1#ifndef PSCF_C_FIELD_CU_H
2#define PSCF_C_FIELD_CU_H
11#include <pscf/backend/cuda/CUT.h>
12#include <pscf/backend/cuda/BackendArray.h>
13#include <pscf/backend/cuda/cudaTypes.h>
15#include <pscf/backend/cuda/HostSendArray.h>
16#include <pscf/math/IntVec.h>
24 template <
int D,
class T>
class CField;
133 template <
class Archive>
134 void serialize(Archive& ar,
const unsigned int version);
157 {
return meshDimensions_; }
163 template <
class Archive>
167 if (Archive::is_saving()) {
168 capacity = capacity_;
171 if (Archive::is_loading()) {
172 if (!isAllocated()) {
177 if (capacity != capacity_) {
186 for (
int i = 0; i < capacity_; ++i) {
191 ar & meshDimensions_;
void serialize(Archive &ar, const unsigned int version)
Serialize a Field to/from an Archive.
void allocate(IntVec< D > const &meshDimensions)
Allocate the underlying C array for data on a regular mesh.
void associate(BackendArray< cudaComplex, CUT > &arr, int beginId, IntVec< D > const &meshDimensions)
Associate this object with a slice of another BackendArray.
CField()
Default constructor.
IntVec< D > const & meshDimensions() const
Return mesh dimensions by constant reference.
void deallocate()
Deallocate the underlying array.
Backend identifier class for the GPU-enabled CUDA backend.
An IntVec<D, T> is a D-component vector of elements of integer type T.
File containing preprocessor macros for error handling.
#define UTIL_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
PSCF package top-level namespace.
cufftDoubleComplex cudaComplex
Complex number type used in CPU code that uses FFTW.