@@ -107,11 +107,10 @@ ur_integrated_buffer_handle_t::ur_integrated_buffer_handle_t(
107107
108108ur_integrated_buffer_handle_t ::ur_integrated_buffer_handle_t (
109109 ur_context_handle_t hContext, void *hostPtr, size_t size,
110- device_access_mode_t accessMode, bool ownHostPtr, bool interopNativeHandle )
110+ device_access_mode_t accessMode, bool ownHostPtr)
111111 : ur_mem_buffer_t (hContext, size, accessMode) {
112- this ->IsInteropNativeHandle = interopNativeHandle;
113112 this ->ptr =
114- usm_unique_ptr_t (hostPtr, [hContext, ownHostPtr, this ](void *ptr) {
113+ usm_unique_ptr_t (hostPtr, [hContext, ownHostPtr](void *ptr) {
115114 if (!ownHostPtr || !checkL0LoaderTeardown ()) {
116115 return ;
117116 }
@@ -222,7 +221,7 @@ ur_discrete_buffer_handle_t::ur_discrete_buffer_handle_t(
222221ur_discrete_buffer_handle_t ::ur_discrete_buffer_handle_t (
223222 ur_context_handle_t hContext, ur_device_handle_t hDevice, void *devicePtr,
224223 size_t size, device_access_mode_t accessMode, void *writeBackMemory,
225- bool ownZePtr, bool interopNativeHandle )
224+ bool ownZePtr)
226225 : ur_mem_buffer_t(hContext, size, accessMode),
227226 deviceAllocations(hContext->getPlatform ()->getNumDevices()),
228227 activeAllocationDevice(hDevice), writeBackPtr(writeBackMemory),
@@ -233,9 +232,8 @@ ur_discrete_buffer_handle_t::ur_discrete_buffer_handle_t(
233232 devicePtr = allocateOnDevice (hDevice, size);
234233 } else {
235234 assert (hDevice);
236- this ->IsInteropNativeHandle = interopNativeHandle;
237235 deviceAllocations[hDevice->Id .value ()] = usm_unique_ptr_t (
238- devicePtr, [this , hContext = this ->hContext , ownZePtr](void *ptr) {
236+ devicePtr, [hContext = this ->hContext , ownZePtr](void *ptr) {
239237 if (!ownZePtr || !checkL0LoaderTeardown ()) {
240238 return ;
241239 }
@@ -466,10 +464,8 @@ ur_mem_image_t::ur_mem_image_t(ur_context_handle_t hContext,
466464ur_mem_image_t ::ur_mem_image_t (ur_context_handle_t hContext,
467465 const ur_image_format_t *pImageFormat,
468466 const ur_image_desc_t *pImageDesc,
469- ze_image_handle_t zeImage, bool ownZeImage,
470- bool interopNativeHandle)
467+ ze_image_handle_t zeImage, bool ownZeImage)
471468 : hContext(hContext), zeImage(zeImage, ownZeImage) {
472- this ->IsInteropNativeHandle = interopNativeHandle;
473469 UR_CALL_THROWS (ur2zeImageDesc (pImageFormat, pImageDesc, zeImageDesc));
474470}
475471
@@ -611,7 +607,7 @@ ur_result_t urMemBufferCreateWithNativeHandle(
611607
612608 if (useHostBuffer (hContext) && memoryAttrs.type == ZE_MEMORY_TYPE_HOST) {
613609 *phMem = ur_mem_handle_t_::create<ur_integrated_buffer_handle_t >(
614- hContext, ptr, size, accessMode, ownNativeHandle, true );
610+ hContext, ptr, size, accessMode, ownNativeHandle);
615611 // if useHostBuffer(hContext) is true but the allocation is on device, we'll
616612 // treat it as discrete memory
617613 } else if (memoryAttrs.type == ZE_MEMORY_TYPE_SHARED) {
@@ -623,14 +619,12 @@ ur_result_t urMemBufferCreateWithNativeHandle(
623619 // For host allocation, we need to copy the data to a device buffer
624620 // and then copy it back on release
625621 *phMem = ur_mem_handle_t_::create<ur_discrete_buffer_handle_t >(
626- hContext, hDevice, nullptr , size, accessMode, ptr, ownNativeHandle,
627- true );
622+ hContext, hDevice, nullptr , size, accessMode, ptr, ownNativeHandle);
628623 } else {
629624 // For device allocation, we can use it directly
630625 assert (hDevice);
631626 *phMem = ur_mem_handle_t_::create<ur_discrete_buffer_handle_t >(
632- hContext, hDevice, ptr, size, accessMode, nullptr , ownNativeHandle,
633- true );
627+ hContext, hDevice, ptr, size, accessMode, nullptr , ownNativeHandle);
634628 }
635629 }
636630
@@ -740,7 +734,7 @@ ur_result_t urMemImageCreateWithNativeHandle(
740734 bool ownNativeHandle = pProperties ? pProperties->isNativeHandleOwned : false ;
741735
742736 *phMem = ur_mem_handle_t_::create<ur_mem_image_t >(
743- hContext, pImageFormat, pImageDesc, zeImage, ownNativeHandle, true );
737+ hContext, pImageFormat, pImageDesc, zeImage, ownNativeHandle);
744738 return UR_RESULT_SUCCESS;
745739} catch (...) {
746740 return exceptionToResult (std::current_exception ());
0 commit comments