├── .clang-format ├── .clang-tidy ├── .gitattributes ├── .github ├── pull_request_template.md └── workflows │ └── clang-format-check.yml ├── .gitignore ├── .gitmodules ├── CMakeLists.txt ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Doxyfile ├── LICENSE ├── README.md ├── SECURITY.md ├── cmake ├── CompileOptions.cmake └── overrides.cmake ├── doc ├── _get_docs.sh ├── requirements.txt └── source │ ├── conf.py │ ├── documentation │ ├── _images │ │ └── qpl_arch_diagram.png │ ├── bench_docs │ │ ├── guide.rst │ │ └── quick_start.rst │ ├── contributing_docs │ │ └── issue_reporting.rst │ ├── dev_guide_docs │ │ ├── c_use_cases │ │ │ ├── advanced │ │ │ │ ├── c_advanced_topics.rst │ │ │ │ ├── c_advanced_topics_decompress.rst │ │ │ │ └── c_advanced_topics_filter.rst │ │ │ ├── c_asynchronous_execution.rst │ │ │ ├── c_huffman_only.rst │ │ │ ├── c_job_structure.rst │ │ │ ├── c_use_huffman_tables.rst │ │ │ ├── deflate │ │ │ │ ├── c_deflate.rst │ │ │ │ ├── c_deflate_compression.rst │ │ │ │ ├── c_deflate_decompression.rst │ │ │ │ ├── c_deflate_dictionary.rst │ │ │ │ ├── c_deflate_estimate_buffer_size.rst │ │ │ │ ├── c_deflate_indexing.rst │ │ │ │ ├── c_deflate_indexing_format.rst │ │ │ │ ├── c_deflate_indexing_usage.rst │ │ │ │ ├── c_deflate_multiple_jobs.rst │ │ │ │ └── c_deflate_zlib_gzip.rst │ │ │ └── filter_ops │ │ │ │ ├── c_operations.rst │ │ │ │ ├── c_operations_aggregates.rst │ │ │ │ ├── c_operations_hw_path_optimization.rst │ │ │ │ ├── c_operations_op.rst │ │ │ │ ├── c_operations_op_crc64.rst │ │ │ │ ├── c_operations_op_expand.rst │ │ │ │ ├── c_operations_op_extract.rst │ │ │ │ ├── c_operations_op_scan.rst │ │ │ │ ├── c_operations_op_select.rst │ │ │ │ ├── c_operations_output_modification.rst │ │ │ │ └── c_operations_parsers.rst │ │ └── low_level_developer_guide.rst │ ├── dev_ref_docs │ │ ├── c_ref │ │ │ ├── c_common_definitions.rst │ │ │ ├── c_huffman_table_apis.rst │ │ │ ├── c_job_apis.rst │ │ │ ├── c_status_codes.rst │ │ │ └── c_utility_apis.rst │ │ └── low_level_api.rst │ ├── get_started_docs │ │ ├── code_examples.rst │ │ ├── compression_decompression.rst │ │ ├── filter_and_other_operations.rst │ │ ├── installation.rst │ │ ├── quick_start.rst │ │ └── testing.rst │ └── introduction_docs │ │ ├── introduction.rst │ │ └── legal.rst │ └── index.rst ├── examples ├── CMakeLists.txt └── low-level-api │ ├── CMakeLists.txt │ ├── canned_mode_example.cpp │ ├── canned_mode_with_data_example.cpp │ ├── canned_mode_with_dictionary_example.cpp │ ├── compression_example.cpp │ ├── compression_multi_chunk_example.cpp │ ├── compression_static_multi_chunk_example.cpp │ ├── compression_with_dictionary_example.cpp │ ├── crc64_cross_socket_example.cpp │ ├── crc64_example.cpp │ ├── decompression_output_overflow_example.cpp │ ├── examples_utils.hpp │ ├── expand_example.cpp │ ├── expand_with_force_array_output_mod_example.cpp │ ├── extract_example.cpp │ ├── huffman_only_example.c │ ├── mix_paths_comp_decomp_w_dict_example.cpp │ ├── scan_for_elements_in_range_example.cpp │ ├── scan_for_specific_value_example.cpp │ ├── select_example.cpp │ └── serialization_example.cpp ├── include └── qpl │ ├── c_api │ ├── defs.h │ ├── dictionary.h │ ├── huffman_table.h │ ├── index_table.h │ ├── job.h │ ├── serialization.h │ ├── statistics.h │ ├── status.h │ ├── triplet.h │ ├── utility.h │ └── version.h │ └── qpl.h ├── sources ├── CMakeLists.txt ├── c_api │ ├── CMakeLists.txt │ ├── compression_operations │ │ ├── arguments_check.hpp │ │ ├── bit_writer.c │ │ ├── bit_writer.h │ │ ├── compression_state_t.h │ │ ├── compressor.cpp │ │ ├── compressor.hpp │ │ ├── decompressor.cpp │ │ ├── dictionary.cpp │ │ ├── huffman_table.cpp │ │ ├── huffman_table.hpp │ │ ├── own_deflate_job.c │ │ ├── own_deflate_job.h │ │ ├── qpl_deflate_slow.c │ │ └── statistics.cpp │ ├── filter_operations │ │ ├── analytics_state_t.h │ │ ├── arguments_check.hpp │ │ ├── expand_job.cpp │ │ ├── extract_job.cpp │ │ ├── filter_operations.hpp │ │ ├── scan_job.cpp │ │ └── select_job.cpp │ ├── job.hpp │ ├── job_execution_api.cpp │ ├── job_initialization_api.cpp │ ├── legacy_hw_path │ │ ├── async_hw_api.h │ │ ├── hardware_state.h │ │ ├── own_ml_buffer_api.hpp │ │ ├── own_ml_submit_operation_api.hpp │ │ ├── qpl_hw_check_job.cpp │ │ ├── qpl_hw_compress_job.cpp │ │ ├── qpl_hw_get_size.c │ │ ├── qpl_hw_inflate_job.cpp │ │ └── qpl_hw_submit_job.cpp │ ├── other_operations │ │ ├── arguments_check.hpp │ │ ├── crc64.cpp │ │ └── crc64.hpp │ ├── own_checkers.h │ ├── own_defs.h │ ├── serialization │ │ └── huffman_table_serialization.cpp │ └── utils_api.cpp ├── core-iaa │ ├── CMakeLists.txt │ ├── include │ │ ├── core_deflate_api.h │ │ ├── hw_aecs_api.h │ │ ├── hw_completion_record_api.h │ │ ├── hw_configuration_driver.h │ │ ├── hw_definitions.h │ │ ├── hw_descriptors_api.h │ │ ├── hw_devices.h │ │ ├── hw_iaa_flags.h │ │ ├── hw_status.h │ │ └── libaccel_config.h │ └── sources │ │ ├── aecs │ │ ├── datatables.c │ │ ├── hw_aecs_compress.c │ │ ├── hw_aecs_decompress.c │ │ └── hw_huffman_table.c │ │ ├── bit_rev.c │ │ ├── descriptors │ │ ├── hw_analytic_descriptor_base.c │ │ ├── hw_analytic_descriptor_operations.c │ │ ├── hw_analytic_descriptor_suboperations.c │ │ ├── hw_compress_descriptor.c │ │ ├── hw_crc64_descriptor.c │ │ ├── hw_decompress_descriptor.c │ │ └── hw_descriptor.c │ │ ├── driver_loader │ │ └── hw_configuration_driver.c │ │ └── include │ │ ├── own_compress.h │ │ └── own_hw_definitions.h ├── core-sw │ ├── CMakeLists.txt │ ├── dispatcher │ │ ├── dispatcher.cpp │ │ ├── dispatcher.hpp │ │ ├── simple_memory_ops.hpp │ │ ├── simple_memory_ops_c_bind.cpp │ │ └── simple_memory_ops_c_bind.h │ ├── include │ │ ├── qplc_aggregates.h │ │ ├── qplc_api.h │ │ ├── qplc_checksum.h │ │ ├── qplc_compression_consts.h │ │ ├── qplc_defines.h │ │ ├── qplc_deflate_utils.h │ │ ├── qplc_expand.h │ │ ├── qplc_extract.h │ │ ├── qplc_huffman_table.h │ │ ├── qplc_memop.h │ │ ├── qplc_pack.h │ │ ├── qplc_scan.h │ │ ├── qplc_select.h │ │ └── qplc_unpack.h │ └── src │ │ ├── checksums │ │ ├── opt │ │ │ └── qplc_checksum_k0.h │ │ └── qplc_checksum.c │ │ ├── compression │ │ ├── deflate_hash_table.c │ │ ├── deflate_histogram.c │ │ ├── deflate_slow.c │ │ ├── deflate_slow_icf.c │ │ ├── deflate_slow_matcher.c │ │ ├── deflate_slow_utils.c │ │ ├── include │ │ │ ├── deflate_defs.h │ │ │ ├── deflate_hash_table.h │ │ │ ├── deflate_histogram.h │ │ │ ├── deflate_slow.h │ │ │ ├── deflate_slow_icf.h │ │ │ ├── deflate_slow_matcher.h │ │ │ └── deflate_slow_utils.h │ │ └── opt │ │ │ └── qplc_deflate_slow_utils_k0.h │ │ ├── data │ │ └── qplc_crc_tables.c │ │ ├── filtering │ │ ├── opt │ │ │ ├── own_scan_intrin.h │ │ │ ├── qplc_aggregates_k0.h │ │ │ ├── qplc_expand_k0.h │ │ │ ├── qplc_pack_16u_k0.h │ │ │ ├── qplc_pack_32u_k0.h │ │ │ ├── qplc_pack_8u_k0.h │ │ │ ├── qplc_pack_be_16u_k0.h │ │ │ ├── qplc_pack_idx_k0.h │ │ │ ├── qplc_scan_k0.h │ │ │ ├── qplc_select_k0.h │ │ │ ├── qplc_unpack_16u_k0.h │ │ │ ├── qplc_unpack_32u_k0.h │ │ │ ├── qplc_unpack_8u_k0.h │ │ │ ├── qplc_unpack_be_16u_k0.h │ │ │ ├── qplc_unpack_be_32u_k0.h │ │ │ └── qplc_unpack_be_8u_k0.h │ │ ├── qplc_aggregates.c │ │ ├── qplc_expand.c │ │ ├── qplc_extract.c │ │ ├── qplc_pack_16u.c │ │ ├── qplc_pack_32u.c │ │ ├── qplc_pack_8u.c │ │ ├── qplc_pack_be_16u.c │ │ ├── qplc_pack_be_32u.c │ │ ├── qplc_pack_be_8u.c │ │ ├── qplc_pack_be_idx.c │ │ ├── qplc_pack_idx.c │ │ ├── qplc_scan.c │ │ ├── qplc_select.c │ │ ├── qplc_unpack_16u.c │ │ ├── qplc_unpack_32u.c │ │ ├── qplc_unpack_8u.c │ │ ├── qplc_unpack_be_16u.c │ │ ├── qplc_unpack_be_32u.c │ │ ├── qplc_unpack_be_8u.c │ │ └── qplc_unpack_prle.c │ │ ├── include │ │ ├── own_qplc_data.h │ │ └── own_qplc_defs.h │ │ └── other │ │ ├── opt │ │ └── qplc_memop_k0.h │ │ └── qplc_memop.c ├── isal │ ├── CMakeLists.txt │ ├── crc │ │ ├── crc32_gzip_refl_by16_10.asm │ │ ├── crc32_gzip_refl_by8.asm │ │ ├── crc32_gzip_refl_by8_02.asm │ │ ├── crc32_ieee_01.asm │ │ ├── crc32_ieee_02.asm │ │ ├── crc32_ieee_by16_10.asm │ │ ├── crc32_ieee_by4.asm │ │ ├── crc32_iscsi_00.asm │ │ ├── crc32_iscsi_01.asm │ │ ├── crc32_iscsi_by16_10.asm │ │ ├── crc64_base.c │ │ ├── crc_base.c │ │ └── crc_multibinary.asm │ ├── igzip │ │ ├── adler32_avx2_4.asm │ │ ├── adler32_base.c │ │ ├── adler32_sse.asm │ │ ├── bitbuf2.asm │ │ ├── bitbuf2.h │ │ ├── data_struct2.asm │ │ ├── encode_df.c │ │ ├── encode_df.h │ │ ├── encode_df_04.asm │ │ ├── encode_df_06.asm │ │ ├── flatten_ll.c │ │ ├── flatten_ll.h │ │ ├── heap_macros.asm │ │ ├── huff_codes.c │ │ ├── huff_codes.h │ │ ├── huffman.asm │ │ ├── huffman.h │ │ ├── hufftables_c.c │ │ ├── igzip.c │ │ ├── igzip_base.c │ │ ├── igzip_body.asm │ │ ├── igzip_checksums.h │ │ ├── igzip_compare_types.asm │ │ ├── igzip_decode_block_stateless.asm │ │ ├── igzip_decode_block_stateless_01.asm │ │ ├── igzip_decode_block_stateless_04.asm │ │ ├── igzip_deflate_hash.asm │ │ ├── igzip_finish.asm │ │ ├── igzip_gen_icf_map_lh1_04.asm │ │ ├── igzip_gen_icf_map_lh1_06.asm │ │ ├── igzip_icf_base.c │ │ ├── igzip_icf_body.c │ │ ├── igzip_icf_body_h1_gr_bt.asm │ │ ├── igzip_icf_finish.asm │ │ ├── igzip_inflate.c │ │ ├── igzip_inflate_multibinary.asm │ │ ├── igzip_level_buf_structs.h │ │ ├── igzip_multibinary.asm │ │ ├── igzip_set_long_icf_fg_04.asm │ │ ├── igzip_set_long_icf_fg_06.asm │ │ ├── igzip_update_histogram.asm │ │ ├── igzip_update_histogram_01.asm │ │ ├── igzip_update_histogram_04.asm │ │ ├── igzip_wrapper.h │ │ ├── inflate_data_structs.asm │ │ ├── lz0a_const.asm │ │ ├── options.asm │ │ ├── proc_heap.asm │ │ ├── repeated_char_result.h │ │ ├── rfc1951_lookup.asm │ │ ├── static_inflate.h │ │ └── stdmac.asm │ └── include │ │ ├── crc.h │ │ ├── crc64.h │ │ ├── igzip_lib.h │ │ ├── multibinary.asm │ │ ├── reg_sizes.asm │ │ └── unaligned.h └── middle-layer │ ├── CMakeLists.txt │ ├── accelerator │ ├── context.cpp │ ├── enqueue.cpp │ └── hw_accelerator_api.h │ ├── analytics │ ├── analytics_defs.hpp │ ├── descriptor_builder.hpp │ ├── expand.cpp │ ├── expand.hpp │ ├── extract.cpp │ ├── extract.hpp │ ├── input_stream.cpp │ ├── input_stream.hpp │ ├── output_stream.cpp │ ├── output_stream.hpp │ ├── scan.hpp │ ├── select.cpp │ └── select.hpp │ ├── common │ ├── allocation_buffer_t.hpp │ ├── bit_buffer.cpp │ ├── bit_buffer.hpp │ ├── bit_reverse.hpp │ ├── buffer.cpp │ ├── buffer.hpp │ ├── defs.hpp │ ├── limited_buffer.cpp │ ├── limited_buffer.hpp │ └── linear_allocator.hpp │ ├── compression │ ├── compression_defs.hpp │ ├── deflate │ │ ├── compression_units │ │ │ ├── auxiliary_units.cpp │ │ │ ├── auxiliary_units.hpp │ │ │ ├── compression_units.cpp │ │ │ ├── compression_units.hpp │ │ │ ├── icf_units.cpp │ │ │ ├── icf_units.hpp │ │ │ ├── stored_block_units.cpp │ │ │ └── stored_block_units.hpp │ │ ├── containers │ │ │ ├── huffman_table.cpp │ │ │ ├── huffman_table.hpp │ │ │ ├── index_table.cpp │ │ │ └── index_table.hpp │ │ ├── deflate.cpp │ │ ├── deflate.hpp │ │ ├── histogram.cpp │ │ ├── histogram.hpp │ │ ├── implementations │ │ │ ├── deflate_implementation.hpp │ │ │ ├── implementation.hpp │ │ │ └── implementation_presets.hpp │ │ ├── streams │ │ │ ├── compression_stream.cpp │ │ │ ├── compression_stream.hpp │ │ │ ├── compression_stream_builder.cpp │ │ │ ├── deflate_state_builder.hpp │ │ │ ├── hw_deflate_state.hpp │ │ │ ├── sw_compression_stream.cpp │ │ │ └── sw_deflate_state.hpp │ │ └── utils │ │ │ ├── compression_defs.hpp │ │ │ ├── compression_traits.hpp │ │ │ ├── fixed_huffman_table.hpp │ │ │ ├── huffman_table_utils.cpp │ │ │ └── huffman_table_utils.hpp │ ├── dictionary │ │ ├── dictionary_defs.hpp │ │ ├── dictionary_utils.cpp │ │ └── dictionary_utils.hpp │ ├── huffman_only │ │ ├── huffman_only.hpp │ │ ├── huffman_only_compression.cpp │ │ ├── huffman_only_compression_state.hpp │ │ ├── huffman_only_compression_state_builder.hpp │ │ ├── huffman_only_decompression.cpp │ │ ├── huffman_only_decompression_state.hpp │ │ ├── huffman_only_implementation.hpp │ │ ├── huffman_only_traits.hpp │ │ ├── huffman_only_units.cpp │ │ └── huffman_only_units.hpp │ ├── huffman_table │ │ ├── deflate_huffman_table.cpp │ │ ├── deflate_huffman_table.hpp │ │ ├── huffman_table.cpp │ │ ├── huffman_table.hpp │ │ ├── huffman_table_utils.cpp │ │ ├── huffman_table_utils.hpp │ │ ├── inflate_huffman_table.cpp │ │ ├── inflate_huffman_table.hpp │ │ ├── serialization_utils.cpp │ │ └── serialization_utils.hpp │ ├── inflate │ │ ├── deflate_body_decompression.cpp │ │ ├── deflate_body_decompression.hpp │ │ ├── deflate_header_decompression.cpp │ │ ├── deflate_header_decompression.hpp │ │ ├── inflate.cpp │ │ ├── inflate.hpp │ │ ├── inflate_defs.hpp │ │ ├── inflate_state.hpp │ │ ├── isal_kernels_wrappers.cpp │ │ └── isal_kernels_wrappers.hpp │ ├── multitask │ │ ├── multi_task.cpp │ │ └── multi_task.hpp │ ├── stream_decorators │ │ ├── default_decorator.hpp │ │ ├── gzip_decorator.cpp │ │ ├── gzip_decorator.hpp │ │ ├── zlib_decorator.cpp │ │ └── zlib_decorator.hpp │ ├── utils.hpp │ └── verification │ │ ├── verification_defs.hpp │ │ ├── verification_state.hpp │ │ ├── verification_state_builder.hpp │ │ ├── verification_units.cpp │ │ ├── verification_units.hpp │ │ ├── verify.cpp │ │ └── verify.hpp │ ├── dispatcher │ ├── hw_device.cpp │ ├── hw_device.hpp │ ├── hw_dispatcher.cpp │ ├── hw_dispatcher.hpp │ ├── hw_queue.cpp │ ├── hw_queue.hpp │ └── queue_selector.hpp │ ├── other │ ├── crc.cpp │ ├── crc.hpp │ └── other_defs.hpp │ └── util │ ├── awaiter.cpp │ ├── awaiter.hpp │ ├── checkers.hpp │ ├── checksum.cpp │ ├── checksum.hpp │ ├── completion_record.hpp │ ├── descriptor_processing.hpp │ ├── hw_status_converting.hpp │ ├── hw_timing_util.hpp │ ├── iaa_features_checks.hpp │ ├── indexing.cpp │ ├── library_version.cpp │ ├── multi_descriptor_processing.cpp │ ├── multi_descriptor_processing.hpp │ ├── topology.cpp │ ├── topology.hpp │ └── util.hpp ├── third-party-programs.txt └── tools ├── CMakeLists.txt ├── benchmarks ├── CMakeLists.txt ├── include │ ├── cmd_decl.hpp │ ├── data_providers.hpp │ ├── details │ │ ├── measure_async.hpp │ │ ├── measure_sync.hpp │ │ └── utility.hpp │ ├── huffman_table.hpp │ ├── measure.hpp │ ├── ops │ │ ├── base.hpp │ │ ├── c_api │ │ │ ├── base.hpp │ │ │ ├── crc64.hpp │ │ │ ├── deflate.hpp │ │ │ └── inflate.hpp │ │ ├── dispatcher.hpp │ │ ├── ops.hpp │ │ ├── params.hpp │ │ └── results.hpp │ ├── types.hpp │ └── utility.hpp ├── scripts │ ├── bench_utils.py │ └── run_qpl_benchmarks.py └── src │ ├── cases │ ├── crc64.cpp │ ├── deflate.cpp │ └── inflate.cpp │ └── main.cpp ├── configs ├── 1n1d1e1w-s-n1.conf ├── 1n1d1e1w-s-n2.conf ├── 1n1d8e1w-s-n1.conf ├── 1n1d8e1w-s-n2.conf ├── 1n2d8e1w-s-n1.conf ├── 1n2d8e1w-s-n2.conf ├── 1n3d8e1w-s-n1.conf ├── 1n3d8e1w-s-n2.conf ├── 1n4d1e1w-s-n1.conf ├── 1n4d1e1w-s-n2.conf ├── 1n4d8e1w-s-n1.conf ├── 1n4d8e1w-s-n2.conf ├── 2n1d1e1w-s.conf ├── 2n1d8e1w-s.conf ├── 2n2d8e1w-s.conf ├── 2n3d8e1w-s.conf └── 2n4d8e1w-s.conf ├── pkg-config ├── CMakeLists.txt └── qpl.pc.in ├── ref ├── CMakeLists.txt ├── include │ ├── own_ref_defs.h │ ├── qpl_api_ref.h │ ├── ref_bit_rev.h │ ├── ref_checksums.h │ ├── ref_convert.h │ ├── ref_copy.h │ ├── ref_count.h │ ├── ref_mask.h │ ├── ref_min_max_sum.h │ ├── ref_prle.h │ ├── ref_scan.h │ └── ref_store.h ├── ref_bit_rev.c ├── ref_checksums.c ├── ref_convert.c ├── ref_count.c ├── ref_crc32.c ├── ref_crc64.c ├── ref_expand.c ├── ref_expand_rle.c ├── ref_extract.c ├── ref_own_copy.c ├── ref_own_min_max_sum.c ├── ref_own_scan.c ├── ref_scan.c ├── ref_select.c ├── ref_store.c └── ref_xor_checksum.c ├── scripts ├── accel_conf.py └── accel_conf.sh ├── testdata ├── file1 ├── file10 ├── file11 ├── file12 ├── file13 ├── file14 ├── file16 ├── file17 ├── file18 ├── file19 ├── file2 ├── file3 ├── file4 ├── file5 ├── file6 ├── file7 ├── file8 ├── file9 ├── gen_all_ll.bin ├── gen_all_ll.def ├── gen_large_dist.bin └── gen_large_dist.def ├── tests ├── CMakeLists.txt ├── common │ ├── CMakeLists.txt │ ├── analytic_fixture.hpp │ ├── analytic_mask_fixture.hpp │ ├── check_result.hpp │ ├── common_defs.hpp │ ├── execution_wrapper.hpp │ ├── job_helper.hpp │ ├── operation_test.hpp │ ├── run_operation.cpp │ ├── run_operation.hpp │ ├── test_cases.hpp │ ├── test_name_format.hpp │ ├── test_sources.cpp │ └── test_sources.hpp ├── cross_tests │ ├── CMakeLists.txt │ ├── base_crc_test_fixture.cpp │ ├── base_crc_test_fixture.hpp │ ├── base_cross_test_fixture.cpp │ ├── base_cross_test_fixture.hpp │ ├── canned_one_chuck_hw_vs_sw.cpp │ ├── canned_test_cases.cpp │ ├── canned_test_cases.hpp │ ├── compression_hw_vs_sw.cpp │ ├── crc32_hw_vs_sw.cpp │ ├── crc32_test_cases.cpp │ ├── crc32_test_cases.hpp │ ├── deflate_test_cases.cpp │ ├── deflate_test_cases.hpp │ ├── huffman_only_hw_vs_sw.cpp │ ├── huffman_only_test_cases.cpp │ ├── huffman_only_test_cases.hpp │ └── main.cpp ├── functional │ ├── CMakeLists.txt │ ├── algorithmic_tests │ │ ├── CMakeLists.txt │ │ └── low_level_api │ │ │ ├── aggregates.cpp │ │ │ ├── analytic_dropped_bytes.cpp │ │ │ ├── async_test.cpp │ │ │ ├── auto_path_with_hw_init_failures.cpp │ │ │ ├── canned_deflate_inflate_in_loops.cpp │ │ │ ├── checksums.cpp │ │ │ ├── crc64.cpp │ │ │ ├── deflate.cpp │ │ │ ├── deflate_canned.cpp │ │ │ ├── deflate_huffman_only.cpp │ │ │ ├── deflate_stateful.cpp │ │ │ ├── deflate_stored_block.cpp │ │ │ ├── deflate_with_page_faults.cpp │ │ │ ├── dictionary_compression.cpp │ │ │ ├── dictionary_job_reusage.cpp │ │ │ ├── dictionary_utility_functions.cpp │ │ │ ├── expand.cpp │ │ │ ├── extract.cpp │ │ │ ├── huffman_table.cpp │ │ │ ├── index.cpp │ │ │ ├── index_table.cpp │ │ │ ├── inflate.cpp │ │ │ ├── inflate_pipeline.cpp │ │ │ ├── inflate_stop_conditions.cpp │ │ │ ├── inflate_with_page_faults.cpp │ │ │ ├── job_reusage.cpp │ │ │ ├── opcfg.cpp │ │ │ ├── prle_stream.cpp │ │ │ ├── scan.cpp │ │ │ ├── select.cpp │ │ │ ├── ta_ll_common.hpp │ │ │ └── utility_triplets_functions.cpp │ ├── bad_argument_tests │ │ ├── CMakeLists.txt │ │ └── low_level_api │ │ │ ├── CRC64.cpp │ │ │ ├── deflate.cpp │ │ │ ├── dictionary.cpp │ │ │ ├── expand.cpp │ │ │ ├── extract.cpp │ │ │ ├── huffman_table.cpp │ │ │ ├── index_table.cpp │ │ │ ├── inflate.cpp │ │ │ ├── ll_public_api.cpp │ │ │ ├── scan.cpp │ │ │ ├── select.cpp │ │ │ ├── tb_ll_common.cpp │ │ │ └── tb_ll_common.hpp │ ├── main.cpp │ ├── negative_tests │ │ ├── CMakeLists.txt │ │ └── low_level_api │ │ │ ├── analytic_with_mask.cpp │ │ │ ├── analytic_without_mask.cpp │ │ │ ├── base_analytic_negative_test_fixture.hpp │ │ │ ├── deflate_errors.cpp │ │ │ ├── deflate_mix_styles.cpp │ │ │ ├── dictionary_compression.cpp │ │ │ ├── inflate_errors.cpp │ │ │ ├── opcfg.cpp │ │ │ ├── repetitive_check.cpp │ │ │ ├── scan.cpp │ │ │ ├── submission_errors.cpp │ │ │ └── tn_common.hpp │ └── unit_tests │ │ ├── CMakeLists.txt │ │ └── algorithmic │ │ ├── core_aggregates.cpp │ │ ├── core_bit_buffer.cpp │ │ ├── core_deflate_histogram.cpp │ │ ├── core_deflate_slow.cpp │ │ ├── core_expand.cpp │ │ ├── core_extract.cpp │ │ ├── core_mem_move.cpp │ │ ├── core_pack_16u.cpp │ │ ├── core_pack_32u.cpp │ │ ├── core_pack_8u.cpp │ │ ├── core_pack_be_idx.cpp │ │ ├── core_pack_idx.cpp │ │ ├── core_select.cpp │ │ ├── core_unpack_16u.cpp │ │ ├── core_unpack_32u.cpp │ │ ├── core_unpack_8u.cpp │ │ ├── core_unpack_be_16u.cpp │ │ ├── core_unpack_be_32u.cpp │ │ ├── core_unpack_be_8u.cpp │ │ ├── core_unpack_prle.cpp │ │ ├── core_zero_8u.cpp │ │ ├── deflate_stored_block.cpp │ │ ├── device_selection.cpp │ │ ├── fallback.cpp │ │ ├── get_safe_deflate_buffer_size.cpp │ │ └── t_common.hpp ├── fuzzing │ ├── CMakeLists.txt │ └── low-level-api │ │ ├── CMakeLists.txt │ │ ├── deflate_dict_fuzz_test.cpp │ │ ├── deflate_nodict_fuzz_test.cpp │ │ ├── expand_fuzz_test.cpp │ │ ├── extract_fuzz_test.cpp │ │ ├── inflate_canned_dict_fuzz_test.cpp │ │ ├── inflate_canned_nodict_fuzz_test.cpp │ │ ├── inflate_dict_fuzz_test.cpp │ │ ├── inflate_nodict_fuzz_test.cpp │ │ ├── scan_fuzz_test.cpp │ │ └── select_fuzz_test.cpp └── thread_tests │ ├── CMakeLists.txt │ ├── compressor_stress_test.cpp │ └── tt_common.hpp └── utils ├── CMakeLists.txt ├── common ├── CMakeLists.txt ├── algorithmic_dataset.cpp ├── algorithmic_dataset.hpp ├── arguments_list.hpp ├── command_line.cpp ├── command_line.hpp ├── compare_huffman_table.cpp ├── compare_huffman_table.hpp ├── compression_huffman_table.cpp ├── compression_huffman_table.hpp ├── dataset.cpp ├── dataset.hpp ├── dispatcher_checks.hpp ├── huffman_table_unique.hpp ├── iaa_features_checks.hpp ├── opcfg_checks.hpp ├── qpl_test_environment.cpp ├── qpl_test_environment.hpp ├── source_provider.cpp ├── source_provider.hpp ├── system_info.hpp ├── topology.cpp ├── topology.hpp └── util.hpp ├── generators ├── CMakeLists.txt ├── configurators │ ├── base_configurator.hpp │ ├── common_methods.cpp │ ├── common_methods.hpp │ ├── configurator.cpp │ └── rfc1951_stream │ │ ├── break_block_configurators │ │ ├── bad_distance.cpp │ │ ├── bad_distance.hpp │ │ ├── bad_stored_length.cpp │ │ ├── bad_stored_length.hpp │ │ ├── distance_before_start.cpp │ │ ├── distance_before_start.hpp │ │ ├── unallowable_d_code.cpp │ │ ├── unallowable_d_code.hpp │ │ ├── unallowable_ll_code.cpp │ │ └── unallowable_ll_code.hpp │ │ ├── break_header_configurators │ │ ├── all_zero_literal_length_codes.cpp │ │ ├── all_zero_literal_length_codes.hpp │ │ ├── big_repeat_count_d_codes.cpp │ │ ├── big_repeat_count_d_codes.hpp │ │ ├── big_repeat_count_ll_codes.cpp │ │ ├── big_repeat_count_ll_codes.h │ │ ├── cl_codes_span_single_table.cpp │ │ ├── cl_codes_span_single_table.hpp │ │ ├── first_d_16_code.cpp │ │ ├── first_d_16_code.hpp │ │ ├── first_ll_16_code.cpp │ │ ├── first_ll_16_code.hpp │ │ ├── invalid_block.cpp │ │ ├── invalid_block.hpp │ │ ├── large_header.cpp │ │ ├── large_header.hpp │ │ ├── many_distance_codes.cpp │ │ ├── many_distance_codes.hpp │ │ ├── many_distance_codes_v2.cpp │ │ ├── many_distance_codes_v2.hpp │ │ ├── many_ll_codes.cpp │ │ ├── many_ll_codes.hpp │ │ ├── no_literal_length_code.cpp │ │ ├── no_literal_length_code.hpp │ │ ├── oversubscribed_cl_tree.cpp │ │ ├── oversubscribed_cl_tree.hpp │ │ ├── oversubscribed_d_tree.cpp │ │ ├── oversubscribed_d_tree.hpp │ │ ├── oversubscribed_ll_tree.cpp │ │ ├── oversubscribed_ll_tree.hpp │ │ ├── undef_cl_code.cpp │ │ └── undefined_cl_code.hpp │ │ └── correct_stream_generators │ │ ├── canned_large_ll_table.cpp │ │ ├── canned_large_ll_table.hpp │ │ ├── canned_small_blocks.cpp │ │ ├── canned_small_blocks.hpp │ │ ├── dynamic_block_no_err.cpp │ │ ├── dynamic_block_no_err.hpp │ │ ├── fixed_block_no_err.cpp │ │ ├── fixed_block_no_err.hpp │ │ ├── huffman_only.cpp │ │ ├── huffman_only.hpp │ │ ├── stored_block_no_err.cpp │ │ └── stored_block_no_err.hpp ├── crc_generator.cpp ├── deflate_generator │ ├── bitbuffer.cpp │ ├── gen.cpp │ ├── grammar.cpp │ ├── histogram.cpp │ ├── huff_codes.cpp │ ├── huffman.cpp │ ├── include │ │ ├── bitbuffer.h │ │ ├── gen.h │ │ ├── grammar.h │ │ ├── heap_alt.h │ │ ├── histogram.h │ │ ├── huff_codes.h │ │ ├── huffman.h │ │ ├── myintrin.h │ │ ├── symbol.h │ │ └── token.h │ ├── token.cpp │ └── token_parcer.cpp ├── format_generator.hpp ├── gendefs.hpp ├── igenerator.h ├── index_table.cpp ├── index_table.hpp ├── inflate_generator.cpp ├── prle_generator.cpp ├── prle_generator.hpp ├── random_generator.cpp ├── random_generator.h └── uint_bit_stream.cpp └── hw_dispatcher ├── CMakeLists.txt ├── qpl_test_libaccel_config.h ├── test_hw_configuration_driver.c ├── test_hw_configuration_driver.h ├── test_hw_device.cpp ├── test_hw_device.hpp ├── test_hw_dispatcher.cpp ├── test_hw_dispatcher.hpp ├── test_hw_queue.cpp ├── test_hw_queue.hpp └── test_hw_status.h /.gitattributes: -------------------------------------------------------------------------------- 1 | tests/testdata/bib -crlf 2 | tests/testdata/book1 -crlf 3 | tests/testdata/book2 -crlf 4 | tests/testdata/geo -crlf 5 | tests/testdata/news -crlf 6 | tests/testdata/obj1 -crlf 7 | tests/testdata/obj2 -crlf 8 | tests/testdata/paper1 -crlf 9 | tests/testdata/paper2 -crlf 10 | tests/testdata/paper3 -crlf 11 | tests/testdata/paper4 -crlf 12 | tests/testdata/paper5 -crlf 13 | tests/testdata/paper6 -crlf 14 | tests/testdata/pic -crlf 15 | tests/testdata/progc -crlf 16 | tests/testdata/progl -crlf 17 | tests/testdata/progp -crlf 18 | tests/testdata/trans -crlf 19 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | # Description 2 | 3 | Please include a summary of the change. Please also include relevant 4 | motivation and context. See 5 | [contribution guidelines](https://github.com/intel/qpl/blob/develop/CONTRIBUTING.md) for more details. 6 | 7 | # Checklist 8 | 9 | ## All Submissions 10 | 11 | - [ ] Attached log with the results of functional testing using `software_path` and/or `hardware_path`. Required testing coverage depends on the nature of changes, e.g., changes to the API or middle-layer imply testing of both, however changes focused on `core-iaa/` only require `hardware_path`. If testing is not possible on the contributor side (e.g., due to lack of resources), please let maintainers know. More information on testing is in [Documentation](https://intel.github.io/qpl/documentation/get_started_docs/testing.html). 12 | 13 | ## New Features 14 | 15 | - [ ] Added copyrights for all new files. 16 | - [ ] Added doxygen comments for all new APIs. 17 | - [ ] Added relevant tests. 18 | - [ ] Added relevant examples and documentation (if required). 19 | 20 | ## Bug Fixes 21 | 22 | - [ ] Added relevant regression tests. 23 | - [ ] Included information on how to reproduce the issue (either in a 24 | GitHub issue or in this PR). -------------------------------------------------------------------------------- /.github/workflows/clang-format-check.yml: -------------------------------------------------------------------------------- 1 | # This workflow executes several linters on changed files based on languages used in your code base whenever 2 | # you push a code or open a pull request. 3 | # 4 | # You can adjust the behavior by modifying this file. 5 | # For more information, see: 6 | # https://github.com/github/super-linter 7 | # https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions 8 | name: "Super-Linter" 9 | 10 | on: 11 | push: 12 | branches: [ "develop" ] 13 | pull_request: 14 | branches: [ "*" ] 15 | 16 | permissions: "read-all" 17 | 18 | jobs: 19 | clang-format-check: 20 | runs-on: ${{ github.repository_owner == 'intel' && 'ubuntu-latest' || 'service' }} 21 | # Grant status permission for MULTI_STATUS 22 | permissions: 23 | contents: "read" 24 | packages: "read" 25 | statuses: "write" 26 | steps: 27 | - name: "Checkout Code" 28 | uses: "actions/checkout@v4" 29 | with: 30 | # Full git history is needed to get a proper list of changed files within `super-linter` 31 | fetch-depth: 0 32 | 33 | - name: "Validation with Super-Linter" 34 | uses: "super-linter/super-linter@v6.3.0" 35 | env: 36 | VALIDATE_ALL_CODEBASE: true 37 | VALIDATE_CLANG_FORMAT: true 38 | FILTER_REGEX_EXCLUDE: ".*tools/third_party.*" 39 | GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" 40 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /_* 2 | /*build* 3 | /*remote* 4 | doc/html/* 5 | .idea/ 6 | .vscode/ 7 | .cproject 8 | .project 9 | .settings/* 10 | /tmp 11 | /b.bat 12 | 13 | # Doc build folder 14 | doc/build 15 | 16 | # qpl tarball 17 | qpl-*.tar.*z 18 | 19 | # RPM build 20 | qpl*.rpm 21 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "tools/third-party/google-test"] 2 | path = tools/third-party/google-test 3 | url = https://github.com/google/googletest.git 4 | branch = v1.14.x 5 | [submodule "tools/third-party/benchmark"] 6 | path = tools/third-party/benchmark 7 | url = https://github.com/google/benchmark 8 | branch = main 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright(c) 2022 Intel Corporation 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | 5 | Intel® Query Processing Library (Intel® QPL) Security Policy 6 | ============================================================ 7 | 8 | Security Vulnerability Report 9 | ----------------------------- 10 | 11 | Visit [https://intel.com/security](https://intel.com/security) for information on how to report security vulnerabilities. 12 | 13 | **Do not report any security vulnerability as a regular issue in this repository.** 14 | 15 | Include the following information in your report: 16 | 17 | - Description of the security problem 18 | - Steps to reproduce the problem 19 | - Expected behavior 20 | - Environment where the problem is reproduced: OS, compiler (including version), Intel® QPL version 21 | - Any additional information that may be relevant 22 | -------------------------------------------------------------------------------- /cmake/overrides.cmake: -------------------------------------------------------------------------------- 1 | # ========================================================================== 2 | # Copyright (C) 2022 Intel Corporation 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # ========================================================================== 6 | 7 | # Variables 8 | set(CMAKE_BUILD_TYPE_INIT Release) 9 | -------------------------------------------------------------------------------- /doc/_get_docs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # ========================================================================== 3 | # Copyright (C) 2022 Intel Corporation 4 | # 5 | # SPDX-License-Identifier: MIT 6 | # ========================================================================== 7 | 8 | 9 | # Intel® Query Processing Library (Intel® QPL) documentation generation script. 10 | 11 | set -ex 12 | 13 | # This file is required for local build of Doxygen for Sphinx to use docs preview in VSCode 14 | # because of that it is targeted to src, there is no way to use preview with other location 15 | 16 | # Full path to the directory where Intel(R) QPL include folder is located, need also to strip it from Doxygen paths 17 | export PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" 18 | export DOXYGEN_OUTPUT_DIR=$PROJECT_DIR/build/doxygen_html 19 | export SPHINX_OUTPUT_DIR=$PROJECT_DIR/build/html 20 | export SPHINX_SRC_DIR=$PROJECT_DIR/source 21 | 22 | # Run Doxygen 23 | cd $PROJECT_DIR && cd .. && doxygen Doxyfile 24 | 25 | # Run Sphinx 26 | # -W - turn Sphinx warnings into errors 27 | # -keep-going - generate full documentation even if errors encountered 28 | # -n check for broken links in documentation 29 | # -b - build output format 30 | sphinx-build -W --keep-going -b html $SPHINX_SRC_DIR $SPHINX_OUTPUT_DIR 31 | -------------------------------------------------------------------------------- /doc/requirements.txt: -------------------------------------------------------------------------------- 1 | # ========================================================================== 2 | # Copyright (C) 2022 Intel Corporation 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # ========================================================================== 6 | 7 | breathe==4.36.0 8 | Sphinx==8.2.3 9 | sphinx-book-theme==1.1.4 10 | -------------------------------------------------------------------------------- /doc/source/documentation/_images/qpl_arch_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/qpl/69f72dfd2f4df6c4ef4fbd5a5aa13dd12eba511d/doc/source/documentation/_images/qpl_arch_diagram.png -------------------------------------------------------------------------------- /doc/source/documentation/dev_guide_docs/c_use_cases/advanced/c_advanced_topics.rst: -------------------------------------------------------------------------------- 1 | .. *************************************************************************** 2 | .. * Copyright (C) 2022 Intel Corporation 3 | .. * 4 | .. * SPDX-License-Identifier: MIT 5 | .. ***************************************************************************/ 6 | 7 | 8 | Advanced Topics 9 | ############### 10 | 11 | .. toctree:: 12 | :maxdepth: 1 13 | 14 | Advanced Decompress Features 15 | Advanced Filter Features 16 | -------------------------------------------------------------------------------- /doc/source/documentation/dev_guide_docs/c_use_cases/filter_ops/c_operations_hw_path_optimization.rst: -------------------------------------------------------------------------------- 1 | .. *************************************************************************** 2 | .. * Copyright (C) 2022 Intel Corporation 3 | .. * 4 | .. * SPDX-License-Identifier: MIT 5 | .. ***************************************************************************/ 6 | 7 | 8 | .. _hw_path_optimizations_reference_link: 9 | 10 | Hardware Path Optimizations 11 | ########################### 12 | 13 | The following section contains information about internal optimizations for 14 | hardware path supported by Intel® Query Processing Library (Intel® QPL). 15 | 16 | Multi-Descriptor Processing 17 | *************************** 18 | 19 | The library can split ``qpl_op_scan_*`` operation onto 20 | several sub-tasks and perform them in paralleled mode. In other words, 21 | if the following conditions are met: 22 | 23 | - This is ``qpl_op_scan_*`` operation. 24 | - Nominal bit array output, i.e. no output modifications. 25 | - Input data size is at least 32kB large. 26 | - Input is in Little- or Big-Endian format (no encoded input support). 27 | - Aggregates and checksums are disabled via appropriate flags. 28 | - No more than 1 work queue per 1 device configured. 29 | - Operation should be executed with synchronous interface 30 | :c:func:`qpl_execute_job`. 31 | 32 | .. note:: 33 | The last limitation will be removed in some of the future releases. 34 | 35 | Then the operation is auto-paralleled on the library level during 36 | execution on hardware path. This is intended to receive better 37 | performance when processing large streams. 38 | 39 | -------------------------------------------------------------------------------- /doc/source/documentation/dev_guide_docs/c_use_cases/filter_ops/c_operations_op.rst: -------------------------------------------------------------------------------- 1 | .. *************************************************************************** 2 | .. * Copyright (C) 2022 Intel Corporation 3 | .. * 4 | .. * SPDX-License-Identifier: MIT 5 | .. ***************************************************************************/ 6 | 7 | .. _c_operations_reference_link: 8 | 9 | Operations 10 | ########## 11 | 12 | .. _c_operations_table_reference_link: 13 | 14 | ======================================= ======================== =================== 15 | Operation Number of Input Streams Output Stream Type 16 | ======================================= ======================== =================== 17 | :ref:`scan_operation_reference_link` 1 Bit Vector 18 | :ref:`extract_operation_reference_link` 1 Array or Bit Vector 19 | :ref:`select_operation_reference_link` 2 Array or Bit Vector 20 | :ref:`expand_operation_reference_link` 2 Array or Bit Vector 21 | ======================================= ======================== =================== 22 | 23 | 24 | .. toctree:: 25 | :maxdepth: 4 26 | :hidden: 27 | 28 | c_operations_op_scan 29 | c_operations_op_extract 30 | c_operations_op_select 31 | c_operations_op_expand 32 | c_operations_op_crc64 33 | 34 | -------------------------------------------------------------------------------- /doc/source/documentation/dev_guide_docs/c_use_cases/filter_ops/c_operations_op_extract.rst: -------------------------------------------------------------------------------- 1 | .. *************************************************************************** 2 | .. * Copyright (C) 2022 Intel Corporation 3 | .. * 4 | .. * SPDX-License-Identifier: MIT 5 | .. ***************************************************************************/ 6 | 7 | .. _extract_operation_reference_link: 8 | 9 | Extract 10 | ####### 11 | 12 | The extract operation (or :c:member:`qpl_operation.qpl_op_extract`) 13 | outputs input elements whose indices (starting at 0) fall within the inclusive 14 | range defined by :c:member:`qpl_job.param_low` and :c:member:`qpl_job.param_high`. 15 | So if the bit width of the output is the same as the bit width of the 16 | input, then the number of output elements should be ``(param_high - param_low + 1)``. 17 | 18 | -------------------------------------------------------------------------------- /doc/source/documentation/dev_guide_docs/c_use_cases/filter_ops/c_operations_op_select.rst: -------------------------------------------------------------------------------- 1 | .. *************************************************************************** 2 | .. * Copyright (C) 2022 Intel Corporation 3 | .. * 4 | .. * SPDX-License-Identifier: MIT 5 | .. ***************************************************************************/ 6 | 7 | .. _select_operation_reference_link: 8 | 9 | Select 10 | ###### 11 | 12 | The select operation (or :c:member:`qpl_operation.qpl_op_select`) can be considered 13 | as a generalization of the :c:member:`qpl_operation.qpl_op_extract` operation 14 | (see :ref:`extract_operation_reference_link` for more information). 15 | Here, source-2 is a bit-vector that must have 16 | at least as many elements as source-1. Those source-1 items that correspond 17 | to 1-bits in source-2 will be the output. 18 | -------------------------------------------------------------------------------- /doc/source/documentation/dev_guide_docs/low_level_developer_guide.rst: -------------------------------------------------------------------------------- 1 | .. *************************************************************************** 2 | .. * Copyright (C) 2022 Intel Corporation 3 | .. * 4 | .. * SPDX-License-Identifier: MIT 5 | .. ***************************************************************************/ 6 | 7 | 8 | .. _developer_guide_low_level_reference_link: 9 | 10 | Low-Level C API Key Concepts 11 | ############################ 12 | 13 | This document provides instructions on how to use the 14 | Intel® Query Processing Library (Intel® QPL) low-level C API. 15 | 16 | .. toctree:: 17 | :maxdepth: 1 18 | 19 | c_use_cases/c_asynchronous_execution 20 | c_use_cases/c_job_structure 21 | c_use_cases/deflate/c_deflate 22 | c_use_cases/c_huffman_only 23 | c_use_cases/c_use_huffman_tables 24 | c_use_cases/filter_ops/c_operations 25 | c_use_cases/advanced/c_advanced_topics 26 | -------------------------------------------------------------------------------- /doc/source/documentation/dev_ref_docs/c_ref/c_common_definitions.rst: -------------------------------------------------------------------------------- 1 | .. *************************************************************************** 2 | .. * Copyright (C) 2022 Intel Corporation 3 | .. * 4 | .. * SPDX-License-Identifier: MIT 5 | .. ***************************************************************************/ 6 | 7 | Common Definitions 8 | ########################### 9 | 10 | Flags 11 | ***** 12 | 13 | .. doxygengroup:: QPL_FLAGS 14 | :project: Intel(R) Query Processing Library 15 | :content-only: 16 | 17 | Enums 18 | ***** 19 | 20 | .. doxygenenum:: qpl_path_t 21 | :project: Intel(R) Query Processing Library 22 | :outline: 23 | 24 | .. doxygenenum:: qpl_operation 25 | :project: Intel(R) Query Processing Library 26 | :outline: 27 | 28 | .. doxygenenum:: qpl_compression_levels 29 | :project: Intel(R) Query Processing Library 30 | 31 | .. doxygenenum:: qpl_statistics_mode 32 | :project: Intel(R) Query Processing Library 33 | 34 | .. doxygenenum:: qpl_mini_block_size 35 | :project: Intel(R) Query Processing Library 36 | :outline: 37 | 38 | .. doxygenenum:: qpl_out_format 39 | :project: Intel(R) Query Processing Library 40 | 41 | .. doxygenenum:: qpl_parser 42 | :project: Intel(R) Query Processing Library 43 | 44 | Structures 45 | ********** 46 | 47 | .. doxygenstruct:: allocator_t 48 | :project: Intel(R) Query Processing Library 49 | :members: 50 | 51 | -------------------------------------------------------------------------------- /doc/source/documentation/dev_ref_docs/c_ref/c_job_apis.rst: -------------------------------------------------------------------------------- 1 | .. *************************************************************************** 2 | .. * Copyright (C) 2022 Intel Corporation 3 | .. * 4 | .. * SPDX-License-Identifier: MIT 5 | .. ***************************************************************************/ 6 | 7 | Job APIs 8 | ######## 9 | 10 | Functions 11 | ********* 12 | 13 | .. doxygenfunction:: qpl_get_job_size 14 | :project: Intel(R) Query Processing Library 15 | 16 | .. doxygenfunction:: qpl_init_job 17 | :project: Intel(R) Query Processing Library 18 | 19 | .. doxygenfunction:: qpl_submit_job 20 | :project: Intel(R) Query Processing Library 21 | 22 | .. doxygenfunction:: qpl_check_job 23 | :project: Intel(R) Query Processing Library 24 | 25 | .. doxygenfunction:: qpl_wait_job 26 | :project: Intel(R) Query Processing Library 27 | 28 | .. doxygenfunction:: qpl_execute_job 29 | :project: Intel(R) Query Processing Library 30 | 31 | .. doxygenfunction:: qpl_fini_job 32 | :project: Intel(R) Query Processing Library 33 | 34 | 35 | Structures 36 | ********** 37 | 38 | .. doxygenstruct:: qpl_job 39 | :project: Intel(R) Query Processing Library 40 | :members: 41 | -------------------------------------------------------------------------------- /doc/source/documentation/dev_ref_docs/c_ref/c_status_codes.rst: -------------------------------------------------------------------------------- 1 | .. *************************************************************************** 2 | .. * Copyright (C) 2022 Intel Corporation 3 | .. * 4 | .. * SPDX-License-Identifier: MIT 5 | .. ***************************************************************************/ 6 | 7 | 8 | Status Codes 9 | ############ 10 | 11 | Categories and Ranges of Status Codes 12 | ************************************* 13 | 14 | .. doxygengroup:: QPL_STATUS_BASE 15 | :project: Intel(R) Query Processing Library 16 | :content-only: 17 | 18 | Internal Calculators for Status Codes 19 | ************************************* 20 | 21 | .. doxygengroup:: QPL_STATUS_CALCULATOR 22 | :project: Intel(R) Query Processing Library 23 | :content-only: 24 | 25 | Complete List of Status Codes 26 | ***************************** 27 | 28 | .. doxygenenum:: qpl_status 29 | :project: Intel(R) Query Processing Library 30 | -------------------------------------------------------------------------------- /doc/source/documentation/dev_ref_docs/c_ref/c_utility_apis.rst: -------------------------------------------------------------------------------- 1 | .. *************************************************************************** 2 | .. * Copyright (C) 2024 Intel Corporation 3 | .. * 4 | .. * SPDX-License-Identifier: MIT 5 | .. ***************************************************************************/ 6 | 7 | Utility APIs 8 | ############ 9 | 10 | Functions 11 | ********* 12 | 13 | .. doxygenfunction:: qpl_get_safe_deflate_compression_buffer_size 14 | :project: Intel(R) Query Processing Library -------------------------------------------------------------------------------- /doc/source/documentation/dev_ref_docs/low_level_api.rst: -------------------------------------------------------------------------------- 1 | .. *************************************************************************** 2 | .. * Copyright (C) 2022 Intel Corporation 3 | .. * 4 | .. * SPDX-License-Identifier: MIT 5 | .. ***************************************************************************/ 6 | 7 | 8 | .. _c_low_level_api_reference_link: 9 | 10 | Low-Level C API Key References 11 | ############################## 12 | 13 | This document describes the Intel® Query Processing Library (Intel® QPL) 14 | Low-Level C API. The document provides descriptions of the main entities 15 | and operations used. 16 | 17 | 18 | .. toctree:: 19 | :maxdepth: 4 20 | 21 | c_ref/c_job_apis 22 | c_ref/c_huffman_table_apis 23 | c_ref/c_common_definitions 24 | c_ref/c_status_codes 25 | c_ref/c_utility_apis 26 | -------------------------------------------------------------------------------- /doc/source/documentation/get_started_docs/code_examples.rst: -------------------------------------------------------------------------------- 1 | .. *************************************************************************** 2 | .. * Copyright (C) 2022 Intel Corporation 3 | .. * 4 | .. * SPDX-License-Identifier: MIT 5 | .. ***************************************************************************/ 6 | 7 | Code Examples 8 | ############# 9 | 10 | 11 | .. _code_examples_c_reference_link: 12 | 13 | Low-Level C API Examples 14 | ************************ 15 | 16 | This section contains a number of simple Low-Level C API examples, illustrating how you 17 | can use the Intel® Query Processing Library (Intel® QPL) with C or C++ code grouped by functionality. 18 | 19 | .. toctree:: 20 | :maxdepth: 2 21 | 22 | compression_decompression 23 | filter_and_other_operations 24 | -------------------------------------------------------------------------------- /doc/source/documentation/introduction_docs/legal.rst: -------------------------------------------------------------------------------- 1 | .. *************************************************************************** 2 | .. * Copyright (C) 2022 Intel Corporation 3 | .. * 4 | .. * SPDX-License-Identifier: MIT 5 | .. ***************************************************************************/ 6 | 7 | Notices and Disclaimers 8 | ####################### 9 | 10 | Intel technologies may require enabled hardware, software or service activation. 11 | 12 | No product or component can be absolutely secure. 13 | 14 | Your costs and results may vary. 15 | 16 | © Intel Corporation. Intel, the Intel logo, and other Intel marks are trademarks of 17 | Intel Corporation or its subsidiaries. 18 | Other names and brands may be claimed as the property of others. 19 | 20 | No license (express or implied, by estoppel or otherwise) to any intellectual 21 | property rights is granted by this document. 22 | 23 | The products described may contain design defects or errors known as errata 24 | which may cause the product to deviate from published specifications. 25 | Current characterized errata are available on request. 26 | 27 | Microsoft, Windows, and the Windows logo are trademarks, or registered trademarks 28 | of Microsoft Corporation in the United States and/or other countries. 29 | 30 | Java is a registered trademark of Oracle and/or its affiliates. 31 | 32 | \* Other names and brands may be claimed as the property of others. 33 | 34 | -------------------------------------------------------------------------------- /examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ========================================================================== 2 | # Copyright (C) 2022 Intel Corporation 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # ========================================================================== 6 | 7 | cmake_minimum_required(VERSION 3.15 FATAL_ERROR) 8 | project(examples VERSION 1.0 LANGUAGES C CXX) 9 | 10 | add_subdirectory(low-level-api) 11 | -------------------------------------------------------------------------------- /include/qpl/c_api/triplet.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | /* 8 | * Intel® Query Processing Library (Intel® QPL) 9 | * Job API (public C API) 10 | */ 11 | 12 | #ifndef QPL_C_API_TRIPLET_H 13 | #define QPL_C_API_TRIPLET_H 14 | 15 | #if defined(__GNUC__) || defined(__clang__) 16 | #pragma GCC visibility push(default) 17 | #endif 18 | 19 | #include 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | /** 26 | * @struct qpl_huffman_triplet 27 | * @brief Structure for intermediate representation of Huffman token 28 | */ 29 | typedef struct { 30 | uint8_t value; /**< Encoded value */ 31 | uint8_t code_length; /**< Length of Huffman code for given value */ 32 | uint16_t code; /**< Huffman code for given value */ 33 | } qpl_huffman_triplet; 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #if defined(__GNUC__) || defined(__clang__) 40 | #pragma GCC visibility pop 41 | #endif 42 | 43 | #endif //QPL_C_API_TRIPLET_H 44 | -------------------------------------------------------------------------------- /include/qpl/c_api/utility.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2024 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | /* 8 | * Intel® Query Processing Library (Intel® QPL) 9 | * Utility API (public C++ API) 10 | */ 11 | 12 | #ifndef QPL_C_API_UTILITY_H 13 | #define QPL_C_API_UTILITY_H 14 | 15 | #if defined(__GNUC__) || defined(__clang__) 16 | #pragma GCC visibility push(default) 17 | #endif 18 | 19 | #include 20 | 21 | #include "qpl/c_api/defs.h" 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | /** 28 | * @defgroup UTILITY_API Utility API 29 | * @{ 30 | */ 31 | 32 | /** 33 | * @brief Calculate the maximum buffer size for compression, compression output should not exceed this size. 34 | * 35 | * @param[in] source_size size of the input buffer 36 | * 37 | * @note This only applies to deflate compressions, Huffman Only mode is not supported. 38 | * @note When performing compression over multiple submissions, the user must call the API for each chunk of data. 39 | * @note This function does not include overhead for gzip/zlib headers and footers. 40 | * 41 | * @return uint32_t 42 | */ 43 | QPL_API(uint32_t, qpl_get_safe_deflate_compression_buffer_size, (uint32_t source_size)) 44 | 45 | /** @} */ 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #if defined(__GNUC__) || defined(__clang__) 52 | #pragma GCC visibility pop 53 | #endif 54 | 55 | #endif //QPL_C_API_UTILITY_H 56 | -------------------------------------------------------------------------------- /include/qpl/c_api/version.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | /* 8 | * Intel® Query Processing Library (Intel® QPL) 9 | * Job API (public C API) 10 | */ 11 | 12 | #ifndef QPL_C_API_VERSION_H 13 | #define QPL_C_API_VERSION_H 14 | 15 | #if defined(__GNUC__) || defined(__clang__) 16 | #pragma GCC visibility push(default) 17 | #endif 18 | 19 | #include "qpl/c_api/defs.h" 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | /** 26 | * @brief Returns a string with a version of the library 27 | */ 28 | QPL_API(const char*, qpl_get_library_version, (void)); 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | #if defined(__GNUC__) || defined(__clang__) 35 | #pragma GCC visibility pop 36 | #endif 37 | 38 | #endif //QPL_C_API_VERSION_H 39 | -------------------------------------------------------------------------------- /include/qpl/qpl.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | /* 8 | * Intel® Query Processing Library (Intel® QPL) 9 | * Job API (public C API) 10 | */ 11 | 12 | /** 13 | * @defgroup JOB_API Public API: Low-level (C) 14 | * @{ 15 | * @brief Public Intel® Query Processing Library (Intel® QPL) C API based on the @ref qpl_job structure (Job API). 16 | * @} 17 | */ 18 | 19 | #ifndef QPL_QPL_H 20 | #define QPL_QPL_H 21 | 22 | #include "c_api/defs.h" 23 | #include "c_api/index_table.h" 24 | #include "c_api/job.h" 25 | #include "c_api/utility.h" 26 | #include "c_api/version.h" 27 | 28 | #endif //QPL_QPL_H 29 | -------------------------------------------------------------------------------- /sources/c_api/compression_operations/compression_state_t.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_SOURCES_C_API_COMPRESSION_OPERATIONS_COMPRESSION_STATE_T_H 8 | #define QPL_SOURCES_C_API_COMPRESSION_OPERATIONS_COMPRESSION_STATE_T_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "igzip_lib.h" 15 | 16 | /** 17 | * @brief Compression state struct definition. 18 | * 19 | * middle_layer_compression_style is used mainly in middle-layer. 20 | * 21 | * adler32 is required for writing zlib trailer and is used to accumulate checksums 22 | * of input streams when compression in multiple chunks is used. 23 | */ 24 | typedef struct { 25 | uint32_t middle_layer_compression_style; 26 | uint32_t adler32; 27 | } own_compression_state_t; 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | 33 | #endif //QPL_SOURCES_C_API_COMPRESSION_OPERATIONS_COMPRESSION_STATE_T_H 34 | -------------------------------------------------------------------------------- /sources/c_api/compression_operations/huffman_table.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | /* 8 | * Intel® Query Processing Library (Intel® QPL) 9 | * Job API (private C API) 10 | */ 11 | 12 | #ifndef QPL_SOURCES_C_API_COMPRESSION_OPERATIONS_HUFFMAN_TABLE_HPP 13 | #define QPL_SOURCES_C_API_COMPRESSION_OPERATIONS_HUFFMAN_TABLE_HPP 14 | 15 | #include "qpl/c_api/huffman_table.h" 16 | 17 | // ml 18 | #include "compression/huffman_table/huffman_table.hpp" 19 | 20 | template 21 | auto check_huffman_table_is_correct(qpl_huffman_table_t table) { 22 | auto meta = reinterpret_cast(table); 23 | 24 | if (meta->algorithm != algorithm) { 25 | return QPL_STS_HUFFMAN_TABLE_TYPE_ERROR; 26 | } else { 27 | return QPL_STS_OK; 28 | } 29 | } 30 | 31 | template 32 | auto use_as_huffman_table(qpl_huffman_table_t table) { 33 | return reinterpret_cast*>(table); 34 | } 35 | 36 | #endif //QPL_SOURCES_C_API_COMPRESSION_OPERATIONS_HUFFMAN_TABLE_HPP 37 | -------------------------------------------------------------------------------- /sources/c_api/legacy_hw_path/async_hw_api.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_SOURCES_C_API_LEGACY_HW_PATH_ASYNC_HW_API_H 8 | #define QPL_SOURCES_C_API_LEGACY_HW_PATH_ASYNC_HW_API_H 9 | 10 | // middle-layer 11 | #include "accelerator/hw_accelerator_api.h" 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | QPL_API(qpl_status, hw_submit_job, (qpl_job * qpl_job_ptr)); 18 | 19 | QPL_API(qpl_status, hw_check_job, (qpl_job * qpl_job_ptr)); 20 | 21 | QPL_API(uint32_t, hw_get_job_size, ()); 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | 27 | #endif //QPL_SOURCES_C_API_LEGACY_HW_PATH_ASYNC_HW_API_H 28 | -------------------------------------------------------------------------------- /sources/c_api/legacy_hw_path/qpl_hw_get_size.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | /** 8 | * @date 3/23/2020 9 | * @brief @ref hw_get_job_size API implementation 10 | */ 11 | 12 | #include "hardware_state.h" 13 | #include "own_defs.h" 14 | 15 | QPL_FUN(uint32_t, hw_get_job_size, ()) { 16 | uint32_t size = 0U; 17 | 18 | size = QPL_ALIGNED_SIZE(sizeof(qpl_hw_state), QPL_DEFAULT_ALIGNMENT); 19 | 20 | return size; 21 | } 22 | -------------------------------------------------------------------------------- /sources/c_api/other_operations/arguments_check.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | /* 8 | * Intel® Query Processing Library (Intel® QPL) 9 | * Job API (public C API) 10 | */ 11 | 12 | #ifndef QPL_SOURCES_C_API_OTHER_OPERATIONS_ARGUMENTS_CHECK_HPP 13 | #define QPL_SOURCES_C_API_OTHER_OPERATIONS_ARGUMENTS_CHECK_HPP 14 | 15 | #include "job.hpp" 16 | #include "own_checkers.h" 17 | #include "util/checkers.hpp" 18 | 19 | namespace qpl::job { 20 | 21 | template <> 22 | inline qpl_status validate_operation(const qpl_job* const job_ptr) noexcept { 23 | QPL_BAD_PTR2_RET(job_ptr, job_ptr->next_in_ptr); 24 | QPL_BAD_SIZE_RET(job_ptr->available_in); 25 | 26 | if (job_ptr->crc64_poly == 0) { return QPL_STS_CRC64_BAD_POLYNOM; } 27 | 28 | return QPL_STS_OK; 29 | } 30 | 31 | } // namespace qpl::job 32 | 33 | #endif //QPL_SOURCES_C_API_OTHER_OPERATIONS_ARGUMENTS_CHECK_HPP 34 | -------------------------------------------------------------------------------- /sources/core-iaa/include/core_deflate_api.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_SOURCES_CORE_IAA_INCLUDE_CORE_DEFLATE_API_H 8 | #define QPL_SOURCES_CORE_IAA_INCLUDE_CORE_DEFLATE_API_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #define OWN_DEFLATE_LL_TABLE_SIZE 286U 15 | #define OWN_DEFLATE_D_TABLE_SIZE 30U 16 | 17 | extern const uint32_t fixed_literals_table[OWN_DEFLATE_LL_TABLE_SIZE]; 18 | 19 | extern const uint32_t fixed_offsets_table[OWN_DEFLATE_D_TABLE_SIZE]; 20 | 21 | #ifdef __cplusplus 22 | } 23 | #endif 24 | 25 | #endif //QPL_SOURCES_CORE_IAA_INCLUDE_CORE_DEFLATE_API_H 26 | -------------------------------------------------------------------------------- /sources/core-iaa/sources/descriptors/hw_analytic_descriptor_suboperations.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #include 8 | 9 | #include "hw_definitions.h" 10 | #include "hw_descriptors_api.h" 11 | #include "own_hw_definitions.h" 12 | 13 | #define OWN_MAX_BIT_IDX 7U /**< @todo */ 14 | 15 | HW_PATH_IAA_API(void, descriptor_analytic_enable_decompress, 16 | (hw_descriptor* const descriptor_ptr, bool is_big_endian_compressed_stream, 17 | uint32_t ignore_last_bits)) { 18 | hw_decompress_analytics_descriptor* const this_ptr = (hw_decompress_analytics_descriptor*)descriptor_ptr; 19 | 20 | this_ptr->decomp_flags |= ADDF_ENABLE_DECOMP | ADDF_FLUSH_OUTPUT | 21 | ADDF_IGNORE_END_BITS(ignore_last_bits & OWN_MAX_BIT_IDX) | 22 | (is_big_endian_compressed_stream ? ADDF_DECOMP_BE : 0U); 23 | } 24 | -------------------------------------------------------------------------------- /sources/core-iaa/sources/descriptors/hw_descriptor.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #include "hw_definitions.h" 8 | #include "hw_descriptors_api.h" 9 | #include "simple_memory_ops_c_bind.h" 10 | 11 | HW_PATH_IAA_API(void, descriptor_reset, (hw_descriptor* const descriptor_ptr)) { 12 | call_c_set_zeros_uint8_t((uint8_t*)descriptor_ptr, sizeof(hw_descriptor)); 13 | } 14 | 15 | HW_PATH_IAA_API(void, descriptor_set_completion_record, 16 | (hw_descriptor* const descriptor_ptr, HW_PATH_VOLATILE hw_completion_record* const completion_record)) { 17 | const uint32_t FLAG_REQ_COMP = 0x08U; 18 | const uint32_t FLAG_COMP_VALID = 0x04U; 19 | 20 | hw_decompress_analytics_descriptor* const this_ptr = (hw_decompress_analytics_descriptor*)descriptor_ptr; 21 | 22 | this_ptr->op_code_op_flags |= FLAG_REQ_COMP | FLAG_COMP_VALID; 23 | this_ptr->completion_record_ptr = (uint8_t*)completion_record; 24 | } 25 | 26 | HW_PATH_IAA_API(void, descriptor_init_noop_operation, (hw_descriptor* const descriptor_ptr)) { 27 | hw_iaa_descriptor_reset(descriptor_ptr); 28 | 29 | hw_decompress_analytics_descriptor* const this_ptr = (hw_decompress_analytics_descriptor*)descriptor_ptr; 30 | this_ptr->op_code_op_flags |= ADOF_OPCODE(QPL_OPCODE_NOOP); 31 | } 32 | -------------------------------------------------------------------------------- /sources/core-sw/dispatcher/simple_memory_ops_c_bind.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2023 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #include 8 | 9 | #include "simple_memory_ops.hpp" 10 | 11 | // C wrapper for util::copy with uint8_t type 12 | extern "C" void call_c_copy_uint8_t(const uint8_t* source, uint8_t* destination, uint32_t length) { 13 | qpl::core_sw::util::copy(source, source + length, destination); 14 | } 15 | 16 | // C wrapper for util::set_zeros with uint8_t type 17 | extern "C" void call_c_set_zeros_uint8_t(uint8_t* destination, uint32_t length) { 18 | qpl::core_sw::util::set_zeros(destination, length); 19 | } 20 | -------------------------------------------------------------------------------- /sources/core-sw/dispatcher/simple_memory_ops_c_bind.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2023 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_SOURCES_CORE_SW_DISPATCHER_SIMPLE_MEMORY_OPS_C_BIND_H 8 | #define QPL_SOURCES_CORE_SW_DISPATCHER_SIMPLE_MEMORY_OPS_C_BIND_H 9 | 10 | #include 11 | 12 | void call_c_copy_uint8_t(const uint8_t* source, uint8_t* destination, uint32_t length); 13 | void call_c_set_zeros_uint8_t(uint8_t* destination, uint32_t length); 14 | 15 | #endif //QPL_SOURCES_CORE_SW_DISPATCHER_SIMPLE_MEMORY_OPS_C_BIND_H 16 | -------------------------------------------------------------------------------- /sources/core-sw/src/compression/include/deflate_slow.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_SOURCES_CORE_SW_SRC_COMPRESSION_INCLUDE_DEFLATE_SLOW_H 8 | #define QPL_SOURCES_CORE_SW_SRC_COMPRESSION_INCLUDE_DEFLATE_SLOW_H 9 | 10 | #include "bitbuf2.h" 11 | #include "deflate_defs.h" 12 | #include "deflate_hash_table.h" 13 | #include "igzip_lib.h" 14 | #include "own_qplc_defs.h" 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | OWN_QPLC_FUN(uint32_t, slow_deflate_body, 21 | (uint8_t * current_ptr, const uint8_t* const lower_bound_ptr, const uint8_t* const upper_bound_ptr, 22 | deflate_hash_table_t* hash_table_ptr, struct isal_hufftables* huffman_tables_ptr, 23 | struct BitBuf2* bit_writer_ptr)); 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | 29 | #endif //QPL_SOURCES_CORE_SW_SRC_COMPRESSION_INCLUDE_DEFLATE_SLOW_H 30 | -------------------------------------------------------------------------------- /sources/core-sw/src/compression/include/deflate_slow_icf.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_SOURCES_CORE_SW_SRC_COMPRESSION_INCLUDE_DEFLATE_SLOW_ICF_H 8 | #define QPL_SOURCES_CORE_SW_SRC_COMPRESSION_INCLUDE_DEFLATE_SLOW_ICF_H 9 | 10 | #include "bitbuf2.h" 11 | #include "deflate_defs.h" 12 | #include "deflate_hash_table.h" 13 | #include "huff_codes.h" 14 | #include "igzip_level_buf_structs.h" 15 | #include "own_qplc_defs.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | typedef struct isal_mod_hist isal_mod_hist; 22 | 23 | OWN_QPLC_FUN(uint32_t, slow_deflate_icf_body, 24 | (uint8_t * current_ptr, const uint8_t* const lower_bound_ptr, const uint8_t* const upper_bound_ptr, 25 | deflate_hash_table_t* hash_table_ptr, isal_mod_hist* histogram_ptr, deflate_icf_stream* icf_stream_ptr)); 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | 31 | #endif //QPL_SOURCES_CORE_SW_SRC_COMPRESSION_INCLUDE_DEFLATE_SLOW_ICF_H 32 | -------------------------------------------------------------------------------- /sources/core-sw/src/compression/include/deflate_slow_matcher.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_SOURCES_CORE_SW_SRC_COMPRESSION_INCLUDE_DEFLATE_SLOW_MATCHER_H 8 | #define QPL_SOURCES_CORE_SW_SRC_COMPRESSION_INCLUDE_DEFLATE_SLOW_MATCHER_H 9 | 10 | #include 11 | 12 | #include "deflate_defs.h" 13 | #include "deflate_hash_table.h" 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | deflate_match_t get_lazy_best_match(const deflate_hash_table_t* const hash_table_ptr, 20 | const uint8_t* const lower_bound_ptr, const uint8_t* const string_ptr, 21 | const uint8_t* const upper_bound_ptr); 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | 27 | #endif // QPL_SOURCES_CORE_SW_SRC_COMPRESSION_INCLUDE_DEFLATE_SLOW_MATCHER_H 28 | -------------------------------------------------------------------------------- /sources/core-sw/src/compression/opt/qplc_deflate_slow_utils_k0.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | /* 8 | * Intel® Query Processing Library (Intel® QPL) 9 | * SW Core API (Private API) 10 | */ 11 | 12 | #ifndef QPL_SOURCES_CORE_SW_SRC_COMPRESSION_OPT_QPLC_DEFLATE_SLOW_UTILS_K0_H 13 | #define QPL_SOURCES_CORE_SW_SRC_COMPRESSION_OPT_QPLC_DEFLATE_SLOW_UTILS_K0_H 14 | 15 | #include "deflate_defs.h" 16 | #include "deflate_hash_table.h" 17 | #include "immintrin.h" 18 | #include "own_qplc_defs.h" 19 | 20 | #if PLATFORM >= K0 21 | 22 | OWN_OPT_FUN( 23 | void, k0_setup_dictionary, 24 | (uint8_t * dictionary_ptr, uint32_t dictionary_size, deflate_hash_table_t* hash_table_ptr) { 25 | uint8_t* current_ptr = dictionary_ptr; 26 | 27 | for (uint32_t index = 0; index < dictionary_size; index++) { 28 | // Variables 29 | 30 | uint32_t hash_value = 0U; 31 | 32 | hash_value = _mm_crc32_u32(0U, *((uint32_t*)current_ptr)) & hash_table_ptr->hash_mask; 33 | 34 | // Updating hash table 35 | own_deflate_hash_table_update(hash_table_ptr, index - dictionary_size, hash_value); 36 | 37 | // End of iteration 38 | current_ptr++; 39 | } 40 | }) 41 | 42 | #endif 43 | 44 | #endif //QPL_SOURCES_CORE_SW_SRC_COMPRESSION_OPT_QPLC_DEFLATE_SLOW_UTILS_K0_H 45 | -------------------------------------------------------------------------------- /sources/isal/igzip/adler32_base.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | #include 7 | #include 8 | 9 | #include "igzip_checksums.h" 10 | 11 | uint32_t qpl_adler32_base(uint32_t adler32, uint8_t* start, uint32_t length) { 12 | uint8_t *end = NULL, *next = start; 13 | uint64_t A = adler32 & 0xffff; 14 | uint64_t B = adler32 >> 16; 15 | 16 | while (length > MAX_ADLER_BUF) { 17 | end = next + MAX_ADLER_BUF; 18 | for (; next < end; next++) { 19 | A += *next; 20 | B += A; 21 | } 22 | 23 | A = A % ADLER_MOD; 24 | B = B % ADLER_MOD; 25 | length -= MAX_ADLER_BUF; 26 | } 27 | 28 | end = next + length; 29 | for (; next < end; next++) { 30 | A += *next; 31 | B += A; 32 | } 33 | 34 | A = A % ADLER_MOD; 35 | B = B % ADLER_MOD; 36 | 37 | return B << 16 | A; 38 | } 39 | -------------------------------------------------------------------------------- /sources/isal/igzip/bitbuf2.asm: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ; Copyright (C) 2022 Intel Corporation 3 | ; 4 | ; SPDX-License-Identifier: MIT 5 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 6 | 7 | %include "options.asm" 8 | %include "stdmac.asm" 9 | 10 | ; Assumes m_out_buf is a register 11 | ; Clobbers RCX 12 | ; code is clobbered 13 | ; write_bits_always m_bits, m_bit_count, code, count, m_out_buf 14 | %macro write_bits 5 15 | %define %%m_bits %1 16 | %define %%m_bit_count %2 17 | %define %%code %3 18 | %define %%count %4 19 | %define %%m_out_buf %5 20 | 21 | SHLX %%code, %%code, %%m_bit_count 22 | 23 | or %%m_bits, %%code 24 | add %%m_bit_count, %%count 25 | 26 | mov [%%m_out_buf], %%m_bits 27 | mov rcx, %%m_bit_count 28 | shr rcx, 3 ; rcx = bytes 29 | add %%m_out_buf, rcx 30 | shl rcx, 3 ; rcx = bits 31 | and %%m_bit_count, 0x7 32 | 33 | SHRX %%m_bits, %%m_bits, rcx 34 | %endm 35 | 36 | %macro write_dword 2 37 | %define %%data %1d 38 | %define %%addr %2 39 | mov [%%addr], %%data 40 | add %%addr, 4 41 | %endm 42 | -------------------------------------------------------------------------------- /sources/isal/igzip/encode_df.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #if __x86_64__ || __i386__ || _M_X64 || _M_IX86 14 | #ifdef _MSC_VER 15 | #include 16 | #else 17 | #include 18 | #endif 19 | #endif //__x86_64__ || __i386__ || _M_X64 || _M_IX86 20 | 21 | #include "bitbuf2.h" 22 | #include "encode_df.h" 23 | 24 | struct deflate_icf* qpl_encode_deflate_icf_base(struct deflate_icf* next_in, struct deflate_icf* end_in, 25 | struct BitBuf2* bb, struct hufftables_icf* hufftables) { 26 | struct huff_code lsym, dsym; 27 | 28 | while (next_in < end_in && !is_full(bb)) { 29 | lsym = hufftables->lit_len_table[next_in->lit_len]; 30 | dsym = hufftables->dist_lit_table[next_in->lit_dist]; 31 | 32 | // insert ll code, dist_code, and extra_bits 33 | write_bits_unsafe(bb, lsym.code_and_extra, lsym.length); 34 | write_bits_unsafe(bb, dsym.code, dsym.length); 35 | write_bits_unsafe(bb, next_in->dist_extra, dsym.extra_bit_count); 36 | flush_bits(bb); 37 | 38 | next_in++; 39 | } 40 | 41 | return next_in; 42 | } 43 | -------------------------------------------------------------------------------- /sources/isal/igzip/encode_df.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_SOURCES_ISAL_IGZIP_ENCODE_DF_H 8 | #define QPL_SOURCES_ISAL_IGZIP_ENCODE_DF_H 9 | 10 | #include 11 | 12 | #include "huff_codes.h" 13 | #include "igzip_lib.h" 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | /* Deflate Intermediate Compression Format */ 20 | #define LIT_LEN_BIT_COUNT 10 21 | #define LIT_LEN_MASK ((1 << LIT_LEN_BIT_COUNT) - 1) 22 | #define DIST_LIT_BIT_COUNT 9 23 | #define DIST_LIT_MASK ((1 << DIST_LIT_BIT_COUNT) - 1) 24 | #define ICF_DIST_OFFSET LIT_LEN_BIT_COUNT 25 | #define NULL_DIST_SYM 30 26 | 27 | #define LEN_START ISAL_DEF_LIT_SYMBOLS 28 | #define LEN_OFFSET (LEN_START - ISAL_DEF_MIN_MATCH) 29 | #define LEN_MAX (LEN_OFFSET + ISAL_DEF_MAX_MATCH) 30 | #define LIT_START (NULL_DIST_SYM + 1) 31 | #define ICF_CODE_LEN 32 32 | 33 | struct deflate_icf { 34 | uint32_t lit_len : LIT_LEN_BIT_COUNT; 35 | uint32_t lit_dist : DIST_LIT_BIT_COUNT; 36 | uint32_t dist_extra : ICF_CODE_LEN - DIST_LIT_BIT_COUNT - ICF_DIST_OFFSET; 37 | }; 38 | 39 | struct deflate_icf* qpl_encode_deflate_icf(struct deflate_icf* next_in, struct deflate_icf* end_in, struct BitBuf2* bb, 40 | struct hufftables_icf* hufftables); 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | #endif //QPL_SOURCES_ISAL_IGZIP_ENCODE_DF_H 45 | -------------------------------------------------------------------------------- /sources/isal/igzip/flatten_ll.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #include "flatten_ll.h" 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | void qpl_flatten_ll(uint32_t* ll_hist) { 14 | uint32_t i = 0U, j = 0U; 15 | uint32_t *s = ll_hist, x = 0U, *p = NULL; 16 | 17 | s[265] += s[266]; 18 | s[266] = s[267] + s[268]; 19 | s[267] = s[269] + s[270]; 20 | s[268] = s[271] + s[272]; 21 | s[269] = s[273] + s[274] + s[275] + s[276]; 22 | s[270] = s[277] + s[278] + s[279] + s[280]; 23 | s[271] = s[281] + s[282] + s[283] + s[284]; 24 | s[272] = s[285] + s[286] + s[287] + s[288]; 25 | p = s + 289; 26 | for (i = 273; i < 277; i++) { 27 | x = *(p++); 28 | for (j = 1; j < 8; j++) 29 | x += *(p++); 30 | s[i] = x; 31 | } 32 | for (; i < 281; i++) { 33 | x = *(p++); 34 | for (j = 1; j < 16; j++) 35 | x += *(p++); 36 | s[i] = x; 37 | } 38 | for (; i < 285; i++) { 39 | x = *(p++); 40 | for (j = 1; j < 32; j++) 41 | x += *(p++); 42 | s[i] = x; 43 | } 44 | s[284] -= s[512]; 45 | s[285] = s[512]; 46 | } 47 | -------------------------------------------------------------------------------- /sources/isal/igzip/flatten_ll.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_SOURCES_ISAL_INCLUDE_FLATTEN_LL_H 8 | #define QPL_SOURCES_ISAL_INCLUDE_FLATTEN_LL_H 9 | 10 | #include 11 | 12 | #ifdef QPL_LIB 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | #endif 17 | 18 | void qpl_flatten_ll(uint32_t* ll_hist); 19 | 20 | #ifdef QPL_LIB 21 | #ifdef __cplusplus 22 | }; // extern "C" 23 | #endif 24 | #endif 25 | 26 | #endif //QPL_SOURCES_ISAL_INCLUDE_FLATTEN_LL_H 27 | -------------------------------------------------------------------------------- /sources/isal/igzip/igzip_checksums.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_SOURCES_ISAL_IGZIP_IGZIP_CHECKSUMS_H 8 | #define QPL_SOURCES_ISAL_IGZIP_IGZIP_CHECKSUMS_H 9 | 10 | #include 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | #define MAX_ADLER_BUF (1 << 28) 17 | #define ADLER_MOD 65521 18 | 19 | uint32_t qpl_isal_adler32(uint32_t init_crc, const unsigned char* buf, //NOLINT(readability-redundant-declaration) 20 | uint64_t len); 21 | uint32_t qpl_isal_adler32_bam1(uint32_t init_crc, const unsigned char* buf, uint64_t len); 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | #endif //QPL_SOURCES_ISAL_IGZIP_IGZIP_CHECKSUMS_H 27 | -------------------------------------------------------------------------------- /sources/isal/igzip/igzip_decode_block_stateless_01.asm: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ; Copyright (C) 2022 Intel Corporation 3 | ; 4 | ; SPDX-License-Identifier: MIT 5 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 6 | 7 | %define ARCH 01 8 | 9 | %include "igzip_decode_block_stateless.asm" 10 | -------------------------------------------------------------------------------- /sources/isal/igzip/igzip_decode_block_stateless_04.asm: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ; Copyright (C) 2022 Intel Corporation 3 | ; 4 | ; SPDX-License-Identifier: MIT 5 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 6 | 7 | %define ARCH 04 8 | %define USE_HSWNI 9 | 10 | %include "igzip_decode_block_stateless.asm" 11 | -------------------------------------------------------------------------------- /sources/isal/igzip/igzip_inflate_multibinary.asm: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ; Copyright (C) 2022 Intel Corporation 3 | ; 4 | ; SPDX-License-Identifier: MIT 5 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 6 | 7 | default rel 8 | [bits 64] 9 | 10 | %include "reg_sizes.asm" 11 | 12 | extern qpl_decode_huffman_code_block_stateless_base 13 | extern qpl_decode_huffman_code_block_stateless_01 14 | extern qpl_decode_huffman_code_block_stateless_04 15 | 16 | section .text 17 | 18 | %include "multibinary.asm" 19 | 20 | 21 | mbin_interface qpl_decode_huffman_code_block_stateless 22 | mbin_dispatch_init5 qpl_decode_huffman_code_block_stateless, qpl_decode_huffman_code_block_stateless_base, qpl_decode_huffman_code_block_stateless_01, qpl_decode_huffman_code_block_stateless_01, qpl_decode_huffman_code_block_stateless_04 23 | -------------------------------------------------------------------------------- /sources/isal/igzip/igzip_update_histogram_01.asm: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ; Copyright (C) 2022 Intel Corporation 3 | ; 4 | ; SPDX-License-Identifier: MIT 5 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 6 | 7 | %define ARCH 01 8 | 9 | %ifndef COMPARE_TYPE 10 | %define COMPARE_TYPE 2 11 | %endif 12 | 13 | %include "igzip_update_histogram.asm" 14 | -------------------------------------------------------------------------------- /sources/isal/igzip/igzip_update_histogram_04.asm: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ; Copyright (C) 2022 Intel Corporation 3 | ; 4 | ; SPDX-License-Identifier: MIT 5 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 6 | 7 | %define ARCH 04 8 | %define USE_HSWNI 9 | 10 | %ifndef COMPARE_TYPE 11 | %define COMPARE_TYPE 3 12 | %endif 13 | 14 | %include "igzip_update_histogram.asm" 15 | -------------------------------------------------------------------------------- /sources/isal/igzip/igzip_wrapper.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_SOURCES_ISAL_IGZIP_IGZIP_WRAPPER_H 8 | #define QPL_SOURCES_ISAL_IGZIP_IGZIP_WRAPPER_H 9 | 10 | #define DEFLATE_METHOD 8 11 | #define ZLIB_DICT_FLAG (1 << 5) 12 | #define TEXT_FLAG (1 << 0) 13 | #define HCRC_FLAG (1 << 1) 14 | #define EXTRA_FLAG (1 << 2) 15 | #define NAME_FLAG (1 << 3) 16 | #define COMMENT_FLAG (1 << 4) 17 | #define UNDEFINED_FLAG (-1) 18 | 19 | #define GZIP_HDR_BASE 10 20 | #define GZIP_EXTRA_LEN 2 21 | #define GZIP_HCRC_LEN 2 22 | #define GZIP_TRAILER_LEN 8 23 | 24 | #define ZLIB_HDR_BASE 2 25 | #define ZLIB_DICT_LEN 4 26 | #define ZLIB_INFO_OFFSET 4 27 | #define ZLIB_LEVEL_OFFSET 6 28 | #define ZLIB_TRAILER_LEN 4 29 | 30 | #endif //QPL_SOURCES_ISAL_IGZIP_IGZIP_WRAPPER_H 31 | -------------------------------------------------------------------------------- /sources/isal/igzip/options.asm: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ; Copyright (C) 2022 Intel Corporation 3 | ; 4 | ; SPDX-License-Identifier: MIT 5 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 6 | 7 | default rel 8 | 9 | %ifndef __OPTIONS_ASM__ 10 | %define __OPTIONS_ASM__ 11 | 12 | ; Options:dir 13 | ; m - reschedule mem reads 14 | ; e b - bitbuff style 15 | ; t s x - compare style 16 | ; h - limit hash updates 17 | ; l - use longer huffman table 18 | ; f - fix cache read 19 | 20 | %ifndef IGZIP_HIST_SIZE 21 | %define IGZIP_HIST_SIZE (32 * 1024) 22 | %endif 23 | 24 | %if (IGZIP_HIST_SIZE > (32 * 1024)) 25 | %undef IGZIP_HIST_SIZE 26 | %define IGZIP_HIST_SIZE (32 * 1024) 27 | %endif 28 | 29 | %ifdef LONGER_HUFFTABLE 30 | %if (IGZIP_HIST_SIZE > 8 * 1024) 31 | %undef IGZIP_HIST_SIZE 32 | %define IGZIP_HIST_SIZE (8 * 1024) 33 | %endif 34 | %endif 35 | 36 | ; (h) limit hash update 37 | %define LIMIT_HASH_UPDATE 38 | 39 | ; (f) fix cache read problem 40 | %define FIX_CACHE_READ 41 | 42 | %define ISAL_DEF_MAX_HDR_SIZE 328 43 | 44 | %ifidn __OUTPUT_FORMAT__, elf64 45 | %ifndef __NASM_VER__ 46 | %define WRT_OPT wrt ..sym 47 | %else 48 | %define WRT_OPT 49 | %endif 50 | %else 51 | %define WRT_OPT 52 | %endif 53 | 54 | %endif ; ifndef __OPTIONS_ASM__ 55 | -------------------------------------------------------------------------------- /sources/isal/include/unaligned.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_SOURCES_ISAL_INCLUDE_UNALIGNED_H 8 | #define QPL_SOURCES_ISAL_INCLUDE_UNALIGNED_H 9 | 10 | #include "stdint.h" 11 | #include "string.h" 12 | 13 | static inline uint16_t load_u16(uint8_t* buf) { 14 | uint16_t ret = 0U; 15 | memcpy(&ret, buf, sizeof(ret)); 16 | return ret; 17 | } 18 | 19 | static inline uint32_t load_u32(uint8_t* buf) { 20 | uint32_t ret = 0U; 21 | memcpy(&ret, buf, sizeof(ret)); 22 | return ret; 23 | } 24 | 25 | static inline uint64_t load_u64(uint8_t* buf) { 26 | uint64_t ret = 0U; 27 | memcpy(&ret, buf, sizeof(ret)); 28 | return ret; 29 | } 30 | 31 | static inline uintmax_t load_umax(uint8_t* buf) { 32 | uintmax_t ret = 0U; 33 | memcpy(&ret, buf, sizeof(ret)); 34 | return ret; 35 | } 36 | 37 | static inline void store_u16(uint8_t* buf, uint16_t val) { 38 | memcpy(buf, &val, sizeof(val)); 39 | } 40 | 41 | static inline void store_u32(uint8_t* buf, uint32_t val) { 42 | memcpy(buf, &val, sizeof(val)); 43 | } 44 | 45 | static inline void store_u64(uint8_t* buf, uint64_t val) { 46 | memcpy(buf, &val, sizeof(val)); 47 | } 48 | 49 | static inline void store_umax(uint8_t* buf, uintmax_t val) { 50 | memcpy(buf, &val, sizeof(val)); 51 | } 52 | 53 | #endif //QPL_SOURCES_ISAL_INCLUDE_UNALIGNED_H 54 | -------------------------------------------------------------------------------- /sources/middle-layer/accelerator/context.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | /** 8 | * @date 3/23/2020 9 | * @brief Internal HW API functions for @ref hw_accelerator_get_context and @ref hw_accelerator_finalize API implementation 10 | * 11 | * @defgroup HW_ACCELERATOR_INIT_API Initialization API 12 | * @ingroup HW_PRIVATE_API 13 | * @{ 14 | */ 15 | 16 | #if defined(__linux__) 17 | 18 | #include "libaccel_config.h" 19 | 20 | #endif 21 | 22 | // middle-layer 23 | #include "accelerator/hw_accelerator_api.h" 24 | #include "dispatcher/hw_dispatcher.hpp" 25 | 26 | extern "C" hw_accelerator_status hw_accelerator_get_context(hw_accelerator_context* const accel_context_ptr) { 27 | static auto& dispatcher = qpl::ml::dispatcher::hw_dispatcher::get_instance(); 28 | if (!accel_context_ptr) return HW_ACCELERATOR_NULL_PTR_ERR; 29 | 30 | if (dispatcher.is_hw_support()) { 31 | dispatcher.fill_hw_context(accel_context_ptr); 32 | 33 | return HW_ACCELERATOR_STATUS_OK; 34 | } 35 | 36 | return dispatcher.get_hw_init_status(); 37 | } 38 | 39 | extern "C" hw_accelerator_status 40 | hw_accelerator_finalize(hw_accelerator_context* const UNREFERENCED_PARAMETER(accel_context_ptr)) { 41 | return HW_ACCELERATOR_STATUS_OK; 42 | } 43 | -------------------------------------------------------------------------------- /sources/middle-layer/analytics/expand.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_SOURCES_MIDDLE_LAYER_ANALYTICS_EXPAND_HPP 8 | #define QPL_SOURCES_MIDDLE_LAYER_ANALYTICS_EXPAND_HPP 9 | 10 | #include "input_stream.hpp" 11 | #include "output_stream.hpp" 12 | 13 | namespace qpl::ml::analytics { 14 | 15 | template 16 | auto call_expand(input_stream_t& input_stream, input_stream_t& mask_stream, 17 | output_stream_t& output_stream, limited_buffer_t& unpack_source_buffer, 18 | limited_buffer_t& unpack_mask_buffer, limited_buffer_t& output_buffer, int32_t numa_id = -1) noexcept 19 | -> analytic_operation_result_t; 20 | 21 | } // namespace qpl::ml::analytics 22 | 23 | #endif //QPL_SOURCES_MIDDLE_LAYER_ANALYTICS_EXPAND_HPP 24 | -------------------------------------------------------------------------------- /sources/middle-layer/analytics/extract.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_SOURCES_MIDDLE_LAYER_ANALYTICS_EXTRACT_HPP 8 | #define QPL_SOURCES_MIDDLE_LAYER_ANALYTICS_EXTRACT_HPP 9 | 10 | #include "input_stream.hpp" 11 | #include "output_stream.hpp" 12 | 13 | namespace qpl::ml::analytics { 14 | 15 | template 16 | auto call_extract(input_stream_t& input_stream, output_stream_t& output_stream, uint32_t param_low, 17 | uint32_t param_high, limited_buffer_t& temporary_buffer, int32_t numa_id = -1) noexcept 18 | -> analytic_operation_result_t; 19 | 20 | } // namespace qpl::ml::analytics 21 | 22 | #endif //QPL_SOURCES_MIDDLE_LAYER_ANALYTICS_EXTRACT_HPP 23 | -------------------------------------------------------------------------------- /sources/middle-layer/analytics/select.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_SOURCES_MIDDLE_LAYER_ANALYTICS_SELECT_HPP 8 | #define QPL_SOURCES_MIDDLE_LAYER_ANALYTICS_SELECT_HPP 9 | 10 | #include "input_stream.hpp" 11 | #include "output_stream.hpp" 12 | 13 | namespace qpl::ml::analytics { 14 | 15 | template 16 | auto call_select(input_stream_t& input_stream, input_stream_t& mask_stream, 17 | output_stream_t& output_stream, limited_buffer_t& unpack_buffer, 18 | limited_buffer_t& set_buffer, limited_buffer_t& output_buffer, int32_t numa_id = -1) noexcept 19 | -> analytic_operation_result_t; 20 | 21 | } // namespace qpl::ml::analytics 22 | 23 | #endif //QPL_SOURCES_MIDDLE_LAYER_ANALYTICS_SELECT_HPP 24 | -------------------------------------------------------------------------------- /sources/middle-layer/common/allocation_buffer_t.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | /* 8 | * Intel® Query Processing Library (Intel® QPL) 9 | * Middle Layer API (public C++ API) 10 | */ 11 | 12 | #ifndef QPL_SOURCES_MIDDLE_LAYER_COMMON_ALLOCATION_BUFFER_T_HPP 13 | #define QPL_SOURCES_MIDDLE_LAYER_COMMON_ALLOCATION_BUFFER_T_HPP 14 | 15 | #include "buffer.hpp" 16 | #include "util/util.hpp" 17 | 18 | namespace qpl::ml { 19 | 20 | class allocation_buffer_t : public buffer_t { 21 | public: 22 | template 23 | explicit allocation_buffer_t(iterator_t begin, iterator_t end) : buffer_t(begin, end), current_(&*begin) { 24 | // No actions required 25 | } 26 | 27 | [[nodiscard]] inline auto data() const noexcept -> uint8_t* override { return current_; } 28 | 29 | [[nodiscard]] inline auto capacity() const noexcept -> size_t { return std::distance(current_, buffer_t::end()); } 30 | 31 | inline auto shift_data(size_t shift_size) noexcept -> void { current_ += shift_size; } 32 | 33 | static auto empty() -> allocation_buffer_t { return {}; } 34 | 35 | private: 36 | allocation_buffer_t() noexcept = default; 37 | 38 | uint8_t* current_ = nullptr; 39 | }; 40 | 41 | } // namespace qpl::ml 42 | 43 | #endif //QPL_SOURCES_MIDDLE_LAYER_COMMON_ALLOCATION_BUFFER_T_HPP 44 | -------------------------------------------------------------------------------- /sources/middle-layer/common/buffer.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #include "buffer.hpp" 8 | 9 | namespace qpl::ml { 10 | 11 | [[nodiscard]] auto buffer_t::size() const noexcept -> uint32_t { 12 | return static_cast(std::distance(begin_, end_)); 13 | } 14 | 15 | [[nodiscard]] auto buffer_t::data() const noexcept -> uint8_t* { 16 | return begin_; 17 | } 18 | 19 | [[nodiscard]] auto buffer_t::begin() const noexcept -> uint8_t* { 20 | return begin_; 21 | } 22 | 23 | [[nodiscard]] auto buffer_t::end() const noexcept -> uint8_t* { 24 | return end_; 25 | } 26 | 27 | } // namespace qpl::ml 28 | -------------------------------------------------------------------------------- /sources/middle-layer/common/limited_buffer.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #include "limited_buffer.hpp" 8 | 9 | namespace qpl::ml { 10 | 11 | [[nodiscard]] auto limited_buffer_t::max_elements_count() const noexcept -> uint32_t { 12 | return max_elements_in_buffer_; 13 | } 14 | 15 | [[nodiscard]] auto limited_buffer_t::data() const noexcept -> uint8_t* { 16 | return buffer_t::data() + byte_shift_; 17 | } 18 | 19 | } // namespace qpl::ml 20 | -------------------------------------------------------------------------------- /sources/middle-layer/common/limited_buffer.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_SOURCES_MIDDLE_LAYER_COMMON_LIMITED_BUFFER_HPP 8 | #define QPL_SOURCES_MIDDLE_LAYER_COMMON_LIMITED_BUFFER_HPP 9 | 10 | #include "buffer.hpp" 11 | #include "util/util.hpp" 12 | 13 | namespace qpl::ml { 14 | 15 | class limited_buffer_t : public buffer_t { 16 | public: 17 | limited_buffer_t() = delete; 18 | 19 | template 20 | limited_buffer_t(iterator_t buffer_begin, iterator_t buffer_end, const uint8_t bit_width) 21 | : buffer_t(buffer_begin, buffer_end) 22 | , bit_width_(bit_width) 23 | , max_elements_in_buffer_(size() / util::bit_to_byte(util::bit_width_to_bits(bit_width_))) {} 24 | 25 | [[nodiscard]] auto max_elements_count() const noexcept -> uint32_t; 26 | 27 | [[nodiscard]] auto data() const noexcept -> uint8_t* override; 28 | 29 | inline void set_byte_shift(uint32_t byte_shift) { byte_shift_ = byte_shift; } 30 | 31 | private: 32 | uint8_t bit_width_ = byte_bits_size; 33 | uint32_t max_elements_in_buffer_ = 0; 34 | uint32_t byte_shift_ = 0; 35 | }; 36 | 37 | } // namespace qpl::ml 38 | 39 | #endif //QPL_SOURCES_MIDDLE_LAYER_COMMON_LIMITED_BUFFER_HPP 40 | -------------------------------------------------------------------------------- /sources/middle-layer/compression/deflate/deflate.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | /** 8 | * @date 8/10/2020 9 | * @brief 10 | * 11 | */ 12 | 13 | #ifndef QPL_SOURCES_MIDDLE_LAYER_COMPRESSION_DEFLATE_DEFLATE_HPP 14 | #define QPL_SOURCES_MIDDLE_LAYER_COMPRESSION_DEFLATE_DEFLATE_HPP 15 | 16 | #include 17 | #include 18 | 19 | #include "common/defs.hpp" 20 | #include "compression/compression_defs.hpp" 21 | #include "compression/deflate/utils/compression_defs.hpp" 22 | #include "compression/deflate/utils/compression_traits.hpp" 23 | 24 | namespace qpl::ml::compression { 25 | 26 | enum class deflate_mode_t : std::uint8_t { 27 | deflate_no_headers, 28 | deflate_default, 29 | }; 30 | 31 | template > 32 | auto deflate(stream_t& stream, uint8_t* begin, const uint32_t size) noexcept -> compression_operation_result_t; 33 | 34 | } // namespace qpl::ml::compression 35 | 36 | #endif //QPL_SOURCES_MIDDLE_LAYER_COMPRESSION_DEFLATE_DEFLATE_HPP 37 | -------------------------------------------------------------------------------- /sources/middle-layer/compression/deflate/histogram.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_SOURCES_MIDDLE_LAYER_COMPRESSION_DEFLATE_HISTOGRAM_HPP 8 | #define QPL_SOURCES_MIDDLE_LAYER_COMPRESSION_DEFLATE_HISTOGRAM_HPP 9 | 10 | #include 11 | 12 | #include "qpl/c_api/statistics.h" 13 | 14 | #include "common/defs.hpp" 15 | 16 | namespace qpl::ml::compression { 17 | 18 | using deflate_histogram = qpl_histogram; 19 | using deflate_level = qpl_compression_levels; 20 | 21 | template < 22 | execution_path_t path, class iterator_t, 23 | class = typename std::enable_if::type> 24 | auto update_histogram(iterator_t begin, iterator_t end, deflate_histogram& histogram, 25 | deflate_level level = qpl_default_level) noexcept -> qpl_ml_status; 26 | } // namespace qpl::ml::compression 27 | 28 | #endif //QPL_SOURCES_MIDDLE_LAYER_COMPRESSION_DEFLATE_HISTOGRAM_HPP 29 | -------------------------------------------------------------------------------- /sources/middle-layer/compression/deflate/streams/compression_stream.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #include "compression_stream.hpp" 8 | 9 | #include "util/checksum.hpp" 10 | 11 | namespace qpl::ml::compression { 12 | 13 | [[nodiscard]] auto compression_stream::bytes_written() const noexcept -> uint32_t { 14 | return bytes_written_; 15 | } 16 | 17 | [[nodiscard]] auto compression_stream::bytes_processed() const noexcept -> uint32_t { 18 | return bytes_processed_; 19 | } 20 | 21 | [[nodiscard]] auto compression_stream::compression_mode() const noexcept -> compression_mode_t { 22 | return compression_mode_; 23 | } 24 | 25 | [[nodiscard]] auto compression_stream::checksum() const noexcept -> util::checksum_accumulator { 26 | return checksum_; 27 | } 28 | 29 | [[nodiscard]] auto compression_stream::is_first_chunk() const noexcept -> bool { 30 | return chunk_type_.is_first; 31 | } 32 | 33 | [[nodiscard]] auto compression_stream::is_last_chunk() const noexcept -> bool { 34 | return chunk_type_.is_last; 35 | } 36 | 37 | [[nodiscard]] auto compression_stream::mini_block_size() const noexcept -> mini_block_size_t { 38 | return mini_block_size_; 39 | } 40 | 41 | void compression_stream::update_checksum(uint8_t* const begin, uint32_t size) noexcept { 42 | checksum_.crc32 = util::crc32_gzip(begin, begin + size, checksum_.crc32); 43 | } 44 | 45 | } // namespace qpl::ml::compression 46 | -------------------------------------------------------------------------------- /sources/middle-layer/compression/huffman_only/huffman_only_traits.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | /* 8 | * Intel® Query Processing Library (Intel® QPL) 9 | * Middle Layer API (private C++ API) 10 | */ 11 | 12 | #ifndef QPL_SOURCES_MIDDLE_LAYER_COMPRESSION_HUFFMAN_ONLY_HUFFMAN_ONLY_TRAITS_HPP 13 | #define QPL_SOURCES_MIDDLE_LAYER_COMPRESSION_HUFFMAN_ONLY_HUFFMAN_ONLY_TRAITS_HPP 14 | 15 | namespace qpl::ml::compression { 16 | 17 | template 18 | class huffman_only_state; 19 | 20 | namespace traits { 21 | template 22 | struct common_type_for_huffman_only_stream { 23 | using type = huffman_only_state; 24 | }; 25 | 26 | template <> 27 | struct common_type_for_huffman_only_stream { 28 | using type = huffman_only_state; 29 | }; 30 | 31 | template <> 32 | struct common_type_for_huffman_only_stream { 33 | using type = huffman_only_state; 34 | }; 35 | } // namespace traits 36 | } // namespace qpl::ml::compression 37 | 38 | #endif //QPL_SOURCES_MIDDLE_LAYER_COMPRESSION_HUFFMAN_ONLY_HUFFMAN_ONLY_TRAITS_HPP 39 | -------------------------------------------------------------------------------- /sources/middle-layer/compression/inflate/deflate_body_decompression.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_MIDDLE_LAYER_COMPRESSION_INFLATE_DEFLATE_BODY_DECOMPRESSION_HPP 8 | #define QPL_MIDDLE_LAYER_COMPRESSION_INFLATE_DEFLATE_BODY_DECOMPRESSION_HPP 9 | 10 | #include 11 | 12 | #include "common/defs.hpp" 13 | #include "inflate_defs.hpp" 14 | 15 | namespace qpl::ml::compression { 16 | auto decode_literal_block(isal_inflate_state& inflate_state) noexcept -> qpl_ml_status; 17 | } 18 | #endif //QPL_MIDDLE_LAYER_COMPRESSION_INFLATE_DEFLATE_BODY_DECOMPRESSION_HPP 19 | -------------------------------------------------------------------------------- /sources/middle-layer/compression/inflate/deflate_header_decompression.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_SOURCES_MIDDLE_LAYER_COMPRESSION_INFLATE_DEFLATE_HEADER_DECOMPRESSION_HPP 8 | #define QPL_SOURCES_MIDDLE_LAYER_COMPRESSION_INFLATE_DEFLATE_HEADER_DECOMPRESSION_HPP 9 | 10 | #include 11 | 12 | #include "common/defs.hpp" 13 | #include "inflate_defs.hpp" 14 | 15 | namespace qpl::ml::compression { 16 | auto read_header_stateful(isal_inflate_state& inflate_state) noexcept -> qpl_ml_status; 17 | } 18 | #endif //QPL_SOURCES_MIDDLE_LAYER_COMPRESSION_INFLATE_DEFLATE_HEADER_DECOMPRESSION_HPP 19 | -------------------------------------------------------------------------------- /sources/middle-layer/compression/inflate/inflate.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_SOURCES_MIDDLE_LAYER_COMPRESSION_INFLATE_INFLATE_HPP 8 | #define QPL_SOURCES_MIDDLE_LAYER_COMPRESSION_INFLATE_INFLATE_HPP 9 | 10 | #include 11 | 12 | #include "common/defs.hpp" 13 | #include "compression/compression_defs.hpp" 14 | #include "inflate_defs.hpp" 15 | 16 | namespace qpl::ml::compression { 17 | 18 | template 19 | auto inflate(inflate_state& decompression_state, end_processing_condition_t end_processing_condition) noexcept 20 | -> decompression_operation_result_t; 21 | 22 | } 23 | #endif //QPL_SOURCES_MIDDLE_LAYER_COMPRESSION_INFLATE_INFLATE_HPP 24 | -------------------------------------------------------------------------------- /sources/middle-layer/compression/inflate/isal_kernels_wrappers.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_SOURCES_MIDDLE_LAYER_COMPRESSION_INFLATE_ISAL_KERNELS_WRAPPERS_HPP 8 | #define QPL_SOURCES_MIDDLE_LAYER_COMPRESSION_INFLATE_ISAL_KERNELS_WRAPPERS_HPP 9 | 10 | #include 11 | 12 | #include "common/defs.hpp" 13 | 14 | typedef struct inflate_state isal_inflate_state; 15 | 16 | namespace qpl::ml::compression { 17 | namespace isal_kernels { 18 | auto read_deflate_header(isal_inflate_state& inflate_state) noexcept -> qpl_ml_status; 19 | auto decode_huffman_code_block(isal_inflate_state& inflate_state, uint8_t* start_out_ptr) noexcept -> qpl_ml_status; 20 | auto check_gzip_checksum(isal_inflate_state& inflate_state) noexcept -> qpl_ml_status; 21 | } // namespace isal_kernels 22 | } // namespace qpl::ml::compression 23 | #endif //QPL_SOURCES_MIDDLE_LAYER_COMPRESSION_INFLATE_ISAL_KERNELS_WRAPPERS_HPP 24 | -------------------------------------------------------------------------------- /sources/middle-layer/compression/multitask/multi_task.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | /* 8 | * Intel® Query Processing Library (Intel® QPL) 9 | * Middle Layer API (private C++ API) 10 | */ 11 | 12 | #ifndef QPL_SOURCES_MIDDLE_LAYER_COMPRESSION_MULTITASK_MULTI_TASK_HPP 13 | #define QPL_SOURCES_MIDDLE_LAYER_COMPRESSION_MULTITASK_MULTI_TASK_HPP 14 | 15 | #include 16 | 17 | namespace qpl::ml::util { 18 | enum multitask_status : std::uint8_t { 19 | ready = 0U, 20 | multi_chunk_in_progress = 0U, 21 | multi_chunk_last_chunk = 1U, 22 | multi_chunk_first_chunk = 2U, 23 | single_chunk_processing = 3U, 24 | }; 25 | 26 | extern std::array aecs_decompress_access_lookup_table; 27 | extern std::array aecs_verify_access_lookup_table; 28 | extern std::array aecs_compress_access_lookup_table; 29 | } // namespace qpl::ml::util 30 | 31 | #endif //QPL_SOURCES_MIDDLE_LAYER_COMPRESSION_MULTITASK_MULTI_TASK_HPP 32 | -------------------------------------------------------------------------------- /sources/middle-layer/compression/verification/verification_units.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_MIDDLE_LAYER_COMPRESSION_VERIFICATION_VERIFICATION_UNITS_HPP 8 | #define QPL_MIDDLE_LAYER_COMPRESSION_VERIFICATION_VERIFICATION_UNITS_HPP 9 | 10 | #include "compression/inflate/deflate_body_decompression.hpp" 11 | #include "compression/inflate/deflate_header_decompression.hpp" 12 | #include "compression/inflate/isal_kernels_wrappers.hpp" 13 | #include "verification_defs.hpp" 14 | #include "verification_state.hpp" 15 | 16 | namespace qpl::ml::compression { 17 | auto verify_deflate_header(verify_state& state) noexcept -> verification_result_t; 18 | 19 | auto verify_deflate_stream_body(verify_state& state) noexcept -> verification_result_t; 20 | } // namespace qpl::ml::compression 21 | #endif //QPL_MIDDLE_LAYER_COMPRESSION_VERIFICATION_VERIFICATION_UNITS_HPP 22 | -------------------------------------------------------------------------------- /sources/middle-layer/compression/verification/verify.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_SOURCES_MIDDLE_LAYER_COMPRESSION_VERIFICATION_VERIFY_HPP 8 | #define QPL_SOURCES_MIDDLE_LAYER_COMPRESSION_VERIFICATION_VERIFY_HPP 9 | 10 | #include 11 | 12 | #include "common/defs.hpp" 13 | #include "compression/deflate/containers/index_table.hpp" 14 | #include "compression/huffman_only/huffman_only_decompression_state.hpp" 15 | #include "compression/inflate/inflate_defs.hpp" 16 | #include "verification_state.hpp" 17 | 18 | namespace qpl::ml::compression { 19 | 20 | template 21 | auto perform_verification(verify_state& state) -> verification_result_t; 22 | } 23 | 24 | #endif //QPL_SOURCES_MIDDLE_LAYER_COMPRESSION_VERIFICATION_VERIFY_HPP 25 | -------------------------------------------------------------------------------- /sources/middle-layer/other/crc.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_SOURCES_MIDDLE_LAYER_OTHER_CRC_HPP 8 | #define QPL_SOURCES_MIDDLE_LAYER_OTHER_CRC_HPP 9 | 10 | #include "common/defs.hpp" 11 | #include "other/other_defs.hpp" 12 | 13 | namespace qpl::ml::other { 14 | 15 | template 16 | auto call_crc(const uint8_t* src_ptr, uint32_t length, uint64_t polynomial, bool is_be_bit_order, bool is_inverse, 17 | int32_t numa_id = -1) noexcept -> crc_operation_result_t; 18 | 19 | } // namespace qpl::ml::other 20 | 21 | #endif //QPL_SOURCES_MIDDLE_LAYER_OTHER_CRC_HPP 22 | -------------------------------------------------------------------------------- /sources/middle-layer/other/other_defs.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_SOURCES_MIDDLE_LAYER_OTHER_OTHER_DEFS_HPP 8 | #define QPL_SOURCES_MIDDLE_LAYER_OTHER_OTHER_DEFS_HPP 9 | 10 | #include 11 | 12 | namespace qpl::ml::other { 13 | 14 | struct crc_operation_result_t { 15 | uint32_t status_code_ = 0U; 16 | uint32_t processed_bytes_ = 0U; 17 | uint64_t crc_ = 0U; 18 | }; 19 | 20 | } // namespace qpl::ml::other 21 | 22 | #endif //QPL_SOURCES_MIDDLE_LAYER_OTHER_OTHER_DEFS_HPP 23 | -------------------------------------------------------------------------------- /sources/middle-layer/util/awaiter.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | /* 8 | * Intel® Query Processing Library (Intel® QPL) 9 | * Middle Layer API (private C++ API) 10 | */ 11 | 12 | #ifndef QPL_SOURCES_MIDDLE_LAYER_UTIL_AWAITER_HPP 13 | #define QPL_SOURCES_MIDDLE_LAYER_UTIL_AWAITER_HPP 14 | 15 | #include 16 | 17 | namespace qpl::ml { 18 | 19 | #define QPL_AWAITER_PERIOD_CYCLES 2000U 20 | #define QPL_AWAITER_TIMEOUT_SECONDS 8.0 21 | 22 | /** 23 | * @brief Wait function looks for changes in address until timeout time reached 24 | * 25 | * @param[in] address Pointer to memory that should be asynchronously changed 26 | * @param[in] initial_value Value to compare with 27 | * 28 | * @return none 29 | */ 30 | void wait_for(volatile uint8_t* address, uint8_t initial_value); 31 | 32 | } // namespace qpl::ml 33 | 34 | #endif //QPL_SOURCES_MIDDLE_LAYER_UTIL_AWAITER_HPP 35 | -------------------------------------------------------------------------------- /sources/middle-layer/util/hw_status_converting.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_SOURCES_MIDDLE_LAYER_UTIL_HW_STATUS_CONVERTING_HPP 8 | #define QPL_SOURCES_MIDDLE_LAYER_UTIL_HW_STATUS_CONVERTING_HPP 9 | 10 | #include "qpl/c_api/status.h" 11 | 12 | #include "hw_status.h" 13 | 14 | namespace qpl::ml::util { 15 | 16 | inline qpl_status convert_hw_accelerator_status_to_qpl_status(const uint32_t status) { 17 | switch (status) { 18 | case HW_ACCELERATOR_STATUS_OK: return QPL_STS_OK; 19 | case HW_ACCELERATOR_WQ_IS_BUSY: return QPL_STS_QUEUES_ARE_BUSY_ERR; 20 | case HW_ACCELERATOR_NULL_PTR_ERR: return QPL_STS_NULL_PTR_ERR; 21 | case HW_ACCELERATOR_SUPPORT_ERR: return QPL_STS_INIT_HW_NOT_SUPPORTED; 22 | case HW_ACCELERATOR_LIBACCEL_NOT_FOUND: return QPL_STS_INIT_LIBACCEL_NOT_FOUND; 23 | case HW_ACCELERATOR_LIBACCEL_ERROR: return QPL_STS_INIT_LIBACCEL_ERROR; 24 | case HW_ACCELERATOR_WORK_QUEUES_NOT_AVAILABLE: return QPL_STS_INIT_WORK_QUEUES_NOT_AVAILABLE; 25 | case HW_ACCELERATOR_NOT_SUPPORTED_BY_WQ: return QPL_STS_NOT_SUPPORTED_BY_WQ; 26 | case HW_ACCELERATOR_TRANSFER_SIZE_EXCEEDED: return QPL_STS_TRANSFER_SIZE_INVALID; 27 | default: return QPL_STS_LIBRARY_INTERNAL_ERR; 28 | } 29 | } 30 | 31 | } // namespace qpl::ml::util 32 | 33 | #endif //QPL_SOURCES_MIDDLE_LAYER_UTIL_HW_STATUS_CONVERTING_HPP 34 | -------------------------------------------------------------------------------- /sources/middle-layer/util/library_version.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #include "qpl/qpl.h" 8 | 9 | namespace qpl { 10 | 11 | auto get_library_version() -> const char* { 12 | return QPL_VERSION; 13 | } 14 | 15 | } // namespace qpl 16 | 17 | extern "C" const char* qpl_get_library_version() { 18 | return qpl::get_library_version(); 19 | } 20 | -------------------------------------------------------------------------------- /sources/middle-layer/util/multi_descriptor_processing.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_SOURCES_MIDDLE_LAYER_UTIL_MULTI_DESCRIPTOR_PROCESSING_HPP 8 | #define QPL_SOURCES_MIDDLE_LAYER_UTIL_MULTI_DESCRIPTOR_PROCESSING_HPP 9 | 10 | #include 11 | 12 | #include "analytics/input_stream.hpp" 13 | #include "analytics/output_stream.hpp" 14 | #include "hw_definitions.h" 15 | #include "hw_descriptors_api.h" 16 | 17 | namespace qpl::ml::analytics { 18 | 19 | template 20 | void split_descriptors(hw_descriptor& reference_descriptor, 21 | std::array& descriptors) noexcept; 22 | 23 | template <> 24 | void split_descriptors(hw_descriptor& reference_descriptor, 25 | std::array& descriptors) noexcept; 26 | 27 | auto is_hw_configuration_good_for_splitting() noexcept -> bool; 28 | 29 | auto is_operation_splittable(const input_stream_t& input_stream, 30 | const output_stream_t& output_stream) noexcept -> bool; 31 | } // namespace qpl::ml::analytics 32 | 33 | #endif //QPL_SOURCES_MIDDLE_LAYER_UTIL_MULTI_DESCRIPTOR_PROCESSING_HPP 34 | -------------------------------------------------------------------------------- /sources/middle-layer/util/topology.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2024 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_SOURCES_MIDDLE_LAYER_UTIL_TOPOLOGY_HPP 8 | #define QPL_SOURCES_MIDDLE_LAYER_UTIL_TOPOLOGY_HPP 9 | 10 | #include 11 | 12 | namespace qpl::ml::util { 13 | 14 | int32_t get_numa_id() noexcept; 15 | 16 | uint64_t get_socket_id() noexcept; 17 | 18 | uint64_t get_socket_id(int numa_node) noexcept; 19 | 20 | } // namespace qpl::ml::util 21 | 22 | #endif //QPL_SOURCES_MIDDLE_LAYER_UTIL_TOPOLOGY_HPP 23 | -------------------------------------------------------------------------------- /tools/benchmarks/include/cmd_decl.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | #ifndef QPL_TOOLS_BENCHMARKS_INCLUDE_CMD_DECL_HPP 7 | #define QPL_TOOLS_BENCHMARKS_INCLUDE_CMD_DECL_HPP 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | namespace bench::cmd { 14 | BM_DECLARE_string(dataset); 15 | BM_DECLARE_string(block_size); 16 | BM_DECLARE_int32(queue_size); 17 | BM_DECLARE_int32(threads); 18 | BM_DECLARE_int32(node); 19 | BM_DECLARE_bool(full_time); 20 | BM_DECLARE_bool(no_hw); 21 | BM_DECLARE_string(in_mem); 22 | BM_DECLARE_string(out_mem); 23 | BM_DECLARE_bool(sync_api); 24 | BM_DECLARE_bool(accel_time); 25 | 26 | std::int32_t get_block_size(); 27 | mem_loc_e get_in_mem(); 28 | mem_loc_e get_out_mem(); 29 | } // namespace bench::cmd 30 | #endif // QPL_TOOLS_BENCHMARKS_INCLUDE_CMD_DECL_HPP 31 | -------------------------------------------------------------------------------- /tools/benchmarks/include/measure.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | #ifndef QPL_TOOLS_BENCHMARKS_INCLUDE_MEASURE_HPP 7 | #define QPL_TOOLS_BENCHMARKS_INCLUDE_MEASURE_HPP 8 | 9 | #include 10 | #include
11 | #include
12 | #include 13 | 14 | namespace bench { 15 | template 16 | static inline statistics_t measure(benchmark::State& state, const case_params_t& common_params, OperationT& operations, 17 | ParamsT& params) { 18 | if constexpr (exec == execution_e::async) 19 | return details::measure_async(state, common_params, operations, params); 20 | else 21 | return details::measure_sync(state, common_params, operations, params); 22 | } 23 | } // namespace bench 24 | 25 | #endif // QPL_TOOLS_BENCHMARKS_INCLUDE_MEASURE_HPP 26 | -------------------------------------------------------------------------------- /tools/benchmarks/include/ops/dispatcher.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | #ifndef QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_DISPATCHER_HPP 7 | #define QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_DISPATCHER_HPP 8 | 9 | #include 10 | 11 | #include "c_api/crc64.hpp" 12 | #include "c_api/deflate.hpp" 13 | #include "c_api/inflate.hpp" 14 | 15 | namespace bench::ops { 16 | template 17 | struct api_dispatcher_t {}; 18 | template 19 | struct api_dispatcher_t { 20 | using impl_t = c_api::deflate_t; 21 | }; 22 | template 23 | struct api_dispatcher_t { 24 | using impl_t = c_api::inflate_t; 25 | }; 26 | 27 | template 28 | struct api_dispatcher_t { 29 | using impl_t = c_api::crc64_t; 30 | }; 31 | } // namespace bench::ops 32 | 33 | #endif // QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_DISPATCHER_HPP 34 | -------------------------------------------------------------------------------- /tools/benchmarks/include/ops/ops.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | #ifndef QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_OPS_HPP 7 | #define QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_OPS_HPP 8 | 9 | #include 10 | 11 | namespace bench::ops { 12 | template 13 | using deflate_t = typename api_dispatcher_t::impl_t; 14 | template 15 | using inflate_t = typename api_dispatcher_t::impl_t; 16 | 17 | template 18 | using crc64_t = typename api_dispatcher_t::impl_t; 19 | } // namespace bench::ops 20 | 21 | #endif // QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_OPS_HPP 22 | -------------------------------------------------------------------------------- /tools/benchmarks/include/ops/results.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | #ifndef QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_RESULTS_HPP 7 | #define QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_RESULTS_HPP 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | namespace bench::ops { 14 | struct deflate_results_t { 15 | using data_type_t = std::vector; 16 | 17 | explicit deflate_results_t() {} 18 | 19 | data_type_t stream_; 20 | }; 21 | 22 | struct inflate_results_t { 23 | using data_type_t = std::vector; 24 | 25 | explicit inflate_results_t() {} 26 | 27 | data_type_t data_; 28 | }; 29 | 30 | struct crc64_results_t { 31 | using data_type_t = std::vector; 32 | 33 | explicit crc64_results_t() {} 34 | 35 | data_type_t data_; 36 | }; 37 | } // namespace bench::ops 38 | 39 | #endif // QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_RESULTS_HPP 40 | -------------------------------------------------------------------------------- /tools/configs/1n1d1e1w-s-n1.conf: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "dev":"iax1", 4 | "groups":[ 5 | { 6 | "dev":"group1.0", 7 | "grouped_workqueues":[ 8 | { 9 | "dev":"wq1.0", 10 | "mode":"shared", 11 | "size":128, 12 | "group_id":0, 13 | "priority":10, 14 | "block_on_fault":1, 15 | "max_transfer_size":2147483648, 16 | "driver_name":"user", 17 | "type":"user", 18 | "name":"app1", 19 | "threshold":128 20 | } 21 | ], 22 | "grouped_engines":[ 23 | { 24 | "dev":"engine1.0", 25 | "group_id":0 26 | } 27 | ] 28 | } 29 | ] 30 | } 31 | ] 32 | -------------------------------------------------------------------------------- /tools/configs/1n1d1e1w-s-n2.conf: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "dev":"iax9", 4 | "groups":[ 5 | { 6 | "dev":"group9.0", 7 | "grouped_workqueues":[ 8 | { 9 | "dev":"wq9.0", 10 | "mode":"shared", 11 | "size":128, 12 | "group_id":0, 13 | "priority":10, 14 | "block_on_fault":1, 15 | "max_transfer_size":2147483648, 16 | "driver_name":"user", 17 | "type":"user", 18 | "name":"app1", 19 | "threshold":128 20 | } 21 | ], 22 | "grouped_engines":[ 23 | { 24 | "dev":"engine9.0", 25 | "group_id":0 26 | } 27 | ] 28 | } 29 | ] 30 | } 31 | ] 32 | -------------------------------------------------------------------------------- /tools/configs/1n1d8e1w-s-n1.conf: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "dev":"iax1", 4 | "groups":[ 5 | { 6 | "dev":"group1.0", 7 | "grouped_workqueues":[ 8 | { 9 | "dev":"wq1.0", 10 | "mode":"shared", 11 | "size":128, 12 | "group_id":0, 13 | "priority":10, 14 | "block_on_fault":1, 15 | "max_transfer_size":2147483648, 16 | "driver_name":"user", 17 | "type":"user", 18 | "name":"app1", 19 | "threshold":128 20 | } 21 | ], 22 | "grouped_engines":[ 23 | { 24 | "dev":"engine1.0", 25 | "group_id":0 26 | }, 27 | { 28 | "dev":"engine1.1", 29 | "group_id":0 30 | }, 31 | { 32 | "dev":"engine1.2", 33 | "group_id":0 34 | }, 35 | { 36 | "dev":"engine1.3", 37 | "group_id":0 38 | }, 39 | { 40 | "dev":"engine1.4", 41 | "group_id":0 42 | }, 43 | { 44 | "dev":"engine1.5", 45 | "group_id":0 46 | }, 47 | { 48 | "dev":"engine1.6", 49 | "group_id":0 50 | }, 51 | { 52 | "dev":"engine1.7", 53 | "group_id":0 54 | } 55 | ] 56 | } 57 | ] 58 | } 59 | ] 60 | -------------------------------------------------------------------------------- /tools/configs/1n1d8e1w-s-n2.conf: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "dev":"iax9", 4 | "groups":[ 5 | { 6 | "dev":"group9.0", 7 | "grouped_workqueues":[ 8 | { 9 | "dev":"wq9.0", 10 | "mode":"shared", 11 | "size":128, 12 | "group_id":0, 13 | "priority":10, 14 | "block_on_fault":1, 15 | "max_transfer_size":2147483648, 16 | "driver_name":"user", 17 | "type":"user", 18 | "name":"app1", 19 | "threshold":128 20 | } 21 | ], 22 | "grouped_engines":[ 23 | { 24 | "dev":"engine9.0", 25 | "group_id":0 26 | }, 27 | { 28 | "dev":"engine9.1", 29 | "group_id":0 30 | }, 31 | { 32 | "dev":"engine9.2", 33 | "group_id":0 34 | }, 35 | { 36 | "dev":"engine9.3", 37 | "group_id":0 38 | }, 39 | { 40 | "dev":"engine9.4", 41 | "group_id":0 42 | }, 43 | { 44 | "dev":"engine9.5", 45 | "group_id":0 46 | }, 47 | { 48 | "dev":"engine9.6", 49 | "group_id":0 50 | }, 51 | { 52 | "dev":"engine9.7", 53 | "group_id":0 54 | } 55 | ] 56 | } 57 | ] 58 | } 59 | ] 60 | -------------------------------------------------------------------------------- /tools/configs/2n1d1e1w-s.conf: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "dev":"iax1", 4 | "groups":[ 5 | { 6 | "dev":"group1.0", 7 | "grouped_workqueues":[ 8 | { 9 | "dev":"wq1.0", 10 | "mode":"shared", 11 | "size":128, 12 | "group_id":0, 13 | "priority":10, 14 | "block_on_fault":1, 15 | "max_transfer_size":2147483648, 16 | "driver_name":"user", 17 | "type":"user", 18 | "name":"app1", 19 | "threshold":128 20 | } 21 | ], 22 | "grouped_engines":[ 23 | { 24 | "dev":"engine1.0", 25 | "group_id":0 26 | } 27 | ] 28 | } 29 | ] 30 | }, 31 | { 32 | "dev":"iax9", 33 | "groups":[ 34 | { 35 | "dev":"group9.0", 36 | "grouped_workqueues":[ 37 | { 38 | "dev":"wq9.0", 39 | "mode":"shared", 40 | "size":128, 41 | "group_id":0, 42 | "priority":10, 43 | "block_on_fault":1, 44 | "max_transfer_size":2147483648, 45 | "driver_name":"user", 46 | "type":"user", 47 | "name":"app1", 48 | "threshold":128 49 | } 50 | ], 51 | "grouped_engines":[ 52 | { 53 | "dev":"engine9.0", 54 | "group_id":0 55 | } 56 | ] 57 | } 58 | ] 59 | } 60 | ] 61 | -------------------------------------------------------------------------------- /tools/pkg-config/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ========================================================================== 2 | # Copyright (C) 2024 Intel Corporation 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # ========================================================================== 6 | 7 | # Intel® Query Processing Library (Intel® QPL) pkg-config file generation. 8 | 9 | if (UNIX AND DYNAMIC_LOADING_LIBACCEL_CONFIG AND "${QPL_LIBRARY_TYPE}" STREQUAL "SHARED") 10 | configure_file(qpl.pc.in qpl.pc @ONLY) 11 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qpl.pc 12 | DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) 13 | endif () 14 | -------------------------------------------------------------------------------- /tools/pkg-config/qpl.pc.in: -------------------------------------------------------------------------------- 1 | # ========================================================================== 2 | # Copyright (C) 2024 Intel Corporation 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # ========================================================================== 6 | 7 | prefix=@CMAKE_INSTALL_PREFIX@ 8 | exec_prefix=${prefix} 9 | libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ 10 | includedir=${prefix}/include 11 | 12 | Name: @CMAKE_PROJECT_NAME@ 13 | Description: @CMAKE_PROJECT_DESCRIPTION@ 14 | Version: @CMAKE_PROJECT_VERSION@ 15 | Libs: -L${libdir} -lqpl 16 | Cflags: -I${includedir} 17 | -------------------------------------------------------------------------------- /tools/ref/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ========================================================================== 2 | # Copyright (C) 2022 Intel Corporation 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # ========================================================================== 6 | 7 | # Build system for the library with Reference implementations. 8 | # Includes reference implementations for CRC and filter functions, and used 9 | # for functional testing. 10 | 11 | cmake_minimum_required(VERSION 3.15.0 FATAL_ERROR) 12 | 13 | project(qplref C) 14 | 15 | # Finding library sources 16 | file(GLOB QPL_C_SRC *.c) 17 | 18 | # Adding library target 19 | add_library(qplref STATIC ${QPL_C_SRC}) 20 | 21 | # Setting external and internal interfaces for reference library 22 | target_include_directories(qplref 23 | PUBLIC $ 24 | PRIVATE $) 25 | 26 | set_target_properties(qplref PROPERTIES 27 | C_STANDARD 99) 28 | 29 | target_compile_options(qplref PUBLIC 30 | "$<$:>" 31 | "$<$:>" 32 | PRIVATE "$<$:-Werror>" 33 | PRIVATE "$<$:/WX>") 34 | 35 | target_compile_definitions(qplref PUBLIC REF_BAD_ARG_CHECK) 36 | -------------------------------------------------------------------------------- /tools/ref/include/ref_checksums.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | /** 8 | * @date 11/12/2020 9 | * @brief Internal helper functions for reference calculation of checksum for analytics operations 10 | * 11 | * @ingroup REFERENCE_PRIVATE 12 | * @{ 13 | * 14 | */ 15 | 16 | #ifndef QPL_TOOLS_REF_INCLUDE_REF_CHECKSUMS_H 17 | #define QPL_TOOLS_REF_INCLUDE_REF_CHECKSUMS_H 18 | 19 | #include "own_ref_defs.h" 20 | #include "qpl_api_ref.h" 21 | 22 | #if defined(__cplusplus) 23 | extern "C" { 24 | #endif 25 | 26 | void update_checksums(qpl_job* const qpl_job_ptr); 27 | 28 | #if defined(__cplusplus) 29 | } 30 | #endif 31 | 32 | #endif // QPL_TOOLS_REF_INCLUDE_REF_CHECKSUMS_H 33 | 34 | /** @} */ 35 | -------------------------------------------------------------------------------- /tools/ref/include/ref_count.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | /** 8 | * @date 10/03/2019 9 | * @brief Contains internal definitions for reference implementation of count elements 10 | * 11 | * @defgroup REFERENCE_COUNT Count 12 | * @ingroup REFERENCE_COMMONS 13 | * @{ 14 | */ 15 | 16 | #ifndef QPL_TOOLS_REF_INCLUDE_REF_COUNT_H 17 | #define QPL_TOOLS_REF_INCLUDE_REF_COUNT_H 18 | 19 | #include "own_ref_defs.h" 20 | #include "ref_prle.h" 21 | 22 | #if defined(__cplusplus) 23 | extern "C" { 24 | #endif 25 | 26 | /** 27 | * @todo 28 | * @param source_ptr 29 | * @param source_end_ptr 30 | * @param number_of_elements_ptr 31 | * @param available_bytes 32 | * @return 33 | */ 34 | qpl_status ref_count_elements_prle(const uint8_t* const source_ptr, const uint8_t* const source_end_ptr, 35 | uint32_t* const number_of_elements_ptr, uint32_t available_bytes); 36 | 37 | /** 38 | * @todo 39 | * @param source_ptr 40 | * @param number_of_elements 41 | * @return 42 | */ 43 | uint32_t ref_count_non_zero_elements_32u(const uint32_t* const source_ptr, uint32_t number_of_elements); 44 | 45 | #if defined(__cplusplus) 46 | } 47 | #endif 48 | 49 | #endif // QPL_TOOLS_REF_INCLUDE_REF_COUNT_H 50 | 51 | /** @} */ 52 | -------------------------------------------------------------------------------- /tools/ref/ref_checksums.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | /** 8 | * @date 11/12/2020 9 | * @brief Internal helper functions for reference calculation of checksum for analytics operations 10 | * 11 | * @ingroup REFERENCE_PRIVATE 12 | * @{ 13 | * 14 | */ 15 | 16 | #include "ref_checksums.h" 17 | 18 | void update_checksums(qpl_job* const qpl_job_ptr) { 19 | // Update crc32 field 20 | uint32_t used_poly = (qpl_job_ptr->flags & QPL_FLAG_CRC32C) ? 0x1EDC6F41 : 0x04C11DB7; 21 | 22 | qpl_job_ptr->crc = 23 | ref_crc32(qpl_job_ptr->next_in_ptr - qpl_job_ptr->drop_initial_bytes, 24 | qpl_job_ptr->available_in + qpl_job_ptr->drop_initial_bytes, used_poly, qpl_job_ptr->crc); 25 | 26 | // Update xor checksum field 27 | qpl_job_ptr->xor_checksum = 28 | ref_xor_checksum(qpl_job_ptr->next_in_ptr - qpl_job_ptr->drop_initial_bytes, 29 | qpl_job_ptr->available_in + qpl_job_ptr->drop_initial_bytes, qpl_job_ptr->xor_checksum); 30 | } 31 | 32 | /** @} */ 33 | -------------------------------------------------------------------------------- /tools/ref/ref_xor_checksum.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | /** 8 | * @date 10/30/2018 9 | * Contains a reference implementation of the XOR checksum function 10 | */ 11 | 12 | #include "qpl_api_ref.h" 13 | 14 | uint32_t ref_xor_checksum(const uint8_t* buf, uint32_t len, uint32_t init_xor) { 15 | uint32_t checksum = init_xor; 16 | 17 | for (uint32_t i = 0; i < (len & ~1); i += 2) { 18 | checksum ^= (uint32_t)(*(uint16_t*)(buf + i)); 19 | } 20 | 21 | if (len & 1) { checksum ^= (uint32_t)buf[len - 1]; } 22 | 23 | return checksum; 24 | } 25 | -------------------------------------------------------------------------------- /tools/scripts/accel_conf.sh: -------------------------------------------------------------------------------- 1 | # ========================================================================== 2 | # Copyright (C) 2022 Intel Corporation 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # ========================================================================== 6 | 7 | SCRIPT_NAME=$(basename $BASH_SOURCE) 8 | SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" 9 | DEVICE_PREFIX=iax 10 | 11 | # Try to use python3 explicitly 12 | Python() { 13 | if ! command -v python3 &> /dev/null; then 14 | python $@ 15 | else 16 | python3 $@ 17 | fi 18 | } 19 | 20 | Python ${SCRIPT_DIR}/accel_conf.py --filter ${DEVICE_PREFIX} $@ 21 | -------------------------------------------------------------------------------- /tools/testdata/file10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/qpl/69f72dfd2f4df6c4ef4fbd5a5aa13dd12eba511d/tools/testdata/file10 -------------------------------------------------------------------------------- /tools/testdata/file11: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/qpl/69f72dfd2f4df6c4ef4fbd5a5aa13dd12eba511d/tools/testdata/file11 -------------------------------------------------------------------------------- /tools/testdata/file12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/qpl/69f72dfd2f4df6c4ef4fbd5a5aa13dd12eba511d/tools/testdata/file12 -------------------------------------------------------------------------------- /tools/testdata/file13: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/qpl/69f72dfd2f4df6c4ef4fbd5a5aa13dd12eba511d/tools/testdata/file13 -------------------------------------------------------------------------------- /tools/testdata/file14: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/qpl/69f72dfd2f4df6c4ef4fbd5a5aa13dd12eba511d/tools/testdata/file14 -------------------------------------------------------------------------------- /tools/testdata/file4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/qpl/69f72dfd2f4df6c4ef4fbd5a5aa13dd12eba511d/tools/testdata/file4 -------------------------------------------------------------------------------- /tools/testdata/file6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/qpl/69f72dfd2f4df6c4ef4fbd5a5aa13dd12eba511d/tools/testdata/file6 -------------------------------------------------------------------------------- /tools/testdata/file7: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/qpl/69f72dfd2f4df6c4ef4fbd5a5aa13dd12eba511d/tools/testdata/file7 -------------------------------------------------------------------------------- /tools/testdata/file8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/qpl/69f72dfd2f4df6c4ef4fbd5a5aa13dd12eba511d/tools/testdata/file8 -------------------------------------------------------------------------------- /tools/testdata/file9: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/qpl/69f72dfd2f4df6c4ef4fbd5a5aa13dd12eba511d/tools/testdata/file9 -------------------------------------------------------------------------------- /tools/testdata/gen_all_ll.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/qpl/69f72dfd2f4df6c4ef4fbd5a5aa13dd12eba511d/tools/testdata/gen_all_ll.bin -------------------------------------------------------------------------------- /tools/testdata/gen_all_ll.def: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/qpl/69f72dfd2f4df6c4ef4fbd5a5aa13dd12eba511d/tools/testdata/gen_all_ll.def -------------------------------------------------------------------------------- /tools/testdata/gen_large_dist.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/qpl/69f72dfd2f4df6c4ef4fbd5a5aa13dd12eba511d/tools/testdata/gen_large_dist.bin -------------------------------------------------------------------------------- /tools/testdata/gen_large_dist.def: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/qpl/69f72dfd2f4df6c4ef4fbd5a5aa13dd12eba511d/tools/testdata/gen_large_dist.def -------------------------------------------------------------------------------- /tools/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ========================================================================== 2 | # Copyright (C) 2022 Intel Corporation 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # ========================================================================== 6 | 7 | # Intel® Query Processing Library (Intel® QPL) 8 | # Build system 9 | 10 | add_subdirectory(common) 11 | add_subdirectory(functional) 12 | add_subdirectory(thread_tests) 13 | add_subdirectory(cross_tests) 14 | 15 | -------------------------------------------------------------------------------- /tools/tests/common/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ========================================================================== 2 | # Copyright (C) 2022 Intel Corporation 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # ========================================================================== 6 | 7 | # Intel® Query Processing Library (Intel® QPL) 8 | # Build system 9 | 10 | enable_language(CXX) 11 | 12 | file(GLOB SOURCES *.cpp) 13 | 14 | add_library(tests_common STATIC ${SOURCES}) 15 | set_target_properties(tests_common PROPERTIES CXX_STANDARD 17) 16 | 17 | target_include_directories(tests_common 18 | PUBLIC $ 19 | PUBLIC $ 20 | PUBLIC $ 21 | PRIVATE $) 22 | 23 | target_link_libraries(tests_common 24 | PUBLIC gtest 25 | PUBLIC tool_common) 26 | 27 | target_compile_definitions(tests_common PRIVATE $) 28 | target_compile_options(tests_common PRIVATE $) 29 | -------------------------------------------------------------------------------- /tools/tests/common/common_defs.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2023 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_TESTS_COMMON_COMMON_DEFS_HPP 8 | #define QPL_TOOLS_TESTS_COMMON_COMMON_DEFS_HPP 9 | 10 | #include 11 | 12 | // Required for PF testing. 13 | // Based on the value, we choose to swap out the pages 14 | // in src-1/src-2 (READ PF) or dst (WRITE PF). 15 | typedef enum : std::uint8_t { READ_SRC_1_PAGE_FAULT, READ_SRC_2_PAGE_FAULT, WRITE_PAGE_FAULT } PageFaultType; 16 | 17 | #endif // QPL_TOOLS_TESTS_COMMON_COMMON_DEFS_HPP 18 | -------------------------------------------------------------------------------- /tools/tests/common/execution_wrapper.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | /* 8 | * Intel® Query Processing Library (Intel® QPL) 9 | * Test API (private C++ API) 10 | */ 11 | 12 | #ifndef QPL_TOOLS_TESTS_COMMON_EXECUTION_WRAPPER_HPP 13 | #define QPL_TOOLS_TESTS_COMMON_EXECUTION_WRAPPER_HPP 14 | 15 | #include "qpl/qpl.h" 16 | 17 | #include "qpl_test_environment.hpp" 18 | 19 | namespace qpl::test { 20 | static inline auto run_job_api(qpl_job* job_ptr) { 21 | if (!util::TestEnvironment::GetInstance().IsAsynchronousApiTesting()) { 22 | return qpl_execute_job(job_ptr); 23 | } else { 24 | auto status = qpl_submit_job(job_ptr); 25 | 26 | if (status) { return status; } 27 | 28 | return qpl_wait_job(job_ptr); 29 | } 30 | } 31 | } // namespace qpl::test 32 | 33 | #endif //QPL_TOOLS_TESTS_COMMON_EXECUTION_WRAPPER_HPP 34 | -------------------------------------------------------------------------------- /tools/tests/common/job_helper.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_TESTS_COMMON_JOB_HELPER_HPP 8 | #define QPL_TOOLS_TESTS_COMMON_JOB_HELPER_HPP 9 | 10 | #include "qpl/qpl.h" 11 | 12 | // tests_common 13 | #include "test_sources.hpp" 14 | 15 | namespace qpl::test::job_helper { 16 | 17 | template 18 | inline auto fill_job(qpl_job* const job_ptr, Arguments... args); 19 | 20 | static inline auto is_two_source_filtering(qpl_job* const job_ptr) { 21 | return job_ptr->op == qpl_op_expand || job_ptr->op == qpl_op_select; 22 | } 23 | 24 | } // namespace qpl::test::job_helper 25 | 26 | #endif // QPL_TOOLS_TESTS_COMMON_JOB_HELPER_HPP 27 | -------------------------------------------------------------------------------- /tools/tests/common/test_name_format.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_TESTS_COMMON_TEST_NAME_FORMAT_HPP 8 | #define QPL_TOOLS_TESTS_COMMON_TEST_NAME_FORMAT_HPP 9 | 10 | #define QPL_SUITE_NAME(type, api, tested_entity) type##_##api##_##tested_entity 11 | 12 | #define QPL_LOW_LEVEL_SUITE_NAME(type, tested_entity) QPL_SUITE_NAME(type, c_api, tested_entity) 13 | 14 | #define QPL_UNIT_SUITE_NAME(type, tested_entity) QPL_SUITE_NAME(type, unit_api, tested_entity) 15 | 16 | #endif //QPL_TOOLS_TESTS_COMMON_TEST_NAME_FORMAT_HPP 17 | -------------------------------------------------------------------------------- /tools/tests/cross_tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ========================================================================== 2 | # Copyright (C) 2022 Intel Corporation 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # ========================================================================== 6 | 7 | # Intel® Query Processing Library (Intel® QPL) 8 | # Build system 9 | 10 | enable_language(CXX) 11 | 12 | file(GLOB SOURCES *.cpp) 13 | 14 | add_executable(cross_tests ${SOURCES}) 15 | 16 | get_target_property(QPL_SOURCE_DIR qpl SOURCE_DIR) 17 | 18 | get_property(LIB_DEPS GLOBAL PROPERTY QPL_LIB_DEPS) 19 | 20 | target_link_libraries(cross_tests 21 | PRIVATE ${LIB_DEPS} 22 | PRIVATE tests_common 23 | PRIVATE tool_generator 24 | PRIVATE gtest 25 | PRIVATE qpl 26 | "$<$:stdc++fs>" 27 | "$<$,$>:${CMAKE_DL_LIBS}>" 28 | "$<$,$>:accel-config>") 29 | 30 | set_target_properties(cross_tests PROPERTIES CXX_STANDARD 17) 31 | 32 | target_compile_definitions(cross_tests PRIVATE $) 33 | target_compile_options(cross_tests PRIVATE $) 34 | 35 | install(TARGETS cross_tests RUNTIME DESTINATION bin) 36 | -------------------------------------------------------------------------------- /tools/tests/cross_tests/canned_test_cases.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #include "canned_test_cases.hpp" 8 | 9 | // tool_common 10 | #include "source_provider.hpp" 11 | 12 | namespace qpl::test { 13 | std::ostream& operator<<(std::ostream& os, const SimpleCannedOneChuckTestCase& test_case) { 14 | os << "File name: " << test_case.file_name << "\n"; 15 | return os; 16 | } 17 | } // namespace qpl::test 18 | -------------------------------------------------------------------------------- /tools/tests/cross_tests/canned_test_cases.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_TESTS_CROSS_TESTS_CANNED_TEST_CASES_HPP 8 | #define QPL_TOOLS_TESTS_CROSS_TESTS_CANNED_TEST_CASES_HPP 9 | 10 | // tool_common 11 | #include "source_provider.hpp" 12 | #include "util.hpp" 13 | 14 | namespace qpl::test { 15 | 16 | struct SimpleCannedOneChuckTestCase { 17 | std::string file_name; 18 | }; 19 | 20 | std::ostream& operator<<(std::ostream& os, const SimpleCannedOneChuckTestCase& test_case); 21 | } // namespace qpl::test 22 | 23 | #endif //QPL_TOOLS_TESTS_CROSS_TESTS_CANNED_TEST_CASES_HPP 24 | -------------------------------------------------------------------------------- /tools/tests/cross_tests/crc32_test_cases.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #include "crc32_test_cases.hpp" 8 | 9 | // tool_common 10 | #include "source_provider.hpp" 11 | 12 | namespace qpl::test { 13 | std::ostream& operator<<(std::ostream& os, const SimpleCRC32TestCase& test_case) { 14 | os << "Polynomial: " << test_case.poly << ", is Big Endian bit order: " << test_case.is_be_bit_order 15 | << ", is inverse: " << test_case.is_inverse << "\n"; 16 | return os; 17 | } 18 | } // namespace qpl::test 19 | -------------------------------------------------------------------------------- /tools/tests/cross_tests/crc32_test_cases.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_TESTS_CROSS_TESTS_CRC32_TEST_CASES_HPP 8 | #define QPL_TOOLS_TESTS_CROSS_TESTS_CRC32_TEST_CASES_HPP 9 | 10 | // tool_common 11 | #include "source_provider.hpp" 12 | #include "util.hpp" 13 | 14 | namespace qpl::test { 15 | struct SimpleCRC32TestCase { 16 | uint32_t source_size; 17 | uint64_t poly; 18 | bool is_be_bit_order; 19 | bool is_inverse; 20 | }; 21 | 22 | std::ostream& operator<<(std::ostream& os, const SimpleCRC32TestCase& test_case); 23 | } // namespace qpl::test 24 | 25 | #endif //QPL_TOOLS_TESTS_CROSS_TESTS_CRC32_TEST_CASES_HPP 26 | -------------------------------------------------------------------------------- /tools/tests/cross_tests/deflate_test_cases.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #include "deflate_test_cases.hpp" 8 | 9 | // tool_common 10 | #include "source_provider.hpp" 11 | 12 | namespace qpl::test { 13 | std::ostream& operator<<(std::ostream& os, const SimpleDeflateTestCase& test_case) { 14 | std::string header; 15 | std::string block_type; 16 | 17 | if (no_header == test_case.header) { 18 | header = "No header"; 19 | } else if (gzip_header == test_case.header) { 20 | header = "Gzip header"; 21 | } else if (zlib_header == test_case.header) { 22 | header = "Zlib header"; 23 | } 24 | 25 | if (block_static == test_case.block_type) { 26 | block_type = "Stored"; 27 | } else if (block_fixed == test_case.block_type) { 28 | block_type = "Fixed Block"; 29 | } else { 30 | block_type = "Dynamic Block"; 31 | } 32 | 33 | os << "Header type: " << header << ", block type: " << block_type << ", file name: " << test_case.file_name << "\n"; 34 | return os; 35 | } 36 | } // namespace qpl::test 37 | -------------------------------------------------------------------------------- /tools/tests/cross_tests/deflate_test_cases.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_TESTS_CROSS_TESTS_DEFLATE_TEST_CASES_HPP 8 | #define QPL_TOOLS_TESTS_CROSS_TESTS_DEFLATE_TEST_CASES_HPP 9 | 10 | #include 11 | 12 | // tool_common 13 | #include "source_provider.hpp" 14 | #include "util.hpp" 15 | 16 | namespace qpl::test { 17 | enum HeaderType { no_header = 0, gzip_header = QPL_FLAG_GZIP_MODE, zlib_header = QPL_FLAG_ZLIB_MODE }; 18 | 19 | enum BlockType : std::uint8_t { block_fixed, block_dynamic, block_static }; 20 | 21 | struct SimpleDeflateTestCase { 22 | HeaderType header; 23 | BlockType block_type; 24 | std::string file_name; 25 | }; 26 | 27 | std::ostream& operator<<(std::ostream& os, const SimpleDeflateTestCase& test_case); 28 | } // namespace qpl::test 29 | 30 | #endif //QPL_TOOLS_TESTS_CROSS_TESTS_DEFLATE_TEST_CASES_HPP 31 | -------------------------------------------------------------------------------- /tools/tests/cross_tests/huffman_only_test_cases.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #include "huffman_only_test_cases.hpp" 8 | 9 | // tool_common 10 | #include "source_provider.hpp" 11 | 12 | namespace qpl::test { 13 | std::ostream& operator<<(std::ostream& os, const SimpleHuffmanOnlyTestCase& test_case) { 14 | os << "is Huffman BE: " << test_case.is_huffman_be << ", file name: " << test_case.file_name << "\n"; 15 | return os; 16 | } 17 | } // namespace qpl::test 18 | -------------------------------------------------------------------------------- /tools/tests/cross_tests/huffman_only_test_cases.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_TESTS_CROSS_TESTS_HUFFMAN_ONLY_TEST_CASES_HPP 8 | #define QPL_TOOLS_TESTS_CROSS_TESTS_HUFFMAN_ONLY_TEST_CASES_HPP 9 | 10 | // tool_common 11 | #include "source_provider.hpp" 12 | #include "util.hpp" 13 | 14 | namespace qpl::test { 15 | 16 | struct SimpleHuffmanOnlyTestCase { 17 | bool is_huffman_be; 18 | std::string file_name; 19 | }; 20 | 21 | std::ostream& operator<<(std::ostream& os, const SimpleHuffmanOnlyTestCase& test_case); 22 | } // namespace qpl::test 23 | 24 | #endif //QPL_TOOLS_TESTS_CROSS_TESTS_HUFFMAN_ONLY_TEST_CASES_HPP 25 | -------------------------------------------------------------------------------- /tools/tests/functional/algorithmic_tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ========================================================================== 2 | # Copyright (C) 2022 Intel Corporation 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # ========================================================================== 6 | 7 | # Intel® Query Processing Library (Intel® QPL) 8 | # Build system 9 | 10 | enable_language(CXX) 11 | 12 | file(GLOB SOURCES low_level_api/*.cpp) 13 | 14 | add_library(algorithmic_tests OBJECT ${SOURCES}) 15 | 16 | get_target_property(QPL_SOURCE_DIR qpl SOURCE_DIR) 17 | set_target_properties(algorithmic_tests PROPERTIES CXX_STANDARD 17) 18 | 19 | target_include_directories(algorithmic_tests 20 | PRIVATE ${QPL_SOURCE_DIR}/sources/include 21 | PRIVATE $ 22 | PRIVATE $ 23 | PRIVATE $ 24 | PRIVATE $ 25 | PRIVATE $) 26 | 27 | target_compile_definitions(algorithmic_tests 28 | PRIVATE $) 29 | 30 | target_compile_options(algorithmic_tests 31 | PRIVATE $) 32 | -------------------------------------------------------------------------------- /tools/tests/functional/algorithmic_tests/low_level_api/ta_ll_common.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_TESTS_FUNCTIONAL_ALGORITHMIC_TESTS_LOW_LEVEL_API_TA_LL_COMMON_HPP 8 | #define QPL_TOOLS_TESTS_FUNCTIONAL_ALGORITHMIC_TESTS_LOW_LEVEL_API_TA_LL_COMMON_HPP 9 | 10 | // tests_common 11 | #include "check_result.hpp" 12 | #include "execution_wrapper.hpp" 13 | #include "test_cases.hpp" 14 | #include "test_name_format.hpp" 15 | 16 | #define QPL_LOW_LEVEL_API_ALGORITHMIC_TEST(operation, test) TEST(ta##_c_api_##operation, test) 17 | 18 | #define QPL_LOW_LEVEL_API_ALGORITHMIC_TEST_F(operation, test, test_fixture) \ 19 | QPL_FIXTURE_TEST(ta##_c_api_##operation, test, test_fixture) 20 | 21 | #define QPL_LOW_LEVEL_API_ALGORITHMIC_TEST_TC(operation, test, test_fixture) \ 22 | QPL_TEST_TC_(ta##_c_api_##operation, test, test_fixture, testing::internal::GetTypeId()) 23 | 24 | #endif //QPL_TOOLS_TESTS_FUNCTIONAL_ALGORITHMIC_TESTS_LOW_LEVEL_API_TA_LL_COMMON_HPP 25 | -------------------------------------------------------------------------------- /tools/tests/functional/bad_argument_tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ========================================================================== 2 | # Copyright (C) 2022 Intel Corporation 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # ========================================================================== 6 | 7 | # Intel® Query Processing Library (Intel® QPL) 8 | # Build system 9 | 10 | enable_language(CXX) 11 | 12 | file(GLOB SOURCES low_level_api/*.cpp) 13 | 14 | add_library(bad_argument_tests OBJECT ${SOURCES}) 15 | 16 | set_target_properties(bad_argument_tests PROPERTIES CXX_STANDARD 17) 17 | 18 | target_include_directories(bad_argument_tests 19 | PRIVATE $ 20 | PRIVATE $ 21 | PRIVATE $ 22 | PRIVATE $) 23 | 24 | target_compile_definitions(bad_argument_tests 25 | PRIVATE $) 26 | 27 | target_compile_options(bad_argument_tests 28 | PRIVATE $) 29 | -------------------------------------------------------------------------------- /tools/tests/functional/negative_tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ========================================================================== 2 | # Copyright (C) 2022 Intel Corporation 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # ========================================================================== 6 | 7 | # Intel® Query Processing Library (Intel® QPL) 8 | # Build system 9 | 10 | enable_language(CXX) 11 | 12 | file(GLOB SOURCES low_level_api/*.cpp) 13 | 14 | add_library(negative_tests OBJECT ${SOURCES} ) 15 | 16 | get_target_property(QPL_SOURCE_DIR qpl SOURCE_DIR) 17 | set_target_properties(negative_tests PROPERTIES CXX_STANDARD 17) 18 | 19 | target_include_directories(negative_tests 20 | PRIVATE ${QPL_SOURCE_DIR}/sources/include 21 | PRIVATE $ 22 | PRIVATE $ 23 | PRIVATE $ 24 | PRIVATE $ 25 | PRIVATE $) 26 | 27 | target_compile_definitions(negative_tests 28 | PRIVATE $) 29 | 30 | target_compile_options(negative_tests 31 | PRIVATE $) 32 | -------------------------------------------------------------------------------- /tools/tests/functional/negative_tests/low_level_api/dictionary_compression.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #include "tn_common.hpp" 8 | 9 | namespace qpl::test { 10 | QPL_LOW_LEVEL_API_NEGATIVE_TEST(dictionary_compression, DISABLED_zlib_wrapper_wrong_dict_id) { 11 | // Empty test 12 | } 13 | 14 | QPL_LOW_LEVEL_API_NEGATIVE_TEST(dictionary_compression, DISABLED_gzip_wrapper_wrong_dict_id) { 15 | // Empty test 16 | } 17 | } // namespace qpl::test 18 | -------------------------------------------------------------------------------- /tools/tests/functional/negative_tests/low_level_api/tn_common.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_TESTS_FUNCTIONAL_NEGATIVE_TESTS_LOW_LEVEL_API_TN_COMMON_HPP 8 | #define QPL_TOOLS_TESTS_FUNCTIONAL_NEGATIVE_TESTS_LOW_LEVEL_API_TN_COMMON_HPP 9 | 10 | #include "gtest/gtest.h" 11 | 12 | // tests_common 13 | #include "check_result.hpp" 14 | #include "execution_wrapper.hpp" 15 | 16 | #define QPL_LOW_LEVEL_API_NEGATIVE_TEST_F(test_suite_name, test_fixture, test_name) \ 17 | GTEST_TEST_(tn_c_api_##test_suite_name, test_name, test_fixture, testing::internal::GetTypeId()) 18 | 19 | #define QPL_LOW_LEVEL_API_NEGATIVE_TEST(test_suite_name, test_name) GTEST_TEST(tn_c_api_##test_suite_name, test_name) 20 | 21 | #endif //QPL_TOOLS_TESTS_FUNCTIONAL_NEGATIVE_TESTS_LOW_LEVEL_API_TN_COMMON_HPP 22 | -------------------------------------------------------------------------------- /tools/tests/functional/unit_tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ========================================================================== 2 | # Copyright (C) 2022 Intel Corporation 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # ========================================================================== 6 | 7 | # Intel® Query Processing Library (Intel® QPL) 8 | # Build system 9 | 10 | enable_language(CXX) 11 | 12 | file(GLOB SOURCES algorithmic/*.cpp) 13 | 14 | add_library(unit_tests OBJECT ${SOURCES} ) 15 | 16 | get_target_property(QPL_SOURCE_DIR qpl SOURCE_DIR) 17 | set_target_properties(unit_tests PROPERTIES CXX_STANDARD 17) 18 | 19 | target_include_directories(unit_tests 20 | PRIVATE $ 21 | PRIVATE $ 22 | PRIVATE $ 23 | PRIVATE $ 24 | PRIVATE $ #todo remove dependency 25 | PRIVATE $ 26 | PRIVATE $ 27 | PRIVATE $) 28 | 29 | target_compile_definitions(unit_tests 30 | PRIVATE $) 31 | 32 | target_compile_options(unit_tests 33 | PRIVATE $) 34 | -------------------------------------------------------------------------------- /tools/tests/functional/unit_tests/algorithmic/get_safe_deflate_buffer_size.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2025 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #include 8 | 9 | #include "qpl/qpl.h" 10 | 11 | #include "t_common.hpp" 12 | 13 | namespace qpl::test { 14 | 15 | /** 16 | * @brief Tests the get_safe_deflate_compression_buffer_size() function across the full range of input sizes. 17 | * The function should return 0 if the input size is too large, accounting for the overhead when a stored block is used. 18 | * In all other cases, the function should return a value greater than the input size. 19 | */ 20 | QPL_UNIT_API_ALGORITHMIC_TEST(get_safe_deflate_buffer_size, full_input_size_range) { 21 | for (uint32_t i = UINT32_MAX; i > 0; i--) { 22 | const uint32_t buffer_size = qpl_get_safe_deflate_compression_buffer_size(i); 23 | ASSERT_TRUE(buffer_size > i || buffer_size == 0) << "Buffer size: " << buffer_size << " Input size: " << i; 24 | } 25 | } 26 | 27 | } // namespace qpl::test 28 | -------------------------------------------------------------------------------- /tools/tests/functional/unit_tests/algorithmic/t_common.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_TESTS_FUNCTIONAL_UNIT_TESTS_ALGORITHMIC_T_COMMON_HPP 8 | #define QPL_TOOLS_TESTS_FUNCTIONAL_UNIT_TESTS_ALGORITHMIC_T_COMMON_HPP 9 | 10 | #include "gtest/gtest.h" 11 | 12 | // tests_common 13 | #include "check_result.hpp" 14 | #include "test_name_format.hpp" 15 | 16 | #define QPL_UNIT_API_ALGORITHMIC_TEST(entity, test) TEST(QPL_UNIT_SUITE_NAME(ta, entity), test) 17 | 18 | #define QPL_UNIT_API_BAD_ARGUMENT_TEST(entity, test) TEST(QPL_UNIT_SUITE_NAME(tb, entity), test) 19 | 20 | #endif //QPL_TOOLS_TESTS_FUNCTIONAL_UNIT_TESTS_ALGORITHMIC_T_COMMON_HPP 21 | -------------------------------------------------------------------------------- /tools/tests/fuzzing/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ========================================================================== 2 | # Copyright (C) 2022 Intel Corporation 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # ========================================================================== 6 | 7 | set(CMAKE_CXX_STANDARD 17) 8 | 9 | add_subdirectory(low-level-api) 10 | 11 | -------------------------------------------------------------------------------- /tools/tests/fuzzing/low-level-api/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ========================================================================== 2 | # Copyright (C) 2022 Intel Corporation 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # ========================================================================== 6 | 7 | project(ll_fuzzing VERSION 1.0 LANGUAGES CXX) 8 | 9 | file(GLOB CPP_FILES "*.cpp") 10 | add_custom_target(ll_fuzzy_tests) 11 | foreach (FILE ${CPP_FILES}) 12 | foreach (QPL_EXECUTION_PATH hw sw) 13 | file(RELATIVE_PATH FILE_REL_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${FILE}) 14 | string(REPLACE ".cpp" "" TARGET_NAME "${FILE_REL_PATH}") 15 | set(TARGET_NAME "${TARGET_NAME}_${QPL_EXECUTION_PATH}") 16 | add_executable(${TARGET_NAME} ${FILE_REL_PATH}) 17 | target_compile_options(${TARGET_NAME} 18 | PRIVATE $<$:-DQPL_EXECUTION_PATH=qpl_path_hardware> 19 | PRIVATE $<$:-DQPL_EXECUTION_PATH=qpl_path_software>) 20 | target_link_libraries(${TARGET_NAME} PRIVATE qpl) 21 | add_dependencies(ll_fuzzy_tests ${TARGET_NAME}) 22 | endforeach() 23 | endforeach() 24 | -------------------------------------------------------------------------------- /tools/tests/thread_tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ========================================================================== 2 | # Copyright (C) 2022 Intel Corporation 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # ========================================================================== 6 | 7 | # Intel® Query Processing Library (Intel® QPL) 8 | # Build system 9 | 10 | enable_language(CXX) 11 | 12 | file(GLOB SOURCES *.cpp) 13 | 14 | add_library(thread_tests OBJECT ${SOURCES}) 15 | 16 | target_link_libraries(thread_tests 17 | PRIVATE tests_common 18 | PRIVATE qpl) 19 | 20 | set_target_properties(thread_tests PROPERTIES CXX_STANDARD 17) 21 | 22 | target_compile_definitions(thread_tests 23 | PRIVATE $) 24 | 25 | target_compile_options(thread_tests 26 | PRIVATE $) 27 | -------------------------------------------------------------------------------- /tools/tests/thread_tests/tt_common.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_TESTS_THREAD_TESTS_TT_COMMON_HPP 8 | #define QPL_TOOLS_TESTS_THREAD_TESTS_TT_COMMON_HPP 9 | 10 | // tests_common 11 | #include "check_result.hpp" 12 | #include "test_cases.hpp" 13 | #include "test_name_format.hpp" 14 | 15 | #define QPL_LOW_LEVEL_API_ALGORITHMIC_TEST(operation, test) TEST(QPL_LOW_LEVEL_SUITE_NAME(tt, operation), test) 16 | 17 | #endif //QPL_TOOLS_TESTS_THREAD_TESTS_TT_COMMON_HPP 18 | -------------------------------------------------------------------------------- /tools/utils/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ========================================================================== 2 | # Copyright (C) 2022 Intel Corporation 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # ========================================================================== 6 | 7 | # Intel® Query Processing Library (Intel® QPL) 8 | # Build system 9 | 10 | add_subdirectory(common) 11 | add_subdirectory(generators) 12 | add_subdirectory(hw_dispatcher) 13 | -------------------------------------------------------------------------------- /tools/utils/common/algorithmic_dataset.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | /* 8 | * Intel® Query Processing Library (Intel® QPL) 9 | * Tools 10 | */ 11 | 12 | #include "algorithmic_dataset.hpp" 13 | 14 | namespace qpl::tools { 15 | // List of files we don't want to appear in algorithmic testing 16 | const std::string excluded_files[] = {"bib_eobs_bfinal", "gen_all_ll.bin", "gen_all_ll.def", "gen_large_dist.bin", 17 | "gen_large_dist.def"}; 18 | 19 | algorithmic_dataset_t::algorithmic_dataset_t(const std::string& path) : dataset_t(path) { 20 | // Erase all files we don't want to be in algorithmic dataset 21 | for (auto& value : excluded_files) { 22 | data_.erase(value); 23 | } 24 | } 25 | } // namespace qpl::tools 26 | -------------------------------------------------------------------------------- /tools/utils/common/algorithmic_dataset.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | /* 8 | * Intel® Query Processing Library (Intel® QPL) 9 | * Tools 10 | */ 11 | 12 | #ifndef QPL_TOOLS_UTILS_COMMON_ALGORITHMIC_DATASET_HPP 13 | #define QPL_TOOLS_UTILS_COMMON_ALGORITHMIC_DATASET_HPP 14 | 15 | #include "dataset.hpp" 16 | 17 | namespace qpl::tools { 18 | class algorithmic_dataset_t : public dataset_t { 19 | public: 20 | explicit algorithmic_dataset_t(const std::string& path); 21 | }; 22 | } // namespace qpl::tools 23 | #endif //QPL_TOOLS_UTILS_COMMON_ALGORITHMIC_DATASET_HPP 24 | -------------------------------------------------------------------------------- /tools/utils/common/arguments_list.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | /* 8 | * Intel® Query Processing Library (Intel® QPL) 9 | * Tests 10 | */ 11 | 12 | #ifndef QPL_TOOLS_UTILS_COMMON_ARGUMENTS_LIST_HPP 13 | #define QPL_TOOLS_UTILS_COMMON_ARGUMENTS_LIST_HPP 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | #include "qpl/c_api/defs.h" 20 | 21 | // All Intel QPL test arguments defined there: 22 | #define QPL_ARG_SEED "--seed" 23 | #define QPL_ARG_PATH "--path" 24 | #define QPL_ARG_DATASET_PATH "--dataset" 25 | #define QPL_ARG_TEST_CASE_ID "--testid" 26 | #define QPL_ARG_ASYNC "--async" 27 | #define QPL_ARG_HELP "--qpl-tests-help" 28 | 29 | namespace qpl::test::util { 30 | /** 31 | * @briеf Structure that holds parsed arguments 32 | */ 33 | struct arguments_list_t { 34 | qpl_path_t execution_path = qpl_path_software; 35 | uint32_t seed = {}; 36 | std::string path_to_dataset = {}; 37 | uint32_t test_case_id = {}; 38 | bool is_test_case_id_used = false; 39 | bool is_async_testing = false; 40 | }; 41 | } // namespace qpl::test::util 42 | 43 | #endif //QPL_TOOLS_UTILS_COMMON_ARGUMENTS_LIST_HPP 44 | -------------------------------------------------------------------------------- /tools/utils/common/command_line.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | /* 8 | * Intel® Query Processing Library (Intel® QPL) 9 | * Tests 10 | */ 11 | 12 | #ifndef QPL_TOOLS_UTILS_COMMON_COMMAND_LINE_HPP 13 | #define QPL_TOOLS_UTILS_COMMON_COMMAND_LINE_HPP 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | namespace qpl::test { 22 | class CommandLine { 23 | public: 24 | CommandLine(char** arguments_pptr, int arguments_count); 25 | 26 | template 27 | auto find(const std::string& parameter_name) -> std::optional; 28 | 29 | private: 30 | using argument_t = std::variant; 31 | 32 | std::map parsed_arguments_; 33 | 34 | static argument_t convertType(const std::string& parsed_argument); 35 | }; 36 | } // namespace qpl::test 37 | #endif //QPL_TOOLS_UTILS_COMMON_COMMAND_LINE_HPP 38 | -------------------------------------------------------------------------------- /tools/utils/common/compare_huffman_table.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_UTILS_COMMON_COMPARE_HUFFMAN_TABLE_HPP 8 | #define QPL_TOOLS_UTILS_COMMON_COMPARE_HUFFMAN_TABLE_HPP 9 | 10 | // qpl_huffman_table_t definition 11 | #include "qpl/c_api/huffman_table.h" 12 | 13 | namespace qpl::test { 14 | [[nodiscard]] qpl_status qpl_huffman_table_compare(const qpl_huffman_table_t table, 15 | const qpl_huffman_table_t other_table, 16 | bool* are_huffman_tables_equal); 17 | } 18 | 19 | #endif //QPL_TOOLS_UTILS_COMMON_COMPARE_HUFFMAN_TABLE_HPP 20 | -------------------------------------------------------------------------------- /tools/utils/common/dataset.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | /* 8 | * Intel® Query Processing Library (Intel® QPL) 9 | * Tools 10 | */ 11 | 12 | #ifndef QPL_TOOLS_UTILS_COMMON_DATASET_HPP 13 | #define QPL_TOOLS_UTILS_COMMON_DATASET_HPP 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | namespace qpl::tools { 21 | 22 | class dataset_t { 23 | using dataset_data_t = std::unordered_map>; 24 | 25 | public: 26 | explicit dataset_t(const std::string& path); 27 | 28 | [[nodiscard]] auto operator[](const std::string& key) const -> const std::vector&; 29 | 30 | friend std::ostream& operator<<(std::ostream& out, const dataset_t& dataset); 31 | 32 | [[nodiscard]] size_t size() const noexcept; 33 | 34 | [[nodiscard]] auto get_data() const -> const dataset_data_t&; 35 | 36 | protected: 37 | dataset_data_t data_ {}; //NOLINT(misc-non-private-member-variables-in-classes) 38 | private: 39 | std::string path_; 40 | }; 41 | } // namespace qpl::tools 42 | 43 | #endif //QPL_TOOLS_UTILS_COMMON_DATASET_HPP 44 | -------------------------------------------------------------------------------- /tools/utils/common/topology.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2024 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_UTILS_COMMON_TOPOLOGY_HPP 8 | #define QPL_TOOLS_UTILS_COMMON_TOPOLOGY_HPP 9 | 10 | #include 11 | 12 | namespace qpl::test { 13 | 14 | int32_t get_numa_id() noexcept; 15 | 16 | uint64_t get_socket_id() noexcept; 17 | 18 | uint64_t get_socket_id(int numa_node) noexcept; 19 | 20 | } // namespace qpl::test 21 | 22 | #endif //QPL_TOOLS_UTILS_COMMON_TOPOLOGY_HPP 23 | -------------------------------------------------------------------------------- /tools/utils/generators/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ========================================================================== 2 | # Copyright (C) 2022 Intel Corporation 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # ========================================================================== 6 | 7 | # Intel® Query Processing Library (Intel® QPL) 8 | # Build system 9 | 10 | enable_language(CXX) 11 | 12 | file(GLOB_RECURSE QPL_GEN_CXX_SRC "*.cpp") 13 | file(GLOB_RECURSE QPL_GEN_C_SRC "*.c") 14 | 15 | #set(QPL_GEN_ASM_SRC 16 | # "deflate_generator/asm_intel64/expand_l_tree.asm" 17 | # "deflate_generator/asm_intel64/proc_heap.asm") 18 | 19 | add_library(tool_generator OBJECT 20 | ${QPL_GEN_CXX_SRC} 21 | ${QPL_GEN_C_SRC} 22 | ${QPL_GEN_ASM_SRC}) 23 | 24 | target_include_directories(tool_generator 25 | PUBLIC $ 26 | PRIVATE $ 27 | PRIVATE $) 28 | 29 | set_target_properties(tool_generator PROPERTIES 30 | CXX_STANDARD 17 31 | C_STANDARD 99) 32 | 33 | target_compile_options(tool_generator PRIVATE 34 | "$<$:>" 35 | "$<$:>") 36 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/common_methods.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | #ifndef QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_COMMON_METHODS_HPP 7 | #define QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_COMMON_METHODS_HPP 8 | 9 | #include "gendefs.hpp" 10 | 11 | namespace gz_generator { 12 | class CommonMethods { 13 | public: 14 | static Gen8u bsr_32(Gen32u number); 15 | static void shuffle_32u(Gen32u* vector_ptr, Gen32u vectorLength, Gen32u seed); 16 | static Gen32u pick(Gen32u* vector_ptr, Gen32u vectorLength, Gen32u seed); 17 | static Gen32u code2Match(Gen32u code, Gen32u seed); 18 | }; 19 | } // namespace gz_generator 20 | #endif //QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_COMMON_METHODS_HPP 21 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/break_block_configurators/bad_distance.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #include "bad_distance.hpp" 8 | 9 | GenStatus gz_generator::BadDistanceConfigurator::generate() { 10 | Gen32u offset = 0U; 11 | Gen32u match = 0U; 12 | Gen32u literalsEncoded = 0U; 13 | 14 | declareRandomHuffmanBlock(); 15 | 16 | literalsEncoded = TestConfigurator::writeRandomReferenceSequence(DEFAULT_MAX_OFFSET + 1U, literalsEncoded, 17 | DEFAULT_MAX_OFFSET + 1U); 18 | 19 | if (0.5F > static_cast(get_m_random())) { 20 | offset = MAX_OFFSET + static_cast(update_range_m_randomOffset(1U, 16U)); 21 | } else { 22 | offset = static_cast(update_range_m_randomOffset(MAX_OFFSET + 1U, DEFAULT_MAX_OFFSET)); 23 | } 24 | 25 | match = static_cast(update_range_m_randomMatch(MIN_MATCH, GEN_MIN(literalsEncoded, MAX_MATCH))); 26 | 27 | TestConfigurator::declareReference(match, offset); 28 | 29 | TestConfigurator::writeRandomHuffmanBlock(); 30 | TestConfigurator::declareFinishBlock(); 31 | 32 | return GEN_OK; 33 | } 34 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/break_block_configurators/bad_distance.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_BLOCK_CONFIGURATORS_BAD_DISTANCE_HPP 8 | #define QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_BLOCK_CONFIGURATORS_BAD_DISTANCE_HPP 9 | 10 | #include "base_configurator.hpp" 11 | 12 | namespace gz_generator { 13 | class BadDistanceConfigurator : public TestConfigurator { 14 | public: 15 | BadDistanceConfigurator(Gen32u seed) : TestConfigurator(seed) {} 16 | 17 | BadDistanceConfigurator() = delete; 18 | 19 | GenStatus generate() override; 20 | }; 21 | } // namespace gz_generator 22 | #endif //QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_BLOCK_CONFIGURATORS_BAD_DISTANCE_HPP 23 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/break_block_configurators/bad_stored_length.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #include "bad_stored_length.hpp" 8 | 9 | GenStatus gz_generator::BadStoredLengthConfigurator::generate() { 10 | Gen32u testGroup = 0U; 11 | qpl::test::random randomTestGroup; 12 | 13 | TestConfigurator::declareStoredBlock(); 14 | 15 | qpl::test::random tmp; 16 | 17 | if (static_cast(get_m_random()) < 0.67F) { 18 | tmp = update_range_m_randomTokenCount(0U, 32U); 19 | } else { 20 | tmp = update_range_m_randomTokenCount(0U, 0xFFFF); 21 | } 22 | 23 | TestConfigurator::writeRandomLiteralSequence((Gen32u)tmp); 24 | 25 | if (static_cast(get_m_random()) < 0.5F) { 26 | randomTestGroup.set_range(0U, 15U); 27 | testGroup = 1U << static_cast(randomTestGroup); 28 | } else { 29 | randomTestGroup.set_range(0U, 0xFFFFU); 30 | testGroup = static_cast(randomTestGroup); 31 | } 32 | 33 | TestConfigurator::declareTestToken(8U, testGroup); 34 | 35 | TestConfigurator::writeRandomHuffmanBlock(); 36 | TestConfigurator::declareFinishBlock(); 37 | 38 | return GEN_OK; 39 | } 40 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/break_block_configurators/bad_stored_length.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_BLOCK_CONFIGURATORS_BAD_STORED_LENGTH_HPP 8 | #define QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_BLOCK_CONFIGURATORS_BAD_STORED_LENGTH_HPP 9 | 10 | #include "base_configurator.hpp" 11 | 12 | namespace gz_generator { 13 | class BadStoredLengthConfigurator : public TestConfigurator { 14 | public: 15 | BadStoredLengthConfigurator(Gen32u seed) : TestConfigurator(seed) {} 16 | 17 | BadStoredLengthConfigurator() = delete; 18 | 19 | GenStatus generate() override; 20 | }; 21 | } // namespace gz_generator 22 | 23 | #endif //QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_BLOCK_CONFIGURATORS_BAD_STORED_LENGTH_HPP 24 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/break_block_configurators/distance_before_start.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #include "distance_before_start.hpp" 8 | 9 | GenStatus gz_generator::DistanceCodeBeforeStartConfigurator::generate() { 10 | Gen32u offset = 0; 11 | Gen32u match = 0; 12 | Gen32u literalsEncoded = 0; 13 | 14 | qpl::test::random tmp = update_range_m_randomTokenCount(0U, 32U); 15 | TestConfigurator::declareRandomHuffmanBlock(); 16 | 17 | literalsEncoded = TestConfigurator::writeRandomReferenceSequence(static_cast(tmp), 0U, 3800U); 18 | if (0.5F > static_cast(get_m_random())) { 19 | offset = literalsEncoded + static_cast(update_range_m_randomOffset(1U, 16U)); 20 | } else { 21 | offset = static_cast(update_range_m_randomOffset(literalsEncoded + 1U, 4096U)); 22 | } 23 | 24 | match = static_cast(update_range_m_randomMatch(MIN_MATCH, GEN_MIN(literalsEncoded, MAX_MATCH))); 25 | 26 | TestConfigurator::declareReference(match, offset); 27 | 28 | TestConfigurator::writeRandomHuffmanBlock(); 29 | TestConfigurator::declareFinishBlock(); 30 | 31 | return GEN_OK; 32 | } 33 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/break_block_configurators/distance_before_start.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_BLOCK_CONFIGURATORS_DISTANCE_BEFORE_START_HPP 8 | #define QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_BLOCK_CONFIGURATORS_DISTANCE_BEFORE_START_HPP 9 | 10 | #include "base_configurator.hpp" 11 | 12 | namespace gz_generator { 13 | class DistanceCodeBeforeStartConfigurator : public TestConfigurator { 14 | public: 15 | DistanceCodeBeforeStartConfigurator(Gen32u seed) : TestConfigurator(seed) {} 16 | 17 | DistanceCodeBeforeStartConfigurator() = delete; 18 | 19 | GenStatus generate() override; 20 | }; 21 | } // namespace gz_generator 22 | 23 | #endif //QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_BLOCK_CONFIGURATORS_DISTANCE_BEFORE_START_HPP 24 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/break_block_configurators/unallowable_d_code.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #include "unallowable_d_code.hpp" 8 | 9 | GenStatus gz_generator::UnallowableDistanceCodeConfigurator::generate() { 10 | Gen32u match = 0U; 11 | Gen32u offset = 0U; 12 | Gen32u literalsEncoded = 0U; 13 | 14 | qpl::test::random tmp = update_range_m_randomTokenCount(1U, 50U); 15 | 16 | TestConfigurator::declareFixedBlock(); 17 | if (0.9F > static_cast(get_m_random())) { 18 | literalsEncoded = TestConfigurator::writeRandomReferenceSequence(static_cast(tmp)); 19 | } 20 | 21 | match = static_cast( 22 | update_range_m_randomMatch(MIN_MATCH, GEN_MIN(GEN_MAX(literalsEncoded, MIN_MATCH), MAX_MATCH))); 23 | offset = DEFAULT_MAX_OFFSET + static_cast(update_range_m_randomOffset(30U, 31U)); 24 | literalsEncoded += match; 25 | 26 | TestConfigurator::declareReference(match, offset); 27 | 28 | if (0.9F > static_cast(get_m_random())) { 29 | TestConfigurator::writeRandomReferenceSequence(static_cast(tmp), literalsEncoded); 30 | } 31 | 32 | TestConfigurator::writeRandomHuffmanBlock(); 33 | TestConfigurator::declareFinishBlock(); 34 | 35 | return GEN_OK; 36 | } 37 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/break_block_configurators/unallowable_d_code.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_BLOCK_CONFIGURATORS_UNALLOWABLE_D_CODE_HPP 8 | #define QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_BLOCK_CONFIGURATORS_UNALLOWABLE_D_CODE_HPP 9 | 10 | #include "base_configurator.hpp" 11 | 12 | namespace gz_generator { 13 | class UnallowableDistanceCodeConfigurator : public TestConfigurator { 14 | public: 15 | UnallowableDistanceCodeConfigurator(Gen32u seed) : TestConfigurator(seed) {} 16 | 17 | UnallowableDistanceCodeConfigurator() = delete; 18 | 19 | GenStatus generate() override; 20 | }; 21 | } // namespace gz_generator 22 | 23 | #endif //QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_BLOCK_CONFIGURATORS_UNALLOWABLE_D_CODE_HPP 24 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/break_block_configurators/unallowable_ll_code.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #include "unallowable_ll_code.hpp" 8 | 9 | /** 10 | * @brief Generate stream where literal is more 285 and uses reserved symbols 286 and 287 11 | * @return 12 | */ 13 | GenStatus gz_generator::UnallowableLiteralLengthCodeConfigurator::generate() { 14 | Gen32u literalsEncoded = 0; 15 | qpl::test::random randomUndefinedLiteral(286, 287, get_m_seed()); 16 | 17 | qpl::test::random tmp = update_range_m_randomTokenCount(1, 50); 18 | 19 | TestConfigurator::declareFixedBlock(); 20 | 21 | if (0.9F > static_cast(get_m_random())) { 22 | literalsEncoded = TestConfigurator::writeRandomReferenceSequence(static_cast(tmp)); 23 | } 24 | TestConfigurator::declareLiteral(static_cast(randomUndefinedLiteral)); 25 | literalsEncoded += 1; 26 | 27 | if (0.9F > static_cast(get_m_random())) { 28 | TestConfigurator::writeRandomReferenceSequence(static_cast(tmp), literalsEncoded); 29 | } 30 | 31 | TestConfigurator::writeRandomHuffmanBlock(); 32 | TestConfigurator::declareFinishBlock(); 33 | return GEN_OK; 34 | } 35 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/break_block_configurators/unallowable_ll_code.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_BLOCK_CONFIGURATORS_UNALLOWABLE_LL_CODE_HPP 8 | #define QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_BLOCK_CONFIGURATORS_UNALLOWABLE_LL_CODE_HPP 9 | 10 | #include "base_configurator.hpp" 11 | 12 | namespace gz_generator { 13 | class UnallowableLiteralLengthCodeConfigurator : public TestConfigurator { 14 | public: 15 | UnallowableLiteralLengthCodeConfigurator(Gen32u seed) : TestConfigurator(seed) {} 16 | 17 | UnallowableLiteralLengthCodeConfigurator() = delete; 18 | 19 | GenStatus generate() override; 20 | }; 21 | } // namespace gz_generator 22 | 23 | #endif //QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_BLOCK_CONFIGURATORS_UNALLOWABLE_LL_CODE_HPP 24 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/break_header_configurators/all_zero_literal_length_codes.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2023 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_ALL_ZERO_LITERAL_LENGTH_CODES_HPP 8 | #define QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_ALL_ZERO_LITERAL_LENGTH_CODES_HPP 9 | 10 | #include "base_configurator.hpp" 11 | 12 | namespace gz_generator { 13 | class AllZeroLiteralLengthCodesConfigurator : public TestConfigurator { 14 | // Not a seed dependent test, but here for consistency with other tests 15 | public: 16 | AllZeroLiteralLengthCodesConfigurator(Gen32u seed) : TestConfigurator(seed) {} 17 | 18 | AllZeroLiteralLengthCodesConfigurator() = delete; 19 | 20 | GenStatus generate() override; 21 | }; 22 | 23 | } // namespace gz_generator 24 | 25 | #endif //QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_ALL_ZERO_LITERAL_LENGTH_CODES_HPP 26 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/break_header_configurators/big_repeat_count_d_codes.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_BIG_REPEAT_COUNT_D_CODES_HPP 8 | #define QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_BIG_REPEAT_COUNT_D_CODES_HPP 9 | 10 | #include "base_configurator.hpp" 11 | 12 | namespace gz_generator { 13 | class BigRepeatCountDistanceLengthCodesConfigurator : public TestConfigurator { 14 | public: 15 | BigRepeatCountDistanceLengthCodesConfigurator(Gen32u seed) : TestConfigurator(seed) {} 16 | 17 | BigRepeatCountDistanceLengthCodesConfigurator() = delete; 18 | 19 | GenStatus generate() override; 20 | }; 21 | } // namespace gz_generator 22 | 23 | #endif //QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_BIG_REPEAT_COUNT_D_CODES_HPP 24 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/break_header_configurators/big_repeat_count_ll_codes.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_BIG_REPEAT_COUNT_LL_CODES_H 8 | #define QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_BIG_REPEAT_COUNT_LL_CODES_H 9 | 10 | #include "base_configurator.hpp" 11 | 12 | namespace gz_generator { 13 | class BigRepeatCountLiteralLengthCodesConfigurator : public TestConfigurator { 14 | public: 15 | BigRepeatCountLiteralLengthCodesConfigurator(Gen32u seed) : TestConfigurator(seed) {} 16 | 17 | BigRepeatCountLiteralLengthCodesConfigurator() = delete; 18 | 19 | GenStatus generate() override; 20 | }; 21 | } // namespace gz_generator 22 | 23 | #endif //QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_BIG_REPEAT_COUNT_LL_CODES_H 24 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/break_header_configurators/cl_codes_span_single_table.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_CL_CODES_SPAN_SINGLE_TABLE_HPP 8 | #define QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_CL_CODES_SPAN_SINGLE_TABLE_HPP 9 | 10 | #include "base_configurator.hpp" 11 | 12 | namespace gz_generator { 13 | class StradingCodeLengthCodesConfigurator : public TestConfigurator { 14 | public: 15 | StradingCodeLengthCodesConfigurator(Gen32u seed) : TestConfigurator(seed) {} 16 | 17 | StradingCodeLengthCodesConfigurator() = delete; 18 | 19 | GenStatus generate() override; 20 | }; 21 | } // namespace gz_generator 22 | 23 | #endif //QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_CL_CODES_SPAN_SINGLE_TABLE_HPP 24 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/break_header_configurators/first_d_16_code.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #include "first_d_16_code.hpp" 8 | 9 | GenStatus gz_generator::FirstDistanceLengthCode16Configurator::generate() { 10 | Gen32u* pDistanceLengthCodesTable = nullptr; 11 | qpl::test::random rand(4U, 7U, get_m_seed()); 12 | 13 | const Gen8u repeatingCount = static_cast(rand); 14 | 15 | pDistanceLengthCodesTable = new Gen32u[DEFAULT_D_TABLE_LENGTH]; 16 | 17 | TestConfigurator::makeRandomLengthCodesTable(pDistanceLengthCodesTable, DEFAULT_D_TABLE_LENGTH, 18 | MAX_D_CODE_BIT_LENGTH); 19 | 20 | for (Gen8u i = 1U; i < repeatingCount; i++) { 21 | pDistanceLengthCodesTable[i] = pDistanceLengthCodesTable[0]; 22 | } 23 | 24 | TestConfigurator::declareDynamicBlock(); 25 | TestConfigurator::declareVectorToken(D_VECTOR, pDistanceLengthCodesTable, DEFAULT_D_TABLE_LENGTH); 26 | TestConfigurator::declareVectorToken(D_ENCODED_VECTOR, pDistanceLengthCodesTable, DEFAULT_D_TABLE_LENGTH); 27 | TestConfigurator::declareTestToken(4U, 1U); 28 | 29 | TestConfigurator::writeRandomHuffmanBlock(); 30 | TestConfigurator::declareFinishBlock(); 31 | 32 | delete[] pDistanceLengthCodesTable; 33 | return GEN_OK; 34 | } 35 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/break_header_configurators/first_d_16_code.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_FIRST_D_16_CODE_HPP 8 | #define QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_FIRST_D_16_CODE_HPP 9 | 10 | #include "base_configurator.hpp" 11 | 12 | namespace gz_generator { 13 | class FirstDistanceLengthCode16Configurator : public TestConfigurator { 14 | public: 15 | FirstDistanceLengthCode16Configurator(Gen32u seed) : TestConfigurator(seed) {} 16 | 17 | FirstDistanceLengthCode16Configurator() = delete; 18 | 19 | GenStatus generate() override; 20 | }; 21 | } // namespace gz_generator 22 | 23 | #endif //QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_FIRST_D_16_CODE_HPP 24 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/break_header_configurators/first_ll_16_code.cpp: -------------------------------------------------------------------------------- 1 | #include "first_ll_16_code.hpp" 2 | 3 | /******************************************************************************* 4 | * Copyright (C) 2022 Intel Corporation 5 | * 6 | * SPDX-License-Identifier: MIT 7 | ******************************************************************************/ 8 | 9 | GenStatus gz_generator::FirstLiteralLengthCode16Configurator::generate() { 10 | Gen32u* pLiteralLengthCodesTable = nullptr; 11 | 12 | qpl::test::random rand(4U, 7U, get_m_seed()); 13 | 14 | const Gen8u repeatingCount = static_cast(rand); 15 | 16 | pLiteralLengthCodesTable = new Gen32u[DEFAULT_LL_TABLE_LENGTH]; 17 | 18 | TestConfigurator::makeRandomLengthCodesTable(pLiteralLengthCodesTable, DEFAULT_LL_TABLE_LENGTH, 19 | MAX_LL_CODE_BIT_LENGTH); 20 | 21 | for (Gen8u i = 1U; i < repeatingCount; i++) { 22 | pLiteralLengthCodesTable[i] = pLiteralLengthCodesTable[0U]; 23 | } 24 | 25 | TestConfigurator::declareDynamicBlock(); 26 | TestConfigurator::declareVectorToken(LL_VECTOR, pLiteralLengthCodesTable, DEFAULT_LL_TABLE_LENGTH); 27 | TestConfigurator::declareVectorToken(LL_ENCODED_VECTOR, pLiteralLengthCodesTable, DEFAULT_LL_TABLE_LENGTH); 28 | TestConfigurator::declareTestToken(4U, 0U); 29 | 30 | TestConfigurator::writeRandomHuffmanBlock(); 31 | TestConfigurator::declareFinishBlock(); 32 | 33 | delete[] pLiteralLengthCodesTable; 34 | 35 | return GEN_OK; 36 | } 37 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/break_header_configurators/first_ll_16_code.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_FIRST_LL_16_CODE_HPP 8 | #define QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_FIRST_LL_16_CODE_HPP 9 | 10 | #include "base_configurator.hpp" 11 | 12 | namespace gz_generator { 13 | class FirstLiteralLengthCode16Configurator : public TestConfigurator { 14 | public: 15 | FirstLiteralLengthCode16Configurator(Gen32u seed) : TestConfigurator(seed) {} 16 | 17 | FirstLiteralLengthCode16Configurator() = delete; 18 | 19 | GenStatus generate() override; 20 | }; 21 | } // namespace gz_generator 22 | 23 | #endif //QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_FIRST_LL_16_CODE_HPP 24 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/break_header_configurators/invalid_block.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #include "invalid_block.hpp" 8 | 9 | GenStatus gz_generator::InvalidBlockTypeConfigurator::generate() { 10 | TestConfigurator::writeRandomBlock(); 11 | TestConfigurator::declareInvalidBlock(); 12 | TestConfigurator::writeRandomBlock(); 13 | 14 | TestConfigurator::writeRandomHuffmanBlock(); 15 | TestConfigurator::declareFinishBlock(); 16 | 17 | return GEN_OK; 18 | } 19 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/break_header_configurators/invalid_block.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_INVALID_BLOCK_HPP 8 | #define QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_INVALID_BLOCK_HPP 9 | 10 | #include "base_configurator.hpp" 11 | 12 | namespace gz_generator { 13 | class InvalidBlockTypeConfigurator : public TestConfigurator { 14 | public: 15 | InvalidBlockTypeConfigurator(Gen32u seed) : TestConfigurator(seed) {} 16 | 17 | InvalidBlockTypeConfigurator() = delete; 18 | 19 | GenStatus generate() override; 20 | }; 21 | } // namespace gz_generator 22 | 23 | #endif //QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_INVALID_BLOCK_HPP 24 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/break_header_configurators/large_header.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_LARGE_HEADER_HPP 8 | #define QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_LARGE_HEADER_HPP 9 | 10 | #include "base_configurator.hpp" 11 | 12 | namespace gz_generator { 13 | class LargeHeaderConfigurator : public TestConfigurator { 14 | public: 15 | LargeHeaderConfigurator(Gen32u seed) : TestConfigurator(seed) {} 16 | 17 | LargeHeaderConfigurator() = delete; 18 | 19 | GenStatus generate() override; 20 | 21 | private: 22 | inline int static caclulateNumberLiteralLengthsCodesEqualTo13(Gen32u headerHighBitBorder, Gen32u header_bit_size) { 23 | return (int)((headerHighBitBorder - header_bit_size) / 2U); 24 | } 25 | 26 | GenStatus writeLiteralLengthsCodesForSmallHeader(Gen32u header_bit_size, Gen32u* pPossibleLiteralCount); 27 | GenStatus writeLiteralLengthCodes(Gen32u header_bit_size, Gen32u* pPossibleLiteralCount); 28 | GenStatus writeBlock(Gen32u blockByteSize); 29 | }; 30 | } // namespace gz_generator 31 | 32 | #endif //QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_LARGE_HEADER_HPP 33 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/break_header_configurators/many_distance_codes.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_MANY_DISTANCE_CODES_HPP 8 | #define QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_MANY_DISTANCE_CODES_HPP 9 | 10 | #include "base_configurator.hpp" 11 | 12 | namespace gz_generator { 13 | class ManyDistanceCodesConfigurator : public TestConfigurator { 14 | public: 15 | ManyDistanceCodesConfigurator(Gen32u seed) : TestConfigurator(seed) {} 16 | 17 | ManyDistanceCodesConfigurator() = delete; 18 | 19 | GenStatus generate() override; 20 | 21 | /** 22 | * return true if given POINT in run of length N is a breakpoint between sequences 23 | */ 24 | static bool breakInRun(Gen32u a, Gen32u b); 25 | }; 26 | } // namespace gz_generator 27 | 28 | #endif //QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_MANY_DISTANCE_CODES_HPP 29 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/break_header_configurators/many_distance_codes_v2.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #include "many_distance_codes_v2.hpp" 8 | 9 | GenStatus gz_generator::ManyDistanceCodesConfiguratorVersion2::generate() { 10 | const Gen32u extraCodesCount = 1U + static_cast(get_m_random()); 11 | const Gen32u total_codes = DEFAULT_D_TABLE_LENGTH + extraCodesCount; 12 | 13 | std::vector distanceLengthCodesTable(total_codes, 0); 14 | 15 | TestConfigurator::makeRandomLengthCodesTable(distanceLengthCodesTable.data(), total_codes, MAX_D_CODE_BIT_LENGTH); 16 | 17 | TestConfigurator::declareExtraLengths(); 18 | TestConfigurator::declareDynamicBlock(); 19 | 20 | TestConfigurator::declareVectorToken(D_ENCODED_VECTOR, distanceLengthCodesTable.data(), total_codes); 21 | 22 | TestConfigurator::declareLiteral(1U); 23 | TestConfigurator::declareLiteral(1U); 24 | TestConfigurator::declareLiteral(1U); 25 | 26 | TestConfigurator::writeRandomBlock(); 27 | TestConfigurator::declareFinishBlock(); 28 | 29 | return GEN_OK; 30 | } 31 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/break_header_configurators/many_distance_codes_v2.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_MANY_DISTANCE_CODES_V2_HPP 8 | #define QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_MANY_DISTANCE_CODES_V2_HPP 9 | 10 | #include "base_configurator.hpp" 11 | 12 | namespace gz_generator { 13 | class ManyDistanceCodesConfiguratorVersion2 : public TestConfigurator { 14 | public: 15 | ManyDistanceCodesConfiguratorVersion2(Gen32u seed) : TestConfigurator(seed) {} 16 | 17 | ManyDistanceCodesConfiguratorVersion2() = delete; 18 | 19 | GenStatus generate() override; 20 | }; 21 | } // namespace gz_generator 22 | 23 | #endif //QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_MANY_DISTANCE_CODES_V2_HPP 24 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/break_header_configurators/many_ll_codes.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #include "many_ll_codes.hpp" 8 | 9 | GenStatus gz_generator::ManyLiteralLengthCodesConfigurator::generate() { 10 | const Gen32u extraLengthCodesCount = 1U + static_cast(get_m_random()); 11 | const Gen32u total_codes = DEFAULT_LL_TABLE_LENGTH + extraLengthCodesCount; 12 | 13 | std::vector literalLengthCodesTable(total_codes, 0); 14 | 15 | TestConfigurator::makeRandomLengthCodesTable(literalLengthCodesTable.data(), total_codes, MAX_LL_CODE_BIT_LENGTH); 16 | 17 | TestConfigurator::declareExtraLengths(); 18 | TestConfigurator::declareDynamicBlock(); 19 | 20 | TestConfigurator::declareVectorToken(LL_ENCODED_VECTOR, literalLengthCodesTable.data(), total_codes); 21 | 22 | TestConfigurator::declareLiteral(1U); 23 | TestConfigurator::declareLiteral(1U); 24 | TestConfigurator::declareLiteral(1U); 25 | 26 | TestConfigurator::writeRandomBlock(); 27 | TestConfigurator::declareFinishBlock(); 28 | 29 | return GEN_OK; 30 | } 31 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/break_header_configurators/many_ll_codes.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_MANY_LL_CODES_HPP 8 | #define QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_MANY_LL_CODES_HPP 9 | 10 | #include "base_configurator.hpp" 11 | 12 | namespace gz_generator { 13 | class ManyLiteralLengthCodesConfigurator : public TestConfigurator { 14 | public: 15 | ManyLiteralLengthCodesConfigurator(Gen32u seed) : TestConfigurator(seed) {} 16 | 17 | ManyLiteralLengthCodesConfigurator() = delete; 18 | 19 | GenStatus generate() override; 20 | }; 21 | } // namespace gz_generator 22 | 23 | #endif //QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_MANY_LL_CODES_HPP 24 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/break_header_configurators/no_literal_length_code.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_NO_LITERAL_LENGTH_CODE_HPP 8 | #define QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_NO_LITERAL_LENGTH_CODE_HPP 9 | 10 | #include "base_configurator.hpp" 11 | 12 | namespace gz_generator { 13 | class NoLiteralLengthCodeConfigurator : public TestConfigurator { 14 | public: 15 | NoLiteralLengthCodeConfigurator(Gen32u seed) : TestConfigurator(seed) {} 16 | 17 | NoLiteralLengthCodeConfigurator() = delete; 18 | 19 | GenStatus generate() override; 20 | }; 21 | 22 | } // namespace gz_generator 23 | 24 | #endif //QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_NO_LITERAL_LENGTH_CODE_HPP 25 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/break_header_configurators/oversubscribed_cl_tree.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #include "oversubscribed_cl_tree.hpp" 8 | 9 | GenStatus gz_generator::OversubscribedCodeLengthsTreeConfigurator::generate() { 10 | Gen32u code_length = 0U; 11 | 12 | qpl::test::random randomCodeLength(0U, DEFAULT_CL_TABLE_LENGTH - 1U, get_m_seed()); 13 | 14 | std::vector codeLengthsTable(DEFAULT_CL_TABLE_LENGTH, 0U); 15 | 16 | makeRandomLengthCodesTable(codeLengthsTable.data(), DEFAULT_CL_TABLE_LENGTH, MAX_CL_CODE_BIT_LENGTH); 17 | 18 | TestConfigurator::declareDynamicBlock(); 19 | TestConfigurator::declareVectorToken(CL_VECTOR_ALT, codeLengthsTable.data(), DEFAULT_CL_TABLE_LENGTH); 20 | 21 | do { //NOLINT(cppcoreguidelines-avoid-do-while) 22 | code_length = static_cast(randomCodeLength); 23 | } while (codeLengthsTable[code_length] == 1U); 24 | codeLengthsTable[code_length]--; 25 | 26 | TestConfigurator::declareVectorToken(CL_ENCODED_VECTOR, codeLengthsTable.data(), DEFAULT_CL_TABLE_LENGTH); 27 | 28 | writeRandomHuffmanBlock(); 29 | declareFinishBlock(); 30 | 31 | return GEN_OK; 32 | } 33 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/break_header_configurators/oversubscribed_cl_tree.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_OVERSUBSCRIBED_CL_TREE_HPP 8 | #define QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_OVERSUBSCRIBED_CL_TREE_HPP 9 | 10 | #include "base_configurator.hpp" 11 | 12 | namespace gz_generator { 13 | class OversubscribedCodeLengthsTreeConfigurator : public TestConfigurator { 14 | public: 15 | OversubscribedCodeLengthsTreeConfigurator(Gen32u seed) : TestConfigurator(seed) {} 16 | 17 | OversubscribedCodeLengthsTreeConfigurator() = delete; 18 | 19 | GenStatus generate() override; 20 | }; 21 | } // namespace gz_generator 22 | 23 | #endif //QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_OVERSUBSCRIBED_CL_TREE_HPP 24 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/break_header_configurators/oversubscribed_d_tree.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #include "oversubscribed_d_tree.hpp" 8 | 9 | GenStatus gz_generator::OversubscribedDistanceTreeConfigurator::generate() { 10 | Gen32u distanceLengthCode = 0U; 11 | 12 | qpl::test::random randomDistanceLengthCode(0U, 29U, get_m_seed()); 13 | 14 | std::vector distanceLengthsTable(DEFAULT_D_TABLE_LENGTH, 0U); 15 | 16 | TestConfigurator::makeRandomLengthCodesTable(distanceLengthsTable.data(), DEFAULT_D_TABLE_LENGTH, 17 | MAX_D_CODE_BIT_LENGTH); 18 | 19 | TestConfigurator::declareDynamicBlock(); 20 | TestConfigurator::declareVectorToken(D_VECTOR, distanceLengthsTable.data(), DEFAULT_D_TABLE_LENGTH); 21 | 22 | do { //NOLINT(cppcoreguidelines-avoid-do-while) 23 | distanceLengthCode = static_cast(randomDistanceLengthCode); 24 | } while (distanceLengthsTable[distanceLengthCode] == 1U); 25 | distanceLengthsTable[distanceLengthCode]--; 26 | 27 | TestConfigurator::declareVectorToken(D_ENCODED_VECTOR, distanceLengthsTable.data(), DEFAULT_D_TABLE_LENGTH); 28 | 29 | TestConfigurator::writeRandomHuffmanBlock(); 30 | TestConfigurator::declareFinishBlock(); 31 | 32 | return GEN_OK; 33 | } 34 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/break_header_configurators/oversubscribed_d_tree.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_OVERSUBSCRIBED_D_TREE_HPP 8 | #define QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_OVERSUBSCRIBED_D_TREE_HPP 9 | 10 | #include "base_configurator.hpp" 11 | 12 | namespace gz_generator { 13 | class OversubscribedDistanceTreeConfigurator : public TestConfigurator { 14 | public: 15 | OversubscribedDistanceTreeConfigurator(Gen32u seed) : TestConfigurator(seed) {} 16 | 17 | OversubscribedDistanceTreeConfigurator() = delete; 18 | 19 | GenStatus generate() override; 20 | }; 21 | } // namespace gz_generator 22 | 23 | #endif //QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_OVERSUBSCRIBED_D_TREE_HPP 24 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/break_header_configurators/oversubscribed_ll_tree.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #include "oversubscribed_ll_tree.hpp" 8 | 9 | GenStatus gz_generator::OversubscribedLiteralLengthsTreeConfigurator::generate() { 10 | // Gen32u* pLiteralLengthsTable = nullptr; 11 | Gen32u literalLength = 0U; 12 | 13 | qpl::test::random randomLiteralLength(0U, DEFAULT_LL_TABLE_LENGTH - 1U, get_m_seed()); 14 | 15 | std::vector literalLengthsTable(DEFAULT_LL_TABLE_LENGTH, 0U); 16 | 17 | TestConfigurator::makeRandomLengthCodesTable(literalLengthsTable.data(), DEFAULT_LL_TABLE_LENGTH, 18 | MAX_LL_CODE_BIT_LENGTH); 19 | 20 | TestConfigurator::declareDynamicBlock(); 21 | TestConfigurator::declareVectorToken(LL_VECTOR, literalLengthsTable.data(), DEFAULT_LL_TABLE_LENGTH); 22 | 23 | do { //NOLINT(cppcoreguidelines-avoid-do-while) 24 | literalLength = static_cast(randomLiteralLength); 25 | } while (literalLengthsTable[literalLength] == 1U); 26 | literalLengthsTable[literalLength]--; 27 | 28 | TestConfigurator::declareVectorToken(LL_ENCODED_VECTOR, literalLengthsTable.data(), DEFAULT_LL_TABLE_LENGTH); 29 | 30 | TestConfigurator::writeRandomHuffmanBlock(); 31 | TestConfigurator::declareFinishBlock(); 32 | 33 | return GEN_OK; 34 | } 35 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/break_header_configurators/oversubscribed_ll_tree.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_OVERSUBSCRIBED_LL_TREE_HPP 8 | #define QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_OVERSUBSCRIBED_LL_TREE_HPP 9 | 10 | #include "base_configurator.hpp" 11 | 12 | namespace gz_generator { 13 | class OversubscribedLiteralLengthsTreeConfigurator : public TestConfigurator { 14 | public: 15 | OversubscribedLiteralLengthsTreeConfigurator(Gen32u seed) : TestConfigurator(seed) {} 16 | 17 | OversubscribedLiteralLengthsTreeConfigurator() = delete; 18 | 19 | GenStatus generate() override; 20 | }; 21 | } // namespace gz_generator 22 | 23 | #endif //QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_OVERSUBSCRIBED_LL_TREE_HPP 24 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/break_header_configurators/undefined_cl_code.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_UNDEFINED_CL_CODE_HPP 8 | #define QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_UNDEFINED_CL_CODE_HPP 9 | 10 | #include "base_configurator.hpp" 11 | 12 | namespace gz_generator { 13 | class UndefinedCodeLengthCodeConfigurator : public TestConfigurator { 14 | public: 15 | UndefinedCodeLengthCodeConfigurator(Gen32u seed) : TestConfigurator(seed) {} 16 | 17 | UndefinedCodeLengthCodeConfigurator() = delete; 18 | 19 | GenStatus generate() override; 20 | }; 21 | } // namespace gz_generator 22 | 23 | #endif //QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_BREAK_HEADER_CONFIGURATORS_UNDEFINED_CL_CODE_HPP 24 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/correct_stream_generators/canned_large_ll_table.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_CORRECT_STREAM_GENERATORS_CANNED_LARGE_LL_TABLE_HPP 8 | #define QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_CORRECT_STREAM_GENERATORS_CANNED_LARGE_LL_TABLE_HPP 9 | 10 | #include "base_configurator.hpp" 11 | 12 | namespace gz_generator { 13 | class CannedLargeLiteralLengthTableConfigurator : public TestConfigurator { 14 | public: 15 | CannedLargeLiteralLengthTableConfigurator(Gen32u seed) : TestConfigurator(seed) {} // need to redesign base class 16 | 17 | CannedLargeLiteralLengthTableConfigurator() = delete; 18 | 19 | GenStatus generate() override; 20 | }; 21 | } // namespace gz_generator 22 | 23 | #endif //QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_CORRECT_STREAM_GENERATORS_CANNED_LARGE_LL_TABLE_HPP 24 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/correct_stream_generators/canned_small_blocks.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #include "canned_small_blocks.hpp" 8 | 9 | GenStatus gz_generator::CannedSmallBlocksConfigurator::generate() { 10 | Gen32u currentLiteral = 0; 11 | 12 | for (Gen32u maxReferencesInBlock = 0; maxReferencesInBlock < 4U; maxReferencesInBlock++) { 13 | for (Gen32u maxLiteralsCurrentBlock = 0; maxLiteralsCurrentBlock < 4U; maxLiteralsCurrentBlock++) { 14 | 15 | TestConfigurator::declareDynamicBlock(); 16 | 17 | //generate constant literal sequence 18 | for (Gen32u literals = 0; literals < maxLiteralsCurrentBlock; literals++) { 19 | TestConfigurator::declareLiteral(currentLiteral++); 20 | } 21 | 22 | //generate references to literal sequence 23 | for (Gen32u lookUp = 0; lookUp < maxLiteralsCurrentBlock; lookUp++) { 24 | const Gen32u match = lookUp + MIN_MATCH; 25 | const Gen32u offset = lookUp + 1U; 26 | TestConfigurator::declareReference(match, offset); 27 | } 28 | } 29 | } 30 | 31 | TestConfigurator::declareFinishBlock(); 32 | 33 | return GEN_OK; 34 | } 35 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/correct_stream_generators/canned_small_blocks.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_CORRECT_STREAM_GENERATORS_CANNED_SMALL_BLOCKS_HPP 8 | #define QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_CORRECT_STREAM_GENERATORS_CANNED_SMALL_BLOCKS_HPP 9 | 10 | #include "base_configurator.hpp" 11 | 12 | namespace gz_generator { 13 | class CannedSmallBlocksConfigurator : public TestConfigurator { 14 | public: 15 | CannedSmallBlocksConfigurator(Gen32u seed) : TestConfigurator(seed) {} 16 | 17 | CannedSmallBlocksConfigurator() = delete; 18 | 19 | GenStatus generate() override; 20 | }; 21 | } // namespace gz_generator 22 | 23 | #endif //QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_CORRECT_STREAM_GENERATORS_CANNED_SMALL_BLOCKS_HPP 24 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/correct_stream_generators/dynamic_block_no_err.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #include "dynamic_block_no_err.hpp" 8 | 9 | GenStatus gz_generator::DynamicBlockNoErrorConfigurator::generate() { 10 | TestConfigurator::declareDynamicBlock(); 11 | TestConfigurator::writeRandomReferenceSequence(static_cast(update_range_m_randomTokenCount(5000U, 10000U))); 12 | TestConfigurator::declareFinishBlock(); 13 | 14 | return GEN_OK; 15 | } 16 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/correct_stream_generators/dynamic_block_no_err.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_CORRECT_STREAM_GENERATORS_DYNAMIC_BLOCK_NO_ERR_HPP 8 | #define QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_CORRECT_STREAM_GENERATORS_DYNAMIC_BLOCK_NO_ERR_HPP 9 | 10 | #include "base_configurator.hpp" 11 | 12 | namespace gz_generator { 13 | class DynamicBlockNoErrorConfigurator : public TestConfigurator { 14 | public: 15 | DynamicBlockNoErrorConfigurator(Gen32u seed) : TestConfigurator(seed) {} 16 | 17 | DynamicBlockNoErrorConfigurator() = delete; 18 | 19 | GenStatus generate() override; 20 | }; 21 | } // namespace gz_generator 22 | 23 | #endif //QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_CORRECT_STREAM_GENERATORS_DYNAMIC_BLOCK_NO_ERR_HPP 24 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/correct_stream_generators/fixed_block_no_err.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #include "fixed_block_no_err.hpp" 8 | 9 | GenStatus gz_generator::FixedBlockNoErrorConfigurator::generate() { 10 | TestConfigurator::declareFixedBlock(); 11 | TestConfigurator::writeRandomReferenceSequence(static_cast(update_range_m_randomTokenCount(5000U, 10000U))); 12 | TestConfigurator::declareFinishBlock(); 13 | 14 | return GEN_OK; 15 | } 16 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/correct_stream_generators/fixed_block_no_err.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_CORRECT_STREAM_GENERATORS_FIXED_BLOCK_NO_ERR_HPP 8 | #define QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_CORRECT_STREAM_GENERATORS_FIXED_BLOCK_NO_ERR_HPP 9 | 10 | #include "base_configurator.hpp" 11 | 12 | namespace gz_generator { 13 | class FixedBlockNoErrorConfigurator : public TestConfigurator { 14 | public: 15 | FixedBlockNoErrorConfigurator(Gen32u seed) : TestConfigurator(seed) {} 16 | 17 | FixedBlockNoErrorConfigurator() = delete; 18 | 19 | GenStatus generate() override; 20 | }; 21 | } // namespace gz_generator 22 | 23 | #endif //QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_CORRECT_STREAM_GENERATORS_FIXED_BLOCK_NO_ERR_HPP 24 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/correct_stream_generators/stored_block_no_err.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #include "stored_block_no_err.hpp" 8 | 9 | GenStatus gz_generator::StoredBlockNoErrorConfigurator::generate() { 10 | TestConfigurator::writeRandomStoredBlock(); 11 | TestConfigurator::declareFinishBlock(); 12 | 13 | return GEN_OK; 14 | } 15 | -------------------------------------------------------------------------------- /tools/utils/generators/configurators/rfc1951_stream/correct_stream_generators/stored_block_no_err.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_CORRECT_STREAM_GENERATORS_STORED_BLOCK_NO_ERR_HPP 8 | #define QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_CORRECT_STREAM_GENERATORS_STORED_BLOCK_NO_ERR_HPP 9 | 10 | #include "base_configurator.hpp" 11 | 12 | namespace gz_generator { 13 | class StoredBlockNoErrorConfigurator : public TestConfigurator { 14 | public: 15 | StoredBlockNoErrorConfigurator(Gen32u seed) : TestConfigurator(seed) {} 16 | 17 | StoredBlockNoErrorConfigurator() = delete; 18 | 19 | GenStatus generate() override; 20 | }; 21 | } // namespace gz_generator 22 | 23 | #endif //QPL_TOOLS_UTILS_GENERATORS_CONFIGURATORS_RFC1951_STREAM_CORRECT_STREAM_GENERATORS_STORED_BLOCK_NO_ERR_HPP 24 | -------------------------------------------------------------------------------- /tools/utils/generators/crc_generator.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | /* 8 | * Intel® Query Processing Library (Intel® QPL) 9 | * Middle Layer API (private C++ API) 10 | */ 11 | 12 | #include "format_generator.hpp" 13 | #include "random_generator.h" 14 | 15 | namespace qpl::test { 16 | auto format_generator::get_random_crc64_poly(uint32_t poly_shift, uint32_t seed) -> uint64_t { 17 | qpl::test::random poly_gen(0U, UINT16_MAX, seed); 18 | uint64_t result_poly = 0U; 19 | result_poly = (uint16_t)poly_gen; 20 | result_poly = (result_poly << 16U) ^ (uint16_t)poly_gen; 21 | result_poly = (result_poly << 16U) ^ (uint16_t)poly_gen; 22 | result_poly = (result_poly << 16U) ^ (uint16_t)poly_gen; 23 | result_poly |= 1U; 24 | result_poly <<= poly_shift; 25 | 26 | return result_poly; 27 | } 28 | } // namespace qpl::test 29 | -------------------------------------------------------------------------------- /tools/utils/generators/deflate_generator/include/histogram.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | #ifndef QPL_TOOLS_UTILS_GENERATORS_DEFLATE_GENERATOR_INCLUDE_HISTOGRAM_H 7 | #define QPL_TOOLS_UTILS_GENERATORS_DEFLATE_GENERATOR_INCLUDE_HISTOGRAM_H 8 | 9 | #include 10 | 11 | class histogram { 12 | protected: 13 | enum : std::uint16_t { NUM_DIST = 32768 }; 14 | enum : std::uint16_t { NUM_LIT_LEN = 257 + 258 - 2 }; 15 | 16 | public: 17 | uint32_t m_dist[NUM_DIST]; 18 | uint32_t m_lit_len[NUM_LIT_LEN]; 19 | 20 | uint32_t m_distcodes[32]; 21 | uint32_t m_llcodes[286]; 22 | 23 | void reset() { 24 | for (uint32_t i = 0U; i < NUM_DIST; i++) 25 | m_dist[i] = 0U; 26 | for (uint32_t i = 0U; i < NUM_LIT_LEN; i++) 27 | m_lit_len[i] = 0U; 28 | } 29 | 30 | histogram() { reset(); } 31 | 32 | void consolidate(); // consolidate m_dist -> m_distcodes, etc. 33 | 34 | void normalize(); 35 | 36 | // uint64_t estimate_out_length(); 37 | 38 | // 0 <= lit <= 256 39 | void add_lit(uint32_t lit) { m_lit_len[lit] += 1U; } 40 | 41 | // 3 <= len <= 258 ; 1 <= dist <= 32768 42 | void add_len_dist(uint32_t len, uint32_t dist) { 43 | m_lit_len[len + (257 - 3)] += 1U; 44 | m_dist[dist - 1] += 1U; 45 | } 46 | }; 47 | 48 | #endif //QPL_TOOLS_UTILS_GENERATORS_DEFLATE_GENERATOR_INCLUDE_HISTOGRAM_H 49 | -------------------------------------------------------------------------------- /tools/utils/generators/deflate_generator/include/huff_codes.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | #ifndef QPL_TOOLS_UTILS_GENERATORS_DEFLATE_GENERATOR_INCLUDE_HUFF_CODES_H 7 | #define QPL_TOOLS_UTILS_GENERATORS_DEFLATE_GENERATOR_INCLUDE_HUFF_CODES_H 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | namespace gz_generator { 14 | class gen_c; 15 | 16 | class BitBuffer; 17 | 18 | void create_huff_tree(uint32_t const* histogram, uint32_t hist_size, uint32_t* bl_count, uint32_t* codes, 19 | uint32_t max_code_len); 20 | 21 | void copy_lens(uint32_t const* code_lens, uint32_t num_lens, uint32_t* bl_count, uint32_t* codes, uint32_t num_codes); 22 | 23 | void create_hufftables(struct bitbuffer* bb, uint32_t ll_codes[286], uint32_t d_codes[32], uint32_t end_of_block, 24 | uint32_t* ll_hist, uint32_t* d_hist, gen_c* gen); 25 | 26 | void create_hufftables(BitBuffer* bit_buffer, uint32_t ll_codes[286], uint32_t d_codes[32], uint32_t end_of_block, 27 | uint32_t* ll_hist, uint32_t* d_hist, gen_c* gen); 28 | 29 | void expand_len_tree(uint32_t* codes); 30 | } // namespace gz_generator 31 | 32 | #endif //QPL_TOOLS_UTILS_GENERATORS_DEFLATE_GENERATOR_INCLUDE_HUFF_CODES_H 33 | -------------------------------------------------------------------------------- /tools/utils/generators/deflate_generator/include/myintrin.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | #ifndef QPL_TOOLS_UTILS_GENERATORS_DEFLATE_GENERATOR_INCLUDE_MYINTRIN_H 7 | #define QPL_TOOLS_UTILS_GENERATORS_DEFLATE_GENERATOR_INCLUDE_MYINTRIN_H 8 | 9 | #ifdef WIN32 10 | #include 11 | static int bsr(int val) { 12 | unsigned long int result; 13 | if (val == 0) return 0; 14 | _BitScanReverse(&result, val); 15 | return result; 16 | } 17 | static int bsf(int val) { 18 | unsigned long int result; 19 | if (val == 0) return 0; 20 | _BitScanForward(&result, val); 21 | return result; 22 | } 23 | #else 24 | // assume LINUX 25 | static int bsr(int val) { 26 | if (val == 0) return 0; 27 | return (31 - __builtin_clz(val)); 28 | } 29 | static int bsf(int val) { 30 | if (val == 0) return 0; 31 | return (__builtin_ctz(val)); 32 | } 33 | #endif 34 | 35 | #endif //QPL_TOOLS_UTILS_GENERATORS_DEFLATE_GENERATOR_INCLUDE_MYINTRIN_H 36 | -------------------------------------------------------------------------------- /tools/utils/generators/deflate_generator/token_parcer.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | /** 8 | *@file 9 | *@brief 10 | *@date 8/18/2019 11 | */ 12 | 13 | #include "token.h" 14 | 15 | /*TokenParser::TokenParser(std::stringstream *config) 16 | :m_config(config), 17 | m_state() 18 | { 19 | }*/ 20 | -------------------------------------------------------------------------------- /tools/utils/generators/format_generator.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | /* 8 | * Intel® Query Processing Library (Intel® QPL) 9 | * Generators 10 | */ 11 | 12 | #ifndef QPL_TOOLS_UTILS_GENERATORS_FORMAT_GENERATOR_HPP 13 | #define QPL_TOOLS_UTILS_GENERATORS_FORMAT_GENERATOR_HPP 14 | 15 | #include 16 | 17 | #include "stdint.h" 18 | 19 | namespace qpl::test { 20 | class format_generator { 21 | public: 22 | static auto generate_uint_bit_sequence(uint32_t length, uint32_t bit_width, uint32_t seed, bool is_little_endian, 23 | uint32_t prologue_bytes = 0U) -> std::vector; 24 | 25 | static auto push_back_uint_vector(std::vector& vector, std::vector& values_vector, 26 | uint32_t bit_vector_element_width, bool is_little_endian) -> std::vector; 27 | 28 | static auto get_random_crc64_poly(uint32_t poly_shift, uint32_t seed) -> uint64_t; 29 | 30 | static auto generate_length_sequence() -> std::vector; 31 | }; 32 | } // namespace qpl::test 33 | 34 | #endif //QPL_TOOLS_UTILS_GENERATORS_FORMAT_GENERATOR_HPP 35 | -------------------------------------------------------------------------------- /tools/utils/generators/igenerator.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_UTILS_GENERATORS_IGENERATOR_H 8 | #define QPL_TOOLS_UTILS_GENERATORS_IGENERATOR_H 9 | 10 | #include 11 | #include 12 | 13 | #include "gendefs.hpp" 14 | 15 | namespace gz_generator { 16 | class InflateGenerator { 17 | protected: 18 | static std::unique_ptr getStreamDescription(TestFactor& testFactor); 19 | 20 | public: 21 | static GenStatus generate(std::vector& pBinaryData, std::vector& pReferenceData, TestFactor& factor); 22 | }; 23 | } // namespace gz_generator 24 | #endif //QPL_TOOLS_UTILS_GENERATORS_IGENERATOR_H 25 | -------------------------------------------------------------------------------- /tools/utils/generators/prle_generator.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2022 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_UTILS_GENERATORS_PRLE_GENERATOR_HPP 8 | #define QPL_TOOLS_UTILS_GENERATORS_PRLE_GENERATOR_HPP 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | constexpr uint32_t parquet_group_size = 8; 16 | 17 | namespace qpl::test { 18 | 19 | enum class prle_encoding_t : std::uint8_t { run_length_encoding, parquet }; 20 | 21 | struct rle_element_t { 22 | uint32_t repeat_count = 0; 23 | uint32_t element_value = 0; 24 | uint32_t bit_width = 0; 25 | }; 26 | 27 | struct parquet_element_t { 28 | std::array parquet_group = {}; 29 | uint32_t bit_width = 0; 30 | uint32_t repeat_count = 0; 31 | }; 32 | 33 | auto get_prle_header_size_bytes(uint32_t count) -> uint32_t; 34 | 35 | auto create_prle_header(prle_encoding_t prle_encoding, uint32_t prle_count) -> std::vector; 36 | 37 | auto create_rle_group(rle_element_t rle_element) -> std::vector; 38 | 39 | auto create_parquet_group(parquet_element_t parquet_element) -> std::vector; 40 | } // namespace qpl::test 41 | #endif // QPL_TOOLS_UTILS_GENERATORS_PRLE_GENERATOR_HPP 42 | -------------------------------------------------------------------------------- /tools/utils/hw_dispatcher/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ========================================================================== 2 | # Copyright (C) 2024 Intel Corporation 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # ========================================================================== 6 | 7 | # Build system for hardware dispatcher used in testing, that includes 8 | # accel-config loading mechanism as well as device initialization routines. 9 | 10 | cmake_minimum_required(VERSION 3.12.0 FATAL_ERROR) 11 | 12 | enable_language(C CXX) 13 | 14 | file(GLOB TOOLS_HW_DISPATCH_SRC *.c *.cpp) 15 | 16 | add_library(tool_hw_dispatcher OBJECT ${TOOLS_HW_DISPATCH_SRC}) 17 | 18 | target_include_directories(tool_hw_dispatcher 19 | PUBLIC $ 20 | PRIVATE $ 21 | PRIVATE $) 22 | 23 | set_target_properties(tool_hw_dispatcher PROPERTIES 24 | CXX_STANDARD 17 25 | C_STANDARD 99) 26 | 27 | target_compile_definitions(tool_hw_dispatcher 28 | PUBLIC $<$:DYNAMIC_LOADING_LIBACCEL_CONFIG>) 29 | -------------------------------------------------------------------------------- /tools/utils/hw_dispatcher/test_hw_status.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2023 Intel Corporation 3 | * 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef QPL_TOOLS_UTILS_HW_DISPATCHER_TEST_HW_STATUS_H 8 | #define QPL_TOOLS_UTILS_HW_DISPATCHER_TEST_HW_STATUS_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | /** 15 | * @brief Enumerates the hardware accelerator statuses 16 | */ 17 | typedef enum { //NOLINT(performance-enum-size) 18 | QPL_TEST_HW_ACCELERATOR_STATUS_OK = 0U, /**< Accelerator returned success */ 19 | QPL_TEST_HW_ACCELERATOR_SUPPORT_ERR = 1U, /**< System doesn't support accelerator */ 20 | QPL_TEST_HW_ACCELERATOR_LIBACCEL_NOT_FOUND = 2U, /**< Required version of libaccel-config is not found */ 21 | QPL_TEST_HW_ACCELERATOR_LIBACCEL_ERROR = 3U, /**< Accelerator instance can not be found */ 22 | QPL_TEST_HW_ACCELERATOR_WORK_QUEUES_NOT_AVAILABLE = 23 | 4U, /**< Enabled work queues are not found or no enabled devices */ 24 | QPL_TEST_HW_ACCELERATOR_NULL_PTR_ERR = 5U, /**< Null pointer error */ 25 | QPL_TEST_HW_ACCELERATOR_WQ_IS_BUSY = 6U, /**< Work queue is busy with task processing */ 26 | } qpl_test_hw_accelerator_status; 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #endif //QPL_TOOLS_UTILS_HW_DISPATCHER_TEST_HW_STATUS_H 33 | --------------------------------------------------------------------------------