@@ -128,6 +128,7 @@ hipToUrImageChannelFormat(hipArray_Format hip_format,
128128 *return_image_channel_type = TO; \
129129 return UR_RESULT_SUCCESS; \
130130 }
131+
131132 HIP_TO_UR_IMAGE_CHANNEL_TYPE (HIP_AD_FORMAT_UNSIGNED_INT8,
132133 UR_IMAGE_CHANNEL_TYPE_UNSIGNED_INT8);
133134 HIP_TO_UR_IMAGE_CHANNEL_TYPE (HIP_AD_FORMAT_UNSIGNED_INT16,
@@ -144,6 +145,8 @@ hipToUrImageChannelFormat(hipArray_Format hip_format,
144145 UR_IMAGE_CHANNEL_TYPE_HALF_FLOAT);
145146 HIP_TO_UR_IMAGE_CHANNEL_TYPE (HIP_AD_FORMAT_FLOAT,
146147 UR_IMAGE_CHANNEL_TYPE_FLOAT);
148+
149+ #undef HIP_TO_UR_IMAGE_CHANNEL_TYPE
147150 default :
148151 return UR_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT;
149152 }
@@ -156,7 +159,6 @@ ur_result_t urTextureCreate(ur_sampler_handle_t hSampler,
156159 ur_exp_image_native_handle_t *phRetImage) {
157160
158161 try {
159- // / pi_sampler_properties
160162 // / Layout of UR samplers for HIP
161163 // /
162164 // / Sampler property layout:
@@ -425,12 +427,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImageFreeExp(
425427 try {
426428 hipArray_t ImageArray = reinterpret_cast <hipArray_t>(hImageMem);
427429 UR_CHECK_ERROR (hipArrayDestroy (ImageArray));
428- if (auto It = hDevice->ChildHipArrayFromMipmapMap .find (ImageArray);
429- It != hDevice->ChildHipArrayFromMipmapMap .end ()) {
430- UR_CHECK_ERROR (hipMipmappedArrayDestroy (
431- static_cast <hipMipmappedArray_t>(It->second )));
432- hDevice->ChildHipArrayFromMipmapMap .erase (It);
433- }
434430 } catch (ur_result_t Err) {
435431 return Err;
436432 } catch (...) {
@@ -625,7 +621,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImageCopyExp(
625621
626622 if (memType == hipMemoryTypeArray) {
627623 // HIP doesn not provide async copies between host and image arrays
628- // memory in versions early than 6.2.
624+ // memory in versions earlier than 6.2.
629625#if HIP_VERSION >= 60200000
630626 UR_CHECK_ERROR (
631627 hipMemcpyHtoAAsync (static_cast <hipArray_t>(pDst),
@@ -733,7 +729,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImageCopyExp(
733729
734730 if (memType == hipMemoryTypeArray) {
735731 // HIP doesn not provide async copies between image arrays and host
736- // memory in versions early than 6.2.
732+ // memory in versions earlier than 6.2.
737733#if HIP_VERSION >= 60200000
738734 UR_CHECK_ERROR (hipMemcpyAtoHAsync (
739735 DstWithOffset, static_cast <hipArray_t>(const_cast <void *>(pSrc)),
@@ -1095,8 +1091,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImportExternalMemoryExp(
10951091 extMemDesc.type = hipExternalMemoryHandleTypeOpaqueWin32;
10961092 break ;
10971093 case UR_EXP_EXTERNAL_MEM_TYPE_WIN32_NT_DX12_RESOURCE:
1098- // Memory descriptor flag values such as hipExternalMemoryDedicatedare
1099- // not available before HIP 5.6, so we safely fallback to unsupported.
1094+ // Memory descriptor flag values such as hipExternalMemoryDedicated
1095+ // are not available before HIP 5.6, so we safely fallback to marking
1096+ // this as an unsupported.
11001097#if HIP_VERSION >= 50600000
11011098 extMemDesc.type = hipExternalMemoryHandleTypeD3D12Resource;
11021099 extMemDesc.flags = hipExternalMemoryDedicated;
@@ -1230,6 +1227,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImportExternalSemaphoreExp(
12301227 extSemDesc.type = hipExternalSemaphoreHandleTypeD3D12Fence;
12311228 break ;
12321229 case UR_EXP_EXTERNAL_SEMAPHORE_TYPE_OPAQUE_FD:
1230+ [[fallthrough]];
12331231 default :
12341232 return UR_RESULT_ERROR_INVALID_VALUE;
12351233 }
0 commit comments