Marcel-Rodekamp / NSL

Nanosystem Simulation Library (NSL) implements statistical simulations for systems on the nanoscale
Other
2 stars 0 forks source link

Feature/gpu basics #80

Closed Marcel-Rodekamp closed 2 years ago

Marcel-Rodekamp commented 2 years ago

I implemented the first step towards GPU interfaces. This provides simple device handles

  1. NSL::Device
  2. NSL::GPU (a specialization of 1)
  3. NSL::CPU (a specialization of 1)

which can already handle a device ID. The Tensor class got a basic constructor

NSL::Tensor<double> A(2,2,NSL::GPU());

as well as a synchronization method (which copies data to the device)

auto Acpu = A.to(NSL::CPU());
or
auto Acpu = A.to(NSL::CPU(),/*non_blocking = */ true);

The synchronization has an example in Executables/Examples/example_GPU_Tensor (maybe we should change the name?) This interface is additional and does not break previous commits.

Marcel-Rodekamp commented 2 years ago

It does work on jureca