@@ -54,7 +54,7 @@ context_impl::context_impl(const std::vector<sycl::device> Devices,
54
54
DeviceIds.push_back (getSyclObjImpl (D)->getHandleRef ());
55
55
}
56
56
57
- getAdapter ()-> call <UrApiKind::urContextCreate>(
57
+ getAdapter (). call <UrApiKind::urContextCreate>(
58
58
DeviceIds.size (), DeviceIds.data (), nullptr , &MContext);
59
59
60
60
MKernelProgramCache.setContextPtr (this );
@@ -102,16 +102,16 @@ context_impl::context_impl(ur_context_handle_t UrContext,
102
102
// TODO: Move this backend-specific retain of the context to SYCL-2020 style
103
103
// make_context<backend::opencl> interop, when that is created.
104
104
if (getBackend () == sycl::backend::opencl) {
105
- getAdapter ()-> call <UrApiKind::urContextRetain>(MContext);
105
+ getAdapter (). call <UrApiKind::urContextRetain>(MContext);
106
106
}
107
107
MKernelProgramCache.setContextPtr (this );
108
108
}
109
109
110
110
cl_context context_impl::get () const {
111
111
// TODO catch an exception and put it to list of asynchronous exceptions
112
- getAdapter ()-> call <UrApiKind::urContextRetain>(MContext);
112
+ getAdapter (). call <UrApiKind::urContextRetain>(MContext);
113
113
ur_native_handle_t nativeHandle = 0 ;
114
- getAdapter ()-> call <UrApiKind::urContextGetNativeHandle>(MContext,
114
+ getAdapter (). call <UrApiKind::urContextGetNativeHandle>(MContext,
115
115
&nativeHandle);
116
116
return ur::cast<cl_context>(nativeHandle);
117
117
}
@@ -120,7 +120,7 @@ context_impl::~context_impl() {
120
120
try {
121
121
// Free all events associated with the initialization of device globals.
122
122
for (auto &DeviceGlobalInitializer : MDeviceGlobalInitializers)
123
- DeviceGlobalInitializer.second .ClearEvents (getAdapter ());
123
+ DeviceGlobalInitializer.second .ClearEvents (& getAdapter ());
124
124
// Free all device_global USM allocations associated with this context.
125
125
for (const void *DeviceGlobal : MAssociatedDeviceGlobals) {
126
126
DeviceGlobalMapEntry *DGEntry =
@@ -130,10 +130,10 @@ context_impl::~context_impl() {
130
130
}
131
131
for (auto LibProg : MCachedLibPrograms) {
132
132
assert (LibProg.second && " Null program must not be kept in the cache" );
133
- getAdapter ()-> call <UrApiKind::urProgramRelease>(LibProg.second );
133
+ getAdapter (). call <UrApiKind::urProgramRelease>(LibProg.second );
134
134
}
135
135
// TODO catch an exception and put it to list of asynchronous exceptions
136
- getAdapter ()-> call_nocheck <UrApiKind::urContextRelease>(MContext);
136
+ getAdapter (). call_nocheck <UrApiKind::urContextRelease>(MContext);
137
137
} catch (std::exception &e) {
138
138
__SYCL_REPORT_EXCEPTION_TO_STREAM (" exception in ~context_impl" , e);
139
139
}
@@ -146,7 +146,7 @@ const async_handler &context_impl::get_async_handler() const {
146
146
template <>
147
147
uint32_t context_impl::get_info<info::context::reference_count>() const {
148
148
return get_context_info<info::context::reference_count>(this ->getHandleRef (),
149
- this ->getAdapter ());
149
+ & this ->getAdapter ());
150
150
}
151
151
template <> platform context_impl::get_info<info::context::platform>() const {
152
152
return createSyclObjFromImpl<platform>(*MPlatform);
@@ -292,9 +292,9 @@ context_impl::findMatchingDeviceImpl(ur_device_handle_t &DeviceUR) const {
292
292
}
293
293
294
294
ur_native_handle_t context_impl::getNative () const {
295
- const auto &Adapter = getAdapter ();
295
+ detail::adapter_impl &Adapter = getAdapter ();
296
296
ur_native_handle_t Handle;
297
- Adapter-> call <UrApiKind::urContextGetNativeHandle>(getHandleRef (), &Handle);
297
+ Adapter. call <UrApiKind::urContextGetNativeHandle>(getHandleRef (), &Handle);
298
298
if (getBackend () == backend::opencl) {
299
299
__SYCL_OCL_CALL (clRetainContext, ur::cast<cl_context>(Handle));
300
300
}
@@ -345,7 +345,7 @@ std::vector<ur_event_handle_t> context_impl::initializeDeviceGlobals(
345
345
if (!MDeviceGlobalNotInitializedCnt.load (std::memory_order_acquire))
346
346
return {};
347
347
348
- const AdapterPtr &Adapter = getAdapter ();
348
+ detail::adapter_impl &Adapter = getAdapter ();
349
349
device_impl &DeviceImpl = QueueImpl.getDeviceImpl ();
350
350
std::lock_guard<std::mutex> NativeProgramLock (MDeviceGlobalInitializersMutex);
351
351
auto ImgIt = MDeviceGlobalInitializers.find (
@@ -365,11 +365,11 @@ std::vector<ur_event_handle_t> context_impl::initializeDeviceGlobals(
365
365
InitEventsRef.begin (), InitEventsRef.end (),
366
366
[&Adapter](const ur_event_handle_t &Event) {
367
367
return get_event_info<info::event::command_execution_status>(
368
- Event, * Adapter) == info::event_command_status::complete;
368
+ Event, Adapter) == info::event_command_status::complete;
369
369
});
370
370
// Release the removed events.
371
371
for (auto EventIt = NewEnd; EventIt != InitEventsRef.end (); ++EventIt)
372
- Adapter-> call <UrApiKind::urEventRelease>(*EventIt);
372
+ Adapter. call <UrApiKind::urEventRelease>(*EventIt);
373
373
// Remove them from the collection.
374
374
InitEventsRef.erase (NewEnd, InitEventsRef.end ());
375
375
// If there are no more events, we can mark it as fully initialized.
@@ -431,14 +431,14 @@ std::vector<ur_event_handle_t> context_impl::initializeDeviceGlobals(
431
431
// are cleaned up separately from cleaning up the device global USM memory
432
432
// this must retain the event.
433
433
{
434
- if (OwnedUrEvent ZIEvent = DeviceGlobalUSM.getInitEvent (* Adapter))
434
+ if (OwnedUrEvent ZIEvent = DeviceGlobalUSM.getInitEvent (Adapter))
435
435
InitEventsRef.push_back (ZIEvent.TransferOwnership ());
436
436
}
437
437
// Write the pointer to the device global and store the event in the
438
438
// initialize events list.
439
439
ur_event_handle_t InitEvent;
440
440
void *const &USMPtr = DeviceGlobalUSM.getPtr ();
441
- Adapter-> call <UrApiKind::urEnqueueDeviceGlobalVariableWrite>(
441
+ Adapter. call <UrApiKind::urEnqueueDeviceGlobalVariableWrite>(
442
442
QueueImpl.getHandleRef (), NativePrg,
443
443
DeviceGlobalEntry->MUniqueId .c_str (), false , sizeof (void *), 0 ,
444
444
&USMPtr, 0 , nullptr , &InitEvent);
@@ -577,7 +577,7 @@ context_impl::get_default_memory_pool(const context &Context,
577
577
578
578
detail::device_impl &DevImpl = *detail::getSyclObjImpl (Device);
579
579
ur_device_handle_t DeviceHandle = DevImpl.getHandleRef ();
580
- const sycl:: detail::AdapterPtr &Adapter = this ->getAdapter ();
580
+ detail::adapter_impl &Adapter = this ->getAdapter ();
581
581
582
582
// Check dev is already in our list of device pool pairs.
583
583
if (auto it = std::find_if (MMemPoolImplPtrs.begin (), MMemPoolImplPtrs.end (),
@@ -590,7 +590,7 @@ context_impl::get_default_memory_pool(const context &Context,
590
590
591
591
// The memory_pool_impl does not exist for this device yet.
592
592
ur_usm_pool_handle_t PoolHandle;
593
- Adapter-> call <sycl::errc::runtime,
593
+ Adapter. call <sycl::errc::runtime,
594
594
sycl::detail::UrApiKind::urUSMPoolGetDefaultDevicePoolExp>(
595
595
this ->getHandleRef (), DeviceHandle, &PoolHandle);
596
596
0 commit comments