cudaError_t err = cuda_func();
check_error( err );
or if it is MAGMA function, as Simplice was saying,
magma_int_t err = magma_func();
check_error( err );
Note that we have overloaded the check, so it works baser on what is err - either
CUDA or MAGMA, etc.
To have this in effect, make sure your make.inc does have -DNDEBUG option.
We have put the check on a few places like memory allocations, streams, etc.
If you want to put checks in your own file that you are building using magma,
you can put more of these checks, e.g., after every function call.
If you want to modify your macro, probably you can also overload gpuAssert, e.g.,
inline void gpuAssert(magma_int_t code, const char *file, int line, bool abort=true)
{
check_error( code );
}
Stan