Skip to content

Commit

Permalink
Merge branch 'gpu_flops' into marenz.update_ci
Browse files Browse the repository at this point in the history
  • Loading branch information
marenz2569 committed Jan 17, 2025
2 parents 4dd5516 + c37f83e commit 31f3355
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
13 changes: 8 additions & 5 deletions include/firestarter/Cuda/Cuda.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,14 @@ class Cuda {

public:
/// Initilize the cuda class. This will start a thread running the Cuda::initGpus function and wait until all gpus
/// are inititialized. \arg LoadVar A reference to the variable that controlls the current load of Firestarter. \arg
/// UseFloat Set to true if we want to stress using single precision floating points. \arg UseDouble Set to true if
/// we want to stress using double precision floating points. If neither UseFloat or UseDouble is set the precision
/// will be choosen automatically. \arg MatrixSize Set to a specific matrix size which will be choosen for the gemm
/// operation or set to 0 for automatic selection. \arg Gpus Select the number of gpus to stress or -1 for all.
/// are inititialized.
/// \arg LoadVar A reference to the variable that controlls the current load of Firestarter.
/// \arg UseFloat Set to true if we want to stress using single precision floating points.
/// \arg UseDouble Set to true if we want to stress using double precision floating points. If neither UseFloat or
/// UseDouble is set the precision will be choosen automatically.
/// \arg MatrixSize Set to a specific matrix size which will be choosen for the gemm operation or set to 0 for
/// automatic selection.
/// \arg Gpus Select the number of gpus to stress or -1 for all.
Cuda(const volatile firestarter::LoadThreadWorkType& LoadVar, bool UseFloat, bool UseDouble, unsigned MatrixSize,
int Gpus)
#if defined(FIRESTARTER_BUILD_CUDA) || defined(FIRESTARTER_BUILD_HIP)
Expand Down
7 changes: 4 additions & 3 deletions src/firestarter/Cuda/Cuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ template <std::size_t Multiple> auto roundUp(int NumToRound) -> int {
/// Convert the UseDouble input (0 -> single precision, 1 -> double precision, 2 -> automatic) to either 0 or 1 for
/// float or double respectively. For CUDART_VERSION at least equal 8000 and automatic selection we check if the card
/// a singleToDoublePrecisionPerfRatio bigger than 3 and select float in this case otherwise double. In all other
/// cases automatic results in double. \arg UseDouble The input that specifies either single precision, double
/// precision or automatic selection. \arg Properties The device properties. \return The selected precision, either 0
/// or 1 for float or double respectively.
/// cases automatic results in double.
/// \arg UseDouble The input that specifies either single precision, double precision or automatic selection.
/// \arg Properties The device properties.
/// \return The selected precision, either 0 or 1 for float or double respectively.
auto getPrecision(int UseDouble, const compat::DeviceProperties& Properties) -> int {
#if (CUDART_VERSION >= 8000)
// read precision ratio (dp/sp) of GPU to choose the right variant for maximum
Expand Down

0 comments on commit 31f3355

Please sign in to comment.