Skip to content

Commit

Permalink
Update moe_kernel.cu
Browse files Browse the repository at this point in the history
wangyems authored Mar 25, 2024
1 parent d30c81d commit a895984
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions onnxruntime/contrib_ops/cuda/moe/ft_moe/moe_kernel.cu
Original file line number Diff line number Diff line change
@@ -656,7 +656,8 @@ inline __device__ float4 operator*(const float4 a, const float4 b) {
return make_float4(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w);
}

#if defined(__CUDA_ARCH__) && __CUDA_ARCH__ < 530
#if defined(__CUDA_ARCH__) && __CUDA_ARCH__ < 530 && \
((__CUDACC_VER_MAJOR__ < 12) || ((__CUDACC_VER_MAJOR__ == 12) && (__CUDACC_VER_MINOR__ < 2)))
inline __device__ half operator*(const half a, const half b) {
return __float2half(__half2float(a) * __half2float(b));
}
@@ -667,7 +668,8 @@ inline __device__ half2 operator*(const half2 a, const half2 b) {
#endif

inline __device__ Half4 operator*(const Half4 a, const Half4 b) {
#if defined(__CUDA_ARCH__) && __CUDA_ARCH__ < 530
#if defined(__CUDA_ARCH__) && __CUDA_ARCH__ < 530 && \
((__CUDACC_VER_MAJOR__ < 12) || ((__CUDACC_VER_MAJOR__ == 12) && (__CUDACC_VER_MINOR__ < 2)))
Half4 result;
result.x = a.x * b.x;
result.y = a.y * b.y;

0 comments on commit a895984

Please sign in to comment.