Commit f98edc3e authored by lvs's avatar lvs
Browse files

corrected host for reading xclbin

parent 0990f100
......@@ -443,7 +443,10 @@ bool fileExists(const char *file_name) {
std::string getBoardBinaryFile(const char *prefix, cl_device_id device) {
// First check if <prefix>.aocx exists. Use it if it does.
/*
std::string file_name = std::string(prefix) + ".aocx";
*/
std::string file_name = std::string(prefix) + ".xclbin";
if(fileExists(file_name.c_str())) {
return file_name;
}
......@@ -459,7 +462,10 @@ std::string getBoardBinaryFile(const char *prefix, cl_device_id device) {
std::string board_name(device_name, 0, end);
// Look for a AOCX with the name <prefix>_<board_name>_<version>.aocx.
/*
file_name = std::string(prefix) + "_" + board_name + "_" + VERSION_STR + ".aocx";
*/
file_name = std::string(prefix) + "_" + board_name + "_" + VERSION_STR + ".xclbin";
if(fileExists(file_name.c_str())) {
return file_name;
}
......@@ -467,7 +473,10 @@ std::string getBoardBinaryFile(const char *prefix, cl_device_id device) {
// At this point just use <prefix>.aocx. This file doesn't exist
// and this should trigger an error later.
/*
return std::string(prefix) + ".aocx";
*/
return std::string(prefix) + ".xclbin";
}
// High-resolution timer.
......
......@@ -560,18 +560,35 @@ FIPO_FLAG = $(FIPOCO_FLAG) \
#helloworld_SRCS=./src/host.cpp $(oclHelper_SRCS) $(xcl2_SRCS)
#helloworld_HDRS=$(xcl2_HDRS)
helloworld_SRCS=$(wildcard ../common/src/AOCLUtils/*.cpp wrapcl/src/*.cpp host/src/*.cpp) \
#helloworld_SRCS=$(wildcard ../common/src/AOCLUtils/*.cpp wrapcl/src/*.cpp host/src/*.cpp) \
# $(oclHelper_SRCS) \
# $(xcl2_SRCS)
#helloworld_HDRS=$(wildcard ./host/inc/*.h) \
# $(xcl2_HDRS)
hostbin_SRCS=$(wildcard ../common/src/AOCLUtils/*.cpp wrapcl/src/*.cpp host/src/*.cpp) \
$(oclHelper_SRCS) \
$(xcl2_SRCS)
helloworld_HDRS=$(wildcard ./host/inc/*.h) \
hostbin_HDRS=$(wildcard ./host/inc/*.h) \
$(xcl2_HDRS)
# -U__STRICT_ANSI__: to avoid: ‘cl_float3 {aka union cl_float4}’ has no member named ‘y’
helloworld_CXXFLAGS=-I../common/inc/ \
#helloworld_CXXFLAGS=-I../common/inc/ \
# -I./host/inc/ \
# -I. \
# -I./wrapcl/inc/ \
# $(opencl_CXXFLAGS) $(xcl2_CXXFLAGS) $(oclHelper_CXXFLAGS) \
# -std=c++0x \
# -U__STRICT_ANSI__ \
# $(ENABLE_KERNELS) \
# $(REP) \
# $(FIPO_FLAG)
hostbin_CXXFLAGS=-I../common/inc/ \
-I./host/inc/ \
-I. \
-I./wrapcl/inc/ \
......@@ -582,25 +599,31 @@ helloworld_CXXFLAGS=-I../common/inc/ \
$(REP) \
$(FIPO_FLAG)
#helloworld_LDFLAGS=$(opencl_LDFLAGS)
hostbin_LDFLAGS=$(opencl_LDFLAGS)
helloworld_LDFLAGS=$(opencl_LDFLAGS)
EXES=helloworld
#EXES=helloworld
EXES=hostbin
# Kernel
#vector_addition_SRCS=./src/vector_addition.cl
vector_addition_SRCS=./device/Krnl_GA.cl
#vector_addition_SRCS=$(wildcard ./device/*.cl)
#vector_addition_SRCS=./device/Krnl_GA.cl
Krnl_GA_SRCS=./device/Krnl_GA.cl
XOS=vector_addition
#XOS=vector_addition
XOS=Krnl_GA
vector_addition_XOS=vector_addition
#vector_addition_XOS=vector_addition
Krnl_GA_XOS=Krnl_GA
XCLBINS=vector_addition
#XCLBINS=vector_addition
XCLBINS=Krnl_GA
# check
check_EXE=helloworld
check_XCLBINS=vector_addition
#check_EXE=helloworld
check_EXE=hostbin
#check_XCLBINS=vector_addition
check_XCLBINS=Krnl_GA
CHECKS=check
......@@ -608,6 +631,6 @@ include $(COMMON_REPO)/utility/rules.mk
# Automate test
# "exe" and "xclbin" are rules from "rules.mk"
test:
XCL_EMULATION_MODE=sw_emu ./helloworld -ffile input/1stp/derived/1stp_protein.maps.fld -lfile input/1stp/derived/1stp_ligand.pdbqt
emu:
XCL_EMULATION_MODE=sw_emu ./hostbin -ffile input/1stp/derived/1stp_protein.maps.fld -lfile input/1stp/derived/1stp_ligand.pdbqt
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment