Skip to content

Commit

Permalink
added ability for sycl makefile to take command line argument
Browse files Browse the repository at this point in the history
  • Loading branch information
jtramm committed Dec 4, 2019
1 parent 1923999 commit b4c41dd
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions sycl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
# User Options
#===============================================================================

COMPILER = clang
# Compiler can be set below, or via environment variable
ifeq ($(CC),)
CC = clang
endif
OPTIMIZE = yes
DEBUG = no
PROFILE = no
Expand All @@ -27,26 +30,25 @@ obj = $(source:.cpp=.o)
# Sets Flags
#===============================================================================

# Make sure we didn't pick up lower case cc
ifeq (cc,$(CC))
CC = clang
endif

# Standard Flags
CFLAGS := -std=c++14 -Wall

# Linker Flags
LDFLAGS = -lm

# Regular gcc Compiler
ifeq ($(COMPILER),gnu)
CC = gcc
CFLAGS += -flto
endif

# Codeplay Compiler
ifeq ($(COMPILER),codeplay)
ifneq (,$(findstring codeplay,$(CC)))
CC = compute++
CFLAGS += -sycl -sycl-driver
LDFLAGS += -lComputeCpp
endif

ifeq ($(COMPILER),clang)
ifneq (,$(findstring clang,$(CC)))
CC = clang++
CFLAGS += -fsycl
LDFLAGS += -lOpenCL
Expand Down

0 comments on commit b4c41dd

Please sign in to comment.