Skip to content

Commit fa37970

Browse files
committed
use elementwise sqrt builtin and contract
1 parent b022979 commit fa37970

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

libclc/clc/lib/generic/math/clc_rsqrt.cl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
*/
2222

2323
#include <clc/internal/clc.h>
24-
#include <clc/math/clc_sqrt.h>
2524

2625
#define __CLC_BODY <clc_rsqrt.inc>
2726
#include <clc/math/gentype.inc>
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
__attribute__((weak)) _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE
22
__clc_rsqrt(__CLC_GENTYPE val) {
3-
return __CLC_FP_LIT(1.0) / __clc_sqrt(val);
3+
#pragma clang fp contract(fast)
4+
return __CLC_FP_LIT(1.0) / __builtin_elementwise_sqrt(val);
45
}

0 commit comments

Comments
 (0)