Skip to content
Snippets Groups Projects
Commit 6bbd9c61 authored by Gabriel Falk's avatar Gabriel Falk
Browse files

Replace Makefile

parent 74a0f3c5
Branches
No related tags found
No related merge requests found
BUILD_DIR=build
SRC_DIR=src
CC = g++
NVCC = nvcc
CXXFLAGS= -fopenmp -O3 -Wextra -std=c++11
CUDAFLAGS= -std=c++11 -arch=sm_75
all: $(BUILD_DIR)/deeplearning.o
gcc -Wall -o $(BUILD_DIR)/deeplearning $(BUILD_DIR)/deeplearning.o -L libonnx/src -lonnx -lm
$(BUILD_DIR)/deeplearning.o : $(SRC_DIR)/deeplearning.c
gcc -Wall -c $(SRC_DIR)/deeplearning.c -I libonnx/src -o $(BUILD_DIR)/deeplearning.o
.PHONY: all clean
all: main
clean:
rm -f build/*
rm -f main main.o cudaKernels.o matrix.o test.o cudaLenet5.o tensor.o ops.o
main: main.o cudaKernels.o matrix.o test.o cudaLenet5.o tensor.o ops.o
$(NVCC) -o main main.o cudaKernels.o matrix.o test.o cudaLenet5.o tensor.o ops.o -lcufft
main.o: main.cpp cudaKernels.h matrix.h test.h cudaLenet5.h tensor.h
$(CC) $(CXXFLAGS) -c -o main.o main.cpp
cudaKernels.o: cudaKernels.cu
$(NVCC) $(CUDAFLAGS) -c cudaKernels.cu
matrix.o: matrix.cpp matrix.h
$(CC) $(CXXFLAGS) -c -o matrix.o matrix.cpp
test.o: test.cpp test.h
$(CC) $(CXXFLAGS) -c -o test.o test.cpp
cudaLenet5.o: cudaLenet5.cu
$(NVCC) $(CUDAFLAGS) -c cudaLenet5.cu
tensor.o: tensor.cc tensor.h
$(CC) $(CXXFLAGS) -c -o tensor.o tensor.cc
ops.o: ops.cc tensor.h
$(CC) $(CXXFLAGS) -c -o ops.o ops.cc
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment