Alien  1.3.0
Developer documentation
Loading...
Searching...
No Matches
SYCLInternalLinearAlgebra.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 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
9#include "arccore/message_passing/ITypeDispatcher.h"
10#include "arccore/message_passing/Request.h"
11#include "arccore/message_passing/IStat.h"
12
13#include <alien/utils/Precomp.h>
14
15#include <arccore/base/NotImplementedException.h>
16#include <arccore/base/TraceInfo.h>
17
20
21#include "alien/kernels/sycl/data/SYCLEnv.h"
22#include "alien/kernels/sycl/data/SYCLEnvInternal.h"
23
24#include "alien/kernels/sycl/data/SYCLVectorInternal.h"
25#include "alien/kernels/sycl/data/SYCLVector.h"
26
27#include <alien/kernels/sycl/data/SYCLBEllPackInternal.h>
28#include <alien/kernels/sycl/data/SYCLBEllPackMatrix.h>
29
30#include "alien/kernels/sycl/algebra/SYCLKernelInternal.h"
31#include "alien/kernels/sycl/algebra/SYCLInternalLinearAlgebra.h"
32
33#include "alien/kernels/sycl/algebra/SYCLBEllPackMatrixMult.h"
34
35/*---------------------------------------------------------------------------*/
36
37namespace Alien
38{
39
40using namespace Arccore;
41
42template class ALIEN_EXPORT LinearAlgebra<BackEnd::tag::sycl>;
43template class ALIEN_EXPORT LinearAlgebraExpr<BackEnd::tag::sycl>;
44
46SYCLInternalLinearAlgebraFactory()
47{
48 return new SYCLInternalLinearAlgebra();
49}
50
52SYCLInternalLinearAlgebraExprFactory()
53{
55}
56
57/*---------------------------------------------------------------------------*/
58
59namespace Internal = SYCLInternal;
60
61/*---------------------------------------------------------------------------*/
62
63SYCLInternalLinearAlgebra::SYCLInternalLinearAlgebra()
65{
66 m_internal.reset(new SYCLInternal::KernelInternal());
67}
68
69/*---------------------------------------------------------------------------*/
70
71SYCLInternalLinearAlgebra::~SYCLInternalLinearAlgebra()
72{
73#ifdef ALIEN_USE_PERF_TIMER
74 m_timer.printInfo("SYCL-ALGEBRA");
75#endif
76}
77
78void SYCLInternalLinearAlgebra::setDotAlgo(int dot_algo)
79{
80 m_internal->setDotAlgo(dot_algo);
81}
82
83/*---------------------------------------------------------------------------*/
84/*---------------------------------------------------------------------------*/
85SYCLInternalLinearAlgebra::ResourceType
86SYCLInternalLinearAlgebra::resource(Matrix const& A)
87{
88 return std::make_tuple(&A.distribution().rowDistribution(),A.blockSize());
89}
90
91void SYCLInternalLinearAlgebra::allocate(ResourceType resource, Vector& v)
92{
93 v.init(*std::get<0>(resource),std::get<1>(resource), true);
94}
95
96void SYCLInternalLinearAlgebra::free(Vector& v)
97{
98 v.clear();
99}
100
101Real SYCLInternalLinearAlgebra::norm0(const SYCLVector<Real>& vx ALIEN_UNUSED_PARAM) const
102{
103 // return SYCLBLASKernel::nrm0(x.space().structInfo(),vx);
104 throw NotImplementedException(
105 A_FUNCINFO, "SYCLLinearAlgebra::norm0 not implemented");
106}
107
108/*---------------------------------------------------------------------------*/
109
110Real SYCLInternalLinearAlgebra::norm1(const SYCLVector<Real>& vx ALIEN_UNUSED_PARAM) const
111{
112 // return SYCLBLASKernel::nrm1(x.space().structInfo(),vx);
113 throw NotImplementedException(
114 A_FUNCINFO, "SYCLLinearAlgebra::norm1 not implemented");
115}
116/*---------------------------------------------------------------------------*/
117
118Real SYCLInternalLinearAlgebra::norm2(const SYCLVector<Real>& vx) const
119{
120#ifdef ALIEN_USE_PERF_TIMER
121 SentryType s(m_timer, "SYCL-NORM2");
122#endif
123 return std::sqrt(m_internal->dot(vx.internal()->values(), vx.internal()->values()));
124}
125
126Real SYCLInternalLinearAlgebra::normInf([[maybe_unused]] const SYCLVector<Real>& vx) const
127{
128#ifdef ALIEN_USE_PERF_TIMER
129 SentryType s(m_timer, "SYCL-NORMINF");
130#endif
131 throw NotImplementedException(
132 A_FUNCINFO, "SYCLLinearAlgebra::normInf not implemented");
133}
134/*---------------------------------------------------------------------------*/
135
136void SYCLInternalLinearAlgebra::mult(const SYCLBEllPackMatrix<Real>& ma,
137 const SYCLVector<Real>& vx,
138 SYCLVector<Real>& vr) const
139{
140#ifdef ALIEN_USE_PERF_TIMER
141 SentryType s(m_timer, "SYCL-SPMV");
142#endif
143 Internal::SYCLBEllPackMatrixMultT<Real>(ma).mult(vx, vr);
144}
145
146void SYCLInternalLinearAlgebra::addLMult(Real alpha,
147 const SYCLBEllPackMatrix<Real>& ma,
148 const SYCLVector<Real>& vx,
149 SYCLVector<Real>& vr) const
150{
151#ifdef ALIEN_USE_PERF_TIMER
152 SentryType s(m_timer, "SYCL-ADDLMULT");
153#endif
154 Internal::SYCLBEllPackMatrixMultT<Real>(ma).addLMult(alpha, vx, vr);
155}
156
157void SYCLInternalLinearAlgebra::addUMult(Real alpha,
158 const SYCLBEllPackMatrix<Real>& ma,
159 const SYCLVector<Real>& vx,
160 SYCLVector<Real>& vr) const
161{
162#ifdef ALIEN_USE_PERF_TIMER
163 SentryType s(m_timer, "SYCL-ADDUMULT");
164#endif
165 Internal::SYCLBEllPackMatrixMultT<Real>(ma).addUMult(alpha, vx, vr);
166}
167
168void SYCLInternalLinearAlgebra::lowerUpperSynchronize(const SYCLBEllPackMatrix<Real>& ma,
169 SYCLVector<Real>& vr) const
170{
171#ifdef ALIEN_USE_PERF_TIMER
172 SentryType s(m_timer, "SYCL-luSynchronize");
173#endif
174 Internal::SYCLBEllPackMatrixMultT<Real>(ma).lowerUpperSynchronize(vr, vr);
175}
176
177void SYCLInternalLinearAlgebra::upperLowerSynchronize(const SYCLBEllPackMatrix<Real>& ma,
178 SYCLVector<Real>& vr) const
179{
180#ifdef ALIEN_USE_PERF_TIMER
181 SentryType s(m_timer, "SYCL-ulSynchronize");
182#endif
183 Internal::SYCLBEllPackMatrixMultT<Real>(ma).upperLowerSynchronize(vr, vr);
184}
185
186void SYCLInternalLinearAlgebra::
187multDiag(const SYCLBEllPackMatrix<Real>& ma,
188 const SYCLVector<Real>& vy,
189 SYCLVector<Real>& vr) const
190{
191#ifdef ALIEN_USE_PERF_TIMER
192 SentryType s(m_timer, "SYCL-MULTDIAG");
193#endif
194 Internal::SYCLBEllPackMatrixMultT<Real>(ma).multDiag(vy,vr);
195}
196
197void SYCLInternalLinearAlgebra::
198multDiag(const SYCLVector<Real>& diag,
199 const SYCLVector<Real>& vy,
200 SYCLVector<Real>& vr) const
201{
202#ifdef ALIEN_USE_PERF_TIMER
203 SentryType s(m_timer, "SYCL-MULTDIAG");
204#endif
205 diag.pointWiseMult(vy,vr);
206}
207
208
209void SYCLInternalLinearAlgebra::
210multInvDiag(const SYCLBEllPackMatrix<Real>& ma,
211 SYCLVector<Real>& vr) const
212{
213#ifdef ALIEN_USE_PERF_TIMER
214 SentryType s(m_timer, "SYCL-MULTINVDIAG");
215#endif
216 Internal::SYCLBEllPackMatrixMultT<Real>(ma).multInvDiag(vr);
217}
218
219void SYCLInternalLinearAlgebra::
220computeInvDiag(const SYCLBEllPackMatrix<Real>& ma,
221 SYCLVector<Real>& vr) const
222{
223#ifdef ALIEN_USE_PERF_TIMER
224 SentryType s(m_timer, "SYCL-INVDIAG");
225#endif
226 Internal::SYCLBEllPackMatrixMultT<Real>(ma).computeInvDiag(vr);
227}
228
229/*---------------------------------------------------------------------------*/
230
231void SYCLInternalLinearAlgebra::axpy(Real alpha, const SYCLVector<Real>& vx, SYCLVector<Real>& vr) const
232{
233#ifdef ALIEN_USE_PERF_TIMER
234 SentryType s(m_timer, "SYCL-AXPY");
235#endif
236 m_internal->axpy(alpha, vx.internal()->values(), vr.internal()->values());
237}
238
239/*---------------------------------------------------------------------------*/
240
241void SYCLInternalLinearAlgebra::aypx(Real alpha ALIEN_UNUSED_PARAM,
242 SYCLVector<Real>& y ALIEN_UNUSED_PARAM,
243 const SYCLVector<Real>& x ALIEN_UNUSED_PARAM) const
244{
245 throw NotImplementedException(
246 A_FUNCINFO, "SYCLLinearAlgebra::aypx not implemented");
247}
248
249/*---------------------------------------------------------------------------*/
250
251void SYCLInternalLinearAlgebra::copy(const SYCLVector<Real>& vx, SYCLVector<Real>& vr) const
252{
253#ifdef ALIEN_USE_PERF_TIMER
254 SentryType s(m_timer, "SYCL-COPY");
255#endif
256 m_internal->copy(vx.internal()->values(), vr.internal()->values());
257}
258
259
260void SYCLInternalLinearAlgebra::axpy(Real alpha,
261 const SYCLVector<Real>& vx,
262 Integer stride_x,
263 SYCLVector<Real>& vr,
264 Integer stride_r) const
265{
266#ifdef ALIEN_USE_PERF_TIMER
267 SentryType s(m_timer, "SYCL-AXPY");
268#endif
269 m_internal->axpy(alpha, vx.internal()->values(), stride_x, vr.internal()->values(), stride_r);
270}
271
272void SYCLInternalLinearAlgebra::axpy(Real alpha,
273 const SYCLVector<Real>& vx,
274 SYCLVector<Real>& vr,
275 ConstArrayView<Integer> strides_r) const
276{
277#ifdef ALIEN_USE_PERF_TIMER
278 SentryType s(m_timer, "SYCL-AXPY");
279#endif
280 m_internal->axpy(alpha, vx.internal()->values(), vr.internal()->values(), strides_r);
281}
282/*---------------------------------------------------------------------------*/
283
284void SYCLInternalLinearAlgebra::aypx(Real alpha ALIEN_UNUSED_PARAM,
285 SYCLVector<Real>& y ALIEN_UNUSED_PARAM,
286 Integer stride_y ALIEN_UNUSED_PARAM,
287 const SYCLVector<Real>& x ALIEN_UNUSED_PARAM,
288 Integer stride_x ALIEN_UNUSED_PARAM) const
289{
290 throw NotImplementedException(
291 A_FUNCINFO, "SYCLLinearAlgebra::aypx not implemented");
292}
293
294/*---------------------------------------------------------------------------*/
295
296void SYCLInternalLinearAlgebra::copy(const SYCLVector<Real>& vx,
297 Integer stride_x,
298 SYCLVector<Real>& vr,
299 Integer stride_r) const
300{
301#ifdef ALIEN_USE_PERF_TIMER
302 SentryType s(m_timer, "SYCL-COPY");
303#endif
304 m_internal->copy(vx.internal()->values(), stride_x, vr.internal()->values(), stride_r);
305}
306
307void SYCLInternalLinearAlgebra::copy(const SYCLVector<Real>& vx,
308 ConstArrayView<Integer> strides_x,
309 SYCLVector<Real>& vr) const
310{
311#ifdef ALIEN_USE_PERF_TIMER
312 SentryType s(m_timer, "SYCL-COPY");
313#endif
314 m_internal->copy(vx.internal()->values(), strides_x, vr.internal()->values());
315}
316
317
318void SYCLInternalLinearAlgebra::copy(const SYCLVector<Real>& vx,
319 SYCLVector<Real>& vr,
320 ConstArrayView<Integer> strides_r) const
321{
322#ifdef ALIEN_USE_PERF_TIMER
323 SentryType s(m_timer, "SYCL-COPY");
324#endif
325 m_internal->copy(vx.internal()->values(), vr.internal()->values(), strides_r);
326}
327/*---------------------------------------------------------------------------*/
328
329Real SYCLInternalLinearAlgebra::dot(const SYCLVector<Real>& vx, const SYCLVector<Real>& vy) const
330{
331#ifdef ALIEN_USE_PERF_TIMER
332 SentryType s(m_timer, "SYCL-DOT");
333#endif
334 auto value = m_internal->dot(vx.internal()->values(), vy.internal()->values());
335 auto& dist = vx.distribution();
336 if (dist.isParallel()) {
337 //alien_info([&] { cout()<<" LOCAL VALUE : "<<value; });
338 value = Arccore::MessagePassing::mpAllReduce(dist.parallelMng(),
339 Arccore::MessagePassing::ReduceSum,
340 value);
341 //alien_info([&] { cout()<<" GLOBAL VALUE : "<<value; });
342 }
343 return value;
344}
345
346void SYCLInternalLinearAlgebra::dot(const SYCLVector<Real>& vx,
347 const SYCLVector<Real>& vy,
348 SYCLInternal::Future<Real>& res) const
349{
350#ifdef ALIEN_USE_PERF_TIMER
351 SentryType s(m_timer, "SYCL-DOT-F");
352#endif
353 m_internal->dot(vx.internal()->values(), vy.internal()->values(), res);
354
355 auto& dist = vx.distribution();
356 //alien_info([&] { cout()<<"SYCL-DOT-F is_parallel="<<dist.isParallel(); });
357 if (dist.isParallel()) {
358 res.get() ;
359 Real local_value = res() ;
360 Real* x = &res();
361 //alien_info([&] { cout()<<" LOCAL VALUE : "<<local_value; });
362 /*
363 auto request = mpNonBlockingAllReduce(dist.parallelMng(),
364 Arccore::MessagePassing::ReduceSum,
365 Arccore::ConstArrayView<Real>(1,&local_value),
366 Arccore::ArrayView<Real>(1,x)) ;
367 res.addRequest(dist.parallelMng(), request);
368 */
369 *x = Arccore::MessagePassing::mpAllReduce(
370 dist.parallelMng(), Arccore::MessagePassing::ReduceSum, local_value);
371 //alien_info([&] { cout()<<" GLOBAL VALUE : "<<*x; });
372 }
373}
374
375/*---------------------------------------------------------------------------*/
376
377void SYCLInternalLinearAlgebra::scal(Real alpha, SYCLVector<Real>& vx) const
378{
379#ifdef ALIEN_USE_PERF_TIMER
380 SentryType s(m_timer, "SYCL-SCAL");
381#endif
382 return m_internal->scal(alpha, vx.internal()->values());
383}
384
385
386void SYCLInternalLinearAlgebra::scal(SYCLVector<Real> const& vx, SYCLBEllPackMatrix<Real>& ma) const
387{
388#ifdef ALIEN_USE_PERF_TIMER
389 SentryType s(m_timer, "SYCL-SCAL");
390#endif
391 return ma.scal(vx);
392}
393
394void SYCLInternalLinearAlgebra::pointwiseMult(const SYCLVector<Real>& vx,
395 const SYCLVector<Real>& vy,
396 SYCLVector<Real>& vz) const
397{
398#ifdef ALIEN_USE_PERF_TIMER
399 SentryType s(m_timer, "SYCL-XYZ");
400#endif
401 return m_internal->pointwiseMult(vx.internal()->values(), vy.internal()->values(), vz.internal()->values());
402}
403
404void SYCLInternalLinearAlgebra::assign(SYCLVector<Real>& vx, Real alpha) const
405{
406#ifdef ALIEN_USE_PERF_TIMER
407 SentryType s(m_timer, "SYCL-ASSIGN");
408#endif
409 return m_internal->assign(alpha, vx.internal()->values());
410}
411
412void SYCLInternalLinearAlgebra::diagonal(
413const SYCLBEllPackMatrix<Real>& ma, SYCLVector<Real>& vx) const
414{
415#ifdef ALIEN_USE_PERF_TIMER
416 SentryType s(m_timer, "SYCL-DIAG");
417#endif
418 Internal::SYCLBEllPackMatrixMultT<Real>(ma).computeDiag(vx);
419}
420
421void SYCLInternalLinearAlgebra::reciprocal(SYCLVector<Real>& x ALIEN_UNUSED_PARAM) const
422{
423 throw NotImplementedException(
424 A_FUNCINFO, "SYCLLinearAlgebra::reciprocal not implemented");
425}
426
427
428Integer SYCLInternalLinearAlgebra::computeCxr(const Matrix& a, Matrix& cxr_a) const
429{
430 auto block_size = a.blockSize() ;
431 cxr_a.setBlockSize(1) ;
432 cxr_a.copy(a) ;
433 return block_size ;
434}
435
436Integer SYCLInternalLinearAlgebra::computeCxr(const Matrix& a,
437 Matrix& cxr_a,
438 UniqueArray<Integer>& strides) const
439{
440 auto block_size = a.blockSize() ;
441 cxr_a.setBlockSize(1) ;
442 {
443 const ISpace& space = a.rowSpace();
444 const MatrixDistribution& dist = a.distribution();
445
446 bool elliptic_split_tag_found = false ;
447
448 Integer domain_offset = dist.rowOffset();
449 Integer local_size = dist.localRowSize();
450
451 UniqueArray<Integer> filter(local_size);
452 filter.fill(0);
453 for (Integer i = 0; i < space.nbField(); ++i)
454 {
455 const UniqueArray<Integer>& indices = space.field(i);
456 if (space.fieldLabel(i) == "Elliptic" and not indices.empty())
457 {
458 elliptic_split_tag_found = true;
459 for (Integer j = 0; j < indices.size(); ++j)
460 {
461 const Integer index = indices[j];
462 //alien_info([&] { cout()<< "Elliptic index "<<j<<" "<<index;}) ;
463 filter[index - domain_offset] = 1 ;
464 }
465 }
466 }
467 cxr_a.copy(a,filter,strides) ;
468 }
469 return block_size ;
470}
471
472Integer SYCLInternalLinearAlgebra::computeCxr(const Matrix& a, const Vector& diag, Matrix& cxr_a) const
473{
474 auto block_size = a.blockSize() ;
475 cxr_a.setBlockSize(1) ;
476 cxr_a.copy(a) ;
477 cxr_a.scal(diag);
478 return block_size ;
479}
480
481
482
483
484SYCLInternalLinearAlgebraExpr::SYCLInternalLinearAlgebraExpr()
485: IInternalLinearAlgebraExpr<SYCLBEllPackMatrix<Real>, SYCLVector<Real>>()
486{
487 m_internal.reset(new SYCLInternal::KernelInternal());
488}
489
490/*---------------------------------------------------------------------------*/
491
492SYCLInternalLinearAlgebraExpr::~SYCLInternalLinearAlgebraExpr() {}
493
494/*---------------------------------------------------------------------------*/
495/*---------------------------------------------------------------------------*/
496
497Real SYCLInternalLinearAlgebraExpr::norm0(const SYCLVector<Real>& vx ALIEN_UNUSED_PARAM) const
498{
499 // return SYCLBLASKernel::nrm0(x.space().structInfo(),vx);
500 throw NotImplementedException(
501 A_FUNCINFO, "SYCLLinearAlgebra::norm0 not implemented");
502}
503
504/*---------------------------------------------------------------------------*/
505
506Real SYCLInternalLinearAlgebraExpr::norm1(const SYCLVector<Real>& vx ALIEN_UNUSED_PARAM) const
507{
508 // return SYCLBLASKernel::nrm1(x.space().structInfo(),vx);
509 throw NotImplementedException(
510 A_FUNCINFO, "SYCLLinearAlgebra::norm1 not implemented");
511}
512
513/*---------------------------------------------------------------------------*/
514
515Real SYCLInternalLinearAlgebraExpr::norm2(const SYCLVector<Real>& vx) const
516{
517 return std::sqrt(m_internal->dot(vx.internal()->values(), vx.internal()->values()));
518}
519
520Real SYCLInternalLinearAlgebraExpr::normInf([[maybe_unused]] const SYCLVector<Real>& vx) const
521{
522#ifdef ALIEN_USE_PERF_TIMER
523 SentryType s(m_timer, "SYCL-NORMINF");
524#endif
525 throw NotImplementedException(
526 A_FUNCINFO, "SYCLLinearAlgebra::normInf not implemented");
527}
528/*---------------------------------------------------------------------------*/
529
530void SYCLInternalLinearAlgebraExpr::mult(
531const SYCLBEllPackMatrix<Real>& ma, const SYCLVector<Real>& vx, SYCLVector<Real>& vr) const
532{
533 Internal::SYCLBEllPackMatrixMultT<Real>(ma).mult(vx, vr);
534}
535
536void SYCLInternalLinearAlgebraExpr::mult(
537const SYCLBEllPackMatrix<Real>& ma, const UniqueArray<Real>& vx, UniqueArray<Real>& vr) const
538{
539 Internal::SYCLBEllPackMatrixMultT<Real>(ma).mult(vx, vr);
540}
541
542/*---------------------------------------------------------------------------*/
543
544void SYCLInternalLinearAlgebraExpr::axpy([[maybe_unused]] Real alpha,
545 [[maybe_unused]] const UniqueArray<Real>& vx,
546 [[maybe_unused]] UniqueArray<Real>& vr) const
547{
548 throw NotImplementedException(
549 A_FUNCINFO, "SYCLLinearAlgebra::axpy not implemented");
550}
551
552void SYCLInternalLinearAlgebraExpr::axpy(Real alpha, const SYCLVector<Real>& vx, SYCLVector<Real>& vy) const
553{
554 m_internal->axpy(alpha, vx.internal()->values(), vy.internal()->values());
555}
556
557/*---------------------------------------------------------------------------*/
558
559void SYCLInternalLinearAlgebraExpr::aypx([[maybe_unused]] Real alpha, [[maybe_unused]] UniqueArray<Real>& vy, [[maybe_unused]] UniqueArray<Real> const& vx) const
560{
561 throw NotImplementedException(
562 A_FUNCINFO, "SYCLLinearAlgebra::aypx not implemented");
563}
564
565void SYCLInternalLinearAlgebraExpr::aypx(Real alpha ALIEN_UNUSED_PARAM,
566 SYCLVector<Real>& y ALIEN_UNUSED_PARAM, const SYCLVector<Real>& x ALIEN_UNUSED_PARAM) const
567{
568 throw NotImplementedException(
569 A_FUNCINFO, "SYCLLinearAlgebra::aypx not implemented");
570}
571
572/*---------------------------------------------------------------------------*/
573
574void SYCLInternalLinearAlgebraExpr::copy([[maybe_unused]] const UniqueArray<Real>& vx,
575 [[maybe_unused]] UniqueArray<Real>& vr) const
576{
577 throw NotImplementedException(
578 A_FUNCINFO, "SYCLLinearAlgebra::copy not implemented");
579}
580
581void SYCLInternalLinearAlgebraExpr::copy(const SYCLVector<Real>& vx, SYCLVector<Real>& vy) const
582{
583 m_internal->copy(vx.internal()->values(), vy.internal()->values());
584}
585
586/*---------------------------------------------------------------------------*/
587
588Real SYCLInternalLinearAlgebraExpr::dot([[maybe_unused]]
589Integer local_size, [[maybe_unused]] const UniqueArray<Real>& vx, [[maybe_unused]] const UniqueArray<Real>& vy) const
590{
591 throw NotImplementedException(
592 A_FUNCINFO, "SYCLLinearAlgebra::dot not implemented");
593}
594
595Real SYCLInternalLinearAlgebraExpr::dot(const SYCLVector<Real>& vx, const SYCLVector<Real>& vy) const
596{
597 return m_internal->dot(vx.internal()->values(), vy.internal()->values());
598}
599
600Real SYCLInternalLinearAlgebraExpr::norm2([[maybe_unused]] const SYCLBEllPackMatrix<Real>& a) const
601{
602 throw NotImplementedException(
603 A_FUNCINFO, "SYCLLinearAlgebra::notm2 not implemented");
604}
605
606void SYCLInternalLinearAlgebraExpr::copy([[maybe_unused]] const SYCLBEllPackMatrix<Real>& a, [[maybe_unused]] SYCLBEllPackMatrix<Real>& r) const
607{
608 throw NotImplementedException(
609 A_FUNCINFO, "SYCLLinearAlgebra::copy not implemented");
610}
611
612void SYCLInternalLinearAlgebraExpr::add([[maybe_unused]] const SYCLBEllPackMatrix<Real>& a, [[maybe_unused]] SYCLBEllPackMatrix<Real>& r) const
613{
614 throw NotImplementedException(
615 A_FUNCINFO, "SYCLLinearAlgebra::add not implemented");
616}
617
618void SYCLInternalLinearAlgebraExpr::scal([[maybe_unused]] Real alpha, [[maybe_unused]] SYCLBEllPackMatrix<Real>& a) const
619{
620 throw NotImplementedException(
621 A_FUNCINFO, "SYCLLinearAlgebra::scal not implemented");
622}
623/*---------------------------------------------------------------------------*/
624void SYCLInternalLinearAlgebraExpr::scal(Real alpha ALIEN_UNUSED_PARAM, UniqueArray<Real>& x ALIEN_UNUSED_PARAM) const
625{
626 throw NotImplementedException(
627 A_FUNCINFO, "SYCLLinearAlgebra::scal not implemented");
628}
629
630void SYCLInternalLinearAlgebraExpr::scal(Real alpha ALIEN_UNUSED_PARAM, SYCLVector<Real>& x ALIEN_UNUSED_PARAM) const
631{
632 throw NotImplementedException(
633 A_FUNCINFO, "SYCLLinearAlgebra::aypx not implemented");
634}
635
636void SYCLInternalLinearAlgebraExpr::diagonal(
637const SYCLBEllPackMatrix<Real>& a ALIEN_UNUSED_PARAM, SYCLVector<Real>& x ALIEN_UNUSED_PARAM) const
638{
639 throw NotImplementedException(
640 A_FUNCINFO, "SYCLLinearAlgebra::aypx not implemented");
641}
642
643void SYCLInternalLinearAlgebraExpr::reciprocal(SYCLVector<Real>& x ALIEN_UNUSED_PARAM) const
644{
645 throw NotImplementedException(
646 A_FUNCINFO, "SYCLLinearAlgebra::aypx not implemented");
647}
648
649void SYCLInternalLinearAlgebraExpr::pointwiseMult(const SYCLVector<Real>& x ALIEN_UNUSED_PARAM,
650 const SYCLVector<Real>& y ALIEN_UNUSED_PARAM, SYCLVector<Real>& w ALIEN_UNUSED_PARAM) const
651{
652 throw NotImplementedException(
653 A_FUNCINFO, "SYCLLinearAlgebra::aypx not implemented");
654}
655
656template class ALIEN_EXPORT SYCLInternal::Future<double>;
657
658namespace SYCLInternal
659{
660template <>
661sycl::buffer<double>& KernelInternal::getWorkBuffer(std::size_t size)
662{
663 if (m_double_work == nullptr) {
664 m_double_work = new sycl::buffer<double>(size);
665 m_double_work->set_final_data(nullptr);
666 }
667 else {
668 if (size > m_double_work->size()) {
669 delete m_double_work;
670 m_double_work = new sycl::buffer<double>(size);
671 m_double_work->set_final_data(nullptr);
672 }
673 }
674 return *m_double_work;
675}
676}
677
678} // namespace Alien
679
680/*---------------------------------------------------------------------------*/
681/*---------------------------------------------------------------------------*/
LinearAlgebraExprT.h.
LinearAlgebraT.h.
Internal linear algebra interface.
Internal linear algebra interface.
Linear algebra interface.
Linear algebra interface.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Definition BackEnd.h:17