diff --git a/sycl/source/backend.cpp b/sycl/source/backend.cpp index 98c5ceb06f7fc..1a91190d3ea0a 100644 --- a/sycl/source/backend.cpp +++ b/sycl/source/backend.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "detail/adapter.hpp" +#include "detail/adapter_impl.hpp" #include "detail/context_impl.hpp" #include "detail/event_impl.hpp" #include "detail/kernel_bundle_impl.hpp" diff --git a/sycl/source/backend/level_zero.cpp b/sycl/source/backend/level_zero.cpp index 80817d9a008cf..dcb5cd2d32aba 100644 --- a/sycl/source/backend/level_zero.cpp +++ b/sycl/source/backend/level_zero.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include +#include #include #include #include diff --git a/sycl/source/backend/opencl.cpp b/sycl/source/backend/opencl.cpp index c8d0f13d8ff3a..39389791feb7b 100644 --- a/sycl/source/backend/opencl.cpp +++ b/sycl/source/backend/opencl.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include +#include #include #include #include diff --git a/sycl/source/detail/adapter.hpp b/sycl/source/detail/adapter_impl.hpp similarity index 94% rename from sycl/source/detail/adapter.hpp rename to sycl/source/detail/adapter_impl.hpp index 5a0f43f700744..a1c16e148a13b 100644 --- a/sycl/source/detail/adapter.hpp +++ b/sycl/source/detail/adapter_impl.hpp @@ -1,4 +1,4 @@ -//==- adapter.hpp ----------------------------------------------------------==// +//==- adapter_impl.hpp ----------------------------------------------==// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -42,11 +42,11 @@ namespace detail { /// runtimes for the device-agnostic SYCL runtime. /// /// \ingroup sycl_ur -class Adapter { +class adapter_impl { public: - Adapter() = delete; + adapter_impl() = delete; - Adapter(ur_adapter_handle_t adapter, backend UseBackend) + adapter_impl(ur_adapter_handle_t adapter, backend UseBackend) : MAdapter(adapter), MBackend(UseBackend), MAdapterMutex(std::make_shared()) { @@ -57,12 +57,12 @@ class Adapter { } // Disallow accidental copies of adapters - Adapter &operator=(const Adapter &) = delete; - Adapter(const Adapter &) = delete; - Adapter &operator=(Adapter &&other) noexcept = delete; - Adapter(Adapter &&other) noexcept = delete; + adapter_impl &operator=(const adapter_impl &) = delete; + adapter_impl(const adapter_impl &) = delete; + adapter_impl &operator=(adapter_impl &&other) noexcept = delete; + adapter_impl(adapter_impl &&other) noexcept = delete; - ~Adapter() = default; + ~adapter_impl() = default; /// \throw SYCL 2020 exception(errc) if ur_result is not UR_RESULT_SUCCESS template @@ -237,7 +237,7 @@ class Adapter { void *UrLoaderHandle = nullptr; #endif UrFuncPtrMapT UrFuncPtrs; -}; // class Adapter +}; // class adapter_impl } // namespace detail } // namespace _V1 diff --git a/sycl/source/detail/allowlist.hpp b/sycl/source/detail/allowlist.hpp index 8f3d204033e9c..656f6ed0e4122 100644 --- a/sycl/source/detail/allowlist.hpp +++ b/sycl/source/detail/allowlist.hpp @@ -8,7 +8,7 @@ #pragma once -#include +#include #include #include diff --git a/sycl/source/detail/device_image_impl.hpp b/sycl/source/detail/device_image_impl.hpp index 614eeac04992e..3947c9e74ed88 100644 --- a/sycl/source/detail/device_image_impl.hpp +++ b/sycl/source/detail/device_image_impl.hpp @@ -8,7 +8,7 @@ #pragma once -#include +#include #include #include #include diff --git a/sycl/source/detail/error_handling/error_handling.cpp b/sycl/source/detail/error_handling/error_handling.cpp index f883340444ebf..230151d381109 100644 --- a/sycl/source/detail/error_handling/error_handling.cpp +++ b/sycl/source/detail/error_handling/error_handling.cpp @@ -13,7 +13,7 @@ #include "error_handling.hpp" #include "sycl/detail/common.hpp" -#include +#include #include #include diff --git a/sycl/source/detail/event_impl.cpp b/sycl/source/detail/event_impl.cpp index 2bf1233042e6a..80dd73d5201ab 100644 --- a/sycl/source/detail/event_impl.cpp +++ b/sycl/source/detail/event_impl.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include +#include #include #include #include diff --git a/sycl/source/detail/event_impl.hpp b/sycl/source/detail/event_impl.hpp index 0e3db59d34a7d..ba70296bb67fa 100644 --- a/sycl/source/detail/event_impl.hpp +++ b/sycl/source/detail/event_impl.hpp @@ -8,7 +8,7 @@ #pragma once -#include +#include #include #include #include @@ -27,7 +27,7 @@ class graph_impl; } class context; namespace detail { -class Adapter; +class adapter_impl; class context_impl; using ContextImplPtr = std::shared_ptr; class queue_impl; diff --git a/sycl/source/detail/event_info.hpp b/sycl/source/detail/event_info.hpp index e660d5f33c796..a914d9302c4a8 100644 --- a/sycl/source/detail/event_info.hpp +++ b/sycl/source/detail/event_info.hpp @@ -8,7 +8,7 @@ #pragma once -#include +#include #include #include #include diff --git a/sycl/source/detail/global_handler.cpp b/sycl/source/detail/global_handler.cpp index 51a77ab85a4d1..2f2e6d0019db4 100644 --- a/sycl/source/detail/global_handler.cpp +++ b/sycl/source/detail/global_handler.cpp @@ -11,7 +11,7 @@ #include "llvm/Support/Signals.h" #endif -#include +#include #include #include #include @@ -230,8 +230,8 @@ std::mutex &GlobalHandler::getFilterMutex() { return FilterMutex; } -std::vector &GlobalHandler::getAdapters() { - static std::vector &adapters = getOrCreate(MAdapters); +std::vector &GlobalHandler::getAdapters() { + static std::vector &adapters = getOrCreate(MAdapters); enableOnCrashStackPrinting(); return adapters; } diff --git a/sycl/source/detail/global_handler.hpp b/sycl/source/detail/global_handler.hpp index fd3dd7e1fc0a5..2182cb993dce7 100644 --- a/sycl/source/detail/global_handler.hpp +++ b/sycl/source/detail/global_handler.hpp @@ -23,7 +23,7 @@ class context_impl; class Scheduler; class ProgramManager; class Sync; -class Adapter; +class adapter_impl; class ods_target_list; class XPTIRegistry; class ThreadPool; @@ -70,7 +70,7 @@ class GlobalHandler { std::mutex &getPlatformToDefaultContextCacheMutex(); std::mutex &getPlatformMapMutex(); std::mutex &getFilterMutex(); - std::vector &getAdapters(); + std::vector &getAdapters(); ods_target_list &getOneapiDeviceSelectorTargets(const std::string &InitValue); XPTIRegistry &getXPTIRegistry(); ThreadPool &getHostTaskThreadPool(); @@ -125,7 +125,7 @@ class GlobalHandler { InstWithLock MPlatformToDefaultContextCacheMutex; InstWithLock MPlatformMapMutex; InstWithLock MFilterMutex; - InstWithLock> MAdapters; + InstWithLock> MAdapters; InstWithLock MOneapiDeviceSelectorTargets; InstWithLock MXPTIRegistry; // Thread pool for host task and event callbacks execution diff --git a/sycl/source/detail/kernel_name_based_cache_t.hpp b/sycl/source/detail/kernel_name_based_cache_t.hpp index 33632a73a8e66..3c2b3fb03cf6f 100644 --- a/sycl/source/detail/kernel_name_based_cache_t.hpp +++ b/sycl/source/detail/kernel_name_based_cache_t.hpp @@ -29,15 +29,15 @@ struct FastKernelCacheVal { const KernelArgMask *MKernelArgMask; /* Eliminated kernel argument mask. */ ur_program_handle_t MProgramHandle; /* UR program handle corresponding to this kernel. */ - const Adapter &MAdapterPtr; /* We can keep reference to the adapter - because during 2-stage shutdown the kernel - cache is destroyed deliberately before the - adapter. */ + const adapter_impl &MAdapterPtr; /* We can keep reference to the adapter + because during 2-stage shutdown the kernel + cache is destroyed deliberately before the + adapter. */ FastKernelCacheVal(ur_kernel_handle_t KernelHandle, std::mutex *Mutex, const KernelArgMask *KernelArgMask, ur_program_handle_t ProgramHandle, - const Adapter &AdapterPtr) + const adapter_impl &AdapterPtr) : MKernelHandle(KernelHandle), MMutex(Mutex), MKernelArgMask(KernelArgMask), MProgramHandle(ProgramHandle), MAdapterPtr(AdapterPtr) {} diff --git a/sycl/source/detail/kernel_program_cache.cpp b/sycl/source/detail/kernel_program_cache.cpp index e50e8d0f23bf0..02706f928111d 100644 --- a/sycl/source/detail/kernel_program_cache.cpp +++ b/sycl/source/detail/kernel_program_cache.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include +#include #include #include diff --git a/sycl/source/detail/persistent_device_code_cache.cpp b/sycl/source/detail/persistent_device_code_cache.cpp index 6e728fbe2e554..36175d8a9a8ff 100644 --- a/sycl/source/detail/persistent_device_code_cache.cpp +++ b/sycl/source/detail/persistent_device_code_cache.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include +#include #include #include #include diff --git a/sycl/source/detail/platform_impl.hpp b/sycl/source/detail/platform_impl.hpp index e279851fce309..70e619b8ec9b7 100644 --- a/sycl/source/detail/platform_impl.hpp +++ b/sycl/source/detail/platform_impl.hpp @@ -8,7 +8,7 @@ #pragma once -#include +#include #include #include #include @@ -39,7 +39,7 @@ class platform_impl : public std::enable_shared_from_this { // // Platforms can only be created under `GlobalHandler`'s ownership via // `platform_impl::getOrMakePlatformImpl` method. - explicit platform_impl(ur_platform_handle_t APlatform, Adapter *AAdapter) + explicit platform_impl(ur_platform_handle_t APlatform, adapter_impl *AAdapter) : MPlatform(APlatform), MAdapter(AAdapter) { // Find out backend of the platform ur_backend_t UrBackend = UR_BACKEND_UNKNOWN; diff --git a/sycl/source/detail/queue_impl.hpp b/sycl/source/detail/queue_impl.hpp index 9952fceeeccd8..fd830ab6601a6 100644 --- a/sycl/source/detail/queue_impl.hpp +++ b/sycl/source/detail/queue_impl.hpp @@ -8,7 +8,7 @@ #pragma once -#include +#include #include #include #include diff --git a/sycl/source/detail/sycl_mem_obj_t.cpp b/sycl/source/detail/sycl_mem_obj_t.cpp index eb79189ce7a68..87fc643459b18 100644 --- a/sycl/source/detail/sycl_mem_obj_t.cpp +++ b/sycl/source/detail/sycl_mem_obj_t.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include +#include #include #include #include diff --git a/sycl/source/detail/sycl_mem_obj_t.hpp b/sycl/source/detail/sycl_mem_obj_t.hpp index 561285784b9a1..a0b5c6b24f529 100644 --- a/sycl/source/detail/sycl_mem_obj_t.hpp +++ b/sycl/source/detail/sycl_mem_obj_t.hpp @@ -33,8 +33,8 @@ namespace detail { // Forward declarations class context_impl; class event_impl; -class Adapter; -using AdapterPtr = Adapter *; +class adapter_impl; +using AdapterPtr = adapter_impl *; using EventImplPtr = std::shared_ptr; diff --git a/sycl/source/detail/ur.cpp b/sycl/source/detail/ur.cpp index 8c31e8dd05ad1..c45a4a6b6d0b1 100644 --- a/sycl/source/detail/ur.cpp +++ b/sycl/source/detail/ur.cpp @@ -13,7 +13,7 @@ /// \ingroup sycl_ur #include "ur.hpp" -#include +#include #include #include #include @@ -90,7 +90,7 @@ bool trace(TraceLevel Level) { return (TraceLevelMask & Level) == Level; } -static void initializeAdapters(std::vector &Adapters, +static void initializeAdapters(std::vector &Adapters, ur_loader_config_handle_t LoaderConfig); bool XPTIInitDone = false; @@ -117,7 +117,7 @@ std::vector &initializeUr(ur_loader_config_handle_t LoaderConfig) { return GlobalHandler::instance().getAdapters(); } -static void initializeAdapters(std::vector &Adapters, +static void initializeAdapters(std::vector &Adapters, ur_loader_config_handle_t LoaderConfig) { #define CHECK_UR_SUCCESS(Call) \ { \ @@ -238,7 +238,7 @@ static void initializeAdapters(std::vector &Adapters, sizeof(adapterBackend), &adapterBackend, nullptr)); auto syclBackend = UrToSyclBackend(adapterBackend); - Adapters.emplace_back(new Adapter(UrAdapter, syclBackend)); + Adapters.emplace_back(new adapter_impl(UrAdapter, syclBackend)); const char *env_value = std::getenv("UR_LOG_CALLBACK"); if (env_value == nullptr || std::string(env_value) != "disabled") { diff --git a/sycl/source/detail/ur.hpp b/sycl/source/detail/ur.hpp index 9a46b12f8abd5..19f27d63824bc 100644 --- a/sycl/source/detail/ur.hpp +++ b/sycl/source/detail/ur.hpp @@ -24,8 +24,8 @@ namespace sycl { inline namespace _V1 { enum class backend : char; namespace detail { -class Adapter; -using AdapterPtr = Adapter *; +class adapter_impl; +using AdapterPtr = adapter_impl *; namespace ur { void *getURLoaderLibrary(); diff --git a/sycl/source/detail/ur_utils.hpp b/sycl/source/detail/ur_utils.hpp index 020f20d718a45..36538cd1deb17 100644 --- a/sycl/source/detail/ur_utils.hpp +++ b/sycl/source/detail/ur_utils.hpp @@ -8,7 +8,7 @@ #pragma once -#include +#include #include #include #include diff --git a/sycl/unittests/helpers/UrMock.hpp b/sycl/unittests/helpers/UrMock.hpp index 9f5ece694599d..df44d5ea56a76 100644 --- a/sycl/unittests/helpers/UrMock.hpp +++ b/sycl/unittests/helpers/UrMock.hpp @@ -31,7 +31,7 @@ #pragma once -#include +#include #include #include #include