Alien  1.3.0
Developer documentation
Loading...
Searching...
No Matches
SYCLBackEnd.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2025 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#pragma once
8
9#include <arccore/message_passing/MessagePassingGlobal.h>
10#include <alien/core/backend/BackEnd.h>
11#include <alien/utils/Precomp.h>
12
14#include <alien/core/backend/IInternalLinearAlgebraT.h>
15
16/*---------------------------------------------------------------------------*/
17/*---------------------------------------------------------------------------*/
18
19namespace Alien
20{
21
22/*---------------------------------------------------------------------------*/
23/*---------------------------------------------------------------------------*/
24
25class MultiVectorImpl;
26
27template <typename T>
29
30template <typename T>
31class SYCLVector;
32
33namespace SYCLInternal
34{
35
36 template <typename MatrixT>
37 class SYCLSendRecvOp ;
38
39 template <typename MatrixT>
40 class SYCLLUSendRecvOp ;
41}
42
43template <typename T>
45{
46 // clang-format off
47 typedef SYCLBEllPackMatrix<T> MatrixType;
48 typedef SYCLVector<T> VectorType;
51 // clang-format on
52};
53
54extern SYCLBEllPackTraits<Real>::AlgebraType* SYCLInternalLinearAlgebraFactory();
55extern SYCLBEllPackTraits<Real>::AlgebraExprType*
56SYCLInternalLinearAlgebraExprFactory();
57
58
59template <typename T>
60class HCSRMatrix;
61
62template <typename T>
63class HCSRVector;
64
65
66template <typename T>
68{
69 // clang-format off
70 typedef HCSRMatrix<T> MatrixType;
71 typedef HCSRVector<T> VectorType;
72 // clang-format on
73};
74
75/*---------------------------------------------------------------------------*/
76
77namespace BackEnd
78{
79 namespace tag
80 {
81 struct sycl
82 {};
83
84 struct hcsr
85 {};
86 } // namespace tag
87} // namespace BackEnd
88
89template <>
90struct AlgebraTraits<BackEnd::tag::sycl>
91{
92 // clang-format off
93 typedef Real value_type;
94 typedef SYCLBEllPackTraits<Real>::MatrixType matrix_type;
95 typedef SYCLBEllPackTraits<Real>::VectorType vector_type;
96 typedef SYCLBEllPackTraits<Real>::AlgebraType algebra_type;
97 typedef SYCLBEllPackTraits<Real>::AlgebraExprType algebra_expr_type;
98 // clang-format on
99
100 static algebra_type* algebra_factory(
101 IMessagePassingMng* p_mng ALIEN_UNUSED_PARAM = nullptr)
102 {
103 return SYCLInternalLinearAlgebraFactory();
104 }
105 static algebra_expr_type* algebra_expr_factory(
106 IMessagePassingMng* p_mng ALIEN_UNUSED_PARAM = nullptr)
107 {
108 return SYCLInternalLinearAlgebraExprFactory();
109 }
110
111 static BackEndId name() { return "sycl"; }
112};
113
114
115template <>
116struct AlgebraTraits<BackEnd::tag::hcsr>
117{
118 // clang-format off
119 typedef Real value_type;
120 typedef HCSRTraits<Real>::MatrixType matrix_type;
121 typedef HCSRTraits<Real>::VectorType vector_type;
122 // clang-format on
123
124 static BackEndId name() { return "hcsr"; }
125};
126
127template <>
128struct LUSendRecvTraits<BackEnd::tag::sycl>
129{
130 // clang-format off
134 typedef SYCLInternal::SYCLLUSendRecvOp<matrix_type> matrix_op_type ;
135 typedef SYCLInternal::SYCLSendRecvOp<value_type> vector_op_type ;
136 // clang-format on
137};
138
139/*---------------------------------------------------------------------------*/
140
141} // namespace Alien
142
143/*---------------------------------------------------------------------------*/
IInternalLinearAlgebraExprT.h.
Internal linear algebra interface.
Internal linear algebra interface.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Definition BackEnd.h:17