Results 1 to 6 of 6

Thread: offline compilation ?

  1. #1
    Junior Member
    Join Date
    Jul 2009
    Posts
    3

    offline compilation ?

    Hi everybody,
    I am currently working on a program using OpenCL (I have previously worked a bit with CUDA), and in all examples included in Nvidia SDK, all kernels are compiled online (during execution).
    With CUDA, I work with nvcc and Makefiles for compiling kernels, and I want to know if there is a way to do the same with OpenCL ? Is there already an OpenCL compiler ? How can I compile them offline ?

    Thanks in adavance for your replies.

  2. #2
    Junior Member
    Join Date
    May 2009
    Posts
    11

    Re: offline compilation ?

    you can compile offline by calling the builtin compiler and store the binaries.
    (compilation makes it necessary to specify the graphic card for which you want to create the binaries).

    afaik the spec doesnt give any details about an executable of the compiler without using the opencl implementation.

  3. #3
    Junior Member
    Join Date
    Jul 2009
    Posts
    3

    Re: offline compilation ?

    Thanks for your reply
    But i didn't undestand what you call "builtin compiler", do you mean clBuildProgram function ?
    I haven't see any binary usable for doing that in SDK...

  4. #4
    Junior Member
    Join Date
    May 2009
    Posts
    11

    Re: offline compilation ?

    please have a look at the function clGetProgramInfo with the parameter CL_PROGRAM_BINARIES.

    just use your program as usual, read out the kernel binaries after compilation (clBuildProgram) using the above function and store it to a file.
    next time you start your program you dont have to compile the kernel again. instead you can use the compiled kernel which you previously stored to the file.

    this is what i meant with the builtin compiler cz. the binaries can just be generated with detailed information about your graphic card.

  5. #5
    Junior Member
    Join Date
    Jul 2009
    Posts
    3

    Re: offline compilation ?

    Perfect ! Thanks for your reply, it's exactly what I want

  6. #6
    Junior Member
    Join Date
    Nov 2011
    Posts
    2

    Re: offline compilation ?

    Hi,

    but if I want to invoke directly the OpenCL compiler to compile a kernel code, under CUDA toolkit for example, how can I do?

Similar Threads

  1. OpenCL offline compilation
    By nemesi in forum OpenCL
    Replies: 0
    Last Post: 11-22-2011, 08:45 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
  •