Skip to content

Commit

Permalink
Bugfix - Log Tensor (#479)
Browse files Browse the repository at this point in the history
* Update the code to use correct stride updation

* Add QA test case for log

---------

Co-authored-by: Srihari-mcw <srihari@multicorewareinc.com>
Co-authored-by: Kiriti Gowda <kiritigowda@gmail.com>
  • Loading branch information
3 people authored Jan 8, 2025
1 parent 6fcfc6f commit bf09fc8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/modules/cpu/kernel/log.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ void log_recursive(T1 *src, Rpp32u *srcStrides, T2 *dst, Rpp32u *dstStrides, Rpp
for (int i = 0; i < *dstShape; i++)
{
log_recursive(src, srcStrides + 1, dst, dstStrides + 1, dstShape + 1, nDim - 1);
dst += *dstStrides;
src += *srcStrides;
dst += *(dstStrides + 1);
src += *(srcStrides + 1);
}
}
}
Expand Down
Binary file not shown.
Binary file added utilities/test_suite/TEST_MISC_FILES/4d_input.bin
Binary file not shown.
14 changes: 12 additions & 2 deletions utilities/test_suite/rpp_test_suite_misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,10 @@ void read_data(Rpp32f *data, Rpp32u nDim, Rpp32u readType, string scriptPath, st
{
if(nDim != 2 && nDim != 3)
{
std::cout<<"\nGolden Inputs / Outputs are generated only for 2D/3D data"<<std::endl;
exit(0);
if(nDim != 4 || testCase != "log") {
std::cout<<"\nGolden Inputs / Outputs are generated only for 2D/3D data"<<std::endl;
exit(0);
}
}
string dataPath = get_path(nDim, readType, scriptPath, testCase, isMeanStd);
read_bin_file(dataPath, data);
Expand Down Expand Up @@ -107,6 +109,14 @@ void fill_roi_values(Rpp32u nDim, Rpp32u batchSize, Rpp32u *roiTensor, bool qaMo
break;
exit(0);
}
case 4:
{
std::array<Rpp32u, 8> roi = {0, 0, 0, 0, 50, 50, 50, 4};
for(int i = 0, j = 0; i < batchSize ; i++, j += 8)
std::copy(roi.begin(), roi.end(), &roiTensor[j]);
break;
exit(0);
}
}
}
else
Expand Down

0 comments on commit bf09fc8

Please sign in to comment.