Displaying 1 result from an estimated 1 matches for "cublascall".
2016 May 14
2
R external pointer and GPU memory leak problem
...? ? ##here is the step which causes the memory leak
cudacall(cudaMalloc((void**)&x, *lenth * sizeof(double)));
//protect the R external pointer from finalizer
SEXP ext = PROTECT(R_MakeExternalPtr(x, R_NilValue, R_NilValue));
R_RegisterCFinalizerEx(ext, _finalizer, TRUE);
?
//copying CPU to GPU
cublascall(cublasSetVector(*lenth, sizeof(double), temp, 1,?
R_ExternalPtrAddr(ext), 1)); ? ?
? ? ? ?UNPROTECT(2);
return ext;
}
here is my finalized for my create function,
/*
define finalizer for R external pointer
input is R external pointer, function will finalize the pointer?
when it is not in use.
*...