Skip to content
This repository was archived by the owner on Apr 6, 2026. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build2cmake/src/templates/xpu/torch-extension.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
define_gpu_extension_target(
{{ ops_name }}
DESTINATION {{ ops_name }}
INCLUDE_DIRECTORIES "${ONEDNN_XPU_INCLUDE_DIR}"
LANGUAGE ${GPU_LANG}
SOURCES ${SRC}
COMPILE_FLAGS ${sycl_flags}
Expand Down
6 changes: 5 additions & 1 deletion lib/torch-extension/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ let
);

oneapi-torch-dev = xpuPackages.oneapi-torch-dev.override { inherit stdenv; };
onednn-xpu = xpuPackages.onednn-xpu.override { inherit stdenv oneapi-torch-dev; };

# On Darwin, we need the host's xcrun for `xcrun metal` to compile Metal shaders.
# t's not supported by the nixpkgs shim.
Expand Down Expand Up @@ -132,7 +133,7 @@ stdenv.mkDerivation (prevAttrs: {
++ lib.optionals rocmSupport (with rocmPackages; [ hipsparselt ])
++ lib.optionals xpuSupport ([
oneapi-torch-dev
xpuPackages.onednn-xpu
onednn-xpu
])
++ lib.optionals stdenv.hostPlatform.isDarwin [
apple-sdk_15
Expand Down Expand Up @@ -172,6 +173,9 @@ stdenv.mkDerivation (prevAttrs: {
(lib.cmakeFeature "CMAKE_HIP_COMPILER_ROCM_ROOT" "${clr}")
(lib.cmakeFeature "HIP_ROOT_DIR" "${clr}")
]
++ lib.optionals xpuSupport [
(lib.cmakeFeature "ONEDNN_XPU_INCLUDE_DIR" "${onednn-xpu}/include")
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# Use host compiler for Metal. Not included in the redistributable SDK.
(lib.cmakeFeature "METAL_COMPILER" "${xcrunHost}/bin/xcrunHost")
Expand Down
Loading