From aae1d8b0a237b5af914187177ccb3b13db67fbe7 Mon Sep 17 00:00:00 2001 From: Christoph Ruegg Date: Wed, 26 Oct 2016 09:31:53 +0200 Subject: [PATCH] FFT-MKL: cleanup - drop redundant suffixes --- src/NativeProviders/MKL/fft.cpp | 24 +++++++++---------- .../Providers/Common/Mkl/SafeNativeMethods.cs | 8 +++---- .../Mkl/MklFourierTransformProvider.cs | 4 ++-- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/NativeProviders/MKL/fft.cpp b/src/NativeProviders/MKL/fft.cpp index 76afb112..870e6e77 100644 --- a/src/NativeProviders/MKL/fft.cpp +++ b/src/NativeProviders/MKL/fft.cpp @@ -13,7 +13,7 @@ inline MKL_INT64 fft_free(DFTI_DESCRIPTOR_HANDLE* handle) } template -inline MKL_INT64 fft_1d_create(DFTI_DESCRIPTOR_HANDLE* handle, const MKL_INT64 n, const Precision forward_scale, const Precision backward_scale, const DFTI_CONFIG_VALUE precision, const DFTI_CONFIG_VALUE domain) +inline MKL_INT64 fft_create_1d(DFTI_DESCRIPTOR_HANDLE* handle, const MKL_INT64 n, const Precision forward_scale, const Precision backward_scale, const DFTI_CONFIG_VALUE precision, const DFTI_CONFIG_VALUE domain) { MKL_LONG status = DftiCreateDescriptor(handle, precision, domain, 1, static_cast(n)); DFTI_DESCRIPTOR_HANDLE descriptor = *handle; @@ -24,7 +24,7 @@ inline MKL_INT64 fft_1d_create(DFTI_DESCRIPTOR_HANDLE* handle, const MKL_INT64 n } template -inline MKL_INT64 fft_1d_inplace(const DFTI_DESCRIPTOR_HANDLE handle, Data x[], FFT fft) +inline MKL_INT64 fft_compute(const DFTI_DESCRIPTOR_HANDLE handle, Data x[], FFT fft) { MKL_LONG status = fft(handle, x); return static_cast(status); @@ -39,31 +39,31 @@ extern "C" { DLLEXPORT MKL_INT64 z_fft_create(DFTI_DESCRIPTOR_HANDLE* handle, const MKL_INT64 n, const double forward_scale, const double backward_scale) { - return fft_1d_create(handle, n, forward_scale, backward_scale, DFTI_DOUBLE, DFTI_COMPLEX); + return fft_create_1d(handle, n, forward_scale, backward_scale, DFTI_DOUBLE, DFTI_COMPLEX); } DLLEXPORT MKL_INT64 c_fft_create(DFTI_DESCRIPTOR_HANDLE* handle, const MKL_INT64 n, const float forward_scale, const float backward_scale) { - return fft_1d_create(handle, n, forward_scale, backward_scale, DFTI_SINGLE, DFTI_COMPLEX); + return fft_create_1d(handle, n, forward_scale, backward_scale, DFTI_SINGLE, DFTI_COMPLEX); } - DLLEXPORT MKL_INT64 z_fft_forward_inplace(const DFTI_DESCRIPTOR_HANDLE handle, MKL_Complex16 x[]) + DLLEXPORT MKL_INT64 z_fft_forward(const DFTI_DESCRIPTOR_HANDLE handle, MKL_Complex16 x[]) { - return fft_1d_inplace(handle, x, DftiComputeForward); + return fft_compute(handle, x, DftiComputeForward); } - DLLEXPORT MKL_INT64 c_fft_forward_inplace(const DFTI_DESCRIPTOR_HANDLE handle, MKL_Complex8 x[]) + DLLEXPORT MKL_INT64 c_fft_forward(const DFTI_DESCRIPTOR_HANDLE handle, MKL_Complex8 x[]) { - return fft_1d_inplace(handle, x, DftiComputeForward); + return fft_compute(handle, x, DftiComputeForward); } - DLLEXPORT MKL_INT64 z_fft_backward_inplace(const DFTI_DESCRIPTOR_HANDLE handle, MKL_Complex16 x[]) + DLLEXPORT MKL_INT64 z_fft_backward(const DFTI_DESCRIPTOR_HANDLE handle, MKL_Complex16 x[]) { - return fft_1d_inplace(handle, x, DftiComputeBackward); + return fft_compute(handle, x, DftiComputeBackward); } - DLLEXPORT MKL_INT64 c_fft_backward_inplace(const DFTI_DESCRIPTOR_HANDLE handle, MKL_Complex8 x[]) + DLLEXPORT MKL_INT64 c_fft_backward(const DFTI_DESCRIPTOR_HANDLE handle, MKL_Complex8 x[]) { - return fft_1d_inplace(handle, x, DftiComputeBackward); + return fft_compute(handle, x, DftiComputeBackward); } } diff --git a/src/Numerics/Providers/Common/Mkl/SafeNativeMethods.cs b/src/Numerics/Providers/Common/Mkl/SafeNativeMethods.cs index 7d84f097..0378e5c4 100644 --- a/src/Numerics/Providers/Common/Mkl/SafeNativeMethods.cs +++ b/src/Numerics/Providers/Common/Mkl/SafeNativeMethods.cs @@ -393,16 +393,16 @@ namespace MathNet.Numerics.Providers.Common.Mkl internal static extern long c_fft_create([Out] out IntPtr handle, long n, float forward_scale, float backward_scale); [DllImport(_DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] - internal static extern long z_fft_forward_inplace([In] IntPtr handle, [In, Out] Complex[] x); + internal static extern long z_fft_forward([In] IntPtr handle, [In, Out] Complex[] x); [DllImport(_DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] - internal static extern long c_fft_forward_inplace([In] IntPtr handle, [In, Out] Complex32[] x); + internal static extern long c_fft_forward([In] IntPtr handle, [In, Out] Complex32[] x); [DllImport(_DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] - internal static extern long z_fft_backward_inplace([In] IntPtr handle, [In, Out] Complex[] x); + internal static extern long z_fft_backward([In] IntPtr handle, [In, Out] Complex[] x); [DllImport(_DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)] - internal static extern long c_fft_backward_inplace([In] IntPtr handle, [In, Out] Complex32[] x); + internal static extern long c_fft_backward([In] IntPtr handle, [In, Out] Complex32[] x); #endregion FFT diff --git a/src/Numerics/Providers/FourierTransform/Mkl/MklFourierTransformProvider.cs b/src/Numerics/Providers/FourierTransform/Mkl/MklFourierTransformProvider.cs index 494de40a..f9ab7d94 100644 --- a/src/Numerics/Providers/FourierTransform/Mkl/MklFourierTransformProvider.cs +++ b/src/Numerics/Providers/FourierTransform/Mkl/MklFourierTransformProvider.cs @@ -181,14 +181,14 @@ namespace MathNet.Numerics.Providers.FourierTransform.Mkl public void ForwardInplace(Complex[] complex, FourierTransformScaling scaling) { Kernel kernel = Configure(complex.Length, scaling); - SafeNativeMethods.z_fft_forward_inplace(kernel.Handle, complex); + SafeNativeMethods.z_fft_forward(kernel.Handle, complex); Release(kernel); } public void BackwardInplace(Complex[] complex, FourierTransformScaling scaling) { Kernel kernel = Configure(complex.Length, scaling); - SafeNativeMethods.z_fft_backward_inplace(kernel.Handle, complex); + SafeNativeMethods.z_fft_backward(kernel.Handle, complex); Release(kernel); }