Skip to content

Commit c0cb322

Browse files
committed
Merge remote-tracking branch 'origin/sycl' into private/asachkov/drop-platform-util
2 parents 8f39dd2 + 3276ddd commit c0cb322

File tree

7 files changed

+37
-7
lines changed

7 files changed

+37
-7
lines changed

sycl/include/sycl/detail/spirv.hpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,22 +1225,26 @@ EnableIfGenericShuffle<T> ShuffleUp(GroupT g, T x, uint32_t delta) {
12251225
template <typename Group>
12261226
typename std::enable_if_t<
12271227
ext::oneapi::experimental::is_fixed_topology_group_v<Group>>
1228-
ControlBarrier(Group, memory_scope FenceScope, memory_order Order) {
1228+
ControlBarrier(Group, [[maybe_unused]] memory_scope FenceScope,
1229+
[[maybe_unused]] memory_order Order) {
1230+
#ifdef __SYCL_DEVICE_ONLY__
12291231
__spirv_ControlBarrier(group_scope<Group>::value, getScope(FenceScope),
12301232
getMemorySemanticsMask(Order) |
12311233
__spv::MemorySemanticsMask::SubgroupMemory |
12321234
__spv::MemorySemanticsMask::WorkgroupMemory |
12331235
__spv::MemorySemanticsMask::CrossWorkgroupMemory);
1236+
#endif
12341237
}
12351238

12361239
template <typename Group>
12371240
typename std::enable_if_t<
12381241
ext::oneapi::experimental::is_user_constructed_group_v<Group>>
1239-
ControlBarrier(Group g, memory_scope FenceScope, memory_order Order) {
1242+
ControlBarrier([[maybe_unused]] Group g,
1243+
[[maybe_unused]] memory_scope FenceScope,
1244+
[[maybe_unused]] memory_order Order) {
12401245
#if defined(__NVPTX__)
12411246
__nvvm_bar_warp_sync(detail::ExtractMask(detail::GetMask(g))[0]);
1242-
#else
1243-
(void)g;
1247+
#elif defined(__SYCL_DEVICE_ONLY__)
12441248
// SPIR-V does not define an instruction to synchronize partial groups.
12451249
// However, most (possibly all?) of the current SPIR-V targets execute
12461250
// work-items in lockstep, so we can probably get away with a MemoryBarrier.

sycl/include/sycl/kernel.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,10 @@ class __SYCL_EXPORT kernel : public detail::OwnerLessBase<kernel> {
255255

256256
ur_native_handle_t getNative() const;
257257

258+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
258259
__SYCL_DEPRECATED("Use getNative() member function")
259260
ur_native_handle_t getNativeImpl() const;
261+
#endif
260262

261263
std::shared_ptr<detail::kernel_impl> impl;
262264

sycl/include/sycl/kernel_bundle.hpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,14 @@ class __SYCL_EXPORT device_image_plain {
123123

124124
bool has_kernel(const kernel_id &KernelID, const device &Dev) const noexcept;
125125

126+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
126127
ur_native_handle_t getNative() const;
127-
128+
#endif
128129
protected:
130+
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
131+
ur_native_handle_t getNative() const;
132+
#endif
133+
129134
std::shared_ptr<device_image_impl> impl;
130135

131136
template <class Obj>
@@ -207,6 +212,9 @@ class device_image : public detail::device_image_plain,
207212
template <class T>
208213
friend T detail::createSyclObjFromImpl(
209214
std::add_lvalue_reference_t<const decltype(T::impl)> ImplObj);
215+
216+
// To allow calling device_image_plain::getNative()
217+
template <bundle_state> friend class kernel_bundle;
210218
};
211219

212220
namespace detail {

sycl/include/sycl/queue.hpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3549,7 +3549,12 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
35493549
bool khr_empty() const;
35503550
#endif
35513551

3552+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
3553+
// TODO: to be made private in the next ABI-breaking window
3554+
__SYCL_DEPRECATED(
3555+
"This is a non-standard method, use sycl::get_native instead")
35523556
ur_native_handle_t getNative(int32_t &NativeHandleDesc) const;
3557+
#endif
35533558

35543559
std::optional<event> ext_oneapi_get_last_event() const {
35553560
return static_cast<std::optional<event>>(ext_oneapi_get_last_event_impl());
@@ -3558,6 +3563,10 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
35583563
void ext_oneapi_set_external_event(const event &external_event);
35593564

35603565
private:
3566+
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
3567+
ur_native_handle_t getNative(int32_t &NativeHandleDesc) const;
3568+
#endif
3569+
35613570
std::shared_ptr<detail::queue_impl> impl;
35623571
queue(std::shared_ptr<detail::queue_impl> impl) : impl(impl) {}
35633572

@@ -3575,6 +3584,10 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
35753584
friend auto get_native(const SyclObjectT &Obj)
35763585
-> backend_return_t<BackendName, SyclObjectT>;
35773586

3587+
template <backend BackendName>
3588+
friend auto get_native(const queue &Obj)
3589+
-> backend_return_t<BackendName, queue>;
3590+
35783591
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
35793592
#if __SYCL_USE_FALLBACK_ASSERT
35803593
friend event detail::submitAssertCapture(const queue &, event &,

sycl/source/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,6 @@ set(SYCL_COMMON_SOURCES
329329
"queue.cpp"
330330
"sampler.cpp"
331331
"stream.cpp"
332-
"spirv_ops.cpp"
333332
"virtual_mem.cpp"
334333
"detail/memory_pool_impl.cpp"
335334
"detail/async_alloc.cpp"
@@ -340,6 +339,7 @@ set(SYCL_COMMON_SOURCES
340339
)
341340

342341
set(SYCL_NON_PREVIEW_SOURCES "${SYCL_COMMON_SOURCES}"
342+
"spirv_ops.cpp"
343343
)
344344

345345

sycl/source/kernel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,9 @@ kernel::kernel(std::shared_ptr<detail::kernel_impl> Impl) : impl(Impl) {}
253253

254254
ur_native_handle_t kernel::getNative() const { return impl->getNative(); }
255255

256+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
256257
ur_native_handle_t kernel::getNativeImpl() const { return impl->getNative(); }
257258

258-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
259259
// The following query was deprecated since it doesn't include a way to specify
260260
// the invdividual dimensions of the work group. All of the contents of this
261261
// #ifndef block should be removed during the next ABI breaking window.

sycl/source/ld-version-script.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@
1818
_ZN10__host_std*;
1919

2020
/* Export SPIR-V built-ins for host device */
21+
/* #ifndef __INTEL_PREVIEW_BREAKING_CHANGES */
22+
/* TODO: drop those in the next ABI-breaking window */
2123
_Z23__spirv_GroupWaitEvents*;
2224
_Z22__spirv_ControlBarrier*;
2325
_Z21__spirv_MemoryBarrier*;
2426
_Z20__spirv_ocl_prefetch*;
27+
/* #endif // __INTEL_PREVIEW_BREAKING_CHANGES */
2528

2629
/* Export offload image hooks */
2730
__sycl_register_lib;

0 commit comments

Comments
 (0)