Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define checkAlloc(ans) checkPointer((ans), __FILE__, __LINE__);
- SomeObject* myObj = checkAlloc(new SomeObject());
- inline __device__ SomeObject* checkPointer(SomeObject* pointer, char *file, int line)
- {
- if (pointer == nullptr)
- {
- // do error logging
- }
- return pointer;
- }
- inline __device__ auto checkPointer(auto pointer, char *file, int line)
Add Comment
Please, Sign In to add comment