Results 1 to 9 of 9

Thread: Invalid Operation using clBuildProgram

  1. #1
    Junior Member
    Join Date
    Apr 2011
    Posts
    20

    Invalid Operation using clBuildProgram

    Hi,

    I came across an issue when compiling OpenCL programs. I'm working on a compiler that supports moving operations to OpenCL. I implemented a method that first calls clCreateProgramWithSource and then, given that the errcode_ret was CL_SUCCESS, calls clBuildProgram immediately after, passing null for pfn_notify.

    For certain operations, the second call results in CL_INVALID_OPERATION. According to the spec, this is due to one of the following reasons:
    1. if the build of a program executable for any of the devices listed in device_list by a previous call to clBuildProgram for program has not completed.[/*:m:1y7oevow]
    2. if there are kernel objects attached to program.[/*:m:1y7oevow]


    I don't see how any of the two conditions might be satisfied. There cannot be any uncompleted calls to clBuildProgram for program, because program was just created from the source before. By the same reasoning, there can also not be any kernels attached to program.

    What could I be missing here?

  2. #2
    Junior Member
    Join Date
    Apr 2011
    Posts
    20

    Re: Invalid Operation using clBuildProgram

    I have found the source of the problem. It seems ATI does not accept the read_write modifier for buffer objects.

    And then it outputs CL_INVALID_OPERATION. So if you get this error, double check whether you're using an ATI card and read_write for a buffer object.

    There is only one thing that is worse than not returning an error: returning the wrong one.

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

    Re: Invalid Operation using clBuildProgram

    It seems ATI does not accept the read_write modifier for buffer objects.
    Correction: the standard does not allow the read_only qualifier for buffer objects.
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

  4. #4
    Junior Member
    Join Date
    Apr 2011
    Posts
    20

    Re: Invalid Operation using clBuildProgram

    I have used read_only successfully many times. It is read_write that makes the compilation for an ATI card fail and output the wrong error.

    Where would that be detailed in the spec?

  5. #5
    Member
    Join Date
    Jul 2011
    Location
    Moscow, Russia
    Posts
    41

    Re: Invalid Operation using clBuildProgram

    Quote Originally Posted by Banjobeni
    I have used read_only successfully many times. It is read_write that makes the compilation for an ATI card fail and output the wrong error.

    Where would that be detailed in the spec?
    Check the The OpenCL Specification document, section "6.6 Access qualifiers". read_only, write_only and read_write don't apply to buffers, they apply to images only. The fact that you used read_only qualifier for buffers and ATI compiler processed it just means that their compiler allowed you to step aside from standard.
    Blog (in russian)

  6. #6
    Junior Member
    Join Date
    Apr 2011
    Posts
    20

    Re: Invalid Operation using clBuildProgram

    Thanks for correcting that.

    Could you maybe try to be more specific when you write stuff like this:
    Quote Originally Posted by david.garcia
    Correction: the standard does not allow the read_only qualifier for buffer objects.
    In the end, it is correct, but suggests that other modifiers are valid. And now they are not.

  7. #7
    Member
    Join Date
    Jul 2011
    Location
    Moscow, Russia
    Posts
    41

    Re: Invalid Operation using clBuildProgram

    Quote Originally Posted by Banjobeni
    Thanks for correcting that.

    Could you maybe try to be more specific when you write stuff like this:
    Quote Originally Posted by david.garcia
    Correction: the standard does not allow the read_only qualifier for buffer objects.
    In the end, it is correct, but suggests that other modifiers are valid. And now they are not.
    Banjobeni, you cited david.garcia's words, not mine.
    Blog (in russian)

  8. #8
    Junior Member
    Join Date
    Apr 2011
    Posts
    20

    Re: Invalid Operation using clBuildProgram

    Oh, sorry, my bad. It seems I got used to the fact that only David Garcia answers my questions

    Sorry again, I did not mean to be rude in any way.

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

    Re: Invalid Operation using clBuildProgram

    Could you maybe try to be more specific when you write stuff like this
    Sure. It takes time to find the exact section and it seemed to me like most people didn't care about the details and simply took my word for it, so sometimes I don't bother.
    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. In-band copy operation
    By demarcus in forum OpenML Coding & Technical Issues
    Replies: 2
    Last Post: 04-21-2004, 10:37 AM

Posting Permissions

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