summaryrefslogtreecommitdiff
path: root/src/routines/level2/xspmv.cpp
diff options
context:
space:
mode:
authorIvan Shapovalov <intelfx@intelfx.name>2016-10-22 05:14:19 +0300
committerIvan Shapovalov <intelfx@intelfx.name>2016-10-22 08:45:25 +0300
commitb98af44fcf89b9946e1de438b1f5527e6bf28905 (patch)
treefbd5ec2ab1e418830b88e5de42279845911ea0da /src/routines/level2/xspmv.cpp
parent5d03d48f7aaf38d3b28bad612638d2d9db8ebee0 (diff)
treewide: use C++ exceptions properly
Since the codebase is designed around proper C++ idioms such as RAII, it makes sense to only use C++ exceptions internally instead of mixing exceptions and error codes. The exceptions are now caught at top level to preserve compatibility with the existing error code-based API. Note that we deliberately do not catch C++ runtime errors (such as `std::bad_alloc`) nor logic errors (aka failed assertions) because no actual handling can ever happen for such errors. However, in the C interface we do catch _all_ exceptions (...) and convert them into a wild-card error code.
Diffstat (limited to 'src/routines/level2/xspmv.cpp')
-rw-r--r--src/routines/level2/xspmv.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/routines/level2/xspmv.cpp b/src/routines/level2/xspmv.cpp
index f6651012..bf1a49e1 100644
--- a/src/routines/level2/xspmv.cpp
+++ b/src/routines/level2/xspmv.cpp
@@ -29,13 +29,13 @@ Xspmv<T>::Xspmv(Queue &queue, EventPointer event, const std::string &name):
// The main routine
template <typename T>
-StatusCode Xspmv<T>::DoSpmv(const Layout layout, const Triangle triangle,
- const size_t n,
- const T alpha,
- const Buffer<T> &ap_buffer, const size_t ap_offset,
- const Buffer<T> &x_buffer, const size_t x_offset, const size_t x_inc,
- const T beta,
- const Buffer<T> &y_buffer, const size_t y_offset, const size_t y_inc) {
+void Xspmv<T>::DoSpmv(const Layout layout, const Triangle triangle,
+ const size_t n,
+ const T alpha,
+ const Buffer<T> &ap_buffer, const size_t ap_offset,
+ const Buffer<T> &x_buffer, const size_t x_offset, const size_t x_inc,
+ const T beta,
+ const Buffer<T> &y_buffer, const size_t y_offset, const size_t y_inc) {
// The data is either in the upper or lower triangle
size_t is_upper = ((triangle == Triangle::kUpper && layout != Layout::kRowMajor) ||
@@ -45,13 +45,13 @@ StatusCode Xspmv<T>::DoSpmv(const Layout layout, const Triangle triangle,
// The specific symmetric packed matrix-accesses are implemented in the kernel guarded by the
// ROUTINE_SPMV define.
bool fast_kernels = false;
- return MatVec(layout, Transpose::kNo,
- n, n, alpha,
- ap_buffer, ap_offset, n,
- x_buffer, x_offset, x_inc, beta,
- y_buffer, y_offset, y_inc,
- fast_kernels, fast_kernels,
- is_upper, true, 0, 0);
+ MatVec(layout, Transpose::kNo,
+ n, n, alpha,
+ ap_buffer, ap_offset, n,
+ x_buffer, x_offset, x_inc, beta,
+ y_buffer, y_offset, y_inc,
+ fast_kernels, fast_kernels,
+ is_upper, true, 0, 0);
}
// =================================================================================================