-
Notifications
You must be signed in to change notification settings - Fork 45
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
Add missing image types to image tests #155
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Oskar Hubert Weber <[email protected]>
Signed-off-by: Oskar Hubert Weber <[email protected]>
LOG_INFO << "device does not support images, cannot run test"; | ||
GTEST_SKIP(); |
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.
LOG_INFO << "device does not support images, cannot run test"; | |
GTEST_SKIP(); | |
GTEST_SKIP() << "Device does not support images"; |
if (properties.maxImageDims1D > 0) { | ||
supported_types.emplace_back(ZE_IMAGE_TYPE_1D); | ||
} else { | ||
LOG_INFO << "ZE_IMAGE_TYPE_1D unsupported"; |
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.
if you want convert L0 value to string use utils_string.cpp for that. example std::string to_string(const ze_image_type_t type)
auto result = zeDeviceGetImageProperties(device, &properties); | ||
|
||
if (result != ZE_RESULT_SUCCESS) { | ||
return {}; | ||
} |
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.
auto result = zeDeviceGetImageProperties(device, &properties); | |
if (result != ZE_RESULT_SUCCESS) { | |
return {}; | |
} | |
EXPECT_EQ(ZE_RESULT_SUCCESS, zeDeviceGetImageProperties(device, &properties)); | |
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.
better to use harness function get_image_properties
ze_device_image_properties_t properties; | ||
memset(&properties, 0, sizeof(properties)); | ||
properties.stype = ZE_STRUCTURE_TYPE_IMAGE_PROPERTIES; |
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.
ze_device_image_properties_t properties; | |
memset(&properties, 0, sizeof(properties)); | |
properties.stype = ZE_STRUCTURE_TYPE_IMAGE_PROPERTIES; | |
ze_device_image_properties_t properties = {}; | |
properties.stype = ZE_STRUCTURE_TYPE_IMAGE_PROPERTIES; |
std::vector<ze_image_type_t> get_supported_image_types( | ||
ze_device_handle_t device, | ||
bool exclude_arrays, | ||
bool exclude_buffer) { |
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.
harness functions must be simple, if addition logic is required adapt helper functions in test itself
test.outbuff = lzt::allocate_host_memory(test.image_size * sizeof(float)); | ||
float *in_ptr = static_cast<float *>(test.inbuff); | ||
for (int i = 0; i < test.image_size; i++) { | ||
in_ptr[i] = 3.5; |
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.
please move 3.5
value to a constexpr variable with the name explaining the value
|
||
ze_group_count_t group_dems = {image_width / group_size_x, | ||
image_height / group_size_y, 1}; | ||
result = zeKernelSetArgumentValue(kernel, 0, sizeof(img_in), &img_in); |
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.
use existing functions from module harness
auto result = zeImageCreate(lzt::get_default_context(), | ||
lzt::zeDevice::get_instance()->get_device(), | ||
&image_desc, &image); | ||
EXPECT_EQ(ZE_RESULT_SUCCESS, | ||
zeImageCreate(lzt::get_default_context(), | ||
lzt::zeDevice::get_instance()->get_device(), |
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.
i dont think this is expected behavior, either way please use harness image functions
LOG_INFO << "RUN"; | ||
LOG_INFO << img_type; |
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.
either provide a meaningful message or don't log at all
virtual void check_extensions() override { | ||
if (!lzt::check_if_extension_supported(lzt::get_default_driver(), | ||
ZE_IMAGE_VIEW_EXT_NAME)) { | ||
GTEST_SKIP() << "Missing ZE_extension_image_view support\n"; | ||
} | ||
if (!lzt::check_if_extension_supported(lzt::get_default_driver(), | ||
ZE_IMAGE_VIEW_PLANAR_EXT_NAME)) { | ||
GTEST_SKIP() << "Missing ZE_extension_image_view_planar support\n"; | ||
} |
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.
this method will provide a result SKIP, but won't cause test to end continuing to create unsupported image
Signed-off-by: Oskar Hubert Weber [email protected]