提交 516e4e28 authored 作者: Alexander Matyasko's avatar Alexander Matyasko

Fix error strings and avoid std::min

上级 9ebd5b09
......@@ -115,8 +115,8 @@ int APPLY_SPECIFIC(magma_cholesky)(PyGpuArrayObject *A, PyGpuArrayObject **L,
#ifdef LOWER
res = tril_kernel_scall(1, &n2, 0, n2, N, (*L)->ga.data);
if (res != GA_NO_ERROR) {
PyErr_Format(PyExc_RuntimeError, "GpuMagmaCholesky: triu_kernel %s.",
GpuKernel_error(&k_triu_kernel, res));
PyErr_Format(PyExc_RuntimeError, "GpuMagmaCholesky: tril_kernel %s.",
GpuKernel_error(&k_tril_kernel, res));
goto fail;
}
#else
......
......@@ -72,7 +72,7 @@ int APPLY_SPECIFIC(magma_qr)(PyGpuArrayObject *A_,
// magma matrix qr
M = PyGpuArray_DIM(A, 0);
N = PyGpuArray_DIM(A, 1);
K = std::min(M, N);
K = M < N ? M : N;
if (MAGMA_SUCCESS != magma_smalloc_pinned(&tau_data, N * N)) {
PyErr_SetString(PyExc_RuntimeError,
......
......@@ -21,7 +21,7 @@ int APPLY_SPECIFIC(magma_svd)(PyGpuArrayObject *A,
if (A->ga.typecode != GA_FLOAT) {
PyErr_SetString(PyExc_TypeError,
"GpuMagmaMatrixInverse: Unsupported data type");
"GpuMagmaSVD: Unsupported data type");
return -1;
}
......@@ -31,12 +31,12 @@ int APPLY_SPECIFIC(magma_svd)(PyGpuArrayObject *A,
if (!GpuArray_IS_C_CONTIGUOUS(&A->ga)) {
PyErr_SetString(PyExc_ValueError,
"GpuMagmaMatrixInverse: requires data to be C-contiguous");
"GpuMagmaSVD: requires data to be C-contiguous");
goto fail;
}
if (PyGpuArray_NDIM(A) != 2) {
PyErr_SetString(PyExc_ValueError,
"GpuMagmaMatrixInverse: matrix rank error");
"GpuMagmaSVD: matrix rank error");
goto fail;
}
......@@ -44,7 +44,7 @@ int APPLY_SPECIFIC(magma_svd)(PyGpuArrayObject *A,
// reverse dimensions because MAGMA expects column-major matrices:
M = PyGpuArray_DIM(A, 1);
N = PyGpuArray_DIM(A, 0);
K = std::min(M, N);
K = M < N ? M : N;
if (MAGMA_SUCCESS != magma_smalloc_pinned(&a_data, M * N)) {
PyErr_SetString(PyExc_RuntimeError,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论