![]() |
ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
|
#include "config/config.hpp"#include "utils.hpp"#include <boost/serialization/access.hpp>#include <cstddef>#include <string>#include <utility>#include <vector>
Include dependency graph for cuda/init.hpp:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Classes | |
| struct | EspressoGpuDevice |
| Struct to hold information relevant to ESPResSo about GPUs. More... | |
Functions | |
| void | cuda_init () |
| Initializes the CUDA stream. | |
| int | cuda_get_n_gpus () |
| Get the number of CUDA devices on the local host. | |
| bool | cuda_check_gpu_compute_capability (int dev) |
| Check that a given GPU has compute capability. | |
| std::string | cuda_get_gpu_name (int dev) |
| Get the name of a CUDA device. | |
| void | cuda_set_device (int dev) |
| Choose a device for future CUDA computations. | |
| int | cuda_get_device () |
| Get the current CUDA device. | |
| bool | cuda_test_device_access () |
| Test if communication to the CUDA device works. | |
| void | cuda_check_device () |
| Check that a device is available, that its compute capability is sufficient for ESPResSo, and that data can be written to and read from it. | |
| std::vector< EspressoGpuDevice > | cuda_gather_gpus () |
| Gather unique list of CUDA devices on all nodes. | |
| EspressoGpuDevice | cuda_get_device_props (int dev) |
| Get properties of a CUDA device. | |
| void | cuda_on_program_start () |
| Called on program start. | |
| void cuda_check_device | ( | ) |
Check that a device is available, that its compute capability is sufficient for ESPResSo, and that data can be written to and read from it.
Otherwise, throw an exception.
Definition at line 102 of file init_cuda.cu.
References cuda_check_gpu_compute_capability(), cuda_get_device(), cuda_get_n_gpus(), cuda_test_device_access(), and stream.
Check that a given GPU has compute capability.
The minimal compute capability required by ESPResSo is computeCapabilityMinMajor . computeCapabilityMinMinor .
| dev | CUDA device number |
false if the GPU meets the requirements, else true. Definition at line 50 of file init_cuda.cu.
References computeCapabilityMinMajor, computeCapabilityMinMinor, CUDA_CHECK, and stream.
Referenced by cuda_check_device().
| std::vector< EspressoGpuDevice > cuda_gather_gpus | ( | ) |
Gather unique list of CUDA devices on all nodes.
Gather unique list of CUDA devices on all nodes.
It relies on MPI_Get_processor_name() to get a unique identifier of the physical node, as opposed to the logical rank of which there can be more than one per node.
Definition at line 56 of file cuda/init.cpp.
References comm_cart, cuda_get_device_props(), cuda_get_n_gpus(), Utils::Mpi::gather_buffer(), invoke_skip_cuda_exceptions(), stream, and this_node.
Referenced by ScriptInterface::System::CudaInitHandle::do_call_method().
| int cuda_get_device | ( | ) |
Get the current CUDA device.
Definition at line 84 of file init_cuda.cu.
References CUDA_CHECK, and stream.
Referenced by cuda_check_device(), and ScriptInterface::System::CudaInitHandle::CudaInitHandle().
| EspressoGpuDevice cuda_get_device_props | ( | int | dev | ) |
Get properties of a CUDA device.
| dev | CUDA device number |
Definition at line 64 of file init_cuda.cu.
References CUDA_CHECK, and stream.
Referenced by cuda_gather_gpus().
| std::string cuda_get_gpu_name | ( | int | dev | ) |
Get the name of a CUDA device.
| [in] | dev | the CUDA device number to ask the name for |
Definition at line 58 of file init_cuda.cu.
References CUDA_CHECK, and stream.
Referenced by ScriptInterface::System::CudaInitHandle::do_call_method().
| int cuda_get_n_gpus | ( | ) |
Get the number of CUDA devices on the local host.
Definition at line 44 of file init_cuda.cu.
References CUDA_CHECK, and stream.
Referenced by cuda_check_device(), cuda_gather_gpus(), and ScriptInterface::System::CudaInitHandle::do_call_method().
| void cuda_init | ( | ) |
Initializes the CUDA stream.
Definition at line 42 of file init_cuda.cu.
References CUDA_CHECK, and stream.
Referenced by cuda_on_program_start().
| void cuda_on_program_start | ( | ) |
Called on program start.
Definition at line 91 of file cuda/init.cpp.
References communicator, cuda_init(), invoke_skip_cuda_exceptions(), and this_node.
Referenced by CommunicationEnvironment::CommunicationEnvironment().
Choose a device for future CUDA computations.
| dev | the device to use |
Definition at line 78 of file init_cuda.cu.
References CUDA_CHECK, and stream.
Referenced by ScriptInterface::System::CudaInitHandle::CudaInitHandle().
| bool cuda_test_device_access | ( | ) |
Test if communication to the CUDA device works.
false on success, else true. Definition at line 90 of file init_cuda.cu.
References CUDA_CHECK, and stream.
Referenced by cuda_check_device().