Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions aten/src/THC/THCTensorTopK.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ struct TopKTypeConfig<at::Half> {
typedef uint32_t RadixType;

static inline __device__ RadixType convert(at::Half v) {
#if CUDA_VERSION >= 8000
#if CUDA_VERSION >= 8000 || defined __HIP_PLATFORM_HCC__
RadixType x = __half_as_ushort(v);
RadixType mask = -((x >> 15)) | 0x8000;
return (x ^ mask);
Expand All @@ -128,7 +128,7 @@ struct TopKTypeConfig<at::Half> {
}

static inline __device__ at::Half deconvert(RadixType v) {
#if CUDA_VERSION >= 8000
#if CUDA_VERSION >= 8000 || defined __HIP_PLATFORM_HCC__
RadixType mask = ((v >> 15) - 1) | 0x8000;
return __ushort_as_half(v ^ mask);
#else
Expand Down