Graphite
Loading...
Searching...
No Matches
differentiation.hpp
Go to the documentation of this file.
1
2#pragma once
3#include <type_traits>
4namespace graphite {
5
7 struct Auto {};
8 struct Manual {};
9};
10
11template <typename DiffMode> constexpr bool use_autodiff_impl() {
12 return false;
13}
14
15template <typename F> constexpr bool is_analytical() {
16 return std::is_same_v<typename F::Traits::Differentiation,
17 DifferentiationMode::Manual>;
18}
19
20template <> constexpr bool use_autodiff_impl<DifferentiationMode::Auto>() {
21 return true;
22}
23
24} // namespace graphite
Definition differentiation.hpp:7
Definition differentiation.hpp:8
Definition differentiation.hpp:6