12 Scratch(
size_t n_double_host,
size_t n_double_device);
15 KOKKOS_INLINE_FUNCTION
void pop_host(
size_t n) {
54 template<
typename Device> View<double*, CLayout, Device>
get_view(
const std::string& label,
int dim1);
55 template<
typename Device> View<double**, CLayout, Device>
get_view(
const std::string& label,
int dim1,
int dim2);
56 template<
typename Device> View<double***, CLayout, Device>
get_view(
const std::string& label,
int dim1,
int dim2,
int dim3);
57 template<
typename Device> View<double****, CLayout, Device>
get_view(
const std::string& label,
int dim1,
int dim2,
int dim3,
int dim4);
58 template<
typename Device> View<double*****, CLayout, Device>
get_view(
const std::string& label,
int dim1,
int dim2,
int dim3,
int dim4,
int dim5);
59 template<
typename Device> View<double******, CLayout, Device>
get_view(
const std::string& label,
int dim1,
int dim2,
int dim3,
int dim4,
int dim5,
int dim6);
61 template<
typename Device> View<double*, Device>
get_view(
const std::string& label,
int dim1,
Layout kdl_true);
62 template<
typename Device> View<double**, Device>
get_view(
const std::string& label,
int dim1,
int dim2,
Layout kdl_true);
63 template<
typename Device> View<double***, Device>
get_view(
const std::string& label,
int dim1,
int dim2,
int dim3,
Layout kdl_true);
64 template<
typename Device> View<double****, Device>
get_view(
const std::string& label,
int dim1,
int dim2,
int dim3,
int dim4,
Layout kdl_true);
65 template<
typename Device> View<double*****, Device>
get_view(
const std::string& label,
int dim1,
int dim2,
int dim3,
int dim4,
int dim5,
Layout kdl_true);
66 template<
typename Device> View<double******, Device>
get_view(
const std::string& label,
int dim1,
int dim2,
int dim3,
int dim4,
int dim5,
int dim6,
Layout kdl_true);
129 template<
typename Device>
double*
get_ptr(
size_t view_size);
Definition: scratch.hpp:48
size_t allocation_offset_
Definition: scratch.hpp:124
Scratch * scratch_
Definition: scratch.hpp:122
double * get_ptr(size_t view_size)
Definition: scratch.cpp:26
bool used_scratch_
Definition: scratch.hpp:126
KOKKOS_INLINE_FUNCTION ScratchLock(const ScratchLock &other)
Definition: scratch.hpp:101
bool is_device_
Definition: scratch.hpp:125
KOKKOS_INLINE_FUNCTION ~ScratchLock()
Definition: scratch.hpp:77
Layout
Definition: scratch.hpp:50
@ KokkosDefaultLayout
Definition: scratch.hpp:51
size_t allocation_size_
Definition: scratch.hpp:123
KOKKOS_INLINE_FUNCTION ScratchLock()
Definition: scratch.hpp:73
View< double *, CLayout, Device > get_view(const std::string &label, int dim1)
Definition: scratch.cpp:73
ScratchLock(Scratch *scratch)
Definition: scratch.hpp:69
ScratchLock & operator=(const ScratchLock &other)
Definition: scratch.hpp:110
bool is_used_
Definition: scratch.hpp:127
Definition: scratch.hpp:10
bool is_initialized
Definition: scratch.hpp:30
View< double *, CLayout, HostType > host_pool_
Definition: scratch.hpp:31
size_t device_offset_
Definition: scratch.hpp:35
KOKKOS_INLINE_FUNCTION void pop_device(size_t n)
Definition: scratch.hpp:20
size_t host_offset_
Definition: scratch.hpp:34
size_t host_unlimited_offset_
Definition: scratch.hpp:37
size_t device_peak_
Definition: scratch.hpp:41
View< double *, CLayout, DeviceType > device_pool_
Definition: scratch.hpp:32
void report_peak_usage() const
Definition: scratch.cpp:14
Scratch()
Definition: scratch.hpp:13
KOKKOS_INLINE_FUNCTION void pop_host(size_t n)
Definition: scratch.hpp:15
size_t device_unlimited_offset_
Definition: scratch.hpp:38
size_t host_peak_
Definition: scratch.hpp:40
logical false
Definition: module.F90:102
std::unique_ptr< Scratch > GLOBAL_SCRATCH
Definition: scratch.cpp:208