Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
4e47613
Merge pull request #3 from SimVascular/main
zasexton Jun 9, 2025
3bdfb91
Merge branch 'SimVascular:main' into main
zasexton Aug 26, 2025
3fb5364
Merge branch 'SimVascular:main' into main
zasexton Sep 18, 2025
4749c70
Merge branch 'SimVascular:main' into main
zasexton Oct 6, 2025
47a7985
Merge branch 'SimVascular:main' into main
zasexton Oct 27, 2025
2d4f8ed
Merge pull request #5 from SimVascular/main
zasexton Nov 11, 2025
1154fe8
Merge branch 'SimVascular:main' into main
zasexton Jan 5, 2026
690a92c
Merge branch 'SimVascular:main' into main
zasexton Feb 27, 2026
e6dd7e9
Merge branch 'SimVascular:main' into main
zasexton Mar 25, 2026
b831ea1
Merge branch 'SimVascular:main' into main
zasexton Apr 8, 2026
1e117c2
Merge branch 'SimVascular:main' into main
zasexton Apr 21, 2026
35cc8fe
Merge branch 'SimVascular:main' into main
zasexton Apr 30, 2026
42b23df
Merge branch 'SimVascular:main' into main
zasexton May 12, 2026
f412876
Merge branch 'SimVascular:main' into main
zasexton May 26, 2026
3a6af11
Merge branch 'SimVascular:main' into main
zasexton Jun 1, 2026
0ff0d30
#525 adding LagrangeBasis/Serendipity function support and unit tests…
zasexton Jun 2, 2026
dfdeead
Update FSI HEX8 FE Basis reference results
zasexton Jun 5, 2026
8b47802
fixing temporary A + B expression in matrix and vector objects
zasexton Jun 8, 2026
4d6baaa
fixing fetch content for google tests
zasexton Jun 8, 2026
81cad54
adding fetch content to include for enabled unit tests
zasexton Jun 8, 2026
004e678
removing basis optimizations, caching, pyramid support, manual/static…
zasexton Jun 8, 2026
3876ee1
removing prewarmed evaluations and switch to std library constants. r…
zasexton Jun 8, 2026
2a97fa0
consolidating math support for integer functions and expression opera…
zasexton Jun 8, 2026
7f2e020
removing the previous basis functions so that we are not maintaining …
zasexton Jun 8, 2026
6e31724
Merge branch 'main' into issue-525
zasexton Jun 8, 2026
36046f8
fixing the licensing and copyright comments
zasexton Jun 8, 2026
ab0ebcc
Merge branch 'main' into issue-525
zasexton Jun 9, 2026
3691503
including doxygen documentation for Basis and Math submodules
zasexton Jun 9, 2026
c53e0e0
updating serendipity basis to be concrete terminal classes with `final`
zasexton Jun 9, 2026
1289c08
adding switch cases for converting consts element types to fe element…
zasexton Jun 9, 2026
82a1158
adding doxygen to Common submodule
zasexton Jun 10, 2026
917c638
aligning exception throws and raises with the function-template calls…
zasexton Jun 10, 2026
4819f59
fixing doxygen layout to allow for visible topic sections since modul…
zasexton Jun 10, 2026
dfd5aff
added topology evaluation helpers and cleaned up static cast helpers
zasexton Jun 10, 2026
ddb509a
aligning throw and raise to use function-template helpers for svmp
zasexton Jun 10, 2026
9d6266b
improving doxygen documentation for the basis topic
zasexton Jun 11, 2026
3e03138
Merge branch 'main' into issue-525
zasexton Jun 11, 2026
bd7c2ad
removing chrono guard from Eigen
zasexton Jun 15, 2026
2826269
reverting chrono replacement code changes
zasexton Jun 15, 2026
f734094
swapping out raw pointers for span support in the non-owning buffer a…
zasexton Jun 15, 2026
2b25acd
clarifying the populate_reference_hessians function for the element f…
zasexton Jun 17, 2026
1d0a817
adding docstrings to nn source functions and inlining to_fe_element_t…
zasexton Jun 17, 2026
34d4e68
conforming hex27 face node ordering to right-hand rule vtk style orde…
zasexton Jun 17, 2026
a875bdb
removing geometry_mode bool from SerendipityBasis to clean up constru…
zasexton Jun 17, 2026
35124f7
C-arrays to the same constexpr std::array for hex20 table in Serendip…
zasexton Jun 17, 2026
e73c13a
implementing unified monomial evaluator to decrease duplicate code ac…
zasexton Jun 17, 2026
56bd86c
adding a `nodes()` method to the base abstraction for basis functions…
zasexton Jun 17, 2026
bcf2b3d
Deleted the unused size-family traits and their tests for LagrangeBasis
zasexton Jun 17, 2026
57d79b4
defaulting BasisRequest's enum fields, swapping the shared thread-loc…
zasexton Jun 17, 2026
6eaa60c
fixing the Hex8 Hessian-delegation doc, renaming the serendipity test…
zasexton Jun 17, 2026
d4d3c4a
deriving the basis topology() and shape predicates from the single me…
zasexton Jun 18, 2026
03a69be
consolidating span-size checks and equispaced-coordinate formula
zasexton Jun 18, 2026
50b00c5
removing add_scaled_hessian from the abstract basisfunction file and …
zasexton Jun 18, 2026
4f7cb90
Canonicalize exception helper wrappers in svmp::Core and migrate FE c…
zasexton Jun 18, 2026
78ed2b9
FE basis/math test suite with improved documentation and clarity
zasexton Jun 18, 2026
58b80a2
removed the DenseTransformKernels.h and the associated unit tests
zasexton Jun 18, 2026
1d93c5c
added quadrilateral-serendipity justification and removed exposed Eig…
zasexton Jun 18, 2026
7ba8828
replaced quadrilateral serendipity interior-node heuristic with trian…
zasexton Jun 18, 2026
f5e7828
adding comments to clarify coefficient calculated tables and node ord…
zasexton Jun 18, 2026
a07a66c
removed is_simplex and is_tensor_product. added clarifying comments t…
zasexton Jun 18, 2026
ff10ac4
Merge branch 'main' into issue-525
zasexton Jun 18, 2026
d442f70
removing `Real` alias for `double`
zasexton Jun 22, 2026
11624f7
Merge remote-tracking branch 'origin/issue-525' into issue-525
zasexton Jun 22, 2026
113984e
using cmake c++ standard variable for the Trilinos flags
zasexton Jun 22, 2026
661c1d3
tet/wedge no longer build and discard per-node Hessians
zasexton Jun 22, 2026
361edeb
reword the doc comment to match intent for numerical gradient and hes…
zasexton Jun 22, 2026
c0ecbdb
removing code that is no longer within the production code for basis …
zasexton Jun 22, 2026
5bd59f6
updating doxygen documentation to use the block comment style
zasexton Jun 23, 2026
d56d390
Hex8 and Hex20 constructor branch now validates the element/order pai…
zasexton Jun 23, 2026
edd52b7
remove FP processing and passing indexing directly for lagrange basis…
zasexton Jun 24, 2026
f6528c0
fixing comment because LagrangeBasis consumes the integer layout.latt…
zasexton Jun 24, 2026
d2b3af4
adding serendipity_subset_nodes(top, complete_layout, keep_count, com…
zasexton Jun 24, 2026
b27f37d
normalizing named serendipity schemes to proper dimensionality and or…
zasexton Jun 24, 2026
6d7ebd7
addressing minor doc and scaling concerns
zasexton Jun 24, 2026
8b78683
removing vector and matrix aliases
zasexton Jun 24, 2026
62cc262
tables for serendipity basis are generated by inverting the Vandermonde
zasexton Jun 24, 2026
f11f3d0
fixed quad8 layout to one standard
zasexton Jun 24, 2026
5a0efda
making basis construction based on topology and order for arbitrary o…
zasexton Jun 24, 2026
b19e6f3
NodeOrderingConventions.cpp:443, the negative-order guard in complete…
zasexton Jun 24, 2026
93ad4d0
fixing the construction of serendipity basis functions with orders le…
zasexton Jun 24, 2026
736fba3
support arbitrary-order hexahedral serendipity bases, with Hex8/Hex20…
zasexton Jun 24, 2026
0a4788e
fixing point lagrange order to zero since nonzero support does not ma…
zasexton Jun 24, 2026
142419d
two arbitrary-order generators now source their corner+edge skeleton …
zasexton Jun 24, 2026
f0c7f48
Added topology-based BasisRequest factory creation for arbitrary-orde…
zasexton Jun 24, 2026
fa3b753
arbitrary-order quadrilateral and hexahedral serendipity bases (and t…
zasexton Jun 24, 2026
523a983
adding proper documentation to conditioning of the lagrange basis
zasexton Jun 25, 2026
504a416
adding single arg constructor overload and removing `element_type()`
zasexton Jun 25, 2026
2376874
removing un-used code and adding covergence criteria for high-order b…
zasexton Jun 25, 2026
ff8c289
BasisNodeOrderingException for negative or oversized i, while preserv…
zasexton Jun 25, 2026
7544c4d
renamed misleading identifiers
zasexton Jun 25, 2026
f1c0c31
adding documentation for tolerance measurements
zasexton Jun 25, 2026
ca68c72
Consolidated all serendipity reference-node generation into a single
zasexton Jun 25, 2026
955a7de
removing un-used code for quad and hex serendipity basis
zasexton Jun 25, 2026
718649a
simplifying documentation and making sure that basis specific excepti…
zasexton Jun 25, 2026
c114538
improving doxygen documentation with internal callouts
zasexton Jun 25, 2026
319d116
improving comments and inlining `eval_modal_basis` for clarity in ser…
zasexton Jun 25, 2026
e97f49d
FE/Basis: clarify BasisFunction documentation
zasexton Jun 25, 2026
0e34aa2
FE/Basis: document when each basis exception type is raised
zasexton Jun 25, 2026
512043a
FE/Basis: state the GLL/equispaced node distinction without implement…
zasexton Jun 25, 2026
ecc15fa
FE/Basis: return unique_ptr from basis_factory create functions
zasexton Jun 25, 2026
6cb363f
FE/Basis: make span evaluators the override point and share vector ov…
zasexton Jun 25, 2026
caa4c91
FE/Basis: clarify out-parameter, sentinel, and field-ordering documen…
zasexton Jun 26, 2026
c733aa1
FE/Basis: render NodeOrderingConventions docs under an internal-API g…
zasexton Jun 26, 2026
5b497a4
FE/Math: clarify that math::Vector is distinct from the legacy solver…
zasexton Jun 26, 2026
7aa2d16
FE/Common: document Mesh-module optionality, GlobalIndex rationale, a…
zasexton Jun 26, 2026
3932e77
FE/Math: document DenseLinearAlgebra and rename label to error_messag…
zasexton Jun 26, 2026
5b072c1
solver: throw on unmapped element type in nn.cpp to_fe_element_type
zasexton Jun 26, 2026
a0722c3
docs: upgrade Doxyfile MathJax to version 3
zasexton Jun 26, 2026
9c3906a
FE: resolve Doxygen cross-references and document exposed internal me…
zasexton Jun 26, 2026
6c7c0d7
Core: add NotImplemented/IndexOutOfRange exceptions and document the …
zasexton Jun 26, 2026
7003bf3
simplifying exception parameters and eliminating redundancies in exce…
zasexton Jun 26, 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
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v4
- name: Build doxygen documentation
run: |
sudo apt install -y doxygen
sudo apt install -y doxygen graphviz
doxygen Documentation/Doxyfile
- name: Save documentation
uses: actions/upload-artifact@v4
Expand Down
37 changes: 30 additions & 7 deletions Code/Source/solver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,18 @@
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
Comment thread
michelebucelli marked this conversation as resolved.
set(CMAKE_CXX_STANDARD_REQUIRED True)

include_directories(${SV_SOURCE_DIR}/ThirdParty/eigen/include)
include_directories(${SV_SOURCE_DIR}/ThirdParty/eigen/include/eigen3)
include_directories(${SV_SOURCE_DIR}/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib)
include_directories(${SV_SOURCE_DIR}/ThirdParty/tetgen/simvascular_tetgen)
include_directories(${SV_SOURCE_DIR}/ThirdParty/tinyxml/simvascular_tinyxml)
include_directories(${MPI_C_INCLUDE_PATH})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Core)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/FE)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/FE/Common)

