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 @@ -961,8 +961,17 @@ UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImageGetInfoExp(
961961 ur_context_handle_t , ur_exp_image_mem_native_handle_t hImageMem,
962962 ur_image_info_t propName, void *pPropValue, size_t *pPropSizeRet) {
963963
964+ CUarray hCUarray;
965+ CUresult Err = cuMipmappedArrayGetLevel (
966+ &hCUarray, reinterpret_cast <CUmipmappedArray>(hImageMem), 0 );
967+
968+ // If cuMipmappedArrayGetLevel failed, hImageMem is already CUarray.
969+ if (Err != CUDA_SUCCESS) {
970+ hCUarray = reinterpret_cast <CUarray>(hImageMem);
971+ }
972+
964973 CUDA_ARRAY3D_DESCRIPTOR ArrayDesc;
965- UR_CHECK_ERROR (cuArray3DGetDescriptor (&ArrayDesc, (CUarray)hImageMem ));
974+ UR_CHECK_ERROR (cuArray3DGetDescriptor (&ArrayDesc, hCUarray ));
966975 switch (propName) {
967976 case UR_IMAGE_INFO_WIDTH:
968977 if (pPropValue) {
You can’t perform that action at this time.
0 commit comments