我创建了一个没有自定义代码的新块,只将变量类型设置为float,输入和输出的数量设置为1,我看到了相同的行为。我一定做错了什么,但我不知道是什么。。。
$ gnuradio-config-info -v
3.7.11
Platform: Mac / x86_64
$ gr_modtool add -t general donothingcpp
GNU Radio module name identified: acsound
Language (python/cpp): cpp
Language: C++
Block/code identifier: donothingcpp
Enter valid argument list, including default arguments:
Add Python QA code? [Y/n] n
Add C++ QA code? [Y/n] n
Adding file 'lib/donothingcpp_impl.h'...
Adding file 'lib/donothingcpp_impl.cc'...
Adding file 'include/acsound/donothingcpp.h'...
Editing swig/acsound_swig.i...
Adding file 'grc/acsound_donothingcpp.xml'...
Editing grc/CMakeLists.txt...
以下是用于测试的流程图:
int
donothingcpp_impl::general_work (int noutput_items,
gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
{
const float *in = (const float *) input_items[0];
float *out = (float *) output_items[0];
// Do <+signal processing+>
// Tell runtime system how many input items we consumed on
// each input stream.
consume_each (noutput_items);
// Tell runtime system how many output items we produced.
return noutput_items;
}
我是否在
general_work
如果我绕过donothing块并运行流程图,它将消耗0.3%的CPU。
我尝试了零信号接收器和探测信号接收器,但两者似乎都不是一个因素。