Skip to content

Commit 5e6549c

Browse files
committed
[SYCL][NFC] Drop leftover host device symbols
Host device had been removed a while ago, but we still exported some `__spirv` symbols which were even referenced on some code paths. This commit prepares for their removal in the next ABI-breaking window
1 parent f722fcf commit 5e6549c

File tree

5 files changed

+15
-4
lines changed

5 files changed

+15
-4
lines changed

sycl/include/sycl/detail/spirv.hpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,21 +1225,25 @@ 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(Group g, [[maybe_unused]] memory_scope FenceScope,
1243+
[[maybe_unused]] memory_order Order) {
12401244
#if defined(__NVPTX__)
12411245
__nvvm_bar_warp_sync(detail::ExtractMask(detail::GetMask(g))[0]);
1242-
#else
1246+
#elif defined(__SYCL_DEVICE_ONLY__)
12431247
(void)g;
12441248
// SPIR-V does not define an instruction to synchronize partial groups.
12451249
// However, most (possibly all?) of the current SPIR-V targets execute

sycl/source/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,6 @@ set(SYCL_COMMON_SOURCES
330330
"queue.cpp"
331331
"sampler.cpp"
332332
"stream.cpp"
333-
"spirv_ops.cpp"
334333
"virtual_mem.cpp"
335334
"detail/memory_pool_impl.cpp"
336335
"detail/async_alloc.cpp"
@@ -341,6 +340,7 @@ set(SYCL_COMMON_SOURCES
341340
)
342341

343342
set(SYCL_NON_PREVIEW_SOURCES "${SYCL_COMMON_SOURCES}"
343+
"spirv_ops.cpp"
344344
)
345345

346346

sycl/source/detail/platform_util.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ uint32_t PlatformUtil::getNativeVectorWidth(PlatformUtil::TypeIndex TIndex) {
131131
return 0;
132132
}
133133

134+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
134135
void PlatformUtil::prefetch(const char *Ptr, size_t NumBytes) {
135136
if (!Ptr)
136137
return;
@@ -150,6 +151,7 @@ void PlatformUtil::prefetch(const char *Ptr, size_t NumBytes) {
150151
#endif
151152
}
152153
}
154+
#endif
153155

154156
} // namespace detail
155157
} // namespace _V1

sycl/source/detail/platform_util.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ struct PlatformUtil {
4343

4444
static uint64_t getMemCacheSize();
4545

46+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
4647
static void prefetch(const char *Ptr, size_t NumBytes);
48+
#endif
4749
};
4850

4951
} // namespace detail

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)