From: Jeff Daily Date: Fri, 10 Sep 2021 16:36:26 +0000 (-0700) Subject: [ROCm] define C10_WARP_SIZE to warpSize HIP constant (#64302) X-Git-Tag: accepted/tizen/8.0/unified/20231005.095509~307 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c7b03e2b832aba58cf42f31e8bf993f16e6317d0;p=platform%2Fupstream%2Fpytorch.git [ROCm] define C10_WARP_SIZE to warpSize HIP constant (#64302) Summary: warpSize is defined as a constexpr in HIP headers. It is incorrect to assume warpSize 64. This change fixes the C10_WARP_SIZE definition in torch sources similar to [how it was done in caffe2](https://github.com/pytorch/pytorch/blob/master/caffe2/utils/GpuDefs.cuh#L10-L14). cc jeffdaily sunway513 jithunnair-amd ROCmSupport Pull Request resolved: https://github.com/pytorch/pytorch/pull/64302 Reviewed By: mrshenli Differential Revision: D30785975 Pulled By: malfet fbshipit-source-id: 68f8333182ad4d02bd0c8d02f1751a50bc5bafa7 --- diff --git a/c10/macros/Macros.h b/c10/macros/Macros.h index 4df7dfc..6bb3b76 100644 --- a/c10/macros/Macros.h +++ b/c10/macros/Macros.h @@ -302,7 +302,7 @@ constexpr uint32_t CUDA_THREADS_PER_BLOCK_FALLBACK = 256; #endif #ifdef __HIP_PLATFORM_HCC__ -#define C10_WARP_SIZE 64 +#define C10_WARP_SIZE warpSize // = 64 or 32 (Defined in hip_runtime.h) #else #define C10_WARP_SIZE 32 #endif