To the best of my knowledge, no you cannot. It is important to keep in mind that
cudaGetLastError()
returns the status of an earlier runtime API call, but not necessarily the last one. An asynchronous call can report an error during operation, after it has already returnedcudaSuccess
, in which case its error will be returned by the next API function which returns a status. Parsing the results of his can get particularly complex with concurrent operations in streams.- There is at least one operation (kernel launches themselves) which don't have an explicit runtime API call which can be related to any programmer visible source, even though they call a series of documented and private API calls behind the curtains.
It isn't clear to me how either case could be cleanly handled in a way that would give meaningful additional information, especially when some classes of device runtime errors can kill the active context, which looses a lot of state anyway....