diff --git a/sycl/include/sycl/detail/array.hpp b/sycl/include/sycl/detail/array.hpp index f0602c52885d8..30dc6311b2105 100644 --- a/sycl/include/sycl/detail/array.hpp +++ b/sycl/include/sycl/detail/array.hpp @@ -10,7 +10,6 @@ #include // for __SYCL_ALWAYS_INLINE #include -#include // for UR_RESULT_ERROR_INVALID_VALUE #include // for size_t #include // for enable_if_t diff --git a/sycl/include/sycl/detail/cg_types.hpp b/sycl/include/sycl/detail/cg_types.hpp index 3f571a5868497..c8f7a4ef261c4 100644 --- a/sycl/include/sycl/detail/cg_types.hpp +++ b/sycl/include/sycl/detail/cg_types.hpp @@ -23,7 +23,6 @@ #include // for nd_item #include // for nd_range #include // for range, operator* -#include // for UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE #include // for function #include // for size_t diff --git a/sycl/include/sycl/detail/ur.hpp b/sycl/include/sycl/detail/ur.hpp index fe797853212fc..70b6517b43748 100644 --- a/sycl/include/sycl/detail/ur.hpp +++ b/sycl/include/sycl/detail/ur.hpp @@ -19,7 +19,6 @@ #include #include -#include #include #include @@ -103,9 +102,6 @@ __SYCL_EXPORT void contextSetExtendedDeleter(const sycl::context &constext, void *user_data); } -class Adapter; -using AdapterPtr = std::shared_ptr; - // TODO: To be removed as this was only introduced for esimd which was removed. template __SYCL_EXPORT void *getPluginOpaqueData(void *opaquedata_arg); @@ -123,15 +119,6 @@ int unloadOsLibrary(void *Library); // library, implementation is OS dependent. void *getOsLibraryFuncAddress(void *Library, const std::string &FunctionName); -void *getURLoaderLibrary(); - -// Performs UR one-time initialization. -std::vector & -initializeUr(ur_loader_config_handle_t LoaderConfig = nullptr); - -// Get the adapter serving given backend. -template const AdapterPtr &getAdapter(); - // The SYCL_UR_TRACE sets what we will trace. // This is a bit-mask of various things we'd want to trace. enum TraceLevel { TRACE_BASIC = 0x1, TRACE_CALLS = 0x2, TRACE_ALL = -1 }; diff --git a/sycl/include/sycl/ext/oneapi/accessor_property_list.hpp b/sycl/include/sycl/ext/oneapi/accessor_property_list.hpp index 7a1ce1119dbbd..3fd3648671cb4 100644 --- a/sycl/include/sycl/ext/oneapi/accessor_property_list.hpp +++ b/sycl/include/sycl/ext/oneapi/accessor_property_list.hpp @@ -14,7 +14,6 @@ #include // for PropertyListBase #include #include // for property_list -#include // for UR_RESULT_ERROR_INVALID_VALUE #include // for bitset #include // for shared_ptr diff --git a/sycl/include/sycl/kernel_handler.hpp b/sycl/include/sycl/kernel_handler.hpp index 1c59400cdc273..20e89abdf14dd 100644 --- a/sycl/include/sycl/kernel_handler.hpp +++ b/sycl/include/sycl/kernel_handler.hpp @@ -11,7 +11,6 @@ #include // for __SYCL_TYPE #include // for __SYCL_ALWAYS_INLINE #include // for feature_not_supported -#include // for UR_RESULT_ERROR_INVALID_OPERATION #ifdef __SYCL_DEVICE_ONLY__ #include diff --git a/sycl/source/backend.cpp b/sycl/source/backend.cpp index a6e422264178b..2c876a570e3c6 100644 --- a/sycl/source/backend.cpp +++ b/sycl/source/backend.cpp @@ -13,10 +13,11 @@ #include "detail/kernel_id_impl.hpp" #include "detail/platform_impl.hpp" #include "detail/queue_impl.hpp" -#include "sycl/detail/impl_utils.hpp" +#include #include #include #include +#include #include #include #include diff --git a/sycl/source/backend/level_zero.cpp b/sycl/source/backend/level_zero.cpp index 1fe93c27ee866..e6b42c366243c 100644 --- a/sycl/source/backend/level_zero.cpp +++ b/sycl/source/backend/level_zero.cpp @@ -9,8 +9,8 @@ #include #include #include +#include #include -#include namespace sycl { inline namespace _V1 { diff --git a/sycl/source/context.cpp b/sycl/source/context.cpp index 63b3c2350e45d..a5ef6c89afe0f 100644 --- a/sycl/source/context.cpp +++ b/sycl/source/context.cpp @@ -8,9 +8,9 @@ #include #include +#include #include #include -#include #include #include #include diff --git a/sycl/source/detail/adapter.hpp b/sycl/source/detail/adapter.hpp index 1f8ce18e3eb54..ef2ce4f513773 100644 --- a/sycl/source/detail/adapter.hpp +++ b/sycl/source/detail/adapter.hpp @@ -9,11 +9,11 @@ #pragma once #include +#include #include #include #include #include -#include #include #ifdef XPTI_ENABLE_INSTRUMENTATION diff --git a/sycl/source/detail/global_handler.cpp b/sycl/source/detail/global_handler.cpp index a13d81b54daca..5669fbdaacc50 100644 --- a/sycl/source/detail/global_handler.cpp +++ b/sycl/source/detail/global_handler.cpp @@ -18,10 +18,10 @@ #include #include #include +#include #include #include #include -#include #ifdef _WIN32 #include diff --git a/sycl/source/detail/platform_impl.cpp b/sycl/source/detail/platform_impl.cpp index 818a3a2de7d36..a6ddbc9156043 100644 --- a/sycl/source/detail/platform_impl.cpp +++ b/sycl/source/detail/platform_impl.cpp @@ -6,8 +6,6 @@ // //===----------------------------------------------------------------------===// -#include "sycl/detail/ur.hpp" -#include "sycl/info/info_desc.hpp" #include #include #include @@ -20,6 +18,7 @@ #include #include #include +#include #include #include diff --git a/sycl/source/detail/program_manager/program_manager.cpp b/sycl/source/detail/program_manager/program_manager.cpp index 1953855127803..6ab92c6e27d04 100644 --- a/sycl/source/detail/program_manager/program_manager.cpp +++ b/sycl/source/detail/program_manager/program_manager.cpp @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include diff --git a/sycl/source/detail/sycl_mem_obj_i.hpp b/sycl/source/detail/sycl_mem_obj_i.hpp index 4d1e84d2ef836..776b74a85e03a 100644 --- a/sycl/source/detail/sycl_mem_obj_i.hpp +++ b/sycl/source/detail/sycl_mem_obj_i.hpp @@ -8,9 +8,10 @@ #pragma once -#include #include +#include + namespace sycl { inline namespace _V1 { diff --git a/sycl/source/detail/sycl_mem_obj_t.hpp b/sycl/source/detail/sycl_mem_obj_t.hpp index 5082597ce14f8..cd3a717fdb8cf 100644 --- a/sycl/source/detail/sycl_mem_obj_t.hpp +++ b/sycl/source/detail/sycl_mem_obj_t.hpp @@ -34,6 +34,7 @@ namespace detail { class context_impl; class event_impl; class Adapter; +using AdapterPtr = std::shared_ptr; using ContextImplPtr = std::shared_ptr; using EventImplPtr = std::shared_ptr; diff --git a/sycl/source/detail/ur.cpp b/sycl/source/detail/ur.cpp index 867cc7a899b90..bc941673fd6c6 100644 --- a/sycl/source/detail/ur.cpp +++ b/sycl/source/detail/ur.cpp @@ -12,9 +12,10 @@ /// /// \ingroup sycl_ur -#include "context_impl.hpp" +#include "ur.hpp" #include #include +#include #include #include #include diff --git a/sycl/source/detail/ur.hpp b/sycl/source/detail/ur.hpp new file mode 100644 index 0000000000000..e0014866ebeb8 --- /dev/null +++ b/sycl/source/detail/ur.hpp @@ -0,0 +1,41 @@ +//==---------- ur.hpp - Unified Runtime integration helpers ----------------==// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +/// \file +/// +/// C++ utilities for Unified Runtime integration. +/// +/// \ingroup sycl_ur + +#pragma once + +#include +#include + +#include +#include + +namespace sycl { +inline namespace _V1 { +namespace detail { +class Adapter; +using AdapterPtr = std::shared_ptr; + +namespace ur { +void *getURLoaderLibrary(); + +// Performs UR one-time initialization. +std::vector & +initializeUr(ur_loader_config_handle_t LoaderConfig = nullptr); + +// Get the adapter serving given backend. +template const AdapterPtr &getAdapter(); +} // namespace ur +} // namespace detail +} // namespace _V1 +} // namespace sycl diff --git a/sycl/source/device.cpp b/sycl/source/device.cpp index fe83f60585f2e..e1abad8af7927 100644 --- a/sycl/source/device.cpp +++ b/sycl/source/device.cpp @@ -10,9 +10,9 @@ #include #include #include +#include #include #include -#include #include #include #include diff --git a/sycl/source/kernel.cpp b/sycl/source/kernel.cpp index 45da7d87270e9..634f22b09bafb 100644 --- a/sycl/source/kernel.cpp +++ b/sycl/source/kernel.cpp @@ -9,8 +9,8 @@ #include #include #include +#include #include -#include #include namespace sycl { diff --git a/sycl/source/platform.cpp b/sycl/source/platform.cpp index 5d24743ac3587..17de8c1700a89 100644 --- a/sycl/source/platform.cpp +++ b/sycl/source/platform.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sycl/test/include_deps/sycl_accessor.hpp.cpp b/sycl/test/include_deps/sycl_accessor.hpp.cpp index 842688bae3018..599ec1835d9cf 100644 --- a/sycl/test/include_deps/sycl_accessor.hpp.cpp +++ b/sycl/test/include_deps/sycl_accessor.hpp.cpp @@ -60,7 +60,6 @@ // CHECK-NEXT: detail/array.hpp // CHECK-NEXT: exception.hpp // CHECK-NEXT: detail/string.hpp -// CHECK-NEXT: ur_api.h // CHECK-NEXT: detail/common.hpp // CHECK-NEXT: detail/is_device_copyable.hpp // CHECK-NEXT: detail/owner_less_base.hpp @@ -77,6 +76,7 @@ // CHECK-NEXT: properties/property_traits.hpp // CHECK-NEXT: id.hpp // CHECK-NEXT: range.hpp +// CHECK-NEXT: ur_api.h // CHECK-NEXT: detail/accessor_iterator.hpp // CHECK-NEXT: detail/generic_type_traits.hpp // CHECK-NEXT: ext/oneapi/bfloat16.hpp diff --git a/sycl/test/include_deps/sycl_buffer.hpp.cpp b/sycl/test/include_deps/sycl_buffer.hpp.cpp index cb193129254b5..e86a8f9524066 100644 --- a/sycl/test/include_deps/sycl_buffer.hpp.cpp +++ b/sycl/test/include_deps/sycl_buffer.hpp.cpp @@ -15,7 +15,6 @@ // CHECK-NEXT: detail/array.hpp // CHECK-NEXT: exception.hpp // CHECK-NEXT: detail/string.hpp -// CHECK-NEXT: ur_api.h // CHECK-NEXT: detail/common.hpp // CHECK-NEXT: stl_wrappers/cassert // CHECK-NEXT: stl_wrappers/assert.h @@ -38,4 +37,5 @@ // CHECK-NEXT: properties/property_traits.hpp // CHECK-NEXT: id.hpp // CHECK-NEXT: range.hpp +// CHECK-NEXT: ur_api.h // CHECK-EMPTY: diff --git a/sycl/test/include_deps/sycl_detail_core.hpp.cpp b/sycl/test/include_deps/sycl_detail_core.hpp.cpp index d2bf55f3c2169..9b9ab56deb6c7 100644 --- a/sycl/test/include_deps/sycl_detail_core.hpp.cpp +++ b/sycl/test/include_deps/sycl_detail_core.hpp.cpp @@ -61,7 +61,6 @@ // CHECK-NEXT: detail/array.hpp // CHECK-NEXT: exception.hpp // CHECK-NEXT: detail/string.hpp -// CHECK-NEXT: ur_api.h // CHECK-NEXT: detail/common.hpp // CHECK-NEXT: detail/is_device_copyable.hpp // CHECK-NEXT: detail/owner_less_base.hpp @@ -78,6 +77,7 @@ // CHECK-NEXT: properties/property_traits.hpp // CHECK-NEXT: id.hpp // CHECK-NEXT: range.hpp +// CHECK-NEXT: ur_api.h // CHECK-NEXT: detail/accessor_iterator.hpp // CHECK-NEXT: detail/generic_type_traits.hpp // CHECK-NEXT: ext/oneapi/bfloat16.hpp diff --git a/sycl/unittests/helpers/UrMock.hpp b/sycl/unittests/helpers/UrMock.hpp index 8cf9b69ebc550..0beed5a06dd1c 100644 --- a/sycl/unittests/helpers/UrMock.hpp +++ b/sycl/unittests/helpers/UrMock.hpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include