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