Commit ab848057dacb903da1a66f40ae2e0833102a26a7

Philip Kaufmann 2012-02-09T14:08:55

changed base-nonce generation for non GOFFSET paths to use get_local_size(0) and left shift

diff --git a/diakgcn120208.cl b/diakgcn120208.cl
index 512e1db..03d6aa9 100644
--- a/diakgcn120208.cl
+++ b/diakgcn120208.cl
@@ -66,25 +66,25 @@ __kernel
 	#ifdef GOFFSET
 		u nonce = ((uint)get_global_id(0) << 3) + (u)(0, 1, 2, 3, 4, 5, 6, 7);
 	#else
-		u nonce = ((uint)get_group_id(0) * (uint)WORKSIZE * 8U) + ((uint)get_local_id(0) * 8U) + base;
+		u nonce = ((uint)get_group_id(0) * (uint)get_local_size(0) << 3) + ((uint)get_local_id(0) << 3) + base;
 	#endif
 #elif defined VECTORS4
 	#ifdef GOFFSET
 		u nonce = ((uint)get_global_id(0) << 2) + (u)(0, 1, 2, 3);
 	#else
-		u nonce = ((uint)get_group_id(0) * (uint)WORKSIZE * 4U) + ((uint)get_local_id(0) * 4U) + base;
+		u nonce = ((uint)get_group_id(0) * (uint)get_local_size(0) << 2) + ((uint)get_local_id(0) << 2) + base;
 	#endif
 #elif defined VECTORS2
 	#ifdef GOFFSET
 		u nonce = ((uint)get_global_id(0) << 1) + (u)(0, 1);
 	#else
-		u nonce = ((uint)get_group_id(0) * (uint)get_local_size(0) * 2U) + ((uint)get_local_id(0) * 2U) + base;
+		u nonce = ((uint)get_group_id(0) * (uint)get_local_size(0) << 1) + ((uint)get_local_id(0) << 1) + base;
 	#endif
 #else
 	#ifdef GOFFSET
 		u nonce = (uint)get_global_id(0);
 	#else
-		u nonce = ((uint)get_group_id(0) * (uint)WORKSIZE) + (uint)get_local_id(0) + base;
+		u nonce = ((uint)get_group_id(0) * (uint)get_local_size(0)) + (uint)get_local_id(0) + base;
 	#endif
 #endif