-
Notifications
You must be signed in to change notification settings - Fork 13
/
linalg.nimble
77 lines (63 loc) · 1.89 KB
/
linalg.nimble
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
mode = ScriptMode.Verbose
packageName = "linalg"
version = "0.6.6"
author = "Andrea Ferretti"
description = "Linear Algebra for Nim"
license = "Apache2"
skipDirs = @["tests", "bench"]
skipFiles = @["linalg.html"]
requires "nim >= 0.13.1", "nimblas >= 0.1.3"
--forceBuild
when defined(nimdistros):
import distros
if detectOs(Ubuntu) or detectOs(Debian):
foreignDep "libblas-dev"
foreignDep "libopenblas-dev"
foreignDep "liblapack-dev"
else:
foreignDep "libblas"
foreignDep "liblapack"
proc configForTests() =
--hints: off
--linedir: on
--stacktrace: on
--linetrace: on
--debuginfo
--path: "."
--run
proc configForBenchmarks() =
--define: release
--path: "."
--run
proc configForCuda() =
switch("cincludes", "/usr/local/cuda/targets/x86_64-linux/include")
switch("clibdir", "/usr/local/cuda/targets/x86_64-linux/lib")
--define: cublas
task test, "run standard tests":
configForTests()
setCommand "c", "tests/all.nim"
task testopenblas, "run standard tests on openblas":
configForTests()
--define: openblas
setCommand "c", "tests/all.nim"
task testmkl, "run standard tests on mkl":
configForTests()
--dynlibOverride:mkl_intel_lp64
--passL:"/home/papillon/.intel/mkl/lib/intel64/libmkl_intel_lp64.a"
--define: mkl
setCommand "c", "tests/all.nim"
task testcuda, "run tests for the cuda implementation":
configForTests()
configForCuda()
setCommand "c", "tests/cublas.nim"
task bench, "run standard benchmarks":
configForBenchmarks()
setCommand "c", "bench/matrix_matrix_mult.nim"
task benchcuda, "run benchmarks for the cuda implementation":
configForBenchmarks()
configForCuda()
setCommand "c", "bench/cuda/matrix_vector_mult.nim"
task gendoc, "generate documentation":
--define: cublas
--docSeeSrcUrl: https://github.com/andreaferretti/linear-algebra/blob/master
setCommand "doc2", "linalg.nim"