mumax / 3

GPU-accelerated micromagnetic simulator
Other
447 stars 150 forks source link

Slice not accessible by GPU #250

Closed Synergy0 closed 4 years ago

Synergy0 commented 4 years ago

I am trying to set the external field of the entire material cell by cell. I think I should be able to use a mask for this but I keep getting an error: "panic: slice not accessible by GPU". Here is the code fore setting the value of the mask and applying it to B_ext:

for x := 0; x < 280; x++{ for y := 0; y < 60; y++{ for z := 0; z < 1; z++{ mask.SetVector(x, y, z, Vector(stripHx[x], 0, stripHz[x])) } } } B_ext.AddTo(mask)

Any help in getting around this would be appreciated.

Synergy0 commented 4 years ago

Here is how I'm defining my mask

mask := NewVectorMask(280, 60, 1)