Skip to content

Commit 39a4de7

Browse files
committed
Merge branch 'main' into cl_khr_unified_svm
2 parents e3e943c + 6b5735e commit 39a4de7

File tree

147 files changed

+681
-244
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+681
-244
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
check:
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
21+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2222

2323
- name: Check Tabs
2424
run: |
@@ -39,7 +39,7 @@ jobs:
3939
runs-on: ${{matrix.os}}
4040

4141
steps:
42-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
42+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4343

4444
- name: Get Ubuntu OpenGL Dependencies
4545
if: matrix.os == 'ubuntu-latest'
@@ -48,29 +48,29 @@ jobs:
4848
sudo apt-get install -y libglfw3-dev
4949
5050
- name: Get OpenCL Headers
51-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
51+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5252
with:
5353
repository: KhronosGroup/OpenCL-Headers
5454
ref: cl_khr_unified_svm
5555
path: external/OpenCL-Headers
5656

5757
- name: Get OpenCL ICD Loader
58-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
58+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5959
with:
6060
repository: KhronosGroup/OpenCL-ICD-Loader
6161
path: external/opencl-icd-loader
6262

6363
- name: Get OpenCL Extension Loader
6464
if: matrix.ext == 'YES'
65-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
65+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
6666
with:
6767
repository: bashbaug/opencl-extension-loader
6868
ref: cl_khr_unified_svm
6969
path: external/opencl-extension-loader
7070

7171
- name: Get SPIR-V Headers
7272
if: matrix.ext == 'YES'
73-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
73+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
7474
with:
7575
repository: KhronosGroup/SPIRV-Headers
7676
path: external/SPIRV-Headers

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2019-2025 Ben Ashbaugh
1+
# Copyright (c) 2019-2026 Ben Ashbaugh
22
#
33
# SPDX-License-Identifier: MIT
44

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019-2025 Ben Ashbaugh
3+
Copyright (c) 2019-2026 Ben Ashbaugh
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Many samples that use extensions additionally require the OpenCL Extension Loade
3939

4040
git clone https://github.com/bashbaug/opencl-extension-loader external/opencl-extension-loader
4141

42-
Several samples that interact with SPIR-V require the SPIR-V headres:
42+
Several samples that interact with SPIR-V require the SPIR-V headers:
4343

4444
git clone https://github.com/KhronosGroup/SPIRV-Headers external/SPIRV-Headers
4545

@@ -97,4 +97,4 @@ parsing, which is licensed under the MIT License.
9797
---
9898
OpenCL and the OpenCL logo are trademarks of Apple Inc. used by permission by Khronos.
9999

100-
\* Other names and brands may be claimed as the property of others.
100+
\* Other names and brands may be claimed as the property of others.

include/getenv_util.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
// Copyright (c) 2022-2025 Ben Ashbaugh
2+
// Copyright (c) 2022-2026 Ben Ashbaugh
33
//
44
// SPDX-License-Identifier: MIT
55
*/

include/layer_util.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
// Copyright (c) 2022-2025 Ben Ashbaugh
2+
// Copyright (c) 2022-2026 Ben Ashbaugh
33
//
44
// SPDX-License-Identifier: MIT
55
*/

include/util.hpp

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
// Copyright (c) 2021-2025 Ben Ashbaugh
2+
// Copyright (c) 2021-2026 Ben Ashbaugh
33
//
44
// SPDX-License-Identifier: MIT
55
*/
@@ -67,3 +67,20 @@ static bool checkDeviceForExtension(
6767

6868
return supported;
6969
}
70+
71+
static bool checkPlatformIndex(
72+
const std::vector<cl::Platform>& platforms,
73+
int platformIndex)
74+
{
75+
if (platforms.size() == 0) {
76+
fprintf(stderr, "Error: No OpenCL platforms found.\n");
77+
return false;
78+
}
79+
if (platformIndex >= (int)platforms.size()) {
80+
fprintf(stderr, "Error: Invalid platform index %d specified (max %d)\n",
81+
platformIndex,
82+
(int)(platforms.size() - 1) );
83+
return false;
84+
}
85+
return true;
86+
}

layers/00_example/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2022-2025 Ben Ashbaugh
1+
# Copyright (c) 2022-2026 Ben Ashbaugh
22
#
33
# SPDX-License-Identifier: MIT
44

layers/00_example/main.cpp

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
// Copyright (c) 2022-2025 Ben Ashbaugh
2+
// Copyright (c) 2022-2026 Ben Ashbaugh
33
//
44
// SPDX-License-Identifier: MIT
55
*/
@@ -97,16 +97,17 @@ CL_API_ENTRY cl_int CL_API_CALL clGetLayerInfo(
9797
return CL_SUCCESS;
9898
}
9999

100-
CL_API_ENTRY cl_int CL_API_CALL clInitLayer(
100+
CL_API_ENTRY cl_int CL_API_CALL clInitLayerWithProperties(
101101
cl_uint num_entries,
102102
const struct _cl_icd_dispatch* target_dispatch,
103103
cl_uint* num_entries_out,
104-
const struct _cl_icd_dispatch** layer_dispatch_ret)
104+
const struct _cl_icd_dispatch** layer_dispatch_ret,
105+
const cl_layer_properties* properties)
105106
{
106107
const size_t dispatchTableSize =
107108
sizeof(dispatch) / sizeof(dispatch.clGetPlatformIDs);
108109

109-
if (target_dispatch == nullptr ||
110+
if (target_dispatch == nullptr ||
110111
num_entries_out == nullptr ||
111112
layer_dispatch_ret == nullptr) {
112113
return CL_INVALID_VALUE;
@@ -126,3 +127,16 @@ CL_API_ENTRY cl_int CL_API_CALL clInitLayer(
126127
return CL_SUCCESS;
127128
}
128129

130+
CL_API_ENTRY cl_int CL_API_CALL clInitLayer(
131+
cl_uint num_entries,
132+
const struct _cl_icd_dispatch* target_dispatch,
133+
cl_uint* num_entries_out,
134+
const struct _cl_icd_dispatch** layer_dispatch_ret)
135+
{
136+
return clInitLayerWithProperties(
137+
num_entries,
138+
target_dispatch,
139+
num_entries_out,
140+
layer_dispatch_ret,
141+
nullptr);
142+
}

layers/10_cmdbufemu/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2022-2025 Ben Ashbaugh
1+
# Copyright (c) 2022-2026 Ben Ashbaugh
22
#
33
# SPDX-License-Identifier: MIT
44

0 commit comments

Comments
 (0)