Guest User

Untitled

a guest
Oct 17th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #define checkAlloc(ans) checkPointer((ans), __FILE__, __LINE__);
  2.  
  3. SomeObject* myObj = checkAlloc(new SomeObject());
  4.  
  5. inline __device__ SomeObject* checkPointer(SomeObject* pointer, char *file, int line)
  6. {
  7. if (pointer == nullptr)
  8. {
  9. // do error logging
  10. }
  11. return pointer;
  12. }
  13.  
  14. inline __device__ auto checkPointer(auto pointer, char *file, int line)
Add Comment
Please, Sign In to add comment