Last active
August 29, 2015 14:16
-
-
Save wence-/8eda6d2cad07de302a98 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/firedrake/parloops.py b/firedrake/parloops.py | |
| index 037f0cc..b198056 100644 | |
| --- a/firedrake/parloops.py | |
| +++ b/firedrake/parloops.py | |
| @@ -89,7 +89,7 @@ def _form_kernel(kernel, measure, args, **kwargs): | |
| "par_loop_kernel", **kwargs) | |
| -def par_loop(kernel, measure, args, **kwargs): | |
| +def par_loop(kernel, measure, args, return_callable=False, **kwargs): | |
| """A :func:`par_loop` is a user-defined operation which reads and | |
| writes :class:`.Function`\s by looping over the mesh cells or facets | |
| and accessing the degrees of freedom on adjacent entities. | |
| @@ -238,4 +238,7 @@ def par_loop(kernel, measure, args, **kwargs): | |
| return f.dat(intent, _map['nodes'](f)) | |
| op2args += [mkarg(func, intent) for (func, intent) in args.itervalues()] | |
| - return pyop2.par_loop(*op2args) | |
| + if return_callable: | |
| + return lambda: pyop2.par_loop(op2args) | |
| + else: | |
| + return pyop2.par_loop(*op2args) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment