Skip to content

Commit b53364b

Browse files
committed
[Offload] Define additional device info properties
Add the following properties in Offload device info: * VENDOR_ID * NUM_COMPUTE_UNITS * [SINGLE|DOUBLE|HALF]_FP_CONFIG * NATIVE_VECTOR_WIDTH_[CHAR|SHORT|INT|LONG|FLOAT|DOUBLE|HALF] * MAX_CLOCK_FREQUENCY * MEMORY_CLOCK_RATE * ADDRESS_BITS * MAX_MEM_ALLOC_SIZE * GLOBAL_MEM_SIZE Add a bitfield option to enumerators, allowing the values to be bit-shifted instead of incremented. Generate the per-type enums using `foreach` to reduce code duplication. Use macros in unit test definitions to reduce code duplication.
1 parent 2f9f92a commit b53364b

File tree

12 files changed

+313
-58
lines changed

12 files changed

+313
-58
lines changed

offload/liboffload/API/APIDefs.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@ class Enum : APIObject {
168168
// all Etor values must be TaggedEtor records
169169
bit is_typed = 0;
170170

171+
// This refers to whether the enumerator is used to name bits of a bit field,
172+
// where consecutive values are bit-shifted rather than incremented.
173+
bit is_bit_field = 0;
174+
171175
list<Etor> etors = [];
172176
}
173177

