STORMM Source Documentation
Loading...
Searching...
No Matches
hpc_config.h
1// -*-c++-*-
2#ifndef STORMM_HPC_CONFIG_H
3#define STORMM_HPC_CONFIG_H
4
5#ifdef STORMM_USE_CUDA
6#include <cusolverDn.h>
7#include "cublas_v2.h"
8#endif
9#include "copyright.h"
10#include "Constants/behavior.h"
11#include "gpu_details.h"
12
13namespace stormm {
14namespace card {
15
16using constants::ExceptionResponse;
17
20class HpcConfig {
21public:
22
25 HpcConfig(ExceptionResponse policy = ExceptionResponse::DIE);
26
29
32 int getOverallGpuCount() const;
33
36
40
44 GpuDetails getGpuInfo(int gpu_index) const;
45
49 std::vector<int> getGpuDevice(int requested_count) const;
50
51#ifdef STORMM_USE_HPC
53 cublasHandle_t getCuBlasHandle() const;
54
56 cusolverDnHandle_t getCuSolverHandle() const;
57#endif
58
59private:
60 int overall_gpu_count;
61 int available_gpu_count;
62 int supported_gpu_count;
63 std::vector<GpuDetails> gpu_list;
64#ifdef STORMM_USE_HPC
65 cublasHandle_t cublas_handle;
66 cusolverDnHandle_t cusolver_handle;
67#endif
68};
69
74const std::vector<GpuDetails> queryGpuStats(ExceptionResponse policy = ExceptionResponse::DIE);
75
76} // namespace card
77} // namespace stormm
78
79#endif
Pertinent aspects of one particular GPU. Condensing the data for each GPU in this manner helps to ens...
Definition gpu_details.h:27
GpuDetails getGpuInfo(int gpu_index) const
Return information on a particular GPU in the server or workstation.
std::vector< int > getGpuDevice(int requested_count) const
Return the indices and specs of one or more GPU devices.
int getOverallGpuCount() const
Return the total number of GPUs in the server or workstation, whether they are supported by STORMM or...
~HpcConfig()
Destructor encapsulates HPC shutdown protocols.
HpcConfig(ExceptionResponse policy=ExceptionResponse::DIE)
Constructor for an HpcConfig object. One such object should be present in any given STORMM executable...
int getSupportedGpuCount() const
Return the count of supported and supported GPUs in the server or workstation. The available GPUs are...
int getAvailableGpuCount() const
Return the count of available and supported GPUs in the server or workstation.