@@ -119,9 +119,19 @@ def test_activations(activation_function, backend, io_type):
119
119
120
120
121
121
@pytest .mark .parametrize ('padds' , padds_options )
122
- @pytest .mark .parametrize ('backend' , ['Vivado' , 'Vitis' , 'Quartus' , 'oneAPI' ])
122
+ @pytest .mark .parametrize (
123
+ 'backend,strategy' ,
124
+ [
125
+ ('Vivado' , 'Resource' ),
126
+ ('Vivado' , 'Latency' ),
127
+ ('Vitis' , 'Resource' ),
128
+ ('Vitis' , 'Latency' ),
129
+ ('Quartus' , 'Resource' ),
130
+ ('oneAPI' , 'Resource' ),
131
+ ],
132
+ )
123
133
@pytest .mark .parametrize ('io_type' , ['io_parallel' , 'io_stream' ])
124
- def test_conv1d (padds , backend , io_type ):
134
+ def test_conv1d (padds , backend , strategy , io_type ):
125
135
model = tf .keras .models .Sequential ()
126
136
input_shape = (10 , 128 , 4 )
127
137
model .add (
@@ -144,7 +154,8 @@ def test_conv1d(padds, backend, io_type):
144
154
keras_prediction = model .predict (X_input )
145
155
146
156
config = hls4ml .utils .config_from_keras_model (model )
147
- output_dir = str (test_root_path / f'hls4mlprj_keras_api_conv1d_{ padds } _{ backend } _{ io_type } ' )
157
+ config ['Model' ]['Strategy' ] = strategy
158
+ output_dir = str (test_root_path / f'hls4mlprj_keras_api_conv1d_{ padds } _{ backend } _{ strategy } _{ io_type } ' )
148
159
hls_model = hls4ml .converters .convert_from_keras_model (
149
160
model , hls_config = config , output_dir = output_dir , backend = backend , io_type = io_type
150
161
)
@@ -192,9 +203,19 @@ def test_conv1d(padds, backend, io_type):
192
203
193
204
@pytest .mark .parametrize ('chans' , chans_options )
194
205
@pytest .mark .parametrize ('padds' , padds_options )
195
- @pytest .mark .parametrize ('backend' , ['Vivado' , 'Vitis' , 'Quartus' , 'oneAPI' ])
206
+ @pytest .mark .parametrize (
207
+ 'backend,strategy' ,
208
+ [
209
+ ('Vivado' , 'Resource' ),
210
+ ('Vivado' , 'Latency' ),
211
+ ('Vitis' , 'Resource' ),
212
+ ('Vitis' , 'Latency' ),
213
+ ('Quartus' , 'Resource' ),
214
+ ('oneAPI' , 'Resource' ),
215
+ ],
216
+ )
196
217
@pytest .mark .parametrize ('io_type' , ['io_parallel' , 'io_stream' ])
197
- def test_conv2d (chans , padds , backend , io_type ):
218
+ def test_conv2d (chans , padds , backend , strategy , io_type ):
198
219
model = tf .keras .models .Sequential ()
199
220
input_shape = (28 , 28 , 3 )
200
221
model .add (
@@ -215,7 +236,8 @@ def test_conv2d(chans, padds, backend, io_type):
215
236
keras_prediction = model .predict (X_input )
216
237
217
238
config = hls4ml .utils .config_from_keras_model (model )
218
- output_dir = str (test_root_path / f'hls4mlprj_keras_api_conv2d_{ backend } _{ chans } _{ padds } _{ io_type } ' )
239
+ config ['Model' ]['Strategy' ] = strategy
240
+ output_dir = str (test_root_path / f'hls4mlprj_keras_api_conv2d_{ backend } _{ strategy } _{ chans } _{ padds } _{ io_type } ' )
219
241
hls_model = hls4ml .converters .convert_from_keras_model (
220
242
model , hls_config = config , output_dir = output_dir , backend = backend , io_type = io_type
221
243
)
0 commit comments