From 02d121832d4963911961bfab62832a055855c60a Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner <inform@tiker.net> Date: Tue, 14 May 2013 11:02:09 -0400 Subject: [PATCH] Kernel.__init__: Deal with being passed bare _Programs. --- pyopencl/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyopencl/__init__.py b/pyopencl/__init__.py index 633b59c4..522e7e32 100644 --- a/pyopencl/__init__.py +++ b/pyopencl/__init__.py @@ -66,7 +66,10 @@ def compiler_output(text): class Kernel(_cl._Kernel): def __init__(self, prg, name): - _cl._Kernel.__init__(self, prg._get_prg(), name) + if not isinstance(prg, _cl._Program): + prg = prg._get_prg() + + _cl._Kernel.__init__(self, prg, name) # }}} -- GitLab