42 static const Integer MAX_SIZE = 9;
52#if defined(ARCANE_HAS_ACCELERATOR_API)
53 template<
typename LayoutType>
57 template<
typename LayoutType>
62 template<
typename LayoutType>
70 _setValue(
reinterpret_cast<Real*
>(&r), 2);
74 _setValue(
reinterpret_cast<Real*
>(&r), 3);
85 _setValue(
reinterpret_cast<Real*
>(&r), 2);
90 _setValue(
reinterpret_cast<Real*
>(&r), 3);
94 Real& operator[](Integer index)
96 ARCANE_ASSERT(index < m_nb_value, (
"Index out of range"));
97 return m_value[index];
99 Real operator[](Integer index)
const
101 ARCANE_ASSERT(index < m_nb_value, (
"Index out of range"));
102 return m_value[index];
104 Real& operator()(Integer index)
106 ARCANE_ASSERT(index < m_nb_value, (
"Index out of range"));
107 return m_value[index];
109 Real operator()(Integer index)
const
111 ARCANE_ASSERT(index < m_nb_value, (
"Index out of range"));
112 return m_value[index];
115 Int32 size()
const {
return m_nb_value; }
116 Real* data() {
return m_value; }
117 const Real* data()
const {
return m_value; }
119 operator Real2()
const {
return Real2(m_value[0], m_value[1]); }
120 operator Real3()
const {
return Real3(m_value[0], m_value[1], m_value[2]); }
122#if defined(ARCANE_HAS_ACCELERATOR_API)
126 for( Integer i=0, n=m_nb_value; i<n; ++i )
134 Real m_value[MAX_SIZE];
135 Int32 m_nb_value = 0;
139 void _setValue(
const Real* v, Int32 nb_value)
141 m_nb_value = nb_value;
142 ARCANE_ASSERT(nb_value <= MAX_SIZE, (
"Size is too large"));
143 for (Integer i = 0 ; i < nb_value; ++i)