FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
min_max_value_block.hpp
1// FEAT3: Finite Element Analysis Toolbox, Version 3
2// Copyright (C) 2010 by Stefan Turek & the FEAT group
3// FEAT3 is released under the GNU General Public License version 3,
4// see the file 'copyright.txt' in the top level directory for details.
5
6#pragma once
7
8// includes, FEAT
10#include <kernel/backend.hpp>
11#include <kernel/util/memory_arbiter.hpp>
12
13namespace FEAT::LAFEM::Arch
14{
16 {
17 template <typename ValueType_>
18 static ValueType_ exec_generic_impl(const ValueType_ * const x, const Index size, const bool min_, const bool abs_);
19
20 template <typename ValueType_>
21 static ValueType_ exec_generic(const Memory::Arbiter& x, const Index size, const bool min_, const bool abs_)
22 {
24 return exec_generic_impl(x_view.get_r(), size, min_, abs_);
25 }
26
27 template <typename ValueType_>
28 static ValueType_ exec(const Memory::Arbiter& x, const Index size, const bool min_, const bool abs_)
29 {
31 {
33 return exec_generic<ValueType_>(x, size, min_, abs_);
34 break;
35
37#ifdef FEAT_HAVE_MKL
38 Backend::warn_missing("LAFEM::Arch::MinMaxValueBlock::exec");
39 return exec_generic<ValueType_>(x, size, min_, abs_);
40#else
41 XABORTM("LAFEM::Arch::MinMaxValueBlock::exec: MKL backend not available!");
42#endif
43 break;
44
46 XABORTM("LAFEM::Arch::MinMaxValueBlock::exec: CUDA backend not available!");
47 break;
48
49 default:
50 XABORTM("LAFEM::Arch::MinMaxValueBlock::exec: unknown backend!");
51 break;
52 }
53 }
54 }; // struct MinMaxValueBlock
55} // namespace FEAT::LAFEM::Arch
56
57#ifndef __CUDACC__
58#define KERNEL_LAFEM_ARCH_MIN_MAX_VALUE_BLOCK_HPP 1
59#include <kernel/lafem/arch/min_max_value_block_generic.hpp>
60#endif
#define XABORTM(msg)
Abortion macro definition with custom message.
Definition: assertion.hpp:192
FEAT Kernel base header.
static PreferredBackend get_preferred_backend()
get current preferred backend
Definition: backend.cpp:32
static void warn_missing(const char *operation, PreferredBackend preferred_backend, PreferredBackend fallback_backend=PreferredBackend::generic)
issues a warning about unsupported backend usage
Definition: backend.cpp:77
Memory arbiter class.
Typed memory view class.
const T_ * get_r() const
Returns a const typed pointer to the array that grants read access.
@ read
read-only access
std::uint64_t Index
Index data type.