class xf::compression::xfZlib

#include "zlib.hpp"

Overview

xfZlib class.


Methods

compress

uint64_t compress (
    uint8_t* in,
    uint8_t* out,
    uint64_t actual_size,
    uint32_t host_buffer_size
    )

This method does the overlapped execution of compression where data transfers and kernel computation are overlapped.

Parameters:

in input byte sequence
out output byte sequence
actual_size input size
host_buffer_size host buffer size

decompress

uint32_t decompress (
    uint8_t* in,
    uint8_t* out,
    uint32_t actual_size,
    int cu_run
    )

This method does serial execution of decompression where data transfers and kernel execution in serial manner.

Parameters:

in input byte sequence
out output byte sequence
actual_size input size
cu_run compute unit number

compress_buffer

uint64_t compress_buffer (
    uint8_t* in,
    uint8_t* out,
    uint64_t input_size
    )

In shared library flow this call can be used for compress buffer in overlapped manner. This is used in libz.so created.

Parameters:

in input byte sequence
out output byte sequence
input_size input size

decompress_buffer

int decompress_buffer (
    uint8_t* in,
    uint8_t* out,
    uint64_t input_size,
    uint8_t cu_id
    )

In shared library flow this call can be used for decompress buffer in serial manner. This is used in libz.so created.

Parameters:

in input byte sequence
out output byte sequence
input_size input size

compress_file

uint64_t compress_file (
    std::string& inFile_name,
    std::string& outFile_name,
    uint64_t input_size
    )

This method does file operations and invokes compress API which internally does zlib compression on FPGA in overlapped manner.

Parameters:

inFile_name input file name
outFile_name output file name
actual_size input size

decompress_file

uint32_t decompress_file (
    std::string& inFile_name,
    std::string& outFile_name,
    uint64_t input_size,
    int cu_run
    )

This method does file operations and invokes decompress API which internally does zlib decompression on FPGA in overlapped manner.

Parameters:

inFile_name input file name
outFile_name output file name
input_size input size
cu_run compute unit number

xfZlib

xfZlib (
    const std::string& binaryFile,
    uint8_t c_max_cr = MAX_CR,
    uint8_t cd_flow = BOTH,
    uint8_t device_id = 0,
    uint8_t profile = 0,
    uint8_t d_type = DYNAMIC
    )

Constructor responsible for creating various host/device buffers.

init

int init (
    const std::string& binaryFile,
    uint8_t dtype
    )

OpenCL setup initialization.

Parameters:

binaryFile  

release

void release ()

OpenCL setup release.

~xfZlib

~xfZlib ()

Release host/device memory.

error_code

int error_code (void)

error_code of a OpenCL call