Ignore:
Timestamp:
Nov 14, 2017, 10:17:19 AM (17 months ago)
Author:
cameron
Message:

Incremental object caching; multithreaded print

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/toolchain/object_cache.h

    r5630 r5735  
    1212#include <llvm/ADT/StringRef.h>
    1313#include <boost/container/flat_map.hpp>
     14#include <boost/filesystem.hpp>
    1415#include <vector>
    1516#include <string>
     
    3435//
    3536
     37unsigned const CACHE_ENTRY_MAX_HOURS (24 * 15);
     38
    3639class ParabixObjectCache final : public llvm::ObjectCache {
    3740    using Path = llvm::SmallString<128>;
     
    4043    using ModuleCache = Map<std::string, std::pair<llvm::Module *, std::unique_ptr<llvm::MemoryBuffer>>>;
    4144public:
     45    ParabixObjectCache(const std::string dir);
    4246    ParabixObjectCache();
    43     ParabixObjectCache(const std::string dir);
    4447    bool loadCachedObjectFile(const std::unique_ptr<kernel::KernelBuilder> & idb, kernel::Kernel * const kernel);
    4548    void notifyObjectCompiled(const llvm::Module * M, llvm::MemoryBufferRef Obj) override;
    46     void cleanUpObjectCacheFiles();
    4749    std::unique_ptr<llvm::MemoryBuffer> getObject(const llvm::Module * M) override;
     50    void performIncrementalCacheCleanupStep();
    4851protected:
    49     static Path getDefaultPath();
     52    static std::string getDefaultPath();
    5053private:
    5154    ModuleCache         mCachedObject;
    5255    const Path          mCachePath;
     56    boost::filesystem::directory_iterator mCacheCleanupIterator;
     57    unsigned            mCacheEntryMaxHours;
    5358};
    5459
Note: See TracChangeset for help on using the changeset viewer.