Skip to content

Commit f11ab3c

Browse files
Update ggml/src/ggml-cuda/unary.cu
Co-authored-by: Johannes Gäßler <[email protected]>
1 parent 6c843ce commit f11ab3c

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

ggml/src/ggml-cuda/unary.cu

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -385,15 +385,7 @@ static __global__ void xielu_kernel(const T * x, T * dst, const int k, float alp
385385
return;
386386
}
387387

388-
float xi;
389-
#if __CUDA_ARCH__ >= 530
390-
if constexpr (std::is_same<T, half>::value) {
391-
xi = __half2float(x[i]);
392-
} else
393-
#endif
394-
{
395-
xi = (float)x[i];
396-
}
388+
const float xi = ggml_cuda_cast<float>(x[i]);
397389

398390
const float gate_pos = (xi > 0.0f);
399391
const float y_pos = alpha_p * xi * xi + beta * xi;

0 commit comments

Comments
 (0)