Exemplo n.º 1
0
from __future__ import with_statement
from pyps import workspace, module

#Deleting workspace
workspace.delete("hyantes")

#Creating workspace
w = workspace("hyantes/hyantes.c",
              "hyantes/options.c",
              cppflags='-Ihyantes',
              name="hyantes",
              deleteOnClose=True)

#Add some default property
w.props.abort_on_user_error = True

w.activate(module.region_chains)

w.props.constant_path_effects = False

w["hyantes!do_run_AMORTIZED_DISK"].privatize_module()

#Closing workspace
w.close()
Exemplo n.º 2
0
from __future__ import with_statement  # this is to work with python2.5
import terapyps
from pyps import workspace
workspace.delete("convol3x3")
with terapyps.workspace("convol3x3.c",
                        name="convol3x3",
                        deleteOnClose=False,
                        recoverInclude=False) as w:
    for f in w.fun:
        f.terapix_code_generation(debug=True)
#    w.compile(terapyps.Maker())
Exemplo n.º 3
0
from __future__ import with_statement  # this is to work with python2.5
import terapyps
from pyps import workspace
workspace.delete("herode")
with terapyps.workspace("herode.c",
                        name="herode",
                        deleteOnClose=False,
                        recoverInclude=False) as w:
    for f in w.fun:
        f.terapix_code_generation(debug=True)
#    w.compile(terapyps.Maker())
Exemplo n.º 4
0
from __future__ import with_statement  # this is to work with python2.5
from pyps import workspace
from sac import workspace as sworkspace
from os import remove
from sys import argv
from os.path import basename, splitext
(filename, _) = splitext(basename(argv[0]))
workspace.delete(filename)
with sworkspace(filename + ".c",
                driver="sse",
                deleteOnClose=True,
                name=filename) as w:
    m = w[filename]
    m.display()
    m.sac()
    m.display()
    a_out0 = w.compile()
    w.run(a_out0)
    a_out1 = w.compile(w.get_sac_maker()())
    w.run(a_out1)
Exemplo n.º 5
0
from __future__ import with_statement  # this is to work with python2.5
from pyps import workspace
from workspace_gettime import workspace as bworkspace

workspace.delete('benchmark')
with bworkspace('benchmark.c', name='benchmark', deleteOnClose=False) as ws:
    ws.fun.run.benchmark_module()
    ws.fun.run.display()
    a = ws.benchmark(iterations=10, args=["200000"])["run"]
Exemplo n.º 6
0
from __future__ import with_statement
from pyps import workspace, module
name="scalarization29"

workspace.delete(name)

with workspace(name+'.c',name=name,deleteOnClose=True) as ws:
	ws.activate(module.must_regions)
	ws.fun.scalarization29.display()
	ws.fun.scalarization29.scalarization()
	ws.fun.scalarization29.display()
with workspace(name+'.c',name=name,deleteOnClose=True) as ws:
	ws.activate(module.must_regions)
	ws.fun.scalarization29.scalarization(force_out=True)
	ws.fun.scalarization29.display()
from __future__ import with_statement  # this is to work with python2.5
import terapyps
from pyps import workspace
workspace.delete("alphablending")
with terapyps.workspace("alphablending.c",
                        name="alphablending",
                        deleteOnClose=False) as w:
    for f in w.fun:
        f.terapix_code_generation(debug=True)
#    w.compile(terapyps.Maker())
Exemplo n.º 8
0
from __future__ import with_statement  # this is to work with python2.5
from pyps import workspace
from terapyps import workspace as teraw, Maker
workspace.delete("addcst")
with teraw("addcst.c",
           name="addcst",
           deleteOnClose=False,
           recoverInclude=False) as w:
    for f in w.fun:
        f.terapix_code_generation(debug=True)
#    w.compile(Maker())
from __future__ import with_statement  # this is to work with python2.5
from pyps import workspace, module


def invoke_function(fu, ws):
    return fu._get_code(activate=module.print_code_out_regions)


if __name__ == "__main__":
    workspace.delete('paws_out_regions')
    with workspace('paws_out_regions.c',
                   name='paws_out_regions',
                   deleteOnClose=True) as ws:
        for fu in ws.fun:
            print invoke_function(fu, ws)
