diff --git a/pyopencl/__init__.py b/pyopencl/__init__.py
index 0d912e41947b45e6963f4a39527104a959f625a8..06ff1e84e136f47019276eea1a4b063dc69dabce 100644
--- a/pyopencl/__init__.py
+++ b/pyopencl/__init__.py
@@ -439,7 +439,7 @@ class Program(object):
             build_descr = "uncached source build (cache disabled by user)"
             self._prg = _cl._Program(self._context, self._source)
 
-        if plat_has_cache:
+        elif plat_has_cache and self._prg is None:
             build_descr = "platform-cached source build"
             self._prg = _cl._Program(self._context, self._source)