DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

TensorStreamer.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) 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 
49 #ifndef DW_INTEROP_TENSORSTREAMER_H_
50 #define DW_INTEROP_TENSORSTREAMER_H_
51 
52 #include <dw/dnn/tensor/Tensor.h>
53 
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57 
59 typedef struct dwDNNTensorStreamerObject* dwDNNTensorStreamerHandle_t;
60 
81 dwStatus dwDNNTensorStreamer_initialize(dwDNNTensorStreamerHandle_t* streamer,
82  const dwDNNTensorProperties* from, dwDNNTensorType to,
83  dwContextHandle_t ctx);
84 
102 dwStatus dwDNNTensorStreamer_producerSend(dwDNNTensorHandle_t tensor, dwDNNTensorStreamerHandle_t streamer);
103 
121  dwDNNTensorStreamerHandle_t streamer);
122 
139  dwDNNTensorStreamerHandle_t streamer);
140 
154 dwStatus dwDNNTensorStreamer_consumerReturn(dwDNNTensorHandle_t* tensor, dwDNNTensorStreamerHandle_t streamer);
155 
171 dwStatus dwDNNTensorStreamer_setCUDAStream(cudaStream_t stream, dwDNNTensorStreamerHandle_t streamer);
172 
184 dwStatus dwDNNTensorStreamer_getCUDAStream(cudaStream_t* stream, dwDNNTensorStreamerHandle_t streamer);
185 
196 dwStatus dwDNNTensorStreamer_getOutputProperties(dwDNNTensorProperties* props, dwDNNTensorStreamerHandle_t streamer);
197 
208 dwStatus dwDNNTensorStreamer_release(dwDNNTensorStreamerHandle_t streamer);
209 
210 #ifdef __cplusplus
211 }
212 #endif
213 
215 #endif // DW_INTEROP_TENSORSTREAMER_H_
dwDNNTensorType
Speficies the type of a tensor.
Definition: Tensor.h:66
DW_API_PUBLIC dwStatus dwDNNTensorStreamer_getOutputProperties(dwDNNTensorProperties *props, dwDNNTensorStreamerHandle_t streamer)
Get tensor properties of the tensor received from the streamer.
DW_API_PUBLIC dwStatus dwDNNTensorStreamer_setCUDAStream(cudaStream_t stream, dwDNNTensorStreamerHandle_t streamer)
Sets the CUDA stream for CUDA related streaming operations such as post and receive.
DW_API_PUBLIC dwStatus dwDNNTensorStreamer_getCUDAStream(cudaStream_t *stream, dwDNNTensorStreamerHandle_t streamer)
Get CUDA stream used by the tensor streamer.
DW_API_PUBLIC dwStatus dwDNNTensorStreamer_producerReturn(dwDNNTensorHandle_t *tensor, dwTime_t timeout_us, dwDNNTensorStreamerHandle_t streamer)
The producer streamer waits for the tensor sent to be returned by the consumer.
struct dwDNNTensorStreamerObject * dwDNNTensorStreamerHandle_t
dwStatus
Status definition.
Definition: Status.h:178
DW_API_PUBLIC dwStatus dwDNNTensorStreamer_consumerReceive(dwDNNTensorHandle_t *tensor, dwTime_t timeout_us, dwDNNTensorStreamerHandle_t streamer)
Receive a pointer to a dwDNNTensorHandle_t from the streamer, acting as a consumer.
int64_t dwTime_t
Specifies a timestamp unit, in microseconds.
Definition: Types.h:82
NVIDIA DriveWorks API: DNNTensor Structures and Methods
DW_API_PUBLIC dwStatus dwDNNTensorStreamer_producerSend(dwDNNTensorHandle_t tensor, dwDNNTensorStreamerHandle_t streamer)
Sends an tensor through the streamer acting as the producer.
DW_API_PUBLIC dwStatus dwDNNTensorStreamer_consumerReturn(dwDNNTensorHandle_t *tensor, dwDNNTensorStreamerHandle_t streamer)
Return the received tensor back to the producer.
DW_API_PUBLIC dwStatus dwDNNTensorStreamer_release(dwDNNTensorStreamerHandle_t streamer)
Releases the tensor streamer.
Specifies DNNTensor properties.
Definition: Tensor.h:93
DW_API_PUBLIC dwStatus dwDNNTensorStreamer_initialize(dwDNNTensorStreamerHandle_t *streamer, const dwDNNTensorProperties *from, dwDNNTensorType to, dwContextHandle_t ctx)
Creates and initializes the tensor streamer capable of moving tensors between different API types...
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:80
struct dwDNNTensorObject * dwDNNTensorHandle_t
Handles representing Deep Neural Network interface.
Definition: Tensor.h:59
#define DW_API_PUBLIC
Definition: Exports.h:56