Results 1 to 2 of 2

Thread: Checking wether a command queue is valid...

  1. #1
    Junior Member
    Join Date
    May 2012

    Checking wether a command queue is valid...


    I would like to check if a given comand queue is valid. (I have a lot of host code, some functions taking a command queue as a parameter, and I had a bug where I gave an unitialised command queue, so I would like to avoid such a bug in the future).
    Anyway, I have tried a simple:

    Code :
    bool queueValid(const cl_command_queue& queue)
        size_t size;
        cl_int err = clGetCommandQueueInfo(queue, CL_QUEUE_DEVICE, 0, NULL, &size);
        return (err == CL_SUCCESS);

    But it turns out that calling clGetCommandQueueInfo on an unitialised queue segfault. (AMD APP SDK 2.7)

    I have seen a previous post about "Check whether cl_mem object is valid":
    but it does not seem to apply to queues.

    Any pointer ? (no pun intended!)
    Thanks a lot in advance.


  2. #2
    Senior Member
    Join Date
    Aug 2011

    Re: Checking wether a command queue is valid...

    Just write more robust code ...?

    They're just pointers, so treat them like any other pointer. i.e. init to 0, use !0 checks, and/or fail earlier if they aren't created in the first place.

Similar Threads

  1. Command Queue
    By chanakya.sun in forum OpenCL
    Replies: 3
    Last Post: 11-09-2011, 04:39 PM
  2. When is a command queue actually executed?
    By sanderbeckers in forum OpenCL
    Replies: 6
    Last Post: 03-03-2011, 05:28 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
Proudly hosted by Digital Ocean