diff options
author | Nick Foster | 2011-02-16 17:20:09 -0800 |
---|---|---|
committer | Nick Foster | 2011-02-16 17:20:09 -0800 |
commit | 0eeeb636a89c5086293bae31511316e4200ad2f9 (patch) | |
tree | ba5d6fa502044257fc24f849e3562b91d2d586c9 /volk/include | |
parent | 8ac430070308f83e8d88f6ae8cf802ccf5a9cf82 (diff) | |
download | gnuradio-0eeeb636a89c5086293bae31511316e4200ad2f9.tar.gz gnuradio-0eeeb636a89c5086293bae31511316e4200ad2f9.tar.bz2 gnuradio-0eeeb636a89c5086293bae31511316e4200ad2f9.zip |
Volk_runtime now does self-initialization. You can call volk_xxx_a16() just like in volk.c.
The first run of each function does the rank_archs call. Subsequent calls proceed with no overhead.
volk_init is still being generated but not used at all.
Diffstat (limited to 'volk/include')
-rw-r--r-- | volk/include/volk/make_runtime.py | 10 | ||||
-rw-r--r-- | volk/include/volk/make_runtime_c.py | 9 | ||||
-rwxr-xr-x | volk/include/volk/volk_register.py | 4 |
3 files changed, 9 insertions, 14 deletions
diff --git a/volk/include/volk/make_runtime.py b/volk/include/volk/make_runtime.py index 645b3aaee..91e703b24 100644 --- a/volk/include/volk/make_runtime.py +++ b/volk/include/volk/make_runtime.py @@ -4,7 +4,7 @@ from volk_regexp import * -def make_runtime(funclist) : +def make_runtime(funclist, arglist) : tempstring = ""; tempstring = tempstring + '/*this file is auto generated by volk_register.py*/\n'; @@ -18,14 +18,8 @@ def make_runtime(funclist) : tempstring = tempstring + '\n'; - tempstring = tempstring + "struct VOLK_RUNTIME {\n"; - for i in range(len(funclist)): - tempstring = tempstring + replace_volk.sub("p", funclist[i]) + " " + funclist[i] + ";\n"; - tempstring = tempstring + "};\n\n"; - - tempstring = tempstring + "struct VOLK_RUNTIME* get_volk_runtime();\n\n" - tempstring = tempstring + "\nvoid volk_runtime_init();\n"; + tempstring = tempstring + "extern void (*" + funclist[i] + ")(" + arglist[i] + ");\n" tempstring = tempstring + emit_epilog(); tempstring = tempstring + "#endif /*INCLUDED_VOLK_RUNTIME*/\n"; diff --git a/volk/include/volk/make_runtime_c.py b/volk/include/volk/make_runtime_c.py index 070df9ba7..0519dddf8 100644 --- a/volk/include/volk/make_runtime_c.py +++ b/volk/include/volk/make_runtime_c.py @@ -3,7 +3,7 @@ import string from volk_regexp import * -def make_runtime_c(funclist, taglist, arched_arglist, retlist, my_arglist, fcountlist) : +def make_runtime_c(funclist, taglist, arched_arglist, retlist, my_arglist, fcountlist, my_argtypelist) : tempstring = ""; tempstring = tempstring + '/*this file is auto generated by volk_register.py*/'; @@ -18,8 +18,6 @@ def make_runtime_c(funclist, taglist, arched_arglist, retlist, my_arglist, fcoun for func in funclist: tempstring = tempstring + "#include<volk/" + func + ".h>\n" ; tempstring = tempstring + '\n'; - - tempstring = tempstring + "struct VOLK_RUNTIME volk_runtime;\n"; for i in range(len(funclist)): tempstring = tempstring + "static const " + replace_volk.sub("p", funclist[i]) + " " + funclist[i] + "_archs[] = {\n"; @@ -42,6 +40,9 @@ def make_runtime_c(funclist, taglist, arched_arglist, retlist, my_arglist, fcoun tempstring = tempstring + retlist[i] + "default_acquire_" + funclist[i] + replace_arch.sub("", arched_arglist[i]) + '\n'; - tempstring = tempstring + "volk_runtime." + funclist[i] + " = " + funclist[i] + "_archs[volk_rank_archs(" + funclist[i] + "_arch_defs, volk_get_lvarch())];\n" + "return " + funclist[i] + "_archs[volk_rank_archs(" + funclist[i] + "_arch_defs, volk_get_lvarch())](" + my_arglist[i] + ");" + '\n}\n'; + tempstring = tempstring + " %s = %s_archs[volk_rank_archs(%s_arch_defs, volk_get_lvarch())];\n" % (funclist[i], funclist[i], funclist[i]) + tempstring = tempstring + " %s(%s);\n}\n\n" % (funclist[i], my_arglist[i]) + + tempstring = tempstring + "%s(*%s)(%s) = &default_acquire_%s;\n\n" % (retlist[i], funclist[i], my_argtypelist[i], funclist[i]) return tempstring; diff --git a/volk/include/volk/volk_register.py b/volk/include/volk/volk_register.py index 460a11fab..b719042df 100755 --- a/volk/include/volk/volk_register.py +++ b/volk/include/volk/volk_register.py @@ -241,13 +241,13 @@ outfile_config_fixed.close(); outfile_c.write( make_c(functions, taglist, arched_arglist, retlist, my_arglist, fcountlist)); outfile_c.close(); -outfile_runtime_c.write(make_runtime_c(functions, taglist, arched_arglist, retlist, my_arglist, fcountlist)); +outfile_runtime_c.write(make_runtime_c(functions, taglist, arched_arglist, retlist, my_arglist, fcountlist, my_argtypelist)); outfile_runtime_c.close(); outfile_init_c.write(make_init_c(functions, filearchs)); outfile_init_c.close(); -outfile_runtime.write(make_runtime(functions)); +outfile_runtime.write(make_runtime(functions, my_argtypelist)); outfile_runtime.close(); outfile_typedefs.write(make_typedefs(functions, retlist, my_argtypelist)); |