6
6
7
7
function (level_zero_gen_kernels target_list platform_name suffix options )
8
8
9
- if (NOT DEFINED cloc_cmd_prefix )
10
- if (WIN32 )
11
- set (cloc_cmd_prefix ocloc )
12
- else ()
13
- if (DEFINED NEO__IGC_LIBRARY_PATH )
14
- set (cloc_cmd_prefix LD_LIBRARY_PATH=${NEO__IGC_LIBRARY_PATH}:$<TARGET_FILE_DIR:ocloc_lib> $< TARGET_FILE:ocloc> )
9
+ if (NOT NEO_DISABLE_BUILTINS_COMPILATION )
10
+ if (NOT DEFINED cloc_cmd_prefix )
11
+ if (WIN32 )
12
+ set (cloc_cmd_prefix ocloc )
15
13
else ()
16
- set (cloc_cmd_prefix LD_LIBRARY_PATH=$<TARGET_FILE_DIR:ocloc_lib> $< TARGET_FILE:ocloc> )
14
+ if (DEFINED NEO__IGC_LIBRARY_PATH )
15
+ set (cloc_cmd_prefix LD_LIBRARY_PATH=${NEO__IGC_LIBRARY_PATH}:$<TARGET_FILE_DIR:ocloc_lib> $< TARGET_FILE:ocloc> )
16
+ else ()
17
+ set (cloc_cmd_prefix LD_LIBRARY_PATH=$<TARGET_FILE_DIR:ocloc_lib> $< TARGET_FILE:ocloc> )
18
+ endif ()
17
19
endif ()
18
20
endif ()
21
+ list (APPEND results copy_compiler_files )
19
22
endif ()
20
23
21
24
set (outputdir "${TargetDir} /level_zero/${suffix} /test_files/${NEO_ARCH} /" )
22
25
23
- if (NOT NEO_DISABLE_BUILTINS_COMPILATION )
24
- foreach (filepath ${ARGN} )
25
- get_filename_component (filename ${filepath} NAME )
26
- get_filename_component (basename ${filepath} NAME_WE )
27
- get_filename_component (workdir ${filepath} DIRECTORY )
26
+ foreach (filepath ${ARGN} )
27
+ get_filename_component (filename ${filepath} NAME )
28
+ get_filename_component (basename ${filepath} NAME_WE )
29
+ get_filename_component (workdir ${filepath} DIRECTORY )
28
30
29
- set (outputpath_base "${outputdir}${basename} _${suffix} " )
31
+ set (outputpath_base "${outputdir}${basename} _${suffix} " )
32
+ if (NOT NEO_DISABLE_BUILTINS_COMPILATION )
30
33
set (output_files
31
34
${outputpath_base} .bin
32
35
${outputpath_base} .gen
@@ -41,7 +44,19 @@ function(level_zero_gen_kernels target_list platform_name suffix options)
41
44
)
42
45
43
46
list (APPEND ${target_list} ${output_files} )
44
- endforeach ()
45
- endif ()
47
+ else ()
48
+ foreach (_file_name "bin" "gen" )
49
+ set (_file_prebuilt "${NEO_SOURCE_DIR} /../neo_test_kernels/level_zero/${suffix} /test_files/${NEO_ARCH} /${basename} _${suffix} .${_file_name} " )
50
+ add_custom_command (
51
+ OUTPUT ${outputpath_base} .${_file_name}
52
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${outputdir}
53
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${_file_prebuilt} ${outputdir}
54
+ )
55
+
56
+ list (APPEND ${target_list} ${outputpath_base} .${_file_name} )
57
+ endforeach ()
58
+ endif ()
59
+ endforeach ()
60
+
46
61
set (${target_list} ${${target_list}} PARENT_SCOPE )
47
62
endfunction ()
0 commit comments