17#ifndef vtkmlib_PortalTraits_h
18#define vtkmlib_PortalTraits_h
20#include "vtkmConfigCore.h"
22#include <vtkm/Types.h>
23#include <vtkm/internal/Assume.h>
30struct vtkPortalOfVecOfVecValues;
31struct vtkPortalOfVecOfValues;
32struct vtkPortalOfScalarValues;
47template <
typename T,
int N>
52 using Type = vtkm::Vec<T, N>;
57 VTKM_ASSUME((i >= 0 && i < N));
63 VTKM_ASSUME((i >= 0 && i < N));
68template <
typename T,
int N>
73 using Type = vtkm::Vec<T, N>;
78 VTKM_ASSUME((i >= 0 && i < N));
84 VTKM_ASSUME((i >= 0 && i < N));
89template <
typename T,
int N,
int M>
92 using TagType = vtkPortalOfVecOfVecValues;
94 using Type = vtkm::Vec<vtkm::Vec<T, N>, M>;
97 static constexpr vtkm::IdComponent NUM_COMPONENTS_OUTER = M;
98 static constexpr vtkm::IdComponent NUM_COMPONENTS_INNER = N;
104 const vtkm::IdComponent j = i % N;
112 const vtkm::IdComponent j = i % N;
117template <
typename T,
int N,
int M>
122 using Type = vtkm::Vec<vtkm::Vec<T, N>, M>;
125 static constexpr vtkm::IdComponent NUM_COMPONENTS_OUTER = M;
126 static constexpr vtkm::IdComponent NUM_COMPONENTS_INNER = N;
132 const vtkm::IdComponent j = i % N;
140 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