Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
resolve
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ift
resolve
Commits
cc6e5ac1
Commit
cc6e5ac1
authored
3 years ago
by
Philipp Arras
Browse files
Options
Downloads
Patches
Plain Diff
Check against old implementation
parent
223dcee2
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!37
Draft: Observation: introduce __hash__
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
resolvelib/Makefile
+0
-13
0 additions, 13 deletions
resolvelib/Makefile
resolvelib/devel.py
+9
-1
9 additions, 1 deletion
resolvelib/devel.py
resolvelib/resolvelib.cc
+11
-11
11 additions, 11 deletions
resolvelib/resolvelib.cc
with
20 additions
and
25 deletions
resolvelib/Makefile
deleted
100644 → 0
+
0
−
13
View file @
223dcee2
.PHONY
:
build
CXXFLAGS_MINI
:=
-std
=
c++17
-Wfatal-errors
-Wall
-Wextra
-shared
-fPIC
$(
shell python3
-m
pybind11
--includes
)
-Iducc
/src
-Ipybind11
/include
-fvisibility
=
hidden
CXXFLAGS
:=
-O3
-march
=
native
-ffast-math
$(
CXXFLAGS_MINI
)
#CXXFLAGS:= $(CXXFLAGS_MINI)
OUT
:=
resolvelib
$(
shell python3-config
--extension-suffix
)
$(OUT)
:
resolvelib.cpp
g++
$(
CXXFLAGS
)
-o
$(
OUT
)
ducc/src/ducc0/infra/threading.cc
$^
build
:
$(OUT)
This diff is collapsed.
Click to expand it.
resolvelib/devel.py
+
9
−
1
View file @
cc6e5ac1
...
...
@@ -17,6 +17,7 @@
import
resolve
as
rve
import
nifty8
as
ift
import
resolvelib
import
numpy
as
np
from
cpp2py
import
Pybind11Operator
from
time
import
time
...
...
@@ -30,16 +31,23 @@ dom = {kk: dom[1:] for kk in pdom.labels}
tgt
=
rve
.
default_sky_domain
(
pdom
=
pdom
,
sdom
=
sdom
)
opold
=
rve
.
polarization_matrix_exponential
(
tgt
)
@
rve
.
MultiFieldStacker
(
tgt
,
0
,
tgt
[
0
].
labels
)
nthreads
=
1
loc
=
ift
.
from_random
(
dom
)
res0
=
opold
(
loc
)
ntries
=
100
for
nthreads
in
[
8
]:
#for nthreads in range(1, 9):
op
=
Pybind11Operator
(
dom
,
tgt
,
resolvelib
.
PolarizationMatrixExponential
(
nthreads
))
assert
op
.
domain
is
opold
.
domain
assert
op
.
target
is
opold
.
target
t0
=
time
()
for
_
in
range
(
ntries
):
op
(
loc
)
res
=
op
(
loc
)
print
(
f
"
Nthreads
{
nthreads
}
:
{
(
time
()
-
t0
)
/
ntries
:
.
2
f
}
s
"
)
np
.
testing
.
assert_allclose
(
res0
.
val
,
res
.
val
)
exit
()
op
(
loc
)
exit
()
...
...
This diff is collapsed.
Click to expand it.
resolvelib/resolvelib.cc
+
11
−
11
View file @
cc6e5ac1
...
...
@@ -82,9 +82,9 @@ class PolarizationMatrixExponential {
auto
&
ouu
,
auto
&
ovv
){
auto
pol
{
qq
*
qq
+
uu
*
uu
+
vv
*
vv
};
oii
=
0.5
*
(
exp
(
ii
+
pol
)
+
exp
(
ii
-
pol
)
)
;
auto
tmp
{
0.5
*
(
exp
(
ii
+
pol
)
-
exp
(
ii
-
pol
)
)
/
sqrt
(
pol
)
};
auto
pol
{
sqrt
(
qq
*
qq
+
uu
*
uu
+
vv
*
vv
)
};
oii
=
exp
(
ii
)
*
cosh
(
pol
);
auto
tmp
{
exp
(
ii
)
*
sinh
(
pol
)
/
pol
};
oqq
=
tmp
*
qq
;
ouu
=
tmp
*
uu
;
ovv
=
tmp
*
vv
;
...
...
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