Skip to content

support real input in fft with mkl #1120

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Mar 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 54 additions & 11 deletions dpnp/backend/include/dpnp_iface_fft.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,33 +53,76 @@
* Compute the one-dimensional discrete Fourier Transform.
*
* @param[in] q_ref Reference to SYCL queue.
* @param[in] array_in Input array.
* @param[out] result Output array.
* @param[in] array1_in Input array.
* @param[out] result_out Output array.
* @param[in] input_shape Array with shape information for input array.
* @param[in] output_shape Array with shape information for output array.
* @param[in] shape_size Number of elements in @ref input_shape or @ref output_shape arrays.
* @param[in] result_shape Array with shape information for result array.
* @param[in] shape_size Number of elements in @ref input_shape or @ref result_shape arrays.
* @param[in] axis Axis ID to compute by.
* @param[in] input_boundarie Limit number of elements for @ref axis.
* @param[in] inverse Using inverse algorithm.
* @param[in] norm Normalization mode. 0 - backward, 1 - forward, 2 - ortho.
* @param[in] dep_event_vec_ref Reference to vector of SYCL events.
*/
template <typename _DataType>
template <typename _DataType_input, typename _DataType_output>
INP_DLLEXPORT DPCTLSyclEventRef dpnp_fft_fft_c(DPCTLSyclQueueRef q_ref,
const void* array_in,
void* result,
const void* array1_in,
void* result_out,
const shape_elem_type* input_shape,
const shape_elem_type* output_shape,
const shape_elem_type* result_shape,
size_t shape_size,
long axis,
long input_boundarie,
size_t inverse,
const size_t norm,
const DPCTLEventVectorRef dep_event_vec_ref);

template <typename _DataType>
INP_DLLEXPORT void dpnp_fft_fft_c(const void* array_in,
void* result,
template <typename _DataType_input, typename _DataType_output>
INP_DLLEXPORT void dpnp_fft_fft_c(const void* array1_in,
void* result_out,
const shape_elem_type* input_shape,
const shape_elem_type* output_shape,
size_t shape_size,
long axis,
long input_boundarie,
size_t inverse,
const size_t norm);


/**
* @ingroup BACKEND_FFT_API
* @brief 1D discrete Fourier Transform.
*
* Compute the one-dimensional discrete Fourier Transform for real input.
*
* @param[in] q_ref Reference to SYCL queue.
* @param[in] array1_in Input array.
* @param[out] result_out Output array.
* @param[in] input_shape Array with shape information for input array.
* @param[in] result_shape Array with shape information for result array.
* @param[in] shape_size Number of elements in @ref input_shape or @ref result_shape arrays.
* @param[in] axis Axis ID to compute by.
* @param[in] input_boundarie Limit number of elements for @ref axis.
* @param[in] inverse Using inverse algorithm.
* @param[in] norm Normalization mode. 0 - backward, 1 - forward, 2 - ortho.
* @param[in] dep_event_vec_ref Reference to vector of SYCL events.
*/
template <typename _DataType_input, typename _DataType_output>
INP_DLLEXPORT DPCTLSyclEventRef dpnp_fft_rfft_c(DPCTLSyclQueueRef q_ref,
const void* array1_in,
void* result_out,
const shape_elem_type* input_shape,
const shape_elem_type* result_shape,
size_t shape_size,
long axis,
long input_boundarie,
size_t inverse,
const size_t norm,
const DPCTLEventVectorRef dep_event_vec_ref);

template <typename _DataType_input, typename _DataType_output>
INP_DLLEXPORT void dpnp_fft_fft_c(const void* array1_in,
void* result_out,
const shape_elem_type* input_shape,
const shape_elem_type* output_shape,
size_t shape_size,
Expand Down
2 changes: 2 additions & 0 deletions dpnp/backend/include/dpnp_iface_fptr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ enum class DPNPFuncName : size_t
DPNP_FN_FABS_EXT, /**< Used in numpy.fabs() impl, requires extra parameters */
DPNP_FN_FFT_FFT, /**< Used in numpy.fft.fft() impl */
DPNP_FN_FFT_FFT_EXT, /**< Used in numpy.fft.fft() impl, requires extra parameters */
DPNP_FN_FFT_RFFT, /**< Used in numpy.fft.rfft() impl */
DPNP_FN_FFT_RFFT_EXT, /**< Used in numpy.fft.rfft() impl, requires extra parameters */
DPNP_FN_FILL_DIAGONAL, /**< Used in numpy.fill_diagonal() impl */
DPNP_FN_FILL_DIAGONAL_EXT, /**< Used in numpy.fill_diagonal() impl, requires extra parameters */
DPNP_FN_FLATTEN, /**< Used in numpy.flatten() impl */
Expand Down
Loading