Skip to content

Commit 81fd46c

Browse files
authored
Merge pull request #1964 from CEED/jeremy/ci-compiler
ci - CUDA wants GCC 14 or earlier
2 parents b9e4153 + be03495 commit 81fd46c

4 files changed

Lines changed: 62 additions & 52 deletions

File tree

.gitlab-ci.yml

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -170,54 +170,54 @@ noether-cpu:
170170
# ----------------------------------------------------------------------------------------
171171
# Rust + CUDA
172172
# ----------------------------------------------------------------------------------------
173-
noether-rust-qfunctions:
174-
stage: test:gpu-and-float
175-
tags:
176-
- cuda
177-
interruptible: true
178-
before_script:
179-
# Environment
180-
- export COVERAGE=1 CC=gcc CXX=g++ FC=gfortran NVCC=nvcc GPU_CLANG=1
181-
- export NPROC_POOL=1
182-
- echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
183-
- echo "-------------- CC ------------------" && $CC --version
184-
- echo "-------------- CXX -----------------" && $CXX --version
185-
- echo "-------------- FC ------------------" && $FC --version
186-
- echo "-------------- NVCC ----------------" && $NVCC --version
187-
- echo "-------------- Rustc ---------------" && rustc --version
188-
- echo "-------------- Clang++ -------------" && clang++ --version
189-
- echo "-------------- GCOV ----------------" && gcov --version
190-
script:
191-
- rm -f .SUCCESS
192-
# Rustup
193-
- rustup update nightly
194-
- rustup component add rust-src --toolchain nightly
195-
- rustup component add llvm-tools --toolchain nightly
196-
# libCEED
197-
- make configure OPT='-g -O0 -fno-inline -march=native -ffp-contract=fast' CUDA_DIR=/usr/local/cuda-12.9
198-
- echo "-------------- libCEED -------------" && make info
199-
- make clean
200-
- make -k -j$NPROC_CPU -l$NPROC_CPU
201-
# -- libCEED only tests
202-
- echo "-------------- Rust QFunction tests -----"
203-
# Note: PETSC_DIR is set by default in GitLab runner env, unsetting to isolate core tests
204-
- export PETSC_DIR= PETSC_ARCH=
205-
- make -k -j$((NPROC_GPU / NPROC_POOL)) JUNIT_BATCH="rust-qfunction" junit search=rustqfunction
206-
# Report status
207-
- touch .SUCCESS
208-
after_script:
209-
- |
210-
if [ -f .SUCCESS ]; then
211-
lcov --directory . --capture --output-file coverage.info --ignore-errors source,mismatch;
212-
bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F interface;
213-
bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F gallery;
214-
bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F backends;
215-
fi
216-
artifacts:
217-
paths:
218-
- build/*.junit
219-
reports:
220-
junit: build/*.junit
173+
#noether-rust-qfunctions:
174+
# stage: test:gpu-and-float
175+
# tags:
176+
# - cuda
177+
# interruptible: true
178+
# before_script:
179+
# # Environment
180+
# - export COVERAGE=1 CC=gcc-14 CXX=g++-14 FC=gfortran-14 NVCC=nvcc GPU_CLANG=1
181+
# - export NPROC_POOL=1
182+
# - echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
183+
# - echo "-------------- CC ------------------" && $CC --version
184+
# - echo "-------------- CXX -----------------" && $CXX --version
185+
# - echo "-------------- FC ------------------" && $FC --version
186+
# - echo "-------------- NVCC ----------------" && $NVCC --version
187+
# - echo "-------------- Rustc ---------------" && rustc --version
188+
# - echo "-------------- Clang++ -------------" && clang++ --version
189+
# - echo "-------------- GCOV ----------------" && gcov-14 --version
190+
# script:
191+
# - rm -f .SUCCESS
192+
# # Rustup
193+
# - rustup update nightly
194+
# - rustup component add rust-src --toolchain nightly
195+
# - rustup component add llvm-tools --toolchain nightly
196+
# # libCEED
197+
# - make configure OPT='-g -O0 -fno-inline -march=native -ffp-contract=fast' CUDA_DIR=/usr/local/cuda-12.9
198+
# - echo "-------------- libCEED -------------" && make info
199+
# - make clean
200+
# - make -k -j$NPROC_CPU -l$NPROC_CPU
201+
# # -- libCEED only tests
202+
# - echo "-------------- Rust QFunction tests -----"
203+
# # Note: PETSC_DIR is set by default in GitLab runner env, unsetting to isolate core tests
204+
# - export PETSC_DIR= PETSC_ARCH=
205+
# - make -k -j$((NPROC_GPU / NPROC_POOL)) JUNIT_BATCH="rust-qfunction" junit search=rustqfunction
206+
# # Report status
207+
# - touch .SUCCESS
208+
# after_script:
209+
# - |
210+
# if [ -f .SUCCESS ]; then
211+
# lcov --directory . --capture --output-file coverage.info --ignore-errors source,mismatch;
212+
# bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F interface;
213+
# bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F gallery;
214+
# bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F backends;
215+
# fi
216+
# artifacts:
217+
# paths:
218+
# - build/*.junit
219+
# reports:
220+
# junit: build/*.junit
221221

222222

223223
# ----------------------------------------------------------------------------------------
@@ -230,14 +230,14 @@ noether-cuda:
230230
interruptible: true
231231
before_script:
232232
# Environment
233-
- export COVERAGE=1 CC=gcc CXX=g++ FC=gfortran NVCC=nvcc
233+
- export COVERAGE=1 CC=gcc-14 CXX=g++-14 FC=gfortran-14 NVCC=nvcc
234234
- export NPROC_POOL=4
235235
- echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
236236
- echo "-------------- CC ------------------" && $CC --version
237237
- echo "-------------- CXX -----------------" && $CXX --version
238238
- echo "-------------- FC ------------------" && $FC --version
239239
- echo "-------------- NVCC ----------------" && $NVCC --version
240-
- echo "-------------- GCOV ----------------" && gcov --version
240+
- echo "-------------- GCOV ----------------" && gcov-14 --version
241241
# ASAN
242242
- echo "-------------- ASAN ----------------"
243243
- export ASAN=1 AFLAGS="-fsanitize=address -fsanitize=leak" ASAN_OPTIONS=protect_shadow_gap=0
@@ -418,13 +418,13 @@ noether-float:
418418
interruptible: true
419419
before_script:
420420
# Environment
421-
- export COVERAGE=1 CC=gcc CXX=g++ FC= NVCC=nvcc
421+
- export COVERAGE=1 CC=gcc-14 CXX=g++-14 FC= NVCC=nvcc
422422
- export NPROC_POOL=8
423423
- echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
424424
- echo "-------------- CC ------------------" && $CC --version
425425
- echo "-------------- CXX -----------------" && $CXX --version
426426
- echo "-------------- NVCC ----------------" && $NVCC --version
427-
- echo "-------------- GCOV ----------------" && gcov --version
427+
- echo "-------------- GCOV ----------------" && gcov-14 --version
428428
# Libraries for backends
429429
# ROCm tests currently disabled
430430
# -- MAGMA from dev branch

backends/cuda-gen/ceed-cuda-gen-operator-build.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <ceed/jit-tools.h>
1414
#include <cuda_runtime.h>
1515

16+
#include <cassert>
1617
#include <iostream>
1718
#include <sstream>
1819
#include <string>
@@ -392,6 +393,9 @@ static int CeedOperatorBuildKernelRestriction_Cuda_gen(std::ostringstream &code,
392393
CeedElemRestriction_Cuda *rstr_data;
393394
CeedElemRestriction elem_rstr;
394395

396+
// Verify bounds
397+
assert(i >= 0 && i < CEED_CUDA_NUMBER_FIELDS);
398+
395399
// Get field data
396400
CeedCallBackend(CeedOperatorFieldGetElemRestriction(op_field, &elem_rstr));
397401
if (elem_rstr != CEED_ELEMRESTRICTION_NONE) {

backends/hip-gen/ceed-hip-gen-operator-build.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <ceed/gen-tools.h>
1313
#include <ceed/jit-tools.h>
1414

15+
#include <cassert>
1516
#include <cstring>
1617
#include <iostream>
1718
#include <sstream>
@@ -420,6 +421,9 @@ static int CeedOperatorBuildKernelRestriction_Hip_gen(std::ostringstream &code,
420421
CeedElemRestriction_Hip *rstr_data;
421422
CeedElemRestriction elem_rstr;
422423

424+
// Verify bounds
425+
assert(i >= 0 && i < CEED_HIP_NUMBER_FIELDS);
426+
423427
// Get field data
424428
CeedCallBackend(CeedOperatorFieldGetElemRestriction(op_field, &elem_rstr));
425429
if (elem_rstr != CEED_ELEMRESTRICTION_NONE) {

interface/ceed-qfunction.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,7 @@ int CeedQFunctionAddInput(CeedQFunction qf, const char *field_name, CeedInt size
836836

837837
CeedCall(CeedQFunctionIsImmutable(qf, &is_immutable));
838838
CeedCheck(!is_immutable, CeedQFunctionReturnCeed(qf), CEED_ERROR_MAJOR, "QFunction cannot be changed after set as immutable");
839+
CeedCheck(qf->num_input_fields < CEED_FIELD_MAX, CeedQFunctionReturnCeed(qf), CEED_ERROR_MINOR, "Can only add %d input fields", CEED_FIELD_MAX);
839840
CeedCheck(eval_mode != CEED_EVAL_WEIGHT || size == 1, CeedQFunctionReturnCeed(qf), CEED_ERROR_DIMENSION, "CEED_EVAL_WEIGHT should have size 1");
840841
for (CeedInt i = 0; i < qf->num_input_fields; i++) {
841842
CeedCheck(strcmp(field_name, qf->input_fields[i]->field_name), CeedQFunctionReturnCeed(qf), CEED_ERROR_MINOR,
@@ -878,6 +879,7 @@ int CeedQFunctionAddOutput(CeedQFunction qf, const char *field_name, CeedInt siz
878879

879880
CeedCall(CeedQFunctionIsImmutable(qf, &is_immutable));
880881
CeedCheck(!is_immutable, CeedQFunctionReturnCeed(qf), CEED_ERROR_MAJOR, "CeedQFunction cannot be changed after set as immutable");
882+
CeedCheck(qf->num_output_fields < CEED_FIELD_MAX, CeedQFunctionReturnCeed(qf), CEED_ERROR_MINOR, "Can only add %d output fields", CEED_FIELD_MAX);
881883
CeedCheck(eval_mode != CEED_EVAL_WEIGHT, CeedQFunctionReturnCeed(qf), CEED_ERROR_DIMENSION,
882884
"Cannot create CeedQFunction output with CEED_EVAL_WEIGHT");
883885
for (CeedInt i = 0; i < qf->num_input_fields; i++) {

0 commit comments

Comments
 (0)