source: CIVL/examples/compare/provesa/runtime_dense_reverse/ad_rev.c

main
Last change on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 2.6 KB
RevLine 
[4d61ad0]1
2#include "ad_rev.h"
3
4__ADIC_RevType our_rev_mode = {0,0,0,0,0,0,0};
5//__ADIC_RevType our_rev_mode = {0};
6
7/*
8int isRevModePlain(__ADIC_RevType our_rev_mode)
9{
10 return our_rev_mode.plain;
11}
12
13int isRevModeTape(__ADIC_RevType our_rev_mode)
14{
15 return our_rev_mode.tape;
16}
17
18int isRevModeAdjoint(__ADIC_RevType our_rev_mode)
19{
20 return our_rev_mode.adjoint;
21}
22
23int isRevModeArgStore(__ADIC_RevType our_rev_mode)
24{
25 return our_rev_mode.arg_store;
26}
27
28int isRevModeArgRestore(__ADIC_RevType our_rev_mode)
29{
30 return our_rev_mode.arg_restore;
31}
32
33int isRevModeRedStore(__ADIC_RevType our_rev_mode)
34{
35 return our_rev_mode.res_store;
36}
37
38int isRevModeResRestore(__ADIC_RevType our_rev_mode)
39{
40 return our_rev_mode.res_restore;
41}
42
43__ADIC_RevType getRevMode()
44{
45 return our_rev_mode;
46}*/
47
48void __ADIC_RevInit(__ADIC_RevType *adic_rev)
49 {
50 adic_rev->arg_store = FALSE;
51 adic_rev->arg_restore = FALSE;
52 adic_rev->res_store = FALSE;
53 adic_rev->res_restore = FALSE;
54 adic_rev->plain = TRUE;
55 adic_rev->tape = FALSE;
56 adic_rev->adjoint = FALSE;
57 }
58
59 void __ADIC_RevPlain(__ADIC_RevType *adic_rev)
60 {
61 adic_rev->arg_store = FALSE;
62 adic_rev->arg_restore = FALSE;
63 adic_rev->res_store = FALSE;
64 adic_rev->res_restore = FALSE;
65 adic_rev->plain = TRUE;
66 adic_rev->tape = FALSE;
67 adic_rev->adjoint = FALSE;
68 }
69 void __ADIC_RevTape(__ADIC_RevType *adic_rev)
70 {
71 adic_rev->arg_store = FALSE;
72 adic_rev->arg_restore = FALSE;
73 adic_rev->res_store = FALSE;
74 adic_rev->res_restore = FALSE;
75 adic_rev->plain = FALSE;
76 adic_rev->tape = TRUE;
77 adic_rev->adjoint = FALSE;
78 }
79 void __ADIC_RevAdjoint(__ADIC_RevType *adic_rev)
80 {
81 adic_rev->arg_store = FALSE;
82 adic_rev->arg_restore = FALSE;
83 adic_rev->res_store = FALSE;
84 adic_rev->res_restore = FALSE;
85 adic_rev->plain = FALSE;
86 adic_rev->tape = FALSE;
87 adic_rev->adjoint = TRUE;
88 }
89 void __ADIC_RevStorePlain(__ADIC_RevType *adic_rev)
90 {
91 adic_rev->arg_store = TRUE;
92 adic_rev->arg_restore = FALSE;
93 adic_rev->res_store = FALSE;
94 adic_rev->res_restore = FALSE;
95 adic_rev->plain = TRUE;
96 adic_rev->tape = FALSE;
97 adic_rev->adjoint = FALSE;
98 }
99 void __ADIC_RevRestoreTape(__ADIC_RevType *adic_rev)
100 {
101 adic_rev->arg_store = FALSE;
102 adic_rev->arg_restore = TRUE;
103 adic_rev->res_store = FALSE;
104 adic_rev->res_restore = FALSE;
105 adic_rev->plain = FALSE;
106 adic_rev->tape = TRUE;
107 adic_rev->adjoint = FALSE;
108 }
109
Note: See TracBrowser for help on using the repository browser.