AMD rocAL API

AMD rocAL API#

rocAL: API: AMD rocAL API
API: AMD rocAL API

The AMD rocAL is designed to efficiently decode and process images and videos from a variety of storage formats and modify them through a processing graph programmable by the user. More...

Functions

RocalContext ROCAL_API_CALL rocalCreate (size_t batch_size, RocalProcessMode affinity, int gpu_id=0, size_t cpu_thread_count=1, size_t prefetch_queue_depth=3, RocalTensorOutputType output_tensor_data_type=RocalTensorOutputType::ROCAL_FP32)
 rocalCreate creates the context for a new augmentation pipeline. Initializes all the required internals for the pipeline More...
 
RocalStatus ROCAL_API_CALL rocalVerify (RocalContext context)
 rocalVerify function to verify the graph for all the inputs and outputs More...
 
RocalStatus ROCAL_API_CALL rocalRun (RocalContext context)
 rocalRun function to process and run the built and verified graph. More...
 
RocalStatus ROCAL_API_CALL rocalRelease (RocalContext rocal_context)
 rocalRelease function to free all the resources allocated during the graph creation process. More...
 
RocalStatus ROCAL_API_CALL rocalSerialize (RocalContext rocal_context, size_t *serialized_string_size)
 Serialize the current pipeline into an opaque binary string. More...
 
RocalStatus ROCAL_API_CALL rocalGetSerializedString (RocalContext rocal_context, char *serialized_string)
 Copy the last serialized pipeline string into a user buffer. More...
 

Detailed Description

The AMD rocAL is designed to efficiently decode and process images and videos from a variety of storage formats and modify them through a processing graph programmable by the user.

Function Documentation

◆ rocalCreate()

RocalContext ROCAL_API_CALL rocalCreate ( size_t  batch_size,
RocalProcessMode  affinity,
int  gpu_id = 0,
size_t  cpu_thread_count = 1,
size_t  prefetch_queue_depth = 3,
RocalTensorOutputType  output_tensor_data_type = RocalTensorOutputType::ROCAL_FP32 
)

rocalCreate creates the context for a new augmentation pipeline. Initializes all the required internals for the pipeline

Parameters
[in]batch_sizebatch size
[in]affinityRocalProcessMode: Defines whether rocal data loading should be on the CPU or GPU.
[in]gpu_idGPU id
[in]cpu_thread_countnumber of cpu threads
[in]prefetch_queue_depthThe depth of the prefetch queue.
[in]output_tensor_data_typeRocalTensorOutputType: Defines whether the output of rocal tensor is FP32 or FP16.
Returns
A RocalContext - The context for the pipeline

◆ rocalGetSerializedString()

RocalStatus ROCAL_API_CALL rocalGetSerializedString ( RocalContext  rocal_context,
char *  serialized_string 
)

Copy the last serialized pipeline string into a user buffer.

This API copies the serialized pipeline string produced by rocalSerialize() into the user-provided buffer. The buffer must be pre-allocated with size at least serialized_string_size + 1 bytes to accommodate the null terminator.

Warning
The caller is responsible for ensuring the destination buffer has sufficient capacity (at least serialized_string_size + 1 bytes as returned by rocalSerialize). Passing an insufficiently sized buffer will result in buffer overflow and undefined behavior.
Parameters
[in]rocal_contextthe rocAL context
[out]serialized_stringdestination buffer to receive the serialized string (null-terminated). Must be pre-allocated with at least serialized_string_size + 1 bytes.
Returns
A RocalStatus - A status code indicating the success or failure.

◆ rocalRelease()

RocalStatus ROCAL_API_CALL rocalRelease ( RocalContext  rocal_context)

rocalRelease function to free all the resources allocated during the graph creation process.

Parameters
[in]contextthe rocal context
Returns
A RocalStatus - A status code indicating the success or failure.

◆ rocalRun()

RocalStatus ROCAL_API_CALL rocalRun ( RocalContext  context)

rocalRun function to process and run the built and verified graph.

Parameters
[in]contextthe rocal context
Returns
A RocalStatus - A status code indicating the success or failure

◆ rocalSerialize()

RocalStatus ROCAL_API_CALL rocalSerialize ( RocalContext  rocal_context,
size_t *  serialized_string_size 
)

Serialize the current pipeline into an opaque binary string.

Parameters
[in]rocal_contextthe rocAL context
[out]serialized_string_sizenumber of bytes in the serialized string
Returns
A RocalStatus - A status code indicating the success or failure.

◆ rocalVerify()

RocalStatus ROCAL_API_CALL rocalVerify ( RocalContext  context)

rocalVerify function to verify the graph for all the inputs and outputs

Parameters
[in]contextthe rocal context
Returns
A RocalStatus - A status code indicating the success or failure