From 6ac83ea3bd8af2da09588c5c7f5a2a83fe91f7a8 Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Sun, 4 Sep 2011 14:31:29 -0400
Subject: [PATCH] Fix mode flag in image_from_array. (reported by Oren
 Freifeld)

---
 pyopencl/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pyopencl/__init__.py b/pyopencl/__init__.py
index baeea6b4..024a6656 100644
--- a/pyopencl/__init__.py
+++ b/pyopencl/__init__.py
@@ -715,7 +715,7 @@ def image_from_array(ctx, ary, num_channels, mode="r", norm_int=False):
 
     if mode == "r":
         mode_flags = mem_flags.READ_ONLY
-    elif mode == "r":
+    elif mode == "w":
         mode_flags = mem_flags.WRITE_ONLY
     else:
         raise ValueError("invalid value '%s' for 'mode'" % mode)
-- 
GitLab