zer011b / fdtd3d

fdtd3d is an open source 1D, 2D, 3D FDTD electromagnetics solver with MPI, OpenMP and CUDA support for x64, ARM, ARM64, RISC-V, PowerPC architectures
GNU General Public License v2.0
119 stars 33 forks source link

Fix bug with not set cudaSolverSettings on non-default device #141

Closed zer011b closed 4 years ago

zer011b commented 4 years ago

cudaSetDevice should be called prior all other Cuda API calls, because before cudaSetDevice all activity happens with regards to the context of the default device (0). For example, if memory is allocated, it is allocated on the default device, and won't be available after cudaSetDevice(i) call (if i != 0).