Skip to content

Commit 499915a

Browse files
committed
Small fixes
1 parent e25b535 commit 499915a

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

offload/liboffload/API/Common.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def : Struct {
149149
}
150150

151151
def : Struct {
152-
let name = "ol_range_t";
152+
let name = "ol_dimensions_t";
153153
let desc = "A three element vector";
154154
let members = [
155155
StructMember<"size_t", "x", "X">,

offload/liboffload/API/Device.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def : Enum {
3232
TaggedEtor<"NAME", "char[]", "Device name">,
3333
TaggedEtor<"VENDOR", "char[]", "Device vendor">,
3434
TaggedEtor<"DRIVER_VERSION", "char[]", "Driver version">,
35-
TaggedEtor<"MAX_WORK_GROUP_SIZE", "ol_range_t", "Maximum work group size in each dimension">,
35+
TaggedEtor<"MAX_WORK_GROUP_SIZE", "ol_dimensions_t", "Maximum work group size in each dimension">,
3636
];
3737
}
3838

offload/liboffload/src/OffloadImpl.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ Error olGetDeviceInfoImplDetail(ol_device_handle_t Device,
228228
ReturnHelper ReturnValue(PropSize, PropValue, PropSizeRet);
229229

230230
// Find the info if it exists under any of the given names
231-
auto FindInfo = [&](InfoQueueTy &DevInfo, std::vector<std::string> &Names)
231+
auto FindInfo = [&](InfoQueueTy &DevInfo, llvm::SmallVector<StringRef> &Names)
232232
-> std::optional<decltype(DevInfo.getQueue().begin())> {
233233
if (!Device->Device)
234234
return std::nullopt;
@@ -250,7 +250,7 @@ Error olGetDeviceInfoImplDetail(ol_device_handle_t Device,
250250

251251
return std::nullopt;
252252
};
253-
auto GetInfoString = [&](std::vector<std::string> Names) {
253+
auto GetInfoString = [&](llvm::SmallVector<StringRef> Names) {
254254
InfoQueueTy DevInfo;
255255

256256
if (auto Item = FindInfo(DevInfo, Names)) {
@@ -259,12 +259,12 @@ Error olGetDeviceInfoImplDetail(ol_device_handle_t Device,
259259
return "";
260260
}
261261
};
262-
auto GetInfoXyz = [&](std::vector<std::string> Names) {
262+
auto GetInfoXyz = [&](llvm::SmallVector<StringRef> Names) {
263263
InfoQueueTy DevInfo;
264264

265265
if (auto Item = FindInfo(DevInfo, Names)) {
266266
auto Iter = *Item;
267-
ol_range_t Out{0, 0, 0};
267+
ol_dimensions_t Out{0, 0, 0};
268268
auto Level = Iter->Level + 1;
269269

270270
while ((++Iter)->Level == Level) {
@@ -286,7 +286,7 @@ Error olGetDeviceInfoImplDetail(ol_device_handle_t Device,
286286

287287
return Out;
288288
} else {
289-
return ol_range_t{0, 0, 0};
289+
return ol_dimensions_t{0, 0, 0};
290290
}
291291
};
292292

offload/unittests/OffloadAPI/device/olGetDeviceInfo.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ TEST_P(olGetDeviceInfoTest, SuccessDriverVersion) {
7878
}
7979

8080
TEST_P(olGetDeviceInfoTest, SuccessMaxWorkGroupSize) {
81-
ol_range_t Value{0, 0, 0};
81+
ol_dimensions_t Value{0, 0, 0};
8282
ASSERT_SUCCESS(olGetDeviceInfo(Device, OL_DEVICE_INFO_MAX_WORK_GROUP_SIZE,
8383
sizeof(Value), &Value));
84-
ASSERT_GT(Value.x, 0);
85-
ASSERT_GT(Value.y, 0);
86-
ASSERT_GT(Value.z, 0);
84+
ASSERT_GT(Value.x, 0u);
85+
ASSERT_GT(Value.y, 0u);
86+
ASSERT_GT(Value.z, 0u);
8787
}
8888

8989
TEST_P(olGetDeviceInfoTest, InvalidNullHandleDevice) {

offload/unittests/OffloadAPI/device/olGetDeviceInfoSize.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ TEST_P(olGetDeviceInfoSizeTest, SuccessMaxWorkGroupSize) {
4848
size_t Size = 0;
4949
ASSERT_SUCCESS(
5050
olGetDeviceInfoSize(Device, OL_DEVICE_INFO_MAX_WORK_GROUP_SIZE, &Size));
51-
ASSERT_EQ(Size, sizeof(ol_range_t));
51+
ASSERT_EQ(Size, sizeof(ol_dimensions_t));
5252
ASSERT_EQ(Size, sizeof(size_t) * 3);
5353
}
5454

0 commit comments

Comments
 (0)