# Find Trilinos package if requested
Expand Down Expand Up @@ -86,7 +89,7 @@ endif()
# add trilinos flags and defines
if(USE_TRILINOS)
ADD_DEFINITIONS(-DWITH_TRILINOS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++${CMAKE_CXX_STANDARD}")
endif()

# Build with the PETSc linear algebra package.
Expand Down Expand Up @@ -245,9 +248,21 @@ file(GLOB SOLVER_FE_COMMON_SRCS CONFIGURE_DEPENDS
FE/Common/*.h
)

file(GLOB SOLVER_FE_BASIS_SRCS CONFIGURE_DEPENDS
FE/Basis/*.cpp
FE/Basis/*.h
)

file(GLOB SOLVER_FE_MATH_SRCS CONFIGURE_DEPENDS
FE/Math/*.cpp
FE/Math/*.h
)

list(APPEND CSRCS
${SOLVER_CORE_SRCS}
${SOLVER_FE_COMMON_SRCS}
${SOLVER_FE_BASIS_SRCS}
${SOLVER_FE_MATH_SRCS}
)

# Set PETSc interace code.
Expand Down Expand Up @@ -324,16 +339,24 @@ if(ENABLE_UNIT_TEST)

# link pthread on ubuntu20
find_package(Threads REQUIRED)

include(FetchContent)
# install Google Test
#if(NOT TARGET gtest_main AND NOT TARGET gtest)
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/refs/heads/main.zip
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG v1.17.0
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
)
FetchContent_MakeAvailable(googletest)

if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_STANDARD GREATER_EQUAL 20)
foreach(GTEST_TARGET gtest gtest_main gmock gmock_main)
if(TARGET ${GTEST_TARGET})
target_compile_options(${GTEST_TARGET} PRIVATE -std=gnu++17)
endif()
endforeach()
endif()
#endif()

enable_testing()
Expand Down
238 changes: 202 additions & 36 deletions Code/Source/solver/Core/Exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <sstream>
#include <string>
#include <string_view>
#include <type_traits>
#include <utility>
#include <vector>

Expand Down Expand Up @@ -281,12 +282,23 @@ class ExceptionBase : public std::exception {
rebuild_what();
}

/// @brief Record the originating source location and refresh what().
///
/// @details Called by raise() after construction, so exception constructors
/// do not need to accept (and forward) the file/line/function themselves.
void set_source_location(const SourceLocation& location)
{
context_.set_source_location(location.file, location.line,
location.function);
rebuild_what();
}

virtual ~ExceptionBase() noexcept = default;

protected:
ExceptionBase(std::string message, StatusCode status,
std::string_view subsystem_label, const char* file,
int line, const char* function)
std::string_view subsystem_label, const char* file = "",
int line = 0, const char* function = "")
: message_(std::move(message)),
subsystem_label_(subsystem_label.empty() ? std::string_view("Exception")
: subsystem_label)
Expand Down Expand Up @@ -323,28 +335,51 @@ class CoreException : public ExceptionBase {
}
};

class ParseException : public CoreException {
public:
ParseException(const std::string& message,
const char* file = "",
int line = 0,
const char* function = "")
: CoreException(message, StatusCode::ParseError, file, line, function)
{
/**
* @brief Define a simple, message-only exception type in one line.
*
* @details Expands to a class @p Name deriving from @p Base with a single
* `explicit Name(const std::string& message)` constructor that records @p Status.
* Use it for exceptions that carry only a message; write the class by hand when it
* needs extra structured context (members and accessors). The source location is
* stamped by raise(), so no file/line/function constructor is needed.
*
* @p Base must be an ExceptionBase-derived type whose constructor accepts
* `(const std::string&, StatusCode)` (CoreException, FEException, and the
* subsystem bases do).
*
* @code
* SVMP_DEFINE_EXCEPTION(ParseException, CoreException, StatusCode::ParseError);
* @endcode
*/
#define SVMP_DEFINE_EXCEPTION(Name, Base, Status) \
class Name : public Base { \
public: \
explicit Name(const std::string& message) \
: Base(message, (Status)) \
{ \
} \
}
};

class DependencyException : public CoreException {
public:
DependencyException(const std::string& message,
const char* file = "",
int line = 0,
const char* function = "")
: CoreException(message, StatusCode::DependencyError, file, line,
function)
{
}
};
/// @brief A parsing or input-format error.
SVMP_DEFINE_EXCEPTION(ParseException, CoreException, StatusCode::ParseError);

/// @brief A required dependency is missing or failed to load.
SVMP_DEFINE_EXCEPTION(DependencyException, CoreException,
StatusCode::DependencyError);

/// @brief A requested operation or feature is not implemented.
///
/// @details The default exception raised by not_implemented().
SVMP_DEFINE_EXCEPTION(NotImplementedException, CoreException,
StatusCode::NotImplemented);

/// @brief An index is outside its valid range.
///
/// @details The default exception raised by check_index(); the status code is
/// InvalidArgument because an out-of-range index is a caller error.
SVMP_DEFINE_EXCEPTION(IndexOutOfRangeException, CoreException,
StatusCode::InvalidArgument);

inline void ExceptionRuntime::install_terminate_handler()
{
Expand All @@ -366,37 +401,168 @@ inline void ExceptionRuntime::install_terminate_handler()
});
}

