AnsweredAssumed Answered

Little fraction of allocated buffer correct initialized?

Question asked by cguenther on Oct 19, 2012
Latest reply on Jan 6, 2013 by heman

Hi there.


I heard of the situation that the OpenCL Buffers can only be allocated in appropriate chunks:


I am using the Cpp Bindings from the Khronos Group with the compiler option "DCL_USE_DEPRECATED_OPENCL_1_1_APIS" to achieve correct linking. The Buffer is allocated as follows:


cl::Buffer tempBuffer(m_context,CL_MEM_READ_ONLY|CL_MEM_COPY_HOST_PTR,size,VBOpos,&errret);

This Buffer contains 3D positions of points as 3 integers per point and is about 120mb. (10 mio points) This command returns cl_success. Can i assume that this behaviour indicates that the buffer is small enough to have not the problem of the 2 links above?


My Kernel reads the data as follows:



void testKernel(__global int* VBOpos)


gid = get_global_id(0);

__private int4 WorldSpacePointPosInt;

WorldSpacePointPosInt = vload4(0,&(VBOpos[3*gid]));



The values of the about first 8mio Points are correct. But after that I get only nonsense. It seems that the allocation is done correctly, but the informations are not settet correctly. I tried it also bevorhand with an shared GL VBO. The GL rendering of the VBO is correct. But when i read it with CL from the shared GL VBO also there are only about 8mio correct points and the rest is dirt.


My Nvidia Notebook does not has this problem.


I would like to chunk the date into several buffers, but I do not know which exact size of the buffer is definitively correct initialized.



AMD 7970, Win7 X64, Ubuntu X64 12.04, catalyst 12.8, AMD APP SDK 2.7


Sorry for my bad english and please reply, this would help me a lot.