mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-19 06:24:51 +08:00
allow external definition of NEO_KERNELS_BIN_DIR
Related-To: NEO-6783 Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
c56046fd29
commit
52da8f7260
@@ -446,6 +446,9 @@ message(STATUS "i915 includes dir: ${I915_INCLUDES_DIR}")
|
||||
|
||||
# Enable/Disable BuiltIns compilation during build
|
||||
set(COMPILE_BUILT_INS TRUE CACHE BOOL "Enable built-in kernels compilation")
|
||||
if(NOT DEFINED NEO_KERNELS_BIN_DIR)
|
||||
get_filename_component(NEO_KERNELS_BIN_DIR "${NEO_SOURCE_DIR}/../kernels_bin/" ABSOLUTE)
|
||||
endif()
|
||||
|
||||
# Changing the default executable and library output directories
|
||||
set(IGDRCL_OUTPUT_DIR "${IGDRCL_OPTION__OUTPUT_DIR}")
|
||||
|
||||
@@ -38,7 +38,7 @@ function(level_zero_generate_kernels target_list platform_name suffix revision_i
|
||||
list(APPEND ${target_list} ${output_files})
|
||||
else()
|
||||
foreach(_file_name "bin" "gen" "spv" "dbg")
|
||||
set(_file_prebuilt "${NEO_SOURCE_DIR}/../kernels_bin/${relativeDir}/${basename}_${suffix}.${_file_name}")
|
||||
set(_file_prebuilt "${NEO_KERNELS_BIN_DIR}/${relativeDir}/${basename}_${suffix}.${_file_name}")
|
||||
add_custom_command(
|
||||
OUTPUT ${outputpath_base}.${_file_name}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${outputdir}
|
||||
@@ -92,7 +92,7 @@ function(level_zero_generate_kernels_with_internal_options target_list platform_
|
||||
list(APPEND ${target_list} ${output_files})
|
||||
else()
|
||||
foreach(_file_name "bin" "gen" "spv" "dbg")
|
||||
set(_file_prebuilt "${NEO_SOURCE_DIR}/../kernels_bin/${relativeDir}/${prefix}_${basename}_${suffix}.${_file_name}")
|
||||
set(_file_prebuilt "${NEO_KERNELS_BIN_DIR}/${relativeDir}/${prefix}_${basename}_${suffix}.${_file_name}")
|
||||
add_custom_command(
|
||||
OUTPUT ${outputpath_base}.${_file_name}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${outputdir}
|
||||
|
||||
@@ -76,7 +76,7 @@ function(compile_builtin core_type platform_type builtin bits builtin_options)
|
||||
set(BUILTIN_CPP built_ins/${NEO_ARCH}/${core_type_lower}/${BASENAME}_${family_name_with_type}.cpp PARENT_SCOPE)
|
||||
else()
|
||||
foreach(_file_name "spv" "bin" "gen")
|
||||
set(_file_prebuilt "${NEO_SOURCE_DIR}/../kernels_bin/built_ins/${NEO_ARCH}/${core_type_lower}/${BASENAME}_${family_name_with_type}.${_file_name}")
|
||||
set(_file_prebuilt "${NEO_KERNELS_BIN_DIR}/built_ins/${NEO_ARCH}/${core_type_lower}/${BASENAME}_${family_name_with_type}.${_file_name}")
|
||||
if(EXISTS ${_file_prebuilt})
|
||||
add_custom_command(
|
||||
OUTPUT ${OUTPUTPATH_BASE}.${_file_name}
|
||||
@@ -85,7 +85,7 @@ function(compile_builtin core_type platform_type builtin bits builtin_options)
|
||||
)
|
||||
endif()
|
||||
endforeach()
|
||||
set(_file_prebuilt "${NEO_SOURCE_DIR}/../kernels_bin/built_ins/${NEO_ARCH}/${core_type_lower}/${BASENAME}_${family_name_with_type}.cpp")
|
||||
set(_file_prebuilt "${NEO_KERNELS_BIN_DIR}/built_ins/${NEO_ARCH}/${core_type_lower}/${BASENAME}_${family_name_with_type}.cpp")
|
||||
if(EXISTS ${_file_prebuilt})
|
||||
add_custom_command(
|
||||
OUTPUT ${OUTPUTPATH_BASE}.cpp
|
||||
|
||||
@@ -200,7 +200,7 @@ function(neo_gen_kernels platform_name_with_type platform_name revision_id suffi
|
||||
list(APPEND kernels_to_compile ${output_files})
|
||||
else()
|
||||
foreach(_file_name "spv" "bin" "gen")
|
||||
set(_file_prebuilt "${NEO_SOURCE_DIR}/../kernels_bin/${suffix}/${revision_id}/test_files/${NEO_ARCH}/${basename}_${suffix}.${_file_name}")
|
||||
set(_file_prebuilt "${NEO_KERNELS_BIN_DIR}/${suffix}/${revision_id}/test_files/${NEO_ARCH}/${basename}_${suffix}.${_file_name}")
|
||||
add_custom_command(
|
||||
OUTPUT ${outputpath_base}.${_file_name}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${outputdir}
|
||||
@@ -246,7 +246,7 @@ function(neo_gen_kernels_with_options platform_name_with_type platform_name revi
|
||||
list(APPEND kernels_to_compile ${output_files})
|
||||
else()
|
||||
foreach(_file_name "spv" "bin" "gen")
|
||||
set(_file_prebuilt "${NEO_SOURCE_DIR}/../kernels_bin/${suffix}/${revision_id}/test_files/${NEO_ARCH}/${basename}_${suffix}.${_file_name}${argwospaces}")
|
||||
set(_file_prebuilt "${NEO_KERNELS_BIN_DIR}/${suffix}/${revision_id}/test_files/${NEO_ARCH}/${basename}_${suffix}.${_file_name}${argwospaces}")
|
||||
add_custom_command(
|
||||
OUTPUT ${outputpath_base}.${_file_name}${argwospaces}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${outputdir}
|
||||
@@ -299,7 +299,7 @@ function(neo_gen_kernels_with_internal_options platform_name_with_type platform_
|
||||
list(APPEND kernels_to_compile_${platform_name_with_type}_${revision_id} ${output_files})
|
||||
else()
|
||||
foreach(_file_name "spv" "bin" "gen")
|
||||
set(_file_prebuilt "${NEO_SOURCE_DIR}/../kernels_bin/${suffix}/${revision_id}/test_files/${NEO_ARCH}/${basename}_${suffix}.${_file_name}")
|
||||
set(_file_prebuilt "${NEO_KERNELS_BIN_DIR}/${suffix}/${revision_id}/test_files/${NEO_ARCH}/${basename}_${suffix}.${_file_name}")
|
||||
add_custom_command(
|
||||
OUTPUT ${outputpath_base}.${_file_name}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${outputdir}
|
||||
@@ -347,7 +347,7 @@ function(neo_gen_kernel_with_kernel_debug_options platform_name_with_type platfo
|
||||
list(APPEND kernels_to_compile_${platform_name_with_type}_${revision_id} ${output_files})
|
||||
else()
|
||||
foreach(_file_name "spv" "bin" "gen" "dbg")
|
||||
set(_file_prebuilt "${NEO_SOURCE_DIR}/../kernels_bin/${suffix}/${revision_id}/test_files/${NEO_ARCH}/${argwospaces}_${suffix}.${_file_name}")
|
||||
set(_file_prebuilt "${NEO_KERNELS_BIN_DIR}/${suffix}/${revision_id}/test_files/${NEO_ARCH}/${argwospaces}_${suffix}.${_file_name}")
|
||||
add_custom_command(
|
||||
OUTPUT ${outputpath_base}.${_file_name}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${outputdir}
|
||||
|
||||
@@ -101,7 +101,7 @@ function(compile_builtin core_type platform_type builtin bits builtin_options mo
|
||||
list(APPEND BUILTINS_COMMANDS "${OUTPUT_FILE_CPP}")
|
||||
else()
|
||||
foreach(_file_name "gen" "bin")
|
||||
set(_file_prebuilt "${NEO_SOURCE_DIR}/../kernels_bin/built_ins/${NEO_ARCH}/${core_type_lower}/${mode}_${BASENAME}_${REVISION_ID}_${family_name_with_type}.${_file_name}")
|
||||
set(_file_prebuilt "${NEO_KERNELS_BIN_DIR}/built_ins/${NEO_ARCH}/${core_type_lower}/${mode}_${BASENAME}_${REVISION_ID}_${family_name_with_type}.${_file_name}")
|
||||
if(EXISTS ${_file_prebuilt})
|
||||
add_custom_command(
|
||||
OUTPUT ${BINARY_OUTPUT}.${_file_name}
|
||||
@@ -110,7 +110,7 @@ function(compile_builtin core_type platform_type builtin bits builtin_options mo
|
||||
)
|
||||
endif()
|
||||
endforeach()
|
||||
set(_file_prebuilt "${NEO_SOURCE_DIR}/../kernels_bin/built_ins/${NEO_ARCH}/${core_type_lower}/${mode}_${BASENAME}_${family_name_with_type}_${REVISION_ID}.cpp")
|
||||
set(_file_prebuilt "${NEO_KERNELS_BIN_DIR}/built_ins/${NEO_ARCH}/${core_type_lower}/${mode}_${BASENAME}_${family_name_with_type}_${REVISION_ID}.cpp")
|
||||
if(EXISTS ${_file_prebuilt})
|
||||
add_custom_command(
|
||||
OUTPUT ${OUTPUT_FILE_CPP}
|
||||
@@ -153,7 +153,7 @@ function(generate_cpp_spirv builtin)
|
||||
)
|
||||
set(OUTPUT_LIST_CPP_FILES ${OUTPUT_LIST_CPP_FILES} ${OUTPUT_FILE_CPP} PARENT_SCOPE)
|
||||
else()
|
||||
set(_file_prebuilt "${NEO_SOURCE_DIR}/../kernels_bin/built_ins/${NEO_ARCH}/spirv/${DIR}/${BASENAME}.spv")
|
||||
set(_file_prebuilt "${NEO_KERNELS_BIN_DIR}/built_ins/${NEO_ARCH}/spirv/${DIR}/${BASENAME}.spv")
|
||||
if(EXISTS ${_file_prebuilt})
|
||||
add_custom_command(
|
||||
OUTPUT ${GENERATED_SPV_INPUT}
|
||||
@@ -161,7 +161,7 @@ function(generate_cpp_spirv builtin)
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${_file_prebuilt} ${OUTPUTDIR}
|
||||
)
|
||||
endif()
|
||||
set(_file_prebuilt "${NEO_SOURCE_DIR}/../kernels_bin/built_ins/${NEO_ARCH}/spirv/${DIR}/${BASENAME}.cpp")
|
||||
set(_file_prebuilt "${NEO_KERNELS_BIN_DIR}/built_ins/${NEO_ARCH}/spirv/${DIR}/${BASENAME}.cpp")
|
||||
if(EXISTS ${_file_prebuilt})
|
||||
add_custom_command(
|
||||
OUTPUT ${OUTPUT_FILE_CPP}
|
||||
|
||||
@@ -35,7 +35,7 @@ function(compile_kernels_gen platform_name_with_type revision_id platform_name s
|
||||
list(APPEND compiled_kernels_${platform_name_with_type}_${revision_id} ${output_files})
|
||||
else()
|
||||
foreach(_file_name "spv" "bin" "gen")
|
||||
set(_file_prebuilt "${NEO_SOURCE_DIR}/../kernels_bin/${suffix}/${revision_id}/test_files/${NEO_ARCH}/${basename}_${suffix}.${_file_name}")
|
||||
set(_file_prebuilt "${NEO_KERNELS_BIN_DIR}/${suffix}/${revision_id}/test_files/${NEO_ARCH}/${basename}_${suffix}.${_file_name}")
|
||||
add_custom_command(
|
||||
OUTPUT ${outputpath_base}.${_file_name}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${outputdir}
|
||||
|
||||
Reference in New Issue
Block a user