Hi,
I have a strange behaviour with time of computing with function clReleaseMemObject
First example
Code :
float *pfTest = (float *)calloc(50 * 500000, sizeof(float));
cl_mem *clTest = clCreateBuffer(Context, CL_MEM_READ_WRITE | CL_MEM_COPY_HOST_PTR, sizeof(cl_float) * 500000 * 50, pfTest, NULL)
clReleaseMemObject(clTest);
In this case time of clReleaseMemObject is 0.01s
Second Example
Code :
float *pfTest = (float *)calloc(50 * 500000, sizeof(float));
cl_mem *clTest = clCreateBuffer(Context, CL_MEM_READ_WRITE | CL_MEM_COPY_HOST_PTR, sizeof(cl_float) * 500000 * 50, pfTest, NULL)
cl_mem *clTest2 = clCreateBuffer(Context, CL_MEM_READ_WRITE | CL_MEM_COPY_HOST_PTR, sizeof(cl_float) * 500000 * 50, pfTest, NULL)
Here i Run a Kernel with parameter clTest and clTest2 (for example clTest[iID] = clTest2[iId])
clReleaseMemObject(clTest);
In the second case time of clReleaseMemObject is 0.2s
Why the fact to add operation Kernel on clTest made that the time of clReleaseMemObject is bigger ????
Thx
J