Ignore:
Timestamp:
Apr 8, 2018, 5:31:54 PM (10 months ago)
Author:
cameron
Message:

InternalSearchEngine?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/grep/grep_engine.h

    r5953 r5954  
    3535extern "C" void finalize_match_wrapper(intptr_t accum_addr, char * buffer_end);
    3636
    37    
    38 #define MAX_SIMD_WIDTH_SUPPORTED 512
    39 #define INITIAL_CAPACITY 1024
    40    
    41 class SearchableBuffer  {
    42     SearchableBuffer();
    43     void addSearchCandidate(char * string_ptr, size_t length);
    44     size_t getCandidateCount() {return mEntries;}
    45     ~SearchableBuffer();
    46 private:
    47     static const unsigned BUFFER_ALIGNMENT = MAX_SIMD_WIDTH_SUPPORTED/8;
    48     size_t mAllocated_capacity;
    49     char * mBuffer_base;
    50     alignas(BUFFER_ALIGNMENT) char mInitial_buffer[INITIAL_CAPACITY];
    51     size_t mSpace_used;
    52     size_t mEntries;
    53 };
    54 
    55 void grepBuffer(re::RE * pattern, const char * buffer, size_t bufferLength, MatchAccumulator * accum);
    5637
    5738class GrepEngine {
     
    197178};
    198179   
     180   
     181#define MAX_SIMD_WIDTH_SUPPORTED 512
     182#define INITIAL_CAPACITY 1024
     183   
     184    class SearchableBuffer  {
     185        SearchableBuffer();
     186        void addSearchCandidate(char * string_ptr, size_t length);
     187        size_t getCandidateCount() {return mEntries;}
     188        char * getBufferBase() {return mBuffer_base;}
     189        size_t getBufferSize() {return mSpace_used;}
     190        ~SearchableBuffer();
     191    private:
     192        static const unsigned BUFFER_ALIGNMENT = MAX_SIMD_WIDTH_SUPPORTED/8;
     193        size_t mAllocated_capacity;
     194        char * mBuffer_base;
     195        alignas(BUFFER_ALIGNMENT) char mInitial_buffer[INITIAL_CAPACITY];
     196        size_t mSpace_used;
     197        size_t mEntries;
     198    };
    199199
    200200}
Note: See TracChangeset for help on using the changeset viewer.