BlackCat_Tensors
A GPU-supported autograd and linear algebra library, designed for neural network construction
operation_traits.h
Go to the documentation of this file.
1 /*
2  * Tags.h
3  *
4  * Created on: Feb 17, 2019
5  * Author: joseph
6  */
7 
8 #ifndef BC_CORE_OPERATION_TRAITS_TAGS_H_
9 #define BC_CORE_OPERATION_TRAITS_TAGS_H_
10 
11 #include "tags.h"
12 
13 namespace bc {
14 namespace oper {
15 namespace detail {
16 
17 template<class T> using query_alpha_modifier = typename T::alpha_modifier;
18 template<class T> using query_beta_modifier = typename T::beta_modifier;
19 template<class T> using query_dx = decltype(std::declval<T>().dx);
20 
21 }
22 
23 template<class T>
25 
26  static constexpr int alpha_modifier = bc::traits::conditional_detected_t<
28 
29  static constexpr int beta_modifier = bc::traits::conditional_detected_t<
31 
32  static constexpr bool is_linear_operation
33  = std::is_base_of<linear_operation,T>::value;
34 
35  static constexpr bool is_linear_assignment_operation
36  = std::is_base_of<linear_assignment_operation, T>::value;
37 
38  static constexpr bool is_assignment_operation
39  = std::is_base_of<assignment_operation, T>::value;
40 
41  static constexpr bool is_blas_function
42  = std::is_base_of<BLAS_Function, T>::value;
43 
44  static constexpr bool is_nonlinear_operation
45  = !is_blas_function && !is_linear_operation;
46 };
47 
48 }
49 }
50 
51 
52 
53 #endif /* TAGS_H_ */
Definition: constexpr_int.h:14
typename T::alpha_modifier query_alpha_modifier
Definition: operation_traits.h:17
typename T::beta_modifier query_beta_modifier
Definition: operation_traits.h:18
typename conditional_detected< func, TestType, DefaultType >::type conditional_detected_t
Definition: type_traits.h:87
Definition: operation_traits.h:24
decltype(std::declval< T >().dx) query_dx
Definition: operation_traits.h:19
The Evaluator determines if an expression needs to be greedily optimized.
Definition: algorithms.h:22