Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions sycl/include/sycl/detail/spirv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1225,21 +1225,25 @@ EnableIfGenericShuffle<T> ShuffleUp(GroupT g, T x, uint32_t delta) {
template <typename Group>
typename std::enable_if_t<
ext::oneapi::experimental::is_fixed_topology_group_v<Group>>
ControlBarrier(Group, memory_scope FenceScope, memory_order Order) {
ControlBarrier(Group, [[maybe_unused]] memory_scope FenceScope,
[[maybe_unused]] memory_order Order) {
#ifdef __SYCL_DEVICE_ONLY__
__spirv_ControlBarrier(group_scope<Group>::value, getScope(FenceScope),
getMemorySemanticsMask(Order) |
__spv::MemorySemanticsMask::SubgroupMemory |
__spv::MemorySemanticsMask::WorkgroupMemory |
__spv::MemorySemanticsMask::CrossWorkgroupMemory);
#endif
}

template <typename Group>
typename std::enable_if_t<
ext::oneapi::experimental::is_user_constructed_group_v<Group>>
ControlBarrier(Group g, memory_scope FenceScope, memory_order Order) {
ControlBarrier(Group g, [[maybe_unused]] memory_scope FenceScope,
[[maybe_unused]] memory_order Order) {
#if defined(__NVPTX__)
__nvvm_bar_warp_sync(detail::ExtractMask(detail::GetMask(g))[0]);
#else
#elif defined(__SYCL_DEVICE_ONLY__)
(void)g;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make it [[maybe_unused]] too, otherwise there will be a warning on the host.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 3d66a50

// SPIR-V does not define an instruction to synchronize partial groups.
// However, most (possibly all?) of the current SPIR-V targets execute
Expand Down
2 changes: 1 addition & 1 deletion sycl/source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,6 @@ set(SYCL_COMMON_SOURCES
"queue.cpp"
"sampler.cpp"
"stream.cpp"
"spirv_ops.cpp"
"virtual_mem.cpp"
"detail/memory_pool_impl.cpp"
"detail/async_alloc.cpp"
Expand All @@ -341,6 +340,7 @@ set(SYCL_COMMON_SOURCES
)

set(SYCL_NON_PREVIEW_SOURCES "${SYCL_COMMON_SOURCES}"
"spirv_ops.cpp"
)


Expand Down
2 changes: 2 additions & 0 deletions sycl/source/detail/platform_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ uint32_t PlatformUtil::getNativeVectorWidth(PlatformUtil::TypeIndex TIndex) {
return 0;
}

#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
void PlatformUtil::prefetch(const char *Ptr, size_t NumBytes) {
if (!Ptr)
return;
Expand All @@ -150,6 +151,7 @@ void PlatformUtil::prefetch(const char *Ptr, size_t NumBytes) {
#endif
}
}
#endif

} // namespace detail
} // namespace _V1
Expand Down
2 changes: 2 additions & 0 deletions sycl/source/detail/platform_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ struct PlatformUtil {

static uint64_t getMemCacheSize();

#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is it used? Can we just drop unconditionally?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is used in spirv_ops.cpp. but since PlatformUtil isn't exported on its own we should indeed be able to remove it straight away

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 3d66a50

static void prefetch(const char *Ptr, size_t NumBytes);
#endif
};

} // namespace detail
Expand Down
3 changes: 3 additions & 0 deletions sycl/source/ld-version-script.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@
_ZN10__host_std*;

/* Export SPIR-V built-ins for host device */
/* #ifndef __INTEL_PREVIEW_BREAKING_CHANGES */
/* TODO: drop those in the next ABI-breaking window */
_Z23__spirv_GroupWaitEvents*;
_Z22__spirv_ControlBarrier*;
_Z21__spirv_MemoryBarrier*;
_Z20__spirv_ocl_prefetch*;
/* #endif // __INTEL_PREVIEW_BREAKING_CHANGES */

/* Export offload image hooks */
__sycl_register_lib;
Expand Down
Loading