Skip to content

Commit b7c29b6

Browse files
Virat AgarwalGitHub Enterprise
authored andcommitted
Adding whitelist support to all the examples
1 parent 669077a commit b7c29b6

File tree

86 files changed

+1115
-1057
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+1115
-1057
lines changed

common/utility/makefile_gen/makegen.py

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,37 @@ def create_params(target,data):
8888
target.write("CXXFLAGS += $(opencl_CXXFLAGS) -Wall -O0 -g -std=c++11\n")
8989
target.write("LDFLAGS += $(opencl_LDFLAGS)\n")
9090
target.write("\n")
91+
92+
blacklist = [board for board in data.get("platform_blacklist", [])]
93+
forbid_others = False
94+
if blacklist:
95+
for board in blacklist:
96+
if board != "others":
97+
target.write("ifeq ($(findstring ")
98+
target.write(board)
99+
target.write(", $(DEVICE)), ")
100+
target.write(board)
101+
target.write(")\n")
102+
target.write("$(error [ERROR]: This example is not supported for $(DEVICE).)\n")
103+
target.write("endif\n")
104+
else:
105+
forbid_others = True
106+
target.write("\n")
107+
whitelist = [board for board in data.get("platform_whitelist", [])]
108+
if whitelist:
109+
for board in whitelist:
110+
target.write("ifneq ($(findstring ")
111+
target.write(board)
112+
target.write(", $(DEVICE)), ")
113+
target.write(board)
114+
target.write(")\n")
115+
if forbid_others:
116+
target.write("$(error [ERROR]: This example is not supported for $(DEVICE).)\n")
117+
else:
118+
target.write("$(warning [WARNING]: This example has not been tested for $(DEVICE). It may or may not work.)\n")
119+
for board in whitelist:
120+
target.write("endif\n")
121+
target.write("\n")
91122
return
92123

93124
def add_host_flags(target, data):
@@ -472,16 +503,6 @@ def mk_run(target, data):
472503
target.write("############################## Setting Essential Checks and Running Rules ##############################\n")
473504

474505
target.write("run: all\n")
475-
if "platform_blacklist" in data:
476-
for board in data["platform_blacklist"]:
477-
target.write("ifeq ($(findstring ")
478-
target.write(board)
479-
target.write(", $(DEVICE)), ")
480-
target.write(board)
481-
target.write(")\n")
482-
target.write("$(error This example is not supported for $(DEVICE))\n")
483-
target.write("endif\n")
484-
target.write("\n")
485506
target.write("ifeq ($(TARGET),$(filter $(TARGET),sw_emu hw_emu))\n")
486507
if not ("platform_type" in data and data["platform_type"] == "pcie"):
487508
target.write("ifeq ($(HOST_ARCH), x86)\n")

cpp_kernels/array_partition/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ include $(XF_PROJ_ROOT)/common/includes/opencl/opencl.mk
8585
CXXFLAGS += $(opencl_CXXFLAGS) -Wall -O0 -g -std=c++11
8686
LDFLAGS += $(opencl_LDFLAGS)
8787

88+
ifeq ($(findstring nodma, $(DEVICE)), nodma)
89+
$(error [ERROR]: This example is not supported for $(DEVICE).)
90+
endif
91+
8892
############################## Setting up Host Variables ##############################
8993
#Include Required Host Source Files
9094
CXXFLAGS += -I$(XF_PROJ_ROOT)/common/includes/xcl2
@@ -156,10 +160,6 @@ $(EMCONFIG_DIR)/emconfig.json:
156160

157161
############################## Setting Essential Checks and Running Rules ##############################
158162
run: all
159-
ifeq ($(findstring nodma, $(DEVICE)), nodma)
160-
$(error This example is not supported for $(DEVICE))
161-
endif
162-
163163
ifeq ($(TARGET),$(filter $(TARGET),sw_emu hw_emu))
164164
ifeq ($(HOST_ARCH), x86)
165165
$(CP) $(EMCONFIG_DIR)/emconfig.json .

cpp_kernels/bind_op_storage/Makefile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,16 @@ include $(XF_PROJ_ROOT)/common/includes/opencl/opencl.mk
8585
CXXFLAGS += $(opencl_CXXFLAGS) -Wall -O0 -g -std=c++11
8686
LDFLAGS += $(opencl_LDFLAGS)
8787

