Cuda compiler errors not as good as VS2017 compiler errors

In lots of template code the compiler errors from .cu files are not very good. Usually you get a one line error which doesn’t help much to diagnose the root of the problem - ie say a template error which doesn’t helpfully tell you the types involved.

Copying the same code from a .cu file to a .cpp file is a work around in some cases and the error output is much better, with much more details.

It would be fabulous if nVidia could improve this situation.

Would you mind providing some relevant code snippets that demonstrate what you’re talking about?

I don’t quite have the time to test a simple example I can share right now - but will try to after current rush is over.

But it happens a lot if you use templated trait like classes with access to things nested inside them ie:

template
struct Traits
{
enum { SomeTrait = 6};
typedef T SomeType;
};

And where that kind of construct is used in other levels of templated functions and classes, and there is a program error in that type of code. When there is an error it will get the last in the cascade of side effects from that error but not tell you the types involved or the instance that realises this error. Giving just an ambiguous single line error. Making it time consuming to track down.

The normal VS2017 compiler will give multiple lines of helpful errors. Telling you what types are involved and other notes that are most helpful.

I would suggest using specific examples when filing enhancement requests (RFEs) with NVIDIA. While not all enhancement requests turn into product features, it is highly unlikely that user-desired features appear without an RFE. RFEs, like bug reports, need to be recorded, collated, and prioritized to be actionable on the engineering side of things.

RFEs can be filed using the bug reporting form that is linked from the registered developer website. Simply prefix the synopsis with “RFE:” to mark it as enhancement request.

I only ask because I use templates as well in my own CUDA with VS 2017 and I haven’t quite noticed the same levels of issues. One thing I’d suggest is maybe improving your SFINAE mechanisms and using more “enable_if” and “static_assert”