void info(const char * format, ...) { va_list args; va_start(args, format); g_output(INFO, format, args); va_end(args); }
void error(const char * format, ...) { va_list args; va_start(args, format); g_output(FAILURE, format, args); va_end(args); }
void warning(const char * format, ...) { va_list args; va_start(args, format); g_output(WARNING, format, args); va_end(args); }
void trace(Severity s, const char * format, ...) { va_list args; va_start (args, format); g_output(s, format, args); va_end (args); }
__u32 ApplicationWindow::tpgDefaultColorspace() { v4l2_dv_timings timings = { 0 }; v4l2_output out; __u32 io_caps; bool dvi_d = false; g_output(out.index); enum_output(out, true, out.index); io_caps = out.capabilities; v4l2_control ctrl = { V4L2_CID_DV_TX_MODE }; if (!g_ctrl(ctrl)) dvi_d = ctrl.value == V4L2_DV_TX_MODE_DVI_D; if (io_caps & V4L2_OUT_CAP_STD) return V4L2_COLORSPACE_SMPTE170M; if (!(io_caps & V4L2_OUT_CAP_DV_TIMINGS)) return V4L2_COLORSPACE_SRGB; g_dv_timings(timings); if (!(timings.bt.standards & V4L2_DV_BT_STD_CEA861) || dvi_d) return V4L2_COLORSPACE_SRGB; if (timings.bt.width == 720 && timings.bt.height <= 576) return V4L2_COLORSPACE_SMPTE170M; return V4L2_COLORSPACE_REC709; }
static void test_iota( size_type count , size_type value , size_type repeat ) { BOOST_TEST_MESSAGE( " " << count << " elements with first value " << value ); BOOST_TEST_MESSAGE( " " << repeat << " iterations" ); halmd::accumulator<double> elapsed; for (size_type i = 0; i < repeat; ++i) { cuda::vector<size_type> g_output(count); cuda::memset(g_output.begin(), g_output.end(), 0); { halmd::scoped_timer<halmd::timer> t(elapsed); halmd::iota(g_output.begin(), g_output.end(), value); } cuda::host::vector<size_type> h_output(count); BOOST_CHECK( cuda::copy( g_output.begin() , g_output.end() , h_output.begin()) == h_output.end() ); BOOST_CHECK_EQUAL_COLLECTIONS( h_output.begin() , h_output.end() , boost::make_counting_iterator(value) , boost::make_counting_iterator(value + count) ); } BOOST_TEST_MESSAGE( " " << mean(elapsed) * 1e3 << " ± " << error_of_mean(elapsed) * 1e3 << " ms per iteration" ); }
void error(const char * msg, ...) { char buf[4096]; va_list args; va_start(args, msg); vsnprintf(buf, 4096, msg, args); va_end(args); g_output(FAILURE, buf); }
void info(const char * msg, ...) { char buf[4096]; va_list args; va_start(args, msg); vsnprintf(buf, 4096, msg, args); va_end(args); g_output(INFO, buf); }
void debug(const char * format, ...) { #if defined DEBUG || _DEBUG va_list args; va_start(args, format); g_output(DEBUG, format, args); va_end(args); #else (void)format; #endif }
void fatal(const char * msg, ...) { char buf[4096]; va_list args; va_start(args, msg); vsnprintf(buf, 4096, msg, args); va_end(args); g_output(FATAL, buf); exit(EXIT_FAILURE); }
void GeneralTab::updateVideoOutput() { int output; v4l2_output out; if (!g_output(output)) return; enum_output(out, true, output); m_videoOutput->setCurrentIndex(output); if (m_tvStandard) m_tvStandard->setEnabled(out.capabilities & V4L2_OUT_CAP_STD); if (m_videoPreset) m_videoPreset->setEnabled(out.capabilities & V4L2_OUT_CAP_PRESETS); }
void debug(const char * msg, ...) { if(!g_enableVerboseOutput) return; char buf[4096]; va_list args; va_start(args, msg); vsnprintf(buf, 4096, msg, args); va_end(args); g_output(DEBUG, buf); }
/** * Test halmd::radix_sort on GPU. */ static void test_radix_sort_gpu(int count, int repeat) { std::vector<unsigned int> input = make_uniform_array(count); cuda::vector<unsigned int> g_input(count); BOOST_CHECK( cuda::copy( input.begin() , input.end() , g_input.begin()) == g_input.end() ); std::vector<unsigned int> result(input.begin(), input.end()); std::sort(result.begin(), result.end()); BOOST_TEST_MESSAGE( " " << count << " elements" ); BOOST_TEST_MESSAGE( " " << repeat << " iterations" ); halmd::accumulator<double> elapsed; for (int i = 0; i < repeat; ++i) { cuda::vector<unsigned int> g_output(count); BOOST_CHECK( cuda::copy( g_input.begin() , g_input.end() , g_output.begin()) == g_output.end() ); { halmd::scoped_timer<halmd::timer> t(elapsed); halmd::radix_sort(g_output.begin(), g_output.end()); } cuda::host::vector<unsigned int> h_output(count); BOOST_CHECK( cuda::copy( g_output.begin() , g_output.end() , h_output.begin()) == h_output.end() ); BOOST_CHECK_EQUAL_COLLECTIONS( h_output.begin() , h_output.end() , result.begin() , result.end() ); } BOOST_TEST_MESSAGE( " " << mean(elapsed) * 1e3 << " ± " << error_of_mean(elapsed) * 1e3 << " ms per iteration" ); }
void trace(Severity s, const char * msg, ...) { if(g_enableVerboseOutput || s > DEBUG) { char buf[4096]; va_list args; va_start(args, msg); vsnprintf(buf, 4096, msg, args); va_end(args); g_output(s, buf); if(s >= FATAL) { exit(0); // Sometimes "exit" is not enough, this is guaranteed to work int * bad = 0; *bad = 123456; } } }
void ApplicationWindow::updateLimRGBRange() { if (m_tpgLimRGBRange == NULL) return; v4l2_output out; g_output(out.index); enum_output(out, true, out.index); if (out.capabilities & V4L2_OUT_CAP_STD) { m_tpgLimRGBRange->setChecked(false); } else if (out.capabilities & V4L2_OUT_CAP_DV_TIMINGS) { v4l2_dv_timings timings; g_dv_timings(timings); if (timings.bt.standards & V4L2_DV_BT_STD_CEA861) m_tpgLimRGBRange->setChecked(true); else m_tpgLimRGBRange->setChecked(false); } else { m_tpgLimRGBRange->setChecked(false); } }