/**
* @brief A diagnostic message bundled with the source location where it was written.
*
* @details The core helpers (raise(), check(), throw_if(), check_not_null()) take
* a Diagnostic in place of an explicit source location. Its file/line/function
* arguments default to the compiler builtins __builtin_FILE()/__builtin_LINE()/
* __builtin_FUNCTION(), which capture the caller's location, so a string literal
* or std::string passed at the call site is implicitly wrapped into a Diagnostic
* that records exactly where the call appears -- callers do not pass SVMP_HERE:
* @code
* svmp::check<MyException>(ptr != nullptr, "pointer must not be null");
* @endcode
*/
class Diagnostic {
public:
/**
* @brief Wrap a message, capturing the caller's source location by default.
* @param message The diagnostic message.
* @param file Source file; defaults to the caller's via __builtin_FILE().
* @param line Source line; defaults to the caller's via __builtin_LINE().
* @param function Function; defaults to the caller's via __builtin_FUNCTION().
*/
Diagnostic(const char* message,
const char* file = __builtin_FILE(),
int line = __builtin_LINE(),
const char* function = __builtin_FUNCTION())
: message_(message), location_{file, line, function}
{
}
/**
* @brief Wrap a message, capturing the caller's source location by default.
* @param message The diagnostic message.
* @param file Source file; defaults to the caller's via __builtin_FILE().
* @param line Source line; defaults to the caller's via __builtin_LINE().
* @param function Function; defaults to the caller's via __builtin_FUNCTION().
*/
Diagnostic(std::string message,
const char* file = __builtin_FILE(),
int line = __builtin_LINE(),
const char* function = __builtin_FUNCTION())
: message_(std::move(message)), location_{file, line, function}
{
}

/**
* @brief The diagnostic message.
* @return The stored message.
*/
const std::string& message() const noexcept { return message_; }
/**
* @brief The source location captured when the Diagnostic was constructed.
* @return The stored source location.
*/
const SourceLocation& location() const noexcept { return location_; }

private:
std::string message_;
SourceLocation location_;
};

