CC = gcc STARPU_VERSION=1.3 CPPFLAGS += $(shell pkg-config --cflags starpu-$(STARPU_VERSION)) LDLIBS += $(shell pkg-config --libs starpu-$(STARPU_VERSION)) CFLAGS += -O3 -Wall -Wextra # to avoid having to use LD_LIBRARY_PATH LDLIBS += -Wl,-rpath -Wl,$(shell pkg-config --variable=libdir starpu-$(STARPU_VERSION)) # Automatically enable CUDA / OpenCL STARPU_CONFIG=$(shell pkg-config --variable=includedir starpu-$(STARPU_VERSION))/starpu/$(STARPU_VERSION)/starpu_config.h ifneq ($(shell grep "USE_CUDA 1" $(STARPU_CONFIG)),) USE_CUDA=1 endif ifneq ($(shell grep "USE_OPENCL 1" $(STARPU_CONFIG)),) USE_OPENCL=1 endif ifneq ($(shell grep "RELEASE_VERSION 99" $(STARPU_CONFIG)),) USE_ENERGY=1 endif PROGS=vector_scal0 vector_scal_task_insert vector_scal_task_insert_filter mult gemm/sgemm gemm/dgemm all: $(PROGS) ifeq ($(USE_ENERGY),1) all: mult_bench endif %.o: %.cu nvcc $(CPPFLAGS) $< -c -o $@ vector_scal_task_insert: vector_scal_task_insert.o vector_scal_cpu.o vector_scal_task_insert_filter: vector_scal_task_insert_filter.o vector_scal_cpu.o ifeq ($(USE_CUDA),1) vector_scal_task_insert: vector_scal_cuda.o vector_scal_task_insert_filter: vector_scal_cuda.o vector_scal_task_insert: LDLIBS+=-L$(CUDA_PATH)/lib64 -lcudart -lstdc++ vector_scal_task_insert_filter: LDLIBS+=-L$(CUDA_PATH)/lib64 -lcudart -lstdc++ endif ifeq ($(USE_OPENCL),1) vector_scal_task_insert: vector_scal_opencl.o vector_scal_task_insert_filter: vector_scal_opencl.o vector_scal_task_insert: LDLIBS+=-lOpenCL vector_scal_task_insert_filter: LDLIBS+=-lOpenCL endif mult: mult.o mult_args.o mult_task.o mult_bench: mult_bench.o mult_args.o mult_task.o CFLAGS+=-DSTARPU_OPENBLAS=1 gemm/sgemm: gemm/sgemm.o gemm/common/blas.o gemm/dgemm: gemm/dgemm.o gemm/common/blas.o gemm/sgemm: LDLIBS+=-lblas gemm/dgemm: LDLIBS+=-lblas ifeq ($(USE_CUDA),1) gemm/sgemm: LDLIBS+=-L$(CUDA_PATH)/lib64 -lcublas -lcudart gemm/dgemm: LDLIBS+=-L$(CUDA_PATH)/lib64 -lcublas -lcudart endif clean: rm -f $(PROGS) mult_bench *.o */*.o */*/*.o rm -f paje.trace dag.dot *.rec trace.html rm -f *.gp *.eps *.data