From b4db42365917e4ed140b54b0998e180f3c52ff54 Mon Sep 17 00:00:00 2001
From: Ryan LaMothe <ryan.lamothe@quantumworx.com>
Date: Thu, 29 Nov 2012 01:43:17 +0000
Subject: [PATCH] Fixed bug introduced with patch for Issue 80

---
 .../src/java/com/amd/aparapi/KernelRunner.java     | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/com.amd.aparapi/src/java/com/amd/aparapi/KernelRunner.java b/com.amd.aparapi/src/java/com/amd/aparapi/KernelRunner.java
index 93fd87a5..8091cf52 100644
--- a/com.amd.aparapi/src/java/com/amd/aparapi/KernelRunner.java
+++ b/com.amd.aparapi/src/java/com/amd/aparapi/KernelRunner.java
@@ -1591,19 +1591,21 @@ class KernelRunner{
    
                   try {
                      executeOpenCL(_entrypointName, _range, _passes);
-                  } catch (AparapiException e) {
+                  } catch (final AparapiException e) {
                      warnFallBackAndExecute(_entrypointName, _range, _passes, e);
                   }
                } else {
                   warnFallBackAndExecute(_entrypointName, _range, _passes, "failed to locate entrypoint");
                }
+            } else {
+               try {
+                  executeOpenCL(_entrypointName, _range, _passes);
+               } catch (final AparapiException e) {
+                  warnFallBackAndExecute(_entrypointName, _range, _passes, e);
+               }
             }
          } else {
-            try {
-               executeOpenCL(_entrypointName, _range, _passes);
-            } catch (AparapiException e) {
-               warnFallBackAndExecute(_entrypointName, _range, _passes, e);
-            }
+              warnFallBackAndExecute(_entrypointName, _range, _passes, "OpenCL was requested but Device supplied was not an OpenCLDevice");
          }
       } else {
          executeJava(_range, _passes);
-- 
GitLab