![]() |
alpaka
Abstraction Library for Parallel Kernel Acceleration
|
alpaka'S function interface More...
Namespaces | |
| namespace | api |
| namespace | concepts |
Classes | |
| struct | Fn |
| Base class for function symbols. More... | |
Enumerations | |
| enum class | Fallback : int { toGeneric = 1 , toAlpaka = 2 , none = 3 } |
| Fallback policy for function calls. More... | |
| enum class | Registration : int { alwaysTrue = 1 , enforced = 2 , none = 3 } |
| Policy to control if a function symbol must be registered. More... | |
alpaka'S function interface
This file defines the interface for registering, dispatching and calling function overloads specialize for device specifications. A device specification consists of an alpaka API and device kind. These functions can be dispatched to third-party libraries (e.g. cuBLAS) and can be used in alpaka onHost or onAcc. The function interface of alpaka provides a way to work natively with alpaka objects while being able to use third party interfaces for functionality not provided in alpaka or in cases where the vendor implementation provides better performance. For each exposed function you can provide a fallback to an alpaka implementation for a device specification or a device specification independent generic implementation. This keeps your code base portable even if you can not dispatch to a third party/vendor library and avoids preprocessor macros around function calls. The preprocessor macro ALPAKA_FN_SYMBOL() should be used to declare a function symbol. A function symbol follows all requirements to be used as kernel within alpaka.
The main components of the interface are:
For an example of how to use the interface see example/vendorApi.
|
strong |
Fallback policy for function calls.
This enum defines the fallback policy for function calls. It is used as a template parameter in alpaka::fn::Fn or ALPAKA_FN_SYMBOL to specify the fallback behavior if no vendor function overload is defined for the given device specification.
|
strong |
Policy to control if a function symbol must be registered.