-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathmuda_def.h
More file actions
38 lines (33 loc) · 873 Bytes
/
muda_def.h
File metadata and controls
38 lines (33 loc) · 873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#pragma once
#include <muda/muda_config.h>
#include <muda/tools/platform.h>
#include <cuda.h>
#include <cuda_runtime.h>
#include <cuda_runtime_api.h>
#define MUDA_HOST __host__
#define MUDA_DEVICE __device__
#define MUDA_GLOBAL __global__
#define MUDA_CONSTANT __constant__
#define MUDA_SHARED __shared__
#define MUDA_MANAGED __managed__
#ifdef __CUDA_ARCH__
#define MUDA_GENERIC MUDA_HOST MUDA_DEVICE
#else
#define MUDA_GENERIC
#endif
// Attributes
#define MUDA_NODISCARD [[nodiscard]]
#define MUDA_DEPRECATED [[deprecated]]
#define MUDA_FALLTHROUGH [[fallthrough]]
#define MUDA_MAYBE_UNUSED [[maybe_unused]]
#define MUDA_NORETURN [[noreturn]]
// Keywords
#define MUDA_NOEXCEPT noexcept
#define MUDA_INLINE inline
#define MUDA_CONSTEXPR constexpr
// Concepts
#if MUDA_HAS_CXX20
#define MUDA_REQUIRES(...) requires (__VA_ARGS__)
#else
#define MUDA_REQUIRES(...)
#endif