From 99cd3ff7ea7f88059dbb4f14b5410d3b8e434be1 Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Fri, 28 Oct 2011 21:44:13 -0400
Subject: [PATCH] Update ranluxcl, use legacy init as recommended by Ivar.

---
 pyopencl/clrandom.py        | 2 +-
 src/cl/pyopencl-ranluxcl.cl | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/pyopencl/clrandom.py b/pyopencl/clrandom.py
index 916d34a9..d0c2a2a0 100644
--- a/pyopencl/clrandom.py
+++ b/pyopencl/clrandom.py
@@ -11,7 +11,7 @@ import numpy as np
 class RanluxGenerator(object):
     def __init__(self, queue, num_work_items,
             luxury=None, seed=None, no_warmup=False,
-            use_legacy_init=False, max_work_items=None):
+            use_legacy_init=True, max_work_items=None):
         if luxury is None:
             luxury = 4
 
diff --git a/src/cl/pyopencl-ranluxcl.cl b/src/cl/pyopencl-ranluxcl.cl
index 1a1a0e53..71606a15 100644
--- a/src/cl/pyopencl-ranluxcl.cl
+++ b/src/cl/pyopencl-ranluxcl.cl
@@ -551,11 +551,11 @@ void ranluxcl_initialization(uint ins, global ranluxcl_state_t *ranluxcltab)
 	//allows us to use ins = 0.
 	int k, maxWorkitems;
 
-	#ifdef RANLUXCL_USE_LEGACY_INITIALIZATION
-	maxWorkitems = RANLUXCL_USE_LEGACY_INITIALIZATION;
+	#ifdef RANLUXCL_MAXWORKITEMS
+	maxWorkitems = RANLUXCL_MAXWORKITEMS;
 	#else
 	maxWorkitems = RANLUXCL_NUMWORKITEMS;
-	#endif //RANLUXCL_USE_LEGACY_INITIALIZATION
+	#endif //RANLUXCL_MAXWORKITEMS
 
 	int scaledins = ins * maxWorkitems + 1;
 
-- 
GitLab