MUDA
Loading...
Searching...
No Matches
muda_def.h
1#pragma once
2#include <muda/muda_config.h>
3#include <muda/tools/platform.h>
4#include <cuda.h>
5#include <cuda_runtime.h>
6#include <cuda_runtime_api.h>
7
8#define MUDA_HOST __host__
9#define MUDA_DEVICE __device__
10#define MUDA_GLOBAL __global__
11#define MUDA_CONSTANT __constant__
12#define MUDA_SHARED __shared__
13#define MUDA_MANAGED __managed__
14
15#ifdef __CUDA_ARCH__
16#define MUDA_GENERIC MUDA_HOST MUDA_DEVICE
17#else
18#define MUDA_GENERIC
19#endif
20
21// Attributes
22#define MUDA_NODISCARD [[nodiscard]]
23#define MUDA_DEPRECATED [[deprecated]]
24#define MUDA_FALLTHROUGH [[fallthrough]]
25#define MUDA_MAYBE_UNUSED [[maybe_unused]]
26#define MUDA_NORETURN [[noreturn]]
27
28// Keywords
29#define MUDA_NOEXCEPT noexcept
30#define MUDA_INLINE inline
31#define MUDA_CONSTEXPR constexpr
32
33// Concepts
34#if MUDA_HAS_CXX20
35#define MUDA_REQUIRES(...) requires (__VA_ARGS__)
36#else
37#define MUDA_REQUIRES(...)
38#endif