Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix - the failures in xzlib with libz.so of data_compression/L3/demos/libzso #131

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@Library('pipeline-library')_
FullVitisLibPipeline (branch: 'next', libname: 'Vitis_Libraries', TARGETS: 'hls_csim:hls_csynth:hls_cosim:vivado_syn:vitis_sw_emu:vitis_hw_emu:vitis_hw_build:vitis_aie_sim:vitis_aie_x86sim', TOOLVERSION: '2022.1_stable_latest')
FullVitisLibPipeline (branch: 'master', libname: 'Vitis_Libraries', TARGETS: 'hls_csim:hls_csynth:hls_cosim:vivado_syn:vitis_sw_emu:vitis_hw_emu:vitis_hw_build:vitis_aie_sim:vitis_aie_x86sim', TOOLVERSION: '2022.1_released')
2 changes: 1 addition & 1 deletion data_compression/L3/demos/libzso/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -444,5 +444,5 @@ run: xclbin lib host $(EMU_CONFIG)
ifeq ($(TARGET), $(filter $(TARGET), sw_emu hw_emu))
XCL_EMULATION_MODE=$(TARGET) ./run.sh $(EXE_FILE) $(XFLIB_DIR) $(XCLBIN_FILE)
else
./run.sh $(EXE_FILE) $(XFLIB_DIR) $(XCLBIN_DIR)
./run.sh $(EXE_FILE) $(XFLIB_DIR) $(XCLBIN_FILE)
endif
4 changes: 2 additions & 2 deletions data_compression/L3/demos/libzso/src/host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ void zlib_compress(const std::string& inFile_name) {
std::cout << "#Iterations " << num_iter;
std::cout << ", Input File: " << inFile_name;
std::cout << ", Output File: " << outFile_name << std::endl;
std::cout << "Input Size: " << input_size / MiB << "MiB ";
std::cout << " Compressed Size: " << compress_len / MiB << "MiB ";
std::cout << "Input Size: " << std::fixed << std::setprecision(2) << (float)input_size / MiB << "MiB ";
std::cout << " Compressed Size: " << std::fixed << std::setprecision(2) << (float)compress_len / MiB << "MiB ";
std::cout << " CR: " << std::fixed << std::setprecision(2) << (float)input_size / compress_len;
std::cout << " PID: " << getpid();
std::cout << " PPID: " << getppid();
Expand Down
25 changes: 14 additions & 11 deletions data_compression/common/libs/compress/gzipOCLHost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,13 @@ int gzipOCLHost::init(const std::string& binaryFileName, uint8_t m_kidx) {
// Create Command Queue
// Compress Command Queue & Kernel Setup
// OCL_CHECK(err, m_def_q = new cl::CommandQueue(*m_context, m_device, m_isProfile, &err));
if ((m_cdflow == BOTH) || (m_cdflow == COMPRESS)) {
if ((m_cdflow == BOTH) || (m_cdflow == COMP_ONLY)) {
OCL_CHECK(err,
m_def_q = new cl::CommandQueue(*m_context, m_device, CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE, &err));
}

// DeCompress Command Queue & Kernel Setup
if ((m_cdflow == BOTH) || (m_cdflow == DECOMPRESS)) {
if ((m_cdflow == BOTH) || (m_cdflow == DECOMP_ONLY)) {
for (uint8_t i = 0; i < D_COMPUTE_UNIT; i++) {
OCL_CHECK(err, m_q_dec[i] = new cl::CommandQueue(*m_context, m_device, CL_QUEUE_PROFILING_ENABLE, &err));
OCL_CHECK(err, m_q_rd[i] = new cl::CommandQueue(*m_context, m_device, CL_QUEUE_PROFILING_ENABLE, &err));
Expand All @@ -209,13 +209,18 @@ gzipOCLHost::gzipOCLHost(const std::string& binaryFileName,
enum design_flow dflow,
const int bank_id) {
m_cdflow = cd_flow;
m_zlibFlow = (enum design_flow)dflow;
m_device = device;
m_pending = 0;
m_context = context;
m_program = program;
m_islibz = true;
m_isSlaveBridge = sb_opt;
if (m_zlibFlow) m_checksum = 1;
if (m_zlibFlow) {
m_checksum = 1;
m_isZlib = true;
}

if (m_cdflow == COMP_ONLY)
m_kidx = 1;
else
Expand Down Expand Up @@ -306,16 +311,16 @@ gzipOCLHost::gzipOCLHost(enum State flow,
return;
}

if ((m_cdflow == BOTH) || (m_cdflow == COMPRESS)) {
if ((m_cdflow == BOTH) || (m_cdflow == COMP_ONLY)) {
m_memMgrCmp = new memoryManager(8, m_context, sb_opt, m_def_q);
}

if ((m_cdflow == BOTH) || (m_cdflow == DECOMPRESS)) {
if ((m_cdflow == BOTH) || (m_cdflow == DECOMP_ONLY)) {
m_memMgrDecMM2S = new memoryManager(8, m_context, sb_opt, m_rd_q);
m_memMgrDecS2MM = new memoryManager(8, m_context, sb_opt, m_wr_q);
}

if ((m_cdflow == BOTH) || (m_cdflow == COMPRESS)) {
if ((m_cdflow == BOTH) || (m_cdflow == COMP_ONLY)) {
if (isSlaveBridge()) {
h_buf_checksum = (uint32_t*)m_memMgrCmp->create_host_buffer(CL_MEM_READ_WRITE, sizeof(uint32_t),
&(buffer_checksum_data));
Expand All @@ -335,7 +340,7 @@ gzipOCLHost::gzipOCLHost(enum State flow,
}
}

if ((m_cdflow == BOTH) || (m_cdflow == DECOMPRESS)) {
if ((m_cdflow == BOTH) || (m_cdflow == DECOMP_ONLY)) {
// Decompression host buffer allocation
for (int j = 0; j < DIN_BUFFERCOUNT; ++j)
MEM_ALLOC_CHECK(h_dbufstream_in[j].resize(INPUT_BUFFER_SIZE), INPUT_BUFFER_SIZE, "Input Buffer");
Expand Down Expand Up @@ -1350,9 +1355,7 @@ size_t gzipOCLHost::deflate_buffer(
cl_int err;
std::string compress_kname;
if (m_compressFullKernel == NULL) {
// Random: Use kernel name directly and let XRT
// decide the CU connection based on HBM bank
compress_kname = compress_kernel_names[1];
compress_kname = compress_kernel_names[2];
OCL_CHECK(err, m_compressFullKernel = new cl::Kernel(*m_program, compress_kname.c_str(), &err));
initialize_checksum = true;
}
Expand Down Expand Up @@ -1443,7 +1446,7 @@ size_t gzipOCLHost::deflate_buffer(
&(buffer->rd_event)));
cl_int err;
OCL_CHECK(err, err = buffer->rd_event.setCallback(CL_COMPLETE, event_compress_cb, (void*)buffer));
input_size = 0;
// input_size = 0;
actionDone = true;
}
}
Expand Down