@@ -300,15 +300,11 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueKernelLaunch(
300300 bool ProvidedLocalWorkGroupSize = (pLocalWorkSize != nullptr );
301301
302302 {
303- ur_result_t Result = urDeviceGetInfo (
304- hQueue->Device , UR_DEVICE_INFO_MAX_WORK_ITEM_SIZES,
305- sizeof (MaxThreadsPerBlock), MaxThreadsPerBlock, nullptr );
306- UR_ASSERT (Result == UR_RESULT_SUCCESS, Result);
303+ MaxThreadsPerBlock[0 ] = hQueue->Device ->getMaxBlockDimX ();
304+ MaxThreadsPerBlock[1 ] = hQueue->Device ->getMaxBlockDimY ();
305+ MaxThreadsPerBlock[2 ] = hQueue->Device ->getMaxBlockDimZ ();
307306
308- Result =
309- urDeviceGetInfo (hQueue->Device , UR_DEVICE_INFO_MAX_WORK_GROUP_SIZE,
310- sizeof (MaxWorkGroupSize), &MaxWorkGroupSize, nullptr );
311- UR_ASSERT (Result == UR_RESULT_SUCCESS, Result);
307+ MaxWorkGroupSize = hQueue->Device ->getMaxWorkGroupSize ();
312308
313309 // The MaxWorkGroupSize = 1024 for AMD GPU
314310 // The MaxThreadsPerBlock = {1024, 1024, 1024}
@@ -1480,7 +1476,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMPrefetch(
14801476
14811477 // If the device does not support managed memory access, we can't set
14821478 // mem_advise.
1483- if (!getAttribute ( Device, hipDeviceAttributeManagedMemory )) {
1479+ if (!Device-> getManagedMemSupport ( )) {
14841480 releaseEvent ();
14851481 setErrorMessage (" mem_advise ignored as device does not support "
14861482 " managed memory access" ,
@@ -1554,7 +1550,7 @@ urEnqueueUSMAdvise(ur_queue_handle_t hQueue, const void *pMem, size_t size,
15541550
15551551 // If the device does not support managed memory access, we can't set
15561552 // mem_advise.
1557- if (!getAttribute ( Device, hipDeviceAttributeManagedMemory )) {
1553+ if (!Device-> getManagedMemSupport ( )) {
15581554 releaseEvent ();
15591555 setErrorMessage (" mem_advise ignored as device does not support "
15601556 " managed memory access" ,
@@ -1571,7 +1567,7 @@ urEnqueueUSMAdvise(ur_queue_handle_t hQueue, const void *pMem, size_t size,
15711567 UR_USM_ADVICE_FLAG_SET_ACCESSED_BY_DEVICE |
15721568 UR_USM_ADVICE_FLAG_CLEAR_ACCESSED_BY_DEVICE |
15731569 UR_USM_ADVICE_FLAG_DEFAULT)) {
1574- if (!getAttribute ( Device, hipDeviceAttributeConcurrentManagedAccess )) {
1570+ if (!Device-> getConcurrentManagedAccess ( )) {
15751571 releaseEvent ();
15761572 setErrorMessage (" mem_advise ignored as device does not support "
15771573 " concurrent managed access" ,
0 commit comments