A few touchups

This commit is contained in:
Steven Robertson 2010-09-13 00:20:15 -04:00
parent e0b218feba
commit e4aac6993f
3 changed files with 9 additions and 9 deletions

View File

@ -68,12 +68,12 @@ class IterThread(PTXEntryPoint):
with block("Claim a CP"): with block("Claim a CP"):
std.set_is_first_thread(reg.pred('p_is_first')) std.set_is_first_thread(reg.pred('p_is_first'))
op.atom.add.u32(cp_idx, addr(g_num_cps_started), 1, ifp=p_is_first) op.atom.add.u32(cp_idx, addr(g_num_cps_started), 1, ifp=p_is_first)
op.st.shared.u32(addr(s_cp_idx), cp_idx, ifp=p_is_first) op.st.volatile.shared.u32(addr(s_cp_idx), cp_idx, ifp=p_is_first)
op.st.shared.s32(addr(s_num_samples), 0) op.st.volatile.shared.s32(addr(s_num_samples), 0)
comment("Load the CP index in all threads") comment("Load the CP index in all threads")
op.bar.sync(0) op.bar.sync(0)
op.ld.shared.u32(cp_idx, addr(s_cp_idx)) op.ld.volatile.shared.u32(cp_idx, addr(s_cp_idx))
with block("Check to see if this CP is valid (if not, we're done)"): with block("Check to see if this CP is valid (if not, we're done)"):
reg.u32('num_cps') reg.u32('num_cps')
@ -178,7 +178,7 @@ class IterThread(PTXEntryPoint):
reg.s32('num_samples num_samples_needed') reg.s32('num_samples num_samples_needed')
comment('Sync before making decision to prevent divergence') comment('Sync before making decision to prevent divergence')
op.bar.sync(3) op.bar.sync(3)
op.ld.shared.s32(num_samples, addr(s_num_samples)) op.ld.volatile.shared.s32(num_samples, addr(s_num_samples))
cp.get(cpA, num_samples_needed, 'cp.nsamples') cp.get(cpA, num_samples_needed, 'cp.nsamples')
op.setp.ge.s32(p_cp_done, num_samples, num_samples_needed) op.setp.ge.s32(p_cp_done, num_samples, num_samples_needed)
op.bra.uni(cp_loop_start, ifp=p_cp_done) op.bra.uni(cp_loop_start, ifp=p_cp_done)
@ -519,9 +519,9 @@ class ShufflePoints(PTXFragment):
op.mad.lo.u32(shuf_read, shuf_off, 4, shuf_read) op.mad.lo.u32(shuf_read, shuf_off, 4, shuf_read)
for var in args: for var in args:
op.bar.sync(bar) op.bar.sync(bar)
op.st.shared.b32(addr(shuf_write), var) op.st.volatile.shared.b32(addr(shuf_write), var)
op.bar.sync(bar) op.bar.sync(bar)
op.ld.shared.b32(var, addr(shuf_read)) op.ld.volatile.shared.b32(var, addr(shuf_read))
class MWCRNG(PTXFragment): class MWCRNG(PTXFragment):
shortname = "mwc" shortname = "mwc"

View File

@ -63,8 +63,8 @@ class _Frame(pyflam3.Frame):
sizeof(BaseGenome)) sizeof(BaseGenome))
self.ngenomes = len(genomes) self.ngenomes = len(genomes)
# TODO: do this here? # TODO: allow user to override this
self.pixel_aspect_ratio = float(genomes[0].height) / genomes[0].width self.pixel_aspect_ratio = 1.0
def interpolate(self, time, stagger=0, cp=None): def interpolate(self, time, stagger=0, cp=None):
cp = cp or BaseGenome() cp = cp or BaseGenome()

View File

@ -59,7 +59,7 @@ def main(args):
print anim.features.hist_width print anim.features.hist_width
print anim.features.hist_height print anim.features.hist_height
print anim.features.hist_stride print anim.features.hist_stride
window = pyglet.window.Window(800, 600) window = pyglet.window.Window(1600, 900)
image = pyglet.image.ImageData(anim.features.hist_width, image = pyglet.image.ImageData(anim.features.hist_width,
anim.features.hist_height, anim.features.hist_height,
'RGBA', 'RGBA',