[arrayfire] 285/408: Moving the kernel cache map to a centralized location

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Mon Sep 21 19:12:15 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch debian/sid
in repository arrayfire.

commit 365afb4290d6d7763dcb58cc36b8411e04b733c7
Author: Pavan Yalamanchili <pavan at arrayfire.com>
Date:   Wed Aug 19 02:48:50 2015 -0400

    Moving the kernel cache map to a centralized location
---
 src/backend/opencl/cache.hpp | 25 +++++++++++++++++++++++++
 src/backend/opencl/jit.cpp   |  8 +-------
 2 files changed, 26 insertions(+), 7 deletions(-)

diff --git a/src/backend/opencl/cache.hpp b/src/backend/opencl/cache.hpp
new file mode 100644
index 0000000..76e4f9d
--- /dev/null
+++ b/src/backend/opencl/cache.hpp
@@ -0,0 +1,25 @@
+/*******************************************************
+ * Copyright (c) 2015, ArrayFire
+ * All rights reserved.
+ *
+ * This file is distributed under 3-clause BSD license.
+ * The complete license agreement can be obtained at:
+ * http://arrayfire.com/licenses/BSD-3-Clause
+ ********************************************************/
+
+#pragma once
+#include <program.hpp>
+
+namespace opencl
+{
+    using cl::Kernel;
+    using cl::Program;
+
+    typedef struct {
+        Program* prog;
+        Kernel* ker;
+    } kc_entry_t;
+
+    typedef std::map<string, kc_entry_t> kc_t;
+    static kc_t kernelCaches[DeviceManager::MAX_DEVICES];
+}
diff --git a/src/backend/opencl/jit.cpp b/src/backend/opencl/jit.cpp
index 088d3a3..66c7c1e 100644
--- a/src/backend/opencl/jit.cpp
+++ b/src/backend/opencl/jit.cpp
@@ -15,6 +15,7 @@
 #include <JIT/Node.hpp>
 #include <kernel_headers/jit.hpp>
 #include <program.hpp>
+#include <cache.hpp>
 #include <dispatch.hpp>
 #include <err_opencl.hpp>
 #include <functional>
@@ -141,13 +142,6 @@ static Kernel getKernel(Node *node, bool is_linear)
     bool is_dbl = false;
     string funcName = getFuncName(node, is_linear, &is_dbl);
 
-    typedef struct {
-        Program* prog;
-        Kernel* ker;
-    } kc_entry_t;
-
-    typedef std::map<string, kc_entry_t> kc_t;
-    static kc_t kernelCaches[DeviceManager::MAX_DEVICES];
     int device = getActiveDeviceId();
 
     kc_t::iterator idx = kernelCaches[device].find(funcName);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/arrayfire.git



More information about the debian-science-commits mailing list