Add a couple cuda kernels from dfdx.

This commit is contained in:
laurent
2023-06-22 12:56:29 +01:00
parent 625e08d6ab
commit 4b1c3405e9
9 changed files with 501 additions and 0 deletions

21
kernels/src/binary_mul.cu Normal file
View File

@ -0,0 +1,21 @@
#include "binary_op_macros.cuh"
struct BinaryMulKernalOp {};
#if __CUDA_ARCH__ >= 530
BINARY_OP(__half, bmul_fwd_f16, bmul_bwd_lhs_f16, bmul_bwd_rhs_f16, BinaryMulKernalOp,
x * y,
y,
x)
#endif
BINARY_OP(float, bmul_fwd_f32, bmul_bwd_lhs_f32, bmul_bwd_rhs_f32, BinaryMulKernalOp,
x * y,
y,
x)
BINARY_OP(double, bmul_fwd_f64, bmul_bwd_lhs_f64, bmul_bwd_rhs_f64, BinaryMulKernalOp,
x * y,
y,
x)