Skip to content

Commit

Permalink
Merge pull request #652 from veselypeta/petr/cts-fixes
Browse files Browse the repository at this point in the history
[UR] Device CTS fixes
  • Loading branch information
veselypeta committed Jun 26, 2023
2 parents 39b3546 + 15a2da0 commit 52d05bf
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion test/conformance/device/urDeviceGet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ TEST_F(urDeviceGetTest, InvalidValueNumEntries) {
ASSERT_NE(count, 0);
std::vector<ur_device_handle_t> devices(count);
ASSERT_EQ_RESULT(
UR_RESULT_ERROR_INVALID_VALUE,
UR_RESULT_ERROR_INVALID_SIZE,
urDeviceGet(platform, UR_DEVICE_TYPE_ALL, 0, devices.data(), nullptr));
}
3 changes: 1 addition & 2 deletions test/conformance/device/urDeviceGetInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ static std::unordered_map<ur_device_info_t, size_t> device_info_size_map = {
{UR_DEVICE_INFO_MAX_COMPUTE_UNITS, sizeof(uint32_t)},
{UR_DEVICE_INFO_MAX_WORK_ITEM_DIMENSIONS, sizeof(uint32_t)},
{UR_DEVICE_INFO_MAX_WORK_GROUP_SIZE, sizeof(size_t)},
{UR_DEVICE_INFO_MAX_WORK_GROUP_SIZE, sizeof(size_t)},
{UR_DEVICE_INFO_SINGLE_FP_CONFIG, sizeof(ur_device_fp_capability_flags_t)},
{UR_DEVICE_INFO_HALF_FP_CONFIG, sizeof(ur_device_fp_capability_flags_t)},
{UR_DEVICE_INFO_DOUBLE_FP_CONFIG, sizeof(ur_device_fp_capability_flags_t)},
Expand Down Expand Up @@ -258,7 +257,7 @@ TEST_P(urDeviceGetInfoTest, Success) {
ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, size,
info_data.data(), nullptr));
} else {
ASSERT_EQ_RESULT(result, UR_RESULT_ERROR_INVALID_ENUMERATION);
ASSERT_EQ_RESULT(result, UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION);
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions test/conformance/device/urDeviceRelease.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ TEST_F(urDeviceReleaseTest, Success) {

TEST_F(urDeviceReleaseTest, SuccessSubdevices) {
for (auto device : devices) {
if (!uur::hasDevicePartitionSupport(device,
UR_DEVICE_PARTITION_EQUALLY)) {
::testing::Message() << "Device: \'" << device
<< "\' does not support partitioning equally.";
continue;
}

ur_device_partition_property_t prop = uur::makePartitionEquallyDesc(1);

Expand Down
6 changes: 6 additions & 0 deletions test/conformance/device/urDeviceRetain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ TEST_F(urDeviceRetainTest, Success) {

TEST_F(urDeviceRetainTest, SuccessSubdevices) {
for (auto device : devices) {
if (!uur::hasDevicePartitionSupport(device,
UR_DEVICE_PARTITION_EQUALLY)) {
::testing::Message() << "Device: \'" << device
<< "\' does not support partitioning equally.";
continue;
}

ur_device_partition_property_t prop = uur::makePartitionEquallyDesc(1);
ur_device_partition_properties_t properties{
Expand Down
2 changes: 1 addition & 1 deletion test/conformance/device/urDeviceSelectBinary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ TEST_F(urDeviceSelectBinaryTest, InvalidValueNumBinaries) {
for (auto device : devices) {
uint32_t selected_binary;
ASSERT_EQ_RESULT(
UR_RESULT_ERROR_INVALID_VALUE,
UR_RESULT_ERROR_INVALID_SIZE,
urDeviceSelectBinary(device, binaries, 0, &selected_binary));
}
}

0 comments on commit 52d05bf

Please sign in to comment.