Skip to content

[SYCL] Declare __devicelib_assert_read only when fallback assert is enabled #5698

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion sycl/include/CL/sycl/detail/assert_happened.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#include <cstdint>

#ifdef __SYCL_DEVICE_ONLY__
#if defined(__SYCL_DEVICE_ONLY__) && __SYCL_USE_FALLBACK_ASSERT
// Reads Flag of AssertHappened on device
SYCL_EXTERNAL __attribute__((weak)) extern "C" void
__devicelib_assert_read(void *);
Expand Down
7 changes: 7 additions & 0 deletions sycl/include/CL/sycl/detail/defines_elementary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,11 @@ __SYCL_WARNING("DPCPP does not support C++ version earlier than C++17. Some "
#warning: DPCPP does not support C++ version earlier than C++17. Some features might not be available.
#endif

// Helper macro to identify if fallback assert is needed
#if defined(SYCL_FALLBACK_ASSERT)
#define __SYCL_USE_FALLBACK_ASSERT SYCL_FALLBACK_ASSERT
#else
#define __SYCL_USE_FALLBACK_ASSERT 0
#endif

#endif
10 changes: 0 additions & 10 deletions sycl/include/CL/sycl/queue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,6 @@
#define _KERNELFUNCPARAM(a) const KernelType &a
#endif

// Helper macro to identify if fallback assert is needed
// FIXME remove __NVPTX__ condition once devicelib supports CUDA
#if defined(SYCL_FALLBACK_ASSERT)
#define __SYCL_USE_FALLBACK_ASSERT SYCL_FALLBACK_ASSERT
#else
#define __SYCL_USE_FALLBACK_ASSERT 0
#endif

__SYCL_INLINE_NAMESPACE(cl) {
namespace sycl {

Expand Down Expand Up @@ -1277,5 +1269,3 @@ template <> struct hash<cl::sycl::queue> {
}
};
} // namespace std

#undef __SYCL_USE_FALLBACK_ASSERT