Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
psrdada_cpp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MPIfR-BDG
psrdada_cpp
Commits
c683d17f
Commit
c683d17f
authored
Apr 14, 2021
by
Tobias Winchen
Browse files
Options
Downloads
Patches
Plain Diff
IMproved speed in stokes accumulate for low channel number
parent
258f6127
No related branches found
No related tags found
1 merge request
!9
Gated spectrometer low channel numbers and saturated samples
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
psrdada_cpp/effelsberg/edd/src/GatedSpectrometer.cu
+34
-27
34 additions, 27 deletions
psrdada_cpp/effelsberg/edd/src/GatedSpectrometer.cu
with
34 additions
and
27 deletions
psrdada_cpp/effelsberg/edd/src/GatedSpectrometer.cu
+
34
−
27
View file @
c683d17f
...
@@ -137,35 +137,42 @@ __host__ __device__ void stokes_IQUV(const float2 &p1, const float2 &p2, float &
...
@@ -137,35 +137,42 @@ __host__ __device__ void stokes_IQUV(const float2 &p1, const float2 &p2, float &
* @brief calculate stokes IQUV spectra pol1, pol2 are arrays of naccumulate
* @brief calculate stokes IQUV spectra pol1, pol2 are arrays of naccumulate
* complex spectra for individual polarizations
* complex spectra for individual polarizations
*/
*/
__global__
void
stokes_accumulate
(
float2
const
__restrict__
*
pol1
,
__global__
void
stokes_accumulate
(
float2
const
*
__restrict__
pol1
,
float2
const
__restrict__
*
pol2
,
float
*
I
,
float
*
Q
,
float
*
U
,
float
*
V
,
float2
const
*
__restrict__
pol2
,
float
*
I
,
int
nchans
,
int
naccumulate
)
float
*
Q
,
float
*
U
,
float
*
V
,
int
nchans
,
{
int
naccumulate
)
{
const
int
nb
=
naccumulate
/
blockDim
.
x
+
1
;
const
int
bs
=
blockDim
.
x
;
for
(
size_t
i
=
blockIdx
.
x
*
blockDim
.
x
+
threadIdx
.
x
;
(
i
<
nchans
*
nb
);
i
+=
blockDim
.
x
*
gridDim
.
x
)
{
const
size_t
channel_number
=
i
%
nchans
;
const
size_t
bn
=
i
/
nchans
;
for
(
size_t
i
=
blockIdx
.
x
*
blockDim
.
x
+
threadIdx
.
x
;
(
i
<
nchans
);
i
+=
blockDim
.
x
*
gridDim
.
x
)
{
float
rI
=
0
;
float
rI
=
0
;
float
rQ
=
0
;
float
rQ
=
0
;
float
rU
=
0
;
float
rU
=
0
;
float
rV
=
0
;
float
rV
=
0
;
for
(
int
k
=
0
;
k
<
naccumulate
;
k
++
)
for
(
int
k
=
0
;
k
<
bs
;
k
++
)
{
{
int
cidx
=
k
+
bn
*
bs
;
const
float2
p1
=
pol1
[
i
+
k
*
nchans
];
if
(
cidx
>=
naccumulate
)
const
float2
p2
=
pol2
[
i
+
k
*
nchans
];
break
;
const
float2
p1
=
pol1
[
channel_number
+
cidx
*
nchans
];
const
float2
p2
=
pol2
[
channel_number
+
cidx
*
nchans
];
rI
+=
fabs
(
p1
.
x
*
p1
.
x
+
p1
.
y
*
p1
.
y
)
+
fabs
(
p2
.
x
*
p2
.
x
+
p2
.
y
*
p2
.
y
);
rI
+=
fabs
(
p1
.
x
*
p1
.
x
+
p1
.
y
*
p1
.
y
)
+
fabs
(
p2
.
x
*
p2
.
x
+
p2
.
y
*
p2
.
y
);
rQ
+=
fabs
(
p1
.
x
*
p1
.
x
+
p1
.
y
*
p1
.
y
)
-
fabs
(
p2
.
x
*
p2
.
x
+
p2
.
y
*
p2
.
y
);
rQ
+=
fabs
(
p1
.
x
*
p1
.
x
+
p1
.
y
*
p1
.
y
)
-
fabs
(
p2
.
x
*
p2
.
x
+
p2
.
y
*
p2
.
y
);
rU
+=
2.f
*
(
p1
.
x
*
p2
.
x
+
p1
.
y
*
p2
.
y
);
rU
+=
2.f
*
(
p1
.
x
*
p2
.
x
+
p1
.
y
*
p2
.
y
);
rV
+=
-
2.f
*
(
p1
.
y
*
p2
.
x
-
p1
.
x
*
p2
.
y
);
rV
+=
-
2.f
*
(
p1
.
y
*
p2
.
x
-
p1
.
x
*
p2
.
y
);
}
}
I
[
i
]
+=
rI
;
Q
[
i
]
+=
rQ
;
U
[
i
]
+=
rU
;
V
[
i
]
+=
rV
;
}
atomicAdd
(
&
I
[
channel_number
],
rI
);
atomicAdd
(
&
Q
[
channel_number
],
rQ
);
atomicAdd
(
&
U
[
channel_number
],
rU
);
atomicAdd
(
&
V
[
channel_number
],
rV
);
}
}
}
...
...
...
...
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
sign in
to comment