Whether to annotate out pytorch error checking code?

Hello. I write a cuda extension for customed operator. After debug, is it encouraged to annotate out the code ‘’'THCudaCheck(cudaGetLastError())``` ? Is it will hurt the running time when using multi gpu ?
Thanks!

Hi,

This is a cpu check to make sure that no error happened during the previous use and so it is very fast.
If you don’t use it, you can get tricky errors as you would not detect if the previous operation failed and did not took place.

ok. Thanks for your reply.

I am not familiar with gpu. Just a curious question, will it block the asynchronization between cpu and gpu ?

I would say no, but you might want to double check in the cuda doc.