Skip to content

Commit a1ba1a2

Browse files
committed
Merge remote-tracking branch 'upstream/sycl' into georgi/test-hip-usm-copy2d
2 parents f8ed883 + 9f4ee47 commit a1ba1a2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+528
-764
lines changed

.github/workflows/sycl-containers.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ jobs:
2828
if: github.repository == 'intel/llvm'
2929
name: Base Ubuntu 22.04 Docker image
3030
runs-on: ubuntu-22.04
31+
permissions:
32+
packages: write
3133
steps:
3234
- name: Checkout
3335
uses: actions/checkout@v4
@@ -47,6 +49,8 @@ jobs:
4749
if: github.repository == 'intel/llvm'
4850
name: Build Ubuntu Docker image
4951
runs-on: ubuntu-22.04
52+
permissions:
53+
packages: write
5054
steps:
5155
- name: Checkout
5256
uses: actions/checkout@v4
@@ -69,6 +73,8 @@ jobs:
6973
if: github.repository == 'intel/llvm'
7074
name: Intel Drivers Ubuntu 22.04 Docker image
7175
runs-on: ubuntu-22.04
76+
permissions:
77+
packages: write
7278
needs: base_image_ubuntu2204
7379
steps:
7480
- name: Checkout
@@ -107,6 +113,8 @@ jobs:
107113
if: github.repository == 'intel/llvm'
108114
name: Intel Drivers (unstable) Ubuntu 22.04 Docker image
109115
runs-on: ubuntu-22.04
116+
permissions:
117+
packages: write
110118
needs: base_image_ubuntu2204
111119
steps:
112120
- name: Checkout

sycl/include/sycl/buffer.hpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,8 @@ template <typename T, int dimensions = 1,
167167
typename std::enable_if_t<(dimensions > 0) && (dimensions <= 3)>>
168168
class buffer : public detail::buffer_plain,
169169
public detail::OwnerLessBase<buffer<T, dimensions, AllocatorT>> {
170-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
171170
static_assert(is_device_copyable_v<T>,
172171
"Underlying type of a buffer must be device copyable!");
173-
#else
174-
static_assert(!std::is_same_v<T, std::string>,
175-
"'std::string' is not a device copyable type");
176-
#endif
177172

178173
public:
179174
using value_type = T;

sycl/include/sycl/detail/assert_happened.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#include <cstdint> // for uint64_t, int32_t
1212

13-
#ifdef __SYCL_DEVICE_ONLY__
13+
#if defined(__SYCL_DEVICE_ONLY__) && __SYCL_USE_FALLBACK_ASSERT
1414
// Reads Flag of AssertHappened on device
1515
__DPCPP_SYCL_EXTERNAL __attribute__((weak)) extern "C" void
1616
__devicelib_assert_read(void *);

sycl/include/sycl/detail/defines_elementary.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@
8181
static_assert(__cplusplus >= 201703L,
8282
"DPCPP does not support C++ version earlier than C++17.");
8383

84+
// Helper macro to identify if fallback assert is needed
85+
#if defined(SYCL_FALLBACK_ASSERT)
86+
#define __SYCL_USE_FALLBACK_ASSERT SYCL_FALLBACK_ASSERT
87+
#else
88+
#define __SYCL_USE_FALLBACK_ASSERT 0
89+
#endif
90+
8491
#if defined(_WIN32) && !defined(_DLL) && !defined(__SYCL_DEVICE_ONLY__)
8592
// SYCL library is designed such a way that STL objects cross DLL boundary,
8693
// which is guaranteed to work properly only when the application uses the same

sycl/include/sycl/detail/generic_type_lists.hpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,8 @@ using scalar_vector_double_list =
9797
using double_list =
9898
tl_append<scalar_double_list, vector_double_list, marray_double_list>;
9999

100-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
101100
using scalar_floating_list = tl_append<scalar_float_list, scalar_double_list,
102101
scalar_half_list, scalar_bfloat16_list>;
103-
#else
104-
// Presently, this is used only by builtins_legacy_scalar.hpp for defining math
105-
// funcs. bfloat16 provides its own scalar math definitions so we skip its
106-
// inclusion.
107-
using scalar_floating_list =
108-
tl_append<scalar_float_list, scalar_double_list, scalar_half_list>;
109-
#endif
110102

111103
using vector_floating_list = tl_append<vector_float_list, vector_double_list,
112104
vector_half_list, vector_bfloat16_list>;

sycl/include/sycl/detail/util.hpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111
#ifndef __SYCL_DEVICE_ONLY
1212

1313
#include <sycl/detail/defines.hpp>
14-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
1514
#include <sycl/detail/string.hpp>
16-
#endif
15+
1716
#include <cstring>
1817
#include <mutex>
1918
#include <vector>
@@ -69,7 +68,6 @@ struct CmpCStr {
6968

7069
using SerializedObj = std::vector<unsigned char>;
7170

72-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
7371
template <typename T> struct ABINeutralT { using type = T; };
7472
// We need special handling of std::string to handle ABI incompatibility
7573
// for get_info<>() when it returns std::string and vector<std::string>.
@@ -85,10 +83,6 @@ template <> struct ABINeutralT<std::vector<std::string>> {
8583
};
8684

8785
template <typename T> using ABINeutralT_t = typename ABINeutralT<T>::type;
88-
#else
89-
template <typename T> using ABINeutralT_t = T;
90-
#endif
91-
9286
} // namespace detail
9387
} // namespace _V1
9488
} // namespace sycl

