#include "hell.h" #include "hell_conv.h" void computeHellAllocSize( int* allocationHeight, int hackSize, int rowsCount, const int *ellRowLengths ) { int totalLen = 0; int i; int remainings; int done; int maxLen; for (i=0; i maxLen) maxLen = curLen; } totalLen += maxLen; } remainings = rowsCount % hackSize; done = (rowsCount/hackSize)*hackSize; maxLen = 0; for (i=0; i maxLen) maxLen = curLen; } *allocationHeight = totalLen + maxLen; } void ellToHell( void *hellValues, int *hellIndices, int* hackOffsets, int hackSize, const void *ellValues, const int *ellIndices, int ellValuesPitch, int ellIndicesPitch, int *ellRowLengths, int rowsCount, spgpuType_t valuesType ) { size_t elementSize = spgpuSizeOf(valuesType); int hacks = (rowsCount + hackSize - 1)/hackSize; char* currValPos = (char*)hellValues; int* currIndPos = hellIndices; int hackOffset = 0; int i; for (i=0; i= rowsCount) break; rowLen = ellRowLengths[row]; if (rowLen > maxLen) maxLen = rowLen; for (k=0; k