Skip to content

Commit

Permalink
Merge pull request #282 from sampath1117/sn/jitter_host
Browse files Browse the repository at this point in the history
RPP Test Suite - Warp Afine Test Case Addition
  • Loading branch information
r-abishek authored Jun 24, 2024
2 parents ae374fd + e44e52b commit 7139d7d
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 6 deletions.
35 changes: 33 additions & 2 deletions utilities/test_suite/HIP/Tensor_hip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ int main(int argc, char **argv)
bool kernelSizeCase = (testCase == 40 || testCase == 41 || testCase == 49 || testCase == 54);
bool dualInputCase = (testCase == 2 || testCase == 30 || testCase == 33 || testCase == 61 || testCase == 63 || testCase == 65 || testCase == 68);
bool randomOutputCase = (testCase == 6 || testCase == 8 || testCase == 84 || testCase == 49 || testCase == 54);
bool nonQACase = (testCase == 24);
bool interpolationTypeCase = (testCase == 21 || testCase == 23 || testCase == 24 || testCase == 79);
bool reductionTypeCase = (testCase == 87 || testCase == 88 || testCase == 89 || testCase == 90 || testCase == 91);
bool noiseTypeCase = (testCase == 8);
Expand Down Expand Up @@ -716,6 +717,36 @@ int main(int argc, char **argv)