88+
ifeq ($(findstring zcu102, $(DEVICE)), zcu102)
89+
$(error [ERROR]: This example is not supported for $(DEVICE).)
90+
endif
91+
ifeq ($(findstring zc706, $(DEVICE)), zc706)
92+
$(error [ERROR]: This example is not supported for $(DEVICE).)
93+
endif
94+
ifeq ($(findstring nodma, $(DEVICE)), nodma)
95+
$(error [ERROR]: This example is not supported for $(DEVICE).)
96+
endif
97+
8898
############################## Setting up Host Variables ##############################
8999
#Include Required Host Source Files
90100
CXXFLAGS += -I$(XF_PROJ_ROOT)/common/includes/xcl2
@@ -152,16 +162,6 @@ $(EMCONFIG_DIR)/emconfig.json:
152162

153163
############################## Setting Essential Checks and Running Rules ##############################
154164
run: all
155-
ifeq ($(findstring zcu102, $(DEVICE)), zcu102)
156-
$(error This example is not supported for $(DEVICE))
157-
endif
158-
ifeq ($(findstring zc706, $(DEVICE)), zc706)
159-
$(error This example is not supported for $(DEVICE))
160-
endif
161-
ifeq ($(findstring nodma, $(DEVICE)), nodma)
162-
$(error This example is not supported for $(DEVICE))
163-
endif
164-
165165
ifeq ($(TARGET),$(filter $(TARGET),sw_emu hw_emu))
166166
ifeq ($(HOST_ARCH), x86)
167167
$(CP) $(EMCONFIG_DIR)/emconfig.json .

cpp_kernels/burst_rw/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ include $(XF_PROJ_ROOT)/common/includes/opencl/opencl.mk
8585
CXXFLAGS += $(opencl_CXXFLAGS) -Wall -O0 -g -std=c++11
8686
LDFLAGS += $(opencl_LDFLAGS)
8787

88+
ifeq ($(findstring nodma, $(DEVICE)), nodma)
89+
$(error [ERROR]: This example is not supported for $(DEVICE).)
90+
endif
91+
8892
############################## Setting up Host Variables ##############################
8993
#Include Required Host Source Files
9094
CXXFLAGS += -I$(XF_PROJ_ROOT)/common/includes/xcl2
@@ -153,10 +157,6 @@ $(EMCONFIG_DIR)/emconfig.json:
153157

154158
############################## Setting Essential Checks and Running Rules ##############################
155159
run: all
156-
ifeq ($(findstring nodma, $(DEVICE)), nodma)
157-
$(error This example is not supported for $(DEVICE))
158-
endif
159-
160160
ifeq ($(TARGET),$(filter $(TARGET),sw_emu hw_emu))
161161
ifeq ($(HOST_ARCH), x86)
162162
$(CP) $(EMCONFIG_DIR)/emconfig.json .

cpp_kernels/critical_path/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ include $(XF_PROJ_ROOT)/common/includes/opencl/opencl.mk
8585
CXXFLAGS += $(opencl_CXXFLAGS) -Wall -O0 -g -std=c++11
8686
LDFLAGS += $(opencl_LDFLAGS)
8787

88+
ifeq ($(findstring nodma, $(DEVICE)), nodma)
89+
$(error [ERROR]: This example is not supported for $(DEVICE).)
90+
endif
91+
8892
############################## Setting up Host Variables ##############################
8993
#Include Required Host Source Files
9094
CXXFLAGS += -I$(XF_PROJ_ROOT)/common/includes/xcl2
@@ -157,10 +161,6 @@ $(EMCONFIG_DIR)/emconfig.json:
157161

158162
############################## Setting Essential Checks and Running Rules ##############################
159163
run: all
160-
ifeq ($(findstring nodma, $(DEVICE)), nodma)
161-
$(error This example is not supported for $(DEVICE))
162-
endif
163-
164164
ifeq ($(TARGET),$(filter $(TARGET),sw_emu hw_emu))
165165
ifeq ($(HOST_ARCH), x86)
166166
$(CP) $(EMCONFIG_DIR)/emconfig.json .

