Skip to content

[SYCL] Don't fail in lit testing if Level Zero device query failed #1882

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 12, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions sycl/tools/get_device_count_by_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,26 +120,26 @@ static bool queryLevelZero(cl_device_type deviceType, cl_uint &deviceCount,
ze_result_t zeResult = zeInit(ZE_INIT_FLAG_NONE);
if (zeResult != ZE_RESULT_SUCCESS) {
msg = "ERROR: Level Zero initialization error";
return false;
return true;
}

uint32_t zeDriverCount = 0;
zeResult = zeDriverGet(&zeDriverCount, nullptr);
if (zeResult != ZE_RESULT_SUCCESS) {
msg = "ERROR: Level Zero error querying driver count";
return false;
return true;
}

if (zeDriverCount == 0) {
msg = "ERROR: Level Zero no driver found";
return false;
return true;
}

ze_driver_handle_t zeDriver;
zeResult = zeDriverGet(&zeDriverCount, &zeDriver);
if (zeResult != ZE_RESULT_SUCCESS) {
msg = "ERROR: Level Zero error querying driver";
return false;
return true;
}

switch (deviceType) {
Expand All @@ -150,7 +150,7 @@ static bool queryLevelZero(cl_device_type deviceType, cl_uint &deviceCount,
zeResult = zeDeviceGet(zeDriver, &zeDeviceCount, nullptr);
if (zeResult != ZE_RESULT_SUCCESS) {
msg = "ERROR: Level Zero error querying device count";
return false;
return true;
}
deviceCount = static_cast<cl_uint>(zeDeviceCount);
msg = "level zero ";
Expand Down