From f18517d538955026d9a62b918b4185adc5cc2ed6 Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Sat, 19 Nov 2011 20:00:39 -0500
Subject: [PATCH] Add a meaningless int to source code to defeat implementation
 caches.

---
 pyopencl/cache.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/pyopencl/cache.py b/pyopencl/cache.py
index f0d03cf7..1388e325 100644
--- a/pyopencl/cache.py
+++ b/pyopencl/cache.py
@@ -371,6 +371,11 @@ def _create_built_program_from_source_cached(ctx, src, options, devices, cache_d
     already_built = False
 
     if to_be_built_indices:
+        # defeat implementation caches:
+        from uuid import uuid4
+        src = src + "\n\n__constant int pyopencl_defeat_cache_%s = 0;" % (
+                uuid4().hex)
+
         prg = _cl._Program(ctx, src)
         prg.build(options, [devices[i] for i in to_be_built_indices])
 
-- 
GitLab