Commit 8f02e959 authored by Tobias Winchen's avatar Tobias Winchen
Browse files

Fix gated full stokes test

parent 6c23c2db
......@@ -166,7 +166,7 @@ struct PowerSpectrumOutput
DoubleDeviceBuffer<uint64_cu> _noOfBitSets;
/// Number of samples overflowed
DoubleHostBuffer<uint64_cu> _noOfOverflowed;
DoubleHostBuffer<uint64_t> _noOfOverflowed;
/// Swap output buffers and reset the buffer in given stream for new integration
......
......@@ -469,6 +469,9 @@ void GatedFullStokesOutput::swap(cudaStream_t &_proc_stream)
void GatedFullStokesOutput::data2Host(cudaStream_t &_d2h_stream)
{
BOOST_LOG_TRIVIAL(debug) << "Copying data2Host for " << G0._noOfBitSets.size() << " blocks.";
for (size_t i = 0; i < G0._noOfBitSets.size(); i++)
{
size_t memslicesize = (_nchans * sizeof(IntegratedPowerType));
......@@ -586,6 +589,7 @@ for (size_t i = 0; i < G0._noOfBitSets.size(); i++)
cudaMemcpyDeviceToHost, _d2h_stream));
std::memcpy(static_cast<void *>(_host_power.a_ptr() + memOffset + 8 * memslicesize + 15 * sizeof(size_t) ),
static_cast<void *>(G1._noOfOverflowed.b_ptr() + i ), 1 * sizeof(size_t) );
}
}
......
......@@ -382,13 +382,13 @@ class GatedTestSinkFullStokes{
// Expected half number of samples per gate
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) << "S" << i; // expect samples from two polarizations
EXPECT_EQ(S[2], nHeaps * 4096) << "S" << i;
uint64_t *S = reinterpret_cast<uint64_t*>(buf.ptr() + 8 *nchans * 32 /8 + i * 4 *sizeof(size_t));
EXPECT_EQ(S[0], nHeaps * 4096) << "G0, S" << i; // expect samples from two polarizations
EXPECT_EQ(S[2], nHeaps * 4096) << "G1, S" << i;
// Correct number of overflowed samples
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
EXPECT_EQ(S[1], 27 + 7) << "G0, S" << i;;
EXPECT_EQ(S[3], 23 + 3) << "G1, S" << i;; // First heap has 23+3 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] = 0L;
sc_items[i+1] = 0L;
sc_items[i+2] = 0L;
sc_items[i+3] = 0L;
sc_items[i] = 0uL;
sc_items[i+1] = 0uL;
sc_items[i+2] = 0uL;
sc_items[i+3] = 0uL;
SET_BIT(sc_items[i], 0);
SET_BIT(sc_items[i + 1], 0);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment