cuda - Asynchrony and memory ownership in CUBLAS -


The cube is an asynchronous library. What are the requirements for memory ownership for the criteria that CUBLAS has passed?

It seems that the asynchronous call to matrix driven by the cubal should not be completed - but what about scalar parameters?

For example, the following code is sound:

  // ... float alpha = compute_alpha (); CublasSaxpy (handle, n, // Find an automatic variable! & Amp; alpha, // and assign it to an asynchronous function! X, incx, y, incy); Return;  

I'm worried that the saxcai actually starts until the alpha can not exist: if we have the function before the launch of SXP Returns, and alpha is overwritten with other items for stack space, it is possible that a suspicious wrong answer (or even crash) can also be found.

I do not need to copy my scalar parameters to any type of heap memory and to ensure that they do not get destroyed on the cubes after asynchronous calls - the tracking will be complicated.

>

It would be great if the CUBAAT has clearly guaranteed that the scalar parameter does not need to live after calling Cubla, but the documentation does not seem very super clear about it.

If indicator mode is HOST, alpha and beta can be on stack or allocated on a heap is. Below the kernel (A), the price of alpha and beta will be launched. So if they were allocated on the heap, they could be released even after the return of the call (though the kernel launch is asynchronous)

If indicator DEVICE, alpha and beta are necessary then the device and their value Should not be modified until the kernel is made. Note that since cudaFree makes a mistake of cudaDeviceSynchronize (), cudaFree alpha / beta can still be said after the call but it defeats the purpose of the DEVICE pointer mode in this case.


Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -