Expression Templates Library (ETL)
xor.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 
28 #ifdef EGBLAS_HAS_BXOR
29 static constexpr bool has_bxor = true;
30 #else
31 static constexpr bool has_bxor = false;
32 #endif
33 
44 inline void logical_xor([[maybe_unused]] size_t n,
45  [[maybe_unused]] const bool* A,
46  [[maybe_unused]] size_t lda,
47  [[maybe_unused]] const bool* B,
48  [[maybe_unused]] size_t ldb,
49  [[maybe_unused]] bool* C,
50  [[maybe_unused]] size_t ldc) {
51 #ifdef EGBLAS_HAS_BXOR
52  inc_counter("egblas");
53  egblas_bxor(n, A, lda, B, ldb, C, ldc);
54 #else
55  cpp_unreachable("Invalid call to egblas::logical_xor");
56 #endif
57 }
58 
59 } //end of namespace etl::impl::egblas
Definition: abs.hpp:23
auto logical_xor(LE &&lhs, RE &&rhs)
Builds an expression representing the elementwise logical xor of lhs and rhs.
Definition: binary_expression_builder.hpp:496
void inc_counter([[maybe_unused]] const char *name)
Increase the given counter.
Definition: counters.hpp:25