SWDEV-411064 - check if image is supported before running image specific tests

Change-Id: I62b3f7489f2f33b4b4e02f42a46e66c8940f2277
This commit is contained in:
Jatin Chaudhary
2023-07-25 17:04:13 +01:00
committed by Jatin Jaikishan Chaudhary
parent b6b43db172
commit ee3c94faf2
52 changed files with 524 additions and 76 deletions
+16
View File
@@ -73,6 +73,8 @@ static void ArrayCreate_DiffSizes(int gpu) {
/* This testcase verifies hipArrayCreate API for small and big chunks data*/
TEST_CASE("Unit_hipArrayCreate_DiffSizes") {
CHECK_IMAGE_SUPPORT
ArrayCreate_DiffSizes(0);
HIP_CHECK_THREAD_FINALIZE();
}
@@ -83,6 +85,8 @@ scenario by launching threads in parallel on multiple GPUs
and verifies the hipArrayCreate API with small and big chunks data
*/
TEST_CASE("Unit_hipArrayCreate_MultiThread") {
CHECK_IMAGE_SUPPORT
std::vector<std::thread> threadlist;
int devCnt = 0;
@@ -200,6 +204,8 @@ void testArrayAsTexture(hiparray array, const size_t width, const size_t height)
// Test the happy path of the hipArrayCreate
TEMPLATE_TEST_CASE("Unit_hipArrayCreate_happy", "", uint, int, int4, ushort, short2, char, uchar2,
char4, float, float2, float4) {
CHECK_IMAGE_SUPPORT
using vec_info = vector_info<TestType>;
DriverContext ctx;
@@ -223,6 +229,8 @@ TEMPLATE_TEST_CASE("Unit_hipArrayCreate_happy", "", uint, int, int4, ushort, sho
// Only widths and Heights up to the maxTexture size is supported
TEMPLATE_TEST_CASE("Unit_hipArrayCreate_maxTexture", "", uint, int, int4, ushort, short2, char,
uchar2, char4, float, float2, float4) {
CHECK_IMAGE_SUPPORT
using vec_info = vector_info<TestType>;
DriverContext ctx;
@@ -281,6 +289,8 @@ TEMPLATE_TEST_CASE("Unit_hipArrayCreate_maxTexture", "", uint, int, int4, ushort
// zero-width array is not supported
TEST_CASE("Unit_hipArrayCreate_ZeroWidth") {
CHECK_IMAGE_SUPPORT
DriverContext ctx;
HIP_ARRAY_DESCRIPTOR desc;
desc.Format = driverFormats[0];
@@ -295,6 +305,8 @@ TEST_CASE("Unit_hipArrayCreate_ZeroWidth") {
// HipArrayCreate will return an error when nullptr is used as the array argument
TEST_CASE("Unit_hipArrayCreate_Nullptr") {
CHECK_IMAGE_SUPPORT
DriverContext ctx;
SECTION("Null array") {
HIP_ARRAY_DESCRIPTOR desc;
@@ -313,6 +325,8 @@ TEST_CASE("Unit_hipArrayCreate_Nullptr") {
// Only elements with 1,2, or 4 channels is supported
TEST_CASE("Unit_hipArrayCreate_BadNumberChannelElement") {
CHECK_IMAGE_SUPPORT
DriverContext ctx;
HIP_ARRAY_DESCRIPTOR desc;
desc.Format = GENERATE(from_range(std::begin(driverFormats), std::end(driverFormats)));
@@ -329,6 +343,8 @@ TEST_CASE("Unit_hipArrayCreate_BadNumberChannelElement") {
// Only certain channel formats are acceptable.
TEST_CASE("Unit_hipArrayCreate_BadChannelFormat") {
CHECK_IMAGE_SUPPORT
DriverContext ctx;
HIP_ARRAY_DESCRIPTOR desc;