-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added GPU solve kernel for Cholesky factor
- Loading branch information
flopez
committed
May 11, 2020
1 parent
eb8d734
commit a8e13c5
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/// @file | ||
/// @copyright 2020- The Science and Technology Facilities Council (STFC) | ||
/// @author Jonathan Hogg | ||
/// @author Florent Lopez | ||
#pragma once | ||
|
||
#include "kernels/gpu/wrappers.hxx" | ||
#include "kernels/gpu/common.hxx" | ||
|
||
namespace sylver { | ||
namespace spldlt { | ||
namespace cuda { | ||
|
||
template<typename T> | ||
class Chol { | ||
|
||
public: | ||
|
||
static void solve( | ||
cublasHandle_t cuhandle, | ||
int m, int n, | ||
T const* akk, int ld_akk, | ||
T* aik, int ld_aik) { | ||
|
||
std::string context = "Chol::solve"; | ||
cublasStatus_t custat; | ||
|
||
T alpha = T(1.0); | ||
|
||
custat = sylver::gpu::dev_trsm( | ||
cuhandle, CUBLAS_SIDE_RIGHT, CUBLAS_FILL_MODE_LOWER, | ||
CUBLAS_OP_T, CUBLAS_DIAG_NON_UNIT, | ||
m, n, | ||
&alpha, | ||
akk, ld_akk, | ||
aik, ld_aik); | ||
|
||
sylver::gpu::cublas_check_error(custat, context); | ||
} | ||
}; | ||
|
||
}}} |