Initiall commit

This commit is contained in:
Martin committed 2024-11-14 12:05:54 +01:00
commit 34971311cb
7 files changed
+296

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
#include <iostream>
#include <cuda_runtime.h>
#define cudaCheckError() { \
cudaError_t e = cudaGetLastError(); \
if (e != cudaSuccess) { \
printf("CUDA error %s:%d: %s\n", __FILE__, __LINE__, \
cudaGetErrorString(e)); \
exit(EXIT_FAILURE); \
} \
}
__global__ void hello_from_gpu() {
printf("Hello from GPU!\n");
}
int main() {
hello_from_gpu<<<1, 1>>>();
cudaCheckError();
cudaDeviceSynchronize();
cudaCheckError();
// Reset device
cudaDeviceReset();
return 0;
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.