Skip to content

Commit

Permalink
MFM: work around CUFFT bug
Browse files Browse the repository at this point in the history
  • Loading branch information
barnex committed Dec 5, 2015
1 parent a9cae13 commit 716ed52
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 1 addition & 3 deletions cuda/conv_mfm.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package cuda
// Generation of Magnetic Force Microscopy images.

import (
"unsafe"

"github.com/mumax/3/data"
"github.com/mumax/3/mag"
)
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 2 additions & 3 deletions test/mfm.mx3
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 716ed52

Please sign in to comment.