Skip to content

Commit

Permalink
[RUNTIME][OPENCL] set type_key even when platform is not available (a…
Browse files Browse the repository at this point in the history
  • Loading branch information
kazum authored and wweic committed Mar 12, 2019
1 parent 534818c commit 829c179
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/runtime/opencl/opencl_device_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ void OpenCLWorkspace::Init(const std::string& type_key, const std::string& devic
std::lock_guard<std::mutex> lock(this->mu);
if (initialized_) return;
if (context != nullptr) return;
this->type_key = type_key;
// matched platforms
std::vector<cl_platform_id> platform_ids = cl::GetPlatformIDs();
if (platform_ids.size() == 0) {
Expand All @@ -254,7 +255,6 @@ void OpenCLWorkspace::Init(const std::string& type_key, const std::string& devic
devices_matched = cl::GetDeviceIDs(platform_id, "cpu");
}
if (devices_matched.size() > 0) {
this->type_key = type_key;
this->platform_id = platform_id;
this->platform_name = cl::GetPlatformInfo(platform_id, CL_PLATFORM_NAME);
this->device_type = device_type;
Expand Down

0 comments on commit 829c179

Please sign in to comment.