Results 1 to 3 of 3

Thread: Issue with clRelease functions

  1. #1
    Junior Member
    Join Date
    Aug 2011

    Issue with clRelease functions


    I have an issue with clRelease functions (clReleaseContext, ...). I developped a C++ library to manage easily OpenCL functions and a test application to control its working.

    This application works fine and all clRelease functions are call with success.

    Then I developped an other library that uses the first lib to use OpenCL and a test application to control its working.

    This application stops when I try to enter in the first clRelease functions namely clReleaseContext.

    The same problem appears with Intel and NVidia OpenCL driver. So this is not a driver problem but a usage problem.

    To summarize:

    OpenCL -> LIB_A -> TEST_APP_A : OK

    OpenCL -> LIB_A -> LIB_B -> TEST_APP_B : not OK

    Is someone could help me to find the problem?

    I have to precise that I use boost shared_ptr in all the library to manage pointers.


  2. #2
    Junior Member
    Join Date
    Aug 2011

    Re: Issue with clRelease functions

    I found a solution but I still don't understand the problem.

    Here is the architecture:

    class A is a singleton and creates the context.
    class B is a singleton and have the member static A* instance.

    If I remove the static member of A* in class B and I give the instantiation of A to other functions calls to clRelease functions work fine.

    So this is the only way to avoid the issue, but I don't understand why I can't have a static instantiation of a singleton in a class.


  3. #3

    Re: Issue with clRelease functions

    On the face of it, I don't know of any reason why you can't use a singleton but I have the following suggestions:
    • Check the error codes returned by every single OpenCL function. You probably do but I'm just being certain.
    • Make sure that the number of calls to clReleaseContext for the context in A matches the number of times that clRetainContext was called plus one for creating the context (implicit retain).

Similar Threads

  1. Built-in Functions: Work-Item Functions
    By sean.settle in forum OpenCL
    Replies: 7
    Last Post: 11-17-2011, 06:39 AM
  2. VG_MOVE_TO_ABS issue
    By pundiramit in forum OpenVG
    Replies: 2
    Last Post: 06-29-2009, 01:39 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
Proudly hosted by Digital Ocean