mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-11 13:49:23 -05:00
gnu: gemmlowp: Add "generic" variant.
* gnu/packages/machine-learning.scm (gemmlowp): New variable, based on 'gemmlowp-for-tensorflow'. (gemmlowp-for-tensorflow): Rewrite to inherit from GEMMLOWP. [properties]: New field.
This commit is contained in:
parent
c83d7d68f3
commit
38d319d38a
1 changed files with 55 additions and 19 deletions
|
@ -762,23 +762,22 @@ (define-public rxcpp
|
||||||
I/O.")
|
I/O.")
|
||||||
(license license:asl2.0)))
|
(license license:asl2.0)))
|
||||||
|
|
||||||
(define-public gemmlowp-for-tensorflow
|
|
||||||
;; The commit hash is taken from "tensorflow/workspace.bzl".
|
(define-public gemmlowp
|
||||||
(let ((commit "38ebac7b059e84692f53e5938f97a9943c120d98")
|
(let ((commit "f9959600daa42992baace8a49544a00a743ce1b6")
|
||||||
(revision "2"))
|
(version "0.1")
|
||||||
|
(revision "1"))
|
||||||
(package
|
(package
|
||||||
(name "gemmlowp")
|
(name "gemmlowp")
|
||||||
(version (git-version "0" revision commit))
|
(version (git-version version revision commit))
|
||||||
|
(home-page "https://github.com/google/gemmlowp")
|
||||||
(source (origin
|
(source (origin
|
||||||
(method url-fetch)
|
(method git-fetch)
|
||||||
(uri (string-append "https://mirror.bazel.build/"
|
(uri (git-reference (url home-page) (commit commit)))
|
||||||
"github.com/google/gemmlowp/archive/"
|
(file-name (git-file-name name version))
|
||||||
commit ".zip"))
|
|
||||||
(file-name (string-append "gemmlowp-" version ".zip"))
|
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"0n56s2g8hrssm4w8qj1v58gfm56a04n9v992ixkmvk6zjiralzxq"))))
|
"1hzfhlhzcb827aza6a7drydc67dw5fm3qfqilb9ibskan8dsf0c6"))))
|
||||||
(build-system cmake-build-system)
|
|
||||||
(arguments
|
(arguments
|
||||||
`(#:configure-flags
|
`(#:configure-flags
|
||||||
(list ,@(match (%current-system)
|
(list ,@(match (%current-system)
|
||||||
|
@ -798,18 +797,15 @@ (define-public gemmlowp-for-tensorflow
|
||||||
(inc (string-append out "/include/")))
|
(inc (string-append out "/include/")))
|
||||||
(install-file "../build/libeight_bit_int_gemm.so" lib)
|
(install-file "../build/libeight_bit_int_gemm.so" lib)
|
||||||
(for-each (lambda (dir)
|
(for-each (lambda (dir)
|
||||||
(let ((target (string-append inc "/" dir)))
|
(let ((target
|
||||||
(mkdir-p target)
|
(string-append inc "/gemmlowp/" dir)))
|
||||||
(for-each (lambda (h)
|
(for-each (lambda (h)
|
||||||
(install-file h target))
|
(install-file h target))
|
||||||
(find-files (string-append "../" dir)
|
(find-files (string-append "../" dir)
|
||||||
"\\.h$"))))
|
"\\.h$"))))
|
||||||
'("meta" "profiling" "public" "fixedpoint"
|
'("meta" "profiling" "public" "fixedpoint"
|
||||||
"eight_bit_int_gemm" "internal"))
|
"eight_bit_int_gemm" "internal"))))))))
|
||||||
#t))))))
|
(build-system cmake-build-system)
|
||||||
(native-inputs
|
|
||||||
`(("unzip" ,unzip)))
|
|
||||||
(home-page "https://github.com/google/gemmlowp")
|
|
||||||
(synopsis "Small self-contained low-precision GEMM library")
|
(synopsis "Small self-contained low-precision GEMM library")
|
||||||
(description
|
(description
|
||||||
"This is a small self-contained low-precision @dfn{general matrix
|
"This is a small self-contained low-precision @dfn{general matrix
|
||||||
|
@ -819,6 +815,46 @@ (define-public gemmlowp-for-tensorflow
|
||||||
than 8 bits, and at the end only some significant 8 bits are kept.")
|
than 8 bits, and at the end only some significant 8 bits are kept.")
|
||||||
(license license:asl2.0))))
|
(license license:asl2.0))))
|
||||||
|
|
||||||
|
(define-public gemmlowp-for-tensorflow
|
||||||
|
;; The commit hash is taken from "tensorflow/workspace.bzl".
|
||||||
|
(let ((commit "38ebac7b059e84692f53e5938f97a9943c120d98")
|
||||||
|
(revision "2"))
|
||||||
|
(package
|
||||||
|
(inherit gemmlowp)
|
||||||
|
(version (git-version "0" revision commit))
|
||||||
|
(source (origin
|
||||||
|
(method url-fetch)
|
||||||
|
(uri (string-append "https://mirror.bazel.build/"
|
||||||
|
"github.com/google/gemmlowp/archive/"
|
||||||
|
commit ".zip"))
|
||||||
|
(file-name (string-append "gemmlowp-" version ".zip"))
|
||||||
|
(sha256
|
||||||
|
(base32
|
||||||
|
"0n56s2g8hrssm4w8qj1v58gfm56a04n9v992ixkmvk6zjiralzxq"))))
|
||||||
|
(arguments
|
||||||
|
(substitute-keyword-arguments (package-arguments gemmlowp)
|
||||||
|
((#:phases phases)
|
||||||
|
`(modify-phases ,phases
|
||||||
|
(replace 'install
|
||||||
|
(lambda* (#:key outputs #:allow-other-keys)
|
||||||
|
(let* ((out (assoc-ref outputs "out"))
|
||||||
|
(lib (string-append out "/lib/"))
|
||||||
|
(inc (string-append out "/include/")))
|
||||||
|
(install-file "../build/libeight_bit_int_gemm.so" lib)
|
||||||
|
(for-each (lambda (dir)
|
||||||
|
;; Note: Install headers straight into
|
||||||
|
;; $includedir instead of $includedir/gemmlowp.
|
||||||
|
(let ((target (string-append inc "/" dir)))
|
||||||
|
(for-each (lambda (h)
|
||||||
|
(install-file h target))
|
||||||
|
(find-files (string-append "../" dir)
|
||||||
|
"\\.h$"))))
|
||||||
|
'("meta" "profiling" "public" "fixedpoint"
|
||||||
|
"eight_bit_int_gemm" "internal")))))))))
|
||||||
|
(native-inputs
|
||||||
|
`(("unzip" ,unzip)))
|
||||||
|
(properties '((hidden? . #t))))))
|
||||||
|
|
||||||
(define-public dlib
|
(define-public dlib
|
||||||
(package
|
(package
|
||||||
(name "dlib")
|
(name "dlib")
|
||||||
|
|
Loading…
Reference in a new issue