The OpenGL API has been around for many years now. So, after many a frustrating error message like “invalid argument”, why do we still see these same “informative” messages from CUDA?
It’s logical to ask what argument was “invalid” and why? We just know that deep in the API code there’s some “if” statement checking an argument against its legal values. Is it too much ask that the argument name be reported?
Since the error system is asynchronous, why not report the name of the function called? (See macros below.) Every little hint helps dear API writers.
In general, if you are going to report an error condition, report the predicate and its arguments. (who, what, where, when)
After gaining the advantages of exception handling in C++, why do we have to devolve back to some error prone API with every new hardware technology? Having to use SAFE_CALL macros really looks pretty doesn’t it? Yes, I understand “C” as an LCD, but it’s costing me time and frustration. OpenCL looks even worse.
#define EXCEPTION_SCOPE PRETTY_FUNCTION
#if _MSC_VER >= 1300
#define EXCEPTION_SCOPE FUNCSIG
#define EXCEPTION_SCOPE “unknown”