本文整理汇总了Python中unit_base_gen.Base_gen类的典型用法代码示例。如果您正苦于以下问题:Python Base_gen类的具体用法?Python Base_gen怎么用?Python Base_gen使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Base_gen类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self,tb_name,fct_name,no_simd=False) :
Base_gen.__init__(self, tb_name, fct_name, 'scalar')
Nt2_tb_struct.__init__(self)
self.tb_files = self.get_rel_tb_unique_files(tb_name)
self.fct_files = self.get_rel_tb_fcts_files(tb_name,fct_name)
self.unique_files = self.get_rel_tb_unique_files(tb_name)
self.no_simd = no_simd
示例2: create_one_bench
def create_one_bench(tb_name,
fct_name,
mode) :
print("tb %s fct %s with %s mode"%(tb_name,fct_name,mode))
bg = Base_gen(tb_name,fct_name,mode)
print(bg.get_module_style(tb_name))
bbg = Bench_gen(bg)
return bbg.get_gen_result()
示例3: create_one_unit
def create_one_unit(self, fct_name, mode, part,platform) :
# if self.verbose :
print("%s with %s with %s"%(fct_name,mode,part))
bg = Base_gen(self.tb_name,fct_name,mode)
ghg = Global_header_gen(bg,part)
r = ghg.get_gen_result()
dl = bg.get_fct_dict_list()
for rank,d in enumerate(dl) :
df = d.get('functor',False)
if not df : df = self.Default_df
if df.get('no_simd_tests',False) : return []
types = []
if mode == 'simd':
types = bg.recover('simd_types',df,[])
if len(types) == 0:
types = bg.recover('types',df,['real_'])
ret_arity = int(df["ret_arity"])
d_unit = d.get("unit",{})
for typ in types :
thg = Type_header_test_gen(bg,d,typ,rank)
r+=thg.get_gen_beg()
if self.verbose : print("part = %s"%part)
if ("unit"==part) and d_unit.get("specific_values",None) :
svt = Specific_values_test_gen(bg,d,typ,ret_arity,platform)
s = svt.get_gen_result()
## print(s)
## raise SystemExit
## if not s : return False
r += s
if ("cover" == part) and d_unit.get("verif_test",None) :
vtg = Random_verif_test_gen(bg,d,typ,platform)
s = vtg.get_gen_result()
## print(s)
## raise SystemExit
## if not s : return False
r += s
r+=thg.get_gen_end()
return r
示例4: create_unit
def create_unit(tb_name,fct_name,mode,parts =["verif","values"]) :
bg = Base_gen(tb_name,fct_name,mode)
ghg = Global_header_gen(bg)
r = ghg.get_gen_result()
if True:# try :
dl = bg.get_fct_dict_list()
for rank, d in enumerate(dl) :
origin ="types" if mode == 'scalar' else 'simd_types'
types = bg.recover(origin,d["functor"],["real_convert_"])
ret_arity = int(d["functor"]["ret_arity"])
d_unit = d["unit"]
for typ in types :
thg = Type_header_test_gen(bg,d,typ,rank)
r+=thg.get_gen_beg()
if ("values" in parts) and d_unit.get("specific_values",None) :
svt = Specific_values_test_gen(bg,d,typ,ret_arity,mode)
r += svt. get_gen_result()
if ("verif" in parts) and d_unit.get("verif_test",None) :
vtg = Random_verif_test_gen(bg,d,typ,mode)
r += vtg. get_gen_result()
r+=thg.get_gen_end()
return r
示例5: type
dd = d.get("call_types",None)
if dd is None :
return "T"
elif type(dd) is str :
return dd
else :
return dd[i]
if __name__ == "__main__" :
from pprint import PrettyPrinter
from unit_base_gen import Base_gen
from unit_type_header_gen import Type_header_test_gen
from unit_specific_values_gen import Specific_values_test_gen
print __doc__
bg = Base_gen("exponential",'pipo','scalar')
dl = bg.get_fct_dict_list()
## r = []
## for d in dl :
## types = bg.recover("types",d["functor"],[])
## d_unit = d["unit"]
## for typ in types :
## thg = Type_header_test_gen(bg,d,typ,0)
## r+=thg.get_gen_beg()
## if d_unit.get("specific_values",None) :
## svt = Specific_values_test_gen(bg,d,typ,ret_arity,mode)
## r += svt. get_gen_result()
## if d_unit.get("random_tuple_test",None) :
## rtg = Random_tuple_test_gen(bg,d,typ,mode)
## r += rtg. get_gen_result()
## r+=thg.get_gen_end()