CUresult vs cudaError

I’m curious as to why there are two separate enums doing what seems to be very similar things. In particular, the libArgus examples using both of these is confusing. Is there a reason for this, and if not, are there plans to remove this duplication?

CUresult is used by the CUDA driver API. cudaError is used by the CUDA runtime API. The two APIs are functionally similar, but generally speaking the CUDA driver API allows finer-grained (lower-level) control by programmers. The CUDA runtime calls into the CUDA driver API, so there is a large degree of compatibility and interoperability between the two APIs. I couldn’t quantify it, however, as I stopped using the driver API the moment the runtime API became available (that is, I acted as the guinea pig for use of the CUDA runtime when it first came into existence; late 2006 if memory serves).

When I worked in the CUDA development team, I unsuccessfully argued for the removal of the driver API. That was 12+ years ago. I guess that answers the second part of your question?

1 Like

Thanks for the detailed answer!