MeDiPack  1.3.1
A Message Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
typeDefinitions.h
Go to the documentation of this file.
1/*
2 * MeDiPack, a Message Differentiation Package
3 *
4 * Copyright (C) 2015-2025 Chair for Scientific Computing (SciComp), University of Kaiserslautern-Landau
5 * Homepage: http://scicomp.rptu.de
6 * Contact: Prof. Nicolas R. Gauger (codi@scicomp.uni-kl.de)
7 *
8 * Lead developers: Max Sagebaum (SciComp, University of Kaiserslautern-Landau)
9 *
10 * This file is part of MeDiPack (http://scicomp.rptu.de/software/medi).
11 *
12 * MeDiPack is free software: you can redistribute it and/or
13 * modify it under the terms of the GNU Lesser General Public
14 * License as published by the Free Software Foundation, either
15 * version 3 of the License, or (at your option) any later version.
16 *
17 * MeDiPack is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 *
21 * See the GNU Lesser General Public License for more details.
22 * You should have received a copy of the GNU
23 * Lesser General Public License along with MeDiPack.
24 * If not, see <http://www.gnu.org/licenses/>.
25 *
26 * Authors: Max Sagebaum, Tim Albring (SciComp, University of Kaiserslautern-Landau)
27 */
28
29#pragma once
30
31#include "adjointInterface.hpp"
32#include "debugInformation.hpp"
33
37namespace medi {
38
39 enum class ManualDeleteType {
40 Normal,
41 Async,
42 Wait
43 };
44
45 struct HandleBase;
49 typedef int (*ContinueFunction)(HandleBase* h);
50 typedef void (*PreAdjointOperation)(void* adjoints, void* primals, int count, int dim);
51 typedef void (*PostAdjointOperation)(void* adjoints, void* primals, void* rootPrimals, int count, int dim);
52 typedef void (*CustomFunction)(void* data);
53
54 struct HandleBase {
55#if MEDI_DebugInformation
56 std::string debugInformation;
57#endif
58
63
66 debugInformation(getDebugInformation()),
67#endif
68 funcReverse(NULL),
69 funcForward(NULL),
70 funcPrimal(NULL),
72
73
74 virtual ~HandleBase() {}
75 };
76
77 // structures for the passive types
78
79 template <typename T>
80 struct PairWithInt {
81 T a;
82 int b;
83 };
84
91
92}
Definition adjointInterface.hpp:40
#define MEDI_DebugInformation
Definition debugInformation.hpp:39
Global namespace for MeDiPack - Message Differentiation Package.
Definition adjointInterface.hpp:37
ManualDeleteType
Definition typeDefinitions.h:39
void(* PrimalFunction)(HandleBase *h, AdjointInterface *a)
Definition typeDefinitions.h:48
void(* CustomFunction)(void *data)
Definition typeDefinitions.h:52
PairWithInt< int > IntIntPair
Definition typeDefinitions.h:88
void(* ForwardFunction)(HandleBase *h, AdjointInterface *a)
Definition typeDefinitions.h:47
PairWithInt< long > LongIntPair
Definition typeDefinitions.h:87
void(* PreAdjointOperation)(void *adjoints, void *primals, int count, int dim)
Definition typeDefinitions.h:50
std::string getDebugInformation()
Definition debugInformation.cpp:59
int(* ContinueFunction)(HandleBase *h)
Definition typeDefinitions.h:49
PairWithInt< float > FloatIntPair
Definition typeDefinitions.h:85
PairWithInt< double > DoubleIntPair
Definition typeDefinitions.h:86
PairWithInt< short > ShortIntPair
Definition typeDefinitions.h:89
void(* PostAdjointOperation)(void *adjoints, void *primals, void *rootPrimals, int count, int dim)
Definition typeDefinitions.h:51
void(* ReverseFunction)(HandleBase *h, AdjointInterface *a)
Definition typeDefinitions.h:46
PairWithInt< long double > LongDoubleIntPair
Definition typeDefinitions.h:90
Definition typeDefinitions.h:54
PrimalFunction funcPrimal
Definition typeDefinitions.h:61
ManualDeleteType deleteType
Definition typeDefinitions.h:62
virtual ~HandleBase()
Definition typeDefinitions.h:74
ReverseFunction funcReverse
Definition typeDefinitions.h:59
HandleBase()
Definition typeDefinitions.h:64
ForwardFunction funcForward
Definition typeDefinitions.h:60
Definition typeDefinitions.h:80
int b
Definition typeDefinitions.h:82
T a
Definition typeDefinitions.h:81