-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (31 loc) · 2.14 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Simple makefile, need to replace with CMake at some point
# test-cuda is the only currently relevant build target
SHELL := /bin/bash
CPPFILES := CSRRep2D.o SquareTriCSRMesh.o Gradient.o CSRMatrix.o MKLCSRMatrix.o SparseMatMat.o
LIBS := -L${MKLROOT}/lib/intel64 -Wl,--no-as-needed -lmkl_sycl -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lm -ldl
MKLOPTS := -DMKL_LP64 -m64 -I"${MKLROOT}/include"
sycl:
echo "Building default"
# source /opt/intel/oneapi/setvars.sh
icpx -fsycl ./src/main.cpp -o ./bin/poisson-sycl
cuda:
echo "Building CUDA"
clang++ -fsycl -fsycl-targets=nvptx64-nvidia-cuda -DSYCL_USE_NATIVE_FP_ATOMICS ./src/main.cpp -o ./bin/poisson-cuda
test-cuda: ${CPPFILES}
echo "Building test"
clang++ -g -std=c++20 -fsycl -fsycl-targets=nvptx64-nvidia-cuda,spir64_x86_64 -DSYCL_USE_NATIVE_FP_ATOMICS ${MKLOPTS} ${LIBS} ${CPPFILES} ./src/test.cpp -o ./bin/test-cuda
test-sycl:
echo "Building test"
icpx -g -std=c++20 ./src/test.cpp ./src/mesh.cpp Gradient.o -o ./bin/test-sycl
Gradient.o: src/Gradient.cpp src/Gradient.h
clang++ -g -std=c++20 -fsycl -fsycl-targets=nvptx64-nvidia-cuda,spir64_x86_64 -DSYCL_USE_NATIVE_FP_ATOMICS -c ./src/Gradient.cpp
CSRMatrix.o: src/CSRMatrix.cpp src/CSRMatrix.h src/Memory.h
clang++ -g -std=c++20 -fsycl -fsycl-targets=nvptx64-nvidia-cuda,spir64_x86_64 -DSYCL_USE_NATIVE_FP_ATOMICS -c ./src/CSRMatrix.cpp
CSRRep2D.o: src/CSRRep2D.cpp src/CSRRep2D.h
clang++ -g -std=c++20 -fsycl -fsycl-targets=nvptx64-nvidia-cuda,spir64_x86_64 -DSYCL_USE_NATIVE_FP_ATOMICS -c ./src/CSRRep2D.cpp
SquareTriCSRMesh.o: src/SquareTriCSRMesh.cpp src/SquareTriCSRMesh.h
clang++ -g -std=c++20 -fsycl -fsycl-targets=nvptx64-nvidia-cuda,spir64_x86_64 -DSYCL_USE_NATIVE_FP_ATOMICS -c ./src/SquareTriCSRMesh.cpp
MKLCSRMatrix.o: src/MKLCSRMatrix.cpp src/MKLCSRMatrix.h
clang++ -g -std=c++20 -fsycl -fsycl-targets=nvptx64-nvidia-cuda,spir64_x86_64 -DSYCL_USE_NATIVE_FP_ATOMICS -c ./src/MKLCSRMatrix.cpp
SparseMatMat.o: src/SparseMatMat.cpp src/SparseMatMat.h src/Memory.h src/CSRMatrix.h
clang++ -g -std=c++20 -fsycl -fsycl-targets=nvptx64-nvidia-cuda,spir64_x86_64 -DSYCL_USE_NATIVE_FP_ATOMICS -c ./src/SparseMatMat.cpp