-
Notifications
You must be signed in to change notification settings - Fork 7
/
Rakefile
43 lines (35 loc) · 1.09 KB
/
Rakefile
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
require "bundler/gem_tasks"
require "rake/testtask"
Rake::TestTask.new(:test) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList["test/**/*_test.rb"]
end
task :compile do
sh 'cd ext/cumo && ruby extconf.rb && make && make build-ctest'
end
task :ctest do
sh 'cd ext/cumo && ruby extconf.rb && make run-ctest'
end
task :clean do
sh 'cd ext/cumo && make clean'
end
task :docs do
dir = "ext/cumo"
srcs = %w[array.c data.c index.c math.c narray.c rand.c struct.c].map{|s| File.join(dir, "narray", s)}
srcs += %w[cublas.c driver.c nvrtc.c runtime.c memory_pool.cpp].map{|s| File.join(dir, "cuda", s) }
srcs << File.join(dir, "narray", "types/*.c")
srcs << "lib/cumo/narray/extra.rb"
sh "cd ext/cumo; ruby extconf.rb; make src"
sh "rm -rf docs .yardoc; yard doc -o docs -m markdown -r README.md #{srcs.join(' ')}"
end
task :doc => :docs
task :gdb do
sh "gdb -x run.gdb --args ruby -I. ./test.rb"
end
task :default => [:clobber, :compile, :test]
desc 'Open an irb session preloaded with the gem library'
task :console do
sh 'irb -rubygems -I lib'
end
task :c => :console