add SPIR-V version testing (#1861)

* basic SPIR-V 1.3 testing support

* updated script to compile for more SPIR-V versions

* switch to general SPIR-V versions test

* update copyright text and fix license

* improve output while test is running

* check for higher SPIR-V versions first

* fix formatting
This commit is contained in:
Ben Ashbaugh
2024-01-30 09:14:40 -08:00
committed by GitHub
parent 8bb89b165c
commit d5b7d10db7
18 changed files with 682 additions and 32 deletions

View File

@@ -33,9 +33,12 @@ const std::string slash = "/";
#endif
const std::string spvExt = ".spv";
bool gVersionSkip = false;
std::string gAddrWidth = "";
std::string spvBinariesPath = "spirv_bin";
std::string spvBinariesPathArg = "--spirv-binaries-path";
const std::string spvBinariesPathArg = "--spirv-binaries-path";
const std::string spvVersionSkipArg = "--skip-spirv-version-check";
std::vector<unsigned char> readBinary(const char *file_name)
{
@@ -227,7 +230,10 @@ test_status InitCL(cl_device_id id)
void printUsage() {
log_info("Reading SPIR-V files from default '%s' path.\n", spvBinariesPath.c_str());
log_info("In case you want to set other directory use '%s' argument.\n", spvBinariesPathArg.c_str());
log_info("In case you want to set other directory use '%s' argument.\n",
spvBinariesPathArg.c_str());
log_info("To skip the SPIR-V version check use the '%s' argument.\n",
spvVersionSkipArg.c_str());
}
int main(int argc, const char *argv[])
@@ -246,6 +252,11 @@ int main(int argc, const char *argv[])
modifiedSpvBinariesPath = true;
}
}
if (argv[i] == spvVersionSkipArg)
{
gVersionSkip = true;
argsRemoveNum++;
}
if (argsRemoveNum > 0) {
for (int j = i; j < (argc - argsRemoveNum); ++j)