File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -199,9 +199,20 @@ if (GGML_SYCL_DEVICE_ARCH)
199199 -fsycl-targets=spir64_gen
200200 "SHELL:-Xsycl-target-backend=spir64_gen \" -device ${GGML_SYCL_DEVICE_ARCH} \" "
201201 )
202+
203+ # Pass through parallel job (process) count for parallelising the
204+ # `llvm-foreach -- ocloc` invocation for compiling AOT device images.
205+ include (ProcessorCount )
206+ ProcessorCount (_ggml_sycl_nproc )
207+ if (_ggml_sycl_nproc LESS 1)
208+ set (_ggml_sycl_nproc 1)
209+ endif ()
210+ set (GGML_SYCL_MAX_PARALLEL_LINK_JOBS ${_ggml_sycl_nproc} CACHE STRING
211+ "Parallel ocloc jobs for spir64_gen AOT device-image lowering" )
202212 target_link_options (
203213 ggml-sycl PRIVATE
204214 -fsycl-targets=spir64_gen
205215 "SHELL:-Xsycl-target-backend=spir64_gen \" -device ${GGML_SYCL_DEVICE_ARCH} \" "
216+ -fsycl-max-parallel-link-jobs=${GGML_SYCL_MAX_PARALLEL_LINK_JOBS}
206217 )
207218endif ()
You can’t perform that action at this time.
0 commit comments