add USE_QAT into build_options

This commit is contained in:
jinjunzh 2024-01-08 11:05:36 -05:00
parent 14cda082d2
commit cf53d9a17c
3 changed files with 15 additions and 10 deletions

View File

@ -27,7 +27,7 @@ if (ENABLE_QAT_OUT_OF_TREE_BUILD)
${QAT_AL_INCLUDE_DIR}
${QAT_USDM_INCLUDE_DIR}
${ZSTD_LIBRARY_DIR})
target_compile_definitions(_qatzstd_plugin PRIVATE -DDEBUGLEVEL=0 PUBLIC -DENABLE_QATZSTD_COMPRESSION)
target_compile_definitions(_qatzstd_plugin PRIVATE -DDEBUGLEVEL=0 PUBLIC -DENABLE_ZSTD_QAT_CODEC)
add_library (ch_contrib::qatzstd_plugin ALIAS _qatzstd_plugin)
else () # In-tree build
message(STATUS "Intel QATZSTD in-tree build")

View File

@ -86,17 +86,21 @@ CompressionCodecZSTDQAT::CompressionCodecZSTDQAT(int level_)
cctx = ZSTD_createCCtx();
int res = QZSTD_startQatDevice();
LOG_DEBUG(log, "Initialization of ZSTD_QAT codec, status: {} ", res);
if(res == QZSTD_OK)
{
sequenceProducerState = QZSTD_createSeqProdState();
ZSTD_registerSequenceProducer(
cctx,
sequenceProducerState,
qatSequenceProducer
);
ZSTD_CCtx_setParameter(cctx, ZSTD_c_enableSeqProducerFallback, 1);
LOG_DEBUG(log, "Hardware-assisted ZSTD_QAT codec is ready!");
}
else
LOG_DEBUG(log, "Initialization of hardware-assisted ZSTD_QAT codec failed, status: {} - please refer to QZSTD_Status_e in ./contrib/QAT-ZSTD-Plugin/src/qatseqprod.h", res);
ZSTD_CCtx_setParameter(cctx, ZSTD_c_compressionLevel, level);
}

View File

@ -63,6 +63,7 @@ const char * auto_config_build[]
"USE_ORC", "@USE_ORC@",
"USE_MSGPACK", "@USE_MSGPACK@",
"USE_QPL", "@ENABLE_QPL@",
"USE_QAT", "@ENABLE_QATLIB@",
"GIT_HASH", "@GIT_HASH@",
"GIT_BRANCH", R"IRjaNsZIL9Yh7FQ4(@GIT_BRANCH@)IRjaNsZIL9Yh7FQ4",
"GIT_DATE", "@GIT_DATE@",