@@ -1253,6 +1253,7 @@ TEST(auto_configure, streaming) {
1253
1253
1254
1254
CHECK_EQUAL (1 , devdef.accel .size ());
1255
1255
1256
+ CHECK (!devdef.accel [0 ].is_sycl_compile );
1256
1257
CHECK (!!devdef.accel [0 ].streaming_info );
1257
1258
CHECK (" k0_ZTS3CRCILi0EE_streaming_start" ==
1258
1259
devdef.accel [0 ].streaming_info ->start );
@@ -1263,21 +1264,170 @@ TEST(auto_configure, streaming) {
1263
1264
CHECK (" k0_ZTS3CRCILi0EE_streaming_stall_out" ==
1264
1265
devdef.accel [0 ].streaming_info ->stall_out );
1265
1266
1266
- CHECK_EQUAL (9 , devdef.accel [0 ].iface .args .size ());
1267
+ const auto &args = devdef.accel [0 ].iface .args ;
1268
+ CHECK_EQUAL (9 , args.size ());
1267
1269
1268
- CHECK (!!devdef. accel [ 0 ]. iface . args [0 ].streaming_info );
1270
+ CHECK (!!args[0 ].streaming_info );
1269
1271
CHECK (" k0_ZTS3CRCILi0EE_arg0" ==
1270
- devdef. accel [ 0 ]. iface . args [0 ].streaming_info ->interface_name );
1272
+ args[0 ].streaming_info ->interface_name );
1271
1273
1272
- CHECK (!!devdef. accel [ 0 ]. iface . args [1 ].streaming_info );
1274
+ CHECK (!!args[1 ].streaming_info );
1273
1275
CHECK (" k0_ZTS3CRCILi0EE_arg1" ==
1274
- devdef. accel [ 0 ]. iface . args [1 ].streaming_info ->interface_name );
1276
+ args[1 ].streaming_info ->interface_name );
1275
1277
1276
- CHECK (!!devdef. accel [ 0 ]. iface . args [2 ].streaming_info );
1278
+ CHECK (!!args[2 ].streaming_info );
1277
1279
CHECK (" k0_ZTS3CRCILi0EE_arg2" ==
1278
- devdef. accel [ 0 ]. iface . args [2 ].streaming_info ->interface_name );
1280
+ args[2 ].streaming_info ->interface_name );
1279
1281
1280
- for (size_t i = 3 ; i < 9 ; ++i) {
1281
- CHECK (!devdef.accel [0 ].iface .args [i].streaming_info );
1282
+ for (size_t i = 3 ; i < args.size (); ++i) {
1283
+ CHECK (!args[i].streaming_info );
1284
+ }
1285
+ }
1286
+
1287
+ TEST (auto_configure, one_streaming_arg_and_streaming_kernel) {
1288
+ const std::string config_str{
1289
+ " 23 27 531091a097f0d7096b21f349b4b283f9e206ebc0 pac_s10 0 1 17 DDR 2 4 "
1290
+ " 24 1 2 0 8589934592 8589934592 17179869184 17179869184 25769803776 "
1291
+ " 25769803776 34359738368 0 - 0 0 0 0 0 0 1 127 _ZTS15binomial_kernel 0 "
1292
+ " 256 0 0 0 0 0 1 0 8 7 2 1 8 1024 0 2 0 8 0 0 8 1 0 0 1 "
1293
+ " k0_ZTS15binomial_kernel_arg1 7 0 0 8 1 0 0 0 7 0 0 8 1 0 0 0 7 2 1 8 "
1294
+ " 1024 0 2 0 7 0 0 8 1 0 0 0 7 0 0 8 1 0 0 0 7 0 0 8 1 0 0 0 0 0 16 2 64 "
1295
+ " 8196 65 8196 66 8196 67 8196 68 8196 69 8196 70 8196 71 8196 72 8196 73 "
1296
+ " 8196 74 8196 75 8196 76 8196 77 8196 78 8196 79 8196 1 1 1 3 1 1 1 3 1 "
1297
+ " 1 4 k0_ZTS15binomial_kernel_streaming_start "
1298
+ " k0_ZTS15binomial_kernel_streaming_done "
1299
+ " k0_ZTS15binomial_kernel_streaming_stall_in "
1300
+ " k0_ZTS15binomial_kernel_streaming_stall_out" };
1301
+
1302
+ acl_device_def_autodiscovery_t devdef;
1303
+ {
1304
+ bool result;
1305
+ std::string err_str;
1306
+ ACL_LOCKED (result =
1307
+ acl_load_device_def_from_str (config_str, devdef, err_str));
1308
+ std::cerr << err_str;
1309
+ CHECK (result);
1310
+ }
1311
+
1312
+ CHECK_EQUAL (1 , devdef.accel .size ());
1313
+
1314
+ CHECK (!!devdef.accel [0 ].streaming_info );
1315
+ CHECK (" k0_ZTS15binomial_kernel_streaming_start" ==
1316
+ devdef.accel [0 ].streaming_info ->start );
1317
+ CHECK (" k0_ZTS15binomial_kernel_streaming_done" ==
1318
+ devdef.accel [0 ].streaming_info ->done );
1319
+ CHECK (" k0_ZTS15binomial_kernel_streaming_stall_in" ==
1320
+ devdef.accel [0 ].streaming_info ->stall_in );
1321
+ CHECK (" k0_ZTS15binomial_kernel_streaming_stall_out" ==
1322
+ devdef.accel [0 ].streaming_info ->stall_out );
1323
+
1324
+ const auto &args = devdef.accel [0 ].iface .args ;
1325
+ CHECK_EQUAL (8 , args.size ());
1326
+
1327
+ CHECK (!args[0 ].streaming_info );
1328
+
1329
+ CHECK (!!args[1 ].streaming_info );
1330
+ CHECK (" k0_ZTS15binomial_kernel_arg1" ==
1331
+ args[1 ].streaming_info ->interface_name );
1332
+
1333
+ for (size_t i = 2 ; i < args.size (); ++i) {
1334
+ CHECK (!args[i].streaming_info );
1335
+ }
1336
+ }
1337
+
1338
+ TEST (auto_configure, two_streaming_args_and_streaming_kernel) {
1339
+ const std::string config_str{
1340
+ " 23 27 531091a097f0d7096b21f349b4b283f9e206ebc0 pac_s10 0 1 17 DDR 2 4 "
1341
+ " 24 1 2 0 8589934592 8589934592 17179869184 17179869184 25769803776 "
1342
+ " 25769803776 34359738368 0 - 0 0 0 0 0 0 1 128 _ZTS15binomial_kernel 0 "
1343
+ " 256 0 0 0 0 0 1 0 8 8 2 1 8 1024 0 2 1 k0_ZTS15binomial_kernel_arg0 8 0 "
1344
+ " 0 8 1 0 0 1 k0_ZTS15binomial_kernel_arg1 7 0 0 8 1 0 0 0 7 0 0 8 1 0 0 "
1345
+ " 0 7 2 1 8 1024 0 2 0 7 0 0 8 1 0 0 0 7 0 0 8 1 0 0 0 7 0 0 8 1 0 0 0 0 "
1346
+ " 0 16 2 64 8196 65 8196 66 8196 67 8196 68 8196 69 8196 70 8196 71 8196 "
1347
+ " 72 8196 73 8196 74 8196 75 8196 76 8196 77 8196 78 8196 79 8196 1 1 1 3 "
1348
+ " 1 1 1 3 1 1 4 k0_ZTS15binomial_kernel_streaming_start "
1349
+ " k0_ZTS15binomial_kernel_streaming_done "
1350
+ " k0_ZTS15binomial_kernel_streaming_stall_in "
1351
+ " k0_ZTS15binomial_kernel_streaming_stall_out" };
1352
+
1353
+ acl_device_def_autodiscovery_t devdef;
1354
+ {
1355
+ bool result;
1356
+ std::string err_str;
1357
+ ACL_LOCKED (result =
1358
+ acl_load_device_def_from_str (config_str, devdef, err_str));
1359
+ std::cerr << err_str;
1360
+ CHECK (result);
1361
+ }
1362
+
1363
+ CHECK_EQUAL (1 , devdef.accel .size ());
1364
+
1365
+ CHECK (devdef.accel [0 ].is_sycl_compile );
1366
+ CHECK (!!devdef.accel [0 ].streaming_info );
1367
+ CHECK (" k0_ZTS15binomial_kernel_streaming_start" ==
1368
+ devdef.accel [0 ].streaming_info ->start );
1369
+ CHECK (" k0_ZTS15binomial_kernel_streaming_done" ==
1370
+ devdef.accel [0 ].streaming_info ->done );
1371
+ CHECK (" k0_ZTS15binomial_kernel_streaming_stall_in" ==
1372
+ devdef.accel [0 ].streaming_info ->stall_in );
1373
+ CHECK (" k0_ZTS15binomial_kernel_streaming_stall_out" ==
1374
+ devdef.accel [0 ].streaming_info ->stall_out );
1375
+
1376
+ const auto &args = devdef.accel [0 ].iface .args ;
1377
+ CHECK_EQUAL (8 , args.size ());
1378
+
1379
+ CHECK (!!args[0 ].streaming_info );
1380
+ CHECK (" k0_ZTS15binomial_kernel_arg0" ==
1381
+ args[0 ].streaming_info ->interface_name );
1382
+
1383
+ CHECK (!!args[1 ].streaming_info );
1384
+ CHECK (" k0_ZTS15binomial_kernel_arg1" ==
1385
+ args[1 ].streaming_info ->interface_name );
1386
+
1387
+ for (size_t i = 2 ; i < args.size (); ++i) {
1388
+ CHECK (!args[i].streaming_info );
1389
+ }
1390
+ }
1391
+
1392
+ TEST (auto_configure, two_streaming_args_and_non_streaming_kernel) {
1393
+ const std::string config_str{
1394
+ " 23 27 531091a097f0d7096b21f349b4b283f9e206ebc0 pac_s10 0 1 17 DDR 2 4 "
1395
+ " 24 1 2 0 8589934592 8589934592 17179869184 17179869184 25769803776 "
1396
+ " 25769803776 34359738368 0 - 0 0 0 0 0 0 1 124 _ZTS15binomial_kernel 0 "
1397
+ " 256 0 0 0 0 0 1 0 8 8 2 1 8 1024 0 2 1 k0_ZTS15binomial_kernel_arg0 8 0 "
1398
+ " 0 8 1 0 0 1 k0_ZTS15binomial_kernel_arg1 7 0 0 8 1 0 0 0 7 0 0 8 1 0 0 "
1399
+ " 0 7 2 1 8 1024 0 2 0 7 0 0 8 1 0 0 0 7 0 0 8 1 0 0 0 7 0 0 8 1 0 0 0 0 "
1400
+ " 0 16 2 64 8196 65 8196 66 8196 67 8196 68 8196 69 8196 70 8196 71 8196 "
1401
+ " 72 8196 73 8196 74 8196 75 8196 76 8196 77 8196 78 8196 79 8196 1 1 1 3 "
1402
+ " 1 1 1 3 1 1 0" };
1403
+
1404
+ acl_device_def_autodiscovery_t devdef;
1405
+ {
1406
+ bool result;
1407
+ std::string err_str;
1408
+ ACL_LOCKED (result =
1409
+ acl_load_device_def_from_str (config_str, devdef, err_str));
1410
+ std::cerr << err_str;
1411
+ CHECK (result);
1412
+ }
1413
+
1414
+ CHECK_EQUAL (1 , devdef.accel .size ());
1415
+
1416
+ CHECK (devdef.accel [0 ].is_sycl_compile );
1417
+ CHECK (!devdef.accel [0 ].streaming_info );
1418
+
1419
+ const auto &args = devdef.accel [0 ].iface .args ;
1420
+ CHECK_EQUAL (8 , args.size ());
1421
+
1422
+ CHECK (!!args[0 ].streaming_info );
1423
+ CHECK (" k0_ZTS15binomial_kernel_arg0" ==
1424
+ args[0 ].streaming_info ->interface_name );
1425
+
1426
+ CHECK (!!args[1 ].streaming_info );
1427
+ CHECK (" k0_ZTS15binomial_kernel_arg1" ==
1428
+ args[1 ].streaming_info ->interface_name );
1429
+
1430
+ for (size_t i = 2 ; i < args.size (); ++i) {
1431
+ CHECK (!args[i].streaming_info );
1282
1432
}
1283
1433
}
0 commit comments