Changeset 6285


Ignore:
Timestamp:
Jan 19, 2019, 2:44:50 PM (9 months ago)
Author:
cameron
Message:

-enable-cache-trace flag; base64 encoding for property kernels.

Location:
icGREP/icgrep-devel
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/.gitignore

    r6284 r6285  
    11# Don't track build directories
    22icgrep-build/
    3 libllvm/
     3libllvm
    44llvm-build/
     5debug-build/
    56# Don't track LLVM source
    67llvm-[0-9].[0-9].[0-9].src/
  • icGREP/icgrep-devel/icgrep/kernels/UCD_property_kernel.cpp

    r6184 r6285  
    1313#include <pablo/builder.hpp>
    1414#include <llvm/Support/ErrorHandling.h>
     15#include <boost/archive/iterators/base64_from_binary.hpp>
     16#include <boost/archive/iterators/transform_width.hpp>
    1517
    1618using namespace kernel;
    1719using namespace pablo;
     20using namespace boost::archive::iterators;
     21
     22std::string base64(std::string to_encode) {
     23    typedef base64_from_binary< transform_width<std::string::const_iterator, 6, 8> > base64_t;
     24    return std::string(base64_t(to_encode.begin()), base64_t(to_encode.end()));
     25}
    1826
    1927
    2028UnicodePropertyKernelBuilder::UnicodePropertyKernelBuilder(const std::unique_ptr<kernel::KernelBuilder> & iBuilder, re::Name * property_value_name, StreamSet *BasisBits, StreamSet * property)
    2129: PabloKernel(iBuilder,
    22 "UCD:" + property_value_name->getFullName(),
     30"UCD:" + base64(property_value_name->getFullName().c_str()),
    2331{Binding{"basis", BasisBits}},
    2432{Binding{"property_stream", property}}),
  • icGREP/icgrep-devel/icgrep/toolchain/object_cache.cpp

    r6265 r6285  
    107107        fileName.append(moduleId);
    108108        fileName.append(KERNEL_FILE_EXTENSION);
    109 
    110109        auto kernelBuffer = MemoryBuffer::getFile(fileName, -1, false);
     110        if (codegen::TraceObjectCache) {
     111            errs() << "Found cache file: " << moduleId << KERNEL_FILE_EXTENSION << "\n";
     112        }
    111113        if (kernelBuffer) {
    112114            #if LLVM_VERSION_INTEGER < LLVM_VERSION_CODE(4, 0, 0)
     
    201203        WriteBitcodeToFile(H.get(), kernelFile);
    202204        kernelFile.close();
     205        if (codegen::TraceObjectCache) {
     206            errs() << "Wrote cache file: " << moduleId << KERNEL_FILE_EXTENSION << "\n";
     207        }
    203208    }
    204209}
  • icGREP/icgrep-devel/icgrep/toolchain/toolchain.cpp

    r6242 r6285  
    6161                                                   cl::desc("Enable object caching"), cl::cat(CodeGenOptions));
    6262
     63static cl::opt<bool, true> TraceObjectCacheOption("trace-object-cache", cl::location(TraceObjectCache), cl::init(false),
     64                                                   cl::desc("Trace object cache retrieval."), cl::cat(CodeGenOptions));
     65
    6366static cl::opt<std::string> ObjectCacheDirOption("object-cache-dir", cl::init(""),
    6467                                                 cl::desc("Path to the object cache diretory"), cl::cat(CodeGenOptions));
     
    113116
    114117bool EnableObjectCache;
     118bool TraceObjectCache;
    115119
    116120unsigned CacheDaysLimit;
  • icGREP/icgrep-devel/icgrep/toolchain/toolchain.h

    r6220 r6285  
    6464extern unsigned ThreadNum;
    6565extern bool EnableObjectCache;
     66extern bool TraceObjectCache;
    6667extern bool NVPTX;
    6768extern unsigned GroupNum;
Note: See TracChangeset for help on using the changeset viewer.