Ignore:
Timestamp:
Apr 7, 2017, 4:59:04 PM (2 years ago)
Author:
nmedfort
Message:

Continued work on processing stdin input. Partial integration of ParabixDriver? methods into icgrep and editd. Object cache does not currently work for recursive REs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/kernels/kernel.h

    r5395 r5398  
    2525   
    2626class KernelBuilder : public KernelInterface {
    27     using NameMap = boost::container::flat_map<std::string, unsigned>;
     27protected:
     28    using KernelMap = boost::container::flat_map<std::string, unsigned>;
     29    enum class Port { Input, Output };
     30    using StreamPort = std::pair<Port, unsigned>;
     31    using StreamMap = boost::container::flat_map<std::string, StreamPort>;
    2832public:
    2933   
     
    8084    void setProducedItemCount(llvm::Value * instance, const std::string & name, llvm::Value * value) const final;
    8185
    82     llvm::Value * getConsumedItemCount(llvm::Value * instance, const std::string & name) const final;
    83 
    84     void setConsumedItemCount(llvm::Value * instance, const std::string & name, llvm::Value * value) const final;
    85 
    8686    llvm::Value * getProcessedItemCount(llvm::Value * instance, const std::string & name) const final;
    8787
    8888    void setProcessedItemCount(llvm::Value * instance, const std::string & name, llvm::Value * value) const final;
    89 
    90     virtual void reserveBytes(llvm::Value * instance, const std::string & name, llvm::Value * requested) const;
    9189
    9290    bool hasNoTerminateAttribute() { return mNoTerminateAttribute;}
     
    236234    llvm::Value * getRawOutputPointer(const std::string & name, llvm::Value * streamIndex, llvm::Value * absolutePosition) const;
    237235
    238     void reserveBytes(const std::string & name, llvm::Value * requested) const {
    239         reserveBytes(getSelf(), name, requested);
    240     }
     236    void setBaseAddress(const std::string & name, llvm::Value * addr) const;
     237
     238    llvm::Value * getBufferedSize(const std::string & name) const;
     239
     240    void setBufferedSize(const std::string & name, llvm::Value * size) const;
     241
     242    void reserveBytes(const std::string & name, llvm::Value * requested) const;
    241243
    242244    llvm::Value * getScalarFieldPtr(const std::string & name) const {
     
    256258    }
    257259
    258     inline llvm::Value * getConsumedItemCount(const std::string & name) const {
    259         return getConsumedItemCount(getSelf(), name);
    260     }
    261 
    262     inline void setConsumedItemCount(const std::string & name, llvm::Value * value) const {
    263         setConsumedItemCount(getSelf(), name, value);
    264     }
    265 
    266260    inline llvm::Value * getProcessedItemCount(const std::string & name) const {
    267261        return getProcessedItemCount(getSelf(), name);
     
    294288    llvm::Value * getScalarFieldPtr(llvm::Value * instance, llvm::Value * index) const;
    295289
    296     unsigned getStreamSetIndex(const std::string & name) const;
     290    StreamPort getStreamPort(const std::string & name) const;
    297291
    298292    const parabix::StreamSetBuffer * getInputStreamSetBuffer(const std::string & name) const {
    299         const auto index = getStreamSetIndex(name);
    300         assert (index < mStreamSetInputBuffers.size());
    301         return mStreamSetInputBuffers[index];
     293        const auto port = getStreamPort(name);
     294        assert (port.first == Port::Input);
     295        assert (port.second < mStreamSetInputBuffers.size());
     296        return mStreamSetInputBuffers[port.second];
    302297    }
    303298
    304299    const parabix::StreamSetBuffer * getOutputStreamSetBuffer(const std::string & name) const {
    305         const auto index = getStreamSetIndex(name);
    306         assert (index < mStreamSetOutputBuffers.size());
    307         return mStreamSetOutputBuffers[index];
     300        const auto port = getStreamPort(name);
     301        assert (port.first == Port::Output);
     302        assert (port.second < mStreamSetOutputBuffers.size());
     303        return mStreamSetOutputBuffers[port.second];
    308304    }
    309305
     
    322318
    323319    std::vector<llvm::Type *>                       mKernelFields;
    324     NameMap                                         mKernelMap;
    325     NameMap                                         mStreamSetNameMap;
     320    KernelMap                                       mKernelMap;
     321    StreamMap                                       mStreamMap;
    326322    std::vector<const parabix::StreamSetBuffer *>   mStreamSetInputBuffers;
    327323    std::vector<const parabix::StreamSetBuffer *>   mStreamSetOutputBuffers;
Note: See TracChangeset for help on using the changeset viewer.