From af4e4f92dc9e5da160eb6c6870a7b38b863f1c6c Mon Sep 17 00:00:00 2001
From: Joseph Redmon <pjreddie@gmail.com>
Date: Tue, 28 Oct 2014 02:45:06 +0000
Subject: [PATCH] getting rid of sub_arrays, nvidia driver memory leak
---
src/opencl.h | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/src/opencl.h b/src/opencl.h
index 59efbae..aedc056 100644
--- a/src/opencl.h
+++ b/src/opencl.h
@@ -1,9 +1,14 @@
+#ifdef GPU
+#ifndef OPENCL_H
+#define OPENCL_H
#ifdef __APPLE__
#include <OpenCL/opencl.h>
#else
#include <CL/cl.h>
#endif
+#define NUM_QUEUES 8
+
typedef struct {
int initialized;
cl_int error;
@@ -11,11 +16,20 @@
cl_device_id device;
cl_context context;
cl_command_queue queue;
+ cl_command_queue queues[NUM_QUEUES];
}cl_info;
extern cl_info cl;
void cl_setup();
+void wait_for_queues();
void check_error(cl_info info);
cl_kernel get_kernel(char *filename, char *kernelname, char *options);
-
+void cl_read_array(cl_mem mem, float *x, int n);
+void cl_write_array(cl_mem mem, float *x, int n);
+cl_mem cl_make_array(float *x, int n);
+cl_mem cl_make_int_array(int *x, int n);
+void cl_copy_array(cl_mem src, cl_mem dst, int n);
+cl_mem cl_sub_array(cl_mem src, int offset, int size);
+#endif
+#endif
--
Gitblit v1.10.0