51 size_t extentXInBytes,
52 size_t extentYInBytes)
53 : nx(nx), ny(ny), nz(nz), pointer(pointer), extentXInBytes(extentXInBytes),
54 extentYInBytes(extentYInBytes) {
69 return pointer[
index(x, y, z)];
83 return pointer[
index(x, y, z)];
92 return pointer[
index];
101 return pointer[
index];
117 return z *
nx *
ny + y *
nx + x ;
138 size_t extentXInBytes;
139 size_t extentYInBytes;
__device__ __host__ size_t index(size_t x, size_t y, size_t z) const
index computes the linear index of the given cell
Definition: View.hpp:116
__device__ __host__ size_t size() const
Definition: View.hpp:105
const size_t nz
Definition: View.hpp:134
#define __host__
Definition: types.hpp:46
__device__ __host__ T & at(size_t x, size_t y, size_t z)
at returns a reference to the element at the given location
Definition: View.hpp:65
__device__ __host__ View(T *pointer, size_t nx, size_t ny, size_t nz, size_t extentXInBytes, size_t extentYInBytes)
View constructs the View.
Definition: View.hpp:47
__device__ __host__ size_t getNumberOfZCells() const
Definition: View.hpp:128
const size_t nx
Definition: View.hpp:132
const size_t ny
Definition: View.hpp:133
__device__ __host__ T & at(size_t index)
at returns the reference to the element index by the single value index
Definition: View.hpp:91
#define __device__
Definition: types.hpp:45
__device__ __host__ size_t getNumberOfXCells() const
Definition: View.hpp:120
__device__ __host__ size_t getNumberOfYCells() const
Definition: View.hpp:124
Various utility functions to implement the tecno flux.
Definition: types.hpp:30
__device__ __host__ const T & at(size_t index) const
at returns the reference to the element index by the single value index
Definition: View.hpp:100
__device__ __host__ const T & at(size_t x, size_t y, size_t z) const
at returns a reference to the element at the given location (const version)
Definition: View.hpp:79