File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -953,8 +953,17 @@ UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImageGetInfoExp(
953
953
ur_context_handle_t , ur_exp_image_mem_native_handle_t hImageMem,
954
954
ur_image_info_t propName, void *pPropValue, size_t *pPropSizeRet) {
955
955
956
+ CUarray hCUarray;
957
+ CUresult Err = cuMipmappedArrayGetLevel (
958
+ &hCUarray, reinterpret_cast <CUmipmappedArray>(hImageMem), 0 );
959
+
960
+ // If cuMipmappedArrayGetLevel failed, hImageMem is already CUarray.
961
+ if (Err != CUDA_SUCCESS) {
962
+ hCUarray = reinterpret_cast <CUarray>(hImageMem);
963
+ }
964
+
956
965
CUDA_ARRAY3D_DESCRIPTOR ArrayDesc;
957
- UR_CHECK_ERROR (cuArray3DGetDescriptor (&ArrayDesc, (CUarray)hImageMem ));
966
+ UR_CHECK_ERROR (cuArray3DGetDescriptor (&ArrayDesc, hCUarray ));
958
967
switch (propName) {
959
968
case UR_IMAGE_INFO_WIDTH:
960
969
if (pPropValue) {
You can’t perform that action at this time.
0 commit comments