Changeset 6010


Ignore:
Timestamp:
May 1, 2018, 10:45:51 PM (3 weeks ago)
Author:
nmedfort
Message:

Bug fix for 32-bit

File:
1 edited

Legend:

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

    r6008 r6010  
    112112    Value * const readStart = b->getRawOutputPointer("sourceBuffer", consumedOffset);
    113113    Value * const readEnd = b->getRawOutputPointer("sourceBuffer", fileItems);
    114     Value * const unconsumedBytes = b->CreatePtrDiff(readEnd, readStart);
     114    Value * const unconsumedBytes = b->CreateTrunc(b->CreatePtrDiff(readEnd, readStart), b->getSizeTy());
    115115    Value * const bufferSize = b->CreateRoundUp(b->CreateAdd(unconsumedBytes, BLOCK_WIDTH), PAGE_SIZE);
    116116    Value * const buffer = b->CreateAlignedMalloc(bufferSize, b->getCacheAlignment());
     
    364364        Value * const readStart = b->getRawOutputPointer("sourceBuffer", consumedOffset);
    365365        Value * const readEnd = b->getRawOutputPointer("sourceBuffer", fileItems);
    366         Value * const unconsumedBytes = b->CreatePtrDiff(readEnd, readStart);
     366        Value * const unconsumedBytes = b->CreateTrunc(b->CreatePtrDiff(readEnd, readStart), b->getSizeTy());
    367367        Value * const bufferSize = b->CreateRoundUp(b->CreateAdd(unconsumedBytes, BLOCK_WIDTH), PAGE_SIZE);
    368368        Value * const buffer = b->CreateAlignedMalloc(bufferSize, b->getCacheAlignment());
Note: See TracChangeset for help on using the changeset viewer.