Skip to content

Instantly share code, notes, and snippets.

@DWarez
DWarez / hello_world.cu
Created May 20, 2024 09:55
A simple CUDA Hello World
#include <stdio.h>
// Macro for checking CUDA errors
#define CUDA_CHECK_ERROR(err) \
if (err != cudaSuccess) { \
printf("CUDA err: %s at line %d\n", cudaGetErrorString(err), __LINE__); \
exit(EXIT_FAILURE); \
}
// Kernel definition