cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

smatovic
Adept II

Using clEnqueueMapBuffer to terminate computation?

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

0 Likes
1 Solution
smatovic
Adept II

ah, i simply placed

status = clFlush(commandQueue);

at the wrong place...

--

Srdja

View solution in original post

0 Likes
1 Reply
smatovic
Adept II

ah, i simply placed

status = clFlush(commandQueue);

at the wrong place...

--

Srdja

0 Likes