37 #ifndef GNSS_SDR_PCPS_OPENCL_ACQUISITION_CC_H 38 #define GNSS_SDR_PCPS_OPENCL_ACQUISITION_CC_H 40 #define CL_SILENCE_DEPRECATION 48 #include <gnuradio/block.h> 49 #include <gnuradio/gr_complex.h> 50 #include "opencl/cl.hpp" 65 using pcps_opencl_acquisition_cc_sptr = gnss_shared_ptr<pcps_opencl_acquisition_cc>;
67 pcps_opencl_acquisition_cc_sptr pcps_make_opencl_acquisition_cc(
const Acq_Conf& conf, uint32_t max_dwells);
90 d_gnss_synchro = p_gnss_synchro;
96 inline uint32_t
mag()
const override 136 d_channel_fsm = channel_fsm;
139 inline bool opencl_ready()
const 149 void acquisition_core_volk();
151 void acquisition_core_opencl();
156 int general_work(
int noutput_items, gr_vector_int& ninput_items,
157 gr_vector_const_void_star& input_items,
158 gr_vector_void_star& output_items)
override;
161 friend pcps_opencl_acquisition_cc_sptr
162 pcps_make_opencl_acquisition_cc(
const Acq_Conf& conf, uint32_t max_dwells);
166 void calculate_magnitudes(gr_complex* fft_begin,
int doppler_shift,
int doppler_offset);
168 int init_opencl_environment(
const std::string& kernel_filename);
170 cl::Platform d_cl_platform;
171 cl::Device d_cl_device;
172 cl::Context d_cl_context;
173 cl::Program d_cl_program;
174 cl::Buffer* d_cl_buffer_in;
175 cl::Buffer* d_cl_buffer_fft_codes;
176 cl::Buffer* d_cl_buffer_1;
177 cl::Buffer* d_cl_buffer_2;
178 cl::Buffer* d_cl_buffer_magnitude;
179 cl::Buffer** d_cl_buffer_grid_doppler_wipeoffs;
180 cl::CommandQueue* d_cl_queue;
181 clFFT_Plan d_cl_fft_plan;
182 cl_int d_cl_fft_batch_size;
184 std::string d_satellite_str;
187 std::ofstream d_dump_file;
191 uint64_t d_sample_counter;
193 int* d_max_doppler_indexs;
197 float d_test_statistics;
202 uint32_t d_max_dwells;
203 uint32_t d_well_count;
204 const uint32_t d_fft_size;
205 uint32_t d_fft_size_pow2;
206 uint32_t d_num_doppler_bins;
207 uint32_t d_code_phase;
209 uint32_t d_in_dwell_count;
214 std::weak_ptr<ChannelFsm> d_channel_fsm;
216 std::unique_ptr<gnss_fft_complex_fwd> d_fft_if;
217 std::unique_ptr<gnss_fft_complex_rev> d_ifft;
219 std::vector<std::vector<gr_complex>> d_grid_doppler_wipeoffs;
220 std::vector<std::vector<gr_complex>> d_in_buffer;
221 std::vector<gr_complex> d_fft_codes;
222 std::vector<gr_complex> d_zero_vector;
223 std::vector<uint64_t> d_sample_counter_buffer;
224 std::vector<float> d_magnitude;
230 #endif // GNSS_SDR_PCPS_OPENCL_ACQUISITION_CC_H Helper file for FFT interface.
Header file of the interface to an acquisition implementation GNSS block.
void set_active(bool active) override
Starts acquisition algorithm, turning from standby mode to active mode.
void set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) override
Set acquisition/tracking common Gnss_Synchro object pointer to exchange synchronization data between ...
int general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) override
Parallel Code Phase Search Acquisition signal processing.
Internals of FFT for OpenCL.
Class that contains all the configuration parameters for generic acquisition block based on the PCPS ...
Interface of the State Machine for channel.
uint32_t mag() const override
Returns the maximum peak of grid search.
This is the class that contains the information that is shared by the processing blocks.
void set_channel(uint32_t channel) override
Set acquisition channel unique ID.
This interface represents a GNSS block.
void set_local_code(std::complex< float > *code) override
Sets local code for PCPS acquisition algorithm.
This class implements a Parallel Code Phase Search Acquisition.
~pcps_opencl_acquisition_cc()
Default destructor.
This abstract class represents an interface to an acquisition GNSS block.
Interface of the Gnss_Synchro class.
void set_channel_fsm(std::weak_ptr< ChannelFsm > channel_fsm) override
Set channel fsm associated to this acquisition instance.