masahi commented on a change in pull request #10108:
URL: https://github.com/apache/tvm/pull/10108#discussion_r796004632



##########
File path: src/runtime/opencl/opencl_device_api.cc
##########
@@ -122,7 +123,8 @@ void OpenCLWorkspace::GetAttr(Device dev, DeviceAttrKind 
kind, TVMRetValue* rv)
                corresponding to the number of SIMD entries the heardware 
configures.
                We need to figure out a way to query this information from the 
hardware.
       */
-      *rv = 1;
+      const int warp_size = dmlc::GetEnv("TVM_OPENCL_WARP_SIZE", 1);

Review comment:
       Our vulkan backend has a better solution, that uses a Vulkan API 
function to query the warp size on a given HW. However, I didn't find such API 
in OpenCL, for some reason. `clGetKernelSubGroupInfoKHR` described in 
https://github.com/KhronosGroup/OpenCL-Docs/blob/master/ext/cl_khr_subgroups.asciidoc
 looks closest, but it requires a compiled kernel as an argument, which I find 
strange since we want warp size information to write or generate a kernel.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to