Defines the core Context methods of the SDK.
Data Structures | |
struct | dwContextParameters |
A set of parameters that is passed to the SDK to create the context. More... | |
struct | dwCustomizedFileFunctions |
Data structure representing a customized FileStream that can be passed in. More... | |
struct | dwVisualizationParameters |
A set of parameters that is passed to the visualization. More... | |
Typedefs | |
typedef struct dwContextObject * | dwContextHandle_t |
Context handle. More... | |
typedef struct dwContextObject const * | dwConstContextHandle_t |
The Driveworks context handle. More... | |
typedef struct dwModuleObject * | dwModuleHandle_t |
The Generic Module Object Handle. More... | |
typedef struct dwModuleObject const * | dwConstModuleHandle_t |
typedef struct dwContextParameters | dwContextParameters |
A set of parameters that is passed to the SDK to create the context. More... | |
typedef void * | dwCustomizedFileHandle |
FileStream function pointers handle. More... | |
typedef void * | dwDLAHandleArray |
cuDLA Device handle array pointer More... | |
typedef struct dwCustomizedFileFunctions | dwCustomizedFileFunctions |
Data structure representing a customized FileStream that can be passed in. More... | |
typedef struct dwVisualizationContextObject * | dwVisualizationContextHandle_t |
Context handle. More... | |
typedef struct dwVisualizationContextObject const * | dwVisualizationConstContextHandle_t |
typedef struct dwVisualizationParameters | dwVisualizationParameters |
A set of parameters that is passed to the visualization. More... | |
Enumerations | |
enum | dwPTPStatus { DW_PTP_STATUS_NO_INIT_SYNC = 0, DW_PTP_STATUS_NO_ERROR, DW_PTP_STATUS_LOST_SYNC, DW_PTP_STATUS_INTERNAL_ERROR } |
Defines PTP synchronization status. More... | |
Functions | |
DW_API_PUBLIC dwStatus | dwContext_setCustomFileFunctions (dwContextHandle_t const context, dwCustomizedFileFunctions *const fileFunctionPtr) |
Set the customized fileStream function pointers in context. More... | |
DW_API_PUBLIC dwStatus | dwGetLastError (char8_t const **const errorMsg) |
Retrieves the last error encountered. More... | |
DW_API_PUBLIC dwStatus | dwGetLastCudaError (cudaError_t *const cudaError, char8_t const **const errorMsg) |
Retrieves the last CUDA error encountered. More... | |
DW_API_PUBLIC dwStatus | dwInitialize (dwContextHandle_t *const context, dwVersion const headerVersion, dwContextParameters const *const params) |
Creates and initializes an SDK context. More... | |
DW_API_PUBLIC dwStatus | dwRelease (dwContextHandle_t const context) |
Releases the context. More... | |
DW_API_PUBLIC dwStatus | dwContext_getCurrentTime (dwTime_t *const time, dwContextHandle_t const context) |
Returns the current PTP timestamp. More... | |
DW_API_PUBLIC dwStatus | dwContext_getCurrentTimeMono (dwTime_t *const time, dwContextHandle_t const context) |
Returns the current monotonic timestamp. More... | |
DW_API_PUBLIC dwStatus | dwContext_getCurrentTimeUTC (dwTime_t *const time, dwContextHandle_t const context) |
Returns the current UTC timestamp. More... | |
DW_API_PUBLIC dwStatus | dwContext_getTimeSource (dwTimeSourceHandle_t *const source, dwContextHandle_t const context) |
Retrieve time source used in the context. More... | |
DW_API_PUBLIC dwStatus | dwContext_isTimePTPSynchronized (bool *const flag, dwContextHandle_t const context) |
Check if the used time source inside the context is synchronized over PTP. More... | |
DW_API_PUBLIC dwStatus | dwContext_getTimePTPSynchronizationStatus (dwPTPStatus *const status, dwContextHandle_t const context) |
Get the PTP synchronization status of time source inside the context. More... | |
DW_API_PUBLIC dwStatus | dwContext_sleepMonotonic (dwTime_t const sleepTimeUs) |
Sleep for a given time using a monotonic clock. More... | |
DW_API_PUBLIC dwStatus | dwContext_selectGPUDevice (int32_t const deviceNumber, dwContextHandle_t const context) |
Selects a GPU device, if available. More... | |
DW_API_PUBLIC dwStatus | dwContext_getGPUDeviceCurrent (int32_t *const deviceNumber, dwContextHandle_t const context) |
Returns the currently selected GPU device. More... | |
DW_API_PUBLIC dwStatus | dwContext_getGPUCount (int32_t *const count, dwContextHandle_t const context) |
Get the available GPU devices count. More... | |
DW_API_PUBLIC dwStatus | dwContext_getGPUProperties (dwGPUDeviceProperties *const properties, int32_t const deviceNum, dwContextHandle_t const context) |
Returns the properties for the specific CUDA device. More... | |
DW_API_PUBLIC dwStatus | dwContext_getGPUAttribute (int32_t *const value, cudaDeviceAttr const attribute, int32_t const deviceNum, dwContextHandle_t const context) |
Returns the value of the selected CUDA attribute for the specific CUDA device. More... | |
DW_API_PUBLIC dwStatus | dwContext_getGPUArchitecture (char8_t const **const architecture, dwContextHandle_t const context) |
Returns the architecture for the currently selected CUDA device. More... | |
DW_API_PUBLIC dwStatus | dwContext_getCUDAProperties (int32_t *const driverVersion, int32_t *const apiVersion, dwContextHandle_t const context) |
Returns Driver and Runtime API version of CUDA on the current machine. More... | |
DW_API_PUBLIC dwStatus | dwContext_getCUDAStream (cudaStream_t *stream, uint32_t streamIndex, dwContextHandle_t const context) |
Returns a preallocated CUDA stream. More... | |
DW_API_PUBLIC dwStatus | dwContext_getGPUDeviceType (dwGPUDeviceType *const deviceType, int32_t const deviceNum, dwContextHandle_t const context) |
Returns the device type of the input GPU number. More... | |
DW_API_PUBLIC dwStatus | dwContext_getDLAEngineCount (int32_t *const count, dwContextHandle_t const context) |
Get the available DLA engines count. More... | |
DW_API_PUBLIC dwStatus | dwContext_setupCUDLA (uint16_t const *handleCountArray, uint16_t const handleCountArraySize, dwContextHandle_t const context) |
Setup CUDLA, create CUDLA Engine handles per request. More... | |
DW_API_PUBLIC dwStatus | dwContext_getCUDLADeviceHandleArray (dwDLAHandleArray *const cudlaDeviceHandleArray, uint16_t *const cudlaDeviceHandleCount, uint16_t const engineId, dwContextHandle_t const context) |
Get the CUDLA Engine handles. More... | |
DW_API_PUBLIC dwStatus | dwContext_getDataPath (char8_t const **const dataPath, dwContextHandle_t const context) |
Gets the initial data path of the library that contains the driveworks context. More... | |
DW_API_PUBLIC dwStatus | dwContext_getUseVirtualTime (bool *const useVirtualTime, dwContextHandle_t const ctx) |
Check if in virtual time mode. More... | |
DW_API_PUBLIC dwStatus | dwContext_getNvSciSyncModule (NvSciSyncModule *mod, dwContextHandle_t const context) |
Get the NvSciSync module. More... | |
DW_API_PUBLIC dwStatus | dwContext_getNvSciBufModule (NvSciBufModule *mod, dwContextHandle_t const context) |
Get the nvscibuf module. More... | |
DW_API_PUBLIC dwStatus | dwContext_getErrorSignal (dwErrorSignal *errorSignal, dwModuleHandle_t handle) |
Get the module error signal. More... | |
DW_VIZ_API_PUBLIC dwStatus | dwVisualizationInitialize (dwVisualizationContextHandle_t *vizContext, dwContextHandle_t ctx) |
Creates and initializes a Visualization SDK context. More... | |
DW_VIZ_API_PUBLIC dwStatus | dwVisualizationInitializeWithParams (dwVisualizationContextHandle_t *vizContext, dwVisualizationParameters params, dwContextHandle_t ctx) |
Creates and initializes a Visualization SDK context. More... | |
DW_VIZ_API_PUBLIC dwStatus | dwVisualizationRelease (dwVisualizationContextHandle_t context) |
Releases the context. More... | |
DW_VIZ_API_PUBLIC dwStatus | dwVisualizationGetDWContext (dwContextHandle_t *dwctx, dwVisualizationContextHandle_t context) |
Return DW context associated with this visualization library. More... | |
typedef struct dwContextObject const* dwConstContextHandle_t |
typedef struct dwModuleObject const* dwConstModuleHandle_t |
typedef struct dwContextObject* dwContextHandle_t |
typedef struct dwContextParameters dwContextParameters |
A set of parameters that is passed to the SDK to create the context.
typedef struct dwCustomizedFileFunctions dwCustomizedFileFunctions |
Data structure representing a customized FileStream that can be passed in.
typedef void* dwCustomizedFileHandle |
typedef void* dwDLAHandleArray |
typedef struct dwModuleObject* dwModuleHandle_t |
typedef struct dwVisualizationContextObject const* dwVisualizationConstContextHandle_t |
Definition at line 54 of file Visualization.h.
typedef struct dwVisualizationContextObject* dwVisualizationContextHandle_t |
Context handle.
Definition at line 53 of file Visualization.h.
typedef struct dwVisualizationParameters dwVisualizationParameters |
A set of parameters that is passed to the visualization.
enum dwPTPStatus |
DW_API_PUBLIC dwStatus dwContext_getCUDAProperties | ( | int32_t *const | driverVersion, |
int32_t *const | apiVersion, | ||
dwContextHandle_t const | context | ||
) |
Returns Driver and Runtime API version of CUDA on the current machine.
[out] | driverVersion | Driver version. |
[out] | apiVersion | Runtime API version. |
[in] | context | Specifies the context handle. |
DW_API_PUBLIC dwStatus dwContext_getCUDAStream | ( | cudaStream_t * | stream, |
uint32_t | streamIndex, | ||
dwContextHandle_t const | context | ||
) |
Returns a preallocated CUDA stream.
[out] | stream | CUDA stream |
[in] | streamIndex | CUDA stream index |
[in] | context | Specifies the context handle. |
DW_API_PUBLIC dwStatus dwContext_getCUDLADeviceHandleArray | ( | dwDLAHandleArray *const | cudlaDeviceHandleArray, |
uint16_t *const | cudlaDeviceHandleCount, | ||
uint16_t const | engineId, | ||
dwContextHandle_t const | context | ||
) |
Get the CUDLA Engine handles.
[out] | cudlaDeviceHandleArray | list of cudlaDeviceHandles on dedicated engine. |
[out] | cudlaDeviceHandleCount | count of cudla engine handles. |
[in] | engineId | indicates which DLA Engine the cudla device handles run on. |
[in] | context | Specifies the context handle. |
DW_API_PUBLIC dwStatus dwContext_getCurrentTime | ( | dwTime_t *const | time, |
dwContextHandle_t const | context | ||
) |
Returns the current PTP timestamp.
Timestamps from the same context are guaranteed to be in sync. The returned time represents the absolute time as received through system time source. On POSIX based systems, the time is measured using CLOCK_MONOTONIC time source.
[out] | time | A pointer to the return time to a given location, in [us]. |
[in] | context | Specifies the context. |
DW_API_PUBLIC dwStatus dwContext_getCurrentTimeMono | ( | dwTime_t *const | time, |
dwContextHandle_t const | context | ||
) |
Returns the current monotonic timestamp.
On POSIX based systems, the time is measured using CLOCK_MONOTONIC time source.
[out] | time | A pointer to the return time to a given location, in [us]. |
[in] | context | Specifies the context. |
DW_API_PUBLIC dwStatus dwContext_getCurrentTimeUTC | ( | dwTime_t *const | time, |
dwContextHandle_t const | context | ||
) |
Returns the current UTC timestamp.
[out] | time | A pointer to the return time to a given location, in [us]. |
[in] | context | Specifies the context. |
DW_API_PUBLIC dwStatus dwContext_getDataPath | ( | char8_t const **const | dataPath, |
dwContextHandle_t const | context | ||
) |
Gets the initial data path of the library that contains the driveworks context.
Note: Later added data paths are not returned here.
[out] | dataPath | Path to the Driveworks data. |
[in] | context | Specifies the context handle. |
DW_API_PUBLIC dwStatus dwContext_getDLAEngineCount | ( | int32_t *const | count, |
dwContextHandle_t const | context | ||
) |
Get the available DLA engines count.
[out] | count | The number of DLA engines available. |
[in] | context | Specifies the context handle. |
DW_API_PUBLIC dwStatus dwContext_getErrorSignal | ( | dwErrorSignal * | errorSignal, |
dwModuleHandle_t | handle | ||
) |
Get the module error signal.
[in,out] | errorSignal | An error signal to be filled into |
[in] | handle | Object handle |
DW_API_PUBLIC dwStatus dwContext_getGPUArchitecture | ( | char8_t const **const | architecture, |
dwContextHandle_t const | context | ||
) |
Returns the architecture for the currently selected CUDA device.
[out] | architecture | A string containing the architecture. |
[in] | context | Specifies the context handle. |
DW_API_PUBLIC dwStatus dwContext_getGPUAttribute | ( | int32_t *const | value, |
cudaDeviceAttr const | attribute, | ||
int32_t const | deviceNum, | ||
dwContextHandle_t const | context | ||
) |
Returns the value of the selected CUDA attribute for the specific CUDA device.
[out] | value | Integer representing the value of the requested attribute. |
[in] | attribute | Specifies the attribute requested. |
[in] | deviceNum | Specifies the device number. |
[in] | context | Specifies the context handle. |
DW_API_PUBLIC dwStatus dwContext_getGPUCount | ( | int32_t *const | count, |
dwContextHandle_t const | context | ||
) |
Get the available GPU devices count.
[out] | count | The number of GPU devices available. |
[in] | context | Specifies the context handle. |
DW_API_PUBLIC dwStatus dwContext_getGPUDeviceCurrent | ( | int32_t *const | deviceNumber, |
dwContextHandle_t const | context | ||
) |
Returns the currently selected GPU device.
If no device is selected, will return -1.
[out] | deviceNumber | The number of GPU device. |
[in] | context | Specifies the context handle. |
DW_API_PUBLIC dwStatus dwContext_getGPUDeviceType | ( | dwGPUDeviceType *const | deviceType, |
int32_t const | deviceNum, | ||
dwContextHandle_t const | context | ||
) |
Returns the device type of the input GPU number.
[out] | deviceType | The type of GPU device. |
[in] | deviceNum | Specifies the device number. |
[in] | context | Specifies the context handle. |
DW_API_PUBLIC dwStatus dwContext_getGPUProperties | ( | dwGPUDeviceProperties *const | properties, |
int32_t const | deviceNum, | ||
dwContextHandle_t const | context | ||
) |
Returns the properties for the specific CUDA device.
[out] | properties | A struct containing the properties. |
[in] | deviceNum | Specifies the device number. |
[in] | context | Specifies the context handle. |
DW_API_PUBLIC dwStatus dwContext_getNvSciBufModule | ( | NvSciBufModule * | mod, |
dwContextHandle_t const | context | ||
) |
Get the nvscibuf module.
[out] | mod | The nvscibuf module |
[in] | context | Specifies the context handle. |
DW_API_PUBLIC dwStatus dwContext_getNvSciSyncModule | ( | NvSciSyncModule * | mod, |
dwContextHandle_t const | context | ||
) |
Get the NvSciSync module.
[out] | mod | The nvscisync module |
[in] | context | Specifies the context handle. |
DW_API_PUBLIC dwStatus dwContext_getTimePTPSynchronizationStatus | ( | dwPTPStatus *const | status, |
dwContextHandle_t const | context | ||
) |
Get the PTP synchronization status of time source inside the context.
[out] | status | Return PTP synchronization status. |
[in] | context | Specifies the context. |
DW_API_PUBLIC dwStatus dwContext_getTimeSource | ( | dwTimeSourceHandle_t *const | source, |
dwContextHandle_t const | context | ||
) |
Retrieve time source used in the context.
[out] | source | Hadle to the time source used by the context |
[in] | context | Specifies the context. |
DW_API_PUBLIC dwStatus dwContext_getUseVirtualTime | ( | bool *const | useVirtualTime, |
dwContextHandle_t const | ctx | ||
) |
Check if in virtual time mode.
[out] | useVirtualTime | boolean for if virtual time is used. |
[in] | ctx | Specifies the context handle. |
DW_API_PUBLIC dwStatus dwContext_isTimePTPSynchronized | ( | bool *const | flag, |
dwContextHandle_t const | context | ||
) |
Check if the used time source inside the context is synchronized over PTP.
PTP synchronization is available starting from PDK 4.1.6.4 and provides a solution to synchronize multiple NVIDIA DRIVE boxes to a common clock base. All sensor readings as well as the 'dwContext_getCurrentTime()' method will be based on the same time source.
[out] | flag | Return true if PTP synchronized time is used. |
[in] | context | Specifies the context. |
DW_API_PUBLIC dwStatus dwContext_selectGPUDevice | ( | int32_t const | deviceNumber, |
dwContextHandle_t const | context | ||
) |
Selects a GPU device, if available.
Note that the selected gpu is valid for the current thread
[in] | deviceNumber | The number of GPU device. |
[in] | context | Specifies the context handle. |
DW_API_PUBLIC dwStatus dwContext_setCustomFileFunctions | ( | dwContextHandle_t const | context, |
dwCustomizedFileFunctions *const | fileFunctionPtr | ||
) |
Set the customized fileStream function pointers in context.
[in] | context | handle |
[in] | fileFunctionPtr | dwCustomizedFileFunctions pointer to be passed into context |
DW_API_PUBLIC dwStatus dwContext_setupCUDLA | ( | uint16_t const * | handleCountArray, |
uint16_t const | handleCountArraySize, | ||
dwContextHandle_t const | context | ||
) |
Setup CUDLA, create CUDLA Engine handles per request.
[in] | handleCountArray | An array to indecate how many cudla device handles to create per DLA Engine. Max 16 handles for one engine by DLA UMD restriction. |
[in] | handleCountArraySize | Size of cudla device handle count array, Max 2 DLA Engines on Orin. |
[in] | context | The context to be released. |
DW_API_PUBLIC dwStatus dwContext_sleepMonotonic | ( | dwTime_t const | sleepTimeUs | ) |
Sleep for a given time using a monotonic clock.
This function is safe from time jumps and system clock changes. This function is not dependent on a DriveWorks context and can be called at any time.
[in] | sleepTimeUs | The time to sleep, in [us]. |
DW_API_PUBLIC dwStatus dwGetLastCudaError | ( | cudaError_t *const | cudaError, |
char8_t const **const | errorMsg | ||
) |
Retrieves the last CUDA error encountered.
When a CUDA function, used within DriveWorks, reports an error, this error is stored internally. It can later be retrieved by this function. After calling this function, the error is reset and future calls will return 'DW_SUCCESS' until another CUDA error is encountered.
Error information is thread local. Each thread has its own last error and an error encountered in one thread will not be visible in another thread.
[out] | cudaError | A pointer to the location where to put last CUDA error encountered. |
[out] | errorMsg | A pointer to a pointer to a string containing a description of the last error encountered. Can be NULL to just reset last error. |
DW_API_PUBLIC dwStatus dwGetLastError | ( | char8_t const **const | errorMsg | ) |
Retrieves the last error encountered.
When a DriveWorks function reports an error, this error is stored internally. It can later be retrieved by this function. After calling this function, the error is reset and future calls will return 'DW_SUCCESS' until another error is encountered.
Error information is thread local. Each thread has its own last error and an error encountered in one thread will not be visible in another thread.
[out] | errorMsg | A pointer to a pointer to a string containing a description of the last error encountered. Can be NULL to just reset last error. |
DW_API_PUBLIC dwStatus dwInitialize | ( | dwContextHandle_t *const | context, |
dwVersion const | headerVersion, | ||
dwContextParameters const *const | params | ||
) |
Creates and initializes an SDK context.
The context is required for initialization of the SDK modules.
[out] | context | A pointer to the context handler is returned here. |
[in] | headerVersion | Specifies current driveworks API version (usually DW_VERSION). |
[in] | params | A pointer with a set of parameters to create the SDK. Can be NULL for a default set of parameters. |
DW_API_PUBLIC dwStatus dwRelease | ( | dwContextHandle_t const | context | ) |
Releases the context.
Any module created with this context must be released before the context can be released.
[in] | context | The context to be released. |
DW_VIZ_API_PUBLIC dwStatus dwVisualizationGetDWContext | ( | dwContextHandle_t * | dwctx, |
dwVisualizationContextHandle_t | context | ||
) |
Return DW context associated with this visualization library.
[out] | dwctx | Context of the DW SDK as given through dwVisualizationInitialize() |
[in] | context | Handle to existing dwVisualization context, created with dwInitialize. |
DW_VIZ_API_PUBLIC dwStatus dwVisualizationInitialize | ( | dwVisualizationContextHandle_t * | vizContext, |
dwContextHandle_t | ctx | ||
) |
Creates and initializes a Visualization SDK context.
The context is required for initialization of the Visualization SDK modules.
[out] | vizContext | A pointer to the context handler is returned here. |
[in] | ctx | Handle to existing DW SDK context, created with dwInitialize. |
dwGLInitialize
will happen DW_VIZ_API_PUBLIC dwStatus dwVisualizationInitializeWithParams | ( | dwVisualizationContextHandle_t * | vizContext, |
dwVisualizationParameters | params, | ||
dwContextHandle_t | ctx | ||
) |
Creates and initializes a Visualization SDK context.
The context is required for initialization of the Visualization SDK modules.
[out] | vizContext | A pointer to the context handler is returned here. |
[in] | params | A set of parameters |
[in] | ctx | Handle to existing DW SDK context, created with dwInitialize. |
dwGLInitialize
will happen DW_VIZ_API_PUBLIC dwStatus dwVisualizationRelease | ( | dwVisualizationContextHandle_t | context | ) |
Releases the context.
Any module created with this context must be released before the context can be released.
[in] | context | The context to be released. |