From 716ed52e7522cc0b971b04d67c6d21753d3f9091 Mon Sep 17 00:00:00 2001 From: Arne Vansteenkiste Date: Sat, 5 Dec 2015 21:21:36 +0000 Subject: [PATCH] MFM: work around CUFFT bug --- cuda/conv_mfm.go | 4 +--- test/mfm.mx3 | 5 ++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/cuda/conv_mfm.go b/cuda/conv_mfm.go index 589724718..6a4a2b80a 100644 --- a/cuda/conv_mfm.go +++ b/cuda/conv_mfm.go @@ -3,8 +3,6 @@ package cuda // Generation of Magnetic Force Microscopy images. import ( - "unsafe" - "github.com/mumax/3/data" "github.com/mumax/3/mag" ) @@ -51,7 +49,7 @@ func (c *MFMConvolution) init() { // init device buffers nc := fftR2COutputSizeFloats(c.kernSize) c.fftCBuf = NewSlice(1, nc) - c.fftRBuf = data.SliceFromPtrs(c.kernSize, data.GPUMemory, []unsafe.Pointer{c.fftCBuf.DevPtr(0)}) + c.fftRBuf = NewSlice(1, c.kernSize) c.gpuFFTKern[X] = NewSlice(1, nc) c.gpuFFTKern[Y] = NewSlice(1, nc) diff --git a/test/mfm.mx3 b/test/mfm.mx3 index befd114b7..bd40feed7 100644 --- a/test/mfm.mx3 +++ b/test/mfm.mx3 @@ -13,10 +13,9 @@ setcellsize(c, c, c) Msat = 1/mu0 setgeom(rect(400e-9, 400e-9).transl(-400e-9, 0, 0)) -m = uniform(1,0,0) +m = uniform(1,0,0.1) MFMLift = 50e-9 save(MFM) -// TODO: add expect() with value form cuda w/o cufft bug. -print(MFM.Average()) +expect("mfm", MFM.Average(), -3.28009e7, 1e5) // golden value with mumax3.9.1 2015-12-05