break;
}
case 24:
{
testCaseName = "warp_affine";

if ((interpolationType != RpptInterpolationType::BILINEAR) && (interpolationType != RpptInterpolationType::NEAREST_NEIGHBOR))
{
missingFuncFlag = 1;
break;
}

Rpp32f6 affineTensor_f6[batchSize];
Rpp32f *affineTensor = (Rpp32f *)affineTensor_f6;
for (i = 0; i < batchSize; i++)
{
affineTensor_f6[i].data[0] = 1.23;
affineTensor_f6[i].data[1] = 0.5;
affineTensor_f6[i].data[2] = 0;
affineTensor_f6[i].data[3] = -0.8;
affineTensor_f6[i].data[4] = 0.83;
affineTensor_f6[i].data[5] = 0;
}

startWallTime = omp_get_wtime();
if (inputBitDepth == 0 || inputBitDepth == 1 || inputBitDepth == 2 || inputBitDepth == 5)
rppt_warp_affine_gpu(d_input, srcDescPtr, d_output, dstDescPtr, affineTensor, interpolationType, roiTensorPtrSrc, roiTypeSrc, handle);
else
missingFuncFlag = 1;

break;
}
case 29:
{
testCaseName = "water";
Expand Down Expand Up @@ -1417,7 +1448,7 @@ int main(int argc, char **argv)
1.QA Flag is set
2.input bit depth 0 (U8)
3.source and destination layout are the same*/
if(qaFlag && inputBitDepth == 0 && (srcDescPtr->layout == dstDescPtr->layout) && !(randomOutputCase))
if(qaFlag && inputBitDepth == 0 && (srcDescPtr->layout == dstDescPtr->layout) && !(randomOutputCase) && !(nonQACase))
{
if (testCase == 87)
compare_reduction_output(static_cast<uint64_t *>(reductionFuncResultArr), testCaseName, srcDescPtr, testCase, dst, scriptPath);
Expand Down Expand Up @@ -1485,7 +1516,7 @@ int main(int argc, char **argv)
2.input bit depth 0 (Input U8 && Output U8)
3.source and destination layout are the same
4.augmentation case does not generate random output*/
if(qaFlag && inputBitDepth == 0 && ((srcDescPtr->layout == dstDescPtr->layout) || pln1OutTypeCase) && !(randomOutputCase))
if(qaFlag && inputBitDepth == 0 && ((srcDescPtr->layout == dstDescPtr->layout) || pln1OutTypeCase) && !(randomOutputCase) && !(nonQACase))
compare_output<Rpp8u>(outputu8, testCaseName, srcDescPtr, dstDescPtr, dstImgSizes, batchSize, interpolationTypeName, noiseTypeName, testCase, dst, scriptPath);

// Calculate exact dstROI in XYWH format for OpenCV dump
Expand Down
2 changes: 1 addition & 1 deletion utilities/test_suite/HIP/runTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def rpp_test_suite_parser_and_validator():
subprocess.run(["make", "-j16"], cwd=".") # nosec

# List of cases supported
supportedCaseList = ['0', '1', '2', '4', '6', '8', '13', '20', '21', '23', '29', '30', '31', '32', '33', '34', '36', '37', '38', '39', '45', '46', '54', '61', '63', '65', '68', '70', '79', '80', '82', '83', '84', '85', '86', '87', '88', '89', '90', '91', '92']
supportedCaseList = ['0', '1', '2', '4', '6', '8', '13', '20', '21', '23', '24', '29', '30', '31', '32', '33', '34', '36', '37', '38', '39', '45', '46', '54', '61', '63', '65', '68', '70', '79', '80', '82', '83', '84', '85', '86', '87', '88', '89', '90', '91', '92']

# Create folders based on testType and profilingOption
if testType == 1 and profilingOption == "YES":
Expand Down
36 changes: 34 additions & 2 deletions utilities/test_suite/HOST/Tensor_host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ int main(int argc, char **argv)
bool additionalParamCase = (testCase == 8 || testCase == 21 || testCase == 23 || testCase == 24 || testCase == 79);
bool dualInputCase = (testCase == 2 || testCase == 30 || testCase == 33 || testCase == 61 || testCase == 63 || testCase == 65 || testCase == 68);
bool randomOutputCase = (testCase == 6 || testCase == 8 || testCase == 84);
bool nonQACase = (testCase == 24);
bool interpolationTypeCase = (testCase == 21 || testCase == 23 || testCase == 24 || testCase == 79);
bool reductionTypeCase = (testCase == 87 || testCase == 88 || testCase == 89 || testCase == 90 || testCase == 91);
bool noiseTypeCase = (testCase == 8);
Expand Down Expand Up @@ -690,6 +691,37 @@ int main(int argc, char **argv)

break;
}
case 24:
{
testCaseName = "warp_affine";

if ((interpolationType != RpptInterpolationType::BILINEAR) && (interpolationType != RpptInterpolationType::NEAREST_NEIGHBOR))
{
missingFuncFlag = 1;
break;
}

Rpp32f6 affineTensor_f6[batchSize];
Rpp32f *affineTensor = (Rpp32f *)affineTensor_f6;
for (i = 0; i < batchSize; i++)
{
affineTensor_f6[i].data[0] = 1.23;
affineTensor_f6[i].data[1] = 0.5;
affineTensor_f6[i].data[2] = 0;
affineTensor_f6[i].data[3] = -0.8;
affineTensor_f6[i].data[4] = 0.83;
affineTensor_f6[i].data[5] = 0;
}

startWallTime = omp_get_wtime();
startCpuTime = clock();
if (inputBitDepth == 0 || inputBitDepth == 1 || inputBitDepth == 2 || inputBitDepth == 5)
rppt_warp_affine_host(input, srcDescPtr, output, dstDescPtr, affineTensor, interpolationType, roiTensorPtrSrc, roiTypeSrc, handle);
else
missingFuncFlag = 1;

break;
}
case 29:
{
testCaseName = "water";
Expand Down Expand Up @@ -1437,7 +1469,7 @@ int main(int argc, char **argv)
1.QA Flag is set
2.input bit depth 0 (U8)
3.source and destination layout are the same*/
if(qaFlag && inputBitDepth == 0 && (srcDescPtr->layout == dstDescPtr->layout) && !(randomOutputCase))
if(qaFlag && inputBitDepth == 0 && (srcDescPtr->layout == dstDescPtr->layout) && !(randomOutputCase) && !(nonQACase))
{
if (testCase == 87)
compare_reduction_output(static_cast<uint64_t *>(reductionFuncResultArr), testCaseName, srcDescPtr, testCase, dst, scriptPath);
Expand Down Expand Up @@ -1503,7 +1535,7 @@ int main(int argc, char **argv)
2.input bit depth 0 (Input U8 && Output U8)
3.source and destination layout are the same
4.augmentation case does not generate random output*/
if(qaFlag && inputBitDepth == 0 && ((srcDescPtr->layout == dstDescPtr->layout) || pln1OutTypeCase) && !(randomOutputCase))
if(qaFlag && inputBitDepth == 0 && ((srcDescPtr->layout == dstDescPtr->layout) || pln1OutTypeCase) && !(randomOutputCase) && !(nonQACase))
compare_output<Rpp8u>(outputu8, testCaseName, srcDescPtr, dstDescPtr, dstImgSizes, batchSize, interpolationTypeName, noiseTypeName, testCase, dst, scriptPath);

// Calculate exact dstROI in XYWH format for OpenCV dump
Expand Down
2 changes: 1 addition & 1 deletion utilities/test_suite/HOST/runTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def rpp_test_suite_parser_and_validator():
subprocess.run(["make", "-j16"], cwd=".") # nosec

# List of cases supported
supportedCaseList = ['0', '1', '2', '4', '6', '8', '13', '20', '21', '23', '29', '30', '31', '32', '33', '34', '36', '37', '38', '39', '45', '46', '54', '61', '63', '65', '68', '70', '79', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '90', '91', '92']
supportedCaseList = ['0', '1', '2', '4', '6', '8', '13', '20', '21', '23', '24', '29', '30', '31', '32', '33', '34', '36', '37', '38', '39', '45', '46', '54', '61', '63', '65', '68', '70', '79', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '90', '91', '92']

print("\n\n\n\n\n")
print("##########################################################################################")
Expand Down
1 change: 1 addition & 0 deletions utilities/test_suite/rpp_test_suite_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ std::map<int, string> augmentationMap =
{20, "flip"},
{21, "resize"},
{23, "rotate"},
{24, "warp_afffine"},
{29, "water"},
{30, "non_linear_blend"},
{31, "color_cast"},
Expand Down

0 comments on commit 7139d7d

Please sign in to comment.