Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
744e0f6
Done: support cmake installation
bersen66 Feb 4, 2026
d0e50ef
Done: volatility surface as binary packed index
bersen66 Mar 28, 2026
81296fe
Done: refactoring
bersen66 Mar 29, 2026
068342d
Done: refactoring
bersen66 Mar 29, 2026
5debdf3
Done: optimizing surface
bersen66 Mar 30, 2026
04ed4a0
Done: refactoring
bersen66 Apr 3, 2026
6c3394a
Done: sanitizers and RCU sanity test
bersen66 Apr 5, 2026
6181425
Done: CI
bersen66 Apr 5, 2026
cb0d643
Fix: CI
bersen66 Apr 5, 2026
ffc292f
Workaround: hardware_destructive_interference_size
bersen66 Apr 5, 2026
d7518cb
Multithreaded CI
bersen66 Apr 5, 2026
fa38c0d
Fix: asan issue
bersen66 Apr 5, 2026
f9e4892
Done: generator benchmarks
bersen66 Apr 5, 2026
bc57aac
Done: rcu tests
bersen66 Apr 5, 2026
bc337f1
Done: windows ci
bersen66 Apr 6, 2026
003c86a
Fix: ci
bersen66 Apr 6, 2026
6380c20
Fix: windows ci
bersen66 Apr 6, 2026
4c6a5ce
Fix: windows ci fails
bersen66 Apr 6, 2026
1c21066
AttemptFix: dll symbol exporting
bersen66 Apr 6, 2026
f1a75f5
Export dll symbols calendar
bersen66 Apr 6, 2026
742592d
Export dll symbols calendar
bersen66 Apr 6, 2026
53c24ec
Merge remote-tracking branch 'origin/volatility' into volatility
bersen66 Apr 6, 2026
4020197
Fix: export dll symbols
bersen66 Apr 6, 2026
88b3e5c
Fix: windows link error
bersen66 Apr 6, 2026
790b2b2
Fix: missed header
bersen66 Apr 6, 2026
80fa4a9
Fix: base()
bersen66 Apr 6, 2026
bc6458a
Fix: aligned_alloc
bersen66 Apr 6, 2026
52ecd1c
Fix: aligned_alloc
bersen66 Apr 6, 2026
fd70e36
Fix: missed export
bersen66 Apr 6, 2026
7078684
Rm: asan msvc
bersen66 Apr 6, 2026
bd7cac6
Merge pull request #1 from bersen66/volatility
bersen66 Apr 6, 2026
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
82 changes: 82 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Cedra CI

on:
push:
branches:
- '**'
pull_request:
branches:
- '**'

jobs:
build-and-test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
compiler:
- { cc: gcc, cxx: g++ }
- { cc: clang, cxx: clang++ }
- { cc: cl, cxx: cl }
sanitizer: [NONE, ASAN, TSAN, UBSAN]
exclude:
# Keep MSVC only on Windows
- os: ubuntu-latest
compiler: { cc: cl, cxx: cl }
# Keep GCC/Clang only on Linux
- os: windows-latest
compiler: { cc: gcc, cxx: g++ }
- os: windows-latest
compiler: { cc: clang, cxx: clang++ }
# TSAN doesn't really supported by MSVC
- os: windows-latest
sanitizer: TSAN
- os: windows-latest
sanitizer: UBSAN
- os: windows-latest
sanitizer: ASAN
# TSAN with GCC is often unstable in CI environments due to
# libtsan version mismatches and high memory consumption.
# Clang's TSAN is more mature and sufficient for data race detection.
- compiler: { cc: gcc, cxx: g++ }
sanitizer: TSAN

steps:
- uses: actions/checkout@v4

- name: Install Dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y cmake ninja-build clang g++

- name: Install Dependencies (Windows)
if: runner.os == 'Windows'
run: |
choco install ninja

- name: Set up MSVC
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1

