From 3948ece16437d80391cacc50bebce1e8b8511a61 Mon Sep 17 00:00:00 2001 From: Evan Nemerson Date: Thu, 12 Sep 2024 21:09:24 -0400 Subject: [PATCH] ci: add GitHub Action for testing NVidia C/C++ compilers --- .github/workflows/ci.yml | 46 ++++++++++++++++++++++++++++++++++++++++ test/Makefile | 6 ++++++ 2 files changed, 52 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9183b84..e5e3a5c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,3 +22,49 @@ jobs: run: make maintainer-clean && make generate ECHO="$(which echo)" - name: Check for changes run: git diff --exit-code + + nvhpc: + runs-on: ubuntu-latest + strategy: + matrix: + version: + # For available versions, see https://developer.download.nvidia.com/hpc-sdk/ubuntu/amd64/Packages + - "20.11" + # - "21.1" ## BROKEN. File size mismatch. + # - "21.2" + # - "21.3" + # - "21.5" + # - "21.7" + # - "21.9" + # - "21.11" + # - "22.1" + # - "22.2" + # - "22.3" + # - "22.5" + # - "22.7" + # - "22.9" + # - "22.11" + # - "23.1" + # - "23.3" + # - "23.5" + # - "23.7" + # - "23.9" + # - "23.11" + # - "24.1" + # - "24.3" + - "24.7" + steps: + - uses: actions/checkout@v4 + - name: Free some disk space + run: sudo rm -rf /usr/local/lib/android /usr/local/.ghcup/ghc + - name: Install NVidia HPC SDK + run: | + curl https://developer.download.nvidia.com/hpc-sdk/ubuntu/DEB-GPG-KEY-NVIDIA-HPC-SDK | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg + echo 'deb [signed-by=/usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg] https://developer.download.nvidia.com/hpc-sdk/ubuntu/amd64 /' | sudo tee /etc/apt/sources.list.d/nvhpc.list + sudo apt-get update -y + sudo apt-get install -y nvhpc-$(echo "${{ matrix.version }}" | tr '.' '-') + - name: Compile + env: + CC: /opt/nvidia/hpc_sdk/Linux_x86_64/"${{ matrix.version }}"/compilers/bin/nvcc + working-directory: test + run: make diff --git a/test/Makefile b/test/Makefile index ae4a1c2..40aa4d1 100644 --- a/test/Makefile +++ b/test/Makefile @@ -15,6 +15,12 @@ else ifeq ($(notdir $(CC)), pgcc) else ifeq ($(notdir $(CC)), pgc++) CFLAGS ?= --display_error_number -Minform=inform -Werror C_OUTPUT_FILE := -o +else ifeq ($(notdir $(CC)), nvcc) + CFLAGS ?= --Werror all-warnings + C_OUTPUT_FILE := -o +else ifeq ($(notdir $(CC)), nvc++) + CFLAGS ?= --Werror all-warnings + C_OUTPUT_FILE := -o else ifeq ($(notdir $(CC)), xlc) CFLAGS ?= $(CLANG_C_FLAGS) C_OUTPUT_FILE := -o