From e4aac6993f6ed6da7d28a56562953581b08dd42b Mon Sep 17 00:00:00 2001 From: Steven Robertson Date: Mon, 13 Sep 2010 00:20:15 -0400 Subject: [PATCH] A few touchups --- cuburn/device_code.py | 12 ++++++------ cuburn/render.py | 4 ++-- main.py | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cuburn/device_code.py b/cuburn/device_code.py index 3028deb..4bf3e16 100644 --- a/cuburn/device_code.py +++ b/cuburn/device_code.py @@ -68,12 +68,12 @@ class IterThread(PTXEntryPoint): with block("Claim a CP"): 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.st.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.u32(addr(s_cp_idx), cp_idx, ifp=p_is_first) + op.st.volatile.shared.s32(addr(s_num_samples), 0) comment("Load the CP index in all threads") 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)"): reg.u32('num_cps') @@ -178,7 +178,7 @@ class IterThread(PTXEntryPoint): reg.s32('num_samples num_samples_needed') comment('Sync before making decision to prevent divergence') 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') op.setp.ge.s32(p_cp_done, num_samples, num_samples_needed) 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) for var in args: 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.ld.shared.b32(var, addr(shuf_read)) + op.ld.volatile.shared.b32(var, addr(shuf_read)) class MWCRNG(PTXFragment): shortname = "mwc" diff --git a/cuburn/render.py b/cuburn/render.py index 27cd00d..c25b4a9 100644 --- a/cuburn/render.py +++ b/cuburn/render.py @@ -63,8 +63,8 @@ class _Frame(pyflam3.Frame): sizeof(BaseGenome)) self.ngenomes = len(genomes) - # TODO: do this here? - self.pixel_aspect_ratio = float(genomes[0].height) / genomes[0].width + # TODO: allow user to override this + self.pixel_aspect_ratio = 1.0 def interpolate(self, time, stagger=0, cp=None): cp = cp or BaseGenome() diff --git a/main.py b/main.py index 9c55a00..e908407 100644 --- a/main.py +++ b/main.py @@ -59,7 +59,7 @@ def main(args): print anim.features.hist_width print anim.features.hist_height 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, anim.features.hist_height, 'RGBA',