clray

diff src/ocl.cc @ 28:97cfd9675310

trying to pass the kdtree to the kernel
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 21 Aug 2010 03:42:49 +0100
parents 29f9330cfa4b
children 4cf4919c3812
line diff
     1.1 --- a/src/ocl.cc	Tue Aug 17 20:35:00 2010 +0100
     1.2 +++ b/src/ocl.cc	Sat Aug 21 03:42:49 2010 +0100
     1.3 @@ -74,7 +74,7 @@
     1.4  }
     1.5  
     1.6  
     1.7 -CLMemBuffer *create_mem_buffer(int rdwr, size_t sz, void *buf)
     1.8 +CLMemBuffer *create_mem_buffer(int rdwr, size_t sz, const void *buf)
     1.9  {
    1.10  	int err;
    1.11  	cl_mem mem;
    1.12 @@ -85,7 +85,7 @@
    1.13  	}
    1.14  
    1.15  
    1.16 -	if(!(mem = clCreateBuffer(ctx, flags, sz, buf, &err))) {
    1.17 +	if(!(mem = clCreateBuffer(ctx, flags, sz, (void*)buf, &err))) {
    1.18  		fprintf(stderr, "failed to create memory buffer: %s\n", clstrerror(err));
    1.19  		return 0;
    1.20  	}
    1.21 @@ -131,7 +131,7 @@
    1.22  	mbuf->ptr = 0;
    1.23  }
    1.24  
    1.25 -bool write_mem_buffer(CLMemBuffer *mbuf, size_t sz, void *src)
    1.26 +bool write_mem_buffer(CLMemBuffer *mbuf, size_t sz, const void *src)
    1.27  {
    1.28  	if(!mbuf) return false;
    1.29  
    1.30 @@ -243,7 +243,7 @@
    1.31  	return true;
    1.32  }
    1.33  
    1.34 -bool CLProgram::set_arg_buffer(int idx, int rdwr, size_t sz, void *ptr)
    1.35 +bool CLProgram::set_arg_buffer(int idx, int rdwr, size_t sz, const void *ptr)
    1.36  {
    1.37  	printf("create argument %d buffer: %d bytes\n", idx, (int)sz);
    1.38  	CLMemBuffer *buf;