QMCPACK
PlatformSelector.hpp
Go to the documentation of this file.
1
//////////////////////////////////////////////////////////////////////////////////////
2
// This file is distributed under the University of Illinois/NCSA Open Source License.
3
// See LICENSE file in top directory for details.
4
//
5
// Copyright (c) 2022 QMCPACK developers.
6
//
7
// File developed by: Ye Luo, yeluo@anl.gov, Argonne National Laboratory
8
//
9
// File created by: Ye Luo, yeluo@anl.gov, Argonne National Laboratory
10
//////////////////////////////////////////////////////////////////////////////////////
11
12
13
#ifndef QMCPLUSPLUS_PLATFORM_SELECTOR_H
14
#define QMCPLUSPLUS_PLATFORM_SELECTOR_H
15
16
#include <vector>
17
#include <string>
18
#include <config.h>
19
#include "
PlatformKinds.hpp
"
20
21
namespace
qmcplusplus
22
{
23
24
enum class
SelectorKind
25
{
26
CPU_OMPTARGET
,
27
CPU_OMPTARGET_CUDA
,
28
CPU_OMPTARGET_SYCL
,
29
};
30
31
template
<SelectorKind KIND>
32
class
PlatformSelector
33
{
34
public
:
35
static
const
std::vector<std::string>
candidate_values
;
36
static
PlatformKind
selectPlatform
(std::string_view value);
37
};
38
39
using
CPUOMPTargetSelector
=
PlatformSelector<SelectorKind::CPU_OMPTARGET>
;
40
41
template
<>
42
const
std::vector<std::string>
PlatformSelector<SelectorKind::CPU_OMPTARGET>::candidate_values
;
43
template
<>
44
const
std::vector<std::string>
PlatformSelector<SelectorKind::CPU_OMPTARGET_CUDA>::candidate_values
;
45
template
<>
46
const
std::vector<std::string>
PlatformSelector<SelectorKind::CPU_OMPTARGET_SYCL>::candidate_values
;
47
48
#if defined(ENABLE_CUDA)
49
using
CPUOMPTargetVendorSelector
=
PlatformSelector<SelectorKind::CPU_OMPTARGET_CUDA>
;
50
#elif defined(ENABLE_SYCL)
51
using
CPUOMPTargetVendorSelector
=
PlatformSelector<SelectorKind::CPU_OMPTARGET_SYCL>
;
52
#else
53
using
CPUOMPTargetVendorSelector
=
PlatformSelector<SelectorKind::CPU_OMPTARGET>
;
54
#endif
55
56
}
// namespace qmcplusplus
57
#endif
qmcplusplus::SelectorKind::CPU_OMPTARGET_CUDA
qmcplusplus
helper functions for EinsplineSetBuilder
Definition:
Configuration.h:43
qmcplusplus::PlatformSelector::candidate_values
static const std::vector< std::string > candidate_values
Definition:
PlatformSelector.hpp:35
qmcplusplus::SelectorKind::CPU_OMPTARGET
qmcplusplus::PlatformSelector::selectPlatform
static PlatformKind selectPlatform(std::string_view value)
qmcplusplus::PlatformSelector
Definition:
PlatformSelector.hpp:32
PlatformKinds.hpp
qmcplusplus::SelectorKind
SelectorKind
Definition:
PlatformSelector.hpp:24
qmcplusplus::PlatformKind
PlatformKind
Definition:
PlatformKinds.hpp:19
qmcplusplus::SelectorKind::CPU_OMPTARGET_SYCL
src
Platforms
PlatformSelector.hpp
Generated on Fri Jun 28 2024 10:45:16 for QMCPACK by
1.8.14