-
Notifications
You must be signed in to change notification settings - Fork 1
/
makefile
55 lines (41 loc) · 1.41 KB
/
makefile
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
SHELL := /bin/bash
CONF?=default.conf
EPOCH?=2
IMG?=test_pics/4.png
N_THR?=4
export CONF
export EPOCH
all:
cd c_implementation && $(MAKE)
cd c_implementation/opencl_implementation && $(MAKE)
train:
@mkdir -p parameters
@cd python_training && $(MAKE)
default_test: test_pics/4.png run_single_core run_openmp run_opencl
test_pics/4.png:
mkdir -p test_pics
wget https://www.dropbox.com/s/enrn8w7zlkmc6c4/4.png
mv 4.png test_pics/
download_test_pics:
mkdir -p test_pics
wget https://www.dropbox.com/s/hj2jiwjz4lsqjmf/test_pics.tar
tar -xvf test_pics.tar --directory test_pics/
run_openmp: test_pics/4.png c_implementation/simple_mlp.o
export OMP_NUM_THREADS=$(N_THR) && ./c_implementation/simple_mlp.o $(CONF) $(IMG)
run_opencl: test_pics/4.png c_implementation/opencl_implementation/opencl_mlp
./c_implementation/opencl_implementation/opencl_mlp $(CONF) $(IMG)
run_single_core: test_pics/4.png c_implementation/simple_mlp.o
export OMP_NUM_THREADS=1 && ./c_implementation/simple_mlp.o $(CONF) $(IMG)
c_implementation/simple_mlp.o:
cd c_implementation && $(MAKE)
c_implementation/opencl_implementation/opencl_mlp:
cd c_implementation/opencl_implementation && $(MAKE)
clean_all:
@echo "Cleaning up..."
@rm -rf parameters
@rm -rf test_pics
@find ./ -name "*.conf" -not -name "default.conf" -exec rm {} \;
@cd c_implementation && make clean
@cd python_training && make clean
clean:
@cd c_implementation && make clean