From 70d622ea54c55aa5489e71b769a92447a586c879 Mon Sep 17 00:00:00 2001
From: Joseph Redmon <pjreddie@gmail.com>
Date: Mon, 14 Jul 2014 05:07:51 +0000
Subject: [PATCH] Added batch to col2im, padding option

---
 src/opencl.c |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/src/opencl.c b/src/opencl.c
index d06c75f..d78537b 100644
--- a/src/opencl.c
+++ b/src/opencl.c
@@ -32,7 +32,8 @@
     if(num_devices > MAX_DEVICES) num_devices = MAX_DEVICES;
     int index = getpid()%num_devices;
     printf("%d rand, %d devices, %d index\n", getpid(), num_devices, index);
-    info.device = devices[index];
+    //info.device = devices[index];
+    info.device = devices[1];
     fprintf(stderr, "Found %d device(s)\n", num_devices);
     check_error(info);
 
@@ -102,4 +103,21 @@
     check_error(cl);
 }
 
+void cl_copy_array(cl_mem src, cl_mem dst, int n)
+{
+    cl_setup();
+    clEnqueueCopyBuffer(cl.queue, src, dst, 0, 0, sizeof(float)*n,0,0,0);
+    check_error(cl);
+}
+
+cl_mem cl_make_array(float *x, int n)
+{
+    cl_setup();
+    cl_mem mem = clCreateBuffer(cl.context,
+            CL_MEM_READ_WRITE|CL_MEM_COPY_HOST_PTR,
+            sizeof(float)*n, x, &cl.error);
+    check_error(cl);
+    return mem;
+}
+
 #endif

--
Gitblit v1.10.0