Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
Fix half conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
zasdfgbnm authored and alliepiper committed Oct 27, 2021
1 parent ef752cb commit 143259c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cub/agent/agent_sub_warp_merge_sort.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,15 @@ class AgentSubWarpSort
#if defined(__CUDA_FP16_TYPES_EXIST__) && (CUB_PTX_ARCH < 530)
__device__ bool operator()(__half lhs, __half rhs)
{
return (*this)(static_cast<float>(lhs), static_cast<float>(rhs));
return (*this)(__half2float(lhs), __half2float(rhs));
}
#endif
};

#if defined(__CUDA_FP16_TYPES_EXIST__) && (CUB_PTX_ARCH < 530)
__device__ static bool equal(__half lhs, __half rhs)
{
return static_cast<float>(lhs) == static_cast<float>(rhs);
return __half2float(lhs) == __half2float(rhs);
}
#endif

Expand Down

0 comments on commit 143259c

Please sign in to comment.