Skip to content
Snippets Groups Projects
Commit 1240fe63 authored by Klaus Reuter's avatar Klaus Reuter
Browse files

add more cuda logic

parent ebcaef73
No related branches found
No related tags found
No related merge requests found
Pipeline #138145 failed
...@@ -30,6 +30,7 @@ cuda_build_on_cpu_runner: ...@@ -30,6 +30,7 @@ cuda_build_on_cpu_runner:
- module load cuda/11.4 - module load cuda/11.4
- mkdir -p bin - mkdir -p bin
- nvcc -o bin/test_cuda.exe test_cuda.cu - nvcc -o bin/test_cuda.exe test_cuda.cu
- bin/test_cuda.exe
cuda_test_on_gpu_runner: cuda_test_on_gpu_runner:
image: gitlab-registry.mpcdf.mpg.de/mpcdf/module-image image: gitlab-registry.mpcdf.mpg.de/mpcdf/module-image
...@@ -42,5 +43,5 @@ cuda_test_on_gpu_runner: ...@@ -42,5 +43,5 @@ cuda_test_on_gpu_runner:
- bin - bin
script: script:
- module load cuda/11.4 - module load cuda/11.4
- ./bin/test_cuda.exe - bin/test_cuda.exe
#include <cstdio> #include <cstdio>
__global__ void cuda_hello(){ __global__ void cuda_hello(){
printf("Hello World from GPU!\n"); printf("Hello World from GPU!\n");
} }
int main() { int main() {
cuda_hello<<<1,1>>>(); cuda_hello<<<1,1>>>();
return 0; cudaDeviceSynchronize();
return (cudaSuccess != cudaGetLastError());
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment