Ignore:
Timestamp:
Apr 24, 2018, 2:57:34 PM (18 months ago)
Author:
nmedfort
Message:

Restructured MultiBlock? kernel. Removal of Swizzled buffers. Inclusion of PopCount? rates / non-linear access. Modifications to several kernels to better align them with the kernel and pipeline changes.

File:
1 edited

Legend:

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

    r5967 r5985  
    3434    llvm::LoadInst * acquireLogicalSegmentNo();
    3535
    36     void releaseLogicalSegmentNo(llvm::Value * nextSegNo);
     36    void releaseLogicalSegmentNo(llvm::Value * const nextSegNo);
    3737
    3838    llvm::Value * getProducedItemCount(const std::string & name) {
    39         return getInternalItemCount(name, Kernel::PRODUCED_ITEM_COUNT_SUFFIX);
     39        return getNamedItemCount(name, PRODUCED_ITEM_COUNT_SUFFIX);
    4040    }
    4141
    4242    void setProducedItemCount(const std::string & name, llvm::Value * value) {
    43         setInternalItemCount(name, Kernel::PRODUCED_ITEM_COUNT_SUFFIX, value);
     43        setNamedItemCount(name, PRODUCED_ITEM_COUNT_SUFFIX, value);
    4444    }
    4545
    4646    llvm::Value * getProcessedItemCount(const std::string & name) {       
    47         return getInternalItemCount(name, Kernel::PROCESSED_ITEM_COUNT_SUFFIX);
     47        return getNamedItemCount(name, PROCESSED_ITEM_COUNT_SUFFIX);
    4848    }
    4949
    5050    void setProcessedItemCount(const std::string & name, llvm::Value * value) {
    51         setInternalItemCount(name, Kernel::PROCESSED_ITEM_COUNT_SUFFIX, value);
     51        setNamedItemCount(name, PROCESSED_ITEM_COUNT_SUFFIX, value);
    5252    }
    5353
    5454    llvm::Value * getConsumedItemCount(const std::string & name) {
    55         return getInternalItemCount(name, Kernel::CONSUMED_ITEM_COUNT_SUFFIX);
     55        return getNamedItemCount(name, CONSUMED_ITEM_COUNT_SUFFIX);
    5656    }
    5757
    5858    void setConsumedItemCount(const std::string & name, llvm::Value * value) {
    59         setInternalItemCount(name, Kernel::CONSUMED_ITEM_COUNT_SUFFIX, value);
     59        setNamedItemCount(name, CONSUMED_ITEM_COUNT_SUFFIX, value);
     60    }
     61
     62    llvm::Value * getNonDeferredProcessedItemCount(const Binding & input) {
     63        return getNamedItemCount(input.getName(), input.isDeferred() ? NON_DEFERRED_ITEM_COUNT_SUFFIX : PROCESSED_ITEM_COUNT_SUFFIX);
     64    }
     65
     66    void setNonDeferredProcessedItemCount(const Binding & input, llvm::Value * value) {
     67        setNamedItemCount(input.getName(), input.isDeferred() ? NON_DEFERRED_ITEM_COUNT_SUFFIX : PROCESSED_ITEM_COUNT_SUFFIX, value);
     68    }
     69
     70    llvm::Value * getNonDeferredProducedItemCount(const Binding & output) {
     71        return getNamedItemCount(output.getName(), output.isDeferred() ? NON_DEFERRED_ITEM_COUNT_SUFFIX : PRODUCED_ITEM_COUNT_SUFFIX);
     72    }
     73
     74    void setNonDeferredProducedItemCount(const Binding & output, llvm::Value * value) {
     75        setNamedItemCount(output.getName(), output.isDeferred() ? NON_DEFERRED_ITEM_COUNT_SUFFIX : PRODUCED_ITEM_COUNT_SUFFIX, value);
    6076    }
    6177
     
    7793    llvm::Value * getInputStreamBlockPtr(const std::string & name, llvm::Value * streamIndex, llvm::Value * blockOffset);
    7894
    79     llvm::Value * loadInputStreamBlock(const std::string & name, llvm::Value * streamIndex);
    80 
    81     llvm::Value * getInputStreamPackPtr(const std::string & name, llvm::Value * streamIndex, llvm::Value * packIndex);
    82 
    83     llvm::Value * loadInputStreamPack(const std::string & name, llvm::Value * streamIndex, llvm::Value * packIndex);
     95    llvm::Value * loadInputStreamBlock(const std::string & name, llvm::Value * streamIndex) {
     96        return loadInputStreamBlock(name, streamIndex, nullptr);
     97    }
     98
     99    llvm::Value * loadInputStreamBlock(const std::string & name, llvm::Value * streamIndex, llvm::Value * blockOffset);
     100
     101    llvm::Value * getInputStreamPackPtr(const std::string & name, llvm::Value * streamIndex, llvm::Value * packIndex) {
     102        return getInputStreamPackPtr(name, streamIndex, packIndex, nullptr);
     103    }
     104
     105    llvm::Value * getInputStreamPackPtr(const std::string & name, llvm::Value * streamIndex, llvm::Value * packIndex, llvm::Value * blockOffset);
     106
     107    llvm::Value * loadInputStreamPack(const std::string & name, llvm::Value * streamIndex, llvm::Value * packIndex) {
     108        return loadInputStreamPack(name, streamIndex, packIndex, nullptr);
     109    }
     110
     111    llvm::Value * loadInputStreamPack(const std::string & name, llvm::Value * streamIndex, llvm::Value * packIndex, llvm::Value * blockOffset);
    84112
    85113    llvm::Value * getInputStreamSetCount(const std::string & name);
     
    91119    llvm::Value * getOutputStreamBlockPtr(const std::string & name, llvm::Value * streamIndex, llvm::Value * blockOffset);
    92120
    93     llvm::StoreInst * storeOutputStreamBlock(const std::string & name, llvm::Value * streamIndex, llvm::Value * toStore);
    94 
    95     llvm::Value * getOutputStreamPackPtr(const std::string & name, llvm::Value * streamIndex, llvm::Value * packIndex);
    96 
    97     llvm::StoreInst * storeOutputStreamPack(const std::string & name, llvm::Value * streamIndex, llvm::Value * packIndex, llvm::Value * toStore);
     121    llvm::StoreInst * storeOutputStreamBlock(const std::string & name, llvm::Value * streamIndex, llvm::Value * toStore) {
     122        return storeOutputStreamBlock(name, streamIndex, nullptr, toStore);
     123    }
     124
     125    llvm::StoreInst * storeOutputStreamBlock(const std::string & name, llvm::Value * streamIndex, llvm::Value * blockOffset, llvm::Value * toStore);
     126
     127    llvm::Value * getOutputStreamPackPtr(const std::string & name, llvm::Value * streamIndex, llvm::Value * packIndex) {
     128        return getOutputStreamPackPtr(name, streamIndex, packIndex, nullptr);
     129    }
     130
     131    llvm::Value * getOutputStreamPackPtr(const std::string & name, llvm::Value * streamIndex, llvm::Value * packIndex, llvm::Value * blockOffset);
     132
     133    llvm::StoreInst * storeOutputStreamPack(const std::string & name, llvm::Value * streamIndex, llvm::Value * packIndex, llvm::Value * toStore) {
     134        return storeOutputStreamPack(name, streamIndex, packIndex, nullptr, toStore);
     135    }
     136
     137    llvm::StoreInst * storeOutputStreamPack(const std::string & name, llvm::Value * streamIndex, llvm::Value * packIndex, llvm::Value * blockOffset, llvm::Value * toStore);
    98138
    99139    llvm::Value * getOutputStreamSetCount(const std::string & name);
     
    105145    llvm::Value * getBaseAddress(const std::string & name);
    106146
    107     llvm::Value * getBlockAddress(const std::string & name, llvm::Value * const blockIndex);
     147    void CreatePrepareOverflow(const std::string & name);
     148
     149    void CreateNonLinearCopyFromOverflow(const Binding & output, llvm::Value * itemsToCopy, llvm::Value * overflowOffset);
     150
     151    void CreateCopyFromOverflow(const Binding & output, llvm::Value * itemsToCopy);
     152
     153    void CreateCopyToOverflow(const std::string & name);
    108154
    109155    void setBaseAddress(const std::string & name, llvm::Value * addr);
     
    120166
    121167    llvm::Value * getLinearlyAccessibleItems(const std::string & name, llvm::Value * fromPos, llvm::Value * avail, bool reverse = false);
    122    
     168
    123169    llvm::Value * getLinearlyWritableItems(const std::string & name, llvm::Value * fromPos, bool reverse = false);
    124    
    125     void CreateStreamCpy(const std::string & name, llvm::Value * const target, llvm::Value * const targetOffset, llvm::Value * const source, llvm::Value * const sourceOffset, llvm::Value * const itemsToCopyFromOffset, const unsigned itemAlignment);
    126170
    127171    llvm::BasicBlock * CreateConsumerWait();
     
    148192
    149193    void doubleCapacity(const std::string & name);
     194
     195    // overloading wrongly subsitutes this for CBuilder function. renamed for now until I can investigate why.
     196    llvm::Value * CreateUDiv2(llvm::Value * const number, const ProcessingRate::RateValue & divisor, const llvm::Twine & Name = "");
     197
     198    llvm::Value * CreateCeilUDiv2(llvm::Value * const number, const ProcessingRate::RateValue & divisor, const llvm::Twine & Name = "");
     199
     200    llvm::Value * CreateMul2(llvm::Value * const number, const ProcessingRate::RateValue & factor, const llvm::Twine & Name = "");
     201
     202    llvm::Value * CreateCeilUMul2(llvm::Value * const number, const ProcessingRate::RateValue & factor, const llvm::Twine & Name = "");
    150203
    151204protected:
     
    161214    llvm::Value * getScalarFieldPtr(llvm::Value * instance, const std::string & fieldName);
    162215
    163     llvm::Value * getInternalItemCount(const std::string & name, const std::string & suffix);
    164 
    165     void setInternalItemCount(const std::string & name, const std::string & suffix, llvm::Value * const value);
     216    llvm::Value * getNamedItemCount(const std::string & name, const std::string & suffix);
     217
     218    void setNamedItemCount(const std::string & name, const std::string & suffix, llvm::Value * const value);
    166219
    167220protected:
Note: See TracChangeset for help on using the changeset viewer.