fix: set heapless mode for builtins compilation

Related-to: NEO-13973

Signed-off-by: Damian Tomczak <damian.tomczak@intel.com>
This commit is contained in:
Damian Tomczak 2025-03-23 09:25:25 +00:00 committed by Compute-Runtime-Automation
parent 8fbde30432
commit 26c23460cb
3 changed files with 26 additions and 8 deletions

View File

@ -41,7 +41,7 @@ components:
dest_dir: kernels_bin
type: git
branch: kernels_bin
revision: 3361-3837
revision: 3361-3845
kmdaf:
branch: kmdaf
dest_dir: kmdaf

View File

@ -74,11 +74,17 @@ function(compile_builtin core_type platform_it builtin bits builtin_options mode
set(OUTPUT_FILE_SPV
${OUTPUTDIR}/${mode}_${BASENAME}_${platform_it_lower}.spv
)
set(heapless_mode "disable")
if(${mode} STREQUAL "heapless")
set(heapless_mode "enable")
endif()
list(APPEND __ocloc__options__ "-cl-kernel-arg-info")
set(INTERNAL_OPTIONS "${${mode}_INTERNAL_OPTIONS}")
add_custom_command(
OUTPUT ${OUTPUT_FILE_SPV}
COMMAND ${ocloc_cmd_prefix} -q -file ${absolute_filepath} -spv_only -device ${platform_it_lower} ${builtin_options} -${bits} -output ${mode}_${BASENAME} -out_dir ${OUTPUTDIR} ${INTERNAL_OPTIONS} -options "$<JOIN:${__ocloc__options__}, >"
COMMAND ${ocloc_cmd_prefix} -q -file ${absolute_filepath} -spv_only -device ${platform_it_lower} -heapless_mode ${heapless_mode} ${builtin_options} -${bits} -output ${mode}_${BASENAME} -out_dir ${OUTPUTDIR} ${INTERNAL_OPTIONS} -options "$<JOIN:${__ocloc__options__}, >"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${builtin} ocloc copy_compiler_files
)
@ -109,7 +115,7 @@ function(compile_builtin core_type platform_it builtin bits builtin_options mode
get_filename_component(absolute_filepath_spv ${OUTPUT_FILE_SPV} ABSOLUTE)
add_custom_command(
OUTPUT ${OUTPUT_FILES_BINARIES}
COMMAND ${ocloc_cmd_prefix} -q -file ${absolute_filepath_spv} -spirv_input -device ${RELEASE} ${builtin_options} -${bits} -stateful_address_mode ${stateful_address_mode} -output ${mode}_${BASENAME}_${RELEASE_FILENAME} -output_no_suffix -out_dir ${OUTPUTDIR} ${INTERNAL_OPTIONS} -options "$<JOIN:${__ocloc__options__}, >"
COMMAND ${ocloc_cmd_prefix} -q -file ${absolute_filepath_spv} -spirv_input -device ${RELEASE} -heapless_mode ${heapless_mode} ${builtin_options} -${bits} -stateful_address_mode ${stateful_address_mode} -output ${mode}_${BASENAME}_${RELEASE_FILENAME} -output_no_suffix -out_dir ${OUTPUTDIR} ${INTERNAL_OPTIONS} -options "$<JOIN:${__ocloc__options__}, >"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${OUTPUT_FILE_SPV} ocloc copy_compiler_files ${OUTPUT_FILES_BINARIES_PREV}
)

View File

@ -5,7 +5,7 @@
#
set(SHARED_TEST_PROJECTS_SUB_FOLDER "prepare test files")
function(compile_kernels_gen device revision_id platform_name use_stateless_suffix)
function(compile_kernels_gen device revision_id platform_name use_stateless_suffix use_heapless)
set(outputdir "${TargetDir}/${platform_name}/${revision_id}/test_files/${NEO_ARCH}/")
set(compiled_kernels)
@ -17,7 +17,9 @@ function(compile_kernels_gen device revision_id platform_name use_stateless_suff
get_filename_component(absolute_filepath ${filepath} ABSOLUTE)
set(outputname_base "${basename}_${platform_name}")
if(${use_stateless_suffix})
if(${use_heapless})
set(outputname_base "${outputname_base}-heapless")
elseif(${use_stateless_suffix})
set(outputname_base "${outputname_base}-cl-intel-greater-than-4GB-buffer-required_")
endif()
@ -29,9 +31,14 @@ function(compile_kernels_gen device revision_id platform_name use_stateless_suff
${outputpath_base}.bin
)
set(heapless_mode "disable")
if(${use_heapless})
set(heapless_mode "enable")
endif()
add_custom_command(
OUTPUT ${output_files}
COMMAND ${ocloc_cmd_prefix} -file ${absolute_filepath} -device ${device} -${NEO_BITS} -out_dir ${outputdir} -output_no_suffix -output ${outputname_base} -revision_id ${revision_id}
COMMAND ${ocloc_cmd_prefix} -file ${absolute_filepath} -device ${device} -heapless_mode ${heapless_mode} -${NEO_BITS} -out_dir ${outputdir} -output_no_suffix -output ${outputname_base} -revision_id ${revision_id}
WORKING_DIRECTORY ${workdir}
DEPENDS ${filepath} ocloc copy_compiler_files
)
@ -79,10 +86,15 @@ macro(macro_for_each_platform)
foreach(REVISION_CONFIG ${${PLATFORM_IT}_${CORE_TYPE}_REVISIONS})
parse_revision_config(${REVISION_CONFIG} ${PLATFORM_IT_LOWER} DEVICE_ID REVISION_ID)
compile_kernels_gen(${DEVICE_ID} ${REVISION_ID} ${PLATFORM_IT_LOWER} FALSE ${KERNELS_TO_COMPILE})
compile_kernels_gen(${DEVICE_ID} ${REVISION_ID} ${PLATFORM_IT_LOWER} FALSE FALSE ${KERNELS_TO_COMPILE})
if(${STATELESS_SUPPORT})
compile_kernels_gen(${DEVICE_ID} ${REVISION_ID} ${PLATFORM_IT_LOWER} TRUE ${KERNELS_TO_COMPILE})
compile_kernels_gen(${DEVICE_ID} ${REVISION_ID} ${PLATFORM_IT_LOWER} TRUE FALSE ${KERNELS_TO_COMPILE})
endif()
if(${HEAPLESS_SUPPORT})
compile_kernels_gen(${DEVICE_ID} ${REVISION_ID} ${PLATFORM_IT_LOWER} FALSE TRUE ${KERNELS_TO_COMPILE})
endif()
add_custom_target(prepare_test_kernels_for_shared_${PLATFORM_IT_LOWER}_${REVISION_ID} DEPENDS ${compiled_kernels_${PLATFORM_IT_LOWER}_${REVISION_ID}} ${PREVIOUS_TARGET})