Skip to content

Commit 9cf1b62

Browse files
kazumtqchen
authored andcommitted
[RUNTIME][OPENCL] set type_key even when platform is not available (#2741)
1 parent 21e8dfa commit 9cf1b62

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/runtime/opencl/opencl_device_api.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ void OpenCLWorkspace::Init(const std::string& type_key, const std::string& devic
237237
std::lock_guard<std::mutex> lock(this->mu);
238238
if (initialized_) return;
239239
if (context != nullptr) return;
240+
this->type_key = type_key;
240241
// matched platforms
241242
std::vector<cl_platform_id> platform_ids = cl::GetPlatformIDs();
242243
if (platform_ids.size() == 0) {
@@ -254,7 +255,6 @@ void OpenCLWorkspace::Init(const std::string& type_key, const std::string& devic
254255
devices_matched = cl::GetDeviceIDs(platform_id, "cpu");
255256
}
256257
if (devices_matched.size() > 0) {
257-
this->type_key = type_key;
258258
this->platform_id = platform_id;
259259
this->platform_name = cl::GetPlatformInfo(platform_id, CL_PLATFORM_NAME);
260260
this->device_type = device_type;

0 commit comments

Comments
 (0)