Skip to content

Commit 5c1ade3

Browse files
committed
Merge branch 'jlgreathouse-fix_blas3' into develop
2 parents bc6408d + 0a208a4 commit 5c1ade3

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

src/tests/resources/csr_matrix_environment.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@ class CSREnvironment: public ::testing::Environment
7272
csrDMatrix.rowOffsets = ::clCreateBuffer( context, CL_MEM_READ_ONLY,
7373
( csrDMatrix.num_rows + 1 ) * sizeof( cl_int ), NULL, &status );
7474

75-
csrDMatrix.rowBlocks = ::clCreateBuffer( context, CL_MEM_READ_WRITE,
76-
csrDMatrix.rowBlockSize * sizeof( cl_ulong ), NULL, &status );
77-
7875
clsparseStatus fileError = clsparseDCsrMatrixfromFile( &csrDMatrix, file_name.c_str( ), CLSE::control );
7976
if( fileError != clsparseSuccess )
8077
throw std::runtime_error( "Could not read matrix market data from disk: " + file_name );

src/tests/resources/sparse_matrix_environment.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ class CSRSparseEnvironment : public ::testing::Environment {
5757
csrSMatrix.num_nonzeros = n_vals;
5858
csrSMatrix.num_rows = n_rows;
5959
csrSMatrix.num_cols = n_cols;
60-
clsparseCsrMetaSize(&csrSMatrix, CLSE::control);
6160

6261
// Load single precision data from file; this API loads straight into GPU memory
6362
cl_int status;
@@ -70,13 +69,15 @@ class CSRSparseEnvironment : public ::testing::Environment {
7069
csrSMatrix.rowOffsets = ::clCreateBuffer(context, CL_MEM_READ_ONLY,
7170
(csrSMatrix.num_rows + 1) * sizeof(cl_int), NULL, &status);
7271

73-
csrSMatrix.rowBlocks = ::clCreateBuffer(context, CL_MEM_READ_ONLY,
74-
csrSMatrix.rowBlockSize * sizeof(cl_ulong), NULL, &status);
75-
7672
clsparseStatus fileError = clsparseSCsrMatrixfromFile(&csrSMatrix, file_name.c_str(), CLSE::control);
7773
if (fileError != clsparseSuccess)
7874
throw std::runtime_error("Could not read matrix market data from disk");
7975

76+
clsparseCsrMetaSize(&csrSMatrix, CLSE::control);
77+
csrSMatrix.rowBlocks = ::clCreateBuffer( context, CL_MEM_READ_WRITE,
78+
csrSMatrix.rowBlockSize * sizeof( cl_ulong ), NULL, &status );
79+
clsparseCsrMetaCompute( &csrSMatrix, CLSE::control );
80+
8081
// Download sparse matrix data to host
8182
// First, create space on host to hold the data
8283
ublasSCsr = sMatrixType(n_rows, n_cols, n_vals);
@@ -310,4 +311,4 @@ class CSRSparseEnvironment : public ::testing::Environment {
310311
};
311312

312313

313-
#endif // _SPARSE_MATRIX_ENVIRONMENT_H_
314+
#endif // _SPARSE_MATRIX_ENVIRONMENT_H_

0 commit comments

Comments
 (0)