Results 1 to 3 of 3

Thread: Error Propagation in OpenCL Specification

  1. #1
    Junior Member
    Join Date
    Aug 2009
    Posts
    3

    Error Propagation in OpenCL Specification

    I'm new to OpenCL and have been reading the specs and examples supplied by NVIDIA's OpenCL implementation. Is it just me or is error detail propagation a tad iffy? Some functions such as clCreateCommandQueue or clCreateBuffer return objects and require a pointer to an error code variable, whereas others such as clRetainCommandQueue or clGetPlatformInfo return an error state.

    While I agree that both styles are perfectly valid and acceptable, would it not be more consistent to pick one and stick with it? Is there a particular reason the two styles were mixed that I'm not aware of? If this is an unintended oversight, now is probably the best time to fix the spec (while the standard is still young and implementations are few or incomplete). I have no preference of one style over the other, however I would appreciate more consistency.

    Thanks,
    Geoff

  2. #2
    Senior Member
    Join Date
    Sep 2002
    Location
    Santa Clara
    Posts
    105

    Re: Error Propagation in OpenCL Specification

    The style the working group chose was to return the most important information as the return type. All functions that create an object (memory, command-queue etc.) return the object. Typically you check if the object value returned is NULL or not and then look at error code (or ignore it if you don't need to).

    Functions that operate on objects return an error.

    Hope this helps clarify your question.

  3. #3
    Junior Member
    Join Date
    Aug 2009
    Posts
    3

    Re: Error Propagation in OpenCL Specification

    Indeed, that's good enough for me.

    Thanks very much affie.

Similar Threads

  1. Specification error
    By IRWolfie- in forum Suggestions for next release
    Replies: 2
    Last Post: 03-16-2011, 11:15 AM
  2. Replies: 4
    Last Post: 07-21-2009, 01:26 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
  •