This repository has been archived on 2026-11-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
radiance-sycl/libxe2/CMakeLists.txt
T
claudeandClaude Opus 5.5 ea065f596c libxe2: the Intel kernel library's skeleton, and its first op, add
libxe2 is a kernel plugin like any other, built by rad_add_plugin from the icpx sub-build into the
build tree's $RADIANCE_HOME. It declares no schemas (every op it serves is libref's vocabulary), only
device rows, written with designated initialisers. xe2_common.h holds what every kernel needs: the
launch's queue (rad_sycl.h), row views over padded operands, refusals that name the geometry, and
libref's own dtype conversions so results round where the reference's do.

add passes rad-kbench against libref at tolerance zero, on the recorded fixture (30 cases) and on
MiniCPM5-2B's container (20 cases), inside guarded allocations. In a SYCL build the kbench replays
run libxe2 on the card, so they are labelled sycl there, as they are gpu in a HIP build.

scripts/sycl/notify.sh posts to the Discord webhook when the port needs the user.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
2026-10-23 15:55:39 +02:00

35 lines
1.7 KiB
CMake

# libxe2 -- radiance's kernel library for Intel Xe2 GPUs (Battlemage; the Arc Pro B65), in SYCL.
# docs/SYCL_PORTING.md has the design, docs/SYCL_PROGRESS.md the state.
#
# Links radiance::abi and the SYCL runtime, nothing of radiance's. Built by icpx: in radiance's tree
# through the sycl/ sub-build, or standalone against an installed radiance:
# cmake -S libxe2 -B build -DCMAKE_CXX_COMPILER=icpx -DCMAKE_PREFIX_PATH=<radiance prefix>
if(NOT COMMAND rad_add_plugin)
cmake_minimum_required(VERSION 3.21)
project(libxe2 LANGUAGES CXX)
find_package(radiance REQUIRED)
rad_plugin_defaults()
endif()
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
message(FATAL_ERROR "libxe2 is SYCL and needs icpx (-DCMAKE_CXX_COMPILER=icpx); this configure "
"has ${CMAKE_CXX_COMPILER_ID}.")
endif()
if(NOT RAD_SYCL_TARGETS)
set(RAD_SYCL_TARGETS "intel_gpu_bmg_g31")
endif()
file(GLOB XE2_SRC CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
rad_add_plugin(libxe2 kernels SOURCES ${XE2_SRC})
# -ffp-contract=off is a correctness flag here as in libref: kernels are checked against it, so
# `a*b + c` rounds twice on both sides. It follows -ffp-model=precise, which would otherwise set
# contraction back on.
set(_xe2_sycl -fsycl "-fsycl-targets=${RAD_SYCL_TARGETS}")
target_compile_options(libxe2 PRIVATE ${_xe2_sycl} -ffp-model=precise -ffp-contract=off -Wno-overriding-option
-fvisibility=hidden)
get_filename_component(_xe2_icpx_bin "${CMAKE_CXX_COMPILER}" DIRECTORY)
get_filename_component(_xe2_oneapi_lib "${_xe2_icpx_bin}/../lib" ABSOLUTE)
target_link_options(libxe2 PRIVATE ${_xe2_sycl} "LINKER:-rpath,${_xe2_oneapi_lib}"
"LINKER:--no-undefined")