Skip to content

Commit

Permalink
Added options to enable and disable log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mpflanzer committed Jun 22, 2015
1 parent a6045d9 commit 9081f6f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
9 changes: 5 additions & 4 deletions src/core/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,15 @@ namespace oclgrind
OCLGRIND_INFO = 1,
OCLGRIND_WARNING = 2,
OCLGRIND_ERROR = 3,
// Special warning types
OCLGRIND_WARNING_UNINITIALIZED = OCLGRIND_WARNING + 4,
// Special error types
OCLGRIND_ERROR_DIVERGENCE = OCLGRIND_ERROR + 4,
OCLGRIND_ERROR_INVALID_ACCESS = OCLGRIND_ERROR + 8,
OCLGRIND_ERROR_DATA_RACE = OCLGRIND_ERROR + 12,
OCLGRIND_ERROR_UNINITIALIZED = OCLGRIND_ERROR + 16,
OCLGRIND_ERROR_UNALIGNED = OCLGRIND_ERROR + 20,
OCLGRIND_ERROR_ARRAY_BOUNDS = OCLGRIND_ERROR + 24,
OCLGRIND_ERROR_FATAL = OCLGRIND_ERROR + 28,
OCLGRIND_ERROR_UNALIGNED = OCLGRIND_ERROR + 16,
OCLGRIND_ERROR_ARRAY_BOUNDS = OCLGRIND_ERROR + 20,
OCLGRIND_ERROR_FATAL = OCLGRIND_ERROR + 24,
};

// 3-dimensional size
Expand Down
10 changes: 5 additions & 5 deletions src/plugins/Logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ void Logger::enableAllDiagnostics()
enableDiagnosticOption(OCLGRIND_WARNING);
enableDiagnosticOption(OCLGRIND_ERROR);
// Turn on specific groups
enableDiagnosticOption(OCLGRIND_WARNING_UNINITIALIZED);
enableDiagnosticOption(OCLGRIND_ERROR_DIVERGENCE);
enableDiagnosticOption(OCLGRIND_ERROR_INVALID_ACCESS);
enableDiagnosticOption(OCLGRIND_ERROR_DATA_RACE);
enableDiagnosticOption(OCLGRIND_ERROR_UNINITIALIZED);
enableDiagnosticOption(OCLGRIND_ERROR_UNALIGNED);
enableDiagnosticOption(OCLGRIND_ERROR_ARRAY_BOUNDS);
}
Expand Down Expand Up @@ -185,6 +185,10 @@ bool Logger::parseDiagnosticOptions(char *options)
{
enableDiagnosticOption(OCLGRIND_DEBUG, isPositive);
}
else if (!strcmp(opt_type, "uninitialized"))
{
enableDiagnosticOption(OCLGRIND_WARNING_UNINITIALIZED, isPositive);
}
else if (!strcmp(opt_type, "divergence"))
{
enableDiagnosticOption(OCLGRIND_ERROR_DIVERGENCE, isPositive);
Expand All @@ -197,10 +201,6 @@ bool Logger::parseDiagnosticOptions(char *options)
{
enableDiagnosticOption(OCLGRIND_ERROR_DATA_RACE, isPositive);
}
else if (!strcmp(opt_type, "uninitialized"))
{
enableDiagnosticOption(OCLGRIND_ERROR_UNINITIALIZED, isPositive);
}
else if (!strcmp(opt_type, "unaligned"))
{
enableDiagnosticOption(OCLGRIND_ERROR_UNALIGNED, isPositive);
Expand Down

0 comments on commit 9081f6f

Please sign in to comment.