alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
Unreachable.hpp
Go to the documentation of this file.
1
/* Copyright 2025 Jan Stephan, Jeffrey Kelling, Andrea Bocci
2
* SPDX-License-Identifier: MPL-2.0
3
*/
4
5
#pragma once
6
7
#include "
alpaka/core/Config.hpp
"
8
9
//! Before CUDA 11.5 nvcc is unable to correctly identify return statements in 'if constexpr' branches. It will issue
10
//! a false warning about a missing return statement unless it is told that the following code section is unreachable.
11
//!
12
//! \param x A dummy value for the expected return type of the calling function.
13
#if(ALPAKA_COMP_NVCC && ALPAKA_ARCH_PTX)
14
# define ALPAKA_UNREACHABLE(...) __builtin_unreachable()
15
#elif ALPAKA_COMP_MSVC
16
# define ALPAKA_UNREACHABLE(...) __assume(false)
17
#elif ALPAKA_COMP_GNUC || ALPAKA_COMP_CLANG
18
# define ALPAKA_UNREACHABLE(...) __builtin_unreachable()
19
#else
20
# define ALPAKA_UNREACHABLE(...)
21
#endif
Config.hpp
include
alpaka
core
Unreachable.hpp
Generated on Thu Jun 26 2025 08:02:45 for alpaka by
1.9.8