Changeset 4988


Ignore:
Timestamp:
Mar 24, 2016, 4:28:31 PM (20 months ago)
Author:
cameron
Message:

casefold sample application/pipeline

Location:
icGREP/icgrep-devel/icgrep
Files:
5 added
3 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/CMakeLists.txt

    r4984 r4988  
    105105
    106106add_executable(icgrep icgrep.cpp toolchain.cpp grep_engine.cpp object_cache.cpp ${PRECOMPILED_FILES})
     107add_executable(casefold casefold.cpp kernels/p2s_kernel.cpp kernels/stdout_kernel.cpp kernels/casefold_pipeline.cpp)
     108
    107109IF(ENABLE_PREGENERATED_UCD_FUNCTIONS)
    108110add_dependencies(icgrep run_generate_predefined_ucd_functions)
     
    113115    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_BOOST")
    114116    target_link_libraries(icgrep ${Boost_LIBRARIES})
     117    target_link_libraries(casefold ${Boost_LIBRARIES})
    115118ENDIF()
    116119IF (PRINT_TIMING_INFORMATION)
     
    122125
    123126target_link_libraries (icgrep UCDlib PabloADT RegExpCompiler CCADT ${REQ_LLVM_LIBRARIES})
     127target_link_libraries (casefold UCDlib PabloADT RegExpCompiler CCADT ${REQ_LLVM_LIBRARIES})
    124128
    125129IF(ENABLE_MULTIPLEXING)
  • icGREP/icgrep-devel/icgrep/kernels/kernel.cpp

    r4986 r4988  
    209209    mDoBlock = Function::Create(functionType, GlobalValue::ExternalLinkage, mKernelName + "_DoBlock", mMod);
    210210    mDoBlock->setCallingConv(CallingConv::C);
    211     mDoBlock->addAttribute(1, Attribute::NoCapture);
    212     mDoBlock->addAttribute(AttributeSet::FunctionIndex, Attribute::ReadNone);
    213     mDoBlock->addAttribute(AttributeSet::FunctionIndex, Attribute::NoUnwind);
     211  //  mDoBlock->addAttribute(1, Attribute::NoCapture);
     212 //   mDoBlock->addAttribute(AttributeSet::FunctionIndex, Attribute::ReadNone);
     213 //   mDoBlock->addAttribute(AttributeSet::FunctionIndex, Attribute::NoUnwind);
    214214
    215215    Function::arg_iterator args = mDoBlock->arg_begin();
     
    249249    mConstructor->setCallingConv(CallingConv::C);
    250250    mConstructor->addAttribute(1, Attribute::NoCapture);
    251     mConstructor->addAttribute(AttributeSet::FunctionIndex, Attribute::InlineHint);
    252     mConstructor->addAttribute(AttributeSet::FunctionIndex, Attribute::ReadNone);
    253     mConstructor->addAttribute(AttributeSet::FunctionIndex, Attribute::NoUnwind);
     251    //mConstructor->addAttribute(AttributeSet::FunctionIndex, Attribute::InlineHint);
     252   // mConstructor->addAttribute(AttributeSet::FunctionIndex, Attribute::ReadNone);
     253    //mConstructor->addAttribute(AttributeSet::FunctionIndex, Attribute::NoUnwind);
    254254    auto args = mConstructor->arg_begin();
    255255    mKernelParam = args++;
  • icGREP/icgrep-devel/icgrep/kernels/p2s_kernel.cpp

    r4987 r4988  
    1212}
    1313
    14 inline void p2s(IDISA::IDISA_Builder * iBuilder, Value * p[], Value * output) {
     14inline void p2s(IDISA::IDISA_Builder * iBuilder, Value * p[], Value * s[]) {
    1515    Value * bit00004444[2];
    1616    Value * bit22226666[2];
     
    2828        p2s_step(iBuilder, bit11115555[j], bit33337777[j],iBuilder->simd_himask(4), 2, bit11335577[2*j+1], bit11335577[2*j]);
    2929    }
    30     Value * s[8];
    3130    for (unsigned j = 0; j<4; j++) {
    3231        p2s_step(iBuilder, bit00224466[j], bit11335577[j], iBuilder->simd_himask(2), 1, s[2*j+1], s[2*j]);
    3332    }
    34     for (unsigned j = 0; j < 8; ++j) {
    35         iBuilder->CreateBlockAlignedStore(s[j], output, {iBuilder->getInt32(j)});
    36     }
    3733}
    3834               
    39 void generateP2SKernel(Module *, IDISA::IDISA_Builder * iBuilder, KernelBuilder * kBuilder) {
     35void generateP2SKernel(Module * m, IDISA::IDISA_Builder * iBuilder, KernelBuilder * kBuilder) {
    4036    for (unsigned i = 0; i < 8; ++i) {
    4137        kBuilder->addInputStream(1);
     
    4440    kBuilder->prepareFunction();
    4541    Value * input[8];
    46     Value * output = kBuilder->getOutputStream(0);
    4742    for (unsigned j = 0; j < 8; ++j) {
    4843        input[j] = iBuilder->CreateBlockAlignedLoad(kBuilder->getInputStream(j));
    4944    }
     45    Value * output[8];
    5046    p2s(iBuilder, input, output);
     47    Value * output_ptr = kBuilder->getOutputStream(0);
     48    for (unsigned j = 0; j < 8; ++j) {
     49
     50        iBuilder->CreateBlockAlignedStore(output[j], iBuilder->CreateGEP(output_ptr, std::vector<Value *>({ iBuilder->getInt32(0), iBuilder->getInt32(j) })));
     51    }
    5152    kBuilder->finalize();
     53    m->dump();
    5254}
    5355
Note: See TracChangeset for help on using the changeset viewer.