Add query option description to help

Related-To: NEO-6031
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
This commit is contained in:
Fabian Zwolinski
2021-08-09 13:41:12 +02:00
committed by Compute-Runtime-Automation
parent 2d5d071e66
commit b5d222f6cb
4 changed files with 37 additions and 1 deletions

View File

@@ -39,7 +39,8 @@ Commands:
disasm Disassembles Intel Compute GPU device binary.
asm Assembles Intel Compute GPU device binary.
multi Compiles multiple files using a config file.
validate Validates Intel Compute GPU device binary
validate Validates Intel Compute GPU device binary.
query Extracts versioning info.
Default command (when none provided) is 'compile'.
@@ -55,6 +56,9 @@ Examples:
Validate Intel Compute GPU device binary
ocloc validate -file source_file_Gen9core.bin
Extract driver version
ocloc query OCL_DRIVER_VERSION
)===";
extern "C" {

View File

@@ -106,6 +106,10 @@ OfflineCompiler *OfflineCompiler::create(size_t numArgs, const std::vector<std::
return pOffCompiler;
}
void printQueryHelp(OclocArgHelper *helper) {
helper->printf(OfflineCompiler::queryHelp.data());
}
int OfflineCompiler::query(size_t numArgs, const std::vector<std::string> &allArgs, OclocArgHelper *helper) {
if (allArgs.size() != 3) {
helper->printf("Error: Invalid command line. Expected ocloc query <argument>");
@@ -121,6 +125,8 @@ int OfflineCompiler::query(size_t numArgs, const std::vector<std::string> &allAr
} else if (Queries::queryOCLDriverVersion == arg) {
auto driverVersion = NEO::getOclDriverVersion();
helper->saveOutput(Queries::queryOCLDriverVersion.data(), driverVersion.c_str(), driverVersion.size() + 1);
} else if ("--help" == arg) {
printQueryHelp(helper);
} else {
helper->printf("Error: Invalid command line. Uknown argument %s.", arg.c_str());
retVal = INVALID_COMMAND_LINE;

View File

@@ -51,6 +51,18 @@ class OfflineCompiler {
std::string &getBuildLog();
void printUsage();
static constexpr ConstStringRef queryHelp =
"Depending on <query_option> will generate file\n"
"(with a name adequate to <query_option>)\n"
"containing either driver version or NEO revision hash.\n\n"
"Usage: ocloc query <query_option>\n\n"
"Supported query options:\n"
" OCL_DRIVER_VERSION ; returns driver version\n"
" NEO_REVISION ; returns NEO revision hash\n\n"
"Examples:\n"
" Extract driver version\n"
" ocloc query OCL_DRIVER_VERSION\n";
OfflineCompiler &operator=(const OfflineCompiler &) = delete;
OfflineCompiler(const OfflineCompiler &) = delete;
MOCKABLE_VIRTUAL ~OfflineCompiler();