DriveWorks SDK Reference

| 0.6.67 Release

Types.h
Go to the documentation of this file.
1 // This code contains NVIDIA Confidential Information and is disclosed
3 // under the Mutual Non-Disclosure Agreement.
4 //
5 // Notice
6 // ALL NVIDIA DESIGN SPECIFICATIONS AND CODE ("MATERIALS") ARE PROVIDED "AS IS" NVIDIA MAKES
7 // NO REPRESENTATIONS, WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
8 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTIES OF NONINFRINGEMENT,
9 // MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
10 //
11 // NVIDIA Corporation assumes no responsibility for the consequences of use of such
12 // information or for any infringement of patents or other rights of third parties that may
13 // result from its use. No license is granted by implication or otherwise under any patent
14 // or patent rights of NVIDIA Corporation. No third party distribution is allowed unless
15 // expressly authorized by NVIDIA. Details are subject to change without notice.
16 // This code supersedes and replaces all information previously supplied.
17 // NVIDIA Corporation products are not authorized for use as critical
18 // components in life support devices or systems without express written approval of
19 // NVIDIA Corporation.
20 //
21 // Copyright (c) 2016 NVIDIA Corporation. All rights reserved.
22 //
23 // NVIDIA Corporation and its licensors retain all intellectual property and proprietary
24 // rights in and to this software and related documentation and any modifications thereto.
25 // Any use, reproduction, disclosure or distribution of this software and related
26 // documentation without an express license agreement from NVIDIA Corporation is
27 // strictly prohibited.
28 //
30 
46 #ifndef DW_CORE_TYPES_H__
47 #define DW_CORE_TYPES_H__
48 
49 #include <dw/core/Exports.h>
50 #include <dw/core/Config.h>
51 #include <dw/core/DynamicMemory.h>
52 
53 #include <host_defines.h>
54 
56 // CUDA float16_t
57 // Disable strict aliasing warnings
58 #ifdef __GNUC__
59  #pragma GCC diagnostic push
60  #pragma GCC diagnostic ignored "-Wstrict-aliasing"
61 #endif
62 #include <cuda_fp16.h>
63 #ifdef __GNUC__
64  #pragma GCC diagnostic pop
65 #endif
66 
67 #include <stdint.h>
68 #include <stddef.h>
69 
70 #ifdef __cplusplus
71 extern "C" {
72 #endif
73 
77 typedef float float32_t;
78 typedef double float64_t;
79 typedef uint8_t dwBool;
80 
81 #if defined(__cplusplus)
82 typedef __half float16_t;
83 #else
84 typedef __half_raw float16_t;
85 #endif
86 
89 typedef uint64_t dwTime_t;
90 
93 static const dwTime_t DW_TIMEOUT_INFINITE = UINT64_MAX;
94 
95 #define DW_NULL_HANDLE NULL
96 #define DW_NO_CALLBACK NULL
97 
98 #define DW_TRUE 1u
99 #define DW_FALSE 0u
100 
104 typedef enum dwTrivialDataType {
105 
106  /* The type of the data is unknown. */
108 
109  /* The underlying data type is bool. */
110  DW_TYPE_BOOL = 1 << 1,
111 
112  /* 8-bit signed integer. */
113  DW_TYPE_INT8 = 1 << 2,
114  /* 16-bit signed integer. */
115  DW_TYPE_INT16 = 1 << 3,
116  /* 32-bit signed integer. */
117  DW_TYPE_INT32 = 1 << 4,
118  /* 64-bit signed integer. */
119  DW_TYPE_INT64 = 1 << 5,
120 
121  /* 8-bit unsigned integer. */
122  DW_TYPE_UINT8 = 1 << 6,
123  /* 16-bit unsigned integer. */
124  DW_TYPE_UINT16 = 1 << 7,
125  /* 32-bit unsigned integer. */
126  DW_TYPE_UINT32 = 1 << 8,
127  /* 64-bit unsigned integer. */
128  DW_TYPE_UINT64 = 1 << 9,
129 
130  /* 32-bit float number. */
131  DW_TYPE_FLOAT32 = 1 << 10,
132  /* 64-bit float number, i.e., double. */
133  DW_TYPE_FLOAT64 = 1 << 11,
134  /* 16-bit float number. */
135  DW_TYPE_FLOAT16 = 1 << 12
136 
138 
139 
141 
144 typedef enum dwGPUDeviceType
145 {
149 
151 typedef struct dwRect {
153  int32_t x;
155  int32_t y;
157  int32_t width;
159  int32_t height;
160 } dwRect;
161 
162 typedef struct dwRectf {
164  float32_t x;
166  float32_t y;
168  float32_t width;
170  float32_t height;
171 } dwRectf;
172 
173 typedef dwRect dwBox2D;
175 
176 
180 typedef struct dwMatrix3f {
181  float32_t array[3*3];
182 } dwMatrix3f;
183 
187 typedef struct dwMatrix3d {
188  float64_t array[3*3];
189 } dwMatrix3d;
190 
191 
195 typedef struct dwMatrix34f {
196  float32_t array[3*4];
197 } dwMatrix34f;
198 
202 typedef struct dwMatrix4f {
203  float32_t array[4*4];
204 } dwMatrix4f;
205 
207 typedef struct dwVector2f {
208  float32_t x;
209  float32_t y;
210 } dwVector2f;
211 
213 typedef struct dwVector2i {
214  int32_t x;
215  int32_t y;
216 } dwVector2i;
217 
219 typedef struct dwVector2ui {
220  uint32_t x;
221  uint32_t y;
222 } dwVector2ui;
223 
225 typedef struct dwVector3f {
226  float32_t x;
227  float32_t y;
228  float32_t z;
229 } dwVector3f;
230 
232 typedef struct dwVector3d {
233  float64_t x;
234  float64_t y;
235  float64_t z;
236 } dwVector3d;
237 
238 typedef struct dwVector4f {
239  float32_t x;
240  float32_t y;
241  float32_t z;
242  float32_t w;
243 } dwVector4f;
244 
246 typedef struct dwVector3ui {
247  uint32_t x;
248  uint32_t y;
249  uint32_t z;
250 } dwVector3ui;
251 
253 typedef struct dwLine3f {
256 } dwLine3f;
257 
259 typedef struct dwPolyline3f
260 {
262  uint32_t pointCount;
263 } dwPolyline3f;
264 
271 typedef struct dwMatrix4f dwTransformation;
272 
278 typedef struct dwMatrix3f dwTransformation2D;
279 
280 #ifdef __cplusplus
281 }
282 #endif
283 
284 #endif // DW_CORE_TYPES_H__
Defines a 3x4 matrix of floating point numbers (column major).
Definition: Types.h:195
uint32_t z
Definition: Types.h:249
float float32_t
Specifies POD types.
Definition: Types.h:77
Defines a polyline.
Definition: Types.h:259
uint32_t y
Definition: Types.h:248
dwTrivialDataType
Specifies a type indicator of the underlying trivial data type.
Definition: Types.h:104
Defines a rectangle.
Definition: Types.h:151
float32_t x
Definition: Types.h:226
Defines a three-element double-precision floating point vector.
Definition: Types.h:232
Defines a three-element floating-point vector.
Definition: Types.h:225
Defines a two-element floating-point vector.
Definition: Types.h:207
Defines a two-element integer vector.
Definition: Types.h:213
dwGPUDeviceType
GPU device type defintions.
Definition: Types.h:144
float32_t y
Definition: Types.h:240
uint64_t dwTime_t
Specifies a timestamp unit, in microseconds.
Definition: Types.h:89
float32_t width
Rectangle width.
Definition: Types.h:168
int32_t x
x coordinate.
Definition: Types.h:153
Definition: Types.h:162
float32_t w
Definition: Types.h:242
float32_t x
Specifies the x coordinate.
Definition: Types.h:164
NVIDIA DriveWorks API: Core Exports
double float64_t
Definition: Types.h:78
uint32_t x
Definition: Types.h:220
uint32_t pointCount
number of points.
Definition: Types.h:262
float32_t height
Rectangle height.
Definition: Types.h:170
int32_t width
Rectangle width.
Definition: Types.h:157
float32_t y
Definition: Types.h:209
int32_t x
Definition: Types.h:214
static const dwTime_t DW_TIMEOUT_INFINITE
Special value of timestamp which means infinitely long duration.
Definition: Types.h:93
float64_t x
Definition: Types.h:233
float64_t y
Definition: Types.h:234
Defines a 3x3 matrix of double floating point numbers.
Definition: Types.h:187
Defines a 3x3 matrix of floating point numbers.
Definition: Types.h:180
Defines a 4x4 matrix of floating point numbers (column major).
Definition: Types.h:202
Defines a line segment.
Definition: Types.h:253
Defines a three-element unsigned-integer vector.
Definition: Types.h:246
Defines a two-element unsigned-integer vector.
Definition: Types.h:219
dwRectf dwBox2Df
Definition: Types.h:174
uint8_t dwBool
Definition: Types.h:79
float32_t y
Specifies the y coordinate.
Definition: Types.h:166
__half_raw float16_t
Definition: Types.h:84
float32_t x
Definition: Types.h:239
DW_API_PUBLIC size_t dwSizeOf(dwTrivialDataType type)
uint32_t x
Definition: Types.h:247
dwRect dwBox2D
Definition: Types.h:173
float32_t y
Definition: Types.h:227
float32_t z
Definition: Types.h:241
NVIDIA DriveWorks API: Core Warp Primitives
uint32_t y
Definition: Types.h:221
float64_t z
Definition: Types.h:235
int32_t y
y coordinate.
Definition: Types.h:155
#define DW_API_PUBLIC
Definition: Exports.h:76
float32_t z
Definition: Types.h:228
int32_t y
Definition: Types.h:215
const dwVector3f * points
pointer to the first element in the container.
Definition: Types.h:261
float32_t x
Definition: Types.h:208
int32_t height
Rectangle height.
Definition: Types.h:159