summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Elsing <[email protected]>2025-01-22 18:32:20 +0000
committerLudovic Courtès <[email protected]>2025-01-27 14:42:40 +0100
commit598907dbd03a00bd61415b8af645281ad046008c (patch)
treec11f3d28898568c3c165ea1c6934d115bf1f412a
parent8e79dff65bdb27c15a0ab49428bcbdd1d4bf7604 (diff)
gnu: oneapi-dnnl: Regenerate autogenerated files.
* gnu/packages/machine-learning.scm (oneapi-dnnl)[source]: Add snippet. [arguments]<#:configure-flags>: Add "-DDNNL_EXPERIMENTAL_UKERNEL=ON". [arguments]<#:phases>: Add 'codegen phase. [native-inputs]: New field to add castxml, clang-17 and python. Signed-off-by: Ludovic Courtès <[email protected]>
-rw-r--r--gnu/packages/machine-learning.scm44
1 files changed, 40 insertions, 4 deletions
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index fe50c45828..b93436f24b 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -6260,11 +6260,47 @@ Brian 2 simulator.")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
- (base32 "1m2d7qlbfk86rmvmpvx2k3rc2k0l9hf9qpa54jl44670ls9n8i7w"))))
+ (base32 "1m2d7qlbfk86rmvmpvx2k3rc2k0l9hf9qpa54jl44670ls9n8i7w"))
+ (modules '((guix build utils)
+ (ice-9 rdelim)))
+ ;; Copyright date used by code generation script
+ (snippet
+ '(for-each
+ (lambda (file)
+ (with-atomic-file-replacement
+ file
+ (lambda (in out)
+ (let loop ((line (read-line in 'concat)))
+ (if (string-contains line "Copyright")
+ (display line out)
+ (loop (read-line in 'concat)))))))
+ '("include/oneapi/dnnl/dnnl_debug.h"
+ "src/common/dnnl_debug_autogenerated.cpp"
+ "tests/benchdnn/dnnl_debug_autogenerated.cpp"
+ "tests/benchdnn/dnnl_debug.hpp")))))
(build-system cmake-build-system)
- (arguments (if (target-riscv64?)
- (list #:configure-flags #~'("-DDNNL_CPU_RUNTIME=SEQ"))
- '()))
+ (arguments
+ (list
+ #:configure-flags
+ `(list
+ ,@(if (target-riscv64?)
+ (list #:configure-flags '("-DDNNL_CPU_RUNTIME=SEQ"))
+ '())
+ ;; Used in PyTorch
+ "-DDNNL_EXPERIMENTAL_UKERNEL=ON")
+ #:phases
+ '(modify-phases %standard-phases
+ (add-after 'configure 'codegen
+ (lambda _
+ (with-directory-excursion "../source"
+ (invoke "castxml" "--castxml-cc-gnu-c" "clang"
+ "--castxml-output=1" "-DDNNL_EXPERIMENTAL_SPARSE"
+ "-Iinclude" "-I../build/include"
+ "include/oneapi/dnnl/dnnl_types.h" "-o" "types.xml")
+ (invoke "python3" "scripts/generate_dnnl_debug.py" "types.xml")
+ ;; Modifies include/oneapi/dnnl/dnnl.hpp
+ (invoke "python3" "scripts/generate_format_tags.py")))))))
+ (native-inputs (list castxml clang-17 python))
(home-page "https://github.com/oneapi-src/oneDNN")
(synopsis "Deep Neural Network Library")
(description