8000 [NFC][SYCL] Remove `ContextImplPtr` type alias by aelovikov-intel · Pull Request #19179 · intel/llvm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[NFC][SYCL] Remove ContextImplPtr type alias #19179

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: sycl
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions sycl/include/sycl/interop_handle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ class interop_handle {
friend class detail::DispatchHostTask;
using ReqToMem = std::pair<detail::AccessorImplHost *, ur_mem_handle_t>;

#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
// Clean this up (no shared pointers). Not doing it right now because I expect
// there will be several iterations of simplifications possible and it would
// be hard to track which of them made their way into a minor public release
// and which didn't. Let's just clean it up once during ABI breaking window.
#endif
interop_handle(std::vector<ReqToMem> MemObjs,
const std::shared_ptr<detail::queue_impl> &Queue,
const std::shared_ptr<detail::device_impl> &Device,
Expand Down
3 changes: 1 addition & 2 deletions sycl/source/detail/event_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class context;
namespace detail {
class Adapter;
class context_impl;
using ContextImplPtr = std::shared_ptr<sycl::detail::context_impl>;
class queue_impl;
class event_impl;
using EventImplPtr = std::shared_ptr<sycl::detail::event_impl>;
Expand Down Expand Up @@ -388,7 +387,7 @@ class event_impl {
std::atomic<ur_event_handle_t> MEvent = nullptr;
// Stores submission time of command associated with event
uint64_t MSubmitTime = 0;
ContextImplPtr MContext;
std::shared_ptr<context_impl> MContext;
std::unique_ptr<HostProfilingInfo> MHostProfilingInfo;
void *MCommand = nullptr;
std::weak_ptr<queue_impl> MQueue;
Expand Down
2 changes: 1 addition & 1 deletion sycl/source/detail/global_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ ProgramManager &GlobalHandler::getProgramManager() {
return PM;
}

std::unordered_map<platform_impl *, ContextImplPtr> &
std::unordered_map<platform_impl *, std::shared_ptr<context_impl>> &
GlobalHandler::getPlatformToDefaultContextCache() {
// The optimization with static reference is not done because
// there are public methods of the GlobalHandler
Expand Down
7 changes: 3 additions & 4 deletions sycl/source/detail/global_handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ class XPTIRegistry;
class ThreadPool;
struct KernelNameBasedCacheT;

using ContextImplPtr = std::shared_ptr<context_impl>;

/// Wrapper class for global data structures with non-trivial destructors.
///
/// As user code can call SYCL Runtime functions from destructor of global
Expand Down Expand Up @@ -64,7 +62,7 @@ class GlobalHandler {

void clearPlatforms();

std::unordered_map<platform_impl *, ContextImplPtr> &
std::unordered_map<platform_impl *, std::shared_ptr<context_impl>> &
getPlatformToDefaultContextCache();

std::mutex &getPlatformToDefaultContextCacheMutex();
Expand Down Expand Up @@ -120,7 +118,8 @@ class GlobalHandler {
InstWithLock<ProgramManager> MProgramManager;
InstWithLock<Sync> MSync;
InstWithLock<std::vector<std::shared_ptr<platform_impl>>> MPlatformCache;
InstWithLock<std::unordered_map<platform_impl *, ContextImplPtr>>
InstWithLock<
std::unordered_map<platform_impl *, std::shared_ptr<context_impl>>>
MPlatformToDefaultContextCache;
InstWithLock<std::mutex> MPlatformToDefaultContextCacheMutex;
InstWithLock<std::mutex> MPlatformMapMutex;
Expand Down
2 changes: 0 additions & 2 deletions sycl/source/detail/program_manager/program_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ namespace sycl {
inline namespace _V1 {
namespace detail {

using ContextImplPtr = std::shared_ptr<sycl::detail::context_impl>;

static constexpr int DbgProgMgr = 0;

static constexpr char UseSpvEnv[]("SYCL_USE_KERNEL_SPV");
Expand Down
1 change: 0 additions & 1 deletion sycl/source/detail/program_manager/program_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ bool doesImageTargetMatchDevice(const RTDeviceBinaryImage &Img,
static constexpr uint32_t inline ITTSpecConstId = 0xFF747469;

class context_impl;
using ContextImplPtr = std::shared_ptr<context_impl>;
class device_impl;
class queue_impl;
class event_impl;
Expand Down
8 changes: 5 additions & 3 deletions sycl/source/detail/queue_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ class node_impl;

namespace detail {

using ContextImplPtr = std::shared_ptr<detail::context_impl>;

/// Sets max number of queues supported by FPGA RT.
static constexpr size_t MaxNumQueues = 256;

Expand Down Expand Up @@ -289,7 +287,11 @@ class queue_impl : public std::enable_shared_from_this<queue_impl> {

const AdapterPtr &getAdapter() const { return MContext->getAdapter(); }

const ContextImplPtr &getContextImplPtr() const { return MContext; }
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
const std::shared_ptr<context_impl> &getContextImplPtr() const {
return MContext;
}
#endif

context_impl &getContextImpl() const { return *MContext; }

Expand Down
0