mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-31 07:13:03 +00:00 
			
		
		
		
	Avoid deprecation warnings when VOLK >= 3.1
Bump CMake max version to 3.28 Do not leak build system paths when cross-compiling. Fixes OpenEmbedded QA warning volk_gnsssdr: Fix 64-bit integer testing CI: Fix for Python 3.12
This commit is contained in:
		
							
								
								
									
										27
									
								
								.github/workflows/main.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										27
									
								
								.github/workflows/main.yml
									
									
									
									
										vendored
									
									
								
							| @@ -48,11 +48,10 @@ jobs: | ||||
|           rm /usr/local/bin/pydoc3 || true | ||||
|           rm /usr/local/bin/python3 || true | ||||
|           rm /usr/local/bin/python3-config || true | ||||
|           rm /usr/local/bin/2to3-3.11 || true | ||||
|           rm /usr/local/bin/idle3.11 || true | ||||
|           rm /usr/local/bin/pydoc3.11 || true | ||||
|           rm /usr/local/bin/python3.11 || true | ||||
|           rm /usr/local/bin/python3.11-config || true | ||||
|           rm /usr/local/bin/2to3-3.1* || true | ||||
|           rm /usr/local/bin/idle3.1* || true | ||||
|           rm /usr/local/bin/pydoc3.1* || true | ||||
|           rm /usr/local/bin/python3.1* || true | ||||
|           brew install ninja hdf5 automake armadillo lapack \ | ||||
|           gflags glog gnuradio log4cpp openssl pugixml protobuf | ||||
|           pip3 install mako | ||||
| @@ -77,11 +76,10 @@ jobs: | ||||
|           rm /usr/local/bin/pydoc3 || true | ||||
|           rm /usr/local/bin/python3 || true | ||||
|           rm /usr/local/bin/python3-config || true | ||||
|           rm /usr/local/bin/2to3-3.11 || true | ||||
|           rm /usr/local/bin/idle3.11 || true | ||||
|           rm /usr/local/bin/pydoc3.11 || true | ||||
|           rm /usr/local/bin/python3.11 || true | ||||
|           rm /usr/local/bin/python3.11-config || true | ||||
|           rm /usr/local/bin/2to3-3.1* || true | ||||
|           rm /usr/local/bin/idle3.1* || true | ||||
|           rm /usr/local/bin/pydoc3.1* || true | ||||
|           rm /usr/local/bin/python3.1* || true | ||||
|           brew install ninja pkg-config hdf5 automake armadillo lapack gflags glog \ | ||||
|           gnuradio log4cpp openssl pugixml protobuf | ||||
|           pip3 install mako | ||||
| @@ -125,11 +123,10 @@ jobs: | ||||
|           rm /usr/local/bin/pydoc3 || true | ||||
|           rm /usr/local/bin/python3 || true | ||||
|           rm /usr/local/bin/python3-config || true | ||||
|           rm /usr/local/bin/2to3-3.11 || true | ||||
|           rm /usr/local/bin/idle3.11 || true | ||||
|           rm /usr/local/bin/pydoc3.11 || true | ||||
|           rm /usr/local/bin/python3.11 || true | ||||
|           rm /usr/local/bin/python3.11-config || true | ||||
|           rm /usr/local/bin/2to3-3.1* || true | ||||
|           rm /usr/local/bin/idle3.1* || true | ||||
|           rm /usr/local/bin/pydoc3.1* || true | ||||
|           rm /usr/local/bin/python3.1* || true | ||||
|           brew install llvm pkg-config hdf5 armadillo lapack gflags glog gnuradio libmatio \ | ||||
|           log4cpp openssl pugixml protobuf | ||||
|           pip3 install mako | ||||
|   | ||||
| @@ -16,7 +16,7 @@ endif() | ||||
| # Build type can still be overridden by setting -DCMAKE_BUILD_TYPE= | ||||
| set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") | ||||
|  | ||||
| cmake_minimum_required(VERSION 2.8.12...3.27) | ||||
| cmake_minimum_required(VERSION 2.8.12...3.28) | ||||
| project(gnss-sdr CXX C) | ||||
|  | ||||
| set(GNSSSDR_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) # Allows to be a sub-project | ||||
|   | ||||
| @@ -46,6 +46,10 @@ All notable changes to GNSS-SDR will be documented in this file. | ||||
| - `volk_gnsssdr`: fix syntax for Python 3.12 without breaking backward | ||||
|   compatibility with Python 2.7. | ||||
| - Fixed linking against latest GNU Radio version. | ||||
| - Make use of new API if linking against VOLK >= 3.1. | ||||
| - Fixed undefined behaviour in `volk_gnsssdr` arising from incompatibility | ||||
|   between complex numbers in C and C++. | ||||
| - Now build system paths are not leaked when cross-compiling. | ||||
|  | ||||
| ### Improvements in Repeatability: | ||||
|  | ||||
|   | ||||
| @@ -101,6 +101,14 @@ if(ENABLE_OPENCL) | ||||
|     ) | ||||
| endif() | ||||
|  | ||||
| if(VOLK_VERSION) | ||||
|     if(VOLK_VERSION VERSION_GREATER 3.0.99) | ||||
|         target_compile_definitions(acquisition_gr_blocks | ||||
|             PRIVATE -DVOLK_EQUAL_OR_GREATER_31=1 | ||||
|         ) | ||||
|     endif() | ||||
| endif() | ||||
|  | ||||
| if(ENABLE_CLANG_TIDY) | ||||
|     if(CLANG_TIDY_EXE) | ||||
|         set_target_properties(acquisition_gr_blocks | ||||
|   | ||||
| @@ -184,10 +184,16 @@ void galileo_e5a_noncoherentIQ_acquisition_caf_cc::set_local_code(std::complex<f | ||||
|     if (d_sampled_ms > 1) | ||||
|         { | ||||
|             // DATA CODE B: First replica is inverted (0,1,1) | ||||
| #if VOLK_EQUAL_OR_GREATER_31 | ||||
|             auto minus_one = gr_complex(-1, 0); | ||||
|             volk_32fc_s32fc_multiply2_32fc(&(d_fft_if->get_inbuf())[0], | ||||
|                 &codeI[0], &minus_one, | ||||
|                 d_samples_per_code); | ||||
| #else | ||||
|             volk_32fc_s32fc_multiply_32fc(&(d_fft_if->get_inbuf())[0], | ||||
|                 &codeI[0], gr_complex(-1, 0), | ||||
|                 d_samples_per_code); | ||||
|  | ||||
| #endif | ||||
|             d_fft_if->execute();  // We need the FFT of local code | ||||
|  | ||||
|             // Conjugate the local code | ||||
| @@ -196,9 +202,16 @@ void galileo_e5a_noncoherentIQ_acquisition_caf_cc::set_local_code(std::complex<f | ||||
|             if (d_both_signal_components == true) | ||||
|                 { | ||||
|                     // PILOT CODE B: First replica is inverted (0,1,1) | ||||
| #if VOLK_EQUAL_OR_GREATER_31 | ||||
|                     auto minus_one = gr_complex(-1, 0); | ||||
|                     volk_32fc_s32fc_multiply2_32fc(&(d_fft_if->get_inbuf())[0], | ||||
|                         &codeQ[0], &minus_one, | ||||
|                         d_samples_per_code); | ||||
| #else | ||||
|                     volk_32fc_s32fc_multiply_32fc(&(d_fft_if->get_inbuf())[0], | ||||
|                         &codeQ[0], gr_complex(-1, 0), | ||||
|                         d_samples_per_code); | ||||
| #endif | ||||
|                     d_fft_if->execute();  // We need the FFT of local code | ||||
|  | ||||
|                     // Conjugate the local code | ||||
|   | ||||
| @@ -124,10 +124,16 @@ void galileo_pcps_8ms_acquisition_cc::set_local_code(std::complex<float> *code) | ||||
|     volk_32fc_conjugate_32fc(d_fft_code_A.data(), d_fft_if->get_outbuf(), d_fft_size); | ||||
|  | ||||
|     // code B: two replicas of a primary code; the second replica is inverted. | ||||
| #if VOLK_EQUAL_OR_GREATER_31 | ||||
|     auto minus_one = gr_complex(-1, 0); | ||||
|     volk_32fc_s32fc_multiply2_32fc(&(d_fft_if->get_inbuf())[d_samples_per_code], | ||||
|         &code[d_samples_per_code], &minus_one, | ||||
|         d_samples_per_code); | ||||
| #else | ||||
|     volk_32fc_s32fc_multiply_32fc(&(d_fft_if->get_inbuf())[d_samples_per_code], | ||||
|         &code[d_samples_per_code], gr_complex(-1, 0), | ||||
|         d_samples_per_code); | ||||
|  | ||||
| #endif | ||||
|     d_fft_if->execute();  // We need the FFT of local code | ||||
|  | ||||
|     // Conjugate the local code | ||||
|   | ||||
| @@ -8,7 +8,7 @@ | ||||
| ######################################################################## | ||||
| # Project setup | ||||
| ######################################################################## | ||||
| cmake_minimum_required(VERSION 2.8.12...3.27) | ||||
| cmake_minimum_required(VERSION 2.8.12...3.28) | ||||
| set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose build type: None Debug Release RelWithDebInfo MinSizeRel") | ||||
| project(volk_gnsssdr) | ||||
| enable_language(CXX) | ||||
|   | ||||
| @@ -37,7 +37,7 @@ static inline void volk_gnsssdr_16ic_rotatorpuppet_16ic_generic(lv_16sc_t* outVe | ||||
|     phase[0] = lv_cmake(cos(rem_carrier_phase_in_rad), -sin(rem_carrier_phase_in_rad)); | ||||
|     lv_32fc_t phase_inc[1]; | ||||
|     phase_inc[0] = lv_cmake(cos(phase_step_rad), -sin(phase_step_rad)); | ||||
|     volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_generic(outVector, inVector, phase_inc[0], phase, num_points); | ||||
|     volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_generic(outVector, inVector, &phase_inc[0], phase, num_points); | ||||
| } | ||||
|  | ||||
| #endif /* LV_HAVE_GENERIC */ | ||||
| @@ -53,7 +53,7 @@ static inline void volk_gnsssdr_16ic_rotatorpuppet_16ic_generic_reload(lv_16sc_t | ||||
|     phase[0] = lv_cmake(cos(rem_carrier_phase_in_rad), -sin(rem_carrier_phase_in_rad)); | ||||
|     lv_32fc_t phase_inc[1]; | ||||
|     phase_inc[0] = lv_cmake(cos(phase_step_rad), -sin(phase_step_rad)); | ||||
|     volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_generic_reload(outVector, inVector, phase_inc[0], phase, num_points); | ||||
|     volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_generic_reload(outVector, inVector, &phase_inc[0], phase, num_points); | ||||
| } | ||||
|  | ||||
| #endif /* LV_HAVE_GENERIC */ | ||||
| @@ -69,7 +69,7 @@ static inline void volk_gnsssdr_16ic_rotatorpuppet_16ic_a_sse3(lv_16sc_t* outVec | ||||
|     phase[0] = lv_cmake(cos(rem_carrier_phase_in_rad), -sin(rem_carrier_phase_in_rad)); | ||||
|     lv_32fc_t phase_inc[1]; | ||||
|     phase_inc[0] = lv_cmake(cos(phase_step_rad), -sin(phase_step_rad)); | ||||
|     volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_a_sse3(outVector, inVector, phase_inc[0], phase, num_points); | ||||
|     volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_a_sse3(outVector, inVector, &phase_inc[0], phase, num_points); | ||||
| } | ||||
|  | ||||
| #endif /* LV_HAVE_SSE3 */ | ||||
| @@ -85,7 +85,7 @@ static inline void volk_gnsssdr_16ic_rotatorpuppet_16ic_a_sse3_reload(lv_16sc_t* | ||||
|     phase[0] = lv_cmake(cos(rem_carrier_phase_in_rad), -sin(rem_carrier_phase_in_rad)); | ||||
|     lv_32fc_t phase_inc[1]; | ||||
|     phase_inc[0] = lv_cmake(cos(phase_step_rad), -sin(phase_step_rad)); | ||||
|     volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_a_sse3_reload(outVector, inVector, phase_inc[0], phase, num_points); | ||||
|     volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_a_sse3_reload(outVector, inVector, &phase_inc[0], phase, num_points); | ||||
| } | ||||
|  | ||||
| #endif /* LV_HAVE_SSE3 */ | ||||
| @@ -101,7 +101,7 @@ static inline void volk_gnsssdr_16ic_rotatorpuppet_16ic_u_sse3(lv_16sc_t* outVec | ||||
|     phase[0] = lv_cmake(cos(rem_carrier_phase_in_rad), -sin(rem_carrier_phase_in_rad)); | ||||
|     lv_32fc_t phase_inc[1]; | ||||
|     phase_inc[0] = lv_cmake(cos(phase_step_rad), -sin(phase_step_rad)); | ||||
|     volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_u_sse3(outVector, inVector, phase_inc[0], phase, num_points); | ||||
|     volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_u_sse3(outVector, inVector, &phase_inc[0], phase, num_points); | ||||
| } | ||||
|  | ||||
| #endif /* LV_HAVE_SSE3 */ | ||||
| @@ -117,7 +117,7 @@ static inline void volk_gnsssdr_16ic_rotatorpuppet_16ic_u_sse3_reload(lv_16sc_t* | ||||
|     phase[0] = lv_cmake(cos(rem_carrier_phase_in_rad), -sin(rem_carrier_phase_in_rad)); | ||||
|     lv_32fc_t phase_inc[1]; | ||||
|     phase_inc[0] = lv_cmake(cos(phase_step_rad), -sin(phase_step_rad)); | ||||
|     volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_u_sse3_reload(outVector, inVector, phase_inc[0], phase, num_points); | ||||
|     volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_u_sse3_reload(outVector, inVector, &phase_inc[0], phase, num_points); | ||||
| } | ||||
|  | ||||
| #endif /* LV_HAVE_SSE3 */ | ||||
| @@ -133,7 +133,7 @@ static inline void volk_gnsssdr_16ic_rotatorpuppet_16ic_neon(lv_16sc_t* outVecto | ||||
|     phase[0] = lv_cmake(cos(rem_carrier_phase_in_rad), -sin(rem_carrier_phase_in_rad)); | ||||
|     lv_32fc_t phase_inc[1]; | ||||
|     phase_inc[0] = lv_cmake(cos(phase_step_rad), -sin(phase_step_rad)); | ||||
|     volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon(outVector, inVector, phase_inc[0], phase, num_points); | ||||
|     volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon(outVector, inVector, &phase_inc[0], phase, num_points); | ||||
| } | ||||
|  | ||||
| #endif /* LV_HAVE_NEON */ | ||||
| @@ -149,7 +149,7 @@ static inline void volk_gnsssdr_16ic_rotatorpuppet_16ic_neon_reload(lv_16sc_t* o | ||||
|     phase[0] = lv_cmake(cos(rem_carrier_phase_in_rad), -sin(rem_carrier_phase_in_rad)); | ||||
|     lv_32fc_t phase_inc[1]; | ||||
|     phase_inc[0] = lv_cmake(cos(phase_step_rad), -sin(phase_step_rad)); | ||||
|     volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon_reload(outVector, inVector, phase_inc[0], phase, num_points); | ||||
|     volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon_reload(outVector, inVector, &phase_inc[0], phase, num_points); | ||||
| } | ||||
|  | ||||
| #endif /* LV_HAVE_NEON */ | ||||
|   | ||||
| @@ -27,7 +27,7 @@ | ||||
|  * | ||||
|  * <b>Dispatcher Prototype</b> | ||||
|  * \code | ||||
|  * void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic(lv_16sc_t* outVector, const lv_16sc_t* inVector, const lv_32fc_t phase_inc, lv_32fc_t* phase, unsigned int num_points); | ||||
|  * void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic(lv_16sc_t* outVector, const lv_16sc_t* inVector, const lv_32fc_t* phase_inc, lv_32fc_t* phase, unsigned int num_points); | ||||
|  * \endcode | ||||
|  * | ||||
|  * \b Inputs | ||||
| @@ -51,7 +51,7 @@ | ||||
|  | ||||
| #ifdef LV_HAVE_GENERIC | ||||
|  | ||||
| static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_generic(lv_16sc_t* outVector, const lv_16sc_t* inVector, const lv_32fc_t phase_inc, lv_32fc_t* phase, unsigned int num_points) | ||||
| static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_generic(lv_16sc_t* outVector, const lv_16sc_t* inVector, const lv_32fc_t* phase_inc, lv_32fc_t* phase, unsigned int num_points) | ||||
| { | ||||
|     unsigned int i = 0; | ||||
|     lv_16sc_t tmp16; | ||||
| @@ -61,7 +61,7 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_generic(lv_16sc_t* ou | ||||
|             tmp16 = *inVector++; | ||||
|             tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase); | ||||
|             *outVector++ = lv_cmake((int16_t)rintf(lv_creal(tmp32)), (int16_t)rintf(lv_cimag(tmp32))); | ||||
|             (*phase) *= phase_inc; | ||||
|             (*phase) *= *phase_inc; | ||||
|             // Regenerate phase | ||||
|             if (i % 512 == 0) | ||||
|                 { | ||||
| @@ -81,7 +81,7 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_generic(lv_16sc_t* ou | ||||
|  | ||||
| #ifdef LV_HAVE_GENERIC | ||||
|  | ||||
| static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_generic_reload(lv_16sc_t* outVector, const lv_16sc_t* inVector, const lv_32fc_t phase_inc, lv_32fc_t* phase, unsigned int num_points) | ||||
| static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_generic_reload(lv_16sc_t* outVector, const lv_16sc_t* inVector, const lv_32fc_t* phase_inc, lv_32fc_t* phase, unsigned int num_points) | ||||
| { | ||||
|     unsigned int ROTATOR_RELOAD = 512; | ||||
|     unsigned int n = 0; | ||||
| @@ -95,7 +95,7 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_generic_reload(lv_16s | ||||
|                     tmp16 = *inVector++; | ||||
|                     tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase); | ||||
|                     *outVector++ = lv_cmake((int16_t)rintf(lv_creal(tmp32)), (int16_t)rintf(lv_cimag(tmp32))); | ||||
|                     (*phase) *= phase_inc; | ||||
|                     (*phase) *= *phase_inc; | ||||
|                 } | ||||
|                 // Regenerate phase | ||||
|                 // printf("Phase before regeneration %i: %f,%f  Modulus: %f\n", n,lv_creal(*phase),lv_cimag(*phase), cabsf(*phase)); | ||||
| @@ -111,7 +111,7 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_generic_reload(lv_16s | ||||
|             tmp16 = *inVector++; | ||||
|             tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase); | ||||
|             *outVector++ = lv_cmake((int16_t)rintf(lv_creal(tmp32)), (int16_t)rintf(lv_cimag(tmp32))); | ||||
|             (*phase) *= phase_inc; | ||||
|             (*phase) *= *phase_inc; | ||||
|         } | ||||
| } | ||||
|  | ||||
| @@ -121,7 +121,7 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_generic_reload(lv_16s | ||||
| #ifdef LV_HAVE_SSE3 | ||||
| #include <pmmintrin.h> | ||||
|  | ||||
| static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_a_sse3(lv_16sc_t* outVector, const lv_16sc_t* inVector, const lv_32fc_t phase_inc, lv_32fc_t* phase, unsigned int num_points) | ||||
| static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_a_sse3(lv_16sc_t* outVector, const lv_16sc_t* inVector, const lv_32fc_t* phase_inc, lv_32fc_t* phase, unsigned int num_points) | ||||
| { | ||||
|     const unsigned int sse_iters = num_points / 4; | ||||
|     unsigned int number; | ||||
| @@ -129,13 +129,13 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_a_sse3(lv_16sc_t* out | ||||
|     __m128i c1, c2, result; | ||||
|     __VOLK_ATTR_ALIGNED(16) | ||||
|     lv_32fc_t two_phase_inc[2]; | ||||
|     two_phase_inc[0] = phase_inc * phase_inc; | ||||
|     two_phase_inc[1] = phase_inc * phase_inc; | ||||
|     two_phase_inc[0] = *phase_inc * *phase_inc; | ||||
|     two_phase_inc[1] = *phase_inc * *phase_inc; | ||||
|     two_phase_inc_reg = _mm_load_ps((float*)two_phase_inc); | ||||
|     __VOLK_ATTR_ALIGNED(16) | ||||
|     lv_32fc_t two_phase_acc[2]; | ||||
|     two_phase_acc[0] = (*phase); | ||||
|     two_phase_acc[1] = (*phase) * phase_inc; | ||||
|     two_phase_acc[1] = (*phase) * *phase_inc; | ||||
|     two_phase_acc_reg = _mm_load_ps((float*)two_phase_acc); | ||||
|  | ||||
|     const lv_16sc_t* _in = inVector; | ||||
| @@ -213,7 +213,7 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_a_sse3(lv_16sc_t* out | ||||
|             tmp16 = *_in++; | ||||
|             tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase); | ||||
|             *_out++ = lv_cmake((int16_t)rintf(lv_creal(tmp32)), (int16_t)rintf(lv_cimag(tmp32))); | ||||
|             (*phase) *= phase_inc; | ||||
|             (*phase) *= *phase_inc; | ||||
|         } | ||||
| } | ||||
|  | ||||
| @@ -223,7 +223,7 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_a_sse3(lv_16sc_t* out | ||||
| #ifdef LV_HAVE_SSE3 | ||||
| #include <pmmintrin.h> | ||||
|  | ||||
| static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_a_sse3_reload(lv_16sc_t* outVector, const lv_16sc_t* inVector, const lv_32fc_t phase_inc, lv_32fc_t* phase, unsigned int num_points) | ||||
| static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_a_sse3_reload(lv_16sc_t* outVector, const lv_16sc_t* inVector, const lv_32fc_t* phase_inc, lv_32fc_t* phase, unsigned int num_points) | ||||
| { | ||||
|     const unsigned int sse_iters = num_points / 4; | ||||
|     const unsigned int ROTATOR_RELOAD = 512; | ||||
| @@ -233,13 +233,13 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_a_sse3_reload(lv_16sc | ||||
|     __m128i c1, c2, result; | ||||
|     __VOLK_ATTR_ALIGNED(16) | ||||
|     lv_32fc_t two_phase_inc[2]; | ||||
|     two_phase_inc[0] = phase_inc * phase_inc; | ||||
|     two_phase_inc[1] = phase_inc * phase_inc; | ||||
|     two_phase_inc[0] = *phase_inc * *phase_inc; | ||||
|     two_phase_inc[1] = *phase_inc * *phase_inc; | ||||
|     two_phase_inc_reg = _mm_load_ps((float*)two_phase_inc); | ||||
|     __VOLK_ATTR_ALIGNED(16) | ||||
|     lv_32fc_t two_phase_acc[2]; | ||||
|     two_phase_acc[0] = (*phase); | ||||
|     two_phase_acc[1] = (*phase) * phase_inc; | ||||
|     two_phase_acc[1] = (*phase) * *phase_inc; | ||||
|     two_phase_acc_reg = _mm_load_ps((float*)two_phase_acc); | ||||
|  | ||||
|     const lv_16sc_t* _in = inVector; | ||||
| @@ -367,7 +367,7 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_a_sse3_reload(lv_16sc | ||||
|             tmp16 = *_in++; | ||||
|             tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase); | ||||
|             *_out++ = lv_cmake((int16_t)rintf(lv_creal(tmp32)), (int16_t)rintf(lv_cimag(tmp32))); | ||||
|             (*phase) *= phase_inc; | ||||
|             (*phase) *= *phase_inc; | ||||
|         } | ||||
| } | ||||
|  | ||||
| @@ -377,7 +377,7 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_a_sse3_reload(lv_16sc | ||||
| #ifdef LV_HAVE_SSE3 | ||||
| #include <pmmintrin.h> | ||||
|  | ||||
| static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_u_sse3(lv_16sc_t* outVector, const lv_16sc_t* inVector, const lv_32fc_t phase_inc, lv_32fc_t* phase, unsigned int num_points) | ||||
| static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_u_sse3(lv_16sc_t* outVector, const lv_16sc_t* inVector, const lv_32fc_t* phase_inc, lv_32fc_t* phase, unsigned int num_points) | ||||
| { | ||||
|     const unsigned int sse_iters = num_points / 4; | ||||
|     unsigned int number; | ||||
| @@ -385,13 +385,13 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_u_sse3(lv_16sc_t* out | ||||
|     __m128i c1, c2, result; | ||||
|     __VOLK_ATTR_ALIGNED(16) | ||||
|     lv_32fc_t two_phase_inc[2]; | ||||
|     two_phase_inc[0] = phase_inc * phase_inc; | ||||
|     two_phase_inc[1] = phase_inc * phase_inc; | ||||
|     two_phase_inc[0] = *phase_inc * *phase_inc; | ||||
|     two_phase_inc[1] = *phase_inc * *phase_inc; | ||||
|     two_phase_inc_reg = _mm_load_ps((float*)two_phase_inc); | ||||
|     __VOLK_ATTR_ALIGNED(16) | ||||
|     lv_32fc_t two_phase_acc[2]; | ||||
|     two_phase_acc[0] = (*phase); | ||||
|     two_phase_acc[1] = (*phase) * phase_inc; | ||||
|     two_phase_acc[1] = (*phase) * *phase_inc; | ||||
|     two_phase_acc_reg = _mm_load_ps((float*)two_phase_acc); | ||||
|  | ||||
|     const lv_16sc_t* _in = inVector; | ||||
| @@ -470,7 +470,7 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_u_sse3(lv_16sc_t* out | ||||
|             tmp16 = *_in++; | ||||
|             tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase); | ||||
|             *_out++ = lv_cmake((int16_t)rintf(lv_creal(tmp32)), (int16_t)rintf(lv_cimag(tmp32))); | ||||
|             (*phase) *= phase_inc; | ||||
|             (*phase) *= *phase_inc; | ||||
|         } | ||||
| } | ||||
|  | ||||
| @@ -480,7 +480,7 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_u_sse3(lv_16sc_t* out | ||||
| #ifdef LV_HAVE_SSE3 | ||||
| #include <pmmintrin.h> | ||||
|  | ||||
| static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_u_sse3_reload(lv_16sc_t* outVector, const lv_16sc_t* inVector, const lv_32fc_t phase_inc, lv_32fc_t* phase, unsigned int num_points) | ||||
| static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_u_sse3_reload(lv_16sc_t* outVector, const lv_16sc_t* inVector, const lv_32fc_t* phase_inc, lv_32fc_t* phase, unsigned int num_points) | ||||
| { | ||||
|     const unsigned int sse_iters = num_points / 4; | ||||
|     unsigned int ROTATOR_RELOAD = 512; | ||||
| @@ -490,13 +490,13 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_u_sse3_reload(lv_16sc | ||||
|     __m128i c1, c2, result; | ||||
|     __VOLK_ATTR_ALIGNED(16) | ||||
|     lv_32fc_t two_phase_inc[2]; | ||||
|     two_phase_inc[0] = phase_inc * phase_inc; | ||||
|     two_phase_inc[1] = phase_inc * phase_inc; | ||||
|     two_phase_inc[0] = *phase_inc * *phase_inc; | ||||
|     two_phase_inc[1] = *phase_inc * *phase_inc; | ||||
|     two_phase_inc_reg = _mm_load_ps((float*)two_phase_inc); | ||||
|     __VOLK_ATTR_ALIGNED(16) | ||||
|     lv_32fc_t two_phase_acc[2]; | ||||
|     two_phase_acc[0] = (*phase); | ||||
|     two_phase_acc[1] = (*phase) * phase_inc; | ||||
|     two_phase_acc[1] = (*phase) * *phase_inc; | ||||
|     two_phase_acc_reg = _mm_load_ps((float*)two_phase_acc); | ||||
|  | ||||
|     const lv_16sc_t* _in = inVector; | ||||
| @@ -624,7 +624,7 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_u_sse3_reload(lv_16sc | ||||
|             tmp16 = *_in++; | ||||
|             tmp32 = lv_cmake((float)lv_creal(tmp16), (float)lv_cimag(tmp16)) * (*phase); | ||||
|             *_out++ = lv_cmake((int16_t)rintf(lv_creal(tmp32)), (int16_t)rintf(lv_cimag(tmp32))); | ||||
|             (*phase) *= phase_inc; | ||||
|             (*phase) *= *phase_inc; | ||||
|         } | ||||
| } | ||||
|  | ||||
| @@ -634,7 +634,7 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_u_sse3_reload(lv_16sc | ||||
| #ifdef LV_HAVE_NEON | ||||
| #include <arm_neon.h> | ||||
|  | ||||
| static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon(lv_16sc_t* outVector, const lv_16sc_t* inVector, const lv_32fc_t phase_inc, lv_32fc_t* phase, unsigned int num_points) | ||||
| static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon(lv_16sc_t* outVector, const lv_16sc_t* inVector, const lv_32fc_t* phase_inc, lv_32fc_t* phase, unsigned int num_points) | ||||
| { | ||||
|     unsigned int i = 0; | ||||
|     const unsigned int neon_iters = num_points / 4; | ||||
| @@ -642,13 +642,13 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon(lv_16sc_t* outVe | ||||
|     lv_32fc_t tmp32_; | ||||
|  | ||||
|     float arg_phase0 = cargf(*phase); | ||||
|     float arg_phase_inc = cargf(phase_inc); | ||||
|     float arg_phase_inc = cargf(*phase_inc); | ||||
|     float phase_est = 0.0; | ||||
|  | ||||
|     const lv_16sc_t* _in = inVector; | ||||
|     lv_16sc_t* _out = outVector; | ||||
|  | ||||
|     lv_32fc_t ___phase4 = phase_inc * phase_inc * phase_inc * phase_inc; | ||||
|     lv_32fc_t ___phase4 = *phase_inc * *phase_inc * *phase_inc * *phase_inc; | ||||
|     __VOLK_ATTR_ALIGNED(16) | ||||
|     float32_t __phase4_real[4] = {lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4)}; | ||||
|     __VOLK_ATTR_ALIGNED(16) | ||||
| @@ -657,9 +657,9 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon(lv_16sc_t* outVe | ||||
|     float32x4_t _phase4_real = vld1q_f32(__phase4_real); | ||||
|     float32x4_t _phase4_imag = vld1q_f32(__phase4_imag); | ||||
|  | ||||
|     lv_32fc_t phase2 = (lv_32fc_t)(*phase) * phase_inc; | ||||
|     lv_32fc_t phase3 = phase2 * phase_inc; | ||||
|     lv_32fc_t phase4 = phase3 * phase_inc; | ||||
|     lv_32fc_t phase2 = (lv_32fc_t)(*phase) * *phase_inc; | ||||
|     lv_32fc_t phase3 = phase2 * *phase_inc; | ||||
|     lv_32fc_t phase4 = phase3 * *phase_inc; | ||||
|  | ||||
|     __VOLK_ATTR_ALIGNED(16) | ||||
|     float32_t __phase_real[4] = {lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4)}; | ||||
| @@ -737,9 +737,9 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon(lv_16sc_t* outVe | ||||
|                             // printf("Estimated phase: %f\n\n", cos(phase_est)); | ||||
|  | ||||
|                             *phase = lv_cmake(cos(phase_est), sin(phase_est)); | ||||
|                             phase2 = (lv_32fc_t)(*phase) * phase_inc; | ||||
|                             phase3 = phase2 * phase_inc; | ||||
|                             phase4 = phase3 * phase_inc; | ||||
|                             phase2 = (lv_32fc_t)(*phase) * *phase_inc; | ||||
|                             phase3 = phase2 * *phase_inc; | ||||
|                             phase4 = phase3 * *phase_inc; | ||||
|  | ||||
|                             __VOLK_ATTR_ALIGNED(16) | ||||
|                             float32_t ____phase_real[4] = {lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4)}; | ||||
| @@ -760,7 +760,7 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon(lv_16sc_t* outVe | ||||
|             tmp16_ = *_in++; | ||||
|             tmp32_ = lv_cmake((float32_t)lv_creal(tmp16_), (float32_t)lv_cimag(tmp16_)) * (*phase); | ||||
|             *_out++ = lv_cmake((int16_t)rintf(lv_creal(tmp32_)), (int16_t)rintf(lv_cimag(tmp32_))); | ||||
|             (*phase) *= phase_inc; | ||||
|             (*phase) *= *phase_inc; | ||||
|         } | ||||
| } | ||||
|  | ||||
| @@ -770,7 +770,7 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon(lv_16sc_t* outVe | ||||
| #ifdef LV_HAVE_NEON | ||||
| #include <arm_neon.h> | ||||
|  | ||||
| static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon_reload(lv_16sc_t* outVector, const lv_16sc_t* inVector, const lv_32fc_t phase_inc, lv_32fc_t* phase, unsigned int num_points) | ||||
| static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon_reload(lv_16sc_t* outVector, const lv_16sc_t* inVector, const lv_32fc_t* phase_inc, lv_32fc_t* phase, unsigned int num_points) | ||||
| { | ||||
|     unsigned int i = 0; | ||||
|     const unsigned int neon_iters = num_points / 4; | ||||
| @@ -782,13 +782,13 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon_reload(lv_16sc_t | ||||
|     lv_32fc_t tmp32_; | ||||
|  | ||||
|     float arg_phase0 = cargf(*phase); | ||||
|     float arg_phase_inc = cargf(phase_inc); | ||||
|     float arg_phase_inc = cargf(*phase_inc); | ||||
|     float phase_est = 0.0; | ||||
|  | ||||
|     const lv_16sc_t* _in = inVector; | ||||
|     lv_16sc_t* _out = outVector; | ||||
|  | ||||
|     lv_32fc_t ___phase4 = phase_inc * phase_inc * phase_inc * phase_inc; | ||||
|     lv_32fc_t ___phase4 = *phase_inc * *phase_inc * *phase_inc * *phase_inc; | ||||
|     __VOLK_ATTR_ALIGNED(16) | ||||
|     float32_t __phase4_real[4] = {lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4), lv_creal(___phase4)}; | ||||
|     __VOLK_ATTR_ALIGNED(16) | ||||
| @@ -797,9 +797,9 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon_reload(lv_16sc_t | ||||
|     float32x4_t _phase4_real = vld1q_f32(__phase4_real); | ||||
|     float32x4_t _phase4_imag = vld1q_f32(__phase4_imag); | ||||
|  | ||||
|     lv_32fc_t phase2 = (lv_32fc_t)(*phase) * phase_inc; | ||||
|     lv_32fc_t phase3 = phase2 * phase_inc; | ||||
|     lv_32fc_t phase4 = phase3 * phase_inc; | ||||
|     lv_32fc_t phase2 = (lv_32fc_t)(*phase) * *phase_inc; | ||||
|     lv_32fc_t phase3 = phase2 * *phase_inc; | ||||
|     lv_32fc_t phase4 = phase3 * *phase_inc; | ||||
|  | ||||
|     __VOLK_ATTR_ALIGNED(16) | ||||
|     float32_t __phase_real[4] = {lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4)}; | ||||
| @@ -877,9 +877,9 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon_reload(lv_16sc_t | ||||
|                     phase_est = arg_phase0 + (n + 1) * ROTATOR_RELOAD * 4 * arg_phase_inc; | ||||
|                     // printf("Estimated phase: %f\n\n", cos(phase_est)); | ||||
|                     *phase = lv_cmake(cos(phase_est), sin(phase_est)); | ||||
|                     phase2 = (lv_32fc_t)(*phase) * phase_inc; | ||||
|                     phase3 = phase2 * phase_inc; | ||||
|                     phase4 = phase3 * phase_inc; | ||||
|                     phase2 = (lv_32fc_t)(*phase) * *phase_inc; | ||||
|                     phase3 = phase2 * *phase_inc; | ||||
|                     phase4 = phase3 * *phase_inc; | ||||
|  | ||||
|                     __VOLK_ATTR_ALIGNED(16) | ||||
|                     float32_t ____phase_real[4] = {lv_creal((*phase)), lv_creal(phase2), lv_creal(phase3), lv_creal(phase4)}; | ||||
| @@ -954,7 +954,7 @@ static inline void volk_gnsssdr_16ic_s32fc_x2_rotator_16ic_neon_reload(lv_16sc_t | ||||
|             tmp16_ = *_in++; | ||||
|             tmp32_ = lv_cmake((float32_t)lv_creal(tmp16_), (float32_t)lv_cimag(tmp16_)) * (*phase); | ||||
|             *_out++ = lv_cmake((int16_t)rintf(lv_creal(tmp32_)), (int16_t)rintf(lv_cimag(tmp32_))); | ||||
|             (*phase) *= phase_inc; | ||||
|             (*phase) *= *phase_inc; | ||||
|         } | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -372,14 +372,18 @@ if(MSVC) | ||||
|         set(cmake_c_compiler_version "Microsoft Visual Studio 14.0") | ||||
|     endif() | ||||
| else() | ||||
|     if(NOT CMAKE_CROSSCOMPILING) | ||||
|         execute_process(COMMAND ${CMAKE_C_COMPILER} --version | ||||
|             OUTPUT_VARIABLE cmake_c_compiler_version | ||||
|         ) | ||||
|     endif() | ||||
| endif() | ||||
| if(NOT GRCBTU) | ||||
|     set(GRCBTU "") | ||||
| endif() | ||||
| set(COMPILER_INFO "${CMAKE_C_COMPILER}:::${CMAKE_C_FLAGS_${GRCBTU}} ${CMAKE_C_FLAGS}\n${CMAKE_CXX_COMPILER}:::${CMAKE_CXX_FLAGS_${GRCBTU}} ${CMAKE_CXX_FLAGS}\n") | ||||
| if(NOT CMAKE_CROSSCOMPILING) | ||||
|     set(COMPILER_INFO "${CMAKE_C_COMPILER}:::${CMAKE_C_FLAGS_${GRCBTU}} ${CMAKE_C_FLAGS}\n${CMAKE_CXX_COMPILER}:::${CMAKE_CXX_FLAGS_${GRCBTU}} ${CMAKE_CXX_FLAGS}\n") | ||||
| endif() | ||||
|  | ||||
| foreach(machine_name ${available_machines}) | ||||
|     # generate machine source | ||||
| @@ -396,7 +400,9 @@ foreach(machine_name ${available_machines}) | ||||
|     if(NOT (CMAKE_GENERATOR STREQUAL Xcode)) | ||||
|         message(STATUS "BUILD INFO ::: ${machine_name} ::: ${COMPILER_NAME} ::: ${CMAKE_C_FLAGS_${CBTU}} ${CMAKE_C_FLAGS} ${${machine_name}_flags}") | ||||
|     endif() | ||||
|     if(NOT CMAKE_CROSSCOMPILING) | ||||
|         set(COMPILER_INFO "${COMPILER_INFO}${machine_name}:::${COMPILER_NAME}:::${CMAKE_C_FLAGS_${CBTU}} ${CMAKE_C_FLAGS} ${${machine_name}_flags}\n") | ||||
|     endif() | ||||
|     if(${machine_name}_flags AND NOT MSVC) | ||||
|         set_source_files_properties(${machine_source} PROPERTIES COMPILE_FLAGS "${${machine_name}_flags}") | ||||
|     endif() | ||||
| @@ -407,11 +413,15 @@ foreach(machine_name ${available_machines}) | ||||
| endforeach() | ||||
|  | ||||
| # Convert to a C string to compile and display properly | ||||
| string(STRIP "${cmake_c_compiler_version}" cmake_c_compiler_version) | ||||
| string(STRIP ${COMPILER_INFO} COMPILER_INFO) | ||||
| message(STATUS "Compiler Version: ${cmake_c_compiler_version}") | ||||
| string(REPLACE "\n" " \\n" cmake_c_compiler_version ${cmake_c_compiler_version}) | ||||
| string(REPLACE "\n" " \\n" COMPILER_INFO ${COMPILER_INFO}) | ||||
| if(NOT CMAKE_CROSSCOMPILING) | ||||
|     string(STRIP "${cmake_c_compiler_version}" cmake_c_compiler_version) | ||||
|     string(REPLACE "\n" " \\n" cmake_c_compiler_version ${cmake_c_compiler_version}) | ||||
|     message(STATUS "Compiler Version: ${cmake_c_compiler_version}") | ||||
|     string(STRIP ${COMPILER_INFO} COMPILER_INFO) | ||||
|     string(REPLACE "\n" " \\n" COMPILER_INFO ${COMPILER_INFO}) | ||||
| else() | ||||
|     set(cmake_c_compiler_version "") | ||||
| endif() | ||||
|  | ||||
|  | ||||
| ######################################################################## | ||||
| @@ -481,8 +491,12 @@ endif() | ||||
| message(STATUS "Loading version ${VERSION} into constants...") | ||||
|  | ||||
| # double escape for windows backslash path separators | ||||
| string(REPLACE "\\" "\\\\" prefix "${prefix}") | ||||
| string(REPLACE "${CMAKE_SOURCE_DIR}" "$BUILD_DIR" COMPILER_INFO "${COMPILER_INFO}") | ||||
| if(NOT CMAKE_CROSSCOMPILING) | ||||
|     string(REPLACE "\\" "\\\\" prefix "${prefix}") | ||||
|     string(REPLACE "${CMAKE_SOURCE_DIR}" "$BUILD_DIR" COMPILER_INFO "${COMPILER_INFO}") | ||||
| else() | ||||
|     set(prefix "") | ||||
| endif() | ||||
|  | ||||
| configure_file( | ||||
|     ${CMAKE_CURRENT_SOURCE_DIR}/constants.c.in | ||||
|   | ||||
| @@ -483,12 +483,12 @@ bool icompare(t *in1, t *in2, unsigned int vlen, unsigned int tol) | ||||
|     int print_max_errs = 10; | ||||
|     for (unsigned int i = 0; i < vlen; i++) | ||||
|         { | ||||
|             if (((unsigned int)abs(int(((t *)(in1))[i]) - int(((t *)(in2))[i]))) > tol) | ||||
|             if (((uint64_t)abs(int64_t(((t *)(in1))[i]) - int64_t(((t *)(in2))[i]))) > tol) | ||||
|                 { | ||||
|                     fail = true; | ||||
|                     if (print_max_errs-- > 0) | ||||
|                         { | ||||
|                             std::cout << "offset " << i << " in1: " << static_cast<int>(t(((t *)(in1))[i])) << " in2: " << static_cast<int>(t(((t *)(in2))[i])); | ||||
|                             std::cout << "offset " << i << " in1: " << static_cast<int64_t>(t(((t *)(in1))[i])) << " in2: " << static_cast<int64_t>(t(((t *)(in2))[i])); | ||||
|                             std::cout << " tolerance was: " << tol << '\n'; | ||||
|                         } | ||||
|                 } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Carles Fernandez
					Carles Fernandez