diff options
author | Téo Mazars <teomazars@gmail.com> | 2013-11-15 21:21:19 +0100 |
---|---|---|
committer | Téo Mazars <teomazars@gmail.com> | 2013-11-15 21:21:36 +0100 |
commit | e01b309a51ab3d3eec8e93ccf5487f890c46dab8 (patch) | |
tree | ff8a49f4b94ef3594ab498da43f080ed1df5a1ea /opencl | |
parent | 46f5f16f692a171a67f2e3dc6c57f1e851488bba (diff) |
random: remove global constants definitions in random.cl
Diffstat (limited to 'opencl')
-rw-r--r-- | opencl/random.cl | 9 | ||||
-rw-r--r-- | opencl/random.cl.h | 9 |
2 files changed, 8 insertions, 10 deletions
diff --git a/opencl/random.cl b/opencl/random.cl index b900b379..26cc1c32 100644 --- a/opencl/random.cl +++ b/opencl/random.cl @@ -17,11 +17,6 @@ */ /* XXX: this file should be kept in sync with gegl-random. */ -__constant const long XPRIME = 103423; -__constant const long YPRIME = 101359; -__constant const long NPRIME = 101111; - -#define RANDOM_DATA_SIZE (15101 * 3) typedef ushort4 GeglRandom; @@ -72,6 +67,10 @@ _gegl_cl_random_int (__global const int *cl_random_data, int z, int n) { + const long XPRIME = 103423; + const long YPRIME = 101359; + const long NPRIME = 101111; + unsigned long idx = x * XPRIME + y * YPRIME * XPRIME + n * NPRIME * YPRIME * XPRIME; diff --git a/opencl/random.cl.h b/opencl/random.cl.h index d48e087e..9261d71b 100644 --- a/opencl/random.cl.h +++ b/opencl/random.cl.h @@ -18,11 +18,6 @@ static const char* random_cl_source = " */ \n" " \n" "/* XXX: this file should be kept in sync with gegl-random. */ \n" -"__constant const long XPRIME = 103423; \n" -"__constant const long YPRIME = 101359; \n" -"__constant const long NPRIME = 101111; \n" -" \n" -"#define RANDOM_DATA_SIZE (15101 * 3) \n" " \n" "typedef ushort4 GeglRandom; \n" " \n" @@ -73,6 +68,10 @@ static const char* random_cl_source = " int z, \n" " int n) \n" "{ \n" +" const long XPRIME = 103423; \n" +" const long YPRIME = 101359; \n" +" const long NPRIME = 101111; \n" +" \n" " unsigned long idx = x * XPRIME + \n" " y * YPRIME * XPRIME + \n" " n * NPRIME * YPRIME * XPRIME; \n" |