diff --git a/opm/simulators/linalg/bda/cusparseSolverBackend.cu b/opm/simulators/linalg/bda/cusparseSolverBackend.cu index 65ef8e2cb..3a29cd573 100644 --- a/opm/simulators/linalg/bda/cusparseSolverBackend.cu +++ b/opm/simulators/linalg/bda/cusparseSolverBackend.cu @@ -227,8 +227,8 @@ void cusparseSolverBackend::initialize(int N, int nnz, int dim) { cudaMalloc((void**)&d_t, sizeof(double) * N); cudaMalloc((void**)&d_v, sizeof(double) * N); cudaMalloc((void**)&d_bVals, sizeof(double) * nnz); - cudaMalloc((void**)&d_bCols, sizeof(double) * nnz); - cudaMalloc((void**)&d_bRows, sizeof(double) * (Nb + 1)); + cudaMalloc((void**)&d_bCols, sizeof(int) * nnzb); + cudaMalloc((void**)&d_bRows, sizeof(int) * (Nb + 1)); cudaMalloc((void**)&d_mVals, sizeof(double) * nnz); cudaCheckLastError("Could not allocate enough memory on GPU"); @@ -295,7 +295,7 @@ void cusparseSolverBackend::copy_system_to_gpu(double *vals, int *ro cudaMemcpyAsync(d_bVals, vals, nnz * sizeof(double), cudaMemcpyHostToDevice, stream); #endif - cudaMemcpyAsync(d_bCols, cols, nnz * sizeof(int), cudaMemcpyHostToDevice, stream); + cudaMemcpyAsync(d_bCols, cols, nnzb * sizeof(int), cudaMemcpyHostToDevice, stream); cudaMemcpyAsync(d_bRows, rows, (Nb + 1) * sizeof(int), cudaMemcpyHostToDevice, stream); cudaMemcpyAsync(d_b, b, N * sizeof(double), cudaMemcpyHostToDevice, stream); cudaMemsetAsync(d_x, 0, sizeof(double) * N, stream); diff --git a/opm/simulators/linalg/bda/cusparseSolverBackend.hpp b/opm/simulators/linalg/bda/cusparseSolverBackend.hpp index 838446826..cec9618af 100644 --- a/opm/simulators/linalg/bda/cusparseSolverBackend.hpp +++ b/opm/simulators/linalg/bda/cusparseSolverBackend.hpp @@ -84,7 +84,7 @@ private: /// Copy linear system to GPU /// \param[in] vals array of nonzeroes, each block is stored row-wise, contains nnz values /// \param[in] rows array of rowPointers, contains N/dim+1 values - /// \param[in] cols array of columnIndices, contains nnz values + /// \param[in] cols array of columnIndices, contains nnzb values /// \param[in] b input vector, contains N values void copy_system_to_gpu(double *vals, int *rows, int *cols, double *b);