Skip to content

Commit d22c9c5

Browse files
[SYCL] Include <complex>/<cmath> from sycl.hpp, unless SYCL2020_CONFORMANT_APIS (#11326)
#11274 and #11196 could break customers code that relied on implicit inclusion of those headers. Don't break it before the next ABI breaking window.
1 parent 47083f8 commit d22c9c5

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

sycl/include/sycl/sycl.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,9 @@
9191
#include <sycl/ext/oneapi/sub_group.hpp>
9292
#include <sycl/ext/oneapi/sub_group_mask.hpp>
9393
#include <sycl/ext/oneapi/weak_object.hpp>
94+
95+
#ifndef SYCL2020_CONFORMANT_APIS
96+
// We used to include those and some code might be reliant on that.
97+
#include <cmath>
98+
#include <complex>
99+
#endif

sycl/test/basic_tests/no_math_in_global_ns.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clangxx -fsycl -fsyntax-only -Xclang -verify %s -Xclang -verify-ignore-unexpected=warning,note
1+
// RUN: %clangxx -DSYCL2020_CONFORMANT_APIS=1 -fsycl -fsyntax-only -Xclang -verify %s -Xclang -verify-ignore-unexpected=warning,note
22
// expected-no-diagnostics
33

44
// MSVC has the following includes:

0 commit comments

Comments
 (0)