BeBOP Optimized Sparse Kernel Interface Library  1.0.1h
Defines | Functions
debug.h File Reference

Debugging support module. More...

#include <stdio.h>

Go to the source code of this file.

Defines

#define INC_OSKI_DEBUG_H
 oski/debug.h has been included

Functions

unsigned oski_GetDebugLevel (void)
 Return the current debugging level.
void oski_SetDebugLevel (unsigned new_level)
 Change the current debugging level.
FILE * oski_GetDebugOutput (void)
 Return the file to which debugging output is currently redirected.
void oski_SetDebugOutput (FILE *fp)
 Change the file to which debugging output is to be redirected.
void oski_PrintDebugMessage (unsigned level, const char *fmt,...)
 Display a debugging message.
void oski_PrintDebugMessageShort (unsigned level, const char *fmt,...)
 Display a debugging message without a trailing newline.

Detailed Description

Debugging support module.

This module defines rudimentary support for debugging and is intended for use by developers only.

The library internally maintains a "current debug level," defined by a non-negative integer. When the level is set to 0, no debugging messages are displayed, and as the level increases, more frequent (or more detailed) debugging messages are displayed.

Developers can call oski_PrintDebugMessage to display debgging information, specifying the level at which the message should appear to the user.

Revision:
1.1.1.1

Revision history:


Function Documentation

FILE* oski_GetDebugOutput ( void  )

Return the file to which debugging output is currently redirected.

Returns:
A pointer to the FILE to which debugging output is currently directed. This return should never be NULL.
Postcondition:
If g_debug_file is NULL, sets it to stderr and returns stderr.

References oski_GetDebugOutput().

Referenced by oski_GetDebugOutput(), oski_PrintDebugMessage(), and oski_PrintDebugMessageShort().

void oski_PrintDebugMessage ( unsigned  level,
const char *  fmt,
  ... 
)

Display a debugging message.

Parameters:
[in]levelLevel at and above which this message should be printed to the current debug file.
[in]fmtA printf-compatible format string.
[in]...Options for the formatting string.
Postcondition:
The message is displayed to the current debug file only if level >= the current debugging level.
Precondition:
oski_GetDebugOutput() != NULL
Postcondition:
Prints a newline character to the debug file.

References oski_GetDebugLevel(), oski_GetDebugOutput(), and oski_PrintDebugMessage().

Referenced by array_CompareElems_NoAbort(), Check(), check_MatMult_instance(), check_MatMultAndMatTransMult_instance(), check_MatTransMatMult_instance(), check_MatTrisolve_instance(), CheckMatMultVectors(), ChooseFastest(), CloseLua(), ComputeTuningBudget(), ConvertLuaMat(), dReadVector(), DumpLuaArg(), DumpTrace(), main(), MeasureStreamTimeCSR(), OpenLua(), oski_ApplyMatTransforms(), oski_CalibrateTimer(), oski_CallModuleInit(), oski_CheckCSR(), oski_Close(), oski_CloseHeurManager(), oski_CloseMatTypeManager(), oski_CloseModule(), oski_ConditionallyExpandCSRToFull(), oski_CopyMat(), oski_CreateMatCSC_arr(), oski_CreateMatCSR_arr(), oski_CreateMatReprFromCSR(), oski_DestroyMat(), oski_DestroyMatStruct(), oski_DisplayInMatPropSet(), oski_FreeInputMatRepr(), oski_HeurEvaluate(), oski_HeurIsApplicable(), oski_Init(), oski_InitHeurManager(), oski_InitMatTypeManager(), oski_InitModule(), oski_InitModuleLoader(), oski_LoadModuleOptional(), oski_PrintDebugMessage(), oski_PrintDebugVecView(), oski_RegisterHeur(), oski_RegisterMatType(), oski_RegisterSiteModules(), oski_ReplaceTunedMatRepr(), oski_TuneMat(), oski_UnloadModule(), oski_WrapCSR(), readhb_pattern(), readhb_pattern_matrix_nnz(), RegisterLuaMatTypes(), SetModuleName(), test_should_fail_1(), test_should_fail_2(), test_should_fail_3(), test_should_pass_1(), and test_should_pass_2().

void oski_PrintDebugMessageShort ( unsigned  level,
const char *  fmt,
  ... 
)

Display a debugging message without a trailing newline.

Display a debugging message without a trailing newline.

See also:
oski_PrintDebugMessage

References oski_GetDebugLevel(), oski_GetDebugOutput(), and oski_PrintDebugMessageShort().

Referenced by main(), oski_PrintDebugMessageShort(), and oski_PrintDebugVecView().

void oski_SetDebugLevel ( unsigned  new_level)

Change the current debugging level.

Parameters:
[in]new_levelNew debugging level.
Postcondition:
Sets g_cur_debug_level to the given level.

References oski_SetDebugLevel().

Referenced by InitSetDebugLevel(), and oski_SetDebugLevel().

void oski_SetDebugOutput ( FILE *  fp)

Change the file to which debugging output is to be redirected.

Parameters:
[in,out]fpNew file to which debugging output should be redirected.
Postcondition:
Sets g_debug_file to fp unless g_debug_file is NULL, in which case fp is set to stderr.

References oski_SetDebugOutput().

Referenced by oski_SetDebugOutput().