Skip to content

Commit

Permalink
Patching THCAtomics.cuh as shown here torch#834
Browse files Browse the repository at this point in the history
  • Loading branch information
dmikushin committed Oct 22, 2019
1 parent 5e9d86c commit 27e14ca
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/THC/THCAtomics.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ static inline __device__ void atomicAdd(long *address, long val) {
}

#ifdef CUDA_HALF_TENSOR
#if !(__CUDA_ARCH__ >= 700 || !defined(__CUDA_ARCH__) )
static inline __device__ void atomicAdd(half *address, half val) {
unsigned int * address_as_ui =
(unsigned int *) ((char *)address - ((size_t)address & 2));
Expand All @@ -117,6 +118,7 @@ static inline __device__ void atomicAdd(half *address, half val) {
} while (assumed != old);
}
#endif
#endif

#if defined(__CUDA_ARCH__) && (__CUDA_ARCH__ < 600 || CUDA_VERSION < 8000)
// from CUDA C Programmic Guide
Expand Down

0 comments on commit 27e14ca

Please sign in to comment.