Results 1 to 4 of 4

Thread: Command Queue

  1. #1
    Junior Member
    Join Date
    Jun 2011
    Posts
    10

    Command Queue

    Hi All,

    I have a scenario like shown in the following code
    The arguments of the kernel vary with the iterator

    Code :
    for(Iterator = 0; Iterator < 20 ; Iterator++)
    {
        clSetKernelArg();//argument 1
        clSetKernelArg();//argument 2
        clEnqueueNDRangeKernel( CommandQueue ,kernel, 2 , NULL, &GlobalSize......)
        clfinish(CommandQueue );
    }

    I tried changing the code above code to increase the performance at cpu level

    Code :
    for(Iterator = 0; Iterator < 20 ; Iterator++)
    {
        clSetKernelArg();//argument 1
        clSetKernelArg();//argument 2
        clEnqueueNDRangeKernel( CommandQueue ,kernel, 2 , NULL, &GlobalSize......)
     
    }
     clfinish(CommandQueue );

    But my buffers are not updated properly. What might be the reason?
    Please help me...

    Thanks & Regards

  2. #2
    Senior Member
    Join Date
    May 2010
    Location
    Toronto, Canada
    Posts
    845

    Re: Command Queue

    Did you create your command queue with out-of-order execution? Otherwise the problem is unlikely to be in the code you have showed us.

    Also, how do you know your buffers are not updated properly? How do you read their content?
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

  3. #3
    Junior Member
    Join Date
    Jun 2011
    Posts
    10

    Re: Command Queue

    Dear David,
    Quote Originally Posted by david.garcia
    Did you create your command queue with out-of-order execution? Otherwise the problem is unlikely to be in the code you have showed us.
    I created the Commandqueue using "clCreateCommandQueue", the order of execution is default.
    Argument 2 is same memory object for all iterations, does that effect the execution.



    Quote Originally Posted by david.garcia
    Also, how do you know your buffers are not updated properly? How do you read their content?
    I am reading back the buffers (memory objects) using clEnqueueReadBuffer once the for loop ends as shown below

    Code :
    for(Iterator = 0; Iterator < 20 ; Iterator++)
    {
        clSetKernelArg();//argument 1
        clSetKernelArg();//argument 2 is same memory object for all iterations
        clEnqueueNDRangeKernel( CommandQueue ,kernel, 2 , NULL, &GlobalSize......)
     
    }
    clfinish(CommandQueue );
    for(Iterator = 0; Iterator < 20 ; Iterator++)
    {
        clEnqueueReadBuffer();// memory object depends on iterator
        clFinish(CommandQueue);
        /* FILE WRITING */
    }

    Thanks & Regards

  4. #4
    Senior Member
    Join Date
    May 2010
    Location
    Toronto, Canada
    Posts
    845

    Re: Command Queue

    None of those calls to clFinish() seem necessary.

    The problem may be caused to the arguments passed to clEnqueueNDRangeKernel() or to the arguments passed to clEnqueueReadBuffer().

    Can you write a small program that reproduces this problem and that you can share with us in complete form?
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

Similar Threads

  1. When is a command queue actually executed?
    By sanderbeckers in forum OpenCL
    Replies: 6
    Last Post: 03-03-2011, 06:28 PM
  2. Problem with Command queue
    By Gregorien in forum OpenCL
    Replies: 0
    Last Post: 03-25-2010, 02:55 AM
  3. Command Queue going invalid
    By PaulS in forum OpenCL
    Replies: 8
    Last Post: 09-30-2009, 07:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •