GPUE-group / GPUE

GPU Gross-Pitaevskii Equation numerical solver for Bose-Einstein condensates.
https://gpue-group.github.io/
Other
38 stars 9 forks source link

create GPU-based curl function #25

Open leios opened 5 years ago

leios commented 5 years ago

Determining the magnetic field takes a lot of time because it is CPU-only. As such, a GPU kernel would be nice... Along with an additional derivative function (psuedocode):

___global___ void derive(data, out, stride, n, dx){
    int gid = [init]
    if (gid + stride < n){
        out[gid] = (data[gid+stride] - data[gid])/dx
    }
    else{
        out[gid] = data[gid]/dx
    }
}

Here, a stride of 1 -> xDim, xDim -> yDim, xDim*yDim -> zDim derivatives

then we just use this to create our curl function, so we might want to make a separate __device__ kernel as well.