-
Notifications
You must be signed in to change notification settings - Fork 781
[SYCL][L0] Fix absence of zeInit in Level Zero LIT e2e tests #18956
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
base: sycl
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -25,6 +25,15 @@ int main() { | |||||||
auto zedev = sycl::get_native<sycl::backend::ext_oneapi_level_zero>(dev); | ||||||||
ze_device_properties_t device_properties{}; | ||||||||
device_properties.stype = ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES; | ||||||||
|
||||||||
// Initialize Level Zero driver is required if this test is linked | ||||||||
// statically with Level Zero loader, the driver will not be init otherwise. | ||||||||
ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY); | ||||||||
if (result != ZE_RESULT_SUCCESS) { | ||||||||
std::cout << "zeInit failed\n"; | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit here and in other tests below:
Suggested change
|
||||||||
return 1; | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. + some small enhancement here and below:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ZE_RESULT_SUCCESS is not equal to test's success return code. May be in current implementation both of them are equal 0, but not in general. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe print this |
||||||||
} | ||||||||
|
||||||||
zeDeviceGetProperties(zedev, &device_properties); | ||||||||
std::stringstream uuid_l0; | ||||||||
for (int i = 0; i < ZE_MAX_DEVICE_UUID_SIZE; ++i) | ||||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -9,6 +9,14 @@ | |||||
using namespace sycl; | ||||||
|
||||||
int main() { | ||||||
// Initialize Level Zero driver is required if this test is linked | ||||||
// statically with Level Zero loader, the driver will not be init otherwise. | ||||||
ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY); | ||||||
if (result != ZE_RESULT_SUCCESS) { | ||||||
std::cout << "zeInit failed\n"; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test use asserts, so to align with it:
Suggested change
|
||||||
return 1; | ||||||
} | ||||||
|
||||||
queue Queue; | ||||||
device Dev = Queue.get_device(); | ||||||
bool Result; | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,14 @@ extern "C" SYCL_EXT_ONEAPI_FUNCTION_PROPERTY( | |
} | ||
|
||
int main() { | ||
// Initialize Level Zero driver is required if this test is linked | ||
// statically with Level Zero loader, the driver will not be init otherwise. | ||
ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY); | ||
if (result != ZE_RESULT_SUCCESS) { | ||
std::cout << "zeInit failed\n"; | ||
Comment on lines
+26
to
+27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better to use |
||
return 1; | ||
} | ||
|
||
sycl::queue q; | ||
sycl::context ctxt = q.get_context(); | ||
sycl::device d = ctxt.get_devices()[0]; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small nit here and below in other tests: