Skip to content

Commit 55827ff

Browse files
committed
Fixed issue with compatibility for newer opencl hpp headers
1 parent f4db00f commit 55827ff

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/backend/opencl/device_manager.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,9 @@ DeviceManager::DeviceManager()
261261

262262
// Create contexts and queues once the sort is done
263263
for (int i = 0; i < nDevices; i++) {
264-
cl_platform_id device_platform =
264+
// For OpenCL-HPP >= v2023.12.14 type is cl::Platform instead of
265+
// cl_platform_id
266+
cl::Platform device_platform =
265267
devices[i]->getInfo<CL_DEVICE_PLATFORM>();
266268
try {
267269
mContexts.emplace_back(
@@ -272,7 +274,7 @@ DeviceManager::DeviceManager()
272274
mDeviceTypes.push_back(getDeviceTypeEnum(*devices[i]));
273275
mPlatforms.push_back(
274276
std::make_pair<std::unique_ptr<cl::Platform>, afcl_platform>(
275-
make_unique<cl::Platform>(device_platform, true),
277+
make_unique<cl::Platform>(device_platform(), true),
276278
getPlatformEnum(*devices[i])));
277279
mDevices.emplace_back(std::move(devices[i]));
278280

0 commit comments

Comments
 (0)