Skip to content

Commit 3276ddd

Browse files
[SYCL][NFC] Drop leftover host device symbols (#20172)
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 b68db56 commit 3276ddd

File tree

6 files changed

+13
-31
lines changed

6 files changed

+13
-31
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/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: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -131,26 +131,6 @@ uint32_t PlatformUtil::getNativeVectorWidth(PlatformUtil::TypeIndex TIndex) {
131131
return 0;
132132
}
133133

134-
void PlatformUtil::prefetch(const char *Ptr, size_t NumBytes) {
135-
if (!Ptr)
136-
return;
137-
138-
const size_t CacheLineSize = PlatformUtil::getMemCacheLineSize();
139-
const size_t CacheLineMask = ~(CacheLineSize - 1);
140-
const char *PtrEnd = Ptr + NumBytes;
141-
142-
// Set the pointer to the beginning of the current cache line.
143-
Ptr = reinterpret_cast<const char *>(reinterpret_cast<size_t>(Ptr) &
144-
CacheLineMask);
145-
for (; Ptr < PtrEnd; Ptr += CacheLineSize) {
146-
#if defined(__SYCL_RT_OS_LINUX)
147-
__builtin_prefetch(Ptr);
148-
#elif defined(__SYCL_RT_OS_WINDOWS)
149-
_mm_prefetch(Ptr, _MM_HINT_T0);
150-
#endif
151-
}
152-
}
153-
154134
} // namespace detail
155135
} // namespace _V1
156136
} // namespace sycl

sycl/source/detail/platform_util.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ struct PlatformUtil {
4242
static uint32_t getMemCacheLineSize();
4343

4444
static uint64_t getMemCacheSize();
45-
46-
static void prefetch(const char *Ptr, size_t NumBytes);
4745
};
4846

4947
} // 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;

sycl/source/spirv_ops.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,4 @@ __SYCL_EXPORT void __spirv_MemoryBarrier(__spv::Scope Memory,
4545
atomic_thread_fence(std::memory_order_seq_cst);
4646
}
4747

48-
__SYCL_EXPORT void __spirv_ocl_prefetch(const char *Ptr,
49-
size_t NumBytes) noexcept {
50-
sycl::detail::PlatformUtil::prefetch(Ptr, NumBytes);
51-
}
48+
__SYCL_EXPORT void __spirv_ocl_prefetch(const char *, size_t) noexcept {}

0 commit comments

Comments
 (0)