Harigami
ログイン
anonymous タイトルなし
No License Python
コピー
ifeq ($(VERBOSE),1)
ECHO := 
else
ECHO := @
endif

TARGET := HostProgram

# Where is the Altera SDK for OpenCL software?
ifeq ($(wildcard $(ALTERAOCLSDKROOT)),)
$(error Set ALTERAOCLSDKROOT to the root directory of the Altera SDK for OpenCL software installation)
endif
ifeq ($(wildcard $(ALTERAOCLSDKROOT)/host/include/CL/opencl.h),)
$(error Set ALTERAOCLSDKROOT to the root directory of the Altera SDK for OpenCL software installation.)
endif

# Directories.
HOST_DIR := host
TARGET_DIR := bin
INC_DIRS := 
LIB_DIRS := /usr/local/altera/15.0/hld/board/terasic/de5net/tests/common/lib

# All include files.
INC_FILES := $(foreach D,$(INC_DIRS),$(wildcard $D/*.h))

# Source files.
SRCS :=  $(wildcard host/src/*.cpp)

# Libraries.
LIBS :=

# Compiler.
CC := g++ -O3 -fopenmp
#CC := icpc -qopt-report-phase=all -qopt-report-phase=openmp -O3 -xHost -qopenmp

# OpenCL compile and link flags.
AOCL_COMPILE_CONFIG := $(shell aocl compile-config)
AOCL_LINK_CONFIG := $(shell aocl link-config)

# Compilation flags
ifeq ($(DEBUG),1)
CXXFLAGS += -g
endif

# Make it all!
all : $(TARGET_DIR)/$(TARGET)

# Host executable target.
$(TARGET_DIR)/$(TARGET) : Makefile $(SRCS) $(INC_FILES)
	@[ -d $(TARGET_DIR) ] || mkdir $(TARGET_DIR)
	$(ECHO)$(CC) $(CXXFLAGS) -fPIC $(foreach D,$(INC_DIRS),-I$D) \
			$(AOCL_COMPILE_CONFIG) $(SRCS) $(AOCL_LINK_CONFIG) \
			$(foreach D,$(LIB_DIRS),-L$D) \
			$(foreach L,$(LIBS),-l$L) \
			-o $(TARGET_DIR)/$(TARGET) -fopenmp

# Device executable target
HOST = host/src/main.cpp

KERNAME = svd4
DEVICE = device/$(KERNAME).cl
OUTPUT = bin/$(KERNAME)

dev: $(DEVICE)
#	aoc -v -g $(DEVICE) -o $(OUTPUT).aocx -report -board=p385a_sch_ax115
	aoc -v -g $(DEVICE) -o $(OUTPUT).aocx -report

firststage: $(DEVICE)
	aoc -v -c $(DEVICE) -o $(OUTPUT)_fststg.aoco -report 

secondstage:
	aoc -v $(OUTPUT).aoco -o $(OUTPUT).aocx -report

emulate: $(DEVICE)
	aoc -march=emulator -v -g $(DEVICE) -o $(OUTPUT)_emulate.aocx -report 

profile: $(DEVICE)
	aoc -v -g -profile $(DEVICE) -o $(OUTPUT)_profile.aocx -report 

analyze: $(OUTPUT)_emulate.aocx
	aocl analyze-area $(OUTPUT)_emulate.aocx

profiling: $(OUTPUT).aocx
	aocl report $(OUTPUT).aocx profile.mon

client: $(HOST)
	g++ $(HOST)

host:
	vim host/src/main.cpp

device:
	vim $(DEVICE)


# Standard make targets
clean :
	$(ECHO)rm -f $(TARGET_DIR)/$(TARGET)

.PHONY : all clean
ifeq ($(VERBOSE),1)
ECHO := 
else
ECHO := @
endif

TARGET := HostProgram

# Where is the Altera SDK for OpenCL software?
ifeq ($(wildcard $(ALTERAOCLSDKROOT)),)
$(error Set ALTERAOCLSDKROOT to the root directory of the Altera SDK for OpenCL software installation)
endif
ifeq ($(wildcard $(ALTERAOCLSDKROOT)/host/include/CL/opencl.h),)
$(error Set ALTERAOCLSDKROOT to the root directory of the Altera SDK for OpenCL software installation.)
endif

# Directories.
HOST_DIR := host
TARGET_DIR := bin
INC_DIRS := 
LIB_DIRS := /usr/local/altera/15.0/hld/board/terasic/de5net/tests/common/lib

# All include files.
INC_FILES := $(foreach D,$(INC_DIRS),$(wildcard $D/*.h))

# Source files.
SRCS :=  $(wildcard host/src/*.cpp)

# Libraries.
LIBS :=

# Compiler.
CC := g++ -O3 -fopenmp
#CC := icpc -qopt-report-phase=all -qopt-report-phase=openmp -O3 -xHost -qopenmp

# OpenCL compile and link flags.
AOCL_COMPILE_CONFIG := $(shell aocl compile-config)
AOCL_LINK_CONFIG := $(shell aocl link-config)

# Compilation flags
ifeq ($(DEBUG),1)
CXXFLAGS += -g
endif

# Make it all!
all : $(TARGET_DIR)/$(TARGET)

# Host executable target.
$(TARGET_DIR)/$(TARGET) : Makefile $(SRCS) $(INC_FILES)
	@[ -d $(TARGET_DIR) ] || mkdir $(TARGET_DIR)
	$(ECHO)$(CC) $(CXXFLAGS) -fPIC $(foreach D,$(INC_DIRS),-I$D) \
			$(AOCL_COMPILE_CONFIG) $(SRCS) $(AOCL_LINK_CONFIG) \
			$(foreach D,$(LIB_DIRS),-L$D) \
			$(foreach L,$(LIBS),-l$L) \
			-o $(TARGET_DIR)/$(TARGET) -fopenmp

# Device executable target
HOST = host/src/main.cpp

KERNAME = svd4
DEVICE = device/$(KERNAME).cl
OUTPUT = bin/$(KERNAME)

dev: $(DEVICE)
#	aoc -v -g $(DEVICE) -o $(OUTPUT).aocx -report -board=p385a_sch_ax115
	aoc -v -g $(DEVICE) -o $(OUTPUT).aocx -report

firststage: $(DEVICE)
	aoc -v -c $(DEVICE) -o $(OUTPUT)_fststg.aoco -report 

secondstage:
	aoc -v $(OUTPUT).aoco -o $(OUTPUT).aocx -report

emulate: $(DEVICE)
	aoc -march=emulator -v -g $(DEVICE) -o $(OUTPUT)_emulate.aocx -report 

profile: $(DEVICE)
	aoc -v -g -profile $(DEVICE) -o $(OUTPUT)_profile.aocx -report 

analyze: $(OUTPUT)_emulate.aocx
	aocl analyze-area $(OUTPUT)_emulate.aocx

profiling: $(OUTPUT).aocx
	aocl report $(OUTPUT).aocx profile.mon

client: $(HOST)
	g++ $(HOST)

host:
	vim host/src/main.cpp

device:
	vim $(DEVICE)


# Standard make targets
clean :
	$(ECHO)rm -f $(TARGET_DIR)/$(TARGET)

.PHONY : all clean
コンソール
現在、コメントはありません。
最初のコメンターになりませんか?