Software Acceleration Classes

enum xf::data_analytics::text::re::ErrCode

Overview

Error code enumerations. More…

// enum values

SUCCESS = 0
PATTERN_ERR = 1
MEM_ERR = 2
DEV_ERR = 3
OPCODE_ERR = 4
INSTR_NM_ERR = 5
CCLASS_NM_ERR = 6
CPGP_NM_ERR = 7

Detailed Documentation

Error code enumerations.

Enum Values

SUCCESS

RE pre-compilation success

PATTERN_ERR

Invalid RE pattern

MEM_ERR

CL buffer allocation failed

DEV_ERR

Kernel creation failed

OPCODE_ERR

Wrong OP code

INSTR_NM_ERR

Wrong number of instructions

CCLASS_NM_ERR

Wrong number of character classes

CPGP_NM_ERR

Wrong number of capturing groups

class xf::data_analytics::text::re::RegexEngine

#include "xf_data_analytics/text/regex_engine.hpp"

Overview

Offload regex match with FPGA.


Methods

RegexEngine

RegexEngine (
    const std::string& xclbin,
    const int dev_index = 0,
    const int instr_depth = 4096,
    const int char_class_num = 128,
    const int capture_grp_num = 512,
    const int msg_size = 4096,
    const int max_slice_size = 5242880,
    const int max_slice_num = 256
    )

Default constructor for loading and programming binary.

Parameters:

xclbin Path to FPGA binary.
dev_index The index of Xilinx OpenCL device.
instr_depth Max number of instructions.
char_class_num Max number of character classes.
capture_grp_num Max number of capturing groups.
msg_size Max size for each message, in number of bytes. max_slice_size Max message slice size, in number of bytes.
max_slice_num Max message slice number.

~RegexEngine

~RegexEngine ()

Default de-constructor for releasing program/command-queue/contect.

compile

ErrCode compile (std::string pattern)

Pre-compiles pattern and gives error code correspondingly.

Parameters:

pattern Input regular expression

getCpgpNm

uint32_t getCpgpNm () const

Gets the number of capturing groups for current pattern.

match

ErrCode match (
    uint32_t total_lnm,
    const uint64_t* msg_buff,
    uint32_t* offt_buff,
    uint16_t* len_buff,
    uint32_t* out_buff
    )

Prepares configurations for RegexEngineKernel , and performs the actual matching process.

Parameters:

total_lnm Total number of lines in current message block
msg_buff Buffer for saving messages line-by-line, pads white-space if not hit the boundary of 64-bit
offt_buff Buffer for saving starting address of each line, aligned with 64-bit
len_buff Buffer for saving length of each message, in byte
out_buff Buffer for saving output results including match flag & corresponding start/end offset address for each capturing group

RegexEngine

RegexEngine (
    const int instr_depth = 4096,
    const int char_class_num = 128,
    const int capture_grp_num = 512,
    const int msg_size = 4096,
    const int max_slice_size = 5242880,
    const int max_slice_num = 256
    )

Default constructor for loading and programming binary.

Parameters:

instr_depth Max number of instructions.
char_class_num Max number of character classes.
capture_grp_num Max number of capturing groups.
msg_size Max size for each message, in number of bytes. max_slice_size Max message slice size, in number of bytes.
max_slice_num Max message slice number.

class sssd_engine::DataEngineConfig

#include "data_engine_config.hpp"

Overview

generating configuration bits for CSV scanner kernel


Methods

DataEngineConfig

DataEngineConfig ()

default constructor

genConfigBits

ErrorCode genConfigBits (
    bool gzip,
    sssd_scandesc_t* sd,
    uint64_t* cfg
    )

generate configuration bits for kernel

Parameters:

gzip file under gzip or not
sd schema for describing the table
cfg kernel configurations

Returns:

error code

class sssd_engine::data_engine_sc::DataEngine

#include "data_engine_sc.hpp"

Overview

class to manage kernels on single device

// fields

std::thread run_t

Fields

std::thread run_t

thread for run data engine;

Methods

DataEngine

DataEngine (
    int t_id,
    VPP_BP& _csvInBufPool,
    VPP_BP& _cfgInBufPool,
    VPP_BP& _outBufPool,
    VPP_BP& _metaBufPool,
    VPP_CC* _cuCluster
    )

constructor of data engine. context, program, command queue are created and ready after FPGA init

Parameters:

t_id targeted device id.
_csvInBufPool input CSV buffer pool
_cfgInBufPool input configuration buffer pool
_outBufPool output result buffer pool
_metaBufPool output meta buffer pool
_cuCluster CU clusters

~DataEngine

~DataEngine ()

default deconstructor

pushRequest

void pushRequest (
    std::promise <RetObj> prom,
    std::string file_path,
    size_t size,
    uint64_t* cfg
    )

push request to queue

Parameters:

prom promise to synchronize status of execution
file_path file path
size file size
cfg pointer to configuration buffer

release

void release (char* buf)

release buffer

Parameters:

buf buffer to be released

class sssd_engine::SmartSSDCache

#include "smart_ssd_cache.hpp"

Overview

class to handle a specific SSD device


Methods

getCardNum

int getCardNum ()

get number of cards

Returns:

number of cards

SmartSSDCache

SmartSSDCache (
    const char* xclbin_path,
    int card_num,
    sssd_info_t* disks,
    FILE* log
    )

default constructor, instantiate data engine

Parameters:

xclbin_path path of xclbin
card_num number of availabe SmartSSD cards
disks information of the SSDs
log file handler for dumping the logs

~SmartSSDCache

~SmartSSDCache ()

default deconstructor

addFile

ErrorCode addFile (
    std::unique_ptr <char[]> data,
    size_t size,
    const std::string& filename
    )

store file to managed SmartSSD cards. Copy data from CPU memory to SSD cards

Parameters:

data pointer to file content in memory. Before return, the block of storage will be released
size file size
filename file to store

Returns:

success or fail status

scanFile

char* scanFile (
    const char* fname,
    sssd_scandesc_t* sd,
    ErrorCode& err
    )

scan files from managed SmartSSD cards.

Parameters:

fname file name;
sd pointer to configuration including schema, projection and filter conditions filenames.
err return the status of exectution.

Returns:

pointer the selected row. It is stored in format defined by data type in schema.

listFiles

ErrorCode listFiles (
    const char* path_pattern,
    std::vector <std::string>& file_list
    )

list all the file name that matche the path_pattern

Parameters:

path_pattern specify the path_pattern for regex
file_list store the file name that matched the path_pattern

Returns:

fail/success

release

void release (
    const char* file_path,
    char* buf_ptr
    )

release specified buffer

Parameters:

file_path path to the file
buf_ptr buffer to be released