AMD rocAL - Data Transfer API#

rocAL: API: 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]contextRocal context
[in]out_ptrpointer to output buffer
[in]out_sizesize 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_contextRocal context
input_imagesStrings pointing to the location on the disk
labelsLabels whose values is passed by the user using an external source
input_bufferCompressed or uncompressed input buffer
roi_widthThe roi width of the images
roi_heightThe roi height of the images
max_widthThe maximum width of the decoded images, larger or smaller will be resized to closest
max_heightThe maximum height of the decoded images, larger or smaller will be resized to closest
channelsThe number of channels for the image
modeDetermines the mode of the source passed from the user - file_names / uncompressed data / compressed data
layoutDetermines 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_contextRocal 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_contextRocal context
[in]num_of_outputsnumber of output images
[in]output_imagesoutput 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_contextRocal context
[in]out_ptrpointer to output buffer
[in]tensor_formatthe layout of the tensor data
[in]tensor_output_typethe output type of the tensor data
[in]multiplier0the multiplier for channel 0
[in]multiplier1the multiplier for channel 1
[in]multiplier2the multiplier for channel 2
[in]offset0the offset for channel 0
[in]offset1the offset for channel 1
[in]offset2the offset for channel 2
[in]reverse_channelsflag to reverse the channel orders
[in]output_mem_typethe memory type of output tensor buffer
Returns
Rocal status indicating success or failure