petrex commented on a change in pull request #4305: Proper Device Attribute 
Query for AMD GPU
URL: https://github.com/apache/incubator-tvm/pull/4305#discussion_r346475845
 
 

 ##########
 File path: src/runtime/rocm/rocm_device_api.cc
 ##########
 @@ -54,35 +52,59 @@ class ROCMDeviceAPI final : public DeviceAPI {
         break;
       }
       case kMaxThreadsPerBlock: {
-        value = 1024;
+        ROCM_CALL(
+            hipDeviceGetAttribute(&value, 
hipDeviceAttributeMaxThreadsPerBlock, ctx.device_id));
         break;
       }
       case kWarpSize: {
-        value = 64;
+        ROCM_CALL(hipDeviceGetAttribute(&value, hipDeviceAttributeWarpSize, 
ctx.device_id));
+        break;
+      }
+      case kMaxSharedMemoryPerBlock: {
+        ROCM_CALL(hipDeviceGetAttribute(&value, 
hipDeviceAttributeMaxSharedMemoryPerBlock,
+                                        ctx.device_id));
         break;
       }
-      case kMaxSharedMemoryPerBlock: return;
       case kComputeVersion: {
 
 Review comment:
   Thanks for the feedback. ComputeVersion and GcnArch are similar concepts but 
they are not exactly the same. We might use ComputeVersion for more precise 
control for future products. I understand the current AMD LLVM backend use 
GcnArch only at this moment, so added a new query for backward compatibility. 
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to