SWDEV-349490 - Add unit test of sRGB (#2940)

Add unit test of sRGB.
Update helper functions to accomodate uchar4 and float4.
Change-Id: Ib604cf603ab63b908130ef1c562c53d42328bacf
Bu işleme şunda yer alıyor:
ROCm CI Service Account
2022-09-16 09:34:57 +05:30
işlemeyi yapan: GitHub
ebeveyn b5a13dd89e
işleme a47f421eb8
6 değiştirilmiş dosya ile 437 ekleme ve 51 silme
+3 -3
Dosyayı Görüntüle
@@ -35,7 +35,7 @@ __global__ void tex2DKernel(float *outputData, hipTextureObject_t textureObject,
}
template<hipTextureAddressMode addressMode, hipTextureFilterMode filterMode, bool normalizedCoords>
void runTest(const int width, const int height, const float offsetX, const float offsetY) {
static void runTest(const int width, const int height, const float offsetX, const float offsetY) {
//printf("%s(addressMode=%d, filterMode=%d, normalizedCoords=%d, width=%d, height=%d, offsetX=%f, offsetY=%f)\n",
// __FUNCTION__, addressMode, filterMode, normalizedCoords, width, height, offsetX, offsetY);
unsigned int size = width * height * sizeof(float);
@@ -92,7 +92,7 @@ void runTest(const int width, const int height, const float offsetX, const float
for (int i = 0; i < height; i++) {
for (int j = 0; j < width; j++) {
int index = i * width + j;
float expectedValue = getExpectedValue<addressMode, filterMode>(width, height,
float expectedValue = getExpectedValue<float, addressMode, filterMode>(width, height,
offsetX + j, offsetY + i, hData);
if (!hipTextureSamplingVerify<float, filterMode>(hOutputData[index], expectedValue)) {
INFO("Mismatch at (" << offsetX + j << ", " << offsetY + i << "):" <<
@@ -128,7 +128,7 @@ TEST_CASE("Unit_hipTextureObj2DCheckModes") {
runTest<hipAddressModeBorder, hipFilterModePoint, false>(256, 256, 12.5, 6.7);
}
SECTION("hipAddressModeClamp, hipFilterModePoint, regularCoords") {
SECTION("hipAddressModeClamp, hipFilterModeLinear, regularCoords") {
runTest<hipAddressModeClamp, hipFilterModeLinear, false>(256, 256, -0.4, -0.4);
runTest<hipAddressModeClamp, hipFilterModeLinear, false>(256, 256, 4, 14.6);
}