Add interface to extract versioning info

Appened ocloc interface with new 'query' feature.
Using this feature now one can extract HEAD hash and version of neo.

Signed-off-by: Bushev, Dmitry <dmitry.bushev@intel.com>
This commit is contained in:
DmitryBushev
2021-03-11 20:22:38 +03:00
committed by Compute-Runtime-Automation
parent 4dda709b41
commit 9e18416098
10 changed files with 271 additions and 15 deletions

View File

@ -0,0 +1,41 @@
/*
* Copyright (C) 2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "driver_version.h"
#include <string>
#ifdef QTR
#undef QTR
#endif
#ifdef TOSTR
#undef TOSTR
#endif
#define QTR(a) #a
#define TOSTR(b) QTR(b)
namespace NEO {
std::string getRevision() {
#ifdef NEO_REVISION
return NEO_REVISION;
#else
return "";
#endif
}
std::string getOclDriverVersion() {
#ifdef NEO_OCL_DRIVER_VERSION
return TOSTR(NEO_OCL_DRIVER_VERSION);
#else
return "";
#endif
}
} // namespace NEO

View File

@ -0,0 +1,14 @@
/*
* Copyright (C) 2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include <string>
namespace NEO {
extern std::string getRevision();
extern std::string getOclDriverVersion();
} // namespace NEO