Results 1 to 10 of 10

Thread: Linking

  1. #1
    Junior Member
    Join Date
    Mar 2011
    Posts
    10

    Linking

    There doesn't appear to be any way to link cl files together (useful for making code modularly).

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

    Re: Linking

    Correct. There is no way to link. clBuildProgram() both compiles and links.
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

  3. #3
    Junior Member
    Join Date
    Mar 2011
    Posts
    10

    Re: Linking

    Is there any chance this will be included in future specifications?

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

    Re: Linking

    The committee has a policy of not discussing what new features will be added to each new revision.

    That said, the committee is well aware of this particular topic you have raised
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

  5. #5
    Junior Member
    Join Date
    Sep 2011
    Posts
    8

    Re: Linking

    I agree,

    For us it is a CRITICAL feature, I explain....

    Our OpenCL application use a "shading language" like HSL, GLSL, Cg, ... and so, the OpenCL code is generated at run-time.

    The complete kernel request 12 minutes to compile today for the GPU.

    99% of the code is in the library, this part of the code never change and must be recompiled each time ! 1% of the code is dynamic and so the application recompile everything !!!!

    We can't release an application like this !!! It is really a critical problem for our company ! It is really a problem that can kill our company business !

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

    Re: Linking

    Would it be possible to move some of that 99% of the code into a separate program and using precompiled binaries?
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

  7. #7
    Junior Member
    Join Date
    Sep 2011
    Posts
    8

    Re: Linking

    I think it is not possible David,

    Imagine the following example :

    Code :
     
    float random() { .... }
    float projection() { .... }
     
    ....
     
    __kernel void emptyKernel() {}

    The I can create a precompiled binary with clCreateProgramWithBinary.

    Later, I generate the following code

    Code :
     
    __kernel void runtimeKernel_01()
    {
    ...
       float r = random();
    ...
    }

    But random is in the first program !!! The second kernel will not compile because it does not know the 'random' function. It is why we need something to link the second kernel with the first one.

    Do you agree ?

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

    Re: Linking

    If the 1% of the code that changes dynamically calls directly or indirectly all the other 99% of the code, then yes, you will need some form of linking. It may still be possible to either reduce the amount of code that needs to be compiled, cache some frequently-used variations of the code, etc.
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

  9. #9
    Junior Member
    Join Date
    Sep 2011
    Posts
    8

    Re: Linking

    Thanks,

    I have no idea to reduce the 99% of the code !!! each function is useful and different and will be used in most situations !

  10. #10
    Junior Member
    Join Date
    Sep 2011
    Posts
    8

    Re: Linking

    I think that this kind of feature will be welcomed in OpenCL 1.2 ?!

    In my case the kernel request 12 minutes to compile for the GPU !! and the dynamic part of the code is minimal. What will happend when I will have a lot of dynamic code !

    I have today an unusable software !!! My customers cannot wait 10 minutes each time it start a rendering and change a settings !

    OpenCL has to evolve urgently... at least for business.

    What can I do ?

    Thanks

Similar Threads

  1. Linking dynamically with libGLES_CM
    By tyua in forum OpenGL ES 1.X - fixed function hardware
    Replies: 3
    Last Post: 06-22-2010, 11:46 PM
  2. OpenGL ES Linking Errors
    By jensr in forum OpenGL ES general technical discussions
    Replies: 5
    Last Post: 10-31-2007, 05:31 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
  •