mirror of
https://github.com/huggingface/candle.git
synced 2025-06-19 19:58:35 +00:00
Refactor the hierarchy.
This commit is contained in:
22
candle-kernels/src/binary.cu
Normal file
22
candle-kernels/src/binary.cu
Normal file
@ -0,0 +1,22 @@
|
||||
#include "binary_op_macros.cuh"
|
||||
#include<stdint.h>
|
||||
|
||||
#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_f64, x + y);
|
||||
BINARY_OP(uint32_t, badd_u32, x + y);
|
||||
BINARY_OP(float, bdiv_f32, x / y)
|
||||
BINARY_OP(double, bdiv_f64, x / y);
|
||||
BINARY_OP(uint32_t, bdiv_u32, x / y);
|
||||
BINARY_OP(float, bmul_f32, x * y)
|
||||
BINARY_OP(double, bmul_f64, x * y);
|
||||
BINARY_OP(uint32_t, bmul_u32, x * y);
|
||||
BINARY_OP(float, bsub_f32, x - y)
|
||||
BINARY_OP(double, bsub_f64, x - y);
|
||||
BINARY_OP(uint32_t, bsub_u32, x - y);
|
Reference in New Issue
Block a user