forked from jpowie01/CUDA-DNN-MNIST
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (32 loc) · 1.24 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
.DEFAULT_GOAL := build
SOURCE_DIR = src
DATA_DIR = data
BUILD_DIR = .
LOGS_DIR = logs
EXEC_FILE_HARDWARE = mlp2_hardware
EXEC_FILE_SIM = mlp2_sim
CPU_SOURCE_FILES := $(shell find $(SOURCEDIR) -name '*.cpp')
GPU_SOURCE_FILES := $(shell find $(SOURCEDIR) -name '*.cu')
dataset:
mkdir -p ${DATA_DIR}
curl -o ${DATA_DIR}/train-images.gz http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz
curl -o ${DATA_DIR}/train-labels.gz http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz
curl -o ${DATA_DIR}/test-images.gz http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz
curl -o ${DATA_DIR}/test-labels.gz http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz
gunzip ${DATA_DIR}/train-images.gz
gunzip ${DATA_DIR}/train-labels.gz
gunzip ${DATA_DIR}/test-images.gz
gunzip ${DATA_DIR}/test-labels.gz
build: FORCE
mkdir -p ${BUILD_DIR}
nvcc ${CPU_SOURCE_FILES} ${GPU_SOURCE_FILES} -lineinfo -o ${BUILD_DIR}/${EXEC_FILE_HARDWARE}
nvcc ${CPU_SOURCE_FILES} ${GPU_SOURCE_FILES} -lineinfo -o ${BUILD_DIR}/${EXEC_FILE_SIM} --cudart shared -gencode arch=compute_61,code=compute_61
run:
mkdir -p ${LOGS_DIR}
./${BUILD_DIR}/${EXEC_FILE}
run_experiments:
mkdir -p ${LOGS_DIR}
python3 run_experiments.py
clean:
rm -rf ${BUILD_DIR}
FORCE: