Skip to content

Commit

Permalink
Update dfdx-core/src/tensor_ops/utilities/compatibility.cuh
Browse files Browse the repository at this point in the history
  • Loading branch information
coreylowman authored Dec 2, 2023
1 parent 27c217c commit c29709b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dfdx-core/src/tensor_ops/utilities/compatibility.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ __device__ __forceinline__ double atomicMinf(double * addr, double value) {

#if __CUDA_ARCH__ < 530
//On older GPU there are no hcos/hsin/hlog/hexp.
__device__ __forceinline__ __half hcos(__half a) { return cosf(a); }
__device__ __forceinline__ __half hsin(__half a) { return sinf(a); }
__device__ __forceinline__ __half hlog(__half a) { return logf(a); }
__device__ __forceinline__ __half hexp(__half a) { return expf(a); }
__device__ __forceinline__ __half hcos(__half a) { return __float2half(cosf(__half2float(a))); }
__device__ __forceinline__ __half hsin(__half a) { return __float2half(sinf(__half2float(a))); }
__device__ __forceinline__ __half hlog(__half a) { return __float2half(logf(__half2float(a))); }
__device__ __forceinline__ __half hexp(__half a) { return __float2half(expf(__half2float(a))); }
#endif

0 comments on commit c29709b

Please sign in to comment.