diff --git a/ngraph/core/include/ngraph/op/dft.hpp b/ngraph/core/include/ngraph/op/dft.hpp index 29570dee9573eb..11abbb8ab91e90 100644 --- a/ngraph/core/include/ngraph/op/dft.hpp +++ b/ngraph/core/include/ngraph/op/dft.hpp @@ -21,6 +21,7 @@ #include "ngraph/attribute_adapter.hpp" #include "ngraph/op/op.hpp" #include "ngraph/op/util/attr_types.hpp" +#include "ngraph/op/util/fft_base.hpp" namespace ngraph { @@ -29,7 +30,7 @@ namespace ngraph namespace v7 { /// \brief An operation DFT that computes the discrete Fourier transformation. - class NGRAPH_API DFT : public Op + class NGRAPH_API DFT : public util::FFTBase { public: NGRAPH_RTTI_DECLARATION; @@ -52,13 +53,8 @@ namespace ngraph bool visit_attributes(AttributeVisitor& visitor) override; - void validate_and_infer_types() override; - std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; - - protected: - void validate(); }; } } diff --git a/ngraph/core/include/ngraph/op/idft.hpp b/ngraph/core/include/ngraph/op/idft.hpp index e8b1d2f15ebe08..f3a7d585b74de9 100644 --- a/ngraph/core/include/ngraph/op/idft.hpp +++ b/ngraph/core/include/ngraph/op/idft.hpp @@ -9,6 +9,7 @@ #include "ngraph/attribute_adapter.hpp" #include "ngraph/op/op.hpp" #include "ngraph/op/util/attr_types.hpp" +#include "ngraph/op/util/fft_base.hpp" namespace ngraph { @@ -17,7 +18,7 @@ namespace ngraph namespace v7 { /// \brief An operation IDFT that computes the inverse discrete Fourier transformation. - class NGRAPH_API IDFT : public Op + class NGRAPH_API IDFT : public util::FFTBase { public: NGRAPH_RTTI_DECLARATION; @@ -40,13 +41,8 @@ namespace ngraph bool visit_attributes(AttributeVisitor& visitor) override; - void validate_and_infer_types() override; - std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; - - protected: - void validate(); }; } } diff --git a/ngraph/core/include/ngraph/op/util/fft_base.hpp b/ngraph/core/include/ngraph/op/util/fft_base.hpp new file mode 100644 index 00000000000000..9652e43a6f638c --- /dev/null +++ b/ngraph/core/include/ngraph/op/util/fft_base.hpp @@ -0,0 +1,46 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include "ngraph/op/op.hpp" +#include "ngraph/op/util/attr_types.hpp" + +namespace ngraph +{ + namespace op + { + namespace util + { + /// \brief Base class for operations DFT and DFT. + class NGRAPH_API FFTBase : public Op + { + public: + NGRAPH_RTTI_DECLARATION; + FFTBase() = default; + + void validate_and_infer_types() override; + bool visit_attributes(AttributeVisitor& visitor) override; + + protected: + /// \brief Constructs an FFT operation. FFT is performed for full size axes. + /// + /// \param data Input data + /// \param axes Axes to perform FFT + FFTBase(const Output& data, const Output& axes); + + /// \brief Constructs a FFT operation. + /// + /// \param data Input data + /// \param axes Axes to perform FFT + /// \param signal_size Signal sizes for 'axes' + FFTBase(const Output& data, + const Output& axes, + const Output& signal_size); + + void validate(); + }; + } + } +} diff --git a/ngraph/core/reference/include/ngraph/runtime/reference/fft.hpp b/ngraph/core/reference/include/ngraph/runtime/reference/fft.hpp new file mode 100644 index 00000000000000..8429058ca08aaa --- /dev/null +++ b/ngraph/core/reference/include/ngraph/runtime/reference/fft.hpp @@ -0,0 +1,62 @@ +//***************************************************************************** +// Copyright 2017-2021 Intel Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//***************************************************************************** + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "ngraph/node.hpp" +#include "ngraph/op/util/op_types.hpp" +#include "ngraph/ops.hpp" +#include "ngraph/shape_util.hpp" + +namespace ngraph +{ + namespace runtime + { + namespace reference + { + enum class FFTKind + { + Forward, + Inverse + }; + + void fft(const float* input_data, + const Shape& input_data_shape, + const int64_t* axes_data, + const Shape& axes_data_shape, + float* fft_result, + const Shape& output_shape, + FFTKind fft_kind); + + void fft_postprocessing(const HostTensorVector& outputs, + const ngraph::element::Type output_type, + const std::vector& fft_result); + + std::vector canonicalize_axes(const int64_t* axes_data, + const Shape& axes_data_shape, + int64_t complex_data_rank); + } + } +} diff --git a/ngraph/core/reference/src/runtime/reference/fft.cpp b/ngraph/core/reference/src/runtime/reference/fft.cpp new file mode 100644 index 00000000000000..01ce6b49a457ad --- /dev/null +++ b/ngraph/core/reference/src/runtime/reference/fft.cpp @@ -0,0 +1,635 @@ +//***************************************************************************** +// Copyright 2017-2021 Intel Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//***************************************************************************** + +#include "ngraph/runtime/reference/fft.hpp" +#include +#include +#include +#include +#include +#include +#include +#include +#include "ngraph/shape.hpp" + +using namespace ngraph; +using namespace ngraph::runtime::reference; + +namespace ngraph +{ + namespace runtime + { + namespace reference + { + // FFT operation supports for negative axes to transform. More precisely, according to + // the FFT operation specification, axes should be integers from -(r - 1) to (r - 2) + // inclusively, where r = rank(data). A negative axis 'a' is interpreted as an axis + // 'r - 1 + a'. The reason is the following: real input tensor of the shape + // [n_0, ..., n_{r - 1}, 2] is interpreted as a complex tensor with the shape + // [n_0, ..., n_{r - 1}]. To simplify calculations, we need to convert negative axes to + // positive axes using the formula 'r - 1 + a'. + std::vector canonicalize_axes(const int64_t* axes_data, + const Shape& axes_data_shape, + int64_t complex_data_rank) + { + size_t num_of_fft_axes = axes_data_shape[0]; + + std::vector result(axes_data, axes_data + num_of_fft_axes); + for (int64_t& axis : result) + { + if (axis < 0) + { + axis += complex_data_rank; + } + } + return result; + } + + namespace + { + using complex_type = std::complex; + + // Calculates strides for all axes. + std::vector compute_strides(const std::vector& v) + { + std::vector strides(v.size() + 1); + int64_t stride = 1; + for (size_t i = 0; i < v.size(); ++i) + { + strides[i] = stride; + stride *= v[i]; + } + strides.back() = stride; + return strides; + } + + // To simplify calculation of strides for all axes of 'shape' of some complex + // tensor, we reverse numbers in 'shape'. Because we have no native support for + // complex numbers in tensors, we interpret FFT input tensors of the shape + // [N_0, ..., N_{r - 1}, 2] as a complex tensor with the shape + // [N_0, ..., N_{r - 1}]. Hence, we convert 'shape=[N_0, ..., N_{r - 1}, 2]' + // into [N_{r - 1}, ..., N_0]. + std::vector reverse_shape(const Shape& shape) + { + size_t complex_data_rank = shape.size() - 1; + + std::vector reversed_shape(complex_data_rank); + for (size_t i = 0; i < complex_data_rank; ++i) + { + reversed_shape[i] = static_cast(shape[complex_data_rank - i - 1]); + } + return reversed_shape; + } + + // This function gets FFT axes from axes_data + std::vector get_axes(const int64_t* axes_data, + const Shape& axes_data_shape, + int64_t complex_data_rank) + { + auto axes = canonicalize_axes(axes_data, axes_data_shape, complex_data_rank); + std::sort(axes.begin(), axes.end(), std::greater{}); + return axes; + } + + // When we reverted shape, we need to revert FFT axes. + void reverse_fft_axes(std::vector& axes, int64_t complex_data_rank) + { + for (int64_t& axis : axes) + { + axis = complex_data_rank - 1 - axis; + } + } + + // Helper function to get only length with respect to given axes. + std::vector get_lengths(const std::vector& shape, + const std::vector& axes) + { + std::vector lengths; + for (int64_t axis : axes) + { + lengths.push_back(shape[axis]); + } + return lengths; + } + + // This function calculates 'outer axes', that is axes that are + // not transformed by FFT. + std::vector get_outer_axes(const std::vector& inner_axes, + int64_t complex_data_rank) + { + int64_t num_of_inner_axes = static_cast(inner_axes.size()); + int64_t num_of_outer_axes = complex_data_rank - num_of_inner_axes; + + std::vector outer_axes(num_of_outer_axes); + + int64_t fft_axes_as_bitset = 0; + for (int64_t axis : inner_axes) + { + assert(axis < 64); + fft_axes_as_bitset |= static_cast(1) << axis; + } + + for (int64_t j = 0, i = 0; i < complex_data_rank; ++i) + { + if ((fft_axes_as_bitset & (static_cast(1) << i)) == 0) + { + outer_axes[j] = i; + ++j; + } + } + + return outer_axes; + } + + inline bool is_power_of_two(int64_t x) { return (x != 0) && ((x & (x - 1)) == 0); } + + // This function calculates internal FFT buffer size using lengths of FFT axes. + int64_t compute_buffer_size(const std::vector& fft_lengths) + { + int64_t buffer_size = 0; + + for (int64_t length : fft_lengths) + { + int64_t current_size = is_power_of_two(length) ? (2 * length) : length; + buffer_size = std::max(buffer_size, current_size); + } + + return buffer_size; + } + + // Calculating coordinates c_0, ..., c_{k - 1} from the index of the form + // c_0 * strides[0] + ... c_{k - 1} * strides[k - 1] + // where k is the number of strides. + std::vector coords_from_index(int64_t index, + const std::vector& strides) + { + int64_t num_of_axes = static_cast(strides.size()) - 1; + if (num_of_axes == 0) + { + return std::vector{}; + } + std::vector coords(num_of_axes); + int64_t curr = index; + for (int64_t j = num_of_axes - 1; j >= 1; --j) + { + coords[j] = curr / strides[j]; + curr %= strides[j]; + } + coords[0] = curr; + return coords; + } + + // This function gets a complex value from given coords of this value + complex_type get_value_from_input(const complex_type* input_data, + int64_t src_index, + const std::vector& coords, + const std::vector& input_fft_lengths, + const std::vector& input_fft_strides) + { + int64_t offset = 0; + int64_t num_of_fft_axes = static_cast(coords.size()); + for (int64_t i = 0; i < num_of_fft_axes; ++i) + { + int64_t coord = coords[i]; + if (coord >= input_fft_lengths[i]) + { + return complex_type{0.0f, 0.0f}; + } + offset += coord * input_fft_strides[i]; + } + + return input_data[src_index + offset]; + } + + // Copying input data to the given memory domain. + void copy_data_from_input(complex_type* result, + const complex_type* input_data, + int64_t src_index, + int64_t fft_size, + const std::vector& fft_strides, + const std::vector& input_fft_lengths, + const std::vector& input_fft_strides) + { + for (int64_t idx = 0; idx < fft_size; ++idx) + { + auto coords = coords_from_index(idx, fft_strides); + complex_type value = get_value_from_input( + input_data, src_index, coords, input_fft_lengths, input_fft_strides); + result[idx] = value; + } + } + + // This function checks whether data of given complex blob are only zeros. + bool blob_is_zero(const complex_type* data, int64_t blob_size) + { + for (int64_t i = 0; i < blob_size; ++i) + { + if (data[i] != complex_type{0.0f, 0.0f}) + { + return false; + } + } + return true; + } + + // Calculates offset of value using corresponding coordinates and strides. + int64_t offset_from_coords_and_strides(const std::vector& coords, + const std::vector& strides) + { + int64_t offset = 0; + int64_t num_of_axes = coords.size(); + for (int64_t i = 0; i < num_of_axes; ++i) + { + offset += coords[i] * strides[i]; + } + return offset; + } + + // Copying calculated data to the given memory domain. + void copy_data_to_output(complex_type* output, + const complex_type* data, + int64_t dst_index, + int64_t fft_size, + const std::vector& fft_strides, + const std::vector& output_fft_strides) + { + for (int64_t idx = 0; idx < fft_size; ++idx) + { + auto coords = coords_from_index(idx, fft_strides); + complex_type value = data[idx]; + int64_t offset = offset_from_coords_and_strides(coords, output_fft_strides); + + output[dst_index + offset] = value; + } + } + + static constexpr float pi = 3.141592653589793238462643f; + + // This function calculates e^{-2i\pi k / length} for the forward FFT, and + // e^{2i\pi k / length} otherwise. Here 'i' is an imaginary unit. + complex_type twiddle(int64_t k, int64_t length, FFTKind fft_kind) + { + float angle = -2.0f * pi * static_cast(k) / static_cast(length); + complex_type result = std::exp(complex_type(0.0f, angle)); + return (fft_kind == FFTKind::Inverse) ? std::conj(result) : result; + } + + // This function gathers data from the input of 1D FFT to the contiguous buffer + void gather_to_buffer(const complex_type* data, + int64_t length, + int64_t start, + int64_t stride, + complex_type* buffer) + { + for (int64_t k = 0; k < length; ++k) + { + complex_type value = data[start + k * stride]; + buffer[k] = value; + } + } + + std::vector generate_twiddles(int64_t length, FFTKind fft_kind) + { + std::vector twiddles(length / 2); + for (int64_t k = 0; k < length / 2; ++k) + { + twiddles[k] = twiddle(k, length, fft_kind); + } + return twiddles; + } + + // Non-recursive implementation of the Cooley-Tukey radix-2 decimation in + // time. Performs 1D FFT transform for the lengths, which are powers of 2. + // Runs in O(length * log(length)) time. Uses the same parameters as the naive + // implementation above, except that the preallocated buffer must be at least + // twice as big as the length of the transform, because the buffer is used to + // hold both input and output values for each stage of the transform. + void optimized_fft1d(int64_t length, + int64_t fft_offset, + int64_t stride, + complex_type* data, + complex_type* buffer, + FFTKind fft_kind) + { + gather_to_buffer(data, length, fft_offset, stride, buffer); + if (blob_is_zero(buffer, length)) + { + return; + } + + int64_t in_base = length; + int64_t out_base = 0; + for (int64_t num_blocks = 1; num_blocks < length; num_blocks *= 2) + { + std::swap(in_base, out_base); + + auto twiddles = generate_twiddles(num_blocks * 2, fft_kind); + const int64_t block_size = length / num_blocks; + const int64_t next_iteration_block_size = block_size / 2; + for (int64_t block = 0; block < num_blocks; block++) + { + const int64_t in_offset = in_base + block * block_size; + const int64_t out_offset = out_base + block * next_iteration_block_size; + + for (int64_t pair = 0; pair < block_size / 2; pair++) + { + const complex_type even = buffer[in_offset + pair]; + const complex_type odd = buffer[in_offset + block_size / 2 + pair]; + const complex_type twiddled_odd = twiddles[block] * odd; + buffer[out_offset + pair] = even + twiddled_odd; + buffer[out_offset + length / 2 + pair] = even - twiddled_odd; + } + } + } + + for (int64_t k = 0; k < length; k++) + { + complex_type value = buffer[out_base + k]; + if (fft_kind == FFTKind::Inverse) + { + value /= complex_type(length, 0.0f); + } + data[fft_offset + k * stride] = value; + } + } + + // Naive implementation of 1D FFT + void naive_fft1d(int64_t length, + int64_t fft_offset, + int64_t stride, + complex_type* data, + complex_type* buffer, + FFTKind fft_kind) + { + gather_to_buffer(data, length, fft_offset, stride, buffer); + if (blob_is_zero(buffer, length)) + { + return; + } + + for (int64_t k = 0; k < length; ++k) + { + complex_type value = complex_type(0.0f, 0.0f); + for (int64_t n = 0; n < length; ++n) + { + value += buffer[n] * twiddle(n * k, length, fft_kind); + } + if (fft_kind == FFTKind::Inverse) + { + value /= complex_type(length, 0.0f); + } + data[fft_offset + k * stride] = value; + } + } + + void fft1d(int64_t length, + int64_t fft_offset, + int64_t stride, + complex_type* data, + complex_type* buffer, + FFTKind fft_kind) + { + if (is_power_of_two(length)) + { + optimized_fft1d(length, fft_offset, stride, data, buffer, fft_kind); + } + else + { + naive_fft1d(length, fft_offset, stride, data, buffer, fft_kind); + } + } + + struct InfoForFFTCalculation + { + std::vector fft_axes; + std::vector fft_lengths; + std::vector fft_strides; + std::vector outer_strides; + std::vector output_fft_strides; + std::vector output_outer_strides; + std::vector input_fft_lengths; + std::vector input_fft_strides; + std::vector input_outer_strides; + int64_t fft_rank; + int64_t fft_size; + int64_t outer_size; + int64_t buffer_size; + }; + + // This function builds information needed to calculate FFT. + InfoForFFTCalculation get_info_for_calculation(const Shape& input_data_shape, + const int64_t* axes_data, + const Shape& axes_data_shape, + const Shape& output_shape) + { + InfoForFFTCalculation result; + + const int64_t complex_data_rank = + static_cast(input_data_shape.size() - 1); + + const auto reversed_output_shape = reverse_shape(output_shape); + auto fft_axes = get_axes(axes_data, axes_data_shape, complex_data_rank); + reverse_fft_axes(fft_axes, complex_data_rank); + + const int64_t fft_rank = fft_axes.size(); + const auto fft_lengths = get_lengths(reversed_output_shape, fft_axes); + const auto fft_strides = compute_strides(fft_lengths); + const int64_t fft_size = fft_strides[fft_rank]; + + const auto outer_axes = get_outer_axes(fft_axes, complex_data_rank); + const int64_t outer_rank = outer_axes.size(); + const auto outer_lengths = get_lengths(reversed_output_shape, outer_axes); + const auto outer_strides = compute_strides(outer_lengths); + const int64_t outer_size = outer_strides[outer_rank]; + + const int64_t buffer_size = compute_buffer_size(fft_lengths); + + const auto output_strides = compute_strides(reversed_output_shape); + const auto output_fft_strides = get_lengths(output_strides, fft_axes); + const auto output_outer_strides = get_lengths(output_strides, outer_axes); + const auto reversed_input_shape = reverse_shape(input_data_shape); + const auto input_fft_lengths = get_lengths(reversed_input_shape, fft_axes); + const auto input_strides = compute_strides(reversed_input_shape); + const auto input_fft_strides = get_lengths(input_strides, fft_axes); + const auto input_outer_strides = get_lengths(input_strides, outer_axes); + + result.fft_axes = fft_axes; + result.fft_lengths = fft_lengths; + result.fft_strides = fft_strides; + result.outer_strides = outer_strides; + result.output_fft_strides = output_fft_strides; + result.output_outer_strides = output_outer_strides; + result.input_fft_lengths = input_fft_lengths; + result.input_fft_strides = input_fft_strides; + result.input_outer_strides = input_outer_strides; + result.fft_rank = fft_rank; + result.fft_size = fft_size; + result.outer_size = outer_size; + result.buffer_size = buffer_size; + + return result; + } + } + + // Calculation of FFT + void fft(const float* input_data, + const Shape& input_data_shape, + const int64_t* axes_data, + const Shape& axes_data_shape, + float* fft_result, + const Shape& output_shape, + FFTKind fft_kind) + { + const complex_type* complex_input_data_ptr = + reinterpret_cast(input_data); + complex_type* complex_output_ptr = reinterpret_cast(fft_result); + + const auto info = get_info_for_calculation( + input_data_shape, axes_data, axes_data_shape, output_shape); + const auto& fft_axes = info.fft_axes; + const int64_t fft_rank = info.fft_rank; + const auto& fft_lengths = info.fft_lengths; + const auto& fft_strides = info.fft_strides; + const int64_t fft_size = info.fft_size; + + if (fft_size <= 0) + { + return; + } + + std::vector data(fft_size); + std::vector buffer(info.buffer_size); + + const auto& output_fft_strides = info.output_fft_strides; + const auto& outer_strides = info.outer_strides; + const int64_t outer_size = info.outer_size; + + const auto& output_outer_strides = info.output_outer_strides; + const auto& input_fft_lengths = info.input_fft_lengths; + const auto& input_fft_strides = info.input_fft_strides; + const auto& input_outer_strides = info.input_outer_strides; + + // Loop along with 'outer' dimensions, that is along with + // not transformed dimensions. + for (int64_t outer_idx = 0; outer_idx < outer_size; ++outer_idx) + { + const auto outer_coords = coords_from_index(outer_idx, outer_strides); + int64_t outer_input_offset = + offset_from_coords_and_strides(outer_coords, input_outer_strides); + + // Copying current data to transform + copy_data_from_input(data.data(), + complex_input_data_ptr, + outer_input_offset, + fft_size, + fft_strides, + input_fft_lengths, + input_fft_strides); + + if (!blob_is_zero(data.data(), fft_size)) + { + // The loop along with all transformed axes. + for (int64_t axis_idx = 0; axis_idx < fft_rank; ++axis_idx) + { + int64_t current_fft_stride = fft_strides[axis_idx]; + int64_t current_fft_length = fft_lengths[axis_idx]; + + int64_t outer_fft_size = 1; + std::vector outer_fft_lengths; + std::vector outer_fft_axes; + for (int64_t i = 0; i < fft_rank; ++i) + { + if (i == axis_idx) + { + continue; + } + outer_fft_size *= fft_lengths[i]; + outer_fft_lengths.push_back(fft_lengths[i]); + outer_fft_axes.push_back(fft_axes[i]); + } + auto outer_fft_strides = compute_strides(outer_fft_lengths); + auto fft_strides_for_outer_fft_axes = + get_lengths(fft_strides, outer_fft_axes); + + // Loop along with all FFT axes, except the current one. + for (int64_t outer_fft_idx = 0; outer_fft_idx < outer_fft_size; + ++outer_fft_idx) + { + const auto outer_fft_coords = + coords_from_index(outer_fft_idx, outer_fft_strides); + int64_t outer_fft_offset = offset_from_coords_and_strides( + outer_fft_coords, fft_strides_for_outer_fft_axes); + // Calculation of 1D FFT + fft1d(current_fft_length, + outer_fft_offset, + current_fft_stride, + data.data(), + buffer.data(), + fft_kind); + } + } + } + + // Copying current calculated data to the output blob. + int64_t outer_output_offset = + offset_from_coords_and_strides(outer_coords, output_outer_strides); + copy_data_to_output(complex_output_ptr, + data.data(), + outer_output_offset, + fft_size, + fft_strides, + output_fft_strides); + } + } + + void fft_postprocessing(const HostTensorVector& outputs, + const ngraph::element::Type output_type, + const std::vector& fft_result) + { + size_t fft_result_size = fft_result.size(); + + switch (output_type) + { + case element::Type_t::bf16: + { + bfloat16* result_ptr = outputs[0]->get_data_ptr(); + for (size_t i = 0; i < fft_result_size; ++i) + { + result_ptr[i] = bfloat16(fft_result[i]); + } + } + break; + case element::Type_t::f16: + { + float16* result_ptr = outputs[0]->get_data_ptr(); + for (size_t i = 0; i < fft_result_size; ++i) + { + result_ptr[i] = float16(fft_result[i]); + } + } + break; + case element::Type_t::f32: + { + float* result_ptr = outputs[0]->get_data_ptr(); + memcpy(result_ptr, fft_result.data(), fft_result_size * sizeof(float)); + } + break; + default:; + } + } + } + } +} \ No newline at end of file diff --git a/ngraph/core/src/op/dft.cpp b/ngraph/core/src/op/dft.cpp index f689652b580c4c..43b447031caa0a 100644 --- a/ngraph/core/src/op/dft.cpp +++ b/ngraph/core/src/op/dft.cpp @@ -30,10 +30,10 @@ using namespace std; using namespace ngraph; -NGRAPH_RTTI_DEFINITION(op::v7::DFT, "DFT", 7); +NGRAPH_RTTI_DEFINITION(op::v7::DFT, "DFT", 7, util::FFTBase); op::v7::DFT::DFT(const Output& data, const Output& axes) - : Op({data, axes}) + : FFTBase(data, axes) { constructor_validate_and_infer_types(); } @@ -41,7 +41,7 @@ op::v7::DFT::DFT(const Output& data, const Output& axes) op::v7::DFT::DFT(const Output& data, const Output& axes, const Output& signal_size) - : Op({data, axes, signal_size}) + : FFTBase(data, axes, signal_size) { constructor_validate_and_infer_types(); } @@ -66,202 +66,3 @@ std::shared_ptr op::v7::DFT::clone_with_new_inputs(const OutputVector& new return std::make_shared(new_args.at(0), new_args.at(1), new_args.at(2)); } - -void op::v7::DFT::validate() -{ - size_t num_of_inputs = get_input_size(); - - NODE_VALIDATION_CHECK( - this, num_of_inputs == 2 || num_of_inputs == 3, "DFT must have 2 or 3 inputs."); - - element::Type input_et = get_input_element_type(0); - NODE_VALIDATION_CHECK(this, - input_et == element::f32 || input_et == element::f16 || - input_et == element::bf16, - "DFT input element type must be f32, f16, or bf16"); - - element::Type axes_et = get_input_element_type(1); - NODE_VALIDATION_CHECK(this, - axes_et == element::i64 || axes_et == element::i32, - "DFT axes element type must be i32 or i64"); - - const auto& input_shape = PartialShape(get_input_partial_shape(0)); - if (input_shape.rank().is_static()) - { - const auto input_rank = input_shape.rank().get_length(); - NODE_VALIDATION_CHECK(this, - input_rank >= 2, - "The input rank must be greater or equal to 2. Got input rank: ", - input_rank); - - auto last_dim_with_two = input_shape[input_rank - 1] & Dimension(2); - NODE_VALIDATION_CHECK(this, - !last_dim_with_two.get_interval().empty(), - "The last dimension of input data must be 2. Got: ", - input_shape[input_rank - 1]); - } - - const auto& axes_shape = PartialShape(get_input_partial_shape(1)); - if (axes_shape.rank().is_static()) - { - NODE_VALIDATION_CHECK(this, - axes_shape.rank().get_length() == 1, - "DFT axes input must be 1D tensor. Got axes input rank: ", - axes_shape.rank().get_length()); - } - - if (input_shape.rank().is_static() && axes_shape.is_static()) - { - const auto input_rank = input_shape.rank().get_length(); - NODE_VALIDATION_CHECK(this, - input_rank >= axes_shape.to_shape()[0] + 1, - "The input rank must be greater than number of DFT axes. Got " - "input rank: ", - input_rank, - ", number of axes: ", - axes_shape.to_shape()[0]); - } - - if (input_shape.rank().is_static() && is_type(input_value(1).get_node())) - { - const auto input_rank = input_shape.rank().get_length(); - const auto& const_axes = get_constant_from_source(input_value(1)); - auto axes = const_axes->cast_vector(); - - // DFT operation supports for negative axes to transform. More precisely, according to - // the DFT operation specification, axes should be integers from -(r - 1) to (r - 2) - // inclusively, where r = rank(data). A negative axis 'a' is interpreted as an axis - //'r - 1 + a'. The reason is the following. - for (int64_t& axis : axes) - { - if (axis < 0) - { - axis += input_rank - 1; - } - } - - AxisVector axes_vector; - AxisSet axes_set; - for (const int64_t axis : axes) - { - axes_vector.push_back(static_cast(axis)); - axes_set.insert(static_cast(axis)); - } - - NODE_VALIDATION_CHECK( - this, axes.size() == axes_set.size(), "DFT axes must be unique. Got: ", axes_vector); - - NODE_VALIDATION_CHECK(this, - std::find(axes.begin(), axes.end(), input_rank - 1) == axes.end(), - "DFT axes cannot contain the last axis. Got axes: ", - axes_vector); - } - - if (num_of_inputs == 3) - { - element::Type signal_size_et = get_input_element_type(2); - NODE_VALIDATION_CHECK(this, - signal_size_et == element::i64 || signal_size_et == element::i32, - "DFT signal_size element type must be i32 or i64"); - - const auto& signal_size_shape = PartialShape(get_input_partial_shape(2)); - if (signal_size_shape.rank().is_static()) - { - NODE_VALIDATION_CHECK(this, - signal_size_shape.rank().get_length() == 1, - "DFT Signal size input must be 1D tensor. Got signal size " - "input rank: ", - signal_size_shape.rank().get_length()); - } - - if (axes_shape.is_static() && signal_size_shape.is_static()) - { - NODE_VALIDATION_CHECK(this, - axes_shape.to_shape()[0] == signal_size_shape.to_shape()[0], - "Sizes of inputs 'axes' and 'signal_size' must be equal. Got " - "size of 'axes': ", - axes_shape.to_shape()[0], - "size of 'signal_size': ", - signal_size_shape.to_shape()[0]); - } - } -} - -void op::v7::DFT::validate_and_infer_types() -{ - NGRAPH_OP_SCOPE(v7_DFT_validate_and_infer_types); - validate(); - - const auto& input_shape = PartialShape(get_input_partial_shape(0)); - const auto& axes_shape = PartialShape(get_input_partial_shape(1)); - PartialShape output_shape = input_shape; - if (input_shape.rank().is_dynamic()) - { - set_output_type(0, get_input_element_type(0), output_shape); - return; - } - - const auto input_rank = input_shape.rank().get_length(); - - if (axes_shape.rank().is_dynamic() || !is_type(input_value(1).get_node())) - { - for (size_t i = 0; i < input_rank - 1; ++i) - { - output_shape[i] = Dimension::dynamic(); - } - set_output_type(0, get_input_element_type(0), output_shape); - return; - } - - if (input_values().size() == 2) - { - set_output_type(0, get_input_element_type(0), output_shape); - return; - } - - const auto& signal_size_shape = PartialShape(get_input_partial_shape(2)); - if (signal_size_shape.rank().is_dynamic()) - { - set_output_type(0, get_input_element_type(0), output_shape); - return; - } - - const auto& const_axes = get_constant_from_source(input_value(1)); - auto axes = const_axes->cast_vector(); - // DFT operation supports for negative axes to transform. More precisely, according to - // the DFT operation specification, axes should be integers from -(r - 1) to (r - 2) - // inclusively, where r = rank(data). A negative axis 'a' is interpreted as an axis - //'r - 1 + a'. The reason is the following. - for (int64_t& axis : axes) - { - if (axis < 0) - { - axis += input_rank - 1; - } - } - - if (!is_type(input_value(2).get_node())) - { - for (int64_t axis : axes) - { - output_shape[axis] = Dimension::dynamic(); - } - set_output_type(0, get_input_element_type(0), output_shape); - return; - } - - const auto& const_signal_size = get_constant_from_source(input_value(2)); - const auto signal_size = const_signal_size->cast_vector(); - - size_t num_of_axes = axes.size(); - for (size_t i = 0; i < num_of_axes; ++i) - { - if (signal_size[i] == -1) - { - continue; - } - output_shape[axes[i]] = Dimension(signal_size[i]); - } - - set_output_type(0, get_input_element_type(0), output_shape); -} diff --git a/ngraph/core/src/op/idft.cpp b/ngraph/core/src/op/idft.cpp index 1c310611f838e1..2da82645b900de 100644 --- a/ngraph/core/src/op/idft.cpp +++ b/ngraph/core/src/op/idft.cpp @@ -17,10 +17,10 @@ using namespace ngraph; -NGRAPH_RTTI_DEFINITION(op::v7::IDFT, "IDFT", 7); +NGRAPH_RTTI_DEFINITION(op::v7::IDFT, "IDFT", 7, util::FFTBase); op::v7::IDFT::IDFT(const Output& data, const Output& axes) - : Op({data, axes}) + : FFTBase(data, axes) { constructor_validate_and_infer_types(); } @@ -28,7 +28,7 @@ op::v7::IDFT::IDFT(const Output& data, const Output& axes) op::v7::IDFT::IDFT(const Output& data, const Output& axes, const Output& signal_size) - : Op({data, axes, signal_size}) + : FFTBase(data, axes, signal_size) { constructor_validate_and_infer_types(); } @@ -53,202 +53,3 @@ std::shared_ptr op::v7::IDFT::clone_with_new_inputs(const OutputVector& ne return std::make_shared(new_args.at(0), new_args.at(1), new_args.at(2)); } - -void op::v7::IDFT::validate() -{ - size_t num_of_inputs = get_input_size(); - - NODE_VALIDATION_CHECK( - this, num_of_inputs == 2 || num_of_inputs == 3, "IDFT must have 2 or 3 inputs."); - - element::Type input_et = get_input_element_type(0); - NODE_VALIDATION_CHECK(this, - input_et == element::f32 || input_et == element::f16 || - input_et == element::bf16, - "IDFT input element type must be f32, f16, or bf16"); - - element::Type axes_et = get_input_element_type(1); - NODE_VALIDATION_CHECK(this, - axes_et == element::i64 || axes_et == element::i32, - "IDFT axes element type must be i32 or i64"); - - const auto& input_shape = PartialShape(get_input_partial_shape(0)); - if (input_shape.rank().is_static()) - { - const auto input_rank = input_shape.rank().get_length(); - NODE_VALIDATION_CHECK(this, - input_rank >= 2, - "The input rank must be greater or equal to 2. Got input rank: ", - input_rank); - - auto last_dim_with_two = input_shape[input_rank - 1] & Dimension(2); - NODE_VALIDATION_CHECK(this, - !last_dim_with_two.get_interval().empty(), - "The last dimension of input data must be 2. Got: ", - input_shape[input_rank - 1]); - } - - const auto& axes_shape = PartialShape(get_input_partial_shape(1)); - if (axes_shape.rank().is_static()) - { - NODE_VALIDATION_CHECK(this, - axes_shape.rank().get_length() == 1, - "IDFT axes input must be 1D tensor. Got axes input rank: ", - axes_shape.rank().get_length()); - } - - if (input_shape.rank().is_static() && axes_shape.is_static()) - { - const auto input_rank = input_shape.rank().get_length(); - NODE_VALIDATION_CHECK(this, - input_rank >= axes_shape.to_shape()[0] + 1, - "The input rank must be greater than number of IDFT axes. Got " - "input rank: ", - input_rank, - ", number of axes: ", - axes_shape.to_shape()[0]); - } - - if (input_shape.rank().is_static() && is_type(input_value(1).get_node())) - { - const auto input_rank = input_shape.rank().get_length(); - const auto& const_axes = get_constant_from_source(input_value(1)); - auto axes = const_axes->cast_vector(); - - // IDFT operation supports for negative axes to transform. More precisely, according to - // the IDFT operation specification, axes should be integers from -(r - 1) to (r - 2) - // inclusively, where r = rank(data). A negative axis 'a' is interpreted as an axis - //'r - 1 + a'. The reason is the following. - for (int64_t& axis : axes) - { - if (axis < 0) - { - axis += input_rank - 1; - } - } - - AxisVector axes_vector; - AxisSet axes_set; - for (const int64_t axis : axes) - { - axes_vector.push_back(static_cast(axis)); - axes_set.insert(static_cast(axis)); - } - - NODE_VALIDATION_CHECK( - this, axes.size() == axes_set.size(), "IDFT axes must be unique. Got: ", axes_vector); - - NODE_VALIDATION_CHECK(this, - std::find(axes.begin(), axes.end(), input_rank - 1) == axes.end(), - "IDFT axes cannot contain the last axis. Got axes: ", - axes_vector); - } - - if (num_of_inputs == 3) - { - element::Type signal_size_et = get_input_element_type(2); - NODE_VALIDATION_CHECK(this, - signal_size_et == element::i64 || signal_size_et == element::i32, - "IDFT signal_size element type must be i32 or i64"); - - const auto& signal_size_shape = PartialShape(get_input_partial_shape(2)); - if (signal_size_shape.rank().is_static()) - { - NODE_VALIDATION_CHECK(this, - signal_size_shape.rank().get_length() == 1, - "IDFT Signal size input must be 1D tensor. Got signal size " - "input rank: ", - signal_size_shape.rank().get_length()); - } - - if (axes_shape.is_static() && signal_size_shape.is_static()) - { - NODE_VALIDATION_CHECK(this, - axes_shape.to_shape()[0] == signal_size_shape.to_shape()[0], - "Sizes of inputs 'axes' and 'signal_size' must be equal. Got " - "size of 'axes': ", - axes_shape.to_shape()[0], - "size of 'signal_size': ", - signal_size_shape.to_shape()[0]); - } - } -} - -void op::v7::IDFT::validate_and_infer_types() -{ - NGRAPH_OP_SCOPE(v7_IDFT_validate_and_infer_types); - validate(); - - const auto& input_shape = PartialShape(get_input_partial_shape(0)); - const auto& axes_shape = PartialShape(get_input_partial_shape(1)); - PartialShape output_shape = input_shape; - if (input_shape.rank().is_dynamic()) - { - set_output_type(0, get_input_element_type(0), output_shape); - return; - } - - const auto input_rank = input_shape.rank().get_length(); - - if (axes_shape.rank().is_dynamic() || !is_type(input_value(1).get_node())) - { - for (size_t i = 0; i < input_rank - 1; ++i) - { - output_shape[i] = Dimension::dynamic(); - } - set_output_type(0, get_input_element_type(0), output_shape); - return; - } - - if (input_values().size() == 2) - { - set_output_type(0, get_input_element_type(0), output_shape); - return; - } - - const auto& signal_size_shape = PartialShape(get_input_partial_shape(2)); - if (signal_size_shape.rank().is_dynamic()) - { - set_output_type(0, get_input_element_type(0), output_shape); - return; - } - - const auto& const_axes = get_constant_from_source(input_value(1)); - auto axes = const_axes->cast_vector(); - // IDFT operation supports for negative axes to transform. More precisely, according to - // the IDFT operation specification, axes should be integers from -(r - 1) to (r - 2) - // inclusively, where r = rank(data). A negative axis 'a' is interpreted as an axis - //'r - 1 + a'. The reason is the following. - for (int64_t& axis : axes) - { - if (axis < 0) - { - axis += input_rank - 1; - } - } - - if (!is_type(input_value(2).get_node())) - { - for (int64_t axis : axes) - { - output_shape[axis] = Dimension::dynamic(); - } - set_output_type(0, get_input_element_type(0), output_shape); - return; - } - - const auto& const_signal_size = get_constant_from_source(input_value(2)); - const auto signal_size = const_signal_size->cast_vector(); - - size_t num_of_axes = axes.size(); - for (size_t i = 0; i < num_of_axes; ++i) - { - if (signal_size[i] == -1) - { - continue; - } - output_shape[axes[i]] = Dimension(signal_size[i]); - } - - set_output_type(0, get_input_element_type(0), output_shape); -} diff --git a/ngraph/core/src/op/util/fft_base.cpp b/ngraph/core/src/op/util/fft_base.cpp new file mode 100644 index 00000000000000..58b571eb0b9a68 --- /dev/null +++ b/ngraph/core/src/op/util/fft_base.cpp @@ -0,0 +1,234 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "ngraph/op/util/fft_base.hpp" +#include +#include "itt.hpp" +#include "ngraph/attribute_visitor.hpp" + +using namespace std; +using namespace ngraph; + +NGRAPH_RTTI_DEFINITION(op::util::FFTBase, "FFTBase", 0); + +op::util::FFTBase::FFTBase(const Output& data, const Output& axes) + : Op({data, axes}) +{ +} + +op::util::FFTBase::FFTBase(const Output& data, + const Output& axes, + const Output& signal_size) + : Op({data, axes, signal_size}) +{ +} + +bool op::util::FFTBase::visit_attributes(AttributeVisitor& visitor) +{ + NGRAPH_OP_SCOPE(util_FFTBase_visit_attributes); + return true; +} + +void op::util::FFTBase::validate() +{ + size_t num_of_inputs = get_input_size(); + + NODE_VALIDATION_CHECK( + this, num_of_inputs == 2 || num_of_inputs == 3, "FFT op must have 2 or 3 inputs."); + + element::Type input_et = get_input_element_type(0); + NODE_VALIDATION_CHECK(this, + input_et == element::f32 || input_et == element::f16 || + input_et == element::bf16, + "FFT op input element type must be f32, f16, or bf16"); + + element::Type axes_et = get_input_element_type(1); + NODE_VALIDATION_CHECK(this, + axes_et == element::i64 || axes_et == element::i32, + "FFT op axes element type must be i32 or i64"); + + const auto& input_shape = PartialShape(get_input_partial_shape(0)); + if (input_shape.rank().is_static()) + { + const auto input_rank = input_shape.rank().get_length(); + NODE_VALIDATION_CHECK(this, + input_rank >= 2, + "The input rank must be greater or equal to 2. Got input rank: ", + input_rank); + + auto last_dim_with_two = input_shape[input_rank - 1] & Dimension(2); + NODE_VALIDATION_CHECK(this, + !last_dim_with_two.get_interval().empty(), + "The last dimension of input data must be 2. Got: ", + input_shape[input_rank - 1]); + } + + const auto& axes_shape = PartialShape(get_input_partial_shape(1)); + if (axes_shape.rank().is_static()) + { + NODE_VALIDATION_CHECK(this, + axes_shape.rank().get_length() == 1, + "FFT op axes input must be 1D tensor. Got axes input rank: ", + axes_shape.rank().get_length()); + } + + if (input_shape.rank().is_static() && axes_shape.is_static()) + { + const auto input_rank = input_shape.rank().get_length(); + NODE_VALIDATION_CHECK(this, + input_rank >= axes_shape.to_shape()[0] + 1, + "The input rank must be greater than number of FFT op axes. Got " + "input rank: ", + input_rank, + ", number of axes: ", + axes_shape.to_shape()[0]); + } + + if (input_shape.rank().is_static() && is_type(input_value(1).get_node())) + { + const auto input_rank = input_shape.rank().get_length(); + const auto& const_axes = get_constant_from_source(input_value(1)); + auto axes = const_axes->cast_vector(); + + // FFT operation supports for negative axes to transform. More precisely, according to + // the FFT operation specification, axes should be integers from -(r - 1) to (r - 2) + // inclusively, where r = rank(data). A negative axis 'a' is interpreted as an axis + // 'r - 1 + a'. The reason is the following: real input tensor of the shape + // [n_0, ..., n_{r - 1}, 2] is interpreted as a complex tensor with the shape + // [n_0, ..., n_{r - 1}]. + for (int64_t& axis : axes) + { + if (axis < 0) + { + axis += input_rank - 1; + } + } + + AxisVector axes_vector; + AxisSet axes_set; + for (const int64_t axis : axes) + { + axes_vector.push_back(static_cast(axis)); + axes_set.insert(static_cast(axis)); + } + + NODE_VALIDATION_CHECK( + this, axes.size() == axes_set.size(), "FFT op axes must be unique. Got: ", axes_vector); + + NODE_VALIDATION_CHECK(this, + std::find(axes.begin(), axes.end(), input_rank - 1) == axes.end(), + "FFT op axes cannot contain the last axis. Got axes: ", + axes_vector); + } + + if (num_of_inputs == 3) + { + element::Type signal_size_et = get_input_element_type(2); + NODE_VALIDATION_CHECK(this, + signal_size_et == element::i64 || signal_size_et == element::i32, + "FFT op signal_size element type must be i32 or i64"); + + const auto& signal_size_shape = PartialShape(get_input_partial_shape(2)); + if (signal_size_shape.rank().is_static()) + { + NODE_VALIDATION_CHECK(this, + signal_size_shape.rank().get_length() == 1, + "FFT op signal size input must be 1D tensor. Got signal size " + "input rank: ", + signal_size_shape.rank().get_length()); + } + + if (axes_shape.is_static() && signal_size_shape.is_static()) + { + NODE_VALIDATION_CHECK(this, + axes_shape.to_shape()[0] == signal_size_shape.to_shape()[0], + "Sizes of inputs 'axes' and 'signal_size' must be equal. Got " + "size of 'axes': ", + axes_shape.to_shape()[0], + "size of 'signal_size': ", + signal_size_shape.to_shape()[0]); + } + } +} + +void op::util::FFTBase::validate_and_infer_types() +{ + NGRAPH_OP_SCOPE(util_FFTBase_validate_and_infer_types); + validate(); + + const auto& input_shape = PartialShape(get_input_partial_shape(0)); + const auto& axes_shape = PartialShape(get_input_partial_shape(1)); + PartialShape output_shape = input_shape; + if (input_shape.rank().is_dynamic()) + { + set_output_type(0, get_input_element_type(0), output_shape); + return; + } + + const auto input_rank = input_shape.rank().get_length(); + + if (axes_shape.rank().is_dynamic() || !is_type(input_value(1).get_node())) + { + for (size_t i = 0; i < input_rank - 1; ++i) + { + output_shape[i] = Dimension::dynamic(); + } + set_output_type(0, get_input_element_type(0), output_shape); + return; + } + + if (input_values().size() == 2) + { + set_output_type(0, get_input_element_type(0), output_shape); + return; + } + + const auto& signal_size_shape = PartialShape(get_input_partial_shape(2)); + if (signal_size_shape.rank().is_dynamic()) + { + set_output_type(0, get_input_element_type(0), output_shape); + return; + } + + const auto& const_axes = get_constant_from_source(input_value(1)); + auto axes = const_axes->cast_vector(); + // FFT operation supports for negative axes to transform. More precisely, according to + // the FFT operation specification, axes should be integers from -(r - 1) to (r - 2) + // inclusively, where r = rank(data). A negative axis 'a' is interpreted as an axis + // 'r - 1 + a'. The reason is the following: real input tensor of the shape + // [n_0, ..., n_{r - 1}, 2] is interpreted as a complex tensor with the shape + // [n_0, ..., n_{r - 1}]. + for (int64_t& axis : axes) + { + if (axis < 0) + { + axis += input_rank - 1; + } + } + + if (!is_type(input_value(2).get_node())) + { + for (int64_t axis : axes) + { + output_shape[axis] = Dimension::dynamic(); + } + set_output_type(0, get_input_element_type(0), output_shape); + return; + } + + const auto& const_signal_size = get_constant_from_source(input_value(2)); + const auto signal_size = const_signal_size->cast_vector(); + + size_t num_of_axes = axes.size(); + for (size_t i = 0; i < num_of_axes; ++i) + { + if (signal_size[i] == -1) + { + continue; + } + output_shape[axes[i]] = Dimension(signal_size[i]); + } + + set_output_type(0, get_input_element_type(0), output_shape); +} diff --git a/ngraph/test/CMakeLists.txt b/ngraph/test/CMakeLists.txt index 6c270fcce2e507..f1007c04fc93ec 100644 --- a/ngraph/test/CMakeLists.txt +++ b/ngraph/test/CMakeLists.txt @@ -323,6 +323,7 @@ set(MULTI_TEST_SRC backend/ctc_greedy_decoder_seq_len.in.cpp backend/cum_sum.in.cpp backend/detection_output.in.cpp + backend/dft.in.cpp backend/divide.in.cpp backend/dyn_reshape.in.cpp backend/strided_slice.in.cpp @@ -339,6 +340,7 @@ set(MULTI_TEST_SRC backend/group_convolution.in.cpp backend/group_convolution_backprop_data.in.cpp backend/hard_sigmoid.in.cpp + backend/idft.in.cpp backend/interpolate.in.cpp backend/log.in.cpp backend/log_softmax.in.cpp diff --git a/ngraph/test/backend/dft.in.cpp b/ngraph/test/backend/dft.in.cpp new file mode 100644 index 00000000000000..8bc6d6b9ecb3af --- /dev/null +++ b/ngraph/test/backend/dft.in.cpp @@ -0,0 +1,1416 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "gtest/gtest.h" +#include "ngraph/ngraph.hpp" +#include "ngraph/runtime/tensor.hpp" +#include "ngraph/type/bfloat16.hpp" +#include "ngraph/type/float16.hpp" +#include "runtime/backend.hpp" +#include "util/all_close.hpp" +#include "util/all_close_f.hpp" +#include "util/engine/test_engines.hpp" +#include "util/known_element_types.hpp" +#include "util/ndarray.hpp" +#include "util/test_case.hpp" +#include "util/test_control.hpp" +#include "util/test_tools.hpp" + +using namespace std; +using namespace ngraph; + +static string s_manifest = "${MANIFEST}"; + +using TestEngine = test::ENGINE_CLASS_NAME(${BACKEND_NAME}); + +static std::vector from_float_vector(const std::vector& v_f32) +{ + if (v_f32.empty()) + { + return std::vector(); + } + + size_t num_of_elems = v_f32.size(); + std::vector v_f16(num_of_elems); + for (size_t i = 0; i < num_of_elems; ++i) + { + v_f16[i] = float16(v_f32[i]); + } + return v_f16; +} + +static std::vector to_float_vector(const std::vector& v_f16) +{ + if (v_f16.empty()) + { + return std::vector(); + } + + size_t num_of_elems = v_f16.size(); + std::vector v_f32(num_of_elems); + for (size_t i = 0; i < num_of_elems; ++i) + { + v_f32[i] = float(v_f16[i]); + } + return v_f32; +} + +static const std::vector input_data = { + 0.85943836, 0.009941814, 0.004292889, 0.54598427, 0.8270831, 0.49770153, 0.9035636, + 0.19274887, 0.8589833, 0.88759327, 0.72343576, 0.057539318, 0.915801, 0.63455844, + 0.25069925, 0.045601673, 0.29793364, 0.8492151, 0.6885839, 0.57419384, 0.009737609, + 0.68192583, 0.7614807, 0.37603703, 0.51804876, 0.033039097, 0.63702065, 0.78960556, + 0.5007368, 0.7248742, 0.2040932, 0.1211606, 0.76035476, 0.44004318, 0.95635134, + 0.82913375, 0.225465, 0.009166263, 0.05445403, 0.5885675, 0.87822133, 0.14324947, + 0.68606305, 0.3274419, 0.9169595, 0.732179, 0.04614906, 0.03505424, 0.84526163, + 0.9972937, 0.89781004, 0.9987864, 0.24641308, 0.34678686, 0.22731997, 0.95805293, + 0.595993, 0.8537836, 0.9174756, 0.17441267, 0.86681056, 0.15913424, 0.6638066, + 0.522398, 0.51548326, 0.024979044, 0.1731268, 0.068090245, 0.6125645, 0.4865482, + 0.2873719, 0.35936728, 0.64452374, 0.27963468, 0.59981745, 0.6309508, 0.507604, + 0.23389837, 0.77500635, 0.4462004, 0.53165394, 0.6535075, 0.4306448, 0.21468966, + 0.6925882, 0.11183031, 0.25347117, 0.2209481, 0.8060583, 0.34712377, 0.78980505, + 0.16110454, 0.6376819, 0.78736854, 0.909368, 0.6915289, 0.24747796, 0.32442623, + 0.22714981, 0.23976989, 0.25199527, 0.28412706, 0.32461873, 0.51917267, 0.8394496, + 0.6324911, 0.28498915, 0.8887276, 0.90213394, 0.16050571, 0.32190812, 0.67677563, + 0.8594967, 0.28917953, 0.1931407, 0.8282108, 0.14881423, 0.18073067, 0.8490643, + 0.2356146, 0.86200285, 0.57409924, 0.94718546, 0.092213534, 0.34502912, 0.4719212, + 0.60031396, 0.22602181, 0.3067876, 0.49529344, 0.11133887, 0.47633907, 0.13236542, + 0.69677263, 0.8490109, 0.6685073, 0.24199674, 0.7983137, 0.37593383, 0.74520975, + 0.16743147, 0.84144354, 0.93073046, 0.55940866, 0.67484015, 0.077098235, 0.69045097, + 0.06949082, 0.6804774, 0.79804176, 0.49027568, 0.8843709, 0.5665486, 0.91798306, + 0.47884017, 0.94707423, 0.98279756, 0.62054926, 0.8134105, 0.01336217, 0.78324115, + 0.9938295, 0.99227554, 0.66681916, 0.38842493, 0.3835454, 0.120395586, 0.5478275, + 0.13309076, 0.9468553, 0.24595714, 0.0057277656, 0.14570542, 0.31220108, 0.41687667, + 0.679465, 0.5731583, 0.7383743, 0.013198466, 0.34619793, 0.9278514, 0.48510832, + 0.46039802, 0.8171329, 0.5041023, 0.37600085, 0.124404594, 0.4201713, 0.7470036, + 0.7340853, 0.8449047, 0.137517, 0.14771219, 0.99655616, 0.2178388, 0.4121613, + 0.8655656, 0.32849622, 0.7574791, 0.95230037, 0.5806251, 0.9598742, 0.7183528, + 0.042957753, 0.2926446, 0.5882527, 0.05208914, 0.3216481, 0.5205192, 0.5095992, + 0.011508227, 0.5209922, 0.78207654, 0.34570032, 0.7968098, 0.4619513, 0.0047925604, + 0.029039407, 0.7673424, 0.571703, 0.44400942, 0.82529145, 0.29335254, 0.34418115, + 0.48119327, 0.38321403, 0.31083322, 0.7179562, 0.41055596, 0.06207573, 0.8747831, + 0.6018095, 0.4483476, 0.16189687, 0.8611539, 0.79723805, 0.42178747, 0.95597315, + 0.5534858, 0.33466807, 0.36827618, 0.60728735, 0.6582703, 0.6790265, 0.870856, + 0.8868432, 0.43860948, 0.32468447, 0.77624434, 0.3403061, 0.14144918, 0.23022941, + 0.07176102, 0.06941459, 0.37346482, 0.9120822, 0.65890974, 0.77746564, 0.4515671, + 0.45455948, 0.15909587, 0.8017096, 0.6259673, 0.6117355, 0.77020043, 0.08495594, + 0.30376136, 0.55266386, 0.8497134, 0.91790336, 0.86088765, 0.88179666, 0.9009849, + 0.97200614, 0.94119, 0.77911216, 0.8057816, 0.14040896, 0.66522235, 0.6649202, + 0.048396785, 0.75035393, 0.4520953, 0.9877601, 0.46115568, 0.2167145, 0.9271302, + 0.39395386, 0.68578094, 0.576275, 0.20754486, 0.5408786, 0.46040633, 0.18199016, + 0.66303253, 0.6288556, 0.14313427, 0.91675115, 0.36198065, 0.51337945, 0.84241706, + 0.22333568, 0.38011634, 0.024615016, 0.19370414, 0.23593484, 0.32207185, 0.47971123, + 0.6202779, 0.6944977, 0.43612957, 0.07961436, 0.57468814, 0.100025274, 0.42476946, + 0.95338464, 0.666547, 0.8683905, 0.52689695, 0.6284723, 0.85813546, 0.4865953, + 0.8269112, 0.08833949, 0.69269264, 0.41784903, 0.5969149, 0.07599888, 0.14184453, + 0.49042618, 0.44027725, 0.6256328, 0.2716237, 0.0999099, 0.09831784, 0.92469853, + 0.24196884, 0.9073526, 0.7523511, 0.7761173, 0.28489882, 0.96349007, 0.5884645, + 0.74933976, 0.06400105, 0.4376275, 0.34752035, 0.6006149, 0.034923803, 0.066874385, + 0.9790322, 0.5558188, 0.97579825, 0.025802653, 0.537738, 0.24921915, 0.111012295, + 0.85987717, 0.781183, 0.69588315, 0.94621634, 0.74946797, 0.6949375, 0.009165181, + 0.91075164, 0.72913235, 0.25934777, 0.19463088, 0.5283304, 0.9241759, 0.0563183, + 0.74323857, 0.43722472, 0.2958358, 0.85980684, 0.029655656, 0.362904, 0.19682994, + 0.37778872, 0.09406928, 0.23010127, 0.44393733, 0.420214, 0.39723217, 0.13777487, + 0.06385251, 0.9535715, 0.89861375, 0.2463547, 0.673834, 0.8008994, 0.0861585, + 0.6613363, 0.79498637, 0.79322547, 0.083214305, 0.577025, 0.58655965, 0.119723536, + 0.0012204717}; + +static const std::vector expected_dft1d_results = { + 6.329814, 4.2950764, -0.8105316, -0.7187835, -0.059136264, 0.2709784, + 0.82793635, 0.57937646, 0.5997731, -1.3291739, 1.188664, 1.462941, + -0.01811248, -1.8314927, 0.16004556, -2.219835, 1.0620322, -1.0679832, + -0.68610185, 0.658314, 4.627743, 4.5935497, -0.78950775, -0.32600924, + -1.4706655, -1.1615934, 0.708719, 1.4568751, -1.0970218, -0.39268675, + -0.5990571, -0.81545514, -0.39174145, -0.420258, 0.55279106, 2.339339, + -0.59915966, 1.3964193, -0.8447231, 0.14907542, 6.2576666, 5.5670385, + 0.25636938, -1.7026355, 1.161571, 0.12042561, 0.19768336, -1.3421875, + -0.90698814, 1.4111948, 0.70803046, 0.5795436, 1.2021728, -0.5199567, + -2.558736, -0.80762154, 1.1657354, -0.8685272, 1.2987087, -1.0047817, + 5.6461143, 3.2111988, 0.2361581, 0.3099669, 0.6179653, 0.099535145, + 1.0438079, -0.016701937, -0.88529384, -0.12907594, 0.64785606, -0.8428119, + -0.058392793, -1.0488291, -0.4019828, 0.20333555, 0.45051938, 0.45967662, + 1.3713523, -0.6549525, 5.5258985, 3.7522945, -1.8860855, -0.2230255, + 0.8160669, -0.46607828, 0.123957604, 0.61024696, 0.26978388, 0.9723815, + 0.3050212, 0.69621503, 0.27244493, -1.0805726, 0.20593566, 1.5653824, + -0.27690098, 0.8950307, -0.039584313, -0.18680441, 4.975611, 4.6955333, + 0.19031112, -0.8860659, 0.91665065, -0.5264673, -0.4547393, 1.1623507, + -1.4774656, 1.671129, 1.028168, -1.6014669, -1.2178835, -0.13447604, + -0.14712845, -0.6739672, -0.3273949, -0.9012072, -0.9661755, 0.03590688, + 4.771964, 5.244689, -0.03415192, -0.37281254, -0.49070793, -0.65789306, + 0.8143984, -0.8913989, -0.19890547, 0.17876014, -0.9956009, 0.82810897, + 0.55270624, -0.023768127, 1.5358362, 0.6981953, 0.23165298, 0.51040155, + 2.4328363, 0.2267083, 6.4758024, 5.72882, -0.8707881, -1.110683, + 0.12478554, 1.3484334, 0.3689712, 0.29180524, -0.8149491, -0.0922713, + -0.33161288, 0.78140867, -0.9623072, 0.8999919, -2.1120539, 0.84492886, + -1.5347936, 0.7440938, 1.3312622, -1.0220959, 3.8123238, 5.62084, + 1.3551373, 0.6460793, -0.21639234, -1.2077228, 1.1639122, -0.05263084, + 0.48105645, -0.5892652, 0.2349168, 1.128768, 0.42568994, 0.36398163, + -1.2250046, 2.3513904, 0.64331245, 0.8099514, 1.1574583, 0.8668997, + 5.59726, 5.659527, 0.48095328, 0.59446967, 1.1849049, 1.4709316, + -1.2589264, -0.11577609, 0.6299068, -1.4621243, 0.7872094, 0.18096408, + 0.5553762, -2.0060503, -0.4373122, 0.9938256, 0.89633095, -0.5491595, + 0.8428093, 0.084472984, 4.52676, 4.351716, 0.73079205, 0.8098516, + 0.27877963, -0.0073297992, 0.36545974, 0.6745955, -2.3818088, 1.5816333, + -0.16544427, 0.51321346, -0.23699868, -0.13254744, 1.551896, 0.62098134, + 0.7739359, 1.6108581, 0.36288044, -0.42423314, 5.0995026, 5.1843014, + -1.1968713, 1.1790991, -0.018864498, -0.7500831, 0.0879575, 0.22010106, + 1.1136081, 2.2893274, -0.6877146, -0.40740123, 0.046427906, 0.8681825, + -0.50678635, 0.23051873, 0.35328788, -0.45622703, 0.1495475, -0.104907334, + 4.8094087, 5.2818966, 0.49697292, 0.29568392, -0.4144543, -0.64546454, + 0.31737912, -0.8962374, -1.0404948, 0.91764164, 0.6826862, 0.08073502, + 0.33942595, 0.053232975, -1.1867946, 0.51120156, -1.1452568, -1.4197243, + 0.82389224, 1.8939058, 6.882805, 6.4072084, -1.3024135, -0.22483894, + -0.22082287, 1.0370905, -0.7639439, 0.6950346, -0.731326, 0.16821115, + 0.0887468, -0.5732441, -0.40715322, -0.96244293, -0.89126545, 1.3140129, + -0.42358512, 1.7674587, -0.6400819, -1.6113993, 4.4106574, 5.706909, + -1.1110737, 0.10560027, -1.1108764, 0.34190884, 2.1167603, -0.067495525, + -0.16237324, 0.2604496, -0.8129095, -0.42274237, -1.1412699, -0.0011268258, + -0.63462454, -0.15172139, -0.7164279, 0.14801888, -0.3538928, 1.583736, + 4.9876184, 4.2879796, -0.8491325, 0.5345522, -0.60507995, -0.9020085, + 1.0447598, 0.21135187, -0.4787205, -0.3230412, 0.8076494, -0.04361339, + 0.62797767, 0.15487206, -0.23772183, 0.69546384, 1.8609382, -1.7030516, + 1.2658813, -0.6791475, 4.921037, 4.8929176, -0.0124401, -0.6873918, + -0.21879943, -0.48610657, 0.36776963, 0.12423802, -0.7854952, 0.48838156, + -0.5085067, -0.08865434, 1.1653454, 0.81965554, -0.6399579, -1.0967884, + 1.4099771, -0.15370974, 2.8824244, 1.0534087, 4.7045717, 5.2045445, + -0.6350576, 2.5321684, 0.6987691, -0.53839976, -0.09889791, 0.5662097, + 0.4088725, 0.635128, -1.763303, -0.49720347, -1.0772469, 1.2422445, + -0.3619956, -1.311133, 1.5846866, 1.0530244, -0.61141044, 0.74831486, + 5.433625, 3.9661994, 2.006918, -0.8703619, -0.7658511, 0.0811044, + 0.83877516, -0.63553256, -0.67563355, 1.7368636, 0.9372277, 1.8246815, + 0.8615329, -0.18161502, 0.62479717, 0.2028623, 0.159001, 1.860977, + 0.04177074, -0.49050322, 4.9402246, 4.0296063, -0.74729615, -0.27802998, + -0.8077982, -0.5414143, 0.467114, 0.9016136, 2.1971147, -1.466963, + -1.2350414, 1.0967304, -0.95607626, 0.51462483, 0.28838068, 1.0117096, + -0.21846394, 0.114624545, -1.627146, -0.9431294}; + +static const std::vector expected_dft2d_results = { + 54.020195, 48.368538, -1.8721353, -3.7894967, 2.5850394, -0.7094516, + 3.5357249, 1.6819549, -3.4001002, 0.23887074, 2.9735894, 2.3982158, + 0.3599546, -5.801426, -4.427606, 5.2949734, 1.7113355, 1.428697, + 5.8978443, -0.8472582, -3.288164, -0.099487126, -0.33851182, 2.614974, + -2.766882, 0.18681616, 0.34976268, -0.2601711, 4.998401, -2.9831958, + -1.6652081, 0.53361464, -0.9001389, -3.6454318, -3.7148805, -0.68562484, + 2.0633714, -2.2154818, -3.3697965, 3.5273929, 1.5474558, -1.6305131, + -5.3327236, 0.54002213, -1.6671672, 2.4493377, -2.2604918, 1.4117424, + 2.1797671, 2.5013056, 0.8525213, 1.6570821, 1.717532, -2.101283, + 4.6570606, -3.6786642, 0.8912736, -0.4010569, -5.9480867, 1.441097, + 2.1150498, -1.4524796, -3.5035098, 3.0815587, -3.3185432, 4.7882123, + 5.64722, -1.1192517, 1.8302126, -2.5760055, -0.41363025, 3.2350469, + 1.4296081, 0.8722873, 6.1752787, -1.7328868, 2.312786, 4.4069357, + 1.7721124, 3.3802934, -0.53283703, 3.7646027, 4.440572, -4.353462, + -2.7639425, 3.6855025, 1.8912748, -2.5849285, -2.9895856, 1.1341677, + 1.4818796, 0.7482485, -1.3077981, 1.0669674, -0.76039124, -10.8791685, + 2.998129, -4.2489543, 0.41752052, -0.45298803, -0.62486386, 0.5913104, + -0.36638862, -0.9528576, -0.16223967, -3.171127, 2.7200532, -3.8751457, + 3.8895426, 1.0489256, -0.091531515, 6.992935, 4.5098467, -0.38218838, + 0.6637606, -2.1199496, 3.9403267, -0.870952, 2.4287906, 1.9679271, + 3.652341, -4.4909067, -1.4710087, 0.5256169, 5.4580984, -2.6554706, + -0.058261395, 3.6613276, 0.5612789, 1.0594783, 4.5429516, -1.447232, + -2.388829, 0.52541757, -6.1111097, -2.3621864, -1.4885365, -2.6265867, + -4.4030347, 0.27728367, 3.9584684, -3.7618577, -3.128574, -2.8671994, + 1.4171265, 0.02298975, -2.0790722, 1.6526843, 0.59488124, -3.2548752, + -0.82249254, 1.3645289, -2.9066925, -3.4377484, -2.501403, -2.821631, + -4.427053, -2.3529994, 0.6670886, -4.7455816, -2.160026, -1.0587022, + 1.1341916, -0.9469211, 0.67554307, -4.0473633, -1.2422556, 4.538533, + -0.739814, -3.22405, 1.2332113, -4.0489397, -4.560828, -3.5195189, + 6.7066355, -2.8439593, -0.43901098, -3.9980454, -4.2256207, 3.0529652, + 4.6105156, 2.720234, 2.3327744, -1.0400636, -0.048398018, 2.1603358, + -0.22459112, 0.6870126, -0.926849, -7.2363615, 3.7953386, 3.195907, + 3.8662248, -1.8919971, 0.91311014, -0.36923724, 3.0576966, 0.19861764, + -0.09782998, -1.0179963, 50.71621, 49.313248, -2.6195984, 3.396334, + -3.1849973, -2.4107025, 4.7431326, 1.7938776, -2.5362587, 6.287631, + -2.656609, 1.4825039, -0.77803206, 2.3750808, -1.9940716, 2.0271082, + 3.6380908, 2.822246, 2.2938647, 1.0260472, 3.248794, -3.05949, + 2.0979533, 3.565119, 1.9497933, 0.2390036, -2.255065, 0.7849397, + 1.9622431, 4.2382064, -3.2529292, 0.78572094, -2.9386084, 0.66875017, + 5.743927, 4.850876, -4.8014383, 6.371132, -2.6618924, -1.8847032, + -1.7702236, -1.1031301, 1.4129921, -0.080709964, -2.7634878, -3.6456683, + 1.4174454, 3.4085226, 3.10102, 0.114031196, -2.4092412, 0.27725983, + 2.8974152, -1.866328, -0.68216217, 2.249536, -0.42875588, -5.8182187, + 5.347006, -6.2936745, 0.8000201, 3.651592, 1.3155181, 2.3413098, + 2.1600244, 1.8733575, -2.4694557, 0.39358342, 2.020084, -0.062472403, + -4.131041, -1.5137839, -2.0354557, 1.1957052, -0.6644075, -2.0442688, + 2.0753646, 4.874056, -0.090800405, 1.3911223, 0.68129027, -4.0028048, + -0.8021738, 0.43866205, 2.7812133, 0.4525791, -0.87565154, 1.2364697, + -2.725146, 2.7965212, 4.148448, -1.9204504, -0.61004305, -4.790703, + 3.1498234, 0.79403657, 5.305445, 0.2803253, -3.67164, -4.3974924, + -2.5132315, -0.9139994, 6.841936, -4.089568, -1.2774054, 0.9789283, + 3.269153, -3.3947415, -7.5553513, 3.682307, 2.9227152, 2.3319635, + 2.754105, -1.2598821, 1.4247041, -1.8540356, -2.675635, 1.2705915, + 5.2202816, 6.206577, 0.4957786, 2.1150033, 5.8791704, 2.8043785, + -0.37886655, 0.011162788, -1.0408137, -1.5385519, -8.079001, -0.68451786, + 2.3513699, 3.0877895, 2.6497078, 1.3670976, 0.77233493, 2.2921152, + -1.2679763, 2.113087, 4.990262, -0.046566606, 0.015865922, 1.1569002, + -4.8347507, 1.9560149, 1.979923, 2.34512, -0.9634773, 4.3939066, + -6.2031984, 0.8311275, -2.7740612, -2.9296994, -3.4624243, -1.4588313, + 2.4724, -0.79477566, -0.4295609, 5.8110385, -2.6649034, -2.270977, + -2.5511568, -3.1238616, -4.46209, 0.16335368, 1.9146351, 1.0459399, + 2.8069792, -0.4705832, -4.0632596, -2.220704, 1.7770543, -0.5791014, + -2.2041528, 3.026476, 5.324942, -0.7805673, 5.9275556, 0.14159381, + -0.81569004, 4.1947803, -3.8557377, -0.5163199, 2.478963, -2.396379, + -0.3930376, -0.96302, -0.9776549, 0.13852966, 0.26078847, 0.8342015, + 2.3698487, 4.109933, 1.3575013, -0.5828376, -0.028537825, -0.53020877, + 0.39626116, -1.7572733, -4.31769, -2.1674476}; + +static const std::vector expected_dft3d_results = { + 104.7364, 97.68179, -4.491728, -0.39316452, -0.59995466, -3.1201572, 8.278858, + 3.4758341, -5.9363585, 6.5265055, 0.3169801, 3.8807175, -0.418082, -3.4263492, + -6.4216776, 7.3220854, 5.3494234, 4.2509427, 8.191702, 0.17879319, -0.03937006, + -3.1589758, 1.7594413, 6.180092, -0.8170867, 0.42582142, -1.9053001, 0.52476853, + 6.9606423, 1.255014, -4.9181366, 1.319335, -3.838747, -2.9766817, 2.0290484, + 4.16525, -2.7380676, 4.155652, -6.0316873, 1.6426877, -0.2227689, -2.7336447, + -3.919732, 0.45931256, -4.4306555, -1.1963288, -0.8430467, 4.8202653, 5.280785, + 2.6153364, -1.556721, 1.9343407, 4.614946, -3.96761, 3.9748988, -1.4291265, + 0.46251905, -6.2192726, -0.60107887, -4.852579, 2.9150705, 2.1991146, -2.1879911, + 5.4228687, -1.158518, 6.661569, 3.1777658, -0.7256692, 3.8502965, -2.6384768, + -4.544671, 1.721262, -0.6058461, 2.067991, 5.5108714, -3.7771575, 4.388153, + 9.280992, 1.681312, 4.7714148, 0.14845347, -0.23820269, 3.6383984, -3.9147997, + 0.017270446, 4.138083, 1.0156215, -1.3484575, -5.7147317, 3.9306912, 5.630328, + -1.1722009, -1.9178381, -3.7237349, 2.3894331, -10.085134, 8.303572, -3.9686286, + -3.2541199, -4.850478, -3.1380959, -0.32268947, 6.475547, -5.0424256, -1.4396465, + -2.1921992, 5.9892044, -7.269888, -3.665809, 4.7312326, 2.8311844, 9.324896, + 7.2639513, -1.6420703, 2.0884657, -3.9739842, 1.2646922, 0.39964193, 7.649071, + 8.174507, 4.148118, -2.3759027, 4.4081597, 3.3299959, 5.0792284, -2.6443086, + -1.0990746, 2.1227744, -7.517721, 0.3749615, 6.894322, 1.6405574, 0.26087707, + 1.8925169, -5.3387756, -0.07007182, -2.7565134, -0.51350284, 0.5872268, 0.23071745, + 3.9743357, -2.6049578, -7.963324, -0.9111862, 3.3970497, 2.368112, -3.0425484, + 6.0465913, -5.608317, -2.4237492, -3.5965526, -1.5651696, -6.369116, -4.896579, + -0.029001951, -3.616405, -4.8566127, 3.4580388, -1.9978137, -7.016559, -4.71118, + -4.1825647, -3.3278992, -0.7835678, 2.5901778, -3.0014238, 1.5647203, 4.06795, + -4.803074, -5.444754, 3.0102665, -4.6280394, -6.764982, -0.49304247, 12.031577, + -3.6245267, 5.488541, -3.8564541, -5.04131, 7.2477474, 0.7547778, 2.2039144, + 4.8117356, -3.4364424, -0.44143593, 1.1973162, -1.2022457, 0.8255428, -0.66605973, + -6.4021583, 6.1651874, 7.3058405, 5.2237253, -2.4748354, 0.88457155, -0.89944726, + 3.453958, -1.558656, -4.4155188, -3.1854444, 3.303988, -0.9447114, 0.7474582, + -7.185831, 5.770039, 1.7012511, -1.2074116, -0.11192033, -0.86384296, -6.048759, + 5.6302013, 0.9157127, 1.1379871, -8.176507, -2.433535, 3.2678652, -1.9267552, + -1.393548, 3.6039736, -1.873306, -6.536957, 2.9600024, -2.4364662, -0.95014465, + -4.716674, -0.052186966, 2.6048284, -1.0451086, 3.036159, -7.221403, 1.5877211, + -0.25210607, 2.0384693, -4.3141813, -9.458808, -5.5365014, 6.8648105, -8.586614, + -0.7079052, 5.412094, 3.3176801, -0.5273831, -6.745717, 0.62073076, 1.0963198, + 6.0950055, -3.677938, -1.9967818, -0.921252, 2.387275, 3.261763, 1.3798212, + -1.1798835, -0.23495495, 5.339221, -5.928199, 1.3200281, 5.417163, -11.295093, + 7.7347717, 1.3150296, -5.1040716, -4.8190293, 0.74024755, -5.4785676, 2.914854, + 8.116676, -1.5128357, -0.1898706, -2.5135324, 3.7174103, 4.7488313, 3.4650638, + -0.32341766, 6.8396864, 0.31138325, 0.2374219, -0.46712062, 1.8629129, 1.9891711, + -1.2141278, 7.7674093, 5.2427464, -4.792124, -5.5451555, 3.2329237, 2.766926, + -3.8213987, -0.26443875, -1.6623533, -2.6665692, 2.6686997, -0.6977545, 5.85767, + -3.9102163, -11.673204, -2.3073153, -4.529278, 4.0891604, 3.9445055, 1.8883687, + 1.50531, -7.2083244, 3.1367111, 1.1151649, -4.1500554, -0.54910004, -0.48040384, + 11.444895, -2.6333811, -3.0142484, 4.6609726, 1.755743, 0.87769306, -0.7609439, + -0.26591438, 6.615961, -2.141545, -2.7914915, -4.2386503, 3.1565619, -6.6059103, + -7.35018, -2.2787585, 5.836963, -2.6666338, 0.98255026, 5.199881, 8.640279, + 1.7439961, 2.191582, -4.535021, -5.038538, -0.841679, -6.8834453, -4.654301, + -0.220559, -4.7396717, -9.393296, 0.32385087, 3.9426038, -4.9187584, 1.7061774, + -4.8232145, -0.5627973, -2.3221302, -1.1155958, -2.7412212, 6.798079, -4.0860014, + 1.9515686, 4.2942266, 0.5557329, -1.9789174, -4.973804, -2.0268555, -3.9974911, + -8.164038, 3.3319929, -2.474605, 0.39113098, 2.0651584, 5.5962815, -1.1102749, + -1.2390921, -5.0933027, -4.0492353, 5.009116, 3.323446, -1.0033474, -0.54384375, + -3.4698372, -2.3566747, -6.545992, 1.3816929, -2.0633929, -6.3665648, -4.13964, + -3.4099324, -1.1418146, 8.466255, 3.2365537, -0.14618888, 1.3563147, 0.3446387, + 3.1233552, 0.7530624, 0.548483, -1.1876376, -8.070564, 1.4254899, -0.9140264, + 2.5087235, -1.3091599, 0.9416502, 0.16097029, 2.6614356, 1.9558911, 4.219861, + 1.1494511}; + +static const std::vector expected_dft1d_signal_size_results = { + 6.138384, 4.8263664, 6.2014966, 4.641298, 6.2220087, 3.340786, 3.8338857, + 3.458686, 6.393098, 6.578215, 4.9169006, 3.8786886, 5.0566025, 5.701084, + 5.099263, 6.690686, 4.686806, 4.9369535, 5.471756, 4.315829, 3.6622288, + -4.547995, 2.3657713, -4.4210963, 3.3341353, -3.560755, 3.0613456, -2.0019536, + 4.9098253, -3.27648, 3.6913419, -2.365142, 5.2827687, -3.2966752, 5.633893, + -2.990755, 2.4099903, -2.5792742, 3.009334, -3.318112, -0.8632047, -0.302661, + -0.9658433, 1.3884914, -0.12056512, -0.5264965, 0.053616166, 0.5239285, -0.37204745, + 0.6682581, 0.88452375, -1.4486976, -0.9331777, -0.6865864, -0.32639223, -1.2646291, + -0.187691, 1.0645473, -0.45738214, 0.48435384, 1.2216191, -0.61395854, 2.4932637, + -1.6152657, 0.99030006, -0.45764852, 2.4245698, 0.31936115, 2.9254415, 0.4994774, + 0.2869299, -0.82977176, 1.759331, 0.66088116, 2.0010936, -0.18261093, 1.5729225, + -0.6416664, 1.2219726, -0.4185537, -0.33628678, 0.21890742, -2.2292616, -0.9053817, + 0.53581333, 0.36471185, 0.90989465, -0.067255855, 0.9978778, -0.6023144, 1.2700583, + -0.055348396, 0.7769584, 0.20883593, 0.68046755, -1.3861976, -0.7743764, -0.17685926, + -0.28369236, 0.7703819, 0.88469267, 0.7845876, 0.4245007, 1.0558772, 1.5855613, + -0.88230014, 2.5918908, 0.5176118, 0.9809585, -0.16784734, 0.44176394, -1.8440124, + 1.8485708, 0.13407728, 0.99209386, -0.49863797, -0.05547434, 0.51047516, 0.95244277, + 0.16795856, 1.4046597, 1.2883723, -0.4217211, -0.30820233, -0.94360316, -1.0276735, + 1.8597782, -1.7973311, 0.17352016, 0.14103556, -0.53083634, -0.08058083, 0.58797073, + -0.1623843, 1.0300912, -1.594127, -0.37183756, 0.6519355, -0.67296886, 1.4364773, + 2.9115105, -0.62121296, 0.10118961, 0.4055282, -0.765203, 1.1095873, 0.25468233, + -0.8044969, 0.37809694, 0.47051764, -0.5070367, -0.69294405, 1.678687, -0.05850029, + -0.15289319, -2.1158576, -0.28707075, 0.64672077, 2.1430318, 1.8936268, 0.287481, + -1.212002, -0.8066146, -0.024840236, 0.4002909, 1.5536453, 0.90662, -0.1200099, + 0.2907222, 1.3641009, -1.2066911, 2.2924597, -0.10727149, -0.90693283, -1.7303126, + -0.9309965, -0.39670166, 1.4576144, 1.8296418, 0.29156286, 0.914652, 0.48379737, + 0.35427743, 1.0552206, 1.0729686, 0.66110367, 1.1590368, -0.883232, 1.5702324, + 0.37410414, 2.7553983, 1.3418052, 0.4280968, 0.43797877, -0.42501903, 0.6896758, + 0.17888534, 0.7881189, 1.906157, -0.893877, 1.6907314, -0.07711154, -0.08057277, + -0.94700074, 0.118160814, 1.0535691, 0.013901293, -1.0134851, -0.49273467, 0.77010435, + 0.61979324, -0.4796943, -0.9006692, -0.14570916, 0.20728627, -0.6043751, -0.77368677, + 2.1912723, -1.0270727, -0.15626097, 1.6779256, -1.3633705, -1.419299, 0.4458414, + 1.8119955, 1.3894738, -0.0533064, -0.2651497, 2.156881, 1.774823, 1.6229321, + 0.83354133, 0.6217755, 2.7520647, -0.8899409, -0.5549828, 2.2334838, 1.866106, + 2.2245884, 1.6349602, -0.17061183, -0.75332606, -0.7192313, 1.011065, 1.1424315, + -0.14698744, -0.5063292, 0.047560766, 0.8158023, -0.99613833, 1.3294827, -0.884288, + 1.9334476, -0.82400334, -1.0622213, 0.45689362, 0.3765804, -0.2486183, 0.5129931, + -2.1530728, 1.6927868, -0.4909035, 0.07076289, 1.1461573, 1.2108444, 0.5570269, + 0.57290983, 1.0781552, 0.2522127, 0.9315722, 0.82063264, -0.27504963, -1.298832, + 0.5996642, 0.035723105, 0.9061513, 0.7085681, 1.3870897, -0.33059365, 1.4296496, + -0.9227723, -2.0201705, -0.25814092, -0.044265598, 0.74225616, -0.7740435, 0.56227565, + -0.7865786, 0.16598742, -0.13509351, 0.65011877, -0.5367288, 0.7644322, 1.754046, + 0.14904708, 0.0060333014, 0.81808805, -0.023402452, 1.2871823, -1.2016544, -0.016474128, + 1.0952724, -0.83657134, 0.959798, -0.29334623, 0.46025404, -1.329956, 0.88328505, + 0.311208, 1.5458176, 1.058334, -0.65749556, 0.7922486, 1.2470598, 0.009132266, + 0.07870856, 0.6166347, 0.009361565, -1.6813973, 0.3131196, -0.3617983, -1.6096013, + -0.80183095, 0.60364366, 0.032118678, 0.53880775, 0.79869264, 2.0884013, 0.30808622, + -1.1033678, -1.0830308, -1.5599371, 1.2167512, 0.439706, -0.76799685, -0.46132383, + -1.6585693, -0.8193617, 0.15754253, 0.82434106, -1.4365332, 2.5602462, -0.59798455, + 2.2706695, 0.094361365, 1.5161843, 1.576273, 0.8282173, -2.615784, 2.0659475, + -0.70808023, 1.8205551, -0.23570198, 1.0002637, -0.84214133, 1.1558707, -0.8486479, + 3.3955946, -0.9163475, 1.2400286, 1.7278013, -0.2593556, 0.12464893, 0.045035288, + 0.14191893, 0.60069644, 0.6033013, -0.40642756, 0.30952126, 2.1911335, 0.38403878, + -0.5504798, 0.7629653, 0.96752846, -0.77223957, -0.45594752, 1.2607243, -0.5419304, + 0.06783953, 1.1299804, -2.9180245, 2.812955, -2.912982, 4.157113, -0.7707863, + 4.184089, -1.2218096, 2.2556906, -2.2792397, 4.6580005, -2.2278588, 3.2439072, + -1.7189349, 2.8687704, -3.8549495, 3.9684548, -3.5499556, 3.1096249, -1.6433489, + 3.6931372, 4.762172, 6.8113427, 5.6586823, 3.9343526, 4.874974, 4.044377, + 4.5118494, 4.560476, 4.814545, 5.255967, 4.8088293, 4.8661695, 5.5842476, + 3.047568, 6.3495092, 5.8194113, 3.9938629, 6.2386484, 5.357541, 4.734993, + 4.009847, -1.85078, 3.257053, -2.863433, 3.2807407, -2.4543116, 2.3266344, + -2.7742774, 5.0006027, -3.1107163, 3.1461582, -2.4130437, 1.9839633, -3.2893786, + 4.9680586, -1.5064957, 4.93627, -2.2536325, 4.4328127, -2.371289, -0.09072271, + 1.6559569, 0.9273602, -0.16627279, -0.15694867, -0.16094846, -0.30682713, 0.62848985, + -0.16314042, -1.793005, -0.025120497, 0.035565466, 0.4509227, 1.029233, 2.6076002, + -1.3557681, -0.042177677, -1.8681216, 0.047852248, -1.0646176, 3.5719476, 0.61097944, + 1.9404714, -1.8996478, 1.4736449, -0.3556636, 0.7955406, -0.70645106, 0.106241465, + -1.4871876, 1.4906516, -0.5542434, 1.8523693, -1.8795702, 0.20563364, -1.7517232, + -0.2156514, -0.42685848, 1.2532125, 0.29982674, 0.6122022, -1.2758396, -0.7942943, + -1.2208992, -0.28703833, -0.6799724, -0.22529805, 0.88721895, -1.6784416, 0.6357958, + -0.40500844, -1.1880269, -1.3736604, 0.27873987, 0.9415196, 1.5691454, 0.637203, + 0.6283375, 0.8025869, -0.73763883, 0.07619148, 0.29328048, -0.21484284, 0.39326593, + 0.2614212, 0.25093663, 1.1460452, -0.42564535, 1.2621714, 0.7867665, -0.9763881, + 0.67735475, 1.3954227, 0.8466128, 2.6533723, -1.3165393, 1.0205896, -1.2907634, + -0.09324902, 0.19477385, -0.10201472, 1.2100208, 0.8927874, 1.1437554, -0.27520463, + -0.18907726, -0.1451918, 0.3773734, -1.0439434, -0.35780138, 1.1060231, 1.0964282, + 0.2501399, 0.31307727, -0.13760762, -0.86377877, -0.49448854, 0.09268577, 0.74952096, + 0.82891256, 1.9546115, 1.2895672, 2.1169534, -1.0286292, 0.0854094, 0.63047266, + 1.0325564, -1.0493125, 0.31182784, 2.3592472, 0.69874203, -0.92576516, 1.5970948, + 0.7720525, 0.9282105, -0.13239098, 1.5795128, -0.7387508, 0.9950645, 0.11649346, + 0.7381579, -0.9112861, -1.0479062, -0.9858517, -0.31902313, -0.43754727, -1.9271741, + 0.41418013, 1.5709126, 0.12488553, 0.34839654, -0.14153089, 1.2988961, -0.17553245, + 0.36363417, -0.4992725, -0.87406987, -1.5621511, 0.52947193, 0.17129752, -0.19691896, + 0.88363117, 0.5983897, 1.4228462, -1.309372, 1.6419725, 2.096242, 1.3451272, + 0.21495643, 0.16032922, -0.21870668, -2.3123596, 1.511457, -1.2067473, 0.30244982, + -0.5896039, -0.20020528, -0.17678946, 0.646347, 0.12540624, 0.8411275, 0.29581466, + 1.0424525, -0.3198546, 1.5812268, 1.633207, 0.036333233, -1.9386438, 0.4908937, + 0.4255972, -3.0946343, 0.4557737, -1.538063, -1.0618666, -0.766645, 0.09507492, + -1.1704439, -0.58377063, 0.06451824, 0.084664315, -0.33639127, 0.43388176, 0.7445558, + 0.56547284, 0.20360313, -0.52746487, -0.22392502, 0.10510802, 0.2932141, 0.13039428, + 0.2339833, 1.1078603, 0.07111454, 1.674398, 0.24977088, 0.7773813, 0.10618341, + 1.3232847, 0.07770634, 0.8410483, 0.6371973, 1.1520991, 1.6076822, -0.553284, + 0.0399023, 1.6575105, -1.002435, -1.153806, -0.338341, 0.75674164, -1.9532704, + -0.16773497, -0.09083623, -0.09499304, -0.15297657, 0.6092089, 1.1756519, -0.8699633, + 0.57320195, 0.77921844, 0.38325477, -0.4647501, 0.16934802, -0.9541189, 1.8387299, + -0.2722485, -0.9011179, 1.2189366, 1.0526755, 1.2198145, -0.66335034, 2.4358046, + -0.0044496655, 2.4705029, 0.7398137, 1.1581391, -0.08892931, -1.3800118, 0.39516693, + 0.7783501, -1.6864198, 0.90398335, -0.09139767, 0.18852606, -0.7292757, -0.7595531, + -0.30982962, -0.37637365, 0.27046034, -0.2601264, 0.06654024, 0.83308995, 2.1443768, + 0.7846114, 0.72724646, 0.43702295, -1.3782393, -1.555314, 1.0024056, 0.96103704, + 0.62146187, 2.4383464, 0.97525114, 0.1517681, -0.05941461, 0.20787807, -0.7399595, + 1.4447442, 0.370912, 1.5718691, 0.36367816, 1.2211394, 1.2772232, 0.46179056, + 1.0423609, -0.1160976, -1.8006848, 0.2063675, 0.699636, -0.2978242, 0.36548108, + 0.13973325, 0.06818205, -0.8364538, -1.8770711, -0.46342957, 0.5138623, -0.7012725, + 1.3353106, -0.7529058, -0.5607584, -0.3658438, 1.3651763, -0.8271546, -1.3937892, + -0.4218138, -1.5759501, 0.052277893, -0.79160595, 1.0530065, -0.25257057, 1.7259041, + -0.09510864, 0.31564656, -1.4286227, 2.806394, -2.0088015, 0.6337404, -1.4553217, + 0.3904129, -0.8321003, 2.0365574, -0.47588396, 0.03407097, 0.08727789, 2.440409, + -1.3018095, 1.9136591, 1.5979958, 1.496789, -0.2709299, -0.38308293, -1.0800201, + -0.7544405, 0.074904405, 1.2379612, -0.62439823, 0.5188385, -0.05306366, 1.060843, + -0.17591527, -0.21396813, -0.27043432, 0.16332026, -0.57039225, -0.76971775, -0.22342275, + -0.28223512, -0.66207, -1.0938429, -4.0251827, 4.238682, -2.3085427, 4.3264065, + -1.419694, 3.9545622, -3.0023227, 3.424511, -1.9520879, 3.0750623, -3.127586, + 3.9366179, -1.3875456, 3.5732715, -3.2088501, 5.656434, -3.9873497, 3.1138892, + -2.331269, 4.533456}; + +static const std::vector expected_dft1d_bfloat16_results = { + 6.3125, 4.28125, -0.804688, -0.722656, -0.0551758, 0.271484, 0.832031, 0.578125, + 0.601563, -1.32031, 1.1875, 1.45313, -0.0197754, -1.82813, 0.15332, -2.21875, + 1.05469, -1.0625, -0.6875, 0.660156, 4.625, 4.5625, -0.785156, -0.332031, + -1.46875, -1.15625, 0.710938, 1.45313, -1.09375, -0.394531, -0.59375, -0.8125, + -0.388672, -0.419922, 0.546875, 2.32813, -0.59375, 1.39063, -0.84375, 0.143555, + 6.25, 5.5625, 0.251953, -1.70313, 1.16406, 0.120117, 0.195313, -1.34375, + -0.90625, 1.40625, 0.699219, 0.574219, 1.19531, -0.515625, -2.5625, -0.804688, + 1.15625, -0.859375, 1.28906, -1, 5.625, 3.21875, 0.240234, 0.308594, + 0.617188, 0.0947266, 1.04688, -0.0205078, -0.875, -0.126953, 0.640625, -0.84375, + -0.050293, -1.04688, -0.40625, 0.207031, 0.443359, 0.458984, 1.375, -0.65625, + 5.5, 3.75, -1.88281, -0.226563, 0.816406, -0.464844, 0.121582, 0.609375, + 0.269531, 0.960938, 0.304688, 0.695313, 0.273438, -1.07813, 0.207031, 1.5625, + -0.277344, 0.890625, -0.0373535, -0.185547, 4.9375, 4.6875, 0.191406, -0.882813, + 0.914063, -0.53125, -0.455078, 1.16406, -1.46875, 1.66406, 1.01563, -1.59375, + -1.21875, -0.126953, -0.137695, -0.671875, -0.324219, -0.902344, -0.960938, 0.0281982, + 4.75, 5.25, -0.034668, -0.378906, -0.492188, -0.65625, 0.816406, -0.890625, + -0.201172, 0.173828, -0.996094, 0.828125, 0.554688, -0.020752, 1.53125, 0.691406, + 0.227539, 0.503906, 2.42188, 0.220703, 6.4375, 5.6875, -0.867188, -1.10156, + 0.128906, 1.34375, 0.363281, 0.289063, -0.8125, -0.0976563, -0.328125, 0.78125, + -0.960938, 0.898438, -2.09375, 0.847656, -1.53125, 0.742188, 1.32813, -1.03125, + 3.79688, 5.625, 1.34375, 0.640625, -0.213867, -1.20313, 1.15625, -0.0522461, + 0.476563, -0.585938, 0.228516, 1.125, 0.421875, 0.363281, -1.21875, 2.34375, + 0.644531, 0.804688, 1.15625, 0.863281, 5.59375, 5.65625, 0.484375, 0.59375, + 1.17969, 1.46875, -1.25781, -0.115723, 0.628906, -1.46875, 0.789063, 0.179688, + 0.554688, -2, -0.435547, 0.992188, 0.898438, -0.546875, 0.847656, 0.0820313, + 4.5, 4.3125, 0.726563, 0.8125, 0.273438, -0.00793457, 0.365234, 0.671875, + -2.375, 1.57813, -0.167969, 0.511719, -0.239258, -0.128906, 1.54688, 0.625, + 0.769531, 1.60938, 0.363281, -0.417969, 5.09375, 5.1875, -1.1875, 1.17188, + -0.0154419, -0.746094, 0.0834961, 0.225586, 1.10938, 2.28125, -0.6875, -0.410156, + 0.0449219, 0.867188, -0.507813, 0.229492, 0.353516, -0.457031, 0.145508, -0.108887, + 4.78125, 5.25, 0.498047, 0.296875, -0.410156, -0.644531, 0.320313, -0.898438, + -1.03125, 0.914063, 0.675781, 0.0810547, 0.335938, 0.0527344, -1.1875, 0.503906, + -1.14063, -1.42188, 0.820313, 1.89063, 6.875, 6.375, -1.29688, -0.229492, + -0.220703, 1.04688, -0.765625, 0.6875, -0.734375, 0.173828, 0.0917969, -0.574219, + -0.408203, -0.953125, -0.890625, 1.3125, -0.421875, 1.75781, -0.640625, -1.59375, + 4.40625, 5.6875, -1.10938, 0.103516, -1.10938, 0.34375, 2.10938, -0.0664063, + -0.164063, 0.261719, -0.808594, -0.414063, -1.14063, -0.00567627, -0.625, -0.146484, + -0.710938, 0.149414, -0.363281, 1.57813, 4.96875, 4.28125, -0.84375, 0.53125, + -0.601563, -0.90625, 1.04688, 0.213867, -0.472656, -0.320313, 0.808594, -0.0415039, + 0.632813, 0.15625, -0.238281, 0.695313, 1.85938, -1.69531, 1.25781, -0.679688, + 4.90625, 4.875, -0.00488281, -0.6875, -0.213867, -0.488281, 0.367188, 0.118164, + -0.78125, 0.488281, -0.5, -0.0839844, 1.15625, 0.820313, -0.640625, -1.09375, + 1.40625, -0.148438, 2.875, 1.04688, 4.6875, 5.1875, -0.632813, 2.53125, + 0.695313, -0.539063, -0.09375, 0.566406, 0.410156, 0.632813, -1.75781, -0.5, + -1.07813, 1.23438, -0.355469, -1.3125, 1.57813, 1.04688, -0.613281, 0.742188, + 5.4375, 3.95313, 2, -0.863281, -0.765625, 0.0791016, 0.835938, -0.632813, + -0.671875, 1.73438, 0.9375, 1.82031, 0.855469, -0.178711, 0.621094, 0.206055, + 0.15918, 1.85938, 0.0454102, -0.488281, 4.9375, 4, -0.746094, -0.277344, + -0.804688, -0.539063, 0.460938, 0.898438, 2.1875, -1.46875, -1.23438, 1.09375, + -0.953125, 0.515625, 0.291016, 1.01563, -0.22168, 0.113281, -1.625, -0.945313}; + +static const std::vector expected_dft2d_bfloat16_results = { + 54, 48.25, -1.85938, -3.8125, 2.59375, -0.714844, 3.53125, 1.67188, + -3.39062, 0.214844, 2.95312, 2.39062, 0.369141, -5.78125, -4.4375, 5.3125, + 1.70312, 1.41406, 5.875, -0.875, -3.25, -0.0917969, -0.34375, 2.59375, + -2.75, 0.199219, 0.355469, -0.271484, 5, -2.96875, -1.65625, 0.539062, + -0.90625, -3.65625, -3.71875, -0.671875, 2.0625, -2.1875, -3.34375, 3.53125, + 1.53125, -1.60938, -5.3125, 0.53125, -1.66406, 2.4375, -2.25, 1.42188, + 2.17188, 2.5, 0.867188, 1.65625, 1.71875, -2.09375, 4.625, -3.67188, + 0.890625, -0.412109, -5.9375, 1.46875, 2.125, -1.4375, -3.48438, 3.09375, + -3.29688, 4.78125, 5.65625, -1.11719, 1.82812, -2.5625, -0.386719, 3.21875, + 1.42969, 0.859375, 6.125, -1.73438, 2.28125, 4.375, 1.76562, 3.375, + -0.535156, 3.75, 4.4375, -4.3125, -2.76562, 3.67188, 1.89062, -2.59375, + -2.96875, 1.14062, 1.46875, 0.75, -1.3125, 1.0625, -0.765625, -10.875, + 2.96875, -4.21875, 0.417969, -0.457031, -0.625, 0.585938, -0.388672, -0.980469, + -0.147461, -3.15625, 2.71875, -3.875, 3.875, 1.04688, -0.0986328, 7, + 4.5, -0.378906, 0.648438, -2.125, 3.9375, -0.859375, 2.40625, 1.98438, + 3.65625, -4.5, -1.45312, 0.53125, 5.4375, -2.67188, -0.0605469, 3.67188, + 0.546875, 1.07812, 4.5, -1.46094, -2.39062, 0.539062, -6.0625, -2.34375, + -1.46875, -2.60938, -4.375, 0.283203, 3.96875, -3.78125, -3.10938, -2.85938, + 1.40625, 0.0375977, -2.07812, 1.64062, 0.601562, -3.25, -0.820312, 1.35938, + -2.89062, -3.4375, -2.51562, -2.8125, -4.4375, -2.34375, 0.664062, -4.75, + -2.125, -1.07812, 1.15625, -0.953125, 0.65625, -4.03125, -1.21875, 4.5625, + -0.734375, -3.21875, 1.25, -4.03125, -4.5625, -3.51562, 6.6875, -2.84375, + -0.429688, -4, -4.1875, 3.01562, 4.59375, 2.6875, 2.34375, -1.03906, + -0.0419922, 2.17188, -0.214844, 0.695312, -0.921875, -7.1875, 3.79688, 3.1875, + 3.84375, -1.89062, 0.898438, -0.371094, 3.04688, 0.197266, -0.102539, -1, + 50.5, 49, -2.59375, 3.39062, -3.17188, -2.40625, 4.75, 1.78906, + -2.51562, 6.28125, -2.64062, 1.48438, -0.789062, 2.375, -1.98438, 2.03125, + 3.625, 2.8125, 2.28125, 1.01562, 3.25, -3.03125, 2.0625, 3.5625, + 1.96094, 0.248047, -2.26562, 0.792969, 1.96094, 4.25, -3.25, 0.78125, + -2.9375, 0.667969, 5.71875, 4.84375, -4.8125, 6.34375, -2.64062, -1.85938, + -1.75781, -1.09375, 1.42188, -0.0986328, -2.76562, -3.65625, 1.42188, 3.40625, + 3.09375, 0.113281, -2.40625, 0.291016, 2.90625, -1.85938, -0.695312, 2.26562, + -0.425781, -5.8125, 5.3125, -6.28125, 0.8125, 3.625, 1.3125, 2.34375, + 2.14062, 1.89062, -2.4375, 0.382812, 2, -0.0454102, -4.125, -1.51562, + -2.04688, 1.19531, -0.65625, -2.03125, 2.0625, 4.875, -0.0996094, 1.42188, + 0.648438, -4, -0.8125, 0.445312, 2.78125, 0.4375, -0.867188, 1.25, + -2.70312, 2.8125, 4.125, -1.9375, -0.585938, -4.75, 3.14062, 0.796875, + 5.3125, 0.277344, -3.64062, -4.375, -2.51562, -0.925781, 6.8125, -4.0625, + -1.28125, 0.972656, 3.26562, -3.40625, -7.5625, 3.6875, 2.90625, 2.34375, + 2.73438, -1.26562, 1.41406, -1.83594, -2.65625, 1.29688, 5.1875, 6.1875, + 0.484375, 2.10938, 5.875, 2.79688, -0.386719, 0.00540161, -1.01562, -1.54688, + -8.0625, -0.679688, 2.34375, 3.07812, 2.625, 1.375, 0.75, 2.26562, + -1.28125, 2.125, 4.96875, -0.0222168, 0.0286865, 1.15625, -4.8125, 1.95312, + 1.96094, 2.34375, -0.984375, 4.375, -6.1875, 0.828125, -2.75, -2.92188, + -3.45312, -1.45312, 2.46875, -0.789062, -0.433594, 5.8125, -2.65625, -2.26562, + -2.54688, -3.125, -4.4375, 0.167969, 1.92188, 1.04688, 2.79688, -0.453125, + -4.0625, -2.21875, 1.78125, -0.570312, -2.1875, 3.01562, 5.3125, -0.765625, + 5.9375, 0.157227, -0.8125, 4.1875, -3.84375, -0.523438, 2.46875, -2.375, + -0.408203, -0.953125, -0.984375, 0.144531, 0.253906, 0.816406, 2.34375, 4.0625, + 1.34375, -0.574219, -0.0258789, -0.53125, 0.390625, -1.75, -4.3125, -2.15625}; + +static const std::vector expected_dft3d_bfloat16_results = { + 104.5, 97.5, -4.4375, -0.414063, -0.582031, -3.125, 8.25, 3.46875, + -5.90625, 6.5, 0.3125, 3.875, -0.419922, -3.40625, -6.40625, 7.3125, + 5.34375, 4.25, 8.125, 0.138672, -0.0197754, -3.125, 1.71875, 6.1875, + -0.796875, 0.445313, -1.90625, 0.523438, 6.9375, 1.25, -4.9375, 1.32031, + -3.84375, -2.98438, 2, 4.15625, -2.75, 4.125, -6, 1.66406, + -0.223633, -2.70313, -3.90625, 0.435547, -4.4375, -1.21875, -0.832031, 4.8125, + 5.25, 2.625, -1.54688, 1.95313, 4.625, -3.95313, 3.9375, -1.40625, + 0.464844, -6.1875, -0.632813, -4.8125, 2.9375, 2.1875, -2.17188, 5.4375, + -1.15625, 6.6875, 3.20313, -0.734375, 3.84375, -2.60938, -4.5, 1.70313, + -0.617188, 2.0625, 5.5, -3.78125, 4.34375, 9.25, 1.67188, 4.8125, + 0.115234, -0.242188, 3.60938, -3.90625, 0.0158691, 4.125, 1.01563, -1.35156, + -5.6875, 3.95313, 5.625, -1.1875, -1.89063, -3.71875, 2.375, -10, + 8.25, -3.9375, -3.21875, -4.84375, -3.14063, -0.341797, 6.4375, -5.0625, + -1.42969, -2.1875, 6, -7.25, -3.67188, 4.71875, 2.8125, 9.3125, + 7.21875, -1.64063, 2.0625, -3.96875, 1.26563, 0.4375, 7.625, 8.1875, + 4.125, -2.375, 4.40625, 3.32813, 5.0625, -2.65625, -1.07813, 2.125, + -7.5, 0.394531, 6.875, 1.625, 0.240234, 1.90625, -5.3125, -0.0849609, + -2.75, -0.492188, 0.574219, 0.261719, 4, -2.625, -7.9375, -0.90625, + 3.375, 2.375, -3.0625, 6, -5.59375, -2.40625, -3.57813, -1.5625, + -6.34375, -4.90625, -0.0458984, -3.59375, -4.875, 3.45313, -1.98438, -7, + -4.6875, -4.1875, -3.29688, -0.78125, 2.57813, -3, 1.57031, 4.09375, + -4.78125, -5.4375, 3.03125, -4.59375, -6.75, -0.492188, 12, -3.625, + 5.5, -3.84375, -5, 7.1875, 0.761719, 2.17188, 4.8125, -3.42188, + -0.449219, 1.21875, -1.20313, 0.835938, -0.664063, -6.375, 6.125, 7.25, + 5.1875, -2.46875, 0.871094, -0.902344, 3.4375, -1.54688, -4.40625, -3.17188, + 3.28125, -0.925781, 0.742188, -7.1875, 5.75, 1.70313, -1.20313, -0.112305, + -0.867188, -6.0625, 5.59375, 0.90625, 1.15625, -8.125, -2.4375, 3.26563, + -1.92969, -1.40625, 3.60938, -1.89063, -6.5, 2.9375, -2.40625, -0.96875, + -4.71875, -0.0493164, 2.625, -1.0625, 3.03125, -7.21875, 1.60156, -0.238281, + 2.03125, -4.3125, -9.4375, -5.5, 6.875, -8.5, -0.710938, 5.375, + 3.28125, -0.523438, -6.75, 0.632813, 1.10156, 6.125, -3.65625, -1.98438, + -0.914063, 2.39063, 3.28125, 1.375, -1.17969, -0.226563, 5.34375, -5.9375, + 1.3125, 5.375, -11.25, 7.75, 1.3125, -5.0625, -4.8125, 0.746094, + -5.4375, 2.89063, 8.125, -1.5, -0.171875, -2.51563, 3.73438, 4.75, + 3.48438, -0.335938, 6.8125, 0.308594, 0.214844, -0.46875, 1.86719, 1.96094, + -1.1875, 7.75, 5.25, -4.78125, -5.5625, 3.23438, 2.75, -3.84375, + -0.257813, -1.65625, -2.65625, 2.6875, -0.726563, 5.84375, -3.90625, -11.625, + -2.3125, -4.5, 4.0625, 3.9375, 1.89063, 1.50781, -7.21875, 3.09375, + 1.13281, -4.125, -0.550781, -0.472656, 11.375, -2.625, -3, 4.625, + 1.74219, 0.882813, -0.761719, -0.291016, 6.59375, -2.15625, -2.8125, -4.1875, + 3.15625, -6.625, -7.3125, -2.26563, 5.84375, -2.6875, 0.953125, 5.21875, + 8.625, 1.75781, 2.17188, -4.53125, -5, -0.832031, -6.84375, -4.625, + -0.195313, -4.75, -9.375, 0.304688, 3.9375, -4.9375, 1.72656, -4.8125, + -0.550781, -2.3125, -1.09375, -2.75, 6.8125, -4.0625, 1.94531, 4.28125, + 0.5625, -1.99219, -5, -2.01563, -4, -8.125, 3.3125, -2.46875, + 0.414063, 2.04688, 5.59375, -1.11719, -1.26563, -5.0625, -4, 5, + 3.3125, -1, -0.539063, -3.46875, -2.375, -6.53125, 1.39063, -2.09375, + -6.34375, -4.15625, -3.40625, -1.15625, 8.375, 3.21875, -0.126953, 1.34375, + 0.367188, 3.125, 0.773438, 0.546875, -1.17188, -8, 1.45313, -0.902344, + 2.51563, -1.3125, 0.921875, 0.157227, 2.65625, 1.94531, 4.1875, 1.17188}; + +static const std::vector expected_dft1d_float16_results = { + 6.32812, 4.29688, -0.811035, -0.71875, -0.0587158, 0.270508, 0.827148, 0.57959, + 0.599609, -1.3291, 1.18848, 1.46289, -0.0178833, -1.83203, 0.160034, -2.2207, + 1.0625, -1.06738, -0.686523, 0.657715, 4.62891, 4.59375, -0.789062, -0.326416, + -1.4707, -1.16113, 0.709473, 1.45703, -1.09766, -0.392334, -0.599609, -0.814941, + -0.391846, -0.420166, 0.552734, 2.33984, -0.599121, 1.39648, -0.845215, 0.149414, + 6.25781, 5.56641, 0.256348, -1.70215, 1.16211, 0.120178, 0.197266, -1.34277, + -0.906738, 1.41113, 0.708496, 0.57959, 1.20215, -0.519043, -2.55859, -0.808594, + 1.16602, -0.868652, 1.29883, -1.00488, 5.64453, 3.21094, 0.235962, 0.310059, + 0.617676, 0.100159, 1.04297, -0.0167999, -0.885254, -0.12915, 0.648926, -0.842773, + -0.0584106, -1.04883, -0.402344, 0.203247, 0.450439, 0.459229, 1.37109, -0.654785, + 5.52734, 3.75195, -1.88672, -0.223389, 0.816895, -0.46582, 0.123657, 0.609863, + 0.27002, 0.97168, 0.304932, 0.696289, 0.272217, -1.08105, 0.205933, 1.56543, + -0.276367, 0.89502, -0.0397949, -0.187134, 4.97656, 4.69531, 0.190063, -0.88623, + 0.916504, -0.525879, -0.454834, 1.16211, -1.47754, 1.67188, 1.02832, -1.60156, + -1.21777, -0.134521, -0.147461, -0.67334, -0.32666, -0.901367, -0.966309, 0.0360413, + 4.77344, 5.24609, -0.0340881, -0.372559, -0.490723, -0.657715, 0.814453, -0.891602, + -0.199219, 0.179199, -0.996094, 0.828613, 0.552246, -0.0240173, 1.53516, 0.69873, + 0.231689, 0.510742, 2.43164, 0.226562, 6.47656, 5.73047, -0.871094, -1.11035, + 0.125244, 1.34863, 0.369141, 0.291504, -0.814941, -0.0922852, -0.331299, 0.780762, + -0.962402, 0.899902, -2.11133, 0.845215, -1.53516, 0.743164, 1.33203, -1.02148, + 3.8125, 5.62109, 1.35449, 0.645996, -0.216187, -1.20801, 1.16406, -0.0525208, + 0.480957, -0.589355, 0.234863, 1.12793, 0.425781, 0.36377, -1.22461, 2.35156, + 0.642578, 0.80957, 1.15723, 0.866699, 5.59766, 5.66016, 0.480469, 0.594727, + 1.18457, 1.4707, -1.25879, -0.116394, 0.629883, -1.46191, 0.787109, 0.181274, + 0.554688, -2.00586, -0.437012, 0.994141, 0.895996, -0.549316, 0.842773, 0.0840454, + 4.52734, 4.35156, 0.730957, 0.810059, 0.278564, -0.00706482, 0.365479, 0.674805, + -2.38281, 1.58203, -0.165527, 0.513672, -0.236938, -0.132935, 1.55176, 0.620605, + 0.773926, 1.61133, 0.362793, -0.424316, 5.10156, 5.18359, -1.19727, 1.17871, + -0.0184937, -0.75, 0.0879517, 0.219238, 1.11328, 2.28906, -0.688477, -0.407715, + 0.0468445, 0.868164, -0.507324, 0.230225, 0.353271, -0.456299, 0.149902, -0.105286, + 4.80859, 5.28125, 0.496826, 0.29541, -0.414551, -0.64502, 0.317627, -0.895508, + -1.04102, 0.917969, 0.682617, 0.0803833, 0.339111, 0.0525818, -1.18652, 0.51123, + -1.14551, -1.41895, 0.82373, 1.89453, 6.88281, 6.40625, -1.30273, -0.224731, + -0.220825, 1.03711, -0.763672, 0.694824, -0.731445, 0.168091, 0.0882568, -0.573242, + -0.406982, -0.962891, -0.890625, 1.31445, -0.423828, 1.76758, -0.640137, -1.61133, + 4.41016, 5.70703, -1.11133, 0.105713, -1.11133, 0.341553, 2.11719, -0.0671997, + -0.161743, 0.260742, -0.813477, -0.422607, -1.1416, -0.000315189, -0.634766, -0.1521, + -0.716797, 0.148071, -0.353516, 1.58398, 4.98828, 4.28906, -0.849121, 0.534668, + -0.60498, -0.902344, 1.04492, 0.211914, -0.479004, -0.322754, 0.807617, -0.0440674, + 0.628418, 0.155029, -0.237671, 0.695801, 1.86035, -1.70312, 1.26562, -0.679199, + 4.92188, 4.89453, -0.012001, -0.6875, -0.218506, -0.486816, 0.367432, 0.124451, + -0.786621, 0.48877, -0.508301, -0.0883179, 1.16504, 0.819336, -0.640625, -1.09668, + 1.40918, -0.153564, 2.88281, 1.05371, 4.70312, 5.20312, -0.634766, 2.53125, + 0.699219, -0.538574, -0.098938, 0.565918, 0.408936, 0.634766, -1.76367, -0.49707, + -1.07715, 1.24219, -0.362549, -1.31152, 1.58398, 1.05273, -0.611328, 0.748535, + 5.43359, 3.9668, 2.00586, -0.870117, -0.765625, 0.0811768, 0.839355, -0.635254, + -0.675293, 1.73633, 0.9375, 1.8252, 0.861816, -0.182007, 0.625, 0.203125, + 0.159302, 1.86133, 0.041687, -0.490723, 4.94141, 4.02734, -0.74707, -0.277832, + -0.808105, -0.541016, 0.467285, 0.901367, 2.19727, -1.4668, -1.23535, 1.09668, + -0.955566, 0.51416, 0.288574, 1.01172, -0.219116, 0.114624, -1.62695, -0.943359}; + +static const std::vector expected_dft2d_float16_results = { + 54.0312, 48.375, -1.87305, -3.78906, 2.58594, -0.708984, 3.53516, 1.67969, + -3.40039, 0.239502, 2.97461, 2.39844, 0.358887, -5.80078, -4.42969, 5.29688, + 1.71191, 1.42676, 5.89844, -0.848145, -3.28711, -0.10022, -0.339111, 2.61523, + -2.76562, 0.185791, 0.349365, -0.259277, 5, -2.98438, -1.66406, 0.533203, + -0.898438, -3.64453, -3.71484, -0.685547, 2.0625, -2.2168, -3.36914, 3.52734, + 1.54785, -1.63281, -5.33203, 0.538086, -1.66699, 2.44922, -2.26172, 1.41113, + 2.17969, 2.50195, 0.851562, 1.66016, 1.7168, -2.10156, 4.65625, -3.67578, + 0.893555, -0.398926, -5.94922, 1.44043, 2.11523, -1.45312, -3.50391, 3.08203, + -3.31836, 4.78516, 5.64844, -1.11914, 1.8291, -2.57617, -0.412842, 3.23633, + 1.42773, 0.870117, 6.17578, -1.73242, 2.3125, 4.40625, 1.77148, 3.38086, + -0.532715, 3.76562, 4.44141, -4.35156, -2.76367, 3.68555, 1.8916, -2.58398, + -2.99023, 1.13477, 1.4834, 0.74707, -1.30762, 1.06641, -0.759766, -10.8828, + 3, -4.25, 0.417969, -0.451416, -0.625, 0.592773, -0.366211, -0.952637, + -0.15979, -3.17383, 2.71875, -3.875, 3.89062, 1.04785, -0.0922241, 6.99219, + 4.51172, -0.383301, 0.664062, -2.12305, 3.94141, -0.869629, 2.42773, 1.96582, + 3.65234, -4.49219, -1.47168, 0.526367, 5.45703, -2.65625, -0.0605774, 3.66211, + 0.561523, 1.05859, 4.54297, -1.44824, -2.38672, 0.524902, -6.11328, -2.36328, + -1.48926, -2.62695, -4.40234, 0.276123, 3.95703, -3.75977, -3.12695, -2.86719, + 1.41699, 0.0242462, -2.08008, 1.6543, 0.595703, -3.25586, -0.820801, 1.36328, + -2.90625, -3.43945, -2.50195, -2.82227, -4.42578, -2.35352, 0.666016, -4.74609, + -2.16016, -1.05859, 1.13379, -0.946777, 0.675781, -4.04688, -1.24219, 4.53906, + -0.742188, -3.22461, 1.23145, -4.04688, -4.5625, -3.51953, 6.70703, -2.84375, + -0.4375, -3.99609, -4.22656, 3.05273, 4.60938, 2.7207, 2.33398, -1.04004, + -0.0499268, 2.1582, -0.223877, 0.686523, -0.927246, -7.23438, 3.79492, 3.19727, + 3.86719, -1.89062, 0.915039, -0.369629, 3.05664, 0.201294, -0.0986938, -1.01953, + 50.7188, 49.3125, -2.61914, 3.39648, -3.18359, -2.41016, 4.74219, 1.79492, + -2.53711, 6.28906, -2.6582, 1.48242, -0.777344, 2.37305, -1.99512, 2.02734, + 3.63477, 2.82227, 2.29492, 1.02539, 3.25195, -3.06055, 2.09766, 3.56641, + 1.94922, 0.241577, -2.25391, 0.783203, 1.96289, 4.23828, -3.25391, 0.787109, + -2.9375, 0.66748, 5.74219, 4.84766, -4.80078, 6.37109, -2.66211, -1.88477, + -1.76953, -1.10449, 1.41309, -0.0806274, -2.76367, -3.64648, 1.41602, 3.41016, + 3.09961, 0.116394, -2.41016, 0.277344, 2.89648, -1.86426, -0.683105, 2.25, + -0.430176, -5.81641, 5.34766, -6.29297, 0.800781, 3.65234, 1.31641, 2.3418, + 2.16016, 1.87207, -2.4707, 0.392822, 2.01953, -0.0645142, -4.13281, -1.5127, + -2.03516, 1.19531, -0.666016, -2.04492, 2.07422, 4.87109, -0.0910034, 1.38965, + 0.680664, -4, -0.802734, 0.439697, 2.78125, 0.452393, -0.876465, 1.23828, + -2.72656, 2.79688, 4.14844, -1.9209, -0.609863, -4.79297, 3.15234, 0.793457, + 5.30859, 0.279785, -3.67383, -4.39844, -2.51172, -0.914062, 6.83984, -4.08984, + -1.27832, 0.978516, 3.26953, -3.39258, -7.55469, 3.68359, 2.92383, 2.33398, + 2.75195, -1.25977, 1.42383, -1.85449, -2.67383, 1.27148, 5.21875, 6.20703, + 0.493652, 2.11523, 5.87891, 2.80469, -0.37793, 0.0119629, -1.04004, -1.53711, + -8.07812, -0.686035, 2.35156, 3.08789, 2.65039, 1.36719, 0.771973, 2.29297, + -1.26855, 2.11523, 4.99219, -0.0458984, 0.0148392, 1.1582, -4.83594, 1.95605, + 1.97949, 2.3457, -0.963379, 4.39453, -6.20312, 0.832031, -2.77344, -2.92773, + -3.46484, -1.45898, 2.47266, -0.795898, -0.428467, 5.8125, -2.66406, -2.27148, + -2.54883, -3.12305, -4.46094, 0.164429, 1.91504, 1.04688, 2.80664, -0.47168, + -4.06641, -2.22266, 1.77734, -0.578613, -2.20312, 3.02734, 5.32422, -0.783203, + 5.92578, 0.141968, -0.815918, 4.19531, -3.85547, -0.515137, 2.47852, -2.39648, + -0.394043, -0.960938, -0.977051, 0.137573, 0.259766, 0.834961, 2.37109, 4.10938, + 1.3584, -0.584473, -0.0278931, -0.530762, 0.396484, -1.75781, -4.31641, -2.16797}; + +static const std::vector expected_dft3d_float16_results = { + 104.75, 97.6875, -4.49219, -0.392578, -0.598633, -3.11914, 8.28125, 3.47461, + -5.9375, 6.52734, 0.316162, 3.88086, -0.418213, -3.42773, -6.42578, 7.32422, + 5.34766, 4.25, 8.1875, 0.17688, -0.0348816, -3.16016, 1.75781, 6.17969, + -0.817383, 0.427246, -1.90527, 0.523926, 6.96094, 1.25391, -4.91797, 1.32031, + -3.83594, -2.97852, 2.0293, 4.16406, -2.73633, 4.15625, -6.03125, 1.64258, + -0.221558, -2.73633, -3.91992, 0.45752, -4.42969, -1.19727, -0.844238, 4.82031, + 5.28125, 2.61914, -1.55762, 1.9375, 4.61328, -3.9668, 3.97461, -1.42676, + 0.463135, -6.21875, -0.599609, -4.85547, 2.91406, 2.19922, -2.1875, 5.42188, + -1.15723, 6.66016, 3.17578, -0.726562, 3.84961, -2.64062, -4.54297, 1.72363, + -0.606445, 2.06641, 5.50781, -3.77734, 4.38672, 9.28125, 1.68066, 4.76953, + 0.148071, -0.237183, 3.63672, -3.91406, 0.0173492, 4.14062, 1.01465, -1.34668, + -5.71484, 3.93164, 5.63281, -1.17285, -1.91797, -3.72656, 2.39258, -10.0859, + 8.30469, -3.96875, -3.25586, -4.84766, -3.13672, -0.321045, 6.47656, -5.04297, + -1.4375, -2.19531, 5.98828, -7.26562, -3.66602, 4.73047, 2.83203, 9.32812, + 7.26172, -1.64258, 2.08789, -3.97656, 1.26562, 0.402588, 7.64844, 8.17188, + 4.14453, -2.375, 4.40625, 3.33008, 5.07812, -2.64453, -1.10059, 2.125, + -7.51953, 0.372559, 6.89453, 1.63867, 0.263672, 1.8916, -5.33984, -0.071228, + -2.75781, -0.512695, 0.587402, 0.230225, 3.97266, -2.60156, -7.96094, -0.911133, + 3.39648, 2.36914, -3.04297, 6.04688, -5.60547, -2.42383, -3.5957, -1.56543, + -6.37109, -4.89844, -0.0288696, -3.61719, -4.85547, 3.45898, -1.99805, -7.01562, + -4.71094, -4.17969, -3.32812, -0.782227, 2.58984, -3.00195, 1.56348, 4.06641, + -4.80859, -5.44531, 3.00781, -4.625, -6.76562, -0.492432, 12.0312, -3.62695, + 5.48828, -3.85352, -5.04297, 7.24609, 0.754883, 2.20703, 4.8125, -3.4375, + -0.443848, 1.19727, -1.20117, 0.824219, -0.66748, -6.40234, 6.16406, 7.30469, + 5.22266, -2.47461, 0.887207, -0.900391, 3.45312, -1.55566, -4.41797, -3.1875, + 3.30469, -0.945801, 0.745605, -7.1875, 5.76953, 1.70215, -1.20898, -0.115417, + -0.862305, -6.05078, 5.63281, 0.916504, 1.13574, -8.17188, -2.43359, 3.26953, + -1.92383, -1.39551, 3.60156, -1.87305, -6.53906, 2.96094, -2.43555, -0.952148, + -4.71484, -0.0558167, 2.60352, -1.04297, 3.03516, -7.22266, 1.58984, -0.253906, + 2.03906, -4.3125, -9.46094, -5.53516, 6.86328, -8.58594, -0.70752, 5.41406, + 3.31641, -0.527832, -6.74609, 0.618652, 1.09668, 6.09766, -3.67773, -1.99902, + -0.919434, 2.38672, 3.26172, 1.38281, -1.17969, -0.237305, 5.33984, -5.92578, + 1.32324, 5.41797, -11.2969, 7.73438, 1.31348, -5.10547, -4.82031, 0.739258, + -5.47656, 2.91406, 8.11719, -1.51172, -0.191284, -2.51172, 3.71875, 4.75, + 3.46289, -0.325439, 6.83984, 0.311768, 0.237549, -0.465088, 1.8623, 1.99023, + -1.21289, 7.76562, 5.24219, -4.79297, -5.54297, 3.23438, 2.76758, -3.82227, + -0.263428, -1.66113, -2.66602, 2.66797, -0.698242, 5.85938, -3.91211, -11.6719, + -2.30664, -4.52734, 4.09375, 3.94531, 1.88672, 1.50684, -7.20703, 3.13672, + 1.11816, -4.15234, -0.55127, -0.482422, 11.4453, -2.63477, -3.01562, 4.66016, + 1.75879, 0.876465, -0.759766, -0.267334, 6.61719, -2.14062, -2.79102, -4.24219, + 3.1582, -6.60547, -7.35156, -2.27734, 5.83594, -2.66992, 0.979492, 5.19922, + 8.64062, 1.74414, 2.19141, -4.53516, -5.03516, -0.841797, -6.88672, -4.65625, + -0.220825, -4.74219, -9.39062, 0.322021, 3.94336, -4.91797, 1.70703, -4.82422, + -0.562012, -2.32031, -1.11719, -2.73828, 6.80078, -4.08594, 1.95312, 4.29297, + 0.558105, -1.97949, -4.97656, -2.02539, -3.99805, -8.16406, 3.33008, -2.47461, + 0.388672, 2.06445, 5.59375, -1.11133, -1.23828, -5.09375, -4.04688, 5.01172, + 3.32227, -1.00293, -0.545898, -3.46875, -2.35938, -6.54688, 1.38086, -2.06055, + -6.36328, -4.13672, -3.41211, -1.14062, 8.46875, 3.23633, -0.145142, 1.35742, + 0.343994, 3.11914, 0.753418, 0.548828, -1.18652, -8.07031, 1.42383, -0.911621, + 2.50781, -1.30566, 0.942871, 0.161255, 2.66016, 1.95898, 4.21875, 1.14844}; + +static const std::vector input_data_1 = { + 0.9795938, 0.14046684, 0.9819369, 0.51320475, 0.9390985, 0.06454252, 0.48972926, + 0.042538255, 0.3341647, 0.14752749, 0.44628578, 0.8509109, 0.6611515, 0.5711897, + 0.10807402, 0.67733586, 0.4091941, 0.23590194, 0.4385734, 0.40270114, 0.75568604, + 0.9842337, 0.82819414, 0.49742407, 0.7397849, 0.6104118, 0.019504193, 0.7756829, + 0.9271429, 0.6423316, 0.3300541, 0.8688829, 0.21220064, 0.76539195, 0.8143789, + 0.70724595, 0.54020476, 0.29437974, 0.19398275, 0.20308031, 0.30458412, 0.040420562, + 0.36627868, 0.61882246, 0.3416973, 0.5482437, 0.68851316, 0.5670022, 0.58812225, + 0.6487681, 0.88266903, 0.07287276, 0.7716641, 0.12443388, 0.4170407, 0.8380076, + 0.17115247, 0.8118648, 0.7704737, 0.5179812, 0.9407177, 0.7311383, 0.4538601, + 0.01992845, 0.4758718, 0.25867644, 0.55573237, 0.89606065, 0.8505143, 0.47349417, + 0.3970769, 0.3293097, 0.7601557, 0.24247961, 0.8102311, 0.7387785, 0.15742134, + 0.8387721, 0.100493915, 0.3733577, 0.4904671, 0.9106489, 0.0049963384, 0.89285916, + 0.24380954, 0.7329451, 0.9373891, 0.52886724, 0.65965563, 0.7307209, 0.5160155, + 0.97944415, 0.43991584, 0.9839402, 0.6350642, 0.16712844, 0.40538687, 0.80509937, + 0.4988989, 0.02185218, 0.74142575, 0.8026278, 0.28912508, 0.50405765, 0.7768013, + 0.9817653, 0.9995751, 0.74799776, 0.8615655, 0.058107413, 0.27611437, 0.76372087, + 0.93234706, 0.7603203, 0.30816016, 0.80595773, 0.8843074, 0.46457228, 0.43644127, + 0.6553406, 0.9050378, 0.5044161, 0.49364874, 0.59174323, 0.2650881, 0.78394204, + 0.57706285, 0.33071348, 0.7140054, 0.5885716, 0.60252094, 0.92644346, 0.91704935, + 0.64020824, 0.99652874, 0.8375778, 0.45622328, 0.3755286, 0.8324417, 0.77270067, + 0.50742614, 0.7814994, 0.30720684, 0.36613366, 0.9426107, 0.12557131, 0.87243265, + 0.002567238, 0.8350289, 0.1262151, 0.35253504, 0.07578735, 0.34082502, 0.9211622, + 0.38055828, 0.3247621, 0.5061271, 0.87862396, 0.1869049, 0.7774487, 0.030804915, + 0.25322768, 0.06073754, 0.27092665, 0.9209875, 0.86690956, 0.74456835, 0.42403135, + 0.61839956, 0.9004572, 0.94674456, 0.17315134, 0.74403226, 0.30930993, 0.23992635, + 0.9080931, 0.4886828, 0.9973065, 0.32888287, 0.32976696, 0.09137513, 0.1410893, + 0.4248779, 0.019689998, 0.6828394, 0.47350892, 0.02358055, 0.94660497, 0.9253734, + 0.1509718, 0.540138, 0.7050524, 0.20855357, 0.9753569, 0.0044813985, 0.5063834, + 0.6836877, 0.2784342, 0.0139586115, 0.8785785, 0.4754602, 0.38955635, 0.151705, + 0.5694773, 0.14548586, 0.6798502, 0.057361145, 0.031760257, 0.91168743, 0.5762714, + 0.54128575, 0.53421247, 0.5860678, 0.97197753, 0.940639, 0.18688098, 0.54635745, + 0.513619, 0.5645304, 0.91558236, 0.8496063, 0.6258071, 0.31261826, 0.20282389, + 0.2723365, 0.5039135, 0.6405068, 0.65471405, 0.5857442, 0.57205665, 0.23835625, + 0.32288164, 0.068663165, 0.43674967, 0.049117915, 0.78065604, 0.98437595, 0.60793245, + 0.38907775, 0.6610265, 0.5587009, 0.89418066, 0.6170649, 0.1305905, 0.5760506, + 0.10885323, 0.5303117, 0.16950679, 0.9630447, 0.9476875, 0.22327174, 0.87473476, + 0.917824, 0.44959846, 0.055421904, 0.22361691, 0.9334828, 0.16427046, 0.5914317, + 0.81789917, 0.48431975, 0.3067152, 0.53250873, 0.19298424, 0.23529118, 0.4841604, + 0.24943262, 0.41821656, 0.59484303, 0.4535004, 0.50373393, 0.6057788, 0.6799498, + 0.21368006, 0.17095569, 0.97966874, 0.3839032, 0.48672524, 0.9375583, 0.84598905, + 0.049092207, 0.47682214, 0.56488436, 0.7817405, 0.8975917, 0.75874424, 0.43242812, + 0.8459973, 0.7138231, 0.9834999, 0.7273379, 0.05828699, 0.6884237, 0.07486352, + 0.4326547, 0.78577167, 0.8844588, 0.9474644, 0.542272, 0.49642876, 0.48886803, + 0.11854455, 0.01492267, 0.22648218, 0.7607531, 0.5930919, 0.9450968, 0.02894685, + 0.67735505, 0.46363172, 0.18415985, 0.66824925, 0.6137258, 0.6086626, 0.6422855, + 0.7637218, 0.56419605, 0.74026155, 0.18709394, 0.14683136, 0.32289994, 0.15482259, + 0.11222768, 0.9085655, 0.43263617, 0.32097924, 0.29690787, 0.77809244, 0.2413839, + 0.8267769, 0.82795614, 0.018312717, 0.9958108, 0.769578, 0.13144562, 0.45904484, + 0.38071582, 0.24182741, 0.7200288, 0.20737973, 0.5285696, 0.3680287, 0.46252182, + 0.89153767, 0.13071166, 0.84319293, 0.10841641, 0.40668696, 0.7636801, 0.42153865, + 0.65055484, 0.86845386, 0.6452055, 0.6112245, 0.84526664, 0.15358071, 0.7889171, + 0.6356269, 0.2515375, 0.86599886, 0.20071381, 0.20584217, 0.24220705, 0.049883988, + 0.77259976, 0.49566683, 0.8112268, 0.49028614, 0.2187354, 0.70172536, 0.47309682, + 0.12539592, 0.13696012, 0.33588144, 0.98134226, 0.537496, 0.9999663, 0.13245043, + 0.5659106, 0.39207155, 0.48483336, 0.49371332, 0.12930158, 0.103645995}; + +static const std::vector expected_dft1d_results_1 = { + 4.940035, 3.0077164, -0.43999052, -0.72356576, 0.35775006, -1.1781573, + 0.35552078, -0.5878226, 0.8879826, -1.1602633, 0.71755445, 0.15355057, + -0.9307331, 0.48268145, 1.9486318, 1.1295953, 4.4481335, 5.01757, + -0.57099926, -0.85269475, -0.7217729, -0.08008081, -1.1429803, -1.1934547, + 1.2154821, -0.07181215, 0.59362185, 0.44658875, -0.345927, -1.480422, + -0.20200539, 0.10152125, 3.4618404, 3.744587, 0.12548631, 0.8791516, + 0.19086862, -0.33497274, -0.69986683, 0.6364535, -0.6644666, -0.44771492, + -0.8179812, 0.17377639, -0.92110324, 0.26135075, 1.0228279, 1.2105042, + 4.9957, 3.764995, 0.17936486, -0.9405504, -1.2201893, -0.17718112, + 1.1820351, 0.5077594, -0.052387, 0.86741495, -0.55883414, 0.9524643, + -0.68602496, 1.3873026, 0.8653134, -1.17206, 4.107497, 4.150929, + -0.95916677, -0.56429225, 1.1602635, -1.679503, 0.5507363, 0.53716975, + 0.38042903, -0.5240841, -0.33995685, -0.78949994, -0.7040798, 0.05728233, + -0.38874817, 0.8814098, 3.9273133, 5.9265537, -0.80074155, 0.20659067, + 1.642705, 0.9759259, 0.85149074, 0.44840366, -0.25961697, 0.78995633, + -0.039625674, 0.545478, -0.70991015, -1.1269569, -0.68787766, -0.48076022, + 4.848893, 4.6852283, -0.6871975, -0.041547477, -0.91873163, -0.0071051717, + -1.4497755, 0.3778788, 0.7214658, 0.6099715, 1.4334095, -0.07150489, + 0.07712549, 1.859364, -0.78209424, -0.97149, 4.8020935, 4.897006, + 0.05723229, -0.21079391, 1.0996364, 0.22791737, 0.7594234, 1.1837918, + 1.1714673, 0.12949562, -0.64135337, -0.5158363, 0.2763425, -0.19547313, + -0.06606534, 0.56645525, 5.3334026, 5.288664, -0.09143779, -0.7460747, + 0.2411859, -0.5888344, 1.4911498, 0.52246934, -0.1439941, -0.51704764, + 0.32441977, 0.35291424, -0.7496793, -0.32638037, -0.6930033, 0.72286314, + 4.4170227, 3.232138, -0.64390934, -1.3210952, -0.58362705, -0.6716566, + 0.39952934, -1.1999383, 0.83216095, 0.8710072, 0.34266293, -0.92789006, + 0.46818644, 0.7554455, 2.3088598, 0.26656008, 4.306201, 4.1061068, + -1.286478, -0.14309806, -1.9038618, -0.045521975, -0.43500268, -0.6120295, + 0.3222475, 0.5537019, 1.2264881, -1.5052714, -0.12776875, 0.00045275688, + -1.8553859, -0.32851917, 3.50575, 3.7639909, -0.8274512, 1.2718699, + 0.7064032, 1.7913067, -1.4024514, -0.49303484, 0.8707912, -0.23823786, + 0.41937304, 1.443722, -0.396856, 0.56620187, 1.0339032, -0.12736642, + 1.7406936, 4.309397, -0.18755847, -0.46101326, 0.020362198, 0.3217622, + 0.7620988, 1.9022003, 1.2856812, 0.3369981, -1.149087, 0.5562107, + -0.31068176, 0.4914955, -0.49307993, 0.34580433, 5.2527924, 4.527175, + -0.029956281, -0.35984623, 1.0824606, -0.360453, 0.19873115, -0.3701315, + 0.53464556, 0.8481753, 1.4529572, 1.012228, -1.037719, -0.6553353, + -0.16041204, -0.03164065, 3.2281785, 4.5399303, 0.3643899, 0.30424678, + -0.7776585, -0.3015166, -0.61336106, -0.7931169, 0.5940609, -0.29862595, + -0.02879478, 0.6273444, -1.6805825, -0.17713517, 1.0924593, 0.1301811, + 4.4416904, 3.7987688, -1.3668841, -0.81391287, 0.64007276, 1.0288135, + -0.57070565, -0.52160406, 1.58955, 1.0018709, -0.123293996, 1.390446, + -0.5843305, 1.5380195, 0.44350854, -0.26895642, 4.125044, 3.443525, + 0.7636179, 0.10296479, 0.52696383, 0.08359367, 0.6142223, -1.2670981, + 0.3708297, -0.6262324, 0.339195, -0.5216981, -0.34774148, -0.30716318, + 1.0757314, 0.4062716, 4.1163635, 5.389367, -0.1369414, 0.3118773, + -0.48302984, 0.07917905, 1.6785579, -0.9954241, -0.09528947, -1.517424, + 0.85461855, 0.18921553, -0.62187576, -1.1891136, 0.12719542, -0.558237, + 4.492761, 3.6913419, -0.29317212, -1.2950531, -0.03654802, 0.91552365, + 0.123229444, 0.514639, 1.0583864, 0.5574026, -0.13546133, 0.9680127, + 0.87852824, 2.559589, -0.3771388, -0.043456703, 4.574666, 4.013397, + -0.06427416, -1.2290373, 0.11051571, -1.2182673, 0.05659631, 0.77380556, + 0.65739393, 0.7978984, -0.19493088, 0.9715779, 0.1553396, 1.2139899, + 0.79071796, -0.57862896, 3.361268, 4.236172, -0.13507411, 0.6842204, + -1.1744223, -0.62078804, 2.008315, -1.2499349, 0.62419355, -0.091858864, + -0.5990913, -0.90177983, -0.55390406, 0.40287262, -0.94808567, -1.2203228, + 3.745199, 4.248646, 0.63732016, -0.82302505, -1.9267471, 0.58008444, + -0.38652933, -0.9787377, -0.1378448, -0.4994706, -0.24433172, 0.09051508, + 0.3651026, 0.010821462, 0.9935576, -0.69421434, 4.5576744, 3.50811, + 1.745633, 0.16605312, -1.8684177, -0.33893645, -0.17866233, 0.5833766, + 0.2571981, 0.38861072, -0.5767294, 0.61207676, 0.43722266, -0.28951776, + 0.78772557, 0.26002276, 3.9901466, 2.82238, -1.4889656, -0.1150527, + 0.47323376, 0.07621753, 0.16292411, 0.17989358, -0.30915606, 0.50516117, + -0.38916004, 1.9493489, 0.72058266, -0.067055345, -1.4097221, 0.26290974}; + +static const std::vector expected_dft2d_results_1 = { + 25.880518, 25.61235, -2.4660468, -1.9953613, 1.409625, -2.473969, + 1.0969357, 0.34850854, 1.5074215, -0.546504, -0.44522142, 1.482357, + -4.297778, -0.41876173, 2.5581412, 1.6702101, -0.79171646, 0.87513673, + -0.5556948, -1.4017968, 1.6127079, 3.341402, -2.2336023, 0.7553977, + 0.8801464, -1.5552741, 2.8809369, -0.12944597, -0.08941656, -2.4948978, + 1.1106122, -0.5771601, 1.5280423, -3.6573076, -1.325342, -0.75811887, + -4.0773964, 0.41215408, 0.24999249, 0.3498589, -0.31276864, -2.3484, + -0.4591713, -0.04454562, -0.7590859, 2.5111904, 3.1611128, -0.09711918, + -0.8617741, -3.8058863, -0.0812951, 1.1779473, 2.0081396, -3.9112964, + -0.6841551, 0.82309175, -0.2995335, -3.7176208, -0.43554613, -2.4067037, + -0.81405425, 2.0213914, 2.6072812, 4.772808, 2.3986423, -1.6369095, + 3.009512, -2.2388682, 0.08045465, -2.0042, 3.2657382, -0.93855727, + 1.3121321, 2.0163581, 1.3805538, 1.8802332, 0.20659024, 3.5175233, + 2.7225797, -1.7004844, 1.4864945, 0.6589138, -1.221076, 0.8748032, + 1.1129706, -2.4330344, 0.43821555, -4.865236, 2.2404962, -0.81013864, + 1.3837745, 0.13940874, 0.16934663, -2.240356, -0.46793693, 2.7093167, + 27.21336, 25.973133, -3.4792416, -1.1907393, -1.358995, 0.70610523, + -0.63712704, -0.22086221, 3.7741385, 1.4088898, 3.1050003, -1.2238663, + -0.45265055, 2.6596098, -0.053786665, 0.12850314, 1.7713342, -0.92604506, + -1.5456572, 0.4535787, -0.4252041, -0.20687354, -0.26421398, -1.5723603, + 0.21247786, -0.19034994, 0.116511285, 3.5963366, -0.9552689, 1.4078308, + 0.17855054, -1.2697299, 0.24928832, -1.3436013, -1.018871, -1.1798176, + -2.4574528, 0.14592099, -0.7871367, -1.3267987, 1.6891341, 0.8528522, + -2.194655, -0.7497572, 0.66770875, 1.4708114, 2.0073843, 0.8376069, + 1.7636304, 2.1868649, -0.65098536, -0.6707011, -3.8038197, -1.9890289, + -0.15012956, 0.7975005, -1.9746995, -0.11563957, 2.8636346, -1.2238576, + -1.1479954, 0.40726233, -6.6071806, -1.2827955, 0.335096, -0.8774332, + 0.5047921, -1.7173706, -0.6906272, -2.8883119, -1.7264752, -0.91851616, + -0.8023921, 2.1811929, 4.4178715, -1.0245608, 1.4208769, 3.714005, + 2.626697, -3.0808997, -2.2393522, 3.0984519, 2.0667777, 4.0557647, + 3.22371, 4.1895566, -5.1335697, 5.5083103, 1.4301378, -0.47711706, + 0.29209352, 0.19667566, 0.9300822, 1.4966636, -2.8442304, -1.1616251, + 22.90476, 26.008162, -0.59333247, -0.9156835, 1.009171, 0.85137844, + 2.0695426, -2.0451744, 4.279478, -0.2552395, 1.3455946, 3.2537463, + -4.582932, -0.29923248, 2.0854027, 0.023423433, -1.4901955, 1.2697036, + 0.12445855, 0.37839913, -0.90889513, -0.96464497, 3.2230172, 5.11582, + 1.7657483, -1.2759314, 1.6806445, -0.48582482, 1.0328861, -0.21219438, + -1.8203479, 0.28618455, -3.8749995, -2.6027172, -2.7910428, -1.8929406, + 0.43884945, -0.8854169, -0.6166424, 3.3119302, 3.9380612, 1.783706, + -2.8637185, 0.45624626, 1.298605, 2.399745, -0.42191154, 0.3671223, + -4.7169294, -1.4224572, 2.4742305, 0.80807984, -1.4698355, -0.64370054, + -0.54362357, 1.729145, 0.2216661, -0.920482, -3.022968, -1.9300321, + -0.09508008, 0.31362647, 1.264819, 1.741091, -0.48260987, 0.91905135, + -1.2789521, -1.0161536, 0.53328425, 4.0857644, -0.8787215, 2.8750324, + 0.4081546, 2.4881384, -2.2990177, 2.1299765, 0.59928864, 3.988031, + -1.8122058, -0.16000175, -1.8958641, 1.6846397, 0.9392875, -0.12778088, + 0.51960033, -0.5128077, 1.3190198, 0.42644808, -2.8990207, 0.20179635, + -1.7350545, -0.08684918, -0.11685985, -3.241004, -2.2542362, -0.18299285, + 24.721714, 22.520046, 0.40146637, -2.611894, -4.422385, -0.6061659, + 1.7858734, -0.17695832, 2.1501722, 1.6577435, -2.1397042, 3.6897519, + 2.0028722, 3.830699, -0.16294527, -2.0136907, 2.7324684, -0.48164713, + -3.0283842, -1.1742884, 2.3383465, -0.04261756, -1.3686588, 0.50161046, + 0.76707345, 0.40514386, -1.7530769, 2.333971, 2.7187724, 4.413412, + -3.610829, 0.57066756, 0.3970142, -0.89236856, -1.0979964, -4.7337284, + -1.6107149, 3.461636, 0.8141506, 1.3783914, 0.97534364, -1.261203, + 0.9644269, -0.4446571, 1.3737998, 1.5714393, 1.5593243, -3.5085554, + 0.10169166, 0.3512014, 2.2333064, 1.7223357, -1.7363904, 0.5177647, + 2.1198907, -0.12688133, 1.7293842, 0.05056551, -0.4828595, -2.333132, + -0.4791782, 1.5151871, -0.91205263, 0.0061766207, -0.4048485, 2.1922839, + 1.728973, 0.9913887, 0.14321594, 1.6313545, -3.389923, -2.5937288, + -0.36389086, -0.2227447, 0.03589952, -0.069511056, 0.3542207, 2.3090918, + 0.45287704, 3.309232, -0.59147376, -1.541465, -1.9963981, -1.9641305, + 5.0686407, 0.53117156, 0.77804404, 4.1053996, 1.0922346, 2.7149107, + 2.5625482, 2.6316533, -0.69931746, 1.7177012, 0.4107918, 1.375428787}; + +static const std::vector expected_dft3d_results_1 = { + 100.72035, 100.11369, -6.1371527, -6.7136793, -3.3625832, -1.5226498, + 4.315223, -2.0944858, 11.711212, 2.2648964, 1.8656702, 7.201989, + -7.3304863, 5.772318, 4.4268136, -0.1915536, 2.2218904, 0.7371478, + -5.005279, -1.7441093, 2.6169558, 2.1272666, -0.64345765, 4.800469, + 3.6254454, -2.6164103, 2.9250154, 5.315038, 2.706975, 3.1141493, + -4.1420155, -0.99003804, -1.7006547, -8.495995, -6.2332516, -8.564608, + -7.7067156, 3.134292, -0.33963704, 3.7133825, 6.2897673, -0.9730439, + -4.5531178, -0.7827141, 2.581028, 7.953187, 6.305909, -2.4009464, + -3.7133813, -2.690277, 3.9752584, 3.0376637, -5.0019054, -6.0262628, + 0.7419828, 3.2228546, -0.32318294, -4.7031775, -1.0777391, -7.8937283, + -2.5363095, 4.257466, -3.6471338, 5.237282, 1.8462799, 0.5969913, + 3.9643247, -3.981004, 0.0663265, 0.82460785, -2.7293837, -1.5757694, + 0.55400586, 6.462948, 3.5353048, 2.9161394, 2.580977, 13.528652, + 3.98995, -1.632153, -3.240194, 3.900541, -0.21140909, 2.8386583, + 9.924921, 1.7748868, -2.5982907, 5.174925, 1.8638494, 1.6294506, + 2.5033612, 2.8808913, 0.2832532, -2.2669961, -5.155612, 2.7401254, + 6.428844, -2.8874602, -0.45156026, 2.8010314, 1.7127267, -6.3887377, + -1.0165125, 4.816684, -3.0209088, -1.9152341, -6.7044344, -7.0160933, + -0.8859364, 2.3359919, 2.614932, 1.5376289, 0.2540813, 0.56656873, + 0.947714, -3.2629232, 2.3573487, 7.069599, -7.53059, -5.4648676, + -1.4810953, 0.27525342, 2.4626575, -1.5132098, -4.127886, 1.3913381, + 1.090563, -4.6527243, 4.9518104, -0.906865, 5.0196123, 1.055696, + -7.831962, 2.144308, -1.838556, -1.3607846, -2.1367745, -4.8458967, + 2.0994475, 2.6582882, -2.158319, 0.8175374, 7.929186, -0.9123031, + 5.690818, -4.0453672, -4.948562, 3.2541595, 0.9711809, -1.2001665, + 0.78384995, 1.3639677, -0.6874037, 0.9069457, 3.6966968, -3.823165, + -1.826899, 2.3765814, 0.0534904, 8.726845, -0.18846548, -3.2959056, + 1.5797036, 0.0014669895, -4.9724956, -5.2561207, 5.819672, -5.477039, + 3.3079143, -0.033277154, 2.7245224, -4.631716, 1.0122153, -1.5371637, + -1.8553452, -3.7143025, 8.022276, 0.62215286, 3.8595328, -3.060592, + 4.2517557, -0.075296044, 0.5221062, 0.6199312, 1.9474881, -1.3498385, + 0.6838516, 2.4967105, 0.06516862, -0.6287519, -0.7507546, 6.147333, + -3.149796, 3.1273334, 0.018394649, 0.8915896, 8.200176, -1.7225304, + 2.0177326, -1.2988436, -0.13740933, -3.868376, -0.06492156, 2.2702193, + -10.430931, -7.2083035, 4.860276, 3.578821, -6.7857146, 3.5525331, + 4.142806, -0.3026886, -1.20933, 2.6262493, 2.6222875, 6.941968, + 1.6663432, -3.0459986, 6.198147, -6.5455766, -0.8200346, -8.528335, + 2.722542, 0.4080863, -2.993259, -4.024056, -1.999518, 3.2624865, + 0.42962015, -4.08082, -0.39366418, 3.6101956, 0.9608154, -0.15634394, + -2.0926623, 1.6061159, -1.5019901, 1.8686844, -0.8275065, 2.9409513, + -7.4440265, -7.7664104, 0.8106141, 0.9343933, 6.078513, -3.0837321, + -3.1975398, 1.8816166, 0.16744804, -4.573029, -5.839288, -0.7797469, + 0.71803975, 0.41256714, 11.391333, 7.790516, 1.9857845, -2.0327086, + -0.5032053, -2.5290394, 1.16115, 3.3385215, 7.5034156, 5.4487205, + 2.886569, 2.5460477, -5.3722363, 5.1042805, -0.9692185, 1.4824567, + -2.1692014, -2.0888186, 2.4214573, 0.78656745, -0.3521694, -1.3446121, + -6.659781, -7.66657, 6.1127615, -14.052498, -3.1808968, -2.8461368, + -3.2059226, -2.7757711, -0.17827892, -8.695724, -0.2887354, 2.312519, + -0.4773283, 2.095835, -3.293869, -4.960386, -0.9118179, -0.2619573, + -0.92870337, -0.029317379, -2.5232022, 1.3327014, 3.1228013, 3.4733155, + 1.4562413, -2.5750513, -1.6694541, 1.7559463, 1.142877, -1.3557005, + -2.30802, -0.29746848, 2.6858592, 1.5424967, -3.3826494, -3.2559767, + -0.2901088, -0.83393717, -0.06207335, 2.225967, 1.8832793, -5.9567456, + 4.7713566, 2.9260354, 5.854274, -1.2023156, -2.0882115, 1.2139479, + -1.2005312, 0.4508332, 3.571826, -4.5633574, -6.3648844, -3.4183156, + 2.7096481, -3.659875, -1.957063, -0.5946456, -0.76313734, -0.016180754, + 2.0194921, -0.72149086, -0.16249031, -2.5144238, 5.9847684, -5.335026, + -1.0649127, -3.176074, -0.3549943, -6.501223, 1.4781482, 2.8698225, + 0.3889513, 1.0389466, 2.6314335, -2.6634102, 5.950971, -1.8160157, + 6.9972243, -2.4468954, 4.066836, -6.923808, 2.4692469, -2.1501422, + -1.4999585, -0.91028214, 4.634622, 4.132228, -1.7976125, 0.59614825, + 10.924917, 0.63333595, -1.2575581, -2.6736045, -8.180259, 5.0657587, + -3.065015, -3.7651565, -2.2837136, -11.203299, 8.331546, -0.6740327, + 5.5538063, -2.0441968, 0.5072439, 2.630047, 4.323353, -0.3627143}; + +NGRAPH_TEST(${BACKEND_NAME}, dft1d_eval) +{ + auto data = std::make_shared(element::f32, Shape{2, 10, 10, 2}); + auto axes_input = op::Constant::create(element::i64, Shape{1}, {2}); + auto dft = std::make_shared(data, axes_input); + + auto f = make_shared(dft, ParameterVector{data}); + + auto backend = runtime::Backend::create("${BACKEND_NAME}"); + auto dft_output = backend->create_tensor(element::f32, Shape{2, 10, 10, 2}); + + auto backend_data = backend->create_tensor(element::f32, Shape{2, 10, 10, 2}); + copy_data(backend_data, input_data); + + auto handle = backend->compile(f); + + handle->call({dft_output}, {backend_data}); + + auto result = read_vector(dft_output); + size_t num_of_elems = result.size(); + for (std::size_t j = 0; j < num_of_elems; ++j) + { + EXPECT_NEAR(result[j], expected_dft1d_results[j], 0.00001); + } +} + +NGRAPH_TEST(${BACKEND_NAME}, dft1d_eval_1) +{ + auto data = std::make_shared(element::f32, Shape{4, 6, 8, 2}); + auto axes_input = op::Constant::create(element::i64, Shape{1}, {2}); + auto dft = std::make_shared(data, axes_input); + + auto f = make_shared(dft, ParameterVector{data}); + + auto backend = runtime::Backend::create("${BACKEND_NAME}"); + auto dft_output = backend->create_tensor(element::f32, Shape{4, 6, 8, 2}); + + auto backend_data = backend->create_tensor(element::f32, Shape{4, 6, 8, 2}); + copy_data(backend_data, input_data_1); + + auto handle = backend->compile(f); + + handle->call({dft_output}, {backend_data}); + + auto result = read_vector(dft_output); + size_t num_of_elems = result.size(); + for (std::size_t j = 0; j < num_of_elems; ++j) + { + EXPECT_NEAR(result[j], expected_dft1d_results_1[j], 0.00001); + } +} + +NGRAPH_TEST(${BACKEND_NAME}, dft1d_eval_float16) +{ + auto data = std::make_shared(element::f16, Shape{2, 10, 10, 2}); + auto axes_input = op::Constant::create(element::i64, Shape{1}, {2}); + auto dft = std::make_shared(data, axes_input); + + auto f = make_shared(dft, ParameterVector{data}); + + auto backend = runtime::Backend::create("${BACKEND_NAME}"); + auto dft_output = backend->create_tensor(element::f16, Shape{2, 10, 10, 2}); + + auto backend_data = backend->create_tensor(element::f16, Shape{2, 10, 10, 2}); + copy_data(backend_data, from_float_vector(input_data)); + + auto handle = backend->compile(f); + + handle->call({dft_output}, {backend_data}); + + auto result = to_float_vector(read_vector(dft_output)); + size_t num_of_elems = result.size(); + for (std::size_t j = 0; j < num_of_elems; ++j) + { + EXPECT_NEAR(result[j], expected_dft1d_float16_results[j], 0.00001); + } +} + +NGRAPH_TEST(${BACKEND_NAME}, dft1d_eval_bfloat16) +{ + auto data = std::make_shared(element::bf16, Shape{2, 10, 10, 2}); + auto axes_input = op::Constant::create(element::i64, Shape{1}, {2}); + auto dft = std::make_shared(data, axes_input); + + auto f = make_shared(dft, ParameterVector{data}); + + auto backend = runtime::Backend::create("${BACKEND_NAME}"); + auto dft_output = backend->create_tensor(element::bf16, Shape{2, 10, 10, 2}); + + auto backend_data = backend->create_tensor(element::bf16, Shape{2, 10, 10, 2}); + copy_data(backend_data, bfloat16::from_float_vector(input_data)); + + auto handle = backend->compile(f); + + handle->call({dft_output}, {backend_data}); + + auto result = bfloat16::to_float_vector(read_vector(dft_output)); + size_t num_of_elems = result.size(); + for (std::size_t j = 0; j < num_of_elems; ++j) + { + EXPECT_NEAR(result[j], expected_dft1d_bfloat16_results[j], 0.00001); + } +} + +NGRAPH_TEST(${BACKEND_NAME}, dft1d_signal_size_eval) +{ + auto data = std::make_shared(element::f32, Shape{2, 10, 10, 2}); + auto axes_input = op::Constant::create(element::i64, Shape{1}, {-2}); + auto signal_size_input = op::Constant::create(element::i64, Shape{1}, {20}); + auto dft = std::make_shared(data, axes_input, signal_size_input); + + auto f = make_shared(dft, ParameterVector{data}); + + auto backend = runtime::Backend::create("${BACKEND_NAME}"); + auto dft_output = backend->create_tensor(element::f32, Shape{2, 20, 10, 2}); + + auto backend_data = backend->create_tensor(element::f32, Shape{2, 10, 10, 2}); + copy_data(backend_data, input_data); + + auto handle = backend->compile(f); + + handle->call({dft_output}, {backend_data}); + + auto result = read_vector(dft_output); + size_t num_of_elems = result.size(); + for (std::size_t j = 0; j < num_of_elems; ++j) + { + EXPECT_NEAR(result[j], expected_dft1d_signal_size_results[j], 0.00001); + } +} + +NGRAPH_TEST(${BACKEND_NAME}, dft1d_eval_i32) +{ + auto data = std::make_shared(element::f32, Shape{2, 10, 10, 2}); + auto axes_input = op::Constant::create(element::i32, Shape{1}, {2}); + auto dft = std::make_shared(data, axes_input); + + auto f = make_shared(dft, ParameterVector{data}); + + auto backend = runtime::Backend::create("${BACKEND_NAME}"); + auto dft_output = backend->create_tensor(element::f32, Shape{2, 10, 10, 2}); + + auto backend_data = backend->create_tensor(element::f32, Shape{2, 10, 10, 2}); + copy_data(backend_data, input_data); + + auto handle = backend->compile(f); + + handle->call({dft_output}, {backend_data}); + + auto result = read_vector(dft_output); + size_t num_of_elems = result.size(); + for (std::size_t j = 0; j < num_of_elems; ++j) + { + EXPECT_NEAR(result[j], expected_dft1d_results[j], 0.00001); + } +} + +NGRAPH_TEST(${BACKEND_NAME}, dft2d_eval_1) +{ + auto data = std::make_shared(element::f32, Shape{4, 6, 8, 2}); + auto axes_input = op::Constant::create(element::i64, Shape{2}, {1, 2}); + auto dft = std::make_shared(data, axes_input); + + auto f = make_shared(dft, ParameterVector{data}); + + auto backend = runtime::Backend::create("${BACKEND_NAME}"); + auto dft_output = backend->create_tensor(element::f32, Shape{4, 6, 8, 2}); + + auto backend_data = backend->create_tensor(element::f32, Shape{4, 6, 8, 2}); + copy_data(backend_data, input_data_1); + + auto handle = backend->compile(f); + + handle->call({dft_output}, {backend_data}); + + auto result = read_vector(dft_output); + size_t num_of_elems = result.size(); + for (std::size_t j = 0; j < num_of_elems; ++j) + { + EXPECT_NEAR(result[j], expected_dft2d_results_1[j], 0.000062); + } +} + +NGRAPH_TEST(${BACKEND_NAME}, dft2d_eval) +{ + auto data = std::make_shared(element::f32, Shape{2, 10, 10, 2}); + auto axes_input = op::Constant::create(element::i64, Shape{2}, {1, 2}); + auto dft = std::make_shared(data, axes_input); + + auto f = make_shared(dft, ParameterVector{data}); + + auto backend = runtime::Backend::create("${BACKEND_NAME}"); + auto dft_output = backend->create_tensor(element::f32, Shape{2, 10, 10, 2}); + + auto backend_data = backend->create_tensor(element::f32, Shape{2, 10, 10, 2}); + copy_data(backend_data, input_data); + + auto handle = backend->compile(f); + + handle->call({dft_output}, {backend_data}); + + auto result = read_vector(dft_output); + size_t num_of_elems = result.size(); + for (std::size_t j = 0; j < num_of_elems; ++j) + { + EXPECT_NEAR(result[j], expected_dft2d_results[j], 0.000062); + } +} + +NGRAPH_TEST(${BACKEND_NAME}, dft2d_eval_float16) +{ + auto data = std::make_shared(element::f16, Shape{2, 10, 10, 2}); + auto axes_input = op::Constant::create(element::i64, Shape{2}, {1, 2}); + auto dft = std::make_shared(data, axes_input); + + auto f = make_shared(dft, ParameterVector{data}); + + auto backend = runtime::Backend::create("${BACKEND_NAME}"); + auto dft_output = backend->create_tensor(element::f16, Shape{2, 10, 10, 2}); + + auto backend_data = backend->create_tensor(element::f16, Shape{2, 10, 10, 2}); + copy_data(backend_data, from_float_vector(input_data)); + + auto handle = backend->compile(f); + + handle->call({dft_output}, {backend_data}); + + auto result = to_float_vector(read_vector(dft_output)); + size_t num_of_elems = result.size(); + for (std::size_t j = 0; j < num_of_elems; ++j) + { + EXPECT_NEAR(result[j], expected_dft2d_float16_results[j], 0.002); + } +} + +NGRAPH_TEST(${BACKEND_NAME}, dft2d_eval_bfloat16) +{ + auto data = std::make_shared(element::bf16, Shape{2, 10, 10, 2}); + auto axes_input = op::Constant::create(element::i64, Shape{2}, {1, 2}); + auto dft = std::make_shared(data, axes_input); + + auto f = make_shared(dft, ParameterVector{data}); + + auto backend = runtime::Backend::create("${BACKEND_NAME}"); + auto dft_output = backend->create_tensor(element::bf16, Shape{2, 10, 10, 2}); + + auto backend_data = backend->create_tensor(element::bf16, Shape{2, 10, 10, 2}); + copy_data(backend_data, bfloat16::from_float_vector(input_data)); + + auto handle = backend->compile(f); + + handle->call({dft_output}, {backend_data}); + + auto result = bfloat16::to_float_vector(read_vector(dft_output)); + size_t num_of_elems = result.size(); + for (std::size_t j = 0; j < num_of_elems; ++j) + { + EXPECT_NEAR(result[j], expected_dft2d_bfloat16_results[j], 0.0003); + } +} + +NGRAPH_TEST(${BACKEND_NAME}, dft2d_eval_i32) +{ + auto data = std::make_shared(element::f32, Shape{2, 10, 10, 2}); + auto axes_input = op::Constant::create(element::i32, Shape{2}, {1, 2}); + auto dft = std::make_shared(data, axes_input); + + auto f = make_shared(dft, ParameterVector{data}); + + auto backend = runtime::Backend::create("${BACKEND_NAME}"); + auto dft_output = backend->create_tensor(element::f32, Shape{2, 10, 10, 2}); + + auto backend_data = backend->create_tensor(element::f32, Shape{2, 10, 10, 2}); + copy_data(backend_data, input_data); + + auto handle = backend->compile(f); + + handle->call({dft_output}, {backend_data}); + + auto result = read_vector(dft_output); + size_t num_of_elems = result.size(); + for (std::size_t j = 0; j < num_of_elems; ++j) + { + EXPECT_NEAR(result[j], expected_dft2d_results[j], 0.000062); + } +} + +NGRAPH_TEST(${BACKEND_NAME}, dft3d_eval_1) +{ + auto data = std::make_shared(element::f32, Shape{4, 6, 8, 2}); + auto axes_input = op::Constant::create(element::i64, Shape{3}, {0, 1, 2}); + auto dft = std::make_shared(data, axes_input); + + auto f = make_shared(dft, ParameterVector{data}); + + auto backend = runtime::Backend::create("${BACKEND_NAME}"); + auto dft_output = backend->create_tensor(element::f32, Shape{4, 6, 8, 2}); + + auto backend_data = backend->create_tensor(element::f32, Shape{4, 6, 8, 2}); + copy_data(backend_data, input_data_1); + + auto handle = backend->compile(f); + + handle->call({dft_output}, {backend_data}); + + auto result = read_vector(dft_output); + size_t num_of_elems = result.size(); + for (std::size_t j = 0; j < num_of_elems; ++j) + { + EXPECT_NEAR(result[j], expected_dft3d_results_1[j], 0.0002); + } +} + +NGRAPH_TEST(${BACKEND_NAME}, dft3d_eval) +{ + auto data = std::make_shared(element::f32, Shape{2, 10, 10, 2}); + auto axes_input = op::Constant::create(element::i64, Shape{3}, {0, 1, 2}); + auto dft = std::make_shared(data, axes_input); + + auto f = make_shared(dft, ParameterVector{data}); + + auto backend = runtime::Backend::create("${BACKEND_NAME}"); + auto dft_output = backend->create_tensor(element::f32, Shape{2, 10, 10, 2}); + + auto backend_data = backend->create_tensor(element::f32, Shape{2, 10, 10, 2}); + copy_data(backend_data, input_data); + + auto handle = backend->compile(f); + + handle->call({dft_output}, {backend_data}); + + auto result = read_vector(dft_output); + size_t num_of_elems = result.size(); + for (std::size_t j = 0; j < num_of_elems; ++j) + { + EXPECT_NEAR(result[j], expected_dft3d_results[j], 0.0002); + } +} + +NGRAPH_TEST(${BACKEND_NAME}, dft3d_eval_float16) +{ + auto data = std::make_shared(element::f16, Shape{2, 10, 10, 2}); + auto axes_input = op::Constant::create(element::i64, Shape{3}, {0, 1, 2}); + auto dft = std::make_shared(data, axes_input); + + auto f = make_shared(dft, ParameterVector{data}); + + auto backend = runtime::Backend::create("${BACKEND_NAME}"); + auto dft_output = backend->create_tensor(element::f16, Shape{2, 10, 10, 2}); + + auto backend_data = backend->create_tensor(element::f16, Shape{2, 10, 10, 2}); + copy_data(backend_data, from_float_vector(input_data)); + + auto handle = backend->compile(f); + + handle->call({dft_output}, {backend_data}); + + auto result = to_float_vector(read_vector(dft_output)); + size_t num_of_elems = result.size(); + for (std::size_t j = 0; j < num_of_elems; ++j) + { + EXPECT_NEAR(result[j], expected_dft3d_float16_results[j], 0.0005); + } +} + +NGRAPH_TEST(${BACKEND_NAME}, dft3d_eval_bfloat16) +{ + auto data = std::make_shared(element::bf16, Shape{2, 10, 10, 2}); + auto axes_input = op::Constant::create(element::i64, Shape{3}, {0, 1, 2}); + auto dft = std::make_shared(data, axes_input); + + auto f = make_shared(dft, ParameterVector{data}); + + auto backend = runtime::Backend::create("${BACKEND_NAME}"); + auto dft_output = backend->create_tensor(element::bf16, Shape{2, 10, 10, 2}); + + auto backend_data = backend->create_tensor(element::bf16, Shape{2, 10, 10, 2}); + copy_data(backend_data, bfloat16::from_float_vector(input_data)); + + auto handle = backend->compile(f); + + handle->call({dft_output}, {backend_data}); + + auto result = bfloat16::to_float_vector(read_vector(dft_output)); + size_t num_of_elems = result.size(); + for (std::size_t j = 0; j < num_of_elems; ++j) + { + EXPECT_NEAR(result[j], expected_dft3d_bfloat16_results[j], 0.00001); + } +} + +NGRAPH_TEST(${BACKEND_NAME}, dft3d_eval_i32) +{ + auto data = std::make_shared(element::f32, Shape{2, 10, 10, 2}); + auto axes_input = op::Constant::create(element::i32, Shape{3}, {0, 1, 2}); + auto dft = std::make_shared(data, axes_input); + + auto f = make_shared(dft, ParameterVector{data}); + + auto backend = runtime::Backend::create("${BACKEND_NAME}"); + auto dft_output = backend->create_tensor(element::f32, Shape{2, 10, 10, 2}); + + auto backend_data = backend->create_tensor(element::f32, Shape{2, 10, 10, 2}); + copy_data(backend_data, input_data); + + auto handle = backend->compile(f); + + handle->call({dft_output}, {backend_data}); + + auto result = read_vector(dft_output); + size_t num_of_elems = result.size(); + for (std::size_t j = 0; j < num_of_elems; ++j) + { + EXPECT_NEAR(result[j], expected_dft3d_results[j], 0.0002); + } +} diff --git a/ngraph/test/backend/idft.in.cpp b/ngraph/test/backend/idft.in.cpp new file mode 100644 index 00000000000000..7cfa4f331814c8 --- /dev/null +++ b/ngraph/test/backend/idft.in.cpp @@ -0,0 +1,1272 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "gtest/gtest.h" +#include "ngraph/ngraph.hpp" +#include "ngraph/runtime/tensor.hpp" +#include "ngraph/type/bfloat16.hpp" +#include "ngraph/type/float16.hpp" +#include "runtime/backend.hpp" +#include "util/all_close.hpp" +#include "util/all_close_f.hpp" +#include "util/engine/test_engines.hpp" +#include "util/known_element_types.hpp" +#include "util/ndarray.hpp" +#include "util/test_case.hpp" +#include "util/test_control.hpp" +#include "util/test_tools.hpp" + +using namespace std; +using namespace ngraph; + +static string s_manifest = "${MANIFEST}"; + +using TestEngine = test::ENGINE_CLASS_NAME(${BACKEND_NAME}); + +static std::vector from_float_vector(const std::vector& v_f32) +{ + if (v_f32.empty()) + { + return std::vector(); + } + + size_t num_of_elems = v_f32.size(); + std::vector v_f16(num_of_elems); + for (size_t i = 0; i < num_of_elems; ++i) + { + v_f16[i] = float16(v_f32[i]); + } + return v_f16; +} + +static std::vector to_float_vector(const std::vector& v_f16) +{ + if (v_f16.empty()) + { + return std::vector(); + } + + size_t num_of_elems = v_f16.size(); + std::vector v_f32(num_of_elems); + for (size_t i = 0; i < num_of_elems; ++i) + { + v_f32[i] = float(v_f16[i]); + } + return v_f32; +} + +static const std::vector expected_result = { + 0.85943836, 0.009941814, 0.004292889, 0.54598427, 0.8270831, 0.49770153, 0.9035636, + 0.19274887, 0.8589833, 0.88759327, 0.72343576, 0.057539318, 0.915801, 0.63455844, + 0.25069925, 0.045601673, 0.29793364, 0.8492151, 0.6885839, 0.57419384, 0.009737609, + 0.68192583, 0.7614807, 0.37603703, 0.51804876, 0.033039097, 0.63702065, 0.78960556, + 0.5007368, 0.7248742, 0.2040932, 0.1211606, 0.76035476, 0.44004318, 0.95635134, + 0.82913375, 0.225465, 0.009166263, 0.05445403, 0.5885675, 0.87822133, 0.14324947, + 0.68606305, 0.3274419, 0.9169595, 0.732179, 0.04614906, 0.03505424, 0.84526163, + 0.9972937, 0.89781004, 0.9987864, 0.24641308, 0.34678686, 0.22731997, 0.95805293, + 0.595993, 0.8537836, 0.9174756, 0.17441267, 0.86681056, 0.15913424, 0.6638066, + 0.522398, 0.51548326, 0.024979044, 0.1731268, 0.068090245, 0.6125645, 0.4865482, + 0.2873719, 0.35936728, 0.64452374, 0.27963468, 0.59981745, 0.6309508, 0.507604, + 0.23389837, 0.77500635, 0.4462004, 0.53165394, 0.6535075, 0.4306448, 0.21468966, + 0.6925882, 0.11183031, 0.25347117, 0.2209481, 0.8060583, 0.34712377, 0.78980505, + 0.16110454, 0.6376819, 0.78736854, 0.909368, 0.6915289, 0.24747796, 0.32442623, + 0.22714981, 0.23976989, 0.25199527, 0.28412706, 0.32461873, 0.51917267, 0.8394496, + 0.6324911, 0.28498915, 0.8887276, 0.90213394, 0.16050571, 0.32190812, 0.67677563, + 0.8594967, 0.28917953, 0.1931407, 0.8282108, 0.14881423, 0.18073067, 0.8490643, + 0.2356146, 0.86200285, 0.57409924, 0.94718546, 0.092213534, 0.34502912, 0.4719212, + 0.60031396, 0.22602181, 0.3067876, 0.49529344, 0.11133887, 0.47633907, 0.13236542, + 0.69677263, 0.8490109, 0.6685073, 0.24199674, 0.7983137, 0.37593383, 0.74520975, + 0.16743147, 0.84144354, 0.93073046, 0.55940866, 0.67484015, 0.077098235, 0.69045097, + 0.06949082, 0.6804774, 0.79804176, 0.49027568, 0.8843709, 0.5665486, 0.91798306, + 0.47884017, 0.94707423, 0.98279756, 0.62054926, 0.8134105, 0.01336217, 0.78324115, + 0.9938295, 0.99227554, 0.66681916, 0.38842493, 0.3835454, 0.120395586, 0.5478275, + 0.13309076, 0.9468553, 0.24595714, 0.0057277656, 0.14570542, 0.31220108, 0.41687667, + 0.679465, 0.5731583, 0.7383743, 0.013198466, 0.34619793, 0.9278514, 0.48510832, + 0.46039802, 0.8171329, 0.5041023, 0.37600085, 0.124404594, 0.4201713, 0.7470036, + 0.7340853, 0.8449047, 0.137517, 0.14771219, 0.99655616, 0.2178388, 0.4121613, + 0.8655656, 0.32849622, 0.7574791, 0.95230037, 0.5806251, 0.9598742, 0.7183528, + 0.042957753, 0.2926446, 0.5882527, 0.05208914, 0.3216481, 0.5205192, 0.5095992, + 0.011508227, 0.5209922, 0.78207654, 0.34570032, 0.7968098, 0.4619513, 0.0047925604, + 0.029039407, 0.7673424, 0.571703, 0.44400942, 0.82529145, 0.29335254, 0.34418115, + 0.48119327, 0.38321403, 0.31083322, 0.7179562, 0.41055596, 0.06207573, 0.8747831, + 0.6018095, 0.4483476, 0.16189687, 0.8611539, 0.79723805, 0.42178747, 0.95597315, + 0.5534858, 0.33466807, 0.36827618, 0.60728735, 0.6582703, 0.6790265, 0.870856, + 0.8868432, 0.43860948, 0.32468447, 0.77624434, 0.3403061, 0.14144918, 0.23022941, + 0.07176102, 0.06941459, 0.37346482, 0.9120822, 0.65890974, 0.77746564, 0.4515671, + 0.45455948, 0.15909587, 0.8017096, 0.6259673, 0.6117355, 0.77020043, 0.08495594, + 0.30376136, 0.55266386, 0.8497134, 0.91790336, 0.86088765, 0.88179666, 0.9009849, + 0.97200614, 0.94119, 0.77911216, 0.8057816, 0.14040896, 0.66522235, 0.6649202, + 0.048396785, 0.75035393, 0.4520953, 0.9877601, 0.46115568, 0.2167145, 0.9271302, + 0.39395386, 0.68578094, 0.576275, 0.20754486, 0.5408786, 0.46040633, 0.18199016, + 0.66303253, 0.6288556, 0.14313427, 0.91675115, 0.36198065, 0.51337945, 0.84241706, + 0.22333568, 0.38011634, 0.024615016, 0.19370414, 0.23593484, 0.32207185, 0.47971123, + 0.6202779, 0.6944977, 0.43612957, 0.07961436, 0.57468814, 0.100025274, 0.42476946, + 0.95338464, 0.666547, 0.8683905, 0.52689695, 0.6284723, 0.85813546, 0.4865953, + 0.8269112, 0.08833949, 0.69269264, 0.41784903, 0.5969149, 0.07599888, 0.14184453, + 0.49042618, 0.44027725, 0.6256328, 0.2716237, 0.0999099, 0.09831784, 0.92469853, + 0.24196884, 0.9073526, 0.7523511, 0.7761173, 0.28489882, 0.96349007, 0.5884645, + 0.74933976, 0.06400105, 0.4376275, 0.34752035, 0.6006149, 0.034923803, 0.066874385, + 0.9790322, 0.5558188, 0.97579825, 0.025802653, 0.537738, 0.24921915, 0.111012295, + 0.85987717, 0.781183, 0.69588315, 0.94621634, 0.74946797, 0.6949375, 0.009165181, + 0.91075164, 0.72913235, 0.25934777, 0.19463088, 0.5283304, 0.9241759, 0.0563183, + 0.74323857, 0.43722472, 0.2958358, 0.85980684, 0.029655656, 0.362904, 0.19682994, + 0.37778872, 0.09406928, 0.23010127, 0.44393733, 0.420214, 0.39723217, 0.13777487, + 0.06385251, 0.9535715, 0.89861375, 0.2463547, 0.673834, 0.8008994, 0.0861585, + 0.6613363, 0.79498637, 0.79322547, 0.083214305, 0.577025, 0.58655965, 0.119723536, + 0.0012204717}; + +static const std::vector idft1d_input_data = { + 6.329814, 4.2950764, -0.8105316, -0.7187835, -0.059136264, 0.2709784, + 0.82793635, 0.57937646, 0.5997731, -1.3291739, 1.188664, 1.462941, + -0.01811248, -1.8314927, 0.16004556, -2.219835, 1.0620322, -1.0679832, + -0.68610185, 0.658314, 4.627743, 4.5935497, -0.78950775, -0.32600924, + -1.4706655, -1.1615934, 0.708719, 1.4568751, -1.0970218, -0.39268675, + -0.5990571, -0.81545514, -0.39174145, -0.420258, 0.55279106, 2.339339, + -0.59915966, 1.3964193, -0.8447231, 0.14907542, 6.2576666, 5.5670385, + 0.25636938, -1.7026355, 1.161571, 0.12042561, 0.19768336, -1.3421875, + -0.90698814, 1.4111948, 0.70803046, 0.5795436, 1.2021728, -0.5199567, + -2.558736, -0.80762154, 1.1657354, -0.8685272, 1.2987087, -1.0047817, + 5.6461143, 3.2111988, 0.2361581, 0.3099669, 0.6179653, 0.099535145, + 1.0438079, -0.016701937, -0.88529384, -0.12907594, 0.64785606, -0.8428119, + -0.058392793, -1.0488291, -0.4019828, 0.20333555, 0.45051938, 0.45967662, + 1.3713523, -0.6549525, 5.5258985, 3.7522945, -1.8860855, -0.2230255, + 0.8160669, -0.46607828, 0.123957604, 0.61024696, 0.26978388, 0.9723815, + 0.3050212, 0.69621503, 0.27244493, -1.0805726, 0.20593566, 1.5653824, + -0.27690098, 0.8950307, -0.039584313, -0.18680441, 4.975611, 4.6955333, + 0.19031112, -0.8860659, 0.91665065, -0.5264673, -0.4547393, 1.1623507, + -1.4774656, 1.671129, 1.028168, -1.6014669, -1.2178835, -0.13447604, + -0.14712845, -0.6739672, -0.3273949, -0.9012072, -0.9661755, 0.03590688, + 4.771964, 5.244689, -0.03415192, -0.37281254, -0.49070793, -0.65789306, + 0.8143984, -0.8913989, -0.19890547, 0.17876014, -0.9956009, 0.82810897, + 0.55270624, -0.023768127, 1.5358362, 0.6981953, 0.23165298, 0.51040155, + 2.4328363, 0.2267083, 6.4758024, 5.72882, -0.8707881, -1.110683, + 0.12478554, 1.3484334, 0.3689712, 0.29180524, -0.8149491, -0.0922713, + -0.33161288, 0.78140867, -0.9623072, 0.8999919, -2.1120539, 0.84492886, + -1.5347936, 0.7440938, 1.3312622, -1.0220959, 3.8123238, 5.62084, + 1.3551373, 0.6460793, -0.21639234, -1.2077228, 1.1639122, -0.05263084, + 0.48105645, -0.5892652, 0.2349168, 1.128768, 0.42568994, 0.36398163, + -1.2250046, 2.3513904, 0.64331245, 0.8099514, 1.1574583, 0.8668997, + 5.59726, 5.659527, 0.48095328, 0.59446967, 1.1849049, 1.4709316, + -1.2589264, -0.11577609, 0.6299068, -1.4621243, 0.7872094, 0.18096408, + 0.5553762, -2.0060503, -0.4373122, 0.9938256, 0.89633095, -0.5491595, + 0.8428093, 0.084472984, 4.52676, 4.351716, 0.73079205, 0.8098516, + 0.27877963, -0.0073297992, 0.36545974, 0.6745955, -2.3818088, 1.5816333, + -0.16544427, 0.51321346, -0.23699868, -0.13254744, 1.551896, 0.62098134, + 0.7739359, 1.6108581, 0.36288044, -0.42423314, 5.0995026, 5.1843014, + -1.1968713, 1.1790991, -0.018864498, -0.7500831, 0.0879575, 0.22010106, + 1.1136081, 2.2893274, -0.6877146, -0.40740123, 0.046427906, 0.8681825, + -0.50678635, 0.23051873, 0.35328788, -0.45622703, 0.1495475, -0.104907334, + 4.8094087, 5.2818966, 0.49697292, 0.29568392, -0.4144543, -0.64546454, + 0.31737912, -0.8962374, -1.0404948, 0.91764164, 0.6826862, 0.08073502, + 0.33942595, 0.053232975, -1.1867946, 0.51120156, -1.1452568, -1.4197243, + 0.82389224, 1.8939058, 6.882805, 6.4072084, -1.3024135, -0.22483894, + -0.22082287, 1.0370905, -0.7639439, 0.6950346, -0.731326, 0.16821115, + 0.0887468, -0.5732441, -0.40715322, -0.96244293, -0.89126545, 1.3140129, + -0.42358512, 1.7674587, -0.6400819, -1.6113993, 4.4106574, 5.706909, + -1.1110737, 0.10560027, -1.1108764, 0.34190884, 2.1167603, -0.067495525, + -0.16237324, 0.2604496, -0.8129095, -0.42274237, -1.1412699, -0.0011268258, + -0.63462454, -0.15172139, -0.7164279, 0.14801888, -0.3538928, 1.583736, + 4.9876184, 4.2879796, -0.8491325, 0.5345522, -0.60507995, -0.9020085, + 1.0447598, 0.21135187, -0.4787205, -0.3230412, 0.8076494, -0.04361339, + 0.62797767, 0.15487206, -0.23772183, 0.69546384, 1.8609382, -1.7030516, + 1.2658813, -0.6791475, 4.921037, 4.8929176, -0.0124401, -0.6873918, + -0.21879943, -0.48610657, 0.36776963, 0.12423802, -0.7854952, 0.48838156, + -0.5085067, -0.08865434, 1.1653454, 0.81965554, -0.6399579, -1.0967884, + 1.4099771, -0.15370974, 2.8824244, 1.0534087, 4.7045717, 5.2045445, + -0.6350576, 2.5321684, 0.6987691, -0.53839976, -0.09889791, 0.5662097, + 0.4088725, 0.635128, -1.763303, -0.49720347, -1.0772469, 1.2422445, + -0.3619956, -1.311133, 1.5846866, 1.0530244, -0.61141044, 0.74831486, + 5.433625, 3.9661994, 2.006918, -0.8703619, -0.7658511, 0.0811044, + 0.83877516, -0.63553256, -0.67563355, 1.7368636, 0.9372277, 1.8246815, + 0.8615329, -0.18161502, 0.62479717, 0.2028623, 0.159001, 1.860977, + 0.04177074, -0.49050322, 4.9402246, 4.0296063, -0.74729615, -0.27802998, + -0.8077982, -0.5414143, 0.467114, 0.9016136, 2.1971147, -1.466963, + -1.2350414, 1.0967304, -0.95607626, 0.51462483, 0.28838068, 1.0117096, + -0.21846394, 0.114624545, -1.627146, -0.9431294}; + +static const std::vector idft2d_input_data = { + 54.020195, 48.368538, -1.8721353, -3.7894967, 2.5850394, -0.7094516, + 3.5357249, 1.6819549, -3.4001002, 0.23887074, 2.9735894, 2.3982158, + 0.3599546, -5.801426, -4.427606, 5.2949734, 1.7113355, 1.428697, + 5.8978443, -0.8472582, -3.288164, -0.099487126, -0.33851182, 2.614974, + -2.766882, 0.18681616, 0.34976268, -0.2601711, 4.998401, -2.9831958, + -1.6652081, 0.53361464, -0.9001389, -3.6454318, -3.7148805, -0.68562484, + 2.0633714, -2.2154818, -3.3697965, 3.5273929, 1.5474558, -1.6305131, + -5.3327236, 0.54002213, -1.6671672, 2.4493377, -2.2604918, 1.4117424, + 2.1797671, 2.5013056, 0.8525213, 1.6570821, 1.717532, -2.101283, + 4.6570606, -3.6786642, 0.8912736, -0.4010569, -5.9480867, 1.441097, + 2.1150498, -1.4524796, -3.5035098, 3.0815587, -3.3185432, 4.7882123, + 5.64722, -1.1192517, 1.8302126, -2.5760055, -0.41363025, 3.2350469, + 1.4296081, 0.8722873, 6.1752787, -1.7328868, 2.312786, 4.4069357, + 1.7721124, 3.3802934, -0.53283703, 3.7646027, 4.440572, -4.353462, + -2.7639425, 3.6855025, 1.8912748, -2.5849285, -2.9895856, 1.1341677, + 1.4818796, 0.7482485, -1.3077981, 1.0669674, -0.76039124, -10.8791685, + 2.998129, -4.2489543, 0.41752052, -0.45298803, -0.62486386, 0.5913104, + -0.36638862, -0.9528576, -0.16223967, -3.171127, 2.7200532, -3.8751457, + 3.8895426, 1.0489256, -0.091531515, 6.992935, 4.5098467, -0.38218838, + 0.6637606, -2.1199496, 3.9403267, -0.870952, 2.4287906, 1.9679271, + 3.652341, -4.4909067, -1.4710087, 0.5256169, 5.4580984, -2.6554706, + -0.058261395, 3.6613276, 0.5612789, 1.0594783, 4.5429516, -1.447232, + -2.388829, 0.52541757, -6.1111097, -2.3621864, -1.4885365, -2.6265867, + -4.4030347, 0.27728367, 3.9584684, -3.7618577, -3.128574, -2.8671994, + 1.4171265, 0.02298975, -2.0790722, 1.6526843, 0.59488124, -3.2548752, + -0.82249254, 1.3645289, -2.9066925, -3.4377484, -2.501403, -2.821631, + -4.427053, -2.3529994, 0.6670886, -4.7455816, -2.160026, -1.0587022, + 1.1341916, -0.9469211, 0.67554307, -4.0473633, -1.2422556, 4.538533, + -0.739814, -3.22405, 1.2332113, -4.0489397, -4.560828, -3.5195189, + 6.7066355, -2.8439593, -0.43901098, -3.9980454, -4.2256207, 3.0529652, + 4.6105156, 2.720234, 2.3327744, -1.0400636, -0.048398018, 2.1603358, + -0.22459112, 0.6870126, -0.926849, -7.2363615, 3.7953386, 3.195907, + 3.8662248, -1.8919971, 0.91311014, -0.36923724, 3.0576966, 0.19861764, + -0.09782998, -1.0179963, 50.71621, 49.313248, -2.6195984, 3.396334, + -3.1849973, -2.4107025, 4.7431326, 1.7938776, -2.5362587, 6.287631, + -2.656609, 1.4825039, -0.77803206, 2.3750808, -1.9940716, 2.0271082, + 3.6380908, 2.822246, 2.2938647, 1.0260472, 3.248794, -3.05949, + 2.0979533, 3.565119, 1.9497933, 0.2390036, -2.255065, 0.7849397, + 1.9622431, 4.2382064, -3.2529292, 0.78572094, -2.9386084, 0.66875017, + 5.743927, 4.850876, -4.8014383, 6.371132, -2.6618924, -1.8847032, + -1.7702236, -1.1031301, 1.4129921, -0.080709964, -2.7634878, -3.6456683, + 1.4174454, 3.4085226, 3.10102, 0.114031196, -2.4092412, 0.27725983, + 2.8974152, -1.866328, -0.68216217, 2.249536, -0.42875588, -5.8182187, + 5.347006, -6.2936745, 0.8000201, 3.651592, 1.3155181, 2.3413098, + 2.1600244, 1.8733575, -2.4694557, 0.39358342, 2.020084, -0.062472403, + -4.131041, -1.5137839, -2.0354557, 1.1957052, -0.6644075, -2.0442688, + 2.0753646, 4.874056, -0.090800405, 1.3911223, 0.68129027, -4.0028048, + -0.8021738, 0.43866205, 2.7812133, 0.4525791, -0.87565154, 1.2364697, + -2.725146, 2.7965212, 4.148448, -1.9204504, -0.61004305, -4.790703, + 3.1498234, 0.79403657, 5.305445, 0.2803253, -3.67164, -4.3974924, + -2.5132315, -0.9139994, 6.841936, -4.089568, -1.2774054, 0.9789283, + 3.269153, -3.3947415, -7.5553513, 3.682307, 2.9227152, 2.3319635, + 2.754105, -1.2598821, 1.4247041, -1.8540356, -2.675635, 1.2705915, + 5.2202816, 6.206577, 0.4957786, 2.1150033, 5.8791704, 2.8043785, + -0.37886655, 0.011162788, -1.0408137, -1.5385519, -8.079001, -0.68451786, + 2.3513699, 3.0877895, 2.6497078, 1.3670976, 0.77233493, 2.2921152, + -1.2679763, 2.113087, 4.990262, -0.046566606, 0.015865922, 1.1569002, + -4.8347507, 1.9560149, 1.979923, 2.34512, -0.9634773, 4.3939066, + -6.2031984, 0.8311275, -2.7740612, -2.9296994, -3.4624243, -1.4588313, + 2.4724, -0.79477566, -0.4295609, 5.8110385, -2.6649034, -2.270977, + -2.5511568, -3.1238616, -4.46209, 0.16335368, 1.9146351, 1.0459399, + 2.8069792, -0.4705832, -4.0632596, -2.220704, 1.7770543, -0.5791014, + -2.2041528, 3.026476, 5.324942, -0.7805673, 5.9275556, 0.14159381, + -0.81569004, 4.1947803, -3.8557377, -0.5163199, 2.478963, -2.396379, + -0.3930376, -0.96302, -0.9776549, 0.13852966, 0.26078847, 0.8342015, + 2.3698487, 4.109933, 1.3575013, -0.5828376, -0.028537825, -0.53020877, + 0.39626116, -1.7572733, -4.31769, -2.1674476}; + +static const std::vector idft3d_input_data = { + 104.7364, 97.68179, -4.491728, -0.39316452, -0.59995466, -3.1201572, 8.278858, + 3.4758341, -5.9363585, 6.5265055, 0.3169801, 3.8807175, -0.418082, -3.4263492, + -6.4216776, 7.3220854, 5.3494234, 4.2509427, 8.191702, 0.17879319, -0.03937006, + -3.1589758, 1.7594413, 6.180092, -0.8170867, 0.42582142, -1.9053001, 0.52476853, + 6.9606423, 1.255014, -4.9181366, 1.319335, -3.838747, -2.9766817, 2.0290484, + 4.16525, -2.7380676, 4.155652, -6.0316873, 1.6426877, -0.2227689, -2.7336447, + -3.919732, 0.45931256, -4.4306555, -1.1963288, -0.8430467, 4.8202653, 5.280785, + 2.6153364, -1.556721, 1.9343407, 4.614946, -3.96761, 3.9748988, -1.4291265, + 0.46251905, -6.2192726, -0.60107887, -4.852579, 2.9150705, 2.1991146, -2.1879911, + 5.4228687, -1.158518, 6.661569, 3.1777658, -0.7256692, 3.8502965, -2.6384768, + -4.544671, 1.721262, -0.6058461, 2.067991, 5.5108714, -3.7771575, 4.388153, + 9.280992, 1.681312, 4.7714148, 0.14845347, -0.23820269, 3.6383984, -3.9147997, + 0.017270446, 4.138083, 1.0156215, -1.3484575, -5.7147317, 3.9306912, 5.630328, + -1.1722009, -1.9178381, -3.7237349, 2.3894331, -10.085134, 8.303572, -3.9686286, + -3.2541199, -4.850478, -3.1380959, -0.32268947, 6.475547, -5.0424256, -1.4396465, + -2.1921992, 5.9892044, -7.269888, -3.665809, 4.7312326, 2.8311844, 9.324896, + 7.2639513, -1.6420703, 2.0884657, -3.9739842, 1.2646922, 0.39964193, 7.649071, + 8.174507, 4.148118, -2.3759027, 4.4081597, 3.3299959, 5.0792284, -2.6443086, + -1.0990746, 2.1227744, -7.517721, 0.3749615, 6.894322, 1.6405574, 0.26087707, + 1.8925169, -5.3387756, -0.07007182, -2.7565134, -0.51350284, 0.5872268, 0.23071745, + 3.9743357, -2.6049578, -7.963324, -0.9111862, 3.3970497, 2.368112, -3.0425484, + 6.0465913, -5.608317, -2.4237492, -3.5965526, -1.5651696, -6.369116, -4.896579, + -0.029001951, -3.616405, -4.8566127, 3.4580388, -1.9978137, -7.016559, -4.71118, + -4.1825647, -3.3278992, -0.7835678, 2.5901778, -3.0014238, 1.5647203, 4.06795, + -4.803074, -5.444754, 3.0102665, -4.6280394, -6.764982, -0.49304247, 12.031577, + -3.6245267, 5.488541, -3.8564541, -5.04131, 7.2477474, 0.7547778, 2.2039144, + 4.8117356, -3.4364424, -0.44143593, 1.1973162, -1.2022457, 0.8255428, -0.66605973, + -6.4021583, 6.1651874, 7.3058405, 5.2237253, -2.4748354, 0.88457155, -0.89944726, + 3.453958, -1.558656, -4.4155188, -3.1854444, 3.303988, -0.9447114, 0.7474582, + -7.185831, 5.770039, 1.7012511, -1.2074116, -0.11192033, -0.86384296, -6.048759, + 5.6302013, 0.9157127, 1.1379871, -8.176507, -2.433535, 3.2678652, -1.9267552, + -1.393548, 3.6039736, -1.873306, -6.536957, 2.9600024, -2.4364662, -0.95014465, + -4.716674, -0.052186966, 2.6048284, -1.0451086, 3.036159, -7.221403, 1.5877211, + -0.25210607, 2.0384693, -4.3141813, -9.458808, -5.5365014, 6.8648105, -8.586614, + -0.7079052, 5.412094, 3.3176801, -0.5273831, -6.745717, 0.62073076, 1.0963198, + 6.0950055, -3.677938, -1.9967818, -0.921252, 2.387275, 3.261763, 1.3798212, + -1.1798835, -0.23495495, 5.339221, -5.928199, 1.3200281, 5.417163, -11.295093, + 7.7347717, 1.3150296, -5.1040716, -4.8190293, 0.74024755, -5.4785676, 2.914854, + 8.116676, -1.5128357, -0.1898706, -2.5135324, 3.7174103, 4.7488313, 3.4650638, + -0.32341766, 6.8396864, 0.31138325, 0.2374219, -0.46712062, 1.8629129, 1.9891711, + -1.2141278, 7.7674093, 5.2427464, -4.792124, -5.5451555, 3.2329237, 2.766926, + -3.8213987, -0.26443875, -1.6623533, -2.6665692, 2.6686997, -0.6977545, 5.85767, + -3.9102163, -11.673204, -2.3073153, -4.529278, 4.0891604, 3.9445055, 1.8883687, + 1.50531, -7.2083244, 3.1367111, 1.1151649, -4.1500554, -0.54910004, -0.48040384, + 11.444895, -2.6333811, -3.0142484, 4.6609726, 1.755743, 0.87769306, -0.7609439, + -0.26591438, 6.615961, -2.141545, -2.7914915, -4.2386503, 3.1565619, -6.6059103, + -7.35018, -2.2787585, 5.836963, -2.6666338, 0.98255026, 5.199881, 8.640279, + 1.7439961, 2.191582, -4.535021, -5.038538, -0.841679, -6.8834453, -4.654301, + -0.220559, -4.7396717, -9.393296, 0.32385087, 3.9426038, -4.9187584, 1.7061774, + -4.8232145, -0.5627973, -2.3221302, -1.1155958, -2.7412212, 6.798079, -4.0860014, + 1.9515686, 4.2942266, 0.5557329, -1.9789174, -4.973804, -2.0268555, -3.9974911, + -8.164038, 3.3319929, -2.474605, 0.39113098, 2.0651584, 5.5962815, -1.1102749, + -1.2390921, -5.0933027, -4.0492353, 5.009116, 3.323446, -1.0033474, -0.54384375, + -3.4698372, -2.3566747, -6.545992, 1.3816929, -2.0633929, -6.3665648, -4.13964, + -3.4099324, -1.1418146, 8.466255, 3.2365537, -0.14618888, 1.3563147, 0.3446387, + 3.1233552, 0.7530624, 0.548483, -1.1876376, -8.070564, 1.4254899, -0.9140264, + 2.5087235, -1.3091599, 0.9416502, 0.16097029, 2.6614356, 1.9558911, 4.219861, + 1.1494511}; + +static const std::vector expected_bfloat_idft1d_result = { + 0.859375, 0.00897217, 0.003479, 0.542969, 0.824219, 0.496094, 0.898438, 0.191406, + 0.855469, 0.882812, 0.71875, 0.057373, 0.914062, 0.632812, 0.25, 0.0437012, + 0.296875, 0.84375, 0.6875, 0.570312, 0.010498, 0.679688, 0.757812, 0.371094, + 0.515625, 0.0302734, 0.632812, 0.785156, 0.5, 0.71875, 0.204102, 0.117188, + 0.757812, 0.4375, 0.953125, 0.824219, 0.226562, 0.00640869, 0.0541992, 0.585938, + 0.875, 0.142578, 0.6875, 0.328125, 0.914062, 0.730469, 0.0463867, 0.034668, + 0.84375, 0.996094, 0.898438, 0.996094, 0.244141, 0.34375, 0.226562, 0.957031, + 0.59375, 0.851562, 0.914062, 0.173828, 0.867188, 0.160156, 0.660156, 0.523438, + 0.511719, 0.0249023, 0.171875, 0.0683594, 0.609375, 0.486328, 0.285156, 0.359375, + 0.640625, 0.28125, 0.597656, 0.632812, 0.507812, 0.234375, 0.773438, 0.445312, + 0.527344, 0.652344, 0.427734, 0.214844, 0.6875, 0.111328, 0.25, 0.220703, + 0.800781, 0.347656, 0.785156, 0.161133, 0.632812, 0.785156, 0.90625, 0.6875, + 0.246094, 0.324219, 0.224609, 0.240234, 0.25, 0.285156, 0.324219, 0.515625, + 0.835938, 0.632812, 0.283203, 0.882812, 0.902344, 0.160156, 0.320312, 0.675781, + 0.859375, 0.289062, 0.193359, 0.824219, 0.148438, 0.181641, 0.84375, 0.234375, + 0.859375, 0.574219, 0.945312, 0.0927734, 0.34375, 0.472656, 0.59375, 0.225586, + 0.304688, 0.496094, 0.108398, 0.476562, 0.129883, 0.695312, 0.84375, 0.667969, + 0.240234, 0.796875, 0.375, 0.742188, 0.167969, 0.839844, 0.929688, 0.558594, + 0.671875, 0.0771484, 0.6875, 0.0693359, 0.679688, 0.796875, 0.490234, 0.882812, + 0.5625, 0.914062, 0.476562, 0.945312, 0.980469, 0.617188, 0.8125, 0.0131836, + 0.78125, 0.992188, 0.992188, 0.664062, 0.388672, 0.384766, 0.121094, 0.546875, + 0.132812, 0.945312, 0.246094, 0.00799561, 0.145508, 0.3125, 0.416016, 0.679688, + 0.570312, 0.734375, 0.0142822, 0.347656, 0.929688, 0.484375, 0.460938, 0.816406, + 0.5, 0.375, 0.124023, 0.417969, 0.746094, 0.734375, 0.84375, 0.138672, + 0.148438, 0.992188, 0.216797, 0.412109, 0.867188, 0.328125, 0.757812, 0.949219, + 0.578125, 0.957031, 0.714844, 0.043457, 0.289062, 0.585938, 0.0498047, 0.320312, + 0.515625, 0.507812, 0.0098877, 0.519531, 0.777344, 0.34375, 0.792969, 0.460938, + 0.00314331, 0.029541, 0.765625, 0.570312, 0.441406, 0.820312, 0.292969, 0.34375, + 0.480469, 0.382812, 0.3125, 0.71875, 0.410156, 0.0639648, 0.875, 0.601562, + 0.447266, 0.163086, 0.859375, 0.796875, 0.421875, 0.953125, 0.550781, 0.333984, + 0.367188, 0.605469, 0.65625, 0.679688, 0.867188, 0.882812, 0.4375, 0.324219, + 0.773438, 0.339844, 0.142578, 0.230469, 0.0722656, 0.0693359, 0.373047, 0.910156, + 0.65625, 0.777344, 0.453125, 0.453125, 0.158203, 0.800781, 0.625, 0.609375, + 0.769531, 0.0864258, 0.302734, 0.554688, 0.847656, 0.914062, 0.859375, 0.878906, + 0.898438, 0.96875, 0.9375, 0.777344, 0.804688, 0.140625, 0.664062, 0.664062, + 0.0478516, 0.746094, 0.451172, 0.984375, 0.460938, 0.214844, 0.921875, 0.392578, + 0.683594, 0.570312, 0.207031, 0.539062, 0.460938, 0.181641, 0.664062, 0.625, + 0.143555, 0.914062, 0.361328, 0.511719, 0.84375, 0.222656, 0.380859, 0.0246582, + 0.194336, 0.234375, 0.324219, 0.478516, 0.621094, 0.695312, 0.4375, 0.0795898, + 0.574219, 0.100098, 0.425781, 0.953125, 0.664062, 0.867188, 0.527344, 0.625, + 0.851562, 0.484375, 0.824219, 0.0869141, 0.6875, 0.416016, 0.59375, 0.0751953, + 0.140625, 0.488281, 0.4375, 0.625, 0.269531, 0.0986328, 0.0976562, 0.921875, + 0.241211, 0.902344, 0.75, 0.773438, 0.28125, 0.960938, 0.585938, 0.746094, + 0.0625, 0.4375, 0.347656, 0.597656, 0.0332031, 0.0644531, 0.976562, 0.554688, + 0.96875, 0.024292, 0.535156, 0.248047, 0.110352, 0.859375, 0.78125, 0.695312, + 0.945312, 0.75, 0.695312, 0.00915527, 0.910156, 0.726562, 0.259766, 0.194336, + 0.527344, 0.921875, 0.0576172, 0.742188, 0.4375, 0.296875, 0.859375, 0.0297852, + 0.363281, 0.198242, 0.376953, 0.0947266, 0.229492, 0.439453, 0.419922, 0.394531, + 0.136719, 0.0625, 0.953125, 0.890625, 0.246094, 0.671875, 0.796875, 0.0839844, + 0.660156, 0.789062, 0.789062, 0.0810547, 0.578125, 0.582031, 0.120117, -0.000337601}; + +static const std::vector expected_bfloat_idft2d_result = { + 0.859375, 0.00817871, 0.00500488, 0.542969, 0.828125, 0.496094, 0.902344, 0.191406, + 0.859375, 0.882812, 0.722656, 0.0566406, 0.914062, 0.632812, 0.25, 0.0444336, + 0.296875, 0.847656, 0.6875, 0.570312, 0.00891113, 0.679688, 0.757812, 0.375, + 0.515625, 0.0317383, 0.636719, 0.789062, 0.5, 0.722656, 0.205078, 0.120117, + 0.757812, 0.4375, 0.957031, 0.828125, 0.225586, 0.0078125, 0.0546875, 0.585938, + 0.875, 0.142578, 0.683594, 0.326172, 0.914062, 0.730469, 0.046875, 0.0327148, + 0.84375, 0.996094, 0.898438, 0.996094, 0.24707, 0.34375, 0.226562, 0.953125, + 0.59375, 0.851562, 0.917969, 0.173828, 0.867188, 0.158203, 0.664062, 0.519531, + 0.515625, 0.0244141, 0.171875, 0.0664062, 0.609375, 0.484375, 0.287109, 0.357422, + 0.640625, 0.277344, 0.601562, 0.628906, 0.507812, 0.232422, 0.773438, 0.445312, + 0.53125, 0.648438, 0.429688, 0.213867, 0.691406, 0.112305, 0.253906, 0.21875, + 0.804688, 0.345703, 0.789062, 0.160156, 0.640625, 0.785156, 0.90625, 0.6875, + 0.246094, 0.322266, 0.226562, 0.238281, 0.251953, 0.28125, 0.324219, 0.515625, + 0.835938, 0.628906, 0.283203, 0.882812, 0.898438, 0.15918, 0.320312, 0.671875, + 0.859375, 0.285156, 0.193359, 0.828125, 0.149414, 0.179688, 0.847656, 0.234375, + 0.859375, 0.570312, 0.945312, 0.0917969, 0.34375, 0.470703, 0.597656, 0.225586, + 0.304688, 0.494141, 0.11084, 0.474609, 0.131836, 0.695312, 0.847656, 0.664062, + 0.242188, 0.796875, 0.375, 0.742188, 0.166016, 0.839844, 0.929688, 0.558594, + 0.671875, 0.0761719, 0.6875, 0.0693359, 0.679688, 0.796875, 0.490234, 0.882812, + 0.5625, 0.914062, 0.478516, 0.945312, 0.980469, 0.617188, 0.8125, 0.0130615, + 0.78125, 0.992188, 0.992188, 0.664062, 0.386719, 0.380859, 0.120605, 0.546875, + 0.134766, 0.945312, 0.24707, 0.00476074, 0.144531, 0.3125, 0.416016, 0.675781, + 0.570312, 0.734375, 0.0135498, 0.345703, 0.925781, 0.482422, 0.460938, 0.816406, + 0.503906, 0.375, 0.125, 0.419922, 0.746094, 0.734375, 0.84375, 0.136719, + 0.148438, 0.992188, 0.216797, 0.410156, 0.863281, 0.328125, 0.757812, 0.949219, + 0.578125, 0.960938, 0.714844, 0.0424805, 0.289062, 0.585938, 0.0510254, 0.320312, + 0.515625, 0.507812, 0.00964355, 0.519531, 0.78125, 0.34375, 0.796875, 0.460938, + 0.0030365, 0.0292969, 0.765625, 0.570312, 0.441406, 0.820312, 0.289062, 0.34375, + 0.480469, 0.382812, 0.308594, 0.71875, 0.410156, 0.0625, 0.871094, 0.601562, + 0.445312, 0.162109, 0.859375, 0.796875, 0.419922, 0.953125, 0.546875, 0.332031, + 0.367188, 0.605469, 0.65625, 0.675781, 0.867188, 0.882812, 0.4375, 0.324219, + 0.773438, 0.339844, 0.138672, 0.228516, 0.0703125, 0.0693359, 0.371094, 0.914062, + 0.65625, 0.773438, 0.449219, 0.453125, 0.157227, 0.796875, 0.625, 0.609375, + 0.765625, 0.0839844, 0.300781, 0.554688, 0.84375, 0.914062, 0.859375, 0.878906, + 0.898438, 0.96875, 0.9375, 0.777344, 0.804688, 0.138672, 0.660156, 0.664062, + 0.0456543, 0.75, 0.449219, 0.984375, 0.457031, 0.216797, 0.921875, 0.394531, + 0.683594, 0.574219, 0.205078, 0.539062, 0.458984, 0.180664, 0.660156, 0.628906, + 0.142578, 0.914062, 0.359375, 0.511719, 0.839844, 0.222656, 0.378906, 0.0241699, + 0.191406, 0.234375, 0.320312, 0.480469, 0.617188, 0.695312, 0.433594, 0.0786133, + 0.570312, 0.0996094, 0.421875, 0.953125, 0.664062, 0.867188, 0.523438, 0.625, + 0.851562, 0.484375, 0.820312, 0.0888672, 0.6875, 0.416016, 0.59375, 0.0766602, + 0.140625, 0.490234, 0.4375, 0.625, 0.269531, 0.0986328, 0.097168, 0.921875, + 0.240234, 0.90625, 0.75, 0.773438, 0.28125, 0.960938, 0.585938, 0.75, + 0.0620117, 0.4375, 0.347656, 0.601562, 0.0322266, 0.0673828, 0.976562, 0.554688, + 0.96875, 0.0263672, 0.53125, 0.248047, 0.108398, 0.859375, 0.777344, 0.695312, + 0.941406, 0.75, 0.6875, 0.00842285, 0.90625, 0.726562, 0.257812, 0.193359, + 0.523438, 0.921875, 0.0554199, 0.742188, 0.435547, 0.294922, 0.859375, 0.0292969, + 0.359375, 0.197266, 0.375, 0.09375, 0.228516, 0.445312, 0.417969, 0.396484, + 0.136719, 0.0644531, 0.949219, 0.898438, 0.244141, 0.671875, 0.796875, 0.0859375, + 0.65625, 0.792969, 0.789062, 0.0820312, 0.570312, 0.585938, 0.117676, 0.000293732}; + +static const std::vector expected_bfloat_idft3d_result = { + 0.859375, 0.0102539, 0.00363159, 0.546875, 0.824219, 0.496094, 0.898438, 0.191406, + 0.855469, 0.882813, 0.71875, 0.0576172, 0.914063, 0.632813, 0.25, 0.045166, + 0.296875, 0.84375, 0.6875, 0.570313, 0.00927734, 0.679688, 0.757813, 0.375, + 0.515625, 0.0334473, 0.632813, 0.785156, 0.5, 0.722656, 0.205078, 0.120117, + 0.757813, 0.4375, 0.953125, 0.828125, 0.224609, 0.00952148, 0.0541992, 0.585938, + 0.875, 0.142578, 0.683594, 0.324219, 0.914063, 0.726563, 0.0454102, 0.0366211, + 0.84375, 0.996094, 0.894531, 0.996094, 0.246094, 0.347656, 0.226563, 0.953125, + 0.59375, 0.851563, 0.914063, 0.173828, 0.863281, 0.15918, 0.660156, 0.523438, + 0.515625, 0.0249023, 0.171875, 0.0678711, 0.609375, 0.484375, 0.285156, 0.359375, + 0.640625, 0.279297, 0.597656, 0.628906, 0.507813, 0.233398, 0.773438, 0.445313, + 0.53125, 0.648438, 0.429688, 0.212891, 0.6875, 0.110352, 0.253906, 0.21875, + 0.804688, 0.347656, 0.789063, 0.162109, 0.636719, 0.785156, 0.90625, 0.6875, + 0.248047, 0.324219, 0.226563, 0.240234, 0.25, 0.283203, 0.324219, 0.515625, + 0.835938, 0.632813, 0.285156, 0.882813, 0.898438, 0.160156, 0.320313, 0.671875, + 0.855469, 0.289063, 0.191406, 0.828125, 0.148438, 0.179688, 0.84375, 0.236328, + 0.859375, 0.570313, 0.945313, 0.0917969, 0.34375, 0.470703, 0.597656, 0.224609, + 0.304688, 0.494141, 0.110352, 0.476563, 0.131836, 0.695313, 0.84375, 0.664063, + 0.241211, 0.796875, 0.375, 0.742188, 0.166016, 0.839844, 0.929688, 0.554688, + 0.671875, 0.0761719, 0.6875, 0.0698242, 0.679688, 0.796875, 0.488281, 0.882813, + 0.5625, 0.914063, 0.476563, 0.945313, 0.976563, 0.617188, 0.808594, 0.0130615, + 0.78125, 0.992188, 0.988281, 0.664063, 0.386719, 0.382813, 0.120117, 0.546875, + 0.132813, 0.945313, 0.244141, 0.0055542, 0.145508, 0.3125, 0.414063, 0.679688, + 0.570313, 0.734375, 0.0133057, 0.34375, 0.921875, 0.484375, 0.460938, 0.8125, + 0.5, 0.375, 0.123047, 0.417969, 0.742188, 0.730469, 0.84375, 0.136719, + 0.146484, 0.992188, 0.216797, 0.410156, 0.863281, 0.328125, 0.757813, 0.953125, + 0.578125, 0.957031, 0.714844, 0.0419922, 0.291016, 0.585938, 0.0517578, 0.320313, + 0.515625, 0.507813, 0.0106201, 0.515625, 0.78125, 0.34375, 0.796875, 0.460938, + 0.00439453, 0.0290527, 0.765625, 0.570313, 0.441406, 0.820313, 0.292969, 0.339844, + 0.480469, 0.382813, 0.308594, 0.71875, 0.410156, 0.0620117, 0.871094, 0.601563, + 0.445313, 0.160156, 0.859375, 0.796875, 0.421875, 0.953125, 0.550781, 0.333984, + 0.367188, 0.605469, 0.65625, 0.679688, 0.867188, 0.882813, 0.4375, 0.324219, + 0.773438, 0.339844, 0.140625, 0.228516, 0.0712891, 0.0698242, 0.373047, 0.910156, + 0.65625, 0.773438, 0.449219, 0.453125, 0.158203, 0.796875, 0.625, 0.609375, + 0.765625, 0.0839844, 0.302734, 0.550781, 0.847656, 0.914063, 0.859375, 0.878906, + 0.898438, 0.96875, 0.9375, 0.773438, 0.804688, 0.140625, 0.664063, 0.664063, + 0.0480957, 0.75, 0.451172, 0.984375, 0.460938, 0.21582, 0.921875, 0.392578, + 0.683594, 0.574219, 0.207031, 0.539063, 0.460938, 0.181641, 0.664063, 0.625, + 0.141602, 0.914063, 0.359375, 0.511719, 0.839844, 0.222656, 0.378906, 0.0244141, + 0.193359, 0.234375, 0.320313, 0.476563, 0.617188, 0.691406, 0.433594, 0.0791016, + 0.570313, 0.0996094, 0.423828, 0.953125, 0.664063, 0.867188, 0.523438, 0.625, + 0.855469, 0.484375, 0.828125, 0.0878906, 0.6875, 0.416016, 0.59375, 0.0761719, + 0.140625, 0.490234, 0.4375, 0.625, 0.269531, 0.0996094, 0.0976563, 0.921875, + 0.240234, 0.90625, 0.75, 0.773438, 0.283203, 0.960938, 0.585938, 0.746094, + 0.0634766, 0.435547, 0.345703, 0.597656, 0.0341797, 0.0644531, 0.976563, 0.554688, + 0.972656, 0.0266113, 0.535156, 0.248047, 0.111328, 0.859375, 0.78125, 0.695313, + 0.945313, 0.75, 0.691406, 0.00946045, 0.90625, 0.726563, 0.257813, 0.193359, + 0.523438, 0.921875, 0.0556641, 0.742188, 0.435547, 0.294922, 0.859375, 0.0296631, + 0.359375, 0.196289, 0.375, 0.09375, 0.229492, 0.443359, 0.417969, 0.396484, + 0.137695, 0.0634766, 0.953125, 0.898438, 0.246094, 0.671875, 0.796875, 0.0859375, + 0.660156, 0.792969, 0.789063, 0.0820313, 0.574219, 0.585938, 0.119141, 0.00128174}; + +static const std::vector expected_float16_idft1d_result = { + 0.859375, 0.0100555, 0.00403976, 0.545898, 0.82666, 0.498047, 0.90332, 0.192871, + 0.858887, 0.887695, 0.723145, 0.0578003, 0.915527, 0.634766, 0.250488, 0.0457764, + 0.297607, 0.849609, 0.688477, 0.574219, 0.00984192, 0.682129, 0.761719, 0.375977, + 0.518066, 0.0329285, 0.637207, 0.789551, 0.500977, 0.725098, 0.204224, 0.121155, + 0.760254, 0.440186, 0.956543, 0.829102, 0.225708, 0.00914001, 0.0545654, 0.588379, + 0.878418, 0.143188, 0.686035, 0.327393, 0.916992, 0.731934, 0.0461426, 0.0350342, + 0.845215, 0.99707, 0.897949, 0.998535, 0.24646, 0.34668, 0.227417, 0.958008, + 0.596191, 0.853516, 0.91748, 0.174438, 0.866699, 0.15918, 0.663574, 0.522461, + 0.515137, 0.0249939, 0.172974, 0.0680542, 0.612305, 0.486572, 0.287354, 0.359375, + 0.644531, 0.279541, 0.599609, 0.630859, 0.507324, 0.233887, 0.774902, 0.446045, + 0.531738, 0.65332, 0.430908, 0.214722, 0.692871, 0.111816, 0.253662, 0.220947, + 0.806152, 0.347168, 0.790039, 0.161011, 0.637695, 0.787598, 0.909668, 0.691406, + 0.247559, 0.324463, 0.227295, 0.239746, 0.251953, 0.283936, 0.324707, 0.519043, + 0.839355, 0.632324, 0.285156, 0.888672, 0.902344, 0.160522, 0.322021, 0.676758, + 0.859375, 0.289062, 0.193237, 0.828125, 0.148926, 0.180664, 0.849121, 0.235596, + 0.862305, 0.574219, 0.947266, 0.0922852, 0.345215, 0.471924, 0.600586, 0.226074, + 0.306885, 0.495361, 0.111389, 0.476562, 0.132446, 0.696777, 0.849121, 0.668457, + 0.242188, 0.79834, 0.376221, 0.745605, 0.16748, 0.841797, 0.930664, 0.55957, + 0.674805, 0.0773315, 0.69043, 0.0697021, 0.680664, 0.79834, 0.490234, 0.884766, + 0.566895, 0.918457, 0.479004, 0.947266, 0.98291, 0.620605, 0.813477, 0.0135803, + 0.783203, 0.993652, 0.992188, 0.666992, 0.388428, 0.383545, 0.120422, 0.547852, + 0.133057, 0.946777, 0.245972, 0.00572968, 0.145752, 0.312256, 0.416992, 0.679688, + 0.573242, 0.738281, 0.0131683, 0.346191, 0.927734, 0.485107, 0.460449, 0.816895, + 0.504395, 0.375977, 0.124512, 0.42041, 0.74707, 0.734375, 0.844727, 0.137573, + 0.147827, 0.996582, 0.217896, 0.412109, 0.865723, 0.328613, 0.757324, 0.952148, + 0.580566, 0.959961, 0.718262, 0.0430298, 0.292725, 0.587891, 0.052063, 0.321777, + 0.520508, 0.509766, 0.011673, 0.520996, 0.782227, 0.345703, 0.796875, 0.461914, + 0.00485229, 0.0290375, 0.76709, 0.571777, 0.443848, 0.825195, 0.293213, 0.343994, + 0.480957, 0.383057, 0.310791, 0.717773, 0.4104, 0.0620422, 0.874512, 0.601562, + 0.448242, 0.161865, 0.86084, 0.797363, 0.421631, 0.956055, 0.553223, 0.334717, + 0.368164, 0.606934, 0.658203, 0.679199, 0.870605, 0.886719, 0.438721, 0.324707, + 0.775879, 0.340332, 0.141357, 0.230103, 0.0716553, 0.069458, 0.373535, 0.912109, + 0.658691, 0.777344, 0.451416, 0.454346, 0.159058, 0.801758, 0.625977, 0.611816, + 0.77002, 0.0848389, 0.303711, 0.552734, 0.849609, 0.917969, 0.86084, 0.881836, + 0.900879, 0.972168, 0.941406, 0.778809, 0.805664, 0.140259, 0.665039, 0.665039, + 0.0482788, 0.750488, 0.452148, 0.987793, 0.461182, 0.216675, 0.927246, 0.394043, + 0.685547, 0.576172, 0.207397, 0.541016, 0.460449, 0.181885, 0.663086, 0.628906, + 0.143066, 0.916992, 0.361816, 0.513184, 0.842285, 0.223389, 0.380127, 0.0247345, + 0.193726, 0.236084, 0.322021, 0.479736, 0.620605, 0.694824, 0.436279, 0.0797729, + 0.574707, 0.100037, 0.424805, 0.953613, 0.666504, 0.868652, 0.526855, 0.628418, + 0.858398, 0.486816, 0.827148, 0.088501, 0.692871, 0.417969, 0.597168, 0.0761719, + 0.141968, 0.490479, 0.440186, 0.625977, 0.271729, 0.100037, 0.0982666, 0.924805, + 0.242065, 0.907715, 0.752441, 0.776367, 0.284668, 0.963379, 0.588379, 0.749023, + 0.0639648, 0.4375, 0.347412, 0.600586, 0.03479, 0.0667725, 0.979004, 0.555664, + 0.975586, 0.02565, 0.537598, 0.249146, 0.110657, 0.859863, 0.78125, 0.695801, + 0.946289, 0.749512, 0.695312, 0.00930023, 0.910645, 0.729004, 0.259277, 0.194824, + 0.52832, 0.924316, 0.0562134, 0.743652, 0.437256, 0.295898, 0.859863, 0.0296478, + 0.362793, 0.196777, 0.37793, 0.0940552, 0.230225, 0.444092, 0.42041, 0.397461, + 0.137939, 0.0640259, 0.953613, 0.898926, 0.246338, 0.673828, 0.80127, 0.0863647, + 0.661621, 0.79541, 0.793457, 0.0834351, 0.577148, 0.586914, 0.119934, 0.00131321}; + +static const std::vector expected_float16_idft2d_result = { + 0.859375, 0.0100098, 0.00434875, 0.545898, 0.827148, 0.497803, 0.903809, 0.192871, + 0.858887, 0.887695, 0.723633, 0.0575562, 0.916016, 0.634277, 0.250732, 0.0457764, + 0.298096, 0.849121, 0.688477, 0.574219, 0.00975037, 0.682129, 0.761719, 0.375977, + 0.518066, 0.0331116, 0.637207, 0.789551, 0.500977, 0.725098, 0.204224, 0.121216, + 0.760254, 0.440186, 0.956543, 0.829102, 0.225586, 0.00925446, 0.0545044, 0.588867, + 0.878418, 0.143311, 0.686523, 0.327393, 0.916992, 0.732422, 0.0462341, 0.0350342, + 0.845215, 0.997559, 0.897949, 0.998535, 0.24646, 0.346924, 0.227417, 0.958496, + 0.596191, 0.854004, 0.91748, 0.174438, 0.867188, 0.15918, 0.664062, 0.522461, + 0.515625, 0.0251007, 0.17334, 0.0681152, 0.612793, 0.486572, 0.287354, 0.359375, + 0.644531, 0.279785, 0.600098, 0.630859, 0.507812, 0.234009, 0.775391, 0.446289, + 0.531738, 0.653809, 0.430908, 0.214844, 0.692871, 0.111877, 0.253418, 0.221069, + 0.806152, 0.347168, 0.790039, 0.161133, 0.637695, 0.787598, 0.909668, 0.691895, + 0.247681, 0.324463, 0.227173, 0.239746, 0.251953, 0.28418, 0.324707, 0.519043, + 0.839355, 0.632812, 0.285156, 0.888672, 0.902344, 0.160522, 0.322021, 0.676758, + 0.859863, 0.289307, 0.193237, 0.828125, 0.148926, 0.180664, 0.849121, 0.235596, + 0.862305, 0.574219, 0.947266, 0.0922852, 0.344971, 0.471924, 0.600586, 0.226074, + 0.306885, 0.495361, 0.11145, 0.476562, 0.132568, 0.696777, 0.849121, 0.668457, + 0.242065, 0.79834, 0.375977, 0.745117, 0.167603, 0.841309, 0.930664, 0.55957, + 0.674805, 0.0771484, 0.69043, 0.0695801, 0.680664, 0.79834, 0.490479, 0.884277, + 0.566406, 0.917969, 0.479004, 0.947266, 0.98291, 0.620605, 0.813477, 0.0133667, + 0.783203, 0.993652, 0.992188, 0.666992, 0.388428, 0.383545, 0.120544, 0.547852, + 0.133057, 0.946777, 0.246094, 0.00577164, 0.145752, 0.3125, 0.416992, 0.679688, + 0.573242, 0.738281, 0.0131683, 0.346436, 0.927734, 0.485352, 0.460693, 0.817383, + 0.504395, 0.375977, 0.124451, 0.420166, 0.74707, 0.734375, 0.845215, 0.137573, + 0.147705, 0.996582, 0.217896, 0.412109, 0.865723, 0.328613, 0.757324, 0.952148, + 0.580566, 0.959961, 0.718262, 0.0429993, 0.292725, 0.588379, 0.0520935, 0.321777, + 0.520508, 0.509766, 0.0115356, 0.520996, 0.782227, 0.345703, 0.796875, 0.461914, + 0.0048027, 0.0290375, 0.767578, 0.571777, 0.444092, 0.825195, 0.293457, 0.344238, + 0.481201, 0.383057, 0.310791, 0.717773, 0.410645, 0.0620728, 0.875, 0.602051, + 0.448486, 0.161865, 0.861328, 0.797363, 0.421875, 0.956055, 0.553711, 0.334717, + 0.368164, 0.607422, 0.658203, 0.679199, 0.871094, 0.886719, 0.438721, 0.324707, + 0.776367, 0.340332, 0.141479, 0.230225, 0.0717163, 0.0693359, 0.373535, 0.912109, + 0.658691, 0.777344, 0.45166, 0.45459, 0.15918, 0.801758, 0.625977, 0.611328, + 0.77002, 0.0849609, 0.303711, 0.552734, 0.849609, 0.917969, 0.86084, 0.881836, + 0.900879, 0.972168, 0.941406, 0.779297, 0.805664, 0.140503, 0.665527, 0.665039, + 0.0483704, 0.750488, 0.452148, 0.987793, 0.461182, 0.216797, 0.927246, 0.394043, + 0.685547, 0.576172, 0.207642, 0.541016, 0.460449, 0.181885, 0.663086, 0.628906, + 0.143066, 0.916504, 0.362061, 0.513184, 0.842285, 0.223389, 0.380127, 0.0245361, + 0.193726, 0.235962, 0.322021, 0.479736, 0.620117, 0.694336, 0.436035, 0.0795898, + 0.574707, 0.0999756, 0.424805, 0.953125, 0.666504, 0.868164, 0.526855, 0.628418, + 0.85791, 0.486572, 0.827148, 0.0883789, 0.692871, 0.417969, 0.597168, 0.0760498, + 0.141968, 0.490479, 0.440186, 0.625488, 0.271729, 0.0999146, 0.0983887, 0.924805, + 0.241943, 0.907227, 0.752441, 0.775879, 0.284912, 0.963379, 0.588379, 0.749512, + 0.0640259, 0.4375, 0.347656, 0.600586, 0.0349731, 0.0668335, 0.979004, 0.555664, + 0.976074, 0.0257111, 0.537598, 0.24939, 0.110962, 0.859863, 0.78125, 0.695801, + 0.946289, 0.749512, 0.694824, 0.00910187, 0.910645, 0.729004, 0.259277, 0.194824, + 0.52832, 0.924316, 0.0563049, 0.743164, 0.437256, 0.295654, 0.859863, 0.0297089, + 0.363037, 0.196777, 0.37793, 0.0940552, 0.22998, 0.444092, 0.420166, 0.397217, + 0.137939, 0.0639038, 0.953613, 0.898438, 0.24646, 0.673828, 0.800781, 0.0861206, + 0.661133, 0.794922, 0.792969, 0.083252, 0.577148, 0.586426, 0.119751, 0.00126743}; + +static const std::vector expected_float16_idft3d_result = { + 0.859375, 0.00984192, 0.00445557, 0.545898, 0.827148, 0.497803, 0.903809, 0.192749, + 0.858887, 0.887695, 0.723633, 0.0576477, 0.916016, 0.634766, 0.250977, 0.0456543, + 0.298096, 0.849121, 0.688477, 0.574219, 0.009758, 0.682129, 0.761719, 0.376221, + 0.518066, 0.0330811, 0.637207, 0.789551, 0.500977, 0.724609, 0.204224, 0.121155, + 0.760254, 0.440186, 0.956543, 0.829102, 0.225464, 0.00920105, 0.0546875, 0.588379, + 0.878418, 0.143433, 0.686035, 0.327393, 0.916992, 0.731934, 0.0462646, 0.0350647, + 0.845215, 0.997559, 0.897949, 0.999023, 0.246338, 0.346924, 0.227295, 0.958008, + 0.596191, 0.854004, 0.91748, 0.174438, 0.866699, 0.15918, 0.664062, 0.522461, + 0.515625, 0.0249634, 0.173218, 0.0679932, 0.612793, 0.486572, 0.287354, 0.359375, + 0.644531, 0.279541, 0.600098, 0.631348, 0.507812, 0.234009, 0.774902, 0.446289, + 0.531738, 0.65332, 0.430664, 0.214722, 0.692871, 0.111938, 0.253418, 0.220947, + 0.806152, 0.347168, 0.790039, 0.161011, 0.637695, 0.787598, 0.90918, 0.691406, + 0.247437, 0.324463, 0.227295, 0.239746, 0.251953, 0.28418, 0.324707, 0.519043, + 0.839355, 0.632324, 0.285156, 0.888672, 0.902344, 0.160522, 0.322021, 0.676758, + 0.859375, 0.289062, 0.193237, 0.828125, 0.148804, 0.180908, 0.849121, 0.235718, + 0.861816, 0.574219, 0.947266, 0.0922241, 0.345215, 0.471924, 0.600586, 0.226074, + 0.306885, 0.495361, 0.111389, 0.476318, 0.132446, 0.696777, 0.849121, 0.668457, + 0.242065, 0.79834, 0.375977, 0.745117, 0.16748, 0.841309, 0.930664, 0.55957, + 0.674805, 0.0770874, 0.69043, 0.069458, 0.680664, 0.797852, 0.490234, 0.884277, + 0.566406, 0.917969, 0.479004, 0.947266, 0.98291, 0.620605, 0.813477, 0.0134964, + 0.783203, 0.994141, 0.992188, 0.666992, 0.388428, 0.383545, 0.120361, 0.547852, + 0.133179, 0.946777, 0.246094, 0.00577164, 0.145752, 0.312256, 0.416992, 0.679688, + 0.573242, 0.738281, 0.0133972, 0.346191, 0.928223, 0.485107, 0.460449, 0.817383, + 0.504395, 0.375977, 0.124512, 0.420166, 0.74707, 0.733887, 0.844727, 0.137451, + 0.147827, 0.996582, 0.217896, 0.412354, 0.865723, 0.328613, 0.757324, 0.952148, + 0.580566, 0.959961, 0.718262, 0.0429382, 0.292725, 0.588379, 0.0520935, 0.321533, + 0.520508, 0.509766, 0.0115204, 0.520996, 0.782227, 0.345703, 0.796875, 0.462158, + 0.00487137, 0.0290985, 0.767578, 0.571777, 0.444092, 0.825195, 0.293457, 0.344238, + 0.481201, 0.383057, 0.310791, 0.717773, 0.410645, 0.0619812, 0.874512, 0.602051, + 0.448242, 0.161865, 0.861328, 0.797363, 0.421875, 0.956055, 0.553711, 0.334717, + 0.368164, 0.607422, 0.658203, 0.679199, 0.871094, 0.887207, 0.438721, 0.324707, + 0.776367, 0.340332, 0.141479, 0.230225, 0.0718994, 0.069458, 0.373535, 0.912109, + 0.65918, 0.777344, 0.45166, 0.45459, 0.159302, 0.801758, 0.625977, 0.611816, + 0.77002, 0.085022, 0.303955, 0.552734, 0.849609, 0.917969, 0.86084, 0.881836, + 0.900879, 0.972168, 0.941406, 0.779297, 0.805664, 0.140381, 0.665039, 0.665039, + 0.0485535, 0.750488, 0.452148, 0.987793, 0.461182, 0.216675, 0.927246, 0.394043, + 0.685547, 0.576172, 0.20752, 0.541016, 0.460449, 0.182129, 0.663086, 0.628906, + 0.143311, 0.916992, 0.362061, 0.513184, 0.842285, 0.223389, 0.380127, 0.024704, + 0.193726, 0.235962, 0.322266, 0.479736, 0.620605, 0.694336, 0.436279, 0.0796509, + 0.574707, 0.0999756, 0.424805, 0.953613, 0.666504, 0.868652, 0.526855, 0.628418, + 0.858398, 0.486572, 0.827148, 0.0883179, 0.692871, 0.417969, 0.597168, 0.0759277, + 0.141968, 0.490479, 0.44043, 0.625488, 0.271729, 0.0999146, 0.0983887, 0.924805, + 0.242065, 0.907227, 0.752441, 0.775879, 0.284912, 0.963379, 0.588379, 0.749512, + 0.0641479, 0.437744, 0.347412, 0.600586, 0.0350037, 0.0668945, 0.979004, 0.555664, + 0.976074, 0.0257721, 0.537598, 0.249268, 0.111145, 0.859863, 0.78125, 0.695801, + 0.946289, 0.749512, 0.694824, 0.00917816, 0.910645, 0.729004, 0.259521, 0.19458, + 0.52832, 0.924316, 0.0562744, 0.743164, 0.437256, 0.295898, 0.859863, 0.0297546, + 0.363037, 0.196899, 0.37793, 0.0941162, 0.230225, 0.443848, 0.42041, 0.397217, + 0.137817, 0.0637817, 0.953613, 0.898438, 0.246338, 0.673828, 0.800781, 0.0863037, + 0.661621, 0.794922, 0.793457, 0.083252, 0.577148, 0.586426, 0.119751, 0.00126934}; + +static const std::vector expected_result_1 = { + 0.9795938, 0.14046684, 0.9819369, 0.51320475, 0.9390985, 0.06454252, 0.48972926, + 0.042538255, 0.3341647, 0.14752749, 0.44628578, 0.8509109, 0.6611515, 0.5711897, + 0.10807402, 0.67733586, 0.4091941, 0.23590194, 0.4385734, 0.40270114, 0.75568604, + 0.9842337, 0.82819414, 0.49742407, 0.7397849, 0.6104118, 0.019504193, 0.7756829, + 0.9271429, 0.6423316, 0.3300541, 0.8688829, 0.21220064, 0.76539195, 0.8143789, + 0.70724595, 0.54020476, 0.29437974, 0.19398275, 0.20308031, 0.30458412, 0.040420562, + 0.36627868, 0.61882246, 0.3416973, 0.5482437, 0.68851316, 0.5670022, 0.58812225, + 0.6487681, 0.88266903, 0.07287276, 0.7716641, 0.12443388, 0.4170407, 0.8380076, + 0.17115247, 0.8118648, 0.7704737, 0.5179812, 0.9407177, 0.7311383, 0.4538601, + 0.01992845, 0.4758718, 0.25867644, 0.55573237, 0.89606065, 0.8505143, 0.47349417, + 0.3970769, 0.3293097, 0.7601557, 0.24247961, 0.8102311, 0.7387785, 0.15742134, + 0.8387721, 0.100493915, 0.3733577, 0.4904671, 0.9106489, 0.0049963384, 0.89285916, + 0.24380954, 0.7329451, 0.9373891, 0.52886724, 0.65965563, 0.7307209, 0.5160155, + 0.97944415, 0.43991584, 0.9839402, 0.6350642, 0.16712844, 0.40538687, 0.80509937, + 0.4988989, 0.02185218, 0.74142575, 0.8026278, 0.28912508, 0.50405765, 0.7768013, + 0.9817653, 0.9995751, 0.74799776, 0.8615655, 0.058107413, 0.27611437, 0.76372087, + 0.93234706, 0.7603203, 0.30816016, 0.80595773, 0.8843074, 0.46457228, 0.43644127, + 0.6553406, 0.9050378, 0.5044161, 0.49364874, 0.59174323, 0.2650881, 0.78394204, + 0.57706285, 0.33071348, 0.7140054, 0.5885716, 0.60252094, 0.92644346, 0.91704935, + 0.64020824, 0.99652874, 0.8375778, 0.45622328, 0.3755286, 0.8324417, 0.77270067, + 0.50742614, 0.7814994, 0.30720684, 0.36613366, 0.9426107, 0.12557131, 0.87243265, + 0.002567238, 0.8350289, 0.1262151, 0.35253504, 0.07578735, 0.34082502, 0.9211622, + 0.38055828, 0.3247621, 0.5061271, 0.87862396, 0.1869049, 0.7774487, 0.030804915, + 0.25322768, 0.06073754, 0.27092665, 0.9209875, 0.86690956, 0.74456835, 0.42403135, + 0.61839956, 0.9004572, 0.94674456, 0.17315134, 0.74403226, 0.30930993, 0.23992635, + 0.9080931, 0.4886828, 0.9973065, 0.32888287, 0.32976696, 0.09137513, 0.1410893, + 0.4248779, 0.019689998, 0.6828394, 0.47350892, 0.02358055, 0.94660497, 0.9253734, + 0.1509718, 0.540138, 0.7050524, 0.20855357, 0.9753569, 0.0044813985, 0.5063834, + 0.6836877, 0.2784342, 0.0139586115, 0.8785785, 0.4754602, 0.38955635, 0.151705, + 0.5694773, 0.14548586, 0.6798502, 0.057361145, 0.031760257, 0.91168743, 0.5762714, + 0.54128575, 0.53421247, 0.5860678, 0.97197753, 0.940639, 0.18688098, 0.54635745, + 0.513619, 0.5645304, 0.91558236, 0.8496063, 0.6258071, 0.31261826, 0.20282389, + 0.2723365, 0.5039135, 0.6405068, 0.65471405, 0.5857442, 0.57205665, 0.23835625, + 0.32288164, 0.068663165, 0.43674967, 0.049117915, 0.78065604, 0.98437595, 0.60793245, + 0.38907775, 0.6610265, 0.5587009, 0.89418066, 0.6170649, 0.1305905, 0.5760506, + 0.10885323, 0.5303117, 0.16950679, 0.9630447, 0.9476875, 0.22327174, 0.87473476, + 0.917824, 0.44959846, 0.055421904, 0.22361691, 0.9334828, 0.16427046, 0.5914317, + 0.81789917, 0.48431975, 0.3067152, 0.53250873, 0.19298424, 0.23529118, 0.4841604, + 0.24943262, 0.41821656, 0.59484303, 0.4535004, 0.50373393, 0.6057788, 0.6799498, + 0.21368006, 0.17095569, 0.97966874, 0.3839032, 0.48672524, 0.9375583, 0.84598905, + 0.049092207, 0.47682214, 0.56488436, 0.7817405, 0.8975917, 0.75874424, 0.43242812, + 0.8459973, 0.7138231, 0.9834999, 0.7273379, 0.05828699, 0.6884237, 0.07486352, + 0.4326547, 0.78577167, 0.8844588, 0.9474644, 0.542272, 0.49642876, 0.48886803, + 0.11854455, 0.01492267, 0.22648218, 0.7607531, 0.5930919, 0.9450968, 0.02894685, + 0.67735505, 0.46363172, 0.18415985, 0.66824925, 0.6137258, 0.6086626, 0.6422855, + 0.7637218, 0.56419605, 0.74026155, 0.18709394, 0.14683136, 0.32289994, 0.15482259, + 0.11222768, 0.9085655, 0.43263617, 0.32097924, 0.29690787, 0.77809244, 0.2413839, + 0.8267769, 0.82795614, 0.018312717, 0.9958108, 0.769578, 0.13144562, 0.45904484, + 0.38071582, 0.24182741, 0.7200288, 0.20737973, 0.5285696, 0.3680287, 0.46252182, + 0.89153767, 0.13071166, 0.84319293, 0.10841641, 0.40668696, 0.7636801, 0.42153865, + 0.65055484, 0.86845386, 0.6452055, 0.6112245, 0.84526664, 0.15358071, 0.7889171, + 0.6356269, 0.2515375, 0.86599886, 0.20071381, 0.20584217, 0.24220705, 0.049883988, + 0.77259976, 0.49566683, 0.8112268, 0.49028614, 0.2187354, 0.70172536, 0.47309682, + 0.12539592, 0.13696012, 0.33588144, 0.98134226, 0.537496, 0.9999663, 0.13245043, + 0.5659106, 0.39207155, 0.48483336, 0.49371332, 0.12930158, 0.103645995}; + +static const std::vector idft1d_input_data_1 = { + 4.940035, 3.0077164, -0.43999052, -0.72356576, 0.35775006, -1.1781573, + 0.35552078, -0.5878226, 0.8879826, -1.1602633, 0.71755445, 0.15355057, + -0.9307331, 0.48268145, 1.9486318, 1.1295953, 4.4481335, 5.01757, + -0.57099926, -0.85269475, -0.7217729, -0.08008081, -1.1429803, -1.1934547, + 1.2154821, -0.07181215, 0.59362185, 0.44658875, -0.345927, -1.480422, + -0.20200539, 0.10152125, 3.4618404, 3.744587, 0.12548631, 0.8791516, + 0.19086862, -0.33497274, -0.69986683, 0.6364535, -0.6644666, -0.44771492, + -0.8179812, 0.17377639, -0.92110324, 0.26135075, 1.0228279, 1.2105042, + 4.9957, 3.764995, 0.17936486, -0.9405504, -1.2201893, -0.17718112, + 1.1820351, 0.5077594, -0.052387, 0.86741495, -0.55883414, 0.9524643, + -0.68602496, 1.3873026, 0.8653134, -1.17206, 4.107497, 4.150929, + -0.95916677, -0.56429225, 1.1602635, -1.679503, 0.5507363, 0.53716975, + 0.38042903, -0.5240841, -0.33995685, -0.78949994, -0.7040798, 0.05728233, + -0.38874817, 0.8814098, 3.9273133, 5.9265537, -0.80074155, 0.20659067, + 1.642705, 0.9759259, 0.85149074, 0.44840366, -0.25961697, 0.78995633, + -0.039625674, 0.545478, -0.70991015, -1.1269569, -0.68787766, -0.48076022, + 4.848893, 4.6852283, -0.6871975, -0.041547477, -0.91873163, -0.0071051717, + -1.4497755, 0.3778788, 0.7214658, 0.6099715, 1.4334095, -0.07150489, + 0.07712549, 1.859364, -0.78209424, -0.97149, 4.8020935, 4.897006, + 0.05723229, -0.21079391, 1.0996364, 0.22791737, 0.7594234, 1.1837918, + 1.1714673, 0.12949562, -0.64135337, -0.5158363, 0.2763425, -0.19547313, + -0.06606534, 0.56645525, 5.3334026, 5.288664, -0.09143779, -0.7460747, + 0.2411859, -0.5888344, 1.4911498, 0.52246934, -0.1439941, -0.51704764, + 0.32441977, 0.35291424, -0.7496793, -0.32638037, -0.6930033, 0.72286314, + 4.4170227, 3.232138, -0.64390934, -1.3210952, -0.58362705, -0.6716566, + 0.39952934, -1.1999383, 0.83216095, 0.8710072, 0.34266293, -0.92789006, + 0.46818644, 0.7554455, 2.3088598, 0.26656008, 4.306201, 4.1061068, + -1.286478, -0.14309806, -1.9038618, -0.045521975, -0.43500268, -0.6120295, + 0.3222475, 0.5537019, 1.2264881, -1.5052714, -0.12776875, 0.00045275688, + -1.8553859, -0.32851917, 3.50575, 3.7639909, -0.8274512, 1.2718699, + 0.7064032, 1.7913067, -1.4024514, -0.49303484, 0.8707912, -0.23823786, + 0.41937304, 1.443722, -0.396856, 0.56620187, 1.0339032, -0.12736642, + 1.7406936, 4.309397, -0.18755847, -0.46101326, 0.020362198, 0.3217622, + 0.7620988, 1.9022003, 1.2856812, 0.3369981, -1.149087, 0.5562107, + -0.31068176, 0.4914955, -0.49307993, 0.34580433, 5.2527924, 4.527175, + -0.029956281, -0.35984623, 1.0824606, -0.360453, 0.19873115, -0.3701315, + 0.53464556, 0.8481753, 1.4529572, 1.012228, -1.037719, -0.6553353, + -0.16041204, -0.03164065, 3.2281785, 4.5399303, 0.3643899, 0.30424678, + -0.7776585, -0.3015166, -0.61336106, -0.7931169, 0.5940609, -0.29862595, + -0.02879478, 0.6273444, -1.6805825, -0.17713517, 1.0924593, 0.1301811, + 4.4416904, 3.7987688, -1.3668841, -0.81391287, 0.64007276, 1.0288135, + -0.57070565, -0.52160406, 1.58955, 1.0018709, -0.123293996, 1.390446, + -0.5843305, 1.5380195, 0.44350854, -0.26895642, 4.125044, 3.443525, + 0.7636179, 0.10296479, 0.52696383, 0.08359367, 0.6142223, -1.2670981, + 0.3708297, -0.6262324, 0.339195, -0.5216981, -0.34774148, -0.30716318, + 1.0757314, 0.4062716, 4.1163635, 5.389367, -0.1369414, 0.3118773, + -0.48302984, 0.07917905, 1.6785579, -0.9954241, -0.09528947, -1.517424, + 0.85461855, 0.18921553, -0.62187576, -1.1891136, 0.12719542, -0.558237, + 4.492761, 3.6913419, -0.29317212, -1.2950531, -0.03654802, 0.91552365, + 0.123229444, 0.514639, 1.0583864, 0.5574026, -0.13546133, 0.9680127, + 0.87852824, 2.559589, -0.3771388, -0.043456703, 4.574666, 4.013397, + -0.06427416, -1.2290373, 0.11051571, -1.2182673, 0.05659631, 0.77380556, + 0.65739393, 0.7978984, -0.19493088, 0.9715779, 0.1553396, 1.2139899, + 0.79071796, -0.57862896, 3.361268, 4.236172, -0.13507411, 0.6842204, + -1.1744223, -0.62078804, 2.008315, -1.2499349, 0.62419355, -0.091858864, + -0.5990913, -0.90177983, -0.55390406, 0.40287262, -0.94808567, -1.2203228, + 3.745199, 4.248646, 0.63732016, -0.82302505, -1.9267471, 0.58008444, + -0.38652933, -0.9787377, -0.1378448, -0.4994706, -0.24433172, 0.09051508, + 0.3651026, 0.010821462, 0.9935576, -0.69421434, 4.5576744, 3.50811, + 1.745633, 0.16605312, -1.8684177, -0.33893645, -0.17866233, 0.5833766, + 0.2571981, 0.38861072, -0.5767294, 0.61207676, 0.43722266, -0.28951776, + 0.78772557, 0.26002276, 3.9901466, 2.82238, -1.4889656, -0.1150527, + 0.47323376, 0.07621753, 0.16292411, 0.17989358, -0.30915606, 0.50516117, + -0.38916004, 1.9493489, 0.72058266, -0.067055345, -1.4097221, 0.26290974}; + +static const std::vector idft2d_input_data_1 = { + 25.880518, 25.61235, -2.4660468, -1.9953613, 1.409625, -2.473969, + 1.0969357, 0.34850854, 1.5074215, -0.546504, -0.44522142, 1.482357, + -4.297778, -0.41876173, 2.5581412, 1.6702101, -0.79171646, 0.87513673, + -0.5556948, -1.4017968, 1.6127079, 3.341402, -2.2336023, 0.7553977, + 0.8801464, -1.5552741, 2.8809369, -0.12944597, -0.08941656, -2.4948978, + 1.1106122, -0.5771601, 1.5280423, -3.6573076, -1.325342, -0.75811887, + -4.0773964, 0.41215408, 0.24999249, 0.3498589, -0.31276864, -2.3484, + -0.4591713, -0.04454562, -0.7590859, 2.5111904, 3.1611128, -0.09711918, + -0.8617741, -3.8058863, -0.0812951, 1.1779473, 2.0081396, -3.9112964, + -0.6841551, 0.82309175, -0.2995335, -3.7176208, -0.43554613, -2.4067037, + -0.81405425, 2.0213914, 2.6072812, 4.772808, 2.3986423, -1.6369095, + 3.009512, -2.2388682, 0.08045465, -2.0042, 3.2657382, -0.93855727, + 1.3121321, 2.0163581, 1.3805538, 1.8802332, 0.20659024, 3.5175233, + 2.7225797, -1.7004844, 1.4864945, 0.6589138, -1.221076, 0.8748032, + 1.1129706, -2.4330344, 0.43821555, -4.865236, 2.2404962, -0.81013864, + 1.3837745, 0.13940874, 0.16934663, -2.240356, -0.46793693, 2.7093167, + 27.21336, 25.973133, -3.4792416, -1.1907393, -1.358995, 0.70610523, + -0.63712704, -0.22086221, 3.7741385, 1.4088898, 3.1050003, -1.2238663, + -0.45265055, 2.6596098, -0.053786665, 0.12850314, 1.7713342, -0.92604506, + -1.5456572, 0.4535787, -0.4252041, -0.20687354, -0.26421398, -1.5723603, + 0.21247786, -0.19034994, 0.116511285, 3.5963366, -0.9552689, 1.4078308, + 0.17855054, -1.2697299, 0.24928832, -1.3436013, -1.018871, -1.1798176, + -2.4574528, 0.14592099, -0.7871367, -1.3267987, 1.6891341, 0.8528522, + -2.194655, -0.7497572, 0.66770875, 1.4708114, 2.0073843, 0.8376069, + 1.7636304, 2.1868649, -0.65098536, -0.6707011, -3.8038197, -1.9890289, + -0.15012956, 0.7975005, -1.9746995, -0.11563957, 2.8636346, -1.2238576, + -1.1479954, 0.40726233, -6.6071806, -1.2827955, 0.335096, -0.8774332, + 0.5047921, -1.7173706, -0.6906272, -2.8883119, -1.7264752, -0.91851616, + -0.8023921, 2.1811929, 4.4178715, -1.0245608, 1.4208769, 3.714005, + 2.626697, -3.0808997, -2.2393522, 3.0984519, 2.0667777, 4.0557647, + 3.22371, 4.1895566, -5.1335697, 5.5083103, 1.4301378, -0.47711706, + 0.29209352, 0.19667566, 0.9300822, 1.4966636, -2.8442304, -1.1616251, + 22.90476, 26.008162, -0.59333247, -0.9156835, 1.009171, 0.85137844, + 2.0695426, -2.0451744, 4.279478, -0.2552395, 1.3455946, 3.2537463, + -4.582932, -0.29923248, 2.0854027, 0.023423433, -1.4901955, 1.2697036, + 0.12445855, 0.37839913, -0.90889513, -0.96464497, 3.2230172, 5.11582, + 1.7657483, -1.2759314, 1.6806445, -0.48582482, 1.0328861, -0.21219438, + -1.8203479, 0.28618455, -3.8749995, -2.6027172, -2.7910428, -1.8929406, + 0.43884945, -0.8854169, -0.6166424, 3.3119302, 3.9380612, 1.783706, + -2.8637185, 0.45624626, 1.298605, 2.399745, -0.42191154, 0.3671223, + -4.7169294, -1.4224572, 2.4742305, 0.80807984, -1.4698355, -0.64370054, + -0.54362357, 1.729145, 0.2216661, -0.920482, -3.022968, -1.9300321, + -0.09508008, 0.31362647, 1.264819, 1.741091, -0.48260987, 0.91905135, + -1.2789521, -1.0161536, 0.53328425, 4.0857644, -0.8787215, 2.8750324, + 0.4081546, 2.4881384, -2.2990177, 2.1299765, 0.59928864, 3.988031, + -1.8122058, -0.16000175, -1.8958641, 1.6846397, 0.9392875, -0.12778088, + 0.51960033, -0.5128077, 1.3190198, 0.42644808, -2.8990207, 0.20179635, + -1.7350545, -0.08684918, -0.11685985, -3.241004, -2.2542362, -0.18299285, + 24.721714, 22.520046, 0.40146637, -2.611894, -4.422385, -0.6061659, + 1.7858734, -0.17695832, 2.1501722, 1.6577435, -2.1397042, 3.6897519, + 2.0028722, 3.830699, -0.16294527, -2.0136907, 2.7324684, -0.48164713, + -3.0283842, -1.1742884, 2.3383465, -0.04261756, -1.3686588, 0.50161046, + 0.76707345, 0.40514386, -1.7530769, 2.333971, 2.7187724, 4.413412, + -3.610829, 0.57066756, 0.3970142, -0.89236856, -1.0979964, -4.7337284, + -1.6107149, 3.461636, 0.8141506, 1.3783914, 0.97534364, -1.261203, + 0.9644269, -0.4446571, 1.3737998, 1.5714393, 1.5593243, -3.5085554, + 0.10169166, 0.3512014, 2.2333064, 1.7223357, -1.7363904, 0.5177647, + 2.1198907, -0.12688133, 1.7293842, 0.05056551, -0.4828595, -2.333132, + -0.4791782, 1.5151871, -0.91205263, 0.0061766207, -0.4048485, 2.1922839, + 1.728973, 0.9913887, 0.14321594, 1.6313545, -3.389923, -2.5937288, + -0.36389086, -0.2227447, 0.03589952, -0.069511056, 0.3542207, 2.3090918, + 0.45287704, 3.309232, -0.59147376, -1.541465, -1.9963981, -1.9641305, + 5.0686407, 0.53117156, 0.77804404, 4.1053996, 1.0922346, 2.7149107, + 2.5625482, 2.6316533, -0.69931746, 1.7177012, 0.4107918, 1.375428787}; + +static const std::vector idft3d_input_data_1 = { + 100.72035, 100.11369, -6.1371527, -6.7136793, -3.3625832, -1.5226498, + 4.315223, -2.0944858, 11.711212, 2.2648964, 1.8656702, 7.201989, + -7.3304863, 5.772318, 4.4268136, -0.1915536, 2.2218904, 0.7371478, + -5.005279, -1.7441093, 2.6169558, 2.1272666, -0.64345765, 4.800469, + 3.6254454, -2.6164103, 2.9250154, 5.315038, 2.706975, 3.1141493, + -4.1420155, -0.99003804, -1.7006547, -8.495995, -6.2332516, -8.564608, + -7.7067156, 3.134292, -0.33963704, 3.7133825, 6.2897673, -0.9730439, + -4.5531178, -0.7827141, 2.581028, 7.953187, 6.305909, -2.4009464, + -3.7133813, -2.690277, 3.9752584, 3.0376637, -5.0019054, -6.0262628, + 0.7419828, 3.2228546, -0.32318294, -4.7031775, -1.0777391, -7.8937283, + -2.5363095, 4.257466, -3.6471338, 5.237282, 1.8462799, 0.5969913, + 3.9643247, -3.981004, 0.0663265, 0.82460785, -2.7293837, -1.5757694, + 0.55400586, 6.462948, 3.5353048, 2.9161394, 2.580977, 13.528652, + 3.98995, -1.632153, -3.240194, 3.900541, -0.21140909, 2.8386583, + 9.924921, 1.7748868, -2.5982907, 5.174925, 1.8638494, 1.6294506, + 2.5033612, 2.8808913, 0.2832532, -2.2669961, -5.155612, 2.7401254, + 6.428844, -2.8874602, -0.45156026, 2.8010314, 1.7127267, -6.3887377, + -1.0165125, 4.816684, -3.0209088, -1.9152341, -6.7044344, -7.0160933, + -0.8859364, 2.3359919, 2.614932, 1.5376289, 0.2540813, 0.56656873, + 0.947714, -3.2629232, 2.3573487, 7.069599, -7.53059, -5.4648676, + -1.4810953, 0.27525342, 2.4626575, -1.5132098, -4.127886, 1.3913381, + 1.090563, -4.6527243, 4.9518104, -0.906865, 5.0196123, 1.055696, + -7.831962, 2.144308, -1.838556, -1.3607846, -2.1367745, -4.8458967, + 2.0994475, 2.6582882, -2.158319, 0.8175374, 7.929186, -0.9123031, + 5.690818, -4.0453672, -4.948562, 3.2541595, 0.9711809, -1.2001665, + 0.78384995, 1.3639677, -0.6874037, 0.9069457, 3.6966968, -3.823165, + -1.826899, 2.3765814, 0.0534904, 8.726845, -0.18846548, -3.2959056, + 1.5797036, 0.0014669895, -4.9724956, -5.2561207, 5.819672, -5.477039, + 3.3079143, -0.033277154, 2.7245224, -4.631716, 1.0122153, -1.5371637, + -1.8553452, -3.7143025, 8.022276, 0.62215286, 3.8595328, -3.060592, + 4.2517557, -0.075296044, 0.5221062, 0.6199312, 1.9474881, -1.3498385, + 0.6838516, 2.4967105, 0.06516862, -0.6287519, -0.7507546, 6.147333, + -3.149796, 3.1273334, 0.018394649, 0.8915896, 8.200176, -1.7225304, + 2.0177326, -1.2988436, -0.13740933, -3.868376, -0.06492156, 2.2702193, + -10.430931, -7.2083035, 4.860276, 3.578821, -6.7857146, 3.5525331, + 4.142806, -0.3026886, -1.20933, 2.6262493, 2.6222875, 6.941968, + 1.6663432, -3.0459986, 6.198147, -6.5455766, -0.8200346, -8.528335, + 2.722542, 0.4080863, -2.993259, -4.024056, -1.999518, 3.2624865, + 0.42962015, -4.08082, -0.39366418, 3.6101956, 0.9608154, -0.15634394, + -2.0926623, 1.6061159, -1.5019901, 1.8686844, -0.8275065, 2.9409513, + -7.4440265, -7.7664104, 0.8106141, 0.9343933, 6.078513, -3.0837321, + -3.1975398, 1.8816166, 0.16744804, -4.573029, -5.839288, -0.7797469, + 0.71803975, 0.41256714, 11.391333, 7.790516, 1.9857845, -2.0327086, + -0.5032053, -2.5290394, 1.16115, 3.3385215, 7.5034156, 5.4487205, + 2.886569, 2.5460477, -5.3722363, 5.1042805, -0.9692185, 1.4824567, + -2.1692014, -2.0888186, 2.4214573, 0.78656745, -0.3521694, -1.3446121, + -6.659781, -7.66657, 6.1127615, -14.052498, -3.1808968, -2.8461368, + -3.2059226, -2.7757711, -0.17827892, -8.695724, -0.2887354, 2.312519, + -0.4773283, 2.095835, -3.293869, -4.960386, -0.9118179, -0.2619573, + -0.92870337, -0.029317379, -2.5232022, 1.3327014, 3.1228013, 3.4733155, + 1.4562413, -2.5750513, -1.6694541, 1.7559463, 1.142877, -1.3557005, + -2.30802, -0.29746848, 2.6858592, 1.5424967, -3.3826494, -3.2559767, + -0.2901088, -0.83393717, -0.06207335, 2.225967, 1.8832793, -5.9567456, + 4.7713566, 2.9260354, 5.854274, -1.2023156, -2.0882115, 1.2139479, + -1.2005312, 0.4508332, 3.571826, -4.5633574, -6.3648844, -3.4183156, + 2.7096481, -3.659875, -1.957063, -0.5946456, -0.76313734, -0.016180754, + 2.0194921, -0.72149086, -0.16249031, -2.5144238, 5.9847684, -5.335026, + -1.0649127, -3.176074, -0.3549943, -6.501223, 1.4781482, 2.8698225, + 0.3889513, 1.0389466, 2.6314335, -2.6634102, 5.950971, -1.8160157, + 6.9972243, -2.4468954, 4.066836, -6.923808, 2.4692469, -2.1501422, + -1.4999585, -0.91028214, 4.634622, 4.132228, -1.7976125, 0.59614825, + 10.924917, 0.63333595, -1.2575581, -2.6736045, -8.180259, 5.0657587, + -3.065015, -3.7651565, -2.2837136, -11.203299, 8.331546, -0.6740327, + 5.5538063, -2.0441968, 0.5072439, 2.630047, 4.323353, -0.3627143}; + +NGRAPH_TEST(${BACKEND_NAME}, idft1d_eval_1) +{ + auto data = std::make_shared(element::f32, Shape{4, 6, 8, 2}); + auto axes_input = op::Constant::create(element::i64, Shape{1}, {2}); + auto idft = std::make_shared(data, axes_input); + + auto f = make_shared(idft, ParameterVector{data}); + + auto backend = runtime::Backend::create("${BACKEND_NAME}"); + auto idft_output = backend->create_tensor(element::f32, Shape{4, 6, 8, 2}); + + auto backend_data = backend->create_tensor(element::f32, Shape{4, 6, 8, 2}); + copy_data(backend_data, idft1d_input_data_1); + + auto handle = backend->compile(f); + + handle->call({idft_output}, {backend_data}); + + auto result = read_vector(idft_output); + size_t num_of_elems = result.size(); + for (std::size_t j = 0; j < num_of_elems; ++j) + { + EXPECT_NEAR(result[j], expected_result_1[j], 0.000002); + } +} + +NGRAPH_TEST(${BACKEND_NAME}, idft1d_eval) +{ + auto data = std::make_shared(element::f32, Shape{2, 10, 10, 2}); + auto axes_input = op::Constant::create(element::i64, Shape{1}, {2}); + auto idft = std::make_shared(data, axes_input); + + auto f = make_shared(idft, ParameterVector{data}); + + auto backend = runtime::Backend::create("${BACKEND_NAME}"); + auto idft_output = backend->create_tensor(element::f32, Shape{2, 10, 10, 2}); + + auto backend_data = backend->create_tensor(element::f32, Shape{2, 10, 10, 2}); + copy_data(backend_data, idft1d_input_data); + + auto handle = backend->compile(f); + + handle->call({idft_output}, {backend_data}); + + auto result = read_vector(idft_output); + size_t num_of_elems = result.size(); + for (std::size_t j = 0; j < num_of_elems; ++j) + { + EXPECT_NEAR(result[j], expected_result[j], 0.000002); + } +} + +NGRAPH_TEST(${BACKEND_NAME}, idft1d_eval_float16) +{ + auto data = std::make_shared(element::f16, Shape{2, 10, 10, 2}); + auto axes_input = op::Constant::create(element::i64, Shape{1}, {2}); + auto idft = std::make_shared(data, axes_input); + + auto f = make_shared(idft, ParameterVector{data}); + + auto backend = runtime::Backend::create("${BACKEND_NAME}"); + auto idft_output = backend->create_tensor(element::f16, Shape{2, 10, 10, 2}); + + auto backend_data = backend->create_tensor(element::f16, Shape{2, 10, 10, 2}); + copy_data(backend_data, from_float_vector(idft1d_input_data)); + + auto handle = backend->compile(f); + + handle->call({idft_output}, {backend_data}); + + auto result = to_float_vector(read_vector(idft_output)); + size_t num_of_elems = result.size(); + for (std::size_t j = 0; j < num_of_elems; ++j) + { + EXPECT_NEAR(result[j], expected_float16_idft1d_result[j], 0.000002); + } +} + +NGRAPH_TEST(${BACKEND_NAME}, idft1d_eval_bfloat16) +{ + auto data = std::make_shared(element::bf16, Shape{2, 10, 10, 2}); + auto axes_input = op::Constant::create(element::i64, Shape{1}, {2}); + auto idft = std::make_shared(data, axes_input); + + auto f = make_shared(idft, ParameterVector{data}); + + auto backend = runtime::Backend::create("${BACKEND_NAME}"); + auto idft_output = backend->create_tensor(element::bf16, Shape{2, 10, 10, 2}); + + auto backend_data = backend->create_tensor(element::bf16, Shape{2, 10, 10, 2}); + copy_data(backend_data, bfloat16::from_float_vector(idft1d_input_data)); + + auto handle = backend->compile(f); + + handle->call({idft_output}, {backend_data}); + + auto result = bfloat16::to_float_vector(read_vector(idft_output)); + size_t num_of_elems = result.size(); + for (std::size_t j = 0; j < num_of_elems; ++j) + { + EXPECT_NEAR(result[j], expected_bfloat_idft1d_result[j], 0.000002); + } +} + +NGRAPH_TEST(${BACKEND_NAME}, idft1d_eval_i32) +{ + auto data = std::make_shared(element::f32, Shape{2, 10, 10, 2}); + auto axes_input = op::Constant::create(element::i32, Shape{1}, {2}); + auto idft = std::make_shared(data, axes_input); + + auto f = make_shared(idft, ParameterVector{data}); + + auto backend = runtime::Backend::create("${BACKEND_NAME}"); + auto idft_output = backend->create_tensor(element::f32, Shape{2, 10, 10, 2}); + + auto backend_data = backend->create_tensor(element::f32, Shape{2, 10, 10, 2}); + copy_data(backend_data, idft1d_input_data); + + auto handle = backend->compile(f); + + handle->call({idft_output}, {backend_data}); + + auto result = read_vector(idft_output); + size_t num_of_elems = result.size(); + for (std::size_t j = 0; j < num_of_elems; ++j) + { + EXPECT_NEAR(result[j], expected_result[j], 0.000002); + } +} + +NGRAPH_TEST(${BACKEND_NAME}, idft2d_eval_1) +{ + auto data = std::make_shared(element::f32, Shape{4, 6, 8, 2}); + auto axes_input = op::Constant::create(element::i64, Shape{2}, {1, 2}); + auto idft = std::make_shared(data, axes_input); + + auto f = make_shared(idft, ParameterVector{data}); + + auto backend = runtime::Backend::create("${BACKEND_NAME}"); + auto idft_output = backend->create_tensor(element::f32, Shape{4, 6, 8, 2}); + + auto backend_data = backend->create_tensor(element::f32, Shape{4, 6, 8, 2}); + copy_data(backend_data, idft2d_input_data_1); + + auto handle = backend->compile(f); + + handle->call({idft_output}, {backend_data}); + + auto result = read_vector(idft_output); + size_t num_of_elems = result.size(); + for (std::size_t j = 0; j < num_of_elems; ++j) + { + EXPECT_NEAR(result[j], expected_result_1[j], 0.000003); + } +} + +NGRAPH_TEST(${BACKEND_NAME}, idft2d_eval) +{ + auto data = std::make_shared(element::f32, Shape{2, 10, 10, 2}); + auto axes_input = op::Constant::create(element::i64, Shape{2}, {1, 2}); + auto idft = std::make_shared(data, axes_input); + + auto f = make_shared(idft, ParameterVector{data}); + + auto backend = runtime::Backend::create("${BACKEND_NAME}"); + auto idft_output = backend->create_tensor(element::f32, Shape{2, 10, 10, 2}); + + auto backend_data = backend->create_tensor(element::f32, Shape{2, 10, 10, 2}); + copy_data(backend_data, idft2d_input_data); + + auto handle = backend->compile(f); + + handle->call({idft_output}, {backend_data}); + + auto result = read_vector(idft_output); + size_t num_of_elems = result.size(); + for (std::size_t j = 0; j < num_of_elems; ++j) + { + EXPECT_NEAR(result[j], expected_result[j], 0.000003); + } +} + +NGRAPH_TEST(${BACKEND_NAME}, idft2d_eval_float16) +{ + auto data = std::make_shared(element::f16, Shape{2, 10, 10, 2}); + auto axes_input = op::Constant::create(element::i64, Shape{2}, {1, 2}); + auto idft = std::make_shared(data, axes_input); + + auto f = make_shared(idft, ParameterVector{data}); + + auto backend = runtime::Backend::create("${BACKEND_NAME}"); + auto idft_output = backend->create_tensor(element::f16, Shape{2, 10, 10, 2}); + + auto backend_data = backend->create_tensor(element::f16, Shape{2, 10, 10, 2}); + copy_data(backend_data, from_float_vector(idft2d_input_data)); + + auto handle = backend->compile(f); + + handle->call({idft_output}, {backend_data}); + + auto result = to_float_vector(read_vector(idft_output)); + size_t num_of_elems = result.size(); + for (std::size_t j = 0; j < num_of_elems; ++j) + { + EXPECT_NEAR(result[j], expected_float16_idft2d_result[j], 0.0002); + } +} + +NGRAPH_TEST(${BACKEND_NAME}, idft2d_eval_bfloat16) +{ + auto data = std::make_shared(element::bf16, Shape{2, 10, 10, 2}); + auto axes_input = op::Constant::create(element::i64, Shape{2}, {1, 2}); + auto idft = std::make_shared(data, axes_input); + + auto f = make_shared(idft, ParameterVector{data}); + + auto backend = runtime::Backend::create("${BACKEND_NAME}"); + auto idft_output = backend->create_tensor(element::bf16, Shape{2, 10, 10, 2}); + + auto backend_data = backend->create_tensor(element::bf16, Shape{2, 10, 10, 2}); + copy_data(backend_data, bfloat16::from_float_vector(idft2d_input_data)); + + auto handle = backend->compile(f); + + handle->call({idft_output}, {backend_data}); + + auto result = bfloat16::to_float_vector(read_vector(idft_output)); + size_t num_of_elems = result.size(); + for (std::size_t j = 0; j < num_of_elems; ++j) + { + EXPECT_NEAR(result[j], expected_bfloat_idft2d_result[j], 0.004); + } +} + +NGRAPH_TEST(${BACKEND_NAME}, idft2d_eval_i32) +{ + auto data = std::make_shared(element::f32, Shape{2, 10, 10, 2}); + auto axes_input = op::Constant::create(element::i32, Shape{2}, {1, 2}); + auto idft = std::make_shared(data, axes_input); + + auto f = make_shared(idft, ParameterVector{data}); + + auto backend = runtime::Backend::create("${BACKEND_NAME}"); + auto idft_output = backend->create_tensor(element::f32, Shape{2, 10, 10, 2}); + + auto backend_data = backend->create_tensor(element::f32, Shape{2, 10, 10, 2}); + copy_data(backend_data, idft2d_input_data); + + auto handle = backend->compile(f); + + handle->call({idft_output}, {backend_data}); + + auto result = read_vector(idft_output); + size_t num_of_elems = result.size(); + for (std::size_t j = 0; j < num_of_elems; ++j) + { + EXPECT_NEAR(result[j], expected_result[j], 0.000003); + } +} + +NGRAPH_TEST(${BACKEND_NAME}, idft3d_eval_1) +{ + auto data = std::make_shared(element::f32, Shape{4, 6, 8, 2}); + auto axes_input = op::Constant::create(element::i64, Shape{3}, {0, 1, 2}); + auto idft = std::make_shared(data, axes_input); + + auto f = make_shared(idft, ParameterVector{data}); + + auto backend = runtime::Backend::create("${BACKEND_NAME}"); + auto idft_output = backend->create_tensor(element::f32, Shape{4, 6, 8, 2}); + + auto backend_data = backend->create_tensor(element::f32, Shape{4, 6, 8, 2}); + copy_data(backend_data, idft3d_input_data_1); + + auto handle = backend->compile(f); + + handle->call({idft_output}, {backend_data}); + + auto result = read_vector(idft_output); + size_t num_of_elems = result.size(); + for (std::size_t j = 0; j < num_of_elems; ++j) + { + EXPECT_NEAR(result[j], expected_result_1[j], 0.000003); + } +} + +NGRAPH_TEST(${BACKEND_NAME}, idft3d_eval) +{ + auto data = std::make_shared(element::f32, Shape{2, 10, 10, 2}); + auto axes_input = op::Constant::create(element::i64, Shape{3}, {0, 1, 2}); + auto idft = std::make_shared(data, axes_input); + + auto f = make_shared(idft, ParameterVector{data}); + + auto backend = runtime::Backend::create("${BACKEND_NAME}"); + auto idft_output = backend->create_tensor(element::f32, Shape{2, 10, 10, 2}); + + auto backend_data = backend->create_tensor(element::f32, Shape{2, 10, 10, 2}); + copy_data(backend_data, idft3d_input_data); + + auto handle = backend->compile(f); + + handle->call({idft_output}, {backend_data}); + + auto result = read_vector(idft_output); + size_t num_of_elems = result.size(); + for (std::size_t j = 0; j < num_of_elems; ++j) + { + EXPECT_NEAR(result[j], expected_result[j], 0.000003); + } +} + +NGRAPH_TEST(${BACKEND_NAME}, idft3d_eval_float16) +{ + auto data = std::make_shared(element::f16, Shape{2, 10, 10, 2}); + auto axes_input = op::Constant::create(element::i64, Shape{3}, {0, 1, 2}); + auto idft = std::make_shared(data, axes_input); + + auto f = make_shared(idft, ParameterVector{data}); + + auto backend = runtime::Backend::create("${BACKEND_NAME}"); + auto idft_output = backend->create_tensor(element::f16, Shape{2, 10, 10, 2}); + + auto backend_data = backend->create_tensor(element::f16, Shape{2, 10, 10, 2}); + copy_data(backend_data, from_float_vector(idft3d_input_data)); + + auto handle = backend->compile(f); + + handle->call({idft_output}, {backend_data}); + + auto result = to_float_vector(read_vector(idft_output)); + size_t num_of_elems = result.size(); + for (std::size_t j = 0; j < num_of_elems; ++j) + { + EXPECT_NEAR(result[j], expected_float16_idft3d_result[j], 0.000003); + } +} + +NGRAPH_TEST(${BACKEND_NAME}, idft3d_eval_bfloat16) +{ + auto data = std::make_shared(element::bf16, Shape{2, 10, 10, 2}); + auto axes_input = op::Constant::create(element::i64, Shape{3}, {0, 1, 2}); + auto idft = std::make_shared(data, axes_input); + + auto f = make_shared(idft, ParameterVector{data}); + + auto backend = runtime::Backend::create("${BACKEND_NAME}"); + auto idft_output = backend->create_tensor(element::bf16, Shape{2, 10, 10, 2}); + + auto backend_data = backend->create_tensor(element::bf16, Shape{2, 10, 10, 2}); + copy_data(backend_data, bfloat16::from_float_vector(idft3d_input_data)); + + auto handle = backend->compile(f); + + handle->call({idft_output}, {backend_data}); + + auto result = bfloat16::to_float_vector(read_vector(idft_output)); + size_t num_of_elems = result.size(); + for (std::size_t j = 0; j < num_of_elems; ++j) + { + EXPECT_NEAR(result[j], expected_bfloat_idft3d_result[j], 0.000003); + } +} + +NGRAPH_TEST(${BACKEND_NAME}, idft3d_eval_i32) +{ + auto data = std::make_shared(element::f32, Shape{2, 10, 10, 2}); + auto axes_input = op::Constant::create(element::i32, Shape{3}, {0, 1, 2}); + auto idft = std::make_shared(data, axes_input); + + auto f = make_shared(idft, ParameterVector{data}); + + auto backend = runtime::Backend::create("${BACKEND_NAME}"); + auto idft_output = backend->create_tensor(element::f32, Shape{2, 10, 10, 2}); + + auto backend_data = backend->create_tensor(element::f32, Shape{2, 10, 10, 2}); + copy_data(backend_data, idft3d_input_data); + + auto handle = backend->compile(f); + + handle->call({idft_output}, {backend_data}); + + auto result = read_vector(idft_output); + size_t num_of_elems = result.size(); + for (std::size_t j = 0; j < num_of_elems; ++j) + { + EXPECT_NEAR(result[j], expected_result[j], 0.000003); + } +} diff --git a/ngraph/test/runtime/ie/unit_test.manifest b/ngraph/test/runtime/ie/unit_test.manifest index 32391961a06605..394f63f487c1da 100644 --- a/ngraph/test/runtime/ie/unit_test.manifest +++ b/ngraph/test/runtime/ie/unit_test.manifest @@ -1061,7 +1061,7 @@ rnn_cell_zero_bias_default_attrs # Activation function hardsigmoid is not supported gru_cell_hardsigmoid_activation_function -# Roll is not implemented yet for CPU, GPU +# Roll is not implemented yet for CPU, GPU roll_2d_input roll_2d_input_negative_shift roll_repeated_axes @@ -1164,6 +1164,41 @@ IE_CPU.onnx_model_reduce_sum_13_axes_as_0_dim_input # output mismatch IE_CPU.gather_nd_batch_1d_from_3d_negative +# DFT is not implemented yet in plugins +IE_CPU.dft1d_eval +IE_CPU.dft2d_eval +IE_CPU.dft3d_eval +IE_CPU.dft1d_eval_i32 +IE_CPU.dft2d_eval_i32 +IE_CPU.dft3d_eval_i32 +IE_CPU.dft1d_signal_size_eval +IE_CPU.dft1d_eval_bfloat16 +IE_CPU.dft2d_eval_bfloat16 +IE_CPU.dft3d_eval_bfloat16 +IE_CPU.dft1d_eval_float16 +IE_CPU.dft2d_eval_float16 +IE_CPU.dft3d_eval_float16 +IE_CPU.dft1d_eval_1 +IE_CPU.dft2d_eval_1 +IE_CPU.dft3d_eval_1 + +# IDFT is not implemented yet in plugins +IE_CPU.idft1d_eval +IE_CPU.idft2d_eval +IE_CPU.idft3d_eval +IE_CPU.idft1d_eval_i32 +IE_CPU.idft2d_eval_i32 +IE_CPU.idft3d_eval_i32 +IE_CPU.idft1d_eval_bfloat16 +IE_CPU.idft2d_eval_bfloat16 +IE_CPU.idft3d_eval_bfloat16 +IE_CPU.idft1d_eval_float16 +IE_CPU.idft2d_eval_float16 +IE_CPU.idft3d_eval_float16 +IE_CPU.idft1d_eval_1 +IE_CPU.idft2d_eval_1 +IE_CPU.idft3d_eval_1 + #------------------------------------------------------------------------------- # # Inference Engine GPU plugin excludes diff --git a/ngraph/test/runtime/interpreter/evaluates_map.cpp b/ngraph/test/runtime/interpreter/evaluates_map.cpp index e242a4021e1678..b3edd47f34a2a7 100644 --- a/ngraph/test/runtime/interpreter/evaluates_map.cpp +++ b/ngraph/test/runtime/interpreter/evaluates_map.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -878,6 +879,106 @@ namespace return true; } + namespace fft_v7 + { + struct InfoForFFT7 + { + std::vector input_data; + std::vector axes_data; + Shape input_data_shape; + Shape axes_data_shape; + Shape output_shape; + }; + + std::vector get_signal_size( + const std::vector>& inputs, size_t num_of_axes) + { + if (inputs.size() == 3) + { + return nms_v5::get_integers(inputs[2], inputs[2]->get_shape()); + } + + return std::vector(num_of_axes, static_cast(-1)); + } + + InfoForFFT7 get_info_for_fft7_eval(const std::vector>& inputs) + { + InfoForFFT7 result; + + result.input_data_shape = inputs[0]->get_shape(); + result.axes_data_shape = inputs[1]->get_shape(); + result.input_data = nms_v5::get_floats(inputs[0], result.input_data_shape); + result.axes_data = nms_v5::get_integers(inputs[1], result.axes_data_shape); + + auto output_shape = result.input_data_shape; + + int64_t input_rank = static_cast(result.input_data_shape.size()); + int64_t complex_data_rank = input_rank - 1; + auto canonicalized_axes = runtime::reference::canonicalize_axes(result.axes_data.data(), + result.axes_data_shape, + complex_data_rank); + + size_t num_of_axes = result.axes_data.size(); + auto signal_size = get_signal_size(inputs, num_of_axes); + + for (size_t i = 0; i < num_of_axes; ++i) + { + int64_t current_axis = canonicalized_axes[i]; + int64_t current_signal_size = signal_size[i]; + if (current_signal_size != -1) + { + output_shape[current_axis] = current_signal_size; + } + } + + result.output_shape = output_shape; + + return result; + } + } // namespace fft_v7 + + template + bool evaluate(const shared_ptr& op, + const HostTensorVector& outputs, + const HostTensorVector& inputs) + { + auto info = fft_v7::get_info_for_fft7_eval(inputs); + + std::vector fft_result(shape_size(info.output_shape), 0.0f); + runtime::reference::fft(info.input_data.data(), + info.input_data_shape, + info.axes_data.data(), + info.axes_data_shape, + fft_result.data(), + info.output_shape, + runtime::reference::FFTKind::Forward); + + const auto output_type = op->get_input_element_type(0); + runtime::reference::fft_postprocessing(outputs, output_type, fft_result); + return true; + } + + template + bool evaluate(const shared_ptr& op, + const HostTensorVector& outputs, + const HostTensorVector& inputs) + { + auto info = fft_v7::get_info_for_fft7_eval(inputs); + + std::vector fft_result(shape_size(info.output_shape), 0.0f); + runtime::reference::fft(info.input_data.data(), + info.input_data_shape, + info.axes_data.data(), + info.axes_data_shape, + fft_result.data(), + info.output_shape, + runtime::reference::FFTKind::Inverse); + + const auto output_type = op->get_input_element_type(0); + runtime::reference::fft_postprocessing(outputs, output_type, fft_result); + return true; + } + template bool evaluate(const shared_ptr& op, const HostTensorVector& outputs, diff --git a/ngraph/test/runtime/interpreter/opset_int_tbl.hpp b/ngraph/test/runtime/interpreter/opset_int_tbl.hpp index 92351719e4e9c7..2eb25b7b0ec55f 100644 --- a/ngraph/test/runtime/interpreter/opset_int_tbl.hpp +++ b/ngraph/test/runtime/interpreter/opset_int_tbl.hpp @@ -86,4 +86,6 @@ NGRAPH_OP(CTCGreedyDecoderSeqLen, op::v6) NGRAPH_OP(GatherElements, op::v6) NGRAPH_OP(MVN, ngraph::op::v6) +NGRAPH_OP(DFT, op::v7) +NGRAPH_OP(IDFT, op::v7) NGRAPH_OP(Roll, ngraph::op::v7)