Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ doc/sphinx/build/
# Example docs automatically copied from source tree
doc/sphinx/source/examples/

# Clang GPU temp files
temp/*

# Output files, videos, and compressed archives should not be added accidentally
*.avi
*.bin
Expand Down
55 changes: 55 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,61 @@ noether-cpu:
# - touch .SUCCESS


# ----------------------------------------------------------------------------------------
# Rust + CUDA
# ----------------------------------------------------------------------------------------
noether-rust-qfunctions:
stage: test:gpu-and-float
tags:
- cuda
interruptible: true
before_script:
# Environment
- export COVERAGE=1 CC=gcc CXX=g++ FC=gfortran NVCC=nvcc GPU_CLANG=1
- export NPROC_POOL=1
- echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
- echo "-------------- CC ------------------" && $CC --version
- echo "-------------- CXX -----------------" && $CXX --version
- echo "-------------- FC ------------------" && $FC --version
- echo "-------------- NVCC ----------------" && $NVCC --version
- echo "-------------- Rustc ---------------" && rustc --version
- echo "-------------- Clang++ -------------" && clang++ --version
- echo "-------------- GCOV ----------------" && gcov --version
script:
- rm -f .SUCCESS
# Rustup
- rustup update nightly
- rustup component add rust-src --toolchain nightly
- rustup component add llvm-tools --toolchain nightly
# libCEED
- make configure OPT='-O -march=native -ffp-contract=fast' CUDA_DIR=/usr/local/cuda-12.9
- echo "-------------- libCEED -------------" && make info
- make clean
- make -k -j$NPROC_CPU -l$NPROC_CPU
# -- libCEED only tests
- echo "-------------- Rust QFunction tests -----"
# Note: PETSC_DIR is set by default in GitLab runner env, unsetting to isolate core tests
- export PETSC_DIR= PETSC_ARCH=
- make -k -j$((NPROC_GPU / NPROC_POOL)) JUNIT_BATCH="rust-qfunction" junit search=rustqfunction
# Report status
- touch .SUCCESS
after_script:
- |
if [ -f .SUCCESS ]; then
lcov --directory . --capture --output-file coverage.info --ignore-errors source,mismatch;
bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F interface;
bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F gallery;
bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F backends;
bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F tests;
bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F examples;
fi
artifacts:
paths:
- build/*.junit
reports:
junit: build/*.junit


# ----------------------------------------------------------------------------------------
# CUDA backends
# ----------------------------------------------------------------------------------------
Expand Down
19 changes: 10 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
[workspace]
members = [
"rust/libceed",
"rust/libceed-sys",
"examples/rust/ex1-volume",
"examples/rust/ex1-volume-vector",
"examples/rust/ex2-surface",
"examples/rust/ex2-surface-vector",
"examples/rust/ex3-volume",
"examples/rust/ex3-volume-vector",
"examples/rust/mesh",
"rust/libceed",
"rust/libceed-sys",
"examples/rust/ex1-volume",
"examples/rust/ex1-volume-vector",
"examples/rust/ex2-surface",
"examples/rust/ex2-surface-vector",
"examples/rust/ex3-volume",
"examples/rust/ex3-volume-vector",
"examples/rust/mesh",
]
exclude = ["examples/rust-qfunctions/ex1-volume-rs"]
23 changes: 18 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,10 @@ mfemexamples := $(mfemexamples.cpp:examples/mfem/%.cpp=$(OBJDIR)/mfem-%)
# Nek5K Examples
nekexamples := $(OBJDIR)/nek-bps

# Rust QFunction Examples
rustqfunctions.c := $(sort $(wildcard examples/rust-qfunctions/*.c))
rustqfunctionsexamples := $(rustqfunctions.c:examples/rust-qfunctions/%.c=$(OBJDIR)/rustqfunctions-%)

# PETSc Examples
petscexamples.c := $(wildcard examples/petsc/*.c)
petscexamples := $(petscexamples.c:examples/petsc/%.c=$(OBJDIR)/petsc-%)
Expand Down Expand Up @@ -733,6 +737,11 @@ $(OBJDIR)/nek-bps : examples/nek/bps/bps.usr examples/nek/nek-examples.sh $(libc
mv examples/nek/build/bps $(OBJDIR)/bps
cp examples/nek/nek-examples.sh $(OBJDIR)/nek-bps

# Rust QFunctions
$(OBJDIR)/rustqfunctions-% : examples/rust-qfunctions/%.c $(libceed) | $$(@D)/.DIR
+$(MAKE) -C examples/rust-qfunctions CEED_DIR=`pwd`
cp examples/rust-qfunctions/$* $@

# PETSc
# Several executables have common utilities, but we can't build the utilities
# from separate submake invocations because they'll compete with each
Expand Down Expand Up @@ -763,19 +772,22 @@ $(OBJDIR)/solids-% : examples/solids/%.c examples/solids/%.h \
PETSC_DIR="$(abspath $(PETSC_DIR))" OPT="$(OPT)" $*
cp examples/solids/$* $@

examples : $(allexamples)
ceedexamples : $(examples)
nekexamples : $(nekexamples)
mfemexamples : $(mfemexamples)
examples : $(allexamples)
ceedexamples : $(examples)
nekexamples : $(nekexamples)
mfemexamples : $(mfemexamples)
petscexamples : $(petscexamples)

rustqfunctionsexamples : $(rustqfunctionsexamples)

external_examples := \
$(if $(MFEM_DIR),$(mfemexamples)) \
$(if $(PETSC_DIR),$(petscexamples)) \
$(if $(NEK5K_DIR),$(nekexamples)) \
$(if $(DEAL_II_DIR),$(dealiiexamples)) \
$(if $(PETSC_DIR),$(fluidsexamples)) \
$(if $(PETSC_DIR),$(solidsexamples))
$(if $(PETSC_DIR),$(solidsexamples)) \
$(if $(or $(RUST_QF),$(GPU_CLANG)),$(rustqfunctionsexamples))

allexamples = $(examples) $(external_examples)

Expand Down Expand Up @@ -904,6 +916,7 @@ cln clean :
$(call quiet,MAKE) -C examples clean NEK5K_DIR="$(abspath $(NEK5K_DIR))"
$(call quiet,MAKE) -C python/tests clean
$(RM) benchmarks/*output.txt
$(RM) -rf temp

distclean : clean
$(RM) -r doc/html doc/sphinx/build $(CONFIG)
Expand Down
2 changes: 2 additions & 0 deletions backends/cuda/ceed-cuda-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ static const char *cublasGetErrorName(cublasStatus_t error) {

typedef struct {
int device_id;
bool use_llvm_version;
int llvm_version;
cublasHandle_t cublas_handle;
struct cudaDeviceProp device_prop;
} Ceed_Cuda;
Expand Down
Loading