AMD rocAL - Data Transfer API#
API: AMD rocAL - Data Transfer API
The AMD rocAL data transfer functions. More...
Functions | |
RocalStatus ROCAL_API_CALL | rocalCopyToOutput (RocalContext context, unsigned char *out_ptr, size_t out_size) |
copies data to output buffer More... | |
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 More... | |
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. More... | |
RocalTensorList ROCAL_API_CALL | rocalGetOutputTensors (RocalContext p_context) |
gives the list of output tensors from rocal context More... | |
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. More... | |
Detailed Description
The AMD rocAL data transfer functions.
Function Documentation
◆ rocalCopyToOutput()
RocalStatus ROCAL_API_CALL rocalCopyToOutput | ( | RocalContext | context, |
unsigned char * | out_ptr, | ||
size_t | out_size | ||
) |
copies data to output buffer
- Parameters
-
[in] context Rocal context [in] out_ptr pointer to output buffer [in] out_size size of output buffer
- Returns
- Rocal status indicating success or failure
◆ rocalExternalSourceFeedInput()
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.
- Parameters
-
rocal_context Rocal context input_images Strings pointing to the location on the disk labels Labels whose values is passed by the user using an external source input_buffer Compressed or uncompressed input buffer roi_width The roi width of the images roi_height The roi height of the images max_width The maximum width of the decoded images, larger or smaller will be resized to closest max_height The maximum height of the decoded images, larger or smaller will be resized to closest channels The number of channels for the image mode Determines the mode of the source passed from the user - file_names / uncompressed data / compressed data layout Determines the layout of the images - NCHW / NHWC
- Returns
- Reference to the output tensor
◆ rocalGetOutputTensors()
RocalTensorList ROCAL_API_CALL rocalGetOutputTensors | ( | RocalContext | p_context | ) |
gives the list of output tensors from rocal context
- Parameters
-
[in] p_context Rocal Context
- Returns
- A RocalTensorList containing the list of output tensors
◆ rocalSetOutputs()
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.
- Parameters
-
[in] p_context Rocal context [in] num_of_outputs number of output images [in] output_images output images
◆ rocalToTensor()
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
- Parameters
-
[in] rocal_context Rocal context [in] out_ptr pointer to output buffer [in] tensor_format the layout of the tensor data [in] tensor_output_type the output type of the tensor data [in] multiplier0 the multiplier for channel 0 [in] multiplier1 the multiplier for channel 1 [in] multiplier2 the multiplier for channel 2 [in] offset0 the offset for channel 0 [in] offset1 the offset for channel 1 [in] offset2 the offset for channel 2 [in] reverse_channels flag to reverse the channel orders [in] output_mem_type the memory type of output tensor buffer
- Returns
- Rocal status indicating success or failure