Table of Contents

Class CuFftNative

Namespace
NVMathNet.Interop
Assembly
NVMath.Net.dll

Raw P/Invoke bindings for the cuFFT library.

public static class CuFftNative

Inheritance

Inherited Members

Methods

Check(CuFftResult, string?)

Throws NVMathNet.Interop.CuFftException if result is not NVMathNet.Interop.CuFftResult.Success. Optionally prefixes the message with context.

public static void Check(CuFftResult result, string? context = null)

Parameters

result CuFftResult
context string?

Create()

Creates a cuFFT plan handle. Caller must call NVMathNet.Interop.CuFftNative.Destroy(System.IntPtr) when done.

public static nint Create()

Returns

nint

Destroy(nint)

Destroys a cuFFT plan handle.

public static void Destroy(nint plan)

Parameters

plan nint

ExecC2C(nint, void*, void*, CuFftDirection)

Executes a complex-to-complex single-precision FFT (C2C).

public static void ExecC2C(nint plan, void* idata, void* odata, CuFftDirection direction)

Parameters

plan nint
idata void*
odata void*
direction CuFftDirection

ExecC2R(nint, void*, void*)

Executes a complex-to-real single-precision inverse FFT (C2R).

public static void ExecC2R(nint plan, void* idata, void* odata)

Parameters

plan nint
idata void*
odata void*

ExecD2Z(nint, void*, void*)

Executes a real-to-complex double-precision forward FFT (D2Z).

public static void ExecD2Z(nint plan, void* idata, void* odata)

Parameters

plan nint
idata void*
odata void*

ExecR2C(nint, void*, void*)

Executes a real-to-complex single-precision forward FFT (R2C).

public static void ExecR2C(nint plan, void* idata, void* odata)

Parameters

plan nint
idata void*
odata void*

ExecZ2D(nint, void*, void*)

Executes a complex-to-real double-precision inverse FFT (Z2D).

public static void ExecZ2D(nint plan, void* idata, void* odata)

Parameters

plan nint
idata void*
odata void*

ExecZ2Z(nint, void*, void*, CuFftDirection)

Executes a complex-to-complex double-precision FFT (Z2Z).

public static void ExecZ2Z(nint plan, void* idata, void* odata, CuFftDirection direction)

Parameters

plan nint
idata void*
odata void*
direction CuFftDirection

GetSize(nint)

Returns the size of the workspace (in bytes) required by plan.

public static nuint GetSize(nint plan)

Parameters

plan nint

Returns

nuint

GetVersion()

Returns the cuFFT library version number (e.g. 11000 = v11.0).

public static int GetVersion()

Returns

int

MakePlanMany(nint, int, long[], long[]?, long, long, long[]?, long, long, CuFftType, long)

Builds a batched N-D FFT plan using the 64-bit cufftMakePlanMany64 API. Returns the required workspace size in bytes.

public static nuint MakePlanMany(nint plan, int rank, long[] n, long[]? inembed, long istride, long idist, long[]? onembed, long ostride, long odist, CuFftType type, long batch)

Parameters

plan nint

Plan handle.

rank int

Number of FFT dimensions.

n long[]

Size of each FFT dimension.

inembed long[]?

Storage dimensions of the input data; null = contiguous.

istride long

Distance between successive input elements in the innermost dimension.

idist long

Stride between the first element of consecutive batches in the input.

onembed long[]?

Storage dimensions of the output data; null = contiguous.

ostride long

Distance between successive output elements in the innermost dimension.

odist long

Stride between the first element of consecutive batches in the output.

type CuFftType

Transform type (e.g. NVMathNet.Interop.CuFftType.C2C).

batch long

Number of independent transforms in the batch.

Returns

nuint

SetAutoAllocation(nint, bool)

Controls whether cuFFT automatically allocates its own workspace. Set to false to supply a custom workspace via NVMathNet.Interop.CuFftNative.SetWorkArea(System.IntPtr,System.Void*).

public static void SetAutoAllocation(nint plan, bool autoAllocate)

Parameters

plan nint
autoAllocate bool

SetStream(nint, nint)

Associates a CUDA stream with the plan for asynchronous execution.

public static void SetStream(nint plan, nint stream)

Parameters

plan nint
stream nint

SetWorkArea(nint, void*)

Provides a caller-owned device workspace buffer to the plan.

public static void SetWorkArea(nint plan, void* workArea)

Parameters

plan nint
workArea void*

XtExec(nint, void*, void*, CuFftDirection)

Executes a cuFFTXt transform (mixed-precision / custom data types).

public static void XtExec(nint plan, void* input, void* output, CuFftDirection direction)

Parameters

plan nint
input void*
output void*
direction CuFftDirection

XtMakePlanMany(nint, int, long[], long[]?, long, long, int, long[]?, long, long, int, long, int)

Builds a batched N-D FFT plan using the cuFFTXt cufftXtMakePlanMany API for mixed-precision and custom data types. Returns the required workspace size in bytes.

public static nuint XtMakePlanMany(nint plan, int rank, long[] n, long[]? inembed, long istride, long idist, int inputType, long[]? onembed, long ostride, long odist, int outputType, long batch, int executionType)

Parameters

plan nint
rank int
n long[]
inembed long[]?
istride long
idist long
inputType int
onembed long[]?
ostride long
odist long
outputType int
batch long
executionType int

Returns

nuint