Exemplo n.º 10
0
from __future__ import with_statement  # this is to work with python2.5
from pyps import workspace, module
s = 'compute_intensity02'
workspace.delete(s)
with workspace(s + '.c', name=s, deleteOnClose=True) as ws:
    ws.activate(module.must_regions)
    ws.activate(module.region_chains)
    ws.props.constant_path_effects = False
    firs = ws.filter(lambda s: s.name.find('fir_') != -1)
    firs.display(activate=module.print_code_complexities)
    firs.computation_intensity(
        bandwidth=1,
        frequency=300)  # that is we need a factor of 300 between the two
    firs.display()
    firs.privatize_module()
    firs.coarse_grain_parallelization()
    firs.display()
# -*- coding: utf-8 -*-

from __future__ import with_statement # this is to work with python2.5
from pyps       import workspace, module


def invoke_function(fu, ws):
    return fu._get_code(activate = module.print_code_preconditions)


if __name__=="__main__":
    workspace.delete('paws_preconditions')
    with workspace('paws_preconditions.c', name='paws_preconditions', deleteOnClose=True) as ws:
        for fu in ws.fun:
            print invoke_function(fu, ws)

Exemplo n.º 12
0
from __future__ import with_statement  # this is to work with python2.5
from pyps import workspace, module

import os
import openmp


def invoke_function(fu, ws):
    ws.props.memory_effects_only = False
    fu.openmp(verbose=True)
    l = ws.save()
    fi = open(l[0].pop(), 'r')
    text = fi.read()
    os.remove(fi.name)
    return text


if __name__ == "__main__":
    workspace.delete('paws_openmp')
    with workspace('paws_openmp.c', name='paws_openmp',
                   deleteOnClose=True) as ws:
        for fu in ws.fun:
            print invoke_function(fu, ws)
Exemplo n.º 13
0
from __future__ import with_statement # this is to work with python2.5
import terapyps
from pyps import workspace
workspace.delete("sub")
with terapyps.workspace("sub.c", name="sub", deleteOnClose=False) as w:
    for f in w.fun:
        f.terapix_code_generation(debug=True)
#    w.compile(terapyps.Maker())
Exemplo n.º 14
0
from __future__ import with_statement  # this is to work with python2.5
import terapyps
from pyps import workspace
workspace.delete("add")
with terapyps.workspace("add.c",
                        name="add",
                        deleteOnClose=False,
                        recoverInclude=False) as w:
    for f in w.fun:
        f.terapix_code_generation(debug=True)
#    w.compile(terapyps.Maker())
Exemplo n.º 15
0
from __future__ import with_statement  # this is to work with python2.5
from pyps import workspace

try:
    w = workspace('error.c', name='error', deleteOnClose=True)
    print "you will never see this"
except RuntimeError:
    print "grrrrr, syntax error"
workspace.delete('error')
Exemplo n.º 16
0
from __future__ import with_statement # this is to work with python2.5
from pyps import workspace, module

def invoke_function(fu, ws):
	return fu._get_code(activate = module.{{template_module}})

if __name__=="__main__":
	workspace.delete('{{template_name}}')
	with workspace('{{template_name}}.c',name='{{template_name}}',deleteOnClose=True) as ws:
		for fu in ws.fun:
			print invoke_function(fu, ws)

Exemplo n.º 17
0
from __future__ import with_statement  # this is to work with python2.5
import terapyps
from pyps import workspace
workspace.delete("verode")
with terapyps.workspace("verode.c",
                        name="verode",
                        deleteOnClose=False,
                        recoverInclude=False) as w:
    for f in w.fun:
        f.terapix_code_generation(debug=True)
#    w.compile(terapyps.Maker())
Exemplo n.º 18
0
from pyps import workspace
workspace.delete("bb")
workspace("a a a /spaces01.c", name="bb",
          recoverInclude=False).fun.main.display()
from __future__ import with_statement  # this is to work with python2.5
from pyps import workspace, module


def invoke_function(fu, ws):
    return fu._get_code(activate=module.print_code_in_regions)


if __name__ == "__main__":
    workspace.delete('paws_in_regions')
    with workspace('paws_in_regions.c',
                   name='paws_in_regions',
                   deleteOnClose=True) as ws:
        for fu in ws.fun:
            print invoke_function(fu, ws)