Ignore:
Timestamp:
May 21, 2018, 9:49:22 PM (13 months ago)
Author:
cameron
Message:

Various small fixes

File:
1 edited

Legend:

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

    r6041 r6055  
    77#include <kernels/kernel_builder.h>
    88#include <toolchain/toolchain.h>
     9#include <llvm/IR/Intrinsics.h>
    910
    1011using namespace llvm;
     
    2122{}, {}, {})
    2223, mSwizzleFactor(swizzleFactor), mNumberOfStreamSet(numberOfStreamSet) {
    23     for (int i = 1; i < numberOfStreamSet; i++) {
     24    for (unsigned i = 1; i < numberOfStreamSet; i++) {
    2425        mStreamSetInputs.push_back(Binding{b->getStreamSetTy(swizzleFactor), "source" + std::to_string(i), RateEqualTo("source0"), BlockSize(b->getBitBlockWidth() / swizzleFactor) });
    2526        mStreamSetOutputs.push_back(Binding{b->getStreamSetTy(swizzleFactor), "output" + std::to_string(i), RateEqualTo("output0"), BlockSize(b->getBitBlockWidth() / swizzleFactor)});
     
    5657    std::vector<PHINode*> bufferPhiArray(mNumberOfStreamSet, NULL);
    5758    std::vector<Value*> bufferArray(mNumberOfStreamSet, NULL);
    58     for (int iStreamSetIndex = 0; iStreamSetIndex < mNumberOfStreamSet; iStreamSetIndex++) {
     59    for (unsigned iStreamSetIndex = 0; iStreamSetIndex < mNumberOfStreamSet; iStreamSetIndex++) {
    5960        PHINode * const bufferPhi = b->CreatePHI(b->getBitBlockType(), 2);
    6061        bufferPhi->addIncoming(Constant::getNullValue(b->getBitBlockType()), entry);
     
    9495
    9596        std::vector<PHINode * > updatedBufferArray(mNumberOfStreamSet, NULL);
    96         for (int iStreamSetIndex = 0; iStreamSetIndex < mNumberOfStreamSet; iStreamSetIndex++) {
     97        for (unsigned iStreamSetIndex = 0; iStreamSetIndex < mNumberOfStreamSet; iStreamSetIndex++) {
    9798            Value* buffer = bufferArray[iStreamSetIndex];
    9899            PHINode * const updatedBuffer = b->CreatePHI(buffer->getType(), 2);
     
    107108        Value * const swizzleOffset = b->CreateURem(updatedSourceOffset, PDEP_WIDTH);
    108109
    109         for (int iStreamSetIndex = 0; iStreamSetIndex < mNumberOfStreamSet; iStreamSetIndex++) {
     110        for (unsigned iStreamSetIndex = 0; iStreamSetIndex < mNumberOfStreamSet; iStreamSetIndex++) {
    110111            Value * const swizzle = b->CreateBlockAlignedLoad(b->getInputStreamBlockPtr("source" + std::to_string(iStreamSetIndex), swizzleIndex, blockOffset));
    111112
     
    143144        Value * const mask = b->CreateExtractElement(selectors, i);
    144145        Value * const usedShift = b->simd_fill(pdepWidth, required);
    145         for (int iStreamSetIndex = 0; iStreamSetIndex < mNumberOfStreamSet; iStreamSetIndex++) {
     146        for (unsigned iStreamSetIndex = 0; iStreamSetIndex < mNumberOfStreamSet; iStreamSetIndex++) {
    146147            Value* result = b->simd_pdep(pdepWidth, bufferArray[iStreamSetIndex], b->simd_fill(pdepWidth, mask));
    147148            // Store the result
     
    159160    sourceOffsetPhi->addIncoming(sourceOffset, finishedBlock);
    160161    bufferSizePhi->addIncoming(bufferSize, finishedBlock);
    161     for (int iStreamSetIndex = 0; iStreamSetIndex < mNumberOfStreamSet; iStreamSetIndex++) {
     162    for (unsigned iStreamSetIndex = 0; iStreamSetIndex < mNumberOfStreamSet; iStreamSetIndex++) {
    162163        bufferPhiArray[iStreamSetIndex]->addIncoming(bufferArray[iStreamSetIndex], finishedBlock);
    163164    }
Note: See TracChangeset for help on using the changeset viewer.