Skip to content

Commit

Permalink
Merge pull request #1349 from PatKamin/fix-fuzztest
Browse files Browse the repository at this point in the history
[CI] Fix failing nightly build
  • Loading branch information
wlemkows authored Feb 16, 2024
2 parents c23d727 + ede9b95 commit 1ac6f95
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions test/fuzz/urFuzz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,19 @@ int ur_device_get(TestState &state) {
return -1;
}

ur_result_t res = urDeviceGet(state.platforms[state.platform_num],
state.device_type, state.num_entries,
state.devices.data(), &state.num_devices);
ur_result_t res = UR_RESULT_SUCCESS;
if (state.devices.size() == 0) {
res = urDeviceGet(state.platforms[state.platform_num],
state.device_type, 0, nullptr, &state.num_devices);
state.devices.resize(state.num_devices);
} else {
res =
urDeviceGet(state.platforms[state.platform_num], state.device_type,
state.num_entries, state.devices.data(), nullptr);
}
if (res != UR_RESULT_SUCCESS) {
return -1;
}
if (state.devices.size() != state.num_devices) {
state.devices.resize(state.num_devices);
}

return 0;
}
Expand Down

0 comments on commit 1ac6f95

Please sign in to comment.