diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ea10cdaafdc7cd97ade4ce553d6d635fb5f05426..251e8fdcb12c929c9a903c53a5deb8b600e7d392 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,7 @@ python_test_numpy: image: python:3.9 tags: - - docker + - cloud cache: key: "python39_pip_cache_20220731" paths: @@ -12,3 +12,35 @@ python_test_numpy: - pip install numpy==1.22.4 script: - python test_numpy.py + +stages: + - build + - test + +cuda_build_on_cpu_runner: + image: gitlab-registry.mpcdf.mpg.de/mpcdf/module-image + tags: + - cloud + stage: build + cache: + key: "$CI_COMMIT_SHA" + paths: + - bin + script: + - module load cuda/11.4 + - mkdir -p bin + - nvcc -o bin/test_cuda.exe test_cuda.cu + +cuda_test_on_gpu_runner: + image: gitlab-registry.mpcdf.mpg.de/mpcdf/module-image + tags: + - cloud-gpu + stage: test + cache: + key: "$CI_COMMIT_SHA" + paths: + - bin + script: + - module load cuda/11.4 + - ./bin/test_cuda.exe + diff --git a/test_cuda.cu b/test_cuda.cu new file mode 100644 index 0000000000000000000000000000000000000000..24928f966a3070dabdee0a5b4f126bde94701dea --- /dev/null +++ b/test_cuda.cu @@ -0,0 +1,10 @@ +#include <cstdio> + +__global__ void cuda_hello(){ + printf("Hello World from GPU!\n"); +} + +int main() { + cuda_hello<<<1,1>>>(); + return 0; +}