Skip to content

Commit be983b5

Browse files
author
shijiashuai
committed
build: align CUDA build outputs and CI checks
Unify Makefile output paths with the CMake layout, broaden default CUDA architecture coverage, and restore a containerized CUDA compile-only CI job. This keeps local build commands consistent with docs while adding a realistic non-GPU validation step in CI.
1 parent 5d0d322 commit be983b5

3 files changed

Lines changed: 29 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,26 @@ jobs:
2929
check-path: '.'
3030
exclude-regex: '(^|/)(build|third_party|external|vendor|\.git)(/|$)'
3131
fallback-style: 'LLVM'
32+
33+
cuda-build:
34+
name: CUDA Build (compile only)
35+
runs-on: ubuntu-latest
36+
container:
37+
image: nvidia/cuda:12.4.1-devel-ubuntu22.04
38+
steps:
39+
- name: Install build tools
40+
run: apt-get update && apt-get install -y cmake git build-essential
41+
42+
- name: Checkout
43+
uses: actions/checkout@v4
44+
45+
- name: Configure CMake
46+
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF
47+
48+
- name: Build benchmark target
49+
run: cmake --build build --target sgemm_benchmark -j2
50+
51+
- name: Document runtime limitation
52+
run: |
53+
echo "This workflow validates CUDA compilation in a containerized toolkit environment."
54+
echo "GPU runtime tests still require a CUDA-capable local machine or dedicated GPU runner."

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
2020
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.24")
2121
set(CMAKE_CUDA_ARCHITECTURES native)
2222
else()
23-
set(CMAKE_CUDA_ARCHITECTURES 75 80 86 89)
23+
set(CMAKE_CUDA_ARCHITECTURES 70 75 80 86 89 90)
2424
endif()
2525
endif()
2626

Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ MAIN_SRC = $(SRC_DIR)/main.cu
2727
TEST_SRC = $(TEST_DIR)/test_sgemm.cu
2828

2929
# Targets
30-
MAIN_TARGET = $(BUILD_DIR)/sgemm_benchmark
31-
TEST_TARGET = $(BUILD_DIR)/test_sgemm
30+
BIN_DIR = $(BUILD_DIR)/bin
31+
MAIN_TARGET = $(BIN_DIR)/sgemm_benchmark
32+
TEST_TARGET = $(BIN_DIR)/test_sgemm
3233

3334
# Header files (for dependency tracking)
3435
HEADERS = $(wildcard $(KERNEL_DIR)/*.cuh) $(wildcard $(UTILS_DIR)/*.cuh)
@@ -39,6 +40,7 @@ all: dirs $(MAIN_TARGET)
3940

4041
dirs:
4142
@mkdir -p $(BUILD_DIR)
43+
@mkdir -p $(BIN_DIR)
4244
@mkdir -p $(KERNEL_DIR)
4345
@mkdir -p $(UTILS_DIR)
4446
@mkdir -p $(TEST_DIR)
@@ -79,7 +81,7 @@ help:
7981
@echo " profile - Build with profiling info"
8082
@echo ""
8183
@echo "Variables:"
82-
@echo " GPU_ARCH - GPU architecture (default: sm_70)"
84+
@echo " GPU_ARCH - GPU architecture (default: sm_86)"
8385
@echo ""
8486
@echo "Example:"
8587
@echo " make GPU_ARCH=sm_80 benchmark"

0 commit comments

Comments
 (0)