Skip to content

Commit

Permalink
[SYCL] Don't include <cmath>/<complex> by default (intel#11528)
Browse files Browse the repository at this point in the history
Any user code relying on those included implicitly is wrong and we don't
consider it a breaking change, just a bug fix.

Reverts intel#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.
  • Loading branch information
aelovikov-intel authored Apr 1, 2024
1 parent 4a08a6c commit ff9e48a
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
6 changes: 0 additions & 6 deletions sycl/include/sycl/sycl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,6 @@
#include <sycl/ext/oneapi/sub_group.hpp>
#include <sycl/ext/oneapi/sub_group_mask.hpp>
#include <sycl/ext/oneapi/weak_object.hpp>
#if !defined(SYCL2020_CONFORMANT_APIS) && \
!defined(__INTEL_PREVIEW_BREAKING_CHANGES)
// We used to include those and some code might be reliant on that.
#include <cmath>
#include <complex>
#endif

#if !defined(__INTEL_PREVIEW_BREAKING_CHANGES)
namespace sycl {
Expand Down
1 change: 1 addition & 0 deletions sycl/test-e2e/ESIMD/api/functional/value.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <sycl/sycl.hpp>

#include <climits>
#include <cmath>
#include <limits>
#include <type_traits>

Expand Down
1 change: 1 addition & 0 deletions sycl/test-e2e/ESIMD/kmeans/kmeans.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "kmeans.h"
#include "esimd_test_utils.hpp"

#include <cmath>
#include <fstream>
#include <iostream>
#include <string.h>
Expand Down
3 changes: 3 additions & 0 deletions sycl/test/basic_tests/fp-accuracy.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// RUN: %clangxx -%fsycl-host-only -c -ffp-accuracy=high -faltmathlib=SVMLAltMathLibrary -fno-math-errno %s

#include <sycl/sycl.hpp>

#include <cmath>

using namespace sycl;

int main() {
Expand Down
3 changes: 2 additions & 1 deletion sycl/test/basic_tests/no_math_in_global_ns.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %clangxx -fsycl -fpreview-breaking-changes -fsyntax-only -Xclang -verify %s -Xclang -verify-ignore-unexpected=warning,note
// RUN: %clangxx -fsycl -fsyntax-only -Xclang -verify %s -Xclang -verify-ignore-unexpected=warning,note
// RUN: %clangxx -fsycl -fsyntax-only -Xclang -verify %s -Xclang -verify-ignore-unexpected=warning,note -fpreview-breaking-changes
// expected-no-diagnostics

// MSVC has the following includes:
Expand Down
2 changes: 2 additions & 0 deletions sycl/test/check_device_code/fp-accuracy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#include <sycl/sycl.hpp>

#include <cmath>

SYCL_EXTERNAL auto foo(double x) {
using namespace sycl;
return cos(exp(log(x)));
Expand Down

0 comments on commit ff9e48a

Please sign in to comment.