/**
* @brief Construct @p ExceptionT from the diagnostic message and @p args, stamp
* the source location, and throw it.
*
* @details @p diagnostic carries the message and the source location captured at
* the call site; @p args are forwarded to the exception constructor after the
* message. The location is recorded via ExceptionBase::set_source_location(), so
* exception types never need a file/line/function constructor -- a `(message)`
* (plus any structured-context) constructor is enough.
*/
template <class ExceptionT, class... Args>
[[noreturn]] void raise(SourceLocation location, Args&&... args)
[[noreturn]] void raise(Diagnostic diagnostic, Args&&... args)
{
throw ExceptionT(std::forward<Args>(args)..., location.file, location.line,
location.function);
static_assert(std::is_base_of_v<ExceptionBase, ExceptionT>,
"raise<>() requires an svmp::ExceptionBase-derived exception type");
ExceptionT exception(diagnostic.message(), std::forward<Args>(args)...);
exception.set_source_location(diagnostic.location());
throw exception;
}

/**
* @brief Raise @p ExceptionT when @p condition is false (a required condition).
*
* @details The general success-condition check, used for argument, state, and
* invariant validation: `check<E>(ptr != nullptr, "...")`. throw_if() is the
* logical inverse -- it raises when its condition is true.
*/
template <class ExceptionT, class... Args>
void check(bool condition, SourceLocation location, Args&&... args)
void check(bool condition, Diagnostic diagnostic, Args&&... args)
{
if (!condition) {
raise<ExceptionT>(location, std::forward<Args>(args)...);
raise<ExceptionT>(std::move(diagnostic), std::forward<Args>(args)...);
}
}

