From 20dbc516a1eba43d1207593a29b9abb280acf403 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Sun, 11 Nov 2012 14:46:27 -0600 Subject: [PATCH] Remove cqa compatibility shim in clrandom. --- pyopencl/clrandom.py | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/pyopencl/clrandom.py b/pyopencl/clrandom.py index cc503e99..5e879e36 100644 --- a/pyopencl/clrandom.py +++ b/pyopencl/clrandom.py @@ -275,26 +275,12 @@ def fill_rand(result, queue=None, luxury=4, a=0, b=1): -def rand(*args, **kwargs): - def inner_rand(queue, shape, dtype, luxury=None, a=0, b=1): - from pyopencl.array import Array - luxury = kwargs.pop("luxury", None) - - gen = _get_generator(queue, luxury) - result = Array(queue, shape, dtype) - gen.fill_uniform(result, a=a, b=b) - return result - - if isinstance(args[0], cl.Context): - from warnings import warn - warn("Passing a context as first argument is deprecated. " - "This will be continue to be accepted througout " - "versions 2011.x of PyOpenCL.", - DeprecationWarning, 2) - args = args[1:] - - return inner_rand(*args, **kwargs) - +def rand(queue, shape, dtype, luxury=None, a=0, b=1): + from pyopencl.array import Array + gen = _get_generator(queue, luxury) + result = Array(queue, shape, dtype) + gen.fill_uniform(result, a=a, b=b) + return result -- GitLab