Standardized/Unified API#

group API

Interface APIs and data structures of AOCL Compression library are described in this section.

This file contains the unified interface API set and associated data structure.

Enums

enum aocl_compression_type#

Types of compression methods supported.

Optimizations are included for all the supported methods

Values:

enumerator LZ4#
enumerator LZ4HC#
enumerator LZMA#
enumerator BZIP2#
enumerator SNAPPY#
enumerator ZLIB#
enumerator ZSTD#
enumerator AOCL_COMPRESSOR_ALGOS_NUM#
enum aocl_error_type#

Error codes supported by unified APIs of AOCL-Compression library.

Values:

enumerator ERR_INVALID_INPUT#

Invalid input parameter provided.

enumerator ERR_UNSUPPORTED_METHOD#

Compression method not supported by the library.

enumerator ERR_EXCLUDED_METHOD#

Compression method excluded from this library build.

enumerator ERR_COMPRESSION_FAILED#

Failure during compression/decompression.

enumerator ERR_COMPRESSION_INVALID_OUTPUT#

Invalid compression/decompression output.

Functions

int64_t aocl_llc_compress(aocl_compression_desc *handle, aocl_compression_type codec_type)#

Interface API to compress data.

Parameters

Direction

Description

handle

in,out

This acts as a handle for compression and decompression. For more information, refer to aocl_compression_desc.

codec_type

in

Select the algorithm to be used for compression, choose from aocl_compression_type.

Returns:

Result

Description

Success

Number of bytes decompressed

Fail

ERR_COMPRESSION_FAILED

ERR_COMPRESSION_INVALID_OUTPUT

int64_t aocl_llc_decompress(aocl_compression_desc *handle, aocl_compression_type codec_type)#

Interface API to decompress data.

Parameters

Direction

Description

handle

in,out

This acts as a handle for compression and decompression. For more information, refer to aocl_compression_desc.

codec_type

in

Select the algorithm to be used for compression, choose from aocl_compression_type.

Returns:

Result

Description

Success

Numbers of bytes decompressed

Fail

ERR_COMPRESSION_FAILED

ERR_COMPRESSION_INVALID_OUTPUT

void aocl_llc_destroy(aocl_compression_desc *handle, aocl_compression_type codec_type)#

Interface API to destroy the compression method.

Parameters

Direction

Description

handle

in,out

This acts as a handle for compression and decompression. For more information, refer to aocl_compression_desc.

codec_type

in

Select the algorithm to be used for compression, choose from aocl_compression_type.

Returns:

void

int32_t aocl_llc_setup(aocl_compression_desc *handle, aocl_compression_type codec_type)#

Interface API to setup the compression method.

Parameters

Direction

Description

handle

in,out

This acts as a handle for compression and decompression. For more information, refer to aocl_compression_desc.

codec_type

in

Select the algorithm to be used for compression, choose from aocl_compression_type.

Returns:

Result

Description

Success

0

Fail

ERR_UNSUPPORTED_METHOD

ERR_EXCLUDED_METHOD

const char *aocl_llc_version(void)#

Interface API to get the compression library version string.

Returns:

AOCL library version

struct aocl_compression_desc#
#include <aocl_compression.h>

This acts as a handle for the compression and decompression of AOCL Compression library.

Public Members

uint64_t cSize#

Size of compressed output

float cSpeed#

Speed of compression

uint64_t cTime#

Time to compress input

uint64_t dSize#

Size of decompressed output

float dSpeed#

Speed of decompression

uint64_t dTime#

Time to decompress input

char *inBuf#

Pointer to input buffer data

size_t inSize#

Input data length

size_t level#

Requested compression level

int measureStats#

Measure speed and size of compression/decompression

size_t memLimit#

Maximum memory limit for compression/decompression

int numMPIranks#

Number of available multi-core MPI ranks

int numThreads#

Number of threads available for multi-threading

int optLevel#

Optimization level:

0 - non-SIMD algorithmic optimizations,

1 - SSE2 optimizations,

2 - AVX optimizations,

3 - AVX2 optimizations,

4 - AVX512 optimizations

int optOff#

Turn off all optimizations

size_t optVar#

Additional variables or parameters

char *outBuf#

Pointer to output buffer data

size_t outSize#

Output data length

char *workBuf#

Pointer to temporary work buffer