File tree 1 file changed +15
-0
lines changed
fbgemm_gpu/include/fbgemm_gpu/utils
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 9
9
#pragma once
10
10
11
11
#include < ATen/ATen.h>
12
+
12
13
#include < cuda.h>
14
+
15
+ #ifdef __HIP_PLATFORM_AMD__
16
+ #include < ATen/cuda/CUDAGeneratorImpl.h>
17
+ #include < ATen/cuda/detail/UnpackRaw.cuh> // For at::cuda::philox::unpack
18
+
19
+ #include < ATen/hip/impl/HIPGuardImplMasqueradingAsCUDA.h> // @manual
20
+ #else
13
21
#include < ATen/cuda/CUDAGraphsUtils.cuh>
22
+ #endif
14
23
#include < cassert>
15
24
16
25
namespace {
17
26
18
27
inline int get_device_sm_cnt_ () {
28
+ #ifdef __HIP_PLATFORM_AMD__
29
+ hipDeviceProp_t deviceProp;
30
+ hipGetDeviceProperties (&deviceProp, c10::hip::current_device ());
31
+ return deviceProp.multiProcessorCount ;
32
+ #else
19
33
cudaDeviceProp* deviceProp =
20
34
at::cuda::getDeviceProperties (c10::cuda::current_device ());
21
35
return deviceProp->multiProcessorCount ;
36
+ #endif
22
37
}
23
38
24
39
} // namespace
You can’t perform that action at this time.
0 commit comments