From 64ae74f72df7d94503f1f35219a1050f2aac2cf6 Mon Sep 17 00:00:00 2001 From: Abishek <52214183+r-abishek@users.noreply.github.com> Date: Wed, 8 May 2024 23:47:52 -0700 Subject: [PATCH] RPP Tensor Normalize ND on HOST and HIP (#335) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Change enum name * Support Batch processing Includes few fixes * Fix testsuite * Add Voxel unittest change testSuite CMakeLists * Add Doxygen Voxel augmentations * minor change * Add readme for Voxel test suite * Cleanup Includes modification in function naming for fmadd operation * Modify HIP testsuite * Optimize AVX Includes testsuite name change for normalize * Fix output dump issue in HIP and profiler logs * Move __AVX2__ flag * Changes to remove localThreads definitions, add _hip to kernel names * Fix QA reference inputs Also includes reverting to 16 pixel load for AVX * Fix codacy warnings * Fix toggle variant HWC -> CHW * Fix conflicting ROI types in API between HIP and HOST Also includes U8 support for slice * Use ROI Tensor instead of roi pointer * Add support for ND channel normalize * Add support for ND channel normalize * Fix usage of begin values Includes fixing of function names as per axis_mask * Add support for audio kernel * resolved issue with QA mode after U8 addition * made changes to display the exact variant being run in QA mode and performance test mode * minor change * resolved issue with unit test mode changed few variables from snake_case to camel case * reset DEBUG_MODE flag * resolved issue with HIP profiler tests * Add testsuite support for audio * Fix audio normalize testsuite Also adds QA reference outputs for normalize audio * Cleanup * Improve readability for normalize ND QA mode * Support ND axes normalize * Add templated C version for u8->f32 and i8->f32 * Update docs Also adds error code for invalid datatype for Slice kernel * Fix i8->f32 datatype * Update docs * Modify normalize testsuite to supporting any ND kernel Fix merge issues Also removes other voxel kernels * Fix audio testsuite and runMiscTests script * Disable QA tests when toggle is set in runMiscTests script * Support internal mean and stddev computation for 3D * Fix Axis mask for 3D Includes cleanup and testsuite changes * CMakeLists - Version Update 1.5.0 - TOT Version * CHANGELOG Updates Version 1.5.0 placeholder * Update rppdefs.h for comments on2D/ 3D types * Rename to fused_multiply_add_scalar * Implement collapse axis functionality for ND * Implement mean and stddev internal compute for ND normalize * Fix paramStride after collapse axis for ND * Fix build error * Fix mean and stddev compute in ND Cleanup * Cleanup * Additional cleanup * Fix strides for 2D and 3D Also includes fix for normalize ND kernel after collapse axis * minor changes * added QA inputs for 3D data * fixed issue with idx used for mean and std dev in case of ND Normalize * resolved the segfault issue with collapse axis for batch size > 1 * Fix 3d mean and stddev compute for axismask 5 Includes cleanup * Cleanup 2d audio kernel and fix audio testsuite Also handled striding for mean and stddev tensors when input dimensions within batch differs * Fix maxSize compute in normalize ND kernel * fixed normalization function for 3D * RPP RICAP Tensor for HOST and HIP (#213) * Initial commit - Ricap HOST Tensor Includes testsuite changes * Add QA tests for RICAP Used three_images_224x224_src1 folder to create golden outputs * Add three_images_224x224_src1 into TEST_IMAGES * Support HIP Backend for RICAP * Fix HIP pkd3->pkd3 variant * regenerated golden outputs for RICAP minor changes in HOST shell script for handling RICAP in QA mode * minor bug fix in RICAP HIP kernels * Improve readability and Cleanup * Additional cleanup * Cleanup testsuite Includes new golden outputs * Additional testuite fixes * Minor cleanup * Fix codacy warnings * Address other codacy warnings * Update ricap.hpp with reference paper * Add RICAP dataset path in readme * Make changes to error codes returned * Modify roi crop region for unit and perf tests * RPP Tensor Water Augmentation on HOST and HIP (#181) * added water HOST and HIP codes * added water case in test suite * added golden outputs for water * added omp thread changes for water augmentation * experimental changes * fixed output issue with AVX2 instructions * added AVX2 support for PKD3 load function minor changes in PLN variant load functions * nwc commit - added avx2 changes for u8 layout toggle variants but need to add store functions for completion * Add Avx2 implementation for F32 and U8 toggle variants * Add AVX2 support for u8 pkd3-pln3 and i8 pkd3-pln3 for water augmentation * change F32 load and store logic * optimized the store function for F32 PLN3-PKD3 * reverted back irrelevant changes * minor change * optimized load and store functions for water U8 and F32 variants in host removed commented code * removed golden outputs for water * minor changes * renamed few functions and removed unused functions updated i8 pln1 load as per the optimized u8 pln1 load * fixed bug in i8 load function * changed cast to c++ style resolved spacing issues and added comments for AVX codes for better understanding made changes to handle cases where QA Tests are not supported * added golden outputs for water * updated golden outputs with latest changes * modified the u8, i8 pkd3-pln3 function and added comments for the vectorized code * fixed minor bug in I8 variants * made to changes to resolve codacy warnings * changed cast to c++ style in hip kernel * changed generic nn F32 loads using gather and setr instructions * added comments for latest changes * minor change * added definition for storing 32 and 64 bits from a 128bit register --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM * Fix build error * CMakeLists - Version Update 1.5.0 - TOT Version * CHANGELOG Updates Version 1.5.0 placeholder * Boost deps fix for test suite --------- Co-authored-by: Snehaa Giridharan Co-authored-by: sampath1117 Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: HazarathKumarM Co-authored-by: Kiriti Gowda * Documentation - Readme & changelog updates (#251) * readme and changelog updates for 6.0 * minor update * Change names of ref outputs * Fix host test suite cmake * Add Voxel tests for ctest and CI * Remove boost deps and change name fmadd to fused_multiply_add_scalar * Add project name to remove warning * Add scriptPath variable usage to make paths generic for CI * Move CHECK to header * Add C++17 warning fix * Add clarity in final QA result display - match voxel tests with other tensor tests * Build fixes * Fix merge issue of double call to set_max_dimensions * Add clarity on QA test final result * Add references for sample nii image usage * Remove tensor voxel slice augmentation output sample from main ReadMe * Codacy fix * resolved output mismatch issue with axismask5 * Fix index of roiTensor used in maxSize compute Includes cleanup Adds QA inputs and outputs for 3d axis 0,1 with mean and stddev input * Add QA for 4d with internal mean and stddev compute for axis 0,1,3 * Add extra QA tests to support code coverage * Add comments * Update doxygen for normalize ND Includes minor fix in audio testsuite * added normalize hip codes * reverted unwanted changes happened with merge * remove ricap mods * removed unwanted file changes * minor bug fix * reverted back to 1 pixel load and store for 2D kernel for better performance * experimental change * removed experimental change made the compute mod function as inline * avoided the reusage of power inside for loop * allocated pinned memory in handle and used same buffers in normalize kernel * restructured code in ND kernel * made mean and stddev buffers as gpu memory instead of pinned memory * reveted back few changes in test suite for supporting qa mode with axismask 3 * added condition to compute param index only when max param volume is not 1 * fixed the issue with numDims in normalize HOST * added initial version for mean compute of 2D inputs for axisMask1 axisMask2 * added executor for mean kernel launch for 2D inputs * added kernels for mean compute for 2D inputs * added mean compute support for 2 axes cases for 3d inputs * added mean compute for axisMask 4 and axisMask 5 cases * added mean compute for axisMask 3 and axisMask 6 for 3d inputs * added support for axisMask 7 for 3D inputs * restructured kernel launch for mean compute for 2D and 3D inputs * combined all reduction kernels to single kernel * moved common reduction to a helper function so that it can be resued * added initial support for stddev 2d inputs * added stddev compute support for 2d and 3d inputs * bug fix on boundary condition && mean index calculation for 3D inputs * bug fix for axisMask 7 for 3D inputs * added initial support for nd mean and stddev compute * added final kernel for computing mean and std values for ND * optimized nd mean and stddev compute if number of meanss/stddev computations is lesser than max shared memory size * removed redundant code * nwc - fixed the performance issue with axismask 7 * resolved the performance issue with axisMask == 3 and axisMask == 4 * bug fix for axisMask == 4 * fixed the performance issues with axisMask 6 * removed the usage of mod calculation for normalize 2d kernel * removed the usage of mod calculation for normalize 3d kernels removed the usage of paramShape and paramStrides buffers from 2d and 3d kernels since not needed anymore * minor change for axisMask 6 * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * License - updates to 2024 and consistency changes (#298) * Match all CMakeLists.txt license as per RPP's outermost LICENSE file * Match all python files' license as per RPP's outermost LICENSE file * Match all .hpp files' license as per RPP's outermost LICENSE file * Match all .cpp files' license as per RPP's outermost LICENSE file * Match all .h files' license as per RPP's outermost LICENSE file * Remove all rights reserved as per LICENSE file * Remove double space in "Copyright (c) 2019 - 2023 Advanced Micro Devices, Inc." * Match all .cmake files' license as per RPP's outermost LICENSE file * Match all .cpp.in files' license as per RPP's outermost LICENSE file * Replace 283 occurrences in 282 files - 2023 to 2024 * Add "MIT License" title to 281 instances * Add missing license * Test - Update README.md for test_suite (#299) * Bump rocm-docs-core[api_reference] from 0.33.0 to 0.33.1 in /docs/sphinx (#301) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.33.0 to 0.33.1. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.33.0...v0.33.1) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump rocm-docs-core[api_reference] from 0.33.1 to 0.33.2 in /docs/sphinx (#302) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.33.1 to 0.33.2. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.33.1...v0.33.2) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * modified the axisMask order in kernel for better categorization * categorized kernels into multiple sections and added info * Update doc codeowners (#303) * Documentation - Bump rocm-docs-core[api_reference] from 0.33.2 to 0.34.0 in /docs/sphinx (#304) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.33.2 to 0.34.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.33.2...v0.34.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Test suite - upgrade 5 qa perf (#305) * experimental changes for adding qa mode for performance tests * made changes to add display more information w.r.t QA results summary for performance tests * minor changes * Add changes to dump qa results to excel file * Add performance QA for three new tensor functions * update prerequisites in readme * added changes to handle unsupported cases * removed treshold dictionary and added performance Noise treshold add new dataset for performance QA * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * Changes to the performane summary dataframe * minor changes * Update CMakeLists.txt to add ${CMAKE_CURRENT_SOURCE_DIR} for CI * Update CMakeLists.txt fix * Update CMakeLists.txt fix * remove tabulate dependency * Update README.md to remove tabulate pip install * Fix for CI machine failure * Add note on performance --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM Co-authored-by: Abishek <52214183+r-abishek@users.noreply.github.com> Co-authored-by: Snehaa Giridharan Co-authored-by: r-abishek * RPP Color Temperature on HOST and HIP (#271) * Initial commit - Color Temperature HOST Tensor * Initial commit - Color Temperature HIP Tensor * Add color temperature golden outputs * address review comments * Use reinterpret_cast instead of static_cast * Combine templated functions to support all datatypes into one (got minor perf difference of order 3%) Also fixes indentation * Fix i8 datatype * Cleanup * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * Fix PLN3 variant outputs Also modifies reference outputs * Update color_temperature.hpp license * Delete color_temperature_u8_Tensor_PKD3.csv * Delete color_temperature_u8_Tensor_PLN3.csv --------- Co-authored-by: snehaa8 Co-authored-by: HazarathKumarM Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> * RPP Voxel 3D Tensor Add/Subtract scalar on HOST and HIP (#272) * added HOST support for voxel add kernel * added HIP support for voxel add kernel * added test suite support for add scalar * added Doxygen support and modified hip kernel function names as per new standard * added HOST support for voxel subtract kernel * added HIP support for voxel subtract kernel * added test suite support * updated the golden outputs for subtract with correct values * removed unnessary validation checks * Remove double spaces * Fix header * Fix all retval docs * Fix docs to add memory type * Fix comment * Add divider comment * Use post-increment efficiently * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * converted add and subtract scalar golden outputs to bin files * changed copyright from 2023 to 2024 * Update add_scalar.hpp license * Update subtract_scalar.hpp license --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM * RPP Magnitude on HOST and HIP (#278) * Initial commit - Magnitude HOST Tensor * Add QA reference outputs * Update runTests.py * Initial commit - Magnitude HIP Tensor * Add dual input support in testsuite * Optimize HOST kernel further * Optimize i8 datatype further * Modify comments * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * Bump rocm-docs-core[api_reference] from 0.31.0 to 0.33.0 in /docs/sphinx (#294) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.31.0 to 0.33.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.31.0...v0.33.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update Copywright year * Combine templated functions to support all datatypes * Modify format of reference outputs * Update rppi_arithmetic_operations.h license * Update rppt_tensor_arithmetic_operations.h license * Update host_tensor_arithmetic_operations.hpp * Update magnitude.hpp license * Update hip_tensor_arithmetic_operations.hpp license * Delete magnitude_u8_Tensor_PKD3.csv * Delete magnitude_u8_Tensor_PLN1.csv * Delete magnitude_u8_Tensor_PLN3.csv * Update rpp_test_suite_common.h license * Update runTests.py license * Update Tensor_hip.cpp license * Update runTests.py license * Update Tensor_host.cpp license --------- Signed-off-by: dependabot[bot] Co-authored-by: Snehaa Giridharan Co-authored-by: HazarathKumarM Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> * moved normalize from geometric to statistical * removed commented lines in test suite * renamed normalize_generic.hpp to normalize.hpp updated copyright * moved common helper in misc HOST and HIP test suites to a separate header file * Bump rocm-docs-core[api_reference] from 0.34.0 to 0.34.2 in /docs/sphinx (#309) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.34.0 to 0.34.2. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.34.0...v0.34.2) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * RPP Tensor Audio Support - Down Mixing (#296) * Initial commit - Non slient region detection Includes unittest setup * Initial commit - To Decibels Includes unittest setup * Intial commit - pre_emphasis_filter * Intial commit - down_mixing * Replace vectors with arrays * Cleanup * Minor cleanup * Optimize downmixing Kernel Includes cleanup * Replace Rpp64s with Rpp32s * Cleanup * Optimize and precompute cutOff * Fix buffer used * Fix buffer used * Additional Cleanup * Optimize post incrmeent operation * Optimize post increment operation * Update testsuite for Audio * code cleanup * Add Readme file for Audio test suite * changes based on review comments * minor change * Remove unittest folders and updated README.md * Remove unit tests * minor change * code cleanup * added common header file for audio helper functions * removed unncessary audio wav files fixed bug in ROI updation for audio test suite resolved issue in summary generation for performance tests in python * removed log file * added doxygen support for audio * added doxygen changes for to_decibels * updated test suite support for to_decibels * minor change * added doxygen changes for preemphasis filter * updated changes for preemphasis filter in test suite * removed the usage of getMax function and used std::max_element * modularized code in test suite * merge with latest changes * minor change * minor change * minor change * resolved codacy warnings * Codacy fix - Remove unused cpuTime * CMakeLists - Version Update 1.5.0 - TOT Version * CHANGELOG Updates Version 1.5.0 placeholder * resolved issue with file_system dependency in test suite * Doxygen changes changed malloc to new in NSR kernel * RPP RICAP Tensor for HOST and HIP (#213) * Initial commit - Ricap HOST Tensor Includes testsuite changes * Add QA tests for RICAP Used three_images_224x224_src1 folder to create golden outputs * Add three_images_224x224_src1 into TEST_IMAGES * Support HIP Backend for RICAP * Fix HIP pkd3->pkd3 variant * regenerated golden outputs for RICAP minor changes in HOST shell script for handling RICAP in QA mode * minor bug fix in RICAP HIP kernels * Improve readability and Cleanup * Additional cleanup * Cleanup testsuite Includes new golden outputs * Additional testuite fixes * Minor cleanup * Fix codacy warnings * Address other codacy warnings * Update ricap.hpp with reference paper * Add RICAP dataset path in readme * Make changes to error codes returned * Modify roi crop region for unit and perf tests * RPP Tensor Water Augmentation on HOST and HIP (#181) * added water HOST and HIP codes * added water case in test suite * added golden outputs for water * added omp thread changes for water augmentation * experimental changes * fixed output issue with AVX2 instructions * added AVX2 support for PKD3 load function minor changes in PLN variant load functions * nwc commit - added avx2 changes for u8 layout toggle variants but need to add store functions for completion * Add Avx2 implementation for F32 and U8 toggle variants * Add AVX2 support for u8 pkd3-pln3 and i8 pkd3-pln3 for water augmentation * change F32 load and store logic * optimized the store function for F32 PLN3-PKD3 * reverted back irrelevant changes * minor change * optimized load and store functions for water U8 and F32 variants in host removed commented code * removed golden outputs for water * minor changes * renamed few functions and removed unused functions updated i8 pln1 load as per the optimized u8 pln1 load * fixed bug in i8 load function * changed cast to c++ style resolved spacing issues and added comments for AVX codes for better understanding made changes to handle cases where QA Tests are not supported * added golden outputs for water * updated golden outputs with latest changes * modified the u8, i8 pkd3-pln3 function and added comments for the vectorized code * fixed minor bug in I8 variants * made to changes to resolve codacy warnings * changed cast to c++ style in hip kernel * changed generic nn F32 loads using gather and setr instructions * added comments for latest changes * minor change * added definition for storing 32 and 64 bits from a 128bit register --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM * Fix build error * CMakeLists - Version Update 1.5.0 - TOT Version * CHANGELOG Updates Version 1.5.0 placeholder * Boost deps fix for test suite --------- Co-authored-by: Snehaa Giridharan Co-authored-by: sampath1117 Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: HazarathKumarM Co-authored-by: Kiriti Gowda * Documentation - Readme & changelog updates (#251) * readme and changelog updates for 6.0 * minor update * added ctests for audio test suite for CI made changes to add more clarity on the QA Tests results * Cmake mods for ctest * HOST-only build error bugfix * added qa mode paramter to python audio script added golden output map for QA testing of Non silent region detection * minor change * Documentation - Bump rocm-docs-core[api_reference] from 0.26.0 to 0.27.0 in /docs/sphinx (#253) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.26.0 to 0.27.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.26.0...v0.27.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * RPP Resize Mirror Normalize Bugfix (#252) * added fix for hipMemset * remove pixel check for U8-F32 and U8-F16 for HOST codes --------- Co-authored-by: sampath1117 * added example for MMS calculation in comments for better understanding * Sphinx - updates (#257) * Sphinx - updates * Doxygen - Updates * Docs - Remove index.md * updated info used to for running audio test suite * removed bitdepth variable from audio test suite * added more information on computing NSR outputs in the example added * Fix doxygen for decibels Also removes extra QA reference files * move tensor_host_audio.cpp to host folder * Fix build errors and qa tests in Audio Test suite * Fix build errors and qa tests in Audio Test suite * Add reference output and test samples for downmix * Add down_mix in augmentation list and supported cases * Remove auto-merge repeated funcs * Improve clarity of header docs * Remove blank line * Improve clarity on header docs * Add Doxygen comments * minor change * converted golden outputs to binary file for downmixing * removed old golden output file for preemphasis and todecibels * modified info for downmixing as per new changes used handle memory for temporary buffers * formatting changes * moved the common code for SSE and AVX to outside * Update down_mixing.hpp license * Update rppt_tensor_audio_augmentations.h * combined the srcLength and channels tensors into single tensor --------- Signed-off-by: dependabot[bot] Co-authored-by: Snehaa Giridharan Co-authored-by: HazarathKumarM Co-authored-by: sampath1117 Co-authored-by: Kiriti Gowda Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: Lisa Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sundarrajan98 * RPP Voxel 3D Tensor Multiply scalar on HOST and HIP (#306) * added HIP support for voxel scalar multiply kernel * added HOST support for voxel multiply kernel added golden outputs for voxel multiply kernel * merge with master * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * converted multiply scalar voxel golden outputs to bin files * changed copyright from 2023 to 2024 --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM * Test Suite Bugfix (#307) * experimental changes for adding qa mode for performance tests * made changes to add display more information w.r.t QA results summary for performance tests * minor changes * Add changes to dump qa results to excel file * Add performance QA for three new tensor functions * update prerequisites in readme * added changes to handle unsupported cases * removed treshold dictionary and added performance Noise treshold add new dataset for performance QA * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * Changes to the performane summary dataframe * minor changes * Update CMakeLists.txt to add ${CMAKE_CURRENT_SOURCE_DIR} for CI * Update CMakeLists.txt fix * Update CMakeLists.txt fix * remove tabulate dependency * Update README.md to remove tabulate pip install * Fix for CI machine failure * Add note on performance * Fix segmentation fault * Revert QAmode to restrict HIP bitdepths * Use Rpp64u for HOST while comparing outputs * Fix ambiguous abs call * Fix for SLES CI HIP fail - error: incompatible pointer types assigning to 'unsigned long *' from 'unsigned long long *' - refOutput = TensorSumReferenceOutputs[numChannels].data(); --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM Co-authored-by: Snehaa Giridharan Co-authored-by: Pavel Tcherniaev * modified fill_roi_values function * made the changes w.r.t scriptPath * moved rpp_rsqrt_avx under rpp math helpers reverted unwanted file changes * Bump rocm-docs-core[api_reference] from 0.34.2 to 0.35.0 in /docs/sphinx (#313) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.34.2 to 0.35.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.34.2...v0.35.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * RPP Reduction - Tensor min and Tensor max on HOST and HIP (#260) * Minor Change * Add Validation check for DST_FOLDER path * added water HOST and HIP codes * added water case in test suite * added golden outputs for water * Add Validation checks for all options in testAllScript.sh * Add sanity check for dual Input cases Set Max Dimension and Max Image Dump Replaced Fast DCT tag with Accurate DCT * Regenerate golden outputs using accurate dct Flag Add golden outputs for some new augmentations * Fix Flip golden outputs mismatch Fix PLN3 variants mismatch in QA mode * Add MAX_BATCH_SIZE check removed Augmentations function calls for failing Qa modes code cleanup * Add crop and gamma correction augmentations code cleanup * Add comments to functions in rpp_test_suite_common.h * minor change * code cleanup * minor code changes * Change roi and Image sizes for crop augmentation * Change numIterations option to numRuns Addressed PR comments * added omp thread changes for water augmentation * experimental changes * fixed output issue with AVX2 instructions * added AVX2 support for PKD3 load function minor changes in PLN variant load functions * Add turboJpeg header to update maxHeight and maxWidth values * nwc commit - added avx2 changes for u8 layout toggle variants but need to add store functions for completion * Change the performance Timings logic * Add Avx2 implementation for F32 and U8 toggle variants * minor change to support u8_f16 and u8_f32 cases * Regenerate LUT golden outputs with ACCURATE_DCT tag * Minor code changes * Add AVX2 support for u8 pkd3-pln3 and i8 pkd3-pln3 for water augmentation * Made changes to the runTests.py in Host to remove testAllScipts.sh * Made changes to the runTests.py in HIP to remove testAllScipts.sh * Initial commit - Image min and max Reduction kernel Includes * u8 datatype for both min and max HOST Tensor of all variants. * Testsuite changes. * NWC -initial code for min max PLN3 - PLN3 * made changes to split min and max kernels seperately * splitted kernels for min and max * made changes to print final max/min in the R,G,B channels * fixed inaccuracies in min/max computation * made changes to typecast intermediate output to output requested by user added comments for the code code cleanup and minor changes in test suite * fixed build issues removed image folders used for min, max and sum reverted unwanted file changes * minor changes in test suite * removed support for unwanted test case in Tensor_hip.cpp * Adds new option roi * remove testAllScripts.sh * Adds roi Option in HIP backend * Implement f32 variants * Implement f16 and i8 datatype variants * change F32 load and store logic * Add build flags in CMakeLists.txt to set AVX/SSE flags based on the system configuration * minor code changes * Initial commit - Image sum Reduction kernel Includes u8 PLN1 -> PLN1 conversion for HOST Tensor * Implement PKD3 and PLN3 for Image sum Tensor HOST * Support i8, f16 and f32 datatypes * Initial commit - Image sum Reduction HIP kernel Includes u8 PLN1 -> PLN1 conversion for Tensor * Implement PKD3 and PLN3 for Image sum Tensor HIP * Add support in testsuite Revert normalization for i8 HOST Tensor variants * Fix HIP testsuite Remove additional blanks for 1 channel output * Modify print statement in HIP testsuite * Improve readability for testsuite outputs * optimized the store function for F32 PLN3-PKD3 * reverted back irrelevant changes * minor change * Fix HIP to support larger inputs * optimized load and store functions for water U8 and F32 variants in host removed commented code * Cleanup * removed golden outputs for water * minor changes * Cleanup Support Reduction QA test in testsuite * renamed few functions and removed unused functions updated i8 pln1 load as per the optimized u8 pln1 load * fixed bug in i8 load function * Remove unused variables and C style casting * changed cast to c++ style resolved spacing issues and added comments for AVX codes for better understanding made changes to handle cases where QA Tests are not supported * added golden outputs for water * updated golden outputs with latest changes * modified the u8, i8 pkd3-pln3 function and added comments for the vectorized code * fixed minor bug in I8 variants * Optimize u8 datatype further * Fix static_cast * made to changes to resolve codacy warnings * changed cast to c++ style in hip kernel * Initial commit - Ricap HOST Tensor Includes testsuite changes * Add QA tests for RICAP Used three_images_224x224_src1 folder to create golden outputs * Add three_images_224x224_src1 into TEST_IMAGES * added rotate case with golden outputs changed generic bilinear HOST codes to match with HIP codes * Add golden output for remaining all tensor augmentations * fix python script issues * Optimize u8 and i8 datatype Uses uint and int internal processing instead of float * Fix testsuite build errors * minor change * Fix QA check * Modify api naming from image_sum to tensor_sum Includes changes for both HOST and HIP * Support HIP Backend for RICAP * change rcm and rmn golden outputs * Fix HIP pkd3->pkd3 variant * changes based on review comments * change test_suite folder to tests * Optimize u8 and i8 datatype of HIP Includes modification in naming of shared memory * minor fix * changed generic nn F32 loads using gather and setr instructions * Optimize and cleanup U8 HIP * regenerated golden outputs for RICAP minor changes in HOST shell script for handling RICAP in QA mode * minor bug fix in RICAP HIP kernels * Fix i8 datatype variants Includes cleanup * Fix the issues with color_to_greyscale * remove the empty folder creation * reverting back the folder name change * minor change * added comments for latest changes * minor change * Improve readability and Cleanup * Fix QA for HIP Includes cleanup * resolved review comments * minor change * Modify api naming from image_ to tensor_ for HOST * Add support for QA tests * removed range check for RMN U8-F32 and U8-F16 variants changed from hipMemset to hipMemsetAsync for RMN HIP Kernel removed multiplication by 255 for stdDev in RMN HOST U8-F16 and U8-F32 variants * Modify naming of shared memory with _smem in HIP Includes cleanup * Typecast and reuse markArr for HIP U8 and I8 * Cleanup and minor optimization * minor fix * fix codacy warnings * Additional cleanup * Cleanup and move #define * Changed the complexity of if statements in runTests.py * Cleanup testsuite Includes new golden outputs * Additional testuite fixes * Minor cleanup * Codacy fixes * Fix codacy warnings * Codacy fix * Address other codacy warnings * cleanup * Change Image functions to generic * Update ricap.hpp with reference paper * resolved minor issues happened with merge * minor changes * fixed minor issue with getting profiler times * minor formatting changes * resolved build issues in test suite renamed the min and max kernel file names * RPP RICAP Tensor for HOST and HIP (#213) * Initial commit - Ricap HOST Tensor Includes testsuite changes * Add QA tests for RICAP Used three_images_224x224_src1 folder to create golden outputs * Add three_images_224x224_src1 into TEST_IMAGES * Support HIP Backend for RICAP * Fix HIP pkd3->pkd3 variant * regenerated golden outputs for RICAP minor changes in HOST shell script for handling RICAP in QA mode * minor bug fix in RICAP HIP kernels * Improve readability and Cleanup * Additional cleanup * Cleanup testsuite Includes new golden outputs * Additional testuite fixes * Minor cleanup * Fix codacy warnings * Address other codacy warnings * Update ricap.hpp with reference paper * Add RICAP dataset path in readme * Make changes to error codes returned * Modify roi crop region for unit and perf tests * RPP Tensor Water Augmentation on HOST and HIP (#181) * added water HOST and HIP codes * added water case in test suite * added golden outputs for water * added omp thread changes for water augmentation * experimental changes * fixed output issue with AVX2 instructions * added AVX2 support for PKD3 load function minor changes in PLN variant load functions * nwc commit - added avx2 changes for u8 layout toggle variants but need to add store functions for completion * Add Avx2 implementation for F32 and U8 toggle variants * Add AVX2 support for u8 pkd3-pln3 and i8 pkd3-pln3 for water augmentation * change F32 load and store logic * optimized the store function for F32 PLN3-PKD3 * reverted back irrelevant changes * minor change * optimized load and store functions for water U8 and F32 variants in host removed commented code * removed golden outputs for water * minor changes * renamed few functions and removed unused functions updated i8 pln1 load as per the optimized u8 pln1 load * fixed bug in i8 load function * changed cast to c++ style resolved spacing issues and added comments for AVX codes for better understanding made changes to handle cases where QA Tests are not supported * added golden outputs for water * updated golden outputs with latest changes * modified the u8, i8 pkd3-pln3 function and added comments for the vectorized code * fixed minor bug in I8 variants * made to changes to resolve codacy warnings * changed cast to c++ style in hip kernel * changed generic nn F32 loads using gather and setr instructions * added comments for latest changes * minor change * added definition for storing 32 and 64 bits from a 128bit register --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM * Fix build error * CMakeLists - Version Update 1.5.0 - TOT Version * CHANGELOG Updates Version 1.5.0 placeholder * Boost deps fix for test suite --------- Co-authored-by: Snehaa Giridharan Co-authored-by: sampath1117 Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: HazarathKumarM Co-authored-by: Kiriti Gowda * Documentation - Readme & changelog updates (#251) * readme and changelog updates for 6.0 * minor update * Documentation - Bump rocm-docs-core[api_reference] from 0.26.0 to 0.27.0 in /docs/sphinx (#253) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.26.0 to 0.27.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.26.0...v0.27.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * RPP Resize Mirror Normalize Bugfix (#252) * added fix for hipMemset * remove pixel check for U8-F32 and U8-F16 for HOST codes --------- Co-authored-by: sampath1117 * Cmake fix to prevent warning * Fix paths in new python scripts * Sphinx - updates (#257) * Sphinx - updates * Doxygen - Updates * Docs - Remove index.md * Test suite fixes after tensor_min / tensor_max HOST merge * Fix max case * QA tests fix for hip and host * naming convention changes as per new std * Substitute imagePartial with partial * Substitute imageMin/imageMax with min/max * Replace hipMemset with hipMemsetAsync, and replace hipDeviceSynchronize with hipStreamSynchronize * Use variable instead of batchCount*4 * Use post increment effectivly * Resolve codacy warnings * Additional cleanup * remove unused variable * Documentation - Bump rocm-docs-core[api_reference] from 0.28.0 to 0.29.0 in /docs/sphinx (#265) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.28.0 to 0.29.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.28.0...v0.29.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Remove auto merge boost * Spaces formatting * Bump rocm-docs-core[api_reference] from 0.29.0 to 0.30.1 in /docs/sphinx (#268) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.29.0 to 0.30.1. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.29.0...v0.30.1) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * add support for mi300 (#269) * Documentation - Bump rocm-docs-core[api_reference] from 0.30.1 to 0.30.2 in /docs/sphinx (#273) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.30.1 to 0.30.2. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.30.1...v0.30.2) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Cleanup by removing oneliner functions as inline * RPP Tensor Audio Support - To Decibels (#258) * Initial commit - Non slient region detection Includes unittest setup * Initial commit - To Decibels Includes unittest setup * Replace vectors with arrays * Cleanup * Replace Rpp64s with Rpp32s * Optimize and precompute cutOff * Fix buffer used * Fix buffer used * Additional Cleanup * Update testsuite for Audio * code cleanup * Add Readme file for Audio test suite * changes based on review comments * minor change * Remove unittest folders and updated README.md * Remove unit tests * minor change * code cleanup * added common header file for audio helper functions * removed unncessary audio wav files fixed bug in ROI updation for audio test suite resolved issue in summary generation for performance tests in python * removed log file * added doxygen support for audio * added doxygen changes for to_decibels * updated test suite support for to_decibels * minor change * removed the usage of getMax function and used std::max_element * modularized code in test suite * merge with latest changes * minor change * minor change * resolved codacy warnings * Codacy fix - Remove unused cpuTime * CMakeLists - Version Update 1.5.0 - TOT Version * CHANGELOG Updates Version 1.5.0 placeholder * resolved issue with file_system dependency in test suite * Doxygen changes changed malloc to new in NSR kernel * RPP RICAP Tensor for HOST and HIP (#213) * Initial commit - Ricap HOST Tensor Includes testsuite changes * Add QA tests for RICAP Used three_images_224x224_src1 folder to create golden outputs * Add three_images_224x224_src1 into TEST_IMAGES * Support HIP Backend for RICAP * Fix HIP pkd3->pkd3 variant * regenerated golden outputs for RICAP minor changes in HOST shell script for handling RICAP in QA mode * minor bug fix in RICAP HIP kernels * Improve readability and Cleanup * Additional cleanup * Cleanup testsuite Includes new golden outputs * Additional testuite fixes * Minor cleanup * Fix codacy warnings * Address other codacy warnings * Update ricap.hpp with reference paper * Add RICAP dataset path in readme * Make changes to error codes returned * Modify roi crop region for unit and perf tests * RPP Tensor Water Augmentation on HOST and HIP (#181) * added water HOST and HIP codes * added water case in test suite * added golden outputs for water * added omp thread changes for water augmentation * experimental changes * fixed output issue with AVX2 instructions * added AVX2 support for PKD3 load function minor changes in PLN variant load functions * nwc commit - added avx2 changes for u8 layout toggle variants but need to add store functions for completion * Add Avx2 implementation for F32 and U8 toggle variants * Add AVX2 support for u8 pkd3-pln3 and i8 pkd3-pln3 for water augmentation * change F32 load and store logic * optimized the store function for F32 PLN3-PKD3 * reverted back irrelevant changes * minor change * optimized load and store functions for water U8 and F32 variants in host removed commented code * removed golden outputs for water * minor changes * renamed few functions and removed unused functions updated i8 pln1 load as per the optimized u8 pln1 load * fixed bug in i8 load function * changed cast to c++ style resolved spacing issues and added comments for AVX codes for better understanding made changes to handle cases where QA Tests are not supported * added golden outputs for water * updated golden outputs with latest changes * modified the u8, i8 pkd3-pln3 function and added comments for the vectorized code * fixed minor bug in I8 variants * made to changes to resolve codacy warnings * changed cast to c++ style in hip kernel * changed generic nn F32 loads using gather and setr instructions * added comments for latest changes * minor change * added definition for storing 32 and 64 bits from a 128bit register --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM * Fix build error * CMakeLists - Version Update 1.5.0 - TOT Version * CHANGELOG Updates Version 1.5.0 placeholder * Boost deps fix for test suite --------- Co-authored-by: Snehaa Giridharan Co-authored-by: sampath1117 Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: HazarathKumarM Co-authored-by: Kiriti Gowda * Documentation - Readme & changelog updates (#251) * readme and changelog updates for 6.0 * minor update * added ctests for audio test suite for CI made changes to add more clarity on the QA Tests results * Cmake mods for ctest * HOST-only build error bugfix * added qa mode paramter to python audio script added golden output map for QA testing of Non silent region detection * minor change * Documentation - Bump rocm-docs-core[api_reference] from 0.26.0 to 0.27.0 in /docs/sphinx (#253) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.26.0 to 0.27.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.26.0...v0.27.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * RPP Resize Mirror Normalize Bugfix (#252) * added fix for hipMemset * remove pixel check for U8-F32 and U8-F16 for HOST codes --------- Co-authored-by: sampath1117 * added example for MMS calculation in comments for better understanding * Sphinx - updates (#257) * Sphinx - updates * Doxygen - Updates * Docs - Remove index.md * updated info used to for running audio test suite * removed bitdepth variable from audio test suite * added more information on computing NSR outputs in the example added * Fix doxygen for decibels Also removes extra QA reference files * Fix build errors and qa tests in Audio Test suite * Remove auto-merge repeated funcs * Improve clarity on header docs * made changes based on review comments * stored golden outputs of to_decibels in binary file removed golden output text files for non silent region * removed unused parameter in verify_output function * updated list of cases supported in python script * added error handling for opening golden output file * Codacy fix and tests warning fix * Codacy fix * Codacy fix trial * codacy fix for checking boundaries of fstream --------- Signed-off-by: dependabot[bot] Co-authored-by: Snehaa Giridharan Co-authored-by: HazarathKumarM Co-authored-by: sampath1117 Co-authored-by: Kiriti Gowda Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: Lisa Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Documentation - Bump rocm-docs-core[api_reference] from 0.30.2 to 0.30.3 in /docs/sphinx (#274) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.30.2 to 0.30.3. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.30.2...v0.30.3) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Adding issue template (#270) * Add files via upload * added ROCm v6, MI300, default component * Fix cast used in testsuite Includes minor fixes * Fix displaying f16 outputs * Optimize HOST min/max reduce function further * Fix spacing in HIP kernels * Fix PLN1 outputs for u8 and i8 datatypes of HOST backend * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * Bump rocm-docs-core[api_reference] from 0.31.0 to 0.33.0 in /docs/sphinx (#294) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.31.0 to 0.33.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.31.0...v0.33.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Store reference outputs via map for min and max kernels * Update tensor_max.hpp license * Update tensor_min.hpp license * Fix output comparison check * Merge branch 'ar/opt_tensor_min_tensor_max' of https://github.com/r-abishek/rpp into sn/tensor_min_max * Modify exit condition used in outer most kernel * Modify srcIdx for HIP Tensor min * Using maximum as 255 for HIP Tensor min * Modify srcIdx for HIP Tensor max kernel Also fixes build error in testsuite * Fix corrupted outputs displayed for Tensor sum * Fix corruption issue seen with tensor sum kernel * Fix minimum for I8 Tensor max kernel * Modified HIP buffer initialization with a common function * Fix redefinition * Remove additional variables xAlignedLength * Remove unwanted xAlignedLength and xDiff * Remove redefinition of TensorSumReferenceOutputs * Fix for CI issue * Add parenthesis --------- Signed-off-by: dependabot[bot] Co-authored-by: HazarathKumarM Co-authored-by: sampath1117 Co-authored-by: Snehaa Giridharan Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: fiona-gladwin Co-authored-by: Kiriti Gowda Co-authored-by: Lisa Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Lakshmi Kumar Co-authored-by: abhimeda <138710508+abhimeda@users.noreply.github.com> * CI - Update precheckin.groovy * added bin golden input and output for 2d data made changes in test suite to support the reading and output comparision from bin files removed the olde golden input and output .txt files * added golden inputs for 2d mean and std added golden output for 2d when mean and std is passed from user modified the helper functions to calculate the strides for 2 modes of normalize * added golden input and output for 3D data * fix for output mean and stddev outputs compute for axisMask 3 * fixed the precision issue with 3d normalization kernel when mean and std is passed from user further cleanup in test suite * use static_cast instead of c style casting * added template argument to kernels for supporting multiple bitdepths * Revert rpp_load24_f32pkd3_to_f32pln3_avx() Cleanup comments in HOST normalize * Bump rocm-docs-core[api_reference] from 0.35.0 to 0.35.1 in /docs/sphinx (#319) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.35.0 to 0.35.1. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.35.0...v0.35.1) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fixed output mismatch seen with 3d HOST normalize kernel when mean and stddev are passed from user * Fix outputs with 2d normalize HOST * Fix HOST 2d outputs when AxisMask is set to 1 with mean and stddev computed internally * Bump rocm-docs-core[api_reference] from 0.35.1 to 0.36.0 in /docs/sphinx (#322) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.35.1 to 0.36.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.35.1...v0.36.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Change all maskArr to scratchBufferHip * Change all tempFloatmem to scratchBufferHost * Cleanup * combined multiple params as a single param wherever possible in kernel launch made the descriptor pointer as pinned memory * Removed the unnecessary memcpy for ND normalize * added axisMask as additional param from test suite added caseMin, caseMax changes and qaMode parameter to python test suite used helper function for displaying qa mode results * remove unncessary variable in test suite added roi start co-ordinates in index calculation * updated source index calculation with roi begin values for 2d and nd mean, stddev compute kernels * change variable from snake case to camel case updated source index calculation with roi begin values for 3d mean, stddev compute kernels * Modify HOST testsuite to process AxisMask * Docs - Bump rocm-docs-core[api_reference] from 0.36.0 to 0.37.0 in /docs/sphinx (#328) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.36.0 to 0.37.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.36.0...v0.37.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Link cleanup (#326) * link updates * update tables * pare down index * API cleanup * consistency * verbiage * Update notes * fix the logic for ND ROI based index calculation * added helper function for setting the description pointer in misc test suite * Docs - Bump rocm-docs-core[api_reference] from 0.37.0 to 0.37.1 in /docs/sphinx (#329) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.37.0 to 0.37.1. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.37.0...v0.37.1) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * RPP Voxel Flip on HIP and HOST (#285) * added support for flip voxel * added test suite support * added golden outputs for flip voxel made changes in test suite to run QA tests for flip * updated golden outputs with correct values * minor bug fix in the hip test suite * made changes to variable names for better readability fixed comments in test suite minor cleanup * combined the flip axis factor as ternary operator in HIP kernel added new enum for error handling when source and destination layouts are not matching * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * converted flip voxel golden outputs to bin files * changed copyright from 2023 to 2024 * Update flip_voxel.hpp license * License - updates to 2024 and consistency changes (#298) * Match all CMakeLists.txt license as per RPP's outermost LICENSE file * Match all python files' license as per RPP's outermost LICENSE file * Match all .hpp files' license as per RPP's outermost LICENSE file * Match all .cpp files' license as per RPP's outermost LICENSE file * Match all .h files' license as per RPP's outermost LICENSE file * Remove all rights reserved as per LICENSE file * Remove double space in "Copyright (c) 2019 - 2023 Advanced Micro Devices, Inc." * Match all .cmake files' license as per RPP's outermost LICENSE file * Match all .cpp.in files' license as per RPP's outermost LICENSE file * Replace 283 occurrences in 282 files - 2023 to 2024 * Add "MIT License" title to 281 instances * Add missing license * Test - Update README.md for test_suite (#299) * Bump rocm-docs-core[api_reference] from 0.33.0 to 0.33.1 in /docs/sphinx (#301) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.33.0 to 0.33.1. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.33.0...v0.33.1) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump rocm-docs-core[api_reference] from 0.33.1 to 0.33.2 in /docs/sphinx (#302) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.33.1 to 0.33.2. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.33.1...v0.33.2) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update doc codeowners (#303) * Documentation - Bump rocm-docs-core[api_reference] from 0.33.2 to 0.34.0 in /docs/sphinx (#304) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.33.2 to 0.34.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.33.2...v0.34.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Test suite - upgrade 5 qa perf (#305) * experimental changes for adding qa mode for performance tests * made changes to add display more information w.r.t QA results summary for performance tests * minor changes * Add changes to dump qa results to excel file * Add performance QA for three new tensor functions * update prerequisites in readme * added changes to handle unsupported cases * removed treshold dictionary and added performance Noise treshold add new dataset for performance QA * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * Changes to the performane summary dataframe * minor changes * Update CMakeLists.txt to add ${CMAKE_CURRENT_SOURCE_DIR} for CI * Update CMakeLists.txt fix * Update CMakeLists.txt fix * remove tabulate dependency * Update README.md to remove tabulate pip install * Fix for CI machine failure * Add note on performance --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM Co-authored-by: Abishek <52214183+r-abishek@users.noreply.github.com> Co-authored-by: Snehaa Giridharan Co-authored-by: r-abishek * RPP Color Temperature on HOST and HIP (#271) * Initial commit - Color Temperature HOST Tensor * Initial commit - Color Temperature HIP Tensor * Add color temperature golden outputs * address review comments * Use reinterpret_cast instead of static_cast * Combine templated functions to support all datatypes into one (got minor perf difference of order 3%) Also fixes indentation * Fix i8 datatype * Cleanup * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * Fix PLN3 variant outputs Also modifies reference outputs * Update color_temperature.hpp license * Delete color_temperature_u8_Tensor_PKD3.csv * Delete color_temperature_u8_Tensor_PLN3.csv --------- Co-authored-by: snehaa8 Co-authored-by: HazarathKumarM Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> * RPP Voxel 3D Tensor Add/Subtract scalar on HOST and HIP (#272) * added HOST support for voxel add kernel * added HIP support for voxel add kernel * added test suite support for add scalar * added Doxygen support and modified hip kernel function names as per new standard * added HOST support for voxel subtract kernel * added HIP support for voxel subtract kernel * added test suite support * updated the golden outputs for subtract with correct values * removed unnessary validation checks * Remove double spaces * Fix header * Fix all retval docs * Fix docs to add memory type * Fix comment * Add divider comment * Use post-increment efficiently * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * converted add and subtract scalar golden outputs to bin files * changed copyright from 2023 to 2024 * Update add_scalar.hpp license * Update subtract_scalar.hpp license --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM * RPP Magnitude on HOST and HIP (#278) * Initial commit - Magnitude HOST Tensor * Add QA reference outputs * Update runTests.py * Initial commit - Magnitude HIP Tensor * Add dual input support in testsuite * Optimize HOST kernel further * Optimize i8 datatype further * Modify comments * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * Bump rocm-docs-core[api_reference] from 0.31.0 to 0.33.0 in /docs/sphinx (#294) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.31.0 to 0.33.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.31.0...v0.33.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update Copywright year * Combine templated functions to support all datatypes * Modify format of reference outputs * Update rppi_arithmetic_operations.h license * Update rppt_tensor_arithmetic_operations.h license * Update host_tensor_arithmetic_operations.hpp * Update magnitude.hpp license * Update hip_tensor_arithmetic_operations.hpp license * Delete magnitude_u8_Tensor_PKD3.csv * Delete magnitude_u8_Tensor_PLN1.csv * Delete magnitude_u8_Tensor_PLN3.csv * Update rpp_test_suite_common.h license * Update runTests.py license * Update Tensor_hip.cpp license * Update runTests.py license * Update Tensor_host.cpp license --------- Signed-off-by: dependabot[bot] Co-authored-by: Snehaa Giridharan Co-authored-by: HazarathKumarM Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> * Bump rocm-docs-core[api_reference] from 0.34.0 to 0.34.2 in /docs/sphinx (#309) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.34.0 to 0.34.2. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.34.0...v0.34.2) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * RPP Tensor Audio Support - Down Mixing (#296) * Initial commit - Non slient region detection Includes unittest setup * Initial commit - To Decibels Includes unittest setup * Intial commit - pre_emphasis_filter * Intial commit - down_mixing * Replace vectors with arrays * Cleanup * Minor cleanup * Optimize downmixing Kernel Includes cleanup * Replace Rpp64s with Rpp32s * Cleanup * Optimize and precompute cutOff * Fix buffer used * Fix buffer used * Additional Cleanup * Optimize post incrmeent operation * Optimize post increment operation * Update testsuite for Audio * code cleanup * Add Readme file for Audio test suite * changes based on review comments * minor change * Remove unittest folders and updated README.md * Remove unit tests * minor change * code cleanup * added common header file for audio helper functions * removed unncessary audio wav files fixed bug in ROI updation for audio test suite resolved issue in summary generation for performance tests in python * removed log file * added doxygen support for audio * added doxygen changes for to_decibels * updated test suite support for to_decibels * minor change * added doxygen changes for preemphasis filter * updated changes for preemphasis filter in test suite * removed the usage of getMax function and used std::max_element * modularized code in test suite * merge with latest changes * minor change * minor change * minor change * resolved codacy warnings * Codacy fix - Remove unused cpuTime * CMakeLists - Version Update 1.5.0 - TOT Version * CHANGELOG Updates Version 1.5.0 placeholder * resolved issue with file_system dependency in test suite * Doxygen changes changed malloc to new in NSR kernel * RPP RICAP Tensor for HOST and HIP (#213) * Initial commit - Ricap HOST Tensor Includes testsuite changes * Add QA tests for RICAP Used three_images_224x224_src1 folder to create golden outputs * Add three_images_224x224_src1 into TEST_IMAGES * Support HIP Backend for RICAP * Fix HIP pkd3->pkd3 variant * regenerated golden outputs for RICAP minor changes in HOST shell script for handling RICAP in QA mode * minor bug fix in RICAP HIP kernels * Improve readability and Cleanup * Additional cleanup * Cleanup testsuite Includes new golden outputs * Additional testuite fixes * Minor cleanup * Fix codacy warnings * Address other codacy warnings * Update ricap.hpp with reference paper * Add RICAP dataset path in readme * Make changes to error codes returned * Modify roi crop region for unit and perf tests * RPP Tensor Water Augmentation on HOST and HIP (#181) * added water HOST and HIP codes * added water case in test suite * added golden outputs for water * added omp thread changes for water augmentation * experimental changes * fixed output issue with AVX2 instructions * added AVX2 support for PKD3 load function minor changes in PLN variant load functions * nwc commit - added avx2 changes for u8 layout toggle variants but need to add store functions for completion * Add Avx2 implementation for F32 and U8 toggle variants * Add AVX2 support for u8 pkd3-pln3 and i8 pkd3-pln3 for water augmentation * change F32 load and store logic * optimized the store function for F32 PLN3-PKD3 * reverted back irrelevant changes * minor change * optimized load and store functions for water U8 and F32 variants in host removed commented code * removed golden outputs for water * minor changes * renamed few functions and removed unused functions updated i8 pln1 load as per the optimized u8 pln1 load * fixed bug in i8 load function * changed cast to c++ style resolved spacing issues and added comments for AVX codes for better understanding made changes to handle cases where QA Tests are not supported * added golden outputs for water * updated golden outputs with latest changes * modified the u8, i8 pkd3-pln3 function and added comments for the vectorized code * fixed minor bug in I8 variants * made to changes to resolve codacy warnings * changed cast to c++ style in hip kernel * changed generic nn F32 loads using gather and setr instructions * added comments for latest changes * minor change * added definition for storing 32 and 64 bits from a 128bit register --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM * Fix build error * CMakeLists - Version Update 1.5.0 - TOT Version * CHANGELOG Updates Version 1.5.0 placeholder * Boost deps fix for test suite --------- Co-authored-by: Snehaa Giridharan Co-authored-by: sampath1117 Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: HazarathKumarM Co-authored-by: Kiriti Gowda * Documentation - Readme & changelog updates (#251) * readme and changelog updates for 6.0 * minor update * added ctests for audio test suite for CI made changes to add more clarity on the QA Tests results * Cmake mods for ctest * HOST-only build error bugfix * added qa mode paramter to python audio script added golden output map for QA testing of Non silent region detection * minor change * Documentation - Bump rocm-docs-core[api_reference] from 0.26.0 to 0.27.0 in /docs/sphinx (#253) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.26.0 to 0.27.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.26.0...v0.27.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * RPP Resize Mirror Normalize Bugfix (#252) * added fix for hipMemset * remove pixel check for U8-F32 and U8-F16 for HOST codes --------- Co-authored-by: sampath1117 * added example for MMS calculation in comments for better understanding * Sphinx - updates (#257) * Sphinx - updates * Doxygen - Updates * Docs - Remove index.md * updated info used to for running audio test suite * removed bitdepth variable from audio test suite * added more information on computing NSR outputs in the example added * Fix doxygen for decibels Also removes extra QA reference files * move tensor_host_audio.cpp to host folder * Fix build errors and qa tests in Audio Test suite * Fix build errors and qa tests in Audio Test suite * Add reference output and test samples for downmix * Add down_mix in augmentation list and supported cases * Remove auto-merge repeated funcs * Improve clarity of header docs * Remove blank line * Improve clarity on header docs * Add Doxygen comments * minor change * converted golden outputs to binary file for downmixing * removed old golden output file for preemphasis and todecibels * modified info for downmixing as per new changes used handle memory for temporary buffers * formatting changes * moved the common code for SSE and AVX to outside * Update down_mixing.hpp license * Update rppt_tensor_audio_augmentations.h * combined the srcLength and channels tensors into single tensor --------- Signed-off-by: dependabot[bot] Co-authored-by: Snehaa Giridharan Co-authored-by: HazarathKumarM Co-authored-by: sampath1117 Co-authored-by: Kiriti Gowda Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: Lisa Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sundarrajan98 * RPP Voxel 3D Tensor Multiply scalar on HOST and HIP (#306) * added HIP support for voxel scalar multiply kernel * added HOST support for voxel multiply kernel added golden outputs for voxel multiply kernel * merge with master * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * converted multiply scalar voxel golden outputs to bin files * changed copyright from 2023 to 2024 --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM * Test Suite Bugfix (#307) * experimental changes for adding qa mode for performance tests * made changes to add display more information w.r.t QA results summary for performance tests * minor changes * Add changes to dump qa results to excel file * Add performance QA for three new tensor functions * update prerequisites in readme * added changes to handle unsupported cases * removed treshold dictionary and added performance Noise treshold add new dataset for performance QA * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * Changes to the performane summary dataframe * minor changes * Update CMakeLists.txt to add ${CMAKE_CURRENT_SOURCE_DIR} for CI * Update CMakeLists.txt fix * Update CMakeLists.txt fix * remove tabulate dependency * Update README.md to remove tabulate pip install * Fix for CI machine failure * Add note on performance * Fix segmentation fault * Revert QAmode to restrict HIP bitdepths * Use Rpp64u for HOST while comparing outputs * Fix ambiguous abs call * Fix for SLES CI HIP fail - error: incompatible pointer types assigning to 'unsigned long *' from 'unsigned long long *' - refOutput = TensorSumReferenceOutputs[numChannels].data(); --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM Co-authored-by: Snehaa Giridharan Co-authored-by: Pavel Tcherniaev * Bump rocm-docs-core[api_reference] from 0.34.2 to 0.35.0 in /docs/sphinx (#313) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.34.2 to 0.35.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.34.2...v0.35.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * RPP Reduction - Tensor min and Tensor max on HOST and HIP (#260) * Minor Change * Add Validation check for DST_FOLDER path * added water HOST and HIP codes * added water case in test suite * added golden outputs for water * Add Validation checks for all options in testAllScript.sh * Add sanity check for dual Input cases Set Max Dimension and Max Image Dump Replaced Fast DCT tag with Accurate DCT * Regenerate golden outputs using accurate dct Flag Add golden outputs for some new augmentations * Fix Flip golden outputs mismatch Fix PLN3 variants mismatch in QA mode * Add MAX_BATCH_SIZE check removed Augmentations function calls for failing Qa modes code cleanup * Add crop and gamma correction augmentations code cleanup * Add comments to functions in rpp_test_suite_common.h * minor change * code cleanup * minor code changes * Change roi and Image sizes for crop augmentation * Change numIterations option to numRuns Addressed PR comments * added omp thread changes for water augmentation * experimental changes * fixed output issue with AVX2 instructions * added AVX2 support for PKD3 load function minor changes in PLN variant load functions * Add turboJpeg header to update maxHeight and maxWidth values * nwc commit - added avx2 changes for u8 layout toggle variants but need to add store functions for completion * Change the performance Timings logic * Add Avx2 implementation for F32 and U8 toggle variants * minor change to support u8_f16 and u8_f32 cases * Regenerate LUT golden outputs with ACCURATE_DCT tag * Minor code changes * Add AVX2 support for u8 pkd3-pln3 and i8 pkd3-pln3 for water augmentation * Made changes to the runTests.py in Host to remove testAllScipts.sh * Made changes to the runTests.py in HIP to remove testAllScipts.sh * Initial commit - Image min and max Reduction kernel Includes * u8 datatype for both min and max HOST Tensor of all variants. * Testsuite changes. * NWC -initial code for min max PLN3 - PLN3 * made changes to split min and max kernels seperately * splitted kernels for min and max * made changes to print final max/min in the R,G,B channels * fixed inaccuracies in min/max computation * made changes to typecast intermediate output to output requested by user added comments for the code code cleanup and minor changes in test suite * fixed build issues removed image folders used for min, max and sum reverted unwanted file changes * minor changes in test suite * removed support for unwanted test case in Tensor_hip.cpp * Adds new option roi * remove testAllScripts.sh * Adds roi Option in HIP backend * Implement f32 variants * Implement f16 and i8 datatype variants * change F32 load and store logic * Add build flags in CMakeLists.txt to set AVX/SSE flags based on the system configuration * minor code changes * Initial commit - Image sum Reduction kernel Includes u8 PLN1 -> PLN1 conversion for HOST Tensor * Implement PKD3 and PLN3 for Image sum Tensor HOST * Support i8, f16 and f32 datatypes * Initial commit - Image sum Reduction HIP kernel Includes u8 PLN1 -> PLN1 conversion for Tensor * Implement PKD3 and PLN3 for Image sum Tensor HIP * Add support in testsuite Revert normalization for i8 HOST Tensor variants * Fix HIP testsuite Remove additional blanks for 1 channel output * Modify print statement in HIP testsuite * Improve readability for testsuite outputs * optimized the store function for F32 PLN3-PKD3 * reverted back irrelevant changes * minor change * Fix HIP to support larger inputs * optimized load and store functions for water U8 and F32 variants in host removed commented code * Cleanup * removed golden outputs for water * minor changes * Cleanup Support Reduction QA test in testsuite * renamed few functions and removed unused functions updated i8 pln1 load as per the optimized u8 pln1 load * fixed bug in i8 load function * Remove unused variables and C style casting * changed cast to c++ style resolved spacing issues and added comments for AVX codes for better understanding made changes to handle cases where QA Tests are not supported * added golden outputs for water * updated golden outputs with latest changes * modified the u8, i8 pkd3-pln3 function and added comments for the vectorized code * fixed minor bug in I8 variants * Optimize u8 datatype further * Fix static_cast * made to changes to resolve codacy warnings * changed cast to c++ style in hip kernel * Initial commit - Ricap HOST Tensor Includes testsuite changes * Add QA tests for RICAP Used three_images_224x224_src1 folder to create golden outputs * Add three_images_224x224_src1 into TEST_IMAGES * added rotate case with golden outputs changed generic bilinear HOST codes to match with HIP codes * Add golden output for remaining all tensor augmentations * fix python script issues * Optimize u8 and i8 datatype Uses uint and int internal processing instead of float * Fix testsuite build errors * minor change * Fix QA check * Modify api naming from image_sum to tensor_sum Includes changes for both HOST and HIP * Support HIP Backend for RICAP * change rcm and rmn golden outputs * Fix HIP pkd3->pkd3 variant * changes based on review comments * change test_suite folder to tests * Optimize u8 and i8 datatype of HIP Includes modification in naming of shared memory * minor fix * changed generic nn F32 loads using gather and setr instructions * Optimize and cleanup U8 HIP * regenerated golden outputs for RICAP minor changes in HOST shell script for handling RICAP in QA mode * minor bug fix in RICAP HIP kernels * Fix i8 datatype variants Includes cleanup * Fix the issues with color_to_greyscale * remove the empty folder creation * reverting back the folder name change * minor change * added comments for latest changes * minor change * Improve readability and Cleanup * Fix QA for HIP Includes cleanup * resolved review comments * minor change * Modify api naming from image_ to tensor_ for HOST * Add support for QA tests * removed range check for RMN U8-F32 and U8-F16 variants changed from hipMemset to hipMemsetAsync for RMN HIP Kernel removed multiplication by 255 for stdDev in RMN HOST U8-F16 and U8-F32 variants * Modify naming of shared memory with _smem in HIP Includes cleanup * Typecast and reuse markArr for HIP U8 and I8 * Cleanup and minor optimization * minor fix * fix codacy warnings * Additional cleanup * Cleanup and move #define * Changed the complexity of if statements in runTests.py * Cleanup testsuite Includes new golden outputs * Additional testuite fixes * Minor cleanup * Codacy fixes * Fix codacy warnings * Codacy fix * Address other codacy warnings * cleanup * Change Image functions to generic * Update ricap.hpp with reference paper * resolved minor issues happened with merge * minor changes * fixed minor issue with getting profiler times * minor formatting changes * resolved build issues in test suite renamed the min and max kernel file names * RPP RICAP Tensor for HOST and HIP (#213) * Initial commit - Ricap HOST Tensor Includes testsuite changes * Add QA tests for RICAP Used three_images_224x224_src1 folder to create golden outputs * Add three_images_224x224_src1 into TEST_IMAGES * Support HIP Backend for RICAP * Fix HIP pkd3->pkd3 variant * regenerated golden outputs for RICAP minor changes in HOST shell script for handling RICAP in QA mode * minor bug fix in RICAP HIP kernels * Improve readability and Cleanup * Additional cleanup * Cleanup testsuite Includes new golden outputs * Additional testuite fixes * Minor cleanup * Fix codacy warnings * Address other codacy warnings * Update ricap.hpp with reference paper * Add RICAP dataset path in readme * Make changes to error codes returned * Modify roi crop region for unit and perf tests * RPP Tensor Water Augmentation on HOST and HIP (#181) * added water HOST and HIP codes * added water case in test suite * added golden outputs for water * added omp thread changes for water augmentation * experimental changes * fixed output issue with AVX2 instructions * added AVX2 support for PKD3 load function minor changes in PLN variant load functions * nwc commit - added avx2 changes for u8 layout toggle variants but need to add store functions for completion * Add Avx2 implementation for F32 and U8 toggle variants * Add AVX2 support for u8 pkd3-pln3 and i8 pkd3-pln3 for water augmentation * change F32 load and store logic * optimized the store function for F32 PLN3-PKD3 * reverted back irrelevant changes * minor change * optimized load and store functions for water U8 and F32 variants in host removed commented code * removed golden outputs for water * minor changes * renamed few functions and removed unused functions updated i8 pln1 load as per the optimized u8 pln1 load * fixed bug in i8 load function * changed cast to c++ style resolved spacing issues and added comments for AVX codes for better understanding made changes to handle cases where QA Tests are not supported * added golden outputs for water * updated golden outputs with latest changes * modified the u8, i8 pkd3-pln3 function and added comments for the vectorized code * fixed minor bug in I8 variants * made to changes to resolve codacy warnings * changed cast to c++ style in hip kernel * changed generic nn F32 loads using gather and setr instructions * added comments for latest changes * minor change * added definition for storing 32 and 64 bits from a 128bit register --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM * Fix build error * CMakeLists - Version Update 1.5.0 - TOT Version * CHANGELOG Updates Version 1.5.0 placeholder * Boost deps fix for test suite --------- Co-authored-by: Snehaa Giridharan Co-authored-by: sampath1117 Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: HazarathKumarM Co-authored-by: Kiriti Gowda * Documentation - Readme & changelog updates (#251) * readme and changelog updates for 6.0 * minor update * Documentation - Bump rocm-docs-core[api_reference] from 0.26.0 to 0.27.0 in /docs/sphinx (#253) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.26.0 to 0.27.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.26.0...v0.27.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * RPP Resize Mirror Normalize Bugfix (#252) * added fix for hipMemset * remove pixel check for U8-F32 and U8-F16 for HOST codes --------- Co-authored-by: sampath1117 * Cmake fix to prevent warning * Fix paths in new python scripts * Sphinx - updates (#257) * Sphinx - updates * Doxygen - Updates * Docs - Remove index.md * Test suite fixes after tensor_min / tensor_max HOST merge * Fix max case * QA tests fix for hip and host * naming convention changes as per new std * Substitute imagePartial with partial * Substitute imageMin/imageMax with min/max * Replace hipMemset with hipMemsetAsync, and replace hipDeviceSynchronize with hipStreamSynchronize * Use variable instead of batchCount*4 * Use post increment effectivly * Resolve codacy warnings * Additional cleanup * remove unused variable * Documentation - Bump rocm-docs-core[api_reference] from 0.28.0 to 0.29.0 in /docs/sphinx (#265) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.28.0 to 0.29.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.28.0...v0.29.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Remove auto merge boost * Spaces formatting * Bump rocm-docs-core[api_reference] from 0.29.0 to 0.30.1 in /docs/sphinx (#268) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.29.0 to 0.30.1. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.29.0...v0.30.1) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * add support for mi300 (#269) * Documentation - Bump rocm-docs-core[api_reference] from 0.30.1 to 0.30.2 in /docs/sphinx (#273) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.30.1 to 0.30.2. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.30.1...v0.30.2) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Cleanup by removing oneliner functions as inline * RPP Tensor Audio Support - To Decibels (#258) * Initial commit - Non slient region detection Includes unittest setup * Initial commit - To Decibels Includes unittest setup * Replace vectors with arrays * Cleanup * Replace Rpp64s with Rpp32s * Optimize and precompute cutOff * Fix buffer used * Fix buffer used * Additional Cleanup * Update testsuite for Audio * code cleanup * Add Readme file for Audio test suite * changes based on review comments * minor change * Remove unittest folders and updated README.md * Remove unit tests * minor change * code cleanup * added common header file for audio helper functions * removed unncessary audio wav files fixed bug in ROI updation for audio test suite resolved issue in summary generation for performance tests in python * removed log file * added doxygen support for audio * added doxygen changes for to_decibels * updated test suite support for to_decibels * minor change * removed the usage of getMax function and used std::max_element * modularized code in test suite * merge with latest changes * minor change * minor change * resolved codacy warnings * Codacy fix - Remove unused cpuTime * CMakeLists - Version Update 1.5.0 - TOT Version * CHANGELOG Updates Version 1.5.0 placeholder * resolved issue with file_system dependency in test suite * Doxygen changes changed malloc to new in NSR kernel * RPP RICAP Tensor for HOST and HIP (#213) * Initial commit - Ricap HOST Tensor Includes testsuite changes * Add QA tests for RICAP Used three_images_224x224_src1 folder to create golden outputs * Add three_images_224x224_src1 into TEST_IMAGES * Support HIP Backend for RICAP * Fix HIP pkd3->pkd3 variant * regenerated golden outputs for RICAP minor changes in HOST shell script for handling RICAP in QA mode * minor bug fix in RICAP HIP kernels * Improve readability and Cleanup * Additional cleanup * Cleanup testsuite Includes new golden outputs * Additional testuite fixes * Minor cleanup * Fix codacy warnings * Address other codacy warnings * Update ricap.hpp with reference paper * Add RICAP dataset path in readme * Make changes to error codes returned * Modify roi crop region for unit and perf tests * RPP Tensor Water Augmentation on HOST and HIP (#181) * added water HOST and HIP codes * added water case in test suite * added golden outputs for water * added omp thread changes for water augmentation * experimental changes * fixed output issue with AVX2 instructions * added AVX2 support for PKD3 load function minor changes in PLN variant load functions * nwc commit - added avx2 changes for u8 layout toggle variants but need to add store functions for completion * Add Avx2 implementation for F32 and U8 toggle variants * Add AVX2 support for u8 pkd3-pln3 and i8 pkd3-pln3 for water augmentation * change F32 load and store logic * optimized the store function for F32 PLN3-PKD3 * reverted back irrelevant changes * minor change * optimized load and store functions for water U8 and F32 variants in host removed commented code * removed golden outputs for water * minor changes * renamed few functions and removed unused functions updated i8 pln1 load as per the optimized u8 pln1 load * fixed bug in i8 load function * changed cast to c++ style resolved spacing issues and added comments for AVX codes for better understanding made changes to handle cases where QA Tests are not supported * added golden outputs for water * updated golden outputs with latest changes * modified the u8, i8 pkd3-pln3 function and added comments for the vectorized code * fixed minor bug in I8 variants * made to changes to resolve codacy warnings * changed cast to c++ style in hip kernel * changed generic nn F32 loads using gather and setr instructions * added comments for latest changes * minor change * added definition for storing 32 and 64 bits from a 128bit register --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM * Fix build error * CMakeLists - Version Update 1.5.0 - TOT Version * CHANGELOG Updates Version 1.5.0 placeholder * Boost deps fix for test suite --------- Co-authored-by: Snehaa Giridharan Co-authored-by: sampath1117 Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: HazarathKumarM Co-authored-by: Kiriti Gowda * Documentation - Readme & changelog updates (#251) * readme and changelog updates for 6.0 * minor update * added ctests for audio test suite for CI made changes to add more clarity on the QA Tests results * Cmake mods for ctest * HOST-only build error bugfix * added qa mode paramter to python audio script added golden output map for QA testing of Non silent region detection * minor change * Documentation - Bump rocm-docs-core[api_reference] from 0.26.0 to 0.27.0 in /docs/sphinx (#253) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.26.0 to 0.27.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.26.0...v0.27.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * RPP Resize Mirror Normalize Bugfix (#252) * added fix for hipMemset * remove pixel check for U8-F32 and U8-F16 for HOST codes --------- Co-authored-by: sampath1117 * added example for MMS calculation in comments for better understanding * Sphinx - updates (#257) * Sphinx - updates * Doxygen - Updates * Docs - Remove index.md * updated info used to for running audio test suite * removed bitdepth variable from audio test suite * added more information on computing NSR outputs in the example added * Fix doxygen for decibels Also removes extra QA reference files * Fix build errors and qa tests in Audio Test suite * Remove auto-merge repeated funcs * Improve clarity on header docs * made changes based on review comments * stored golden outputs of to_decibels in binary file removed golden output text files for non silent region * removed unused parameter in verify_output function * updated list of cases supported in python script * added error handling for opening golden output file * Codacy fix and tests warning fix * Codacy fix * Codacy fix trial * codacy fix for checking boundaries of fstream --------- Signed-off-by: dependabot[bot] Co-authored-by: Snehaa Giridharan Co-authored-by: HazarathKumarM Co-authored-by: sampath1117 Co-authored-by: Kiriti Gowda Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: Lisa Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Documentation - Bump rocm-docs-core[api_reference] from 0.30.2 to 0.30.3 in /docs/sphinx (#274) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.30.2 to 0.30.3. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.30.2...v0.30.3) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Adding issue template (#270) * Add files via upload * added ROCm v6, MI300, default component * Fix cast used in testsuite Includes minor fixes * Fix displaying f16 outputs * Optimize HOST min/max reduce function further * Fix spacing in HIP kernels * Fix PLN1 outputs for u8 and i8 datatypes of HOST backend * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * Bump rocm-docs-core[api_reference] from 0.31.0 to 0.33.0 in /docs/sphinx (#294) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.31.0 to 0.33.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.31.0...v0.33.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Store reference outputs via map for min and max kernels * Update tensor_max.hpp license * Update tensor_min.hpp license * Fix output comparison check * Merge branch 'ar/opt_tensor_min_tensor_max' of https://github.com/r-abishek/rpp into sn/tensor_min_max * Modify exit condition used in outer most kernel * Modify srcIdx for HIP Tensor min * Using maximum as 255 for HIP Tensor min * Modify srcIdx for HIP Tensor max kernel Also fixes build error in testsuite * Fix corrupted outputs displayed for Tensor sum * Fix corruption issue seen with tensor sum kernel * Fix minimum for I8 Tensor max kernel * Modified HIP buffer initialization with a common function * Fix redefinition * Remove additional variables xAlignedLength * Remove unwanted xAlignedLength and xDiff * Remove redefinition of TensorSumReferenceOutputs * Fix for CI issue * Add parenthesis --------- Signed-off-by: dependabot[bot] Co-authored-by: HazarathKumarM Co-authored-by: sampath1117 Co-authored-by: Snehaa Giridharan Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: fiona-gladwin Co-authored-by: Kiriti Gowda Co-authored-by: Lisa Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Lakshmi Kumar Co-authored-by: abhimeda <138710508+abhimeda@users.noreply.github.com> * CI - Update precheckin.groovy * added separate kernels for doing flip when horizontal flip is not set * fixed build issue * Add supported case * reverted incorrect changes happened with merge --------- Signed-off-by: dependabot[bot] Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sam Wu Co-authored-by: Kiriti Gowda Co-authored-by: Snehaa Giridharan Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: Lisa Co-authored-by: Sundarrajan98 Co-authored-by: Pavel Tcherniaev Co-authored-by: fiona-gladwin Co-authored-by: Lakshmi Kumar Co-authored-by: abhimeda <138710508+abhimeda@users.noreply.github.com> * RPP Vignette Tensor on HOST and HIP (#311) * Add Vignette Tensor HOST and HIP Implementation * License - updates to 2024 and consistency changes (#298) * Match all CMakeLists.txt license as per RPP's outermost LICENSE file * Match all python files' license as per RPP's outermost LICENSE file * Match all .hpp files' license as per RPP's outermost LICENSE file * Match all .cpp files' license as per RPP's outermost LICENSE file * Match all .h files' license as per RPP's outermost LICENSE file * Remove all rights reserved as per LICENSE file * Remove double space in "Copyright (c) 2019 - 2023 Advanced Micro Devices, Inc." * Match all .cmake files' license as per RPP's outermost LICENSE file * Match all .cpp.in files' license as per RPP's outermost LICENSE file * Replace 283 occurrences in 282 files - 2023 to 2024 * Add "MIT License" title to 281 instances * Add missing license * Test - Update README.md for test_suite (#299) * Bump rocm-docs-core[api_reference] from 0.33.0 to 0.33.1 in /docs/sphinx (#301) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.33.0 to 0.33.1. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.33.0...v0.33.1) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump rocm-docs-core[api_reference] from 0.33.1 to 0.33.2 in /docs/sphinx (#302) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.33.1 to 0.33.2. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.33.1...v0.33.2) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update doc codeowners (#303) * Documentation - Bump rocm-docs-core[api_reference] from 0.33.2 to 0.34.0 in /docs/sphinx (#304) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.33.2 to 0.34.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.33.2...v0.34.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Test suite - upgrade 5 qa perf (#305) * experimental changes for adding qa mode for performance tests * made changes to add display more information w.r.t QA results summary for performance tests * minor changes * Add changes to dump qa results to excel file * Add performance QA for three new tensor functions * update prerequisites in readme * added changes to handle unsupported cases * removed treshold dictionary and added performance Noise treshold add new dataset for performance QA * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * Changes to the performane summary dataframe * minor changes * Update CMakeLists.txt to add ${CMAKE_CURRENT_SOURCE_DIR} for CI * Update CMakeLists.txt fix * Update CMakeLists.txt fix * remove tabulate dependency * Update README.md to remove tabulate pip install * Fix for CI machine failure * Add note on performance --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM Co-authored-by: Abishek <52214183+r-abishek@users.noreply.github.com> Co-authored-by: Snehaa Giridharan Co-authored-by: r-abishek * RPP Color Temperature on HOST and HIP (#271) * Initial commit - Color Temperature HOST Tensor * Initial commit - Color Temperature HIP Tensor * Add color temperature golden outputs * address review comments * Use reinterpret_cast instead of static_cast * Combine templated functions to support all datatypes into one (got minor perf difference of order 3%) Also fixes indentation * Fix i8 datatype * Cleanup * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * Fix PLN3 variant outputs Also modifies reference outputs * Update color_temperature.hpp license * Delete color_temperature_u8_Tensor_PKD3.csv * Delete color_temperature_u8_Tensor_PLN3.csv --------- Co-authored-by: snehaa8 Co-authored-by: HazarathKumarM Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> * RPP Voxel 3D Tensor Add/Subtract scalar on HOST and HIP (#272) * added HOST support for voxel add kernel * added HIP support for voxel add kernel * added test suite support for add scalar * added Doxygen support and modified hip kernel function names as per new standard * added HOST support for voxel subtract kernel * added HIP support for voxel subtract kernel * added test suite support * updated the golden outputs for subtract with correct values * removed unnessary validation checks * Remove double spaces * Fix header * Fix all retval docs * Fix docs to add memory type * Fix comment * Add divider comment * Use post-increment efficiently * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * converted add and subtract scalar golden outputs to bin files * changed copyright from 2023 to 2024 * Update add_scalar.hpp license * Update subtract_scalar.hpp license --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM * RPP Magnitude on HOST and HIP (#278) * Initial commit - Magnitude HOST Tensor * Add QA reference outputs * Update runTests.py * Initial commit - Magnitude HIP Tensor * Add dual input support in testsuite * Optimize HOST kernel further * Optimize i8 datatype further * Modify comments * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * Bump rocm-docs-core[api_reference] from 0.31.0 to 0.33.0 in /docs/sphinx (#294) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.31.0 to 0.33.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.31.0...v0.33.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update Copywright year * Combine templated functions to support all datatypes * Modify format of reference outputs * Update rppi_arithmetic_operations.h license * Update rppt_tensor_arithmetic_operations.h license * Update host_tensor_arithmetic_operations.hpp * Update magnitude.hpp license * Update hip_tensor_arithmetic_operations.hpp license * Delete magnitude_u8_Tensor_PKD3.csv * Delete magnitude_u8_Tensor_PLN1.csv * Delete magnitude_u8_Tensor_PLN3.csv * Update rpp_test_suite_common.h license * Update runTests.py license * Update Tensor_hip.cpp license * Update runTests.py license * Update Tensor_host.cpp license --------- Signed-off-by: dependabot[bot] Co-authored-by: Snehaa Giridharan Co-authored-by: HazarathKumarM Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> * Bump rocm-docs-core[api_reference] from 0.34.0 to 0.34.2 in /docs/sphinx (#309) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.34.0 to 0.34.2. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.34.0...v0.34.2) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * RPP Tensor Audio Support - Down Mixing (#296) * Initial commit - Non slient region detection Includes unittest setup * Initial commit - To Decibels Includes unittest setup * Intial commit - pre_emphasis_filter * Intial commit - down_mixing * Replace vectors with arrays * Cleanup * Minor cleanup * Optimize downmixing Kernel Includes cleanup * Replace Rpp64s with Rpp32s * Cleanup * Optimize and precompute cutOff * Fix buffer used * Fix buffer used * Additional Cleanup * Optimize post incrmeent operation * Optimize post increment operation * Update testsuite for Audio * code cleanup * Add Readme file for Audio test suite * changes based on review comments * minor change * Remove unittest folders and updated README.md * Remove unit tests * minor change * code cleanup * added common header file for audio helper functions * removed unncessary audio wav files fixed bug in ROI updation for audio test suite resolved issue in summary generation for performance tests in python * removed log file * added doxygen support for audio * added doxygen changes for to_decibels * updated test suite support for to_decibels * minor change * added doxygen changes for preemphasis filter * updated changes for preemphasis filter in test suite * removed the usage of getMax function and used std::max_element * modularized code in test suite * merge with latest changes * minor change * minor change * minor change * resolved codacy warnings * Codacy fix - Remove unused cpuTime * CMakeLists - Version Update 1.5.0 - TOT Version * CHANGELOG Updates Version 1.5.0 placeholder * resolved issue with file_system dependency in test suite * Doxygen changes changed malloc to new in NSR kernel * RPP RICAP Tensor for HOST and HIP (#213) * Initial commit - Ricap HOST Tensor Includes testsuite changes * Add QA tests for RICAP Used three_images_224x224_src1 folder to create golden outputs * Add three_images_224x224_src1 into TEST_IMAGES * Support HIP Backend for RICAP * Fix HIP pkd3->pkd3 variant * regenerated golden outputs for RICAP minor changes in HOST shell script for handling RICAP in QA mode * minor bug fix in RICAP HIP kernels * Improve readability and Cleanup * Additional cleanup * Cleanup testsuite Includes new golden outputs * Additional testuite fixes * Minor cleanup * Fix codacy warnings * Address other codacy warnings * Update ricap.hpp with reference paper * Add RICAP dataset path in readme * Make changes to error codes returned * Modify roi crop region for unit and perf tests * RPP Tensor Water Augmentation on HOST and HIP (#181) * added water HOST and HIP codes * added water case in test suite * added golden outputs for water * added omp thread changes for water augmentation * experimental changes * fixed output issue with AVX2 instructions * added AVX2 support for PKD3 load function minor changes in PLN variant load functions * nwc commit - added avx2 changes for u8 layout toggle variants but need to add store functions for completion * Add Avx2 implementation for F32 and U8 toggle variants * Add AVX2 support for u8 pkd3-pln3 and i8 pkd3-pln3 for water augmentation * change F32 load and store logic * optimized the store function for F32 PLN3-PKD3 * reverted back irrelevant changes * minor change * optimized load and store functions for water U8 and F32 variants in host removed commented code * removed golden outputs for water * minor changes * renamed few functions and removed unused functions updated i8 pln1 load as per the optimized u8 pln1 load * fixed bug in i8 load function * changed cast to c++ style resolved spacing issues and added comments for AVX codes for better understanding made changes to handle cases where QA Tests are not supported * added golden outputs for water * updated golden outputs with latest changes * modified the u8, i8 pkd3-pln3 function and added comments for the vectorized code * fixed minor bug in I8 variants * made to changes to resolve codacy warnings * changed cast to c++ style in hip kernel * changed generic nn F32 loads using gather and setr instructions * added comments for latest changes * minor change * added definition for storing 32 and 64 bits from a 128bit register --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM * Fix build error * CMakeLists - Version Update 1.5.0 - TOT Version * CHANGELOG Updates Version 1.5.0 placeholder * Boost deps fix for test suite --------- Co-authored-by: Snehaa Giridharan Co-authored-by: sampath1117 Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: HazarathKumarM Co-authored-by: Kiriti Gowda * Documentation - Readme & changelog updates (#251) * readme and changelog updates for 6.0 * minor update * added ctests for audio test suite for CI made changes to add more clarity on the QA Tests results * Cmake mods for ctest * HOST-only build error bugfix * added qa mode paramter to python audio script added golden output map for QA testing of Non silent region detection * minor change * Documentation - Bump rocm-docs-core[api_reference] from 0.26.0 to 0.27.0 in /docs/sphinx (#253) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.26.0 to 0.27.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.26.0...v0.27.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * RPP Resize Mirror Normalize Bugfix (#252) * added fix for hipMemset * remove pixel check for U8-F32 and U8-F16 for HOST codes --------- Co-authored-by: sampath1117 * added example for MMS calculation in comments for better understanding * Sphinx - updates (#257) * Sphinx - updates * Doxygen - Updates * Docs - Remove index.md * updated info used to for running audio test suite * removed bitdepth variable from audio test suite * added more information on computing NSR outputs in the example added * Fix doxygen for decibels Also removes extra QA reference files * move tensor_host_audio.cpp to host folder * Fix build errors and qa tests in Audio Test suite * Fix build errors and qa tests in Audio Test suite * Add reference output and test samples for downmix * Add down_mix in augmentation list and supported cases * Remove auto-merge repeated funcs * Improve clarity of header docs * Remove blank line * Improve clarity on header docs * Add Doxygen comments * minor change * converted golden outputs to binary file for downmixing * removed old golden output file for preemphasis and todecibels * modified info for downmixing as per new changes used handle memory for temporary buffers * formatting changes * moved the common code for SSE and AVX to outside * Update down_mixing.hpp license * Update rppt_tensor_audio_augmentations.h * combined the srcLength and channels tensors into single tensor --------- Signed-off-by: dependabot[bot] Co-authored-by: Snehaa Giridharan Co-authored-by: HazarathKumarM Co-authored-by: sampath1117 Co-authored-by: Kiriti Gowda Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: Lisa Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sundarrajan98 * RPP Voxel 3D Tensor Multiply scalar on HOST and HIP (#306) * added HIP support for voxel scalar multiply kernel * added HOST support for voxel multiply kernel added golden outputs for voxel multiply kernel * merge with master * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * converted multiply scalar voxel golden outputs to bin files * changed copyright from 2023 to 2024 --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM * Test Suite Bugfix (#307) * experimental changes for adding qa mode for performance tests * made changes to add display more information w.r.t QA results summary for performance tests * minor changes * Add changes to dump qa results to excel file * Add performance QA for three new tensor functions * update prerequisites in readme * added changes to handle unsupported cases * removed treshold dictionary and added performance Noise treshold add new dataset for performance QA * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * Changes to the performane summary dataframe * minor changes * Update CMakeLists.txt to add ${CMAKE_CURRENT_SOURCE_DIR} for CI * Update CMakeLists.txt fix * Update CMakeLists.txt fix * remove tabulate dependency * Update README.md to remove tabulate pip install * Fix for CI machine failure * Add note on performance * Fix segmentation fault * Revert QAmode to restrict HIP bitdepths * Use Rpp64u for HOST while comparing outputs * Fix ambiguous abs call * Fix for SLES CI HIP fail - error: incompatible pointer types assigning to 'unsigned long *' from 'unsigned long long *' - refOutput = TensorSumReferenceOutputs[numChannels].data(); --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM Co-authored-by: Snehaa Giridharan Co-authored-by: Pavel Tcherniaev * Add Vignette Tensor HOST and HIP Implementation * Address review comments * Update rpp_hip_common.hpp * Update vignette.hpp to add rpp_hip_math_nearbyintf8() * Update Tensor_hip.cpp to add hipHostFree * Fix init * Repeated initialization bugfix * Add host case 46 --------- Signed-off-by: dependabot[bot] Co-authored-by: HazarathKumarM Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sam Wu Co-authored-by: Kiriti Gowda Co-authored-by: sampath1117 Co-authored-by: Snehaa Giridharan Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: Lisa Co-authored-by: Sundarrajan98 Co-authored-by: Pavel Tcherniaev * Modify HIP buffer to match latest changes * further restructuring of misc test suite * revert unwanted file change * add empty line at EOF * replaced common code in image test suite with read_from_subprocess_and_write_to_log helper function * combined unit and performance test for voxel python test suites * combined unit and performance test suite for audio python scripts * Bump rocm-docs-core[api_reference] from 0.37.1 to 0.38.0 in /docs/sphinx (#333) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.37.1 to 0.38.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.37.1...v0.38.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * combined functions for profiler for misc and voxel test suite * renamed the voxel and audio test suite filenames * minor formatting changes * add empty line at EOF * add comment for get_layout_name function * RPP Tensor Audio Support - Resample (#310) * Initial commit - Non slient region detection Includes unittest setup * Initial commit - To Decibels Includes unittest setup * Intial commit - pre_emphasis_filter * Intial commit - down_mixing * Intial commit - slice_audio * Intial commit - mel_filter_bank * Intial commit - spectrogram * Intial commit - resample * Replace vectors with arrays * Cleanup * Minor cleanup * Optimize downmixing Kernel Includes cleanup * Remove unused variables in header file * Add axes parameter * Replace Rpp64s with Rpp32s * Replace vectors with arrays Includes optimization * Cleanup * Cleanup * Cleanup and optimize * Move malloc outside openMP loop * Optimize and precompute cutOff * Cleanup * Fix buffer used * Fix buffer used * Additional Cleanup * Fix buffer allocation Includes minor optimization * Optimize post incrmeent operation * Optimize post increment operation * Optimize post increment operation * Update testsuite for Audio * code cleanup * Add Readme file for Audio test suite * changes based on review comments * minor change * Remove unittest folders and updated README.md * Remove unit tests * minor change * code cleanup * added common header file for audio helper functions * removed unncessary audio wav files fixed bug in ROI updation for audio test suite resolved issue in summary generation for performance tests in python * removed log file * added doxygen support for audio * added doxygen changes for to_decibels * updated test suite support for to_decibels * minor change * added doxygen changes for preemphasis filter * updated changes for preemphasis filter in test suite * removed the usage of getMax function and used std::max_element * modularized code in test suite * merge with latest changes * minor change * minor change * minor change * resolved codacy warnings * Codacy fix - Remove unused cpuTime * CMakeLists - Version Update 1.5.0 - TOT Version * CHANGELOG Updates Version 1.5.0 placeholder * resolved issue with file_system dependency in test suite * Doxygen changes changed malloc to new in NSR kernel * RPP RICAP Tensor for HOST and HIP (#213) * Initial commit - Ricap HOST Tensor Includes testsuite changes * Add QA tests for RICAP Used three_images_224x224_src1 folder to create golden outputs * Add three_images_224x224_src1 into TEST_IMAGES * Support HIP Backend for RICAP * Fix HIP pkd3->pkd3 variant * regenerated golden outputs for RICAP minor changes in HOST shell script for handling RICAP in QA mode * minor bug fix in RICAP HIP kernels * Improve readability and Cleanup * Additional cleanup * Cleanup testsuite Includes new golden outputs * Additional testuite fixes * Minor cleanup * Fix codacy warnings * Address other codacy warnings * Update ricap.hpp with reference paper * Add RICAP dataset path in readme * Make changes to error codes returned * Modify roi crop region for unit and perf tests * RPP Tensor Water Augmentation on HOST and HIP (#181) * added water HOST and HIP codes * added water case in test suite * added golden outputs for water * added omp thread changes for water augmentation * experimental changes * fixed output issue with AVX2 instructions * added AVX2 support for PKD3 load function minor changes in PLN variant load functions * nwc commit - added avx2 changes for u8 layout toggle variants but need to add store functions for completion * Add Avx2 implementation for F32 and U8 toggle variants * Add AVX2 support for u8 pkd3-pln3 and i8 pkd3-pln3 for water augmentation * change F32 load and store logic * optimized the store function for F32 PLN3-PKD3 * reverted back irrelevant changes * minor change * optimized load and store functions for water U8 and F32 variants in host removed commented code * removed golden outputs for water * minor changes * renamed few functions and removed unused functions updated i8 pln1 load as per the optimized u8 pln1 load * fixed bug in i8 load function * changed cast to c++ style resolved spacing issues and added comments for AVX codes for better understanding made changes to handle cases where QA Tests are not supported * added golden outputs for water * updated golden outputs with latest changes * modified the u8, i8 pkd3-pln3 function and added comments for the vectorized code * fixed minor bug in I8 variants * made to changes to resolve codacy warnings * changed cast to c++ style in hip kernel * changed generic nn F32 loads using gather and setr instructions * added comments for latest changes * minor change * added definition for storing 32 and 64 bits from a 128bit register --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM * Fix build error * CMakeLists - Version Update 1.5.0 - TOT Version * CHANGELOG Updates Version 1.5.0 placeholder * Boost deps fix for test suite --------- Co-authored-by: Snehaa Giridharan Co-authored-by: sampath1117 Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: HazarathKumarM Co-authored-by: Kiriti Gowda * Documentation - Readme & changelog updates (#251) * readme and changelog updates for 6.0 * minor update * added ctests for audio test suite for CI made changes to add more clarity on the QA Tests results * Cmake mods for ctest * HOST-only build error bugfix * added qa mode paramter to python audio script added golden output map for QA testing of Non silent region detection * minor change * Documentation - Bump rocm-docs-core[api_reference] from 0.26.0 to 0.27.0 in /docs/sphinx (#253) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.26.0 to 0.27.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.26.0...v0.27.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * RPP Resize Mirror Normalize Bugfix (#252) * added fix for hipMemset * remove pixel check for U8-F32 and U8-F16 for HOST codes --------- Co-authored-by: sampath1117 * added example for MMS calculation in comments for better understanding * Sphinx - updates (#257) * Sphinx - updates * Doxygen - Updates * Docs - Remove index.md * updated info used to for running audio test suite * removed bitdepth variable from audio test suite * added more information on computing NSR outputs in the example added * Fix doxygen for decibels Also removes extra QA reference files * move tensor_host_audio.cpp to host folder * Fix build errors and qa tests in Audio Test suite * Fix build errors and qa tests in Audio Test suite * Add reference output and test samples for downmix * Add down_mix in augmentation list and supported cases * move Tensor_host_audio.cpp to host folder * fix qa mismatches * move Tensor_host_audio.cpp to host folder * fix qa mismatches * move Tensor_host_audio.cpp to host folder * Add spectrogram case in Tensor_host_audio.cpp * move Tensor_host_audio.cpp to host folder * fix qa mismatches * Remove auto-merge repeated funcs * Improve clarity of header docs * Remove blank line * Improve clarity on header docs * Add Doxygen comments * Add Doxygen comments * Add Doxygen comments * minor change * License - updates to 2024 and consistency changes (#298) * Match all CMakeLists.txt license as per RPP's outermost LICENSE file * Match all python files' license as per RPP's outermost LICENSE file * Match all .hpp files' license as per RPP's outermost LICENSE file * Match all .cpp files' license as per RPP's outermost LICENSE file * Match all .h files' license as per RPP's outermost LICENSE file * Remove all rights reserved as per LICENSE file * Remove double space in "Copyright (c) 2019 - 2023 Advanced Micro Devices, Inc." * Match all .cmake files' license as per RPP's outermost LICENSE file * Match all .cpp.in files' license as per RPP's outermost LICENSE file * Replace 283 occurrences in 282 files - 2023 to 2024 * Add "MIT License" title to 281 instances * Add missing license * Test - Update README.md for test_suite (#299) * Bump rocm-docs-core[api_reference] from 0.33.0 to 0.33.1 in /docs/sphinx (#301) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.33.0 to 0.33.1. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.33.0...v0.33.1) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump rocm-docs-core[api_reference] from 0.33.1 to 0.33.2 in /docs/sphinx (#302) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.33.1 to 0.33.2. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.33.1...v0.33.2) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update doc codeowners (#303) * Documentation - Bump rocm-docs-core[api_reference] from 0.33.2 to 0.34.0 in /docs/sphinx (#304) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.33.2 to 0.34.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.33.2...v0.34.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Test suite - upgrade 5 qa perf (#305) * experimental changes for adding qa mode for performance tests * made changes to add display more information w.r.t QA results summary for performance tests * minor changes * Add changes to dump qa results to excel file * Add performance QA for three new tensor functions * update prerequisites in readme * added changes to handle unsupported cases * removed treshold dictionary and added performance Noise treshold add new dataset for performance QA * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * Changes to the performane summary dataframe * minor changes * Update CMakeLists.txt to add ${CMAKE_CURRENT_SOURCE_DIR} for CI * Update CMakeLists.txt fix * Update CMakeLists.txt fix * remove tabulate dependency * Update README.md to remove tabulate pip install * Fix for CI machine failure * Add note on performance --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM Co-authored-by: Abishek <52214183+r-abishek@users.noreply.github.com> Co-authored-by: Snehaa Giridharan Co-authored-by: r-abishek * RPP Color Temperature on HOST and HIP (#271) * Initial commit - Color Temperature HOST Tensor * Initial commit - Color Temperature HIP Tensor * Add color temperature golden outputs * address review comments * Use reinterpret_cast instead of static_cast * Combine templated functions to support all datatypes into one (got minor perf difference of order 3%) Also fixes indentation * Fix i8 datatype * Cleanup * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * Fix PLN3 variant outputs Also modifies reference outputs * Update color_temperature.hpp license * Delete color_temperature_u8_Tensor_PKD3.csv * Delete color_temperature_u8_Tensor_PLN3.csv --------- Co-authored-by: snehaa8 Co-authored-by: HazarathKumarM Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> * RPP Voxel 3D Tensor Add/Subtract scalar on HOST and HIP (#272) * added HOST support for voxel add kernel * added HIP support for voxel add kernel * added test suite support for add scalar * added Doxygen support and modified hip kernel function names as per new standard * added HOST support for voxel subtract kernel * added HIP support for voxel subtract kernel * added test suite support * updated the golden outputs for subtract with correct values * removed unnessary validation checks * Remove double spaces * Fix header * Fix all retval docs * Fix docs to add memory type * Fix comment * Add divider comment * Use post-increment efficiently * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * converted add and subtract scalar golden outputs to bin files * changed copyright from 2023 to 2024 * Update add_scalar.hpp license * Update subtract_scalar.hpp license --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM * removed unnecessary files * removed debugging print statement * updated copyright * updated description for resample based on latest changes * converted golden outputs for resample to binary files * Passed resampling window as a parameter to resampling function * RPP Magnitude on HOST and HIP (#278) * Initial commit - Magnitude HOST Tensor * Add QA reference outputs * Update runTests.py * Initial commit - Magnitude HIP Tensor * Add dual input support in testsuite * Optimize HOST kernel further * Optimize i8 datatype further * Modify comments * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * Bump rocm-docs-core[api_reference] from 0.31.0 to 0.33.0 in /docs/sphinx (#294) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.31.0 to 0.33.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.31.0...v0.33.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update Copywright year * Combine templated functions to support all datatypes * Modify format of reference outputs * Update rppi_arithmetic_operations.h license * Update rppt_tensor_arithmetic_operations.h license * Update host_tensor_arithmetic_operations.hpp * Update magnitude.hpp license * Update hip_tensor_arithmetic_operations.hpp license * Delete magnitude_u8_Tensor_PKD3.csv * Delete magnitude_u8_Tensor_PLN1.csv * Delete magnitude_u8_Tensor_PLN3.csv * Update rpp_test_suite_common.h license * Update runTests.py license * Update Tensor_hip.cpp license * Update runTests.py license * Update Tensor_host.cpp license --------- Signed-off-by: dependabot[bot] Co-authored-by: Snehaa Giridharan Co-authored-by: HazarathKumarM Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> * removed unnecessary files removed unncessary validation checks in test suite * modified sinc to use ONE_OVER_6 macro * combined srcLength and channels into single tensor removed the usage of quality parameter since not used in the kernel * minor change * Bump rocm-docs-core[api_reference] from 0.34.0 to 0.34.2 in /docs/sphinx (#309) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.34.0 to 0.34.2. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.34.0...v0.34.2) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * RPP Tensor Audio Support - Down Mixing (#296) * Initial commit - Non slient region detection Includes unittest setup * Initial commit - To Decibels Includes unittest setup * Intial commit - pre_emphasis_filter * Intial commit - down_mixing * Replace vectors with arrays * Cleanup * Minor cleanup * Optimize downmixing Kernel Includes cleanup * Replace Rpp64s with Rpp32s * Cleanup * Optimize and precompute cutOff * Fix buffer used * Fix buffer used * Additional Cleanup * Optimize post incrmeent operation * Optimize post increment operation * Update testsuite for Audio * code cleanup * Add Readme file for Audio test suite * changes based on review comments * minor change * Remove unittest folders and updated README.md * Remove unit tests * minor change * code cleanup * added common header file for audio helper functions * removed unncessary audio wav files fixed bug in ROI updation for audio test suite resolved issue in summary generation for performance tests in python * removed log file * added doxygen support for audio * added doxygen changes for to_decibels * updated test suite support for to_decibels * minor change * added doxygen changes for preemphasis filter * updated changes for preemphasis filter in test suite * removed the usage of getMax function and used std::max_element * modularized code in test suite * merge with latest changes * minor change * minor change * minor change * resolved codacy warnings * Codacy fix - Remove unused cpuTime * CMakeLists - Version Update 1.5.0 - TOT Version * CHANGELOG Updates Version 1.5.0 placeholder * resolved issue with file_system dependency in test suite * Doxygen changes changed malloc to new in NSR kernel * RPP RICAP Tensor for HOST and HIP (#213) * Initial commit - Ricap HOST Tensor Includes testsuite changes * Add QA tests for RICAP Used three_images_224x224_src1 folder to create golden outputs * Add three_images_224x224_src1 into TEST_IMAGES * Support HIP Backend for RICAP * Fix HIP pkd3->pkd3 variant * regenerated golden outputs for RICAP minor changes in HOST shell script for handling RICAP in QA mode * minor bug fix in RICAP HIP kernels * Improve readability and Cleanup * Additional cleanup * Cleanup testsuite Includes new golden outputs * Additional testuite fixes * Minor cleanup * Fix codacy warnings * Address other codacy warnings * Update ricap.hpp with reference paper * Add RICAP dataset path in readme * Make changes to error codes returned * Modify roi crop region for unit and perf tests * RPP Tensor Water Augmentation on HOST and HIP (#181) * added water HOST and HIP codes * added water case in test suite * added golden outputs for water * added omp thread changes for water augmentation * experimental changes * fixed output issue with AVX2 instructions * added AVX2 support for PKD3 load function minor changes in PLN variant load functions * nwc commit - added avx2 changes for u8 layout toggle variants but need to add store functions for completion * Add Avx2 implementation for F32 and U8 toggle variants * Add AVX2 support for u8 pkd3-pln3 and i8 pkd3-pln3 for water augmentation * change F32 load and store logic * optimized the store function for F32 PLN3-PKD3 * reverted back irrelevant changes * minor change * optimized load and store functions for water U8 and F32 variants in host removed commented code * removed golden outputs for water * minor changes * renamed few functions and removed unused functions updated i8 pln1 load as per the optimized u8 pln1 load * fixed bug in i8 load function * changed cast to c++ style resolved spacing issues and added comments for AVX codes for better understanding made changes to handle cases where QA Tests are not supported * added golden outputs for water * updated golden outputs with latest changes * modified the u8, i8 pkd3-pln3 function and added comments for the vectorized code * fixed minor bug in I8 variants * made to changes to resolve codacy warnings * changed cast to c++ style in hip kernel * changed generic nn F32 loads using gather and setr instructions * added comments for latest changes * minor change * added definition for storing 32 and 64 bits from a 128bit register --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM * Fix build error * CMakeLists - Version Update 1.5.0 - TOT Version * CHANGELOG Updates Version 1.5.0 placeholder * Boost deps fix for test suite --------- Co-authored-by: Snehaa Giridharan Co-authored-by: sampath1117 Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: HazarathKumarM Co-authored-by: Kiriti Gowda * Documentation - Readme & changelog updates (#251) * readme and changelog updates for 6.0 * minor update * added ctests for audio test suite for CI made changes to add more clarity on the QA Tests results * Cmake mods for ctest * HOST-only build error bugfix * added qa mode paramter to python audio script added golden output map for QA testing of Non silent region detection * minor change * Documentation - Bump rocm-docs-core[api_reference] from 0.26.0 to 0.27.0 in /docs/sphinx (#253) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.26.0 to 0.27.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.26.0...v0.27.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * RPP Resize Mirror Normalize Bugfix (#252) * added fix for hipMemset * remove pixel check for U8-F32 and U8-F16 for HOST codes --------- Co-authored-by: sampath1117 * added example for MMS calculation in comments for better understanding * Sphinx - updates (#257) * Sphinx - updates * Doxygen - Updates * Docs - Remove index.md * updated info used to for running audio test suite * removed bitdepth variable from audio test suite * added more information on computing NSR outputs in the example added * Fix doxygen for decibels Also removes extra QA reference files * move tensor_host_audio.cpp to host folder * Fix build errors and qa tests in Audio Test suite * Fix build errors and qa tests in Audio Test suite * Add reference output and test samples for downmix * Add down_mix in augmentation list and supported cases * Remove auto-merge repeated funcs * Improve clarity of header docs * Remove blank line * Improve clarity on header docs * Add Doxygen comments * minor change * converted golden outputs to binary file for downmixing * removed old golden output file for preemphasis and todecibels * modified info for downmixing as per new changes used handle memory for temporary buffers * formatting changes * moved the common code for SSE and AVX to outside * Update down_mixing.hpp license * Update rppt_tensor_audio_augmentations.h * combined the srcLength and channels tensors into single tensor --------- Signed-off-by: dependabot[bot] Co-authored-by: Snehaa Giridharan Co-authored-by: HazarathKumarM Co-authored-by: sampath1117 Co-authored-by: Kiriti Gowda Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: Lisa Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sundarrajan98 * RPP Voxel 3D Tensor Multiply scalar on HOST and HIP (#306) * added HIP support for voxel scalar multiply kernel * added HOST support for voxel multiply kernel added golden outputs for voxel multiply kernel * merge with master * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * converted multiply scalar voxel golden outputs to bin files * changed copyright from 2023 to 2024 --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM * Test Suite Bugfix (#307) * experimental changes for adding qa mode for performance tests * made changes to add display more information w.r.t QA results summary for performance tests * minor changes * Add changes to dump qa results to excel file * Add performance QA for three new tensor functions * update prerequisites in readme * added changes to handle unsupported cases * removed treshold dictionary and added performance Noise treshold add new dataset for performance QA * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * Changes to the performane summary dataframe * minor changes * Update CMakeLists.txt to add ${CMAKE_CURRENT_SOURCE_DIR} for CI * Update CMakeLists.txt fix * Update CMakeLists.txt fix * remove tabulate dependency * Update README.md to remove tabulate pip install * Fix for CI machine failure * Add note on performance * Fix segmentation fault * Revert QAmode to restrict HIP bitdepths * Use Rpp64u for HOST while comparing outputs * Fix ambiguous abs call * Fix for SLES CI HIP fail - error: incompatible pointer types assigning to 'unsigned long *' from 'unsigned long long *' - refOutput = TensorSumReferenceOutputs[numChannels].data(); --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM Co-authored-by: Snehaa Giridharan Co-authored-by: Pavel Tcherniaev * used std functions for floor and ceil use static_cast instead of floor in the resample kernel * Bump rocm-docs-core[api_reference] from 0.34.2 to 0.35.0 in /docs/sphinx (#313) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.34.2 to 0.35.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.34.2...v0.35.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * RPP Reduction - Tensor min and Tensor max on HOST and HIP (#260) * Minor Change * Add Validation check for DST_FOLDER path * added water HOST and HIP codes * added water case in test suite * added golden outputs for water * Add Validation checks for all options in testAllScript.sh * Add sanity check for dual Input cases Set Max Dimension and Max Image Dump Replaced Fast DCT tag with Accurate DCT * Regenerate golden outputs using accurate dct Flag Add golden outputs for some new augmentations * Fix Flip golden outputs mismatch Fix PLN3 variants mismatch in QA mode * Add MAX_BATCH_SIZE check removed Augmentations function calls for failing Qa modes code cleanup * Add crop and gamma correction augmentations code cleanup * Add comments to functions in rpp_test_suite_common.h * minor change * code cleanup * minor code changes * Change roi and Image sizes for crop augmentation * Change numIterations option to numRuns Addressed PR comments * added omp thread changes for water augmentation * experimental changes * fixed output issue with AVX2 instructions * added AVX2 support for PKD3 load function minor changes in PLN variant load functions * Add turboJpeg header to update maxHeight and maxWidth values * nwc commit - added avx2 changes for u8 layout toggle variants but need to add store functions for completion * Change the performance Timings logic * Add Avx2 implementation for F32 and U8 toggle variants * minor change to support u8_f16 and u8_f32 cases * Regenerate LUT golden outputs with ACCURATE_DCT tag * Minor code changes * Add AVX2 support for u8 pkd3-pln3 and i8 pkd3-pln3 for water augmentation * Made changes to the runTests.py in Host to remove testAllScipts.sh * Made changes to the runTests.py in HIP to remove testAllScipts.sh * Initial commit - Image min and max Reduction kernel Includes * u8 datatype for both min and max HOST Tensor of all variants. * Testsuite changes. * NWC -initial code for min max PLN3 - PLN3 * made changes to split min and max kernels seperately * splitted kernels for min and max * made changes to print final max/min in the R,G,B channels * fixed inaccuracies in min/max computation * made changes to typecast intermediate output to output requested by user added comments for the code code cleanup and minor changes in test suite * fixed build issues removed image folders used for min, max and sum reverted unwanted file changes * minor changes in test suite * removed support for unwanted test case in Tensor_hip.cpp * Adds new option roi * remove testAllScripts.sh * Adds roi Option in HIP backend * Implement f32 variants * Implement f16 and i8 datatype variants * change F32 load and store logic * Add build flags in CMakeLists.txt to set AVX/SSE flags based on the system configuration * minor code changes * Initial commit - Image sum Reduction kernel Includes u8 PLN1 -> PLN1 conversion for HOST Tensor * Implement PKD3 and PLN3 for Image sum Tensor HOST * Support i8, f16 and f32 datatypes * Initial commit - Image sum Reduction HIP kernel Includes u8 PLN1 -> PLN1 conversion for Tensor * Implement PKD3 and PLN3 for Image sum Tensor HIP * Add support in testsuite Revert normalization for i8 HOST Tensor variants * Fix HIP testsuite Remove additional blanks for 1 channel output * Modify print statement in HIP testsuite * Improve readability for testsuite outputs * optimized the store function for F32 PLN3-PKD3 * reverted back irrelevant changes * minor change * Fix HIP to support larger inputs * optimized load and store functions for water U8 and F32 variants in host removed commented code * Cleanup * removed golden outputs for water * minor changes * Cleanup Support Reduction QA test in testsuite * renamed few functions and removed unused functions updated i8 pln1 load as per the optimized u8 pln1 load * fixed bug in i8 load function * Remove unused variables and C style casting * changed cast to c++ style resolved spacing issues and added comments for AVX codes for better understanding made changes to handle cases where QA Tests are not supported * added golden outputs for water * updated golden outputs with latest changes * modified the u8, i8 pkd3-pln3 function and added comments for the vectorized code * fixed minor bug in I8 variants * Optimize u8 datatype further * Fix static_cast * made to changes to resolve codacy warnings * changed cast to c++ style in hip kernel * Initial commit - Ricap HOST Tensor Includes testsuite changes * Add QA tests for RICAP Used three_images_224x224_src1 folder to create golden outputs * Add three_images_224x224_src1 into TEST_IMAGES * added rotate case with golden outputs changed generic bilinear HOST codes to match with HIP codes * Add golden output for remaining all tensor augmentations * fix python script issues * Optimize u8 and i8 datatype Uses uint and int internal processing instead of float * Fix testsuite build errors * minor change * Fix QA check * Modify api naming from image_sum to tensor_sum Includes changes for both HOST and HIP * Support HIP Backend for RICAP * change rcm and rmn golden outputs * Fix HIP pkd3->pkd3 variant * changes based on review comments * change test_suite folder to tests * Optimize u8 and i8 datatype of HIP Includes modification in naming of shared memory * minor fix * changed generic nn F32 loads using gather and setr instructions * Optimize and cleanup U8 HIP * regenerated golden outputs for RICAP minor changes in HOST shell script for handling RICAP in QA mode * minor bug fix in RICAP HIP kernels * Fix i8 datatype variants Includes cleanup * Fix the issues with color_to_greyscale * remove the empty folder creation * reverting back the folder name change * minor change * added comments for latest changes * minor change * Improve readability and Cleanup * Fix QA for HIP Includes cleanup * resolved review comments * minor change * Modify api naming from image_ to tensor_ for HOST * Add support for QA tests * removed range check for RMN U8-F32 and U8-F16 variants changed from hipMemset to hipMemsetAsync for RMN HIP Kernel removed multiplication by 255 for stdDev in RMN HOST U8-F16 and U8-F32 variants * Modify naming of shared memory with _smem in HIP Includes cleanup * Typecast and reuse markArr for HIP U8 and I8 * Cleanup and minor optimization * minor fix * fix codacy warnings * Additional cleanup * Cleanup and move #define * Changed the complexity of if statements in runTests.py * Cleanup testsuite Includes new golden outputs * Additional testuite fixes * Minor cleanup * Codacy fixes * Fix codacy warnings * Codacy fix * Address other codacy warnings * cleanup * Change Image functions to generic * Update ricap.hpp with reference paper * resolved minor issues happened with merge * minor changes * fixed minor issue with getting profiler times * minor formatting changes * resolved build issues in test suite renamed the min and max kernel file names * RPP RICAP Tensor for HOST and HIP (#213) * Initial commit - Ricap HOST Tensor Includes testsuite changes * Add QA tests for RICAP Used three_images_224x224_src1 folder to create golden outputs * Add three_images_224x224_src1 into TEST_IMAGES * Support HIP Backend for RICAP * Fix HIP pkd3->pkd3 variant * regenerated golden outputs for RICAP minor changes in HOST shell script for handling RICAP in QA mode * minor bug fix in RICAP HIP kernels * Improve readability and Cleanup * Additional cleanup * Cleanup testsuite Includes new golden outputs * Additional testuite fixes * Minor cleanup * Fix codacy warnings * Address other codacy warnings * Update ricap.hpp with reference paper * Add RICAP dataset path in readme * Make changes to error codes returned * Modify roi crop region for unit and perf tests * RPP Tensor Water Augmentation on HOST and HIP (#181) * added water HOST and HIP codes * added water case in test suite * added golden outputs for water * added omp thread changes for water augmentation * experimental changes * fixed output issue with AVX2 instructions * added AVX2 support for PKD3 load function minor changes in PLN variant load functions * nwc commit - added avx2 changes for u8 layout toggle variants but need to add store functions for completion * Add Avx2 implementation for F32 and U8 toggle variants * Add AVX2 support for u8 pkd3-pln3 and i8 pkd3-pln3 for water augmentation * change F32 load and store logic * optimized the store function for F32 PLN3-PKD3 * reverted back irrelevant changes * minor change * optimized load and store functions for water U8 and F32 variants in host removed commented code * removed golden outputs for water * minor changes * renamed few functions and removed unused functions updated i8 pln1 load as per the optimized u8 pln1 load * fixed bug in i8 load function * changed cast to c++ style resolved spacing issues and added comments for AVX codes for better understanding made changes to handle cases where QA Tests are not supported * added golden outputs for water * updated golden outputs with latest changes * modified the u8, i8 pkd3-pln3 function and added comments for the vectorized code * fixed minor bug in I8 variants * made to changes to resolve codacy warnings * changed cast to c++ style in hip kernel * changed generic nn F32 loads using gather and setr instructions * added comments for latest changes * minor change * added definition for storing 32 and 64 bits from a 128bit register --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM * Fix build error * CMakeLists - Version Update 1.5.0 - TOT Version * CHANGELOG Updates Version 1.5.0 placeholder * Boost deps fix for test suite --------- Co-authored-by: Snehaa Giridharan Co-authored-by: sampath1117 Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: HazarathKumarM Co-authored-by: Kiriti Gowda * Documentation - Readme & changelog updates (#251) * readme and changelog updates for 6.0 * minor update * Documentation - Bump rocm-docs-core[api_reference] from 0.26.0 to 0.27.0 in /docs/sphinx (#253) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.26.0 to 0.27.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.26.0...v0.27.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * RPP Resize Mirror Normalize Bugfix (#252) * added fix for hipMemset * remove pixel check for U8-F32 and U8-F16 for HOST codes --------- Co-authored-by: sampath1117 * Cmake fix to prevent warning * Fix paths in new python scripts * Sphinx - updates (#257) * Sphinx - updates * Doxygen - Updates * Docs - Remove index.md * Test suite fixes after tensor_min / tensor_max HOST merge * Fix max case * QA tests fix for hip and host * naming convention changes as per new std * Substitute imagePartial with partial * Substitute imageMin/imageMax with min/max * Replace hipMemset with hipMemsetAsync, and replace hipDeviceSynchronize with hipStreamSynchronize * Use variable instead of batchCount*4 * Use post increment effectivly * Resolve codacy warnings * Additional cleanup * remove unused variable * Documentation - Bump rocm-docs-core[api_reference] from 0.28.0 to 0.29.0 in /docs/sphinx (#265) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.28.0 to 0.29.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.28.0...v0.29.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Remove auto merge boost * Spaces formatting * Bump rocm-docs-core[api_reference] from 0.29.0 to 0.30.1 in /docs/sphinx (#268) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.29.0 to 0.30.1. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.29.0...v0.30.1) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * add support for mi300 (#269) * Documentation - Bump rocm-docs-core[api_reference] from 0.30.1 to 0.30.2 in /docs/sphinx (#273) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.30.1 to 0.30.2. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.30.1...v0.30.2) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Cleanup by removing oneliner functions as inline * RPP Tensor Audio Support - To Decibels (#258) * Initial commit - Non slient region detection Includes unittest setup * Initial commit - To Decibels Includes unittest setup * Replace vectors with arrays * Cleanup * Replace Rpp64s with Rpp32s * Optimize and precompute cutOff * Fix buffer used * Fix buffer used * Additional Cleanup * Update testsuite for Audio * code cleanup * Add Readme file for Audio test suite * changes based on review comments * minor change * Remove unittest folders and updated README.md * Remove unit tests * minor change * code cleanup * added common header file for audio helper functions * removed unncessary audio wav files fixed bug in ROI updation for audio test suite resolved issue in summary generation for performance tests in python * removed log file * added doxygen support for audio * added doxygen changes for to_decibels * updated test suite support for to_decibels * minor change * removed the usage of getMax function and used std::max_element * modularized code in test suite * merge with latest changes * minor change * minor change * resolved codacy warnings * Codacy fix - Remove unused cpuTime * CMakeLists - Version Update 1.5.0 - TOT Version * CHANGELOG Updates Version 1.5.0 placeholder * resolved issue with file_system dependency in test suite * Doxygen changes changed malloc to new in NSR kernel * RPP RICAP Tensor for HOST and HIP (#213) * Initial commit - Ricap HOST Tensor Includes testsuite changes * Add QA tests for RICAP Used three_images_224x224_src1 folder to create golden outputs * Add three_images_224x224_src1 into TEST_IMAGES * Support HIP Backend for RICAP * Fix HIP pkd3->pkd3 variant * regenerated golden outputs for RICAP minor changes in HOST shell script for handling RICAP in QA mode * minor bug fix in RICAP HIP kernels * Improve readability and Cleanup * Additional cleanup * Cleanup testsuite Includes new golden outputs * Additional testuite fixes * Minor cleanup * Fix codacy warnings * Address other codacy warnings * Update ricap.hpp with reference paper * Add RICAP dataset path in readme * Make changes to error codes returned * Modify roi crop region for unit and perf tests * RPP Tensor Water Augmentation on HOST and HIP (#181) * added water HOST and HIP codes * added water case in test suite * added golden outputs for water * added omp thread changes for water augmentation * experimental changes * fixed output issue with AVX2 instructions * added AVX2 support for PKD3 load function minor changes in PLN variant load functions * nwc commit - added avx2 changes for u8 layout toggle variants but need to add store functions for completion * Add Avx2 implementation for F32 and U8 toggle variants * Add AVX2 support for u8 pkd3-pln3 and i8 pkd3-pln3 for water augmentation * change F32 load and store logic * optimized the store function for F32 PLN3-PKD3 * reverted back irrelevant changes * minor change * optimized load and store functions for water U8 and F32 variants in host removed commented code * removed golden outputs for water * minor changes * renamed few functions and removed unused functions updated i8 pln1 load as per the optimized u8 pln1 load * fixed bug in i8 load function * changed cast to c++ style resolved spacing issues and added comments for AVX codes for better understanding made changes to handle cases where QA Tests are not supported * added golden outputs for water * updated golden outputs with latest changes * modified the u8, i8 pkd3-pln3 function and added comments for the vectorized code * fixed minor bug in I8 variants * made to changes to resolve codacy warnings * changed cast to c++ style in hip kernel * changed generic nn F32 loads using gather and setr instructions * added comments for latest changes * minor change * added definition for storing 32 and 64 bits from a 128bit register --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM * Fix build error * CMakeLists - Version Update 1.5.0 - TOT Version * CHANGELOG Updates Version 1.5.0 placeholder * Boost deps fix for test suite --------- Co-authored-by: Snehaa Giridharan Co-authored-by: sampath1117 Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: HazarathKumarM Co-authored-by: Kiriti Gowda * Documentation - Readme & changelog updates (#251) * readme and changelog updates for 6.0 * minor update * added ctests for audio test suite for CI made changes to add more clarity on the QA Tests results * Cmake mods for ctest * HOST-only build error bugfix * added qa mode paramter to python audio script added golden output map for QA testing of Non silent region detection * minor change * Documentation - Bump rocm-docs-core[api_reference] from 0.26.0 to 0.27.0 in /docs/sphinx (#253) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.26.0 to 0.27.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.26.0...v0.27.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * RPP Resize Mirror Normalize Bugfix (#252) * added fix for hipMemset * remove pixel check for U8-F32 and U8-F16 for HOST codes --------- Co-authored-by: sampath1117 * added example for MMS calculation in comments for better understanding * Sphinx - updates (#257) * Sphinx - updates * Doxygen - Updates * Docs - Remove index.md * updated info used to for running audio test suite * removed bitdepth variable from audio test suite * added more information on computing NSR outputs in the example added * Fix doxygen for decibels Also removes extra QA reference files * Fix build errors and qa tests in Audio Test suite * Remove auto-merge repeated funcs * Improve clarity on header docs * made changes based on review comments * stored golden outputs of to_decibels in binary file removed golden output text files for non silent region * removed unused parameter in verify_output function * updated list of cases supported in python script * added error handling for opening golden output file * Codacy fix and tests warning fix * Codacy fix * Codacy fix trial * codacy fix for checking boundaries of fstream --------- Signed-off-by: dependabot[bot] Co-authored-by: Snehaa Giridharan Co-authored-by: HazarathKumarM Co-authored-by: sampath1117 Co-authored-by: Kiriti Gowda Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: Lisa Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Documentation - Bump rocm-docs-core[api_reference] from 0.30.2 to 0.30.3 in /docs/sphinx (#274) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.30.2 to 0.30.3. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.30.2...v0.30.3) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Adding issue template (#270) * Add files via upload * added ROCm v6, MI300, default component * Fix cast used in testsuite Includes minor fixes * Fix displaying f16 outputs * Optimize HOST min/max reduce function further * Fix spacing in HIP kernels * Fix PLN1 outputs for u8 and i8 datatypes of HOST backend * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * Bump rocm-docs-core[api_reference] from 0.31.0 to 0.33.0 in /docs/sphinx (#294) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.31.0 to 0.33.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.31.0...v0.33.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Store reference outputs via map for min and max kernels * Update tensor_max.hpp license * Update tensor_min.hpp license * Fix output comparison check * Merge branch 'ar/opt_tensor_min_tensor_max' of https://github.com/r-abishek/rpp into sn/tensor_min_max * Modify exit condition used in outer most kernel * Modify srcIdx for HIP Tensor min * Using maximum as 255 for HIP Tensor min * Modify srcIdx for HIP Tensor max kernel Also fixes build error in testsuite * Fix corrupted outputs displayed for Tensor sum * Fix corruption issue seen with tensor sum kernel * Fix minimum for I8 Tensor max kernel * Modified HIP buffer initialization with a common function * Fix redefinition * Remove additional variables xAlignedLength * Remove unwanted xAlignedLength and xDiff * Remove redefinition of TensorSumReferenceOutputs * Fix for CI issue * Add parenthesis --------- Signed-off-by: dependabot[bot] Co-authored-by: HazarathKumarM Co-authored-by: sampath1117 Co-authored-by: Snehaa Giridharan Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: fiona-gladwin Co-authored-by: Kiriti Gowda Co-authored-by: Lisa Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Lakshmi Kumar Co-authored-by: abhimeda <138710508+abhimeda@users.noreply.github.com> * CI - Update precheckin.groovy * Png update (#316) * PNG file conversion * reference .png files * remove JPG files * edit IMAGE_PATH * RPP Test Suite Upgrade 6 - Restructure common HIP/HOST code (#315) * moved the common functions used in a python test suites to to a common python script created helper function for displaying QA test summary * reversed the order of performance runs loop and decode loop in all test suites * modified remaining python scripts to use print qa helper function for displaying QA results * added new helper function for print the performance test results as a summary * added caseMax, caseMin variables in image test suite made changes to run only necessary bitdepths needed incase of qa mode --------- Co-authored-by: sampath1117 * Fix build error * removed outBegin variable * remove duplicate line in readme --------- Signed-off-by: dependabot[bot] Co-authored-by: Snehaa Giridharan Co-authored-by: HazarathKumarM Co-authored-by: sampath1117 Co-authored-by: Kiriti Gowda Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: Lisa Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sundarrajan98 Co-authored-by: Sam Wu Co-authored-by: Pavel Tcherniaev Co-authored-by: fiona-gladwin Co-authored-by: Lakshmi Kumar Co-authored-by: abhimeda <138710508+abhimeda@users.noreply.github.com> Co-authored-by: randyh62 <42045079+randyh62@users.noreply.github.com> * Docs - Missing input and output images for Doxygen (#331) * added missing outputs for image augmentations modified the description with correct output names * added gif for voxel input and outputs * modified the output images for water, resize_crop_mirror and resize_mirror_normalize --------- Co-authored-by: sampath1117 * Scratch buffers rename for HOST and HIP (#324) * Change all maskArr to scratchBufferHip * Change all tempFloatmem to scratchBufferHost * Update CMakeLists.txt Version updates * RPP BitwiseAND and BitwiseOR Tensor on HOST and HIP (#318) * HOST test suite update for voxel processing * Initial commit - Implements PLN1 Fmadd Kernel * Add dependencies for fmadd kernel * Implement NDHWC variant for Fmadd Includes testsuite changes to support 3 channels * Implement Slice HOST Kernel Includes testsuite changes * Fix NCDHW variant for Slice * Cleanup * Fix NDHWC variant * Fix stride used for NDHWC * Fix NDHWC layout handling in testsuite Temporarily converts pln3 inputs into pkd3 inputs later stores them as pln3 after processing * Add sample input .nii file Also fixes build error in testsuite * Fix NDHWC layout for fmadd and slice Also includes fixes in voxel testsuite * Initial commit - Bitwise AND HOST Tensor * Match u8 and i8 outputs with BatchPD variant * Fix i8 PKD3 -> PLN3 * Initial commit - Bitwise AND HIP Tensor Also includes fixing f16 and f32 datatype of HOST * Add reference outputs * License - updates to 2024 and consistency changes (#298) * Match all CMakeLists.txt license as per RPP's outermost LICENSE file * Match all python files' license as per RPP's outermost LICENSE file * Match all .hpp files' license as per RPP's outermost LICENSE file * Match all .cpp files' license as per RPP's outermost LICENSE file * Match all .h files' license as per RPP's outermost LICENSE file * Remove all rights reserved as per LICENSE file * Remove double space in "Copyright (c) 2019 - 2023 Advanced Micro Devices, Inc." * Match all .cmake files' license as per RPP's outermost LICENSE file * Match all .cpp.in files' license as per RPP's outermost LICENSE file * Replace 283 occurrences in 282 files - 2023 to 2024 * Add "MIT License" title to 281 instances * Add missing license * Test - Update README.md for test_suite (#299) * Modify reference outputs Update Copywrite * Combine templated functions to support all datatypes * Initial commit - Bitwise OR HOST * Fix GPU kernel details * Fix case number for HOST testsuite * Initial commit - Bitwise OR HIP Includes reference output * Bump rocm-docs-core[api_reference] from 0.33.0 to 0.33.1 in /docs/sphinx (#301) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.33.0 to 0.33.1. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.33.0...v0.33.1) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump rocm-docs-core[api_reference] from 0.33.1 to 0.33.2 in /docs/sphinx (#302) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.33.1 to 0.33.2. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.33.1...v0.33.2) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Address review comments * Update doc codeowners (#303) * Documentation - Bump rocm-docs-core[api_reference] from 0.33.2 to 0.34.0 in /docs/sphinx (#304) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.33.2 to 0.34.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.33.2...v0.34.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Test suite - upgrade 5 qa perf (#305) * experimental changes for adding qa mode for performance tests * made changes to add display more information w.r.t QA results summary for performance tests * minor changes * Add changes to dump qa results to excel file * Add performance QA for three new tensor functions * update prerequisites in readme * added changes to handle unsupported cases * removed treshold dictionary and added performance Noise treshold add new dataset for performance QA * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * Changes to the performane summary dataframe * minor changes * Update CMakeLists.txt to add ${CMAKE_CURRENT_SOURCE_DIR} for CI * Update CMakeLists.txt fix * Update CMakeLists.txt fix * remove tabulate dependency * Update README.md to remove tabulate pip install * Fix for CI machine failure * Add note on performance --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM Co-authored-by: Abishek <52214183+r-abishek@users.noreply.github.com> Co-authored-by: Snehaa Giridharan Co-authored-by: r-abishek * RPP Color Temperature on HOST and HIP (#271) * Initial commit - Color Temperature HOST Tensor * Initial commit - Color Temperature HIP Tensor * Add color temperature golden outputs * address review comments * Use reinterpret_cast instead of static_cast * Combine templated functions to support all datatypes into one (got minor perf difference of order 3%) Also fixes indentation * Fix i8 datatype * Cleanup * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * Fix PLN3 variant outputs Also modifies reference outputs * Update color_temperature.hpp license * Delete color_temperature_u8_Tensor_PKD3.csv * Delete color_temperature_u8_Tensor_PLN3.csv --------- Co-authored-by: snehaa8 Co-authored-by: HazarathKumarM Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> * RPP Voxel 3D Tensor Add/Subtract scalar on HOST and HIP (#272) * added HOST support for voxel add kernel * added HIP support for voxel add kernel * added test suite support for add scalar * added Doxygen support and modified hip kernel function names as per new standard * added HOST support for voxel subtract kernel * added HIP support for voxel subtract kernel * added test suite support * updated the golden outputs for subtract with correct values * removed unnessary validation checks * Remove double spaces * Fix header * Fix all retval docs * Fix docs to add memory type * Fix comment * Add divider comment * Use post-increment efficiently * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * converted add and subtract scalar golden outputs to bin files * changed copyright from 2023 to 2024 * Update add_scalar.hpp license * Update subtract_scalar.hpp license --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM * RPP Magnitude on HOST and HIP (#278) * Initial commit - Magnitude HOST Tensor * Add QA reference outputs * Update runTests.py * Initial commit - Magnitude HIP Tensor * Add dual input support in testsuite * Optimize HOST kernel further * Optimize i8 datatype further * Modify comments * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * Bump rocm-docs-core[api_reference] from 0.31.0 to 0.33.0 in /docs/sphinx (#294) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.31.0 to 0.33.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.31.0...v0.33.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update Copywright year * Combine templated functions to support all datatypes * Modify format of reference outputs * Update rppi_arithmetic_operations.h license * Update rppt_tensor_arithmetic_operations.h license * Update host_tensor_arithmetic_operations.hpp * Update magnitude.hpp license * Update hip_tensor_arithmetic_operations.hpp license * Delete magnitude_u8_Tensor_PKD3.csv * Delete magnitude_u8_Tensor_PLN1.csv * Delete magnitude_u8_Tensor_PLN3.csv * Update rpp_test_suite_common.h license * Update runTests.py license * Update Tensor_hip.cpp license * Update runTests.py license * Update Tensor_host.cpp license --------- Signed-off-by: dependabot[bot] Co-authored-by: Snehaa Giridharan Co-authored-by: HazarathKumarM Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> * Bump rocm-docs-core[api_reference] from 0.34.0 to 0.34.2 in /docs/sphinx (#309) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.34.0 to 0.34.2. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.34.0...v0.34.2) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * RPP Tensor Audio Support - Down Mixing (#296) * Initial commit - Non slient region detection Includes unittest setup * Initial commit - To Decibels Includes unittest setup * Intial commit - pre_emphasis_filter * Intial commit - down_mixing * Replace vectors with arrays * Cleanup * Minor cleanup * Optimize downmixing Kernel Includes cleanup * Replace Rpp64s with Rpp32s * Cleanup * Optimize and precompute cutOff * Fix buffer used * Fix buffer used * Additional Cleanup * Optimize post incrmeent operation * Optimize post increment operation * Update testsuite for Audio * code cleanup * Add Readme file for Audio test suite * changes based on review comments * minor change * Remove unittest folders and updated README.md * Remove unit tests * minor change * code cleanup * added common header file for audio helper functions * removed unncessary audio wav files fixed bug in ROI updation for audio test suite resolved issue in summary generation for performance tests in python * removed log file * added doxygen support for audio * added doxygen changes for to_decibels * updated test suite support for to_decibels * minor change * added doxygen changes for preemphasis filter * updated changes for preemphasis filter in test suite * removed the usage of getMax function and used std::max_element * modularized code in test suite * merge with latest changes * minor change * minor change * minor change * resolved codacy warnings * Codacy fix - Remove unused cpuTime * CMakeLists - Version Update 1.5.0 - TOT Version * CHANGELOG Updates Version 1.5.0 placeholder * resolved issue with file_system dependency in test suite * Doxygen changes changed malloc to new in NSR kernel * RPP RICAP Tensor for HOST and HIP (#213) * Initial commit - Ricap HOST Tensor Includes testsuite changes * Add QA tests for RICAP Used three_images_224x224_src1 folder to create golden outputs * Add three_images_224x224_src1 into TEST_IMAGES * Support HIP Backend for RICAP * Fix HIP pkd3->pkd3 variant * regenerated golden outputs for RICAP minor changes in HOST shell script for handling RICAP in QA mode * minor bug fix in RICAP HIP kernels * Improve readability and Cleanup * Additional cleanup * Cleanup testsuite Includes new golden outputs * Additional testuite fixes * Minor cleanup * Fix codacy warnings * Address other codacy warnings * Update ricap.hpp with reference paper * Add RICAP dataset path in readme * Make changes to error codes returned * Modify roi crop region for unit and perf tests * RPP Tensor Water Augmentation on HOST and HIP (#181) * added water HOST and HIP codes * added water case in test suite * added golden outputs for water * added omp thread changes for water augmentation * experimental changes * fixed output issue with AVX2 instructions * added AVX2 support for PKD3 load function minor changes in PLN variant load functions * nwc commit - added avx2 changes for u8 layout toggle variants but need to add store functions for completion * Add Avx2 implementation for F32 and U8 toggle variants * Add AVX2 support for u8 pkd3-pln3 and i8 pkd3-pln3 for water augmentation * change F32 load and store logic * optimized the store function for F32 PLN3-PKD3 * reverted back irrelevant changes * minor change * optimized load and store functions for water U8 and F32 variants in host removed commented code * removed golden outputs for water * minor changes * renamed few functions and removed unused functions updated i8 pln1 load as per the optimized u8 pln1 load * fixed bug in i8 load function * changed cast to c++ style resolved spacing issues and added comments for AVX codes for better understanding made changes to handle cases where QA Tests are not supported * added golden outputs for water * updated golden outputs with latest changes * modified the u8, i8 pkd3-pln3 function and added comments for the vectorized code * fixed minor bug in I8 variants * made to changes to resolve codacy warnings * changed cast to c++ style in hip kernel * changed generic nn F32 loads using gather and setr instructions * added comments for latest changes * minor change * added definition for storing 32 and 64 bits from a 128bit register --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM * Fix build error * CMakeLists - Version Update 1.5.0 - TOT Version * CHANGELOG Updates Version 1.5.0 placeholder * Boost deps fix for test suite --------- Co-authored-by: Snehaa Giridharan Co-authored-by: sampath1117 Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: HazarathKumarM Co-authored-by: Kiriti Gowda * Documentation - Readme & changelog updates (#251) * readme and changelog updates for 6.0 * minor update * added ctests for audio test suite for CI made changes to add more clarity on the QA Tests results * Cmake mods for ctest * HOST-only build error bugfix * added qa mode paramter to python audio script added golden output map for QA testing of Non silent region detection * minor change * Documentation - Bump rocm-docs-core[api_reference] from 0.26.0 to 0.27.0 in /docs/sphinx (#253) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.26.0 to 0.27.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.26.0...v0.27.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * RPP Resize Mirror Normalize Bugfix (#252) * added fix for hipMemset * remove pixel check for U8-F32 and U8-F16 for HOST codes --------- Co-authored-by: sampath1117 * added example for MMS calculation in comments for better understanding * Sphinx - updates (#257) * Sphinx - updates * Doxygen - Updates * Docs - Remove index.md * updated info used to for running audio test suite * removed bitdepth variable from audio test suite * added more information on computing NSR outputs in the example added * Fix doxygen for decibels Also removes extra QA reference files * move tensor_host_audio.cpp to host folder * Fix build errors and qa tests in Audio Test suite * Fix build errors and qa tests in Audio Test suite * Add reference output and test samples for downmix * Add down_mix in augmentation list and supported cases * Remove auto-merge repeated funcs * Improve clarity of header docs * Remove blank line * Improve clarity on header docs * Add Doxygen comments * minor change * converted golden outputs to binary file for downmixing * removed old golden output file for preemphasis and todecibels * modified info for downmixing as per new changes used handle memory for temporary buffers * formatting changes * moved the common code for SSE and AVX to outside * Update down_mixing.hpp license * Update rppt_tensor_audio_augmentations.h * combined the srcLength and channels tensors into single tensor --------- Signed-off-by: dependabot[bot] Co-authored-by: Snehaa Giridharan Co-authored-by: HazarathKumarM Co-authored-by: sampath1117 Co-authored-by: Kiriti Gowda Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: Lisa Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sundarrajan98 * RPP Voxel 3D Tensor Multiply scalar on HOST and HIP (#306) * added HIP support for voxel scalar multiply kernel * added HOST support for voxel multiply kernel added golden outputs for voxel multiply kernel * merge with master * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * converted multiply scalar voxel golden outputs to bin files * changed copyright from 2023 to 2024 --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM * Test Suite Bugfix (#307) * experimental changes for adding qa mode for performance tests * made changes to add display more information w.r.t QA results summary for performance tests * minor changes * Add changes to dump qa results to excel file * Add performance QA for three new tensor functions * update prerequisites in readme * added changes to handle unsupported cases * removed treshold dictionary and added performance Noise treshold add new dataset for performance QA * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * Changes to the performane summary dataframe * minor changes * Update CMakeLists.txt to add ${CMAKE_CURRENT_SOURCE_DIR} for CI * Update CMakeLists.txt fix * Update CMakeLists.txt fix * remove tabulate dependency * Update README.md to remove tabulate pip install * Fix for CI machine failure * Add note on performance * Fix segmentation fault * Revert QAmode to restrict HIP bitdepths * Use Rpp64u for HOST while comparing outputs * Fix ambiguous abs call * Fix for SLES CI HIP fail - error: incompatible pointer types assigning to 'unsigned long *' from 'unsigned long long *' - refOutput = TensorSumReferenceOutputs[numChannels].data(); --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM Co-authored-by: Snehaa Giridharan Co-authored-by: Pavel Tcherniaev * Update rppt_tensor_arithmetic_operations.h * Update rppt_tensor_arithmetic_operations.h * Bump rocm-docs-core[api_reference] from 0.34.2 to 0.35.0 in /docs/sphinx (#313) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.34.2 to 0.35.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.34.2...v0.35.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * RPP Reduction - Tensor min and Tensor max on HOST and HIP (#260) * Minor Change * Add Validation check for DST_FOLDER path * added water HOST and HIP codes * added water case in test suite * added golden outputs for water * Add Validation checks for all options in testAllScript.sh * Add sanity check for dual Input cases Set Max Dimension and Max Image Dump Replaced Fast DCT tag with Accurate DCT * Regenerate golden outputs using accurate dct Flag Add golden outputs for some new augmentations * Fix Flip golden outputs mismatch Fix PLN3 variants mismatch in QA mode * Add MAX_BATCH_SIZE check removed Augmentations function calls for failing Qa modes code cleanup * Add crop and gamma correction augmentations code cleanup * Add comments to functions in rpp_test_suite_common.h * minor change * code cleanup * minor code changes * Change roi and Image sizes for crop augmentation * Change numIterations option to numRuns Addressed PR comments * added omp thread changes for water augmentation * experimental changes * fixed output issue with AVX2 instructions * added AVX2 support for PKD3 load function minor changes in PLN variant load functions * Add turboJpeg header to update maxHeight and maxWidth values * nwc commit - added avx2 changes for u8 layout toggle variants but need to add store functions for completion * Change the performance Timings logic * Add Avx2 implementation for F32 and U8 toggle variants * minor change to support u8_f16 and u8_f32 cases * Regenerate LUT golden outputs with ACCURATE_DCT tag * Minor code changes * Add AVX2 support for u8 pkd3-pln3 and i8 pkd3-pln3 for water augmentation * Made changes to the runTests.py in Host to remove testAllScipts.sh * Made changes to the runTests.py in HIP to remove testAllScipts.sh * Initial commit - Image min and max Reduction kernel Includes * u8 datatype for both min and max HOST Tensor of all variants. * Testsuite changes. * NWC -initial code for min max PLN3 - PLN3 * made changes to split min and max kernels seperately * splitted kernels for min and max * made changes to print final max/min in the R,G,B channels * fixed inaccuracies in min/max computation * made changes to typecast intermediate output to output requested by user added comments for the code code cleanup and minor changes in test suite * fixed build issues removed image folders used for min, max and sum reverted unwanted file changes * minor changes in test suite * removed support for unwanted test case in Tensor_hip.cpp * Adds new option roi * remove testAllScripts.sh * Adds roi Option in HIP backend * Implement f32 variants * Implement f16 and i8 datatype variants * change F32 load and store logic * Add build flags in CMakeLists.txt to set AVX/SSE flags based on the system configuration * minor code changes * Initial commit - Image sum Reduction kernel Includes u8 PLN1 -> PLN1 conversion for HOST Tensor * Implement PKD3 and PLN3 for Image sum Tensor HOST * Support i8, f16 and f32 datatypes * Initial commit - Image sum Reduction HIP kernel Includes u8 PLN1 -> PLN1 conversion for Tensor * Implement PKD3 and PLN3 for Image sum Tensor HIP * Add support in testsuite Revert normalization for i8 HOST Tensor variants * Fix HIP testsuite Remove additional blanks for 1 channel output * Modify print statement in HIP testsuite * Improve readability for testsuite outputs * optimized the store function for F32 PLN3-PKD3 * reverted back irrelevant changes * minor change * Fix HIP to support larger inputs * optimized load and store functions for water U8 and F32 variants in host removed commented code * Cleanup * removed golden outputs for water * minor changes * Cleanup Support Reduction QA test in testsuite * renamed few functions and removed unused functions updated i8 pln1 load as per the optimized u8 pln1 load * fixed bug in i8 load function * Remove unused variables and C style casting * changed cast to c++ style resolved spacing issues and added comments for AVX codes for better understanding made changes to handle cases where QA Tests are not supported * added golden outputs for water * updated golden outputs with latest changes * modified the u8, i8 pkd3-pln3 function and added comments for the vectorized code * fixed minor bug in I8 variants * Optimize u8 datatype further * Fix static_cast * made to changes to resolve codacy warnings * changed cast to c++ style in hip kernel * Initial commit - Ricap HOST Tensor Includes testsuite changes * Add QA tests for RICAP Used three_images_224x224_src1 folder to create golden outputs * Add three_images_224x224_src1 into TEST_IMAGES * added rotate case with golden outputs changed generic bilinear HOST codes to match with HIP codes * Add golden output for remaining all tensor augmentations * fix python script issues * Optimize u8 and i8 datatype Uses uint and int internal processing instead of float * Fix testsuite build errors * minor change * Fix QA check * Modify api naming from image_sum to tensor_sum Includes changes for both HOST and HIP * Support HIP Backend for RICAP * change rcm and rmn golden outputs * Fix HIP pkd3->pkd3 variant * changes based on review comments * change test_suite folder to tests * Optimize u8 and i8 datatype of HIP Includes modification in naming of shared memory * minor fix * changed generic nn F32 loads using gather and setr instructions * Optimize and cleanup U8 HIP * regenerated golden outputs for RICAP minor changes in HOST shell script for handling RICAP in QA mode * minor bug fix in RICAP HIP kernels * Fix i8 datatype variants Includes cleanup * Fix the issues with color_to_greyscale * remove the empty folder creation * reverting back the folder name change * minor change * added comments for latest changes * minor change * Improve readability and Cleanup * Fix QA for HIP Includes cleanup * resolved review comments * minor change * Modify api naming from image_ to tensor_ for HOST * Add support for QA tests * removed range check for RMN U8-F32 and U8-F16 variants changed from hipMemset to hipMemsetAsync for RMN HIP Kernel removed multiplication by 255 for stdDev in RMN HOST U8-F16 and U8-F32 variants * Modify naming of shared memory with _smem in HIP Includes cleanup * Typecast and reuse markArr for HIP U8 and I8 * Cleanup and minor optimization * minor fix * fix codacy warnings * Additional cleanup * Cleanup and move #define * Changed the complexity of if statements in runTests.py * Cleanup testsuite Includes new golden outputs * Additional testuite fixes * Minor cleanup * Codacy fixes * Fix codacy warnings * Codacy fix * Address other codacy warnings * cleanup * Change Image functions to generic * Update ricap.hpp with reference paper * resolved minor issues happened with merge * minor changes * fixed minor issue with getting profiler times * minor formatting changes * resolved build issues in test suite renamed the min and max kernel file names * RPP RICAP Tensor for HOST and HIP (#213) * Initial commit - Ricap HOST Tensor Includes testsuite changes * Add QA tests for RICAP Used three_images_224x224_src1 folder to create golden outputs * Add three_images_224x224_src1 into TEST_IMAGES * Support HIP Backend for RICAP * Fix HIP pkd3->pkd3 variant * regenerated golden outputs for RICAP minor changes in HOST shell script for handling RICAP in QA mode * minor bug fix in RICAP HIP kernels * Improve readability and Cleanup * Additional cleanup * Cleanup testsuite Includes new golden outputs * Additional testuite fixes * Minor cleanup * Fix codacy warnings * Address other codacy warnings * Update ricap.hpp with reference paper * Add RICAP dataset path in readme * Make changes to error codes returned * Modify roi crop region for unit and perf tests * RPP Tensor Water Augmentation on HOST and HIP (#181) * added water HOST and HIP codes * added water case in test suite * added golden outputs for water * added omp thread changes for water augmentation * experimental changes * fixed output issue with AVX2 instructions * added AVX2 support for PKD3 load function minor changes in PLN variant load functions * nwc commit - added avx2 changes for u8 layout toggle variants but need to add store functions for completion * Add Avx2 implementation for F32 and U8 toggle variants * Add AVX2 support for u8 pkd3-pln3 and i8 pkd3-pln3 for water augmentation * change F32 load and store logic * optimized the store function for F32 PLN3-PKD3 * reverted back irrelevant changes * minor change * optimized load and store functions for water U8 and F32 variants in host removed commented code * removed golden outputs for water * minor changes * renamed few functions and removed unused functions updated i8 pln1 load as per the optimized u8 pln1 load * fixed bug in i8 load function * changed cast to c++ style resolved spacing issues and added comments for AVX codes for better understanding made changes to handle cases where QA Tests are not supported * added golden outputs for water * updated golden outputs with latest changes * modified the u8, i8 pkd3-pln3 function and added comments for the vectorized code * fixed minor bug in I8 variants * made to changes to resolve codacy warnings * changed cast to c++ style in hip kernel * changed generic nn F32 loads using gather and setr instructions * added comments for latest changes * minor change * added definition for storing 32 and 64 bits from a 128bit register --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM * Fix build error * CMakeLists - Version Update 1.5.0 - TOT Version * CHANGELOG Updates Version 1.5.0 placeholder * Boost deps fix for test suite --------- Co-authored-by: Snehaa Giridharan Co-authored-by: sampath1117 Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: HazarathKumarM Co-authored-by: Kiriti Gowda * Documentation - Readme & changelog updates (#251) * readme and changelog updates for 6.0 * minor update * Documentation - Bump rocm-docs-core[api_reference] from 0.26.0 to 0.27.0 in /docs/sphinx (#253) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.26.0 to 0.27.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.26.0...v0.27.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * RPP Resize Mirror Normalize Bugfix (#252) * added fix for hipMemset * remove pixel check for U8-F32 and U8-F16 for HOST codes --------- Co-authored-by: sampath1117 * Cmake fix to prevent warning * Fix paths in new python scripts * Sphinx - updates (#257) * Sphinx - updates * Doxygen - Updates * Docs - Remove index.md * Test suite fixes after tensor_min / tensor_max HOST merge * Fix max case * QA tests fix for hip and host * naming convention changes as per new std * Substitute imagePartial with partial * Substitute imageMin/imageMax with min/max * Replace hipMemset with hipMemsetAsync, and replace hipDeviceSynchronize with hipStreamSynchronize * Use variable instead of batchCount*4 * Use post increment effectivly * Resolve codacy warnings * Additional cleanup * remove unused variable * Documentation - Bump rocm-docs-core[api_reference] from 0.28.0 to 0.29.0 in /docs/sphinx (#265) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.28.0 to 0.29.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.28.0...v0.29.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Remove auto merge boost * Spaces formatting * Bump rocm-docs-core[api_reference] from 0.29.0 to 0.30.1 in /docs/sphinx (#268) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.29.0 to 0.30.1. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.29.0...v0.30.1) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * add support for mi300 (#269) * Documentation - Bump rocm-docs-core[api_reference] from 0.30.1 to 0.30.2 in /docs/sphinx (#273) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.30.1 to 0.30.2. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.30.1...v0.30.2) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Cleanup by removing oneliner functions as inline * RPP Tensor Audio Support - To Decibels (#258) * Initial commit - Non slient region detection Includes unittest setup * Initial commit - To Decibels Includes unittest setup * Replace vectors with arrays * Cleanup * Replace Rpp64s with Rpp32s * Optimize and precompute cutOff * Fix buffer used * Fix buffer used * Additional Cleanup * Update testsuite for Audio * code cleanup * Add Readme file for Audio test suite * changes based on review comments * minor change * Remove unittest folders and updated README.md * Remove unit tests * minor change * code cleanup * added common header file for audio helper functions * removed unncessary audio wav files fixed bug in ROI updation for audio test suite resolved issue in summary generation for performance tests in python * removed log file * added doxygen support for audio * added doxygen changes for to_decibels * updated test suite support for to_decibels * minor change * removed the usage of getMax function and used std::max_element * modularized code in test suite * merge with latest changes * minor change * minor change * resolved codacy warnings * Codacy fix - Remove unused cpuTime * CMakeLists - Version Update 1.5.0 - TOT Version * CHANGELOG Updates Version 1.5.0 placeholder * resolved issue with file_system dependency in test suite * Doxygen changes changed malloc to new in NSR kernel * RPP RICAP Tensor for HOST and HIP (#213) * Initial commit - Ricap HOST Tensor Includes testsuite changes * Add QA tests for RICAP Used three_images_224x224_src1 folder to create golden outputs * Add three_images_224x224_src1 into TEST_IMAGES * Support HIP Backend for RICAP * Fix HIP pkd3->pkd3 variant * regenerated golden outputs for RICAP minor changes in HOST shell script for handling RICAP in QA mode * minor bug fix in RICAP HIP kernels * Improve readability and Cleanup * Additional cleanup * Cleanup testsuite Includes new golden outputs * Additional testuite fixes * Minor cleanup * Fix codacy warnings * Address other codacy warnings * Update ricap.hpp with reference paper * Add RICAP dataset path in readme * Make changes to error codes returned * Modify roi crop region for unit and perf tests * RPP Tensor Water Augmentation on HOST and HIP (#181) * added water HOST and HIP codes * added water case in test suite * added golden outputs for water * added omp thread changes for water augmentation * experimental changes * fixed output issue with AVX2 instructions * added AVX2 support for PKD3 load function minor changes in PLN variant load functions * nwc commit - added avx2 changes for u8 layout toggle variants but need to add store functions for completion * Add Avx2 implementation for F32 and U8 toggle variants * Add AVX2 support for u8 pkd3-pln3 and i8 pkd3-pln3 for water augmentation * change F32 load and store logic * optimized the store function for F32 PLN3-PKD3 * reverted back irrelevant changes * minor change * optimized load and store functions for water U8 and F32 variants in host removed commented code * removed golden outputs for water * minor changes * renamed few functions and removed unused functions updated i8 pln1 load as per the optimized u8 pln1 load * fixed bug in i8 load function * changed cast to c++ style resolved spacing issues and added comments for AVX codes for better understanding made changes to handle cases where QA Tests are not supported * added golden outputs for water * updated golden outputs with latest changes * modified the u8, i8 pkd3-pln3 function and added comments for the vectorized code * fixed minor bug in I8 variants * made to changes to resolve codacy warnings * changed cast to c++ style in hip kernel * changed generic nn F32 loads using gather and setr instructions * added comments for latest changes * minor change * added definition for storing 32 and 64 bits from a 128bit register --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM * Fix build error * CMakeLists - Version Update 1.5.0 - TOT Version * CHANGELOG Updates Version 1.5.0 placeholder * Boost deps fix for test suite --------- Co-authored-by: Snehaa Giridharan Co-authored-by: sampath1117 Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: HazarathKumarM Co-authored-by: Kiriti Gowda * Documentation - Readme & changelog updates (#251) * readme and changelog updates for 6.0 * minor update * added ctests for audio test suite for CI made changes to add more clarity on the QA Tests results * Cmake mods for ctest * HOST-only build error bugfix * added qa mode paramter to python audio script added golden output map for QA testing of Non silent region detection * minor change * Documentation - Bump rocm-docs-core[api_reference] from 0.26.0 to 0.27.0 in /docs/sphinx (#253) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.26.0 to 0.27.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.26.0...v0.27.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * RPP Resize Mirror Normalize Bugfix (#252) * added fix for hipMemset * remove pixel check for U8-F32 and U8-F16 for HOST codes --------- Co-authored-by: sampath1117 * added example for MMS calculation in comments for better understanding * Sphinx - updates (#257) * Sphinx - updates * Doxygen - Updates * Docs - Remove index.md * updated info used to for running audio test suite * removed bitdepth variable from audio test suite * added more information on computing NSR outputs in the example added * Fix doxygen for decibels Also removes extra QA reference files * Fix build errors and qa tests in Audio Test suite * Remove auto-merge repeated funcs * Improve clarity on header docs * made changes based on review comments * stored golden outputs of to_decibels in binary file removed golden output text files for non silent region * removed unused parameter in verify_output function * updated list of cases supported in python script * added error handling for opening golden output file * Codacy fix and tests warning fix * Codacy fix * Codacy fix trial * codacy fix for checking boundaries of fstream --------- Signed-off-by: dependabot[bot] Co-authored-by: Snehaa Giridharan Co-authored-by: HazarathKumarM Co-authored-by: sampath1117 Co-authored-by: Kiriti Gowda Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: Lisa Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Documentation - Bump rocm-docs-core[api_reference] from 0.30.2 to 0.30.3 in /docs/sphinx (#274) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.30.2 to 0.30.3. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.30.2...v0.30.3) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Adding issue template (#270) * Add files via upload * added ROCm v6, MI300, default component * Fix cast used in testsuite Includes minor fixes * Fix displaying f16 outputs * Optimize HOST min/max reduce function further * Fix spacing in HIP kernels * Fix PLN1 outputs for u8 and i8 datatypes of HOST backend * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * Bump rocm-docs-core[api_reference] from 0.31.0 to 0.33.0 in /docs/sphinx (#294) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.31.0 to 0.33.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.31.0...v0.33.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Store reference outputs via map for min and max kernels * Update tensor_max.hpp license * Update tensor_min.hpp license * Fix output comparison check * Merge branch 'ar/opt_tensor_min_tensor_max' of https://github.com/r-abishek/rpp into sn/tensor_min_max * Modify exit condition used in outer most kernel * Modify srcIdx for HIP Tensor min * Using maximum as 255 for HIP Tensor min * Modify srcIdx for HIP Tensor max kernel Also fixes build error in testsuite * Fix corrupted outputs displayed for Tensor sum * Fix corruption issue seen with tensor sum kernel * Fix minimum for I8 Tensor max kernel * Modified HIP buffer initialization with a common function * Fix redefinition * Remove additional variables xAlignedLength * Remove unwanted xAlignedLength and xDiff * Remove redefinition of TensorSumReferenceOutputs * Fix for CI issue * Add parenthesis --------- Signed-off-by: dependabot[bot] Co-authored-by: HazarathKumarM Co-authored-by: sampath1117 Co-authored-by: Snehaa Giridharan Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: fiona-gladwin Co-authored-by: Kiriti Gowda Co-authored-by: Lisa Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Lakshmi Kumar Co-authored-by: abhimeda <138710508+abhimeda@users.noreply.github.com> * CI - Update precheckin.groovy * Move bitwise operations into under logical ops * Fix doxygen comments * Merge with master * Cleanup * Revert change in CMakeLists.txt * Add docs outputs * Cleanup --------- Signed-off-by: dependabot[bot] Co-authored-by: Snehaa Giridharan Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sam Wu Co-authored-by: Kiriti Gowda Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: Lisa Co-authored-by: Sundarrajan98 Co-authored-by: Pavel Tcherniaev Co-authored-by: fiona-gladwin Co-authored-by: Lakshmi Kumar Co-authored-by: abhimeda <138710508+abhimeda@users.noreply.github.com> * fixed spacing in Doxygen * changes to match all 20 decimal places for normalize 2D HOST * fix spacing for params in normalize description * added more comments for better readbility minor modification in condition checks * removed extra semicolon * Combines flag for internal computation of mean and stddev for HOST Renames nDim, numDims to tensorDim and stores tensor dimension * rename numDims to tensorDims add comments for better understanding * combined compute mean and compute stddev into single variable in HIP codes * fix minor spacing issues for comments * Improve readability * modified function name for setup function used for 2d and 3d added space after if * added misc test suite command line instructions in readme * minor change in readme * Update CMakeLists.txt Version Upgrade * Bump rocm-docs-core[api_reference] from 0.38.1 to 1.0.0 in /docs/sphinx (#337) * Bump rocm-docs-core[api_reference] from 0.38.1 to 1.0.0 in /docs/sphinx Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.38.1 to 1.0.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.38.1...v1.0.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Use Python 3.10 in RTD config --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sam Wu * Bump rocm-docs-core[api_reference] from 1.0.0 to 1.1.0 in /docs/sphinx (#339) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 1.0.0 to 1.1.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v1.0.0...v1.1.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * RPP Gaussian Noise Voxel Tensor on HOST and HIP (#323) * License - updates to 2024 and consistency changes (#298) * Match all CMakeLists.txt license as per RPP's outermost LICENSE file * Match all python files' license as per RPP's outermost LICENSE file * Match all .hpp files' license as per RPP's outermost LICENSE file * Match all .cpp files' license as per RPP's outermost LICENSE file * Match all .h files' license as per RPP's outermost LICENSE file * Remove all rights reserved as per LICENSE file * Remove double space in "Copyright (c) 2019 - 2023 Advanced Micro Devices, Inc." * Match all .cmake files' license as per RPP's outermost LICENSE file * Match all .cpp.in files' license as per RPP's outermost LICENSE file * Replace 283 occurrences in 282 files - 2023 to 2024 * Add "MIT License" title to 281 instances * Add missing license * Test - Update README.md for test_suite (#299) * Bump rocm-docs-core[api_reference] from 0.33.0 to 0.33.1 in /docs/sphinx (#301) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.33.0 to 0.33.1. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.33.0...v0.33.1) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump rocm-docs-core[api_reference] from 0.33.1 to 0.33.2 in /docs/sphinx (#302) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.33.1 to 0.33.2. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.33.1...v0.33.2) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update doc codeowners (#303) * Documentation - Bump rocm-docs-core[api_reference] from 0.33.2 to 0.34.0 in /docs/sphinx (#304) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.33.2 to 0.34.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.33.2...v0.34.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Test suite - upgrade 5 qa perf (#305) * experimental changes for adding qa mode for performance tests * made changes to add display more information w.r.t QA results summary for performance tests * minor changes * Add changes to dump qa results to excel file * Add performance QA for three new tensor functions * update prerequisites in readme * added changes to handle unsupported cases * removed treshold dictionary and added performance Noise treshold add new dataset for performance QA * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * Changes to the performane summary dataframe * minor changes * Update CMakeLists.txt to add ${CMAKE_CURRENT_SOURCE_DIR} for CI * Update CMakeLists.txt fix * Update CMakeLists.txt fix * remove tabulate dependency * Update README.md to remove tabulate pip install * Fix for CI machine failure * Add note on performance --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM Co-authored-by: Abishek <52214183+r-abishek@users.noreply.github.com> Co-authored-by: Snehaa Giridharan Co-authored-by: r-abishek * RPP Color Temperature on HOST and HIP (#271) * Initial commit - Color Temperature HOST Tensor * Initial commit - Color Temperature HIP Tensor * Add color temperature golden outputs * address review comments * Use reinterpret_cast instead of static_cast * Combine templated functions to support all datatypes into one (got minor perf difference of order 3%) Also fixes indentation * Fix i8 datatype * Cleanup * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * Fix PLN3 variant outputs Also modifies reference outputs * Update color_temperature.hpp license * Delete color_temperature_u8_Tensor_PKD3.csv * Delete color_temperature_u8_Tensor_PLN3.csv --------- Co-authored-by: snehaa8 Co-authored-by: HazarathKumarM Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> * RPP Voxel 3D Tensor Add/Subtract scalar on HOST and HIP (#272) * added HOST support for voxel add kernel * added HIP support for voxel add kernel * added test suite support for add scalar * added Doxygen support and modified hip kernel function names as per new standard * added HOST support for voxel subtract kernel * added HIP support for voxel subtract kernel * added test suite support * updated the golden outputs for subtract with correct values * removed unnessary validation checks * Remove double spaces * Fix header * Fix all retval docs * Fix docs to add memory type * Fix comment * Add divider comment * Use post-increment efficiently * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * converted add and subtract scalar golden outputs to bin files * changed copyright from 2023 to 2024 * Update add_scalar.hpp license * Update subtract_scalar.hpp license --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM * RPP Magnitude on HOST and HIP (#278) * Initial commit - Magnitude HOST Tensor * Add QA reference outputs * Update runTests.py * Initial commit - Magnitude HIP Tensor * Add dual input support in testsuite * Optimize HOST kernel further * Optimize i8 datatype further * Modify comments * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * Bump rocm-docs-core[api_reference] from 0.31.0 to 0.33.0 in /docs/sphinx (#294) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.31.0 to 0.33.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.31.0...v0.33.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update Copywright year * Combine templated functions to support all datatypes * Modify format of reference outputs * Update rppi_arithmetic_operations.h license * Update rppt_tensor_arithmetic_operations.h license * Update host_tensor_arithmetic_operations.hpp * Update magnitude.hpp license * Update hip_tensor_arithmetic_operations.hpp license * Delete magnitude_u8_Tensor_PKD3.csv * Delete magnitude_u8_Tensor_PLN1.csv * Delete magnitude_u8_Tensor_PLN3.csv * Update rpp_test_suite_common.h license * Update runTests.py license * Update Tensor_hip.cpp license * Update runTests.py license * Update Tensor_host.cpp license --------- Signed-off-by: dependabot[bot] Co-authored-by: Snehaa Giridharan Co-authored-by: HazarathKumarM Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> * Bump rocm-docs-core[api_reference] from 0.34.0 to 0.34.2 in /docs/sphinx (#309) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.34.0 to 0.34.2. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.34.0...v0.34.2) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * RPP Tensor Audio Support - Down Mixing (#296) * Initial commit - Non slient region detection Includes unittest setup * Initial commit - To Decibels Includes unittest setup * Intial commit - pre_emphasis_filter * Intial commit - down_mixing * Replace vectors with arrays * Cleanup * Minor cleanup * Optimize downmixing Kernel Includes cleanup * Replace Rpp64s with Rpp32s * Cleanup * Optimize and precompute cutOff * Fix buffer used * Fix buffer used * Additional Cleanup * Optimize post incrmeent operation * Optimize post increment operation * Update testsuite for Audio * code cleanup * Add Readme file for Audio test suite * changes based on review comments * minor change * Remove unittest folders and updated README.md * Remove unit tests * minor change * code cleanup * added common header file for audio helper functions * removed unncessary audio wav files fixed bug in ROI updation for audio test suite resolved issue in summary generation for performance tests in python * removed log file * added doxygen support for audio * added doxygen changes for to_decibels * updated test suite support for to_decibels * minor change * added doxygen changes for preemphasis filter * updated changes for preemphasis filter in test suite * removed the usage of getMax function and used std::max_element * modularized code in test suite * merge with latest changes * minor change * minor change * minor change * resolved codacy warnings * Codacy fix - Remove unused cpuTime * CMakeLists - Version Update 1.5.0 - TOT Version * CHANGELOG Updates Version 1.5.0 placeholder * resolved issue with file_system dependency in test suite * Doxygen changes changed malloc to new in NSR kernel * RPP RICAP Tensor for HOST and HIP (#213) * Initial commit - Ricap HOST Tensor Includes testsuite changes * Add QA tests for RICAP Used three_images_224x224_src1 folder to create golden outputs * Add three_images_224x224_src1 into TEST_IMAGES * Support HIP Backend for RICAP * Fix HIP pkd3->pkd3 variant * regenerated golden outputs for RICAP minor changes in HOST shell script for handling RICAP in QA mode * minor bug fix in RICAP HIP kernels * Improve readability and Cleanup * Additional cleanup * Cleanup testsuite Includes new golden outputs * Additional testuite fixes * Minor cleanup * Fix codacy warnings * Address other codacy warnings * Update ricap.hpp with reference paper * Add RICAP dataset path in readme * Make changes to error codes returned * Modify roi crop region for unit and perf tests * RPP Tensor Water Augmentation on HOST and HIP (#181) * added water HOST and HIP codes * added water case in test suite * added golden outputs for water * added omp thread changes for water augmentation * experimental changes * fixed output issue with AVX2 instructions * added AVX2 support for PKD3 load function minor changes in PLN variant load functions * nwc commit - added avx2 changes for u8 layout toggle variants but need to add store functions for completion * Add Avx2 implementation for F32 and U8 toggle variants * Add AVX2 support for u8 pkd3-pln3 and i8 pkd3-pln3 for water augmentation * change F32 load and store logic * optimized the store function for F32 PLN3-PKD3 * reverted back irrelevant changes * minor change * optimized load and store functions for water U8 and F32 variants in host removed commented code * removed golden outputs for water * minor changes * renamed few functions and removed unused functions updated i8 pln1 load as per the optimized u8 pln1 load * fixed bug in i8 load function * changed cast to c++ style resolved spacing issues and added comments for AVX codes for better understanding made changes to handle cases where QA Tests are not supported * added golden outputs for water * updated golden outputs with latest changes * modified the u8, i8 pkd3-pln3 function and added comments for the vectorized code * fixed minor bug in I8 variants * made to changes to resolve codacy warnings * changed cast to c++ style in hip kernel * changed generic nn F32 loads using gather and setr instructions * added comments for latest changes * minor change * added definition for storing 32 and 64 bits from a 128bit register --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM * Fix build error * CMakeLists - Version Update 1.5.0 - TOT Version * CHANGELOG Updates Version 1.5.0 placeholder * Boost deps fix for test suite --------- Co-authored-by: Snehaa Giridharan Co-authored-by: sampath1117 Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: HazarathKumarM Co-authored-by: Kiriti Gowda * Documentation - Readme & changelog updates (#251) * readme and changelog updates for 6.0 * minor update * added ctests for audio test suite for CI made changes to add more clarity on the QA Tests results * Cmake mods for ctest * HOST-only build error bugfix * added qa mode paramter to python audio script added golden output map for QA testing of Non silent region detection * minor change * Documentation - Bump rocm-docs-core[api_reference] from 0.26.0 to 0.27.0 in /docs/sphinx (#253) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.26.0 to 0.27.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.26.0...v0.27.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * RPP Resize Mirror Normalize Bugfix (#252) * added fix for hipMemset * remove pixel check for U8-F32 and U8-F16 for HOST codes --------- Co-authored-by: sampath1117 * added example for MMS calculation in comments for better understanding * Sphinx - updates (#257) * Sphinx - updates * Doxygen - Updates * Docs - Remove index.md * updated info used to for running audio test suite * removed bitdepth variable from audio test suite * added more information on computing NSR outputs in the example added * Fix doxygen for decibels Also removes extra QA reference files * move tensor_host_audio.cpp to host folder * Fix build errors and qa tests in Audio Test suite * Fix build errors and qa tests in Audio Test suite * Add reference output and test samples for downmix * Add down_mix in augmentation list and supported cases * Remove auto-merge repeated funcs * Improve clarity of header docs * Remove blank line * Improve clarity on header docs * Add Doxygen comments * minor change * converted golden outputs to binary file for downmixing * removed old golden output file for preemphasis and todecibels * modified info for downmixing as per new changes used handle memory for temporary buffers * formatting changes * moved the common code for SSE and AVX to outside * Update down_mixing.hpp license * Update rppt_tensor_audio_augmentations.h * combined the srcLength and channels tensors into single tensor --------- Signed-off-by: dependabot[bot] Co-authored-by: Snehaa Giridharan Co-authored-by: HazarathKumarM Co-authored-by: sampath1117 Co-authored-by: Kiriti Gowda Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: Lisa Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sundarrajan98 * RPP Voxel 3D Tensor Multiply scalar on HOST and HIP (#306) * added HIP support for voxel scalar multiply kernel * added HOST support for voxel multiply kernel added golden outputs for voxel multiply kernel * merge with master * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * converted multiply scalar voxel golden outputs to bin files * changed copyright from 2023 to 2024 --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM * Test Suite Bugfix (#307) * experimental changes for adding qa mode for performance tests * made changes to add display more information w.r.t QA results summary for performance tests * minor changes * Add changes to dump qa results to excel file * Add performance QA for three new tensor functions * update prerequisites in readme * added changes to handle unsupported cases * removed treshold dictionary and added performance Noise treshold add new dataset for performance QA * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * Changes to the performane summary dataframe * minor changes * Update CMakeLists.txt to add ${CMAKE_CURRENT_SOURCE_DIR} for CI * Update CMakeLists.txt fix * Update CMakeLists.txt fix * remove tabulate dependency * Update README.md to remove tabulate pip install * Fix for CI machine failure * Add note on performance * Fix segmentation fault * Revert QAmode to restrict HIP bitdepths * Use Rpp64u for HOST while comparing outputs * Fix ambiguous abs call * Fix for SLES CI HIP fail - error: incompatible pointer types assigning to 'unsigned long *' from 'unsigned long long *' - refOutput = TensorSumReferenceOutputs[numChannels].data(); --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM Co-authored-by: Snehaa Giridharan Co-authored-by: Pavel Tcherniaev * Initial commit * Merge changes and fixes for gaussian noise 3d * Test suite merge and fixes for gaussian noise 3d * added initial support for gaussian noise HOST NDHWC variant * added NCDHW support * added u8 and i8 bitdepth support * updated gaussian noise voxel host outer api to match with hip api merged gaussian noise voxel kernel codes in 2d kernel codes * resolved black pixels issue across border * minor changes * modified HIP kernel as per the latest changes * modified the description as per the latest changes * made changes in test suite * added new host compute functions for gaussian noise 3d * Bump rocm-docs-core[api_reference] from 0.35.0 to 0.35.1 in /docs/sphinx (#319) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.35.0 to 0.35.1. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.35.0...v0.35.1) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * moved the copy 3d function to rpp_cpu_common.hpp * reverted incorrect changes happened with merge * fix test suite issue with RMN * revert incorrect merge changes remove empty blank lines * modify suffix from 3d to voxel for gaussian noise added U8 support for gaussian noise HIP voxel kernel * added separate copy kernel for copying input to output when mean and stddev passed is 0 * Bump rocm-docs-core[api_reference] from 0.35.1 to 0.36.0 in /docs/sphinx (#322) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.35.1 to 0.36.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.35.1...v0.36.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fixed bug in test suite * Docs - Bump rocm-docs-core[api_reference] from 0.36.0 to 0.37.0 in /docs/sphinx (#328) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.36.0 to 0.37.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.36.0...v0.37.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Link cleanup (#326) * link updates * update tables * pare down index * API cleanup * consistency * verbiage * Update notes * change function name from CHECK to CHECK_RETURN_STATUS * Docs - Bump rocm-docs-core[api_reference] from 0.37.0 to 0.37.1 in /docs/sphinx (#329) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.37.0 to 0.37.1. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.37.0...v0.37.1) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * RPP Voxel Flip on HIP and HOST (#285) * added support for flip voxel * added test suite support * added golden outputs for flip voxel made changes in test suite to run QA tests for flip * updated golden outputs with correct values * minor bug fix in the hip test suite * made changes to variable names for better readability fixed comments in test suite minor cleanup * combined the flip axis factor as ternary operator in HIP kernel added new enum for error handling when source and destination layouts are not matching * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * converted flip voxel golden outputs to bin files * changed copyright from 2023 to 2024 * Update flip_voxel.hpp license * License - updates to 2024 and consistency changes (#298) * Match all CMakeLists.txt license as per RPP's outermost LICENSE file * Match all python files' license as per RPP's outermost LICENSE file * Match all .hpp files' license as per RPP's outermost LICENSE file * Match all .cpp files' license as per RPP's outermost LICENSE file * Match all .h files' license as per RPP's outermost LICENSE file * Remove all rights reserved as per LICENSE file * Remove double space in "Copyright (c) 2019 - 2023 Advanced Micro Devices, Inc." * Match all .cmake files' license as per RPP's outermost LICENSE file * Match all .cpp.in files' license as per RPP's outermost LICENSE file * Replace 283 occurrences in 282 files - 2023 to 2024 * Add "MIT License" title to 281 instances * Add missing license * Test - Update README.md for test_suite (#299) * Bump rocm-docs-core[api_reference] from 0.33.0 to 0.33.1 in /docs/sphinx (#301) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.33.0 to 0.33.1. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.33.0...v0.33.1) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump rocm-docs-core[api_reference] from 0.33.1 to 0.33.2 in /docs/sphinx (#302) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.33.1 to 0.33.2. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.33.1...v0.33.2) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update doc codeowners (#303) * Documentation - Bump rocm-docs-core[api_reference] from 0.33.2 to 0.34.0 in /docs/sphinx (#304) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.33.2 to 0.34.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.33.2...v0.34.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Test suite - upgrade 5 qa perf (#305) * experimental changes for adding qa mode for performance tests * made changes to add display more information w.r.t QA results summary for performance tests * minor changes * Add changes to dump qa results to excel file * Add performance QA for three new tensor functions * update prerequisites in readme * added changes to handle unsupported cases * removed treshold dictionary and added performance Noise treshold add new dataset for performance QA * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * Changes to the performane summary dataframe * minor changes * Update CMakeLists.txt to add ${CMAKE_CURRENT_SOURCE_DIR} for CI * Update CMakeLists.txt fix * Update CMakeLists.txt fix * remove tabulate dependency * Update README.md to remove tabulate pip install * Fix for CI machine failure * Add note on performance --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM Co-authored-by: Abishek <52214183+r-abishek@users.noreply.github.com> Co-authored-by: Snehaa Giridharan Co-authored-by: r-abishek * RPP Color Temperature on HOST and HIP (#271) * Initial commit - Color Temperature HOST Tensor * Initial commit - Color Temperature HIP Tensor * Add color temperature golden outputs * address review comments * Use reinterpret_cast instead of static_cast * Combine templated functions to support all datatypes into one (got minor perf difference of order 3%) Also fixes indentation * Fix i8 datatype * Cleanup * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * Fix PLN3 variant outputs Also modifies reference outputs * Update color_temperature.hpp license * Delete color_temperature_u8_Tensor_PKD3.csv * Delete color_temperature_u8_Tensor_PLN3.csv --------- Co-authored-by: snehaa8 Co-authored-by: HazarathKumarM Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> * RPP Voxel 3D Tensor Add/Subtract scalar on HOST and HIP (#272) * added HOST support for voxel add kernel * added HIP support for voxel add kernel * added test suite support for add scalar * added Doxygen support and modified hip kernel function names as per new standard * added HOST support for voxel subtract kernel * added HIP support for voxel subtract kernel * added test suite support * updated the golden outputs for subtract with correct values * removed unnessary validation checks * Remove double spaces * Fix header * Fix all retval docs * Fix docs to add memory type * Fix comment * Add divider comment * Use post-increment efficiently * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * converted add and subtract scalar golden outputs to bin files * changed copyright from 2023 to 2024 * Update add_scalar.hpp license * Update subtract_scalar.hpp license --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM * RPP Magnitude on HOST and HIP (#278) * Initial commit - Magnitude HOST Tensor * Add QA reference outputs * Update runTests.py * Initial commit - Magnitude HIP Tensor * Add dual input support in testsuite * Optimize HOST kernel further * Optimize i8 datatype further * Modify comments * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * Bump rocm-docs-core[api_reference] from 0.31.0 to 0.33.0 in /docs/sphinx (#294) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.31.0 to 0.33.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.31.0...v0.33.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update Copywright year * Combine templated functions to support all datatypes * Modify format of reference outputs * Update rppi_arithmetic_operations.h license * Update rppt_tensor_arithmetic_operations.h license * Update host_tensor_arithmetic_operations.hpp * Update magnitude.hpp license * Update hip_tensor_arithmetic_operations.hpp license * Delete magnitude_u8_Tensor_PKD3.csv * Delete magnitude_u8_Tensor_PLN1.csv * Delete magnitude_u8_Tensor_PLN3.csv * Update rpp_test_suite_common.h license * Update runTests.py license * Update Tensor_hip.cpp license * Update runTests.py license * Update Tensor_host.cpp license --------- Signed-off-by: dependabot[bot] Co-authored-by: Snehaa Giridharan Co-authored-by: HazarathKumarM Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> * Bump rocm-docs-core[api_reference] from 0.34.0 to 0.34.2 in /docs/sphinx (#309) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.34.0 to 0.34.2. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.34.0...v0.34.2) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * RPP Tensor Audio Support - Down Mixing (#296) * Initial commit - Non slient region detection Includes unittest setup * Initial commit - To Decibels Includes unittest setup * Intial commit - pre_emphasis_filter * Intial commit - down_mixing * Replace vectors with arrays * Cleanup * Minor cleanup * Optimize downmixing Kernel Includes cleanup * Replace Rpp64s with Rpp32s * Cleanup * Optimize and precompute cutOff * Fix buffer used * Fix buffer used * Additional Cleanup * Optimize post incrmeent operation * Optimize post increment operation * Update testsuite for Audio * code cleanup * Add Readme file for Audio test suite * changes based on review comments * minor change * Remove unittest folders and updated README.md * Remove unit tests * minor change * code cleanup * added common header file for audio helper functions * removed unncessary audio wav files fixed bug in ROI updation for audio test suite resolved issue in summary generation for performance tests in python * removed log file * added doxygen support for audio * added doxygen changes for to_decibels * updated test suite support for to_decibels * minor change * added doxygen changes for preemphasis filter * updated changes for preemphasis filter in test suite * removed the usage of getMax function and used std::max_element * modularized code in test suite * merge with latest changes * minor change * minor change * minor change * resolved codacy warnings * Codacy fix - Remove unused cpuTime * CMakeLists - Version Update 1.5.0 - TOT Version * CHANGELOG Updates Version 1.5.0 placeholder * resolved issue with file_system dependency in test suite * Doxygen changes changed malloc to new in NSR kernel * RPP RICAP Tensor for HOST and HIP (#213) * Initial commit - Ricap HOST Tensor Includes testsuite changes * Add QA tests for RICAP Used three_images_224x224_src1 folder to create golden outputs * Add three_images_224x224_src1 into TEST_IMAGES * Support HIP Backend for RICAP * Fix HIP pkd3->pkd3 variant * regenerated golden outputs for RICAP minor changes in HOST shell script for handling RICAP in QA mode * minor bug fix in RICAP HIP kernels * Improve readability and Cleanup * Additional cleanup * Cleanup testsuite Includes new golden outputs * Additional testuite fixes * Minor cleanup * Fix codacy warnings * Address other codacy warnings * Update ricap.hpp with reference paper * Add RICAP dataset path in readme * Make changes to error codes returned * Modify roi crop region for unit and perf tests * RPP Tensor Water Augmentation on HOST and HIP (#181) * added water HOST and HIP codes * added water case in test suite * added golden outputs for water * added omp thread changes for water augmentation * experimental changes * fixed output issue with AVX2 instructions * added AVX2 support for PKD3 load function minor changes in PLN variant load functions * nwc commit - added avx2 changes for u8 layout toggle variants but need to add store functions for completion * Add Avx2 implementation for F32 and U8 toggle variants * Add AVX2 support for u8 pkd3-pln3 and i8 pkd3-pln3 for water augmentation * change F32 load and store logic * optimized the store function for F32 PLN3-PKD3 * reverted back irrelevant changes * minor change * optimized load and store functions for water U8 and F32 variants in host removed commented code * removed golden outputs for water * minor changes * renamed few functions and removed unused functions updated i8 pln1 load as per the optimized u8 pln1 load * fixed bug in i8 load function * changed cast to c++ style resolved spacing issues and added comments for AVX codes for better understanding made changes to handle cases where QA Tests are not supported * added golden outputs for water * updated golden outputs with latest changes * modified the u8, i8 pkd3-pln3 function and added comments for the vectorized code * fixed minor bug in I8 variants * made to changes to resolve codacy warnings * changed cast to c++ style in hip kernel * changed generic nn F32 loads using gather and setr instructions * added comments for latest changes * minor change * added definition for storing 32 and 64 bits from a 128bit register --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM * Fix build error * CMakeLists - Version Update 1.5.0 - TOT Version * CHANGELOG Updates Version 1.5.0 placeholder * Boost deps fix for test suite --------- Co-authored-by: Snehaa Giridharan Co-authored-by: sampath1117 Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: HazarathKumarM Co-authored-by: Kiriti Gowda * Documentation - Readme & changelog updates (#251) * readme and changelog updates for 6.0 * minor update * added ctests for audio test suite for CI made changes to add more clarity on the QA Tests results * Cmake mods for ctest * HOST-only build error bugfix * added qa mode paramter to python audio script added golden output map for QA testing of Non silent region detection * minor change * Documentation - Bump rocm-docs-core[api_reference] from 0.26.0 to 0.27.0 in /docs/sphinx (#253) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.26.0 to 0.27.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.26.0...v0.27.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * RPP Resize Mirror Normalize Bugfix (#252) * added fix for hipMemset * remove pixel check for U8-F32 and U8-F16 for HOST codes --------- Co-authored-by: sampath1117 * added example for MMS calculation in comments for better understanding * Sphinx - updates (#257) * Sphinx - updates * Doxygen - Updates * Docs - Remove index.md * updated info used to for running audio test suite * removed bitdepth variable from audio test suite * added more information on computing NSR outputs in the example added * Fix doxygen for decibels Also removes extra QA reference files * move tensor_host_audio.cpp to host folder * Fix build errors and qa tests in Audio Test suite * Fix build errors and qa tests in Audio Test suite * Add reference output and test samples for downmix * Add down_mix in augmentation list and supported cases * Remove auto-merge repeated funcs * Improve clarity of header docs * Remove blank line * Improve clarity on header docs * Add Doxygen comments * minor change * converted golden outputs to binary file for downmixing * removed old golden output file for preemphasis and todecibels * modified info for downmixing as per new changes used handle memory for temporary buffers * formatting changes * moved the common code for SSE and AVX to outside * Update down_mixing.hpp license * Update rppt_tensor_audio_augmentations.h * combined the srcLength and channels tensors into single tensor --------- Signed-off-by: dependabot[bot] Co-authored-by: Snehaa Giridharan Co-authored-by: HazarathKumarM Co-authored-by: sampath1117 Co-authored-by: Kiriti Gowda Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: Lisa Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sundarrajan98 * RPP Voxel 3D Tensor Multiply scalar on HOST and HIP (#306) * added HIP support for voxel scalar multiply kernel * added HOST support for voxel multiply kernel added golden outputs for voxel multiply kernel * merge with master * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * converted multiply scalar voxel golden outputs to bin files * changed copyright from 2023 to 2024 --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM * Test Suite Bugfix (#307) * experimental changes for adding qa mode for performance tests * made changes to add display more information w.r.t QA results summary for performance tests * minor changes * Add changes to dump qa results to excel file * Add performance QA for three new tensor functions * update prerequisites in readme * added changes to handle unsupported cases * removed treshold dictionary and added performance Noise treshold add new dataset for performance QA * RPP Test Suite Upgrade 4 - CSV to BIN conversions for file size reduction (#293) * change golden outputs from .csv files to .bin files * Changed comparision funtions to use .bin files * Address review comments * minor change * Address review comments * minor change --------- Co-authored-by: HazarathKumarM * Changes to the performane summary dataframe * minor changes * Update CMakeLists.txt to add ${CMAKE_CURRENT_SOURCE_DIR} for CI * Update CMakeLists.txt fix * Update CMakeLists.txt fix * remove tabulate dependency * Update README.md to remove tabulate pip install * Fix for CI machine failure * Add note on performance * Fix segmentation fault * Revert QAmode to restrict HIP bitdepths * Use Rpp64u for HOST while comparing outputs * Fix ambiguous abs call * Fix for SLES CI HIP fail - error: incompatible pointer types assigning to 'unsigned long *' from 'unsigned long long *' - refOutput = TensorSumReferenceOutputs[numChannels].data(); --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM Co-authored-by: Snehaa Giridharan Co-authored-by: Pavel Tcherniaev * Bump rocm-docs-core[api_reference] from 0.34.2 to 0.35.0 in /docs/sphinx (#313) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.34.2 to 0.35.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.34.2...v0.35.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * RPP Reduction - Tensor min and Tensor max on HOST and HIP (#260) * Minor Change * Add Validation check for DST_FOLDER path * added water HOST and HIP codes * added water case in test suite * added golden outputs for water * Add Validation checks for all options in testAllScript.sh * Add sanity check for dual Input cases Set Max Dimension and Max Image Dump Replaced Fast DCT tag with Accurate DCT * Regenerate golden outputs using accurate dct Flag Add golden outputs for some new augmentations * Fix Flip golden outputs mismatch Fix PLN3 variants mismatch in QA mode * Add MAX_BATCH_SIZE check removed Augmentations function calls for failing Qa modes code cleanup * Add crop and gamma correction augmentations code cleanup * Add comments to functions in rpp_test_suite_common.h * minor change * code cleanup * minor code changes * Change roi and Image sizes for crop augmentation * Change numIterations option to numRuns Addressed PR comments * added omp thread changes for water augmentation * experimental changes * fixed output issue with AVX2 instructions * added AVX2 support for PKD3 load function minor changes in PLN variant load functions * Add turboJpeg header to update maxHeight and maxWidth values * nwc commit - added avx2 changes for u8 layout toggle variants but need to add store functions for completion * Change the performance Timings logic * Add Avx2 implementation for F32 and U8 toggle variants * minor change to support u8_f16 and u8_f32 cases * Regenerate LUT golden outputs with ACCURATE_DCT tag * Minor code changes * Add AVX2 support for u8 pkd3-pln3 and i8 pkd3-pln3 for water augmentation * Made changes to the runTests.py in Host to remove testAllScipts.sh * Made changes to the runTests.py in HIP to remove testAllScipts.sh * Initial commit - Image min and max Reduction kernel Includes * u8 datatype for both min and max HOST Tensor of all variants. * Testsuite changes. * NWC -initial code for min max PLN3 - PLN3 * made changes to split min and max kernels seperately * splitted kernels for min and max * made changes to print final max/min in the R,G,B channels * fixed inaccuracies in min/max computation * made changes to typecast intermediate output to output requested by user added comments for the code code cleanup and minor changes in test suite * fixed build issues removed image folders used for min, max and sum reverted unwanted file changes * minor changes in test suite * removed support for unwanted test case in Tensor_hip.cpp * Adds new option roi * remove testAllScripts.sh * Adds roi Option in HIP backend * Implement f32 variants * Implement f16 and i8 datatype variants * change F32 load and store logic * Add build flags in CMakeLists.txt to set AVX/SSE flags based on the system configuration * minor code changes * Initial commit - Image sum Reduction kernel Includes u8 PLN1 -> PLN1 conversion for HOST Tensor * Implement PKD3 and PLN3 for Image sum Tensor HOST * Support i8, f16 and f32 datatypes * Initial commit - Image sum Reduction HIP kernel Includes u8 PLN1 -> PLN1 conversion for Tensor * Implement PKD3 and PLN3 for Image sum Tensor HIP * Add support in testsuite Revert normalization for i8 HOST Tensor variants * Fix HIP testsuite Remove additional blanks for 1 channel output * Modify print statement in HIP testsuite * Improve readability for testsuite outputs * optimized the store function for F32 PLN3-PKD3 * reverted back irrelevant changes * minor change * Fix HIP to support larger inputs * optimized load and store functions for water U8 and F32 variants in host removed commented code * Cleanup * removed golden outputs for water * minor changes * Cleanup Support Reduction QA test in testsuite * renamed few functions and removed unused functions updated i8 pln1 load as per the optimized u8 pln1 load * fixed bug in i8 load function * Remove unused variables and C style casting * changed cast to c++ style resolved spacing issues and added comments for AVX codes for better understanding made changes to handle cases where QA Tests are not supported * added golden outputs for water * updated golden outputs with latest changes * modified the u8, i8 pkd3-pln3 function and added comments for the vectorized code * fixed minor bug in I8 variants * Optimize u8 datatype further * Fix static_cast * made to changes to resolve codacy warnings * changed cast to c++ style in hip kernel * Initial commit - Ricap HOST Tensor Includes testsuite changes * Add QA tests for RICAP Used three_images_224x224_src1 folder to create golden outputs * Add three_images_224x224_src1 into TEST_IMAGES * added rotate case with golden outputs changed generic bilinear HOST codes to match with HIP codes * Add golden output for remaining all tensor augmentations * fix python script issues * Optimize u8 and i8 datatype Uses uint and int internal processing instead of float * Fix testsuite build errors * minor change * Fix QA check * Modify api naming from image_sum to tensor_sum Includes changes for both HOST and HIP * Support HIP Backend for RICAP * change rcm and rmn golden outputs * Fix HIP pkd3->pkd3 variant * changes based on review comments * change test_suite folder to tests * Optimize u8 and i8 datatype of HIP Includes modification in naming of shared memory * minor fix * changed generic nn F32 loads using gather and setr instructions * Optimize and cleanup U8 HIP * regenerated golden outputs for RICAP minor changes in HOST shell script for handling RICAP in QA mode * minor bug fix in RICAP HIP kernels * Fix i8 datatype variants Includes cleanup * Fix the issues with color_to_greyscale * remove the empty folder creation * reverting back the folder name change * minor change * added comments for latest changes * minor change * Improve readability and Cleanup * Fix QA for HIP Includes cleanup * resolved review comments * minor change * Modify api naming from image_ to tensor_ for HOST * Add support for QA tests * removed range check for RMN U8-F32 and U8-F16 variants changed from hipMemset to hipMemsetAsync for RMN HIP Kernel removed multiplication by 255 for stdDev in RMN HOST U8-F16 and U8-F32 variants * Modify naming of shared memory with _smem in HIP Includes cleanup * Typecast and reuse markArr for HIP U8 and I8 * Cleanup and minor optimization * minor fix * fix codacy warnings * Additional cleanup * Cleanup and move #define * Changed the complexity of if statements in runTests.py * Cleanup testsuite Includes new golden outputs * Additional testuite fixes * Minor cleanup * Codacy fixes * Fix codacy warnings * Codacy fix * Address other codacy warnings * cleanup * Change Image functions to generic * Update ricap.hpp with reference paper * resolved minor issues happened with merge * minor changes * fixed minor issue with getting profiler times * minor formatting changes * resolved build issues in test suite renamed the min and max kernel file names * RPP RICAP Tensor for HOST and HIP (#213) * Initial commit - Ricap HOST Tensor Includes testsuite changes * Add QA tests for RICAP Used three_images_224x224_src1 folder to create golden outputs * Add three_images_224x224_src1 into TEST_IMAGES * Support HIP Backend for RICAP * Fix HIP pkd3->pkd3 variant * regenerated golden outputs for RICAP minor changes in HOST shell script for handling RICAP in QA mode * minor bug fix in RICAP HIP kernels * Improve readability and Cleanup * Additional cleanup * Cleanup testsuite Includes new golden outputs * Additional testuite fixes * Minor cleanup * Fix codacy warnings * Address other codacy warnings * Update ricap.hpp with reference paper * Add RICAP dataset path in readme * Make changes to error codes returned * Modify roi crop region for unit and perf tests * RPP Tensor Water Augmentation on HOST and HIP (#181) * added water HOST and HIP codes * added water case in test suite * added golden outputs for water * added omp thread changes for water augmentation * experimental changes * fixed output issue with AVX2 instructions * added AVX2 support for PKD3 load function minor changes in PLN variant load functions * nwc commit - added avx2 changes for u8 layout toggle variants but need to add store functions for completion * Add Avx2 implementation for F32 and U8 toggle variants * Add AVX2 support for u8 pkd3-pln3 and i8 pkd3-pln3 for water augmentation * change F32 load and store logic * optimized the store function for F32 PLN3-PKD3 * reverted back irrelevant changes * minor change * optimized load and store functions for water U8 and F32 variants in host removed commented code * removed golden outputs for water * minor changes * renamed few functions and removed unused functions updated i8 pln1 load as per the optimized u8 pln1 load * fixed bug in i8 load function * changed cast to c++ style resolved spacing issues and added comments for AVX codes for better understanding made changes to handle cases where QA Tests are not supported * added golden outputs for water * updated golden outputs with latest changes * modified the u8, i8 pkd3-pln3 function and added comments for the vectorized code * fixed minor bug in I8 variants * made to changes to resolve codacy warnings * changed cast to c++ style in hip kernel * changed generic nn F32 loads using gather and setr instructions * added comments for latest changes * minor change * added definition for storing 32 and 64 bits from a 128bit register --------- Co-authored-by: sampath1117 Co-authored-by: HazarathKumarM * Fix build error * CMakeLists - Version Update 1.5.0 - TOT Version * CHANGELOG Updates Version 1.5.0 placeholder * Boost deps fix for test suite --------- Co-authored-by: Snehaa Giridharan Co-authored-by: sampath1117 Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: HazarathKumarM Co-authored-by: Kiriti Gowda * Documentation - Readme & changelog updates (#251) * readme and changelog updates for 6.0 * minor update * Documentation - Bump rocm-docs-core[api_reference] from 0.26.0 to 0.27.0 in /docs/sphinx (#253) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.26.0 to 0.27.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.26.0...v0.27.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * RPP Resize Mirror Normalize Bugfix (#252) * added fix for hipMemset * remove pixel check for U8-F32 and U8-F16 for HOST codes --------- Co-authored-by: sampath1117 * Cmake fix to prevent warning * Fix paths in new python scripts * Sphinx - updates (#257) * Sphinx - updates * Doxygen - Updates * Docs - Remove index.md * Test suite fixes after tensor_min / tensor_max HOST merge * Fix max case * QA tests fix for hip and host * naming convention changes as per new std * Substitute imagePartial with partial * Substitute imageMin/imageMax with min/max * Replace hipMemset with hipMemsetAsync, and replace hipDeviceSynchronize with hipStreamSynchronize * Use variable instead of batchCount*4 * Use post increment effectivly * Resolve codacy warnings * Additional cleanup * remove unused variable * Documentation - Bump rocm-docs-core[api_reference] from 0.28.0 to 0.29.0 in /docs/sphinx (#265) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.28.0 to 0.29.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.28.0...v0.29.0) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Remove auto merge boost * Spaces formatting * Bump rocm-docs-core[api_reference] from 0.29.0 to 0.30.1 in /docs/sphinx (#268) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.29.0 to 0.30.1. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.29.0...v0.30.1) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * add support for mi300 (#269) * Documentation - Bump rocm-docs-core[api_reference] from 0.30.1 to 0.30.2 in /docs/sphinx (#273) Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.30.1 to 0.30.2. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.30.1...v0.30.2) --- updated-dependencies: - dependency-name: rocm-docs-core[api_reference] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Cleanup by removing oneliner functions as inline * RPP Tensor Audio Support - To Decibels (#258) * Initial commit - Non slient region detection Includes unittest setup * Initial commit - To Decibels Includes unittest setup * Replace vectors with arrays * Cleanup * Replace Rpp64s with Rpp32s * Optimize and precompute cutOff * Fix buff… * modified CHECK to CHECK_RETURN_STATUS in HIP test suites * bugfix --------- Signed-off-by: dependabot[bot] Co-authored-by: Snehaa Giridharan Co-authored-by: sampath1117 Co-authored-by: Snehaa-Giridharan <118163708+snehaa8@users.noreply.github.com> Co-authored-by: Kiriti Gowda Co-authored-by: HazarathKumarM Co-authored-by: Lisa Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sam Wu Co-authored-by: Sundarrajan98 Co-authored-by: Pavel Tcherniaev Co-authored-by: fiona-gladwin Co-authored-by: Lakshmi Kumar Co-authored-by: abhimeda <138710508+abhimeda@users.noreply.github.com> Co-authored-by: randyh62 <42045079+randyh62@users.noreply.github.com> --- include/rppdefs.h | 1 + include/rppt_tensor_statistical_operations.h | 43 + src/include/cpu/rpp_cpu_simd.hpp | 121 ++ src/modules/CMakeLists.txt | 3 + .../host_tensor_statistical_operations.hpp | 3 +- src/modules/cpu/kernel/normalize.hpp | 882 ++++++++ .../hip/hip_tensor_statistical_operations.hpp | 1 + src/modules/hip/kernel/normalize.hpp | 1921 +++++++++++++++++ src/modules/rppi_validate.hpp | 8 +- .../rppt_tensor_statistical_operations.cpp | 193 +- utilities/test_suite/CMakeLists.txt | 4 +- utilities/test_suite/HIP/CMakeLists.txt | 2 + utilities/test_suite/HIP/Tensor_misc_hip.cpp | 231 ++ utilities/test_suite/HIP/runMiscTests.py | 281 +++ utilities/test_suite/HIP/runTests.py | 99 +- .../{runTests_voxel.py => runVoxelTests.py} | 147 +- utilities/test_suite/HOST/CMakeLists.txt | 6 +- ...r_host_audio.cpp => Tensor_audio_host.cpp} | 2 +- .../test_suite/HOST/Tensor_misc_host.cpp | 193 ++ utilities/test_suite/HOST/runAudioTests.py | 77 +- utilities/test_suite/HOST/runMiscTests.py | 197 ++ utilities/test_suite/HOST/runTests.py | 54 +- .../{runTests_voxel.py => runVoxelTests.py} | 111 +- .../test_suite/NORMALIZE/input/2d_input.bin | Bin 0 -> 120000 bytes .../NORMALIZE/input/2d_mean_std.bin | Bin 0 -> 1608 bytes .../test_suite/NORMALIZE/input/3d_input.bin | Bin 0 -> 240000 bytes .../NORMALIZE/input/3d_mean_std.bin | Bin 0 -> 27272 bytes .../test_suite/NORMALIZE/output/2d_output.bin | Bin 0 -> 720000 bytes .../test_suite/NORMALIZE/output/3d_output.bin | Bin 0 -> 3360000 bytes utilities/test_suite/README.md | 58 +- utilities/test_suite/common.py | 20 +- utilities/test_suite/rpp_test_suite_common.h | 10 +- utilities/test_suite/rpp_test_suite_misc.h | 340 +++ 33 files changed, 4687 insertions(+), 321 deletions(-) create mode 100644 src/modules/cpu/kernel/normalize.hpp create mode 100644 src/modules/hip/kernel/normalize.hpp create mode 100644 utilities/test_suite/HIP/Tensor_misc_hip.cpp create mode 100644 utilities/test_suite/HIP/runMiscTests.py rename utilities/test_suite/HIP/{runTests_voxel.py => runVoxelTests.py} (66%) rename utilities/test_suite/HOST/{Tensor_host_audio.cpp => Tensor_audio_host.cpp} (99%) create mode 100644 utilities/test_suite/HOST/Tensor_misc_host.cpp create mode 100644 utilities/test_suite/HOST/runMiscTests.py rename utilities/test_suite/HOST/{runTests_voxel.py => runVoxelTests.py} (73%) create mode 100644 utilities/test_suite/NORMALIZE/input/2d_input.bin create mode 100644 utilities/test_suite/NORMALIZE/input/2d_mean_std.bin create mode 100644 utilities/test_suite/NORMALIZE/input/3d_input.bin create mode 100644 utilities/test_suite/NORMALIZE/input/3d_mean_std.bin create mode 100644 utilities/test_suite/NORMALIZE/output/2d_output.bin create mode 100644 utilities/test_suite/NORMALIZE/output/3d_output.bin create mode 100644 utilities/test_suite/rpp_test_suite_misc.h diff --git a/include/rppdefs.h b/include/rppdefs.h index f7cd7a711..7d49c457d 100644 --- a/include/rppdefs.h +++ b/include/rppdefs.h @@ -1045,6 +1045,7 @@ typedef struct Rpp64u* dstBatchIndex; Rpp32u* inc; Rpp32u* dstInc; + hipMemRpp32u scratchBuf; } memGPU; /*! \brief RPP HIP-HOST memory management diff --git a/include/rppt_tensor_statistical_operations.h b/include/rppt_tensor_statistical_operations.h index 3cb49a82b..7c2d3318b 100644 --- a/include/rppt_tensor_statistical_operations.h +++ b/include/rppt_tensor_statistical_operations.h @@ -150,6 +150,49 @@ RppStatus rppt_tensor_max_host(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t RppStatus rppt_tensor_max_gpu(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t imageMaxArr, Rpp32u imageMaxArrLength, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle); #endif // GPU_SUPPORT +/*! \brief Normalize Generic augmentation on HOST backend + * \details Normalizes the input generic ND buffer by removing the mean and dividing by the standard deviation for a given ND Tensor. + * Supports u8->f32, i8->f32, f16->f16 and f32->f32 datatypes. Also has toggle variant(NHWC->NCHW) support for 3D. + * \param [in] srcPtr source tensor memory in HOST memory + * \param [in] srcGenericDescPtr source tensor descriptor + * \param [out] dstPtr destination tensor memory in HOST memory + * \param [in] dstGenericDescPtr destination tensor descriptor + * \param [in] axisMask axis along which normalization needs to be done + * \param [in] meanTensor values to be subtracted from input + * \param [in] stdDevTensor standard deviation values to scale the input + * \param [in] computeMeanStddev flag to represent internal computation of mean, stddev (Wherein 0th bit used to represent computeMean and 1st bit for computeStddev, 0- Externally provided) + * \param [in] scale value to be multiplied with data after subtracting from mean + * \param [in] shift value to be added finally + * \param [in] roiTensor values to represent dimensions of input tensor + * \param [in] rppHandle RPP HOST handle created with \ref rppCreateWithBatchSize() + * \return A \ref RppStatus enumeration. + * \retval RPP_SUCCESS Successful completion. + * \retval RPP_ERROR* Unsuccessful completion. + */ +RppStatus rppt_normalize_host(RppPtr_t srcPtr, RpptGenericDescPtr srcGenericDescPtr, RppPtr_t dstPtr, RpptGenericDescPtr dstGenericDescPtr, Rpp32u axisMask, Rpp32f *meanTensor, Rpp32f *stdDevTensor, Rpp8u computeMeanStddev, Rpp32f scale, Rpp32f shift, Rpp32u *roiTensor, rppHandle_t rppHandle); + +#ifdef GPU_SUPPORT +/*! \brief Normalize Generic augmentation on HIP backend + * \details Normalizes the input generic ND buffer by removing the mean and dividing by the standard deviation for a given ND Tensor. + * \param [in] srcPtr source tensor memory in HIP memory + * \param [in] srcGenericDescPtr source tensor descriptor + * \param [out] dstPtr destination tensor memory in HIP memory + * \param [in] dstGenericDescPtr destination tensor descriptor + * \param [in] axisMask axis along which normalization needs to be done + * \param [in] meanTensor values to be subtracted from input + * \param [in] stdDevTensor standard deviation values to scale the input + * \param [in] computeMeanStddev flag to represent internal computation of mean, stddev (Wherein 0th bit used to represent computeMean and 1st bit for computeStddev, 0- Externally provided) + * \param [in] scale value to be multiplied with data after subtracting from mean + * \param [in] shift value to be added finally + * \param [in] roiTensor values to represent dimensions of input tensor + * \param [in] rppHandle RPP HIP handle created with \ref rppCreateWithStreamAndBatchSize() + * \return A \ref RppStatus enumeration. + * \retval RPP_SUCCESS Successful completion. + * \retval RPP_ERROR* Unsuccessful completion. + */ +RppStatus rppt_normalize_gpu(RppPtr_t srcPtr, RpptGenericDescPtr srcGenericDescPtr, RppPtr_t dstPtr, RpptGenericDescPtr dstGenericDescPtr, Rpp32u axisMask, Rpp32f *meanTensor, Rpp32f *stdDevTensor, Rpp8u computeMeanStddev, Rpp32f scale, Rpp32f shift, Rpp32u *roiTensor, rppHandle_t rppHandle); +#endif // GPU_SUPPORT + /*! @} */ diff --git a/src/include/cpu/rpp_cpu_simd.hpp b/src/include/cpu/rpp_cpu_simd.hpp index 19121957b..6c327fdd6 100644 --- a/src/include/cpu/rpp_cpu_simd.hpp +++ b/src/include/cpu/rpp_cpu_simd.hpp @@ -2537,6 +2537,127 @@ inline Rpp32f rpp_hsum_ps(__m256 x) return _mm_cvtss_f32(sum); } +/* Computes inverse square root */ +inline Rpp32f rpp_rsqrt_ps(Rpp32f x) +{ + __m128 X = _mm_set_ss(x); + __m128 tmp = _mm_rsqrt_ss(X); + Rpp32f y = _mm_cvtss_f32(tmp); + return y * (1.5f - x * 0.5f * y * y); +} + +/* Compute inverse square root */ +/* SSE matches to 6 decimal places with raw C version due to newton rhapson approximation*/ +inline void rpp_rsqrt_sse(Rpp32f *input, Rpp64s numElements, Rpp32f eps, Rpp32f rdiv, Rpp32f mul) +{ + Rpp64s i = 0; + __m128 rdivx4 = _mm_set1_ps(rdiv); + __m128 mulx4 = _mm_set1_ps(mul * 0.5f); + if (eps) // epsilon is present - no need for masking, but we need to add it + { + __m128 epsx4 = _mm_set1_ps(eps); + for (; i + 4 <= numElements; i += 4) + { + __m128 x = _mm_loadu_ps(&input[i]); + x = _mm_mul_ps(x, rdivx4); + x = _mm_add_ps(x, epsx4); + __m128 y = _mm_rsqrt_ps(x); + __m128 y2 = _mm_mul_ps(y, y); + __m128 xy2 = _mm_mul_ps(x, y2); + __m128 three_minus_xy2 = _mm_sub_ps(xmm_p3, xy2); + y = _mm_mul_ps(y, three_minus_xy2); + y = _mm_mul_ps(y, mulx4); + _mm_storeu_ps(&input[i], y); + } + } + else + { + for (; i + 4 <= numElements; i += 4) + { + __m128 x = _mm_loadu_ps(&input[i]); + x = _mm_mul_ps(x, rdivx4); + __m128 mask = _mm_cmpneq_ps(x, xmm_p0); + __m128 y = _mm_rsqrt_ps(x); + y = _mm_and_ps(y, mask); + __m128 y2 = _mm_mul_ps(y, y); + __m128 xy2 = _mm_mul_ps(x, y2); + __m128 three_minus_xy2 = _mm_sub_ps(xmm_p3, xy2); + y = _mm_mul_ps(y, three_minus_xy2); + y = _mm_mul_ps(y, mulx4); + _mm_storeu_ps(&input[i], y); + } + } + if (eps) + { + for (; i < numElements; i++) + input[i] = rpp_rsqrt_ps(input[i] * rdiv + eps) * mul; + } + else + { + for (; i < numElements; i++) + { + Rpp32f x = input[i] * rdiv; + input[i] = x ? rpp_rsqrt_ps(x) * mul : 0; + } + } +} + +/* Compute inverse square root */ +/* AVX2 matches to 6 decimal places with raw C version due to newton rhapson approximation*/ +inline void rpp_rsqrt_avx(Rpp32f *input, Rpp32s numElements, Rpp32f eps, Rpp32f rdiv, Rpp32f scale) +{ + Rpp32s i = 0; + __m256 rdivx8 = _mm256_set1_ps(rdiv); + __m256 mulx8 = _mm256_set1_ps(scale * 0.5f); + if (eps) // epsilon is present - no need for masking, but we need to add it + { + __m256 epsx8 = _mm256_set1_ps(eps); + for (; i + 8 <= numElements; i += 8) + { + __m256 x = _mm256_loadu_ps(&input[i]); + x = _mm256_mul_ps(x, rdivx8); + x = _mm256_add_ps(x, epsx8); + __m256 y = _mm256_rsqrt_ps(x); + __m256 y2 = _mm256_mul_ps(y, y); + __m256 xy2 = _mm256_mul_ps(x, y2); + __m256 three_minus_xy2 = _mm256_sub_ps(avx_p3, xy2); + y = _mm256_mul_ps(y, three_minus_xy2); + y = _mm256_mul_ps(y, mulx8); + _mm256_storeu_ps(&input[i], y); + } + } + else + { + for (; i + 8 <= numElements; i += 8) + { + __m256 x = _mm256_loadu_ps(&input[i]); + x = _mm256_mul_ps(x, rdivx8); + __m256 mask = _mm256_cmp_ps(x, avx_p0, _CMP_NEQ_OQ); + __m256 y = _mm256_rsqrt_ps(x); + y = _mm256_and_ps(y, mask); + __m256 y2 = _mm256_mul_ps(y, y); + __m256 xy2 = _mm256_mul_ps(x, y2); + __m256 three_minus_xy2 = _mm256_sub_ps(avx_p3, xy2); + y = _mm256_mul_ps(y, three_minus_xy2); + y = _mm256_mul_ps(y, mulx8); + _mm256_storeu_ps(&input[i], y); + } + } + if (eps) + { + for (; i < numElements; i++) + input[i] = rpp_rsqrt_ps(input[i] * rdiv + eps) * scale; + } + else + { + for (; i < numElements; i++) + { + Rpp32f x = input[i] * rdiv; + input[i] = x ? rpp_rsqrt_ps(x) * scale : 0; + } + } +} + static inline void fast_matmul4x4_sse(float *A, float *B, float *C) { __m128 row1 = _mm_load_ps(&B[0]); // Row 0 of B diff --git a/src/modules/CMakeLists.txt b/src/modules/CMakeLists.txt index 1f47e8ee7..4338483a9 100644 --- a/src/modules/CMakeLists.txt +++ b/src/modules/CMakeLists.txt @@ -97,6 +97,7 @@ if( "${BACKEND}" STREQUAL "HIP") set(CMAKE_CXX_COMPILER ${COMPILER_FOR_HIP}) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${HIP_HIPCC_FLAGS}") set_source_files_properties(rppt_tensor_audio_augmentations.cpp PROPERTIES COMPILE_FLAGS -mno-fma) + set_source_files_properties(rppt_tensor_statistical_operations.cpp PROPERTIES COMPILE_FLAGS -mno-fma) # no-fma flag added to get the exact output match with golden outputs # Add HIP specific preprocessor flags add_definitions(-DHIP_COMPILE) @@ -111,6 +112,7 @@ elseif( "${BACKEND}" STREQUAL "OCL") list(APPEND Rpp_Source ${CPPFILES} ${MOD_CL_CPP}) message("-- ${Green}OpenCL kernels added!${ColourReset}") set_source_files_properties(rppt_tensor_audio_augmentations.cpp PROPERTIES COMPILE_FLAGS -mno-fma) + set_source_files_properties(rppt_tensor_statistical_operations.cpp PROPERTIES COMPILE_FLAGS -mno-fma) # no-fma flag added to get the exact output match with golden outputs # Add OpenCL specific preprocessor flags add_definitions(-DOCL_COMPILE) @@ -125,6 +127,7 @@ elseif( "${BACKEND}" STREQUAL "CPU") # Add CPU specific includes set(INCLUDE_LIST ${CMAKE_SOURCE_DIR}/src/include/common/) set_source_files_properties(rppt_tensor_audio_augmentations.cpp PROPERTIES COMPILE_FLAGS -mno-fma) + set_source_files_properties(rppt_tensor_statistical_operations.cpp PROPERTIES COMPILE_FLAGS -mno-fma) # no-fma flag added to get the exact output match with golden outputs endif() message("-- ${White}AMD RPP ${PROJECT_NAME} -- Include Directories:${INCLUDE_LIST}${ColourReset}") add_compile_options("-Wno-unused-result") diff --git a/src/modules/cpu/host_tensor_statistical_operations.hpp b/src/modules/cpu/host_tensor_statistical_operations.hpp index 32b8b62b5..7ddc238fa 100644 --- a/src/modules/cpu/host_tensor_statistical_operations.hpp +++ b/src/modules/cpu/host_tensor_statistical_operations.hpp @@ -28,5 +28,6 @@ SOFTWARE. #include "kernel/tensor_sum.hpp" #include "kernel/tensor_min.hpp" #include "kernel/tensor_max.hpp" +#include "kernel/normalize.hpp" -#endif // HOST_TENSOR_STATISTICAL_OPERATIONS_HPP \ No newline at end of file +#endif // HOST_TENSOR_STATISTICAL_OPERATIONS_HPP diff --git a/src/modules/cpu/kernel/normalize.hpp b/src/modules/cpu/kernel/normalize.hpp new file mode 100644 index 000000000..dbe746d1a --- /dev/null +++ b/src/modules/cpu/kernel/normalize.hpp @@ -0,0 +1,882 @@ +/* +MIT License + +Copyright (c) 2019 - 2024 Advanced Micro Devices, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#include "rppdefs.h" +#include "rpp_cpu_simd.hpp" +#include "rpp_cpu_common.hpp" + +// Computes strides +void compute_strides(Rpp32u *strides, Rpp32u *shape, Rpp32u tensorDim) +{ + if (tensorDim > 0) + { + Rpp32u v = 1; + for (Rpp32u i = tensorDim - 1; i > 0; i--) + { + strides[i] = v; + v *= shape[i]; + } + strides[0] = v; + } +} + +// Recursive reduction helper function to compute difference of input with mean and squares them up +template +void compute_diff_square_sum(Rpp32f &output, T *input, Rpp32s inputStride, Rpp32s numElements, Rpp32f mean) +{ + if (numElements > 32) + { + Rpp32s currElements = numElements >> 1; + Rpp32f tmp1 = 0, tmp2 = 0; + + // reduce first half and accumulate + compute_diff_square_sum(tmp1, input, inputStride, currElements, mean); + + // reduce second half and accumulate + compute_diff_square_sum(tmp2, input + currElements * inputStride, inputStride, numElements - currElements, mean); + + tmp1 += tmp2; + output += tmp1; + } + else + { + // reduce to a temporary + Rpp32f tmp = 0; + for (Rpp32s i = 0; i < numElements; i++) + { + Rpp32f curr = (input[i * inputStride] - mean); + auto curSq = curr * curr; + tmp += curSq; + } + + // accumulate in target value + output += tmp; + } +} + +// Recursive reduction helper function to sum up input values +template +void compute_sum(Rpp32f &output, T *input, Rpp32s inputStride, Rpp32s numElements) +{ + if (numElements > 32) + { + Rpp32s currElements = numElements >> 1; + Rpp32f tmp1 = 0, tmp2 = 0; + + // reduce first half and accumulate + compute_sum(tmp1, input, inputStride, currElements); + + // reduce second half and accumulate + compute_sum(tmp2, input + currElements * inputStride, inputStride, numElements - currElements); + + tmp1 += tmp2; + output += tmp1; + } + else + { + // reduce to a temporary + Rpp32f tmp = 0; + for (Rpp32s i = 0; i < numElements; i++) + tmp += input[i * inputStride]; + + // accumulate in target value + output += tmp; + } +} + +// Computes mean for 2D inputs +void compute_2D_mean(Rpp32f *srcPtr, Rpp32f *meanPtr, Rpp32u *dims, Rpp32u *stride) +{ + Rpp32f *srcPtrTemp = srcPtr; + Rpp32f normFactor = 1.0 / dims[1]; + for(Rpp32u i = 0; i < dims[0]; i++) + { + meanPtr[i] = 0; + compute_sum(meanPtr[i], srcPtrTemp, stride[0], dims[1]); + srcPtrTemp += stride[1]; + meanPtr[i] *= normFactor; + } +} + +// Computes inverse stddev for 2D inputs +void compute_2D_inv_std_dev(Rpp32f *srcPtr, Rpp32f *meanPtr, Rpp32f *stdDevPtr, Rpp32u *dims, Rpp32u *stride, Rpp32f scale) +{ + + Rpp32f *srcPtrTemp = srcPtr; + Rpp32f normFactor = (Rpp32f)(1.0 / dims[1]); + for(Rpp32u i = 0; i < dims[0]; i++) + { + stdDevPtr[i] = 0; + compute_diff_square_sum(stdDevPtr[i], srcPtrTemp, stride[0], dims[1], meanPtr[i]); + srcPtrTemp += stride[1]; + } + rpp_rsqrt_sse(stdDevPtr, (Rpp32s)dims[0], 0, normFactor, scale); +} + +// Computes mean for 3D inputs +void compute_3D_mean(Rpp32f *srcPtr, Rpp32f *meanPtr, Rpp32u *dims, Rpp32u *stride, bool isConsecutive = true) +{ + Rpp32f *srcPtrTemp = srcPtr; + if(isConsecutive) + { + Rpp32f normFactor = 1.0 / dims[2]; + for(Rpp32u i = 0; i < dims[0]; i++) + { + float *srcPtrRow = srcPtrTemp; + for(Rpp32u j = 0; j < dims[1]; j++) + { + Rpp32u index = i * dims[1] + j; + meanPtr[index] = 0; + compute_sum(meanPtr[index], srcPtrRow, stride[0], dims[2]); + srcPtrRow += stride[1]; + meanPtr[index] *= normFactor; + } + srcPtrTemp += stride[2]; + } + } + else + { + Rpp32f normFactor = 1.0 / (dims[1] * dims[2]); + for(Rpp32u i = 0; i < dims[0]; i++) + { + meanPtr[i] = 0; + Rpp32f *srcPtrRow = srcPtrTemp; + for(Rpp32u j = 0; j < dims[1]; j++) + { + compute_sum(meanPtr[i], srcPtrRow, stride[0], dims[2]); + srcPtrRow += stride[1]; + } + meanPtr[i] *= normFactor; + srcPtrTemp += stride[2]; + } + } +} + +// Computes inverse stddev for 3D inputs +void compute_3D_inv_std_dev(Rpp32f *srcPtr, Rpp32f *meanPtr, Rpp32f *stdDevPtr, Rpp32u *dims, Rpp32u *stride, Rpp32f scale, bool isConsecutive = true) +{ + Rpp32f *srcPtrTemp = srcPtr; + if(isConsecutive) + { + Rpp32f normFactor = (Rpp32f)(1.0 / dims[2]); + for(Rpp32u i = 0; i < dims[0]; i++) + { + float *srcPtrRow = srcPtrTemp; + for(Rpp32u j = 0; j < dims[1]; j++) + { + Rpp32u index = i * dims[1] + j; + stdDevPtr[index] = 0; + compute_diff_square_sum(stdDevPtr[index], srcPtrRow, stride[0], dims[2], meanPtr[index]); + srcPtrRow += stride[1]; + } + srcPtrTemp += stride[2]; + } + rpp_rsqrt_avx(stdDevPtr, (Rpp32s)(dims[0] * dims[1]), 0, normFactor, scale); + } + else + { + Rpp32f normFactor = (Rpp32f)(1.0 / (dims[1] * dims[2])); + for(Rpp32u i = 0; i < dims[0]; i++) + { + stdDevPtr[i] = 0; + Rpp32f *srcPtrRow = srcPtrTemp; + for(Rpp32u j = 0; j < dims[1]; j++) + { + compute_diff_square_sum(stdDevPtr[i], srcPtrRow, stride[0], dims[2], meanPtr[i]); + srcPtrRow += stride[1]; + } + srcPtrTemp += stride[2]; + } + rpp_rsqrt_avx(stdDevPtr, (Rpp32s)(dims[0]), 0, normFactor, scale); + } +} + +// Computes mean for ND inputs +template +void compute_ND_mean(T *srcPtr, Rpp32f *meanPtr, Rpp32u *dims, Rpp32u *stride, Rpp32u *axis, Rpp32u tensorDim, Rpp32u level, Rpp32u index, Rpp32u size, Rpp32u norm, Rpp32u lastNormAxis) +{ + if((level == (tensorDim - 1)) && axis[tensorDim - 1]) // Calls computeSum when last dimension is to be normalized + compute_sum(meanPtr[index], srcPtr, stride[level], dims[level]); + else if(level == tensorDim) // Calls computeSum when only 1st axis need to be normalized + compute_sum(meanPtr[index], srcPtr, stride[norm], dims[norm]); + else if (!axis[level]) // When that axis at present level isn't normalized, split srcPtr and modify index to store mean + { + for(Rpp32u i = 0; i < dims[level]; i++) + compute_ND_mean(srcPtr + (i * stride[level]), meanPtr, dims, stride, axis, tensorDim, level + 1, index + (i * (size / dims[level])), size / dims[level], norm, lastNormAxis); + } + else if(axis[level] && (level == lastNormAxis)) // Increment level alone if its last axis to be normalized + compute_ND_mean(srcPtr, meanPtr, dims, stride, axis, tensorDim, level + 1, index, size, level, lastNormAxis); + else if(axis[level]) // Called when axis at present level needs to be normalized + { + for(Rpp32u i = 0; i < dims[level]; i++) + compute_ND_mean(srcPtr + (i * stride[level]), meanPtr, dims, stride, axis, tensorDim, level + 1, index, size, level, lastNormAxis); + } +} + +// Computes inverse stddev for ND inputs +template +void compute_ND_stddev(T *srcPtr, Rpp32f *meanPtr, Rpp32f *stdDevPtr, Rpp32u *dims, Rpp32u *stride, Rpp32u *axis, Rpp32u tensorDim, Rpp32u level, Rpp32u index, Rpp32u size, Rpp32u norm, Rpp32u lastNormAxis) +{ + if((level == (tensorDim - 1)) && axis[tensorDim - 1]) // Calls computeDiffSumSquare when last dimension is to be normalized + compute_diff_square_sum(stdDevPtr[index], srcPtr, stride[level], dims[level], meanPtr[index]); + else if(level == tensorDim) // Calls computeDiffSumSquare when only 1st axis need to be normalized + compute_diff_square_sum(stdDevPtr[index], srcPtr, stride[norm], dims[norm], meanPtr[index]); + else if (!axis[level]) // When that axis at present level isn't normalized, split srcPtr and modify index to store stddev + { + for(Rpp32u i = 0; i < dims[level]; i++) + compute_ND_stddev(srcPtr + (i * stride[level]), meanPtr, stdDevPtr, dims, stride, axis, tensorDim, level + 1, index + (i * (size / dims[level])), size / dims[level], norm, lastNormAxis); + } + else if(axis[level] && (level == lastNormAxis)) // Increment level alone if its last axis to be normalized + compute_ND_stddev(srcPtr, meanPtr, stdDevPtr, dims, stride, axis, tensorDim, level + 1, index, size, level, lastNormAxis); + else if(axis[level]) // Called when axis at present level needs to be normalized + { + for(Rpp32u i = 0; i < dims[level]; i++) + compute_ND_stddev(srcPtr + (i * stride[level]), meanPtr, stdDevPtr, dims, stride, axis, tensorDim, level + 1, index, size, level, lastNormAxis); + } +} + +// Computes normalize for 3D non toggle variants +void normalize_3D_tensor_nontoggle(Rpp32f *srcPtr, RpptGenericDescPtr srcGenericDescPtr, Rpp32f *dstPtr, RpptGenericDescPtr dstGenericDescPtr, + Rpp32f *meanPtr, Rpp32f *multiplierPtr, Rpp32f shift, Rpp32u *paramStride, Rpp32u *length) +{ + Rpp32s paramIdx = 0; + Rpp32s idx1 = 0; + + for(Rpp32u i = 0; i < length[0]; i++) + { + Rpp32f *srcPtrRow = srcPtr; + Rpp32f *dstPtrRow = dstPtr; + for(Rpp32u j = 0; j < length[1]; j++) + { + Rpp32f *srcPtrRowTemp = srcPtrRow; + Rpp32f *dstPtrRowTemp = dstPtrRow; + idx1 = paramIdx; + for(Rpp32u k = 0; k < length[2]; k++) + { + *dstPtrRowTemp = ((*srcPtrRowTemp - meanPtr[paramIdx]) * multiplierPtr[paramIdx]) + shift; + if(k < length[2] - 1) + paramIdx += paramStride[2]; + srcPtrRowTemp++; + dstPtrRowTemp++; + } + if(j < length[1] - 1) + paramIdx = (!paramStride[1]) ? idx1 : paramIdx + paramStride[1]; + srcPtrRow += srcGenericDescPtr->strides[2]; + dstPtrRow += dstGenericDescPtr->strides[2]; + } + if(i < length[0] - 1) + paramIdx = (!paramStride[0]) ? 0 : paramIdx + paramStride[0]; + srcPtr += srcGenericDescPtr->strides[1]; + dstPtr += dstGenericDescPtr->strides[1]; + } +} + +// Computes normalize for 3D toggle variants when axis mask is set to 3 +void normalize_3D_tensor_axis3_toggle(Rpp32f *srcPtr, RpptGenericDescPtr srcGenericDescPtr, Rpp32f *dstPtr, RpptGenericDescPtr dstGenericDescPtr, + Rpp32f *meanPtr, Rpp32f *multiplierPtr, Rpp32f shift, Rpp32u *paramStride, Rpp32u *length) +{ + Rpp32f *srcPtrTemp = srcPtr; + Rpp32f *dstPtrTemp[length[2]]; + dstPtrTemp[0] = dstPtr; + for(Rpp32u i = 1; i < length[2]; i++) + dstPtrTemp[i] = dstPtrTemp[i-1] + dstGenericDescPtr->strides[1]; + Rpp32s paramIdx = 0; + + for(Rpp32u i = 0; i < length[0]; i++) + { + Rpp32f *srcPtrRow = srcPtrTemp; + Rpp32f *dstPtrRow[length[2]]; + for(Rpp32u l = 0; l < length[2]; l++) + dstPtrRow[l] = dstPtrTemp[l]; + for(Rpp32u j = 0; j < length[1]; j++) + { + Rpp32f *srcPtrRowTemp = srcPtrRow; + Rpp32f *dstPtrRowTemp[length[2]]; + for(Rpp32u l = 0; l < length[2]; l++) + dstPtrRowTemp[l] = dstPtrRow[l]; + for(Rpp32u k = 0; k < length[2]; k++) + { + *dstPtrRowTemp[k]++ = ((*srcPtrRowTemp++ - meanPtr[paramIdx]) * multiplierPtr[paramIdx]) + shift; + paramIdx += paramStride[2]; + } + paramIdx = (!paramStride[1]) ? 0 : paramIdx + paramStride[1]; + srcPtrRow += srcGenericDescPtr->strides[2]; + for(Rpp32u l = 0; l < length[2]; l++) + dstPtrRow[l] += dstGenericDescPtr->strides[3]; + } + srcPtrTemp += srcGenericDescPtr->strides[1]; + for(Rpp32u l = 0; l < length[2]; l++) + dstPtrTemp[l] += dstGenericDescPtr->strides[2]; + } +} + +// Computes normalize for 3D non toggle variants, optimized with AVX when axis mask set to 3 and 16 channel normalize +void normalize_3D_tensor_avx_axis3(Rpp32f *srcPtr, RpptGenericDescPtr srcGenericDescPtr, Rpp32f *dstPtr, RpptGenericDescPtr dstGenericDescPtr, + Rpp32f *meanPtr, Rpp32f *multiplierPtr, Rpp32f shift, Rpp32u *paramStride, Rpp32u bufferLength, Rpp32u *length) +{ + Rpp32u vectorIncrement = 16; + Rpp32u alignedLength = (bufferLength / 16) * 16; + Rpp32u outerDim = length[0]; + + // set shift, mean and stddev + __m256 pShift = _mm256_set1_ps(shift); + __m256 pMean1 = _mm256_loadu_ps(meanPtr); + __m256 pMean2 = _mm256_loadu_ps(meanPtr + 8); + __m256 pMultiplier1 = _mm256_loadu_ps(multiplierPtr); + __m256 pMultiplier2 = _mm256_loadu_ps(multiplierPtr + 8); + + for(Rpp32u i = 0; i < outerDim; i++) + { + Rpp32f *srcPtrTemp = srcPtr + i * srcGenericDescPtr->strides[1]; + Rpp32f *dstPtrTemp = dstPtr + i * dstGenericDescPtr->strides[1]; + + Rpp32u vectorLoopCount = 0; + for(; vectorLoopCount < alignedLength ; vectorLoopCount += vectorIncrement) + { + __m256 pSrc1 = _mm256_loadu_ps(srcPtrTemp); + __m256 pSrc2 = _mm256_loadu_ps(srcPtrTemp + 8); + __m256 pDst1 = _mm256_add_ps(_mm256_mul_ps(_mm256_sub_ps(pSrc1, pMean1), pMultiplier1), pShift); + __m256 pDst2 = _mm256_add_ps(_mm256_mul_ps(_mm256_sub_ps(pSrc2, pMean2), pMultiplier2), pShift); + _mm256_storeu_ps(dstPtrTemp, pDst1); + _mm256_storeu_ps(dstPtrTemp + 8, pDst2); + srcPtrTemp += vectorIncrement; + dstPtrTemp += vectorIncrement; + } + } +} + +// Computes normalize for ND non toggle variants for i8 dataype +void normalize_ND_tensor_nontoggle(Rpp32s *srcPtr, Rpp32u *srcStride, Rpp32f *dstPtr, Rpp32f *meanPtr, Rpp32f *multiplierPtr, + Rpp32f shift, Rpp32u *paramStride, Rpp32u *length, Rpp32u tensorDim, Rpp32u level, Rpp32u& idx) +{ + Rpp32u idx1 = 0; + if(tensorDim == 1) + { + for(Rpp32u k = 0; k < length[level]; k++) + { + *dstPtr++ = (((Rpp32f)(*srcPtr + 128) - meanPtr[idx]) * multiplierPtr[idx]) + shift; + if(k < length[level] - 1) + idx += paramStride[level]; + srcPtr++; + } + } + else + { + idx1 = idx; + for (Rpp32u i = 0; i < length[level]; i++) + { + normalize_ND_tensor_nontoggle(srcPtr, srcStride, dstPtr, meanPtr, multiplierPtr, shift, paramStride, length + 1, tensorDim - 1, level + 1, idx); + if(i < length[level] - 1) + idx = (!paramStride[level]) ? idx1 : idx + paramStride[level]; + dstPtr += srcStride[level]; + srcPtr += srcStride[level]; + } + } +} + +// Computes normalize for ND non toggle variants +template +void normalize_ND_tensor_nontoggle(T1 *srcPtr, Rpp32u *srcStride, T2 *dstPtr, Rpp32f *meanPtr, Rpp32f *multiplierPtr, + Rpp32f shift, Rpp32u *paramStride, Rpp32u *length, Rpp32u tensorDim, Rpp32u level, Rpp32u& idx) +{ + Rpp32u idx1 = 0; + if(tensorDim == 1) + { + T1 *srcPtrTemp = srcPtr; + T2 *dstPtrTemp = dstPtr; + + for(Rpp32u k = 0; k < length[level]; k++) + { + *dstPtrTemp = (((T2)*srcPtrTemp - meanPtr[idx]) * multiplierPtr[idx]) + shift; + if(k < length[level] - 1) + idx += paramStride[level]; + srcPtrTemp++; + dstPtrTemp++; + } + } + else + { + idx1 = idx; + for (Rpp32u i = 0; i < length[level]; i++) + { + normalize_ND_tensor_nontoggle(srcPtr, srcStride, dstPtr, meanPtr, multiplierPtr, shift, paramStride, length + 1, tensorDim - 1, level + 1, idx); + if(i < length[level] - 1) + idx = (!paramStride[level]) ? idx1 : idx + paramStride[level]; + dstPtr += srcStride[level]; + srcPtr += srcStride[level]; + } + } +} + +// Computes normalize for 2D +void normalize_2D_tensor(Rpp32f *srcPtr, RpptGenericDescPtr srcDescPtr, Rpp32f *dstPtr, RpptGenericDescPtr dstDescPtr, + Rpp32f *meanPtr, Rpp32f *invStdDevPtr, Rpp32f shift, Rpp32u *dims, Rpp32u *paramStride) +{ + if (paramStride[1]) // Optimized with AVX when axis mask set to 2 + { + Rpp32u vectorIncrement = 8; + Rpp32u bufferLength = dims[1]; + Rpp32u alignedLength = (bufferLength / 8) * 8; + + __m256 pShift = _mm256_set1_ps(shift); + for(Rpp32u i = 0; i < dims[0]; i++) + { + Rpp32f *srcPtrTemp = srcPtr + i * srcDescPtr->strides[1]; + Rpp32f *dstPtrTemp = dstPtr + i * dstDescPtr->strides[1]; + + // set mean and stddev + Rpp32f mean = meanPtr[i]; + Rpp32f invStdDev = invStdDevPtr[i]; + __m256 pMean, pInvStdDev; + pMean = _mm256_set1_ps(mean); + pInvStdDev = _mm256_set1_ps(invStdDev); + + Rpp32u vectorLoopCount = 0; + for(; vectorLoopCount < alignedLength ; vectorLoopCount += vectorIncrement) + { + __m256 pSrc = _mm256_loadu_ps(srcPtrTemp); + __m256 pDst = _mm256_add_ps(_mm256_mul_ps(_mm256_sub_ps(pSrc, pMean), pInvStdDev), pShift); + _mm256_storeu_ps(dstPtrTemp, pDst); + srcPtrTemp += vectorIncrement; + dstPtrTemp += vectorIncrement; + } + for(; vectorLoopCount < dims[1] ; vectorLoopCount ++) + *dstPtrTemp++ = (*srcPtrTemp++ - mean) * invStdDev + shift; + } + } + else + { + Rpp32s paramIdx = 0; + for(Rpp32u i = 0; i < dims[0]; i++) + { + Rpp32f *srcPtrTemp = srcPtr; + Rpp32f *dstPtrTemp = dstPtr; + for(Rpp32u j = 0; j < dims[1]; j++) + { + *dstPtrTemp++ = (*srcPtrTemp++ - meanPtr[paramIdx]) * invStdDevPtr[paramIdx] + shift; + paramIdx += paramStride[0]; + } + paramIdx = (!paramStride[1]) ? 0 : paramIdx + paramStride[1]; + srcPtr += srcDescPtr->strides[1]; + dstPtr += dstDescPtr->strides[1]; + } + } +} + +// Performs collapse axis operation wherein continuous axis that require normalization are combined together +void collapse_axis(Rpp32u *tensorDim, Rpp32u *axis, Rpp32u *length, Rpp32u *newAxis, Rpp32u *newDims, Rpp32u *lastNormAxis) +{ + int skipped = 0, prev = -2, k = 0; + for(Rpp32u i = 0; i < *tensorDim; i++) + { + if(axis[i]) + { + int temp = i - skipped; + if(temp != prev + 1) + { + newAxis[k] = 1; + newDims[k] = length[i]; + prev = i; + k++; + } + else if(prev >= 0) + { + newDims[prev] *= length[i]; + skipped++; + } + } + else + { + newDims[k] = length[i]; + k++; + } + } + *tensorDim -= skipped; + for(Rpp32u i = 0; i < *tensorDim; i++) + { + if(newAxis[i]) + *lastNormAxis = i; + } +} + +RppStatus normalize_f32_f32_host_tensor(Rpp32f *srcPtr, + RpptGenericDescPtr srcGenericDescPtr, + Rpp32f *dstPtr, + RpptGenericDescPtr dstGenericDescPtr, + Rpp32u axisMask, + Rpp32f *meanTensorPtr, + Rpp32f *stdDevTensorPtr, + Rpp8u computeMeanStddev, + Rpp32f scale, + Rpp32f shift, + Rpp32u *roiTensor, + RppLayoutParams layoutParams, + rpp::Handle& handle) +{ + Rpp32u numThreads = handle.GetNumThreads(); + Rpp32u tensorDims = srcGenericDescPtr->numDims - 1; + Rpp32u batchSize = dstGenericDescPtr->dims[0]; + + Rpp32u maxSize = 1; + // Compute maxSize as length of input tensors differ based on axisMask and tensorDims + for(int batch = 0; batch < batchSize; batch++) + { + Rpp32u size = 1; + for(int i = 0; i < tensorDims; i++) + size *= ((axisMask & (int)(pow(2, i))) >= 1) ? 1 : roiTensor[(tensorDims * 2 * batch) + tensorDims + i]; + maxSize = std::max(maxSize, size); + } + + if(!computeMeanStddev) + { + for(Rpp32u i = 0; i < maxSize; i++) + stdDevTensorPtr[i] = (!stdDevTensorPtr[i])? 1.0f : scale / stdDevTensorPtr[i]; + maxSize = 0; + } + + omp_set_dynamic(0); +#pragma omp parallel for num_threads(numThreads) + for(int batchCount = 0; batchCount < batchSize; batchCount++) + { + Rpp32u *roi = roiTensor + batchCount * tensorDims * 2; + Rpp32u *begin = roi; + Rpp32u *length = &roi[tensorDims]; + + Rpp32f *srcPtrTemp, *dstPtrTemp, *meanTensor, *stdDevTensor; + srcPtrTemp = srcPtr + batchCount * srcGenericDescPtr->strides[0]; + dstPtrTemp = dstPtr + batchCount * dstGenericDescPtr->strides[0]; + meanTensor = meanTensorPtr + batchCount * maxSize; + stdDevTensor = stdDevTensorPtr + batchCount * maxSize; + + // Set all values in dst buffer to 0.0 + for(int cnt = 0; cnt < dstGenericDescPtr->strides[0]; cnt++) + dstPtrTemp[cnt] = 0.0f; + + Rpp32f *srcPtrChannel = srcPtrTemp; + + if(tensorDims == 2) // Called for audio testcase and for any other 2D case + { + Rpp32u paramStride[2]; + Rpp32u srcReductionDims[2], srcStride[2]; + if (axisMask == 3) + { + srcStride[0] = srcStride[1] = srcGenericDescPtr->strides[2]; + srcReductionDims[0] = 1; + srcReductionDims[1] = length[0] * length[1]; + paramStride[0] = paramStride[1] = 0; + } + else if (axisMask == 1) + { + srcStride[0] = srcGenericDescPtr->strides[1]; + srcStride[1] = srcGenericDescPtr->strides[2]; + srcReductionDims[0] = length[1]; + srcReductionDims[1] = length[0]; + paramStride[0] = 1; + paramStride[1] = 0; + } + else if (axisMask == 2) + { + srcStride[0] = srcGenericDescPtr->strides[2]; + srcStride[1] = srcGenericDescPtr->strides[1]; + srcReductionDims[0] = length[0]; + srcReductionDims[1] = length[1]; + paramStride[0] = 0; + paramStride[1] = 1; + } + + if(computeMeanStddev & 1) // Check if mean is to be computed internally + compute_2D_mean(srcPtrTemp, meanTensor, srcReductionDims, srcStride); + if(computeMeanStddev & 2) // Check if stddev is to be computed internally + compute_2D_inv_std_dev(srcPtrTemp, meanTensor, stdDevTensor, srcReductionDims, srcStride, scale); + + normalize_2D_tensor(srcPtrTemp, srcGenericDescPtr, dstPtrTemp, dstGenericDescPtr, meanTensor, stdDevTensor, shift, length, paramStride); + } + else if(tensorDims == 3) // Called when a 3D tensor is passed to kernel + { + Rpp32u paramStride[3]; + Rpp32u srcReductionDims[3], srcStride[3]; + Rpp32u reductionDims; + bool isConsecutive = true; + switch(axisMask) + { + case 1: // Normalize axes 0 + { + reductionDims = length[1] * length[2]; + paramStride[0] = 0; + paramStride[1] = paramStride[2] = 1; + srcReductionDims[0] = length[1]; + srcReductionDims[1] = length[2]; + srcReductionDims[2] = length[0]; + srcStride[0] = srcGenericDescPtr->strides[1]; + srcStride[1] = srcGenericDescPtr->strides[3]; + srcStride[2] = srcGenericDescPtr->strides[2]; + break; + } + case 2: // Normalize axes 1 + { + reductionDims = length[0] * length[2]; + paramStride[1] = 0; + paramStride[0] = paramStride[2] = 1; + srcReductionDims[0] = length[0]; + srcReductionDims[1] = length[2]; + srcReductionDims[2] = length[1]; + srcStride[0] = srcGenericDescPtr->strides[2]; + srcStride[1] = srcGenericDescPtr->strides[3]; + srcStride[2] = srcGenericDescPtr->strides[1]; + break; + } + case 3: // Normalize axes 0, 1 + { + reductionDims = length[2]; + paramStride[0] = paramStride[1] = 0; + paramStride[2] = 1; + srcReductionDims[0] = 1; + srcReductionDims[1] = length[2]; + srcReductionDims[2] = length[0] * length[1]; + srcStride[0] = srcGenericDescPtr->strides[2]; + srcStride[1] = srcGenericDescPtr->strides[3]; + srcStride[2] = srcGenericDescPtr->strides[3]; + break; + } + case 4: // Normalize across 2 + { + reductionDims = length[0] * length[1]; + paramStride[2] = 0; + paramStride[0] = paramStride[1] = 1; + srcReductionDims[0] = length[0]; + srcReductionDims[1] = length[1]; + srcReductionDims[2] = length[2]; + srcStride[0] = srcGenericDescPtr->strides[3]; + srcStride[1] = srcGenericDescPtr->strides[2]; + srcStride[2] = srcGenericDescPtr->strides[1]; + break; + } + case 5: // Normalize across 0, 2 + { + reductionDims = length[1]; + paramStride[0] = paramStride[2] = 0; + paramStride[1] = 1; + srcReductionDims[0] = length[1]; + srcReductionDims[1] = length[0]; + srcReductionDims[2] = length[2]; + srcStride[0] = srcGenericDescPtr->strides[3]; + srcStride[1] = srcGenericDescPtr->strides[1]; + srcStride[2] = srcGenericDescPtr->strides[2]; + isConsecutive = false; + break; + } + case 6: // Normalize across 1, 2 + { + reductionDims = length[0]; + paramStride[1] = paramStride[2] = 0; + paramStride[0] = 1; + srcReductionDims[0] = 1; + srcReductionDims[1] = length[0]; + srcReductionDims[2] = length[1] * length[2]; + srcStride[0] = srcGenericDescPtr->strides[3]; + srcStride[1] = srcGenericDescPtr->strides[1]; + srcStride[2] = srcGenericDescPtr->strides[3]; + break; + } + case 7: // Normalize across 0, 1, 2 + { + reductionDims = 1; + paramStride[0] = paramStride[1] = paramStride[2] = 0; + srcReductionDims[0] = 1; + srcReductionDims[1] = 1; + srcReductionDims[2] = length[0] * length[1] * length[2]; + srcStride[0] = srcStride[1] = srcStride[2] = srcGenericDescPtr->strides[3]; + break; + } + default: + { + std::cout<<"Invalid Axis mask"<strides[i]; + + if(computeMeanStddev & 1) // Check if mean is to be computed internally + compute_3D_mean(srcPtrChannel, meanTensor, srcReductionDims, srcStride, isConsecutive); + if(computeMeanStddev & 2) // Check if stddev is to be computed internally + compute_3D_inv_std_dev(srcPtrChannel, meanTensor, stdDevTensor, srcReductionDims, srcStride, scale, isConsecutive); + + if((axisMask == 3) && (srcGenericDescPtr->layout == RpptLayout::NHWC) && (dstGenericDescPtr->layout == RpptLayout::NHWC) && (srcGenericDescPtr->dims[3] == 16)) + normalize_3D_tensor_avx_axis3(srcPtrChannel, srcGenericDescPtr, dstPtrTemp, dstGenericDescPtr, meanTensor, stdDevTensor, shift, paramStride, length[1] * layoutParams.bufferMultiplier, length); + else if((srcGenericDescPtr->layout == RpptLayout::NHWC) && (dstGenericDescPtr->layout == RpptLayout::NHWC)) + normalize_3D_tensor_nontoggle(srcPtrChannel, srcGenericDescPtr, dstPtrTemp, dstGenericDescPtr, meanTensor, stdDevTensor, shift, paramStride, length); + else if((axisMask == 3) && (srcGenericDescPtr->layout == RpptLayout::NHWC) && (dstGenericDescPtr->layout == RpptLayout::NCHW)) + normalize_3D_tensor_axis3_toggle(srcPtrChannel, srcGenericDescPtr, dstPtrTemp, dstGenericDescPtr, meanTensor, stdDevTensor, shift, paramStride, length); + } + else // Handle any other ND tensor is passed to kernel + { + // Compute length of input tensors as they differ based on axisMask and tensorDims + int size = 1; + for(int i = 0; i < tensorDims; i++) + size *= ((axisMask & (int)(pow(2, i))) >= 1) ? 1 : length[i]; + + Rpp32u totalElements = 1; + Rpp32u lastNormAxis = 0; + Rpp32u axis[tensorDims], newAxis[tensorDims], newDims[tensorDims]; + // Initialize newAxis and newDims used to store final Axis and Dims after removing redundant axis + memset(newAxis, 0, tensorDims * sizeof(Rpp32u)); + memset(newDims, 0, tensorDims * sizeof(Rpp32u)); + + for(Rpp32u i = 0; i < tensorDims; i++) + { + axis[i] = ((axisMask & (int)(pow(2, i))) >= 1) ? 1 : 0; + totalElements *= axis[i] ? length[i] : 1; + srcPtrChannel += begin[i] * srcGenericDescPtr->strides[i + 1]; + } + + Rpp32u paramStride[tensorDims], srcStride[tensorDims]; + collapse_axis(&tensorDims, axis, length, newAxis, newDims, &lastNormAxis); + compute_strides(srcStride, newDims, tensorDims); + + if(computeMeanStddev & 1) // Check if mean is to be computed internally + { + compute_ND_mean(srcPtrChannel, meanTensor, newDims, srcStride, newAxis, tensorDims, 0, 0, size, 0, lastNormAxis); + Rpp32f normFactor = 1.0 / totalElements; + for(int i = 0; i < size; i++) + meanTensor[i] *= normFactor; + } + if(computeMeanStddev & 2) // Check if stddev is to be computed internally + { + compute_ND_stddev(srcPtrChannel, meanTensor, stdDevTensor, newDims, srcStride, newAxis, tensorDims, 0, 0, size, 0, lastNormAxis); + Rpp32f normFactor = (Rpp32f)(1.0 / totalElements); + rpp_rsqrt_avx(stdDevTensor, (Rpp32s)size, 0, normFactor, scale); + } + + for(Rpp32u i = 0; i < tensorDims; i++) + paramStride[i] = !newAxis[i]; + + Rpp32u idx = 0; + normalize_ND_tensor_nontoggle(srcPtrChannel, srcStride, dstPtrTemp, meanTensor, stdDevTensor, shift, paramStride, newDims, tensorDims, 0, idx); + } + } + + return RPP_SUCCESS; +} +template +RppStatus normalize_generic_host_tensor(T1 *srcPtr, + RpptGenericDescPtr srcGenericDescPtr, + T2 *dstPtr, + RpptGenericDescPtr dstGenericDescPtr, + Rpp32u axisMask, + Rpp32f *meanTensorPtr, + Rpp32f *stdDevTensorPtr, + Rpp8u computeMeanStddev, + Rpp32f scale, + Rpp32f shift, + Rpp32u *roiTensor, + RppLayoutParams layoutParams, + rpp::Handle& handle) +{ + Rpp32u numThreads = handle.GetNumThreads(); + Rpp32u tensorDims = srcGenericDescPtr->numDims - 1; // Omitting batchSize here to get tensor dimension. + Rpp32u batchSize = dstGenericDescPtr->dims[0]; + + Rpp32u maxSize = 1; + for(int batch = 0; batch < batchSize; batch++) + { + Rpp32u size = 1; // length of input tensors differ based on axisMask and tensorDims + for(int i = 0; i < tensorDims; i++) + size *= ((axisMask & (int)(pow(2, i))) >= 1) ? 1 : roiTensor[(tensorDims * 2 * batch) + tensorDims + i]; + maxSize = std::max(maxSize, size); + } + if(!computeMeanStddev) + { + for(Rpp32u i = 0; i < maxSize; i++) + stdDevTensorPtr[i] = (!stdDevTensorPtr[i])? 1.0f : scale / stdDevTensorPtr[i]; + maxSize = 0; + } + + omp_set_dynamic(0); +#pragma omp parallel for num_threads(numThreads) + for(int batchCount = 0; batchCount < batchSize; batchCount++) + { + int size = 1; + Rpp32u *roi = roiTensor + batchCount * tensorDims * 2; + Rpp32u *begin = roi; + Rpp32u *length = &roi[tensorDims]; + + for(int i = 0; i < tensorDims; i++) + size *= ((axisMask & (int)(pow(2, i))) >= 1) ? 1 : length[i]; + + T1 *srcPtrTemp; + T2 *dstPtrTemp; + Rpp32f *meanTensor, *stdDevTensor; + srcPtrTemp = srcPtr + batchCount * srcGenericDescPtr->strides[0]; + dstPtrTemp = dstPtr + batchCount * dstGenericDescPtr->strides[0]; + meanTensor = meanTensorPtr + batchCount * maxSize; + stdDevTensor = stdDevTensorPtr + batchCount * maxSize; + + // Set all values in dst buffer to 0.0 + for(int cnt = 0; cnt < dstGenericDescPtr->strides[0]; cnt++) + dstPtrTemp[cnt] = 0.0f; + + T1 *srcPtrChannel = srcPtrTemp; + + int totalElements = 1; + Rpp32u lastNormAxis = 0; + Rpp32u axis[tensorDims], newAxis[tensorDims], newDims[tensorDims]; + // Initialize newAxis and newDims used to store final Axis and Dims after removing redundant axis + memset(newAxis, 0, sizeof(newAxis)); + memset(newDims, 0, sizeof(newDims)); + + for(int i = 0; i < tensorDims; i++) + { + axis[i] = ((axisMask & (int)(pow(2, i))) >= 1) ? 1 : 0; + totalElements *= axis[i] ? length[i] : 1; + srcPtrChannel += begin[i] * srcGenericDescPtr->strides[i + 1]; + } + + Rpp32u paramStride[tensorDims], srcStride[tensorDims]; + collapse_axis(&tensorDims, axis, length, newAxis, newDims, &lastNormAxis); + compute_strides(srcStride, newDims, tensorDims); + + if(computeMeanStddev & 1) // Check if mean is to be computed internally + { + compute_ND_mean(srcPtrChannel, meanTensor, newDims, srcStride, newAxis, tensorDims, 0, 0, size, 0, lastNormAxis); + Rpp32f normFactor = 1.0 / totalElements; + for(int i = 0; i < size; i++) + meanTensor[i] *= normFactor; + } + if(computeMeanStddev & 2) // Check if stddev is to be computed internally + { + compute_ND_stddev(srcPtrChannel, meanTensor, stdDevTensor, newDims, srcStride, newAxis, tensorDims, 0, 0, size, 0, lastNormAxis); + Rpp32f normFactor = (Rpp32f)(1.0 / totalElements); + rpp_rsqrt_avx(stdDevTensor, (Rpp32s)size, 0, normFactor, scale); + } + + for(int i = 0; i < tensorDims; i++) + paramStride[i] = !newAxis[i]; + + Rpp32u idx = 0; + normalize_ND_tensor_nontoggle(srcPtrChannel, srcStride, dstPtrTemp, meanTensor, stdDevTensor, shift, paramStride, newDims, tensorDims, 0, idx); + } + + return RPP_SUCCESS; +} \ No newline at end of file diff --git a/src/modules/hip/hip_tensor_statistical_operations.hpp b/src/modules/hip/hip_tensor_statistical_operations.hpp index c79e0a951..6923b9a3f 100644 --- a/src/modules/hip/hip_tensor_statistical_operations.hpp +++ b/src/modules/hip/hip_tensor_statistical_operations.hpp @@ -27,5 +27,6 @@ SOFTWARE. #include "kernel/tensor_sum.hpp" #include "kernel/tensor_min.hpp" #include "kernel/tensor_max.hpp" +#include "kernel/normalize.hpp" #endif // HIP_TENSOR_STATISTICAL_OPERATIONS_HPP diff --git a/src/modules/hip/kernel/normalize.hpp b/src/modules/hip/kernel/normalize.hpp new file mode 100644 index 000000000..384454ca7 --- /dev/null +++ b/src/modules/hip/kernel/normalize.hpp @@ -0,0 +1,1921 @@ +#include +#include "rpp_hip_common.hpp" + +#define MAX_SHARED_MEMORY_SIZE 1024 + +// -------------------- Set 0 - normalization kernels device helpers -------------------- + +__device__ __forceinline__ void normalize_check_and_store(float outVal, uchar* dst) +{ + outVal = fmax(fminf(outVal, 255), 0); + *dst = static_cast(outVal); +} + +__device__ __forceinline__ void normalize_check_and_store(float outVal, schar* dst) +{ + outVal = fmax(fminf(outVal, 127), -128); + *dst = static_cast(outVal); +} + +__device__ __forceinline__ void normalize_check_and_store(float outVal, float* dst) +{ + *dst = outVal; +} + +__device__ __forceinline__ void normalize_check_and_store(float outVal, half* dst) +{ + *dst = static_cast(outVal); +} + +// -------------------- Set 1 - normalization kernel host helpers -------------------- + +// setup function needed for 2D/3D optimized kernel variants when mean and stddev needs to be internally computed +void normalize_setup_2d_and_3d(Rpp32u *roiTensor, Rpp32u batchSize, Rpp32u tensorDims, + Rpp32u axisMask, Rpp32u &maxParamVolume) +{ + maxParamVolume = 1; + uint axisSet[RPPT_MAX_DIMS]; + for(int i = 0; i < tensorDims; i++) + axisSet[i] = ((axisMask & (int)(pow(2, i))) >= 1) ? 1 : 0; + + for(uint i = 0; i < batchSize; i++) + { + // calculate the max param volume + Rpp32u paramVolume = 1; + Rpp32u *roi = &roiTensor[tensorDims * 2 * i + tensorDims]; + for(uint j = 0; j < tensorDims; j++) + paramVolume *= (axisSet[j]) ? 1 : roi[j]; + maxParamVolume = std::max(maxParamVolume, paramVolume); + } +} + +// setup function needed for ND generic kernel variants +void normalize_setup_nd(Rpp32u *roiTensor, Rpp32u batchSize, Rpp32u tensorDims, Rpp32u axisMask, + Rpp32u *paramShapeTensor, Rpp32u *paramStridesTensor, Rpp32u &maxParamVolume) +{ + maxParamVolume = 1; + uint axisSet[RPPT_MAX_DIMS]; + for(int i = 0; i < tensorDims; i++) + axisSet[i] = ((axisMask & (int)(pow(2, i))) >= 1) ? 1 : 0; + + for(uint i = 0; i < batchSize; i++) + { + // calculate the param shape and param volume based on the axis mask + Rpp32u paramVolume = 1; + Rpp32u *roi = &roiTensor[tensorDims * 2 * i + tensorDims]; + Rpp32u *paramShape = ¶mShapeTensor[i * tensorDims]; + for(uint j = 0; j < tensorDims; j++) + { + paramShape[j] = (axisSet[j]) ? 1 : roi[j]; + paramVolume *= paramShape[j]; + } + maxParamVolume = std::max(maxParamVolume, paramVolume); + + // calculate the param strides from the param shape + Rpp32u *paramStrides = ¶mStridesTensor[i * tensorDims]; + Rpp32u val = 1; + for(uint j = tensorDims - 1; j > 0; j--) + { + paramStrides[j] = val; + val *= paramShape[j]; + } + paramStrides[0] = val; + } +} + +// -------------------- Set 2 - normalization kernels -------------------- + +template +__global__ void normalize_2d_hip_tensor(T *srcPtr, + uint2 srcStridesNH, + T *dstPtr, + uint2 dstStridesNH, + float *meanTensor, + float *stdDevTensor, + float2 scaleAndShift, + uint *roiTensor, + uint2 maxParamVolumeAndAxisMask, + bool computeStdDev) +{ + uint id_x = hipBlockIdx_x * hipBlockDim_x + hipThreadIdx_x; // width + uint id_y = hipBlockIdx_y * hipBlockDim_y + hipThreadIdx_y; // height + uint id_z = hipBlockIdx_z * hipBlockDim_z + hipThreadIdx_z; // batchsize + + uint *roi = &roiTensor[id_z * 4]; + uint yBegin = roi[0]; + uint xBegin = roi[1]; + uint height = roi[2]; + uint width = roi[3]; + + if (id_x >= width || id_y >= height) + return; + + uint maxParamVolume = maxParamVolumeAndAxisMask.x; + uint axisMask = maxParamVolumeAndAxisMask.y; + uint paramIndex = id_z * maxParamVolume; + // update paramIndex based on axisMask value + if (axisMask == 1) + paramIndex += id_x; + else if (axisMask == 2) + paramIndex += id_y; + + uint srcIdx = (id_z * srcStridesNH.x) + ((id_y + yBegin) * srcStridesNH.y) + id_x + xBegin; + uint dstIdx = (id_z * dstStridesNH.x) + (id_y * dstStridesNH.y) + id_x; + float mean = meanTensor[paramIndex]; + float stdDev = stdDevTensor[paramIndex]; + float scale = scaleAndShift.x; + float shift = scaleAndShift.y; + float invStdDev; + if (computeStdDev) + { + float stdDevSquare = stdDev * stdDev; + invStdDev = stdDevSquare ? rsqrtf(stdDevSquare) * scale : 0; + } + else + { + invStdDev = (stdDev) ? (scale * (1.0f / stdDev)) : 1.0f; + } + float outVal = fmaf((static_cast(srcPtr[srcIdx]) - mean), invStdDev, shift); + normalize_check_and_store(outVal, &dstPtr[dstIdx]); +} + +template +__global__ void normalize_3d_hip_tensor(T *srcPtr, + uint2 srcStridesDH, + T *dstPtr, + uint2 dstStridesDH, + float *meanTensor, + float *stdDevTensor, + float2 scaleAndShift, + uint *roiTensor, + uint axisMask, + bool computeStdDev) +{ + uint id_x = hipBlockIdx_x * hipBlockDim_x + hipThreadIdx_x; // lengthX + uint id_y = hipBlockIdx_y * hipBlockDim_y + hipThreadIdx_y; // lengthY + uint id_z = hipBlockIdx_z * hipBlockDim_z + hipThreadIdx_z; // lengthZ + + uint *roi = roiTensor; + uint zBegin = roi[0]; + uint yBegin = roi[1]; + uint xBegin = roi[2]; + uint lengthZ = roi[3]; + uint lengthY = roi[4]; + uint lengthX = roi[5]; + + if (id_x >= lengthX || id_y >= lengthY || id_z >= lengthZ) + return; + + uint paramIndex = 0; + // update paramIndex based on axisMask value + if (axisMask == 1) + paramIndex += id_y * lengthX + id_x; + else if (axisMask == 2) + paramIndex += id_z * lengthX + id_x; + else if (axisMask == 4) + paramIndex += id_z * lengthY + id_y; + else if (axisMask == 3) + paramIndex += id_x; + else if (axisMask == 5) + paramIndex += id_y; + else if (axisMask == 6) + paramIndex += id_z; + + uint srcIdx = ((id_z + zBegin) * srcStridesDH.x) + ((id_y + yBegin) * srcStridesDH.y) + id_x + xBegin; + uint dstIdx = (id_z * dstStridesDH.x) + (id_y * dstStridesDH.y) + id_x; + float mean = meanTensor[paramIndex]; + float stdDev = stdDevTensor[paramIndex]; + float scale = scaleAndShift.x; + float shift = scaleAndShift.y; + float invStdDev; + if (computeStdDev) + { + float stdDevSquare = stdDev * stdDev; + invStdDev = stdDevSquare ? rsqrtf(stdDevSquare) * scale : 0; + } + else + { + invStdDev = (stdDev) ? (scale * (1.0f / stdDev)) : 1.0f; + } + float outVal = fmaf((static_cast(srcPtr[srcIdx]) - mean), invStdDev, shift); + normalize_check_and_store(outVal, &dstPtr[dstIdx]); +} + +template +__global__ void normalize_nd_hip_tensor(T *srcPtr, + uint *srcMaxDims, + uint *srcStrides, + T *dstPtr, + float *meanTensor, + float *stdDevTensor, + float2 scaleAndShift, + uint *roiTensor, + uint *paramShapeTensor, + uint *paramStridesTensor, + uint2 maxParamVolumeAndBufferLength, + uint tensorDims, + bool computeStdDev) +{ + uint id_x = hipBlockIdx_x * hipBlockDim_x + hipThreadIdx_x; + uint id_z = hipBlockIdx_z * hipBlockDim_z + hipThreadIdx_z; + uint maxBufferLength = maxParamVolumeAndBufferLength.y; + + if (id_x >= maxBufferLength) + return; + + uint *begin = &roiTensor[id_z * tensorDims * 2]; + uint *length = &roiTensor[id_z * tensorDims * 2 + tensorDims]; + uint *paramShape = ¶mShapeTensor[id_z * tensorDims]; + uint *paramStrides = ¶mStridesTensor[id_z * tensorDims]; + uint maxParamVolume = maxParamVolumeAndBufferLength.x; + uint srcIdx = id_z * maxBufferLength; + + uint paramIndex = id_z * maxParamVolume; + for (int i = 0; i < tensorDims; i++) + { + uint coord = id_x / srcStrides[i] % srcMaxDims[i]; + srcIdx += ((begin[i] + coord) * srcStrides[i]); + if (coord >= length[i]) + return; + paramIndex += (maxParamVolume != 1) ? ((coord % paramShape[i]) * paramStrides[i]) : 0; + } + + float mean = meanTensor[paramIndex]; + float stdDev = stdDevTensor[paramIndex]; + float scale = scaleAndShift.x; + float shift = scaleAndShift.y; + float invStdDev; + if (computeStdDev) + { + float stdDevSquare = stdDev * stdDev; + invStdDev = stdDevSquare ? rsqrtf(stdDevSquare) * scale : 0; + } + else + { + invStdDev = (stdDev) ? (scale * (1.0f / stdDev)) : 1.0f; + } + uint dstIdx = id_z * maxBufferLength + id_x; + float outVal = fmaf((static_cast(srcPtr[srcIdx]) - mean), invStdDev, shift); + normalize_check_and_store(outVal, &dstPtr[dstIdx]); +} + +// -------------------- Set 3 - mean and stddev compute kernels device helpers -------------------- + +__device__ __forceinline__ void reduction_sum_x_hip(float *partialSum_smem) +{ + for(uint threadMax = hipBlockDim_x / 2; threadMax >= 1; threadMax /= 2) + { + if (hipThreadIdx_x < threadMax) + partialSum_smem[hipThreadIdx_x] += partialSum_smem[hipThreadIdx_x + threadMax]; + __syncthreads(); + } +} + +// -------------------- Set 4 - mean compute kernels (reduction stage 1) -------------------- + +template +__global__ void compute_mean_2d_hip_tensor(T *srcPtr, + uint2 srcStridesNH, + float *meanTensor, + float *partialSumTensor, + uint *roiTensor, + uint maxParamVolume, + uint axisMask) +{ + int id_x = hipBlockIdx_x * hipBlockDim_x + hipThreadIdx_x; + int id_y = hipBlockIdx_y * hipBlockDim_y + hipThreadIdx_y; + int id_z = hipBlockIdx_z * hipBlockDim_z + hipThreadIdx_z; + + uint *roi = &roiTensor[id_z * 4]; + uint yBegin = roi[0]; + uint xBegin = roi[1]; + uint height = roi[2]; + uint width = roi[3]; + + // compute column wise mean + if (axisMask == 1) + { + if ((id_y >= height) || (id_x >= width)) + { + return; + } + + uint srcIdx = (id_z * srcStridesNH.x) + (yBegin * srcStridesNH.y) + (id_x + xBegin); + uint dstIdx = id_z * maxParamVolume + id_x; + if (id_x < width) + { + float accum = 0.0f; + for(int i = 0; i < height; i++) + { + accum += static_cast(srcPtr[srcIdx]); + srcIdx += srcStridesNH.y; + } + meanTensor[dstIdx] = accum / static_cast(height); + } + } + // compute partial sums needed for row wise mean + else if (axisMask == 2) + { + id_x *= 8; + __shared__ float partialRowSum_smem[256]; + partialRowSum_smem[hipThreadIdx_x] = 0.0f; + + if ((id_y >= height) || (id_x >= width)) + { + return; + } + + int xAlignedLength = width & ~7; // alignedLength for vectorized global loads + int xDiff = width - xAlignedLength; // difference between roiWidth and alignedLength + uint srcIdx = (id_z * srcStridesNH.x) + ((id_y + yBegin) * srcStridesNH.y) + (id_x + xBegin); + + d_float8 src_f8; + rpp_hip_load8_and_unpack_to_float8(srcPtr + srcIdx, &src_f8); // load 8 pixels to local memory + if (id_x + 8 > width) + { + for(int i = xDiff; i < 8; i++) + src_f8.f1[i] = 0.0f; // local memory reset of invalid values (from the vectorized global load) to 0.0f + } + src_f8.f4[0] += src_f8.f4[1]; // perform small work of vectorized float4 addition + partialRowSum_smem[hipThreadIdx_x] = (src_f8.f1[0] + + src_f8.f1[1] + + src_f8.f1[2] + + src_f8.f1[3]); // perform small work of reducing float4s to float using 256 threads and store in Shared + __syncthreads(); + + // Now do block level reduction sum + reduction_sum_x_hip(partialRowSum_smem); + + // Final store to dst + if (hipThreadIdx_x == 0) + { + uint paramIndex = (id_z * hipGridDim_y * hipGridDim_x) + (id_y * hipGridDim_x) + hipBlockIdx_x; + partialSumTensor[paramIndex] = partialRowSum_smem[0]; + } + } + // compute partial sums need for computing mean over entire rows and columns + else if (axisMask == 3) + { + id_x *= 8; + __shared__ float partialSum_smem[16][16]; // 16 rows of src, 128 reduced cols of src in a 16 x 16 thread block + float *partialSumRowPtr_smem = &partialSum_smem[hipThreadIdx_y][0]; // float pointer to beginning of each row in Shared + partialSumRowPtr_smem[hipThreadIdx_x] = 0.0f; // initialization of Shared to 0.0f using all 16 x 16 threads + + if ((id_y >= height) || (id_x >= width)) + { + return; + } + + int xAlignedLength = width & ~7; // alignedLength for vectorized global loads + int xDiff = width - xAlignedLength; // difference between roiWidth and alignedLength + uint srcIdx = (id_z * srcStridesNH.x) + ((id_y + yBegin) * srcStridesNH.y) + (id_x + xBegin); + + d_float8 src_f8; + rpp_hip_load8_and_unpack_to_float8(srcPtr + srcIdx, &src_f8); // load 8 pixels to local memory + if (id_x + 8 > width) + { + for(int i = xDiff; i < 8; i++) + src_f8.f1[i] = 0.0f; // local memory reset of invalid values (from the vectorized global load) to 0.0f + } + src_f8.f4[0] += src_f8.f4[1]; // perform small work of vectorized float4 addition + partialSumRowPtr_smem[hipThreadIdx_x] = (src_f8.f1[0] + + src_f8.f1[1] + + src_f8.f1[2] + + src_f8.f1[3]); // perform small work of reducing float4s to float using 16 x 16 threads and store in Shared + __syncthreads(); // syncthreads after Shared load + + // Reduction of 16 floats on 16 threads per block in x dimension (for every y dimension) + reduction_sum_x_hip(partialSumRowPtr_smem); + + if (hipThreadIdx_x == 0) + { + // Reduction of 16 floats on 16 threads per block in y dimension + for (int threadMax = 8, increment = 128; threadMax >= 1; threadMax /= 2, increment /= 2) + { + if (hipThreadIdx_y < threadMax) + partialSumRowPtr_smem[0] += partialSumRowPtr_smem[increment]; + __syncthreads(); + } + + // Final store to dst + if (hipThreadIdx_y == 0) + partialSumTensor[(hipBlockIdx_z * hipGridDim_y + hipBlockIdx_y) * hipGridDim_x + hipBlockIdx_x] = partialSumRowPtr_smem[0]; + } + } +} + +template +__global__ void compute_mean_3d_hip_tensor(T *srcPtr, + uint3 srcStridesNZY, + float *meanTensor, + uint *roiTensor, + float *partialSumTensor, + uint maxParamVolume, + uint axisMask) +{ + int id_x = hipBlockIdx_x * hipBlockDim_x + hipThreadIdx_x; + int id_y = hipBlockIdx_y * hipBlockDim_y + hipThreadIdx_y; + int id_z = hipBlockIdx_z * hipBlockDim_z + hipThreadIdx_z; + + uint *roi = &roiTensor[id_z * 6]; + uint zBegin = roi[0]; + uint yBegin = roi[1]; + uint xBegin = roi[2]; + uint lengthZ = roi[3]; + uint lengthY = roi[4]; + uint lengthX = roi[5]; + + // compute mean along z direction + if (axisMask == 1) + { + if (id_x >= lengthX || id_y >= lengthY) + return; + + uint srcIdx = (id_z * srcStridesNZY.x) + (zBegin * srcStridesNZY.y) + ((id_y + yBegin) * srcStridesNZY.z) + (id_x + xBegin); + uint dstIdx = id_z * maxParamVolume + id_y * lengthX + id_x; + float accum = 0.0f; + for(uint i = 0; i < lengthZ; i++) + { + accum += static_cast(srcPtr[srcIdx]); + srcIdx += srcStridesNZY.y; + } + meanTensor[dstIdx] = accum / static_cast(lengthZ); + } + // compute mean along y direction + else if (axisMask == 2) + { + if (id_x >= lengthX || id_y >= lengthZ) + return; + + uint srcIdx = (id_z * srcStridesNZY.x) + ((id_y + zBegin) * srcStridesNZY.y) + (yBegin * srcStridesNZY.z) + (id_x + xBegin); + uint dstIdx = id_z * maxParamVolume + id_y * lengthX + id_x; + float accum = 0.0f; + for(uint i = 0; i < lengthY; i++) + { + accum += static_cast(srcPtr[srcIdx]); + srcIdx += srcStridesNZY.z; + } + meanTensor[dstIdx] = accum / static_cast(lengthY); + } + // compute mean along x direction + else if (axisMask == 4) + { + if (id_x >= lengthY || id_y >= lengthZ) + return; + + uint srcIdx = (id_z * srcStridesNZY.x) + ((id_y + zBegin) * srcStridesNZY.y) + ((id_x + yBegin) * srcStridesNZY.z) + xBegin; + d_float8 accum_f8; + accum_f8.f4[0] = (float4)0.0f; + accum_f8.f4[1] = (float4)0.0f; + for(int i = 0; i < lengthX; i += 8) + { + d_float8 src_f8; + rpp_hip_load8_and_unpack_to_float8(srcPtr + srcIdx, &src_f8); + if (i + 8 > lengthX) + { + int xDiff = i + 8 - lengthX; + for(int i = xDiff; i < 8; i++) + src_f8.f1[i] = 0.0f; + } + accum_f8.f4[0] += src_f8.f4[0]; + accum_f8.f4[1] += src_f8.f4[1]; + srcIdx += 8; + } + accum_f8.f4[0] += accum_f8.f4[1]; + accum_f8.f1[0] = (accum_f8.f1[0] + accum_f8.f1[1] + accum_f8.f1[2] + accum_f8.f1[3]); + uint dstIdx = id_z * maxParamVolume + id_y * lengthY + id_x; + meanTensor[dstIdx] = accum_f8.f1[0] / static_cast(lengthX); + } + // compute partial sums required for computing mean along z-y direction + else if (axisMask == 3) + { + for(uint xIndex = 0; xIndex < lengthX; xIndex++) + { + __shared__ float partialSum_smem[16][16]; + float *partialSumRowPtr_smem = &partialSum_smem[hipThreadIdx_y][0]; // float pointer to beginning of each row in Shared + partialSumRowPtr_smem[hipThreadIdx_x] = 0.0f; // initialization of Shared to 0.0f using all 16 x 16 threads + + if ((id_x >= lengthY) || (id_y >= lengthZ)) + { + return; + } + + uint srcIdx = (id_z * srcStridesNZY.x) + ((id_y + zBegin) * srcStridesNZY.y) + ((id_x + yBegin) * srcStridesNZY.z) + (xBegin + xIndex); + partialSumRowPtr_smem[hipThreadIdx_x] = static_cast(srcPtr[srcIdx]); + __syncthreads(); // syncthreads after Shared load + + // Reduction of 16 floats on 16 threads per block in x dimension (for every y dimension) + for (int threadMax = 8; threadMax >= 1; threadMax /= 2) + { + if (hipThreadIdx_x < threadMax) + partialSumRowPtr_smem[hipThreadIdx_x] += partialSumRowPtr_smem[hipThreadIdx_x + threadMax]; + __syncthreads(); + } + + if (hipThreadIdx_x == 0) + { + // Reduction of 16 floats on 16 threads per block in z dimension + for (int threadMax = 8, increment = 128; threadMax >= 1; threadMax /= 2, increment /= 2) + { + if (hipThreadIdx_y < threadMax) + partialSumRowPtr_smem[0] += partialSumRowPtr_smem[increment]; + __syncthreads(); + } + + // Final store to dst + if (hipThreadIdx_y == 0) + { + uint dstIdx = (id_z * srcStridesNZY.z * hipGridDim_y * hipGridDim_x) + (hipBlockIdx_y * hipGridDim_x + hipBlockIdx_x) + (xIndex * hipGridDim_y * hipGridDim_x); + partialSumTensor[dstIdx] = partialSumRowPtr_smem[0]; + } + } + __syncthreads(); + } + } + // compute partial sums required for computing mean along y-x direction + else if (axisMask == 6) + { + __shared__ float partialSum_smem[256]; + partialSum_smem[hipThreadIdx_x] = 0.0f; + __syncthreads(); + + if (id_x >= lengthY || id_y >= lengthZ) + return; + + uint maxLengthZ = srcStridesNZY.x / srcStridesNZY.y; + uint srcIdx = (id_z * srcStridesNZY.x) + ((id_y + zBegin) * srcStridesNZY.y) + ((id_x + yBegin) * srcStridesNZY.z) + xBegin; + d_float8 accum_f8; + accum_f8.f4[0] = (float4)0.0f; + accum_f8.f4[1] = (float4)0.0f; + for(int i = 0; i < lengthX; i += 8) + { + d_float8 src_f8; + rpp_hip_load8_and_unpack_to_float8(srcPtr + srcIdx, &src_f8); + if (i + 8 > lengthX) + { + int xDiff = lengthX - i; + for(int j = xDiff; j < 8; j++) + src_f8.f1[j] = 0.0f; + } + accum_f8.f4[0] += src_f8.f4[0]; + accum_f8.f4[1] += src_f8.f4[1]; + srcIdx += 8; + } + accum_f8.f4[0] += accum_f8.f4[1]; + accum_f8.f1[0] = (accum_f8.f1[0] + accum_f8.f1[1] + accum_f8.f1[2] + accum_f8.f1[3]); + partialSum_smem[hipThreadIdx_x] = accum_f8.f1[0]; + __syncthreads(); + + // Reduction of 16 floats on 16 threads per block in x dimension (for every y dimension) + reduction_sum_x_hip(partialSum_smem); + + if (hipThreadIdx_x == 0) + { + uint dstIdx = (id_z * maxLengthZ * hipGridDim_x) + hipBlockIdx_y * hipGridDim_x + hipBlockIdx_x; + partialSumTensor[dstIdx] = partialSum_smem[0]; + } + } + // compute mean along z-x direction + else if (axisMask == 5) + { + __shared__ float partialSum_smem[32]; + partialSum_smem[hipThreadIdx_x] = 0.0f; + + if (hipBlockIdx_x >= lengthY) + return; + + uint dstIdx = id_z * maxParamVolume + hipBlockIdx_x; + float accum = 0.0f; + for (uint i = 0; i < lengthZ; i++) + { + uint tid_x = hipThreadIdx_x; + uint srcIdx = (id_z * srcStridesNZY.x) + ((i + zBegin) * srcStridesNZY.y) + ((hipBlockIdx_x + yBegin) * srcStridesNZY.z) + xBegin; + while (tid_x < lengthX) + { + accum += static_cast(srcPtr[srcIdx + tid_x]); + tid_x += hipBlockDim_x; + } + } + partialSum_smem[hipThreadIdx_x] = accum; + __syncthreads(); + + // perform reduction on shared memory sums + reduction_sum_x_hip(partialSum_smem); + + if (hipThreadIdx_x == 0) + meanTensor[dstIdx] = partialSum_smem[0] / static_cast(lengthX * lengthZ); + } + // compute partial sums required for computing mean along z-y-x direction + else if (axisMask == 7) + { + id_x *= 8; + __shared__ float partialSum_smem[16][16]; + float *partialSumRowPtr_smem = &partialSum_smem[hipThreadIdx_y][0]; // float pointer to beginning of each row in Shared + partialSumRowPtr_smem[hipThreadIdx_x] = 0.0f; // initialization of Shared to 0.0f using all 16 x 16 threads + + uint xIndex = id_x % srcStridesNZY.z; + uint yIndex = id_x / srcStridesNZY.z; + if ((xIndex >= lengthX) || (yIndex >= lengthY) || (id_y >= lengthZ)) + { + return; + } + + int xAlignedLength = lengthX & ~7; // alignedLength for vectorized global loads + int xDiff = lengthX - xAlignedLength; // difference between roiWidth and alignedLength + uint srcIdx = (id_z * srcStridesNZY.x) + ((id_y + zBegin) * srcStridesNZY.y) + ((yIndex + yBegin) * srcStridesNZY.z) + (xIndex + xBegin); + + d_float8 src_f8; + rpp_hip_load8_and_unpack_to_float8(srcPtr + srcIdx, &src_f8); // load 8 pixels to local memory + if (xIndex + 8 > lengthX) + { + for(int i = xDiff; i < 8; i++) + src_f8.f1[i] = 0.0f; // local memory reset of invalid values (from the vectorized global load) to 0.0f + } + src_f8.f4[0] += src_f8.f4[1]; + partialSumRowPtr_smem[hipThreadIdx_x] = (src_f8.f1[0] + + src_f8.f1[1] + + src_f8.f1[2] + + src_f8.f1[3]); + __syncthreads(); + + // Reduction of 16 floats on 16 threads per block in x dimension (for every y dimension) + reduction_sum_x_hip(partialSumRowPtr_smem); + + if (hipThreadIdx_x == 0) + { + // Reduction of 16 floats on 16 threads per block in y dimension + for (int threadMax = 8, increment = 128; threadMax >= 1; threadMax /= 2, increment /= 2) + { + if (hipThreadIdx_y < threadMax) + partialSumRowPtr_smem[0] += partialSumRowPtr_smem[increment]; + __syncthreads(); + } + + // Final store to dst + if (hipThreadIdx_y == 0) + { + uint dstIdx = (id_z * hipGridDim_y * hipGridDim_x) + (hipBlockIdx_y * hipGridDim_x + hipBlockIdx_x); + partialSumTensor[dstIdx] = partialSumRowPtr_smem[0]; + } + } + } +} + +template +__global__ void compute_mean_nd_hip_tensor(T *srcPtr, + uint *srcMaxDims, + uint *srcStrides, + float *meanTensor, + uint *roiTensor, + uint *paramShapeTensor, + uint *paramStridesTensor, + uint maxParamVolume, + uint tensorDims, + uint maxBufferLength) +{ + uint id_x = hipBlockIdx_x * hipBlockDim_x + hipThreadIdx_x; + uint id_z = hipBlockIdx_z * hipBlockDim_z + hipThreadIdx_z; + + uint *begin = &roiTensor[id_z * tensorDims * 2]; + uint *length = &roiTensor[id_z * tensorDims * 2 + tensorDims]; + uint *paramShape = ¶mShapeTensor[id_z * tensorDims]; + uint *paramStrides = ¶mStridesTensor[id_z * tensorDims]; + uint srcIdx = id_z * maxBufferLength; + uint paramBase = id_z * maxParamVolume; + uint paramIndex = 0; + + if (maxParamVolume > MAX_SHARED_MEMORY_SIZE) + { + if (id_x >= maxBufferLength) + return; + + // validate if id_x is within the roi of input and compute paramIndex if valid + for (int i = 0; i < tensorDims; i++) + { + uint coord = id_x / srcStrides[i] % srcMaxDims[i]; + srcIdx += ((begin[i] + coord) * srcStrides[i]); + if (coord >= length[i]) + return; + paramIndex += (maxParamVolume > 1) ? ((coord % paramShape[i]) * paramStrides[i]) : 0; + } + atomicAdd(&meanTensor[paramBase + paramIndex], static_cast(srcPtr[srcIdx])); + } + else + { + + if (id_x >= (hipBlockDim_x * hipGridDim_x)) + return; + + // if number of means needed to compute is within in the max shared memory size + // use shared memory for atomic addition to reduce global memory traffic + bool isValid = true; + for (int i = 0; i < tensorDims; i++) + { + uint coord = id_x / srcStrides[i] % srcMaxDims[i]; + srcIdx += ((begin[i] + coord) * srcStrides[i]); + if (coord >= length[i]) + { + isValid = false; + break; + } + paramIndex += (maxParamVolume > 1) ? ((coord % paramShape[i]) * paramStrides[i]) : 0; + } + + extern __shared__ float sh_mem[]; + sh_mem[hipThreadIdx_x] = 0.0f; + __syncthreads(); + + if (isValid && id_x < maxBufferLength) + atomicAdd(&sh_mem[paramIndex], static_cast(srcPtr[srcIdx])); + __syncthreads(); + + if (hipThreadIdx_x < maxParamVolume) + atomicAdd(&meanTensor[paramBase + hipThreadIdx_x], sh_mem[hipThreadIdx_x]); + } +} + +// -------------------- Set 5 - stddev compute kernels (reduction stage 1) -------------------- + +template +__global__ void compute_stddev_2d_hip_tensor(T *srcPtr, + uint2 srcStridesNH, + float *meanTensor, + float *stdDevTensor, + float *partialSumTensor, + uint *roiTensor, + uint maxParamVolume, + uint axisMask) +{ + int id_x = hipBlockIdx_x * hipBlockDim_x + hipThreadIdx_x; + int id_y = hipBlockIdx_y * hipBlockDim_y + hipThreadIdx_y; + int id_z = hipBlockIdx_z * hipBlockDim_z + hipThreadIdx_z; + + uint *roi = &roiTensor[id_z * 4]; + uint yBegin = roi[0]; + uint xBegin = roi[1]; + uint height = roi[2]; + uint width = roi[3]; + + // compute column wise stdDev + if (axisMask == 1) + { + if ((id_y >= height) || (id_x >= width)) + { + return; + } + + uint srcIdx = (id_z * srcStridesNH.x) + (yBegin * srcStridesNH.y) + (id_x + xBegin); + uint paramIndex = id_z * maxParamVolume + id_x; + float mean = meanTensor[paramIndex]; + if (id_x < width) + { + float accum = 0.0f; + for(int i = 0; i < height; i++) + { + float val = (static_cast(srcPtr[srcIdx]) - mean); + accum += (val * val); + srcIdx += srcStridesNH.y; + } + stdDevTensor[paramIndex] = sqrtf(accum / static_cast(height)); + } + } + // compute partial mean subtracted squared sums needed for row wise stdDev + else if (axisMask == 2) + { + id_x *= 8; + __shared__ float partialRowSum_smem[256]; + partialRowSum_smem[hipThreadIdx_x] = 0.0f; + + if ((id_y >= height) || (id_x >= width)) + { + return; + } + + int xAlignedLength = width & ~7; // alignedLength for vectorized global loads + int xDiff = width - xAlignedLength; // difference between roiWidth and alignedLength + uint srcIdx = (id_z * srcStridesNH.x) + ((id_y + yBegin) * srcStridesNH.y) + (id_x + xBegin); + + uint paramIndex = id_z * maxParamVolume + id_y; + float mean = meanTensor[paramIndex]; + float4 mean_f4 = static_cast(mean); + + d_float8 src_f8; + rpp_hip_load8_and_unpack_to_float8(srcPtr + srcIdx, &src_f8); // load 8 pixels to local memory + rpp_hip_math_subtract8_const(&src_f8, &src_f8, mean_f4); + rpp_hip_math_multiply8(&src_f8, &src_f8, &src_f8); + + if (id_x + 8 > width) + { + for(int i = xDiff; i < 8; i++) + src_f8.f1[i] = 0.0f; // local memory reset of invalid values (from the vectorized global load) to 0.0f + } + src_f8.f4[0] += src_f8.f4[1]; // perform small work of vectorized float4 addition + partialRowSum_smem[hipThreadIdx_x] = (src_f8.f1[0] + + src_f8.f1[1] + + src_f8.f1[2] + + src_f8.f1[3]); // perform small work of reducing float4s to float using 16 x 16 threads and store in Shared + __syncthreads(); + + // Now do block level reduction sum + reduction_sum_x_hip(partialRowSum_smem); + + // Final store to dst + if (hipThreadIdx_x == 0) + { + uint paramIndex = (id_z * hipGridDim_y * hipGridDim_x) + (id_y * hipGridDim_x) + hipBlockIdx_x; + partialSumTensor[paramIndex] = partialRowSum_smem[0]; + } + } + // compute partial mean subtracted squared sums need for computing stdDev over entire rows and columns + else if (axisMask == 3) + { + id_x *= 8; + __shared__ float partialSum_smem[16][16]; // 16 rows of src, 128 reduced cols of src in a 16 x 16 thread block + float *partialSumRowPtr_smem = &partialSum_smem[hipThreadIdx_y][0]; // float pointer to beginning of each row in Shared + partialSumRowPtr_smem[hipThreadIdx_x] = 0.0f; // initialization of Shared to 0.0f using all 16 x 16 threads + + if ((id_y >= height) || (id_x >= width)) + { + return; + } + + int xAlignedLength = width & ~7; // alignedLength for vectorized global loads + int xDiff = width - xAlignedLength; // difference between roiWidth and alignedLength + uint srcIdx = (id_z * srcStridesNH.x) + ((id_y + yBegin) * srcStridesNH.y) + (id_x + xBegin); + + float mean = meanTensor[id_z]; + float4 mean_f4 = static_cast(mean); + + d_float8 src_f8; + rpp_hip_load8_and_unpack_to_float8(srcPtr + srcIdx, &src_f8); // load 8 pixels to local memory + rpp_hip_math_subtract8_const(&src_f8, &src_f8, mean_f4); + rpp_hip_math_multiply8(&src_f8, &src_f8, &src_f8); + if (id_x + 8 > width) + { + for(int i = xDiff; i < 8; i++) + src_f8.f1[i] = 0.0f; // local memory reset of invalid values (from the vectorized global load) to 0.0f + } + src_f8.f4[0] += src_f8.f4[1]; // perform small work of vectorized float4 addition + partialSumRowPtr_smem[hipThreadIdx_x] = (src_f8.f1[0] + + src_f8.f1[1] + + src_f8.f1[2] + + src_f8.f1[3]); // perform small work of reducing float4s to float using 16 x 16 threads and store in Shared + __syncthreads(); // syncthreads after Shared load + + // Reduction of 16 floats on 16 threads per block in x dimension (for every y dimension) + reduction_sum_x_hip(partialSumRowPtr_smem); + + if (hipThreadIdx_x == 0) + { + // Reduction of 16 floats on 16 threads per block in y dimension + for (int threadMax = 8, increment = 128; threadMax >= 1; threadMax /= 2, increment /= 2) + { + if (hipThreadIdx_y < threadMax) + partialSumRowPtr_smem[0] += partialSumRowPtr_smem[increment]; + __syncthreads(); + } + + // Final store to dst + if (hipThreadIdx_y == 0) + partialSumTensor[(hipBlockIdx_z * hipGridDim_y + hipBlockIdx_y) * hipGridDim_x + hipBlockIdx_x] = partialSumRowPtr_smem[0]; + } + } +} + +template +__global__ void compute_stddev_3d_hip_tensor(T *srcPtr, + uint3 srcStridesNZY, + float *meanTensor, + float *stdDevTensor, + uint *roiTensor, + float *partialSumTensor, + uint maxParamVolume, + uint axisMask) +{ + int id_x = hipBlockIdx_x * hipBlockDim_x + hipThreadIdx_x; + int id_y = hipBlockIdx_y * hipBlockDim_y + hipThreadIdx_y; + int id_z = hipBlockIdx_z * hipBlockDim_z + hipThreadIdx_z; + + uint *roi = &roiTensor[id_z * 6]; + uint zBegin = roi[0]; + uint yBegin = roi[1]; + uint xBegin = roi[2]; + uint lengthZ = roi[3]; + uint lengthY = roi[4]; + uint lengthX = roi[5]; + + // compute stddev along z direction + if (axisMask == 1) + { + if (id_x >= lengthX || id_y >= lengthY) + return; + + uint srcIdx = (id_z * srcStridesNZY.x) + (zBegin * srcStridesNZY.y) + ((id_y + yBegin) * srcStridesNZY.z) + (id_x + xBegin); + uint paramIndex = id_z * maxParamVolume + id_y * lengthX + id_x; + float mean = meanTensor[paramIndex]; + float accum = 0.0f; + for(uint i = 0; i < lengthZ; i++) + { + float val = (static_cast(srcPtr[srcIdx]) - mean); + accum += (val * val); + srcIdx += srcStridesNZY.y; + } + stdDevTensor[paramIndex] = sqrtf(accum / static_cast(lengthZ)); + } + // compute stddev along y direction + else if (axisMask == 2) + { + if (id_x >= lengthX || id_y >= lengthZ) + return; + + uint srcIdx = (id_z * srcStridesNZY.x) + ((id_y + zBegin) * srcStridesNZY.y) + (yBegin * srcStridesNZY.z) + (id_x + xBegin); + uint paramIndex = id_z * maxParamVolume + id_y * lengthX + id_x; + float mean = meanTensor[paramIndex]; + float accum = 0.0f; + for(uint i = 0; i < lengthY; i++) + { + float val = (static_cast(srcPtr[srcIdx]) - mean); + accum += (val * val); + srcIdx += srcStridesNZY.z; + } + stdDevTensor[paramIndex] = sqrtf(accum / static_cast(lengthY)); + } + // compute stddev along x direction + else if (axisMask == 4) + { + if (id_x >= lengthY || id_y >= lengthZ) + return; + + uint srcIdx = (id_z * srcStridesNZY.x) + ((id_y + zBegin) * srcStridesNZY.y) + ((id_x + yBegin) * srcStridesNZY.z) + xBegin; + uint paramIndex = id_z * maxParamVolume + id_y * lengthY + id_x; + float mean = meanTensor[paramIndex]; + float4 mean_f4 = static_cast(mean); + d_float8 accum_f8; + accum_f8.f4[0] = (float4)0.0f; + accum_f8.f4[1] = (float4)0.0f; + for(int i = 0; i < lengthX; i += 8) + { + d_float8 src_f8; + rpp_hip_load8_and_unpack_to_float8(srcPtr + srcIdx, &src_f8); + rpp_hip_math_subtract8_const(&src_f8, &src_f8, mean_f4); + rpp_hip_math_multiply8(&src_f8, &src_f8, &src_f8); + if (i + 8 > lengthX) + { + int xDiff = i + 8 - lengthX; + for(int i = xDiff; i < 8; i++) + src_f8.f1[i] = 0.0f; + } + accum_f8.f4[0] += src_f8.f4[0]; + accum_f8.f4[1] += src_f8.f4[1]; + srcIdx += 8; + } + accum_f8.f4[0] += accum_f8.f4[1]; + accum_f8.f1[0] = (accum_f8.f1[0] + accum_f8.f1[1] + accum_f8.f1[2] + accum_f8.f1[3]); + + stdDevTensor[paramIndex] = sqrtf(accum_f8.f1[0] / static_cast(lengthX)); + } + // compute partial mean subtracted squared sums required for computing stdDev along z-y direction + else if (axisMask == 3) + { + for(uint xIndex = 0; xIndex < lengthX; xIndex++) + { + __shared__ float partialSum_smem[16][16]; + float *partialSumRowPtr_smem = &partialSum_smem[hipThreadIdx_y][0]; // float pointer to beginning of each row in Shared + partialSumRowPtr_smem[hipThreadIdx_x] = 0.0f; // initialization of Shared to 0.0f using all 16 x 16 threads + + if ((id_x >= lengthY) || (id_y >= lengthZ)) + { + return; + } + + uint paramIndex = id_z * maxParamVolume + xIndex; + float mean = meanTensor[paramIndex]; + uint srcIdx = (id_z * srcStridesNZY.x) + ((id_y + zBegin) * srcStridesNZY.y) + ((id_x + yBegin) * srcStridesNZY.z) + (xBegin + xIndex); + float val = static_cast(srcPtr[srcIdx]) - mean; + partialSumRowPtr_smem[hipThreadIdx_x] = (val * val); + __syncthreads(); // syncthreads after Shared load + + // Reduction of 16 floats on 16 threads per block in x dimension (for every y dimension) + for (int threadMax = 8; threadMax >= 1; threadMax /= 2) + { + if (hipThreadIdx_x < threadMax) + partialSumRowPtr_smem[hipThreadIdx_x] += partialSumRowPtr_smem[hipThreadIdx_x + threadMax]; + __syncthreads(); + } + + if (hipThreadIdx_x == 0) + { + // Reduction of 16 floats on 16 threads per block in z dimension + for (int threadMax = 8, increment = 128; threadMax >= 1; threadMax /= 2, increment /= 2) + { + if (hipThreadIdx_y < threadMax) + partialSumRowPtr_smem[0] += partialSumRowPtr_smem[increment]; + __syncthreads(); + } + + // Final store to dst + if (hipThreadIdx_y == 0) + { + uint dstIdx = (id_z * srcStridesNZY.z * hipGridDim_y * hipGridDim_x) + (hipBlockIdx_y * hipGridDim_x + hipBlockIdx_x) + (xIndex * hipGridDim_y * hipGridDim_x); + partialSumTensor[dstIdx] = partialSumRowPtr_smem[0]; + } + } + __syncthreads(); + } + } + // compute partial mean subtracted squared sums required for computing stdDev along y-x direction + else if (axisMask == 6) + { + __shared__ float partialSum_smem[256]; + partialSum_smem[hipThreadIdx_x] = 0.0f; + __syncthreads(); + + if (id_x >= lengthY || id_y >= lengthZ) + return; + + uint maxLengthZ = srcStridesNZY.x / srcStridesNZY.y; + uint srcIdx = (id_z * srcStridesNZY.x) + ((id_y + zBegin) * srcStridesNZY.y) + ((id_x + yBegin) * srcStridesNZY.z) + xBegin; + + uint paramIndex = id_z * maxParamVolume + id_y; + float mean = meanTensor[paramIndex]; + float4 mean_f4 = static_cast(mean); + + d_float8 accum_f8; + accum_f8.f4[0] = (float4)0.0f; + accum_f8.f4[1] = (float4)0.0f; + for(int i = 0; i < lengthX; i += 8) + { + d_float8 src_f8; + rpp_hip_load8_and_unpack_to_float8(srcPtr + srcIdx, &src_f8); + rpp_hip_math_subtract8_const(&src_f8, &src_f8, mean_f4); + rpp_hip_math_multiply8(&src_f8, &src_f8, &src_f8); + if (i + 8 > lengthX) + { + int xDiff = lengthX - i; + for(int j = xDiff; j < 8; j++) + src_f8.f1[j] = 0.0f; + } + accum_f8.f4[0] += src_f8.f4[0]; + accum_f8.f4[1] += src_f8.f4[1]; + srcIdx += 8; + } + accum_f8.f4[0] += accum_f8.f4[1]; + accum_f8.f1[0] = (accum_f8.f1[0] + accum_f8.f1[1] + accum_f8.f1[2] + accum_f8.f1[3]); + partialSum_smem[hipThreadIdx_x] = accum_f8.f1[0]; + __syncthreads(); + + // Reduction of 16 floats on 16 threads per block in x dimension (for every y dimension) + reduction_sum_x_hip(partialSum_smem); + + if (hipThreadIdx_x == 0) + { + uint dstIdx = (id_z * maxLengthZ * hipGridDim_x) + hipBlockIdx_y * hipGridDim_x + hipBlockIdx_x; + partialSumTensor[dstIdx] = partialSum_smem[0]; + } + } + // compute stddev along z-x direction + else if (axisMask == 5) + { + __shared__ float partialSum_smem[32]; + partialSum_smem[hipThreadIdx_x] = 0.0f; + + if (hipBlockIdx_x >= lengthY) + return; + + uint paramIndex = id_z * maxParamVolume + hipBlockIdx_x; + float mean = meanTensor[paramIndex]; + float accum = 0.0f; + for (uint i = 0; i < lengthZ; i++) + { + uint tid_x = hipThreadIdx_x; + uint srcIdx = (id_z * srcStridesNZY.x) + ((i + zBegin) * srcStridesNZY.y) + ((hipBlockIdx_x + yBegin) * srcStridesNZY.z) + xBegin; + while (tid_x < lengthX) + { + float val = (static_cast(srcPtr[srcIdx + tid_x]) - mean); + accum += (val * val); + tid_x += hipBlockDim_x; + } + } + partialSum_smem[hipThreadIdx_x] = accum; + __syncthreads(); + + // perform reduction on shared memory sums + reduction_sum_x_hip(partialSum_smem); + + if (hipThreadIdx_x == 0) + stdDevTensor[paramIndex] = sqrtf(partialSum_smem[0] / static_cast(lengthX * lengthZ)); + } + // compute partial mean subtracted squared sums required for computing stdDev along z-y-x direction + else if (axisMask == 7) + { + id_x *= 8; + __shared__ float partialSum_smem[16][16]; + float *partialSumRowPtr_smem = &partialSum_smem[hipThreadIdx_y][0]; // float pointer to beginning of each row in Shared + partialSumRowPtr_smem[hipThreadIdx_x] = 0.0f; // initialization of Shared to 0.0f using all 16 x 16 threads + + uint xIndex = id_x % srcStridesNZY.z; + uint yIndex = id_x / srcStridesNZY.z; + if ((xIndex >= lengthX) || (yIndex >= lengthY) || (id_y >= lengthZ)) + { + return; + } + + int xAlignedLength = lengthX & ~7; // alignedLength for vectorized global loads + int xDiff = lengthX - xAlignedLength; // difference between roiWidth and alignedLength + uint srcIdx = (id_z * srcStridesNZY.x) + ((id_y + zBegin) * srcStridesNZY.y) + ((yIndex + yBegin) * srcStridesNZY.z) + (xIndex + xBegin); + + uint paramIndex = id_z * maxParamVolume; + float mean = meanTensor[paramIndex]; + float4 mean_f4 = static_cast(mean); + + d_float8 src_f8; + rpp_hip_load8_and_unpack_to_float8(srcPtr + srcIdx, &src_f8); // load 8 pixels to local memory + rpp_hip_math_subtract8_const(&src_f8, &src_f8, mean_f4); + rpp_hip_math_multiply8(&src_f8, &src_f8, &src_f8); + + if (xIndex + 8 > lengthX) + { + for(int i = xDiff; i < 8; i++) + src_f8.f1[i] = 0.0f; // local memory reset of invalid values (from the vectorized global load) to 0.0f + } + src_f8.f4[0] += src_f8.f4[1]; + partialSumRowPtr_smem[hipThreadIdx_x] = (src_f8.f1[0] + + src_f8.f1[1] + + src_f8.f1[2] + + src_f8.f1[3]); // perform small work of reducing float4s to float using 16 x 16 threads and store in Shared + __syncthreads(); // syncthreads after Shared load + + // Reduction of 16 floats on 16 threads per block in x dimension (for every y dimension) + reduction_sum_x_hip(partialSumRowPtr_smem); + + if (hipThreadIdx_x == 0) + { + // Reduction of 16 floats on 16 threads per block in y dimension + for (int threadMax = 8, increment = 128; threadMax >= 1; threadMax /= 2, increment /= 2) + { + if (hipThreadIdx_y < threadMax) + partialSumRowPtr_smem[0] += partialSumRowPtr_smem[increment]; + __syncthreads(); + } + + // Final store to dst + if (hipThreadIdx_y == 0) + { + uint dstIdx = (id_z * hipGridDim_y * hipGridDim_x) + (hipBlockIdx_y * hipGridDim_x + hipBlockIdx_x); + partialSumTensor[dstIdx] = partialSumRowPtr_smem[0]; + } + } + } +} + +template +__global__ void compute_stddev_nd_hip_tensor(T *srcPtr, + uint *srcMaxDims, + uint *srcStrides, + float *meanTensor, + float *stdDevTensor, + uint *roiTensor, + uint *paramShapeTensor, + uint *paramStridesTensor, + uint maxParamVolume, + uint tensorDims, + uint maxBufferLength) +{ + uint id_x = hipBlockIdx_x * hipBlockDim_x + hipThreadIdx_x; + uint id_z = hipBlockIdx_z * hipBlockDim_z + hipThreadIdx_z; + + uint *begin = &roiTensor[id_z * tensorDims * 2]; + uint *length = &roiTensor[id_z * tensorDims * 2 + tensorDims]; + uint *paramShape = ¶mShapeTensor[id_z * tensorDims]; + uint *paramStrides = ¶mStridesTensor[id_z * tensorDims]; + uint srcIdx = id_z * maxBufferLength; + uint paramBase = id_z * maxParamVolume; + uint paramIndex = 0; + + if (maxParamVolume > MAX_SHARED_MEMORY_SIZE) + { + if (id_x >= maxBufferLength) + return; + + // validate if id_x is within the roi of input and compute paramIndex if valid + for (int i = 0; i < tensorDims; i++) + { + uint coord = id_x / srcStrides[i] % srcMaxDims[i]; + srcIdx += ((begin[i] + coord) * srcStrides[i]); + if (coord >= length[i]) + return; + paramIndex += (maxParamVolume > 1) ? ((coord % paramShape[i]) * paramStrides[i]) : 0; + } + float val = static_cast(srcPtr[srcIdx]) - meanTensor[paramBase + paramIndex]; + atomicAdd(&stdDevTensor[paramBase + paramIndex], (val * val)); + } + else + { + + if (id_x >= (hipBlockDim_x * hipGridDim_x)) + return; + + // if number of means needed to compute is within in the max shared memory size + // use shared memory for atomic addition to reduce global memory traffic + bool isValid = true; + for (int i = 0; i < tensorDims; i++) + { + uint coord = id_x / srcStrides[i] % srcMaxDims[i]; + srcIdx += ((begin[i] + coord) * srcStrides[i]); + if (coord >= length[i]) + { + isValid = false; + break; + } + paramIndex += (maxParamVolume > 1) ? ((coord % paramShape[i]) * paramStrides[i]) : 0; + } + + extern __shared__ float sh_mem[]; + sh_mem[hipThreadIdx_x] = 0.0f; + __syncthreads(); + + if (isValid && id_x < maxBufferLength) + { + float val = static_cast(srcPtr[srcIdx]) - meanTensor[paramBase + paramIndex]; + atomicAdd(&sh_mem[paramIndex], (val * val)); + } + __syncthreads(); + + if (hipThreadIdx_x < maxParamVolume) + atomicAdd(&stdDevTensor[paramBase + hipThreadIdx_x], sh_mem[hipThreadIdx_x]); + } +} + +// -------------------- Set 6 - mean and stddev compute kernels (reduction stage 2) -------------------- + +__global__ void reduce_final_result_hip(float *partialSumTensor, + uint numPartialSums, + float *meanTensor, + float *stdDevTensor, + bool isMean, + uint *roiTensor, + uint axisMask, + uint tensorDims) +{ + int id_x = hipBlockIdx_x * hipBlockDim_x + hipThreadIdx_x; + int id_y = hipBlockIdx_y * hipBlockDim_y + hipThreadIdx_y; + int id_z = hipBlockIdx_z * hipBlockDim_z + hipThreadIdx_z; + uint *roi = &roiTensor[id_z * tensorDims * 2 + tensorDims]; + + uint meanFactor; + if (tensorDims == 3) + { + uint lengthZ = roi[0]; + uint lengthY = roi[1]; + uint lengthX = roi[2]; + + if (axisMask == 3) + meanFactor = lengthZ * lengthY; + else if (axisMask == 6) + meanFactor = lengthY * lengthX; + else if (axisMask == 7) + meanFactor = lengthZ * lengthY * lengthX; + } + else if (tensorDims == 2) + { + uint lengthY = roi[0]; + uint lengthX = roi[1]; + + if (axisMask == 2) + meanFactor = lengthX; + else if (axisMask == 3) + meanFactor = lengthY * lengthX; + } + + __shared__ float partialSum_smem[16]; + partialSum_smem[hipThreadIdx_x] = 0.0f; + + float accum = 0.0f; + while(id_x < numPartialSums) + { + uint srcIdx = (id_z * hipGridDim_y * numPartialSums) + (id_y * numPartialSums) + id_x; + accum += partialSumTensor[srcIdx]; + id_x += hipBlockDim_x; + } + partialSum_smem[hipThreadIdx_x] = accum; + __syncthreads(); + + // Now do block level reduction sum + reduction_sum_x_hip(partialSum_smem); + + // Final store to dst + if (hipThreadIdx_x == 0) + { + if (isMean) + meanTensor[id_z * hipGridDim_y + id_y] = partialSum_smem[0] / meanFactor; + else + stdDevTensor[id_z * hipGridDim_y + id_y] = sqrtf(partialSum_smem[0] / meanFactor); + } +} + +__global__ void final_reduction_nd_hip_tensor(float *meanTensor, + float *stdDevTensor, + uint *paramShapeTensor, + uint *roiTensor, + uint tensorDims, + uint maxParamVolume, + bool isMean) +{ + uint id_x = hipBlockIdx_x * hipBlockDim_x + hipThreadIdx_x; + uint id_z = hipBlockIdx_z * hipBlockDim_z + hipThreadIdx_z; + + uint *paramShape = ¶mShapeTensor[id_z * tensorDims]; + uint *roi = &roiTensor[id_z * tensorDims * 2 + tensorDims]; + + uint divisionFactor = 1; + uint paramVolume = 1; + for(int i = 0; i < tensorDims; i++) + { + paramVolume *= paramShape[i]; + if (paramShape[i] == 1) + divisionFactor *= roi[i]; + } + + if (id_x >= paramVolume) + return; + + uint paramIndex = id_z * maxParamVolume + id_x; + if (isMean) + meanTensor[paramIndex] = meanTensor[paramIndex] / divisionFactor; + else + stdDevTensor[paramIndex] = sqrtf(stdDevTensor[paramIndex] / divisionFactor); +} + +// -------------------- Set 7 - mean and stddev compute kernels launch helpers -------------------- + +void set_kernel_launch_config_2d(RpptGenericDescPtr srcGenericDescPtr, + int &globalThreads_x, + int &globalThreads_y, + int &globalThreads_z, + int &localThreads_x, + int &localThreads_y, + int &localThreads_z, + Rpp32u axisMask, + Rpp32f *partialSumArr, + rpp::Handle& handle) +{ + switch (axisMask) + { + // compute along Y direction + case 1: + { + localThreads_x = 256; + localThreads_y = 1; + localThreads_z = 1; + globalThreads_x = static_cast(ceil((float)srcGenericDescPtr->dims[2] / localThreads_x)); + globalThreads_y = 1; + globalThreads_z = srcGenericDescPtr->dims[0]; + break; + } + // compute along X direction + case 2: + { + localThreads_x = 256; + localThreads_y = 1; + localThreads_z = 1; + globalThreads_x = static_cast (ceil((float)((srcGenericDescPtr->dims[2] + 7) >> 3) / 256)); + globalThreads_y = srcGenericDescPtr->dims[1]; + globalThreads_z = srcGenericDescPtr->dims[0]; + + Rpp32u partialSumArrLength = srcGenericDescPtr->dims[0] * srcGenericDescPtr->dims[1] * globalThreads_x; + hipMemsetAsync(partialSumArr, 0, partialSumArrLength * sizeof(Rpp32f), handle.GetStream()); + hipStreamSynchronize(handle.GetStream()); + break; + } + // compute along XY direction + case 3: + { + localThreads_x = 16; + localThreads_y = 16; + localThreads_z = 1; + globalThreads_x = static_cast (ceil((float)((srcGenericDescPtr->dims[2] + 7) >> 3) / localThreads_x)); + globalThreads_y = static_cast (ceil((float)srcGenericDescPtr->dims[1] / localThreads_y)); + globalThreads_z = srcGenericDescPtr->dims[0]; + + Rpp32u partialSumArrLength = globalThreads_x * globalThreads_y * globalThreads_z; + hipMemsetAsync(partialSumArr, 0, partialSumArrLength * sizeof(Rpp32f), handle.GetStream()); + hipStreamSynchronize(handle.GetStream()); + break; + } + } +} + +void set_kernel_launch_config_3d(RpptGenericDescPtr srcGenericDescPtr, + int &globalThreads_x, + int &globalThreads_y, + int &globalThreads_z, + int &localThreads_x, + int &localThreads_y, + int &localThreads_z, + Rpp32u axisMask, + Rpp32f *partialSumArr, + rpp::Handle& handle) +{ + switch (axisMask) + { + // compute along Z direction + case 1: + { + localThreads_x = 16; + localThreads_y = 16; + localThreads_z = 1; + globalThreads_x = static_cast (ceil((float)srcGenericDescPtr->dims[3] / localThreads_x)); + globalThreads_y = static_cast (ceil((float)srcGenericDescPtr->dims[2] / localThreads_y)); + globalThreads_z = srcGenericDescPtr->dims[0]; + break; + } + // compute along Y direction + case 2: + { + localThreads_x = 16; + localThreads_y = 16; + localThreads_z = 1; + globalThreads_x = static_cast (ceil((float)srcGenericDescPtr->dims[3] / localThreads_x)); + globalThreads_y = static_cast (ceil((float)srcGenericDescPtr->dims[1] / localThreads_y)); + globalThreads_z = srcGenericDescPtr->dims[0]; + break; + } + // compute along YZ direction + case 3: + { + localThreads_x = 16; + localThreads_y = 16; + localThreads_z = 1; + globalThreads_x = static_cast (ceil((float)srcGenericDescPtr->dims[2] / localThreads_x)); + globalThreads_y = static_cast (ceil((float)srcGenericDescPtr->dims[1] / localThreads_y)); + globalThreads_z = srcGenericDescPtr->dims[0]; + + Rpp32u partialSumArrLength = globalThreads_x * globalThreads_y * globalThreads_z; + hipMemsetAsync(partialSumArr, 0, partialSumArrLength * sizeof(Rpp32f), handle.GetStream()); + hipStreamSynchronize(handle.GetStream()); + break; + } + // compute along X direction + case 4: + { + localThreads_x = 16; + localThreads_y = 16; + localThreads_z = 1; + globalThreads_x = static_cast (ceil((float)srcGenericDescPtr->dims[2] / localThreads_x)); + globalThreads_y = static_cast (ceil((float)srcGenericDescPtr->dims[1] / localThreads_y)); + globalThreads_z = srcGenericDescPtr->dims[0]; + break; + } + // compute along XZ direction + case 5: + { + localThreads_x = 32; + localThreads_y = 1; + localThreads_z = 1; + globalThreads_x = srcGenericDescPtr->dims[2]; + globalThreads_y = 1; + globalThreads_z = srcGenericDescPtr->dims[0]; + break; + } + // compute along XY direction + case 6: + { + localThreads_x = 256; + localThreads_y = 1; + localThreads_z = 1; + globalThreads_x = static_cast (ceil((float)srcGenericDescPtr->dims[2] / localThreads_x)); + globalThreads_y = srcGenericDescPtr->dims[1]; + globalThreads_z = srcGenericDescPtr->dims[0]; + + Rpp32u partialSumArrLength = globalThreads_x * globalThreads_y * globalThreads_z; + hipMemsetAsync(partialSumArr, 0, partialSumArrLength * sizeof(Rpp32f), handle.GetStream()); + hipStreamSynchronize(handle.GetStream()); + break; + } + // compute along XYZ direction + case 7: + { + localThreads_x = 16; + localThreads_y = 16; + localThreads_z = 1; + Rpp32u numValues = (srcGenericDescPtr->dims[2] * srcGenericDescPtr->dims[3] + 7) >> 3; + globalThreads_x = static_cast (ceil((float)numValues / localThreads_x)); + globalThreads_y = static_cast (ceil((float)srcGenericDescPtr->dims[1] / localThreads_y)); + globalThreads_z = srcGenericDescPtr->dims[0]; + + Rpp32u partialSumArrLength = globalThreads_x * globalThreads_y * globalThreads_z; + hipMemsetAsync(partialSumArr, 0, partialSumArrLength * sizeof(Rpp32f), handle.GetStream()); + hipStreamSynchronize(handle.GetStream()); + break; + } + } +} + +// -------------------- Set 8 - mean and stddev compute kernels executor -------------------- + +template +RppStatus hip_exec_compute_mean_stddev_tensor(T *srcPtr, + RpptGenericDescPtr srcGenericDescPtr, + Rpp32f *meanTensor, + Rpp32f *stdDevTensor, + bool isMean, + Rpp32u *roiTensor, + Rpp32u axisMask, + Rpp32u tensorDims, + Rpp32u maxParamVolume, + Rpp32u *paramShape, + Rpp32u *paramStrides, + rpp::Handle& handle) +{ + Rpp32f *partialSumArr = handle.GetInitHandle()->mem.mgpu.scratchBufferHip.floatmem; + Rpp32u partialSumArrLength, partialSumBlocksPerSample; + + int globalThreads_x, globalThreads_y, globalThreads_z; + int localThreads_x, localThreads_y, localThreads_z; + // based on number of dimensions call the corresponding kernel + if (tensorDims == 2) + { + // set the block and grid configuration based on axisMask + set_kernel_launch_config_2d(srcGenericDescPtr, globalThreads_x, globalThreads_y, globalThreads_z, + localThreads_x, localThreads_y, localThreads_z, axisMask, + partialSumArr, handle); + + if (isMean) + { + hipLaunchKernelGGL(compute_mean_2d_hip_tensor, + dim3(globalThreads_x, globalThreads_y, globalThreads_z), + dim3(localThreads_x, localThreads_y, localThreads_z), + 0, + handle.GetStream(), + srcPtr, + make_uint2(srcGenericDescPtr->strides[0], srcGenericDescPtr->strides[1]), + meanTensor, + partialSumArr, + roiTensor, + maxParamVolume, + axisMask); + } + else + { + hipLaunchKernelGGL(compute_stddev_2d_hip_tensor, + dim3(globalThreads_x, globalThreads_y, globalThreads_z), + dim3(localThreads_x, localThreads_y, localThreads_z), + 0, + handle.GetStream(), + srcPtr, + make_uint2(srcGenericDescPtr->strides[0], srcGenericDescPtr->strides[1]), + meanTensor, + stdDevTensor, + partialSumArr, + roiTensor, + maxParamVolume, + axisMask); + } + + if (axisMask == 2) + { + partialSumBlocksPerSample = globalThreads_x; + hipLaunchKernelGGL(reduce_final_result_hip, + dim3(ceil((float)partialSumBlocksPerSample/16), ceil((float)globalThreads_y), ceil((float)globalThreads_z)), + dim3(16, 1, 1), + 0, + handle.GetStream(), + partialSumArr, + partialSumBlocksPerSample, + meanTensor, + stdDevTensor, + isMean, + roiTensor, + axisMask, + tensorDims); + } + else if (axisMask == 3) + { + partialSumBlocksPerSample = globalThreads_x * globalThreads_y; + hipLaunchKernelGGL(reduce_final_result_hip, + dim3(ceil((float)partialSumBlocksPerSample/16), 1, globalThreads_z), + dim3(16, 1, 1), + 0, + handle.GetStream(), + partialSumArr, + partialSumBlocksPerSample, + meanTensor, + stdDevTensor, + isMean, + roiTensor, + axisMask, + tensorDims); + } + } + else if (tensorDims == 3) + { + // set the block and grid configuration based on axisMask + set_kernel_launch_config_3d(srcGenericDescPtr, globalThreads_x, globalThreads_y, globalThreads_z, + localThreads_x, localThreads_y, localThreads_z, axisMask, + partialSumArr, handle); + + if (isMean) + { + hipLaunchKernelGGL(compute_mean_3d_hip_tensor, + dim3(globalThreads_x, globalThreads_y, globalThreads_z), + dim3(localThreads_x, localThreads_y, localThreads_z), + 0, + handle.GetStream(), + srcPtr, + make_uint3(srcGenericDescPtr->strides[0], srcGenericDescPtr->strides[1], srcGenericDescPtr->strides[2]), + meanTensor, + roiTensor, + partialSumArr, + maxParamVolume, + axisMask); + } + else + { + hipLaunchKernelGGL(compute_stddev_3d_hip_tensor, + dim3(globalThreads_x, globalThreads_y, globalThreads_z), + dim3(localThreads_x, localThreads_y, localThreads_z), + 0, + handle.GetStream(), + srcPtr, + make_uint3(srcGenericDescPtr->strides[0], srcGenericDescPtr->strides[1], srcGenericDescPtr->strides[2]), + meanTensor, + stdDevTensor, + roiTensor, + partialSumArr, + maxParamVolume, + axisMask); + } + + // perform final reduction on block wise sums for below cases + // reduce on YZ partial sums + if (axisMask == 3) + { + partialSumBlocksPerSample = globalThreads_x * globalThreads_y; + hipLaunchKernelGGL(reduce_final_result_hip, + dim3(ceil((float)partialSumBlocksPerSample/16), srcGenericDescPtr->dims[3], srcGenericDescPtr->dims[0]), + dim3(16, 1, 1), + 0, + handle.GetStream(), + partialSumArr, + partialSumBlocksPerSample, + meanTensor, + stdDevTensor, + isMean, + roiTensor, + axisMask, + tensorDims); + } + // reduce on XY partial sums + if (axisMask == 6) + { + partialSumBlocksPerSample = globalThreads_x; + hipLaunchKernelGGL(reduce_final_result_hip, + dim3(ceil((float)partialSumBlocksPerSample/16), srcGenericDescPtr->dims[1], srcGenericDescPtr->dims[0]), + dim3(16, 1, 1), + 0, + handle.GetStream(), + partialSumArr, + partialSumBlocksPerSample, + meanTensor, + stdDevTensor, + isMean, + roiTensor, + axisMask, + tensorDims); + } + // reduce on XYZ block partial sums + else if (axisMask == 7) + { + partialSumBlocksPerSample = globalThreads_x * globalThreads_y; + hipLaunchKernelGGL(reduce_final_result_hip, + dim3(ceil((float)partialSumBlocksPerSample/16), 1, srcGenericDescPtr->dims[0]), + dim3(16, 1, 1), + 0, + handle.GetStream(), + partialSumArr, + partialSumBlocksPerSample, + meanTensor, + stdDevTensor, + isMean, + roiTensor, + axisMask, + tensorDims); + } + } + else + { + // interpret the input as 1D tensor + globalThreads_x = srcGenericDescPtr->strides[0]; + globalThreads_y = 1; + globalThreads_z = srcGenericDescPtr->dims[0]; + Rpp32u batchSize = globalThreads_z; + + // allocate tensor for src strides + Rpp32u *srcMaxDims = &srcGenericDescPtr->dims[1]; + Rpp32u *srcStrides = &srcGenericDescPtr->strides[1]; + + Rpp32u shared_memory_size = 0; + Rpp32u block_size = 1024; + if (maxParamVolume <= MAX_SHARED_MEMORY_SIZE) + { + if (maxParamVolume <= 32) + shared_memory_size = 32; + else if (maxParamVolume <= 64) + shared_memory_size = 64; + else if (maxParamVolume <= 128) + shared_memory_size = 128; + else if (maxParamVolume <= 256) + shared_memory_size = 256; + else if (maxParamVolume <= 512) + shared_memory_size = 512; + else + shared_memory_size = MAX_SHARED_MEMORY_SIZE; + block_size = shared_memory_size; + } + + if (isMean) + { + hipLaunchKernelGGL(compute_mean_nd_hip_tensor, + dim3(ceil((float)globalThreads_x/block_size), ceil((float)globalThreads_y), ceil((float)globalThreads_z)), + dim3(block_size, 1, 1), + shared_memory_size, + handle.GetStream(), + srcPtr, + srcMaxDims, + srcStrides, + meanTensor, + roiTensor, + paramShape, + paramStrides, + maxParamVolume, + tensorDims, + srcGenericDescPtr->strides[0]); + } + else + { + hipLaunchKernelGGL(compute_stddev_nd_hip_tensor, + dim3(ceil((float)globalThreads_x/block_size), ceil((float)globalThreads_y), ceil((float)globalThreads_z)), + dim3(block_size, 1, 1), + shared_memory_size, + handle.GetStream(), + srcPtr, + srcMaxDims, + srcStrides, + meanTensor, + stdDevTensor, + roiTensor, + paramShape, + paramStrides, + maxParamVolume, + tensorDims, + srcGenericDescPtr->strides[0]); + } + hipLaunchKernelGGL(final_reduction_nd_hip_tensor, + dim3(ceil((float)maxParamVolume/1024), 1, globalThreads_z), + dim3(1024, 1, 1), + 0, + handle.GetStream(), + meanTensor, + stdDevTensor, + paramShape, + roiTensor, + tensorDims, + maxParamVolume, + isMean); + } + hipStreamSynchronize(handle.GetStream()); + return RPP_SUCCESS; +} + +// -------------------- Set 9 - normalization kernel executor -------------------- + +template +RppStatus hip_exec_normalize_tensor(T *srcPtr, + RpptGenericDescPtr srcGenericDescPtr, + T *dstPtr, + RpptGenericDescPtr dstGenericDescPtr, + Rpp32u axisMask, + Rpp32f *meanTensor, + Rpp32f *stdDevTensor, + Rpp8u computeMeanStddev, + Rpp32f scale, + Rpp32f shift, + Rpp32u *roiTensor, + rpp::Handle& handle) +{ + Rpp32u batchSize = srcGenericDescPtr->dims[0]; + Rpp32u tensorDims = srcGenericDescPtr->numDims - 1; // exclude batchsize from input dims + + // create buffer for paramShape and paramStride needed for generic kernel + Rpp32u *paramShape, *paramStrides; + paramShape = handle.GetInitHandle()->mem.mgpu.scratchBuf.uintmem; + paramStrides = handle.GetInitHandle()->mem.mgpu.scratchBuf.uintmem + (batchSize * tensorDims); + + // do initial preprocessing, compute maxParamVolue and fill the values for paramShape and paramStrides + Rpp32u maxParamVolume; + if (tensorDims == 2 || tensorDims == 3) + normalize_setup_2d_and_3d(roiTensor, batchSize, tensorDims, + axisMask, maxParamVolume); + else + normalize_setup_nd(roiTensor, batchSize, tensorDims, axisMask, + paramShape, paramStrides, maxParamVolume); + + bool computeMean = computeMeanStddev & 1; // if 0th bit in computeMeanStddev is set, computeMean is set to true. Otherwise it is set to false + bool computeStdDev = computeMeanStddev & 2; // if 1st bit in computeMeanStddev is set, computeStdDev is set to true. Otherwise it is set to false + if ((!computeMean) && (!computeStdDev)) + maxParamVolume = 0; + + // if computeMean is set, compute mean values by processing over input based on axisMask values + if (computeMean) + hip_exec_compute_mean_stddev_tensor(srcPtr, srcGenericDescPtr, meanTensor, stdDevTensor, true, + roiTensor, axisMask, tensorDims, maxParamVolume, + paramShape, paramStrides, handle); + + // if computeStdDev is set, compute stdDev values by processing over input based on axisMask values + if (computeStdDev) + hip_exec_compute_mean_stddev_tensor(srcPtr, srcGenericDescPtr, meanTensor, stdDevTensor, false, + roiTensor, axisMask, tensorDims, maxParamVolume, + paramShape, paramStrides, handle); + + // based on number of dimensions call the corresponding kernel + if (tensorDims == 2) + { + // NHW + int globalThreads_x = dstGenericDescPtr->dims[2]; + int globalThreads_y = dstGenericDescPtr->dims[1]; + int globalThreads_z = dstGenericDescPtr->dims[0]; + + hipLaunchKernelGGL(normalize_2d_hip_tensor, + dim3(ceil((float)globalThreads_x/LOCAL_THREADS_X), ceil((float)globalThreads_y/LOCAL_THREADS_Y), ceil((float)globalThreads_z/LOCAL_THREADS_Z)), + dim3(LOCAL_THREADS_X, LOCAL_THREADS_Y, LOCAL_THREADS_Z), + 0, + handle.GetStream(), + srcPtr, + make_uint2(srcGenericDescPtr->strides[0], srcGenericDescPtr->strides[1]), + dstPtr, + make_uint2(dstGenericDescPtr->strides[0], dstGenericDescPtr->strides[1]), + meanTensor, + stdDevTensor, + make_float2(scale, shift), + roiTensor, + make_uint2(maxParamVolume, axisMask), + computeStdDev); + } + else if (tensorDims == 3) + { + // NDHW + int globalThreads_x = dstGenericDescPtr->dims[3]; + int globalThreads_y = dstGenericDescPtr->dims[2]; + int globalThreads_z = dstGenericDescPtr->dims[1]; + + for(int batchCount = 0; batchCount < dstGenericDescPtr->dims[0]; batchCount++) + { + hipLaunchKernelGGL(normalize_3d_hip_tensor, + dim3(ceil((float)globalThreads_x/LOCAL_THREADS_X), ceil((float)globalThreads_y/LOCAL_THREADS_Y), ceil((float)globalThreads_z/LOCAL_THREADS_Z)), + dim3(LOCAL_THREADS_X, LOCAL_THREADS_Y, LOCAL_THREADS_Z), + 0, + handle.GetStream(), + srcPtr + (batchCount * srcGenericDescPtr->strides[0]), + make_uint2(srcGenericDescPtr->strides[1], srcGenericDescPtr->strides[2]), + dstPtr + (batchCount * dstGenericDescPtr->strides[0]), + make_uint2(dstGenericDescPtr->strides[1], dstGenericDescPtr->strides[2]), + &meanTensor[batchCount * maxParamVolume], + &stdDevTensor[batchCount * maxParamVolume], + make_float2(scale, shift), + &roiTensor[batchCount * 6], + axisMask, + computeStdDev); + } + } + else + { + // interpret the input as 1D tensor + int globalThreads_x = dstGenericDescPtr->strides[0]; + int globalThreads_y = 1; + int globalThreads_z = dstGenericDescPtr->dims[0]; + + // allocate tensor for src strides + Rpp32u *srcMaxDims = &srcGenericDescPtr->dims[1]; + Rpp32u *srcStrides = &srcGenericDescPtr->strides[1]; + hipLaunchKernelGGL(normalize_nd_hip_tensor, + dim3(ceil((float)globalThreads_x/1024), ceil((float)globalThreads_y), ceil((float)globalThreads_z)), + dim3(1024, 1, 1), + 0, + handle.GetStream(), + srcPtr, + srcMaxDims, + srcStrides, + dstPtr, + meanTensor, + stdDevTensor, + make_float2(scale, shift), + roiTensor, + paramShape, + paramStrides, + make_uint2(maxParamVolume, srcGenericDescPtr->strides[0]), + tensorDims, + computeStdDev); + } + + return RPP_SUCCESS; +} \ No newline at end of file diff --git a/src/modules/rppi_validate.hpp b/src/modules/rppi_validate.hpp index e35e5c514..3285ee756 100644 --- a/src/modules/rppi_validate.hpp +++ b/src/modules/rppi_validate.hpp @@ -56,11 +56,9 @@ inline RppLayoutParams get_layout_params(RpptLayout layout, Rpp32u channels) } else if(layout == RpptLayout::NHWC || layout == RpptLayout::NDHWC) { - if (channels == 3) // PKD3 - { - layoutParams.channelParam = 1; - layoutParams.bufferMultiplier = 3; - } + //PKD + layoutParams.channelParam = 1; + layoutParams.bufferMultiplier = channels; } return layoutParams; } diff --git a/src/modules/rppt_tensor_statistical_operations.cpp b/src/modules/rppt_tensor_statistical_operations.cpp index 28313a88f..ef69a49bb 100644 --- a/src/modules/rppt_tensor_statistical_operations.cpp +++ b/src/modules/rppt_tensor_statistical_operations.cpp @@ -241,13 +241,109 @@ RppStatus rppt_tensor_max_host(RppPtr_t srcPtr, return RPP_SUCCESS; } +/******************** normalize_ND ********************/ + +RppStatus rppt_normalize_host(RppPtr_t srcPtr, + RpptGenericDescPtr srcGenericDescPtr, + RppPtr_t dstPtr, + RpptGenericDescPtr dstGenericDescPtr, + Rpp32u axisMask, + Rpp32f *meanTensor, + Rpp32f *stdDevTensor, + Rpp8u computeMeanStddev, + Rpp32f scale, + Rpp32f shift, + Rpp32u *roiTensor, + rppHandle_t rppHandle) +{ + RppLayoutParams layoutParams; + Rpp32u tensorDim = srcGenericDescPtr->numDims - 1; + if (tensorDim == 3 && (srcGenericDescPtr->layout == RpptLayout::NHWC)) + layoutParams = get_layout_params(srcGenericDescPtr->layout, srcGenericDescPtr->dims[3]); + else if ((srcGenericDescPtr->layout == RpptLayout::NCDHW) && (dstGenericDescPtr->layout == RpptLayout::NCDHW)) + layoutParams = get_layout_params(srcGenericDescPtr->layout, srcGenericDescPtr->dims[1]); + else if ((srcGenericDescPtr->layout == RpptLayout::NDHWC) && (dstGenericDescPtr->layout == RpptLayout::NDHWC)) + layoutParams = get_layout_params(srcGenericDescPtr->layout, srcGenericDescPtr->dims[4]); + else if(tensorDim == 2 && (srcGenericDescPtr->layout == RpptLayout::NHWC)) + layoutParams = get_layout_params(srcGenericDescPtr->layout, srcGenericDescPtr->dims[2]); + + if ((srcGenericDescPtr->dataType == RpptDataType::U8) && (dstGenericDescPtr->dataType == RpptDataType::U8)) + { + normalize_generic_host_tensor(static_cast(srcPtr) + srcGenericDescPtr->offsetInBytes, + srcGenericDescPtr, + static_cast(dstPtr) + dstGenericDescPtr->offsetInBytes, + dstGenericDescPtr, + axisMask, + meanTensor, + stdDevTensor, + computeMeanStddev, + scale, + shift, + roiTensor, + layoutParams, + rpp::deref(rppHandle)); + } + else if ((srcGenericDescPtr->dataType == RpptDataType::F16) && (dstGenericDescPtr->dataType == RpptDataType::F16)) + { + normalize_generic_host_tensor(reinterpret_cast(static_cast(srcPtr) + srcGenericDescPtr->offsetInBytes), + srcGenericDescPtr, + reinterpret_cast(static_cast(dstPtr) + dstGenericDescPtr->offsetInBytes), + dstGenericDescPtr, + axisMask, + meanTensor, + stdDevTensor, + computeMeanStddev, + scale, + shift, + roiTensor, + layoutParams, + rpp::deref(rppHandle)); + } + else if ((srcGenericDescPtr->dataType == RpptDataType::F32) && (dstGenericDescPtr->dataType == RpptDataType::F32)) + { + normalize_f32_f32_host_tensor(reinterpret_cast(static_cast(srcPtr) + srcGenericDescPtr->offsetInBytes), + srcGenericDescPtr, + reinterpret_cast(static_cast(dstPtr) + dstGenericDescPtr->offsetInBytes), + dstGenericDescPtr, + axisMask, + meanTensor, + stdDevTensor, + computeMeanStddev, + scale, + shift, + roiTensor, + layoutParams, + rpp::deref(rppHandle)); + } + + else if ((srcGenericDescPtr->dataType == RpptDataType::I8) && (dstGenericDescPtr->dataType == RpptDataType::I8)) + { + normalize_generic_host_tensor(static_cast(srcPtr) + srcGenericDescPtr->offsetInBytes, + srcGenericDescPtr, + static_cast(dstPtr) + dstGenericDescPtr->offsetInBytes, + dstGenericDescPtr, + axisMask, + meanTensor, + stdDevTensor, + computeMeanStddev, + scale, + shift, + roiTensor, + layoutParams, + rpp::deref(rppHandle)); + } + + return RPP_SUCCESS; +} /********************************************************************************************************************/ /*********************************************** RPP_GPU_SUPPORT = ON ***********************************************/ /********************************************************************************************************************/ +#ifdef GPU_SUPPORT + /******************** tensor_sum ********************/ -#ifdef HIP_COMPILE + RppStatus rppt_tensor_sum_gpu(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t tensorSumArr, @@ -256,6 +352,7 @@ RppStatus rppt_tensor_sum_gpu(RppPtr_t srcPtr, RpptRoiType roiType, rppHandle_t rppHandle) { +#ifdef HIP_COMPILE if (srcDescPtr->c == 1) { if (tensorSumArrLength < srcDescPtr->n) // sum of single channel @@ -317,10 +414,12 @@ RppStatus rppt_tensor_sum_gpu(RppPtr_t srcPtr, } return RPP_SUCCESS; +#elif defined(OCL_COMPILE) + return RPP_ERROR_NOT_IMPLEMENTED; +#endif // backend } /******************** tensor_min ********************/ - RppStatus rppt_tensor_min_gpu(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t imageMinArr, @@ -329,6 +428,7 @@ RppStatus rppt_tensor_min_gpu(RppPtr_t srcPtr, RpptRoiType roiType, rppHandle_t rppHandle) { +#ifdef HIP_COMPILE if (srcDescPtr->c == 1) { if (imageMinArrLength < srcDescPtr->n) // min of single channel @@ -378,6 +478,9 @@ RppStatus rppt_tensor_min_gpu(RppPtr_t srcPtr, } return RPP_SUCCESS; +#elif defined(OCL_COMPILE) + return RPP_ERROR_NOT_IMPLEMENTED; +#endif // backend } /******************** tensor_max ********************/ @@ -390,6 +493,7 @@ RppStatus rppt_tensor_max_gpu(RppPtr_t srcPtr, RpptRoiType roiType, rppHandle_t rppHandle) { +#ifdef HIP_COMPILE if (srcDescPtr->c == 1) { if (imageMaxArrLength < srcDescPtr->n) // max of single channel @@ -439,5 +543,90 @@ RppStatus rppt_tensor_max_gpu(RppPtr_t srcPtr, } return RPP_SUCCESS; +#elif defined(OCL_COMPILE) + return RPP_ERROR_NOT_IMPLEMENTED; +#endif // backend } + +RppStatus rppt_normalize_gpu(RppPtr_t srcPtr, + RpptGenericDescPtr srcGenericDescPtr, + RppPtr_t dstPtr, + RpptGenericDescPtr dstGenericDescPtr, + Rpp32u axisMask, + Rpp32f *meanTensor, + Rpp32f *stdDevTensor, + Rpp8u computeMeanStddev, + Rpp32f scale, + Rpp32f shift, + Rpp32u *roiTensor, + rppHandle_t rppHandle) +{ +#ifdef HIP_COMPILE + if ((srcGenericDescPtr->dataType == RpptDataType::U8) && (dstGenericDescPtr->dataType == RpptDataType::U8)) + { + hip_exec_normalize_tensor(static_cast(srcPtr) + srcGenericDescPtr->offsetInBytes, + srcGenericDescPtr, + static_cast(dstPtr) + dstGenericDescPtr->offsetInBytes, + dstGenericDescPtr, + axisMask, + meanTensor, + stdDevTensor, + computeMeanStddev, + scale, + shift, + roiTensor, + rpp::deref(rppHandle)); + } + else if ((srcGenericDescPtr->dataType == RpptDataType::F16) && (dstGenericDescPtr->dataType == RpptDataType::F16)) + { + hip_exec_normalize_tensor(reinterpret_cast(static_cast(srcPtr) + srcGenericDescPtr->offsetInBytes), + srcGenericDescPtr, + reinterpret_cast(static_cast(dstPtr) + dstGenericDescPtr->offsetInBytes), + dstGenericDescPtr, + axisMask, + meanTensor, + stdDevTensor, + computeMeanStddev, + scale, + shift, + roiTensor, + rpp::deref(rppHandle)); + } + else if ((srcGenericDescPtr->dataType == RpptDataType::F32) && (dstGenericDescPtr->dataType == RpptDataType::F32)) + { + hip_exec_normalize_tensor(reinterpret_cast(static_cast(srcPtr) + srcGenericDescPtr->offsetInBytes), + srcGenericDescPtr, + reinterpret_cast(static_cast(dstPtr) + dstGenericDescPtr->offsetInBytes), + dstGenericDescPtr, + axisMask, + meanTensor, + stdDevTensor, + computeMeanStddev, + scale, + shift, + roiTensor, + rpp::deref(rppHandle)); + } + else if ((srcGenericDescPtr->dataType == RpptDataType::I8) && (dstGenericDescPtr->dataType == RpptDataType::I8)) + { + hip_exec_normalize_tensor(static_cast(srcPtr) + srcGenericDescPtr->offsetInBytes, + srcGenericDescPtr, + static_cast(dstPtr) + dstGenericDescPtr->offsetInBytes, + dstGenericDescPtr, + axisMask, + meanTensor, + stdDevTensor, + computeMeanStddev, + scale, + shift, + roiTensor, + rpp::deref(rppHandle)); + } + + return RPP_SUCCESS; +#elif defined(OCL_COMPILE) + return RPP_ERROR_NOT_IMPLEMENTED; #endif // backend +} + +#endif // GPU_SUPPORT diff --git a/utilities/test_suite/CMakeLists.txt b/utilities/test_suite/CMakeLists.txt index 82ed65309..77052cabe 100644 --- a/utilities/test_suite/CMakeLists.txt +++ b/utilities/test_suite/CMakeLists.txt @@ -83,7 +83,7 @@ if(Python3_FOUND) if(NIFTI_FOUND) add_test( NAME rpp_qa_tests_tensor_voxel_host_all - COMMAND ${Python3_EXECUTABLE} ${ROCM_PATH}/share/rpp/test/HOST/runTests_voxel.py --qa_mode 1 --batch_size 3 + COMMAND ${Python3_EXECUTABLE} ${ROCM_PATH}/share/rpp/test/HOST/runVoxelTests.py --qa_mode 1 --batch_size 3 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) endif(NIFTI_FOUND) @@ -105,7 +105,7 @@ if(Python3_FOUND) if(NIFTI_FOUND) add_test( NAME rpp_qa_tests_tensor_voxel_hip_all - COMMAND ${Python3_EXECUTABLE} ${ROCM_PATH}/share/rpp/test/HIP/runTests_voxel.py --qa_mode 1 --batch_size 3 + COMMAND ${Python3_EXECUTABLE} ${ROCM_PATH}/share/rpp/test/HIP/runVoxelTests.py --qa_mode 1 --batch_size 3 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) endif(NIFTI_FOUND) diff --git a/utilities/test_suite/HIP/CMakeLists.txt b/utilities/test_suite/HIP/CMakeLists.txt index 26017065e..a0bd42fa0 100644 --- a/utilities/test_suite/HIP/CMakeLists.txt +++ b/utilities/test_suite/HIP/CMakeLists.txt @@ -83,8 +83,10 @@ if (hip_FOUND AND OpenCV_FOUND) link_directories(${ROCM_PATH}/lib /usr/local/lib) add_executable(Tensor_hip Tensor_hip.cpp) + add_executable(Tensor_misc_hip Tensor_misc_hip.cpp) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGPU_SUPPORT=1 -DRPP_BACKEND_HIP=1 -std=gnu++17") target_link_libraries(Tensor_hip ${OpenCV_LIBS} -lturbojpeg -lrpp ${hip_LIBRARIES} pthread ${LINK_LIBRARY_LIST} hip::device) + target_link_libraries(Tensor_misc_hip ${OpenCV_LIBS} -lturbojpeg -lrpp ${hip_LIBRARIES} pthread ${LINK_LIBRARY_LIST} hip::device) else() message(FATAL_ERROR "-- ${Red}Error: OpenCV and hip must be installed to install ${PROJECT_NAME} successfully!${ColourReset}") endif() diff --git a/utilities/test_suite/HIP/Tensor_misc_hip.cpp b/utilities/test_suite/HIP/Tensor_misc_hip.cpp new file mode 100644 index 000000000..96197f432 --- /dev/null +++ b/utilities/test_suite/HIP/Tensor_misc_hip.cpp @@ -0,0 +1,231 @@ +/* +MIT License + +Copyright (c) 2019 - 2024 Advanced Micro Devices, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#include "../rpp_test_suite_misc.h" + +int main(int argc, char **argv) +{ + // Handle inputs + const int MIN_ARG_COUNT = 9; + if (argc < MIN_ARG_COUNT) + { + printf("\nImproper Usage! Needs all arguments!\n"); + printf("\nUsage: ./Tensor_misc_hip