34 OwnedPiEvent(
RT::PiEvent Event,
const plugin &Plugin);
38 : MEvent(Other.MEvent), MPlugin(Other.MPlugin) {
39 Other.MEvent = std::nullopt;
46 operator bool() {
return MEvent.has_value(); }
54 MEvent = std::nullopt;
59 std::optional<RT::PiEvent> MEvent;
67 void *
const &
getPtr() const noexcept {
return MPtr; }
75 std::mutex MZeroInitEventMutex;
76 std::optional<RT::PiEvent> MZeroInitEvent;
85 const void *MDeviceGlobalPtr =
nullptr;
92 std::uint32_t MDeviceGlobalTSize = 0;
94 bool MIsDeviceImageScopeDecorated =
false;
99 : MUniqueId(UniqueId), MDeviceGlobalPtr(DeviceGlobalPtr) {}
105 bool IsDeviceImageScopeDecorated)
106 : MUniqueId(UniqueId), MImageIdentifiers{ImgId}, MKSIds{KSId},
107 MDeviceGlobalTSize(DeviceGlobalTSize),
108 MIsDeviceImageScopeDecorated(IsDeviceImageScopeDecorated) {}
112 assert(DeviceGlobalPtr &&
"Device global pointer cannot be null");
113 assert(!MDeviceGlobalPtr &&
114 "Device global pointer has already been initialized.");
115 MDeviceGlobalPtr = DeviceGlobalPtr;
121 std::uint32_t DeviceGlobalTSize,
122 bool IsDeviceImageScopeDecorated) {
123 if (MDeviceGlobalTSize != 0) {
127 assert(MDeviceGlobalTSize == DeviceGlobalTSize &&
128 "Device global intializations disagree on type size.");
130 MIsDeviceImageScopeDecorated == IsDeviceImageScopeDecorated &&
131 "Device global intializations disagree on image scope decoration.");
134 MImageIdentifiers.insert(ImgId);
136 MDeviceGlobalTSize = DeviceGlobalTSize;
137 MIsDeviceImageScopeDecorated = IsDeviceImageScopeDecorated;
142 getOrAllocateDeviceGlobalUSM(
const std::shared_ptr<queue_impl> &QueueImpl);
145 void removeAssociatedResources(
const context_impl *CtxImpl);
151 std::map<std::pair<const device_impl *, const context_impl *>,
154 std::mutex MDeviceToUSMPtrMapMutex;