Skip to content

Commit

Permalink
Split compilation lines for SYCL Stream
Browse files Browse the repository at this point in the history
The Makefile for SYCL Stream compilation is now split with
individual lines for each file. This facilitates identifying
compile time errors and avoids warnings on unused symbols.
  • Loading branch information
Ruyk committed May 2, 2018
1 parent 63f32fc commit 8920cfd
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions SYCL.make
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@

COMPUTECPP_FLAGS = $(shell $(COMPUTECPP_PACKAGE_ROOT_DIR)/bin/computecpp_info --dump-device-compiler-flags)

sycl-stream: main.cpp SYCLStream.cpp SYCLStream.sycl
$(CXX) -O3 -std=c++11 -DSYCL main.cpp SYCLStream.cpp -I$(COMPUTECPP_PACKAGE_ROOT_DIR)/include -include SYCLStream.sycl $(EXTRA_FLAGS) -L$(COMPUTECPP_PACKAGE_ROOT_DIR)/lib -lComputeCpp -lOpenCL -Wl,--rpath=$(COMPUTECPP_PACKAGE_ROOT_DIR)/lib/ -o $@
sycl-stream: main.o SYCLStream.o SYCLStream.sycl
$(CXX) -O3 -std=c++11 -DSYCL main.o SYCLStream.o $(EXTRA_FLAGS) -L$(COMPUTECPP_PACKAGE_ROOT_DIR)/lib -lComputeCpp -lOpenCL -Wl,--rpath=$(COMPUTECPP_PACKAGE_ROOT_DIR)/lib/ -o $@

main.o: main.cpp
$(CXX) -O3 -std=c++11 -DSYCL main.cpp -c -I$(COMPUTECPP_PACKAGE_ROOT_DIR)/include $(EXTRA_FLAGS) -o $@

SYCLStream.o: SYCLStream.cpp SYCLStream.sycl
$(CXX) -O3 -std=c++11 -DSYCL SYCLStream.cpp -c -I$(COMPUTECPP_PACKAGE_ROOT_DIR)/include -include SYCLStream.sycl $(EXTRA_FLAGS) -o $@

SYCLStream.sycl: SYCLStream.cpp
$(COMPUTECPP_PACKAGE_ROOT_DIR)/bin/compute++ SYCLStream.cpp $(COMPUTECPP_FLAGS) -c -I$(COMPUTECPP_PACKAGE_ROOT_DIR)/include -o $@
$(COMPUTECPP_PACKAGE_ROOT_DIR)/bin/compute++ -DSYCL SYCLStream.cpp $(COMPUTECPP_FLAGS) -c -I$(COMPUTECPP_PACKAGE_ROOT_DIR)/include -o $@

.PHONY: clean
clean:
rm -f sycl-stream SYCLStream.sycl SYCLStream.bc
rm -f sycl-stream SYCLStream.sycl main.o SYCLStream.o

0 comments on commit 8920cfd

Please sign in to comment.