.. index:: pair: class; xf::compression::xfZlib .. _doxid-classxf_1_1compression_1_1xfZlib: .. _cid-xf::compression::xfzlib: class xf::compression::xfZlib ============================= .. toctree:: :hidden: .. code-block:: cpp :class: overview-code-block #include "zlib.hpp" Overview ~~~~~~~~ :ref:`xfZlib ` class. .. _doxid-classxf_1_1compression_1_1xfZlib_1a25be136469b32af77df2e6b382cf72a9: .. _cid-xf::compression::xfzlib::decompress_buffer: .. _doxid-classxf_1_1compression_1_1xfZlib_1aa2477f22a23fc8ce1ffa8c968c588f29: .. _cid-xf::compression::xfzlib::get_event_duration_ns: .. ref-code-block:: cpp :class: overview-code-block .. FunctionSection Methods ~~~~~~~ .. _doxid-classxf_1_1compression_1_1xfZlib_1aac31d05070fc44eaa7b73e39d1e55387: .. _cid-xf::compression::xfzlib::compress_buffer: compress_buffer --------------- .. ref-code-block:: cpp :class: title-code-block size_t compress_buffer ( uint8_t* in, uint8_t* out, size_t input_size, uint32_t host_buffer_size = HOST_BUFFER_SIZE, int cu = 0 ) This method does the overlapped execution of compression where data transfers and kernel computation are overlapped. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - in - input byte sequence * - out - output byte sequence * - input_size - input size * - host_buffer_size - buffer size for kernel * - cu - comput unit name .. _doxid-classxf_1_1compression_1_1xfZlib_1aa6fc980499fbe77fb8c760362140cc97: .. _cid-xf::compression::xfzlib::deflate_buffer: deflate_buffer -------------- .. ref-code-block:: cpp :class: title-code-block size_t deflate_buffer ( uint8_t* in, uint8_t* out, size_t& input_size, bool& last_data, bool last_buffer, const std::string& cu ) This method does the overlapped execution of compression where data transfers and kernel computation are overlapped. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - in - input byte sequence * - out - output byte sequence * - input_size - input size * - last_data - last compressed output buffer * - last_buffer - last input buffer * - cu - comput unit name .. _doxid-classxf_1_1compression_1_1xfZlib_1a42d55d344807bb9cce3df23de903efdc: .. _cid-xf::compression::xfzlib::inflate_buffer: inflate_buffer -------------- .. ref-code-block:: cpp :class: title-code-block size_t inflate_buffer ( uint8_t* in, uint8_t* out, size_t& input_size, size_t& output_size, bool& last_data, bool last_buffer, const std::string& cu_id ) This method does the overlapped execution of decompression where data transfers and kernel computation are overlapped. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - in - input byte sequence * - out - output byte sequence * - input_size - input size * - last_data - last compressed output buffer * - last_buffer - last input buffer * - cu - comput unit name .. _doxid-classxf_1_1compression_1_1xfZlib_1a5dc1443008daebba8e3aa47c1962434a: .. _cid-xf::compression::xfzlib::decompress: decompress ---------- .. ref-code-block:: cpp :class: title-code-block size_t decompress ( uint8_t* in, uint8_t* out, size_t actual_size, size_t max_outbuf_size, int cu_run = 0 ) This method does serial execution of decompression where data transfers and kernel execution in serial manner. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - in - input byte sequence * - out - output byte sequence * - actual_size - input size * - cu_run - compute unit number .. _doxid-classxf_1_1compression_1_1xfZlib_1aed3a52d3bcb4e2603d367a559c85e175: .. _cid-xf::compression::xfzlib::compress: compress -------- .. ref-code-block:: cpp :class: title-code-block size_t compress ( uint8_t* in, uint8_t* out, size_t input_size, int cu, int level = 1, int strategy = 0, int window_bits = 15 ) This API does end to end compression in a single call. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - in - input byte sequence * - out - output byte sequence * - input_size - input size .. _doxid-classxf_1_1compression_1_1xfZlib_1a4dae7f3471aa3788ffc0c11a9b6196fc: .. _cid-xf::compression::xfzlib::compress_file: compress_file ------------- .. ref-code-block:: cpp :class: title-code-block uint64_t compress_file ( std::string& inFile_name, std::string& outFile_name, uint64_t input_size, int cu_run = 0 ) This method does file operations and invokes compress API which internally does zlib compression on FPGA in overlapped manner. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - inFile_name - input file name * - outFile_name - output file name * - actual_size - input size .. _doxid-classxf_1_1compression_1_1xfZlib_1a847206ba337f6811dbd477c1533586c3: .. _cid-xf::compression::xfzlib::decompress_file: decompress_file --------------- .. ref-code-block:: cpp :class: title-code-block 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. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - inFile_name - input file name * - outFile_name - output file name * - input_size - input size * - cu_run - compute unit number .. _doxid-classxf_1_1compression_1_1xfZlib_1abed5b0a998fd1b3f7a8236927bd099a4: .. _cid-xf::compression::xfzlib::xfzlib: xfZlib ------ xfZlib overload (1) +++++++++++++++++++ .. ref-code-block:: cpp :class: title-code-block xfZlib ( const std::string& binaryFile, bool sb_opt, uint8_t cd_flow, cl::Context* context, cl::Program* program, const cl::Device& device, enum design_flow dflow = XILINX_GZIP, const int bank_id = 0 ) Constructor responsible for creating various host/device buffers. This gets context created already with it so skips ocl platform, device and context creation as part of it. .. _doxid-classxf_1_1compression_1_1xfZlib_1a329922295001165915c6bce0ba7cbdbd: .. _cid-xf::compression::xfzlib::xfzlib-2: xfZlib overload (2) +++++++++++++++++++ .. ref-code-block:: cpp :class: title-code-block xfZlib ( const std::string& binaryFile, bool sb_opt = false, 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, enum design_flow dflow = XILINX_GZIP, uint8_t ccu = 0, uint8_t dcu = 0 ) Constructor responsible for creating various host/device buffers. .. _doxid-classxf_1_1compression_1_1xfZlib_1a87f13a66b1928934295c46677666fabe: .. _cid-xf::compression::xfzlib::init: init ---- .. ref-code-block:: cpp :class: title-code-block int init ( const std::string& binaryFile, uint8_t dtype ) OpenCL setup initialization. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - binaryFile - .. _doxid-classxf_1_1compression_1_1xfZlib_1a161a134c573011f422026e83597b96b3: .. _cid-xf::compression::xfzlib::release: release ------- .. ref-code-block:: cpp :class: title-code-block void release () OpenCL setup release. .. _doxid-classxf_1_1compression_1_1xfZlib_1a6904dbfc6bf5a6f9917fb727ed5e391d: .. _cid-xf::compression::xfzlib::~xfzlib: ~xfZlib ------- .. ref-code-block:: cpp :class: title-code-block ~xfZlib () Release host/device memory. .. _doxid-classxf_1_1compression_1_1xfZlib_1a287855eea3200b5fb64a09bce2e19f67: .. _cid-xf::compression::xfzlib::error_code: error_code ---------- .. ref-code-block:: cpp :class: title-code-block int error_code (void) error_code of a OpenCL call .. _doxid-classxf_1_1compression_1_1xfZlib_1a334578509391cdb59adf3fc8dada79eb: .. _cid-xf::compression::xfzlib::get_checksum: get_checksum ------------ .. ref-code-block:: cpp :class: title-code-block uint32_t get_checksum (void) returns check sum value (CRC32/Adler32) .. _doxid-classxf_1_1compression_1_1xfZlib_1aa0659ec7543b798f008891b160deeed3: .. _cid-xf::compression::xfzlib::set_checksum: set_checksum ------------ .. ref-code-block:: cpp :class: title-code-block void set_checksum (uint32_t cval) set check sum value (CRC32/Adler32) .. _doxid-classxf_1_1compression_1_1xfZlib_1ac893340263a91d6429824fa68e93d39e: .. _cid-xf::compression::xfzlib::getcompresskernel: getCompressKernel ----------------- .. ref-code-block:: cpp :class: title-code-block std::string getCompressKernel (int index) get compress kernel name .. _doxid-classxf_1_1compression_1_1xfZlib_1a396520949b83c409a780da720a35ce01: .. _cid-xf::compression::xfzlib::getdecompresskernel: getDeCompressKernel ------------------- .. ref-code-block:: cpp :class: title-code-block std::string getDeCompressKernel (int index) get decompress kernel name