Skip to content

Commit c55dc2a

Browse files
committed
Resolved conflicts
1 parent 7f56cec commit c55dc2a

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

source/adapters/cuda/device.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -501,12 +501,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
501501
return ReturnValue(
502502
static_cast<uint64_t>(hDevice->getMaxChosenLocalMem()));
503503
} else {
504-
int LocalMemSize = 0;
505-
UR_CHECK_ERROR(cuDeviceGetAttribute(
506-
&LocalMemSize, CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK,
507-
hDevice->get()));
508-
detail::ur::assertion(LocalMemSize >= 0);
509-
return ReturnValue(static_cast<uint64_t>(LocalMemSize));
504+
return ReturnValue(
505+
static_cast<uint64_t>(hDevice->getMaxCapacityLocalMem()));
510506
}
511507
}
512508
case UR_DEVICE_INFO_ERROR_CORRECTION_SUPPORT: {

source/adapters/cuda/device.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ struct ur_device_handle_t_ {
4545
UR_CHECK_ERROR(cuDeviceGetAttribute(
4646
&MaxRegsPerBlock, CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK,
4747
cuDevice));
48+
UR_CHECK_ERROR(cuDeviceGetAttribute(
49+
&MaxCapacityLocalMem,
50+
CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN, cuDevice));
4851

4952
// Set local mem max size if env var is present
5053
static const char *LocalMemSizePtrUR =
@@ -56,9 +59,6 @@ struct ur_device_handle_t_ {
5659
: (LocalMemSizePtrPI ? LocalMemSizePtrPI : nullptr);
5760

5861
if (LocalMemSizePtr) {
59-
cuDeviceGetAttribute(
60-
&MaxCapacityLocalMem,
61-
CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN, cuDevice);
6262
MaxChosenLocalMem = std::atoi(LocalMemSizePtr);
6363
MaxLocalMemSizeChosen = true;
6464
}

0 commit comments

Comments
 (0)