@@ -20,24 +20,31 @@ def keras_model():
20
20
return model
21
21
22
22
@pytest .fixture
23
- @pytest .mark .parametrize ('io_type' , ['io_parallel' ,
24
- 'io_stream' ])
25
- def hls_model (keras_model , io_type ):
23
+ @pytest .mark .parametrize ('backend, io_type' , [
24
+ ('Vivado' , 'io_parallel' ),
25
+ ('Vivado' , 'io_stream' ),
26
+ ('Quartus' , 'io_parallel' )
27
+ ])
28
+ def hls_model (keras_model , backend , io_type ):
26
29
hls_config = hls4ml .utils .config_from_keras_model (keras_model ,
27
30
default_precision = 'ap_fixed<16,6>' ,
28
31
granularity = 'name' )
29
32
hls_config ['LayerName' ]['embedding_input' ]['Precision' ]['result' ] = 'ap_uint<4>'
30
- out_dir = str (test_root_path / 'hls4mlprj_embed_{}' ).format (io_type )
33
+ out_dir = str (test_root_path / 'hls4mlprj_embed_{}_{} ' ).format (backend , io_type )
31
34
hls_model = hls4ml .converters .convert_from_keras_model (keras_model ,
35
+ backend = backend ,
32
36
hls_config = hls_config ,
33
37
io_type = io_type ,
34
38
output_dir = out_dir )
35
39
36
40
hls_model .compile ()
37
41
return hls_model
38
42
39
- @pytest .mark .parametrize ('io_type' , ['io_parallel' ,
40
- 'io_stream' ])
43
+ @pytest .mark .parametrize ('backend, io_type' , [
44
+ ('Vivado' , 'io_parallel' ),
45
+ ('Vivado' , 'io_stream' ),
46
+ ('Quartus' , 'io_parallel' )
47
+ ])
41
48
def test_embedding_accuracy (data , keras_model , hls_model ):
42
49
X = data
43
50
model = keras_model
0 commit comments