Skip to content

Commit ff9e48a

Browse files
[SYCL] Don't include <cmath>/<complex> by default (#11528)
Any user code relying on those included implicitly is wrong and we don't consider it a breaking change, just a bug fix. Reverts #11326. We agreed that this isn't an ABI break as the code relying on this wasn't standard conforming. However, ABI break is next week, so I'll be merging it then. Meanwhile, adding `abi-break` label to ease documentation update later.
1 parent 4a08a6c commit ff9e48a

File tree

6 files changed

+9
-7
lines changed

6 files changed

+9
-7
lines changed

sycl/include/sycl/sycl.hpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,6 @@
105105
#include <sycl/ext/oneapi/sub_group.hpp>
106106
#include <sycl/ext/oneapi/sub_group_mask.hpp>
107107
#include <sycl/ext/oneapi/weak_object.hpp>
108-
#if !defined(SYCL2020_CONFORMANT_APIS) && \
109-
!defined(__INTEL_PREVIEW_BREAKING_CHANGES)
110-
// We used to include those and some code might be reliant on that.
111-
#include <cmath>
112-
#include <complex>
113-
#endif
114108

115109
#if !defined(__INTEL_PREVIEW_BREAKING_CHANGES)
116110
namespace sycl {

sycl/test-e2e/ESIMD/api/functional/value.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <sycl/sycl.hpp>
2121

2222
#include <climits>
23+
#include <cmath>
2324
#include <limits>
2425
#include <type_traits>
2526

sycl/test-e2e/ESIMD/kmeans/kmeans.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "kmeans.h"
1212
#include "esimd_test_utils.hpp"
1313

14+
#include <cmath>
1415
#include <fstream>
1516
#include <iostream>
1617
#include <string.h>

sycl/test/basic_tests/fp-accuracy.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
// RUN: %clangxx -%fsycl-host-only -c -ffp-accuracy=high -faltmathlib=SVMLAltMathLibrary -fno-math-errno %s
22

33
#include <sycl/sycl.hpp>
4+
5+
#include <cmath>
6+
47
using namespace sycl;
58

69
int main() {

sycl/test/basic_tests/no_math_in_global_ns.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// RUN: %clangxx -fsycl -fpreview-breaking-changes -fsyntax-only -Xclang -verify %s -Xclang -verify-ignore-unexpected=warning,note
1+
// RUN: %clangxx -fsycl -fsyntax-only -Xclang -verify %s -Xclang -verify-ignore-unexpected=warning,note
2+
// RUN: %clangxx -fsycl -fsyntax-only -Xclang -verify %s -Xclang -verify-ignore-unexpected=warning,note -fpreview-breaking-changes
23
// expected-no-diagnostics
34

45
// MSVC has the following includes:

sycl/test/check_device_code/fp-accuracy.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
#include <sycl/sycl.hpp>
1010

11+
#include <cmath>
12+
1113
SYCL_EXTERNAL auto foo(double x) {
1214
using namespace sycl;
1315
return cos(exp(log(x)));

0 commit comments

Comments
 (0)