cpp_kernels/custom_datatype/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ include $(XF_PROJ_ROOT)/common/includes/opencl/opencl.mk
8585
CXXFLAGS += $(opencl_CXXFLAGS) -Wall -O0 -g -std=c++11
8686
LDFLAGS += $(opencl_LDFLAGS)
8787

88+
ifeq ($(findstring nodma, $(DEVICE)), nodma)
89+
$(error [ERROR]: This example is not supported for $(DEVICE).)
90+
endif
91+
8892
############################## Setting up Host Variables ##############################
8993
#Include Required Host Source Files
9094
CXXFLAGS += -I$(XF_PROJ_ROOT)/common/includes/xcl2
@@ -156,10 +160,6 @@ $(EMCONFIG_DIR)/emconfig.json:
156160

157161
############################## Setting Essential Checks and Running Rules ##############################
158162
run: all
159-
ifeq ($(findstring nodma, $(DEVICE)), nodma)
160-
$(error This example is not supported for $(DEVICE))
161-
endif
162-
163163
ifeq ($(TARGET),$(filter $(TARGET),sw_emu hw_emu))
164164
ifeq ($(HOST_ARCH), x86)
165165
$(CP) $(EMCONFIG_DIR)/emconfig.json .

cpp_kernels/dataflow_stream/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ include $(XF_PROJ_ROOT)/common/includes/opencl/opencl.mk
8585
CXXFLAGS += $(opencl_CXXFLAGS) -Wall -O0 -g -std=c++11
8686
LDFLAGS += $(opencl_LDFLAGS)
8787

88+
ifeq ($(findstring nodma, $(DEVICE)), nodma)
89+
$(error [ERROR]: This example is not supported for $(DEVICE).)
90+
endif
91+
8892
############################## Setting up Host Variables ##############################
8993
#Include Required Host Source Files
9094
CXXFLAGS += -I$(XF_PROJ_ROOT)/common/includes/xcl2
@@ -152,10 +156,6 @@ $(EMCONFIG_DIR)/emconfig.json:
152156

153157
############################## Setting Essential Checks and Running Rules ##############################
154158
run: all
155-
ifeq ($(findstring nodma, $(DEVICE)), nodma)
156-
$(error This example is not supported for $(DEVICE))
157-
endif
158-
159159
ifeq ($(TARGET),$(filter $(TARGET),sw_emu hw_emu))
160160
ifeq ($(HOST_ARCH), x86)
161161
$(CP) $(EMCONFIG_DIR)/emconfig.json .

cpp_kernels/dataflow_stream_array/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ include $(XF_PROJ_ROOT)/common/includes/opencl/opencl.mk
8585
CXXFLAGS += $(opencl_CXXFLAGS) -Wall -O0 -g -std=c++11
8686
LDFLAGS += $(opencl_LDFLAGS)
8787

88+
ifeq ($(findstring nodma, $(DEVICE)), nodma)
89+
$(error [ERROR]: This example is not supported for $(DEVICE).)
90+
endif
91+
8892
############################## Setting up Host Variables ##############################
8993
#Include Required Host Source Files
9094
CXXFLAGS += -I$(XF_PROJ_ROOT)/common/includes/xcl2
@@ -153,10 +157,6 @@ $(EMCONFIG_DIR)/emconfig.json:
153157

154158
############################## Setting Essential Checks and Running Rules ##############################
155159
run: all
156-
ifeq ($(findstring nodma, $(DEVICE)), nodma)
157-
$(error This example is not supported for $(DEVICE))
158-
endif
159-
160160
ifeq ($(TARGET),$(filter $(TARGET),sw_emu hw_emu))
161161
ifeq ($(HOST_ARCH), x86)
162162
$(CP) $(EMCONFIG_DIR)/emconfig.json .

cpp_kernels/dependence_inter/Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@ include $(XF_PROJ_ROOT)/common/includes/opencl/opencl.mk
8585
CXXFLAGS += $(opencl_CXXFLAGS) -Wall -O0 -g -std=c++11
8686
LDFLAGS += $(opencl_LDFLAGS)
8787

