@@ -25,7 +25,7 @@ template <typename T>
2525class xSpMdM : public clsparseFunc
2626{
2727public:
28- xSpMdM ( PFCLSPARSETIMER sparseGetTimer, size_t profileCount, cl_device_type devType, size_t columns, cl_bool keep_explicit_zeroes = true ): clsparseFunc( devType, CL_QUEUE_PROFILING_ENABLE ), gpuTimer( nullptr ), cpuTimer( nullptr ), num_columns( columns )
28+ xSpMdM ( PFCLSPARSETIMER sparseGetTimer, size_t profileCount, cl_device_type devType, clsparseIdx_t columns, cl_bool keep_explicit_zeroes = true ): clsparseFunc( devType, CL_QUEUE_PROFILING_ENABLE ), gpuTimer( nullptr ), cpuTimer( nullptr ), num_columns( columns )
2929 {
3030 // Create and initialize our timer class, if the external timer shared library loaded
3131 if ( sparseGetTimer )
@@ -87,7 +87,7 @@ class xSpMdM: public clsparseFunc
8787 // There are NNZ float_types in the vals[ ] array
8888 // You read num_cols floats from the vector, afterwards they cache perfectly.
8989 // Finally, you write num_rows floats out to DRAM at the end of the kernel.
90- return ( sizeof ( cl_int )*( csrMtx.num_nonzeros + csrMtx.num_rows ) + sizeof ( T ) * ( csrMtx.num_nonzeros + csrMtx.num_cols + csrMtx.num_rows ) ) / time_in_ns ( );
90+ return (sizeof (clsparseIdx_t )*(csrMtx.num_nonzeros + csrMtx.num_rows ) + sizeof (T ) * (csrMtx.num_nonzeros + csrMtx.num_cols + csrMtx.num_rows ) ) / time_in_ns ();
9191 }
9292
9393 std::string bandwidth_formula ( )
@@ -104,7 +104,7 @@ class xSpMdM: public clsparseFunc
104104 beta = static_cast < T >( pBeta );
105105
106106 // Read sparse data from file and construct a CSR matrix from it
107- int nnz, row, col;
107+ clsparseIdx_t nnz, row, col;
108108 clsparseStatus fileError = clsparseHeaderfromFile ( &nnz, &row, &col, sparseFile.c_str ( ) );
109109 if ( fileError != clsparseSuccess )
110110 throw clsparse::io_exception ( " Could not read matrix market header from disk: " + sparseFile );
@@ -119,10 +119,10 @@ class xSpMdM: public clsparseFunc
119119 csrMtx.values = ::clCreateBuffer ( ctx, CL_MEM_READ_ONLY, csrMtx.num_nonzeros * sizeof ( T ), NULL , &status );
120120 CLSPARSE_V ( status, " ::clCreateBuffer csrMtx.values" );
121121
122- csrMtx.colIndices = ::clCreateBuffer ( ctx, CL_MEM_READ_ONLY, csrMtx.num_nonzeros * sizeof ( cl_int ), NULL , &status );
122+ csrMtx.colIndices = ::clCreateBuffer (ctx, CL_MEM_READ_ONLY, csrMtx.num_nonzeros * sizeof (clsparseIdx_t ), NULL , &status);
123123 CLSPARSE_V ( status, " ::clCreateBuffer csrMtx.colIndices" );
124124
125- csrMtx.rowOffsets = ::clCreateBuffer ( ctx, CL_MEM_READ_ONLY, ( csrMtx.num_rows + 1 ) * sizeof ( cl_int ), NULL , &status );
125+ csrMtx.rowOffsets = ::clCreateBuffer (ctx, CL_MEM_READ_ONLY, (csrMtx.num_rows + 1 ) * sizeof (clsparseIdx_t ), NULL , &status);
126126 CLSPARSE_V ( status, " ::clCreateBuffer csrMtx.rowOffsets" );
127127
128128 fileError = clsparseSCsrMatrixfromFile ( &csrMtx, sparseFile.c_str ( ), control, explicit_zeroes );
@@ -204,7 +204,7 @@ class xSpMdM: public clsparseFunc
204204 if ( gpuTimer && cpuTimer )
205205 {
206206 std::cout << " clSPARSE matrix: " << sparseFile << std::endl;
207- size_t sparseBytes = sizeof ( cl_int )*( csrMtx.num_nonzeros + csrMtx.num_rows ) + sizeof ( T ) * ( csrMtx.num_nonzeros + csrMtx.num_cols + csrMtx.num_rows );
207+ clsparseIdx_t sparseBytes = sizeof (clsparseIdx_t )*(csrMtx.num_nonzeros + csrMtx.num_rows ) + sizeof (T ) * (csrMtx.num_nonzeros + csrMtx.num_cols + csrMtx.num_rows );
208208 cpuTimer->pruneOutliers ( 3.0 );
209209 cpuTimer->Print ( sparseBytes, " GiB/s" );
210210 cpuTimer->Reset ( );
@@ -247,7 +247,7 @@ class xSpMdM: public clsparseFunc
247247 // host values
248248 T alpha;
249249 T beta;
250- size_t num_columns;
250+ clsparseIdx_t num_columns;
251251 cl_bool explicit_zeroes;
252252
253253 // OpenCL state
0 commit comments