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
MPIfR-BDG
psrdada_cpp
Commits
9f17395b
Commit
9f17395b
authored
Apr 15, 2021
by
Tobias Winchen
Browse files
Check heap loss on zero bit of ICD
parent
418e19c7
Changes
3
Hide whitespace changes
Inline
Side-by-side
psrdada_cpp/effelsberg/edd/detail/GatedSpectrometer.cu
View file @
9f17395b
...
...
@@ -389,7 +389,7 @@ void GatedSpectrometer<HandlerType, InputType, OutputType>::process(SinglePolari
const
int
heaps_per_output_spectra
=
inputDataStream
->
_sideChannelData_h
.
size
()
/
_naccumulate
/
_nBlocks
;
for
(
int
j
=
output_block_number
*
heaps_per_output_spectra
;
j
<
(
output_block_number
+
1
)
*
heaps_per_output_spectra
*
_dadaBufferLayout
.
getNSideChannels
();
j
+=
_dadaBufferLayout
.
getNSideChannels
())
{
if
(
TEST_BIT
(
inputDataStream
->
_sideChannelData_h
.
a
().
data
()[
j
],
42
))
if
(
TEST_BIT
(
inputDataStream
->
_sideChannelData_h
.
a
().
data
()[
j
],
3
))
{
// heap was lost
continue
;
}
...
...
@@ -454,7 +454,7 @@ void GatedSpectrometer<HandlerType, InputType, OutputType>::process(DualPolariza
const
int
heaps_per_output_spectra
=
inputDataStream
->
polarization0
.
_sideChannelData_h
.
size
()
/
_naccumulate
/
_nBlocks
;
for
(
int
j
=
output_block_number
*
heaps_per_output_spectra
;
j
<
(
output_block_number
+
1
)
*
heaps_per_output_spectra
*
_dadaBufferLayout
.
getNSideChannels
();
j
+=
_dadaBufferLayout
.
getNSideChannels
())
{
if
(
TEST_BIT
(
inputDataStream
->
polarization0
.
_sideChannelData_h
.
a
().
data
()[
j
],
42
)
||
TEST_BIT
(
inputDataStream
->
polarization1
.
_sideChannelData_h
.
a
().
data
()[
j
],
42
))
if
(
TEST_BIT
(
inputDataStream
->
polarization0
.
_sideChannelData_h
.
a
().
data
()[
j
],
3
)
||
TEST_BIT
(
inputDataStream
->
polarization1
.
_sideChannelData_h
.
a
().
data
()[
j
],
3
))
{
lostHeaps
++
;
// thiss heap was lost, do not count
...
...
psrdada_cpp/effelsberg/edd/src/GatedSpectrometer.cu
View file @
9f17395b
...
...
@@ -49,7 +49,7 @@ __global__ void gating(float* __restrict__ G0,
selectedSideChannel
];
const
unsigned
int
bit_set
=
TEST_BIT
(
sideChannelItem
,
bitpos
);
const
unsigned
int
heap_lost
=
TEST_BIT
(
sideChannelItem
,
6
3
);
const
unsigned
int
heap_lost
=
TEST_BIT
(
sideChannelItem
,
3
);
G1
[
i
]
=
(
v
-
baseLineG1
)
*
bit_set
*
(
!
heap_lost
)
+
baseLineG1
;
G0
[
i
]
=
(
v
-
baseLineG0
)
*
(
!
bit_set
)
*
(
!
heap_lost
)
+
baseLineG0
;
...
...
psrdada_cpp/effelsberg/edd/test/src/GatedSpectrometerTest.cu
View file @
9f17395b
...
...
@@ -383,12 +383,12 @@ class GatedTestSinkFullStokes{
for
(
int
i
=
0
;
i
<
4
;
i
++
)
{
uint64_t
*
S
=
reinterpret_cast
<
uint64_t
*>
(
buf
.
ptr
()
+
8
*
nchans
*
32
/
8
+
i
*
2
*
sizeof
(
size_t
));
EXPECT_EQ
(
S
[
0
],
nHeaps
*
4096
);
// expect samples from two polarizations
EXPECT_EQ
(
S
[
2
],
nHeaps
*
4096
);
EXPECT_EQ
(
S
[
0
],
nHeaps
*
4096
)
<<
"S"
<<
i
;
// expect samples from two polarizations
EXPECT_EQ
(
S
[
2
],
nHeaps
*
4096
)
<<
"S"
<<
i
;
// Correct number of overflowed samples
EXPECT_EQ
(
S
[
1
],
27
+
7
);
EXPECT_EQ
(
S
[
3
],
23
+
3
);
// First heap has 23 and bit set, thus G1
EXPECT_EQ
(
S
[
1
],
27
+
7
)
<<
"S"
<<
i
;
;
EXPECT_EQ
(
S
[
3
],
23
+
3
)
<<
"S"
<<
i
;
;
// First heap has 23 and bit set, thus G1
}
call_count
++
;
...
...
@@ -435,10 +435,10 @@ TEST(GatedSpectrometer, processingFullStokes)
uint64_t
*
sc_items
=
reinterpret_cast
<
uint64_t
*>
(
raw_buffer
+
2
*
nHeaps
*
4096
);
for
(
int
i
=
0
;
i
<
2
*
nHeaps
;
i
+=
4
)
{
sc_items
[
i
]
=
0
;
sc_items
[
i
+
1
]
=
0
;
sc_items
[
i
+
2
]
=
0
;
sc_items
[
i
+
3
]
=
0
;
sc_items
[
i
]
=
0
L
;
sc_items
[
i
+
1
]
=
0
L
;
sc_items
[
i
+
2
]
=
0
L
;
sc_items
[
i
+
3
]
=
0
L
;
SET_BIT
(
sc_items
[
i
],
0
);
SET_BIT
(
sc_items
[
i
+
1
],
0
);
}
...
...
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