Commit 73c5c92f authored by Sarod Yatawatta's avatar Sarod Yatawatta

add quantization to incoherent pipeline

parent 2c896150
......@@ -116,7 +116,7 @@ namespace LOFAR
size_t nrCoherent(const BlockID &blockID) const;
// FIXME
// Quantizer
std::unique_ptr<QuantizeOutputKernel> quantizeOutputKernel;
// flag to remember if quantization is enabled or not
......
......@@ -71,7 +71,11 @@ namespace LOFAR
"FFT (incoherent, final)"))
: NULL),
incoherentStokes(IncoherentStokesKernel::Parameters(ps))
incoherentStokes(IncoherentStokesKernel::Parameters(ps)),
quantizeOutput(ps.settings.beamFormer.incoherentSettings.quantizerSettings.enabled
? new KernelFactory<QuantizeOutputKernel>(QuantizeOutputKernel::Parameters(ps))
: NULL) //FIXME
{
}
......@@ -85,7 +89,8 @@ namespace LOFAR
:
ProcessStep(parset, i_queue),
incoherentStokesPPF(factories.incoherentFirFilter != NULL),
outputCounter(context, "output (incoherent)")
outputCounter(context, "output (incoherent)"),
quantizeOutputFlag(factories.quantizeOutput!= NULL)
{
devA = i_devA;
devB = i_devB;
......@@ -121,10 +126,17 @@ namespace LOFAR
incoherentStokesKernel = std::unique_ptr<IncoherentStokesKernel>(
factories.incoherentStokes.create(
queue, *devA, *devB));
if (quantizeOutputFlag) {
quantizeOutputKernel = std::unique_ptr<QuantizeOutputKernel>(
factories.quantizeOutput->create(queue,
*devB, *devA));
}
}
gpu::DeviceMemory BeamFormerIncoherentStep::outputBuffer() {
return *devB;
return (quantizeOutputFlag? *devA: *devB);
}
......@@ -159,6 +171,11 @@ namespace LOFAR
}
incoherentStokesKernel->enqueue(input.blockID);
if (quantizeOutputFlag) {
quantizeOutputKernel->enqueue(input.blockID); //FIXME
}
}
......@@ -168,7 +185,7 @@ namespace LOFAR
return;
output.incoherentData.resizeOneDimensionInplace(0, nrIncoherent(output.blockID));
queue.readBuffer(output.incoherentData, outputBuffer(), outputCounter, false);
queue.readBuffer(output.incoherentData, outputBuffer(), outputCounter, false); //FIXME
}
}
}
......@@ -42,6 +42,7 @@
#include <GPUProc/Kernels/FIR_FilterKernel.h>
#include <GPUProc/Kernels/IncoherentStokesKernel.h>
#include <GPUProc/Kernels/IncoherentStokesTransposeKernel.h>
#include <GPUProc/Kernels/QuantizeOutputKernel.h>
namespace LOFAR
......@@ -61,6 +62,7 @@ namespace LOFAR
SmartPtr< KernelFactory<FIR_FilterKernel> > incoherentFirFilter;
SmartPtr< KernelFactory<FFT_Kernel> > incoherentFinalFFT;
KernelFactory<IncoherentStokesKernel> incoherentStokes;
SmartPtr< KernelFactory<QuantizeOutputKernel> > quantizeOutput; //FIXME
};
BeamFormerIncoherentStep(const Parset &parset,
......@@ -105,6 +107,12 @@ namespace LOFAR
PerformanceCounter outputCounter;
// Quantizer
std::unique_ptr<QuantizeOutputKernel> quantizeOutputKernel;
// flag to remember if quantization is enabled or not
const bool quantizeOutputFlag;
size_t nrIncoherent(const BlockID &blockID) const;
};
}
......
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