Add debug flag to print driver diagnostics to cout.

- New registry flags can be used for applications that wants to dump driver
diagnostics without using any additional tools
- When flag is on , context is being created with driver diagnostics and
hint level is being set to debug variable
- If application is already using driver diagnostics the hint level is
overwritten

Change-Id: I9912c0a7e8f23adb8372997144e5b75f9cc05b1d
This commit is contained in:
Mrozek, Michal
2018-03-02 13:39:22 +01:00
committed by sys_ocldev
parent e579578bc8
commit bee295415f
8 changed files with 113 additions and 5 deletions

View File

@@ -107,7 +107,12 @@ class Context : public BaseObject<_cl_context> {
char hint[DriverDiagnostics::maxHintStringSize];
snprintf(hint, DriverDiagnostics::maxHintStringSize, DriverDiagnostics::hintFormat[performanceHint], std::forward<Args>(args)..., 0);
if (driverDiagnostics->validFlags(flags)) {
contextCallback(hint, &flags, sizeof(flags), userData);
if (contextCallback) {
contextCallback(hint, &flags, sizeof(flags), userData);
}
if (DebugManager.flags.PrintDriverDiagnostics.get() != -1) {
printf("\n%s\n", hint);
}
}
}