37 TEST_CASE(
"DiracMatrixComputeCUDA_cuBLAS_geam_call",
"[wavefunction][fermion]")
48 double host_zero(0.0);
50 std::vector<double>
A{2, 5, 8, 7, 5, 2, 2, 8, 7, 5, 6, 6, 5, 4, 4, 8};
60 "cuBLAS::geam failed.");
63 TEST_CASE(
"DiracMatrixComputeCUDA_different_batch_sizes",
"[wavefunction][fermion]")
67 std::vector<double>
A{2, 5, 8, 7, 5, 2, 2, 8, 7, 5, 6, 6, 5, 4, 4, 8};
81 double invA[16]{-0.08247423, -0.26804124, 0.26804124, 0.05154639, 0.18556701, -0.89690722, 0.39690722, 0.13402062,
82 0.24742268, -0.19587629, 0.19587629, -0.15463918, -0.29896907, 1.27835052, -0.77835052, 0.06185567};
105 CHECK(
log_values[0] == ComplexApprox(std::complex<double>{5.267858159063328, 6.283185307179586}));
106 CHECK(
log_values[1] == ComplexApprox(std::complex<double>{5.267858159063328, 6.283185307179586}));
129 CHECK(
log_values[0] == ComplexApprox(std::complex<double>{5.267858159063328, 6.283185307179586}));
130 CHECK(
log_values[1] == ComplexApprox(std::complex<double>{5.267858159063328, 6.283185307179586}));
131 CHECK(
log_values[2] == ComplexApprox(std::complex<double>{5.267858159063328, 6.283185307179586}));
134 TEST_CASE(
"DiracMatrixComputeCUDA_complex_determinants_against_legacy",
"[wavefunction][fermion]")
149 for (
int i = 0; i <
n; ++i)
150 for (
int j = 0; j <
n; ++j)
151 mat_a(i, j) = mat_spd(i, j);
160 for (
int i = 0; i <
n; ++i)
161 for (
int j = 0; j <
n; ++j)
162 mat_a2(i, j) = mat_spd2(i, j);
178 std::complex<double> det_log_value;
189 TEST_CASE(
"DiracMatrixComputeCUDA_large_determinants_against_legacy",
"[wavefunction][fermion]")
203 for (
int i = 0; i <
n; ++i)
204 for (
int j = 0; j <
n; ++j)
205 mat_a(i, j) = mat_spd(i, j);
214 for (
int i = 0; i <
n; ++i)
215 for (
int j = 0; j <
n; ++j)
216 mat_a2(i, j) = mat_spd2(i, j);
232 std::complex<double> det_log_value;
helper functions for EinsplineSetBuilder
Vector< T, PinnedDualAllocator< T > > OffloadPinnedVector
std::vector< StdComp, CUDAHostAllocator< StdComp > > log_values(batch_size)
TEST_CASE("complex_helper", "[type_traits]")
CHECKED_ELSE(check_matrix_result.result)
void resize(size_type n, size_type m)
Resize the container.
std::enable_if_t<!std::is_same< VALUE_FP, TMAT >::value > mw_invertTranspose(compute::Queue< PlatformKind::CUDA > &queue, const RefVector< const DualMatrix< TMAT >> &a_mats, const RefVector< DualMatrix< TMAT >> &inv_a_mats, DualVector< LogValue > &log_values)
Mixed precision specialization When TMAT is not full precision we need to still do the inversion and ...
void makeRngSpdMatrix(testing::RandomForTest< RngValueType< T >> &rng, Matrix< T > &mat_spd)
helper class to compute matrix inversion and the log value of determinant
These allocators are to make code that should be generic with the respect to accelerator code flavor ...
void invert_transpose(compute::Queue< PlatformKind::CUDA > &queue, DualMatrix< TMAT > &a_mat, DualMatrix< TMAT > &inv_a_mat, DualVector< LogValue > &log_values)
Given a_mat returns inverted amit and log determinant of a_matches.
#define cudaMemcpyHostToDevice
std::vector< std::reference_wrapper< T > > RefVector
Declaraton of Vector<T,Alloc> Manage memory through Alloc directly and allow referencing an existing ...
sycl::event copy_n(sycl::queue &aq, const T1 *restrict VA, size_t array_size, T2 *restrict VC, const std::vector< sycl::event > &events)
class defining a compute and memory resource to compute matrix inversion and the log determinants of ...
CheckMatrixResult checkMatrix(M1 &a_mat, M2 &b_mat, const bool check_all=false, std::optional< const double > eps=std::nullopt)
This function checks equality a_mat and b_mat elements M1, M2 need to have their element type declare...
cublasStatus_t geam(cublasHandle_t &handle, cublasOperation_t &transa, cublasOperation_t &transb, int m, int n, const float *alpha, const float *A, int lda, const float *beta, const float *B, int ldb, float *C, int ldc)
CHECK(log_values[0]==ComplexApprox(std::complex< double >{ 5.603777579195571, -6.1586603331188225 }))
Declaration of WaveFunctionComponent.
#define cublasErrorCheck(ans, cause)
Matrix< T, PinnedDualAllocator< T > > OffloadPinnedMatrix
std::enable_if_t< std::is_same< T_FP, TMAT >::value > invert_transpose(const Matrix< TMAT, ALLOC1 > &amat, Matrix< TMAT, ALLOC2 > &invMat, std::complex< TREAL > &LogDet)
compute the inverse of the transpose of matrix A and its determinant value in log when T_FP and TMAT ...
Functor to provide scope for rng when making SpdMatrix for testing.