FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
scale_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 void exec_generic_impl(ValueType_ * r, const ValueType_ * const x, const ValueType_ alpha, const Index size);
19
20 template<typename ValueType_>
21 static void exec_generic(Memory::Arbiter& r, const Memory::Arbiter& x, const ValueType_ alpha, const Index size)
22 {
25 exec_generic_impl(r_view.get_w(), x_view.get_r(), alpha, size);
26 }
27
28 template<typename ValueType_>
29 static void exec(Memory::Arbiter& r, const Memory::Arbiter& x, const ValueType_ alpha, const Index size)
30 {
32 {
34 exec_generic<ValueType_>(r, x, alpha, size);
35 break;
36
38#ifdef FEAT_HAVE_MKL
39 Backend::warn_missing("LAFEM::Arch::AxpyBlock::exec");
40 exec_generic<ValueType_>(r, x, alpha, size);
41#else
42 XABORTM("LAFEM::Arch::ScaleBlock::exec: MKL backend not available!");
43#endif
44 break;
45
47 XABORTM("LAFEM::Arch::ScaleBlock::exec: CUDA backend not available!");
48 break;
49
50 default:
51 XABORTM("LAFEM::Arch::ScaleBlock::exec: unknown backend!");
52 break;
53 }
54 }
55 };
56} // namespace FEAT::LAFEM::Arch
57
58#ifndef __CUDACC__
59#define KERNEL_LAFEM_ARCH_SCALE_BLOCK_HPP 1
60#include <kernel/lafem/arch/scale_block_generic.hpp>
61#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.
T_ * get_w()
Returns a typed pointer to the array that grants write (and read) access.
@ overlap
explicitly allow overlapping writes (see Overlapping Memory Views)
@ read
read-only access
@ write
write-only access (see attention note above)
std::uint64_t Index
Index data type.