diff options
author | Anthony LaTorre <tlatorre9@gmail.com> | 2011-06-18 20:26:51 -0400 |
---|---|---|
committer | Anthony LaTorre <tlatorre9@gmail.com> | 2011-06-18 20:26:51 -0400 |
commit | ec4a86bbe3e59cb97348218f05852fda236b0592 (patch) | |
tree | 5bbe88c92576271af95e2515795fa67740294110 | |
parent | c51c2e8d9c9d841af567d8bb57217db3340efb60 (diff) | |
download | chroma-ec4a86bbe3e59cb97348218f05852fda236b0592.tar.gz chroma-ec4a86bbe3e59cb97348218f05852fda236b0592.tar.bz2 chroma-ec4a86bbe3e59cb97348218f05852fda236b0592.zip |
change curandstate array length to 100,000. gputhread.run() now correctly initializes ALL of the states.
-rw-r--r-- | gputhread.py | 2 | ||||
-rw-r--r-- | src/kernel.cu | 2 | ||||
-rw-r--r-- | threadtest.py | 3 |
3 files changed, 4 insertions, 3 deletions
diff --git a/gputhread.py b/gputhread.py index 0ee0155..6271607 100644 --- a/gputhread.py +++ b/gputhread.py @@ -78,7 +78,7 @@ class GPUThread(threading.Thread): init_rng = module.get_function('init_rng') texrefs = self.geometry.load(module) - init_rng(np.int32(1000000), np.int32(0), np.int32(0), block=(self.nblocks,1,1), grid=(1000000//self.nblocks,1)) + init_rng(np.int32(100000), np.int32(0), np.int32(0), block=(self.nblocks,1,1), grid=(100000//self.nblocks+1,1)) while not self.stopped(): try: diff --git a/src/kernel.cu b/src/kernel.cu index a2d2d71..b7dadfa 100644 --- a/src/kernel.cu +++ b/src/kernel.cu @@ -138,7 +138,7 @@ __device__ int intersect_mesh(const float3 &origin, const float3& direction, con return triangle_index; } -__device__ curandState rng_states[1000000]; +__device__ curandState rng_states[100000]; extern "C" { diff --git a/threadtest.py b/threadtest.py index 0111bc7..21d1b1e 100644 --- a/threadtest.py +++ b/threadtest.py @@ -43,9 +43,10 @@ def generate_event(position=(0,0,0), nphotons=10000): if len(hit_times) > 0: event_times.append((i, np.min(hit_times))) + print len(event_times) print event_times - return np.array(event_times) + return np.array(event_times, dtype=int) def likelihood(event_times, position=(0,0,0), nphotons=10000, neval=100): for i in range(neval): |