Ejemplo n.º 1
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_static_vectorization.c",
         "function_name":
         "ut_static_vectorization",
         "precision":
         ML_Binary32,
         "target":
         VectorBackend.get_target_instance(),
         "passes": [
             "beforecodegen:virtual_vector_bool_legalization",
             "beforecodegen:vector_mask_test_legalization"
         ],
         "fast_path_extract":
         True,
         "fuse_fma":
         True,
         "libm_compliant":
         True
     }
     default_args.update(kw)
     return DefaultArgTemplate(**default_args)
Ejemplo n.º 2
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": VectorBackend(),
         "fast_path_extract": True,
         "fuse_fma": True,
         "libm_compliant": True
     }
     default_args.update(kw)
     return DefaultArgTemplate(**default_args)
Ejemplo n.º 3
0
    # FunctionTest(metalibm_functions.ml_log2.ML_Log2, [{}]),
    FunctionTest(metalibm_functions.ml_exp2.ML_Exp2, [{}]),
    FunctionTest(metalibm_functions.ml_cbrt.ML_Cbrt, [{}]),
    FunctionTest(metalibm_functions.ml_sqrt.MetalibmSqrt, [{}]),
    FunctionTest(metalibm_functions.ml_isqrt.ML_Isqrt, [{}]),
    FunctionTest(metalibm_functions.ml_vectorizable_log.ML_Log, [{}]),
    FunctionTest(metalibm_functions.ml_sincos.ML_SinCos, [{}]),
]

global_test_list = []

# instantiating target objects
X86_AVX2 = X86_AVX2_Processor()
GENERIC_PROCESSOR = GenericProcessor()
X86_PROCESSOR = X86_Processor()
VECTOR_BACKEND = VectorBackend()

TARGET_OPTIONS_MAP = {
    GENERIC_PROCESSOR: {},
    X86_AVX2: {
        "passes": [
            "beforecodegen:basic_legalization",
            "beforecodegen:expand_multi_precision",
            "beforecodegen:m128_promotion", "beforecodegen:m256_promotion"
        ]
    },
    VECTOR_BACKEND: {},
    X86_PROCESSOR: {},
}

SCALAR_TARGET_LIST = [GENERIC_PROCESSOR, X86_PROCESSOR, X86_AVX2]
Ejemplo n.º 4
0
                "vector-size": 4,
                "pre-gen-pass": avx2_pass_m128_promotion,
            },
            {
                "precision": ML_Binary32,
                "target": x86_avx2_processor,
                "vector-size": 8,
                "pre-gen-pass": avx2_pass_m256_promotion,
            },
        ]),
    NewSchemeTest("vector exp test", metalibm_functions.ml_exp.ML_Exponential,
                  [
                      {
                          "precision": ML_Binary32,
                          "vector_size": 2,
                          "target": VectorBackend()
                      },
                  ]),
    NewSchemeTest("external bench test",
                  metalibm_functions.external_bench.ML_ExternalBench, [
                      {
                          "precision": ML_Binary32,
                          "bench_function_name": "tanf",
                          "target": target_instanciate("x86"),
                          "input_precisions": [ML_Binary32],
                          "bench_execute": 1000,
                          "bench_test_range": Interval(-1, 1)
                      },
                  ]),
]
Ejemplo n.º 5
0
                   "auto_test": 128,
                   "execute_trigger": True
               }]),
 NewSchemeTest("vector hyperbolic cosine gen test",
               metalibm_functions.ml_cosh.ML_HyperbolicCosine, [
                   {
                       "precision":
                       ML_Binary32,
                       "vector_size":
                       4,
                       "auto_test":
                       128,
                       "execute_trigger":
                       True,
                       "target":
                       VectorBackend.get_target_instance(),
                       "passes": [
                           "beforecodegen:virtual_vector_bool_legalization",
                           "beforecodegen:vector_mask_test_legalization"
                       ]
                   },
                   {
                       "precision":
                       ML_Binary32,
                       "vector_size":
                       8,
                       "auto_test":
                       128,
                       "execute_trigger":
                       True,
                       "target":
Ejemplo n.º 6
0
        else:
            print_report("OVERALL FAILURE")
        print_report("</p>\n")
        print_report("generated: {}".format(datetime.datetime.today()))

        print_report("</div></body></html>")



global_test_list = []

# instantiating target objects
X86_AVX2 = X86_AVX2_Processor.get_target_instance()
GENERIC_PROCESSOR = GenericProcessor.get_target_instance()
X86_PROCESSOR = X86_Processor.get_target_instance()
VECTOR_BACKEND = VectorBackend.get_target_instance()

TARGET_OPTIONS_MAP = {
    GENERIC_PROCESSOR: {},
    X86_AVX2: {
        "extra_passes": [
            "beforecodegen:basic_legalization",
            "beforecodegen:expand_multi_precision",
            "beforecodegen:virtual_vector_bool_legalization",
            "beforecodegen:m128_promotion",
            "beforecodegen:m256_promotion",
            "beforecodegen:vector_mask_test_legalization"
        ]
    },
    VECTOR_BACKEND: {
        "extra_passes": [