diff options
author | Giorgio Arena <giorgio.arena@arm.com> | 2020-12-10 16:49:39 +0000 |
---|---|---|
committer | Giorgio Arena <giorgio.arena@arm.com> | 2020-12-14 13:58:17 +0000 |
commit | ea7de7babc319e2fa31c5e1c986e48d6c5370689 (patch) | |
tree | 2303791668c67eda76dfb14d07b912af1cb54a17 /tests/validation/reference | |
parent | ec241b48ea7481e797285788fd68e5e1d42382bb (diff) | |
download | ComputeLibrary-ea7de7babc319e2fa31c5e1c986e48d6c5370689.tar.gz |
Enable FFT for FP16
Resolves: COMPMID-4051
Change-Id: I0c0bf97212dd281c19d5081e6247e7dc0c23cd6b
Signed-off-by: Giorgio Arena <giorgio.arena@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4687
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'tests/validation/reference')
-rw-r--r-- | tests/validation/reference/DFT.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/tests/validation/reference/DFT.cpp b/tests/validation/reference/DFT.cpp index 1f746eaeb7..b98bc77b1d 100644 --- a/tests/validation/reference/DFT.cpp +++ b/tests/validation/reference/DFT.cpp @@ -318,7 +318,7 @@ SimpleTensor<T> ridft_1d(const SimpleTensor<T> &src, bool is_odd) { auto dst = rdft_1d_core(src, FFTDirection::Inverse, is_odd); - const T scaling_factor = dst.shape()[0]; + const T scaling_factor = T(dst.shape()[0]); scale(dst, scaling_factor); return dst; @@ -330,7 +330,7 @@ SimpleTensor<T> dft_1d(const SimpleTensor<T> &src, FFTDirection direction) auto dst = dft_1d_core(src, direction); if(direction == FFTDirection::Inverse) { - const T scaling_factor = dst.shape()[0]; + const T scaling_factor = T(dst.shape()[0]); scale(dst, scaling_factor); } return dst; @@ -359,7 +359,7 @@ SimpleTensor<T> ridft_2d(const SimpleTensor<T> &src, bool is_odd) auto transposed_2 = permute(first_pass, PermutationVector(1U, 0U)); auto dst = rdft_1d_core(transposed_2, direction, is_odd); - const T scaling_factor = dst.shape()[0] * dst.shape()[1]; + const T scaling_factor = T(dst.shape()[0] * dst.shape()[1]); scale(dst, scaling_factor); return dst; } @@ -383,7 +383,7 @@ SimpleTensor<T> dft_2d(const SimpleTensor<T> &src, FFTDirection direction) auto transposed_2 = permute(first_pass, PermutationVector(1U, 0U)); auto dst = dft_1d_core(transposed_2, direction); - const T scaling_factor = dst.shape()[0] * dst.shape()[1]; + const T scaling_factor = T(dst.shape()[0] * dst.shape()[1]); scale(dst, scaling_factor); return dst; @@ -425,6 +425,7 @@ SimpleTensor<T> conv2d_dft(const SimpleTensor<T> &src, const SimpleTensor<T> &w, return slice(conv_res, Coordinates(start_left, start_top), Coordinates(end_right, end_botton)); } +// FP32 template SimpleTensor<float> rdft_1d(const SimpleTensor<float> &src); template SimpleTensor<float> ridft_1d(const SimpleTensor<float> &src, bool is_odd); template SimpleTensor<float> dft_1d(const SimpleTensor<float> &src, FFTDirection direction); @@ -434,6 +435,17 @@ template SimpleTensor<float> ridft_2d(const SimpleTensor<float> &src, bool is_od template SimpleTensor<float> dft_2d(const SimpleTensor<float> &src, FFTDirection direction); template SimpleTensor<float> conv2d_dft(const SimpleTensor<float> &src, const SimpleTensor<float> &w, const PadStrideInfo &conv_info); + +// FP16 +template SimpleTensor<half> rdft_1d(const SimpleTensor<half> &src); +template SimpleTensor<half> ridft_1d(const SimpleTensor<half> &src, bool is_odd); +template SimpleTensor<half> dft_1d(const SimpleTensor<half> &src, FFTDirection direction); + +template SimpleTensor<half> rdft_2d(const SimpleTensor<half> &src); +template SimpleTensor<half> ridft_2d(const SimpleTensor<half> &src, bool is_odd); +template SimpleTensor<half> dft_2d(const SimpleTensor<half> &src, FFTDirection direction); + +template SimpleTensor<half> conv2d_dft(const SimpleTensor<half> &src, const SimpleTensor<half> &w, const PadStrideInfo &conv_info); } // namespace reference } // namespace validation } // namespace test |