alpaka
Abstraction Library for Parallel Kernel Acceleration
|
Go to the source code of this file.
Macros | |
#define | ALPAKA_DEVICE_VOLATILE |
This macro disables memory optimizations for annotated device memory. More... | |
#define | ALPAKA_FN_EXTERN |
All functions marked with ALPAKA_FN_ACC or ALPAKA_FN_HOST_ACC that are exported to / imported from different translation units have to be attributed with ALPAKA_FN_EXTERN. Note that this needs to be applied to both the declaration and the definition. More... | |
#define | ALPAKA_FN_INLINE [[gnu::always_inline]] inline |
Macro defining the inline function attribute. More... | |
#define | ALPAKA_NO_HOST_ACC_WARNING |
Disable nvcc warning: 'calling a host function from host device function.' Usage: ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC function_declaration() WARNING: Only use this method if there is no other way. Most cases can be solved by #if BOOST_ARCH_PTX or #if BOOST_LANG_CUDA. More... | |
#define | ALPAKA_STATIC_ACC_MEM_CONSTANT |
This macro defines a variable lying in constant accelerator device memory. More... | |
#define | ALPAKA_STATIC_ACC_MEM_GLOBAL |
This macro defines a variable lying in global accelerator device memory. More... | |
#define | ALPAKA_FN_ACC |
All functions that can be used on an accelerator have to be attributed with ALPAKA_FN_ACC or ALPAKA_FN_HOST_ACC. More... | |
#define | ALPAKA_FN_HOST |
#define | ALPAKA_FN_HOST_ACC |
#define ALPAKA_DEVICE_VOLATILE |
This macro disables memory optimizations for annotated device memory.
Example: ALPAKA_DEVICE_VOLATILE float* ptr;
This is useful for pointers, (shared) variables and shared memory which are used in combination with the alpaka::mem_fence() function. It ensures that memory annotated with this macro will always be written directly to memory (and not to a register or cache because of compiler optimizations).
Definition at line 220 of file Common.hpp.
#define ALPAKA_FN_ACC |
All functions that can be used on an accelerator have to be attributed with ALPAKA_FN_ACC or ALPAKA_FN_HOST_ACC.
Definition at line 38 of file Common.hpp.
#define ALPAKA_FN_EXTERN |
All functions marked with ALPAKA_FN_ACC or ALPAKA_FN_HOST_ACC that are exported to / imported from different translation units have to be attributed with ALPAKA_FN_EXTERN. Note that this needs to be applied to both the declaration and the definition.
Usage: ALPAKA_FN_ACC ALPAKA_FN_EXTERN auto add(std::int32_t a, std::int32_t b) -> std::int32_t;
Warning: If this is used together with the SYCL back-end make sure that your SYCL runtime supports generic address spaces. Otherwise it is forbidden to use pointers as parameter or return type for functions marked with ALPAKA_FN_EXTERN.
Definition at line 65 of file Common.hpp.
#define ALPAKA_FN_HOST |
Definition at line 40 of file Common.hpp.
#define ALPAKA_FN_HOST_ACC |
Definition at line 39 of file Common.hpp.
#define ALPAKA_FN_INLINE [[gnu::always_inline]] inline |
Macro defining the inline function attribute.
The macro should stay on the left hand side of keywords, e.g. 'static', 'constexpr', 'explicit' or the return type.
Definition at line 95 of file Common.hpp.
#define ALPAKA_NO_HOST_ACC_WARNING |
Disable nvcc warning: 'calling a host function from host device function.' Usage: ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC function_declaration() WARNING: Only use this method if there is no other way. Most cases can be solved by #if BOOST_ARCH_PTX or #if BOOST_LANG_CUDA.
Definition at line 82 of file Common.hpp.
#define ALPAKA_STATIC_ACC_MEM_CONSTANT |
This macro defines a variable lying in constant accelerator device memory.
Example: ALPAKA_STATIC_ACC_MEM_CONSTANT alpaka::DevGlobal<TAcc, const int> variable;
Those variables behave like ordinary variables when used in file-scope, but inside kernels the get() method must be used to access the variable. They are declared inline to resolve to a single instance across multiple translation units. Like ordinary variables, only one definition is allowed (ODR) Failure to do so might lead to linker errors.
In contrast to ordinary variables, you can not define such variables as static compilation unit local variables with internal linkage because this is forbidden by CUDA.
Definition at line 203 of file Common.hpp.
#define ALPAKA_STATIC_ACC_MEM_GLOBAL |
This macro defines a variable lying in global accelerator device memory.
Example: ALPAKA_STATIC_ACC_MEM_GLOBAL alpaka::DevGlobal<TAcc, int> variable;
Those variables behave like ordinary variables when used in file-scope, but inside kernels the get() method must be used to access the variable. They are declared inline to resolve to a single instance across multiple translation units. Like ordinary variables, only one definition is allowed (ODR) Failure to do so might lead to linker errors.
In contrast to ordinary variables, you can not define such variables as static compilation unit local variables with internal linkage because this is forbidden by CUDA.
Definition at line 148 of file Common.hpp.