Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/backend/opencl/device_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,11 @@ DeviceManager::DeviceManager()

// Create contexts and queues once the sort is done
for (int i = 0; i < nDevices; i++) {
cl_platform_id device_platform =
devices[i]->getInfo<CL_DEVICE_PLATFORM>();
// For OpenCL-HPP >= v2023.12.14 type is cl::Platform instead of
// cl_platform_id
cl::Platform device_platform;
device_platform = devices[i]->getInfo<CL_DEVICE_PLATFORM>();

try {
mContexts.emplace_back(
make_unique<cl::Context>(mDeviceContextMap[*devices[i]]));
Expand All @@ -272,7 +275,7 @@ DeviceManager::DeviceManager()
mDeviceTypes.push_back(getDeviceTypeEnum(*devices[i]));
mPlatforms.push_back(
std::make_pair<std::unique_ptr<cl::Platform>, afcl_platform>(
make_unique<cl::Platform>(device_platform, true),
make_unique<cl::Platform>(device_platform(), true),
getPlatformEnum(*devices[i])));
mDevices.emplace_back(std::move(devices[i]));

Expand Down
13 changes: 10 additions & 3 deletions src/backend/opencl/platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,11 @@ const std::string& getActiveDeviceBaseBuildFlags() {
}

vector<Version> getOpenCLCDeviceVersion(const Device& device) {
Platform device_platform(device.getInfo<CL_DEVICE_PLATFORM>(), false);
// For OpenCL-HPP >= v2023.12.14 type is cl::Platform instead of
// cl_platform_id
Platform device_platform;
device_platform = device.getInfo<CL_DEVICE_PLATFORM>();

auto platform_version = device_platform.getInfo<CL_PLATFORM_VERSION>();
vector<Version> out;

Expand Down Expand Up @@ -540,10 +544,13 @@ void addDeviceContext(cl_device_id dev, cl_context ctx, cl_command_queue que) {
devMngr.mDeviceTypes.push_back(
static_cast<int>(tDevice.getInfo<CL_DEVICE_TYPE>()));

auto device_platform = tDevice.getInfo<CL_DEVICE_PLATFORM>();
// For OpenCL-HPP >= v2023.12.14 type is cl::Platform instead of
// cl_platform_id
cl::Platform device_platform;
device_platform = tDevice.getInfo<CL_DEVICE_PLATFORM>();
devMngr.mPlatforms.push_back(
std::make_pair<std::unique_ptr<cl::Platform>, afcl_platform>(
make_unique<cl::Platform>(device_platform, true),
make_unique<cl::Platform>(device_platform(), true),
getPlatformEnum(tDevice)));

devMngr.mDevices.emplace_back(make_unique<cl::Device>(move(tDevice)));
Expand Down