105 if (fInstances == 0) {
106 cublasCreate(&fCublasHandle);
107 CUDACHECK(cudaMalloc(& fDeviceReturn,
sizeof(AFloat)));
112 if (fNCurandStates > 10000000)
113 std::cout <<
"***** Warning - initialize a BIG curandstate for matrix " << fNRows <<
"," << fNCols <<
" nstate "
114 << fNCurandStates << std::endl;
117 cudaFree(fCurandStates);
120 InitializeCurandStates();
122 if (fNRows > fNOnes) {
127 cudaMalloc(&fOnes, fNRows *
sizeof(AFloat));
128 AFloat * buffer =
new AFloat[fNRows];
129 for (
size_t i = 0; i < fNRows; i++) {
132 cudaMemcpy(fOnes, buffer, fNRows *
sizeof(AFloat),
133 cudaMemcpyHostToDevice);