@@ -300,15 +300,11 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueKernelLaunch(
300
300
bool ProvidedLocalWorkGroupSize = (pLocalWorkSize != nullptr );
301
301
302
302
{
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 ();
307
306
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 ();
312
308
313
309
// The MaxWorkGroupSize = 1024 for AMD GPU
314
310
// The MaxThreadsPerBlock = {1024, 1024, 1024}
@@ -423,11 +419,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueKernelLaunch(
423
419
: (LocalMemSzPtrPI ? LocalMemSzPtrPI : nullptr );
424
420
425
421
if (LocalMemSzPtr) {
426
- int DeviceMaxLocalMem = 0 ;
427
- UR_CHECK_ERROR (hipDeviceGetAttribute (
428
- &DeviceMaxLocalMem, hipDeviceAttributeMaxSharedMemoryPerBlock,
429
- Dev->get ()));
430
-
422
+ int DeviceMaxLocalMem = Dev->getDeviceMaxLocalMem ();
431
423
static const int EnvVal = std::atoi (LocalMemSzPtr);
432
424
if (EnvVal <= 0 || EnvVal > DeviceMaxLocalMem) {
433
425
setErrorMessage (LocalMemSzPtrUR ? " Invalid value specified for "
@@ -1484,7 +1476,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMPrefetch(
1484
1476
1485
1477
// If the device does not support managed memory access, we can't set
1486
1478
// mem_advise.
1487
- if (!getAttribute ( Device, hipDeviceAttributeManagedMemory )) {
1479
+ if (!Device-> getManagedMemSupport ( )) {
1488
1480
releaseEvent ();
1489
1481
setErrorMessage (" mem_advise ignored as device does not support "
1490
1482
" managed memory access" ,
@@ -1558,7 +1550,7 @@ urEnqueueUSMAdvise(ur_queue_handle_t hQueue, const void *pMem, size_t size,
1558
1550
1559
1551
// If the device does not support managed memory access, we can't set
1560
1552
// mem_advise.
1561
- if (!getAttribute ( Device, hipDeviceAttributeManagedMemory )) {
1553
+ if (!Device-> getManagedMemSupport ( )) {
1562
1554
releaseEvent ();
1563
1555
setErrorMessage (" mem_advise ignored as device does not support "
1564
1556
" managed memory access" ,
@@ -1575,7 +1567,7 @@ urEnqueueUSMAdvise(ur_queue_handle_t hQueue, const void *pMem, size_t size,
1575
1567
UR_USM_ADVICE_FLAG_SET_ACCESSED_BY_DEVICE |
1576
1568
UR_USM_ADVICE_FLAG_CLEAR_ACCESSED_BY_DEVICE |
1577
1569
UR_USM_ADVICE_FLAG_DEFAULT)) {
1578
- if (!getAttribute ( Device, hipDeviceAttributeConcurrentManagedAccess )) {
1570
+ if (!Device-> getConcurrentManagedAccess ( )) {
1579
1571
releaseEvent ();
1580
1572
setErrorMessage (" mem_advise ignored as device does not support "
1581
1573
" concurrent managed access" ,
0 commit comments