@@ -259,9 +259,9 @@ image_channel_type convertChannelType(ur_image_channel_type_t Type) {
259
259
}
260
260
261
261
template <typename T>
262
- static void getImageInfo (const ContextImplPtr &Context, ur_image_info_t Info,
263
- T &Dest, ur_mem_handle_t InteropMemObject) {
264
- const AdapterPtr &Adapter = Context-> getAdapter ();
262
+ static void getImageInfo (context_impl &Context, ur_image_info_t Info, T &Dest ,
263
+ ur_mem_handle_t InteropMemObject) {
264
+ const AdapterPtr &Adapter = Context. getAdapter ();
265
265
Adapter->call <UrApiKind::urMemImageGetInfo>(InteropMemObject, Info, sizeof (T),
266
266
&Dest, nullptr );
267
267
}
@@ -274,8 +274,8 @@ image_impl::image_impl(cl_mem MemObject, const context &SyclContext,
274
274
std::move (Allocator)),
275
275
MDimensions(Dimensions), MRange({0 , 0 , 0 }) {
276
276
ur_mem_handle_t Mem = ur::cast<ur_mem_handle_t >(BaseT::MInteropMemObject);
277
- const ContextImplPtr &Context = getSyclObjImpl (SyclContext);
278
- const AdapterPtr &Adapter = Context-> getAdapter ();
277
+ detail::context_impl &Context = * getSyclObjImpl (SyclContext);
278
+ const AdapterPtr &Adapter = Context. getAdapter ();
279
279
Adapter->call <UrApiKind::urMemGetInfo>(Mem, UR_MEM_INFO_SIZE, sizeof (size_t ),
280
280
&(BaseT::MSizeInBytes), nullptr );
281
281
@@ -323,7 +323,7 @@ image_impl::image_impl(ur_native_handle_t MemObject, const context &SyclContext,
323
323
setPitches (); // sets MRowPitch, MSlice and BaseT::MSizeInBytes
324
324
}
325
325
326
- void *image_impl::allocateMem (ContextImplPtr Context, bool InitFromUserData,
326
+ void *image_impl::allocateMem (context_impl * Context, bool InitFromUserData,
327
327
void *HostPtr,
328
328
ur_event_handle_t &OutEventToWait) {
329
329
bool HostPtrReadOnly = false ;
@@ -338,13 +338,13 @@ void *image_impl::allocateMem(ContextImplPtr Context, bool InitFromUserData,
338
338
" The check an image format failed." );
339
339
340
340
return MemoryManager::allocateMemImage (
341
- std::move ( Context) , this , HostPtr, HostPtrReadOnly,
342
- BaseT::getSizeInBytes (), Desc, Format, BaseT::MInteropEvent ,
343
- BaseT::MInteropContext, MProps, OutEventToWait);
341
+ Context, this , HostPtr, HostPtrReadOnly, BaseT::getSizeInBytes (), Desc ,
342
+ Format, BaseT::MInteropEvent, BaseT::MInteropContext. get (), MProps ,
343
+ OutEventToWait);
344
344
}
345
345
346
346
bool image_impl::checkImageDesc (const ur_image_desc_t &Desc,
347
- ContextImplPtr Context, void *UserPtr) {
347
+ context_impl * Context, void *UserPtr) {
348
348
if (checkAny (Desc.type , UR_MEM_TYPE_IMAGE1D, UR_MEM_TYPE_IMAGE1D_ARRAY,
349
349
UR_MEM_TYPE_IMAGE2D_ARRAY, UR_MEM_TYPE_IMAGE2D) &&
350
350
!checkImageValueRange<info::device::image2d_max_width>(
@@ -409,7 +409,7 @@ bool image_impl::checkImageDesc(const ur_image_desc_t &Desc,
409
409
}
410
410
411
411
bool image_impl::checkImageFormat (const ur_image_format_t &Format,
412
- ContextImplPtr Context) {
412
+ context_impl * Context) {
413
413
(void )Context;
414
414
if (checkAny (Format.channelOrder , UR_IMAGE_CHANNEL_ORDER_INTENSITY,
415
415
UR_IMAGE_CHANNEL_ORDER_LUMINANCE) &&
@@ -451,7 +451,7 @@ bool image_impl::checkImageFormat(const ur_image_format_t &Format,
451
451
return true ;
452
452
}
453
453
454
- std::vector<device> image_impl::getDevices (const ContextImplPtr Context) {
454
+ std::vector<device> image_impl::getDevices (context_impl * Context) {
455
455
if (!Context)
456
456
return {};
457
457
return Context->get_info <info::context::devices>();
0 commit comments