- name: Configure CMake
shell: bash
env:
CC: ${{ matrix.compiler.cc }}
CXX: ${{ matrix.compiler.cxx }}
run: |
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCDR_WITH_ASAN=${{ matrix.sanitizer == 'ASAN' && 'ON' || 'OFF' }} \
-DCDR_WITH_TSAN=${{ matrix.sanitizer == 'TSAN' && 'ON' || 'OFF' }} \
-DCDR_WITH_UBSAN=${{ matrix.sanitizer == 'UBSAN' && 'ON' || 'OFF' }} \
-DCDR_BUILD_TESTS=ON \
-DCDR_BUILD_BENCH=OFF

- name: Build
run: cmake --build build -j 2

- name: Run Tests
working-directory: build
run: ctest --output-on-failure -j 2
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
build
.cache
.idea
.vscode
.vscode
cmake-build-debug
build-asan
build-tsan
build-ubsan
55 changes: 51 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,40 @@
cmake_minimum_required(VERSION 3.20)
project(cedra LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# We should not use directly CMAKE_CXX_STANDARD because
# it would override user variable value if library included
# using `add_subdirectory` command
set(CDR_CXX_STANDARD 20)

include(CTest)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

list(APPEND CDR_COMMON_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR})
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(CdrHelpers)

############# SANITIZERS SUPPORT #############

option(CDR_WITH_ASAN "Enable AddressSanitizer" OFF)
option(CDR_WITH_TSAN "Enable ThreadSanitizer" OFF)
option(CDR_WITH_UBSAN "Enable UndefinedBehaviorSanitizer" OFF)

include(CdrSanitizers)

if(CDR_WITH_ASAN)
_cdr_add_sanitizer_interface(cdr_asan_interface address)
endif()

if(CDR_WITH_TSAN)
_cdr_add_sanitizer_interface(cdr_tsan_interface thread)
endif()

if(CDR_WITH_UBSAN)
_cdr_add_sanitizer_interface(cdr_ubsan_interface undefined)
endif()

##############################################

include(CdrHelpers)

option(CDR_BUILD_TESTS "If ON CDR will build all of cedra's own tests" ON)
option(CDR_BUILD_BENCH "If ON CDR will build all of cedra's own benchmarks" ON)
Expand All @@ -29,7 +53,30 @@ endif()
include(PrepareDependencies)
add_subdirectory(cdr)

# TODO: INSTALLING
if (CDR_ENABLE_INSTALL)
include(CMakePackageConfigHelpers)

install(EXPORT CdrTargets
FILE CdrTargets.cmake
NAMESPACE cdr::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/cedra
)

configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/CdrConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/CdrConfig.cmake"
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/cedra
)

write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/CdrConfigVersion.cmake"
VERSION 0.1.0
COMPATIBILITY AnyNewerVersion
)

install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/CdrConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/CdrConfigVersion.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/cedra
)
endif()
1 change: 1 addition & 0 deletions cdr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ add_subdirectory(calendar)
add_subdirectory(curve)
add_subdirectory(base)
add_subdirectory(swaps)
add_subdirectory(options)
17 changes: 17 additions & 0 deletions cdr/base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,28 @@ cdr_cpp_library(
NAME base
HDRS
"generator.h"
"internal/generator_impl.h"
"internal/export.h"
"check.h"
"internal/check_impl.h"
"hardware_interference_size.h"
"aligned_alloc.h"
SRCS
"internal/check_impl.cc"
DEPS
cdr::types
PUBLIC
)

cdr_cpp_executable(
NAME
generator_benchmark
SRCS
"internal/generator_impl_bench.cc"
DEPS
cdr::base
benchmark::benchmark
COPTS
"-O3"
BENCH
)
32 changes: 32 additions & 0 deletions cdr/base/aligned_alloc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#pragma once

#include <cdr/types/integers.h>

#include <cstdlib>
#include <new>

#ifdef _MSC_VER
#include <malloc.h>
#endif // _MSC_VER

namespace cdr {

inline void* AlignedAlloc(u64 alignment, u64 size) noexcept {
#ifdef _MSC_VER
// Windows
return _aligned_malloc(size, alignment);
#else // _MSC_VER
// unix
return std::aligned_alloc(alignment, size);
#endif // _MSC_VER
}

inline void AlignedFree(void* ptr) {
#if defined(_MSC_VER)
_aligned_free(ptr);
#else // _MSC_VER
free(ptr);
#endif // _MSC_VER
}

} // namespace cdr
Loading