Fixing some problems with Boost round (works in darwin) and std::round (works in linux gcc). Also fixing building problems

git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@95 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
Carles Fernandez 2011-12-24 22:15:37 +00:00
parent baebfd96be
commit 181596a55e
8 changed files with 27 additions and 27 deletions

View File

@ -34,13 +34,10 @@
#include "gps_sdr_fft.h"
#include "gps_sdr_prn_codes_short.h"
#include "control_message_factory.h"
#ifdef NO_SIMD
#include "gps_sdr_x86.h"
#else
#include "gps_sdr_x86.h"
#ifndef NO_SIMD
#include "gps_sdr_simd.h"
#endif
#include <gnuradio/gr_io_signature.h>
#include <sstream>
@ -183,15 +180,13 @@ int gps_l1_ca_gps_sdr_acquisition_ss::general_work(int noutput_items,
<< " bytes into buffer (" << d_fft_size << " samples)";
memcpy(d_baseband_signal, in, d_fft_size * sizeof(CPX));
#ifdef NO_SIMD
x86_cmulsc(d_baseband_signal, d_sine_250,
x86_cmulsc(d_baseband_signal, d_sine_250,
&d_baseband_signal[d_fft_size], d_fft_size, 14);
x86_cmulsc(d_baseband_signal, d_sine_500, &d_baseband_signal[2
* d_fft_size], d_fft_size, 14);
x86_cmulsc(d_baseband_signal, d_sine_750, &d_baseband_signal[3
* d_fft_size], d_fft_size, 14);
x86_cmuls(d_baseband_signal, d_sine_if, d_fft_size, 14);
#else
sse_cmulsc(d_baseband_signal, d_sine_250,
&d_baseband_signal[d_fft_size], d_fft_size, 14);
@ -199,7 +194,6 @@ int gps_l1_ca_gps_sdr_acquisition_ss::general_work(int noutput_items,
* d_fft_size], d_fft_size, 14);
sse_cmulsc(d_baseband_signal, d_sine_750, &d_baseband_signal[3
* d_fft_size], d_fft_size, 14);
sse_cmuls(d_baseband_signal, d_sine_if, d_fft_size, 14);
#endif
for (unsigned int i = 0; i < d_doppler_resolution; i++)
@ -227,14 +221,12 @@ int gps_l1_ca_gps_sdr_acquisition_ss::general_work(int noutput_items,
x86_cmulsc(&d_baseband_signal_shift[(j * (d_fft_size + 201))
+ 100 + i], d_fft_codes[d_satellite], buffer,
d_fft_size, 10);
#else
sse_cmulsc(&d_baseband_signal_shift[(j * (d_fft_size + 201))
+ 100 + i], d_fft_codes[d_satellite], buffer,
d_fft_size, 10);
d_fft_size, 10);
#endif
d_piFFT->doiFFT(buffer, true);
d_piFFT->doiFFT(buffer, true);
x86_cmag(buffer, d_fft_size);
x86_max((unsigned int *)buffer, &indext, &magt, d_fft_size);

View File

@ -1,6 +1,6 @@
project : build-dir ../../../../build ;
obj gps_l1_ca_gps_sdr_acquisition_cc : gps_l1_ca_gps_sdr_acquisition_cc.cc ;
obj gps_l1_ca_gps_sdr_acquisition_ss : gps_l1_ca_gps_sdr_acquisition_ss.cc : <toolset>darwin:<define>NO_SIMD ;
obj gps_l1_ca_gps_sdr_acquisition_ss : gps_l1_ca_gps_sdr_acquisition_ss.cc : <toolset>darwin:<define>NO_SIMD <toolset>gcc:<define>USE_SIMD ;
obj gps_l1_ca_pcps_acquisition_cc : gps_l1_ca_pcps_acquisition_cc.cc ;
obj gps_l1_ca_tong_pcps_acquisition_cc : gps_l1_ca_tong_pcps_acquisition_cc.cc ;

View File

@ -20,9 +20,7 @@ write to the:
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
************************************************************************************************/
#ifdef NO_SIMD
#else
#ifdef USE_SIMD
#include "gps_sdr_simd.h"
// __asm

View File

@ -3,8 +3,8 @@ project : build-dir ../../../build ;
obj gps_sdr_signal_processing : gps_sdr_signal_processing.cc ;
obj gnss_sdr_valve : gnss_sdr_valve.cc ;
obj pass_through : pass_through.cc ;
obj gps_sdr_fft : gps_sdr_fft.cc : <toolset>darwin:<define>NO_SIMD ;
obj gps_sdr_simd : gps_sdr_simd.cc : <toolset>darwin:<define>NO_SIMD ;
obj gps_sdr_fft : gps_sdr_fft.cc : <toolset>darwin:<define>NO_SIMD <toolset>gcc:<define>USE_SIMD ;
obj gps_sdr_simd : gps_sdr_simd.cc : <toolset>darwin:<define>NO_SIMD <toolset>gcc:<define>USE_SIMD ;
obj gps_sdr_x86 : gps_sdr_x86.cc ;

View File

@ -36,7 +36,9 @@
#include "gps_l1_ca_dll_fll_pll_tracking.h"
#include "GPS_L1_CA.h"
#include "configuration_interface.h"
#include <boost/math/special_functions/round.hpp>
#ifdef GNSS_SDR_USE_BOOST_ROUND
#include <boost/math/special_functions/round.hpp>
#endif
#include <gnuradio/gr_io_signature.h>
#include <glog/log_severity.h>
@ -84,8 +86,12 @@ GpsL1CaDllFllPllTracking::GpsL1CaDllFllPllTracking(
std::string default_dump_filename = "./track_ch";
dump_filename = configuration->property(role + ".dump_filename",
default_dump_filename); //unused!
#ifdef USE_BOOST_ROUND
vector_length = round(fs_in / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS));
#else
vector_length = std::round(fs_in / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS));
#endif
//################# MAKE TRACKING GNURadio object ###################
if (item_type.compare("gr_complex") == 0)

