summaryrefslogtreecommitdiff
path: root/gnu/packages/machine-learning.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/machine-learning.scm')
-rw-r--r--gnu/packages/machine-learning.scm27
1 files changed, 19 insertions, 8 deletions
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 7f24a449fe..d4b8903009 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -3893,7 +3893,6 @@ advanced research.")
(build-system cmake-build-system)
(arguments
(list
- #:tests? #false ;tests are not building now
#:build-type "Release"
#:modules '((ice-9 match)
(guix build utils)
@@ -3909,6 +3908,7 @@ advanced research.")
"-DTFLITE_ENABLE_GPU=ON"
"-DTFLITE_ENABLE_RUY=ON"
+ "-DTFLITE_ENABLE_XNNPACK=ON"
;; TODO: turn on Farmhash
;;"-DSYSTEM_FARMHASH=ON"
@@ -3926,11 +3926,6 @@ advanced research.")
(string-append "-Druy_DIR=" #$(this-package-input "ruy")
"/lib/cmake/ruy")
- ;; TODO: The build system attempts to build xnnpack from source. We
- ;; would like to use our xnnpack package here, but this requires more
- ;; work.
- "-DTFLITE_ENABLE_XNNPACK=OFF"
-
;; Don't fetch the sources. We have these already
"-Dgemmlowp_POPULATED=TRUE"
"-Degl_headers_POPULATED=TRUE"
@@ -3942,6 +3937,7 @@ advanced research.")
"-Dgoogle_benchmark_POPULATED=TRUE"
"-Dnsync_POPULATED=TRUE"
"-Dre2_POPULATED=TRUE"
+ "-Dxnnpack_POPULATED=TRUE"
"-DFFT2D_SOURCE_DIR=/tmp/fft2d"
"-DFARMHASH_SOURCE_DIR=/tmp/farmhash"
@@ -3976,6 +3972,21 @@ advanced research.")
(with-directory-excursion "/tmp/fft2d"
(invoke "tar" "--strip-components=1"
"-xf" (assoc-ref inputs "fft2d-src")))))
+ (add-after 'copy-sources 'opencl-fix
+ (lambda _ (substitute* "delegates/gpu/cl/opencl_wrapper.h"
+ (("cl_ndrange_kernel_command_properties_khr")
+ "cl_command_properties_khr"))))
+ (add-after 'opencl-fix 'absl-fix
+ (lambda _ (substitute* '(
+ "delegates/gpu/cl/cl_operation.h"
+ "delegates/gpu/common/task/qcom_thin_filter_desc.cc"
+ "delegates/gpu/common/tasks/special/thin_pointwise_fuser.cc")
+ (("#include <vector>")
+ "#include <vector>\n\n#include \"absl/strings/str_cat.h\"\n"))))
+ (add-after 'opencl-fix 'stdint-fix
+ (lambda _ (substitute* "kernels/internal/spectrogram.cc"
+ (("#include <math.h>")
+ "#include <math.h>\n#include <cstdint>\n"))))
(add-after 'build 'build-shared-library
(lambda* (#:key configure-flags #:allow-other-keys)
(mkdir-p "c")
@@ -4000,7 +4011,7 @@ advanced research.")
(when tests?
(invoke "ctest" "-L" "plain")))))))
(inputs
- `(("abseil-cpp" ,abseil-cpp-20200923.3)
+ `(("abseil-cpp" ,abseil-cpp)
("cpuinfo" ,cpuinfo)
("eigen" ,eigen)
("fp16" ,fp16)
@@ -4016,7 +4027,7 @@ advanced research.")
("python" ,python)
("ruy" ,ruy)
("re2" ,re2)
- ;;("xnnpack" ,xnnpack) ; TODO: use Guix's copy of xnnpack
+ ("xnnpack" ,xnnpack)
("vulkan-headers" ,vulkan-headers)))
(native-inputs
`(("pkg-config" ,pkg-config)