From 0ec053539253ad93b840e208b6a7d740734a2f71 Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Thu, 8 Jul 2010 20:21:34 -0400
Subject: [PATCH] Only use 'go-faster' options in matrix multiply example on
 Nvidia.

---
 examples/matrix-multiply.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/examples/matrix-multiply.py b/examples/matrix-multiply.py
index 142591f1..c8fab12e 100644
--- a/examples/matrix-multiply.py
+++ b/examples/matrix-multiply.py
@@ -161,8 +161,12 @@ h_c = numpy.empty((c_height, c_width)).astype(numpy.float32)
 kernel_params = {"block_size": block_size,
         "w_a":a_width, "h_a":a_height, "w_b":b_width}
 
+if "NVIDIA" in queue.device.vendor:
+    options = "-cl-mad-enable -cl-fast-relaxed-math"
+else:
+    options = None
 prg = cl.Program(ctx, KERNEL_CODE % kernel_params,
-        ).build(options="-cl-mad-enable -cl-fast-relaxed-math")
+        ).build(options=options)
 kernel = prg.matrixMul
 #print prg.binaries[0]
 
-- 
GitLab