Example #1
0
// Destroys the plan.
func (plan *Handle) Destroy() {
	err := Result(C.cufftDestroy(C.cufftHandle(*plan)))
	*plan = 0 // make sure plan is not used anymore
	if err != SUCCESS {
		panic(err)
	}
}
Example #2
0
// Sets the FFTW compatibility mode
func (plan Handle) SetCompatibilityMode(mode CompatibilityMode) {
	err := Result(C.cufftSetCompatibilityMode(
		C.cufftHandle(plan),
		C.cufftCompatibility(mode)))
	if err != SUCCESS {
		panic(err)
	}
}
Example #3
0
// Sets the cuda stream for this plan
func (plan Handle) SetStream(stream cu.Stream) {
	err := Result(C.cufftSetStream(
		C.cufftHandle(plan),
		C.cudaStream_t(unsafe.Pointer(uintptr(stream)))))
	if err != SUCCESS {
		panic(err)
	}
}
Example #4
0
// Execute Double Complex-to-Real plan
func (plan Handle) ExecZ2D(idata, odata cu.DevicePtr) {
	err := Result(C.cufftExecZ2D(
		C.cufftHandle(plan),
		(*C.cufftDoubleComplex)(unsafe.Pointer(uintptr(idata))),
		(*C.cufftDoubleReal)(unsafe.Pointer(uintptr(odata)))))
	if err != SUCCESS {
		panic(err)
	}
}
Example #5
0
// Execute Complex-to-Real plan
func (plan Handle) ExecC2R(idata, odata uintptr) {
	err := Result(C.cufftExecC2R(
		C.cufftHandle(plan),
		(*C.cufftComplex)(unsafe.Pointer(idata)),
		(*C.cufftReal)(unsafe.Pointer(odata))))
	if err != SUCCESS {
		panic(err)
	}
}
Example #6
0
// Execute Double Complex-to-Complex plan
func (plan Handle) ExecZ2Z(idata, odata cu.DevicePtr, direction int) {
	err := Result(C.cufftExecZ2Z(
		C.cufftHandle(plan),
		(*C.cufftDoubleComplex)(unsafe.Pointer(uintptr(idata))),
		(*C.cufftDoubleComplex)(unsafe.Pointer(uintptr(odata))),
		C.int(direction)))
	if err != SUCCESS {
		panic(err)
	}
}
Example #7
0
// Execute Complex-to-Complex plan
func (plan Handle) ExecC2C(idata, odata uintptr, direction int) {
	err := Result(C.cufftExecC2C(
		C.cufftHandle(plan),
		(*C.cufftComplex)(unsafe.Pointer(idata)),
		(*C.cufftComplex)(unsafe.Pointer(odata)),
		C.int(direction)))
	if err != SUCCESS {
		panic(err)
	}
}