From b168a2431e43b9e1ea134cd85a7d835a4b71e9e9 Mon Sep 17 00:00:00 2001 From: Steven Robertson Date: Thu, 13 Oct 2011 16:56:20 -0400 Subject: [PATCH] 32-bit compatibility (I think?) --- cuburn/code/mwc.py | 7 +++---- cuburn/render.py | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cuburn/code/mwc.py b/cuburn/code/mwc.py index d5ec00e..2117328 100644 --- a/cuburn/code/mwc.py +++ b/cuburn/code/mwc.py @@ -60,10 +60,9 @@ __device__ float mwc_next_11(mwc_st &st) { rand.shuffle(mults) seeds[0][:] = mults[:nthreads] - # Intentionally excludes both 0 and (2^32-1), as they can lead to - # degenerate sequences of period 0 - seeds[1] = rand.randint(1, 0xffffffff, size=nthreads) - seeds[2] = rand.randint(1, 0xffffffff, size=nthreads) + # Excludes 0xffffffff for 32-bit compatibility with laziness + seeds[1] = rand.randint(1, 0x7fffffff, size=nthreads) + seeds[2] = rand.randint(1, 0x7fffffff, size=nthreads) return seeds diff --git a/cuburn/render.py b/cuburn/render.py index ee1147a..887b7f8 100644 --- a/cuburn/render.py +++ b/cuburn/render.py @@ -364,7 +364,7 @@ class _AnimRenderer(object): cuda.memcpy_htod_async(d_info_off, h_infos, stream) # TODO: get block config from IterCode - iter_fun(d_seeds, np.uint64(d_info_off), self.d_accum, + iter_fun(d_seeds, np.uintp(d_info_off), self.d_accum, block=(32, 16, 1), grid=(len(block_times), 1), texrefs=[tref], stream=stream)