I just copied a function from normal CHECK(call) function in CUDA and run with nvcc_plugin in Google Colab
#define CHECK(call)
{
    const cudaError_t error = call;
    if (error != cudaSuccess)
    {
        printf("Error: %s:%d, ", __FILE__, __LINE__);
        printf("code:%d, reason: %s\n", error, cudaGetErrorString(error));
        exit(1);
    }
}
But it raises an error
/tmp/tmpvc2kvnuh/9c0f913f-6a2c-420d-9e3a-94c6e3123f7f.cu(9): error: expected a declaration 
How do I do this?
 
     
    