Commit 7f44fd00 authored by root's avatar root
Browse files

channeliser tests running

parent 60b5baa6
......@@ -30,7 +30,7 @@ Channeliser<HandlerType>::Channeliser(
BOOST_LOG_TRIVIAL(debug)
<< "Creating new Channeliser instance with parameters: \n"
<< "fft_length = " << _fft_length << "\n"
<< "naccumulate = " << _naccumulate;
<< "nbits = " << _nbits;
std::size_t nsamps_per_buffer = buffer_bytes * 8 / nbits;
assert(nsamps_per_buffer % _fft_length == 0 /*Number of samples is not multiple of FFT size*/);
std::size_t n64bit_words = buffer_bytes / sizeof(uint64_t);
......@@ -38,7 +38,7 @@ Channeliser<HandlerType>::Channeliser(
int batch = nsamps_per_buffer/_fft_length;
BOOST_LOG_TRIVIAL(debug) << "Calculating scales and offsets";
float scale = std::sqrt(_nchans) * input_level;
BOOST_LOG_TRIVIAL(debug) << "Correction factors for 8-bit conversion: offset = " << offset << ", scaling = " << scaling;
BOOST_LOG_TRIVIAL(debug) << "Correction factors for 8-bit conversion: scaling = " << scale;
BOOST_LOG_TRIVIAL(debug) << "Generating FFT plan";
int n[] = {static_cast<int>(_fft_length)};
//Not we put this into transposed output order, so the inner dimension will be time.
......@@ -84,7 +84,7 @@ void Channeliser<HandlerType>::init(RawBytes& block)
template <class HandlerType>
void Channeliser<HandlerType>::process(
thrust::device_vector<RawVoltageType> const& digitiser_raw,
thrust::device_vector<PackedChannelisedVoltageType>& packed_channelised))
thrust::device_vector<PackedChannelisedVoltageType>& packed_channelised)
{
BOOST_LOG_TRIVIAL(debug) << "Unpacking raw voltages";
switch (_nbits)
......@@ -100,7 +100,7 @@ void Channeliser<HandlerType>::process(
(cufftReal*) _unpacked_voltage_ptr,
(cufftComplex*) _channelised_voltage_ptr));
CUDA_ERROR_CHECK(cudaStreamSynchronize(_proc_stream));
_transposer.transpose(_channelised_voltage, _packed_channelised_voltage);
_transposer->transpose(_channelised_voltage, packed_channelised);
}
template <class HandlerType>
......
......@@ -139,7 +139,7 @@ void Unpacker::unpack<12>(InputType const& input, OutputType& output)
template <>
void Unpacker::unpack<8>(InputType const& input, OutputType& output)
{
BOOST_LOG_TRIVIAL(debug) << "Unpacking 12-bit data";
BOOST_LOG_TRIVIAL(debug) << "Unpacking 8-bit data";
std::size_t output_size = input.size() * 8;
BOOST_LOG_TRIVIAL(debug) << "Resizing output buffer to " << output_size << " elements";
output.resize(output_size);
......
......@@ -21,7 +21,7 @@ protected:
public:
ChanneliserTester();
~ChanneliserTester();
void performance_test(std::size_t nchans, std::size_t nsamps_per_packet, std::size_t nbits);
void performance_test(std::size_t nchans, std::size_t nbits);
};
} //namespace test
......
......@@ -30,14 +30,6 @@ void ChanneliserTester::TearDown()
{
}
std::size_t buffer_bytes,
std::size_t fft_length,
std::size_t nbits,
float input_level,
float output_level,
HandlerType& handler
void ChanneliserTester::performance_test(std::size_t fft_length, std::size_t nbits)
{
std::size_t input_block_bytes = fft_length * 8192 * 1024 * nbits / 8;
......@@ -49,7 +41,7 @@ void ChanneliserTester::performance_test(std::size_t fft_length, std::size_t nbi
RawBytes header_raw_bytes(header_block.data(), 4096, 4096);
NullSink null_sink;
Channeliser<NullSink> channeliser(input_block_bytes, fft_length, nbits, 16.0f, 16.0f, null_sink);
spectrometer.init(header_raw_bytes);
channeliser.init(header_raw_bytes);
for (int ii = 0; ii < 100; ++ii)
{
channeliser(input_raw_bytes);
......@@ -59,7 +51,8 @@ void ChanneliserTester::performance_test(std::size_t fft_length, std::size_t nbi
TEST_F(ChanneliserTester, simple_exec_test)
{
performance_test(1024, 16, 128, 12);
performance_test(16, 12);
performance_test(32, 8);
}
} //namespace test
......
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