Commit 8f743c8b authored by root's avatar root
Browse files

unpacker tester code running

parent 1756e60f
......@@ -63,6 +63,7 @@ void unpack_edd_12bit_to_float32(uint64_t const* __restrict__ in, float* __restr
sout[12] = (float)((int64_t)(( 0x0000FFF000000000 & val) << 16) >> 52);
sout[13] = (float)((int64_t)(( 0x0000000FFF000000 & val) << 28) >> 52);
sout[14] = (float)((int64_t)(( 0x0000000000FFF000 & val) << 40) >> 52);
sout[15] = (float)((int64_t)(( 0x0000000000000FFF & val) << 52) >> 52);
__syncthreads();
int block_write_start = block_idx * EDD_NTHREADS_UNPACK * 16;
for (int ii = threadIdx.x; ii < 16 * EDD_NTHREADS_UNPACK; ii += blockDim.x)
......@@ -152,4 +153,4 @@ void Unpacker::unpack<8>(InputType const& input, OutputType& output)
} //namespace edd
} //namespace effelsberg
} //namespace psrdada_cpp
\ No newline at end of file
} //namespace psrdada_cpp
......@@ -180,6 +180,7 @@ void UnpackerTester::unpacker_8_to_32_c_reference(
output.reserve(input.size() * 8);
for (uint64_t val: input)
{
val = be64toh(val);
output.push_back(static_cast<float>(
static_cast<int64_t>((0xFF00000000000000 & val) << 0) >> 56));
output.push_back(static_cast<float>(
......@@ -207,7 +208,7 @@ void UnpackerTester::compare_against_host(
ASSERT_EQ(host_output.size(), copy_from_gpu.size());
for (std::size_t ii = 0; ii < host_output.size(); ++ii)
{
ASSERT_EQ(host_output[ii], copy_from_gpu[ii]);
ASSERT_EQ(host_output[ii], copy_from_gpu[ii]);
}
}
......@@ -232,7 +233,7 @@ TEST_F(UnpackerTester, 12_bit_unpack_test)
TEST_F(UnpackerTester, 8_bit_unpack_test)
{
std::size_t n = 1024;
std::size_t n = 512 * 8;
std::default_random_engine generator;
std::uniform_int_distribution<int> distribution(1,1<<31);
InputType host_input(n);
......@@ -253,4 +254,4 @@ TEST_F(UnpackerTester, 8_bit_unpack_test)
} //namespace test
} //namespace edd
} //namespace meerkat
} //namespace psrdada_cpp
\ No newline at end of file
} //namespace psrdada_cpp
Supports Markdown
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