Ignore:
Timestamp:
Jun 9, 2017, 12:44:00 PM (2 years ago)
Author:
cameron
Message:

Fix for read_source kernel; stride attribute for multiblock kernels

File:
1 edited

Legend:

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

    r5479 r5497  
    121121        return mStreamSetOutputBuffers[i];
    122122    }
    123 
     123   
    124124    virtual ~Kernel() = 0;
    125125
     
    335335#.  The Multi-Block Kernel Builder will arrange that these input parameters may be
    336336    processed under the following simplifying assumptions.
    337     * the number of itemsToDo will either be an exact multiple of the BlockSize,
    338       or, for processing the final block, a value less than BlockSize
     337    * the number of itemsToDo will either be an exact multiple of the kernel stride,
     338      or, for processing the final block, a value less than the kernel stride
    339339    * the input buffer of the principal stream set and all input buffers of stream sets
    340340      with derived processing rates will be safe to access and have data available in
     
    345345    * all output buffers will be safe to access and have space available
    346346      for the given maximum output generation rates based on the given number
    347       of blocksToDo of the principal input stream set; no further bounds checking
     347      of itemsToDo of the principal input stream set; no further bounds checking
    348348      is needed.
    349349    * for final block processing, all input buffers will be extended to be safely
     
    357357    * for any input pointer p, a GEP instruction with a single int32 index i
    358358      will produce a pointer to the buffer position corresponding to the ith block of the
    359       principal input stream set.
     359      input stream set.
    360360    * for any output stream set declared with a Fixed or Add1 processing rate with respect
    361361      to the principal input stream set, a GEP instruction with a single int32 index i
    362362      will produce a pointer to the buffer position corresponding to the ith block of the
    363       principal input stream set.
     363      stream set.
    364364
    365365#.  Upon completion of multi-block processing, the Multi-Block Kernel Builder will arrange that
     
    393393    //
    394394    virtual void generateMultiBlockLogic(const std::unique_ptr<KernelBuilder> & idb) = 0;
     395   
     396    // Kernels typically perform block-at-a-time processing, but some kernels may require
     397    // a different stride.   In the case of multiblock kernels, the stride attribute
     398    // determines the number of minimum number of items that will be provided to the kernel
     399    // on each doMultiBlock call.
     400    //
     401   
     402    unsigned getKernelStride() const { return mStride;}
     403       
     404    void setKernelStride(unsigned stride) {mStride = stride;}
     405       
     406       
    395407
    396408private:
     409    size_t                            mStride;
     410
    397411
    398412    // Given a kernel subtype with an appropriate interface, the generateDoSegment
Note: See TracChangeset for help on using the changeset viewer.