diff --git a/pyopencl/cache.py b/pyopencl/cache.py index 3992c71a4bc687ee433d079694320549b12d9dc6..a84413d1f9593262474389068896ed134467d174 100644 --- a/pyopencl/cache.py +++ b/pyopencl/cache.py @@ -156,7 +156,7 @@ def get_dependencies(src, include_path): _inner(src) - result = list(result.iteritems()) + result = list((name,) + vals for name, vals in result.iteritems()) result.sort() return result @@ -294,7 +294,7 @@ def _create_built_program_from_source_cached(ctx, src, options, devices, cache_d from tempfile import gettempdir import getpass cache_dir = join(gettempdir(), - "pyopencl-compiler-cache-v1-uid%s-py%s" % ( + "pyopencl-compiler-cache-v2-uid%s-py%s" % ( getpass.getuser(), ".".join(str(i) for i in sys.version_info))) # {{{ ensure cache directory exists diff --git a/test/test_wrapper.py b/test/test_wrapper.py index bce224f73f43aabadc512c6a4a35e6c92eb1e1ad..80c774576db3ae18e298521e73e448fd5c6ec866 100644 --- a/test/test_wrapper.py +++ b/test/test_wrapper.py @@ -339,6 +339,17 @@ class TestCL: assert (dest == x).all() + @pytools.test.mark_test.opencl + def test_header_dep_handling(self, ctx_getter): + context = ctx_getter() + queue = cl.CommandQueue(context) + + kernel_src = """ + #include <empty-header.h> + kernel void zonk() {} + """ + cl.Program(context, kernel_src).build('-I.') + cl.Program(context, kernel_src).build('-I.')