Example #1
0
 def get_default_args(**args):
     """ Generate a default argument structure set specifically for
         the Hyperbolic Cosine """
     default_div_args = {
         "precision":
         ML_Binary32,
         "accuracy":
         ML_CorrectlyRounded,
         "target":
         GenericProcessor.get_target_instance(),
         "output_file":
         "my_div.c",
         "function_name":
         "my_div",
         "input_intervals": [DefaultArgTemplate.input_intervals[0]] * 2,
         "auto_test_range":
         DefaultArgTemplate.auto_test_range * 2,
         "bench_test_range":
         DefaultArgTemplate.bench_test_range * 2,
         "language":
         C_Code,
         "num_iter":
         3,
         "passes": [
             "typing:basic_legalization",
             "beforecodegen:expand_multi_precision"
         ],
         "vector_size":
         1,
     }
     default_div_args.update(args)
     return DefaultArgTemplate(**default_div_args)
Example #2
0
 def get_default_args(**kw):
     """ Return a structure containing the arguments for MetaAtan,
             builtin from a default argument mapping overloaded with @p kw
     """
     default_args_rootn = {
         "output_file":
         "rootn.c",
         "function_name":
         "rootn",
         "input_precisions": [ML_Binary32, ML_Int32],
         "accuracy":
         ML_Faithful,
         "input_intervals": [
             sollya.Interval(-2.0**126, 2.0**126),
             sollya.Interval(-2**24, 2**24)
         ],
         "auto_test_range": [
             sollya.Interval(-2.0**126, 2.0**126),
             sollya.Interval(-2**24, 2**24)
         ],
         "target":
         GenericProcessor.get_target_instance(),
         "expand_div":
         False,
     }
     default_args_rootn.update(kw)
     return DefaultArgTemplate(**default_args_rootn)
Example #3
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_new_arg_template.c",
       "function_name": "ut_new_arg_template",
       "precision": ML_Binary32,
       "accuracy": ML_Faithful,
       "target": MPFRProcessor()
   }
   default_args.update(kw)
   return DefaultArgTemplate(**default_args)
Example #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)
Example #5
0
 def get_default_args(**kw):
     """ Return a structure containing the arguments for MetalibmSqrt,
         builtin from a default argument mapping overloaded with @p kw """
     default_args_fast_exp2i = {
         "output_file": "fast_expi.c",
         "function_name": "fast_expi",
         "input_precisions": [ML_Int32],
         "precision": ML_Binary32,
         "accuracy": ML_Faithful,
         "target": GenericProcessor.get_target_instance()
     }
     default_args_fast_exp2i.update(kw)
     return DefaultArgTemplate(**default_args_fast_exp2i)
Example #6
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_machine_insn_generation.S",
         "function_name": "ut_machine_insn_generation",
         "precision": ML_Binary32,
         "passes": [
             # default pass for dummy asm target are enough
         ],
     }
     default_args.update(kw)
     return DefaultArgTemplate(**default_args)
Example #7
0
 def get_default_args(**kw):
     """ Return a structure containing the arguments for FunctionExpression,
         builtin from a default argument mapping overloaded with @p kw """
     default_args_log = {
         "output_file": "func_expr.c",
         "function_name": "func_expr",
         "function_expr_str": "exp(x)",
         "precision": ML_Binary32,
         "accuracy": ML_Faithful,
         "expand_div": False,
         "target": GenericProcessor.get_target_instance(),
     }
     default_args_log.update(kw)
     return DefaultArgTemplate(**default_args_log)
Example #8
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_gappa_code.c",
         "function_name": "ut_gappa_code",
         "precision": ML_Binary32,
         "target": MPFRProcessor(),
         "fast_path_extract": True,
         "fuse_fma": True,
         "libm_compliant": True
     }
     default_args.update(kw)
     return DefaultArgTemplate(**default_args)
Example #9
0
 def get_default_args(**kw):
     """ Return a structure containing the arguments for ML_Exponential,
         builtin from a default argument mapping overloaded with @p kw """
     default_args_mmk = {
         "output_file": "mm_kernel.c",
         "function_name": "mm_kernel",
         "test_index_range": [[16, 32], [16, 32], [16, 32]],
         "auto_test_range": [Interval(-1, 1), Interval(-1, 1)],
         "vectorize": False,
         "precision": ML_Binary32,
         "target": GenericProcessor.get_target_instance()
     }
     default_args_mmk.update(kw)
     return DefaultArgTemplate(**default_args_mmk)
