alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
Unroll.hpp
Go to the documentation of this file.
1
/* Copyright 2021 Benjamin Worpitz, Bernhard Manfred Gruber
2
* SPDX-License-Identifier: MPL-2.0
3
*/
4
5
#pragma once
6
7
#include "
alpaka/core/Config.hpp
"
8
9
//! Suggests unrolling of the directly following loop to the compiler.
10
//!
11
//! Usage:
12
//! `ALPAKA_UNROLL
13
//! for(...){...}`
14
// \TODO: Implement for other compilers.
15
#if ALPAKA_ARCH_PTX
16
# define ALPAKA_UNROLL_STRINGIFY(x) #x
17
# define ALPAKA_UNROLL(...) _Pragma(ALPAKA_UNROLL_STRINGIFY(unroll __VA_ARGS__))
18
#elif ALPAKA_COMP_IBM
19
# define ALPAKA_UNROLL_STRINGIFY(x) #x
20
# define ALPAKA_UNROLL(...) _Pragma(ALPAKA_UNROLL_STRINGIFY(unroll(__VA_ARGS__)))
21
#elif ALPAKA_COMP_PGI
22
# define ALPAKA_UNROLL(...) _Pragma("unroll")
23
#else
24
# define ALPAKA_UNROLL(...)
25
#endif
Config.hpp
include
alpaka
core
Unroll.hpp
Generated on Thu Jun 26 2025 08:02:45 for alpaka by
1.9.8