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

Change-Id: I62b3f7489f2f33b4b4e02f42a46e66c8940f2277
Этот коммит содержится в:
Jatin Chaudhary
2023-07-25 17:04:13 +01:00
коммит произвёл Jatin Jaikishan Chaudhary
родитель b6b43db172
Коммит ee3c94faf2
52 изменённых файлов: 524 добавлений и 76 удалений
+30
Просмотреть файл
@@ -67,6 +67,8 @@ static void Malloc3DArray_DiffSizes(int gpu) {
}
TEST_CASE("Unit_hipMalloc3DArray_DiffSizes") {
CHECK_IMAGE_SUPPORT
Malloc3DArray_DiffSizes(0);
HIP_CHECK_THREAD_FINALIZE();
}
@@ -77,6 +79,8 @@ scenario by launching threads in parallel on multiple GPUs
and verifies the hipMalloc3DArray API with small and big chunks data
*/
TEST_CASE("Unit_hipMalloc3DArray_MultiThread") {
CHECK_IMAGE_SUPPORT
std::vector<std::thread> threadlist;
int devCnt = 0;
devCnt = HipTest::getDeviceCount();
@@ -122,6 +126,8 @@ void checkArrayIsExpected(hipArray_t array, const hipChannelFormatDesc& expected
TEMPLATE_TEST_CASE("Unit_hipMalloc3DArray_happy", "", char, uchar2, uint2, int4, short4, float,
float2, float4) {
CHECK_IMAGE_SUPPORT
hipArray_t array;
const auto desc = hipCreateChannelDesc<TestType>();
#if HT_AMD
@@ -151,6 +157,8 @@ TEMPLATE_TEST_CASE("Unit_hipMalloc3DArray_happy", "", char, uchar2, uint2, int4,
TEMPLATE_TEST_CASE("Unit_hipMalloc3DArray_MaxTexture", "", int, uint4, short, ushort2,
unsigned char, float, float4) {
CHECK_IMAGE_SUPPORT
hipArray_t array;
const hipChannelFormatDesc desc = hipCreateChannelDesc<TestType>();
#if HT_AMD
@@ -241,6 +249,8 @@ hipExtent makeExtent(unsigned int flag, size_t s) {
// Providing the array pointer as nullptr should return an error
TEST_CASE("Unit_hipMalloc3DArray_Negative_NullArrayPtr") {
CHECK_IMAGE_SUPPORT
hipChannelFormatDesc desc = hipCreateChannelDesc<float4>();
constexpr size_t s = 6;
@@ -251,6 +261,8 @@ TEST_CASE("Unit_hipMalloc3DArray_Negative_NullArrayPtr") {
// Providing the description pointer as nullptr should return an error
TEST_CASE("Unit_hipMalloc3DArray_Negative_NullDescPtr") {
CHECK_IMAGE_SUPPORT
constexpr size_t s = 6; // 6 to keep cubemap happy
hipArray_t array;
@@ -262,6 +274,8 @@ TEST_CASE("Unit_hipMalloc3DArray_Negative_NullDescPtr") {
// Zero width arrays are not allowed
TEST_CASE("Unit_hipMalloc3DArray_Negative_ZeroWidth") {
CHECK_IMAGE_SUPPORT
constexpr size_t s = 6; // 6 to keep cubemap happy
hipArray_t array;
hipChannelFormatDesc desc = hipCreateChannelDesc<float4>();
@@ -274,6 +288,8 @@ TEST_CASE("Unit_hipMalloc3DArray_Negative_ZeroWidth") {
// Zero height arrays are only allowed for 1D arrays and layered arrays
TEST_CASE("Unit_hipMalloc3DArray_Negative_ZeroHeight") {
CHECK_IMAGE_SUPPORT
constexpr size_t s = 6; // 6 to keep cubemap happy
hipArray_t array;
hipChannelFormatDesc desc = hipCreateChannelDesc<float4>();
@@ -290,6 +306,8 @@ TEST_CASE("Unit_hipMalloc3DArray_Negative_ZeroHeight") {
}
TEST_CASE("Unit_hipMalloc3DArray_Negative_InvalidFlags") {
CHECK_IMAGE_SUPPORT
constexpr size_t s = 6; // 6 to keep cubemap happy
hipArray_t array;
hipChannelFormatDesc desc = hipCreateChannelDesc<float4>();
@@ -325,12 +343,16 @@ void testInvalidDescription(hipChannelFormatDesc desc) {
}
TEST_CASE("Unit_hipMalloc3DArray_Negative_InvalidFormat") {
CHECK_IMAGE_SUPPORT
hipChannelFormatDesc desc = hipCreateChannelDesc<float4>();
desc.f = GENERATE(hipChannelFormatKindNone, 0xBEEF);
testInvalidDescription(desc);
}
TEST_CASE("Unit_hipMalloc3DArray_Negative_BadChannelLayout") {
CHECK_IMAGE_SUPPORT
const int bits = GENERATE(8, 16, 32);
const hipChannelFormatKind formatKind =
GENERATE(hipChannelFormatKindSigned, hipChannelFormatKindUnsigned, hipChannelFormatKindFloat);
@@ -352,6 +374,8 @@ TEST_CASE("Unit_hipMalloc3DArray_Negative_BadChannelLayout") {
}
TEST_CASE("Unit_hipMalloc3DArray_Negative_8BitFloat") {
CHECK_IMAGE_SUPPORT
hipChannelFormatDesc desc = GENERATE(hipCreateChannelDesc(8, 0, 0, 0, hipChannelFormatKindFloat),
hipCreateChannelDesc(8, 8, 0, 0, hipChannelFormatKindFloat),
hipCreateChannelDesc(8, 8, 8, 8, hipChannelFormatKindFloat));
@@ -360,6 +384,8 @@ TEST_CASE("Unit_hipMalloc3DArray_Negative_8BitFloat") {
}
TEST_CASE("Unit_hipMalloc3DArray_Negative_DifferentChannelSizes") {
CHECK_IMAGE_SUPPORT
const int bitsX = GENERATE(8, 16, 32);
const int bitsY = GENERATE(8, 16, 32);
const int bitsZ = GENERATE(8, 16, 32);
@@ -383,6 +409,8 @@ TEST_CASE("Unit_hipMalloc3DArray_Negative_DifferentChannelSizes") {
}
TEST_CASE("Unit_hipMalloc3DArray_Negative_BadChannelSize") {
CHECK_IMAGE_SUPPORT
const int badBits = GENERATE(-1, 0, 10, 100);
const hipChannelFormatKind formatKind =
GENERATE(hipChannelFormatKindSigned, hipChannelFormatKindUnsigned, hipChannelFormatKindFloat);
@@ -396,6 +424,8 @@ TEST_CASE("Unit_hipMalloc3DArray_Negative_BadChannelSize") {
// hipMalloc3DArray should handle the max numeric value gracefully.
TEST_CASE("Unit_hipMalloc3DArray_Negative_NumericLimit") {
CHECK_IMAGE_SUPPORT
hipArray_t arrayPtr;
hipChannelFormatDesc desc = hipCreateChannelDesc<float>();