Example #10
0
 def get_default_args(**kw):
     """ Return a structure containing the arguments for MetaAtan,
             builtin from a default argument mapping overloaded with @p kw
     """
     default_args_pow = {
         "output_file": "ml_pow.c",
         "function_name": "ml_pow",
         "input_precisions": [ML_Binary32, ML_Binary32],
         "accuracy": ML_Faithful,
         "input_intervals": [None, Interval(-2**24, 2**24)], # sollya.Interval(-2.0**126, 2.0**126), sollya.Interval(0, 2**31-1)],
         "auto_test_range": [None, Interval(-2**24, 2**24)], # sollya.Interval(-2.0**126, 2.0**126), sollya.Interval(0, 47)],
         "target": GenericProcessor.get_target_instance()
     }
     default_args_pow.update(kw)
     return DefaultArgTemplate(**default_args_pow)
Example #11
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_llvm_code.ll",
         "function_name": "ut_llvm_code",
         "precision": ML_Int32,
         "target": LLVMBackend(),
         "language": LLVM_IR_Code,
         "fast_path_extract": True,
         "fuse_fma": False,
         "libm_compliant": True
     }
     default_args.update(kw)
     return DefaultArgTemplate(**default_args)
Example #12
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_m128_conversion.c",
         "function_name": "ut_m128_conversion",
         "precision": ML_Binary32,
         "target": X86_AVX2_Processor(),
         "fast_path_extract": True,
         "fuse_fma": True,
         "debug": True,
         "libm_compliant": True,
         "pre_gen_passes": ["m128_promotion"],
     }
     default_args.update(kw)
     return DefaultArgTemplate(**default_args)
Example #13
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_mp_vectorization.c",
             "function_name": "ut_mp_vectorization",
             "precision": ML_DoubleDouble,
             "target": GenericProcessor.get_target_instance(),
             "fast_path_extract": True,
             "fuse_fma": True,
             "passes": ["start:basic_legalization", "start:expand_multi_precision"],
             "libm_compliant": True
     }
     default_args.update(kw)
     return DefaultArgTemplate(**default_args)
Example #14
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_legalize_sqrt.c",
         "function_name": "ut_legalize_sqrt",
         "precision": ML_Binary32,
         "target": GenericProcessor(),
         "fast_path_extract": True,
         "fuse_fma": True,
         "debug": True,
         "libm_compliant": True,
         "test_range": Interval(S2**-8, S2**8),
         "accuracy": dar(S2**-7),
     }
     default_args.update(kw)
     return DefaultArgTemplate(**default_args)
Example #15
0
 def get_default_args(**args):
     """ Generate a default argument structure set specifically for
         the Hyperbolic Cosine """
     default_div_args = {
         "precision": ML_Binary32,
         "accuracy": ML_CorrectlyRounded,
         "target": GenericProcessor(),
         "output_file": "my_div.c",
         "function_name": "my_div",
         "language": C_Code,
         "num_iter": 3,
         "passes": ["beforecodegen:expand_multi_precision"],
         "vector_size": 1,
         "arity": ML_Division.arity,
     }
     default_div_args.update(args)
     return DefaultArgTemplate(**default_div_args)
Example #16
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_multi_precision.c",
         "function_name": "ut_multi_precision",
         "precision": ML_Binary32,
         "target": GenericProcessor(),
         "language": C_Code,
         "arity": 2,
         "input_precisions": [ML_Binary32, ML_Binary32],
         "fast_path_extract": True,
         "fuse_fma": False,
         "libm_compliant": True
     }
     default_args.update(kw)
     return DefaultArgTemplate(**default_args)
Example #17
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_eval_error.c",
         "function_name": "ut_eval_error",
         "precision": FIXED_FORMAT,
         "target": GenericProcessor.get_target_instance(),
         "fast_path_extract": True,
         "fuse_fma": True,
         "debug": True,
         "libm_compliant": True,
         "test_range": Interval(S2**-8, S2**8),
         "accuracy": dar(S2**-6),
     }
     default_args.update(kw)
     return DefaultArgTemplate(**default_args)
Example #18
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_bfloat16.c",
         "function_name": "ut_bfloat16",
         "precision": ML_Binary32,
         "input_precisions": [ML_UInt32],
         "target": GenericProcessor.get_target_instance(),
         "fast_path_extract": True,
         "fuse_fma": True,
         "debug": True,
         "libm_compliant": True,
         "table_size": 16,
         "auto_test_range": Interval(0, 16),
         "accuracy": dar(S2**-7),
     }
     default_args.update(kw)
     return DefaultArgTemplate(**default_args)
Example #19
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)