Skip to content

Commit a151a75

Browse files
committed
Add architecture check in libclc
1 parent 4f30a79 commit a151a75

File tree

1 file changed

+3
-3
lines changed
  • libclc/ptx-nvidiacl/libspirv/math

1 file changed

+3
-3
lines changed

libclc/ptx-nvidiacl/libspirv/math/tanh.cl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
int __clc_nvvm_reflect_arch();
1515
int __clc_nvvm_reflect_approx_tanh();
1616

17-
float __my_tanhf (float x){
18-
if(__clc_nvvm_reflect_approx_tanh()) {
17+
float __select_tanhf (float x){
18+
if(__clc_nvvm_reflect_approx_tanh() && __clc_nvvm_reflect_arch() >= 800) {
1919
return __nvvm_tanh_approx_f(x);
2020
} else {
2121
return __nv_tanhf(x);
@@ -24,5 +24,5 @@ float __my_tanhf (float x){
2424

2525
#define __CLC_FUNCTION __spirv_ocl_tanh
2626
#define __CLC_BUILTIN __nv_tanh
27-
#define __CLC_BUILTIN_F __my_tanhf
27+
#define __CLC_BUILTIN_F __select_tanhf
2828
#include <math/unary_builtin.inc>

0 commit comments

Comments
 (0)