2018-02-08 16:21:20 +08:00
|
|
|
#
|
2020-01-14 21:38:19 +08:00
|
|
|
# Copyright (C) 2018-2020 Intel Corporation
|
2018-02-08 16:21:20 +08:00
|
|
|
#
|
2018-09-18 15:11:08 +08:00
|
|
|
# SPDX-License-Identifier: MIT
|
2018-02-08 16:21:20 +08:00
|
|
|
#
|
|
|
|
|
2019-06-24 19:48:14 +08:00
|
|
|
add_library(${BUILTINS_BINARIES_LIB_NAME} OBJECT EXCLUDE_FROM_ALL builtins_binary.cmake)
|
2018-02-08 16:21:20 +08:00
|
|
|
|
|
|
|
# Add builtins sources
|
|
|
|
add_subdirectory(registry)
|
|
|
|
|
2018-03-06 21:50:30 +08:00
|
|
|
set(GENERATED_BUILTINS
|
2018-08-07 15:22:55 +08:00
|
|
|
"aux_translation"
|
2018-03-06 21:50:30 +08:00
|
|
|
"copy_buffer_rect"
|
|
|
|
"copy_buffer_to_buffer"
|
|
|
|
"copy_buffer_to_image3d"
|
|
|
|
"fill_buffer"
|
|
|
|
"fill_image1d"
|
|
|
|
"fill_image2d"
|
|
|
|
"fill_image3d"
|
2018-02-08 16:21:20 +08:00
|
|
|
)
|
|
|
|
|
2020-04-22 00:52:36 +08:00
|
|
|
set(GENERATED_BUILTINS_IMAGES
|
|
|
|
"copy_image3d_to_buffer"
|
|
|
|
"copy_image_to_image1d"
|
|
|
|
"copy_image_to_image2d"
|
|
|
|
"copy_image_to_image3d"
|
|
|
|
)
|
|
|
|
|
|
|
|
set(GENERATED_BUILTINS_IMAGES_STATELESS
|
|
|
|
"copy_image3d_to_buffer_stateless"
|
|
|
|
)
|
|
|
|
|
2019-10-10 00:20:12 +08:00
|
|
|
set(GENERATED_BUILTINS_STATELESS
|
|
|
|
"copy_buffer_to_buffer_stateless"
|
2019-11-14 22:25:38 +08:00
|
|
|
"copy_buffer_to_image3d_stateless"
|
2020-04-22 00:52:36 +08:00
|
|
|
"copy_buffer_rect_stateless"
|
2019-10-29 21:23:32 +08:00
|
|
|
"fill_buffer_stateless"
|
2019-10-10 00:20:12 +08:00
|
|
|
)
|
|
|
|
|
2018-02-08 16:21:20 +08:00
|
|
|
# Generate builtins cpps
|
|
|
|
if(COMPILE_BUILT_INS)
|
|
|
|
add_subdirectory(kernels)
|
|
|
|
endif()
|
|
|
|
|
2018-03-22 18:35:24 +08:00
|
|
|
macro(macro_for_each_gen)
|
2019-07-24 17:43:29 +08:00
|
|
|
foreach(PLATFORM_TYPE ${PLATFORM_TYPES})
|
2018-04-18 00:11:50 +08:00
|
|
|
get_family_name_with_type(${GEN_TYPE} ${PLATFORM_TYPE})
|
2020-04-22 00:52:36 +08:00
|
|
|
foreach(GENERATED_BUILTIN_IMAGES ${GENERATED_BUILTINS_IMAGES})
|
|
|
|
list(APPEND GENERATED_BUILTINS_CPPS ${BUILTINS_INCLUDE_DIR}/${RUNTIME_GENERATED_${GENERATED_BUILTIN_IMAGES}_${family_name_with_type}})
|
|
|
|
endforeach()
|
|
|
|
foreach(GENERATED_BUILTIN_IMAGES_STATELESS ${GENERATED_BUILTINS_IMAGES_STATELESS})
|
|
|
|
list(APPEND GENERATED_BUILTINS_CPPS ${BUILTINS_INCLUDE_DIR}/${RUNTIME_GENERATED_${GENERATED_BUILTIN_IMAGES_STATELESS}_${family_name_with_type}})
|
|
|
|
endforeach()
|
2018-04-18 00:11:50 +08:00
|
|
|
foreach(GENERATED_BUILTIN ${GENERATED_BUILTINS})
|
|
|
|
list(APPEND GENERATED_BUILTINS_CPPS ${BUILTINS_INCLUDE_DIR}/${RUNTIME_GENERATED_${GENERATED_BUILTIN}_${family_name_with_type}})
|
|
|
|
endforeach()
|
2019-10-10 00:20:12 +08:00
|
|
|
foreach(GENERATED_BUILTIN_STATELESS ${GENERATED_BUILTINS_STATELESS})
|
|
|
|
list(APPEND GENERATED_BUILTINS_CPPS ${BUILTINS_INCLUDE_DIR}/${RUNTIME_GENERATED_${GENERATED_BUILTIN_STATELESS}_${family_name_with_type}})
|
|
|
|
endforeach()
|
2018-04-18 00:11:50 +08:00
|
|
|
endforeach()
|
2018-03-22 18:35:24 +08:00
|
|
|
source_group("generated files\\${GEN_TYPE_LOWER}" FILES ${GENERATED_BUILTINS_CPPS})
|
|
|
|
endmacro()
|
2018-02-08 16:21:20 +08:00
|
|
|
|
2018-03-22 18:35:24 +08:00
|
|
|
apply_macro_for_each_gen("SUPPORTED")
|
2018-02-08 16:21:20 +08:00
|
|
|
|
|
|
|
if(COMPILE_BUILT_INS)
|
|
|
|
target_sources(${BUILTINS_BINARIES_LIB_NAME} PUBLIC ${GENERATED_BUILTINS_CPPS})
|
|
|
|
set_source_files_properties(${GENERATED_BUILTINS_CPPS} PROPERTIES GENERATED TRUE)
|
2018-03-22 18:35:24 +08:00
|
|
|
endif()
|
2018-02-08 16:21:20 +08:00
|
|
|
|
|
|
|
set_target_properties(${BUILTINS_BINARIES_LIB_NAME} PROPERTIES LINKER_LANGUAGE CXX)
|
|
|
|
set_target_properties(${BUILTINS_BINARIES_LIB_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
|
|
|
set_target_properties(${BUILTINS_BINARIES_LIB_NAME} PROPERTIES FOLDER "built_ins")
|
|
|
|
|
|
|
|
target_include_directories(${BUILTINS_BINARIES_LIB_NAME} PRIVATE
|
2019-03-27 17:06:29 +08:00
|
|
|
${ENGINE_NODE_DIR}
|
2018-02-08 16:21:20 +08:00
|
|
|
${KHRONOS_HEADERS_DIR}
|
2018-08-27 22:30:40 +08:00
|
|
|
${KHRONOS_GL_HEADERS_DIR}
|
2020-01-14 21:38:19 +08:00
|
|
|
${NEO__GMM_INCLUDE_DIR}
|
|
|
|
${NEO__IGC_INCLUDE_DIR}
|
2018-02-08 16:21:20 +08:00
|
|
|
${THIRD_PARTY_DIR}
|
|
|
|
)
|