QMCPACK
PlatformSelector< KIND > Class Template Reference
+ Collaboration diagram for PlatformSelector< KIND >:

Public Member Functions

template<>
const std::vector< std::string > candidate_values
 
template<>
PlatformKind selectPlatform (std::string_view value)
 
template<>
const std::vector< std::string > candidate_values
 
template<>
PlatformKind selectPlatform (std::string_view value)
 
template<>
const std::vector< std::string > candidate_values
 
template<>
PlatformKind selectPlatform (std::string_view value)
 
template<>
const std::vector< std::string > candidate_values
 
template<>
const std::vector< std::string > candidate_values
 
template<>
const std::vector< std::string > candidate_values
 

Static Public Member Functions

static PlatformKind selectPlatform (std::string_view value)
 

Static Public Attributes

static const std::vector< std::string > candidate_values
 

Detailed Description

template<SelectorKind KIND>
class qmcplusplus::PlatformSelector< KIND >

Definition at line 32 of file PlatformSelector.hpp.

Member Function Documentation

◆ candidate_values() [1/6]

◆ candidate_values() [2/6]

const std::vector< std::string > candidate_values ( )

Definition at line 38 of file PlatformSelector.cpp.

◆ candidate_values() [3/6]

const std::vector< std::string > candidate_values ( )

Definition at line 42 of file PlatformSelector.hpp.

◆ candidate_values() [4/6]

const std::vector< std::string > candidate_values ( )

Definition at line 44 of file PlatformSelector.hpp.

◆ candidate_values() [5/6]

const std::vector< std::string > candidate_values ( )

Definition at line 46 of file PlatformSelector.hpp.

◆ candidate_values() [6/6]

const std::vector< std::string > candidate_values ( )

Definition at line 64 of file PlatformSelector.cpp.

◆ selectPlatform() [1/4]

PlatformKind selectPlatform ( std::string_view  value)

Definition at line 25 of file PlatformSelector.cpp.

References qmcplusplus::CPU, and qmcplusplus::OMPTARGET.

26 {
27 #if defined(ENABLE_OFFLOAD)
28  if (value.empty() || value == "yes" || value == "omptarget")
29 #else
30  if (value == "omptarget")
31 #endif
33  else
34  return PlatformKind::CPU;
35 }

◆ selectPlatform() [2/4]

◆ selectPlatform() [3/4]

PlatformKind selectPlatform ( std::string_view  value)

Definition at line 43 of file PlatformSelector.cpp.

References qmcplusplus::CPU, qmcplusplus::CUDA, and qmcplusplus::OMPTARGET.

44 {
45 #if defined(ENABLE_CUDA)
46  if (value.empty() || value == "yes" || value == "cuda")
47  return PlatformKind::CUDA;
48  else if (value == "omptarget")
49 #else
50  if (value == "cuda")
51  throw std::runtime_error("Cannot access CUDA code path. Executables are built with ENABLE_CUDA=OFF.");
52 #if defined(ENABLE_OFFLOAD)
53  if (value.empty() || value == "yes" || value == "omptarget")
54 #else
55  if (value == "omptarget")
56 #endif
57 #endif
59  else
60  return PlatformKind::CPU;
61 }

◆ selectPlatform() [4/4]

PlatformKind selectPlatform ( std::string_view  value)

Definition at line 69 of file PlatformSelector.cpp.

References qmcplusplus::CPU, qmcplusplus::OMPTARGET, and qmcplusplus::SYCL.

70 {
71 #if defined(ENABLE_SYCL)
72  if (value.empty() || value == "yes" || value == "sycl")
73  return PlatformKind::SYCL;
74  else if (value == "omptarget")
75 #else
76  if (value == "sycl")
77  throw std::runtime_error("Cannot access SYCL code path. Executables are built with ENABLE_SYCL=OFF.");
78 #if defined(ENABLE_OFFLOAD)
79  if (value.empty() || value == "yes" || value == "omptarget")
80 #else
81  if (value == "omptarget")
82 #endif
83 #endif
85  else
86  return PlatformKind::CPU;
87 }

Member Data Documentation

◆ candidate_values

const std::vector<std::string> candidate_values
static

Definition at line 35 of file PlatformSelector.hpp.


The documentation for this class was generated from the following file: