Changeset 5637


Ignore:
Timestamp:
Sep 14, 2017, 7:02:17 AM (2 months ago)
Author:
cameron
Message:

Trace option for produced, processed, consumed item counts

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

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/kernels/kernel_builder.cpp

    r5522 r5637  
    11#include "kernel_builder.h"
     2#include <toolchain/toolchain.h>
    23#include <kernels/kernel.h>
    34#include <kernels/streamset.h>
     
    9899void KernelBuilder::setProducedItemCount(const std::string & name, Value * value) {
    99100    setScalarField(name + Kernel::PRODUCED_ITEM_COUNT_SUFFIX, value);
     101    if (codegen::DebugOptionIsSet(codegen::TraceCounts)) {
     102        CallPrintIntToStderr(mKernel->getName() + ": " + name + "_producedItemCount", value);
     103    }
    100104}
    101105
    102106void KernelBuilder::setProcessedItemCount(const std::string & name, Value * value) {
    103107    setScalarField(name + Kernel::PROCESSED_ITEM_COUNT_SUFFIX, value);
     108    if (codegen::DebugOptionIsSet(codegen::TraceCounts)) {
     109        CallPrintIntToStderr(mKernel->getName() + ": " + name + "_processedItemCount", value);
     110    }
    104111}
    105112
    106113void KernelBuilder::setConsumedItemCount(const std::string & name, Value * value) {
    107114    setScalarField(name + Kernel::CONSUMED_ITEM_COUNT_SUFFIX, value);
     115    if (codegen::DebugOptionIsSet(codegen::TraceCounts)) {
     116        CallPrintIntToStderr(mKernel->getName() + ": " + name + "_consumedItemCount", value);
     117    }
    108118}
    109119
     
    114124void KernelBuilder::setTerminationSignal() {
    115125    setScalarField(Kernel::TERMINATION_SIGNAL, getTrue());
     126    if (codegen::DebugOptionIsSet(codegen::TraceCounts)) {
     127        CallPrintIntToStderr(mKernel->getName() + ": setTerminationSignal", getTrue());
     128    }
    116129}
    117130
  • icGREP/icgrep-devel/icgrep/toolchain/toolchain.cpp

    r5618 r5637  
    2929#endif
    3030                        clEnumVal(SerializeThreads, "Force segment threads to run sequentially."),
     31                        clEnumVal(TraceCounts, "Show kernel processed and produced item counts."),
    3132                        clEnumVal(TraceDynamicBuffers, "Show dynamic buffer allocations and deallocations."),
    3233                        clEnumValEnd), cl::cat(CodeGenOptions));
  • icGREP/icgrep-devel/icgrep/toolchain/toolchain.h

    r5618 r5637  
    3232#endif
    3333    SerializeThreads,
     34    TraceCounts,
    3435    TraceDynamicBuffers
    3536};
Note: See TracChangeset for help on using the changeset viewer.