Skip to content

Commit f41309b

Browse files
authored
[SYCL] Remove fabs and ceil from the list of unsupported math functions (#1217)
Signed-off-by: Arvind Sudarsanam <[email protected]>
1 parent 8c71dcb commit f41309b

File tree

2 files changed

+0
-20
lines changed

2 files changed

+0
-20
lines changed

clang/lib/Sema/SemaSYCL.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,8 @@ static bool IsSyclMathFunc(unsigned BuiltinID) {
138138
case Builtin::BI__builtin_truncl:
139139
case Builtin::BIlroundl:
140140
case Builtin::BI__builtin_lroundl:
141-
case Builtin::BIceil:
142-
case Builtin::BI__builtin_ceil:
143141
case Builtin::BIcopysign:
144142
case Builtin::BI__builtin_copysign:
145-
case Builtin::BIfabs:
146-
case Builtin::BI__builtin_fabs:
147143
case Builtin::BIfloor:
148144
case Builtin::BI__builtin_floor:
149145
case Builtin::BIfmax:
@@ -158,12 +154,8 @@ static bool IsSyclMathFunc(unsigned BuiltinID) {
158154
case Builtin::BI__builtin_round:
159155
case Builtin::BItrunc:
160156
case Builtin::BI__builtin_trunc:
161-
case Builtin::BIceilf:
162-
case Builtin::BI__builtin_ceilf:
163157
case Builtin::BIcopysignf:
164158
case Builtin::BI__builtin_copysignf:
165-
case Builtin::BIfabsf:
166-
case Builtin::BI__builtin_fabsf:
167159
case Builtin::BIfloorf:
168160
case Builtin::BI__builtin_floorf:
169161
case Builtin::BIfmaxf:

clang/test/SemaSYCL/unsupported_math.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,9 @@
22
extern "C" float sinf(float);
33
extern "C" float cosf(float);
44
extern "C" float logf(float);
5-
extern "C" float ceilf(float);
6-
extern "C" float fabsf(float);
75
extern "C" double sin(double);
86
extern "C" double cos(double);
97
extern "C" double log(double);
10-
extern "C" double ceil(double);
11-
extern "C" double fabs(double);
128
template <typename name, typename Func>
139
__attribute__((sycl_kernel)) void kernel(Func kernelFunc) {
1410
kernelFunc();
@@ -30,14 +26,6 @@ int main() {
3026
acc[0] += (int)log(1.0); // expected-no-error
3127
acc[0] += (int)__builtin_logf(1.0f); // expected-no-error
3228
acc[0] += (int)__builtin_log(1.0); // expected-no-error
33-
acc[0] += (int)ceilf(1.0f); // expected-error{{builtin is not supported on this target}}
34-
acc[0] += (int)ceil(1.0); // expected-error{{builtin is not supported on this target}}
35-
acc[0] += (int)__builtin_ceilf(1.0f); // expected-error{{builtin is not supported on this target}}
36-
acc[0] += (int)__builtin_ceil(1.0); // expected-error{{builtin is not supported on this target}}
37-
acc[0] += (int)fabsf(-1.0f); // expected-error{{builtin is not supported on this target}}
38-
acc[0] += (int)fabs(-1.0); // expected-error{{builtin is not supported on this target}}
39-
acc[0] += (int)__builtin_fabsf(-1.0f); // expected-error{{builtin is not supported on this target}}
40-
acc[0] += (int)__builtin_fabs(-1.0); // expected-error{{builtin is not supported on this target}}
4129
acc[0] += (int)__builtin_fabsl(-1.0); // expected-error{{builtin is not supported on this target}}
4230
acc[0] += (int)__builtin_cosl(-1.0); // expected-error{{builtin is not supported on this target}}
4331
acc[0] += (int)__builtin_powl(-1.0, 10.0); // expected-error{{builtin is not supported on this target}}

0 commit comments

Comments
 (0)