From 3c21e711ee109abd42947d068a290c99627f6118 Mon Sep 17 00:00:00 2001 From: Jeffrey Phillips Freeman <jeffrey.freeman@syncleus.com> Date: Mon, 12 Dec 2016 20:23:23 -0500 Subject: [PATCH] Fixed compilation error. --- .../aparapi/internal/kernel/KernelRunner.java | 22 ++----------------- .../aparapi/internal/opencl/OpenCLLoader.java | 8 +++---- 2 files changed, 6 insertions(+), 24 deletions(-) diff --git a/src/main/java/com/aparapi/internal/kernel/KernelRunner.java b/src/main/java/com/aparapi/internal/kernel/KernelRunner.java index d511537a..08458478 100644 --- a/src/main/java/com/aparapi/internal/kernel/KernelRunner.java +++ b/src/main/java/com/aparapi/internal/kernel/KernelRunner.java @@ -1367,28 +1367,10 @@ public class KernelRunner extends KernelRunnerJNI{ // Send the string to OpenCL to compile it, or if the compiled binary is already cached on JNI side just empty string to use cached binary long handle; int buildFlags = kernel.getFlowType().getValue(); - if (BINARY_CACHING_DISABLED) { - handle = buildProgramJNI(jniContextHandle, openCL, "", buildFlags); - } else { - synchronized (seenBinaryKeys) { - String binaryKey = kernel.getClass().getName() + ":" + device.getDeviceId(); - if (seenBinaryKeys.contains(binaryKey)) { - // use cached binary - logger.log(Level.INFO, "reusing cached binary for " + binaryKey); - handle = buildProgramJNI(jniContextHandle, "", binaryKey, buildFlags); - } - else { - // create and cache binary - logger.log(Level.INFO, "compiling new binary for " + binaryKey); - handle = buildProgramJNI(jniContextHandle, openCL, binaryKey, buildFlags); - seenBinaryKeys.add(binaryKey); - } - } - } - _settings.profile.onEvent(ProfilingEvent.OPENCL_COMPILED); - if (handle == 0) { + if (buildProgramJNI(jniContextHandle, openCL,buildFlags) == 0) { return fallBackToNextDevice(_settings, "OpenCL compile failed"); } + _settings.profile.onEvent(ProfilingEvent.OPENCL_COMPILED); args = new KernelArg[entryPoint.getReferencedFields().size()]; int i = 0; diff --git a/src/main/java/com/aparapi/internal/opencl/OpenCLLoader.java b/src/main/java/com/aparapi/internal/opencl/OpenCLLoader.java index 550ac69c..46da8bfa 100644 --- a/src/main/java/com/aparapi/internal/opencl/OpenCLLoader.java +++ b/src/main/java/com/aparapi/internal/opencl/OpenCLLoader.java @@ -1,12 +1,12 @@ /** * Copyright (c) 2016 - 2017 Syncleus, Inc. - * <p> + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * <p> - * http://www.apache.org/licenses/LICENSE-2.0 - * <p> + * + * http://www.apache.org/licenses/LICENSE-2.0 + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- GitLab