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

Change-Id: I62b3f7489f2f33b4b4e02f42a46e66c8940f2277
Este commit está contenido en:
Jatin Chaudhary
2023-07-25 17:04:13 +01:00
cometido por Jatin Jaikishan Chaudhary
padre b6b43db172
commit ee3c94faf2
Se han modificado 52 ficheros con 524 adiciones y 76 borrados
+29
Ver fichero
@@ -68,6 +68,8 @@ static void MallocArray_DiffSizes(int gpu) {
}
TEST_CASE("Unit_hipMallocArray_DiffSizes") {
CHECK_IMAGE_SUPPORT
MallocArray_DiffSizes(0);
HIP_CHECK_THREAD_FINALIZE();
}
@@ -78,6 +80,8 @@ scenario by launching threads in parallel on multiple GPUs
and verifies the hipMallocArray API with small and big chunks data
*/
TEST_CASE("Unit_hipMallocArray_MultiThread") {
CHECK_IMAGE_SUPPORT
std::vector<std::thread> threadlist;
int devCnt = 0;
devCnt = HipTest::getDeviceCount();
@@ -373,6 +377,7 @@ void testArrayAsSurface(hipArray_t arrayPtr, const size_t width, const size_t he
// Selection of types chosen to reduce compile times
TEMPLATE_TEST_CASE("Unit_hipMallocArray_happy", "", uint, int, int4, ushort, short2, char, uchar2,
char4, float, float2, float4) {
CHECK_IMAGE_SUPPORT
hipChannelFormatDesc desc = hipCreateChannelDesc<TestType>();
@@ -425,6 +430,8 @@ TEMPLATE_TEST_CASE("Unit_hipMallocArray_happy", "", uint, int, int4, ushort, sho
// EXSWCPHIPT-71 - no equivalent value for maxSurface and maxTexture2DGather.
TEMPLATE_TEST_CASE("Unit_hipMallocArray_MaxTexture_Default", "", uint, int4, ushort, short2, char,
char4, float2, float4) {
CHECK_IMAGE_SUPPORT
size_t width, height;
hipArray_t array{};
hipChannelFormatDesc desc = hipCreateChannelDesc<TestType>();
@@ -482,6 +489,8 @@ TEMPLATE_TEST_CASE("Unit_hipMallocArray_MaxTexture_Default", "", uint, int4, ush
// Arrays with channels of different size are not allowed.
TEST_CASE("Unit_hipMallocArray_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);
@@ -520,6 +529,8 @@ TEST_CASE("Unit_hipMallocArray_Negative_DifferentChannelSizes") {
// Zero-width array is not supported
TEST_CASE("Unit_hipMallocArray_Negative_ZeroWidth") {
CHECK_IMAGE_SUPPORT
hipChannelFormatDesc desc = hipCreateChannelDesc<float4>();
// pointer to the array in device memory
@@ -534,6 +545,8 @@ TEST_CASE("Unit_hipMallocArray_Negative_ZeroWidth") {
// Providing the array pointer as nullptr should return an error
TEST_CASE("Unit_hipMallocArray_Negative_NullArrayPtr") {
CHECK_IMAGE_SUPPORT
hipChannelFormatDesc desc = hipCreateChannelDesc<float4>();
HIP_CHECK_ERROR(hipMallocArray(nullptr, &desc, 1024, 0, hipArrayDefault), hipErrorInvalidValue);
@@ -541,6 +554,8 @@ TEST_CASE("Unit_hipMallocArray_Negative_NullArrayPtr") {
// Providing the desc pointer as nullptr should return an error
TEST_CASE("Unit_hipMallocArray_Negative_NullDescPtr") {
CHECK_IMAGE_SUPPORT
hipArray_t arrayPtr;
HIP_CHECK_ERROR(hipMallocArray(&arrayPtr, nullptr, 1024, 0, hipArrayDefault),
hipErrorInvalidValue);
@@ -548,6 +563,8 @@ TEST_CASE("Unit_hipMallocArray_Negative_NullDescPtr") {
// Inappropriate but related flags should still return an error
TEST_CASE("Unit_hipMallocArray_Negative_BadFlags") {
CHECK_IMAGE_SUPPORT
hipChannelFormatDesc desc = hipCreateChannelDesc<float4>();
hipArray_t arrayPtr;
@@ -574,6 +591,8 @@ TEST_CASE("Unit_hipMallocArray_Negative_BadFlags") {
// 8-bit float channels are not supported
TEMPLATE_TEST_CASE("Unit_hipMallocArray_Negative_8bitFloat", "", float, float2, float4) {
CHECK_IMAGE_SUPPORT
hipChannelFormatDesc desc = GENERATE(hipCreateChannelDesc(8, 0, 0, 0, hipChannelFormatKindFloat),
hipCreateChannelDesc(8, 8, 0, 0, hipChannelFormatKindFloat),
hipCreateChannelDesc(8, 8, 8, 8, hipChannelFormatKindFloat));
@@ -592,6 +611,8 @@ TEMPLATE_TEST_CASE("Unit_hipMallocArray_Negative_8bitFloat", "", float, float2,
// Only 8, 16, and 32 bit channels are supported
TEST_CASE("Unit_hipMallocArray_Negative_BadNumberOfBits") {
CHECK_IMAGE_SUPPORT
const int badBits = GENERATE(-1, 0, 10, 100);
const hipChannelFormatKind formatKind =
GENERATE(hipChannelFormatKindSigned, hipChannelFormatKindUnsigned, hipChannelFormatKindFloat);
@@ -618,6 +639,8 @@ TEST_CASE("Unit_hipMallocArray_Negative_BadNumberOfBits") {
// creating elements with 3 channels is not supported.
TEST_CASE("Unit_hipMallocArray_Negative_3ChannelElement") {
CHECK_IMAGE_SUPPORT
const int bits = GENERATE(8, 16, 32);
hipChannelFormatKind formatKind =
GENERATE(hipChannelFormatKindSigned, hipChannelFormatKindUnsigned, hipChannelFormatKindFloat);
@@ -644,6 +667,8 @@ TEST_CASE("Unit_hipMallocArray_Negative_3ChannelElement") {
// The bit channel description should not allow any channels after a zero channel
TEST_CASE("Unit_hipMallocArray_Negative_ChannelAfterZeroChannel") {
CHECK_IMAGE_SUPPORT
const int bits = GENERATE(8, 16, 32);
const hipChannelFormatKind formatKind =
GENERATE(hipChannelFormatKindSigned, hipChannelFormatKindUnsigned, hipChannelFormatKindFloat);
@@ -671,6 +696,8 @@ TEST_CASE("Unit_hipMallocArray_Negative_ChannelAfterZeroChannel") {
// The channel format should be one of the defined formats
TEST_CASE("Unit_hipMallocArray_Negative_InvalidChannelFormat") {
CHECK_IMAGE_SUPPORT
const int bits = 32;
hipChannelFormatKind formatKind = static_cast<hipChannelFormatKind>(0xFF);
hipChannelFormatDesc desc = hipCreateChannelDesc(bits, bits, bits, bits, formatKind);
@@ -695,6 +722,8 @@ TEST_CASE("Unit_hipMallocArray_Negative_InvalidChannelFormat") {
// hipMallocArray should handle the max numeric value gracefully.
TEST_CASE("Unit_hipMallocArray_Negative_NumericLimit") {
CHECK_IMAGE_SUPPORT
hipArray_t arrayPtr;
hipChannelFormatDesc desc = hipCreateChannelDesc<float>();