Use QueryAdapter APIs as per MS directives

Update ICD loader to use QueryAdapter APIs
as per MS directives for paravirtualization.

Merge branch 'skudchad-ocl-wddm24'
of https://github.com/BKlamik-MSFT/OpenCL-ICD-Loader
13 files changed
tree: 20dd466f45976092472eea2dbe12a9536ebdb857
  1. inc/
  2. loader/
  3. test/
  4. .gitignore
  5. build_using_cmake.bat
  6. CMakeLists.txt
  7. CODE_OF_CONDUCT.md
  8. LICENSE
  9. Makefile
  10. README.md
README.md

Building the OpenCL ICD Loader and Tests

The build system will build ICD Loader library (OpenCL.dll or libOpenCL.so), the ICD Loader Test binary (icd_loader_test), and some helper libraries for the test.

  1. See inc/readme.txt about downloading or symlink the OpenCL headers. Ex: https://github.com/KhronosGroup/OpenCL-Headers

Linux

Run “make”

Windows

  1. Install recent Windows WDK, for access to d3dkmthk.h Currently at https://docs.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk

  2. Establish environment variable WDK to include directory Ex: set WDK=C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0

  3. Modify environment for your compiler. Ex: Command line builds should modify “build_using_cmake.bat” Ex: Visual Studio CMake integration should modify the “buildRoot” to match the BUILD_DIR in “build_using_cmake.bat”

  4. Build either using the command line to run “build_using_cmake.bat” or with Visual Studio CMake integration

Running ICD Test

The ICD Test can be run using ctest, which is a companion to cmake. It can also be run directly by executing icd_loader_test(.exe) executable from the bin folder.

Linux

  1. Add driver stub as an ICD echo full/path/to/libOpenCLDriverStub.so > /etc/OpenCL/vendors/test.icd

  2. Run test using ctest make test

Windows

  1. Add driver stub as an ICD by adding appropriate registry value Key for 32-bit apps: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Khronos\OpenCL\Vendors Key for 64-bit apps: HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\OpenCL\Vendors

    Add a REG_DWORD value: Name: c:/full/path/to/OpenCLDriverStub.dll Data: 0

    Note: The build_using_cmake.bat builds ICD test as a 32-bit binary.

  2. Run test using ctest.exe cd build ctest.exe

Cleanup

Manually remove the registry key or .icd files added for running the ICD test.

The “build” and “bin” folders are autogenerated by the build so those may be safely deleted without losing any source code (on Linux “make clobber” will delete them).