From b1986d140945f6f7736ab735d1f107346c98e505 Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Tue, 13 Oct 2015 12:13:02 +0200 Subject: [PATCH] Added cuda template --- vim/.vim/templates/cuda | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 vim/.vim/templates/cuda diff --git a/vim/.vim/templates/cuda b/vim/.vim/templates/cuda new file mode 100644 index 0000000..dd7fddf --- /dev/null +++ b/vim/.vim/templates/cuda @@ -0,0 +1,16 @@ +#define ERRCHECK(err) (HandleError( err , __FILE__, __LINE__)) + +static void HandleError( cudaError_t err, const char *file, int line ) { + if(err != cudaSuccess) { + fprintf(stderr, "Cuda Error: %s in %s at line %d\n", + cudaGetErrorString( err ), + file, + line ); + exit( EXIT_FAILURE ); + } +} + +int main( int argc, char *argv[] ) { + + return 0; +}