Skip to content

Commit 6745dd5

Browse files
committed
Fix review comments
1 parent a41ad51 commit 6745dd5

File tree

8 files changed

+17
-17
lines changed

8 files changed

+17
-17
lines changed

offload/liboffload/API/Device.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def ol_device_info_t : Enum {
4343
TaggedEtor<"ADDRESS_BITS", "uint32_t", "Number of bits used to represent an address in device memory">,
4444
TaggedEtor<"MAX_MEM_ALLOC_SIZE", "uint64_t", "The maximum size of memory object allocation in bytes">,
4545
TaggedEtor<"GLOBAL_MEM_SIZE", "uint64_t", "The size of global device memory in bytes">,
46-
TaggedEtor<"WORK_GROUP_SHARED_MEM_SIZE", "uint64_t", "The maximum size of shared memory per work group in bytes">,
46+
TaggedEtor<"WORK_GROUP_LOCAL_MEM_SIZE", "uint64_t", "The maximum size of local shared memory per work group in bytes">,
4747
];
4848
list<TaggedEtor> fp_configs = !foreach(type, ["Single", "Double", "Half"], TaggedEtor<type # "_FP_CONFIG", "ol_device_fp_capability_flags_t", type # " precision floating point capability">);
4949
list<TaggedEtor> native_vec_widths = !foreach(type, ["char","short","int","long","float","double","half"], TaggedEtor<"NATIVE_VECTOR_WIDTH_" # type, "uint32_t", "Native vector width for " # type>);

offload/liboffload/src/OffloadImpl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ Error olGetDeviceInfoImplDetail(ol_device_handle_t Device,
495495
return Info.write(static_cast<uint32_t>(Value));
496496
}
497497

498-
case OL_DEVICE_INFO_WORK_GROUP_SHARED_MEM_SIZE: {
498+
case OL_DEVICE_INFO_WORK_GROUP_LOCAL_MEM_SIZE: {
499499
if (!std::holds_alternative<uint64_t>(Entry->Value))
500500
return makeError(ErrorCode::BACKEND_FAILURE,
501501
"plugin returned incorrect type");
@@ -597,7 +597,7 @@ Error olGetDeviceInfoImplDetailHost(ol_device_handle_t Device,
597597
return Info.write<uint32_t>(std::numeric_limits<uintptr_t>::digits);
598598
case OL_DEVICE_INFO_MAX_MEM_ALLOC_SIZE:
599599
case OL_DEVICE_INFO_GLOBAL_MEM_SIZE:
600-
case OL_DEVICE_INFO_WORK_GROUP_SHARED_MEM_SIZE:
600+
case OL_DEVICE_INFO_WORK_GROUP_LOCAL_MEM_SIZE:
601601
return Info.write<uint64_t>(0);
602602
default:
603603
return createOffloadError(ErrorCode::INVALID_ENUMERATION,

offload/plugins-nextgen/amdgpu/src/rtl.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2189,10 +2189,9 @@ struct AMDGPUDeviceTy : public GenericDeviceTy, AMDGenericDeviceTy {
21892189
// Retrieve the size of the group memory.
21902190
for (const auto *Pool : AllMemoryPools) {
21912191
if (Pool->isGroup()) {
2192-
size_t Size = 0;
2193-
if (auto Err = Pool->getAttr(HSA_AMD_MEMORY_POOL_INFO_SIZE, Size))
2192+
if (auto Err = Pool->getAttr(HSA_AMD_MEMORY_POOL_INFO_SIZE,
2193+
MaxBlockSharedMemSize))
21942194
return Err;
2195-
MaxBlockSharedMemSize = Size;
21962195
break;
21972196
}
21982197
}
@@ -2935,7 +2934,7 @@ struct AMDGPUDeviceTy : public GenericDeviceTy, AMDGenericDeviceTy {
29352934
Info.add("Cacheline Size", TmpUInt);
29362935

29372936
Info.add("Max Shared Memory per Work Group", MaxBlockSharedMemSize, "bytes",
2938-
DeviceInfo::WORK_GROUP_SHARED_MEM_SIZE);
2937+
DeviceInfo::WORK_GROUP_LOCAL_MEM_SIZE);
29392938

29402939
Status = getDeviceAttrRaw(HSA_AMD_AGENT_INFO_MAX_CLOCK_FREQUENCY, TmpUInt);
29412940
if (Status == HSA_STATUS_SUCCESS)

offload/plugins-nextgen/common/include/PluginInterface.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -794,8 +794,9 @@ struct GenericDeviceTy : public DeviceAllocatorTy {
794794
/// Get the unique identifier of the device.
795795
const char *getDeviceUid() const { return DeviceUid.c_str(); }
796796

797-
/// Get the total shared memory per block that can be used in any kernel.
798-
uint32_t getMaxBlockSharedMemSize() const { return MaxBlockSharedMemSize; }
797+
/// Get the total shared memory per block (in bytes) that can be used in any
798+
/// kernel.
799+
size_t getMaxBlockSharedMemSize() const { return MaxBlockSharedMemSize; }
799800

800801
/// Set the context of the device if needed, before calling device-specific
801802
/// functions. Plugins may implement this function as a no-op if not needed.
@@ -1256,7 +1257,7 @@ struct GenericDeviceTy : public DeviceAllocatorTy {
12561257
#endif
12571258

12581259
/// The total per-block native shared memory that a kernel may use.
1259-
uint32_t MaxBlockSharedMemSize = 0;
1260+
size_t MaxBlockSharedMemSize = 0;
12601261
};
12611262

12621263
/// Class implementing common functionalities of offload plugins. Each plugin

offload/plugins-nextgen/cuda/src/rtl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,7 @@ struct CUDADeviceTy : public GenericDeviceTy {
10961096
Info.add("Total Constant Memory", TmpInt, "bytes");
10971097

10981098
Info.add("Max Shared Memory per Block", MaxBlockSharedMemSize, "bytes",
1099-
DeviceInfo::WORK_GROUP_SHARED_MEM_SIZE);
1099+
DeviceInfo::WORK_GROUP_LOCAL_MEM_SIZE);
11001100

11011101
Res = getDeviceAttrRaw(CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK, TmpInt);
11021102
if (Res == CUDA_SUCCESS)

offload/tools/deviceinfo/llvm-offload-device-info.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,9 @@ ol_result_t printDevice(std::ostream &S, ol_device_handle_t D) {
205205
S, D, OL_DEVICE_INFO_MAX_MEM_ALLOC_SIZE, "Max Mem Allocation Size", "B"));
206206
OFFLOAD_ERR(printDeviceValue<uint64_t>(S, D, OL_DEVICE_INFO_GLOBAL_MEM_SIZE,
207207
"Global Mem Size", "B"));
208-
OFFLOAD_ERR(printDeviceValue<uint64_t>(
209-
S, D, OL_DEVICE_INFO_WORK_GROUP_SHARED_MEM_SIZE,
210-
"Work Group Shared Mem Size", "B"));
208+
OFFLOAD_ERR(
209+
printDeviceValue<uint64_t>(S, D, OL_DEVICE_INFO_WORK_GROUP_LOCAL_MEM_SIZE,
210+
"Work Group Shared Mem Size", "B"));
211211
OFFLOAD_ERR(
212212
(printDeviceValue<ol_device_fp_capability_flags_t, PrintKind::FP_FLAGS>(
213213
S, D, OL_DEVICE_INFO_SINGLE_FP_CONFIG,

offload/unittests/OffloadAPI/device/olGetDeviceInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,10 @@ OL_DEVICE_INFO_TEST_DEVICE_VALUE_GT(GlobalMemSize, uint64_t,
218218
OL_DEVICE_INFO_TEST_HOST_SUCCESS(GlobalMemSize, uint64_t,
219219
OL_DEVICE_INFO_GLOBAL_MEM_SIZE);
220220
OL_DEVICE_INFO_TEST_DEVICE_VALUE_GT(SharedMemSize, uint64_t,
221-
OL_DEVICE_INFO_WORK_GROUP_SHARED_MEM_SIZE,
221+
OL_DEVICE_INFO_WORK_GROUP_LOCAL_MEM_SIZE,
222222
0);
223223
OL_DEVICE_INFO_TEST_HOST_SUCCESS(SharedMemSize, uint64_t,
224-
OL_DEVICE_INFO_WORK_GROUP_SHARED_MEM_SIZE);
224+
OL_DEVICE_INFO_WORK_GROUP_LOCAL_MEM_SIZE);
225225

226226
TEST_P(olGetDeviceInfoTest, InvalidNullHandleDevice) {
227227
ol_device_type_t DeviceType;

offload/unittests/OffloadAPI/device/olGetDeviceInfoSize.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ OL_DEVICE_INFO_SIZE_TEST_EQ(MaxMemAllocSize, uint64_t,
7272
OL_DEVICE_INFO_SIZE_TEST_EQ(GlobalMemSize, uint64_t,
7373
OL_DEVICE_INFO_GLOBAL_MEM_SIZE);
7474
OL_DEVICE_INFO_SIZE_TEST_EQ(SharedMemSize, uint64_t,
75-
OL_DEVICE_INFO_WORK_GROUP_SHARED_MEM_SIZE);
75+
OL_DEVICE_INFO_WORK_GROUP_LOCAL_MEM_SIZE);
7676

7777
TEST_P(olGetDeviceInfoSizeTest, SuccessMaxWorkGroupSizePerDimension) {
7878
size_t Size = 0;

0 commit comments

Comments
 (0)