/// <summary> /// Provides a more accurate estimate of the work area for a custom plan than /// <see cref="EstimateMany(int, ReadOnlySpan{int}, ReadOnlySpan{int}, int, int, Span{int}, int, int, CuFFTType, int, Span{UIntPtr})"/>. /// </summary> /// <param name="plan">The plan handle.</param> /// <param name="rank">The transform.</param> /// <param name="n">The transform dimensions.</param> /// <param name="inembed">The storage dimensions of the input data.</param> /// <param name="istride">The stride of the input data.</param> /// <param name="idist">The distance of the input data.</param> /// <param name="onembed">The storage dimensions of the output data.</param> /// <param name="ostride">The stride of the output data.</param> /// <param name="odist">The distance of the output data.</param> /// <param name="type">The transform type.</param> /// <param name="batch">The number of transforms.</param> /// <param name="workSize">Populated with the estimated size in bytes.</param> /// <returns>The error code.</returns> public unsafe CuFFTResult GetSizeMany( IntPtr plan, int rank, ReadOnlySpan <int> n, ReadOnlySpan <int> inembed, int istride, int idist, Span <int> onembed, int ostride, int odist, CuFFTType type, int batch, Span <UIntPtr> workSize) { fixed(int *nPtr = n) fixed(int *inembedPtr = inembed) fixed(int *onembedPtr = onembed) fixed(UIntPtr * workSizePtr = workSize) { return(GetSizeMany( plan, rank, nPtr, inembedPtr, istride, idist, onembedPtr, ostride, odist, type, batch, workSizePtr)); } }
/// <summary> /// Estimates the work area for a custom plan. /// </summary> /// <param name="plan">The plan handle.</param> /// <param name="rank">The transform.</param> /// <param name="n">The transform dimensions.</param> /// <param name="inembed">The storage dimensions of the input data.</param> /// <param name="istride">The stride of the input data.</param> /// <param name="idist">The distance of the input data.</param> /// <param name="onembed">The storage dimensions of the output data.</param> /// <param name="ostride">The stride of the output data.</param> /// <param name="odist">The distance of the output data.</param> /// <param name="type">The transform type.</param> /// <param name="batch">The number of transforms.</param> /// <param name="workSize">The work size.</param> /// <returns>The error code.</returns> public unsafe CuFFTResult GetSizeMany( IntPtr plan, int rank, ReadOnlySpan <long> n, ReadOnlySpan <long> inembed, long istride, long idist, Span <long> onembed, long ostride, long odist, CuFFTType type, long batch, Span <UIntPtr> workSize) { fixed(long *nPtr = n) fixed(long *inembedPtr = inembed) fixed(long *onembedPtr = onembed) fixed(UIntPtr * workSizePtr = workSize) { return(GetSizeMany64( plan, rank, nPtr, inembedPtr, istride, idist, onembedPtr, ostride, odist, type, batch, workSizePtr)); } }
/// <summary> /// Configures a custom plan. /// </summary> /// <param name="rank">The transform.</param> /// <param name="n">The transform dimensions.</param> /// <param name="inembed">The storage dimensions of the input data.</param> /// <param name="istride">The stride of the input data.</param> /// <param name="idist">The distance of the input data.</param> /// <param name="onembed">The storage dimensions of the output data.</param> /// <param name="ostride">The stride of the output data.</param> /// <param name="odist">The distance of the output data.</param> /// <param name="type">The transform type.</param> /// <param name="batch">The number of transforms.</param> /// <param name="workSize">The work size.</param> /// <returns>The error code.</returns> public CuFFTResult MakePlanMany( int rank, int[] n, int[] inembed, int istride, int idist, int[] onembed, int ostride, int odist, CuFFTType type, int batch, UIntPtr[] workSize) => API.MakePlanMany( PlanHandle, rank, n, inembed, istride, idist, onembed, ostride, odist, type, batch, workSize);
/// <summary> /// Estimates the work area for a custom plan. /// </summary> /// <param name="rank">The transform.</param> /// <param name="n">The transform dimensions.</param> /// <param name="inembed">The storage dimensions of the input data.</param> /// <param name="istride">The stride of the input data.</param> /// <param name="idist">The distance of the input data.</param> /// <param name="onembed">The storage dimensions of the output data.</param> /// <param name="ostride">The stride of the output data.</param> /// <param name="odist">The distance of the output data.</param> /// <param name="type">The transform type.</param> /// <param name="batch">The number of transforms.</param> /// <param name="workSize">The work size.</param> /// <returns>The error code.</returns> public CuFFTResult GetSizeMany( int rank, long[] n, long[] inembed, long istride, long idist, long[] onembed, long ostride, long odist, CuFFTType type, long batch, UIntPtr[] workSize) => API.GetSizeMany( PlanHandle, rank, n, inembed, istride, idist, onembed, ostride, odist, type, batch, workSize);
/// <summary> /// Creates a custom plan. /// </summary> /// <param name="plan">Filled in with the created plan.</param> /// <param name="rank">The transform.</param> /// <param name="n">The transform dimensions.</param> /// <param name="inembed">The storage dimensions of the input data.</param> /// <param name="istride">The stride of the input data.</param> /// <param name="idist">The distance of the input data.</param> /// <param name="onembed">The storage dimensions of the output data.</param> /// <param name="ostride">The stride of the output data.</param> /// <param name="odist">The distance of the output data.</param> /// <param name="type">The transform type.</param> /// <param name="batch">The number of transforms.</param> /// <returns>The error code.</returns> public CuFFTResult PlanMany( out CuFFTPlan plan, int rank, int[] n, int[] inembed, int istride, int idist, int[] onembed, int ostride, int odist, CuFFTType type, int batch) { var errorCode = API.PlanMany( out var planHandle, rank, n, inembed, istride, idist, onembed, ostride, odist, type, batch); plan = errorCode == CuFFTResult.CUFFT_SUCCESS ? new CuFFTPlan(API, planHandle) : default; return(errorCode); }
/// <summary> /// Creates a 2D plan. /// </summary> /// <param name="plan">Filled in with the created plan.</param> /// <param name="nx">The transform size in the x dimension.</param> /// <param name="ny">The transform size in the y dimension.</param> /// <param name="type">The transform type.</param> /// <returns>The error code.</returns> public CuFFTResult Plan2D(out CuFFTPlan plan, int nx, int ny, CuFFTType type) { var errorCode = API.Plan2D(out var planHandle, nx, ny, type); plan = errorCode == CuFFTResult.CUFFT_SUCCESS ? new CuFFTPlan(API, planHandle) : default; return(errorCode); }
/// <summary> /// Estimates the work area for a 2D plan. /// </summary> /// <param name="nx">The transform size in the x dimension.</param> /// <param name="ny">The transform size in the y dimension.</param> /// <param name="type">The transform type.</param> /// <param name="workSize">Filled in with the estimated size in bytes.</param> /// <returns>The error code.</returns> public CuFFTResult Estimate2D( int nx, int ny, CuFFTType type, UIntPtr[] workSize) => API.Estimate2D( nx, ny, type, workSize);
/// <summary> /// Estimates the work area for a 1D plan. /// </summary> /// <param name="nx">The transform size.</param> /// <param name="type">The transform type.</param> /// <param name="batch">The number of transforms.</param> /// <param name="workSize">Filled in with the estimated size in bytes.</param> /// <returns>The error code.</returns> public CuFFTResult Estimate1D( int nx, CuFFTType type, int batch, UIntPtr[] workSize) => API.Estimate1D( nx, type, batch, workSize);
/// <summary> /// Configures a 1D plan. /// </summary> /// <param name="nx">The transform size.</param> /// <param name="type">The transform type.</param> /// <param name="batch">The number of transforms.</param> /// <param name="workSize">The work size.</param> /// <returns>The error code.</returns> public CuFFTResult MakePlan1D( int nx, CuFFTType type, int batch, UIntPtr[] workSize) => API.MakePlan1D( PlanHandle, nx, type, batch, workSize);
/// <summary> /// Estimates the work area for a 2D plan. /// </summary> /// <param name="nx">The transform size in the x dimension.</param> /// <param name="ny">The transform size in the y dimension.</param> /// <param name="type">The transform type.</param> /// <param name="workSize">Populated with the estimated size in bytes.</param> /// <returns>The error code.</returns> public CuFFTResult GetSize2D( int nx, int ny, CuFFTType type, UIntPtr[] workSize) => API.GetSize2D( PlanHandle, nx, ny, type, workSize);
/// <summary> /// Configures a 3D plan. /// </summary> /// <param name="nx">The transform size in the x dimension.</param> /// <param name="ny">The transform size in the y dimension.</param> /// <param name="nz">The transform size in the z dimension.</param> /// <param name="type">The transform type.</param> /// <param name="workSize">The work size.</param> /// <returns>The error code.</returns> public CuFFTResult MakePlan3D( int nx, int ny, int nz, CuFFTType type, UIntPtr[] workSize) => API.MakePlan3D( PlanHandle, nx, ny, nz, type, workSize);
/// <summary> /// Estimates the work area for a 1D plan. /// </summary> /// <param name="nx">The transform size.</param> /// <param name="type">The transform type.</param> /// <param name="batch">The number of transforms.</param> /// <param name="workSize">Filled in with the estimated size in bytes.</param> /// <returns>The error code.</returns> public unsafe CuFFTResult Estimate1D( int nx, CuFFTType type, int batch, Span <UIntPtr> workSize) { fixed(UIntPtr *workSizePtr = workSize) { return(Estimate1D( nx, type, batch, workSizePtr)); } }
/// <summary> /// Estimates the work area for a 2D plan. /// </summary> /// <param name="nx">The transform size in the x dimension.</param> /// <param name="ny">The transform size in the y dimension.</param> /// <param name="type">The transform type.</param> /// <param name="workSize">Filled in with the estimated size in bytes.</param> /// <returns>The error code.</returns> public unsafe CuFFTResult Estimate2D( int nx, int ny, CuFFTType type, Span <UIntPtr> workSize) { fixed(UIntPtr *workSizePtr = workSize) { return(Estimate2D( nx, ny, type, workSizePtr)); } }
/// <summary> /// Provides a more accurate estimate of the work area for a 1D plan than /// <see cref="Estimate1D(int, CuFFTType, int, Span{UIntPtr})"/>. /// </summary> /// <param name="plan">The plan handle.</param> /// <param name="nx">The transform size.</param> /// <param name="type">The transform type.</param> /// <param name="batch">The number of transforms.</param> /// <param name="workSize">Populated with the estimated size in bytes.</param> /// <returns>The error code.</returns> public unsafe CuFFTResult GetSize1D( IntPtr plan, int nx, CuFFTType type, int batch, Span <UIntPtr> workSize) { fixed(UIntPtr *workSizePtr = workSize) { return(GetSize1D( plan, nx, type, batch, workSizePtr)); } }
/// <summary> /// Provides a more accurate estimate of the work area for a 2D plan than /// <see cref="Estimate2D(int, int, CuFFTType, Span{UIntPtr})"/>. /// </summary> /// <param name="plan">The plan handle.</param> /// <param name="nx">The transform size in the x dimension.</param> /// <param name="ny">The transform size in the y dimension.</param> /// <param name="type">The transform type.</param> /// <param name="workSize">Populated with the estimated size in bytes.</param> /// <returns>The error code.</returns> public unsafe CuFFTResult GetSize2D( IntPtr plan, int nx, int ny, CuFFTType type, Span <UIntPtr> workSize) { fixed(UIntPtr *workSizePtr = workSize) { return(GetSize2D( plan, nx, ny, type, workSizePtr)); } }
/// <summary> /// Configures a 3D plan. /// </summary> /// <param name="plan">The plan handle.</param> /// <param name="nx">The transform size in the x dimension.</param> /// <param name="ny">The transform size in the y dimension.</param> /// <param name="nz">The transform size in the z dimension.</param> /// <param name="type">The transform type.</param> /// <param name="workSize">The work size.</param> /// <returns>The error code.</returns> public unsafe CuFFTResult MakePlan3D( IntPtr plan, int nx, int ny, int nz, CuFFTType type, Span <UIntPtr> workSize) { fixed(UIntPtr *workSizePtr = workSize) { return(MakePlan3D( plan, nx, ny, nz, type, workSizePtr)); } }
/// <summary> /// Estimates the work area for a custom plan. /// </summary> /// <param name="rank">The transform.</param> /// <param name="n">The transform dimensions.</param> /// <param name="inembed">The storage dimensions of the input data.</param> /// <param name="istride">The stride of the input data.</param> /// <param name="idist">The distance of the input data.</param> /// <param name="onembed">The storage dimensions of the output data.</param> /// <param name="ostride">The stride of the output data.</param> /// <param name="odist">The distance of the output data.</param> /// <param name="type">The transform type.</param> /// <param name="batch">The number of transforms.</param> /// <param name="workSize">Filled in with the estimated size in bytes.</param> /// <returns>The error code.</returns> public CuFFTResult EstimateMany( int rank, int[] n, int[] inembed, int istride, int idist, int[] onembed, int ostride, int odist, CuFFTType type, int batch, UIntPtr[] workSize) => API.EstimateMany( rank, n, inembed, istride, idist, onembed, ostride, odist, type, batch, workSize);
/// <summary> /// Creates a custom plan. /// </summary> /// <param name="plan">Filled in with the created plan.</param> /// <param name="rank">The transform.</param> /// <param name="n">The transform dimensions.</param> /// <param name="inembed">The storage dimensions of the input data.</param> /// <param name="istride">The stride of the input data.</param> /// <param name="idist">The distance of the input data.</param> /// <param name="onembed">The storage dimensions of the output data.</param> /// <param name="ostride">The stride of the output data.</param> /// <param name="odist">The distance of the output data.</param> /// <param name="type">The transform type.</param> /// <param name="batch">The number of transforms.</param> /// <returns>The error code.</returns> public unsafe CuFFTResult PlanMany( out IntPtr plan, int rank, ReadOnlySpan <int> n, ReadOnlySpan <int> inembed, int istride, int idist, Span <int> onembed, int ostride, int odist, CuFFTType type, int batch) { fixed(int *nPtr = n) fixed(int *inembedPtr = inembed) fixed(int *onembedPtr = onembed) { var errorCode = PlanMany( out var planHandle, rank, nPtr, inembedPtr, istride, idist, onembedPtr, ostride, odist, type, batch); plan = errorCode == CuFFTResult.CUFFT_SUCCESS ? planHandle : default; return(errorCode); } }