[gegl] random: remove global constants definitions in random.cl
- From: Téo Mazars <teom src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] random: remove global constants definitions in random.cl
- Date: Fri, 15 Nov 2013 20:21:53 +0000 (UTC)
commit e01b309a51ab3d3eec8e93ccf5487f890c46dab8
Author: Téo Mazars <teomazars gmail com>
Date: Fri Nov 15 21:21:19 2013 +0100
random: remove global constants definitions in random.cl
opencl/random.cl | 9 ++++-----
opencl/random.cl.h | 9 ++++-----
2 files changed, 8 insertions(+), 10 deletions(-)
---
diff --git a/opencl/random.cl b/opencl/random.cl
index b900b37..26cc1c3 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 d48e087..9261d71 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"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]