DriveWorks SDK Reference
3.0.4260 Release
For Test and Development only

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-2020 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 
48 #ifndef DW_CORE_TYPES_H_
49 #define DW_CORE_TYPES_H_
50 
51 #include <dw/core/Exports.h>
52 #include <dw/core/Status.h>
53 
54 #include <cuda_runtime_api.h>
55 #include <stdalign.h>
56 
57 #include <cuda_fp16.h>
58 
59 #include <stdint.h>
60 #include <stddef.h>
61 #include <stdbool.h>
62 
63 #ifdef __cplusplus
64 extern "C" {
65 #endif
66 
70 typedef float float32_t;
71 typedef double float64_t;
72 typedef char char8_t;
73 
74 #if defined(__cplusplus)
75 typedef __half float16_t;
76 #else
77 typedef __half_raw float16_t;
78 #endif
79 
82 typedef int64_t dwTime_t;
83 
86 static const dwTime_t DW_TIMEOUT_INFINITE = 0x0123456789ABCDEF;
87 
90 static const dwTime_t DW_TIME_INVALID = INT64_MIN;
91 
92 #if defined(__cplusplus)
93 #define DW_NULL_HANDLE nullptr
94 #define DW_NO_CALLBACK nullptr
95 #else
96 #define DW_NULL_HANDLE NULL
97 #define DW_NO_CALLBACK NULL
98 #endif
99 
103 typedef enum dwTrivialDataType {
104 
105  /* The type of the data is unknown. */
107 
108  /* The underlying data type is bool. */
109  DW_TYPE_BOOL = 1 << 1,
110 
111  /* 8-bit signed integer. */
112  DW_TYPE_INT8 = 1 << 2,
113  /* 16-bit signed integer. */
114  DW_TYPE_INT16 = 1 << 3,
115  /* 32-bit signed integer. */
116  DW_TYPE_INT32 = 1 << 4,
117  /* 64-bit signed integer. */
118  DW_TYPE_INT64 = 1 << 5,
119 
120  /* 8-bit unsigned integer. */
121  DW_TYPE_UINT8 = 1 << 6,
122  /* 16-bit unsigned integer. */
123  DW_TYPE_UINT16 = 1 << 7,
124  /* 32-bit unsigned integer. */
125  DW_TYPE_UINT32 = 1 << 8,
126  /* 64-bit unsigned integer. */
127  DW_TYPE_UINT64 = 1 << 9,
128 
129  /* 32-bit float number. */
130  DW_TYPE_FLOAT32 = 1 << 10,
131  /* 64-bit float number, i.e., double. */
132  DW_TYPE_FLOAT64 = 1 << 11,
133  /* 16-bit float number. */
134  DW_TYPE_FLOAT16 = 1 << 12
135 
137 
139 
140 typedef enum dwPrecision {
149 } dwPrecision;
150 
153 typedef enum dwGPUDeviceType {
157 
159 typedef enum dwProcessorType {
169 
171 typedef enum dwProcessType {
174 } dwProcessType;
175 
177 typedef enum dwMemoryType {
180 
183 
186 } dwMemoryType;
187 
189 typedef struct dwRect
190 {
192  alignas(8) int32_t x;
194  int32_t y;
196  int32_t width;
198  int32_t height;
199 } dwRect;
200 
202 static const dwRect DW_INVALID_RECT = {.x = 0, .y = 0, .width = -1, .height = -1};
203 
204 typedef struct dwRectf
205 {
207  alignas(8) float32_t x;
209  float32_t y;
211  float32_t width;
213  float32_t height;
214 } dwRectf;
215 
217 static const dwRectf DW_INVALID_RECTF = {.x = 0.0f, .y = 0.0f, .width = -1.0f, .height = -1.0f};
218 
219 typedef dwRect dwBox2D;
221 
225 typedef struct dwMatrix2f
226 {
227  alignas(16) float32_t array[2 * 2];
228 } dwMatrix2f;
229 
231 static const dwMatrix2f DW_IDENTITY_MATRIX2F = {{1, 0,
232  0, 1}};
233 
237 typedef struct dwMatrix3f
238 {
239  float32_t array[3 * 3];
240 } dwMatrix3f;
241 
243 static const dwMatrix3f DW_IDENTITY_MATRIX3F = {{1, 0, 0,
244  0, 1, 0,
245  0, 0, 1}};
246 
250 typedef struct dwMatrix3d
251 {
252  float64_t array[3 * 3];
253 } dwMatrix3d;
254 
256 static const dwMatrix3d DW_IDENTITY_MATRIX3D = {{1, 0, 0,
257  0, 1, 0,
258  0, 0, 1}};
259 
263 typedef struct dwMatrix34f
264 {
265  alignas(16) float32_t array[3 * 4];
266 } dwMatrix34f;
267 
271 typedef struct dwMatrix4f
272 {
273  alignas(16) float32_t array[4 * 4];
274 } dwMatrix4f;
275 
277 static const dwMatrix4f DW_IDENTITY_MATRIX4F = {{1, 0, 0, 0,
278  0, 1, 0, 0,
279  0, 0, 1, 0,
280  0, 0, 0, 1}};
281 
285 typedef struct dwMatrix6f
286 {
287  float32_t array[6 * 6];
288 } dwMatrix6f;
289 
291 typedef struct dwVector2f
292 {
293  alignas(8) float32_t x;
294  float32_t y;
295 } dwVector2f;
296 
298 typedef struct dwVector2d
299 {
300  alignas(16) float64_t x;
301  float64_t y;
302 } dwVector2d;
303 
305 typedef struct dwVector2i
306 {
307  alignas(8) int32_t x;
308  int32_t y;
309 } dwVector2i;
310 
312 typedef struct dwVector2ui
313 {
314  alignas(8) uint32_t x;
315  uint32_t y;
316 } dwVector2ui;
317 
319 typedef struct dwVector3f
320 {
321  float32_t x;
322  float32_t y;
323  float32_t z;
324 } dwVector3f;
325 
327 typedef struct dwVector3d
328 {
329  float64_t x;
330  float64_t y;
331  float64_t z;
332 } dwVector3d;
333 
335 typedef struct dwVector4f
336 {
337  alignas(16) float32_t x;
338  float32_t y;
339  float32_t z;
340  float32_t w;
341 } dwVector4f;
342 
344 typedef struct dwVector4d
345 {
346  alignas(16) float64_t x;
347  float64_t y;
348  float64_t z;
349  float64_t w;
350 } dwVector4d;
351 
353 typedef struct dwVector3ui
354 {
355  uint32_t x;
356  uint32_t y;
357  uint32_t z;
358 } dwVector3ui;
359 
361 typedef struct dwBbox3Df
362 {
365 } dwBbox3Df;
366 
368 typedef struct dwBbox2Df
369 {
370  // AABB bounding box 2D
373 } dwBbox2Df;
374 
376 typedef struct dwLine3f
377 {
380 } dwLine3f;
381 
383 typedef struct dwLine3d
384 {
387 } dwLine3d;
388 
390 typedef struct dwPolyline2f
391 {
393  uint32_t pointCount;
394 } dwPolyline2f;
395 
397 typedef struct dwPolyline2d
398 {
400  uint32_t pointCount;
401 } dwPolyline2d;
402 
404 typedef struct dwPolyline3f
405 {
407  uint32_t pointCount;
408 } dwPolyline3f;
409 
411 typedef struct dwPolyline3d
412 {
414  uint32_t pointCount;
415 } dwPolyline3d;
416 
418 typedef struct dwQuaternionf
419 {
420  alignas(16) float32_t x;
421  float32_t y;
422  float32_t z;
423  float32_t w;
424 } dwQuaternionf;
425 
427 static const dwQuaternionf DW_IDENTITY_QUATERNIONF = {0.f, 0.f, 0.f, 1.f};
428 
430 typedef struct dwQuaterniond
431 {
432  alignas(16) float64_t x;
433  float64_t y;
434  float64_t z;
435  float64_t w;
436 } dwQuaterniond;
437 
439 static const dwQuaterniond DW_IDENTITY_QUATERNIOND = {0., 0., 0., 1.};
440 
446 typedef struct dwTransformation2f
447 {
448  float32_t array[3 * 3];
450 
452 static const dwTransformation2f DW_IDENTITY_TRANSFORMATION2F = {{1.f, 0.f, 0.f,
453  0.f, 1.f, 0.f,
454  0.f, 0.f, 1.f}};
455 
462 typedef struct dwTransformation3f
463 {
464  alignas(16) float32_t array[4 * 4];
466 
468 static const dwTransformation3f DW_IDENTITY_TRANSFORMATION3F = {{1.f, 0.f, 0.f, 0.f,
469  0.f, 1.f, 0.f, 0.f,
470  0.f, 0.f, 1.f, 0.f,
471  0.f, 0.f, 0.f, 1.f}};
472 
477 typedef enum dwSide {
481 } dwSide;
482 
487 {
495 
510 typedef struct dwConfidence1f
511 {
512  float32_t confidence;
513  float32_t threshold;
514  float32_t variance;
516 
517 typedef struct dwConfidence2f
518 {
519  float32_t confidence;
520  float32_t threshold;
523 
524 typedef struct dwConfidence3f
525 {
526  float32_t confidence;
527  float32_t threshold;
530 
537 typedef enum {
556 } dwBindSlot;
557 
558 #ifdef __cplusplus
559 }
560 #endif
561 
562 #endif // DW_CORE_TYPES_H_
float64_t w
Definition: Types.h:435
dwVector2f bb
Definition: Types.h:372
const dwVector2d * points
pointer to the first element in the container.
Definition: Types.h:399
Defines a 3x4 matrix of floating point numbers (column major).
Definition: Types.h:263
static const dwQuaterniond DW_IDENTITY_QUATERNIOND
Identity for dwQuaterniond.
Definition: Types.h:439
uint32_t z
Definition: Types.h:357
float float32_t
Specifies POD types.
Definition: Types.h:70
Defines a double-precision 3D polyline.
Definition: Types.h:411
Defines a single-precision 3D polyline.
Definition: Types.h:404
Defines a double-precision 2D polyline.
Definition: Types.h:397
Defines a single-precision 2D polyline.
Definition: Types.h:390
uint32_t y
Definition: Types.h:356
dwTrivialDataType
Specifies a type indicator of the underlying trivial data type.
Definition: Types.h:103
dwSide
A generic side enum definition to improve consistency of objects with a &#39;side&#39; concept Usage: define ...
Definition: Types.h:477
Defines a rectangle.
Definition: Types.h:189
float32_t y
Definition: Types.h:421
float32_t threshold
Inlier threshold.
Definition: Types.h:527
dwVector3f aa
Definition: Types.h:363
Defines a AABB bounding box 2D.
Definition: Types.h:368
float32_t x
Definition: Types.h:321
Defines a four-element double-precision floating point vector.
Definition: Types.h:344
Defines a four-element single-precision floating point vector.
Definition: Types.h:335
Defines a three-element double-precision floating point vector.
Definition: Types.h:327
Defines a three-element floating-point vector.
Definition: Types.h:319
Defines a two-element double-precision floating-point vector.
Definition: Types.h:298
Defines a two-element single-precision floating-point vector.
Definition: Types.h:291
Defines a two-element integer vector.
Definition: Types.h:305
dwGPUDeviceType
GPU device type definitions.
Definition: Types.h:153
Defines a AABB bounding box 3D.
Definition: Types.h:361
static const dwRectf DW_INVALID_RECTF
Invalid dwRect.
Definition: Types.h:217
Defines a double-precision quaternion.
Definition: Types.h:430
Defines a single-precision quaternion.
Definition: Types.h:418
uint32_t pointCount
number of points.
Definition: Types.h:400
dwPrecision
Definition: Types.h:140
FP32 precision.
Definition: Types.h:146
dwVector2f aa
Definition: Types.h:371
float32_t y
Definition: Types.h:338
dwMatrix2f covariance
2x2 covariance matrix
Definition: Types.h:521
float32_t width
Rectangle width.
Definition: Types.h:211
int32_t x
x coordinate.
Definition: Types.h:192
float32_t confidence
Inlier ratio [0,1].
Definition: Types.h:519
INT8 precision.
Definition: Types.h:142
float64_t w
Definition: Types.h:349
float64_t y
Definition: Types.h:347
Our strategy for uncertainty representation is to give classification confidence scalars for classifi...
Definition: Types.h:510
Definition: Types.h:204
float32_t threshold
Inlier threshold.
Definition: Types.h:520
float32_t w
Definition: Types.h:340
float32_t x
Specifies the x coordinate.
Definition: Types.h:207
CUDA memory.
Definition: Types.h:179
double float64_t
Definition: Types.h:71
dwVector3f halfAxisXYZ
Half of the width, height and depth of the box in the local frame.
Definition: Types.h:491
Data structure representing an oriented bounding box in the local object coordinate frame The box is ...
Definition: Types.h:486
Specifies a 3D rigid transformation.
Definition: Types.h:462
Specifies a 2D transformation as a 3 x 3 matrix in column-major order.
Definition: Types.h:446
float32_t threshold
Inlier threshold.
Definition: Types.h:513
uint32_t pointCount
number of points.
Definition: Types.h:407
dwMemoryType
Memory type definitions.
Definition: Types.h:177
float32_t height
Rectangle height.
Definition: Types.h:213
float32_t variance
Variance of inliers.
Definition: Types.h:514
int32_t width
Rectangle width.
Definition: Types.h:196
float32_t y
Definition: Types.h:294
float32_t confidence
Inlier ratio [0,1].
Definition: Types.h:526
dwProcessorType
Processor type definitions.
Definition: Types.h:159
float64_t y
Definition: Types.h:433
dwMatrix3f covariance
3x3 covariance matrix
Definition: Types.h:528
dwBindSlot
The slot enum used when an application wants a dw module to bind some particular input data to an int...
Definition: Types.h:537
int64_t dwTime_t
Specifies a timestamp unit, in microseconds.
Definition: Types.h:82
static const dwTime_t DW_TIMEOUT_INFINITE
Special value of timestamp which means infinitely long duration.
Definition: Types.h:86
float64_t x
Definition: Types.h:329
static const dwRect DW_INVALID_RECT
Invalid dwRect.
Definition: Types.h:202
pageable CPU memory
Definition: Types.h:182
static const dwMatrix3f DW_IDENTITY_MATRIX3F
Identity for dwMatrix3f.
Definition: Types.h:243
dwMatrix3f rotation
Rotation matrix defining the orientation in the local frame.
Definition: Types.h:493
float64_t y
Definition: Types.h:301
static const dwTime_t DW_TIME_INVALID
Special value indicating invalid time.
Definition: Types.h:90
float64_t y
Definition: Types.h:330
uint32_t pointCount
number of points.
Definition: Types.h:414
const dwVector2f * points
pointer to the first element in the container.
Definition: Types.h:392
Defines a 2x2 matrix of floating point numbers.
Definition: Types.h:225
Defines a 3x3 matrix of double floating point numbers.
Definition: Types.h:250
Defines a 3x3 matrix of floating point numbers.
Definition: Types.h:237
Defines a 4x4 matrix of floating point numbers (column major).
Definition: Types.h:271
Defines a 6x6 matrix of floating point numbers (column major).
Definition: Types.h:285
dwVector3f center
Coordinate of the position of the center of the bounding box in the local frame.
Definition: Types.h:489
Combination of multiple precisions.
Definition: Types.h:148
float64_t z
Definition: Types.h:348
Defines a double-precision line segment.
Definition: Types.h:383
Defines a single-precision line segment.
Definition: Types.h:376
Defines a three-element unsigned-integer vector.
Definition: Types.h:353
DW_API_PUBLIC uint8_t dwSizeOf(dwTrivialDataType type)
static const dwQuaternionf DW_IDENTITY_QUATERNIONF
Identity for dwQuaternionf.
Definition: Types.h:427
Defines a two-element unsigned-integer vector.
Definition: Types.h:312
dwRectf dwBox2Df
Definition: Types.h:220
float32_t y
Specifies the y coordinate.
Definition: Types.h:209
__half_raw float16_t
Definition: Types.h:77
static const dwTransformation2f DW_IDENTITY_TRANSFORMATION2F
Identity for dwTransformation2f.
Definition: Types.h:452
char char8_t
Definition: Types.h:72
static const dwTransformation3f DW_IDENTITY_TRANSFORMATION3F
Identity for dwTransformation3f.
Definition: Types.h:468
float32_t confidence
Inlier ratio [0,1].
Definition: Types.h:512
static const dwMatrix3d DW_IDENTITY_MATRIX3D
Identity for dwMatrix3d.
Definition: Types.h:256
float64_t z
Definition: Types.h:434
dwProcessType
Process type definitions.
Definition: Types.h:171
uint32_t x
Definition: Types.h:355
dwRect dwBox2D
Definition: Types.h:219
float32_t y
Definition: Types.h:322
uint32_t pointCount
number of points.
Definition: Types.h:393
NVIDIA DriveWorks API: Core Exports
float32_t z
Definition: Types.h:339
pinned memory
Definition: Types.h:185
uint32_t y
Definition: Types.h:315
float64_t z
Definition: Types.h:331
static const dwMatrix2f DW_IDENTITY_MATRIX2F
Identity for dwMatrix2f.
Definition: Types.h:231
const dwVector3d * points
pointer to the first element in the container.
Definition: Types.h:413
int32_t y
y coordinate.
Definition: Types.h:194
#define DW_API_PUBLIC
Definition: Exports.h:56
float32_t z
Definition: Types.h:422
FP16 precision.
Definition: Types.h:144
float32_t w
Definition: Types.h:423
dwVector3f bb
Definition: Types.h:364
float32_t z
Definition: Types.h:323
NVIDIA DriveWorks API: Core Status Methods
int32_t y
Definition: Types.h:308
const dwVector3f * points
pointer to the first element in the container.
Definition: Types.h:406
int32_t height
Rectangle height.
Definition: Types.h:198
static const dwMatrix4f DW_IDENTITY_MATRIX4F
Identity for dwMatrix4f.
Definition: Types.h:277