softmax on gpu

This commit is contained in:
Joseph Redmon
2014-10-21 14:49:18 -07:00
parent 9b3c7136f3
commit 158bb1bee9
17 changed files with 440 additions and 97 deletions

View File

@@ -7,6 +7,8 @@
#include <CL/cl.h>
#endif
#define NUM_QUEUES 8
typedef struct {
int initialized;
cl_int error;
@@ -14,16 +16,19 @@ typedef struct {
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