CMake: improve selection/filtering of archs of Intel GPU binaries #112669
|
@ -684,8 +684,10 @@ This option is only for debugging purposes."
|
|||
)
|
||||
|
||||
# https://www.intel.com/content/www/us/en/develop/documentation/oneapi-dpcpp-cpp-compiler-dev-guide-and-reference/top/compilation/ahead-of-time-compilation.html
|
||||
# acm-g10 is the target for the first Intel Arc Alchemist GPUs.
|
||||
set(CYCLES_ONEAPI_SPIR64_GEN_DEVICES "acm-g10" CACHE STRING "\
|
||||
# The target architectures levels can be retrieved from `ocloc` output when running
|
||||
# `ocloc compile -device {device_id} test.c` for given GPUs PCI device IDs.
|
||||
# 12.55.8 is for Arc Alchemist GPUs. 12.70.0 for Meteor Lake iGPUs.
|
||||
set(CYCLES_ONEAPI_INTEL_BINARIES_ARCH 12.55.8 12.70.0 CACHE STRING "\
|
||||
oneAPI Intel GPU architectures to build binaries for"
|
||||
)
|
||||
set(CYCLES_ONEAPI_SYCL_TARGETS spir64 spir64_gen CACHE STRING "\
|
||||
|
@ -693,7 +695,7 @@ oneAPI targets to build AOT binaries for"
|
|||
)
|
||||
|
||||
mark_as_advanced(WITH_CYCLES_ONEAPI_HOST_TASK_EXECUTION)
|
||||
mark_as_advanced(CYCLES_ONEAPI_SPIR64_GEN_DEVICES)
|
||||
mark_as_advanced(CYCLES_ONEAPI_INTEL_BINARIES_ARCH)
|
||||
mark_as_advanced(CYCLES_ONEAPI_SYCL_TARGETS)
|
||||
endif()
|
||||
|
||||
|
|
|
@ -884,7 +884,28 @@ if(WITH_CYCLES_DEVICE_ONEAPI)
|
|||
endif()
|
||||
# Enable zebin, a graphics binary format with improved compatibility.
|
||||
string(PREPEND CYCLES_ONEAPI_SYCL_OPTIONS_spir64_gen "--format zebin ")
|
||||
string(PREPEND CYCLES_ONEAPI_SYCL_OPTIONS_spir64_gen "-device ${CYCLES_ONEAPI_SPIR64_GEN_DEVICES} ")
|
||||
|
||||
# Add the list of Intel devices to build binaries for.
|
||||
foreach(device ${CYCLES_ONEAPI_INTEL_BINARIES_ARCH})
|
||||
# Run ocloc ids to test if the device is supported.
|
||||
if(WIN32)
|
||||
execute_process(COMMAND ${OCLOC_INSTALL_DIR}/ocloc.exe ids ${device}
|
||||
RESULT_VARIABLE oclocids_ret
|
||||
OUTPUT_QUIET
|
||||
ERROR_QUIET)
|
||||
else()
|
||||
execute_process(COMMAND ${OCLOC_INSTALL_DIR}/bin/ocloc ids ${device}
|
||||
RESULT_VARIABLE oclocids_ret
|
||||
OUTPUT_QUIET
|
||||
ERROR_QUIET)
|
||||
endif()
|
||||
if(NOT oclocids_ret EQUAL 0)
|
||||
list(REMOVE_ITEM CYCLES_ONEAPI_INTEL_BINARIES_ARCH ${device})
|
||||
message(STATUS "binaries for ${device} not supported by Intel Graphics Compiler/ocloc, skipped.")
|
||||
endif()
|
||||
endforeach()
|
||||
list(JOIN CYCLES_ONEAPI_INTEL_BINARIES_ARCH "," gen_devices_string)
|
||||
string(PREPEND CYCLES_ONEAPI_SYCL_OPTIONS_spir64_gen "-device ${gen_devices_string} ")
|
||||
|
||||
# Host execution won't use GPU binaries, no need to compile them.
|
||||
if(WITH_CYCLES_ONEAPI_BINARIES AND NOT WITH_CYCLES_ONEAPI_HOST_TASK_EXECUTION)
|
||||
|
|
Loading…
Reference in New Issue