diff --git a/sycl/include/sycl/ext/intel/experimental/pipes.hpp b/sycl/include/sycl/ext/intel/experimental/pipes.hpp index 76b0acf7c8d42..4313673f49082 100644 --- a/sycl/include/sycl/ext/intel/experimental/pipes.hpp +++ b/sycl/include/sycl/ext/intel/experimental/pipes.hpp @@ -46,10 +46,41 @@ 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. +#ifdef __SYCL_PIPES_CPP +// Magic combination found by trial and error: +__SYCL_EXPORT +#ifdef WIN32 +inline +#endif +#else +inline +#endif + std::string + pipe_base::get_pipe_name(const void *HostPipePtr) { + return {get_pipe_name_impl(HostPipePtr).c_str()}; +} +#endif + template diff --git a/sycl/source/detail/pipes.cpp b/sycl/source/detail/pipes.cpp index 99b0d292676ff..42884e7aaa77f 100644 --- a/sycl/source/detail/pipes.cpp +++ b/sycl/source/detail/pipes.cpp @@ -6,6 +6,10 @@ // //===----------------------------------------------------------------------===// +#ifndef __INTEL_PREVIEW_BREAKING_CHANGES +#define __SYCL_PIPES_CPP +#endif + #include #include #include @@ -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 {std::string_view{sycl::_V1::detail::ProgramManager::getInstance() + .getHostPipeEntry(HostPipePtr) + ->MUniqueId}}; } __SYCL_EXPORT bool pipe_base::wait_non_blocking(const event &E) { diff --git a/sycl/test/abi/sycl_symbols_linux.dump b/sycl/test/abi/sycl_symbols_linux.dump index a5134a7a524ca..27bfeeed383b4 100644 --- a/sycl/test/abi/sycl_symbols_linux.dump +++ b/sycl/test/abi/sycl_symbols_linux.dump @@ -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 diff --git a/sycl/test/abi/sycl_symbols_windows.dump b/sycl/test/abi/sycl_symbols_windows.dump index a6e6a5e47c137..30c43c656f27b 100644 --- a/sycl/test/abi/sycl_symbols_windows.dump +++ b/sycl/test/abi/sycl_symbols_windows.dump @@ -4055,6 +4055,7 @@ ?get_nodes@modifiable_command_graph@detail@experimental@oneapi@ext@_V1@sycl@@QEBA?AV?$vector@Vnode@experimental@oneapi@ext@_V1@sycl@@V?$allocator@Vnode@experimental@oneapi@ext@_V1@sycl@@@std@@@std@@XZ ?get_num_channels@image_mem@experimental@oneapi@ext@_V1@sycl@@QEBAIXZ ?get_pipe_name@pipe_base@experimental@intel@ext@_V1@sycl@@KA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEBX@Z +?get_pipe_name_impl@pipe_base@experimental@intel@ext@_V1@sycl@@KA?AVstring@detail@56@PEBX@Z ?get_pitch@image_plain@detail@_V1@sycl@@IEBA?AV?$range@$01@34@XZ ?get_platform@context@_V1@sycl@@QEBA?AVplatform@23@XZ ?get_platform@device@_V1@sycl@@QEBA?AVplatform@23@XZ