mirror of
https://github.com/open-mmlab/mmcv.git
synced 2025-06-03 21:54:52 +08:00
[Fix] Fix compiled error on windows (#1510)
This commit is contained in:
parent
71341e9a0a
commit
9cad97bcf8
@ -37,8 +37,13 @@ __device__ __forceinline__ static void reduceMax(double *address, double val) {
|
||||
#ifdef __CUDA_ARCH__
|
||||
__device__ __forceinline__ static void reduceAdd(float *address, float val) {
|
||||
#if (__CUDA_ARCH__ < 200)
|
||||
#ifdef _MSC_VER
|
||||
#pragma message( \
|
||||
"compute capability lower than 2.x. fall back to use CAS version of atomicAdd for float32")
|
||||
#else
|
||||
#warning \
|
||||
"compute capability lower than 2.x. fall back to use CAS version of atomicAdd for float32"
|
||||
#endif
|
||||
int *address_as_i = reinterpret_cast<int *>(address);
|
||||
int old = *address_as_i, assumed;
|
||||
do {
|
||||
@ -53,8 +58,13 @@ __device__ __forceinline__ static void reduceAdd(float *address, float val) {
|
||||
|
||||
__device__ __forceinline__ static void reduceAdd(double *address, double val) {
|
||||
#if (__CUDA_ARCH__ < 600)
|
||||
#ifdef _MSC_VER
|
||||
#pragma message( \
|
||||
"compute capability lower than 6.x. fall back to use CAS version of atomicAdd for float64")
|
||||
#else
|
||||
#warning \
|
||||
"compute capability lower than 6.x. fall back to use CAS version of atomicAdd for float64"
|
||||
#endif
|
||||
unsigned long long *address_as_ull =
|
||||
reinterpret_cast<unsigned long long *>(address);
|
||||
unsigned long long old = *address_as_ull, assumed;
|
||||
|
Loading…
x
Reference in New Issue
Block a user