QMCPACK
matrix_update_helper.hpp
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////////////
2 // This file is distributed under the University of Illinois/NCSA Open Source License.
3 // See LICENSE file in top directory for details.
4 //
5 // Copyright (c) 2024 QMCPACK developers.
6 //
7 // File developed by: Ye Luo, yeluo@anl.gov, Argonne National Laboratory
8 //
9 // File created by: Ye Luo, yeluo@anl.gov, Argonne National Laboratory
10 //////////////////////////////////////////////////////////////////////////////////////
11 
12 
13 #ifndef CUDA_MATRIX_UPDATE_HELPER_H
14 #define CUDA_MATRIX_UPDATE_HELPER_H
15 
16 #include "config.h"
17 #ifndef QMC_CUDA2HIP
18 #include <cuda_runtime_api.h>
19 #else
20 #include <hip/hip_runtime.h>
21 #include "ROCm/cuda2hip.h"
22 #endif
23 
24 namespace qmcplusplus
25 {
26 /** interface to cuBLAS_inhouse calls for different data types S/C/D/Z
27  */
28 namespace CUDA
29 {
30 /** helper function for SM-1 Fahy update
31  * subtract one in temp
32  * copy Ainv changed row to rcopy
33  * save phi G and L as accept.
34  */
35 template<typename T>
37  const int rowchanged,
38  const int n,
39  const T* const Ainv[],
40  const int lda,
41  T* const temp[],
42  T* const rcopy[],
43  const T* const phi_vgl_in[],
44  const size_t phi_vgl_stride,
45  T* const dphi_out[],
46  T* const d2phi_out[],
47  const int batch_count);
48 
49 /** calculate gradients
50  */
51 template<typename T>
53  const int n,
54  const T* const Ainvrow[],
55  const T* const dpsiMrow[],
56  T* const grads_now,
57  const int batch_count);
58 
59 template<typename T>
61  int* const delay_list[],
62  const int rowchanged,
63  const int delay_count,
64  T* const binv[],
65  const int binv_lda,
66  const T* const ratio_inv,
67  const T* const phi_vgl_in[],
68  const size_t phi_vgl_stride,
69  T* const phi_out[],
70  T* const dphi_out[],
71  T* const d2phi_out[],
72  const int norb,
73  const int n_accepted,
74  const int batch_count);
75 
76 template<typename T>
78  const int* const delay_list[],
79  const int delay_count,
80  T* const tempMat[],
81  const int lda,
82  const int batch_count);
83 
85  int* const delay_list[],
86  const int delay_count,
87  const int batch_count);
88 
89 } // namespace CUDA
90 } // namespace qmcplusplus
91 #endif
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
cudaError_t print_delay_list_batched(cudaStream_t hstream, int *const delay_list[], const int delay_count, const int batch_count)
cudaError_t add_delay_list_save_sigma_VGL_batched(cudaStream_t hstream, int *const delay_list[], const int rowchanged, const int delay_count, T *const binv[], const int binv_lda, const T *const ratio_inv, const T *const phi_vgl_in[], const size_t phi_vgl_stride, T *const phi_out[], T *const dphi_out[], T *const d2phi_out[], const int norb, const int n_accepted, const int batch_count)
cudaError_t calcGradients_batched(cudaStream_t hstream, const int n, const T *const Ainvrow[], const T *const dpsiMrow[], T *const grads_now, const int batch_count)
calculate gradients
#define cudaError_t
Definition: cuda2hip.h:89
#define cudaStream_t
Definition: cuda2hip.h:149
cudaError_t applyW_batched(cudaStream_t hstream, const int *const delay_list[], const int delay_count, T *const tempMat[], const int lda, const int batch_count)
cudaError_t copyAinvRow_saveGL_batched(cudaStream_t hstream, const int rowchanged, const int n, const T *const Ainv[], const int lda, T *const temp[], T *const rcopy[], const T *const phi_vgl_in[], const size_t phi_vgl_stride, T *const dphi_out[], T *const d2phi_out[], const int batch_count)
helper function for SM-1 Fahy update subtract one in temp copy Ainv changed row to rcopy save phi G a...