diff --git a/sycl/include/sycl/ext/oneapi/experimental/graph.hpp b/sycl/include/sycl/ext/oneapi/experimental/graph.hpp index 2bc3ef1d921ab..44be91274a60a 100644 --- a/sycl/include/sycl/ext/oneapi/experimental/graph.hpp +++ b/sycl/include/sycl/ext/oneapi/experimental/graph.hpp @@ -335,13 +335,7 @@ class __SYCL_EXPORT modifiable_command_graph { /// @param path The path to write the DOT file to. /// @param verbose If true, print additional information about the nodes such /// as kernel args or memory access where applicable. -#ifdef __INTEL_PREVIEW_BREAKING_CHANGES - void print_graph(const std::string path, bool verbose = false) const { - print_graph(sycl::detail::string_view{path}, verbose); - } -#else void print_graph(const std::string path, bool verbose = false) const; -#endif /// Get a list of all nodes contained in this graph. std::vector get_nodes() const; @@ -378,17 +372,31 @@ class __SYCL_EXPORT modifiable_command_graph { /// added as dependencies. void addGraphLeafDependencies(node Node); + void print_graph(sycl::detail::string_view path, bool verbose = false) const; + template friend const decltype(Obj::impl) & sycl::detail::getSyclObjImpl(const Obj &SyclObject); template friend T sycl::detail::createSyclObjFromImpl(decltype(T::impl) ImplObj); -#ifdef __INTEL_PREVIEW_BREAKING_CHANGES - void print_graph(sycl::detail::string_view path, bool verbose = false) const; -#endif std::shared_ptr impl; }; +#ifdef __SYCL_GRAPH_IMPL_CPP +// Magic combination found by trial and error: +__SYCL_EXPORT +#if WIN32 +inline +#endif +#else +inline +#endif + void + modifiable_command_graph::print_graph(const std::string path, + bool verbose) const { + print_graph(sycl::detail::string_view{path}, verbose); +} + // Templateless executable command-graph base class. class __SYCL_EXPORT executable_command_graph { public: diff --git a/sycl/source/detail/graph_impl.cpp b/sycl/source/detail/graph_impl.cpp index 861ec2a883601..10624c7c5fd61 100644 --- a/sycl/source/detail/graph_impl.cpp +++ b/sycl/source/detail/graph_impl.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +#define __SYCL_GRAPH_IMPL_CPP + #include #include #include @@ -1757,15 +1759,9 @@ void modifiable_command_graph::end_recording( } } -#ifdef __INTEL_PREVIEW_BREAKING_CHANGES void modifiable_command_graph::print_graph(sycl::detail::string_view pathstr, -#else -void modifiable_command_graph::print_graph(std::string path, -#endif bool verbose) const { -#ifdef __INTEL_PREVIEW_BREAKING_CHANGES std::string path{pathstr.data()}; -#endif graph_impl::ReadLock Lock(impl->MMutex); if (path.substr(path.find_last_of(".") + 1) == "dot") { impl->printGraphAsDot(path, verbose); diff --git a/sycl/test/abi/sycl_symbols_linux.dump b/sycl/test/abi/sycl_symbols_linux.dump index 853ac28bad1d5..0f71c282e2462 100644 --- a/sycl/test/abi/sycl_symbols_linux.dump +++ b/sycl/test/abi/sycl_symbols_linux.dump @@ -3613,6 +3613,7 @@ _ZNK4sycl3_V13ext6oneapi12experimental21dynamic_command_group14get_active_cgfEv _ZNK4sycl3_V13ext6oneapi12experimental4node14get_successorsEv _ZNK4sycl3_V13ext6oneapi12experimental4node16get_predecessorsEv _ZNK4sycl3_V13ext6oneapi12experimental4node8get_typeEv +_ZNK4sycl3_V13ext6oneapi12experimental6detail24modifiable_command_graph11print_graphENS0_6detail11string_viewEb _ZNK4sycl3_V13ext6oneapi12experimental6detail24modifiable_command_graph11print_graphENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb _ZNK4sycl3_V13ext6oneapi12experimental6detail24modifiable_command_graph14get_root_nodesEv _ZNK4sycl3_V13ext6oneapi12experimental6detail24modifiable_command_graph8finalizeERKNS0_13property_listE diff --git a/sycl/test/abi/sycl_symbols_windows.dump b/sycl/test/abi/sycl_symbols_windows.dump index 8e29aba2726c9..bbd10e05f6640 100644 --- a/sycl/test/abi/sycl_symbols_windows.dump +++ b/sycl/test/abi/sycl_symbols_windows.dump @@ -4202,6 +4202,7 @@ ?prefetch@queue@_V1@sycl@@QEAA?AVevent@23@PEBX_KV423@AEBUcode_location@detail@23@@Z ?prepare_for_device_copy@experimental@oneapi@ext@_V1@sycl@@YAXPEBX_KAEBVcontext@45@@Z ?prepare_for_device_copy@experimental@oneapi@ext@_V1@sycl@@YAXPEBX_KAEBVqueue@45@@Z +?print_graph@modifiable_command_graph@detail@experimental@oneapi@ext@_V1@sycl@@IEBAXVstring_view@267@_N@Z ?print_graph@modifiable_command_graph@detail@experimental@oneapi@ext@_V1@sycl@@QEBAXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@_N@Z ?processArg@handler@_V1@sycl@@AEAAXPEAXAEBW4kernel_param_kind_t@detail@23@H_KAEA_K_N4@Z ?query@tls_code_loc_t@detail@_V1@sycl@@QEAAAEBUcode_location@234@XZ