Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
teqp_fork_old
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sven Michael Pohl
teqp_fork_old
Commits
6c1f1cd1
Commit
6c1f1cd1
authored
3 years ago
by
Ian Bell
Browse files
Options
Downloads
Patches
Plain Diff
Allow also for testing mcx derivative timing
parent
4d46df0e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/time_Ar0n.cpp
+20
-13
20 additions, 13 deletions
src/time_Ar0n.cpp
with
20 additions
and
13 deletions
src/time_Ar0n.cpp
+
20
−
13
View file @
6c1f1cd1
...
@@ -57,7 +57,7 @@ auto some_REFPROP(obtainablethings thing, int Ncomp, int itau, int idelta, Taus&
...
@@ -57,7 +57,7 @@ auto some_REFPROP(obtainablethings thing, int Ncomp, int itau, int idelta, Taus&
return
o
;
return
o
;
}
}
template
<
int
itau
,
int
idelta
,
typename
Taus
,
typename
Deltas
,
typename
TT
,
typename
RHO
,
typename
Model
>
template
<
int
itau
,
int
idelta
,
ADBackends
backend
,
typename
Taus
,
typename
Deltas
,
typename
TT
,
typename
RHO
,
typename
Model
>
auto
some_teqp
(
obtainablethings
thing
,
int
Ncomp
,
const
Taus
&
taus
,
const
Deltas
&
deltas
,
const
Model
&
model
,
const
TT
&
Ts
,
const
RHO
&
rhos
)
{
auto
some_teqp
(
obtainablethings
thing
,
int
Ncomp
,
const
Taus
&
taus
,
const
Deltas
&
deltas
,
const
Model
&
model
,
const
TT
&
Ts
,
const
RHO
&
rhos
)
{
std
::
vector
<
OneTiming
>
out
;
std
::
vector
<
OneTiming
>
out
;
...
@@ -77,14 +77,14 @@ auto some_teqp(obtainablethings thing, int Ncomp, const Taus& taus, const Deltas
...
@@ -77,14 +77,14 @@ auto some_teqp(obtainablethings thing, int Ncomp, const Taus& taus, const Deltas
o
+=
tdx
::
get_Ar00
(
model
,
Ts
[
j
],
rhos
[
j
],
c
);
o
+=
tdx
::
get_Ar00
(
model
,
Ts
[
j
],
rhos
[
j
],
c
);
}
}
else
if
constexpr
(
itau
==
0
&&
idelta
==
1
)
{
else
if
constexpr
(
itau
==
0
&&
idelta
==
1
)
{
o
+=
tdx
::
get_Ar01
(
model
,
Ts
[
j
],
rhos
[
j
],
c
);
o
+=
tdx
::
get_Ar01
<
backend
>
(
model
,
Ts
[
j
],
rhos
[
j
],
c
);
//o += tdx::get_Ar0n<1>(model, Ts[j], rhos[j], c)[1];
//o += tdx::get_Ar0n<1>(model, Ts[j], rhos[j], c)[1];
}
}
else
if
constexpr
(
itau
==
0
&&
idelta
==
2
)
{
else
if
constexpr
(
itau
==
0
&&
idelta
==
2
)
{
o
+=
tdx
::
get_Ar02
(
model
,
Ts
[
j
],
rhos
[
j
],
c
);
o
+=
tdx
::
get_Ar02
<
backend
>
(
model
,
Ts
[
j
],
rhos
[
j
],
c
);
}
}
else
if
constexpr
(
itau
==
0
&&
idelta
>
2
)
{
else
if
constexpr
(
itau
==
0
&&
idelta
>
2
)
{
o
+=
tdx
::
template
get_Ar0n
<
idelta
>(
model
,
Ts
[
j
],
rhos
[
j
],
c
)[
idelta
];
o
+=
tdx
::
template
get_Ar0n
<
idelta
,
backend
>(
model
,
Ts
[
j
],
rhos
[
j
],
c
)[
idelta
];
}
}
}
}
auto
toc
=
std
::
chrono
::
high_resolution_clock
::
now
();
auto
toc
=
std
::
chrono
::
high_resolution_clock
::
now
();
...
@@ -114,25 +114,32 @@ auto one_deriv(obtainablethings thing, int Ncomp, Taus& taus, Deltas& deltas, co
...
@@ -114,25 +114,32 @@ auto one_deriv(obtainablethings thing, int Ncomp, Taus& taus, Deltas& deltas, co
std
::
cout
<<
"Ar_{"
<<
itau
<<
","
<<
idelta
<<
"}"
<<
std
::
endl
;
std
::
cout
<<
"Ar_{"
<<
itau
<<
","
<<
idelta
<<
"}"
<<
std
::
endl
;
auto
timingREFPROP
=
some_REFPROP
(
thing
,
Ncomp
,
itau
,
idelta
,
taus
,
deltas
,
Ts
,
rhos
);
auto
timingREFPROP
=
some_REFPROP
(
thing
,
Ncomp
,
itau
,
idelta
,
taus
,
deltas
,
Ts
,
rhos
);
auto
timingteqp
=
some_teqp
<
itau
,
idelta
>
(
thing
,
Ncomp
,
taus
,
deltas
,
model
,
Ts
,
rhos
);
auto
timingteqpad
=
some_teqp
<
itau
,
idelta
,
ADBackends
::
autodiff
>
(
thing
,
Ncomp
,
taus
,
deltas
,
model
,
Ts
,
rhos
);
auto
timingteqpmcx
=
some_teqp
<
itau
,
idelta
,
ADBackends
::
multicomplex
>
(
thing
,
Ncomp
,
taus
,
deltas
,
model
,
Ts
,
rhos
);
std
::
cout
<<
"Values:"
<<
check_values
(
timingREFPROP
)
<<
", "
<<
check_values
(
timingteqp
)
<<
std
::
endl
;
std
::
cout
<<
"Values:"
<<
check_values
(
timingREFPROP
)
<<
", "
<<
check_values
(
timingteqp
ad
)
<<
std
::
endl
;
auto
N
=
timingREFPROP
.
size
();
auto
N
=
timingREFPROP
.
size
();
std
::
vector
<
double
>
timesteqp
,
timesREFPROP
,
valsteqp
,
valsREFPROP
;
std
::
vector
<
double
>
timesteqpad
,
timesteqpmcx
,
timesREFPROP
,
valsteqpad
,
valsteqpmcx
,
valsREFPROP
;
for
(
auto
i
=
0
;
i
<
N
;
++
i
)
{
for
(
auto
i
=
0
;
i
<
N
;
++
i
)
{
timesteqp
.
push_back
(
timingteqp
[
i
].
sec_per_call
);
timesteqpad
.
push_back
(
timingteqpad
[
i
].
sec_per_call
);
timesteqpmcx
.
push_back
(
timingteqpmcx
[
i
].
sec_per_call
);
timesREFPROP
.
push_back
(
timingREFPROP
[
i
].
sec_per_call
);
timesREFPROP
.
push_back
(
timingREFPROP
[
i
].
sec_per_call
);
valsteqp
.
push_back
(
timingteqp
[
i
].
value
);
valsteqpad
.
push_back
(
timingteqpad
[
i
].
value
);
valsteqpmcx
.
push_back
(
timingteqpmcx
[
i
].
value
);
valsREFPROP
.
push_back
(
timingREFPROP
[
i
].
value
);
valsREFPROP
.
push_back
(
timingREFPROP
[
i
].
value
);
}
}
for
(
auto
i
=
1
;
i
<
6
;
++
i
)
{
for
(
auto
i
=
1
;
i
<
6
;
++
i
)
{
std
::
cout
<<
timingteqp
[
N
-
i
].
sec_per_call
<<
", "
<<
timingREFPROP
[
N
-
i
].
sec_per_call
<<
std
::
endl
;
std
::
cout
<<
timingteqp
ad
[
N
-
i
].
sec_per_call
<<
", "
<<
timingREFPROP
[
N
-
i
].
sec_per_call
<<
std
::
endl
;
}
}
nlohmann
::
json
j
=
{
nlohmann
::
json
j
=
{
{
"timeteqp"
,
timesteqp
},
{
"timeteqp"
,
timesteqpad
},
{
"timeteqp(autodiff)"
,
timesteqpad
},
{
"timeteqp(multicomplex)"
,
timesteqpmcx
},
{
"timeREFPROP"
,
timesREFPROP
},
{
"timeREFPROP"
,
timesREFPROP
},
{
"valteqp"
,
valsteqp
},
{
"valteqp(autodiff)"
,
valsteqpad
},
{
"valteqp(multicomplex)"
,
valsteqpmcx
},
{
"valREFPROP"
,
valsREFPROP
},
{
"valREFPROP"
,
valsREFPROP
},
{
"model"
,
modelname
},
{
"model"
,
modelname
},
{
"itau"
,
itau
},
{
"itau"
,
itau
},
...
@@ -173,7 +180,7 @@ int main()
...
@@ -173,7 +180,7 @@ int main()
double
rhoc
=
1
/
dummymodel
.
redfunc
.
vc
[
0
];
double
rhoc
=
1
/
dummymodel
.
redfunc
.
vc
[
0
];
double
Tc
=
dummymodel
.
redfunc
.
Tc
[
0
];
double
Tc
=
dummymodel
.
redfunc
.
Tc
[
0
];
std
::
default_random_engine
re
;
std
::
default_random_engine
re
;
std
::
valarray
<
double
>
taus
(
100
0
);
std
::
valarray
<
double
>
taus
(
100
);
{
{
std
::
uniform_real_distribution
<
double
>
unif
(
2.0941098901098902
,
2.1941098901098902
);
std
::
uniform_real_distribution
<
double
>
unif
(
2.0941098901098902
,
2.1941098901098902
);
std
::
transform
(
std
::
begin
(
taus
),
std
::
end
(
taus
),
std
::
begin
(
taus
),
[
&
unif
,
&
re
](
double
x
)
{
return
unif
(
re
);
});
std
::
transform
(
std
::
begin
(
taus
),
std
::
end
(
taus
),
std
::
begin
(
taus
),
[
&
unif
,
&
re
](
double
x
)
{
return
unif
(
re
);
});
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment