@@ -1191,31 +1191,38 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
11911191    //  Intel extension for device LUID. This returns the LUID as
11921192    //  std::array<std::byte, 8>. For details about this extension,
11931193    //  see sycl/doc/extensions/supported/sycl_ext_intel_device_info.md.
1194-     char  *LUID =  nullptr ;
1195-     cuDeviceGetLuid (LUID, nullptr , hDevice->get ());
1194+     std::array< char ,  8 > LUID{} ;
1195+     cuDeviceGetLuid (LUID. data () , nullptr , hDevice->get ());
11961196
1197-     std::array<unsigned  char , 8 > Name = {};
1197+     bool  isAllZeros = true ;
1198+     for  (char  num : LUID) {
1199+       if  (num != 0 ) {
1200+         isAllZeros = false ;
1201+       }
1202+     }
11981203
1199-     if  (LUID ==  nullptr ) {
1204+     if  (isAllZeros ) {
12001205      return  UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
12011206    }
12021207
1203-     std::copy (LUID, LUID + 8 , Name.begin ());
1208+     std::array<unsigned  char , 8 > Name{};
1209+     std::copy (LUID.begin (), LUID.end (), Name.begin ());
12041210    return  ReturnValue (Name.data (), 8 );
12051211  }
12061212  case  UR_DEVICE_INFO_NODE_MASK: {
12071213    //  Device node mask is only available on Windows.
12081214    //  Intel extension for device node mask. This returns the node mask as
12091215    //  uint32_t. For details about this extension,
12101216    //  see sycl/doc/extensions/supported/sycl_ext_intel_device_info.md.
1211-     uint32_t  * nodeMask = nullptr ;
1212-     cuDeviceGetLuid (nullptr , nodeMask, hDevice->get ());
1217+     uint32_t  nodeMask = 0 ;
1218+     cuDeviceGetLuid (nullptr , & nodeMask, hDevice->get ());
12131219
1214-     if  (nodeMask == nullptr ) {
1220+     //  If nodeMask has not changed, return unsupported.
1221+     if  (nodeMask == 0 ) {
12151222      return  UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
12161223    }
12171224
1218-     return  ReturnValue (* nodeMask);
1225+     return  ReturnValue (nodeMask);
12191226  }
12201227  default :
12211228    break ;
0 commit comments