Skip to content
Draft
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
12 changes: 11 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
os: [windows-latest, ubuntu-latest, macos-latest]
c_compiler: [gcc, clang, cl]
build_type: [Debug, Release]
cxx_standard: ["20"]
Expand All @@ -37,6 +37,10 @@ jobs:
c_compiler: clang
- os: ubuntu-latest
c_compiler: cl
- os: macos-latest
c_compiler: gcc
- os: macos-latest
c_compiler: cl

name: ${{ matrix.c_compiler }} - ${{ matrix.build_type }} - ${{ matrix.os }} - c++${{ matrix.cxx_standard }}

Expand All @@ -47,9 +51,15 @@ jobs:
- uses: seanmiddleditch/gha-setup-ninja@v3
- uses: seanmiddleditch/gha-setup-vsdevenv@master
- name: Install LLVM and Clang
if: ${{ matrix.os != 'macos-latest' }}
uses: KyleMayes/install-llvm-action@v1
with:
version: "16.0"
- name: Install LLVM and Clang
if: ${{ matrix.os == 'macos-latest' }}
uses: KyleMayes/install-llvm-action@v1
with:
version: "15.0"

- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/build
Expand Down
4 changes: 2 additions & 2 deletions 03_01_data_oriented_design/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
if (${CPP_COURSE_BUILD_SLIDES})
add_marp_slides(03_01_data_oriented_design data_oriented_design.md)
add_marp_slides(03_01_data_oriented_design data_oriented_tips.md)
add_marp_slides(03_01_data_oriented_design_tips data_oriented_tips.md)
endif()


Expand All @@ -21,4 +21,4 @@ add_executable(03_01_cache_false_sharing
code/cache_false_sharing.cpp
)

add_subdirectory(code/nbody)
add_subdirectory(code/nbody)
11 changes: 7 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.25)
cmake_minimum_required(VERSION 3.24)

project(cpp_course_2023 CXX)

Expand Down Expand Up @@ -28,8 +28,11 @@ endif()

include(CTest)

if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
set(CPP_COURSE_AVX_OPTION "-march=core-avx2")
if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm")
set(CPP_COURSE_AVX_OPTION "-march=native")
set(CPP_COURSE_MATH_NO_ERRNO_OPTION "-fno-math-errno")
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
set(CPP_COURSE_AVX_OPTION "-march=core-avx2")
set(CPP_COURSE_MATH_NO_ERRNO_OPTION "-fno-math-errno")
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
set(CPP_COURSE_AVX_OPTION "-march=core-avx2")
Expand All @@ -38,7 +41,7 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel")
set(CPP_COURSE_AVX_OPTION "-march=core-avx2")
set(CPP_COURSE_MATH_NO_ERRNO_OPTION "")
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC")
set(CPP_COURSE_AVX_OPTION "/arch:AVX2")
set(CPP_COURSE_AVX_OPTION "/arch:AVX2")
set(CPP_COURSE_MATH_NO_ERRNO_OPTION "")
endif()

Expand Down