6#include "Accelerator/hybrid.h"
7#include "Random/random.h"
12using card::default_hpc_format;
14using card::HybridFormat;
15using card::HybridKind;
16using card::HybridLabel;
17using card::HybridTargetLevel;
18using random::Ran2Generator;
20enum class MatrixFillMode {
53 HpcMatrix(
const char* tag_in =
nullptr, HybridFormat format_in = default_hpc_format);
54 HpcMatrix(
size_t rows_in,
size_t cols_in,
const char* tag_in =
nullptr,
55 HybridFormat format_in = default_hpc_format,
56 MatrixFillMode fill_method = MatrixFillMode::VALUE, T fill_value =
static_cast<T
>(0));
57 HpcMatrix(
size_t rows_in,
size_t cols_in, MatrixFillMode fill_method,
58 T fill_value =
static_cast<T
>(0),
const char* tag_in =
nullptr,
59 HybridFormat format_in = default_hpc_format);
60 HpcMatrix(
size_t rows_in,
size_t cols_in, MatrixFillMode fill_method,
62 HybridFormat format_in = default_hpc_format);
74 void resize(
size_t new_rows,
size_t new_cols);
88 const T*
memptr(HybridTargetLevel tier = HybridTargetLevel::HOST)
const;
89 T*
memptr(HybridTargetLevel tier = HybridTargetLevel::HOST);
98 T
operator()(
size_t row_idx,
size_t col_idx, HybridTargetLevel tier = HybridTargetLevel::HOST);
105 T
atHost(
size_t row_idx,
size_t col_idx);
An evolution of GpuBuffer in pmemd.cuda, the Composite array has elements that are accessible from ei...
Definition hybrid.h:202
Stores the state of a Ran2 pseudo-random number generator. Member functions produce random numbers al...
Definition random.h:81
const T * memptr(HybridTargetLevel tier=HybridTargetLevel::HOST) const
Pointer to the memory itself, on the host or the device. This takes its name from the Armadillo vec,...
T atDevice(size_t row_idx, size_t col_idx)
Element-wise access to data on the GPU without bounds checks, following on the Armadillo naming conve...
T operator()(size_t row_idx, size_t col_idx, HybridTargetLevel tier=HybridTargetLevel::HOST)
Element-wise access via the function call () operator. This entails two bounds checks.
HpcMatrix(const char *tag_in=nullptr, HybridFormat format_in=default_hpc_format)
Constructors must set public-facing reference variables in addition to private member variables.
T atHost(size_t row_idx, size_t col_idx)
Element-wise access to host data without bounds checks, following on the Armadillo naming conventions...
void resize(size_t new_rows, size_t new_cols)
Change the number of rows and columns. Elements outside the bounds of the new matrix will be discarde...
Hybrid< T > colptr(size_t col_idx, const char *tag_in=nullptr)
Get a Hybrid POINTER-kind object that is set directly to the column of interest.
void reset()
Empty the matrix and set its size to 0 by 0.
HybridLabel getLabel() const
Produce the label for this matrix (obtained from the label of its primary contents)
A Hybrid object's immutable identifying information, stored as a const member variable within the Hyb...
Definition hybrid.h:65