Changeset 5407


Ignore:
Timestamp:
Apr 13, 2017, 8:05:17 PM (2 years ago)
Author:
cameron
Message:

Some preparations to ease transition to unique_ptr

Location:
icGREP/icgrep-devel/icgrep/kernels
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/kernels/pipeline.cpp

    r5403 r5407  
    9999
    100100    for (unsigned k = 0;;) {
    101         KernelBuilder * const kernel = kernels[k];
     101        const auto & kernel = kernels[k];
    102102        const unsigned waitIdx = codegen::DebugOptionIsSet(codegen::SerializeThreads) ? (n - 1) : k;
    103103
     
    224224    Constant * const nullVoidPtrVal = ConstantPointerNull::getNullValue(voidPtrTy);
    225225
    226     for (auto k : kernels) {
     226    for (auto & k : kernels) {
    227227        k->createInstance();
    228228    }
     
    247247        iBuilder->CreateStore(kernels[i]->getInstance(), ptr);
    248248    }
    249     for (unsigned i = 0; i < n; i++) {
    250         kernels[i]->releaseLogicalSegmentNo(kernels[i]->getInstance(), iBuilder->getSize(0));
     249    for (auto & kernel : kernels) {
     250        kernel->releaseLogicalSegmentNo(kernel->getInstance(), iBuilder->getSize(0));
    251251    }
    252252
     
    255255    StreamSetBufferMap<std::vector<unsigned>> consumingKernels;
    256256    for (unsigned id = 0; id < n; ++id) {
    257         KernelBuilder * const kernel = kernels[id];
     257        const auto & kernel = kernels[id];
    258258        const auto & inputs = kernel->getStreamInputs();
    259259        const auto & outputs = kernel->getStreamOutputs();
     
    289289    Function * thread_functions[n];
    290290    for (unsigned id = 0; id < n; id++) {
    291         KernelBuilder * const kernel = kernels[id];
     291        const auto & kernel = kernels[id];
    292292        const auto & inputs = kernel->getStreamInputs();
    293293        const auto & outputs = kernel->getStreamOutputs();
     
    410410void generatePipelineLoop(IDISA::IDISA_Builder * iBuilder, const std::vector<KernelBuilder *> & kernels) {
    411411
    412     for (auto k : kernels) {
     412    for (auto & k : kernels) {
    413413        k->createInstance();
    414414    }
     
    427427
    428428    // Build up the initial phi nodes for each of the consumed (minimum processed) positions
    429     for (unsigned k = 0; k < kernels.size(); k++) {
    430         KernelBuilder * const kernel = kernels[k];
     429    for (auto & kernel : kernels) {
    431430        const auto & outputs = kernel->getStreamOutputs();
    432431        for (unsigned i = 0; i < outputs.size(); ++i) {
     
    442441
    443442    Value * terminated = iBuilder->getFalse();
    444     for (unsigned k = 0; k < kernels.size(); k++) {
    445         KernelBuilder * const kernel = kernels[k];
     443    for (auto & kernel : kernels) {
    446444        Value * const instance = kernel->getInstance();
    447445        const auto & inputs = kernel->getStreamInputs();
  • icGREP/icgrep-devel/icgrep/kernels/toolchain.cpp

    r5402 r5407  
    219219
    220220void ParabixDriver::generatePipelineIR() {
    221     for (kernel::KernelBuilder * kb : mKernelList) {
     221    for (auto & kb : mKernelList) {
    222222        kb->addKernelDeclarations(mMainModule);
    223223    }
Note: See TracChangeset for help on using the changeset viewer.