Arcane  v3.14.10.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
SimdOperation.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2022 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* SimdOperation.h (C) 2000-2022 */
9/* */
10/* Operations sur les types Simd. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_UTILS_SIMDOPERATION_H
13#define ARCANE_UTILS_SIMDOPERATION_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/Simd.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28#if defined(ARCANE_HAS_AVX512)
29#include "arcane/utils/SimdAVX512Generated.h"
30#endif
31#if defined(ARCANE_HAS_AVX)
32#include "arcane/utils/SimdAVXGenerated.h"
33#endif
34#if defined(ARCANE_HAS_SSE)
35#include "arcane/utils/SimdSSEGenerated.h"
36#endif
37
38#include "arcane/utils/SimdEMULGenerated.h"
39
40/*---------------------------------------------------------------------------*/
41/*---------------------------------------------------------------------------*/
42
43inline SimdReal3
44operator+(const SimdReal3& a,const SimdReal3& b)
45{
46 return SimdReal3(a.x + b.x,a.y + b.y,a.z + b.z);
47}
48
49inline SimdReal3
50operator-(const SimdReal3& a)
51{
52 return SimdReal3(-a.x,-a.y,-a.z);
53}
54
55inline SimdReal3
56operator-(const SimdReal3& a,const SimdReal3& b)
57{
58 return SimdReal3(a.x - b.x,a.y - b.y,a.z - b.z);
59}
60
61inline SimdReal3
62operator*(const SimdReal3& a,Real b)
63{
64 return SimdReal3(a.x * b,a.y * b,a.z * b);
65}
66
67inline SimdReal3
68operator*(const SimdReal3& a,const SimdReal& b)
69{
70 return SimdReal3(a.x * b,a.y * b,a.z * b);
71}
72
73inline SimdReal3
74operator*(Real b,const SimdReal3& a)
75{
76 return SimdReal3(b * a.x,b * a.y,b * a.z);
77}
78
79inline SimdReal3
80operator*(const SimdReal& b,const SimdReal3& a)
81{
82 return SimdReal3(b * a.x,b * a.y,b * a.z);
83}
84
85inline SimdReal3
86operator*(const SimdReal3& a,const SimdReal3& b)
87{
88 return SimdReal3(a.x * b.x,a.y * b.y,a.z * b.z);
89}
90
91inline SimdReal3
92operator/(const SimdReal3& a,const SimdReal& b)
93{
94 return SimdReal3(a.x / b,a.y / b,a.z / b);
95}
96
97inline SimdReal3
98operator/(const SimdReal3& a,Real b)
99{
100 return SimdReal3(a.x / b,a.y / b,a.z / b);
101}
102
103/*---------------------------------------------------------------------------*/
104/*---------------------------------------------------------------------------*/
105
106inline SimdReal2
107operator+(const SimdReal2& a,const SimdReal2& b)
108{
109 return SimdReal2(a.x + b.x,a.y + b.y);
110}
111
112inline SimdReal2
113operator-(const SimdReal2& a,const SimdReal2& b)
114{
115 return SimdReal2(a.x - b.x,a.y - b.y);
116}
117
118inline SimdReal2
119operator*(const SimdReal2& a,Real b)
120{
121 return SimdReal2(a.x * b,a.y * b);
122}
123
124inline SimdReal2
125operator*(Real b,const SimdReal2& a)
126{
127 return SimdReal2(b * a.x,b * a.y);
128}
129
130inline SimdReal2
131operator*(const SimdReal2& a,const SimdReal2& b)
132{
133 return SimdReal2(a.x * b.x,a.y * b.y);
134}
135
136inline SimdReal2
137operator/(const SimdReal2& a,const SimdReal& b)
138{
139 return SimdReal2(a.x / b,a.y / b);
140}
141
142inline SimdReal2
143operator/(const SimdReal2& a,Real b)
144{
145 return SimdReal2(a.x / b,a.y / b);
146}
147
148/*---------------------------------------------------------------------------*/
149/*---------------------------------------------------------------------------*/
150
151inline SimdReal3x3
152operator+(const SimdReal3x3& a,const SimdReal3x3& b)
153{
154 return SimdReal3x3(a.x + b.x,a.y + b.y,a.z + b.z);
155}
156
157inline SimdReal3x3
158operator-(const SimdReal3x3& a)
159{
160 return SimdReal3x3(-a.x,-a.y,-a.z);
161}
162
163inline SimdReal3x3
164operator-(const SimdReal3x3& a,const SimdReal3x3& b)
165{
166 return SimdReal3x3(a.x - b.x,a.y - b.y,a.z - b.z);
167}
168
169inline SimdReal3x3
170operator*(const SimdReal3x3& a,Real b)
171{
172 return SimdReal3x3(a.x * b,a.y * b,a.z * b);
173}
174
175inline SimdReal3x3
176operator*(const SimdReal3x3& a,const SimdReal& b)
177{
178 return SimdReal3x3(a.x * b,a.y * b,a.z * b);
179}
180
181inline SimdReal3x3
182operator*(Real b,const SimdReal3x3& a)
183{
184 return SimdReal3x3(b * a.x,b * a.y,b * a.z);
185}
186
187inline SimdReal3x3
188operator*(const SimdReal& b,const SimdReal3x3& a)
189{
190 return SimdReal3x3(b * a.x,b * a.y,b * a.z);
191}
192
193inline SimdReal3x3
194operator*(const SimdReal3x3& a,const SimdReal3x3& b)
195{
196 return SimdReal3x3(a.x * b.x,a.y * b.y,a.z * b.z);
197}
198
199inline SimdReal3x3
200operator/(const SimdReal3x3& a,const SimdReal& b)
201{
202 return SimdReal3x3(a.x / b,a.y / b,a.z / b);
203}
204
205inline SimdReal3x3
206operator/(const SimdReal3x3& a,Real b)
207{
208 return SimdReal3x3(a.x / b,a.y / b,a.z / b);
209}
210
211/*---------------------------------------------------------------------------*/
212/*---------------------------------------------------------------------------*/
213
214inline SimdReal2x2
215operator+(const SimdReal2x2& a,const SimdReal2x2& b)
216{
217 return SimdReal2x2(a.x + b.x,a.y + b.y);
218}
219
220inline SimdReal2x2
221operator-(const SimdReal2x2& a,const SimdReal2x2& b)
222{
223 return SimdReal2x2(a.x - b.x,a.y - b.y);
224}
225
226inline SimdReal2x2
227operator*(const SimdReal2x2& a,Real b)
228{
229 return SimdReal2x2(a.x * b,a.y * b);
230}
231
232inline SimdReal2x2
233operator*(Real b,const SimdReal2x2& a)
234{
235 return SimdReal2x2(b * a.x,b * a.y);
236}
237
238inline SimdReal2x2
239operator*(const SimdReal2x2& a,const SimdReal2x2& b)
240{
241 return SimdReal2x2(a.x * b.x,a.y * b.y);
242}
243
244inline SimdReal2x2
245operator/(const SimdReal2x2& a,const SimdReal& b)
246{
247 return SimdReal2x2(a.x / b,a.y / b);
248}
249
250inline SimdReal2x2
251operator/(const SimdReal2x2& a,Real b)
252{
253 return SimdReal2x2(a.x / b,a.y / b);
254}
255
256/*---------------------------------------------------------------------------*/
257/*---------------------------------------------------------------------------*/
258
259} // End namespace Arcane
260
261/*---------------------------------------------------------------------------*/
262/*---------------------------------------------------------------------------*/
263
264#endif
SimdInfo::SimdReal SimdReal
Vecteur SIMD de réel.
Definition Simd.h:134
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
Real2 operator*(Real sca, const Real2Proxy &vec)
Multiplication par un scalaire.
Definition Real2Proxy.h:241
Real2 operator/(const Real2Proxy &vec, Real sca)
Division par un scalaire.
Definition Real2Proxy.h:263