Skip to content

Commit eb896b8

Browse files
Fix warnings ready for release (#273)
* Fix incorrectly named header for AMGX_matrix_check_symmetry. * Fixing warnings ready for release.
1 parent bd574b0 commit eb896b8

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

include/amgx_c.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ AMGX_RC AMGX_API AMGX_matrix_upload_all_global_32
608608
const void *diag_data,
609609
AMGX_distribution_handle distribution);
610610

611-
AMGX_RC AMGX_API AMGX_check_matrix_symmetry
611+
AMGX_RC AMGX_API AMGX_matrix_check_symmetry
612612
(AMGX_matrix_handle mtx,
613613
int* structurally_symmetric,
614614
int* symmetric);

src/amgx_cusparse.cu

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,18 +1209,18 @@ inline void Cusparse::bsrmv( cusparseHandle_t handle, cusparseDirection_t dir, c
12091209
double *y,
12101210
const cudaStream_t& stream)
12111211
{
1212-
// Run cuSparse on selected stream
1213-
cusparseSetStream(handle, stream);
1214-
12151212
#ifndef DISABLE_MIXED_PRECISION
1213+
// Run cuSparse on selected stream
1214+
cusparseSetStream(handle, stream);
1215+
12161216
const double *d_bsrVal = reinterpret_cast<const double *>(const_cast<float *>(bsrVal)); // this works due to private API call in the matrix initialization which sets cusparse matrix description in the half precision mode
12171217
cusparseCheckError(cusparseDbsrxmv(handle, dir, trans, mb, mb, nb, nnzb, alpha, descr, d_bsrVal, bsrMaskPtr, bsrRowPtr, bsrRowPtr + 1, bsrColInd, blockDim, x, beta, y));
1218+
1219+
// Reset cuSparse to default stream
1220+
cusparseSetStream(handle, 0);
12181221
#else
12191222
FatalError("Mixed precision modes not currently supported for CUDA 10.1 or later.", AMGX_ERR_NOT_IMPLEMENTED);
12201223
#endif
1221-
1222-
// Reset cuSparse to default stream
1223-
cusparseSetStream(handle, 0);
12241224
}
12251225

12261226
// Custom implementation of matrix-vector product to replace the original bsrxmv,
@@ -1491,18 +1491,18 @@ inline void Cusparse::bsrmv( cusparseHandle_t handle, cusparseDirection_t dir, c
14911491
cuDoubleComplex *y,
14921492
const cudaStream_t& stream)
14931493
{
1494-
// Run cuSparse on selected stream
1495-
cusparseSetStream(handle, stream);
1496-
14971494
#ifndef DISABLE_MIXED_PRECISION
1495+
// Run cuSparse on selected stream
1496+
cusparseSetStream(handle, stream);
1497+
14981498
const cuDoubleComplex *d_bsrVal = reinterpret_cast<cuDoubleComplex *>(const_cast<cuComplex *>(bsrVal));
14991499
cusparseCheckError(cusparseZbsrxmv(handle, dir, trans, mb, mb, nb, nnzb, alpha, descr, d_bsrVal, bsrMaskPtr, bsrRowPtr, bsrRowPtr + 1, bsrColInd, blockDim, x, beta, y));
1500+
1501+
// Reset cuSparse to default stream
1502+
cusparseSetStream(handle, 0);
15001503
#else
15011504
FatalError("Mixed precision modes not currently supported for CUDA 10.1 or later.", AMGX_ERR_NOT_IMPLEMENTED);
15021505
#endif
1503-
1504-
// Reset cuSparse to default stream
1505-
cusparseSetStream(handle, 0);
15061506
}
15071507

15081508

src/distributed/distributed_manager.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1901,7 +1901,6 @@ void *DistributedManagerBase<TConfig>::getHostPointerForData(void *ptr, size_t s
19011901
//you are in case 1 or 3 from the above comment
19021902
ptr_h = ptr;
19031903
}
1904-
#endif
19051904

19061905
cudaGetLastError(); //to reset last error
19071906

@@ -1912,6 +1911,7 @@ void *DistributedManagerBase<TConfig>::getHostPointerForData(void *ptr, size_t s
19121911
}
19131912

19141913
return ptr_h;
1914+
#endif
19151915
}
19161916

19171917
// if pointer is host pointer - returns data. If it is device pointer - copies it to the m_pinned_buffer and returns pointer to m_pinned_buffer

src/solvers/gauss_seidel_solver.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ void GaussSeidelSolver<TemplateConfig<AMGX_host, t_vecPrec, t_matPrec, t_indPrec
158158
{
159159
if (A.col_indices[j] == i)
160160
{
161-
this->diag[i] = /*static_cast<ValueTypeB>(1) /*/ A.values[j];
161+
this->diag[i] = A.values[j];
162162
break;
163163
}
164164

0 commit comments

Comments
 (0)