Skip to content

Commit 867c6da

Browse files
[SYCL] Support pipe_base::get_pipe_name compiled with pre-C++11 ABI
1 parent 1873789 commit 867c6da

File tree

3 files changed

+36
-5
lines changed

3 files changed

+36
-5
lines changed

sycl/include/sycl/ext/intel/experimental/pipes.hpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,36 @@ class pipe_base {
4646
pipe_base() = default;
4747
~pipe_base() = default;
4848

49+
__SYCL_EXPORT static sycl::detail::string
50+
get_pipe_name_impl(const void *HostPipePtr);
51+
52+
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
53+
static std::string get_pipe_name(const void *HostPipePtr) {
54+
return {get_pipe_name_impl(HostPipePtr).c_str()};
55+
}
56+
#else
4957
__SYCL_EXPORT static std::string get_pipe_name(const void *HostPipePtr);
58+
#endif
59+
5060
__SYCL_EXPORT static bool wait_non_blocking(const event &E);
5161
};
5262

63+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
64+
// We want all "new" uses/recompilation to use the "inline" version, yet we
65+
// still need to provide an exported symbol for the code that was compiled
66+
// before that. Make sure we use "inline" everywhere except when compiling
67+
// `pipes.cpp` so that we'd still provide this backward-compatibility ABI symbol
68+
// via `pipes.cpp` TU.
69+
__SYCL_EXPORT
70+
#ifndef __SYCL_PIPES_CPP
71+
inline
72+
#endif
73+
std::string
74+
pipe_base::get_pipe_name(const void *HostPipePtr) {
75+
return {get_pipe_name_impl(HostPipePtr).c_str()};
76+
}
77+
#endif
78+
5379
template <class _name, class _dataT, int32_t _min_capacity = 0,
5480
class _propertiesT = decltype(oneapi::experimental::properties{}),
5581
class = void>

sycl/source/detail/pipes.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
10+
#define __SYCL_PIPES_CPP
11+
#endif
12+
913
#include <detail/event_impl.hpp>
1014
#include <detail/host_pipe_map_entry.hpp>
1115
#include <detail/program_manager/program_manager.hpp>
@@ -16,11 +20,11 @@ inline namespace _V1 {
1620
namespace ext {
1721
namespace intel {
1822
namespace experimental {
19-
20-
__SYCL_EXPORT std::string pipe_base::get_pipe_name(const void *HostPipePtr) {
21-
return sycl::_V1::detail::ProgramManager::getInstance()
22-
.getHostPipeEntry(HostPipePtr)
23-
->MUniqueId;
23+
__SYCL_EXPORT sycl::detail::string
24+
pipe_base::get_pipe_name_impl(const void *HostPipePtr) {
25+
return {sycl::_V1::detail::ProgramManager::getInstance()
26+
.getHostPipeEntry(HostPipePtr)
27+
->MUniqueId};
2428
}
2529

2630
__SYCL_EXPORT bool pipe_base::wait_non_blocking(const event &E) {

sycl/test/abi/sycl_symbols_linux.dump

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2989,6 +2989,7 @@ _ZN4sycl3_V13ext5intel12experimental15online_compilerILNS3_15source_languageE0EE
29892989
_ZN4sycl3_V13ext5intel12experimental15online_compilerILNS3_15source_languageE1EE7compileIJSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaISE_EEEEES8_IhSaIhEERKSE_DpRKT_
29902990
_ZN4sycl3_V13ext5intel12experimental9pipe_base13get_pipe_nameB5cxx11EPKv
29912991
_ZN4sycl3_V13ext5intel12experimental9pipe_base17wait_non_blockingERKNS0_5eventE
2992+
_ZN4sycl3_V13ext5intel12experimental9pipe_base18get_pipe_name_implEPKv
29922993
_ZN4sycl3_V13ext6oneapi10level_zero6detail11make_deviceERKNS0_8platformEm
29932994
_ZN4sycl3_V13ext6oneapi12experimental10mem_adviseENS0_5queueEPvmiRKNS0_6detail13code_locationE
29942995
_ZN4sycl3_V13ext6oneapi12experimental12create_imageENS3_16image_mem_handleERKNS3_16image_descriptorERKNS0_5queueE

0 commit comments

Comments
 (0)