platform/upstream/OpenCL-ICD-Loader.git
2 years agoAdd spec file for Tizen (#1) accepted/tizen_7.0_unified accepted/tizen_7.0_unified_hotfix accepted/tizen_8.0_unified accepted/tizen_unified tizen tizen_7.0 tizen_7.0_hotfix tizen_8.0 accepted/tizen/7.0/unified/20221110.060246 accepted/tizen/7.0/unified/hotfix/20221116.110543 accepted/tizen/8.0/unified/20231005.094600 accepted/tizen/unified/20220315.205456 submit/tizen/20220315.071947 tizen_7.0_m2_release tizen_8.0_m2_release
Xuelian Bai/Visual Experience Platform Lab /SRC-Nanjing/Staff Engineer/Samsung Electronics [Wed, 5 Jan 2022 06:49:48 +0000 (14:49 +0800)]
Add spec file for Tizen (#1)

Change-Id: I68d77d5783d79f7178a4919bd8e9999fec931f95
Signed-off-by: Xuelian Bai <xuelian.bai@samsung.com>
2 years agoFix: stat was done on an incomplete file path. (#161) upstream upstream/v2022.01.04
Brice Videau [Thu, 16 Dec 2021 06:58:26 +0000 (00:58 -0600)]
Fix: stat was done on an incomplete file path. (#161)

2 years agoPedantic (#159)
Brice Videau [Wed, 15 Dec 2021 05:56:46 +0000 (23:56 -0600)]
Pedantic (#159)

* Replace usage of `d_type` of `struct dirent` by `stat()`.

* Remove unsigned comparison warning.

* Remove warning conversion for function pointers.

* Fix missing initializers.

* Remove unused variable warnings.

* Update loader/linux/icd_linux.c

Co-authored-by: Ronan Keryell <ronan@keryell.fr>
Co-authored-by: Ronan Keryell <ronan@keryell.fr>
2 years agoRemove const warning (#158)
Ronan Keryell [Thu, 2 Dec 2021 05:06:13 +0000 (21:06 -0800)]
Remove const warning (#158)

* Remove spurious trailing spaces

* Add missing const on the pointed data

This removes compilation warning:
Building C object _deps/ocl-icd-build/CMakeFiles/OpenCL.dir/loader/linux/icd_linux.c.o
In file included from _deps/ocl-icd-src/loader/icd.h:22,
                 from _deps/ocl-icd-src/loader/linux/icd_linux.c:19:
_deps/ocl-icd-src/loader/linux/icd_linux.c: In function ‘khrIcdOsVendorsEnumerate’:
_deps/ocl-icd-src/loader/icd_platform.h:29:25: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   29 | #define ICD_VENDOR_PATH "/etc/OpenCL/vendors";
      |                         ^~~~~~~~~~~~~~~~~~~~~
_deps/ocl-icd-src/loader/linux/icd_linux.c:43:24: note: in expansion of macro ‘ICD_VENDOR_PATH’
   43 |     char* vendorPath = ICD_VENDOR_PATH;
      |                        ^~~~~~~~~~~~~~~

2 years agodeclare ret_val global variable static (#147)
Ben Ashbaugh [Wed, 30 Jun 2021 20:10:48 +0000 (13:10 -0700)]
declare ret_val global variable static (#147)

It would be better to remove all global ret_val variables, but
this would be a much bigger change.

2 years agoFix compiler warnings (#148)
John Plate [Wed, 30 Jun 2021 20:08:59 +0000 (21:08 +0100)]
Fix compiler warnings (#148)

* Fix compiler warnings

* Define and use printf format macros for DWORD and ULONG.

Co-authored-by: Brice Videau <bvideau@anl.gov>
2 years agoupdate ICD loader generation scripts to handle empty arguments (#150)
Ben Ashbaugh [Mon, 21 Jun 2021 17:52:29 +0000 (10:52 -0700)]
update ICD loader generation scripts to handle empty arguments (#150)

3 years agoChange OCL_ICD_LAYERS to OPENCL_LAYERS to conform to the specification. (#145)
Brice Videau [Tue, 30 Mar 2021 15:48:07 +0000 (10:48 -0500)]
Change OCL_ICD_LAYERS to OPENCL_LAYERS to conform to the specification. (#145)

3 years agodo not add the API suffix macro to function definitions (#124)
Ben Ashbaugh [Fri, 12 Mar 2021 19:04:38 +0000 (11:04 -0800)]
do not add the API suffix macro to function definitions (#124)

3 years agoRemove cl_gl_ext.h includes (#144)
James Price [Fri, 12 Mar 2021 19:03:59 +0000 (14:03 -0500)]
Remove cl_gl_ext.h includes (#144)

All OpenGL extensions are now in cl_gl.h.

3 years agoReplace uses of CL_EXT_{PRE,SUF}FIX* with CL_API_{PRE,SUF}FIX* (#142)
Kévin Petit [Mon, 22 Feb 2021 05:24:55 +0000 (05:24 +0000)]
Replace uses of CL_EXT_{PRE,SUF}FIX* with CL_API_{PRE,SUF}FIX* (#142)

Generation done using https://github.com/KhronosGroup/OpenCL-Docs/pull/569

Signed-off-by: Kévin Petit <kpet@free.fr>
3 years agoRemoved uneeded lines in Cmakelists.txt file. (#141)
Brice Videau [Wed, 17 Feb 2021 15:43:06 +0000 (09:43 -0600)]
Removed uneeded lines in Cmakelists.txt file. (#141)

3 years agoRemoved cl_icd_layer.h as it is now in the OpenCL-Headers repository under CL/cl_laye...
Brice Videau [Sat, 13 Feb 2021 00:04:48 +0000 (18:04 -0600)]
Removed cl_icd_layer.h as it is now in the OpenCL-Headers repository under CL/cl_layer.h. (#140)

3 years agoFixed generators to better account for the lack of return value of clSVMFree. (#139)
Brice Videau [Fri, 5 Feb 2021 17:05:27 +0000 (11:05 -0600)]
Fixed generators to better account for the lack of return value of clSVMFree. (#139)

* Fixed generators to better account for the lack of return value of clSVMFree.

* Added generated file.

3 years agoAdd C99 flag as last commit added some c99 variable declarations (#135)
John Kesapides [Fri, 11 Dec 2020 10:41:18 +0000 (10:41 +0000)]
Add C99 flag as last commit added some c99 variable declarations (#135)

* Add C99 flag as last commit added some c99 variable declarations

Signed-off-by: John Kesapides <john.kesapides@arm.com>
* Add CMAKE_C_STANDARD_REQUIRED

Signed-off-by: John Kesapides <john.kesapides@arm.com>
3 years agoLayers (#125)
Brice Videau [Thu, 10 Dec 2020 06:16:34 +0000 (00:16 -0600)]
Layers (#125)

* remove CMake option for OpenCL 3.0 provisional

* generate the OpenCL 3.0 APIs also

* Added layers.

* Added test print layer.

* Added missing cpp guards to cl_icd_layer.h.

* Rearrange includes in icd_windows.c to ensure DXGI.h has INITGUID defined when it's included

* Fix extern "C" usage in Windows build

* Ensure platforms are initialized before initializing layers.

* Fix faulty merge.

* Fix copy paste errors.

* Added ENABLE_OPENCL_LAYERS option to CMakeLists.

* Activate layers by default and fix bad copy paste...

* Added formal definition of Layer API entry points.

* Better variable name.

* Added a section dedicated to layers in the README.

* Changed value to proposed reserved enum range.

* Bumped version number for windows release.

* Added guard for MacOS.

Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
Co-authored-by: Jesse Natalie <jenatali@microsoft.com>
3 years agoAdd missing includes (#131)
James Price [Fri, 4 Dec 2020 21:31:14 +0000 (16:31 -0500)]
Add missing includes (#131)

* Add missing includes

This is causing problems with recent Xcode version on macOS.

* Enable macOS in GitHub Actions

3 years agoSwitch from Travis CI to Github Actions (#132)
James Price [Fri, 4 Dec 2020 20:59:50 +0000 (15:59 -0500)]
Switch from Travis CI to Github Actions (#132)

3 years agoAdd force fPIC option
TP Boudreau [Mon, 25 May 2020 15:03:30 +0000 (15:03 +0000)]
Add force fPIC option

3 years agoMinor fixes to Windows build to improve header include order resiliency (#126)
Jesse Natalie [Fri, 9 Oct 2020 00:26:00 +0000 (17:26 -0700)]
Minor fixes to Windows build to improve header include order resiliency (#126)

* Rearrange includes in icd_windows.c to ensure DXGI.h has INITGUID defined when it's included

* Fix extern "C" usage in Windows build

3 years agoremove CMake option for OpenCL 3.0 provisional (#121)
Ben Ashbaugh [Tue, 6 Oct 2020 15:56:43 +0000 (08:56 -0700)]
remove CMake option for OpenCL 3.0 provisional (#121)

* remove CMake option for OpenCL 3.0 provisional

* generate the OpenCL 3.0 APIs also

3 years agoRevert "Merge branch 'master' into master"
Ben Ashbaugh [Mon, 28 Sep 2020 15:00:42 +0000 (08:00 -0700)]
Revert "Merge branch 'master' into master"

This reverts commit 97f0eb551154ac28decc89f546eb9f4082948887, reversing
changes made to 98ca71fb9f8484f1cd1999f55224bf9e8d18693b.

3 years agoMerge branch 'master' into master
Nikhil Joshi [Mon, 28 Sep 2020 04:24:46 +0000 (09:54 +0530)]
Merge branch 'master' into master

3 years agoDefine CL_USE_DEPRECATED_OPENCL_2_{1,2}_APIS (#122)
James Price [Tue, 8 Sep 2020 23:05:24 +0000 (19:05 -0400)]
Define CL_USE_DEPRECATED_OPENCL_2_{1,2}_APIS (#122)

3 years agoskip testing except for icd loader project (#117)
Ben Ashbaugh [Tue, 8 Sep 2020 16:53:17 +0000 (09:53 -0700)]
skip testing except for icd loader project (#117)

* skip testing except for icd loader project

* add option for testing when embedding the loader in other projects

3 years agoGenerate the ICD Loader Dispatch Functions (#114)
Ben Ashbaugh [Tue, 8 Sep 2020 16:45:22 +0000 (09:45 -0700)]
Generate the ICD Loader Dispatch Functions (#114)

* initial version of generated ICD dispatch code

* add new OpenCL 3.0 API clSetContextDestructorCallback

* add a README describing how to generate files
increment the file version

* address review comments

3 years agocorrectly pass user_data to destructor callbacks
Ben Ashbaugh [Wed, 29 Jul 2020 21:06:14 +0000 (14:06 -0700)]
correctly pass user_data to destructor callbacks

3 years agoadd clSetContextDestructorCallback
Ben Ashbaugh [Fri, 24 Jul 2020 23:04:53 +0000 (16:04 -0700)]
add clSetContextDestructorCallback

3 years agoUpdate and modernize some aspects of CMake (#92)
Kenneth Benzie [Thu, 25 Jun 2020 14:07:41 +0000 (15:07 +0100)]
Update and modernize some aspects of CMake (#92)

* Update and modernize some aspects of CMake

Ease integration with projects targeting more recent CMake versions:

* Update minimum required CMake version to 3.1.
* Specify a version `1.2` to the `project` CMake command, this silences
  developer warnings when the OpenCL-ICD-Loader is integrated in another
  project using `add_subdirectory`.
* Specify include directory on the `OpenCL` target, this removes the
  need to set the OpenCL-Headers include directory globally (old CMake)
  or set them manually per target which links the `OpenCL` target
  library.

* Update AppVeyor project config

3 years agoruntimeobject.lib should be lower case
Ben Ashbaugh [Fri, 1 May 2020 04:48:27 +0000 (21:48 -0700)]
runtimeobject.lib should be lower case

3 years agoexpand ifdefs to remove include file dependencies
Ben Ashbaugh [Thu, 30 Apr 2020 14:29:14 +0000 (07:29 -0700)]
expand ifdefs to remove include file dependencies

3 years agoadd an option to disable support for OpenCLOn12
Ben Ashbaugh [Thu, 30 Apr 2020 01:21:31 +0000 (18:21 -0700)]
add an option to disable support for OpenCLOn12

setting this option breaks a dependency on the Windows SDK

3 years agoAdd support for OpenCL 3.0 Provisional (#108)
Alastair Murray [Thu, 7 May 2020 22:23:33 +0000 (23:23 +0100)]
Add support for OpenCL 3.0 Provisional (#108)

* Add support for experimental entry points

The new entry points will only be enabled if `CL_EXPERIMENTAL` is manually set.

* Update experimental implementation points to 3.0 provisional

* Use configure_file to selectively include symbols

4 years agoremove WDK dependency for OpenCL ICD loader (#102)
Ben Ashbaugh [Thu, 23 Apr 2020 23:48:29 +0000 (16:48 -0700)]
remove WDK dependency for OpenCL ICD loader (#102)

* remove dependency on Windows WDK for Windows ICD Loader builds

After this change, instead of including a WDK header file, a
private header file is used with just the definitions needed
for the ICD loader.  The header file is copied unchanged from
the Vulkan loader repo.

* update README to remove WDK dependency

* updated file version to v2.2.8

4 years agoAdd support for OpenCLOn12 ICD (#103)
Jesse Natalie [Thu, 16 Apr 2020 22:37:11 +0000 (15:37 -0700)]
Add support for OpenCLOn12 ICD (#103)

* Add search for OpenCLOn12 mapping layer package.

* Use altered search path for ICD loading.

* Update version to 2.2.7

4 years agoAdd a path separator to OCL_ICD_VENDORS
Kenneth Benzie (Benie) [Wed, 9 Oct 2019 16:42:46 +0000 (17:42 +0100)]
Add a path separator to OCL_ICD_VENDORS

When using the `OCL_ICD_VENDORS` environment variable a trailing `/`
path separator must be provided by the user, this is surprising.

This patch updates the `sprintf` call to include a `/` when constructing
the `.icd` file path. It also removes the trailing `/` from instances of
the `ICD_VENDOR_PATH` to canonicalised path strings. Existing scripts
which specify a trailing `/` when setting `OCL_ICD_VENDORS` will
continue working as expected since duplicate path separators `//`, while
not canonical, work as if a single path separator is specified.

4 years agoMake ret_val and ret_mem local to the functions in which they are used.
Dr I J Ormshaw [Fri, 27 Mar 2020 13:26:10 +0000 (13:26 +0000)]
Make ret_val and ret_mem local to the functions in which they are used.

4 years agoCorrected inconsistent indentation
John Alexander [Mon, 17 Feb 2020 10:22:05 +0000 (10:22 +0000)]
Corrected inconsistent indentation

4 years agoIncorporating PR refinement requests so REG_MULTI_SZ is handled in the HKR codepath...
John Alexander [Mon, 10 Feb 2020 18:34:04 +0000 (18:34 +0000)]
Incorporating PR refinement requests so REG_MULTI_SZ is handled in the HKR codepath, adding KHR_ICD_TRACE messages and incrementing the revision version number

4 years agoFix to allow windows ICD detection to detect AMD ICD drivers
John Alexander [Fri, 7 Feb 2020 11:37:57 +0000 (11:37 +0000)]
Fix to allow windows ICD detection to detect AMD ICD drivers

4 years agoUse API function pointer and dispatch table definitions from the CL headers
Kevin Petit [Tue, 2 Jul 2019 15:56:05 +0000 (16:56 +0100)]
Use API function pointer and dispatch table definitions from the CL headers

Depends on https://github.com/KhronosGroup/OpenCL-Headers/pull/50.

Fixes #72.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
4 years agoFix indentation with previous changes
Nikhil Joshi [Tue, 21 Jan 2020 11:05:08 +0000 (16:35 +0530)]
Fix indentation with previous changes

Fix whitespaces in indentation added by
previous commit
0b3756e8ac11fb35e696e13d3cfdbc2e699cb6eb

4 years agoMerge branch 'origin/para-virtual-fixes'
Nikhil Joshi [Fri, 10 Jan 2020 12:58:22 +0000 (18:28 +0530)]
Merge branch 'origin/para-virtual-fixes'

4 years agoUpdate nikhiljnv:master with Khronos:master
Nikhil Joshi [Fri, 10 Jan 2020 10:32:42 +0000 (16:02 +0530)]
Update nikhiljnv:master with Khronos:master

Merge branch 'KhronosGroup-master'

4 years agoRemove link-time dependency on WDK
Nikhil Joshi [Wed, 30 Oct 2019 13:58:52 +0000 (19:28 +0530)]
Remove link-time dependency on WDK

Recent changes for using QueryAdapter and DXGI APIs
for enumerating platforms on Windows added a dependency on
WDK for linking OpenCL driver to Windows specific
libraries.

Querying function address using GetProcAddress for new QueryAdapterInfo
function so that there is no need to link to WDK while
building OpenCL ICD loader.

Also, removing knob OPENCL_ICD_LOADER_REQUIRE_WDK
needed because of link-time dependency on WDK.

Update README to reflect the changes wrt WDK dependency.

While at it -
1. Fix variable names to use camelCase.
2. Use realloc instead of malloc for reallocating memory for adapters.

4 years agoUpdate branch with Khronos GitHub Master branch.
Nikhil Joshi [Thu, 10 Oct 2019 07:19:17 +0000 (12:49 +0530)]
Update branch with Khronos GitHub Master branch.
Merge https://github.com/KhronosGroup/OpenCL-ICD-Loader into new_para_virtual

4 years agoUse QueryAdapter APIs as per MS directives
Nikhil Joshi [Fri, 12 Jul 2019 10:12:54 +0000 (15:42 +0530)]
Use QueryAdapter APIs as per MS directives

Update ICD loader to use QueryAdapter APIs
as per MS directives for para-virtualization.

This includes changes to -
1. Order OpenCL platforms consistent with Windows adapters,
   to honor user-settings for multi-adapter machines.
2. Fix OS version detection.
3. Some minor fixes including
    1. Add trace prints at required places.
    2. Fix build failure in getting the address of D3DKMTQueryAdapterInfo.
    3. Fix early return platform enumeartion if there are no entries found for old reg key
       under "HKLM\\SOFTWARE\\Khronos\\OpenCL\\Vendors" to allow add for the entries found
       using DXGK interface and HKR entries.
4. Some other fixes including
    1. Update README.md with WDK dependency information.
    2. Move AddAdapter* call inside for which got misplaced while resolving conflicts.
    3. Free WinAdapter allocations and avoid overriding NULL platform.
5. Fixes based on review comments including -
    1. WinAdapter is reallocated with previous allocation freed.
       However, the final allocation is not freed.
       Fixed the same to free at the end of enumeration.
    2. Fix header file ordering by including windows headers
       inside necessary header files.

Minor fixes to para-virtualization support

Changes to following aspects of para-virtualization changes -
1. Revert platform[0] override when platform is NULL

Fix variable naming, array size and cleanup paths.

Fix changes added as part of para_virtualization support
1. to use camelCase for variable names
2. Use sizeof(element) while calculating array size.
3. Free/unload allocations/libraries during cleanup.

Add return value checks for adapterAdd.

Return boolean result from adapterAdd API
and add checks for success of this API
for better error reporting.

Free adapter names and add check for DXGI interface queries

Add adapterFree to free memory allocated to hold WinAdapter
handles.
Also, check for successful query of DXGIFactory interfaces.

Minor fixes to cleanup Windows para-virtualization changes

Fix indentation and variable name casing.
Fix adapterFree to remove null-pointer check and set it to null after
free.
Add missing header required for adapterAdd.
Add checks for malloced pointers.

Bump up OpenCL ICD Loader version

Bump up OpenCL ICD Loader version
with para-virtualization changes.

Update status based on DXGK and HKR enumearation

khrIcdOsVendorsEnumerate currently does not consider
the status returned by DXGK and HKR enumeration
and returns TRUE only if HKLM regkey enumeration
results in successful adapterAdd.

Fix the returned status to consider successful
adapterAdd from DXGK and HKR enumeration.

Also, set freed adapger pointers to NULL to avoid
potential double-free issue.

Refactor ICD loader windows header files

Add icd_windows.h to include Windows specific
types and functions.
Keep icd_windows_hkr.h and icd_windows_dxgk.h
limited to the HKR and DXGK specific information.

4 years agoRefactor ICD loader windows header files
Nikhil Joshi [Fri, 4 Oct 2019 00:50:10 +0000 (06:20 +0530)]
Refactor ICD loader windows header files

Add icd_windows.h to include Windows specific
types and functions.
Keep icd_windows_hkr.h and icd_windows_dxgk.h
limited to the HKR and DXGK specific information.

4 years agoUpdate status based on DXGK and HKR enumearation
Nikhil Joshi [Tue, 24 Sep 2019 17:06:12 +0000 (22:36 +0530)]
Update status based on DXGK and HKR enumearation

khrIcdOsVendorsEnumerate currently does not consider
the status returned by DXGK and HKR enumeration
and returns TRUE only if HKLM regkey enumeration
results in successful adapterAdd.

Fix the returned status to consider successful
adapterAdd from DXGK and HKR enumeration.

Also, set freed adapger pointers to NULL to avoid
potential double-free issue.

4 years agoBump up OpenCL ICD Loader version
Nikhil Joshi [Thu, 19 Sep 2019 06:20:32 +0000 (11:50 +0530)]
Bump up OpenCL ICD Loader version

Bump up OpenCL ICD Loader version
with para-virtualization changes.

4 years agoMerge pull request #10 from KhronosGroup/master
Nikhil Joshi [Thu, 19 Sep 2019 06:16:53 +0000 (11:46 +0530)]
Merge pull request #10 from KhronosGroup/master

added checks for high integrity for Windows secure_getenv

4 years agoMinor fixes to cleanup Windows para-virtualization changes
Nikhil Joshi [Wed, 18 Sep 2019 03:32:20 +0000 (09:02 +0530)]
Minor fixes to cleanup Windows para-virtualization changes

Fix indentation and variable name casing.
Fix adapterFree to remove null-pointer check and set it to null after
free.
Add missing header required for adapterAdd.
Add checks for malloced pointers.

4 years agoadded checks for high integrity for Windows secure_getenv
bashbaug [Tue, 27 Aug 2019 18:43:58 +0000 (11:43 -0700)]
added checks for high integrity for Windows secure_getenv

4 years agoFree adapter names and add check for DXGI interface queries
Nikhil Joshi [Tue, 10 Sep 2019 13:59:11 +0000 (19:29 +0530)]
Free adapter names and add check for DXGI interface queries

Add adapterFree to free memory allocated to hold WinAdapter
handles.
Also, check for successful query of DXGIFactory interfaces.

4 years agoAdd return value checks for adapterAdd.
Nikhil Joshi [Tue, 3 Sep 2019 05:11:25 +0000 (10:41 +0530)]
Add return value checks for adapterAdd.

Return boolean result from adapterAdd API
and add checks for success of this API
for better error reporting.

4 years agoFix variable naming, array size and cleanup paths.
Nikhil Joshi [Thu, 22 Aug 2019 08:35:36 +0000 (14:05 +0530)]
Fix variable naming, array size and cleanup paths.

Fix changes added as part of para_virtualization support
1. to use camelCase for variable names
2. Use sizeof(element) while calculating array size.
3. Free/unload allocations/libraries during cleanup.

4 years agoMinor fixes to para-virtualization support
Nikhil Joshi [Mon, 12 Aug 2019 14:33:26 +0000 (20:03 +0530)]
Minor fixes to para-virtualization support

Changes to following aspects of para-virtualization changes -
1. Revert platform[0] override when platform is NULL

4 years agoMerge branch 'KhronosGroup-master' into new_para_virtual
Nikhil Joshi [Fri, 9 Aug 2019 10:22:37 +0000 (15:52 +0530)]
Merge branch 'KhronosGroup-master' into new_para_virtual

4 years agoUpdate nikhiljnv:new_para_virtual with Khronos master
Nikhil Joshi [Fri, 9 Aug 2019 10:14:24 +0000 (15:44 +0530)]
Update nikhiljnv:new_para_virtual with Khronos master

Merge branch 'master' of https://github.com/KhronosGroup/OpenCL-ICD-Loader into KhronosGroup-master

4 years agoInstall to standard locations using GNUInstallDirs
Craig Andrews [Tue, 30 Jul 2019 19:05:27 +0000 (15:05 -0400)]
Install to standard locations using GNUInstallDirs

Different distributions may specify different paths; using GNUInstallDirs ensures that everything installed to the correct location for all systems. For example, amd64 Debian uses lib64 as opposed to lib, so hardcoding lib would be wrong for Debian.

4 years agoUse QueryAdapter APIs as per MS directives
Nikhil Joshi [Fri, 12 Jul 2019 10:12:54 +0000 (15:42 +0530)]
Use QueryAdapter APIs as per MS directives

Update ICD loader to use QueryAdapter APIs
as per MS directives for para-virtualization.

This includes changes to -
1. Order OpenCL platforms consistent with Windows adapters,
   to honor user-settings for multi-adapter machines.
2. Fix OS version detection.
3. Some minor fixes including
    1. Add trace prints at required places.
    2. Fix build failure in getting the address of D3DKMTQueryAdapterInfo.
    3. Fix early return platform enumeartion if there are no entries found for old reg key
       under "HKLM\\SOFTWARE\\Khronos\\OpenCL\\Vendors" to allow add for the entries found
       using DXGK interface and HKR entries.
4. Some other fixes including
    1. Update README.md with WDK dependency information.
    2. Move AddAdapter* call inside for which got misplaced while resolving conflicts.
    3. Free WinAdapter allocations and avoid overriding NULL platform.
5. Fixes based on review comments including -
    1. WinAdapter is reallocated with previous allocation freed.
       However, the final allocation is not freed.
       Fixed the same to free at the end of enumeration.
    2. Fix header file ordering by including windows headers
       inside necessary header files.

4 years agoincrease loader rev for environment variable support
bashbaug [Wed, 17 Jul 2019 15:48:21 +0000 (08:48 -0700)]
increase loader rev for environment variable support

4 years agoneed to include a lower-case windows.h for cross-compilation
bashbaug [Wed, 17 Jul 2019 15:45:04 +0000 (08:45 -0700)]
need to include a lower-case windows.h for cross-compilation

4 years agoinitial ICD loader environment variable support (#77)
Ben Ashbaugh [Tue, 16 Jul 2019 15:09:15 +0000 (08:09 -0700)]
initial ICD loader environment variable support (#77)

* basic ICD loader env var support for OCL_ICD_VENDORS

* added envvars source files

* added OCL_ICD_FILENAMES support

* added README section describing debug environment variables

* refactored platform specific defines into icd_platform.h

* disable tracing

4 years agoMerge pull request #7 from KhronosGroup/master
Nikhil Joshi [Tue, 2 Jul 2019 08:05:13 +0000 (13:35 +0530)]
Merge pull request #7 from KhronosGroup/master

Merge master branch of Khronos

4 years agoWindows 10 RS4 Support for the OpenCL ICD Loader w/ Build Option (#78)
Ben Ashbaugh [Mon, 1 Jul 2019 12:53:41 +0000 (05:53 -0700)]
Windows 10 RS4 Support for the OpenCL ICD Loader w/ Build Option (#78)

* Windows 10 RS4 support for OpenCL ICD as per MS directive

Motivation - MS is adopting DCHU complaince and for For RS4 it will be mandatory for OpenCL to load via registry keys contained only within the HKR section of the registry as writes outside of HKR will not be allowed for the INF. It is also to support ParaV feature of the OS to make it "virtualization-ready".

* Update Copyright year
* Fix vendors enumeration on 32-bit Windows OS
* Update CMake file for detecting necessary includes for the Windows WDK
* Add option to build with or without the WDK (default: with)
* Documented Windows WDK dependency

4 years agoadd CI badges for travis-ci and appveyor
bashbaug [Tue, 11 Jun 2019 20:30:45 +0000 (13:30 -0700)]
add CI badges for travis-ci and appveyor

4 years agobasic appveyor enabling
bashbaug [Tue, 7 May 2019 21:10:10 +0000 (14:10 -0700)]
basic appveyor enabling

4 years agosimple travis CI enabling
bashbaug [Tue, 7 May 2019 21:02:42 +0000 (14:02 -0700)]
simple travis CI enabling

4 years agofix README typos
bashbaug [Tue, 21 May 2019 17:01:36 +0000 (10:01 -0700)]
fix README typos

4 years agoremoved non-CMake build files
bashbaug [Thu, 11 Apr 2019 16:56:36 +0000 (09:56 -0700)]
removed non-CMake build files
updated README with CMake build instructions

4 years agoUse QueryAdapter APIs as per MS directives
Nikhil Joshi [Tue, 21 May 2019 10:28:18 +0000 (15:58 +0530)]
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

4 years agoWindows 10 RS4 support for OpenCL ICD as per MS directive
nikhiljnv [Wed, 8 May 2019 13:06:17 +0000 (18:36 +0530)]
Windows 10 RS4 support for OpenCL ICD as per MS directive

These are set of changes required by MS for Para-Virtualization
support for Windows 10 RS4.
Pull changes in pull request
https://github.com/KhronosGroup/OpenCL-ICD-Loader/pull/33

4 years agoDownstream MinGW fixes
Morris Hafner [Wed, 8 May 2019 12:17:55 +0000 (13:17 +0100)]
Downstream MinGW fixes

* Don't include DX SDK at all on MinGW (MinGW have their own headers)
* Lower case header name for cross-compilation on Linux

5 years agoCreate directory tree, fix warnings, cmake improvements (#58)
Ben Ashbaugh [Tue, 7 May 2019 14:13:17 +0000 (07:13 -0700)]
Create directory tree, fix warnings, cmake improvements (#58)

* fix make test

* include CTest and wrap tests with BUILD_TESTING

* move loader files to their own directory

* create specific directories for Windows and Linux

* cmake improvements

* fix path to map file for linux build

* add definition for CL_TARGET_OPENCL_VERSION

* fix warnings

* don't use target_link_options for cmake compatibility

* remove SHARED from a few cmake files

5 years agoOption to allow for dynamic linking with VC++ Runtime (#60)
Artur Harasimiuk [Tue, 7 May 2019 14:08:28 +0000 (16:08 +0200)]
Option to allow for dynamic linking with VC++ Runtime (#60)

By default ICD loader will use static linking. However, you can specifiy
cmake parameter USE_DYNAMIC_VCXX_RUNTIME to switch to dynamic. For
example:
  cmake -DUSE_DYNAMIC_VCXX_RUNTIME=TRUE ..

Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
5 years agoDo parameter validation in clGetExtensionFunctionAddress
Alastair Murray [Thu, 11 Apr 2019 16:17:06 +0000 (17:17 +0100)]
Do parameter validation in clGetExtensionFunctionAddress

Also undefine the local macros as soon as possible.

Patch originally from Jeroen Ketema.

5 years agoStatically link with VC++ Runtime (#57)
Artur Harasimiuk [Wed, 10 Apr 2019 18:10:53 +0000 (20:10 +0200)]
Statically link with VC++ Runtime (#57)

* Statically link with VC++ Runtime

VC++ Runtime dynamic library may not be available in some cases. Thus,
by doing static linking it makes dll independent of already installed
software and can be used without problems.

Change-Id: I8bb71db2f3dc48bc9ec976cdbb597d2ec812ce54
Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
* Extend static linking of VC++ Runtime

adding MinSizeRel and RelWithDebInfo targets

Change-Id: I740002ca47ad4a65548b9fcad87817f730511c13
Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
5 years agofix compilation with VS2010
Michael Eiler [Wed, 19 Apr 2017 05:42:46 +0000 (07:42 +0200)]
fix compilation with VS2010

5 years agoUpdate icd_windows.c (#51)
cos-public [Sun, 7 Apr 2019 22:38:26 +0000 (05:08 +0630)]
Update icd_windows.c (#51)

Return TRUE from khrIcdOsVendorsEnumerate() even if RegOpenKeyExA() fails to open the key.

5 years agoChange header license to Apache 2.0 (#53)
Khronos Group Webmaster [Sun, 7 Apr 2019 22:29:04 +0000 (18:29 -0400)]
Change header license to Apache 2.0 (#53)

5 years agoswitch README from plain text to markdown
bashbaug [Tue, 26 Mar 2019 15:28:42 +0000 (08:28 -0700)]
switch README from plain text to markdown

no major content updates, just minor wording fixes.

5 years agoCreate LICENSE
Khronos Group Webmaster [Wed, 20 Feb 2019 16:01:17 +0000 (11:01 -0500)]
Create LICENSE

5 years agoDelete LICENSE.txt
Khronos Group Webmaster [Wed, 20 Feb 2019 16:01:00 +0000 (11:01 -0500)]
Delete LICENSE.txt

5 years agoFix bugs encountered while building with VS 2017 64bit (#39)
SilverCamel [Tue, 12 Feb 2019 15:12:08 +0000 (20:42 +0530)]
Fix bugs encountered while building with VS 2017 64bit (#39)

5 years agoUse PROJECT_SOURCE_DIR in CMakefile
Kedar Patil [Sat, 26 Jan 2019 00:41:19 +0000 (06:11 +0530)]
Use PROJECT_SOURCE_DIR in CMakefile

Instead of using CMAKE_CURRENT_SOURCE_DIR. This facilitates using the
ICD loader as a subproject of another project.

5 years agoUpdate .gitignore to ignore build directory (#42)
mancoast [Sat, 26 Jan 2019 00:23:25 +0000 (19:23 -0500)]
Update .gitignore to ignore build directory (#42)

5 years agoAdd option to build static library.
Kedar Patil [Tue, 6 Mar 2018 14:46:41 +0000 (20:16 +0530)]
Add option to build static library.

Also add explanatory comment on why shared library should be preferred.

5 years agoadd extension function comments
bashbaug [Wed, 7 Feb 2018 22:11:13 +0000 (14:11 -0800)]
add extension function comments

As per working group discussion, most extension functions do not need to
be "ICD-aware", and hence do not need to be handled in the ICD loader
and dispatch tables.

5 years agoSupport building on macOS (#40)
Kévin Petit [Tue, 6 Nov 2018 17:29:44 +0000 (17:29 +0000)]
Support building on macOS (#40)

Use the the linux code in that case.

The resulting library hasn't been tested but it is already
useful as is as a library to link against to build-test
things like the CTS on macOS.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
5 years agoCreate CODE_OF_CONDUCT.md
Khronos Group Webmaster [Wed, 10 Oct 2018 19:49:05 +0000 (15:49 -0400)]
Create CODE_OF_CONDUCT.md

6 years agoFix vendors enumeration on 32-bit Windows OS (#28)
Ofir Cohen [Thu, 26 Apr 2018 14:44:05 +0000 (17:44 +0300)]
Fix vendors enumeration on 32-bit Windows OS (#28)

When running 32-bit OpenCL applications on a 32-bit OS, we need to
use the registry keys without the "Wow" suffix. On 64-bit OSes and
32-bit applications, OTOH, we must use the Wow suffix.

6 years agoRemove GL/EGL headers
Lukasz Towarek [Thu, 5 Apr 2018 07:22:03 +0000 (09:22 +0200)]
Remove GL/EGL headers

6 years agodriver stub: Fix dangling & NULL ptr dereference (#27)
Pavel Begunkov [Tue, 20 Feb 2018 14:30:35 +0000 (17:30 +0300)]
driver stub: Fix dangling & NULL ptr dereference (#27)

1. NULL pointer dereference
2. dangling pointer dereference
3. Memory leak (newly created device isn't returned to user)
4. Ignoring errors + invalid error logging

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
6 years agoStatic analysis fixes.
Grzegorz Wawiorko [Thu, 10 Aug 2017 13:07:04 +0000 (15:07 +0200)]
Static analysis fixes.

6 years agoAdded OpenCL Universal Driver Support for Win10 RS3 (#21)
Ofir Cohen [Tue, 3 Oct 2017 14:37:14 +0000 (17:37 +0300)]
Added OpenCL Universal Driver Support for Win10 RS3 (#21)

Starting from Windows 10 RS3+ Graphics Drivers are no longer allowed to
write HKLM entries, and hence the current registry key:
HKLM\SOFTWARE\Khronos\OpenCL\Vendors

Is no longer applicable to graphics drivers for registering their ICD.
Instead, graphics drivers can write to either of the 2 registry keys
below:
1) Display Adapter HKR
2) Software Components HKR

Graphics Drivers (starting from RS3) have dedicated component INF files and are
referenced via the CopyINF directive and/or (optional) "INF AddComponent directive".

Every such component, e.g. OpenCL instance (ICD), is assigned a unique device
instance ID (e.g. 0000, 0001, etc) under the "Software Component" GUID and use it to
store the path to its ICD.

Therefore we enumerate ICDs in the following places (and also in the following order):
1) Display Adapters HKRs (using the display adapter GUID)
2) Software Component HKRs (using the CM_* APIs to traverse the device tree)
3) The usual "Vendors" registry key (see above)

Corresponding ICD extension updates were made with KhronosGroup/OpenCL-Registry#30.

6 years agoAllow building ICD loader as a CMake subproject.
Laurent Morichetti [Thu, 18 May 2017 17:05:46 +0000 (10:05 -0700)]
Allow building ICD loader as a CMake subproject.

Tweaked CMakeLists.txt to make it possible to build OpenCL-ICD-Loader as a
subproject.

6 years agoUpdate Windows DLL version to 2.2 (#19)
John Poole [Tue, 6 Jun 2017 12:58:16 +0000 (08:58 -0400)]
Update Windows DLL version to 2.2 (#19)

6 years agoAdd OpenCL 2.2 API to ICD Loader.
bashbaug [Tue, 6 Dec 2016 18:34:24 +0000 (10:34 -0800)]
Add OpenCL 2.2 API to ICD Loader.

7 years agocorrect the case that properties is NULL for clCreateContextFromType (#8)
guoyejun [Tue, 13 Sep 2016 14:52:48 +0000 (22:52 +0800)]
correct the case that properties is NULL for clCreateContextFromType (#8)

Handle properties==NULL in clCreateContextFromType

According to spec, for function clCreateContextFromType, properties can also be
NULL in which case the platform that is selected is implementation-defined,
while the current code returns CL_INVALID_PLATFORM.