Use 'RecordProperty' to record performance scores

For following test cases:
- KFDQMTest.QueueLatency
- KFDQMTest.BasicCuMaskingLinear
- KFDQMTest.BasicCuMaskingEven
- KFDMemoryTest.MMBandWidth
- KFDMemoryTest.MMapLarge
- KFDMemoryTest.MMBench

v2: xml element cannot start with a number, so change the key name of
    MMBandWidth and MMBench accordingly
    xml element cannot contain whitespaces, so trim whitespaces in "VRAM  "
v3: introduce KFDLog-like way to use KFDRecord

Change-Id: Ifc3ed5657621252a7b39dccf1ef4f50a92593f77
Signed-off-by: Xiaojie Yuan <xiaojie.yuan@amd.com>


[ROCm/ROCR-Runtime commit: 247fa9f1e0]
Esse commit está contido em:
Xiaojie Yuan
2018-09-12 17:30:42 +08:00
commit ca0873a234
3 arquivos alterados com 56 adições e 4 exclusões
@@ -42,6 +42,27 @@ std::ostream& operator << (KFDLog log, LOGTYPE level);
#define LOG() KFDLog() << LOGTYPE_INFO
#define WARN() KFDLog() << LOGTYPE_WARNING
class KFDRecord: public testing::Test {
public:
KFDRecord(const char *val): m_val(val) {}
KFDRecord(std::string &val): m_val(val) {}
KFDRecord(HSAint64 val): m_val(std::to_string(val)) {}
KFDRecord(HSAuint64 val): m_val(std::to_string(val)) {}
KFDRecord(double val): m_val(std::to_string(val)) {}
~KFDRecord() {
RecordProperty(m_key.str().c_str(), m_val.c_str());
}
std::stringstream &get_key_stream() {
return m_key;
}
virtual void TestBody() {};
private:
std::string m_val;
std::stringstream m_key;
};
#define RECORD(val) (KFDRecord(val).get_key_stream())
// All tests MUST be in a try catch since the gtest flag to throw an exception on any fatal failure is enabled
#define TEST_START(testProfile) if (Ok2Run(testProfile)) try {
#define TEST_END } catch (...) {}