ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
ParallelNumeric.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/*------------------------- File ParallelNumeric.h -------------------------*/
3/*--------------------------------------------------------------------------*/
56/*--------------------------------------------------------------------------*/
57/*----------------------------- DEFINITIONS --------------------------------*/
58/*--------------------------------------------------------------------------*/
59
60#ifndef __ADS_ParallelNumeric
61 #define __ADS_ParallelNumeric
62/* self-identification: #endif constant */
63
64/*--------------------------------------------------------------------------*/
65/*------------------------------ INCLUDES ----------------------------------*/
66/*--------------------------------------------------------------------------*/
67
68#include "ADS/Contract.h"
73
74#include <algorithm>
75#include <cstddef>
76#include <vector>
77
78/*--------------------------------------------------------------------------*/
79/*--------------------------- NAMESPACE ------------------------------------*/
80/*--------------------------------------------------------------------------*/
81
82namespace ADS
83{
84
112template< Executor E , class T , std::integral I , std::integral P >
113void multiply( E & ex , const BasicCsrMatrix< T , I , P > & A , const T * x ,
114 T * y );
115
128template< Executor E , class T , std::integral I , std::integral P >
129[[nodiscard]] std::vector< T > multiply( E & ex ,
130 const BasicCsrMatrix< T , I ,
131 P > & A ,
132 const std::vector< T > & x );
133
162template< Executor E , std::size_t C >
163void multiply( E & ex , const SellMatrix< C > & A , const double * x ,
164 double * y );
165
178template< Executor E , std::size_t C >
179[[nodiscard]] std::vector< double >
180multiply( E & ex , const SellMatrix< C > & A ,
181 const std::vector< double > & x );
182
204template< Executor E , class T >
205void gemm( E & ex , std::size_t m , std::size_t n , std::size_t k , T alpha ,
206 const T * A , std::size_t lda , const T * B , std::size_t ldb ,
207 T beta ,
208 T * C , std::size_t ldc );
209
221template< Executor E , class T >
222[[nodiscard]] DenseMatrix< T > multiply( E & ex , const DenseMatrix< T > & A ,
223 const DenseMatrix< T > & B );
224
225/*--------------------------------------------------------------------------*/
226
227} // end( namespace ADS )
228
229/*--------------------------------------------------------------------------*/
230/*-------------------------- IMPLEMENTATION --------------------------------*/
231/*--------------------------------------------------------------------------*/
232
233#include "ADS/parallel/impl/ParallelNumeric.tpp"
234
235/*--------------------------------------------------------------------------*/
236
237#endif /* ParallelNumeric.h included */
238
239/*--------------------------------------------------------------------------*/
240/*----------------------- End File ParallelNumeric.h -----------------------*/
241/*--------------------------------------------------------------------------*/
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
A sparse matrix in compressed sparse rows (CSR), beyond the book: the nonzeros of each row,...
The dense matrices by rows, beyond the book: DenseMatrix keeps the entries by rows in one contiguous...
The layer of execution of the parallel algorithms of ADS, beyond the book: an executor runs the calls...
A sparse matrix in the format SELL- - of Kreutzer, Hager, Wellein, Fehske and Bishop,...
a sparse matrix of values T in compressed sparse rows, the columns of the type I and the offsets of ...
Definition CsrMatrix.h:129
an matrix by rows in one contiguous vector
Definition DenseMatrix.h:187
a sparse matrix of doubles in SELL- - , chunks of rows (4 by default, the fastest on a Xeon Gold 512...
Definition SellMatrix.h:88
DenseMatrix< T > multiply(const DenseMatrix< T > &A, const DenseMatrix< T > &B)
the product , a new matrix, by gemm() with and
void gemm(std::size_t m, std::size_t n, std::size_t k, T alpha, const T *A, std::size_t lda, const T *B, std::size_t ldb, T beta, T *C, std::size_t ldc)
the product , , and by rows, with the leading dimensions lda, ldb, ldc (the distance of two rows...
Definition ADT.h:96