offload/liboffload/API/Device.td

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,49 @@ def DeviceInfo : Enum {
2626
let name = "ol_device_info_t";
2727
let desc = "Supported device info.";
2828
let is_typed = 1;
29-
let etors =[
29+
list<TaggedEtor> basic_etors =[
3030
TaggedEtor<"TYPE", "ol_device_type_t", "type of the device">,
3131
TaggedEtor<"PLATFORM", "ol_platform_handle_t", "the platform associated with the device">,
3232
TaggedEtor<"NAME", "char[]", "Device name">,
3333
TaggedEtor<"VENDOR", "char[]", "Device vendor">,
3434
TaggedEtor<"DRIVER_VERSION", "char[]", "Driver version">,
3535
TaggedEtor<"MAX_WORK_GROUP_SIZE", "uint32_t", "Maximum total work group size in work items">,
3636
TaggedEtor<"MAX_WORK_GROUP_SIZE_PER_DIMENSION", "ol_dimensions_t", "Maximum work group size in each dimension">,
37+
TaggedEtor<"VENDOR_ID", "uint32_t", "A unique vendor device identifier assigned by PCI-SIG">,
38+
TaggedEtor<"NUM_COMPUTE_UNITS", "uint32_t", "The number of parallel compute units available to the device">,
39+
TaggedEtor<"MAX_CLOCK_FREQUENCY", "uint32_t", "The maximum configured clock frequency of this device in MHz">,
40+
TaggedEtor<"MEMORY_CLOCK_RATE", "uint32_t", "Memory clock frequency in MHz">,
41+
TaggedEtor<"ADDRESS_BITS", "uint32_t", "Number of bits used to represent an address in device memory">,
42+
TaggedEtor<"MAX_MEM_ALLOC_SIZE", "uint64_t", "The maximum size of memory object allocation in bytes">,
43+
TaggedEtor<"GLOBAL_MEM_SIZE", "uint64_t", "The size of global device memory in bytes">,
44+
];
45+
list<TaggedEtor> fp_configs = !foreach(type, ["Single", "Double", "Half"], TaggedEtor<type # "_FP_CONFIG", "ol_device_fp_capability_flags_t", type # " precision floating point capability">);
46+
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>);
47+
let etors = !listconcat(basic_etors, fp_configs, native_vec_widths);
48+
}
49+
50+
def : Enum {
51+
let name = "ol_device_fp_capability_flag_t";
52+
let desc = "Device floating-point capability flags";
53+
let is_bit_field = 1;
54+
let etors =[
55+
Etor<"CORRECTLY_ROUNDED_DIVIDE_SQRT", "Support correctly rounded divide and sqrt">,
56+
Etor<"ROUND_TO_NEAREST", "Support round to nearest">,
57+
Etor<"ROUND_TO_ZERO", "Support round to zero">,
58+
Etor<"ROUND_TO_INF", "Support round to infinity">,
59+
Etor<"INF_NAN", "Support INF to NAN">,
60+
Etor<"DENORM", "Support denorm">,
61+
Etor<"FMA", "Support fused multiply-add">,
62+
Etor<"SOFT_FLOAT", "Basic floating point operations implemented in software">,
3763
];
3864
}
3965

66+
def : Typedef {
67+
let name = "ol_device_fp_capability_flags_t";
68+
let desc = "Device floating-point capability flags";
69+
let value = "uint32_t";
70+
}
71+
4072
def : FptrTypedef {
4173
let name = "ol_device_iterate_cb_t";
4274
let desc = "User-provided function to be used with `olIterateDevices`";

offload/liboffload/src/OffloadImpl.cpp

Lines changed: 89 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,50 @@ Error olGetDeviceInfoImplDetail(ol_device_handle_t Device,
302302
};
303303

304304
// These are not implemented by the plugin interface
305-
if (PropName == OL_DEVICE_INFO_PLATFORM)
305+
switch (PropName) {
306+
case OL_DEVICE_INFO_PLATFORM:
306307
return Info.write<void *>(Device->Platform);
307-
if (PropName == OL_DEVICE_INFO_TYPE)
308+
309+
case OL_DEVICE_INFO_TYPE:
308310
return Info.write<ol_device_type_t>(OL_DEVICE_TYPE_GPU);
311+
312+
case OL_DEVICE_INFO_SINGLE_FP_CONFIG:
313+
case OL_DEVICE_INFO_DOUBLE_FP_CONFIG: {
314+
ol_device_fp_capability_flags_t flags{0};
315+
flags |= OL_DEVICE_FP_CAPABILITY_FLAG_CORRECTLY_ROUNDED_DIVIDE_SQRT |
316+
OL_DEVICE_FP_CAPABILITY_FLAG_ROUND_TO_NEAREST |
317+
OL_DEVICE_FP_CAPABILITY_FLAG_ROUND_TO_ZERO |
318+
OL_DEVICE_FP_CAPABILITY_FLAG_ROUND_TO_INF |
319+
OL_DEVICE_FP_CAPABILITY_FLAG_INF_NAN |
320+
OL_DEVICE_FP_CAPABILITY_FLAG_DENORM |
321+
OL_DEVICE_FP_CAPABILITY_FLAG_FMA;
322+
return Info.write(flags);
323+
}
324+
325+
case OL_DEVICE_INFO_HALF_FP_CONFIG:
326+
return Info.write<ol_device_fp_capability_flags_t>(0);
327+
328+
case OL_DEVICE_INFO_NATIVE_VECTOR_WIDTH_CHAR:
329+
case OL_DEVICE_INFO_NATIVE_VECTOR_WIDTH_SHORT:
330+
case OL_DEVICE_INFO_NATIVE_VECTOR_WIDTH_INT:
331+
case OL_DEVICE_INFO_NATIVE_VECTOR_WIDTH_LONG:
332+
case OL_DEVICE_INFO_NATIVE_VECTOR_WIDTH_FLOAT:
333+
case OL_DEVICE_INFO_NATIVE_VECTOR_WIDTH_DOUBLE:
334+
return Info.write<uint32_t>(1);
335+
336+
case OL_DEVICE_INFO_NATIVE_VECTOR_WIDTH_HALF:
337+
return Info.write<uint32_t>(0);
338+
339+
// None of the existing plugins specify a limit on a single allocation,
340+
// so return the global memory size instead
341+
case OL_DEVICE_INFO_MAX_MEM_ALLOC_SIZE:
342+
PropName = OL_DEVICE_INFO_GLOBAL_MEM_SIZE;
343+
break;
344+
345+
default:
346+
break;
347+
}
348+
309349
if (PropName >= OL_DEVICE_INFO_LAST)
310350
return createOffloadError(ErrorCode::INVALID_ENUMERATION,
311351
"getDeviceInfo enum '%i' is invalid", PropName);
@@ -316,6 +356,7 @@ Error olGetDeviceInfoImplDetail(ol_device_handle_t Device,
316356
"plugin did not provide a response for this information");
317357
auto Entry = *EntryOpt;
318358

359+
// Retrieve properties from the plugin interface
319360
switch (PropName) {
320361
case OL_DEVICE_INFO_NAME:
321362
case OL_DEVICE_INFO_VENDOR:
@@ -327,7 +368,20 @@ Error olGetDeviceInfoImplDetail(ol_device_handle_t Device,
327368
return Info.writeString(std::get<std::string>(Entry->Value).c_str());
328369
}
329370

330-
case OL_DEVICE_INFO_MAX_WORK_GROUP_SIZE: {
371+
case OL_DEVICE_INFO_GLOBAL_MEM_SIZE: {
372+
// Uint64 values
373+
if (!std::holds_alternative<uint64_t>(Entry->Value))
374+
return makeError(ErrorCode::BACKEND_FAILURE,
375+
"plugin returned incorrect type");
376+
return Info.write(std::get<uint64_t>(Entry->Value));
377+
}
378+
379+
case OL_DEVICE_INFO_MAX_WORK_GROUP_SIZE:
380+
case OL_DEVICE_INFO_VENDOR_ID:
381+
case OL_DEVICE_INFO_NUM_COMPUTE_UNITS:
382+
case OL_DEVICE_INFO_ADDRESS_BITS:
383+
case OL_DEVICE_INFO_MAX_CLOCK_FREQUENCY:
384+
case OL_DEVICE_INFO_MEMORY_CLOCK_RATE: {
331385
// Uint32 values
332386
if (!std::holds_alternative<uint64_t>(Entry->Value))
333387
return makeError(ErrorCode::BACKEND_FAILURE,
@@ -389,9 +443,40 @@ Error olGetDeviceInfoImplDetailHost(ol_device_handle_t Device,
389443
case OL_DEVICE_INFO_DRIVER_VERSION:
390444
return Info.writeString(LLVM_VERSION_STRING);
391445
case OL_DEVICE_INFO_MAX_WORK_GROUP_SIZE:
392-
return Info.write<uint64_t>(1);
446+
return Info.write<uint32_t>(1);
393447
case OL_DEVICE_INFO_MAX_WORK_GROUP_SIZE_PER_DIMENSION:
394448
return Info.write<ol_dimensions_t>(ol_dimensions_t{1, 1, 1});
449+
case OL_DEVICE_INFO_VENDOR_ID:
450+
return Info.write<uint32_t>(0);
451+
case OL_DEVICE_INFO_NUM_COMPUTE_UNITS:
452+
return Info.write<uint32_t>(1);
453+
case OL_DEVICE_INFO_SINGLE_FP_CONFIG:
454+
case OL_DEVICE_INFO_DOUBLE_FP_CONFIG:
455+
return Info.write<ol_device_fp_capability_flags_t>(
456+
OL_DEVICE_FP_CAPABILITY_FLAG_CORRECTLY_ROUNDED_DIVIDE_SQRT |
457+
OL_DEVICE_FP_CAPABILITY_FLAG_ROUND_TO_NEAREST |
458+
OL_DEVICE_FP_CAPABILITY_FLAG_ROUND_TO_ZERO |
459+
OL_DEVICE_FP_CAPABILITY_FLAG_ROUND_TO_INF |
460+
OL_DEVICE_FP_CAPABILITY_FLAG_INF_NAN |
461+
OL_DEVICE_FP_CAPABILITY_FLAG_DENORM | OL_DEVICE_FP_CAPABILITY_FLAG_FMA);
462+
case OL_DEVICE_INFO_HALF_FP_CONFIG:
463+
return Info.write<ol_device_fp_capability_flags_t>(0);
464+
case OL_DEVICE_INFO_NATIVE_VECTOR_WIDTH_CHAR:
465+
case OL_DEVICE_INFO_NATIVE_VECTOR_WIDTH_SHORT:
466+
case OL_DEVICE_INFO_NATIVE_VECTOR_WIDTH_INT:
467+
case OL_DEVICE_INFO_NATIVE_VECTOR_WIDTH_LONG:
468+
case OL_DEVICE_INFO_NATIVE_VECTOR_WIDTH_FLOAT:
469+
case OL_DEVICE_INFO_NATIVE_VECTOR_WIDTH_DOUBLE:
470+
return Info.write<uint32_t>(1);
471+
case OL_DEVICE_INFO_NATIVE_VECTOR_WIDTH_HALF:
472+
return Info.write<uint32_t>(0);
473+
case OL_DEVICE_INFO_MAX_CLOCK_FREQUENCY:
474+
case OL_DEVICE_INFO_MEMORY_CLOCK_RATE:
475+
case OL_DEVICE_INFO_ADDRESS_BITS:
476+
return Info.write<uint32_t>(std::numeric_limits<uintptr_t>::digits);
477+
case OL_DEVICE_INFO_MAX_MEM_ALLOC_SIZE:
478+
case OL_DEVICE_INFO_GLOBAL_MEM_SIZE:
479+
return Info.write<uint64_t>(0);
395480
default:
396481
return createOffloadError(ErrorCode::INVALID_ENUMERATION,
397482
"getDeviceInfo enum '%i' is invalid", PropName);

offload/plugins-nextgen/amdgpu/dynamic_hsa/hsa.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,16 @@ typedef enum {
7070
HSA_ISA_INFO_NAME = 1
7171
} hsa_isa_info_t;
7272

73+
typedef enum {
74+
HSA_MACHINE_MODEL_SMALL = 0,
75+
HSA_MACHINE_MODEL_LARGE = 1
76+
} hsa_machine_model_t;
77+
7378
typedef enum {
7479
HSA_AGENT_INFO_NAME = 0,
7580
HSA_AGENT_INFO_VENDOR_NAME = 1,
7681
HSA_AGENT_INFO_FEATURE = 2,
82+
HSA_AGENT_INFO_MACHINE_MODEL = 3,
7783
HSA_AGENT_INFO_PROFILE = 4,
7884
HSA_AGENT_INFO_WAVEFRONT_SIZE = 6,
7985
HSA_AGENT_INFO_WORKGROUP_MAX_DIM = 7,

offload/plugins-nextgen/amdgpu/dynamic_hsa/hsa_ext_amd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ typedef enum hsa_amd_agent_info_s {
6767
HSA_AMD_AGENT_INFO_CACHELINE_SIZE = 0xA001,
6868
HSA_AMD_AGENT_INFO_COMPUTE_UNIT_COUNT = 0xA002,
6969
HSA_AMD_AGENT_INFO_MAX_CLOCK_FREQUENCY = 0xA003,
70+
HSA_AMD_AGENT_INFO_MEMORY_MAX_FREQUENCY = 0xA008,
7071
HSA_AMD_AGENT_INFO_PRODUCT_NAME = 0xA009,
7172
HSA_AMD_AGENT_INFO_MAX_WAVES_PER_CU = 0xA00A,
7273
HSA_AMD_AGENT_INFO_NUM_SIMDS_PER_CU = 0xA00B,

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

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2642,6 +2642,15 @@ struct AMDGPUDeviceTy : public GenericDeviceTy, AMDGenericDeviceTy {
26422642
if (Status == HSA_STATUS_SUCCESS)
26432643
Info.add("Vendor Name", TmpChar, "", DeviceInfo::VENDOR);
26442644

2645+
Info.add("Vendor ID", uint64_t{4130}, "", DeviceInfo::VENDOR_ID);
2646+
2647+
hsa_machine_model_t MachineModel;
2648+
Status = getDeviceAttrRaw(HSA_AGENT_INFO_MACHINE_MODEL, MachineModel);
2649+
if (Status == HSA_STATUS_SUCCESS)
2650+
Info.add("Memory Address Size",
2651+
uint64_t{MachineModel == HSA_MACHINE_MODEL_SMALL ? 32u : 64u},
2652+
"bits", DeviceInfo::ADDRESS_BITS);
2653+
26452654
hsa_device_type_t DevType;
26462655
Status = getDeviceAttrRaw(HSA_AGENT_INFO_DEVICE, DevType);
26472656
if (Status == HSA_STATUS_SUCCESS) {
@@ -2692,11 +2701,17 @@ struct AMDGPUDeviceTy : public GenericDeviceTy, AMDGenericDeviceTy {
26922701

26932702
Status = getDeviceAttrRaw(HSA_AMD_AGENT_INFO_MAX_CLOCK_FREQUENCY, TmpUInt);
26942703
if (Status == HSA_STATUS_SUCCESS)
2695-
Info.add("Max Clock Freq", TmpUInt, "MHz");
2704+
Info.add("Max Clock Freq", TmpUInt, "MHz",
2705+
DeviceInfo::MAX_CLOCK_FREQUENCY);
2706+
2707+
Status = getDeviceAttrRaw(HSA_AMD_AGENT_INFO_MEMORY_MAX_FREQUENCY, TmpUInt);
2708+
if (Status == HSA_STATUS_SUCCESS)
2709+
Info.add("Max Memory Clock Freq", TmpUInt, "MHz",
2710+
DeviceInfo::MEMORY_CLOCK_RATE);
26962711

26972712
Status = getDeviceAttrRaw(HSA_AMD_AGENT_INFO_COMPUTE_UNIT_COUNT, TmpUInt);
26982713
if (Status == HSA_STATUS_SUCCESS)
2699-
Info.add("Compute Units", TmpUInt);
2714+
Info.add("Compute Units", TmpUInt, "", DeviceInfo::NUM_COMPUTE_UNITS);
27002715

27012716
Status = getDeviceAttrRaw(HSA_AMD_AGENT_INFO_NUM_SIMDS_PER_CU, TmpUInt);
27022717
if (Status == HSA_STATUS_SUCCESS)
@@ -2778,7 +2793,11 @@ struct AMDGPUDeviceTy : public GenericDeviceTy, AMDGenericDeviceTy {
27782793

27792794
Status = Pool->getAttrRaw(HSA_AMD_MEMORY_POOL_INFO_SIZE, TmpSt);
27802795
if (Status == HSA_STATUS_SUCCESS)
2781-
PoolNode.add("Size", TmpSt, "bytes");
2796+
PoolNode.add(
2797+
"Size", TmpSt, "bytes",
2798+
(Pool->isGlobal() && Pool->isCoarseGrained())
2799+
? std::optional<DeviceInfo>{DeviceInfo::GLOBAL_MEM_SIZE}
2800+
: std::nullopt);
27822801

27832802
Status = Pool->getAttrRaw(HSA_AMD_MEMORY_POOL_INFO_RUNTIME_ALLOC_ALLOWED,
27842803
TmpBool);

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

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -949,13 +949,20 @@ struct CUDADeviceTy : public GenericDeviceTy {
949949

950950
Info.add("Vendor Name", "NVIDIA", "", DeviceInfo::VENDOR);
951951

952+
Info.add("Vendor ID", uint64_t{4318}, "", DeviceInfo::VENDOR_ID);
953+
954+
Info.add("Memory Address Size", std::numeric_limits<CUdeviceptr>::digits,
955+
"bits", DeviceInfo::ADDRESS_BITS);
956+
952957
Res = cuDeviceTotalMem(&TmpSt, Device);
953958
if (Res == CUDA_SUCCESS)
954-
Info.add("Global Memory Size", TmpSt, "bytes");
959+
Info.add("Global Memory Size", TmpSt, "bytes",
960+
DeviceInfo::GLOBAL_MEM_SIZE);
955961

956962
Res = getDeviceAttrRaw(CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT, TmpInt);
957963
if (Res == CUDA_SUCCESS)
958-
Info.add("Number of Multiprocessors", TmpInt);
964+
Info.add("Number of Multiprocessors", TmpInt, "",
965+
DeviceInfo::NUM_COMPUTE_UNITS);
959966

960967
Res = getDeviceAttrRaw(CU_DEVICE_ATTRIBUTE_GPU_OVERLAP, TmpInt);
961968
if (Res == CUDA_SUCCESS)
@@ -1016,7 +1023,8 @@ struct CUDADeviceTy : public GenericDeviceTy {
10161023

10171024
Res = getDeviceAttrRaw(CU_DEVICE_ATTRIBUTE_CLOCK_RATE, TmpInt);
10181025
if (Res == CUDA_SUCCESS)
1019-
Info.add("Clock Rate", TmpInt, "kHz");
1026+
Info.add("Clock Rate", TmpInt / 1000, "MHz",
1027+
DeviceInfo::MAX_CLOCK_FREQUENCY);
10201028

10211029
Res = getDeviceAttrRaw(CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, TmpInt);
10221030
if (Res == CUDA_SUCCESS)
@@ -1053,7 +1061,8 @@ struct CUDADeviceTy : public GenericDeviceTy {
10531061

10541062
Res = getDeviceAttrRaw(CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE, TmpInt);
10551063
if (Res == CUDA_SUCCESS)
1056-
Info.add("Memory Clock Rate", TmpInt, "kHz");
1064+
Info.add("Memory Clock Rate", TmpInt / 1000, "MHz",
1065+
DeviceInfo::MEMORY_CLOCK_RATE);
10571066

10581067
Res = getDeviceAttrRaw(CU_DEVICE_ATTRIBUTE_GLOBAL_MEMORY_BUS_WIDTH, TmpInt);
10591068
if (Res == CUDA_SUCCESS)

offload/tools/offload-tblgen/APIGen.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ static void ProcessEnum(const EnumRec &Enum, raw_ostream &OS) {
131131
OS << formatv("/// @brief {0}\n", Enum.getDesc());
132132
OS << formatv("typedef enum {0} {{\n", Enum.getName());
133133

134-
uint32_t EtorVal = 0;
134+
// Bitfields start from 1, other enums from 0
135+
uint32_t EtorVal = Enum.isBitField();
135136
for (const auto &EnumVal : Enum.getValues()) {
136137
if (Enum.isTyped()) {
137138
OS << MakeComment(
@@ -141,7 +142,12 @@ static void ProcessEnum(const EnumRec &Enum, raw_ostream &OS) {
141142
OS << MakeComment(EnumVal.getDesc());
142143
}
143144
OS << formatv(TAB_1 "{0}_{1} = {2},\n", Enum.getEnumValNamePrefix(),
144-
EnumVal.getName(), EtorVal++);
145+
EnumVal.getName(), EtorVal);
146+
if (Enum.isBitField()) {
147+
EtorVal <<= 1u;
148+
} else {
149+
++EtorVal;
150+
}
145151
}
146152

147153
// Add last_element/force uint32 val

offload/tools/offload-tblgen/MiscGen.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,16 @@ void EmitOffloadInfo(const RecordKeeper &Records, raw_ostream &OS) {
107107
108108
)";
109109

110-
auto ErrorCodeEnum = EnumRec{Records.getDef("DeviceInfo")};
111-
uint32_t EtorVal = 0;
112-
for (const auto &EnumVal : ErrorCodeEnum.getValues()) {
110+
auto Enum = EnumRec{Records.getDef("DeviceInfo")};
111+
// Bitfields start from 1, other enums from 0
112+
uint32_t EtorVal = Enum.isBitField();
113+
for (const auto &EnumVal : Enum.getValues()) {
113114
OS << formatv(TAB_1 "OFFLOAD_DEVINFO({0}, \"{1}\", {2})\n",
114-
EnumVal.getName(), EnumVal.getDesc(), EtorVal++);
115+
EnumVal.getName(), EnumVal.getDesc(), EtorVal);
116+
if (Enum.isBitField()) {
117+
EtorVal <<= 1u;
118+
} else {
119+
++EtorVal;
120+
}
115121
}
116122
}

offload/tools/offload-tblgen/RecordTypes.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ class EnumRec {
9292

9393
bool isTyped() const { return rec->getValueAsBit("is_typed"); }
9494

95+
bool isBitField() const { return rec->getValueAsBit("is_bit_field"); }
96+
9597
private:
9698
const Record *rec;
9799
std::vector<EnumValueRec> vals;

0 commit comments

Comments
 (0)