From 7b35885d5df6ac323c863e2fb74a99ceb1b843d8 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Mon, 19 Dec 2016 16:31:39 +0100 Subject: [PATCH 1/2] Force CallInstruction instances declare their non-atomicity --- loopy/kernel/instruction.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/loopy/kernel/instruction.py b/loopy/kernel/instruction.py index 90be2f409..4477f5baf 100644 --- a/loopy/kernel/instruction.py +++ b/loopy/kernel/instruction.py @@ -994,6 +994,13 @@ class CallInstruction(MultiAssignmentBase): else: key_builder.rec(key_hash, getattr(self, field_name)) + @property + def atomicity(self): + # Function calls can impossibly be atomic, and even the result assignment + # is troublesome, especially in the case of multiple results. Avoid the + # issue altogether by disallowing atomicity. + return () + # }}} -- GitLab From 2cafbbd1cb1e42747c6679f3a53a40f71b099dda Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Mon, 19 Dec 2016 16:32:02 +0100 Subject: [PATCH 2/2] Fix incorrect error message in vectorization codegen --- loopy/codegen/instruction.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loopy/codegen/instruction.py b/loopy/codegen/instruction.py index c490abb6e..6224d9709 100644 --- a/loopy/codegen/instruction.py +++ b/loopy/codegen/instruction.py @@ -221,7 +221,7 @@ def generate_call_code(codegen_state, insn): if codegen_state.vectorization_info: if insn.atomicity: - raise Unvectorizable("function call") + raise Unvectorizable("atomic operation") # }}} -- GitLab