alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
Functional.hpp
Go to the documentation of this file.
1/* Copyright 2022 Benjamin Worpitz, Bernhard Manfred Gruber
2 * SPDX-License-Identifier: MPL-2.0
3 */
4
5#pragma once
6
8
9namespace alpaka::meta
10{
11 template<typename T>
12 struct min
13 {
15 ALPAKA_FN_HOST_ACC constexpr auto operator()(T const& lhs, T const& rhs) const
16 {
17 return (lhs < rhs) ? lhs : rhs;
18 }
19 };
20
21 template<typename T>
22 struct max
23 {
25 ALPAKA_FN_HOST_ACC constexpr auto operator()(T const& lhs, T const& rhs) const
26 {
27 return (lhs > rhs) ? lhs : rhs;
28 }
29 };
30} // namespace alpaka::meta
#define ALPAKA_FN_HOST_ACC
Definition Common.hpp:39
#define ALPAKA_NO_HOST_ACC_WARNING
Disable nvcc warning: 'calling a host function from host device function.' Usage: ALPAKA_NO_HOST_ACC_...
Definition Common.hpp:82
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC constexpr auto operator()(T const &lhs, T const &rhs) const
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC constexpr auto operator()(T const &lhs, T const &rhs) const