stdgpu/cstddef.h Source File

stdgpu/cstddef.h Source File#

stdgpu: stdgpu/cstddef.h Source File
stdgpu Latest
Efficient STL-like Data Structures on the GPU
cstddef.h
Go to the documentation of this file.
1/*
2 * Copyright 2019 Patrick Stotko
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16#ifndef STDGPU_CSTDDEF_H
17#define STDGPU_CSTDDEF_H
18
28#include <cinttypes>
29#include <cstddef>
30#include <cstdint>
31
32#include <stdgpu/compiler.h>
33#include <stdgpu/config.h>
34
35namespace stdgpu
36{
37
42using index32_t = std::int_least32_t;
43
48using index64_t = std::ptrdiff_t;
49
55#if STDGPU_USE_32_BIT_INDEX
56using index_t = index32_t;
57#else
59#endif
60
65#define STDGPU_PRIINDEX32 PRIdLEAST32
66
71#define STDGPU_PRIINDEX64 "td"
72
78#if STDGPU_USE_32_BIT_INDEX
79 #define STDGPU_PRIINDEX STDGPU_PRIINDEX32
80#else
81 #define STDGPU_PRIINDEX STDGPU_PRIINDEX64
82#endif
83
89#if STDGPU_HOST_COMPILER == STDGPU_HOST_COMPILER_GCC || STDGPU_HOST_COMPILER == STDGPU_HOST_COMPILER_CLANG
90 #define STDGPU_FUNC __PRETTY_FUNCTION__
91#elif STDGPU_HOST_COMPILER == STDGPU_HOST_COMPILER_MSVC
92 #define STDGPU_FUNC __FUNCSIG__
93#else
94 #define STDGPU_FUNC __func__
95#endif
96
97} // namespace stdgpu
98
99#endif // STDGPU_CSTDDEF_H
std::ptrdiff_t index64_t
std::ptrdiff_t
Definition: cstddef.h:48
std::int_least32_t index32_t
std::int_least32_t
Definition: cstddef.h:42
index64_t index_t
index32_t if STDGPU_USE_32_BIT_INDEX is set, index64_t otherwise
Definition: cstddef.h:58