OpenPFC  0.1.4
Phase Field Crystal simulation framework
Loading...
Searching...
No Matches
memory_traits.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2025 VTT Technical Research Centre of Finland Ltd
2// SPDX-License-Identifier: AGPL-3.0-or-later
3
37#pragma once
38
40
41namespace pfc {
42namespace core {
43
54template <typename BackendTag> struct backend_traits;
55
61template <> struct backend_traits<backend::CpuTag> {
63 static constexpr bool has_host_access = true;
65 static constexpr bool has_device_access = false;
67 static constexpr bool requires_transfer = false;
68};
69
70#if defined(OpenPFC_ENABLE_CUDA)
76template <> struct backend_traits<backend::CudaTag> {
78 static constexpr bool has_host_access = false;
80 static constexpr bool has_device_access = true;
82 static constexpr bool requires_transfer = true;
83};
84#endif
85
86#if defined(OpenPFC_ENABLE_HIP)
92template <> struct backend_traits<backend::HipTag> {
94 static constexpr bool has_host_access = false;
96 static constexpr bool has_device_access = true;
98 static constexpr bool requires_transfer = true;
99};
100#endif
101
102} // namespace core
103} // namespace pfc
Backend tags for compile-time backend selection.
Type traits for backend capabilities.
Definition memory_traits.hpp:54
Represents the global simulation domain (the "world").
Definition world.hpp:91