Skip to content

Commit

Permalink
add missing ctx if >=800 or (>=530 && <800)
Browse files Browse the repository at this point in the history
  • Loading branch information
haricot committed Jan 17, 2025
1 parent c0a7838 commit 46042d4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion candle-kernels/src/binary.cu
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "binary_op_macros.cuh"
#include<stdint.h>

#if __CUDA_ARCH__ >= 530
#if __CUDA_ARCH__ >= 800 || (__CUDA_ARCH__ >= 530 && __CUDA_ARCH__ < 800)
BINARY_OP(__nv_bfloat16, badd_bf16, x + y)
BINARY_OP(__nv_bfloat16, bdiv_bf16, x / y)
BINARY_OP(__nv_bfloat16, bmul_bf16, x * y)
Expand All @@ -14,7 +14,9 @@ BINARY_OP_OUT(__nv_bfloat16, uint8_t, lt_bf16, x < y)
BINARY_OP_OUT(__nv_bfloat16, uint8_t, le_bf16, x <= y)
BINARY_OP_OUT(__nv_bfloat16, uint8_t, gt_bf16, x > y)
BINARY_OP_OUT(__nv_bfloat16, uint8_t, ge_bf16, x >= y)
#endif

#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)
Expand Down

0 comments on commit 46042d4

Please sign in to comment.