SIRIUS 7.5.0
Electronic structure library and applications
rocsolver.cpp
1// Copyright (c) 2023 Simon Pintarelli, Anton Kozhevnikov, Thomas Schulthess
2// All rights reserved.
3//
4// Redistribution and use in source and binary forms, with or without modification, are permitted provided that
5
6// the following conditions are met:
7//
8// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the
9// following disclaimer.
10// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11// and the following disclaimer in the documentation and/or other materials provided with the distribution.
12//
13// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
14// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
15// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
16// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
17// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
18// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
19// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
20
21#ifdef SIRIUS_ROCM
22
23#include "rocsolver.hpp"
24#include "acc_blas.hpp"
25
26namespace sirius {
27
28namespace acc {
29
30namespace rocsolver {
31
32acc::blas_api::handle_t&
33rocsolver_handle()
34{
36}
37
38/// Linear Solvers
39void
40zgetrs(rocblas_handle handle, char trans, int n, int nrhs, acc_complex_double_t* A, int lda, const int* devIpiv,
41 acc_complex_double_t* B, int ldb)
42{
43 rocblas_operation trans_op = get_rocblas_operation(trans);
44
45 CALL_ROCSOLVER(rocsolver_zgetrs, (handle, trans_op, n, nrhs, reinterpret_cast<rocblas_double_complex*>(A), lda,
46 devIpiv, reinterpret_cast<rocblas_double_complex*>(B), ldb));
47}
48
49void
50zgetrf(rocblas_handle handle, int m, int n, acc_complex_double_t* A, int* devIpiv, int lda, int* devInfo)
51{
52 CALL_ROCSOLVER(rocsolver_zgetrf,
53 (handle, m, n, reinterpret_cast<rocblas_double_complex*>(A), lda, devIpiv, devInfo));
54}
55
56} // namespace rocsolver
57
58} // namespace acc
59
60} // namespace sirius
61
62#endif
Blas functions for execution on GPUs.
acc::blas_api::handle_t & null_stream_handle()
Store the default (null) stream handler.
Definition: acc_blas.cpp:11
void zgetrs(rocblas_handle handle, char trans, int n, int nrhs, acc_complex_double_t *A, int lda, const int *devIpiv, acc_complex_double_t *B, int ldb)
Linear Solvers.
Namespace of the SIRIUS library.
Definition: sirius.f90:5
Contains implementation of rocsolver wrappers.