Commit f1ce6270 authored by lvs's avatar lvs
Browse files

corrected host for reading xclbin


Former-commit-id: f98edc3e
parent 53e4fc3c
...@@ -443,7 +443,10 @@ bool fileExists(const char *file_name) { ...@@ -443,7 +443,10 @@ bool fileExists(const char *file_name) {
std::string getBoardBinaryFile(const char *prefix, cl_device_id device) { std::string getBoardBinaryFile(const char *prefix, cl_device_id device) {
// First check if <prefix>.aocx exists. Use it if it does. // 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) + ".aocx";
*/
std::string file_name = std::string(prefix) + ".xclbin";
if(fileExists(file_name.c_str())) { if(fileExists(file_name.c_str())) {
return file_name; return file_name;
} }
...@@ -459,7 +462,10 @@ std::string getBoardBinaryFile(const char *prefix, cl_device_id device) { ...@@ -459,7 +462,10 @@ std::string getBoardBinaryFile(const char *prefix, cl_device_id device) {
std::string board_name(device_name, 0, end); std::string board_name(device_name, 0, end);
// Look for a AOCX with the name <prefix>_<board_name>_<version>.aocx. // 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 + ".aocx";
*/
file_name = std::string(prefix) + "_" + board_name + "_" + VERSION_STR + ".xclbin";
if(fileExists(file_name.c_str())) { if(fileExists(file_name.c_str())) {
return file_name; return file_name;
} }
...@@ -467,7 +473,10 @@ std::string getBoardBinaryFile(const char *prefix, cl_device_id device) { ...@@ -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 // At this point just use <prefix>.aocx. This file doesn't exist
// and this should trigger an error later. // and this should trigger an error later.
/*
return std::string(prefix) + ".aocx"; return std::string(prefix) + ".aocx";
*/
return std::string(prefix) + ".xclbin";
} }
// High-resolution timer. // High-resolution timer.
......
...@@ -560,18 +560,35 @@ FIPO_FLAG = $(FIPOCO_FLAG) \ ...@@ -560,18 +560,35 @@ FIPO_FLAG = $(FIPOCO_FLAG) \
#helloworld_SRCS=./src/host.cpp $(oclHelper_SRCS) $(xcl2_SRCS) #helloworld_SRCS=./src/host.cpp $(oclHelper_SRCS) $(xcl2_SRCS)
#helloworld_HDRS=$(xcl2_HDRS) #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) \ $(oclHelper_SRCS) \
$(xcl2_SRCS) $(xcl2_SRCS)
helloworld_HDRS=$(wildcard ./host/inc/*.h) \ hostbin_HDRS=$(wildcard ./host/inc/*.h) \
$(xcl2_HDRS) $(xcl2_HDRS)
# -U__STRICT_ANSI__: to avoid: ‘cl_float3 {aka union cl_float4}’ has no member named ‘y’ # -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./host/inc/ \
-I. \ -I. \
-I./wrapcl/inc/ \ -I./wrapcl/inc/ \
...@@ -582,25 +599,31 @@ helloworld_CXXFLAGS=-I../common/inc/ \ ...@@ -582,25 +599,31 @@ helloworld_CXXFLAGS=-I../common/inc/ \
$(REP) \ $(REP) \
$(FIPO_FLAG) $(FIPO_FLAG)
#helloworld_LDFLAGS=$(opencl_LDFLAGS)
hostbin_LDFLAGS=$(opencl_LDFLAGS)
helloworld_LDFLAGS=$(opencl_LDFLAGS) #EXES=helloworld
EXES=hostbin
EXES=helloworld
# Kernel # Kernel
#vector_addition_SRCS=./src/vector_addition.cl #vector_addition_SRCS=./src/vector_addition.cl
vector_addition_SRCS=./device/Krnl_GA.cl #vector_addition_SRCS=./device/Krnl_GA.cl
#vector_addition_SRCS=$(wildcard ./device/*.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
check_EXE=helloworld #check_EXE=helloworld
check_XCLBINS=vector_addition check_EXE=hostbin
#check_XCLBINS=vector_addition
check_XCLBINS=Krnl_GA
CHECKS=check CHECKS=check
...@@ -608,6 +631,6 @@ include $(COMMON_REPO)/utility/rules.mk ...@@ -608,6 +631,6 @@ include $(COMMON_REPO)/utility/rules.mk
# Automate test # Automate test
# "exe" and "xclbin" are rules from "rules.mk" # "exe" and "xclbin" are rules from "rules.mk"
test: emu:
XCL_EMULATION_MODE=sw_emu ./helloworld -ffile input/1stp/derived/1stp_protein.maps.fld -lfile input/1stp/derived/1stp_ligand.pdbqt 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