AnsweredAssumed Answered

Using clEnqueueMapBuffer to terminate computation?

Question asked by smatovic on Jul 8, 2012
Latest reply on Jul 8, 2012 by smatovic

Heyho,

 

i try to use an Buffer Object (CL_MEM_USE_HOST_PTR) to terminate an while loop on the OpenCL Device after n seconds,

but the return Buffers are all empty when i set the value of the pointer....what am i missing?

 

 

while(1) {
    time(&end_time);
    elapsed = (int) (end_time - start_time);
    if (elapsed >= 6 )
        break;
}

 

GLOBAL_FINISHED = 1;

 

clEnqueueMapBuffer( commandQueue,
                    GLOBAL_FINISHED_Buffer,
                    CL_TRUE,
                    CL_MAP_WRITE,
                    0,
                    sizeof(cl_int),
                    0,
                    NULL,
                    NULL,
                    &status);

 

if(status != CL_SUCCESS)

    {

   print_debug((char *)"Error: Waiting for kernel run to finish. (clEnqueueMapBuffer)\n");
   return 1;

    }

 

--

Srdja

Outcomes