Ejemplo n.º 1
0
    def __init__(self, scene_key=0.18, saturation=0.6):
        self._asm = create_assembler()
        self._runtime = Runtime()
        self._macro_call = macro_call = MacroCall()
        self._asm.register_macro('call', macro_call.macro_call)
        macro_call.set_runtimes([self._runtime])

        self._reinhard_asm()

        self._key = float(scene_key)
        self._saturation = float(saturation)
Ejemplo n.º 2
0
    def __init__(self, m=0.6, c=0.5, a=0.5, f=1.0):

        self._asm = create_assembler()
        self._runtime = Runtime()
        self._macro_call = macro_call = MacroCall()
        self._asm.register_macro('call', macro_call.macro_call)
        macro_call.set_runtimes([self._runtime])

        self._photoreceptor_asm()

        self._m = m # contrast range usually 0.2-0.9 - you can limit this 0.0-1.0
        self._c = c # adaptation range 0.0-1.0
        self._a = a # colornes-contrast range 0.0-1.0
        self._f = f # lightnes 
Ejemplo n.º 3
0
 def setUp(self):
     self.runtime = Runtime()
     self.macro_call = MacroCall()
     self.macro_call.set_runtimes([self.runtime])
     self.assembler = Tdasm()
     self.assembler.register_macro('call', self.macro_call.macro_call)
Ejemplo n.º 4
0
macro eq128 nrez = xmm4 {xmm4}

macro broadcast xmm5 = xmm4[3]
macro eq128 brod = xmm5 {xmm0}

macro if xmm5 < d goto _lab

_lab:
macro dot xmm7 = n1 * n2 {xmm7, xmm6}
macro eq32 dot_rez = xmm7 {xmm7}

macro mov eax, t1
macro eq128 temp5 = eax.triangle.p0 + one {xmm7}
#END
'''

runtime = Runtime()
mac_call = MacroCall()
mac_call.set_runtimes([runtime])
assembler = create_assembler()
mc = assembler.assemble(ASM)
mc.print_machine_code()
ds = runtime.load('test_arithmetic', mc)

runtime.run('test_arithmetic')
print(ds['m4'])
print(ds['nrez'])
print(ds['brod'])
print(ds['dot_rez'])
print(ds['temp5'])
Ejemplo n.º 5
0
    code = """
    #DATA
    float v1[4]
    float v2[4]
    #CODE
    movaps xmm0, oword [v1]
    movaps xmm1, oword [v2]
    """
    code += "macro call " + func_name + """
    movaps oword [v1], xmm0 
    movaps oword [v2], xmm6
    #END
    """
    return code

runtime = Runtime()
macro_call = MacroCall()
macro_call.set_runtimes([runtime])
assembler = Tdasm()
assembler.register_macro('call', macro_call.macro_call)

assembler.assemble(asm_code('fast_sin_ps'))
assembler.assemble(asm_code('fast_cos_ps'))

start = time.clock()
runtime = Runtime()
macro_call.set_runtimes([runtime])
end = time.clock()
print(end-start)