Add more binary kernels.

This commit is contained in:
laurent
2023-06-22 14:07:02 +01:00
parent 97fe1fac85
commit b8f514d9c6
9 changed files with 54 additions and 87 deletions

29
kernels/src/binary.cu Normal file
View File

@ -0,0 +1,29 @@
#include "binary_op_macros.cuh"
#if __CUDA_ARCH__ >= 530
BINARY_OP(__half, badd_f16, x + y)
#endif
BINARY_OP(float, badd_f32, x + y)
BINARY_OP(double, badd_fwd_f64, x + y);
#if __CUDA_ARCH__ >= 530
BINARY_OP(__half, bdiv_f16, x / y)
#endif
BINARY_OP(float, bdiv_f32, x / y)
BINARY_OP(double, bdiv_f64, x / y);
#if __CUDA_ARCH__ >= 530
BINARY_OP(__half, bmul_f16, x * y)
#endif
BINARY_OP(float, bmul_f32, x * y)
BINARY_OP(double, bmul_f64, x * y);
#if __CUDA_ARCH__ >= 530
BINARY_OP(__half, bsub_f16, x - y)
#endif
BINARY_OP(float, bsub_f32, x - y)
BINARY_OP(double, bsub_f64, x - y);