示例#1
0
    def __init__(self,
                 arg_template,
                 precision=ML_Binary32,
                 abs_accuracy=S2**-24,
                 libm_compliant=True,
                 debug_flag=False,
                 fuse_fma=True,
                 fast_path_extract=True,
                 target=FixedPointBackend(),
                 output_file="ut_static_vectorization.c",
                 function_name="ut_static_vectorization"):
        # precision argument extraction
        precision = ArgDefault.select_value(
            [arg_template.precision, precision])
        io_precisions = [precision] * 2

        # initializing base class
        ML_FunctionBasis.__init__(self,
                                  base_name="ut_static_vectorization",
                                  function_name=function_name,
                                  output_file=output_file,
                                  io_precisions=io_precisions,
                                  abs_accuracy=None,
                                  libm_compliant=libm_compliant,
                                  processor=target,
                                  fuse_fma=fuse_fma,
                                  fast_path_extract=fast_path_extract,
                                  debug_flag=debug_flag,
                                  arg_template=arg_template)

        self.precision = precision
示例#2
0
    def __init__(self,
                 precision=ML_Binary32,
                 abs_accuracy=S2**-24,
                 libm_compliant=True,
                 debug_flag=False,
                 fuse_fma=True,
                 fast_path_extract=True,
                 target=FixedPointBackend(),
                 output_file="ut_call_externalization.c",
                 function_name="ut_call_externalization"):
        io_precisions = [precision] * 2

        # initializing base class
        ML_FunctionBasis.__init__(self,
                                  base_name="ut_call_externalization",
                                  function_name=function_name,
                                  output_file=output_file,
                                  io_precisions=io_precisions,
                                  abs_accuracy=None,
                                  libm_compliant=libm_compliant,
                                  processor=target,
                                  fuse_fma=fuse_fma,
                                  fast_path_extract=fast_path_extract,
                                  debug_flag=debug_flag)

        self.precision = precision
示例#3
0
    def __init__(self,
                 precision=ML_Binary32,
                 abs_accuracy=S2**-24,
                 libm_compliant=True,
                 debug_flag=False,
                 fuse_fma=True,
                 fast_path_extract=True,
                 target=FixedPointBackend(),
                 output_file="ut_opencl_code.c",
                 function_name="ut_opencl_code",
                 vector_size=2,
                 language=C_Code):
        io_precisions = [precision] * 2

        # initializing base class
        ML_FunctionBasis.__init__(self,
                                  base_name="ut_opencl_code",
                                  function_name=function_name,
                                  output_file=output_file,
                                  io_precisions=io_precisions,
                                  abs_accuracy=None,
                                  libm_compliant=libm_compliant,
                                  processor=target,
                                  fuse_fma=fuse_fma,
                                  fast_path_extract=fast_path_extract,
                                  debug_flag=debug_flag,
                                  vector_size=vector_size,
                                  language=language)

        self.precision = precision
示例#4
0
 def get_default_args(**kw):
     """ Return a structure containing the arguments for ML_SinCos,
         builtin from a default argument mapping overloaded with @p kw """
     default_args_sincos = {
         "output_file": "my_sincos.c",
         "function_name": "new_fastsincos",
         "precision": ML_Binary32,
         "accuracy": ML_Faithful,
         "target": FixedPointBackend.get_target_instance(),
         "cos_output": True,
     }
     default_args_sincos.update(kw)
     return DefaultArgTemplate(**default_args_sincos)
示例#5
0
 def get_default_args(**kw):
     """ Return a structure containing the arguments for current class,
     builtin from a default argument mapping overloaded with @p kw """
     default_args = {
         "output_file": "ut_vector_code.c",
         "function_name": "ut_vector_code",
         "precision": ML_Binary32,
         "target": FixedPointBackend(),
         "fast_path_extract": True,
         "fuse_fma": True,
         "libm_compliant": True
     }
     default_args.update(kw)
     return DefaultArgTemplate(**default_args)
示例#6
0
 def get_default_args(**kw):
     """ generate default argument structure for BipartiteApprox """
     default_dict = {
         "target": FixedPointBackend(),
         "output_file": "my_bipartite_approx.c",
         "entity_name": "my_bipartie_approx",
         "language": C_Code,
         "function": lambda x: 1.0 / x,
         "interval": Interval(1, 2),
         "pipelined": False,
         "precision": fixed_point(1, 15, signed=False),
         "disable_sub_testing": False,
         "disable_sv_testing": False,
         "alpha": 6,
         "beta": 5,
         "gamma": 5,
         "guard_bits": 3,
         "passes": ["start:size_datapath"],
     }
     default_dict.update(kw)
     return DefaultArgTemplate(**default_dict)