diff --git a/mace/core/runtime/opencl/opencl_runtime.cc b/mace/core/runtime/opencl/opencl_runtime.cc index 6d5f82e105365c5cc38482b8bfe97ea0d0aacf5f..17f1dd5a89bcf4f6aaf507c38a3feae04dd618c5 100644 --- a/mace/core/runtime/opencl/opencl_runtime.cc +++ b/mace/core/runtime/opencl/opencl_runtime.cc @@ -331,7 +331,7 @@ OpenCLRuntime::OpenCLRuntime( cl_int err; if (gpu_type_ == GPUType::QUALCOMM_ADRENO - && opencl_version_ == OpenCLVersion::CL_VER_2_0) { + && opencl_version_ >= OpenCLVersion::CL_VER_2_0) { std::vector context_properties; context_properties.reserve(5); GetAdrenoContextProperties(&context_properties, @@ -769,7 +769,7 @@ uint64_t OpenCLRuntime::GetKernelWaveSize(const cl::Kernel &kernel) { bool OpenCLRuntime::IsNonUniformWorkgroupsSupported() const { return (gpu_type_ == GPUType::QUALCOMM_ADRENO && - opencl_version_ == OpenCLVersion::CL_VER_2_0); + opencl_version_ >= OpenCLVersion::CL_VER_2_0); } GPUType OpenCLRuntime::gpu_type() const { @@ -786,7 +786,9 @@ OpenCLVersion OpenCLRuntime::ParseDeviceVersion( // OpenCL // auto words = Split(device_version, ' '); - if (words[1] == "2.0") { + if (words[1] == "2.1") { + return OpenCLVersion::CL_VER_2_1; + } else if (words[1] == "2.0") { return OpenCLVersion::CL_VER_2_0; } else if (words[1] == "1.2") { return OpenCLVersion::CL_VER_1_2; diff --git a/mace/core/runtime/opencl/opencl_runtime.h b/mace/core/runtime/opencl/opencl_runtime.h index ddc270b5dd6e134890260df1fff4adc3d76195d0..f06f313ad973730d3d43fad739bb2224fd617496 100644 --- a/mace/core/runtime/opencl/opencl_runtime.h +++ b/mace/core/runtime/opencl/opencl_runtime.h @@ -41,11 +41,12 @@ enum GPUType { }; enum OpenCLVersion { + CL_VER_UNKNOWN, CL_VER_1_0, CL_VER_1_1, CL_VER_1_2, CL_VER_2_0, - CL_VER_UNKNOWN, + CL_VER_2_1, };