/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-rocal/checkouts/docs-6.1.2/rocAL/include/api/rocal_api_data_transfer.h Source File

/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-rocal/checkouts/docs-6.1.2/rocAL/include/api/rocal_api_data_transfer.h Source File#

rocAL: /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-rocal/checkouts/docs-6.1.2/rocAL/include/api/rocal_api_data_transfer.h Source File
rocal_api_data_transfer.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2019 - 2023 Advanced Micro Devices, Inc. All rights reserved.
3 
4 Permission is hereby granted, free of charge, to any person obtaining a copy
5 of this software and associated documentation files (the "Software"), to deal
6 in the Software without restriction, including without limitation the rights
7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 copies of the Software, and to permit persons to whom the Software is
9 furnished to do so, subject to the following conditions:
10 
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13 
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 THE SOFTWARE.
21 */
22 
23 #ifndef MIVISIONX_ROCAL_API_DATA_TRANSFER_H
24 #define MIVISIONX_ROCAL_API_DATA_TRANSFER_H
25 #include "rocal_api_types.h"
26 
43 extern "C" RocalStatus ROCAL_API_CALL rocalCopyToOutput(RocalContext context, unsigned char *out_ptr, size_t out_size);
44 
62 extern "C" RocalStatus ROCAL_API_CALL rocalToTensor(RocalContext rocal_context, void *out_ptr,
63  RocalTensorLayout tensor_format, RocalTensorOutputType tensor_output_type,
64  float multiplier0, float multiplier1, float multiplier2, float offset0,
65  float offset1, float offset2,
66  bool reverse_channels, RocalOutputMemType output_mem_type, int max_roi_height = 0, int max_roi_width = 0);
67 
75 extern "C" void ROCAL_API_CALL rocalSetOutputs(RocalContext p_context, unsigned int num_of_outputs, std::vector<RocalTensor> &output_images);
76 
83 extern "C" RocalTensorList ROCAL_API_CALL rocalGetOutputTensors(RocalContext p_context);
84 
101 extern "C" RocalStatus ROCAL_API_CALL rocalExternalSourceFeedInput(RocalContext p_context, const std::vector<std::string>& input_images_names,
102  bool is_labels, const std::vector<unsigned char *>& input_buffer,
103  const std::vector<ROIxywh>& roi_xywh,
104  unsigned int max_width, unsigned int max_height, unsigned int channels,
105  RocalExternalSourceMode mode, RocalTensorLayout layout, bool eos);
106 
107 #endif // MIVISIONX_ROCAL_API_DATA_TRANSFER_H
RocalStatus ROCAL_API_CALL rocalCopyToOutput(RocalContext context, unsigned char *out_ptr, size_t out_size)
copies data to output buffer
void ROCAL_API_CALL rocalSetOutputs(RocalContext p_context, unsigned int num_of_outputs, std::vector< RocalTensor > &output_images)
Sets the output images in the RocalContext.
RocalStatus ROCAL_API_CALL rocalExternalSourceFeedInput(RocalContext p_context, const std::vector< std::string > &input_images_names, bool is_labels, const std::vector< unsigned char * > &input_buffer, const std::vector< ROIxywh > &roi_xywh, unsigned int max_width, unsigned int max_height, unsigned int channels, RocalExternalSourceMode mode, RocalTensorLayout layout, bool eos)
Creates ExternalSourceFeedInput for data transfer.
RocalStatus ROCAL_API_CALL rocalToTensor(RocalContext rocal_context, void *out_ptr, RocalTensorLayout tensor_format, RocalTensorOutputType tensor_output_type, float multiplier0, float multiplier1, float multiplier2, float offset0, float offset1, float offset2, bool reverse_channels, RocalOutputMemType output_mem_type, int max_roi_height=0, int max_roi_width=0)
converts data to a tensor
RocalTensorList ROCAL_API_CALL rocalGetOutputTensors(RocalContext p_context)
gives the list of output tensors from rocal context
RocalTensorLayout
rocAL Tensor Layout enum
Definition: rocal_api_types.h:208
RocalStatus
rocAL Status enum
Definition: rocal_api_types.h:112
RocalTensorOutputType
rocAL Tensor Output Type enum
Definition: rocal_api_types.h:229
RocalExternalSourceMode
RocalExternalSourceMode struct.
Definition: rocal_api_types.h:368
void * RocalContext
typedef void* rocAL Context
Definition: rocal_api_types.h:63
The AMD rocAL Library - Types.
RocalOutputMemType
Definition: rocal_api_types.h:269
#define ROCAL_API_CALL
Definition: rocal_api_types.h:35