@@ -1227,3 +1227,171 @@ 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 103 _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 1" };
1240
+
1241
+ acl_device_def_autodiscovery_t devdef;
1242
+ {
1243
+ bool result;
1244
+ std::string err_str;
1245
+ ACL_LOCKED (result =
1246
+ acl_load_device_def_from_str (config_str, devdef, err_str));
1247
+ std::cerr << err_str;
1248
+ CHECK (result);
1249
+ }
1250
+
1251
+ CHECK_EQUAL (1 , devdef.accel .size ());
1252
+
1253
+ CHECK (!devdef.accel [0 ].is_sycl_compile );
1254
+ CHECK (devdef.accel [0 ].streaming_control_info_available );
1255
+
1256
+ const auto &args = devdef.accel [0 ].iface .args ;
1257
+ CHECK_EQUAL (9 , args.size ());
1258
+
1259
+ CHECK (args[0 ].streaming_arg_info_available );
1260
+ CHECK (" k0_ZTS3CRCILi0EE_arg0" == args[0 ].streaming_arg_info .interface_name );
1261
+
1262
+ CHECK (args[1 ].streaming_arg_info_available );
1263
+ CHECK (" k0_ZTS3CRCILi0EE_arg1" == args[1 ].streaming_arg_info .interface_name );
1264
+
1265
+ CHECK (args[2 ].streaming_arg_info_available );
1266
+ CHECK (" k0_ZTS3CRCILi0EE_arg2" == args[2 ].streaming_arg_info .interface_name );
1267
+
1268
+ for (size_t i = 3 ; i < args.size (); ++i) {
1269
+ CHECK (!args[i].streaming_arg_info_available );
1270
+ }
1271
+ }
1272
+
1273
+ TEST (auto_configure, one_streaming_arg_and_streaming_kernel) {
1274
+ const std::string config_str{
1275
+ " 23 27 531091a097f0d7096b21f349b4b283f9e206ebc0 pac_s10 0 1 17 DDR 2 4 "
1276
+ " 24 1 2 0 8589934592 8589934592 17179869184 17179869184 25769803776 "
1277
+ " 25769803776 34359738368 0 - 0 0 0 0 0 0 1 123 _ZTS15binomial_kernel 0 "
1278
+ " 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 "
1279
+ " k0_ZTS15binomial_kernel_arg1 7 0 0 8 1 0 0 0 7 0 0 8 1 0 0 0 7 2 1 8 "
1280
+ " 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 "
1281
+ " 8196 65 8196 66 8196 67 8196 68 8196 69 8196 70 8196 71 8196 72 8196 73 "
1282
+ " 8196 74 8196 75 8196 76 8196 77 8196 78 8196 79 8196 1 1 1 3 1 1 1 3 1 "
1283
+ " 1 1" };
1284
+
1285
+ acl_device_def_autodiscovery_t devdef;
1286
+ {
1287
+ bool result;
1288
+ std::string err_str;
1289
+ ACL_LOCKED (result =
1290
+ acl_load_device_def_from_str (config_str, devdef, err_str));
1291
+ std::cerr << err_str;
1292
+ CHECK (result);
1293
+ }
1294
+
1295
+ CHECK_EQUAL (1 , devdef.accel .size ());
1296
+
1297
+ CHECK (devdef.accel [0 ].streaming_control_info_available );
1298
+
1299
+ const auto &args = devdef.accel [0 ].iface .args ;
1300
+ CHECK_EQUAL (8 , args.size ());
1301
+
1302
+ CHECK (!args[0 ].streaming_arg_info_available );
1303
+
1304
+ CHECK (args[1 ].streaming_arg_info_available );
1305
+ CHECK (" k0_ZTS15binomial_kernel_arg1" ==
1306
+ args[1 ].streaming_arg_info .interface_name );
1307
+
1308
+ for (size_t i = 2 ; i < args.size (); ++i) {
1309
+ CHECK (!args[i].streaming_arg_info_available );
1310
+ }
1311
+ }
1312
+
1313
+ TEST (auto_configure, two_streaming_args_and_streaming_kernel) {
1314
+ const std::string config_str{
1315
+ " 23 27 531091a097f0d7096b21f349b4b283f9e206ebc0 pac_s10 0 1 17 DDR 2 4 "
1316
+ " 24 1 2 0 8589934592 8589934592 17179869184 17179869184 25769803776 "
1317
+ " 25769803776 34359738368 0 - 0 0 0 0 0 0 1 124 _ZTS15binomial_kernel 0 "
1318
+ " 256 0 0 0 0 0 1 0 8 8 2 1 8 1024 0 2 1 k0_ZTS15binomial_kernel_arg0 8 0 "
1319
+ " 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 "
1320
+ " 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 "
1321
+ " 0 16 2 64 8196 65 8196 66 8196 67 8196 68 8196 69 8196 70 8196 71 8196 "
1322
+ " 72 8196 73 8196 74 8196 75 8196 76 8196 77 8196 78 8196 79 8196 1 1 1 3 "
1323
+ " 1 1 1 3 1 1 1" };
1324
+
1325
+ acl_device_def_autodiscovery_t devdef;
1326
+ {
1327
+ bool result;
1328
+ std::string err_str;
1329
+ ACL_LOCKED (result =
1330
+ acl_load_device_def_from_str (config_str, devdef, err_str));
1331
+ std::cerr << err_str;
1332
+ CHECK (result);
1333
+ }
1334
+
1335
+ CHECK_EQUAL (1 , devdef.accel .size ());
1336
+
1337
+ CHECK (devdef.accel [0 ].is_sycl_compile );
1338
+ CHECK (devdef.accel [0 ].streaming_control_info_available );
1339
+
1340
+ const auto &args = devdef.accel [0 ].iface .args ;
1341
+ CHECK_EQUAL (8 , args.size ());
1342
+
1343
+ CHECK (args[0 ].streaming_arg_info_available );
1344
+ CHECK (" k0_ZTS15binomial_kernel_arg0" ==
1345
+ args[0 ].streaming_arg_info .interface_name );
1346
+
1347
+ CHECK (args[1 ].streaming_arg_info_available );
1348
+ CHECK (" k0_ZTS15binomial_kernel_arg1" ==
1349
+ args[1 ].streaming_arg_info .interface_name );
1350
+
1351
+ for (size_t i = 2 ; i < args.size (); ++i) {
1352
+ CHECK (!args[i].streaming_arg_info_available );
1353
+ }
1354
+ }
1355
+
1356
+ TEST (auto_configure, two_streaming_args_and_non_streaming_kernel) {
1357
+ const std::string config_str{
1358
+ " 23 27 531091a097f0d7096b21f349b4b283f9e206ebc0 pac_s10 0 1 17 DDR 2 4 "
1359
+ " 24 1 2 0 8589934592 8589934592 17179869184 17179869184 25769803776 "
1360
+ " 25769803776 34359738368 0 - 0 0 0 0 0 0 1 124 _ZTS15binomial_kernel 0 "
1361
+ " 256 0 0 0 0 0 1 0 8 8 2 1 8 1024 0 2 1 k0_ZTS15binomial_kernel_arg0 8 0 "
1362
+ " 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 "
1363
+ " 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 "
1364
+ " 0 16 2 64 8196 65 8196 66 8196 67 8196 68 8196 69 8196 70 8196 71 8196 "
1365
+ " 72 8196 73 8196 74 8196 75 8196 76 8196 77 8196 78 8196 79 8196 1 1 1 3 "
1366
+ " 1 1 1 3 1 1 0" };
1367
+
1368
+ acl_device_def_autodiscovery_t devdef;
1369
+ {
1370
+ bool result;
1371
+ std::string err_str;
1372
+ ACL_LOCKED (result =
1373
+ acl_load_device_def_from_str (config_str, devdef, err_str));
1374
+ std::cerr << err_str;
1375
+ CHECK (result);
1376
+ }
1377
+
1378
+ CHECK_EQUAL (1 , devdef.accel .size ());
1379
+
1380
+ CHECK (devdef.accel [0 ].is_sycl_compile );
1381
+ CHECK (!devdef.accel [0 ].streaming_control_info_available );
1382
+
1383
+ const auto &args = devdef.accel [0 ].iface .args ;
1384
+ CHECK_EQUAL (8 , args.size ());
1385
+
1386
+ CHECK (args[0 ].streaming_arg_info_available );
1387
+ CHECK (" k0_ZTS15binomial_kernel_arg0" ==
1388
+ args[0 ].streaming_arg_info .interface_name );
1389
+
1390
+ CHECK (args[1 ].streaming_arg_info_available );
1391
+ CHECK (" k0_ZTS15binomial_kernel_arg1" ==
1392
+ args[1 ].streaming_arg_info .interface_name );
1393
+
1394
+ for (size_t i = 2 ; i < args.size (); ++i) {
1395
+ CHECK (!args[i].streaming_arg_info_available );
1396
+ }
1397
+ }
0 commit comments