diff --git a/libtcc/Correlator.cc b/libtcc/Correlator.cc index 2fadd516be765beeb964a579130ed211244c5b61..9d189d22ceb474d82858fe2d13277daec955aecb 100644 --- a/libtcc/Correlator.cc +++ b/libtcc/Correlator.cc @@ -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 { return nrReceivers <= 32 ? 32 : diff --git a/libtcc/Correlator.h b/libtcc/Correlator.h index ce93ae1dbb4494cf948f39afda86883fa61de4de..5f705340e8a0679098f06d01972170c73c70b124 100644 --- a/libtcc/Correlator.h +++ b/libtcc/Correlator.h @@ -23,6 +23,16 @@ namespace tcc { const std::string &customStoreVisibility = "" ); // 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(CUstream, CUdeviceptr visibilities, CUdeviceptr samples, bool add = false); // throw (cu::Error)