コード例 #1
0
from validation import vworkspace

with vworkspace() as w:
  w.props.memory_effects_only = False
  w.props.prettyprint_memory_effects_only = True
  w.activate('must_regions')

  fs=w.fun
  for f in [fs.orig,fs.skewed,fs.tiled]:
    f.display('print_code_preconditions')
    f.display('print_code_regions')
    print "***** COARSE GRAIN ******"
    f.privatize_module()
    f.coarse_grain_parallelization()
    f.display()
    print "***** FINE GRAIN ******"
    f.internalize_parallel_code()
    f.display()
  

コード例 #2
0
from validation import vworkspace

with vworkspace("include/par4all.c") as w:
    h = w.compile()
    ref = w.run(h)
    w.props.constant_path_effects = False
    w.props.isolate_statement_label = "holy"
    w.activate("must_regions")
    w.fun.pain.validate_phases("print_code_regions", "isolate_statement")
    h = w.compile()
    w.run(h)
    print ref, ':', w.run(h)
コード例 #3
0
from validation import vworkspace

with vworkspace("include/p4a_stubs.c") as w:
    w.props.linearize_array_use_pointers = True
    w.props.linearize_array_cast_at_call_site = True
    w.props.isolate_statement_even_non_local = True

    # Transform for GPU
    w.all_functions.privatize_module()
    w.all_functions.coarse_grain_parallelization()
    w.all_functions.gpu_ify()

    # Display kernels
    w.filter(lambda m: m.name.startswith("p4a_kernel")).display()

    # Display wrappers
    w.filter(lambda m: m.name.startswith("p4a_wrapper")).display()

    # Display launchers
    l = w.filter(lambda m: m.name.startswith("p4a_launcher"))
    l.display()

    # Isolate statement
    l.kernel_load_store()
    l.callers.display()
コード例 #4
0
from validation import vworkspace

w=vworkspace()
w.props.constant_path_effects=False
w.props.isolate_statement_label="holy"
w.fun.pain.validate_phases("isolate_statement")
w.close()
コード例 #5
0
from validation import vworkspace
from os import environ

with vworkspace("several_units01/foo.c", cppflags="-Iseveral_units01/") as w:
    w.props.constant_path_effects = True
    w.props.aliasing_across_io_streams = False
    w.props.constant_path_effects = False
    w.props.prettyprint_sequential_style = "omp"
    w.props.memory_effects_only = False
    w.activate("must_regions")

    w.all_functions.validate_phases("print_code_proper_effects")
    w.all_functions.validate_phases("print_code_cumulated_effects")
コード例 #6
0
from validation import vworkspace

with vworkspace("edn99_ppm.c", cppflags="-I.") as w:
    w.props.constant_path_effects = False
    w.all_functions.display()
    w.all_functions.display("print_code_proper_effects")
コード例 #7
0
from validation import vworkspace

with vworkspace("compilation_unit01_bis.c") as w:
    w.activate('must_regions')
    w.all_functions.display('PRINT_CODE_REGIONS')
    w.all_functions.display('PRINT_CODE_IN_REGIONS')
    w.all_functions.display('PRINT_CODE_OUT_REGIONS')
コード例 #8
0
from validation import vworkspace

with vworkspace("consumer.c") as w:
    r = w.fun.producer_consumer
    w.activate("print_chains_graph")
    r.atomic_chains()
    r.display(rc="dg_file")