The OpenCL-on-D3D12 mapping layer
Перейти к файлу
Jesse Natalie c349d539a7 Update Mesa clc header 2024-08-29 13:45:30 -07:00
.github/workflows
external Import D3D12TranslationLayer fork 2024-03-26 09:37:48 -07:00
include/d3d12translationlayer Enable PSO cached blob usage 2024-03-26 09:51:37 -07:00
src Update Mesa clc header 2024-08-29 13:45:30 -07:00
test Handle null SRV kernel args 2024-04-04 16:45:55 -07:00
CMakeLists.txt Warning fixes 2024-03-26 09:52:09 -07:00
CONTRIBUTING.md
LICENSE
README.md
SECURITY.md
SUPPORT.MD

README.md

OpenCLOn12

OpenCLOn12 is a mapping layer, which implements the OpenCL 1.2 API on top of D3D12. It also implements the OpenCL ICD extension, and can therefore be loaded by the existing ICD loader.

This repository contains the implementations of the APIs. It depends on various other repositories for further functionality, either implicitly or explicitly:

  • WIL is used occasionally throughout.
  • The OpenCL headers are referenced.
  • GoogleTest is used for unit testing.
  • The D3D12TranslationLayer handles some of the complexity of using D3D12 for us.
  • The compiler infrastructure for consuming OpenCL C and SPIR-V and converting to DXIL comes from the Mesa project. This dependency is only required at runtime, as a copy of the compiler interface header is contained in this repo. The compiler interface in the master branch of this repository tracks master of Mesa.
    • The compiler was originally developed downstream from master, and the downstream-abi branch of this repository is intended to interface with that downstream interface.

Additionally, DXIL.dll from the Windows SDK will be required at runtime to sign and validate the DXIL shaders produced by the compiler.

For more details about OpenCLOn12, see:

Make sure that you visit the DirectX Landing Page for more resources for DirectX developers.

Current Status

At this point, the OpenCL 1.2 API is fully implemented, with no optional extensions. It has not yet been certified conformant, though it passes every conformance test for OpenCL 1.2, but has not yet passed all tests on a single underlying implementation.

Building

The D3D12TranslationLayer project will be fetched from GitHub when building with CMake if D3D12TranslationLayer isn't already declared as a FetchContent source, such as by a parent CMakeLists.txt. Assuming there was a top level CMakeLists.txt in a directory that included both OpenCLOn12 and D3D12TranslationLayer, you could achieve that like this:

cmake_minimum_required(VERSION 3.14)
include(FetchContent)

FetchContent_Declare(
    d3d12translationlayer
    SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/D3D12TranslationLayer
)
FetchContent_MakeAvailable(d3d12translationlayer)

add_subdirectory(OpenCLOn12)

At the time of publishing, OpenCLOn12 and the D3D12TranslationLayer require the latest released version of the SDK (19041).

OpenCLOn12 requires C++17, and only supports building with MSVC at the moment.

Data Collection

The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft's privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.

Note however that no data collection is performed when using your private builds.