cutilSafeCall(.....) why do we need this ?


Would anyone please tell me why do we use cutilSafeCall(…) in our CUDA programs. I have seen this in many of the SDK programs. Moreover I would like to know which header file I need to include to use this function. About cutil.h I read somewhere that this is needed only when running programs from SDK is it true?

Thanks for your precious time

The cutil library is really just there to help clean up the examples in the SDK, and it’s not recommended for general use. Rather, it provides a number of macros and functions which wrap some of the most common boiler plate code, in the interest of making the SDK examples more readable.

cutilSafeCall pretty much just wraps the cuda call along with checking for errors.

It provides error checking and error code parsing on the results. But don’t use the SDK functions in your own code. That is not what they are intended for. The runtime API has error handling and error code parsing functions, use those instead.

Thank you so much guys!!
I have seen many people handling errors using cutilSafeCall(…), thats why I asked this question