@@ -513,7 +513,7 @@ bool testBindlessBindfulKernel(ze_context_handle_t context, ze_device_handle_t d
513
513
}
514
514
515
515
bool testBindlessImages (ze_context_handle_t context, ze_device_handle_t device, const std::string &deviceId, const std::string &revisionId,
516
- int imageCount, AddressingMode mode) {
516
+ int imageCount, AddressingMode mode, ExecutionMode execMode ) {
517
517
bool outputValidated = false ;
518
518
519
519
ze_module_handle_t module = nullptr ;
@@ -523,7 +523,7 @@ bool testBindlessImages(ze_context_handle_t context, ze_device_handle_t device,
523
523
createKernel (module , copyKernel, kernelName3.c_str ());
524
524
525
525
LevelZeroBlackBoxTests::CommandHandler commandHandler;
526
- bool isImmediateCmdList = false ;
526
+ bool isImmediateCmdList = execMode == ExecutionMode::immSyncCmdList ? true : false ;
527
527
528
528
SUCCESS_OR_TERMINATE (commandHandler.create (context, device, isImmediateCmdList));
529
529
@@ -631,6 +631,33 @@ bool testBindlessImages(ze_context_handle_t context, ze_device_handle_t device,
631
631
return outputValidated;
632
632
}
633
633
634
+ bool testBindlessBindfulImageKernel (ze_context_handle_t context, ze_device_handle_t device, const std::string &deviceId, const std::string &revisionId) {
635
+
636
+ ExecutionMode executionModes[] = {ExecutionMode::commandQueue, ExecutionMode::immSyncCmdList};
637
+
638
+ std::tuple<AddressingMode, AddressingMode, std::string> kernelOrder[2 ] = {{AddressingMode::bindless, AddressingMode::bindful, " First Bindless Then Bindful" },
639
+ {AddressingMode::bindful, AddressingMode::bindless, " First Bindful Then Bindless" }};
640
+
641
+ for (auto kernelMode : kernelOrder) {
642
+
643
+ for (auto mode : executionModes) {
644
+
645
+ bool result1 = testBindlessImages (context, device, deviceId, revisionId, 0 , std::get<0 >(kernelMode), mode);
646
+ bool result2 = testBindlessImages (context, device, deviceId, revisionId, 0 , std::get<1 >(kernelMode), mode);
647
+
648
+ if (!result1 || !result2) {
649
+ std::cout << " testBindlessBindfulImageKernel with mode " << static_cast <uint32_t >(mode) << " " << std::get<2 >(kernelMode) << " FAILED.\n "
650
+ << std::endl;
651
+ return false ;
652
+ } else {
653
+ std::cout << " testBindlessBindfulKernel with mode " << static_cast <uint32_t >(mode) << " " << std::get<2 >(kernelMode) << " PASSED.\n "
654
+ << std::endl;
655
+ }
656
+ }
657
+ }
658
+ return true ;
659
+ }
660
+
634
661
bool testBindlessImageSampled (ze_context_handle_t context, ze_device_handle_t device, const std::string &deviceId,
635
662
const std::string &revisionId, AddressingMode mode) {
636
663
bool outputValidated = true ;
@@ -1301,7 +1328,7 @@ int main(int argc, char *argv[]) {
1301
1328
ze_device_uuid_t uuid = deviceProperties.uuid ;
1302
1329
std::string revisionId = std::to_string (reinterpret_cast <uint16_t *>(uuid.id )[2 ]);
1303
1330
1304
- int numTests = 7 ;
1331
+ int numTests = 8 ;
1305
1332
int testCase = -1 ;
1306
1333
testCase = LevelZeroBlackBoxTests::getParamValue (argc, argv, " " , " --test-case" , -1 );
1307
1334
if (testCase < -1 || testCase >= numTests) {
@@ -1342,7 +1369,7 @@ int main(int argc, char *argv[]) {
1342
1369
std::cout << " --bindless-images " << std::endl;
1343
1370
}
1344
1371
1345
- outputValidated &= testBindlessImages (context, device, ss.str (), revisionId, imageCount, mode);
1372
+ outputValidated &= testBindlessImages (context, device, ss.str (), revisionId, imageCount, mode, ExecutionMode::commandQueue );
1346
1373
} else {
1347
1374
std::cout << " Skipped. testBindlessImages case not supported\n " ;
1348
1375
}
@@ -1436,6 +1463,18 @@ int main(int argc, char *argv[]) {
1436
1463
<< std::endl;
1437
1464
1438
1465
outputValidated &= testBindlessBindfulKernel (context, device, ss.str (), revisionId);
1466
+ break ;
1467
+ case 7 :
1468
+
1469
+ if (is2dImageSupported) {
1470
+ std::cout << " \n test case: testBindlessBindfulImageKernel\n "
1471
+ << std::endl;
1472
+
1473
+ outputValidated &= testBindlessBindfulImageKernel (context, device, ss.str (), revisionId);
1474
+ } else {
1475
+ std::cout << " Skipped. testBindlessBindfulImageKernel case not supported\n " ;
1476
+ }
1477
+
1439
1478
break ;
1440
1479
}
1441
1480
0 commit comments