Skip to content
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

[SYCL] Support pipe_base::get_pipe_name compiled with pre-C++11 ABI #16178

Open
wants to merge 1 commit into
base: sycl
Choose a base branch
from
Open
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
26 changes: 26 additions & 0 deletions sycl/include/sycl/ext/intel/experimental/pipes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,36 @@ class pipe_base {
pipe_base() = default;
~pipe_base() = default;

__SYCL_EXPORT static sycl::detail::string
get_pipe_name_impl(const void *HostPipePtr);

#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
static std::string get_pipe_name(const void *HostPipePtr) {
return {get_pipe_name_impl(HostPipePtr).c_str()};
}
#else
__SYCL_EXPORT static std::string get_pipe_name(const void *HostPipePtr);
#endif

__SYCL_EXPORT static bool wait_non_blocking(const event &E);
};

#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
// We want all "new" uses/recompilation to use the "inline" version, yet we
// still need to provide an exported symbol for the code that was compiled
// before that. Make sure we use "inline" everywhere except when compiling
// `pipes.cpp` so that we'd still provide this backward-compatibility ABI symbol
// via `pipes.cpp` TU.
__SYCL_EXPORT
#ifndef __SYCL_PIPES_CPP
inline
#endif
std::string
pipe_base::get_pipe_name(const void *HostPipePtr) {
return {get_pipe_name_impl(HostPipePtr).c_str()};
}
#endif

template <class _name, class _dataT, int32_t _min_capacity = 0,
class _propertiesT = decltype(oneapi::experimental::properties{}),
class = void>
Expand Down
14 changes: 9 additions & 5 deletions sycl/source/detail/pipes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
//
//===----------------------------------------------------------------------===//

#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
#define __SYCL_PIPES_CPP
#endif

#include <detail/event_impl.hpp>
#include <detail/host_pipe_map_entry.hpp>
#include <detail/program_manager/program_manager.hpp>
Expand All @@ -16,11 +20,11 @@ inline namespace _V1 {
namespace ext {
namespace intel {
namespace experimental {

__SYCL_EXPORT std::string pipe_base::get_pipe_name(const void *HostPipePtr) {
return sycl::_V1::detail::ProgramManager::getInstance()
.getHostPipeEntry(HostPipePtr)
->MUniqueId;
__SYCL_EXPORT sycl::detail::string
pipe_base::get_pipe_name_impl(const void *HostPipePtr) {
return {sycl::_V1::detail::ProgramManager::getInstance()
.getHostPipeEntry(HostPipePtr)
->MUniqueId};
}

__SYCL_EXPORT bool pipe_base::wait_non_blocking(const event &E) {
Expand Down
1 change: 1 addition & 0 deletions sycl/test/abi/sycl_symbols_linux.dump
Original file line number Diff line number Diff line change
Expand Up @@ -2989,6 +2989,7 @@ _ZN4sycl3_V13ext5intel12experimental15online_compilerILNS3_15source_languageE0EE
_ZN4sycl3_V13ext5intel12experimental15online_compilerILNS3_15source_languageE1EE7compileIJSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaISE_EEEEES8_IhSaIhEERKSE_DpRKT_
_ZN4sycl3_V13ext5intel12experimental9pipe_base13get_pipe_nameB5cxx11EPKv
_ZN4sycl3_V13ext5intel12experimental9pipe_base17wait_non_blockingERKNS0_5eventE
_ZN4sycl3_V13ext5intel12experimental9pipe_base18get_pipe_name_implEPKv
_ZN4sycl3_V13ext6oneapi10level_zero6detail11make_deviceERKNS0_8platformEm
_ZN4sycl3_V13ext6oneapi12experimental10mem_adviseENS0_5queueEPvmiRKNS0_6detail13code_locationE
_ZN4sycl3_V13ext6oneapi12experimental12create_imageENS3_16image_mem_handleERKNS3_16image_descriptorERKNS0_5queueE
Expand Down
Loading