From c60e00497d85787ec92e695bf0a532a789cbc763 Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Sat, 11 Jan 2014 22:37:53 -0600
Subject: [PATCH] Improve get_fast_inaccurate_build_options()

---
 pyopencl/characterize/__init__.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/pyopencl/characterize/__init__.py b/pyopencl/characterize/__init__.py
index 8fd33a86..0a6aed65 100644
--- a/pyopencl/characterize/__init__.py
+++ b/pyopencl/characterize/__init__.py
@@ -261,8 +261,11 @@ def get_fast_inaccurate_build_options(dev):
     """Return a list of flags valid on device *dev* that enable fast, but
     potentially inaccurate floating point math.
     """
-    return ["-cl-mad-enable", "-cl-fast-relaxed-math",
-        "-cl-no-signed-zeros", "-cl-strict-aliasing"]
+    result = ["-cl-mad-enable", "-cl-fast-relaxed-math",
+        "-cl-no-signed-zeros", ]
+    if dev.vendor.startswith("Advanced Micro") or dev.vendor.startswith("NVIDIA"):
+        result.append("-cl-strict-aliasing")
+    return result
 
 
 def get_simd_group_size(dev, type_size):
-- 
GitLab