Hi Tom,
thanks for the extremely quick review :)

On 2020/8/20 9:33 PM, Tom de Vries wrote:
I reviewed the CUDA API docs and see that CUDA_ERROR_NOT_PERMITTED is
returned
for such CUDA calls inside callback context,
Right, that's "Callbacks must not make any CUDA API calls. Attempting to
use a CUDA API will result in CUDA_ERROR_NOT_PERMITTED" at
cuStreamAddCallback.  Perhaps mention more precisely where you found this.

I've added a little bit more in the comments in the final patch pushed.

and it appears to be enough
to replace
the current check, so the new code sees if this error is returned on the
first
cuMemGetAddressRange call to determine callback context. This should now
work
for both OpenACC/OpenMP.

(Tobias, Catherine, the earlier internal patch to re-organize this
callback context
checking did not work in general, since OpenACC also uses the
.queue_callback
functionality to free the struct target_mem_desc asynchronously, so in
general we
have to ensure nvptx_free() could be used under both normal/callback
context)

This patch has been libgomp tested for x86_64-linux with nvptx
offloading without
regressions, and should be applied for mainline and GCC10. Is this okay?

Ok, thanks for fixing this.

Just pushed to master, releases/gcc-10, and devel/omp/gcc-10.

Chung-Lin

Reply via email to