Results 1 to 4 of 4

Thread: OpenCL slow compiling of multiple kernel code

  1. #1

    OpenCL slow compiling of multiple kernel code

    Hi
    I have many kernels in my OpenCL file and I am using the NVIDIA OpenCL implementation to compile the code, and it takes a full 40 seconds to do so. Having just 1 kernel in the file takes 0.42 seconds to compile.

    I have isolated the slow compile to a single kernel, which now takes 37.xx seconds approximately. Is there a way to speed up the compiling of the OpenCL code itself ?

    Any suggestions will be appreciated.

    Thanks.

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

    Re: OpenCL slow compiling of multiple kernel code

    It is recommended to build your kernels just once when the application is installed on the user's computer and after that rely on prebuilt program binaries.

    See clGetProgramInfo(..., CL_PROGRAM_BINARIES, ...) to obtain the program binaries during installation and clCreateProgramWithBinaries() to load those binaries every time the application is executed.

    Calling clBuildProgram() with programs that have been loaded with clCreateProgramWithBinaries() tends to be a lot faster than with programs created with clCreateProgramWithSource().
    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
    Senior Member
    Join Date
    Aug 2011
    Posts
    271

    Re: OpenCL slow compiling of multiple kernel code

    I remember some particularly slow (and unexpected) compiles which seemed to be bugs or issues in the compiler.

    From memory it had to do with unrolled loops and register allocation, and fiddling with the source eventually got it building faster, but I can't remember the specifics.

  4. #4

    Re: OpenCL slow compiling of multiple kernel code

    Thanks

Similar Threads

  1. OpenCL slow compiling on AMD card
    By Gopal_HC in forum OpenCL
    Replies: 4
    Last Post: 01-02-2013, 04:31 AM
  2. compiling and runing OpenCL code
    By college_guy in forum OpenCL
    Replies: 4
    Last Post: 04-07-2011, 05:07 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
  •