sycl/include/sycl/device.hpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@
1515
#include <sycl/detail/info_desc_helpers.hpp>
1616
#include <sycl/detail/owner_less_base.hpp>
1717
#include <sycl/detail/pi.h>
18-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
1918
#include <sycl/detail/string.hpp>
2019
#include <sycl/detail/string_view.hpp>
21-
#endif
2220
#include <sycl/detail/util.hpp>
2321
#include <sycl/device_selector.hpp>
2422
#include <sycl/ext/oneapi/experimental/device_architecture.hpp>
@@ -221,17 +219,10 @@ class __SYCL_EXPORT device : public detail::OwnerLessBase<device> {
221219
/// type associated with the param parameter.
222220
///
223221
/// \return device info of type described in Table 4.20.
224-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
225222
template <typename Param>
226223
typename detail::is_device_info_desc<Param>::return_type get_info() const {
227224
return detail::convert_from_abi_neutral(get_info_impl<Param>());
228225
}
229-
#else
230-
template <typename Param>
231-
detail::ABINeutralT_t<
232-
typename detail::is_device_info_desc<Param>::return_type>
233-
get_info() const;
234-
#endif
235226

236227
/// Queries this SYCL device for SYCL backend-specific information.
237228
///
@@ -377,12 +368,10 @@ class __SYCL_EXPORT device : public detail::OwnerLessBase<device> {
377368
friend auto get_native(const SyclObjectT &Obj)
378369
-> backend_return_t<BackendName, SyclObjectT>;
379370

380-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
381371
template <typename Param>
382372
typename detail::ABINeutralT_t<
383373
typename detail::is_device_info_desc<Param>::return_type>
384374
get_info_impl() const;
385-
#endif
386375
};
387376

388377
} // namespace _V1

