Skip to content

Commit

Permalink
Merge pull request #259 from sampath1117/sr/test_suite_bug_fix
Browse files Browse the repository at this point in the history
Crop and Patch - Test suite bug fix and Doxygen output
  • Loading branch information
r-abishek committed Apr 1, 2024
2 parents 393e460 + 8c4e7b7 commit 0941e36
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions include/rppt_tensor_geometric_augmentations.h
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,9 @@ RppStatus rppt_slice_gpu(RppPtr_t srcPtr, RpptGenericDescPtr srcGenericDescPtr,
* - srcPtr1 depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).
* - srcPtr2 depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).
* - dstPtr depth ranges - Will be same depth as srcPtr.
* \image html img150x150.png Sample Input1
* \image html img150x150_2.png Sample Input2
* \image html geometric_augmentations_crop_and_patch_img150x150.png Sample Output
* \param [in] srcPtr1 source tensor1 in HOST memory
* \param [in] srcPtr2 source tensor2 in HOST memory
* \param [in] srcDescPtr source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)
Expand All @@ -511,6 +514,9 @@ RppStatus rppt_crop_and_patch_host(RppPtr_t srcPtr1, RppPtr_t srcPtr2, RpptDescP
* - srcPtr1 depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).
* - srcPtr2 depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).
* - dstPtr depth ranges - Will be same depth as srcPtr.
* \image html img150x150.png Sample Input1
* \image html img150x150_2.png Sample Input2
* \image html geometric_augmentations_crop_and_patch_img150x150.png Sample Output
* \param [in] srcPtr1 source tensor1 in HIP memory
* \param [in] srcPtr2 source tensor2 in HIP memory
* \param [in] srcDescPtr source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)
Expand Down
4 changes: 3 additions & 1 deletion utilities/test_suite/HIP/Tensor_hip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,8 @@ int main(int argc, char **argv)
CHECK(hipHostMalloc(&cropRoi, batchSize * sizeof(RpptROI)));
CHECK(hipHostMalloc(&patchRoi, batchSize * sizeof(RpptROI)));
}
bool invalidROI = (roiList[0] == 0 && roiList[1] == 0 && roiList[2] == 0 && roiList[3] == 0);

Rpp32f *intensity;
if(testCase == 46)
CHECK(hipHostMalloc(&intensity, batchSize * sizeof(Rpp32f)));
Expand Down Expand Up @@ -400,7 +402,7 @@ int main(int argc, char **argv)
CHECK(hipMemcpy(d_input_second, input_second, inputBufferSize, hipMemcpyHostToDevice));

int roiHeightList[batchSize], roiWidthList[batchSize];
if(roiList[0] == 0 && roiList[1] == 0 && roiList[2] == 0 && roiList[3] == 0)
if(invalidROI)
{
for(int i = 0; i < batchSize ; i++)
{
Expand Down
3 changes: 2 additions & 1 deletion utilities/test_suite/HOST/Tensor_host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ int main(int argc, char **argv)
cropRoi = static_cast<RpptROI*>(calloc(batchSize, sizeof(RpptROI)));
patchRoi = static_cast<RpptROI*>(calloc(batchSize, sizeof(RpptROI)));
}
bool invalidROI = (roiList[0] == 0 && roiList[1] == 0 && roiList[2] == 0 && roiList[3] == 0);

// Set the number of threads to be used by OpenMP pragma for RPP batch processing on host.
// If numThreads value passed is 0, number of OpenMP threads used by RPP will be set to batch size
Expand Down Expand Up @@ -390,7 +391,7 @@ int main(int argc, char **argv)
convert_input_bitdepth(input, input_second, inputu8, inputu8Second, inputBitDepth, ioBufferSize, inputBufferSize, srcDescPtr, dualInputCase, conversionFactor);

int roiHeightList[batchSize], roiWidthList[batchSize];
if(roiList[0] == 0 && roiList[1] == 0 && roiList[2] == 0 && roiList[3] == 0)
if(invalidROI)
{
for(int i = 0; i < batchSize ; i++)
{
Expand Down

0 comments on commit 0941e36

Please sign in to comment.