21 #include <cuda_runtime_api.h> 22 #include <cuda_runtime.h> 23 #include <cublas_v2.h> 24 #include <device_types.h> 61 int_fast8_t *refWFSinit;
104 pthread_t *threadarray;
105 int_fast8_t NBstreams;
106 cudaStream_t *stream;
107 cublasHandle_t *handle;
110 uint_fast32_t *Nsize;
111 uint_fast32_t *Noffset;
115 int_fast8_t orientation;
159 int_fast8_t
GPUcomp_test(
long NBact,
long NBmodes,
long WFSsize,
long GPUcnt);
183 void matrixMulCPU(
float *cMat,
float *wfsVec,
float *dmVec,
int M,
int N);
193 int GPU_loop_MultMat_setup(
int index,
const char *IDcontrM_name,
const char *IDwfsim_name,
const char *IDoutdmmodes_name,
long NBGPUs,
int *GPUdevice,
int orientation,
int USEsem,
int initWFSref,
long loopnb);
196 int GPU_loop_MultMat_execute(
int index, int_fast8_t *status, int_fast8_t *GPUstatus,
float alpha,
float beta,
int timing,
int TimerOffsetIndex);
246 int CUDACOMP_magma_compute_SVDpseudoInverse(
const char *ID_Rmatrix_name,
const char *ID_Cmatrix_name,
double SVDeps,
long MaxNBmodes,
const char *ID_VTmatrix_name,
int LOOPmode,
int PSINV_MODE,
double qdwh_s,
float qdwh_tol,
int testmode);
250 int GPU_SVD_computeControlMatrix(
int device,
const char *ID_Rmatrix_name,
const char *ID_Cmatrix_name,
double SVDeps,
const char *ID_VTmatrix_name);
268 int CUDACOMP_Coeff2Map_Loop(
const char *IDmodes_name,
const char *IDcoeff_name,
int GPUindex,
const char *IDoutmap_name,
int offsetmode,
const char *IDoffset_name);
296 int CUDACOMP_extractModesLoop(
const char *in_stream,
const char *intot_stream,
const char *IDmodes_name,
const char *IDrefin_name,
const char *IDrefout_name,
const char *IDmodes_val_name,
int GPUindex,
int PROCESS,
int TRACEMODE,
int MODENORM,
int insem,
int axmode,
long twait);
int_fast8_t CUDACOMP_init()
Initialize CUDA and MAGMA.
Definition: cudacomp.c:567
struct timespec * t3
Definition: cudacomp.h:43
struct timespec * t4
Definition: cudacomp.h:44
void matrixMulCPU(float *cMat, float *wfsVec, float *dmVec, int M, int N)
CPU-based matrix vector multiplication.
Definition: cudacomp.c:844
int CUDACOMP_Coeff2Map_Loop(const char *IDmodes_name, const char *IDcoeff_name, int GPUindex, const char *IDoutmap_name, int offsetmode, const char *IDoffset_name)
Definition: cudacomp.c:4836
int GPUloadCmat(int index)
Definition: cudacomp.c:1228
int_fast8_t GPUcomp_test(long NBact, long NBmodes, long WFSsize, long GPUcnt)
Definition: cudacomp.c:680
int CUDACOMP_magma_compute_SVDpseudoInverse_SVD(const char *ID_Rmatrix_name, const char *ID_Cmatrix_name, double SVDeps, long MaxNBmodes, const char *ID_VTmatrix_name)
Compute pseudoinverse using MAGMA-based SVD.
Definition: cudacomp.c:2448
int CUDACOMP_printGPUMATMULTCONF(int index)
Definition: cudacomp.c:600
long CUDACOMP_MatMatMult_testPseudoInverse(const char *IDmatA_name, const char *IDmatAinv_name, const char *IDmatOut_name)
Test pseudo inverse.
Definition: cudacomp.c:2313
void __attribute__((constructor)) libinit_cudacomp()
Definition: 00CORE.c:87
void * compute_function(void *ptr)
Definition: cudacomp.c:905
struct timespec * t5
Definition: cudacomp.h:45
struct timespec * t1
Definition: cudacomp.h:41
Definition: cudacomp.h:32
int GPU_SVD_computeControlMatrix(int device, const char *ID_Rmatrix_name, const char *ID_Cmatrix_name, double SVDeps, const char *ID_VTmatrix_name)
Definition: cudacomp.c:4404
int GPU_loop_MultMat_free(int index)
Definition: cudacomp.c:2178
This structure holds the GPU computation setup for matrix multiplication.
Definition: cudacomp.h:49
struct timespec * t2
Definition: cudacomp.h:42
int GPU_loop_MultMat_execute(int index, int_fast8_t *status, int_fast8_t *GPUstatus, float alpha, float beta, int timing, int TimerOffsetIndex)
Definition: cudacomp.c:1933
int CUDACOMP_extractModesLoop(const char *in_stream, const char *intot_stream, const char *IDmodes_name, const char *IDrefin_name, const char *IDrefout_name, const char *IDmodes_val_name, int GPUindex, int PROCESS, int TRACEMODE, int MODENORM, int insem, int axmode, long twait)
extract mode coefficients from data stream
Definition: cudacomp.c:5159
int GPU_loop_MultMat_setup(int index, const char *IDcontrM_name, const char *IDwfsim_name, const char *IDoutdmmodes_name, long NBGPUs, int *GPUdevice, int orientation, int USEsem, int initWFSref, long loopnb)
Setup memory and process for GPU-based matrix-vector multiply.
Definition: cudacomp.c:1286
int_fast8_t init_cudacomp()
Initialize cudacomp module and command line interface.
Definition: cudacomp.c:429
struct timespec * t0
Definition: cudacomp.h:40
int CUDACOMP_magma_compute_SVDpseudoInverse(const char *ID_Rmatrix_name, const char *ID_Cmatrix_name, double SVDeps, long MaxNBmodes, const char *ID_VTmatrix_name, int LOOPmode, int PSINV_MODE, double qdwh_s, float qdwh_tol)
Computes matrix pseudo-inverse (AT A)^-1 AT, using eigenvector/eigenvalue decomposition of AT A...