View File

@ -36,7 +36,9 @@
#include "gps_l1_ca_dll_pll_tracking.h"
#include "GPS_L1_CA.h"
#include "configuration_interface.h"
#include <boost/math/special_functions/round.hpp>
#ifdef GNSS_SDR_USE_BOOST_ROUND
#include <boost/math/special_functions/round.hpp>
#endif
#include <gnuradio/gr_io_signature.h>
#include <glog/log_severity.h>
@ -80,9 +82,11 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking(
std::string default_dump_filename = "./track_ch";
dump_filename = configuration->property(role + ".dump_filename",
default_dump_filename); //unused!
#ifdef GNSS_SDR_USE_BOOST_CONST
vector_length = round(fs_in / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS));
#else
vector_length = std::round(fs_in / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS));
#endif
//################# MAKE TRACKING GNURadio object ###################
if (item_type.compare("gr_complex") == 0)
{

View File

@ -1,4 +1,4 @@
project : build-dir ../../../../build ;
obj gps_l1_ca_dll_pll_tracking : gps_l1_ca_dll_pll_tracking.cc ;
obj gps_l1_ca_dll_fll_pll_tracking : gps_l1_ca_dll_fll_pll_tracking.cc ;
obj gps_l1_ca_dll_pll_tracking : gps_l1_ca_dll_pll_tracking.cc : <toolset>darwin:<define>GNSS_SDR_USE_BOOST_ROUND ;
obj gps_l1_ca_dll_fll_pll_tracking : gps_l1_ca_dll_fll_pll_tracking.cc : <toolset>darwin:<define>GNSS_SDR_USE_BOOST_ROUND ;

View File

@ -16,7 +16,7 @@ exe gnss-sdr : main.cc
../algorithms/libs//gnss_sdr_valve
../algorithms/libs//pass_through
../algorithms/libs//gps_sdr_fft
#../algorithms/libs//gps_sdr_simd
../algorithms/libs//gps_sdr_simd
../algorithms/libs//gps_sdr_x86
../algorithms/observables/adapters//gps_l1_ca_observables
../algorithms/observables/gnuradio_blocks//gps_l1_ca_observables_cc