2022-04-27 01:37:38 +00:00
## The Intel® QPL provides high performance implementations of data processing functions for existing hardware accelerator, and/or software path in case if hardware accelerator is not available.
2023-05-08 19:20:55 +00:00
set ( UUID_DIR "${ClickHouse_SOURCE_DIR}/contrib/qpl-cmake" )
2022-04-27 01:37:38 +00:00
set ( QPL_PROJECT_DIR "${ClickHouse_SOURCE_DIR}/contrib/qpl" )
set ( QPL_SRC_DIR "${ClickHouse_SOURCE_DIR}/contrib/qpl/sources" )
2022-07-05 18:08:44 +00:00
set ( QPL_BINARY_DIR "${ClickHouse_BINARY_DIR}/build/contrib/qpl" )
2022-12-07 21:41:12 +00:00
set ( EFFICIENT_WAIT OFF )
2022-04-27 17:54:57 +00:00
set ( LOG_HW_INIT OFF )
set ( SANITIZE_MEMORY OFF )
set ( SANITIZE_THREADS OFF )
set ( LIB_FUZZING_ENGINE OFF )
2023-04-25 18:52:28 +00:00
set ( DYNAMIC_LOADING_LIBACCEL_CONFIG OFF )
2022-04-27 17:54:57 +00:00
function ( GetLibraryVersion _content _outputVar )
2023-04-25 18:52:28 +00:00
string ( REGEX MATCHALL "QPL VERSION (.+) LANGUAGES" VERSION_REGEX "${_content}" )
2022-04-27 17:54:57 +00:00
SET ( ${ _outputVar } ${ CMAKE_MATCH_1 } PARENT_SCOPE )
endfunction ( )
2024-07-19 20:32:18 +00:00
set ( QPL_VERSION 1.6.0 )
2022-04-27 01:37:38 +00:00
message ( STATUS "Intel QPL version: ${QPL_VERSION}" )
2024-07-19 20:32:18 +00:00
# There are 5 source subdirectories under $QPL_SRC_DIR: c_api, core-iaa, core-sw, middle-layer and isal.
# Generate 8 library targets: qpl_c_api, core_iaa, qplcore_px, qplcore_avx512, qplcore_sw_dispatcher, middle_layer_lib, isal and isal_asm,
# which are then combined into static or shared qpl.
2023-05-12 13:56:01 +00:00
# Output ch_contrib::qpl by linking with 8 library targets.
2022-07-06 14:34:22 +00:00
2024-08-06 19:15:23 +00:00
# Note, QPL has integrated a customized version of ISA-L to meet specific needs.
# This version has been significantly modified and there are no plans to maintain compatibility with the upstream version
# or upgrade the current copy.
2024-07-19 20:32:18 +00:00
## cmake/CompileOptions.cmake and automatic wrappers generation
2023-05-29 07:43:40 +00:00
2023-11-17 09:03:10 +00:00
# ==========================================================================
# Copyright (C) 2022 Intel Corporation
#
# SPDX-License-Identifier: MIT
# ==========================================================================
set ( QPL_LINUX_TOOLCHAIN_CPP_EMBEDDED_FLAGS "-fno-exceptions;-fno-rtti" )
function ( modify_standard_language_flag )
# Declaring function parameters
set ( OPTIONS "" )
set ( ONE_VALUE_ARGS
L A N G U A G E _ N A M E
F L A G _ N A M E
N E W _ F L A G _ V A L U E )
set ( MULTI_VALUE_ARGS "" )
# Parsing function parameters
cmake_parse_arguments ( MODIFY
" $ { O P T I O N S } "
" $ { O N E _ V A L U E _ A R G S } "
" $ { M U L T I _ V A L U E _ A R G S } "
$ { A R G N } )
# Variables
set ( FLAG_REGULAR_EXPRESSION "${MODIFY_FLAG_NAME}.*[ ]*" )
set ( NEW_VALUE "${MODIFY_FLAG_NAME}${MODIFY_NEW_FLAG_VALUE}" )
# Replacing specified flag with new value
string ( REGEX REPLACE
$ { F L A G _ R E G U L A R _ E X P R E S S I O N } $ { N E W _ V A L U E }
N E W _ C O M P I L E _ F L A G S
" $ { C M A K E _ $ { M O D I F Y _ L A N G U A G E _ N A M E } _ F L A G S } " )
# Returning the value
set ( CMAKE_ ${ MODIFY_LANGUAGE_NAME } _FLAGS ${ NEW_COMPILE_FLAGS } PARENT_SCOPE )
endfunction ( )
function ( get_function_name_with_default_bit_width in_function_name bit_width out_function_name )
if ( in_function_name MATCHES ".*_i" )
string ( REPLACE "_i" "" in_function_name ${ in_function_name } )
set ( ${ out_function_name } "${in_function_name}_${bit_width}_i" PARENT_SCOPE )
else ( )
set ( ${ out_function_name } "${in_function_name}_${bit_width}" PARENT_SCOPE )
endif ( )
endfunction ( )
macro ( get_list_of_supported_optimizations PLATFORMS_LIST )
list ( APPEND PLATFORMS_LIST "" )
list ( APPEND PLATFORMS_LIST "px" )
list ( APPEND PLATFORMS_LIST "avx512" )
endmacro ( get_list_of_supported_optimizations )
function ( generate_unpack_kernel_arrays current_directory PLATFORMS_LIST )
list ( APPEND UNPACK_POSTFIX_LIST "" )
list ( APPEND UNPACK_PRLE_POSTFIX_LIST "" )
list ( APPEND PACK_POSTFIX_LIST "" )
list ( APPEND PACK_INDEX_POSTFIX_LIST "" )
list ( APPEND SCAN_POSTFIX_LIST "" )
list ( APPEND DEFAULT_BIT_WIDTH_FUNCTIONS_LIST "" )
list ( APPEND DEFAULT_BIT_WIDTH_LIST "" )
#create list of functions that use only 8u 16u 32u postfixes
list ( APPEND DEFAULT_BIT_WIDTH_FUNCTIONS_LIST "unpack_prle" )
list ( APPEND DEFAULT_BIT_WIDTH_FUNCTIONS_LIST "extract" )
list ( APPEND DEFAULT_BIT_WIDTH_FUNCTIONS_LIST "extract_i" )
list ( APPEND DEFAULT_BIT_WIDTH_FUNCTIONS_LIST "select" )
list ( APPEND DEFAULT_BIT_WIDTH_FUNCTIONS_LIST "select_i" )
list ( APPEND DEFAULT_BIT_WIDTH_FUNCTIONS_LIST "expand" )
#create default bit width list
list ( APPEND DEFAULT_BIT_WIDTH_LIST "8u" )
list ( APPEND DEFAULT_BIT_WIDTH_LIST "16u" )
list ( APPEND DEFAULT_BIT_WIDTH_LIST "32u" )
#create scan kernel postfixes
list ( APPEND SCAN_COMPARATOR_LIST "" )
list ( APPEND SCAN_COMPARATOR_LIST "eq" )
list ( APPEND SCAN_COMPARATOR_LIST "ne" )
list ( APPEND SCAN_COMPARATOR_LIST "lt" )
list ( APPEND SCAN_COMPARATOR_LIST "le" )
list ( APPEND SCAN_COMPARATOR_LIST "gt" )
list ( APPEND SCAN_COMPARATOR_LIST "ge" )
list ( APPEND SCAN_COMPARATOR_LIST "range" )
list ( APPEND SCAN_COMPARATOR_LIST "not_range" )
foreach ( SCAN_COMPARATOR IN LISTS SCAN_COMPARATOR_LIST )
list ( APPEND SCAN_POSTFIX_LIST "_${SCAN_COMPARATOR}_8u" )
list ( APPEND SCAN_POSTFIX_LIST "_${SCAN_COMPARATOR}_16u8u" )
list ( APPEND SCAN_POSTFIX_LIST "_${SCAN_COMPARATOR}_32u8u" )
endforeach ( )
# create unpack kernel postfixes
foreach ( input_width RANGE 1 32 1 )
if ( input_width LESS 8 OR input_width EQUAL 8 )
list ( APPEND UNPACK_POSTFIX_LIST "_${input_width}u8u" )
elseif ( input_width LESS 16 OR input_width EQUAL 16 )
list ( APPEND UNPACK_POSTFIX_LIST "_${input_width}u16u" )
else ( )
list ( APPEND UNPACK_POSTFIX_LIST "_${input_width}u32u" )
endif ( )
endforeach ( )
# create pack kernel postfixes
foreach ( output_width RANGE 1 8 1 )
list ( APPEND PACK_POSTFIX_LIST "_8u${output_width}u" )
endforeach ( )
foreach ( output_width RANGE 9 16 1 )
list ( APPEND PACK_POSTFIX_LIST "_16u${output_width}u" )
endforeach ( )
foreach ( output_width RANGE 17 32 1 )
list ( APPEND PACK_POSTFIX_LIST "_32u${output_width}u" )
endforeach ( )
list ( APPEND PACK_POSTFIX_LIST "_8u16u" )
list ( APPEND PACK_POSTFIX_LIST "_8u32u" )
list ( APPEND PACK_POSTFIX_LIST "_16u32u" )
# create pack index kernel postfixes
list ( APPEND PACK_INDEX_POSTFIX_LIST "_nu" )
list ( APPEND PACK_INDEX_POSTFIX_LIST "_8u" )
list ( APPEND PACK_INDEX_POSTFIX_LIST "_8u16u" )
list ( APPEND PACK_INDEX_POSTFIX_LIST "_8u32u" )
# write to file
file ( MAKE_DIRECTORY ${ current_directory } /generated )
foreach ( PLATFORM_VALUE IN LISTS PLATFORMS_LIST )
set ( directory "${current_directory}/generated" )
set ( PLATFORM_PREFIX "${PLATFORM_VALUE}_" )
#
# Write unpack table
#
file ( WRITE ${ directory } / ${ PLATFORM_PREFIX } unpack.cpp "#include \" qplc_api.h\ "\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } unpack.cpp "#include \" dispatcher/dispatcher.hpp\ "\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } unpack.cpp "namespace qpl::core_sw::dispatcher\n{\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } unpack.cpp "unpack_table_t ${PLATFORM_PREFIX}unpack_table = {\n" )
#write LE kernels
foreach ( UNPACK_POSTFIX IN LISTS UNPACK_POSTFIX_LIST )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } unpack.cpp "\t${PLATFORM_PREFIX}qplc_unpack${UNPACK_POSTFIX},\n" )
endforeach ( )
#write BE kernels
#get last element of the list
set ( LAST_ELEMENT "" )
list ( GET UNPACK_POSTFIX_LIST -1 LAST_ELEMENT )
foreach ( UNPACK_POSTFIX IN LISTS UNPACK_POSTFIX_LIST )
if ( UNPACK_POSTFIX STREQUAL LAST_ELEMENT )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } unpack.cpp "\t${PLATFORM_PREFIX}qplc_unpack_be${UNPACK_POSTFIX}};\n" )
else ( )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } unpack.cpp "\t${PLATFORM_PREFIX}qplc_unpack_be${UNPACK_POSTFIX},\n" )
endif ( )
endforeach ( )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } unpack.cpp "}\n" )
#
# Write pack table
#
file ( WRITE ${ directory } / ${ PLATFORM_PREFIX } pack.cpp "#include \" qplc_api.h\ "\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } pack.cpp "#include \" dispatcher/dispatcher.hpp\ "\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } pack.cpp "namespace qpl::core_sw::dispatcher\n{\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } pack.cpp "pack_table_t ${PLATFORM_PREFIX}pack_table = {\n" )
#write LE kernels
foreach ( PACK_POSTFIX IN LISTS PACK_POSTFIX_LIST )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } pack.cpp "\t${PLATFORM_PREFIX}qplc_pack${PACK_POSTFIX},\n" )
endforeach ( )
#write BE kernels
#get last element of the list
set ( LAST_ELEMENT "" )
list ( GET PACK_POSTFIX_LIST -1 LAST_ELEMENT )
foreach ( PACK_POSTFIX IN LISTS PACK_POSTFIX_LIST )
if ( PACK_POSTFIX STREQUAL LAST_ELEMENT )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } pack.cpp "\t${PLATFORM_PREFIX}qplc_pack_be${PACK_POSTFIX}};\n" )
else ( )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } pack.cpp "\t${PLATFORM_PREFIX}qplc_pack_be${PACK_POSTFIX},\n" )
endif ( )
endforeach ( )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } pack.cpp "}\n" )
#
# Write scan table
#
file ( WRITE ${ directory } / ${ PLATFORM_PREFIX } scan.cpp "#include \" qplc_api.h\ "\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } scan.cpp "#include \" dispatcher/dispatcher.hpp\ "\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } scan.cpp "namespace qpl::core_sw::dispatcher\n{\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } scan.cpp "scan_table_t ${PLATFORM_PREFIX}scan_table = {\n" )
#get last element of the list
set ( LAST_ELEMENT "" )
list ( GET SCAN_POSTFIX_LIST -1 LAST_ELEMENT )
foreach ( SCAN_POSTFIX IN LISTS SCAN_POSTFIX_LIST )
if ( SCAN_POSTFIX STREQUAL LAST_ELEMENT )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } scan.cpp "\t${PLATFORM_PREFIX}qplc_scan${SCAN_POSTFIX}};\n" )
else ( )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } scan.cpp "\t${PLATFORM_PREFIX}qplc_scan${SCAN_POSTFIX},\n" )
endif ( )
endforeach ( )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } scan.cpp "}\n" )
#
# Write scan_i table
#
file ( WRITE ${ directory } / ${ PLATFORM_PREFIX } scan_i.cpp "#include \" qplc_api.h\ "\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } scan_i.cpp "#include \" dispatcher/dispatcher.hpp\ "\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } scan_i.cpp "namespace qpl::core_sw::dispatcher\n{\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } scan_i.cpp "scan_i_table_t ${PLATFORM_PREFIX}scan_i_table = {\n" )
#get last element of the list
set ( LAST_ELEMENT "" )
list ( GET SCAN_POSTFIX_LIST -1 LAST_ELEMENT )
foreach ( SCAN_POSTFIX IN LISTS SCAN_POSTFIX_LIST )
if ( SCAN_POSTFIX STREQUAL LAST_ELEMENT )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } scan_i.cpp "\t${PLATFORM_PREFIX}qplc_scan${SCAN_POSTFIX}_i};\n" )
else ( )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } scan_i.cpp "\t${PLATFORM_PREFIX}qplc_scan${SCAN_POSTFIX}_i,\n" )
endif ( )
endforeach ( )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } scan_i.cpp "}\n" )
#
# Write pack_index table
#
file ( WRITE ${ directory } / ${ PLATFORM_PREFIX } pack_index.cpp "#include \" qplc_api.h\ "\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } pack_index.cpp "#include \" dispatcher/dispatcher.hpp\ "\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } pack_index.cpp "namespace qpl::core_sw::dispatcher\n{\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } pack_index.cpp "pack_index_table_t ${PLATFORM_PREFIX}pack_index_table = {\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } pack_index.cpp "\t${PLATFORM_PREFIX}qplc_pack_bits_nu,\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } pack_index.cpp "\t${PLATFORM_PREFIX}qplc_pack_index_8u,\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } pack_index.cpp "\t${PLATFORM_PREFIX}qplc_pack_index_8u16u,\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } pack_index.cpp "\t${PLATFORM_PREFIX}qplc_pack_index_8u32u,\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } pack_index.cpp "\t${PLATFORM_PREFIX}qplc_pack_bits_be_nu,\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } pack_index.cpp "\t${PLATFORM_PREFIX}qplc_pack_index_8u,\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } pack_index.cpp "\t${PLATFORM_PREFIX}qplc_pack_index_be_8u16u,\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } pack_index.cpp "\t${PLATFORM_PREFIX}qplc_pack_index_be_8u32u};\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } pack_index.cpp "}\n" )
#
# Write default bit width functions
#
foreach ( DEAULT_BIT_WIDTH_FUNCTION IN LISTS DEFAULT_BIT_WIDTH_FUNCTIONS_LIST )
file ( WRITE ${ directory } / ${ PLATFORM_PREFIX } ${ DEAULT_BIT_WIDTH_FUNCTION } .cpp "#include \" qplc_api.h\ "\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } ${ DEAULT_BIT_WIDTH_FUNCTION } .cpp "#include \" dispatcher/dispatcher.hpp\ "\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } ${ DEAULT_BIT_WIDTH_FUNCTION } .cpp "namespace qpl::core_sw::dispatcher\n{\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } ${ DEAULT_BIT_WIDTH_FUNCTION } .cpp "${DEAULT_BIT_WIDTH_FUNCTION}_table_t ${PLATFORM_PREFIX}${DEAULT_BIT_WIDTH_FUNCTION}_table = {\n" )
#get last element of the list
set ( LAST_ELEMENT "" )
list ( GET DEFAULT_BIT_WIDTH_LIST -1 LAST_ELEMENT )
foreach ( BIT_WIDTH IN LISTS DEFAULT_BIT_WIDTH_LIST )
set ( FUNCTION_NAME "" )
get_function_name_with_default_bit_width ( ${ DEAULT_BIT_WIDTH_FUNCTION } ${ BIT_WIDTH } FUNCTION_NAME )
if ( BIT_WIDTH STREQUAL LAST_ELEMENT )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } ${ DEAULT_BIT_WIDTH_FUNCTION } .cpp "\t${PLATFORM_PREFIX}qplc_${FUNCTION_NAME}};\n" )
else ( )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } ${ DEAULT_BIT_WIDTH_FUNCTION } .cpp "\t${PLATFORM_PREFIX}qplc_${FUNCTION_NAME},\n" )
endif ( )
endforeach ( )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } ${ DEAULT_BIT_WIDTH_FUNCTION } .cpp "}\n" )
endforeach ( )
#
# Write aggregates table
#
file ( WRITE ${ directory } / ${ PLATFORM_PREFIX } aggregates.cpp "#include \" qplc_api.h\ "\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } aggregates.cpp "#include \" dispatcher/dispatcher.hpp\ "\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } aggregates.cpp "namespace qpl::core_sw::dispatcher\n{\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } aggregates.cpp "aggregates_table_t ${PLATFORM_PREFIX}aggregates_table = {\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } aggregates.cpp "\t${PLATFORM_PREFIX}qplc_bit_aggregates_8u,\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } aggregates.cpp "\t${PLATFORM_PREFIX}qplc_aggregates_8u,\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } aggregates.cpp "\t${PLATFORM_PREFIX}qplc_aggregates_16u,\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } aggregates.cpp "\t${PLATFORM_PREFIX}qplc_aggregates_32u};\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } aggregates.cpp "}\n" )
#
# Write mem_copy functions table
#
file ( WRITE ${ directory } / ${ PLATFORM_PREFIX } memory_copy.cpp "#include \" qplc_api.h\ "\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } memory_copy.cpp "#include \" dispatcher/dispatcher.hpp\ "\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } memory_copy.cpp "namespace qpl::core_sw::dispatcher\n{\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } memory_copy.cpp "memory_copy_table_t ${PLATFORM_PREFIX}memory_copy_table = {\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } memory_copy.cpp "\t${PLATFORM_PREFIX}qplc_copy_8u,\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } memory_copy.cpp "\t${PLATFORM_PREFIX}qplc_copy_16u,\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } memory_copy.cpp "\t${PLATFORM_PREFIX}qplc_copy_32u};\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } memory_copy.cpp "}\n" )
#
# Write mem_copy functions table
#
file ( WRITE ${ directory } / ${ PLATFORM_PREFIX } zero.cpp "#include \" qplc_api.h\ "\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } zero.cpp "#include \" dispatcher/dispatcher.hpp\ "\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } zero.cpp "namespace qpl::core_sw::dispatcher\n{\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } zero.cpp "zero_table_t ${PLATFORM_PREFIX}zero_table = {\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } zero.cpp "\t${PLATFORM_PREFIX}qplc_zero_8u};\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } zero.cpp "}\n" )
#
# Write move functions table
#
file ( WRITE ${ directory } / ${ PLATFORM_PREFIX } move.cpp "#include \" qplc_api.h\ "\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } move.cpp "#include \" dispatcher/dispatcher.hpp\ "\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } move.cpp "namespace qpl::core_sw::dispatcher\n{\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } move.cpp "move_table_t ${PLATFORM_PREFIX}move_table = {\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } move.cpp "\t${PLATFORM_PREFIX}qplc_move_8u};\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } move.cpp "}\n" )
#
# Write crc64 function table
#
file ( WRITE ${ directory } / ${ PLATFORM_PREFIX } crc64.cpp "#include \" qplc_api.h\ "\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } crc64.cpp "#include \" dispatcher/dispatcher.hpp\ "\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } crc64.cpp "namespace qpl::core_sw::dispatcher\n{\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } crc64.cpp "crc64_table_t ${PLATFORM_PREFIX}crc64_table = {\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } crc64.cpp "\t${PLATFORM_PREFIX}qplc_crc64};\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } crc64.cpp "}\n" )
#
# Write xor_checksum function table
#
file ( WRITE ${ directory } / ${ PLATFORM_PREFIX } xor_checksum.cpp "#include \" qplc_api.h\ "\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } xor_checksum.cpp "#include \" dispatcher/dispatcher.hpp\ "\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } xor_checksum.cpp "namespace qpl::core_sw::dispatcher\n{\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } xor_checksum.cpp "xor_checksum_table_t ${PLATFORM_PREFIX}xor_checksum_table = {\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } xor_checksum.cpp "\t${PLATFORM_PREFIX}qplc_xor_checksum_8u};\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } xor_checksum.cpp "}\n" )
#
# Write deflate functions table
#
file ( WRITE ${ directory } / ${ PLATFORM_PREFIX } deflate.cpp "#include \" deflate_slow_icf.h\ "\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } deflate.cpp "#include \" deflate_hash_table.h\ "\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } deflate.cpp "#include \" deflate_histogram.h\ "\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } deflate.cpp "#include \" dispatcher/dispatcher.hpp\ "\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } deflate.cpp "namespace qpl::core_sw::dispatcher\n{\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } deflate.cpp "deflate_table_t ${PLATFORM_PREFIX}deflate_table = {\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } deflate.cpp "\t reinterpret_cast<void *>(&${PLATFORM_PREFIX}slow_deflate_icf_body),\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } deflate.cpp "\t reinterpret_cast<void *>(&${PLATFORM_PREFIX}deflate_histogram_reset),\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } deflate.cpp "\t reinterpret_cast<void *>(&${PLATFORM_PREFIX}deflate_hash_table_reset)};\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } deflate.cpp "}\n" )
#
# Write deflate fix functions table
#
file ( WRITE ${ directory } / ${ PLATFORM_PREFIX } deflate_fix.cpp "#include \" deflate_slow.h\ "\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } deflate_fix.cpp "#include \" dispatcher/dispatcher.hpp\ "\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } deflate_fix.cpp "namespace qpl::core_sw::dispatcher\n{\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } deflate_fix.cpp "deflate_fix_table_t ${PLATFORM_PREFIX}deflate_fix_table = {\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } deflate_fix.cpp "\t reinterpret_cast<void *>(&${PLATFORM_PREFIX}slow_deflate_body)};\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } deflate_fix.cpp "}\n" )
#
# Write setup_dictionary functions table
#
file ( WRITE ${ directory } / ${ PLATFORM_PREFIX } setup_dictionary.cpp "#include \" deflate_slow_utils.h\ "\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } setup_dictionary.cpp "#include \" dispatcher/dispatcher.hpp\ "\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } setup_dictionary.cpp "namespace qpl::core_sw::dispatcher\n{\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } setup_dictionary.cpp "setup_dictionary_table_t ${PLATFORM_PREFIX}setup_dictionary_table = {\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } setup_dictionary.cpp "\t reinterpret_cast<void *>(&${PLATFORM_PREFIX}setup_dictionary)};\n" )
file ( APPEND ${ directory } / ${ PLATFORM_PREFIX } setup_dictionary.cpp "}\n" )
endforeach ( )
endfunction ( )
2022-04-27 01:37:38 +00:00
2024-07-19 20:32:18 +00:00
# [SUBDIR]isal
2022-05-05 15:56:11 +00:00
2022-04-27 01:37:38 +00:00
enable_language ( ASM_NASM )
set ( ISAL_C_SRC ${ QPL_SRC_DIR } /isal/igzip/adler32_base.c
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / h u f f _ c o d e s . c
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / h u f f t a b l e s _ c . c
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p . c
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ b a s e . c
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / f l a t t e n _ l l . c
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / e n c o d e _ d f . c
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ i c f _ b a s e . c
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ i n f l a t e . c
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ i c f _ b o d y . c
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c _ b a s e . c
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c 6 4 _ b a s e . c )
set ( ISAL_ASM_SRC ${ QPL_SRC_DIR } /isal/igzip/igzip_body.asm
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ g e n _ i c f _ m a p _ l h 1 _ 0 4 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ g e n _ i c f _ m a p _ l h 1 _ 0 6 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ d e c o d e _ b l o c k _ s t a t e l e s s _ 0 4 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ f i n i s h . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / e n c o d e _ d f _ 0 4 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / e n c o d e _ d f _ 0 6 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ d e c o d e _ b l o c k _ s t a t e l e s s _ 0 1 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / p r o c _ h e a p . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ i c f _ b o d y _ h 1 _ g r _ b t . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ i c f _ f i n i s h . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ i n f l a t e _ m u l t i b i n a r y . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ u p d a t e _ h i s t o g r a m _ 0 1 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ u p d a t e _ h i s t o g r a m _ 0 4 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / r f c 1 9 5 1 _ l o o k u p . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / a d l e r 3 2 _ s s e . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / a d l e r 3 2 _ a v x 2 _ 4 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ d e f l a t e _ h a s h . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ s e t _ l o n g _ i c f _ f g _ 0 4 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ s e t _ l o n g _ i c f _ f g _ 0 6 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ m u l t i b i n a r y . a s m
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c _ m u l t i b i n a r y . a s m
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c 3 2 _ g z i p _ r e f l _ b y 8 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c 3 2 _ g z i p _ r e f l _ b y 8 _ 0 2 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c 3 2 _ g z i p _ r e f l _ b y 1 6 _ 1 0 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c 3 2 _ i e e e _ 0 1 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c 3 2 _ i e e e _ 0 2 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c 3 2 _ i e e e _ b y 4 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c 3 2 _ i e e e _ b y 1 6 _ 1 0 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c 3 2 _ i s c s i _ 0 0 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c 3 2 _ i s c s i _ 0 1 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c 3 2 _ i s c s i _ b y 1 6 _ 1 0 . a s m )
# Adding ISA-L library target
add_library ( isal OBJECT ${ ISAL_C_SRC } )
add_library ( isal_asm OBJECT ${ ISAL_ASM_SRC } )
2023-05-12 13:56:01 +00:00
set_property ( GLOBAL APPEND PROPERTY QPL_LIB_DEPS
$ < T A R G E T _ O B J E C T S : i s a l > )
set_property ( GLOBAL APPEND PROPERTY QPL_LIB_DEPS
$ < T A R G E T _ O B J E C T S : i s a l _ a s m > )
2022-04-27 01:37:38 +00:00
# Setting external and internal interfaces for ISA-L library
target_include_directories ( isal
2023-05-12 13:56:01 +00:00
P U B L I C $ < B U I L D _ I N T E R F A C E : $ { Q P L _ S R C _ D I R } / i s a l / i n c l u d e >
P U B L I C $ { Q P L _ S R C _ D I R } / i s a l / i g z i p )
set_target_properties ( isal PROPERTIES
C X X _ S T A N D A R D 1 1
C _ S T A N D A R D 9 9 )
2022-04-27 01:37:38 +00:00
2023-05-12 13:56:01 +00:00
# AS_FEATURE_LEVEL=10 means "Check SIMD capabilities of the target system at runtime and use up to AVX512 if available".
# HAVE_KNOWS_AVX512 means rely on AVX512 being available on the target system.
2022-12-07 21:41:12 +00:00
target_compile_options ( isal_asm PRIVATE "-I${QPL_SRC_DIR}/isal/include/"
P R I V A T E " - I $ { Q P L _ S R C _ D I R } / i s a l / i g z i p / "
P R I V A T E " - I $ { Q P L _ S R C _ D I R } / i s a l / c r c / "
2023-05-12 13:56:01 +00:00
P R I V A T E " - D H A V E _ A S _ K N O W S _ A V X 5 1 2 "
P R I V A T E " - D A S _ F E A T U R E _ L E V E L = 1 0 "
2022-12-07 21:41:12 +00:00
P R I V A T E " - D Q P L _ L I B " )
2022-07-06 16:19:37 +00:00
2022-07-06 14:34:22 +00:00
# Here must remove "-fno-sanitize=undefined" from COMPILE_OPTIONS.
# Otherwise nasm compiler would fail to proceed due to unrecognition of "-fno-sanitize=undefined"
2022-06-05 18:46:28 +00:00
if ( SANITIZE STREQUAL "undefined" )
get_target_property ( target_options isal_asm COMPILE_OPTIONS )
2022-06-29 02:52:11 +00:00
list ( REMOVE_ITEM target_options "-fno-sanitize=undefined" )
2022-06-05 18:46:28 +00:00
set_property ( TARGET isal_asm PROPERTY COMPILE_OPTIONS ${ target_options } )
endif ( )
2022-04-27 01:37:38 +00:00
target_compile_definitions ( isal PUBLIC
Q P L _ L I B
N D E B U G )
# [SUBDIR]core-sw
2023-05-12 13:56:01 +00:00
# Create set of libraries corresponding to supported platforms for SW fallback which are implemented by AVX512 and non-AVX512 instructions respectively.
2022-07-06 17:26:07 +00:00
# The upper level QPL API will check SIMD capabilities of the target system at runtime and decide to call AVX512 function or non-AVX512 function.
2023-05-12 13:56:01 +00:00
# Hence, here we don't need put ENABLE_AVX512 CMake switch.
2022-04-27 01:37:38 +00:00
2023-05-12 13:56:01 +00:00
get_list_of_supported_optimizations ( PLATFORMS_LIST )
2022-04-27 01:37:38 +00:00
2023-05-12 13:56:01 +00:00
foreach ( PLATFORM_ID IN LISTS PLATFORMS_LIST )
# Find Core Sources
file ( GLOB SOURCES
$ { Q P L _ S R C _ D I R } / c o r e - s w / s r c / c h e c k s u m s / * . c
$ { Q P L _ S R C _ D I R } / c o r e - s w / s r c / f i l t e r i n g / * . c
$ { Q P L _ S R C _ D I R } / c o r e - s w / s r c / o t h e r / * . c
$ { Q P L _ S R C _ D I R } / c o r e - s w / s r c / c o m p r e s s i o n / * . c )
2022-04-27 01:37:38 +00:00
2023-05-12 13:56:01 +00:00
file ( GLOB DATA_SOURCES
$ { Q P L _ S R C _ D I R } / c o r e - s w / s r c / d a t a / * . c )
2022-07-06 17:26:07 +00:00
2023-05-12 13:56:01 +00:00
# Create library
add_library ( qplcore_ ${ PLATFORM_ID } OBJECT ${ SOURCES } )
2022-04-27 01:37:38 +00:00
2023-05-12 13:56:01 +00:00
set_property ( GLOBAL APPEND PROPERTY QPL_LIB_DEPS
$ < T A R G E T _ O B J E C T S : q p l c o r e _ $ { P L A T F O R M _ I D } > )
2022-04-27 01:37:38 +00:00
2023-05-12 13:56:01 +00:00
target_include_directories ( qplcore_ ${ PLATFORM_ID }
P U B L I C $ < B U I L D _ I N T E R F A C E : $ { Q P L _ S R C _ D I R } / c o r e - s w >
P U B L I C $ < B U I L D _ I N T E R F A C E : $ { Q P L _ S R C _ D I R } / c o r e - s w / i n c l u d e >
P U B L I C $ < B U I L D _ I N T E R F A C E : $ { Q P L _ S R C _ D I R } / c o r e - s w / s r c / i n c l u d e >
P U B L I C $ < B U I L D _ I N T E R F A C E : $ { Q P L _ S R C _ D I R } / c o r e - s w / s r c / c o m p r e s s i o n / i n c l u d e >
P R I V A T E $ < T A R G E T _ P R O P E R T Y : i s a l , I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S > )
2022-04-27 01:37:38 +00:00
2023-11-17 09:03:10 +00:00
# Set specific compiler options and/or definitions based on a platform
2023-05-12 13:56:01 +00:00
if ( ${ PLATFORM_ID } MATCHES "avx512" )
target_compile_definitions ( qplcore_ ${ PLATFORM_ID } PRIVATE PLATFORM=2 )
target_compile_options ( qplcore_ ${ PLATFORM_ID } PRIVATE -march=skylake-avx512 )
else ( ) # Create default px library
target_compile_definitions ( qplcore_ ${ PLATFORM_ID } PRIVATE PLATFORM=0 )
endif ( )
2022-04-27 01:37:38 +00:00
2023-05-12 13:56:01 +00:00
target_link_libraries ( qplcore_ ${ PLATFORM_ID } isal )
endforeach ( )
2022-04-27 01:37:38 +00:00
#
2023-05-12 13:56:01 +00:00
# Create dispatcher between platforms and auto-generated wrappers
2022-04-27 01:37:38 +00:00
#
2023-05-12 13:56:01 +00:00
file ( GLOB SW_DISPATCHER_SOURCES ${ QPL_SRC_DIR } /core-sw/dispatcher/*.cpp )
2022-04-27 01:37:38 +00:00
2023-05-12 13:56:01 +00:00
add_library ( qplcore_sw_dispatcher OBJECT ${ SW_DISPATCHER_SOURCES } )
set_property ( GLOBAL APPEND PROPERTY QPL_LIB_DEPS
$ < T A R G E T _ O B J E C T S : q p l c o r e _ s w _ d i s p a t c h e r > )
2022-04-27 01:37:38 +00:00
2023-05-12 13:56:01 +00:00
target_include_directories ( qplcore_sw_dispatcher
P U B L I C $ < B U I L D _ I N T E R F A C E : $ { Q P L _ S R C _ D I R } / c o r e - s w / d i s p a t c h e r > )
2022-04-27 01:37:38 +00:00
2023-05-12 13:56:01 +00:00
# Generate kernel wrappers
generate_unpack_kernel_arrays ( ${ QPL_BINARY_DIR } "${PLATFORMS_LIST}" )
2022-04-27 01:37:38 +00:00
2023-05-12 13:56:01 +00:00
foreach ( PLATFORM_ID IN LISTS PLATFORMS_LIST )
file ( GLOB GENERATED_ ${ PLATFORM_ID } _TABLES_SRC ${ QPL_BINARY_DIR } /generated/ ${ PLATFORM_ID } _*.cpp )
2022-04-27 01:37:38 +00:00
2023-05-12 13:56:01 +00:00
target_sources ( qplcore_sw_dispatcher PRIVATE ${ GENERATED_${PLATFORM_ID } _TABLES_SRC} )
2022-04-27 01:37:38 +00:00
2023-05-12 13:56:01 +00:00
# Set specific compiler options and/or definitions based on a platform
if ( ${ PLATFORM_ID } MATCHES "avx512" )
set_source_files_properties ( ${ GENERATED_${PLATFORM_ID } _TABLES_SRC} PROPERTIES COMPILE_DEFINITIONS PLATFORM=2 )
else ( )
set_source_files_properties ( ${ GENERATED_${PLATFORM_ID } _TABLES_SRC} PROPERTIES COMPILE_DEFINITIONS PLATFORM=0 )
endif ( )
2022-04-27 01:37:38 +00:00
2023-05-12 13:56:01 +00:00
target_include_directories ( qplcore_sw_dispatcher
P U B L I C $ < T A R G E T _ P R O P E R T Y : q p l c o r e _ $ { P L A T F O R M _ I D } , I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S > )
endforeach ( )
set_target_properties ( qplcore_sw_dispatcher PROPERTIES CXX_STANDARD 17 )
# w/a for build compatibility with ISAL codebase
target_compile_definitions ( qplcore_sw_dispatcher PUBLIC -DQPL_LIB )
target_compile_options ( qplcore_sw_dispatcher
2023-11-17 09:03:10 +00:00
P R I V A T E $ { Q P L _ L I N U X _ T O O L C H A I N _ C P P _ E M B E D D E D _ F L A G S } )
2022-04-27 01:37:38 +00:00
# [SUBDIR]core-iaa
file ( GLOB HW_PATH_SRC ${ QPL_SRC_DIR } /core-iaa/sources/aecs/*.c
$ { Q P L _ S R C _ D I R } / c o r e - i a a / s o u r c e s / d r i v e r _ l o a d e r / * . c
$ { Q P L _ S R C _ D I R } / c o r e - i a a / s o u r c e s / d e s c r i p t o r s / * . c
2024-07-19 20:32:18 +00:00
$ { Q P L _ S R C _ D I R } / c o r e - i a a / s o u r c e s / * . c )
2022-04-27 01:37:38 +00:00
# Create library
add_library ( core_iaa OBJECT ${ HW_PATH_SRC } )
2023-05-12 13:56:01 +00:00
set_property ( GLOBAL APPEND PROPERTY QPL_LIB_DEPS
$ < T A R G E T _ O B J E C T S : c o r e _ i a a > )
2022-04-27 01:37:38 +00:00
target_include_directories ( core_iaa
P R I V A T E $ { U U I D _ D I R }
P U B L I C $ < B U I L D _ I N T E R F A C E : $ { Q P L _ S R C _ D I R } / c o r e - i a a / i n c l u d e >
2023-04-25 18:52:28 +00:00
P U B L I C $ < B U I L D _ I N T E R F A C E : $ { Q P L _ S R C _ D I R } / c o r e - i a a / s o u r c e s / i n c l u d e >
2024-07-19 20:32:18 +00:00
P R I V A T E $ < B U I L D _ I N T E R F A C E : $ { Q P L _ P R O J E C T _ D I R } / i n c l u d e > # status.h in own_checkers.h
P R I V A T E $ < T A R G E T _ P R O P E R T Y : q p l _ c _ a p i , I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S > # for own_checkers.h
2023-05-12 13:56:01 +00:00
P R I V A T E $ < T A R G E T _ P R O P E R T Y : q p l c o r e _ s w _ d i s p a t c h e r , I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S > )
2022-04-27 01:37:38 +00:00
target_compile_features ( core_iaa PRIVATE c_std_11 )
target_compile_definitions ( core_iaa PRIVATE QPL_BADARG_CHECK
2023-05-12 13:56:01 +00:00
P R I V A T E $ < $ < B O O L : $ { L O G _ H W _ I N I T } > : L O G _ H W _ I N I T >
P R I V A T E $ < $ < B O O L : $ { D Y N A M I C _ L O A D I N G _ L I B A C C E L _ C O N F I G } > : D Y N A M I C _ L O A D I N G _ L I B A C C E L _ C O N F I G > )
2022-04-27 01:37:38 +00:00
# [SUBDIR]middle-layer
file ( GLOB MIDDLE_LAYER_SRC
2024-07-19 20:32:18 +00:00
$ { Q P L _ S R C _ D I R } / m i d d l e - l a y e r / a c c e l e r a t o r / * . c p p
$ { Q P L _ S R C _ D I R } / m i d d l e - l a y e r / a n a l y t i c s / * . c p p
2022-04-27 01:37:38 +00:00
$ { Q P L _ S R C _ D I R } / m i d d l e - l a y e r / c o m m o n / * . c p p
$ { Q P L _ S R C _ D I R } / m i d d l e - l a y e r / c o m p r e s s i o n / * . c p p
$ { Q P L _ S R C _ D I R } / m i d d l e - l a y e r / c o m p r e s s i o n / * / * . c p p
$ { Q P L _ S R C _ D I R } / m i d d l e - l a y e r / c o m p r e s s i o n / * / * / * . c p p
$ { Q P L _ S R C _ D I R } / m i d d l e - l a y e r / d i s p a t c h e r / * . c p p
$ { Q P L _ S R C _ D I R } / m i d d l e - l a y e r / o t h e r / * . c p p
2024-07-19 20:32:18 +00:00
$ { Q P L _ S R C _ D I R } / m i d d l e - l a y e r / u t i l / * . c p p )
2022-04-27 01:37:38 +00:00
add_library ( middle_layer_lib OBJECT
$ { M I D D L E _ L A Y E R _ S R C } )
2023-05-12 13:56:01 +00:00
set_property ( GLOBAL APPEND PROPERTY QPL_LIB_DEPS
$ < T A R G E T _ O B J E C T S : m i d d l e _ l a y e r _ l i b > )
2022-04-27 01:37:38 +00:00
target_compile_options ( middle_layer_lib
2024-07-19 20:32:18 +00:00
P R I V A T E $ < $ < C _ C O M P I L E R _ I D : G N U , C l a n g > : $ < $ < C O N F I G : R e l e a s e > : - O 3 ; - U _ F O R T I F Y _ S O U R C E ; - D _ F O R T I F Y _ S O U R C E = 2 > >
2023-11-17 09:03:10 +00:00
P R I V A T E $ { Q P L _ L I N U X _ T O O L C H A I N _ C P P _ E M B E D D E D _ F L A G S } )
2022-04-27 01:37:38 +00:00
target_compile_definitions ( middle_layer_lib
2022-04-27 17:54:57 +00:00
P U B L I C Q P L _ V E R S I O N = " $ { Q P L _ V E R S I O N } "
2022-04-27 01:37:38 +00:00
P U B L I C $ < $ < B O O L : $ { L O G _ H W _ I N I T } > : L O G _ H W _ I N I T >
P U B L I C $ < $ < B O O L : $ { E F F I C I E N T _ W A I T } > : Q P L _ E F F I C I E N T _ W A I T >
2023-05-12 13:56:01 +00:00
P U B L I C Q P L _ B A D A R G _ C H E C K
P U B L I C $ < $ < B O O L : $ { D Y N A M I C _ L O A D I N G _ L I B A C C E L _ C O N F I G } > : D Y N A M I C _ L O A D I N G _ L I B A C C E L _ C O N F I G > )
2022-04-27 01:37:38 +00:00
2023-05-12 13:56:01 +00:00
set_target_properties ( middle_layer_lib PROPERTIES CXX_STANDARD 17 )
2022-04-27 01:37:38 +00:00
target_include_directories ( middle_layer_lib
P R I V A T E $ { U U I D _ D I R }
P U B L I C $ < B U I L D _ I N T E R F A C E : $ { Q P L _ S R C _ D I R } / m i d d l e - l a y e r >
P U B L I C $ < T A R G E T _ P R O P E R T Y : _ q p l , I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S >
2024-07-19 20:32:18 +00:00
P R I V A T E $ < T A R G E T _ P R O P E R T Y : q p l _ c _ a p i , I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S >
2023-05-12 13:56:01 +00:00
P U B L I C $ < T A R G E T _ P R O P E R T Y : q p l c o r e _ s w _ d i s p a t c h e r , I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S >
2022-04-27 01:37:38 +00:00
P U B L I C $ < T A R G E T _ P R O P E R T Y : i s a l , I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S >
P U B L I C $ < T A R G E T _ P R O P E R T Y : c o r e _ i a a , I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S > )
target_compile_definitions ( middle_layer_lib PUBLIC -DQPL_LIB )
2022-07-06 14:34:22 +00:00
# [SUBDIR]c_api
2024-07-19 20:32:18 +00:00
file ( GLOB QPL_C_API_SRC
$ { Q P L _ S R C _ D I R } / c _ a p i / c o m p r e s s i o n _ o p e r a t i o n s / * . c
$ { Q P L _ S R C _ D I R } / c _ a p i / c o m p r e s s i o n _ o p e r a t i o n s / * . c p p
$ { Q P L _ S R C _ D I R } / c _ a p i / f i l t e r _ o p e r a t i o n s / * . c p p
$ { Q P L _ S R C _ D I R } / c _ a p i / l e g a c y _ h w _ p a t h / * . c
$ { Q P L _ S R C _ D I R } / c _ a p i / l e g a c y _ h w _ p a t h / * . c p p
$ { Q P L _ S R C _ D I R } / c _ a p i / o t h e r _ o p e r a t i o n s / * . c p p
$ { Q P L _ S R C _ D I R } / c _ a p i / s e r i a l i z a t i o n / * . c p p
$ { Q P L _ S R C _ D I R } / c _ a p i / * . c p p )
add_library ( qpl_c_api OBJECT ${ QPL_C_API_SRC } )
target_include_directories ( qpl_c_api
P U B L I C $ < B U I L D _ I N T E R F A C E : $ { Q P L _ S R C _ D I R } / c _ a p i / >
P U B L I C $ < B U I L D _ I N T E R F A C E : $ { Q P L _ S R C _ D I R } / i n c l u d e / > $ < I N S T A L L _ I N T E R F A C E : i n c l u d e >
P R I V A T E $ < T A R G E T _ P R O P E R T Y : m i d d l e _ l a y e r _ l i b , I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S > )
set_target_properties ( qpl_c_api PROPERTIES
$ < $ < C _ C O M P I L E R _ I D : G N U , C l a n g > : C _ S T A N D A R D 1 7
C X X _ S T A N D A R D 1 7 )
target_compile_options ( qpl_c_api
P R I V A T E $ < $ < C _ C O M P I L E R _ I D : G N U , C l a n g > : $ < $ < C O N F I G : R e l e a s e > : - O 3 ; - U _ F O R T I F Y _ S O U R C E ; - D _ F O R T I F Y _ S O U R C E = 2 > >
P R I V A T E $ < $ < C O M P I L E _ L A N G _ A N D _ I D : C X X , G N U , C l a n g > : $ { Q P L _ L I N U X _ T O O L C H A I N _ C P P _ E M B E D D E D _ F L A G S } > )
target_compile_definitions ( qpl_c_api
P U B L I C - D Q P L _ B A D A R G _ C H E C K # own_checkers.h
P U B L I C - D Q P L _ L I B # needed for middle_layer_lib
P U B L I C $ < $ < B O O L : $ { L O G _ H W _ I N I T } > : L O G _ H W _ I N I T > ) # needed for middle_layer_lib
set_property ( GLOBAL APPEND PROPERTY QPL_LIB_DEPS
$ < T A R G E T _ O B J E C T S : q p l _ c _ a p i > )
# Final _qpl target
2022-04-27 01:37:38 +00:00
2023-05-12 13:56:01 +00:00
get_property ( LIB_DEPS GLOBAL PROPERTY QPL_LIB_DEPS )
2024-07-19 20:32:18 +00:00
add_library ( _qpl STATIC ${ LIB_DEPS } )
2022-04-27 01:37:38 +00:00
target_include_directories ( _qpl
2024-07-19 20:32:18 +00:00
P U B L I C $ < B U I L D _ I N T E R F A C E : $ { Q P L _ P R O J E C T _ D I R } / i n c l u d e / > $ < I N S T A L L _ I N T E R F A C E : i n c l u d e > )
2022-04-27 01:37:38 +00:00
target_link_libraries ( _qpl
2024-07-19 20:32:18 +00:00
P R I V A T E c h _ c o n t r i b : : a c c e l - c o n f i g )
2023-04-25 18:52:28 +00:00
target_include_directories ( _qpl SYSTEM BEFORE
P U B L I C " $ { Q P L _ P R O J E C T _ D I R } / i n c l u d e "
P U B L I C $ { U U I D _ D I R } )
2023-05-08 19:20:55 +00:00
add_library ( ch_contrib::qpl ALIAS _qpl )