Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
neilkichler committed Jul 1, 2024
0 parents commit 3d91aa1
Show file tree
Hide file tree
Showing 25 changed files with 951 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
BasedOnStyle: WebKit
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: true
AlignConsecutiveAssignments: true
AlignTrailingComments: true
BreakBeforeBraces: Custom
BraceWrapping:
AfterEnum: true
AfterStruct: true
AfterFunction: true
AfterNamespace: true
AfterUnion: true
SplitEmptyFunction: false
FixNamespaceComments: true
PointerAlignment: Right
SpaceAfterTemplateKeyword: false
...
36 changes: 36 additions & 0 deletions .github/workflows/linux_gpu_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Linux GPU

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: [self-hosted, Linux, GPU]

steps:
- uses: actions/checkout@v4

- name: gpu info
run: nvidia-smi

- name: nvidia compiler info
run: nvcc --version

- name: setup cmake
run: cmake --preset linux-gcc-debug-sanitizer-ub-coverage

- name: build
run: cmake --build --preset debug

- name: run ctest
run: ctest --preset debug

- name: run checks
run: |
./tools/memcheck.sh ./build/tests/tests
./tools/racecheck.sh ./build/tests/tests
./tools/synccheck.sh ./build/tests/tests
38 changes: 38 additions & 0 deletions .github/workflows/windows_gpu_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Windows GPU tests

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: [self-hosted, Windows, GPU]

steps:
- uses: actions/checkout@v4

- uses: ilammy/msvc-dev-cmd@v1

- name: Display the path
run: echo ${env:PATH}

- name: test compiler
run: cl

- name: gpu info
run: nvidia-smi

- name: nvidia compiler info
run: nvcc --version

- name: setup cmake
run: cmake --preset debug

- name: build
run: cmake --build --preset debug

- name: run ctest
run: ctest --preset debug
45 changes: 45 additions & 0 deletions .github/workflows/wsl_gpu_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: WSL GPU

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: [self-hosted, Linux, WSL, GPU]

steps:
- uses: actions/checkout@v4

- name: Display the path
run: echo $PATH

- name: gpu info
run: nvidia-smi

- name: nvidia compiler info
run: nvcc --version

- name: setup cmake
run: cmake --preset linux-gcc-debug-sanitizer-ub-coverage

- name: build
run: cmake --build --preset debug

- name: run ctest
run: ctest --preset debug

- name: upload coverage reports to codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: neilkichler/cumccormick

- name: run checks
run: |
./tools/memcheck.sh ./build/tests/tests
./tools/racecheck.sh ./build/tests/tests
./tools/synccheck.sh ./build/tests/tests
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*build*
*.cache*
*.nsys-rep
*.log
*.vscode*

38 changes: 38 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
cmake_minimum_required(VERSION 3.25.2)

project(
cutangent
VERSION 0.0.1
DESCRIPTION "CUDA Tangent Subgradient library"
LANGUAGES CXX CUDA)

# Only do these if this is the main project, and not if it is included through add_subdirectory
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)

# Let's ensure -std=c++xx instead of -std=g++xx
set(CMAKE_CXX_EXTENSIONS OFF)

# Better support of clang based tools
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

# Enable position independent code
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

# Let's nicely support folders in IDEs
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

# Include example programs
add_subdirectory(examples)

# Testing only available if this is the main project.
# Note this needs to be done in the main CMakeLists
# since it calls enable_testing, which must be in the
# main CMakeLists.
include(CTest)

add_subdirectory(tests)
endif()

# Include main library
add_subdirectory(src)

Loading

0 comments on commit 3d91aa1

Please sign in to comment.