From 829c17903ba020ac9f6f5b41bcd731247fd7e866 Mon Sep 17 00:00:00 2001 From: MORITA Kazutaka Date: Sun, 10 Mar 2019 01:58:44 +0900 Subject: [PATCH] [RUNTIME][OPENCL] set type_key even when platform is not available (#2741) --- src/runtime/opencl/opencl_device_api.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/opencl/opencl_device_api.cc b/src/runtime/opencl/opencl_device_api.cc index 38edcd1967cc..a5ad66b2def4 100644 --- a/src/runtime/opencl/opencl_device_api.cc +++ b/src/runtime/opencl/opencl_device_api.cc @@ -237,6 +237,7 @@ void OpenCLWorkspace::Init(const std::string& type_key, const std::string& devic std::lock_guard lock(this->mu); if (initialized_) return; if (context != nullptr) return; + this->type_key = type_key; // matched platforms std::vector platform_ids = cl::GetPlatformIDs(); if (platform_ids.size() == 0) { @@ -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;