Blob

Overview

Set of functions allowing to research memory from infer requests or make new memory objects to be passed to InferRequests. More…

// global functions

IEStatusCode ie_blob_make_memory(
    const tensor_desc_t* tensorDesc,
    ie_blob_t** blob
    );

IEStatusCode ie_blob_make_memory_from_preallocated(
    const tensor_desc_t* tensorDesc,
    void* ptr,
    size_t size,
    ie_blob_t** blob
    );

IEStatusCode ie_blob_make_memory_with_roi(
    const ie_blob_t* inputBlob,
    const roi_t* roi,
    ie_blob_t** blob
    );

IEStatusCode ie_blob_make_memory_nv12(
    const ie_blob_t* y,
    const ie_blob_t* uv,
    ie_blob_t** nv12Blob
    );

IEStatusCode ie_blob_make_memory_i420(
    const ie_blob_t* y,
    const ie_blob_t* u,
    const ie_blob_t* v,
    ie_blob_t** i420Blob
    );

IEStatusCode ie_blob_size(ie_blob_t* blob, int* size_result);
IEStatusCode ie_blob_byte_size(ie_blob_t* blob, int* bsize_result);
void ie_blob_deallocate(ie_blob_t** blob);
IEStatusCode ie_blob_get_dims(const ie_blob_t* blob, dimensions_t* dims_result);
IEStatusCode ie_blob_get_layout(const ie_blob_t* blob, layout_e* layout_result);

IEStatusCode ie_blob_get_precision(
    const ie_blob_t* blob,
    precision_e* prec_result
    );

void ie_blob_free(ie_blob_t** blob);

Detailed Documentation

Set of functions allowing to research memory from infer requests or make new memory objects to be passed to InferRequests.

Global Functions

IEStatusCode ie_blob_make_memory(
    const tensor_desc_t* tensorDesc,
    ie_blob_t** blob
    )

Creates a blob with the specified dimensions, layout and to allocate memory.

Parameters:

tensorDesc

Tensor descriptor for Blob creation.

blob

A pointer to the newly created blob.

Returns:

Status code of the operation: OK(0) for success.

IEStatusCode ie_blob_make_memory_from_preallocated(
    const tensor_desc_t* tensorDesc,
    void* ptr,
    size_t size,
    ie_blob_t** blob
    )

Creates a blob with the given tensor descriptor from the pointer to the pre-allocated memory.

Parameters:

tensorDesc

Tensor descriptor for Blob creation.

ptr

Pointer to the pre-allocated memory.

size

Length of the pre-allocated array.

blob

A pointer to the newly created blob.

Returns:

Status code of the operation: OK(0) for success.

IEStatusCode ie_blob_make_memory_with_roi(
    const ie_blob_t* inputBlob,
    const roi_t* roi,
    ie_blob_t** blob
    )

Creates a blob describing given roi_t instance based on the given blob with pre-allocated memory.

Parameters:

inputBlob

original blob with pre-allocated memory.

roi

A roi_tinstance inside of the original blob.

blob

A pointer to the newly created blob.

Returns:

Status code of the operation: OK(0) for success.

IEStatusCode ie_blob_make_memory_nv12(
    const ie_blob_t* y,
    const ie_blob_t* uv,
    ie_blob_t** nv12Blob
    )

Creates a NV12 blob from two planes Y and UV.

Parameters:

y

A pointer to the ie_blob_t instance that represents Y plane in NV12 color format.

uv

A pointer to the ie_blob_t instance that represents UV plane in NV12 color format.

nv12Blob

A pointer to the newly created blob.

Returns:

Status code of the operation: OK(0) for success.

IEStatusCode ie_blob_make_memory_i420(
    const ie_blob_t* y,
    const ie_blob_t* u,
    const ie_blob_t* v,
    ie_blob_t** i420Blob
    )

Creates I420 blob from three planes Y, U and V.

Parameters:

y

A pointer to the ie_blob_t instance that represents Y plane in I420 color format.

u

A pointer to the ie_blob_t instance that represents U plane in I420 color format.

v

A pointer to the ie_blob_t instance that represents V plane in I420 color format.

i420Blob

A pointer to the newly created blob.

Returns:

Status code of the operation: OK(0) for success.

IEStatusCode ie_blob_size(ie_blob_t* blob, int* size_result)

Gets the total number of elements, which is a product of all the dimensions.

Parameters:

blob

A pointer to the blob.

size_result

The total number of elements.

Returns:

Status code of the operation: OK(0) for success.

IEStatusCode ie_blob_byte_size(ie_blob_t* blob, int* bsize_result)

Gets the size of the current Blob in bytes.

Parameters:

blob

A pointer to the blob.

bsize_result

The size of the current blob in bytes.

Returns:

Status code of the operation: OK(0) for success.

void ie_blob_deallocate(ie_blob_t** blob)

Releases previously allocated data.

Parameters:

blob

A pointer to the blob to free memory.

IEStatusCode ie_blob_get_dims(const ie_blob_t* blob, dimensions_t* dims_result)

Gets dimensions of blob’s tensor.

Parameters:

blob

A pointer to the blob.

dims_result

A pointer to the dimensions of blob’s tensor.

Returns:

Status code of the operation: OK(0) for success.

IEStatusCode ie_blob_get_layout(const ie_blob_t* blob, layout_e* layout_result)

Gets layout of blob’s tensor.

Parameters:

blob

A pointer to the blob.

layout_result

A pointer to the layout of blob’s tensor.

Returns:

Status code of the operation: OK(0) for success.

IEStatusCode ie_blob_get_precision(
    const ie_blob_t* blob,
    precision_e* prec_result
    )

Gets precision of blob’s tensor.

Parameters:

blob

A pointer to the blob.

prec_result

A pointer to the precision of blob’s tensor.

Returns:

Status code of the operation: OK(0) for success.

void ie_blob_free(ie_blob_t** blob)

Releases the memory occupied by the ie_blob_t pointer.

Parameters:

blob

A pointer to the blob pointer to release memory.