88+
ifeq ($(findstring zc702, $(DEVICE)), zc702)
89+
$(error [ERROR]: This example is not supported for $(DEVICE).)
90+
endif
91+
ifeq ($(findstring nodma, $(DEVICE)), nodma)
92+
$(error [ERROR]: This example is not supported for $(DEVICE).)
93+
endif
94+
8895
############################## Setting up Host Variables ##############################
8996
#Include Required Host Source Files
9097
CXXFLAGS += -I$(XF_PROJ_ROOT)/common/includes/xcl2
@@ -152,13 +159,6 @@ $(EMCONFIG_DIR)/emconfig.json:
152159

153160
############################## Setting Essential Checks and Running Rules ##############################
154161
run: all
155-
ifeq ($(findstring zc702, $(DEVICE)), zc702)
156-
$(error This example is not supported for $(DEVICE))
157-
endif
158-
ifeq ($(findstring nodma, $(DEVICE)), nodma)
159-
$(error This example is not supported for $(DEVICE))
160-
endif
161-
162162
ifeq ($(TARGET),$(filter $(TARGET),sw_emu hw_emu))
163163
ifeq ($(HOST_ARCH), x86)
164164
$(CP) $(EMCONFIG_DIR)/emconfig.json .

cpp_kernels/gmem_2banks/Makefile

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,28 @@ include $(XF_PROJ_ROOT)/common/includes/opencl/opencl.mk
8585
CXXFLAGS += $(opencl_CXXFLAGS) -Wall -O0 -g -std=c++11
8686
LDFLAGS += $(opencl_LDFLAGS)
8787

88+
ifeq ($(findstring zc, $(DEVICE)), zc)
89+
$(error [ERROR]: This example is not supported for $(DEVICE).)
90+
endif
91+
ifeq ($(findstring zed, $(DEVICE)), zed)
92+
$(error [ERROR]: This example is not supported for $(DEVICE).)
93+
endif
94+
ifeq ($(findstring vck, $(DEVICE)), vck)
95+
$(error [ERROR]: This example is not supported for $(DEVICE).)
96+
endif
97+
ifeq ($(findstring u30, $(DEVICE)), u30)
98+
$(error [ERROR]: This example is not supported for $(DEVICE).)
99+
endif
100+
ifeq ($(findstring u50, $(DEVICE)), u50)
101+
$(error [ERROR]: This example is not supported for $(DEVICE).)
102+
endif
103+
ifeq ($(findstring samsung, $(DEVICE)), samsung)
104+
$(error [ERROR]: This example is not supported for $(DEVICE).)
105+
endif
106+
ifeq ($(findstring nodma, $(DEVICE)), nodma)
107+
$(error [ERROR]: This example is not supported for $(DEVICE).)
108+
endif
109+
88110
############################## Setting up Host Variables ##############################
89111
#Include Required Host Source Files
90112
CXXFLAGS += -I$(XF_PROJ_ROOT)/common/includes/xcl2
@@ -160,28 +182,6 @@ $(EMCONFIG_DIR)/emconfig.json:
160182

161183
############################## Setting Essential Checks and Running Rules ##############################
162184
run: all
163-
ifeq ($(findstring zc, $(DEVICE)), zc)
164-
$(error This example is not supported for $(DEVICE))
165-
endif
166-
ifeq ($(findstring zed, $(DEVICE)), zed)
167-
$(error This example is not supported for $(DEVICE))
168-
endif
169-
ifeq ($(findstring vck, $(DEVICE)), vck)
170-
$(error This example is not supported for $(DEVICE))
171-
endif
172-
ifeq ($(findstring u30, $(DEVICE)), u30)
173-
$(error This example is not supported for $(DEVICE))
174-
endif
175-
ifeq ($(findstring u50, $(DEVICE)), u50)
176-
$(error This example is not supported for $(DEVICE))
177-
endif
178-
ifeq ($(findstring samsung, $(DEVICE)), samsung)
179-
$(error This example is not supported for $(DEVICE))
180-
endif
181-
ifeq ($(findstring nodma, $(DEVICE)), nodma)
182-
$(error This example is not supported for $(DEVICE))
183-
endif
184-
185185
ifeq ($(TARGET),$(filter $(TARGET),sw_emu hw_emu))
186186
ifeq ($(HOST_ARCH), x86)
187187
$(CP) $(EMCONFIG_DIR)/emconfig.json .

0 commit comments

Comments
 (0)