diff options
author | Josh Blum <josh@joshknows.com> | 2011-07-14 22:41:56 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-07-14 22:41:56 -0700 |
commit | 3fea33db9a5d951b9db7c7653eaae0e6291de0bc (patch) | |
tree | 48b5401ec94b9508c00191942f9fa4387c985b9c | |
parent | 5239879e9f97bdbb6e3c531cee85824823ebff89 (diff) | |
download | uhd-3fea33db9a5d951b9db7c7653eaae0e6291de0bc.tar.gz uhd-3fea33db9a5d951b9db7c7653eaae0e6291de0bc.tar.bz2 uhd-3fea33db9a5d951b9db7c7653eaae0e6291de0bc.zip |
uhd: pulled misc changes from other branches into master
-rw-r--r-- | host/CMakeLists.txt | 2 | ||||
-rw-r--r-- | host/examples/benchmark_rate.cpp | 3 | ||||
-rw-r--r-- | host/lib/convert/convert_with_sse2.cpp | 40 |
3 files changed, 23 insertions, 22 deletions
diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt index 034257551..b5f8e57c2 100644 --- a/host/CMakeLists.txt +++ b/host/CMakeLists.txt @@ -129,7 +129,7 @@ IF(MSVC) ENDIF(BOOST_ALL_DYN_LINK) ENDIF(MSVC) -SET(Boost_ADDITIONAL_VERSIONS "1.42.0" "1.42" "1.43.0" "1.43" "1.44.0" "1.44" "1.45.0" "1.45" "1.46.0" "1.46") +SET(Boost_ADDITIONAL_VERSIONS "1.42.0" "1.42" "1.43.0" "1.43" "1.44.0" "1.44" "1.45.0" "1.45" "1.46.0" "1.46" "1.47.0" "1.47") FIND_PACKAGE(Boost 1.36 COMPONENTS ${BOOST_REQUIRED_COMPONENTS}) INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) diff --git a/host/examples/benchmark_rate.cpp b/host/examples/benchmark_rate.cpp index 688cd797a..774b240d4 100644 --- a/host/examples/benchmark_rate.cpp +++ b/host/examples/benchmark_rate.cpp @@ -157,6 +157,7 @@ void benchmark_tx_rate_async_helper(uhd::usrp::multi_usrp::sptr usrp){ * Main code + dispatcher **********************************************************************/ int UHD_SAFE_MAIN(int argc, char *argv[]){ + uhd::set_thread_priority_safe(); //variables to be set by po std::string args; @@ -177,7 +178,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ po::notify(vm); //print the help message - if (vm.count("help")){ + if (vm.count("help") or (vm.count("rx_rate") + vm.count("tx_rate")) == 0){ std::cout << boost::format("UHD Benchmark Rate %s") % desc << std::endl; std::cout << " Specify --rx_rate for a receive-only test.\n" diff --git a/host/lib/convert/convert_with_sse2.cpp b/host/lib/convert/convert_with_sse2.cpp index 0cbb2c444..0649baab4 100644 --- a/host/lib/convert/convert_with_sse2.cpp +++ b/host/lib/convert/convert_with_sse2.cpp @@ -28,10 +28,10 @@ DECLARE_CONVERTER(convert_fc32_1_to_item32_1_nswap, PRIORITY_CUSTOM){ const __m128 scalar = _mm_set_ps1(float(scale_factor)); #define convert_fc32_1_to_item32_1_nswap_guts(_al_) \ - for (; i+4 < nsamps; i+=4){ \ + for (; i+4 < nsamps; i+=4){ \ /* load from input */ \ - __m128 tmplo = _mm_load ## _al_ ## _ps(reinterpret_cast<const float *>(input+i+0)); \ - __m128 tmphi = _mm_load ## _al_ ## _ps(reinterpret_cast<const float *>(input+i+2)); \ + __m128 tmplo = _mm_load ## _al_ ## ps(reinterpret_cast<const float *>(input+i+0)); \ + __m128 tmphi = _mm_load ## _al_ ## ps(reinterpret_cast<const float *>(input+i+2)); \ \ /* convert and scale */ \ __m128i tmpilo = _mm_cvtps_epi32(_mm_mul_ps(tmplo, scalar)); \ @@ -53,9 +53,9 @@ DECLARE_CONVERTER(convert_fc32_1_to_item32_1_nswap, PRIORITY_CUSTOM){ case 0x8: output[i] = fc32_to_item32(input[i], float(scale_factor)); i++; case 0x0: - convert_fc32_1_to_item32_1_nswap_guts() + convert_fc32_1_to_item32_1_nswap_guts(_) break; - default: convert_fc32_1_to_item32_1_nswap_guts(u) + default: convert_fc32_1_to_item32_1_nswap_guts(u_) } //convert remainder @@ -71,10 +71,10 @@ DECLARE_CONVERTER(convert_fc32_1_to_item32_1_bswap, PRIORITY_CUSTOM){ const __m128 scalar = _mm_set_ps1(float(scale_factor)); #define convert_fc32_1_to_item32_1_bswap_guts(_al_) \ - for (; i+4 < nsamps; i+=4){ \ + for (; i+4 < nsamps; i+=4){ \ /* load from input */ \ - __m128 tmplo = _mm_load ## _al_ ## _ps(reinterpret_cast<const float *>(input+i+0)); \ - __m128 tmphi = _mm_load ## _al_ ## _ps(reinterpret_cast<const float *>(input+i+2)); \ + __m128 tmplo = _mm_load ## _al_ ## ps(reinterpret_cast<const float *>(input+i+0)); \ + __m128 tmphi = _mm_load ## _al_ ## ps(reinterpret_cast<const float *>(input+i+2)); \ \ /* convert and scale */ \ __m128i tmpilo = _mm_cvtps_epi32(_mm_mul_ps(tmplo, scalar)); \ @@ -95,9 +95,9 @@ DECLARE_CONVERTER(convert_fc32_1_to_item32_1_bswap, PRIORITY_CUSTOM){ case 0x8: output[i] = uhd::byteswap(fc32_to_item32(input[i], float(scale_factor))); i++; case 0x0: - convert_fc32_1_to_item32_1_bswap_guts() + convert_fc32_1_to_item32_1_bswap_guts(_) break; - default: convert_fc32_1_to_item32_1_bswap_guts(u) + default: convert_fc32_1_to_item32_1_bswap_guts(u_) } //convert remainder @@ -114,7 +114,7 @@ DECLARE_CONVERTER(convert_item32_1_to_fc32_1_nswap, PRIORITY_CUSTOM){ const __m128i zeroi = _mm_setzero_si128(); #define convert_item32_1_to_fc32_1_nswap_guts(_al_) \ - for (; i+4 < nsamps; i+=4){ \ + for (; i+4 < nsamps; i+=4){ \ /* load from input */ \ __m128i tmpi = _mm_loadu_si128(reinterpret_cast<const __m128i *>(input+i)); \ \ @@ -129,8 +129,8 @@ DECLARE_CONVERTER(convert_item32_1_to_fc32_1_nswap, PRIORITY_CUSTOM){ __m128 tmphi = _mm_mul_ps(_mm_cvtepi32_ps(tmpihi), scalar); \ \ /* store to output */ \ - _mm_store ## _al_ ## _ps(reinterpret_cast<float *>(output+i+0), tmplo); \ - _mm_store ## _al_ ## _ps(reinterpret_cast<float *>(output+i+2), tmphi); \ + _mm_store ## _al_ ## ps(reinterpret_cast<float *>(output+i+0), tmplo); \ + _mm_store ## _al_ ## ps(reinterpret_cast<float *>(output+i+2), tmphi); \ } \ size_t i = 0; @@ -140,9 +140,9 @@ DECLARE_CONVERTER(convert_item32_1_to_fc32_1_nswap, PRIORITY_CUSTOM){ case 0x8: output[i] = item32_to_fc32(input[i], float(scale_factor)); i++; case 0x0: - convert_item32_1_to_fc32_1_nswap_guts() + convert_item32_1_to_fc32_1_nswap_guts(_) break; - default: convert_item32_1_to_fc32_1_nswap_guts(u) + default: convert_item32_1_to_fc32_1_nswap_guts(u_) } //convert remainder @@ -159,7 +159,7 @@ DECLARE_CONVERTER(convert_item32_1_to_fc32_1_bswap, PRIORITY_CUSTOM){ const __m128i zeroi = _mm_setzero_si128(); #define convert_item32_1_to_fc32_1_bswap_guts(_al_) \ - for (; i+4 < nsamps; i+=4){ \ + for (; i+4 < nsamps; i+=4){ \ /* load from input */ \ __m128i tmpi = _mm_loadu_si128(reinterpret_cast<const __m128i *>(input+i)); \ \ @@ -173,8 +173,8 @@ DECLARE_CONVERTER(convert_item32_1_to_fc32_1_bswap, PRIORITY_CUSTOM){ __m128 tmphi = _mm_mul_ps(_mm_cvtepi32_ps(tmpihi), scalar); \ \ /* store to output */ \ - _mm_store ## _al_ ## _ps(reinterpret_cast<float *>(output+i+0), tmplo); \ - _mm_store ## _al_ ## _ps(reinterpret_cast<float *>(output+i+2), tmphi); \ + _mm_store ## _al_ ## ps(reinterpret_cast<float *>(output+i+0), tmplo); \ + _mm_store ## _al_ ## ps(reinterpret_cast<float *>(output+i+2), tmphi); \ } \ size_t i = 0; @@ -184,9 +184,9 @@ DECLARE_CONVERTER(convert_item32_1_to_fc32_1_bswap, PRIORITY_CUSTOM){ case 0x8: output[i] = item32_to_fc32(uhd::byteswap(input[i]), float(scale_factor)); i++; case 0x0: - convert_item32_1_to_fc32_1_bswap_guts() + convert_item32_1_to_fc32_1_bswap_guts(_) break; - default: convert_item32_1_to_fc32_1_bswap_guts(u) + default: convert_item32_1_to_fc32_1_bswap_guts(u_) } //convert remainder |