Skip to content

[fix] fix dispatch table copy #24

New issue

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

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

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: develop
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
4 changes: 2 additions & 2 deletions sources/middle-layer/analytics/expand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ static inline auto expand(input_stream_t &input_stream,
output_stream_t<array_stream> &output_stream,
core_sw::dispatcher::aggregates_function_ptr_t aggregates_callback,
aggregates_t &aggregates) noexcept -> uint32_t {
const auto table = core_sw::dispatcher::kernels_dispatcher::get_instance().get_expand_table();
const auto &table = core_sw::dispatcher::kernels_dispatcher::get_instance().get_expand_table();
const auto index = core_sw::dispatcher::get_expand_index(input_stream.bit_width());
const auto expand_impl = table[index];

Expand Down Expand Up @@ -115,7 +115,7 @@ auto call_expand<execution_path_t::software>(input_stream_t &input_stream,
limited_buffer_t &output_buffer,
int32_t UNREFERENCED_PARAMETER(numa_id)) noexcept -> analytic_operation_result_t {
// Get required aggregates kernel
auto aggregates_table = core_sw::dispatcher::kernels_dispatcher::get_instance().get_aggregates_table();
auto &aggregates_table = core_sw::dispatcher::kernels_dispatcher::get_instance().get_aggregates_table();
auto aggregates_index = core_sw::dispatcher::get_aggregates_index(1u);
auto aggregates_callback = (input_stream.are_aggregates_disabled()) ?
&aggregates_empty_callback :
Expand Down
6 changes: 3 additions & 3 deletions sources/middle-layer/analytics/extract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ static inline auto extract(input_stream_t &input_stream,
aggregates_t &aggregates,
const uint32_t param_low,
const uint32_t param_high) noexcept -> uint32_t {
auto table = core_sw::dispatcher::kernels_dispatcher::get_instance().get_extract_i_table();
auto &table = core_sw::dispatcher::kernels_dispatcher::get_instance().get_extract_i_table();
uint32_t index = core_sw::dispatcher::get_extract_index(input_stream.bit_width());
auto extract_impl = table[index];

Expand Down Expand Up @@ -155,7 +155,7 @@ auto call_extract<execution_path_t::software>(input_stream_t &input_stream,
uint32_t input_bit_width = input_stream.bit_width();
uint32_t status_code = status_list::ok;

auto aggregates_table = core_sw::dispatcher::kernels_dispatcher::get_instance().get_aggregates_table();
auto &aggregates_table = core_sw::dispatcher::kernels_dispatcher::get_instance().get_aggregates_table();
auto aggregates_index = core_sw::dispatcher::get_aggregates_index(input_bit_width);
auto aggregates_callback = (input_stream.are_aggregates_disabled()) ?
&aggregates_empty_callback :
Expand All @@ -164,7 +164,7 @@ auto call_extract<execution_path_t::software>(input_stream_t &input_stream,
if ((input_bit_width == 8u || input_bit_width == 16u || input_bit_width == 32u) &&
input_stream.stream_format() == stream_format_t::le_format &&
!input_stream.is_compressed()) {
auto extract_table = core_sw::dispatcher::kernels_dispatcher::get_instance().get_extract_table();
auto &extract_table = core_sw::dispatcher::kernels_dispatcher::get_instance().get_extract_table();
uint32_t extract_index = core_sw::dispatcher::get_extract_index(input_bit_width);
auto extract_kernel = extract_table[extract_index];

Expand Down
4 changes: 2 additions & 2 deletions sources/middle-layer/analytics/input_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ auto input_stream_t::unpack<analytic_pipeline::inflate_prle>(limited_buffer_t &o
}

auto input_stream_t::initialize_sw_kernels() noexcept -> void {
auto unpack_table = core_sw::dispatcher::kernels_dispatcher::get_instance().get_unpack_table();
auto unpack_prle_table = core_sw::dispatcher::kernels_dispatcher::get_instance().get_unpack_prle_table();
auto &unpack_table = core_sw::dispatcher::kernels_dispatcher::get_instance().get_unpack_table();
auto &unpack_prle_table = core_sw::dispatcher::kernels_dispatcher::get_instance().get_unpack_prle_table();

uint32_t is_stream_be = (stream_format_ == stream_format_t::be_format) ? 1 : 0;

Expand Down
2 changes: 1 addition & 1 deletion sources/middle-layer/analytics/output_stream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class output_stream_t<stream_type>::builder {
stream_.destination_current_ptr_ = stream_.data();

if constexpr(path == execution_path_t::software || path == execution_path_t::auto_detect) {
auto pack_table = core_sw::dispatcher::kernels_dispatcher::get_instance().get_pack_index_table();
auto &pack_table = core_sw::dispatcher::kernels_dispatcher::get_instance().get_pack_index_table();
stream_.capacity_ = (std::distance(stream_.begin(), stream_.end()) * byte_bits_size)
/ stream_.actual_bit_width_;

Expand Down
6 changes: 3 additions & 3 deletions sources/middle-layer/analytics/scan.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static inline auto scan(input_stream_t &input_stream,
aggregates_t &aggregates,
uint32_t param_low,
uint32_t param_high) noexcept -> uint32_t {
auto table = core_sw::dispatcher::kernels_dispatcher::get_instance().get_scan_i_table();
auto &table = core_sw::dispatcher::kernels_dispatcher::get_instance().get_scan_i_table();
auto index = core_sw::dispatcher::get_scan_index(input_stream.bit_width(), static_cast<uint32_t>(comparator));
auto scan_impl = table[index];

Expand Down Expand Up @@ -145,7 +145,7 @@ static inline auto call_scan_sw(input_stream_t &input_stream,
auto corrected_param_low = correct_input_param(input_bit_width, param_low);
auto corrected_param_high = correct_input_param(input_bit_width, param_high);

auto aggregates_table = core_sw::dispatcher::kernels_dispatcher::get_instance().get_aggregates_table();
auto &aggregates_table = core_sw::dispatcher::kernels_dispatcher::get_instance().get_aggregates_table();
auto aggregates_index = core_sw::dispatcher::get_aggregates_index(1u);
auto aggregates_callback = (input_stream.are_aggregates_disabled()) ?
&aggregates_empty_callback :
Expand All @@ -155,7 +155,7 @@ static inline auto call_scan_sw(input_stream_t &input_stream,
input_stream.stream_format() == stream_format_t::le_format &&
!input_stream.is_compressed()) {

auto scan_table = core_sw::dispatcher::kernels_dispatcher::get_instance().get_scan_table();
auto &scan_table = core_sw::dispatcher::kernels_dispatcher::get_instance().get_scan_table();
auto scan_index = core_sw::dispatcher::get_scan_index(input_bit_width, (uint32_t) comparator);
auto scan_kernel = scan_table[scan_index];

Expand Down
4 changes: 2 additions & 2 deletions sources/middle-layer/analytics/select.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ static inline auto select(input_stream_t &input_stream,
limited_buffer_t &output_buffer,
core_sw::dispatcher::aggregates_function_ptr_t aggregates_callback,
aggregates_t &aggregates) noexcept -> uint32_t {
auto table = core_sw::dispatcher::kernels_dispatcher::get_instance().get_select_table();
auto &table = core_sw::dispatcher::kernels_dispatcher::get_instance().get_select_table();
const auto index = core_sw::dispatcher::get_select_index(input_stream.bit_width());
const auto select_impl = table[index];

Expand Down Expand Up @@ -98,7 +98,7 @@ auto call_select<execution_path_t::software>(input_stream_t &input_stream,
limited_buffer_t &output_buffer,
int32_t UNREFERENCED_PARAMETER(numa_id)) noexcept -> analytic_operation_result_t {
// Get required aggregates kernel
auto aggregates_table = core_sw::dispatcher::kernels_dispatcher::get_instance().get_aggregates_table();
auto &aggregates_table = core_sw::dispatcher::kernels_dispatcher::get_instance().get_aggregates_table();
auto aggregates_index = core_sw::dispatcher::get_aggregates_index(1u);
auto aggregates_callback = (input_stream.are_aggregates_disabled()) ?
&aggregates_empty_callback :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ static inline void store_isal_deflate_header(isal_hufftables *isal_huffman_table
header_complete_byte_size += (0u == isal_huffman_table->deflate_hdr_extra_bits) ? 0u : 1u;

// Use copy kernel to copy deflate header from isal huffman tables
auto copy_kernel = core_sw::dispatcher::kernels_dispatcher::get_instance().get_memory_copy_table();
auto &copy_kernel = core_sw::dispatcher::kernels_dispatcher::get_instance().get_memory_copy_table();
copy_kernel[0]((uint8_t *) isal_huffman_table->deflate_hdr,
compression_table.get_deflate_header_data(),
header_complete_byte_size);
Expand Down Expand Up @@ -1279,4 +1279,3 @@ bool is_equal(qpl_decompression_huffman_table &table,
}

};

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ constexpr uint32_t TEST_SOURCE_SIZE = TEST_ARRAY_SIZE / 2u;
constexpr uint32_t TEST_SPAN_SIZE = TEST_ARRAY_SIZE / 4u;

static inline qplc_move_t_ptr move() {
static const auto& table = qpl::core_sw::dispatcher::kernels_dispatcher::get_instance().get_move_table();
static const auto &table = qpl::core_sw::dispatcher::kernels_dispatcher::get_instance().get_move_table();

return (qplc_move_t_ptr)table[0u];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
namespace qpl::test {

qplc_zero_t_ptr qplc_zero() {
static const auto& table = qpl::core_sw::dispatcher::kernels_dispatcher::get_instance().get_zero_table();
static const auto &table = qpl::core_sw::dispatcher::kernels_dispatcher::get_instance().get_zero_table();

return (qplc_zero_t_ptr)table[0u];
}
Expand Down