@@ -119,9 +119,19 @@ def test_activations(activation_function, backend, io_type):
119119
120120
121121@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+ )
123133@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 ):
125135 model = tf .keras .models .Sequential ()
126136 input_shape = (10 , 128 , 4 )
127137 model .add (
@@ -144,7 +154,8 @@ def test_conv1d(padds, backend, io_type):
144154 keras_prediction = model .predict (X_input )
145155
146156 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 } ' )
148159 hls_model = hls4ml .converters .convert_from_keras_model (
149160 model , hls_config = config , output_dir = output_dir , backend = backend , io_type = io_type
150161 )
@@ -192,9 +203,19 @@ def test_conv1d(padds, backend, io_type):
192203
193204@pytest .mark .parametrize ('chans' , chans_options )
194205@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+ )
196217@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 ):
198219 model = tf .keras .models .Sequential ()
199220 input_shape = (28 , 28 , 3 )
200221 model .add (
@@ -215,7 +236,8 @@ def test_conv2d(chans, padds, backend, io_type):
215236 keras_prediction = model .predict (X_input )
216237
217238 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 } ' )
219241 hls_model = hls4ml .converters .convert_from_keras_model (
220242 model , hls_config = config , output_dir = output_dir , backend = backend , io_type = io_type
221243 )
0 commit comments