-
Notifications
You must be signed in to change notification settings - Fork 0
/
CudaFunctions_Base.cpp
34 lines (27 loc) · 956 Bytes
/
CudaFunctions_Base.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "CudaFunctions_Base.h"
CudaFunctions_Base::CudaFunctions_Base()
{
//printf("\nCreating CudaFunctions...");
checkCudaErrors(cusolverDnCreate(&cusolverHandle));
checkCudaErrors(cublasCreate(&cublasHandle));
checkCudaErrors(cudaEventCreate(&start));
checkCudaErrors(cudaEventCreate(&stop));
}
CudaFunctions_Base::~CudaFunctions_Base()
{
printf("\nDestroying CudaFunctions...");
// Destroying library handles.
if (cusolverHandle) { checkCudaErrors(cusolverDnDestroy(cusolverHandle)); }
if (cublasHandle) { checkCudaErrors(cublasDestroy(cublasHandle)); }
checkCudaErrors(cudaEventDestroy(start));
checkCudaErrors(cudaEventDestroy(stop));
}
void CudaFunctions_Base::setGridSize(unsigned int grid_size) {
this->grid_size = grid_size;
}
void CudaFunctions_Base::setGridData(GridDataSet grid_data) {
this->dataset = grid_data;
}
void CudaFunctions_Base::setSEresults(StateEstimationResults results) {
this->SEstate_vector = results;
}