Add cuda support for unary ops.

This commit is contained in:
laurent
2023-06-22 15:12:59 +01:00
parent b8f514d9c6
commit 5276755fb3
7 changed files with 101 additions and 23 deletions

View File

@ -2,28 +2,16 @@
#if __CUDA_ARCH__ >= 530
BINARY_OP(__half, badd_f16, x + y)
BINARY_OP(__half, bdiv_f16, x / y)
BINARY_OP(__half, bmul_f16, x * y)
BINARY_OP(__half, bsub_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);