Results 1 to 2 of 2

Thread: Compilation of the Kernel is always at runtime?

  1. #1

    Compilation of the Kernel is always at runtime?

    Hi,
    In my application, in a certain problem the time of kernel compilation is eighty percent of the time of all execution.
    And, some references say that compilation of kernel is always in runtime of application. So, every time that i execute my application, the kernel is compiled.
    There some ways that i compile my kernel a only time?

    Thanks,

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

    Re: Compilation of the Kernel is always at runtime?

    Yes, there is a very simple way. After building your program with clBuildProgram() you can retrieve the prebuilt program binary with clGetProgramInfo(..., CL_PROGRAM_BINARIES, ...)

    Next time your program runs, you can use that precompiled binary and load it with clCreateProgramWithBinary() instead of using clCreateProgramWithSource(). It should be quite a bit faster than recompiling from source.
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

Similar Threads

  1. Kernel pre-compilation
    By vincentfpgarcia in forum OpenCL
    Replies: 2
    Last Post: 01-11-2012, 01:28 AM
  2. Kernel compilation problem....
    By Craig in forum OpenCL
    Replies: 16
    Last Post: 11-06-2010, 03:05 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
  •