Results 1 to 3 of 3

Thread: Issue with clRelease functions

  1. #1
    Junior Member
    Join Date
    Aug 2011
    Posts
    14

    Issue with clRelease functions

    Hi,

    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.

    Thanks.

  2. #2
    Junior Member
    Join Date
    Aug 2011
    Posts
    14

    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.

    Thanks.

  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 Suggestions for next release
    Replies: 7
    Last Post: 11-17-2011, 07:39 AM
  2. Billboard issue
    By VinceGL in forum Developers Coding:Beginner
    Replies: 1
    Last Post: 08-03-2011, 03:17 AM
  3. VG_MOVE_TO_ABS issue
    By pundiramit in forum OpenVG and VGU
    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
  •