6#ifndef vtkmlib_PortalTraits_h
7#define vtkmlib_PortalTraits_h
9#include "vtkmConfigCore.h"
11#include <vtkm/Types.h>
12#include <vtkm/internal/Assume.h>
18VTK_ABI_NAMESPACE_BEGIN
20struct vtkPortalOfVecOfVecValues;
21struct vtkPortalOfVecOfValues;
22struct vtkPortalOfScalarValues;
37template <
typename T,
int N>
42 using Type = vtkm::Vec<T, N>;
47 VTKM_ASSUME((i >= 0 && i < N));
53 VTKM_ASSUME((i >= 0 && i < N));
58template <
typename T,
int N>
63 using Type = vtkm::Vec<T, N>;
68 VTKM_ASSUME((i >= 0 && i < N));
74 VTKM_ASSUME((i >= 0 && i < N));
79template <
typename T,
int N,
int M>
82 using TagType = vtkPortalOfVecOfVecValues;
84 using Type = vtkm::Vec<vtkm::Vec<T, N>, M>;
87 static constexpr vtkm::IdComponent NUM_COMPONENTS_OUTER = M;
88 static constexpr vtkm::IdComponent NUM_COMPONENTS_INNER = N;
94 const vtkm::IdComponent j = i % N;
102 const vtkm::IdComponent j = i % N;
107template <
typename T,
int N,
int M>
112 using Type = vtkm::Vec<vtkm::Vec<T, N>, M>;
115 static constexpr vtkm::IdComponent NUM_COMPONENTS_OUTER = M;
116 static constexpr vtkm::IdComponent NUM_COMPONENTS_INNER = N;
122 const vtkm::IdComponent j = i % N;
130 const vtkm::IdComponent j = i % N;
static void SetComponent(Type &t, vtkm::IdComponent i, const ComponentType &v)
static ComponentType GetComponent(const Type &t, vtkm::IdComponent i)
vtkPortalOfVecOfValues TagType
typename std::remove_const< T >::type ComponentType
static void SetComponent(Type &t, vtkm::IdComponent i, const ComponentType &v)
typename std::remove_const< T >::type ComponentType
vtkPortalOfVecOfVecValues TagType
vtkm::Vec< vtkm::Vec< T, N >, M > Type
static ComponentType GetComponent(const Type &t, vtkm::IdComponent i)
vtkPortalOfVecOfValues TagType
static ComponentType GetComponent(const Type &t, vtkm::IdComponent i)
static void SetComponent(Type &t, vtkm::IdComponent i, const ComponentType &v)
typename std::remove_const< T >::type ComponentType
vtkm::Vec< vtkm::Vec< T, N >, M > Type
static ComponentType GetComponent(const Type &t, vtkm::IdComponent i)
typename std::remove_const< T >::type ComponentType
vtkPortalOfVecOfVecValues TagType
static void SetComponent(Type &t, vtkm::IdComponent i, const ComponentType &v)
static void SetComponent(Type &t, vtkm::IdComponent, const ComponentType &v)
typename std::remove_const< T >::type ComponentType
static constexpr vtkm::IdComponent NUM_COMPONENTS
static ComponentType GetComponent(const Type &t, vtkm::IdComponent)
vtkPortalOfScalarValues TagType