Skip to content
Snippets Groups Projects
Commit 9f17395b authored by Tobias Winchen's avatar Tobias Winchen
Browse files

Check heap loss on zero bit of ICD

parent 418e19c7
Branches
Tags
1 merge request!9Gated spectrometer low channel numbers and saturated samples
...@@ -389,7 +389,7 @@ void GatedSpectrometer<HandlerType, InputType, OutputType>::process(SinglePolari ...@@ -389,7 +389,7 @@ void GatedSpectrometer<HandlerType, InputType, OutputType>::process(SinglePolari
const int heaps_per_output_spectra = inputDataStream->_sideChannelData_h.size() / _naccumulate / _nBlocks; 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()) 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 { // heap was lost
continue; continue;
} }
...@@ -454,7 +454,7 @@ void GatedSpectrometer<HandlerType, InputType, OutputType>::process(DualPolariza ...@@ -454,7 +454,7 @@ void GatedSpectrometer<HandlerType, InputType, OutputType>::process(DualPolariza
const int heaps_per_output_spectra = inputDataStream->polarization0._sideChannelData_h.size() / _naccumulate / _nBlocks; 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()) 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++; lostHeaps++;
// thiss heap was lost, do not count // thiss heap was lost, do not count
... ...
......
...@@ -49,7 +49,7 @@ __global__ void gating(float* __restrict__ G0, ...@@ -49,7 +49,7 @@ __global__ void gating(float* __restrict__ G0,
selectedSideChannel]; selectedSideChannel];
const unsigned int bit_set = TEST_BIT(sideChannelItem, bitpos); const unsigned int bit_set = TEST_BIT(sideChannelItem, bitpos);
const unsigned int heap_lost = TEST_BIT(sideChannelItem, 63); const unsigned int heap_lost = TEST_BIT(sideChannelItem, 3);
G1[i] = (v - baseLineG1) * bit_set * (!heap_lost) + baseLineG1; G1[i] = (v - baseLineG1) * bit_set * (!heap_lost) + baseLineG1;
G0[i] = (v - baseLineG0) * (!bit_set) *(!heap_lost) + baseLineG0; G0[i] = (v - baseLineG0) * (!bit_set) *(!heap_lost) + baseLineG0;
... ...
......
...@@ -383,12 +383,12 @@ class GatedTestSinkFullStokes{ ...@@ -383,12 +383,12 @@ class GatedTestSinkFullStokes{
for(int i =0; i <4; i++) 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)); 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[0], nHeaps * 4096) << "S" << i; // expect samples from two polarizations
EXPECT_EQ(S[2], nHeaps * 4096); EXPECT_EQ(S[2], nHeaps * 4096) << "S" << i;
// Correct number of overflowed samples // Correct number of overflowed samples
EXPECT_EQ(S[1], 27 + 7); EXPECT_EQ(S[1], 27 + 7) << "S" << i;;
EXPECT_EQ(S[3], 23 + 3); // First heap has 23 and bit set, thus G1 EXPECT_EQ(S[3], 23 + 3) << "S" << i;; // First heap has 23 and bit set, thus G1
} }
call_count ++; call_count ++;
...@@ -435,10 +435,10 @@ TEST(GatedSpectrometer, processingFullStokes) ...@@ -435,10 +435,10 @@ TEST(GatedSpectrometer, processingFullStokes)
uint64_t* sc_items = reinterpret_cast<uint64_t*>(raw_buffer + 2*nHeaps * 4096); uint64_t* sc_items = reinterpret_cast<uint64_t*>(raw_buffer + 2*nHeaps * 4096);
for (int i = 0; i < 2 * nHeaps; i+=4) for (int i = 0; i < 2 * nHeaps; i+=4)
{ {
sc_items[i] = 0; sc_items[i] = 0L;
sc_items[i+1] = 0; sc_items[i+1] = 0L;
sc_items[i+2] = 0; sc_items[i+2] = 0L;
sc_items[i+3] = 0; sc_items[i+3] = 0L;
SET_BIT(sc_items[i], 0); SET_BIT(sc_items[i], 0);
SET_BIT(sc_items[i + 1], 0); SET_BIT(sc_items[i + 1], 0);
} }
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment