Ignore:
Timestamp:
Nov 2, 2017, 10:22:06 AM (19 months ago)
Author:
cameron
Message:

EnableAsserts? and EnableCycleCounter? are DebugOptions? (disable object caching)

Location:
icGREP/icgrep-devel/icgrep/toolchain
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/toolchain/pipeline.cpp

    r5706 r5721  
    9999    Value * cycleCountStart = nullptr;
    100100    Value * cycleCountEnd = nullptr;
    101     if (codegen::EnableCycleCounter) {
     101    if (DebugOptionIsSet(codegen::EnableCycleCounter)) {
    102102        cycleCountStart = iBuilder->CreateReadCycleCounter();
    103103    }
     
    174174            }
    175175        }
    176         if (codegen::EnableCycleCounter) {
     176        if (DebugOptionIsSet(codegen::EnableCycleCounter)) {
    177177            cycleCountEnd = iBuilder->CreateReadCycleCounter();
    178178            Value * counterPtr = iBuilder->getCycleCountPtr();
     
    271271    }
    272272   
    273     if (codegen::EnableCycleCounter) {
     273    if (DebugOptionIsSet(codegen::EnableCycleCounter)) {
    274274        for (unsigned k = 0; k < kernels.size(); k++) {
    275275            auto & kernel = kernels[k];
     
    516516    Value * cycleCountStart = nullptr;
    517517    Value * cycleCountEnd = nullptr;
    518     if (codegen::EnableCycleCounter) {
     518    if (DebugOptionIsSet(codegen::EnableCycleCounter)) {
    519519        cycleCountStart = iBuilder->CreateReadCycleCounter();
    520520    }
     
    563563            }
    564564        }
    565         if (codegen::EnableCycleCounter) {
     565        if (DebugOptionIsSet(codegen::EnableCycleCounter)) {
    566566            cycleCountEnd = iBuilder->CreateReadCycleCounter();
    567567            Value * counterPtr = iBuilder->getCycleCountPtr();
     
    596596    iBuilder->SetInsertPoint(pipelineExit);
    597597
    598     if (codegen::EnableCycleCounter) {
     598    if (DebugOptionIsSet(codegen::EnableCycleCounter)) {
    599599        for (unsigned k = 0; k < kernels.size(); k++) {
    600600            auto & kernel = kernels[k];
  • icGREP/icgrep-devel/icgrep/toolchain/toolchain.cpp

    r5656 r5721  
    3333                        clEnumVal(TraceCounts, "Show kernel processed and produced item counts."),
    3434                        clEnumVal(TraceDynamicBuffers, "Show dynamic buffer allocations and deallocations."),
     35                        clEnumVal(EnableAsserts, "Enable built-in Parabix framework asserts in generated IR."),
     36                        clEnumVal(EnableCycleCounter, "Count and report CPU cycles per kernel."),
    3537                        clEnumValEnd), cl::cat(CodeGenOptions));
    3638
     
    7173                                          cl::desc("Number of threads used for segment pipeline parallel"), cl::value_desc("positive integer"));
    7274
    73 
    74 static cl::opt<bool, true> EnableAssertsOption("ea", cl::location(EnableAsserts), cl::init(IN_DEBUG_MODE),
    75                                                cl::desc("Enable Asserts"), cl::cat(CodeGenOptions));
    76 
    77 static cl::opt<bool, true> EnableCycleCountOption("ShowKernelCycles", cl::location(EnableCycleCounter), cl::init(false),
    78                                              cl::desc("Count and report CPU cycles per kernel"), cl::cat(CodeGenOptions));
    7975
    8076static cl::opt<bool, true> pipelineParallelOption("enable-pipeline-parallel", cl::location(PipelineParallel), cl::init(false),
     
    110106int ThreadNum;
    111107
    112 bool EnableAsserts;
    113 
    114 bool EnableCycleCounter;
    115 
    116108bool EnableObjectCache;
    117109
     
    148140
    149141bool DebugOptionIsSet(const DebugFlags flag) {
     142    if (IN_DEBUG_MODE && (flag == EnableAsserts)) return true;
    150143    return DebugOptions.isSet(flag);
    151144}
  • icGREP/icgrep-devel/icgrep/toolchain/toolchain.h

    r5637 r5721  
    3333    SerializeThreads,
    3434    TraceCounts,
    35     TraceDynamicBuffers
     35    TraceDynamicBuffers,
     36    EnableAsserts,
     37    EnableCycleCounter,
     38    DebugFlagSentinel
    3639};
    3740
     
    5154extern int ThreadNum;
    5255extern bool EnableObjectCache;
    53 extern bool EnableAsserts;
    54 extern bool EnableCycleCounter;
    5556extern bool NVPTX;
    5657extern int GroupNum;
Note: See TracChangeset for help on using the changeset viewer.