Kokkos Core Kernels Package
Version of the Day
|
View to an array of data. More...
#include <Kokkos_View.hpp>
Public Types | |
using | array_type = View< typename traits::scalar_array_type, typename traits::array_layout, typename traits::device_type, typename traits::hooks_policy, typename traits::memory_traits > |
Compatible view of array of scalar types. More... | |
using | const_type = View< typename traits::const_data_type, typename traits::array_layout, typename traits::device_type, typename traits::hooks_policy, typename traits::memory_traits > |
Compatible view of const data type. More... | |
using | non_const_type = View< typename traits::non_const_data_type, typename traits::array_layout, typename traits::device_type, typename traits::hooks_policy, typename traits::memory_traits > |
Compatible view of non-const data type. More... | |
using | HostMirror = View< typename traits::non_const_data_type, typename traits::array_layout, Device< DefaultHostExecutionSpace, typename traits::host_mirror_space::memory_space >, typename traits::hooks_policy > |
Compatible HostMirror view. More... | |
using | host_mirror_type = View< typename traits::non_const_data_type, typename traits::array_layout, typename traits::host_mirror_space, typename traits::hooks_policy > |
Compatible HostMirror view. More... | |
using | uniform_type = typename Impl::ViewUniformType< View, 0 >::type |
Unified types. More... | |
View to an array of data.
A View represents an array of one or more dimensions. For details, please refer to Kokkos' tutorial materials.
This class has both required and optional template parameters. The DataType
parameter must always be provided, and must always be first. The parameters Arg1Type
, Arg2Type
, and Arg3Type
are placeholders for different template parameters. The default value of the fifth template parameter Specialize
suffices for most use cases. When explaining the template parameters, we won't refer to Arg1Type
, Arg2Type
, and Arg3Type
; instead, we will refer to the valid categories of template parameters, in whatever order they may occur.
Valid ways in which template arguments may be specified:
DataType | (required) This indicates both the type of each entry of the array, and the combination of compile-time and run-time array dimension(s). For example, double* indicates a one-dimensional array of double with run-time dimension, and int*[3] a two-dimensional array of int with run-time first dimension and compile-time second dimension (of 3). In general, the run-time dimensions (if any) must go first, followed by zero or more compile-time dimensions. For more examples, please refer to the tutorial materials. |
Space | (required) The memory space. |
Layout | (optional) The array's layout in memory. For example, LayoutLeft indicates a column-major (Fortran style) layout, and LayoutRight a row-major (C style) layout. If not specified, this defaults to the preferred layout for the Space . |
MemoryTraits | (optional) Assertion of the user's intended access behavior. For example, RandomAccess indicates read-only access with limited spatial locality, and Unmanaged lets users wrap externally allocated memory in a View without automatic deallocation. |
Space
Some MemoryTraits
options may have different interpretations for different Space
types. For example, with the Cuda device, RandomAccess
tells Kokkos to fetch the data through the texture cache, whereas the non-GPU devices have no such hardware construct.
Users should defer applying the optional MemoryTraits
parameter until the point at which they actually plan to rely on it in a computational kernel. This minimizes the number of template parameters exposed in their code, which reduces the cost of compilation. Users may always assign a View without specified MemoryTraits
to a compatible View with that specification. For example:
Definition at line 279 of file Kokkos_Core_fwd.hpp.
using Kokkos::View< DataType, Properties >::array_type = View<typename traits::scalar_array_type, typename traits::array_layout, typename traits::device_type, typename traits::hooks_policy, typename traits::memory_traits> |
Compatible view of array of scalar types.
Definition at line 668 of file Kokkos_View.hpp.
using Kokkos::View< DataType, Properties >::const_type = View<typename traits::const_data_type, typename traits::array_layout, typename traits::device_type, typename traits::hooks_policy, typename traits::memory_traits> |
Compatible view of const data type.
Definition at line 674 of file Kokkos_View.hpp.
using Kokkos::View< DataType, Properties >::non_const_type = View<typename traits::non_const_data_type, typename traits::array_layout, typename traits::device_type, typename traits::hooks_policy, typename traits::memory_traits> |
Compatible view of non-const data type.
Definition at line 680 of file Kokkos_View.hpp.
using Kokkos::View< DataType, Properties >::HostMirror = View<typename traits::non_const_data_type, typename traits::array_layout, Device<DefaultHostExecutionSpace, typename traits::host_mirror_space::memory_space>, typename traits::hooks_policy> |
Compatible HostMirror view.
Definition at line 687 of file Kokkos_View.hpp.
using Kokkos::View< DataType, Properties >::host_mirror_type = View<typename traits::non_const_data_type, typename traits::array_layout, typename traits::host_mirror_space, typename traits::hooks_policy> |
Compatible HostMirror view.
Definition at line 692 of file Kokkos_View.hpp.
using Kokkos::View< DataType, Properties >::uniform_type = typename Impl::ViewUniformType<View, 0>::type |
Unified types.
Definition at line 695 of file Kokkos_View.hpp.