alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
fn.hpp File Reference
#include "alpaka/api/concepts/api.hpp"
#include "alpaka/concepts.hpp"
#include "alpaka/core/common.hpp"
#include "alpaka/tag.hpp"
#include <type_traits>

Go to the source code of this file.

Classes

struct  alpaka::fn::api::Alpaka
 Api tag for alpaka. More...
struct  alpaka::fn::Fn< T_FnClass, T_fallbackPolicy, T_registrationPolicy >
 Base class for function symbols. More...

Namespaces

namespace  alpaka
 main alpaka namespace.
namespace  alpaka::fn
 alpaka'S function interface
namespace  alpaka::fn::api
namespace  alpaka::fn::concepts

Concepts

concept  alpaka::fn::concepts::DispatchedFnInvocable
 Concept to check if a function symbol can be called.
concept  alpaka::fn::concepts::FnRegistered
 Concept to check if a function symbol is registered.

Macros

#define ALPAKA_FN_SYMBOL(fnName, ...)
 Define a function symbol class for alpaka's function interface.

Enumerations

enum class  alpaka::fn::Fallback : int {
  alpaka::fn::toGeneric = 1 ,
  alpaka::fn::toAlpaka = 2 ,
  alpaka::fn::none = 3
}
 Fallback policy for function calls. More...
enum class  alpaka::fn::Registration : int {
  alpaka::fn::alwaysTrue = 1 ,
  alpaka::fn::enforced = 2 ,
  alpaka::fn::none = 3
}
 Policy to control if a function symbol must be registered. More...

Variables

constexpr auto alpaka::fn::api::alpaka = Alpaka{}

Macro Definition Documentation

◆ ALPAKA_FN_SYMBOL

#define ALPAKA_FN_SYMBOL ( fnName,
... )
Value:
struct fnName : alpaka::fn::Fn<fnName __VA_OPT__(, __VA_ARGS__)> \
{ \
/** Function specification for a given device specification. \
* \
* This struct should be specialized for each device specification combination where a vendor \
* function overload is defined. The specialization should be empty and only used as a tag to \
* identify the function overload. \
*/ \
template<alpaka::concepts::Api T_Api, alpaka::concepts::DeviceKind T_DeviceKind> \
struct Spec \
{ \
}; \
}; \
static_assert(true)
Base class for function symbols.
Definition fn.hpp:155

Define a function symbol class for alpaka's function interface.

Parameters
fnNameName of the function symbol. This can be used to call the function overloads with the static call() function without having to create an instance or with the operator().
optional_fallbackThe fallback policy if no vendor function overload is defined for the given device specification. If set to Fallback::toAlpaka the generic alpaka implementation is called if no other overload is fitting. If set to Fallback::toGeneric the overload with the function symbol as first argument is called if no other function device specification is callable. If set to Fallback::none no fallback is performed and a static assert is triggered if no vendor function overload is defined for the given device specification. Default: Fallback::toGeneric.
optional_registartionIf set to Registration::enforced the isRegistered() can be called, and it is required to define alpakaFnRegister() for on T_FnClass. If set to Registration::none the isRegistered() function is not available and no registration of the vendor function overloads is required. If set to Registration::alwaysTrue isRegistered() will always return true. This can be used to skip the registration of the function symbol. Default: Registration::none.
ALPAKA_FN_SYMBOL(TransformWithFallbackAndRegistration, alpaka::fn::Fallback::toGeneric,
#define ALPAKA_FN_SYMBOL(fnName,...)
Define a function symbol class for alpaka's function interface.
Definition fn.hpp:319
@ toAlpaka
The alpaka implementation is called if no other overload fits.
Definition fn.hpp:86
@ toGeneric
The generic implementation is called if no other overload fits.
Definition fn.hpp:81
@ enforced
It is required to define alpakaFnRegister() for a function symbol.
Definition fn.hpp:105

Definition at line 319 of file fn.hpp.