forked from bd4/sycl-test
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (31 loc) · 1.3 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
SYCL_CXX ?= $(ONEAPI_ROOT)/compiler/latest/linux/bin/dpcpp
MKL_ROOT ?= $(ONEAPI_ROOT)/mkl/latest
SYCL_CXX_FLAGS = -std=c++17
COMPLEX_FLAGS = -device-math-lib=fp32,fp64
MKL_FLAGS = -DMKL_ILP64 -I$(MKL_ROOT)/include -L$(MKL_ROOT)/lib/intel64 -lmkl_sycl -lmkl_intel_ilp64 -lmkl_sequential -lmkl_core
# See
# https://github.com/jinge90/llvm/blob/sycl/sycl/doc/extensions/C-CXX-StandardLibrary/DeviceLibExtensions.rst
# and
# https://github.com/jinge90/llvm/blob/sycl/sycl/test/devicelib/std_complex_math_fp64_test.cpp
#DPCPP_LIBDIR ?= /opt/intel/inteloneapi/compiler/latest/linux/lib
#DPCPP_OBJS = libsycl-complex-fp64.o libsycl-cmath-fp64.o
#LIBS = $(addprefix $(DPCPP_LIBDIR)/,$(DPCPP_OBJS))
BUILD_DIR=build-intelone
SYCL_SOURCES = $(wildcard *.cxx)
EXES = $(addprefix $(BUILD_DIR)/,$(basename $(SYCL_SOURCES)))
.PHONY: all
all: $(EXES)
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
$(BUILD_DIR)/% : %.cxx | $(BUILD_DIR)
@echo "Compiling "$<
$(SYCL_CXX) $(SYCL_CXX_FLAGS) -o $@ $< $(LIBS)
$(BUILD_DIR)/complex : complex.cxx | $(BUILD_DIR)
@echo "Compiling "$<
$(SYCL_CXX) $(SYCL_CXX_FLAGS) $(COMPLEX_FLAGS) -o $@ $< $(LIBS)
$(BUILD_DIR)/batched_zgetrs : batched_zgetrs.cxx | $(BUILD_DIR)
@echo "Compiling "$<
$(SYCL_CXX) $(SYCL_CXX_FLAGS) $(COMPLEX_FLAGS) $(MKL_FLAGS) -o $@ $< $(LIBS)
.PHONY: clean
clean:
rm -f $(BUILD_DIR)/*