sycl/include/sycl/exception.hpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -74,21 +74,13 @@ class __SYCL_EXPORT exception : public virtual std::exception {
7474

7575
exception(std::error_code, const char *Msg);
7676

77-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
7877
exception(std::error_code Ec, const std::string &Msg)
7978
: exception(Ec, nullptr, Msg.c_str()) {}
80-
#else
81-
exception(std::error_code, const std::string &Msg);
82-
#endif
8379

8480
// new SYCL 2020 constructors
8581
exception(std::error_code);
86-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
8782
exception(int EV, const std::error_category &ECat, const std::string &WhatArg)
8883
: exception(EV, ECat, WhatArg.c_str()) {}
89-
#else
90-
exception(int, const std::error_category &, const std::string &);
91-
#endif
9284
exception(int, const std::error_category &, const char *);
9385
exception(int, const std::error_category &);
9486

@@ -137,16 +129,11 @@ class __SYCL_EXPORT exception : public virtual std::exception {
137129
// base constructor for all SYCL 2020 constructors
138130
// exception(context *ctxPtr, std::error_code Ec, const std::string
139131
// &what_arg);
140-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
141132
exception(std::error_code Ec, std::shared_ptr<context> SharedPtrCtx,
142133
const std::string &what_arg)
143134
: exception(Ec, SharedPtrCtx, what_arg.c_str()) {}
144135
exception(std::error_code Ec, std::shared_ptr<context> SharedPtrCtx,
145136
const char *WhatArg);
146-
#else
147-
exception(std::error_code Ec, std::shared_ptr<context> SharedPtrCtx,
148-
const std::string &what_arg);
149-
#endif
150137
};
151138

152139
class __SYCL2020_DEPRECATED(

sycl/include/sycl/ext/oneapi/bfloat16.hpp

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,6 @@ __devicelib_ConvertBF16ToFINTEL(const uint16_t &) noexcept;
2121

2222
namespace sycl {
2323
inline namespace _V1 {
24-
25-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
26-
// forward declaration of sycl::isnan built-in.
27-
// extern __DPCPP_SYCL_EXTERNAL bool isnan(float a);
28-
bool isnan(float a);
29-
#endif
30-
3124
namespace ext::oneapi {
3225

3326
class bfloat16;
@@ -53,10 +46,6 @@ using Vec8StorageT = std::array<Bfloat16StorageT, 8>;
5346
using Vec16StorageT = std::array<Bfloat16StorageT, 16>;
5447
#endif
5548
} // namespace bf16
56-
57-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
58-
inline bool float_is_nan(float x) { return x != x; }
59-
#endif
6049
} // namespace detail
6150

6251
class bfloat16 {
@@ -77,13 +66,10 @@ class bfloat16 {
7766

7867
private:
7968
static detail::Bfloat16StorageT from_float_fallback(const float &a) {
80-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
81-
if (sycl::isnan(a))
82-
return 0xffc1;
83-
#else
84-
if (detail::float_is_nan(a))
69+
// We don't call sycl::isnan because we don't want a data type to depend on
70+
// builtins.
71+
if (a != a)
8572
return 0xffc1;
86-
#endif
8773

8874
union {
8975
uint32_t intStorage;

sycl/include/sycl/handler.hpp

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,8 @@
2121
#include <sycl/detail/pi.h>
2222
#include <sycl/detail/pi.hpp>
2323
#include <sycl/detail/reduction_forward.hpp>
24-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
2524
#include <sycl/detail/string.hpp>
2625
#include <sycl/detail/string_view.hpp>
27-
#endif
2826
#include <sycl/device.hpp>
2927
#include <sycl/event.hpp>
3028
#include <sycl/exception.hpp>
@@ -422,11 +420,6 @@ template <int Dims> bool range_size_fits_in_size_t(const range<Dims> &r) {
422420
}
423421
return true;
424422
}
425-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
426-
using string = std::string;
427-
using string_view = std::string;
428-
#endif
429-
430423
} // namespace detail
431424

432425
/// Command group handler class.
@@ -872,14 +865,10 @@ class __SYCL_EXPORT handler {
872865
///
873866
/// \param KernelName is the name of the SYCL kernel to check that the used
874867
/// kernel bundle contains.
875-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
876868
void verifyUsedKernelBundle(const std::string &KernelName) {
877869
verifyUsedKernelBundleInternal(detail::string_view{KernelName});
878870
}
879871
void verifyUsedKernelBundleInternal(detail::string_view KernelName);
880-
#else
881-
void verifyUsedKernelBundle(const std::string &KernelName);
882-
#endif
883872

884873
/// Stores lambda to the template-free object
885874
///
@@ -1326,8 +1315,6 @@ class __SYCL_EXPORT handler {
13261315
"Kernel argument cannot have a sycl::nd_item type in "
13271316
"sycl::parallel_for with sycl::range");
13281317

1329-
#if defined(SYCL2020_CONFORMANT_APIS) || \
1330-
defined(__INTEL_PREVIEW_BREAKING_CHANGES)
13311318
static_assert(std::is_convertible_v<item<Dims>, LambdaArgType> ||
13321319
std::is_convertible_v<item<Dims, false>, LambdaArgType>,
13331320
"sycl::parallel_for(sycl::range) kernel must have the "
@@ -1340,7 +1327,6 @@ class __SYCL_EXPORT handler {
13401327
std::is_invocable_v<KernelType, RefLambdaArgType, kernel_handler>),
13411328
"SYCL kernel lambda/functor has an unexpected signature, it should be "
13421329
"invocable with sycl::item and optionally sycl::kernel_handler");
1343-
#endif
13441330

13451331
// TODO: Properties may change the kernel function, so in order to avoid
13461332
// conflicts they should be included in the name.
@@ -1432,19 +1418,11 @@ class __SYCL_EXPORT handler {
14321418
verifyUsedKernelBundle(detail::KernelInfo<NameT>::getName());
14331419
using LambdaArgType =
14341420
sycl::detail::lambda_arg_type<KernelType, nd_item<Dims>>;
1435-
#if defined(SYCL2020_CONFORMANT_APIS) || \
1436-
defined(__INTEL_PREVIEW_BREAKING_CHANGES)
14371421
static_assert(
14381422
std::is_convertible_v<sycl::nd_item<Dims>, LambdaArgType>,
14391423
"Kernel argument of a sycl::parallel_for with sycl::nd_range "
14401424
"must be either sycl::nd_item or be convertible from sycl::nd_item");
14411425
using TransformedArgType = sycl::nd_item<Dims>;
1442-
#else
1443-
// If user type is convertible from sycl::item/sycl::nd_item, use
1444-
// sycl::item/sycl::nd_item to transport item information
1445-
using TransformedArgType =
1446-
typename TransformUserItemType<Dims, LambdaArgType>::type;
1447-
#endif
14481426

14491427
(void)ExecutionRange;
14501428
(void)Props;
@@ -3414,35 +3392,25 @@ class __SYCL_EXPORT handler {
34143392
/// expr m_Storage member
34153393
/// \param Size the size of data getting read back / to.
34163394
/// \param Block if read operation is blocking, default to false.
3417-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
34183395
void ext_intel_read_host_pipe(const std::string &Name, void *Ptr, size_t Size,
34193396
bool Block = false) {
34203397
ext_intel_read_host_pipe(detail::string_view(Name), Ptr, Size, Block);
34213398
}
34223399
void ext_intel_read_host_pipe(detail::string_view Name, void *Ptr,
34233400
size_t Size, bool Block = false);
3424-
#else
3425-
void ext_intel_read_host_pipe(const std::string &Name, void *Ptr, size_t Size,
3426-
bool Block = false);
3427-
#endif
34283401

34293402
/// Write to host pipes given a host address and
34303403
/// \param Name name of the host pipe to be passed into lower level runtime
34313404
/// \param Ptr host pointer of host pipe as identified by address of its const
34323405
/// expr m_Storage member
34333406
/// \param Size the size of data getting read back / to.
34343407
/// \param Block if write opeartion is blocking, default to false.
3435-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
34363408
void ext_intel_write_host_pipe(const std::string &Name, void *Ptr,
34373409
size_t Size, bool Block = false) {
34383410
ext_intel_write_host_pipe(detail::string_view(Name), Ptr, Size, Block);
34393411
}
34403412
void ext_intel_write_host_pipe(detail::string_view Name, void *Ptr,
34413413
size_t Size, bool Block = false);
3442-
#else
3443-
void ext_intel_write_host_pipe(const std::string &Name, void *Ptr,
3444-
size_t Size, bool Block = false);
3445-
#endif
34463414
friend class ext::oneapi::experimental::detail::graph_impl;
34473415
friend class ext::oneapi::experimental::detail::dynamic_parameter_impl;
34483416

sycl/include/sycl/kernel.hpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@
1515
#include <sycl/detail/info_desc_helpers.hpp> // for is_kernel_device_specif...
1616
#include <sycl/detail/owner_less_base.hpp> // for OwnerLessBase
1717
#include <sycl/detail/pi.h> // for pi_native_handle
18-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
1918
#include <sycl/detail/string.hpp>
2019
#include <sycl/detail/string_view.hpp>
21-
#endif
2220
#include <sycl/detail/util.hpp>
2321
#include <sycl/device.hpp> // for device
2422
#include <sycl/kernel_bundle_enums.hpp> // for bundle_state
@@ -142,13 +140,9 @@ class __SYCL_EXPORT kernel : public detail::OwnerLessBase<kernel> {
142140
///
143141
/// \return depends on information being queried.
144142
template <typename Param>
145-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
146143
typename detail::is_kernel_info_desc<Param>::return_type get_info() const {
147144
return detail::convert_from_abi_neutral(get_info_impl<Param>());
148145
}
149-
#else
150-
typename detail::is_kernel_info_desc<Param>::return_type get_info() const;
151-
#endif
152146

153147
/// Queries the kernel object for SYCL backend-specific information.
154148
///
@@ -201,12 +195,10 @@ class __SYCL_EXPORT kernel : public detail::OwnerLessBase<kernel> {
201195
template <backend BackendName, class SyclObjectT>
202196
friend auto get_native(const SyclObjectT &Obj)
203197
-> backend_return_t<BackendName, SyclObjectT>;
204-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
205198
template <typename Param>
206199
typename detail::ABINeutralT_t<
207200
typename detail::is_kernel_info_desc<Param>::return_type>
208201
get_info_impl() const;
209-
#endif
210202
};
211203
} // namespace _V1
212204
} // namespace sycl

0 commit comments

Comments
 (0)