Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPP Audio Support HIP - To Decibels #398

Merged
Merged
Show file tree
Hide file tree
Changes from 69 commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
c33af22
Bump rocm-docs-core[api_reference] from 0.35.0 to 0.35.1 in /docs/sph…
dependabot[bot] Mar 6, 2024
14f6334
Bump rocm-docs-core[api_reference] from 0.35.1 to 0.36.0 in /docs/sph…
dependabot[bot] Mar 12, 2024
95c3272
Merge branch 'master' into develop
kiritigowda Mar 12, 2024
3973c34
added api support for ToDecibels HIP kernel
sampath1117 Mar 19, 2024
3f08f90
added test suite support for audio in HIP
sampath1117 Mar 8, 2024
b9c0788
added profiler support for hip test suite
sampath1117 Mar 18, 2024
ab9de97
added initial max find support for 1D and 2D data
sampath1117 Mar 19, 2024
ffd7817
added initial support for todecibels kernel
sampath1117 Mar 20, 2024
641f653
Docs - Bump rocm-docs-core[api_reference] from 0.36.0 to 0.37.0 in /d…
dependabot[bot] Mar 20, 2024
5568573
Link cleanup (#326)
LisaDelaney Mar 20, 2024
a6749ba
Update notes
LisaDelaney Mar 20, 2024
8a98556
improved precision match to 6 decimals
sampath1117 Mar 21, 2024
089a347
added kernal launch configuration for max kernel
sampath1117 Mar 21, 2024
a255906
Docs - Bump rocm-docs-core[api_reference] from 0.37.0 to 0.37.1 in /d…
dependabot[bot] Mar 22, 2024
d3df761
RPP Voxel Flip on HIP and HOST (#285)
r-abishek Mar 23, 2024
ebecb42
RPP Vignette Tensor on HOST and HIP (#311)
r-abishek Mar 23, 2024
5ff01c9
remove empty blank line
sampath1117 Mar 25, 2024
fc1410b
Bump rocm-docs-core[api_reference] from 0.37.1 to 0.38.0 in /docs/sph…
dependabot[bot] Mar 27, 2024
c0f0d34
Merge branch 'develop' into sr/to_decibels_hip
sampath1117 Mar 29, 2024
5741b66
changed 8 pixel load and store to single pixel load and store for 2d …
sampath1117 Mar 29, 2024
3ebd7c3
RPP Tensor Audio Support - Resample (#310)
r-abishek Apr 3, 2024
76f31df
Docs - Missing input and output images for Doxygen (#331)
r-abishek Apr 3, 2024
b83f910
Scratch buffers rename for HOST and HIP (#324)
r-abishek Apr 3, 2024
ebeb131
Update CMakeLists.txt
kiritigowda Apr 3, 2024
2c160cd
Merge branch 'develop' into sr/to_decibels_hip
sampath1117 Apr 8, 2024
14538d2
added missing hipDeviceSynchronize() in test suite
sampath1117 Apr 8, 2024
574d42d
minor bug fix
sampath1117 Apr 8, 2024
fe37ae1
removed f16 includes since not needed for audio
sampath1117 Apr 4, 2024
179253d
restructured python test suite
sampath1117 Apr 4, 2024
6a99788
added empty line at EOF
sampath1117 Apr 8, 2024
68b70a5
fixed spacing in Doxygen
sampath1117 Apr 11, 2024
1147bfe
Update CMakeLists.txt
kiritigowda Apr 12, 2024
ccd493d
Merge remote-tracking branch 'develop' into sr/to_decibels_hip
sampath1117 Apr 16, 2024
5e3fc7a
Bump rocm-docs-core[api_reference] from 0.38.1 to 1.0.0 in /docs/sphi…
dependabot[bot] Apr 18, 2024
b6b7cc5
Bump rocm-docs-core[api_reference] from 1.0.0 to 1.1.0 in /docs/sphin…
dependabot[bot] Apr 25, 2024
e16ad7a
RPP Gaussian Noise Voxel Tensor on HOST and HIP (#323)
r-abishek Apr 26, 2024
7d34794
Merge branch 'develop' into sr/to_decibels_hip
sampath1117 Apr 30, 2024
d2f5d8e
modify CHECK to CHECK_RETURN_STATUS
sampath1117 Apr 30, 2024
b30f50b
Merge branch 'develop' into sr/to_decibels_hip
sampath1117 May 2, 2024
77e14ef
Minor common-fixes for HIP (#345)
r-abishek May 7, 2024
34f3f6d
Readme Updates: --usecase=rocm (#349)
kiritigowda May 8, 2024
ab52683
RPP Tensor Audio Support - Spectrogram (#312)
r-abishek May 8, 2024
ee0d6fe
Update CHANGELOG.md (#352)
r-abishek May 8, 2024
2decd32
RPP Tensor Audio Support - Slice (#325)
r-abishek May 8, 2024
30ce1d6
RPP Tensor Audio Support - MelFilterBank (#332)
r-abishek May 8, 2024
64ae74f
RPP Tensor Normalize ND on HOST and HIP (#335)
r-abishek May 9, 2024
1a3015c
SWDEV-459739 - Remove the package obsolete setting (#353)
raramakr May 9, 2024
bcc9ac9
Merge branch 'develop' into sr/to_decibels_hip
sampath1117 May 9, 2024
4cb8d4b
Audio support merge commit fixes (#354)
r-abishek May 9, 2024
7349eab
remove min_smem from comments
sampath1117 May 16, 2024
7cd32bd
modified verify_output to have different cutoff for HIP and HOST back…
sampath1117 May 15, 2024
f78e93c
separated reduction kernels for 1d and 2d
sampath1117 May 16, 2024
a086a88
reorganized kernels
sampath1117 May 16, 2024
a601ddc
Merge branch 'develop' into sr/to_decibels_hip
sampath1117 May 16, 2024
b29bfe6
addded empty line at EOF
sampath1117 May 17, 2024
fb53f63
add more comments for 1D reduction kernel
sampath1117 May 17, 2024
63235b4
removed handle floatArr[0] usage in hip kernel
sampath1117 May 17, 2024
8efaa3e
added more comments
sampath1117 May 17, 2024
8732386
renamed tensor_hip_audio to tensor_audio_hip
sampath1117 May 17, 2024
33e5f15
make device helper as inline
sampath1117 May 19, 2024
0cc5c20
Merge branch 'develop' into sr/to_decibels_hip
sampath1117 May 30, 2024
42c1c9f
Merge branch 'develop' into sr/to_decibels_hip
r-abishek Jul 10, 2024
305e138
Merge pull request #252 from sampath1117/sr/to_decibels_hip
r-abishek Jul 10, 2024
274ca8c
Merge branch 'develop' into ar/audio_support_2_to_decibels_hip
r-abishek Jul 16, 2024
6e29926
audio test suite changes for python 2 compatibility
sampath1117 Jul 17, 2024
a69f90e
added validation checks for numDims
sampath1117 Jul 17, 2024
953fdcb
Merge pull request #294 from sampath1117/sr/to_decibels_hip_pr_changes
r-abishek Jul 17, 2024
f650fee
Merge branch 'develop' into ar/audio_support_2_to_decibels_hip
kiritigowda Jul 22, 2024
7d6b240
Merge branch 'develop' into ar/audio_support_2_to_decibels_hip
kiritigowda Jul 23, 2024
eebb7b1
Merge branch 'develop' into sr/to_decibels_merge_develop
sampath1117 Jul 25, 2024
8c31674
removed duplicate code added in merge
sampath1117 Jul 25, 2024
0361342
Merge pull request #297 from sampath1117/sr/to_decibels_merge_develop
r-abishek Jul 25, 2024
ee8d034
Merge branch 'develop' into ar/audio_support_2_to_decibels_hip
kiritigowda Aug 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion include/rppdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ typedef enum
/*! \brief src and dst layout mismatch \ingroup group_rppdefs */
RPP_ERROR_LAYOUT_MISMATCH = -18,
/*! \brief Number of channels is invalid. (Needs to adhere to function specification.) \ingroup group_rppdefs */
RPP_ERROR_INVALID_CHANNELS = -19
RPP_ERROR_INVALID_CHANNELS = -19,
/*! \brief Number of src dims is invalid. (Needs to adhere to function specification.) \ingroup group_rppdefs */
RPP_ERROR_INVALID_SRC_DIMS = -20
} RppStatus;

/*! \brief RPP rppStatus_t type enums
Expand Down
89 changes: 54 additions & 35 deletions include/rppt_tensor_audio_augmentations.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,49 +48,68 @@ extern "C" {
* \details Non Silent Region Detection augmentation for 1D audio buffer
\n Finds the starting index and length of non silent region in the audio buffer by comparing the
calculated short-term power with cutoff value passed
* \param[in] srcPtr source tensor in HOST memory
* \param[in] srcDescPtr source tensor descriptor (Restrictions - numDims = 3, offsetInBytes >= 0, dataType = F32)
* \param[in] srcLengthTensor source audio buffer length (1D tensor in HOST memory, of size batchSize)
* \param[out] detectedIndexTensor beginning index of non silent region (1D tensor in HOST memory, of size batchSize)
* \param[out] detectionLengthTensor length of non silent region (1D tensor in HOST memory, of size batchSize)
* \param[in] cutOffDB cutOff in dB below which the signal is considered silent
* \param[in] windowLength window length used for computing short-term power of the signal
* \param[in] referencePower reference power that is used to convert the signal to dB
* \param[in] resetInterval number of samples after which the moving mean average is recalculated to avoid precision loss
* \param[in] rppHandle RPP HOST handle created with <tt>\ref rppCreateWithBatchSize()</tt>
* \param [in] srcPtr source tensor in HOST memory
* \param [in] srcDescPtr source tensor descriptor (Restrictions - numDims = 3, offsetInBytes >= 0, dataType = F32)
* \param [in] srcLengthTensor source audio buffer length (1D tensor in HOST memory, of size batchSize)
* \param [out] detectedIndexTensor beginning index of non silent region (1D tensor in HOST memory, of size batchSize)
* \param [out] detectionLengthTensor length of non silent region (1D tensor in HOST memory, of size batchSize)
* \param [in] cutOffDB cutOff in dB below which the signal is considered silent
* \param [in] windowLength window length used for computing short-term power of the signal
* \param [in] referencePower reference power that is used to convert the signal to dB
* \param [in] resetInterval number of samples after which the moving mean average is recalculated to avoid precision loss
* \param [in] rppHandle RPP HOST handle created with <tt>\ref rppCreateWithBatchSize()</tt>
* \return A <tt> \ref RppStatus</tt> enumeration.
* \retval RPP_SUCCESS Successful completion.
* \retval RPP_ERROR* Unsuccessful completion.
*/
RppStatus rppt_non_silent_region_detection_host(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, Rpp32s *srcLengthTensor, Rpp32s *detectedIndexTensor, Rpp32s *detectionLengthTensor, Rpp32f cutOffDB, Rpp32s windowLength, Rpp32f referencePower, Rpp32s resetInterval, rppHandle_t rppHandle);

/*! \brief To Decibels augmentation on HOST backend
* \details To Decibels augmentation for 1D audio buffer converts magnitude values to decibel values
* \param[in] srcPtr source tensor in HOST memory
* \param[in] srcDescPtr source tensor descriptor (Restrictions - numDims = 3, offsetInBytes >= 0, dataType = F32)
* \param[out] dstPtr destination tensor in HOST memory
* \param[in] dstDescPtr destination tensor descriptor (Restrictions - numDims = 3, offsetInBytes >= 0, dataType = F32)
* \param[in] srcDims source tensor sizes for each element in batch (2D tensor in HOST memory, of size batchSize * 2)
* \param[in] cutOffDB minimum or cut-off ratio in dB
* \param[in] multiplier factor by which the logarithm is multiplied
* \param[in] referenceMagnitude Reference magnitude if not provided maximum value of input used as reference
* \param[in] rppHandle RPP HOST handle created with <tt>\ref rppCreateWithBatchSize()</tt>
* \details To Decibels augmentation for 1D/2D audio buffer converts magnitude values to decibel values
* \param [in] srcPtr source tensor in HOST memory
* \param [in] srcDescPtr source tensor descriptor (Restrictions - numDims = 2 or 3 (for single-channel or multi-channel/2D audio tensor with 1 channel), offsetInBytes >= 0, dataType = F32)
* \param [out] dstPtr destination tensor in HOST memory
* \param [in] dstDescPtr destination tensor descriptor (Restrictions - numDims = 2 or 3 (for single-channel or multi-channel/2D audio tensor with 1 channel), offsetInBytes >= 0, dataType = F32)
* \param [in] srcDims source tensor sizes for each element in batch (2D tensor in HOST memory, of size batchSize * 2)
* \param [in] cutOffDB minimum or cut-off ratio in dB
* \param [in] multiplier factor by which the logarithm is multiplied
* \param [in] referenceMagnitude Reference magnitude if not provided maximum value of input used as reference
* \param [in] rppHandle RPP HOST handle created with <tt>\ref rppCreateWithBatchSize()</tt>
* \return A <tt> \ref RppStatus</tt> enumeration.
* \retval RPP_SUCCESS Successful completion.
* \retval RPP_ERROR* Unsuccessful completion.
*/
RppStatus rppt_to_decibels_host(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, RpptImagePatchPtr srcDims, Rpp32f cutOffDB, Rpp32f multiplier, Rpp32f referenceMagnitude, rppHandle_t rppHandle);

#ifdef GPU_SUPPORT
/*! \brief To Decibels augmentation on HIP backend
* \details To Decibels augmentation for 1D/2D audio buffer converts magnitude values to decibel values
* \param [in] srcPtr source tensor in HIP memory
* \param [in] srcDescPtr source tensor descriptor (Restrictions - numDims = 2 or 3 (for single-channel or multi-channel/2D audio tensor with 1 channel), offsetInBytes >= 0, dataType = F32)
* \param [out] dstPtr destination tensor in HIP memory
* \param [in] dstDescPtr destination tensor descriptor (Restrictions - numDims = 2 or 3 (for single-channel or multi-channel/2D audio tensor with 1 channel), offsetInBytes >= 0, dataType = F32)
* \param [in] srcDims source tensor sizes for each element in batch (2D tensor in Pinned/HIP memory, of size batchSize * 2)
* \param [in] cutOffDB minimum or cut-off ratio in dB
* \param [in] multiplier factor by which the logarithm is multiplied
* \param [in] referenceMagnitude Reference magnitude if not provided maximum value of input used as reference
* \param [in] rppHandle RPP HIP handle created with <tt>\ref rppCreateWithStreamAndBatchSize()</tt>
* \return A <tt> \ref RppStatus</tt> enumeration.
* \retval RPP_SUCCESS Successful completion.
* \retval RPP_ERROR* Unsuccessful completion.
*/
RppStatus rppt_to_decibels_gpu(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, RpptImagePatchPtr srcDims, Rpp32f cutOffDB, Rpp32f multiplier, Rpp32f referenceMagnitude, rppHandle_t rppHandle);
#endif // GPU_SUPPORT

/*! \brief Pre Emphasis Filter augmentation on HOST backend
* \details Pre Emphasis Filter augmentation for audio data
* \param[in] srcPtr source tensor in HOST memory
* \param[in] srcDescPtr source tensor descriptor (Restrictions - numDims = 3, offsetInBytes >= 0, dataType = F32)
* \param[out] dstPtr destination tensor in HOST memory
* \param[in] dstDescPtr destination tensor descriptor (Restrictions - numDims = 3, offsetInBytes >= 0, dataType = F32)
* \param[in] srcLengthTensor source audio buffer length (1D tensor in HOST memory, of size batchSize)
* \param[in] coeffTensor preemphasis coefficient (1D tensor in HOST memory, of size batchSize)
* \param[in] borderType border value policy
* \param[in] rppHandle RPP HOST handle created with <tt>\ref rppCreateWithBatchSize()</tt>
* \param [in] srcPtr source tensor in HOST memory
* \param [in] srcDescPtr source tensor descriptor (Restrictions - numDims = 3, offsetInBytes >= 0, dataType = F32)
* \param [out] dstPtr destination tensor in HOST memory
* \param [in] dstDescPtr destination tensor descriptor (Restrictions - numDims = 3, offsetInBytes >= 0, dataType = F32)
* \param [in] srcLengthTensor source audio buffer length (1D tensor in HOST memory, of size batchSize)
* \param [in] coeffTensor preemphasis coefficient (1D tensor in HOST memory, of size batchSize)
* \param [in] borderType border value policy
* \param [in] rppHandle RPP HOST handle created with <tt>\ref rppCreateWithBatchSize()</tt>
* \return A <tt> \ref RppStatus</tt> enumeration.
* \retval RPP_SUCCESS Successful completion.
* \retval RPP_ERROR* Unsuccessful completion.
Expand All @@ -99,13 +118,13 @@ RppStatus rppt_pre_emphasis_filter_host(RppPtr_t srcPtr, RpptDescPtr srcDescPtr,

/*! \brief Down Mixing augmentation on HOST backend
* \details Down Mixing augmentation for audio data
* \param[in] srcPtr source tensor in HOST memory
* \param[in] srcDescPtr source tensor descriptor (Restrictions - numDims = 3, offsetInBytes >= 0, dataType = F32)
* \param[out] dstPtr destination tensor in HOST memory
* \param[in] dstDescPtr destination tensor descriptor (Restrictions - numDims = 3, offsetInBytes >= 0, dataType = F32)
* \param[in] srcDimsTensor source audio buffer length and number of channels (1D tensor in HOST memory, of size batchSize * 2)
* \param[in] normalizeWeights bool flag to specify if normalization of weights is needed
* \param[in] rppHandle RPP HOST handle created with <tt>\ref rppCreateWithBatchSize()</tt>
* \param [in] srcPtr source tensor in HOST memory
* \param [in] srcDescPtr source tensor descriptor (Restrictions - numDims = 3, offsetInBytes >= 0, dataType = F32)
* \param [out] dstPtr destination tensor in HOST memory
* \param [in] dstDescPtr destination tensor descriptor (Restrictions - numDims = 3, offsetInBytes >= 0, dataType = F32)
* \param [in] srcDimsTensor source audio buffer length and number of channels (1D tensor in HOST memory, of size batchSize * 2)
* \param [in] normalizeWeights bool flag to specify if normalization of weights is needed
* \param [in] rppHandle RPP HOST handle created with <tt>\ref rppCreateWithBatchSize()</tt>
* \return A <tt> \ref RppStatus</tt> enumeration.
* \retval RPP_SUCCESS Successful completion.
* \retval RPP_ERROR* Unsuccessful completion.
Expand Down
30 changes: 30 additions & 0 deletions src/modules/hip/hip_tensor_audio_augmentations.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
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.
*/

#ifndef HIP_TENSOR_AUDIO_AUGMENTATIONS_HPP
#define HIP_TENSOR_AUDIO_AUGMENTATIONS_HPP

#include "kernel/to_decibels.hpp"

#endif // HIP_TENSOR_AUDIO_AUGMENTATIONS_HPP
Loading