#include "dia.h" #include "dia_conv.h" #include "stdlib.h" int computeDiaAllocPitch(int rowsCount) { // returns a pitch good for indices and values return ((rowsCount + 31)/32)*32; } int computeDiaDiagonalsCount( int rowsCount, int columnsCount, int nonZerosCount, const int* cooRowIndices, const int* cooColsIndices) { int* diagIds = (int*)malloc((rowsCount + columnsCount - 1)*sizeof(int)); int diagonalsCount = 0; int i; for (i=0; i<(rowsCount + columnsCount - 1); ++i) diagIds[i] = -1; for (i=0; i