Expression Templates Library (ETL)
transpose_front.hpp
Go to the documentation of this file.
1 //=======================================================================
2 // Copyright (c) 2014-2023 Baptiste Wicht
3 // Distributed under the terms of the MIT License.
4 // (See accompanying file LICENSE or copy at
5 // http://opensource.org/licenses/MIT)
6 //=======================================================================
7 
13 #pragma once
14 
15 #ifdef ETL_EGBLAS_MODE
16 
17 #include "etl/impl/cublas/cuda.hpp"
18 
19 #include <egblas.hpp>
20 
21 #endif
22 
23 namespace etl::impl::egblas {
24 
25 #ifdef EGBLAS_HAS_STRANSPOSE_FRONT
26 static constexpr bool has_stranspose_front = true;
27 #else
28 static constexpr bool has_stranspose_front = false;
29 #endif
30 
40 inline void transpose_front([[maybe_unused]] size_t m,
41  [[maybe_unused]] size_t n,
42  [[maybe_unused]] size_t k,
43  [[maybe_unused]] float* A,
44  [[maybe_unused]] float* B) {
45 #ifdef EGBLAS_HAS_STRANSPOSE_FRONT
46  inc_counter("egblas");
47  egblas_stranspose_front(m, n, k, A, B);
48 #else
49  cpp_unreachable("Invalid call to egblas::transpose_front");
50 #endif
51 }
52 
53 #ifdef EGBLAS_HAS_DTRANSPOSE_FRONT
54 static constexpr bool has_dtranspose_front = true;
55 #else
56 static constexpr bool has_dtranspose_front = false;
57 #endif
58 
68 inline void transpose_front([[maybe_unused]] size_t m,
69  [[maybe_unused]] size_t n,
70  [[maybe_unused]] size_t k,
71  [[maybe_unused]] double* A,
72  [[maybe_unused]] double* B) {
73 #ifdef EGBLAS_HAS_DTRANSPOSE_FRONT
74  inc_counter("egblas");
75  egblas_dtranspose_front(m, n, k, A, B);
76 #else
77  cpp_unreachable("Invalid call to egblas::transpose_front");
78 #endif
79 }
80 
81 } //end of namespace etl::impl::egblas
Definition: abs.hpp:23
auto transpose_front(const E &value)
Returns the transpose of the given expression.
Definition: expression_builder.hpp:568
void inc_counter([[maybe_unused]] const char *name)
Increase the given counter.
Definition: counters.hpp:25