Update Kokkos library to v2.7.00
This commit is contained in:
50
lib/kokkos/example/make_buildlink/Makefile
Normal file
50
lib/kokkos/example/make_buildlink/Makefile
Normal file
@ -0,0 +1,50 @@
|
||||
KOKKOS_DEVICES=OpenMP
|
||||
KOKKOS_CUDA_OPTIONS=enable_lambda
|
||||
KOKKOS_ARCH = "SNB,Kepler35"
|
||||
|
||||
|
||||
MAKEFILE_PATH := $(subst Makefile,,$(abspath $(lastword $(MAKEFILE_LIST))))
|
||||
|
||||
ifndef KOKKOS_PATH
|
||||
KOKKOS_PATH = $(MAKEFILE_PATH)../..
|
||||
endif
|
||||
|
||||
SRC = $(wildcard $(MAKEFILE_PATH)*.cpp)
|
||||
HEADERS = $(wildcard $(MAKEFILE_PATH)*.hpp)
|
||||
|
||||
vpath %.cpp $(sort $(dir $(SRC)))
|
||||
|
||||
default: build
|
||||
echo "Start Build"
|
||||
|
||||
ifneq (,$(findstring Cuda,$(KOKKOS_DEVICES)))
|
||||
CXX = ${KOKKOS_PATH}/bin/nvcc_wrapper
|
||||
EXE = make_buildlink.cuda
|
||||
else
|
||||
CXX = g++
|
||||
EXE = make_buildlink.host
|
||||
endif
|
||||
|
||||
CXXFLAGS ?= -O3 -g
|
||||
override CXXFLAGS += -I$(MAKEFILE_PATH)
|
||||
|
||||
DEPFLAGS = -M
|
||||
LINK = ${CXX}
|
||||
LINKFLAGS =
|
||||
|
||||
OBJ = $(notdir $(SRC:.cpp=.o))
|
||||
LIB =
|
||||
|
||||
include $(KOKKOS_PATH)/Makefile.kokkos
|
||||
|
||||
build: $(EXE)
|
||||
|
||||
test: build
|
||||
./$(EXE)
|
||||
|
||||
$(EXE): $(SRC) $(KOKKOS_LINK_DEPENDS) $(KOKKOS_CPP_DEPENDS)
|
||||
$(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) $(KOKKOS_CXXLDFLAGS) $(LINKFLAGS) $(EXTRA_PATH) $(SRC) $(KOKKOS_LIBS) $(LIB) -o $(EXE)
|
||||
|
||||
clean: kokkos-clean
|
||||
rm -f *.o *.cuda *.host
|
||||
|
||||
2
lib/kokkos/example/make_buildlink/README
Normal file
2
lib/kokkos/example/make_buildlink/README
Normal file
@ -0,0 +1,2 @@
|
||||
This example provides a template and test for compiling and linking in a single command.
|
||||
|
||||
14
lib/kokkos/example/make_buildlink/main.cpp
Normal file
14
lib/kokkos/example/make_buildlink/main.cpp
Normal file
@ -0,0 +1,14 @@
|
||||
#include<Kokkos_Core.hpp>
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
Kokkos::initialize(argc,argv);
|
||||
{
|
||||
int N = (argc>1) ? atoi(argv[1]) : 10000;
|
||||
int M = (argc>2) ? atoi(argv[2]) : 10000;
|
||||
int R = (argc>3) ? atoi(argv[3]) : 10;
|
||||
|
||||
printf("Called with: %i %i %i\n",N,M,R);
|
||||
|
||||
}
|
||||
Kokkos::finalize();
|
||||
}
|
||||
Reference in New Issue
Block a user