template <class ExceptionT, class... Args>
void check_arg(bool condition, SourceLocation location, Args&&... args)
/**
* @brief Raise @p ExceptionT when @p ptr is null.
*/
template <class ExceptionT, class PointerT, class... Args>
void check_not_null(PointerT ptr, Diagnostic diagnostic, Args&&... args)
{
if (!condition) {
raise<ExceptionT>(location, std::forward<Args>(args)...);
if (ptr == nullptr) {
raise<ExceptionT>(std::move(diagnostic), std::forward<Args>(args)...);
}
}

template <class ExceptionT, class PointerT, class... Args>
void check_not_null(PointerT ptr, SourceLocation location, Args&&... args)
/**
* @brief Raise @p ExceptionT when @p condition is true.
*
* @details The logical inverse of check(): check() raises when its condition is
* false (a required condition); throw_if() raises when its condition is true (a
* failure condition). The two are not interchangeable.
*/
template <class ExceptionT, class... Args>
void throw_if(bool condition, Diagnostic diagnostic, Args&&... args)
{
if (ptr == nullptr) {
raise<ExceptionT>(location, std::forward<Args>(args)...);
if (condition) {
raise<ExceptionT>(std::move(diagnostic), std::forward<Args>(args)...);
}
}

/**
* @brief Raise an exception when @p index is outside [0, @p size).
*
* @details @p ExceptionT defaults to IndexOutOfRangeException; supply a different
* type only when a subsystem needs its own exception. The bounds message and the
* source location are generated automatically.
*/
template <class ExceptionT = IndexOutOfRangeException, class IndexT, class SizeT>
void check_index(IndexT index, SizeT size,
const char* file = __builtin_FILE(),
int line = __builtin_LINE(),
const char* function = __builtin_FUNCTION())
{
const long long index_value = static_cast<long long>(index);
const long long size_value = static_cast<long long>(size);
check<ExceptionT>(
index_value >= 0 && index_value < size_value,
Diagnostic("Index " + std::to_string(index_value) + " out of bounds [0, " +
std::to_string(size_value) + ")",
file, line, function));
}

/**
* @brief Raise an exception reporting an unimplemented feature, with a message.
*
* @details @p ExceptionT defaults to NotImplementedException, so most call sites
* pass only a message:
* @code
* svmp::not_implemented("GPU assembly is not supported");
* @endcode
* Pass a different exception type explicitly only when a subsystem needs one.
*/
template <class ExceptionT = NotImplementedException>
[[noreturn]] void not_implemented(std::string message,
const char* file = __builtin_FILE(),
int line = __builtin_LINE(),
const char* function = __builtin_FUNCTION())
{
raise<ExceptionT>(Diagnostic(std::move(message), file, line, function));
}
Comment thread
zasexton marked this conversation as resolved.

} // namespace svmp

#define SVMP_HERE ::svmp::SourceLocation{__FILE__, __LINE__, __func__}
Expand All @@ -405,7 +571,7 @@ void check_not_null(PointerT ptr, SourceLocation location, Args&&... args)
#define SVMP_DEBUG_CHECK(ExceptionT, condition, ...) \
do { \
if (!(condition)) { \
::svmp::raise<ExceptionT>(SVMP_HERE, __VA_ARGS__); \
::svmp::raise<ExceptionT>(__VA_ARGS__); \
} \
} while (false)
#else
Expand Down
Loading
Loading