Skip to content

Commit 81d85bf

Browse files
authored
[NFC][libspirv] Simplify macros in __spirv_ocl_smoothstep (#20400)
1 parent fd3466a commit 81d85bf

File tree

1 file changed

+4
-29
lines changed

1 file changed

+4
-29
lines changed

libclc/libspirv/lib/generic/common/smoothstep.cl

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,7 @@
99
#include <clc/common/clc_smoothstep.h>
1010
#include <libspirv/spirv.h>
1111

12-
#define SMOOTHSTEP_SINGLE_DEF(X_TYPE) \
13-
_CLC_OVERLOAD _CLC_DEF X_TYPE __spirv_ocl_smoothstep( \
14-
X_TYPE edge0, X_TYPE edge1, X_TYPE x) { \
15-
return __clc_smoothstep(edge0, edge1, x); \
16-
}
17-
18-
#define SMOOTHSTEP_DEF(type) \
19-
SMOOTHSTEP_SINGLE_DEF(type) \
20-
SMOOTHSTEP_SINGLE_DEF(type##2) \
21-
SMOOTHSTEP_SINGLE_DEF(type##3) \
22-
SMOOTHSTEP_SINGLE_DEF(type##4) \
23-
SMOOTHSTEP_SINGLE_DEF(type##8) \
24-
SMOOTHSTEP_SINGLE_DEF(type##16)
25-
26-
SMOOTHSTEP_DEF(float)
27-
28-
#ifdef cl_khr_fp64
29-
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
30-
31-
SMOOTHSTEP_DEF(double);
32-
33-
#endif
34-
35-
#ifdef cl_khr_fp16
36-
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
37-
38-
SMOOTHSTEP_DEF(half);
39-
40-
#endif
12+
#define __CLC_FUNCTION __spirv_ocl_smoothstep
13+
#define __CLC_IMPL_FUNCTION(x) __clc_smoothstep
14+
#define __CLC_BODY <clc/shared/ternary_def.inc>
15+
#include <clc/math/gentype.inc>

0 commit comments

Comments
 (0)