alpaka
Abstraction Library for Parallel Kernel Acceleration
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/BoostPredef.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 BOOST_ARCH_PTX
16
# define ALPAKA_UNROLL_STRINGIFY(x) #x
17
# define ALPAKA_UNROLL(...) _Pragma(ALPAKA_UNROLL_STRINGIFY(unroll __VA_ARGS__))
18
#elif BOOST_COMP_IBM || BOOST_COMP_SUNPRO || BOOST_COMP_HPACC
19
# define ALPAKA_UNROLL_STRINGIFY(x) #x
20
# define ALPAKA_UNROLL(...) _Pragma(ALPAKA_UNROLL_STRINGIFY(unroll(__VA_ARGS__)))
21
#elif BOOST_COMP_PGI
22
# define ALPAKA_UNROLL(...) _Pragma("unroll"
)
23
#else
24
# define ALPAKA_UNROLL(...)
25
#endif
BoostPredef.hpp
include
alpaka
core
Unroll.hpp
Generated on Thu Nov 21 2024 22:46:14 for alpaka by
1.9.1