Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Martin Reinecke
ducc
Commits
b451429e
Commit
b451429e
authored
Jun 25, 2020
by
Martin Reinecke
Browse files
more tweaks
parent
6d591c2b
Pipeline
#77269
passed with stages
in 13 minutes and 2 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
python/gridder_cxx.h
View file @
b451429e
...
@@ -537,9 +537,11 @@ template<typename T, typename T2=complex<T>> class Helper
...
@@ -537,9 +537,11 @@ template<typename T, typename T2=complex<T>> class Helper
public:
public:
const
T2
*
p0r
;
const
T2
*
p0r
;
T2
*
p0w
;
T2
*
p0w
;
T
kernel
[
64
];
static
constexpr
size_t
vlen
=
native_simd
<
T
>::
size
();
static
constexpr
size_t
vlen
=
native_simd
<
T
>::
size
();
native_simd
<
T
>
simd_kernel
[
64
/
vlen
];
union
{
T
scalar
[
64
];
native_simd
<
T
>
simd
[
64
/
vlen
];
}
kernel
;
Helper
(
const
GridderConfig
&
gconf_
,
const
T2
*
grid_r_
,
T2
*
grid_w_
,
Helper
(
const
GridderConfig
&
gconf_
,
const
T2
*
grid_r_
,
T2
*
grid_w_
,
vector
<
std
::
mutex
>
&
locks_
,
double
w0_
=-
1
,
double
dw_
=-
1
)
vector
<
std
::
mutex
>
&
locks_
,
double
w0_
=-
1
,
double
dw_
=-
1
)
...
@@ -555,11 +557,14 @@ template<typename T, typename T2=complex<T>> class Helper
...
@@ -555,11 +557,14 @@ template<typename T, typename T2=complex<T>> class Helper
nexp
(
2
*
supp
+
do_w_gridding
),
nexp
(
2
*
supp
+
do_w_gridding
),
nvecs
((
nexp
+
vlen
-
1
)
/
vlen
),
nvecs
((
nexp
+
vlen
-
1
)
/
vlen
),
locks
(
locks_
)
locks
(
locks_
)
{}
{
for
(
size_t
i
=
0
;
i
<
64
/
vlen
;
++
i
)
kernel
.
simd
[
i
]
=
0
;
}
~
Helper
()
{
if
(
grid_w
)
dump
();
}
~
Helper
()
{
if
(
grid_w
)
dump
();
}
int
lineJump
()
const
{
return
sv
;
}
int
lineJump
()
const
{
return
sv
;
}
T
Wfac
()
const
{
return
kernel
[
2
*
supp
];
}
T
Wfac
()
const
{
return
kernel
.
scalar
[
2
*
supp
];
}
void
prep
(
const
UVW
&
in
)
void
prep
(
const
UVW
&
in
)
{
{
double
u
,
v
;
double
u
,
v
;
...
@@ -569,17 +574,13 @@ template<typename T, typename T2=complex<T>> class Helper
...
@@ -569,17 +574,13 @@ template<typename T, typename T2=complex<T>> class Helper
double
y0
=
xsupp
*
(
iv0
-
v
);
double
y0
=
xsupp
*
(
iv0
-
v
);
for
(
int
i
=
0
;
i
<
supp
;
++
i
)
for
(
int
i
=
0
;
i
<
supp
;
++
i
)
{
{
kernel
[
i
]
=
T
(
x0
+
i
*
xsupp
);
kernel
.
scalar
[
i
]
=
T
(
x0
+
i
*
xsupp
);
kernel
[
i
+
supp
]
=
T
(
y0
+
i
*
xsupp
);
kernel
.
scalar
[
i
+
supp
]
=
T
(
y0
+
i
*
xsupp
);
}
}
if
(
do_w_gridding
)
if
(
do_w_gridding
)
kernel
[
2
*
supp
]
=
T
(
xdw
*
xsupp
*
abs
(
w0
-
in
.
w
));
kernel
.
scalar
[
2
*
supp
]
=
T
(
xdw
*
xsupp
*
abs
(
w0
-
in
.
w
));
for
(
size_t
i
=
nexp
;
i
<
nvecs
*
vlen
;
++
i
)
kernel
[
i
]
=
0
;
memcpy
(
simd_kernel
,
kernel
,
nvecs
*
vlen
*
sizeof
(
T
));
for
(
size_t
i
=
0
;
i
<
nvecs
;
++
i
)
for
(
size_t
i
=
0
;
i
<
nvecs
;
++
i
)
simd_kernel
[
i
]
=
esk
(
simd_kernel
[
i
],
beta
);
kernel
.
simd
[
i
]
=
esk
(
kernel
.
simd
[
i
],
beta
);
memcpy
(
kernel
,
simd_kernel
,
nvecs
*
vlen
*
sizeof
(
T
));
if
((
iu0
<
bu0
)
||
(
iv0
<
bv0
)
||
(
iu0
+
supp
>
bu0
+
su
)
||
(
iv0
+
supp
>
bv0
+
sv
))
if
((
iu0
<
bu0
)
||
(
iv0
<
bv0
)
||
(
iu0
+
supp
>
bu0
+
su
)
||
(
iv0
+
supp
>
bv0
+
sv
))
{
{
if
(
grid_w
)
{
dump
();
fill
(
wbuf
.
begin
(),
wbuf
.
end
(),
T
(
0
));
}
if
(
grid_w
)
{
dump
();
fill
(
wbuf
.
begin
(),
wbuf
.
end
(),
T
(
0
));
}
...
@@ -680,8 +681,8 @@ template<typename T, typename Serv> void x2grid_c
...
@@ -680,8 +681,8 @@ template<typename T, typename Serv> void x2grid_c
{
{
Helper
<
T
>
hlp
(
gconf
,
nullptr
,
grid
.
vdata
(),
locks
,
w0
,
dw
);
Helper
<
T
>
hlp
(
gconf
,
nullptr
,
grid
.
vdata
(),
locks
,
w0
,
dw
);
int
jump
=
hlp
.
lineJump
();
int
jump
=
hlp
.
lineJump
();
const
T
*
DUCC0_RESTRICT
ku
=
hlp
.
kernel
;
const
T
*
DUCC0_RESTRICT
ku
=
hlp
.
kernel
.
scalar
;
const
T
*
DUCC0_RESTRICT
kv
=
hlp
.
kernel
+
supp
;
const
T
*
DUCC0_RESTRICT
kv
=
hlp
.
kernel
.
scalar
+
supp
;
while
(
auto
rng
=
sched
.
getNext
())
for
(
auto
ipart
=
rng
.
lo
;
ipart
<
rng
.
hi
;
++
ipart
)
while
(
auto
rng
=
sched
.
getNext
())
for
(
auto
ipart
=
rng
.
lo
;
ipart
<
rng
.
hi
;
++
ipart
)
{
{
...
@@ -728,8 +729,8 @@ template<typename T, typename Serv> void grid2x_c
...
@@ -728,8 +729,8 @@ template<typename T, typename Serv> void grid2x_c
{
{
Helper
<
T
>
hlp
(
gconf
,
grid
.
data
(),
nullptr
,
locks
,
w0
,
dw
);
Helper
<
T
>
hlp
(
gconf
,
grid
.
data
(),
nullptr
,
locks
,
w0
,
dw
);
int
jump
=
hlp
.
lineJump
();
int
jump
=
hlp
.
lineJump
();
const
T
*
DUCC0_RESTRICT
ku
=
hlp
.
kernel
;
const
T
*
DUCC0_RESTRICT
ku
=
hlp
.
kernel
.
scalar
;
const
T
*
DUCC0_RESTRICT
kv
=
hlp
.
kernel
+
supp
;
const
T
*
DUCC0_RESTRICT
kv
=
hlp
.
kernel
.
scalar
+
supp
;
while
(
auto
rng
=
sched
.
getNext
())
for
(
auto
ipart
=
rng
.
lo
;
ipart
<
rng
.
hi
;
++
ipart
)
while
(
auto
rng
=
sched
.
getNext
())
for
(
auto
ipart
=
rng
.
lo
;
ipart
<
rng
.
hi
;
++
ipart
)
{
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment