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
272/*---------------------------------------------------------------------------*/
273
274void SYCLInternalLinearAlgebra::aypx(Real alpha ALIEN_UNUSED_PARAM,
275 SYCLVector<Real>& y ALIEN_UNUSED_PARAM,
276 Integer stride_y ALIEN_UNUSED_PARAM,
277 const SYCLVector<Real>& x ALIEN_UNUSED_PARAM,
278 Integer stride_x ALIEN_UNUSED_PARAM) const
279{
280 throw NotImplementedException(
281 A_FUNCINFO, "SYCLLinearAlgebra::aypx not implemented");
282}
283
284/*---------------------------------------------------------------------------*/
285
286void SYCLInternalLinearAlgebra::copy(const SYCLVector<Real>& vx,
287 Integer stride_x,
288 SYCLVector<Real>& vr,
289 Integer stride_r) const
290{
291#ifdef ALIEN_USE_PERF_TIMER
292 SentryType s(m_timer, "SYCL-COPY");
293#endif
294 m_internal->copy(vx.internal()->values(), stride_x, vr.internal()->values(), stride_r);
295}
296
297/*---------------------------------------------------------------------------*/
298
299Real SYCLInternalLinearAlgebra::dot(const SYCLVector<Real>& vx, const SYCLVector<Real>& vy) const
300{
301#ifdef ALIEN_USE_PERF_TIMER
302 SentryType s(m_timer, "SYCL-DOT");
303#endif
304 auto value = m_internal->dot(vx.internal()->values(), vy.internal()->values());
305 auto& dist = vx.distribution();
306 if (dist.isParallel()) {
307 //alien_info([&] { cout()<<" LOCAL VALUE : "<<value; });
308 value = Arccore::MessagePassing::mpAllReduce(dist.parallelMng(),
309 Arccore::MessagePassing::ReduceSum,
310 value);
311 //alien_info([&] { cout()<<" GLOBAL VALUE : "<<value; });
312 }
313 return value;
314}
315
316void SYCLInternalLinearAlgebra::dot(const SYCLVector<Real>& vx,
317 const SYCLVector<Real>& vy,
318 SYCLInternal::Future<Real>& res) const
319{
320#ifdef ALIEN_USE_PERF_TIMER
321 SentryType s(m_timer, "SYCL-DOT-F");
322#endif
323 m_internal->dot(vx.internal()->values(), vy.internal()->values(), res);
324
325 auto& dist = vx.distribution();
326 //alien_info([&] { cout()<<"SYCL-DOT-F is_parallel="<<dist.isParallel(); });
327 if (dist.isParallel()) {
328 res.get() ;
329 Real local_value = res() ;
330 Real* x = &res();
331 //alien_info([&] { cout()<<" LOCAL VALUE : "<<local_value; });
332 /*
333 auto request = mpNonBlockingAllReduce(dist.parallelMng(),
334 Arccore::MessagePassing::ReduceSum,
335 Arccore::ConstArrayView<Real>(1,&local_value),
336 Arccore::ArrayView<Real>(1,x)) ;
337 res.addRequest(dist.parallelMng(), request);
338 */
339 *x = Arccore::MessagePassing::mpAllReduce(
340 dist.parallelMng(), Arccore::MessagePassing::ReduceSum, local_value);
341 //alien_info([&] { cout()<<" GLOBAL VALUE : "<<*x; });
342 }
343}
344
345/*---------------------------------------------------------------------------*/
346
347void SYCLInternalLinearAlgebra::scal(Real alpha, SYCLVector<Real>& vx) const
348{
349#ifdef ALIEN_USE_PERF_TIMER
350 SentryType s(m_timer, "SYCL-SCAL");
351#endif
352 return m_internal->scal(alpha, vx.internal()->values());
353}
354
355
356void SYCLInternalLinearAlgebra::scal(SYCLVector<Real> const& vx, SYCLBEllPackMatrix<Real>& ma) const
357{
358#ifdef ALIEN_USE_PERF_TIMER
359 SentryType s(m_timer, "SYCL-SCAL");
360#endif
361 return ma.scal(vx);
362}
363
364void SYCLInternalLinearAlgebra::pointwiseMult(const SYCLVector<Real>& vx,
365 const SYCLVector<Real>& vy,
366 SYCLVector<Real>& vz) const
367{
368#ifdef ALIEN_USE_PERF_TIMER
369 SentryType s(m_timer, "SYCL-XYZ");
370#endif
371 return m_internal->pointwiseMult(vx.internal()->values(), vy.internal()->values(), vz.internal()->values());
372}
373
374void SYCLInternalLinearAlgebra::assign(SYCLVector<Real>& vx, Real alpha) const
375{
376#ifdef ALIEN_USE_PERF_TIMER
377 SentryType s(m_timer, "SYCL-ASSIGN");
378#endif
379 return m_internal->assign(alpha, vx.internal()->values());
380}
381
382void SYCLInternalLinearAlgebra::diagonal(
383const SYCLBEllPackMatrix<Real>& ma, SYCLVector<Real>& vx) const
384{
385#ifdef ALIEN_USE_PERF_TIMER
386 SentryType s(m_timer, "SYCL-DIAG");
387#endif
388 Internal::SYCLBEllPackMatrixMultT<Real>(ma).computeDiag(vx);
389}
390
391void SYCLInternalLinearAlgebra::reciprocal(SYCLVector<Real>& x ALIEN_UNUSED_PARAM) const
392{
393 throw NotImplementedException(
394 A_FUNCINFO, "SYCLLinearAlgebra::reciprocal not implemented");
395}
396
397
398Integer SYCLInternalLinearAlgebra::computeCxr(const Matrix& a, Matrix& cxr_a) const
399{
400 auto block_size = a.blockSize() ;
401 cxr_a.setBlockSize(1) ;
402 cxr_a.copy(a) ;
403 return block_size ;
404}
405
406Integer SYCLInternalLinearAlgebra::computeCxr(const Matrix& a, const Vector& diag, Matrix& cxr_a) const
407{
408 auto block_size = a.blockSize() ;
409 cxr_a.setBlockSize(1) ;
410 cxr_a.copy(a) ;
411 cxr_a.scal(diag);
412 return block_size ;
413}
414
415
416
417
418SYCLInternalLinearAlgebraExpr::SYCLInternalLinearAlgebraExpr()
419: IInternalLinearAlgebraExpr<SYCLBEllPackMatrix<Real>, SYCLVector<Real>>()
420{
421 m_internal.reset(new SYCLInternal::KernelInternal());
422}
423
424/*---------------------------------------------------------------------------*/
425
426SYCLInternalLinearAlgebraExpr::~SYCLInternalLinearAlgebraExpr() {}
427
428/*---------------------------------------------------------------------------*/
429/*---------------------------------------------------------------------------*/
430
431Real SYCLInternalLinearAlgebraExpr::norm0(const SYCLVector<Real>& vx ALIEN_UNUSED_PARAM) const
432{
433 // return SYCLBLASKernel::nrm0(x.space().structInfo(),vx);
434 throw NotImplementedException(
435 A_FUNCINFO, "SYCLLinearAlgebra::norm0 not implemented");
436}
437
438/*---------------------------------------------------------------------------*/
439
440Real SYCLInternalLinearAlgebraExpr::norm1(const SYCLVector<Real>& vx ALIEN_UNUSED_PARAM) const
441{
442 // return SYCLBLASKernel::nrm1(x.space().structInfo(),vx);
443 throw NotImplementedException(
444 A_FUNCINFO, "SYCLLinearAlgebra::norm1 not implemented");
445}
446
447/*---------------------------------------------------------------------------*/
448
449Real SYCLInternalLinearAlgebraExpr::norm2(const SYCLVector<Real>& vx) const
450{
451 return std::sqrt(m_internal->dot(vx.internal()->values(), vx.internal()->values()));
452}
453
454Real SYCLInternalLinearAlgebraExpr::normInf([[maybe_unused]] const SYCLVector<Real>& vx) const
455{
456#ifdef ALIEN_USE_PERF_TIMER
457 SentryType s(m_timer, "SYCL-NORMINF");
458#endif
459 throw NotImplementedException(
460 A_FUNCINFO, "SYCLLinearAlgebra::normInf not implemented");
461}
462/*---------------------------------------------------------------------------*/
463
464void SYCLInternalLinearAlgebraExpr::mult(
465const SYCLBEllPackMatrix<Real>& ma, const SYCLVector<Real>& vx, SYCLVector<Real>& vr) const
466{
467 Internal::SYCLBEllPackMatrixMultT<Real>(ma).mult(vx, vr);
468}
469
470void SYCLInternalLinearAlgebraExpr::mult(
471const SYCLBEllPackMatrix<Real>& ma, const UniqueArray<Real>& vx, UniqueArray<Real>& vr) const
472{
473 Internal::SYCLBEllPackMatrixMultT<Real>(ma).mult(vx, vr);
474}
475
476/*---------------------------------------------------------------------------*/
477
478void SYCLInternalLinearAlgebraExpr::axpy([[maybe_unused]] Real alpha,
479 [[maybe_unused]] const UniqueArray<Real>& vx,
480 [[maybe_unused]] UniqueArray<Real>& vr) const
481{
482 throw NotImplementedException(
483 A_FUNCINFO, "SYCLLinearAlgebra::axpy not implemented");
484}
485
486void SYCLInternalLinearAlgebraExpr::axpy(Real alpha, const SYCLVector<Real>& vx, SYCLVector<Real>& vy) const
487{
488 m_internal->axpy(alpha, vx.internal()->values(), vy.internal()->values());
489}
490
491/*---------------------------------------------------------------------------*/
492
493void SYCLInternalLinearAlgebraExpr::aypx([[maybe_unused]] Real alpha, [[maybe_unused]] UniqueArray<Real>& vy, [[maybe_unused]] UniqueArray<Real> const& vx) const
494{
495 throw NotImplementedException(
496 A_FUNCINFO, "SYCLLinearAlgebra::aypx not implemented");
497}
498
499void SYCLInternalLinearAlgebraExpr::aypx(Real alpha ALIEN_UNUSED_PARAM,
500 SYCLVector<Real>& y ALIEN_UNUSED_PARAM, const SYCLVector<Real>& x ALIEN_UNUSED_PARAM) const
501{
502 throw NotImplementedException(
503 A_FUNCINFO, "SYCLLinearAlgebra::aypx not implemented");
504}
505
506/*---------------------------------------------------------------------------*/
507
508void SYCLInternalLinearAlgebraExpr::copy([[maybe_unused]] const UniqueArray<Real>& vx,
509 [[maybe_unused]] UniqueArray<Real>& vr) const
510{
511 throw NotImplementedException(
512 A_FUNCINFO, "SYCLLinearAlgebra::copy not implemented");
513}
514
515void SYCLInternalLinearAlgebraExpr::copy(const SYCLVector<Real>& vx, SYCLVector<Real>& vy) const
516{
517 m_internal->copy(vx.internal()->values(), vy.internal()->values());
518}
519
520/*---------------------------------------------------------------------------*/
521
522Real SYCLInternalLinearAlgebraExpr::dot([[maybe_unused]]
523Integer local_size, [[maybe_unused]] const UniqueArray<Real>& vx, [[maybe_unused]] const UniqueArray<Real>& vy) const
524{
525 throw NotImplementedException(
526 A_FUNCINFO, "SYCLLinearAlgebra::dot not implemented");
527}
528
529Real SYCLInternalLinearAlgebraExpr::dot(const SYCLVector<Real>& vx, const SYCLVector<Real>& vy) const
530{
531 return m_internal->dot(vx.internal()->values(), vy.internal()->values());
532}
533
534Real SYCLInternalLinearAlgebraExpr::norm2([[maybe_unused]] const SYCLBEllPackMatrix<Real>& a) const
535{
536 throw NotImplementedException(
537 A_FUNCINFO, "SYCLLinearAlgebra::notm2 not implemented");
538}
539
540void SYCLInternalLinearAlgebraExpr::copy([[maybe_unused]] const SYCLBEllPackMatrix<Real>& a, [[maybe_unused]] SYCLBEllPackMatrix<Real>& r) const
541{
542 throw NotImplementedException(
543 A_FUNCINFO, "SYCLLinearAlgebra::copy not implemented");
544}
545
546void SYCLInternalLinearAlgebraExpr::add([[maybe_unused]] const SYCLBEllPackMatrix<Real>& a, [[maybe_unused]] SYCLBEllPackMatrix<Real>& r) const
547{
548 throw NotImplementedException(
549 A_FUNCINFO, "SYCLLinearAlgebra::add not implemented");
550}
551
552void SYCLInternalLinearAlgebraExpr::scal([[maybe_unused]] Real alpha, [[maybe_unused]] SYCLBEllPackMatrix<Real>& a) const
553{
554 throw NotImplementedException(
555 A_FUNCINFO, "SYCLLinearAlgebra::scal not implemented");
556}
557/*---------------------------------------------------------------------------*/
558void SYCLInternalLinearAlgebraExpr::scal(Real alpha ALIEN_UNUSED_PARAM, UniqueArray<Real>& x ALIEN_UNUSED_PARAM) const
559{
560 throw NotImplementedException(
561 A_FUNCINFO, "SYCLLinearAlgebra::scal not implemented");
562}
563
564void SYCLInternalLinearAlgebraExpr::scal(Real alpha ALIEN_UNUSED_PARAM, SYCLVector<Real>& x ALIEN_UNUSED_PARAM) const
565{
566 throw NotImplementedException(
567 A_FUNCINFO, "SYCLLinearAlgebra::aypx not implemented");
568}
569
570void SYCLInternalLinearAlgebraExpr::diagonal(
571const SYCLBEllPackMatrix<Real>& a ALIEN_UNUSED_PARAM, SYCLVector<Real>& x ALIEN_UNUSED_PARAM) const
572{
573 throw NotImplementedException(
574 A_FUNCINFO, "SYCLLinearAlgebra::aypx not implemented");
575}
576
577void SYCLInternalLinearAlgebraExpr::reciprocal(SYCLVector<Real>& x ALIEN_UNUSED_PARAM) const
578{
579 throw NotImplementedException(
580 A_FUNCINFO, "SYCLLinearAlgebra::aypx not implemented");
581}
582
583void SYCLInternalLinearAlgebraExpr::pointwiseMult(const SYCLVector<Real>& x ALIEN_UNUSED_PARAM,
584 const SYCLVector<Real>& y ALIEN_UNUSED_PARAM, SYCLVector<Real>& w ALIEN_UNUSED_PARAM) const
585{
586 throw NotImplementedException(
587 A_FUNCINFO, "SYCLLinearAlgebra::aypx not implemented");
588}
589
590template class ALIEN_EXPORT SYCLInternal::Future<double>;
591
592namespace SYCLInternal
593{
594template <>
595sycl::buffer<double>& KernelInternal::getWorkBuffer(std::size_t size)
596{
597 if (m_double_work == nullptr) {
598 m_double_work = new sycl::buffer<double>(size);
599 m_double_work->set_final_data(nullptr);
600 }
601 else {
602 if (size > m_double_work->size()) {
603 delete m_double_work;
604 m_double_work = new sycl::buffer<double>(size);
605 m_double_work->set_final_data(nullptr);
606 }
607 }
608 return *m_double_work;
609}
610}
611
612} // namespace Alien
613
614/*---------------------------------------------------------------------------*/
615/*---------------------------------------------------------------------------*/
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