Skip to content
Snippets Groups Projects
Commit 71f1161c authored by John Romein's avatar John Romein
Browse files

Added backward-compatible tcc::Correlator() constructor.

parent 21f4fb69
No related branches found
No related tags found
1 merge request!15Fp8
Pipeline #116427 passed
...@@ -52,6 +52,35 @@ Correlator::Correlator(const cu::Device &device, ...@@ -52,6 +52,35 @@ Correlator::Correlator(const cu::Device &device,
} }
Correlator::Correlator(const cu::Device &device,
unsigned nrBits,
unsigned nrReceivers,
unsigned nrChannels,
unsigned nrSamplesPerChannel,
unsigned nrPolarizations,
unsigned nrReceiversPerBlock,
const std::string &customStoreVisibility
)
:
Correlator(device,
[&] () -> Format {
switch (nrBits) {
case 4 : return Format::i4;
case 8 : return Format::i8;
case 16 : return Format::fp16;
default : throw std::invalid_argument("nrBits should be 4, 8, or 16");
}
} (),
nrReceivers,
nrChannels,
nrSamplesPerChannel,
nrPolarizations,
nrReceiversPerBlock,
customStoreVisibility)
{
}
unsigned Correlator::defaultNrReceiversPerBlock(unsigned nrReceivers) const unsigned Correlator::defaultNrReceiversPerBlock(unsigned nrReceivers) const
{ {
return nrReceivers <= 32 ? 32 : return nrReceivers <= 32 ? 32 :
......
...@@ -23,6 +23,16 @@ namespace tcc { ...@@ -23,6 +23,16 @@ namespace tcc {
const std::string &customStoreVisibility = "" const std::string &customStoreVisibility = ""
); // throw (cu::Error, nvrtc::Error) ); // throw (cu::Error, nvrtc::Error)
[[deprecated]] Correlator(const cu::Device &,
unsigned nrBits,
unsigned nrReceivers,
unsigned nrChannels,
unsigned nrSamplesPerChannel,
unsigned nrPolarizations = 2,
unsigned nrReceiversPerBlock = 0, // 0: use a heuristic value that should work well
const std::string &customStoreVisibility = ""
); // throw (cu::Error, nvrtc::Error)
void launchAsync(cu::Stream &, cu::DeviceMemory &visibilities, cu::DeviceMemory &samples, bool add = false); // throw (cu::Error) void launchAsync(cu::Stream &, cu::DeviceMemory &visibilities, cu::DeviceMemory &samples, bool add = false); // throw (cu::Error)
void launchAsync(CUstream, CUdeviceptr visibilities, CUdeviceptr samples, bool add = false); // throw (cu::Error) void launchAsync(CUstream, CUdeviceptr visibilities, CUdeviceptr samples, bool add = false); // throw (cu::Error)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment