From cd8d53df21f3ad2810add2a8cff766c745f55a17 Mon Sep 17 00:00:00 2001
From: Joseph Redmon <pjreddie@gmail.com>
Date: Fri, 09 May 2014 22:14:52 +0000
Subject: [PATCH] So there WAS this huge bug. Gone now

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

diff --git a/src/opencl.c b/src/opencl.c
index 0d645ba..d06c75f 100644
--- a/src/opencl.c
+++ b/src/opencl.c
@@ -88,4 +88,18 @@
 	return kernel;
 }
 
+void cl_read_array(cl_mem mem, float *x, int n)
+{
+    cl_setup();
+    clEnqueueReadBuffer(cl.queue, mem, CL_TRUE, 0, sizeof(float)*n,x,0,0,0);
+    check_error(cl);
+}
+
+void cl_write_array(cl_mem mem, float *x, int n)
+{
+    cl_setup();
+    clEnqueueWriteBuffer(cl.queue, mem, CL_TRUE, 0,sizeof(float)*n,x,0,0,0);
+    check_error(cl);
+}
+
 #endif

--
Gitblit v1.10.0