26 lines
558 B
Makefile
26 lines
558 B
Makefile
|
TARGET=cuda_info
|
||
|
OBJECTS=cuda_info.o
|
||
|
|
||
|
CPPFLAGS=-std=c++14 -O3 -Wall -march=native -mavx2 -mfma -fopenmp -mno-avx512f -I/usr/local/cuda/include
|
||
|
CUDA_CFLAGS:=$(foreach option, $(CPPFLAGS),-Xcompiler=$(option))
|
||
|
|
||
|
LDFLAGS=-L/usr/local/cuda/lib64
|
||
|
LDLIBS=-lstdc++ -lcudart -lm -lcublas -lcublasLt
|
||
|
|
||
|
CXX=g++
|
||
|
CUX=/usr/local/cuda/bin/nvcc
|
||
|
|
||
|
all: $(TARGET)
|
||
|
|
||
|
$(TARGET): $(OBJECTS)
|
||
|
$(CC) $(CPPFLAGS) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(LDLIBS)
|
||
|
|
||
|
%.o: %.cpp
|
||
|
$(CXX) $(CPPFLAGS) -c -o $@ $^
|
||
|
|
||
|
%.o: %.cu
|
||
|
$(CUX) $(CUDA_CFLAGS) -c -o $@ $^
|
||
|
|
||
|
clean:
|
||
|
rm -rf $(TARGET) $(OBJECTS)
|