mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[ROCm] Fix SymmetricMemory build error on NAVI arch (#152838)
NAVI arch doesn't support `__builtin_amdgcn_s_memtime()`, using `clock64()` instead which works for both NAVI and MI archs. Fixes #ISSUE_NUMBER Pull Request resolved: https://github.com/pytorch/pytorch/pull/152838 Approved by: https://github.com/jeffdaily
This commit is contained in:
committed by
PyTorch MergeBot
parent
8faa0b18c3
commit
ed63cb20ec
@ -60,7 +60,7 @@ __device__ __forceinline__ void trap() {
|
|||||||
__device__ __forceinline__ size_t global_timer_ns() {
|
__device__ __forceinline__ size_t global_timer_ns() {
|
||||||
#if defined(USE_ROCM)
|
#if defined(USE_ROCM)
|
||||||
static constexpr double MI300_FREQ_GHZ = 2.1;
|
static constexpr double MI300_FREQ_GHZ = 2.1;
|
||||||
return __builtin_amdgcn_s_memtime() / MI300_FREQ_GHZ;
|
return clock64() / MI300_FREQ_GHZ;
|
||||||
#else
|
#else
|
||||||
size_t val;
|
size_t val;
|
||||||
asm volatile("mov.u64 %0, %globaltimer;" : "=l"(val) : : "memory");
|
asm volatile("mov.u64 %0, %globaltimer;" : "=l"(val) : : "memory");
|
||||||
|
Reference in New Issue
Block a user