Template Class HostMacroProperty
Defined in File HostMacroProperty.cuh
Class Documentation
-
template<typename T, unsigned int I = 1, unsigned int J = 1, unsigned int K = 1, unsigned int W = 1>
class HostMacroProperty This template class is used for conveniently converting a multi-dimensional pointer to an array Theoretically the compiler should be able to optimise away most of it at compile time
Public Functions
Root Constructor
- Parameters:
_metadata – Metadata struct
Sub Constructor
- Parameters:
_metadata – Preallocated metadata struct, shared with other current instances of same host macro property
_offset – Pointer to buffer in device memory
-
HostMacroProperty<T, J, K, W, 1> operator[](unsigned int i) const
Access the next dimension of the array
- Throws:
exception::OutOfBoundsException – If i >= I.
exception::InvalidOperation – If template arguments I, J, K , W are all 1. Which denotes the macro property has no dimensions remaining to be indexed.
-
operator T()
Read/Write access to the current element
- Throws:
exception::InvalidOperation – If template arguments I, J, K , W are not all 1. Which denotes the macro property has more dimensions remaining to be indexed.
-
operator T() const
Read-only access to the current element
- Throws:
exception::InvalidOperation – If template arguments I, J, K , W are not all 1. Which denotes the macro property has more dimensions remaining to be indexed.
-
HostMacroProperty<T, I, J, K, W> &operator=(T val)
Assign value
- Parameters:
val – New value of the element
- Throws:
exception::InvalidOperation – If template arguments I, J, K , W are not all 1. Which denotes the macro property has more dimensions remaining to be indexed.
-
void zero()
Zero’s the selected area of the array