diff --git a/gds/samples/buffer-agnostic/Makefile b/gds/samples/buffer-agnostic/Makefile new file mode 100644 index 0000000..55d7ee1 --- /dev/null +++ b/gds/samples/buffer-agnostic/Makefile @@ -0,0 +1,35 @@ +# Common includes and paths for CUDA +CUDA_PATH := /usr/local/cuda +CUFILE_PATH := /usr/local/gds/lib +CXXFLAGS += -I $(CUDA_PATH)/include/ + +GDS_SUPPORT = FALSE + +CXX:=nvcc + +########################### +# Enable the following line for code coverage +#CXXFLAGS += -ftest-coverage -fprofile-arcs +########################### +CUDA_LIB := -L $(CUDA_PATH)/lib64/ -lcuda -L $(CUDA_PATH)/lib64/ -lcudart +################################################################################ + +ifeq ($(GDS_SUPPORT),TRUE) +CXXFLAGS += -I $(CUFILE_PATH) -DGDS_SUPPORT +CUFILE_LIB := -L $(CUFILE_PATH) -lcufile +LDFLAGS := $(CUFILE_LIB) $(CUDA_LIB) -lcrypto -lssl -lpthread -ldl +else +LDFLAGS := $(CUDA_LIB) -lcrypto -lssl -lpthread -ldl +endif + +# Target rules +all: build + +build: buffer-agnostic + +%: %.cc $(CUFILE_PATH)/cufile.h + $(CXX) $(CXXFLAGS) $< -o $@ $(LDFLAGS) + +.PHONY : clean +clean: + rm -f buffer-agnostic diff --git a/gds/samples/buffer-agnostic/README.txt b/gds/samples/buffer-agnostic/README.txt new file mode 100644 index 0000000..e01181f --- /dev/null +++ b/gds/samples/buffer-agnostic/README.txt @@ -0,0 +1,15 @@ +Memory Buffer Agnostic Sample + +This sample demonstrates how software can detect where a memory buffer is allocated by querying the +CUDA runtime. + +Compile using gnu make. +$ make clean; make +$ make clean; make GDS_SUPPORT=TRUE # compile with cufile + +Run instructions: +$ ./buffer-agnostic