From 2f34370891eff5328f0b7787d5830857fa5566d3 Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Mon, 30 Nov 2015 01:27:36 -0600
Subject: [PATCH] Fix lhs/rhs reversal typo, allow vectorizing 'vector =
 scalar'

---
 loopy/codegen/instruction.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/loopy/codegen/instruction.py b/loopy/codegen/instruction.py
index 75d71e4cb..c20727660 100644
--- a/loopy/codegen/instruction.py
+++ b/loopy/codegen/instruction.py
@@ -96,12 +96,12 @@ def generate_expr_instruction_code(kernel, insn, codegen_state):
         vinfo = codegen_state.vectorization_info
         vcheck = VectorizabilityChecker(
                 kernel, vinfo.iname, vinfo.length)
-        rhs_is_vector = vcheck(insn.assignee)
-        lhs_is_vector = vcheck(insn.expression)
+        lhs_is_vector = vcheck(insn.assignee)
+        rhs_is_vector = vcheck(insn.expression)
 
-        if lhs_is_vector != rhs_is_vector:
+        if not lhs_is_vector and rhs_is_vector:
             raise Unvectorizable(
-                    "LHS and RHS disagree on whether they are vectors")
+                    "LHS is scalar, RHS is vector, cannot assign")
 
         is_vector = lhs_is_vector
 
-- 
GitLab