Recitation 6: Monte-Carlo Integration - Caltech
Recitation 6: Monte-Carlo Integration - Caltech
Recitation 6: Monte-Carlo Integration - Caltech
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
CURAND Device API<br />
●<br />
Now, RNG states are stored entirely on GPU<br />
▸ Still need to allocate space<br />
▸ So, on the host we need to do:<br />
curandState* devStates;<br />
cudaMalloc(&devStates, numThreads *<br />
sizeof(curandState));<br />
kernel_func>(devStates);<br />
cudaFree(devStates);<br />
// don’t free devStates if you want to use<br />
// them again in another kernel