where the default construction --- omitting the NSL::GPU --- creates CPU tensors. The handle is in general of Type NSL::Device and is meant to encompass all the information about the device (so far only what device to pick).
Further, I added a copy function
to move a tensor directly onto the device without the need of creating a new instance.
The idea is, as soon as a tensor is on the device, i.e. on gpu/cpu, all computations involving it will be executed on that device.
If two Tensors on different devices are combined a runtime error is thrown.
Fermion Matrix
Enabling the fermion matrix for GPU computation required a little change for the lattice types. Hence the NSL::Lattice::SpatialLattice got a new function
General Support I Implemented GPU support via
where the default construction --- omitting the
NSL::GPU
--- creates CPU tensors. The handle is in general of TypeNSL::Device
and is meant to encompass all the information about the device (so far only what device to pick). Further, I added a copy functionwhich creates a copy of the tensor. As well as an inplace copy function
to move a tensor directly onto the device without the need of creating a new instance.
The idea is, as soon as a tensor is on the device, i.e. on gpu/cpu, all computations involving it will be executed on that device. If two Tensors on different devices are combined a runtime error is thrown.
Fermion Matrix Enabling the fermion matrix for GPU computation required a little change for the lattice types. Hence the
NSL::Lattice::SpatialLattice
got a new functioncopying the internal tensors to the device (inplace).