OpenCL compilation process and obtaining intermediate files

Hi everyone,

(I made a similar post on this in the Nvidia forums but didn’t get any replies thus far, so I figured I’d try here. The reason I posted there is my machine has an Nvidia GPU, so I have the Nvidia OpenCL version.)

At a high-level, what I’m looking for boils down to: how do I find more details on how the OpenCL compilation process works? My belief is that the equivalent of the CUDA “-keep” or “-cuda” options will lead me to this, but I haven’t been able to find one thus far.

What I’m trying to figure out is how to “keep” the intermediate files that are created when an OpenCL file is compiled. In CUDA, this can be done using the “-keep” option. Is there a similar option in OpenCL? If so, what is it? So far, the only compiler options I’ve been able to find for OpenCL are the ones that you would pass to clBuildProgram().

Thanks for any pointers you may have.

Thanks,
Matt

It seems like the Portland Group has created such a flag with their “-dryrun” flag. However, this flag is not recognized on my machine when I try to use it … is there an equivalent that can be used when not using the Portland Group’s version?

Thanks,
Matt

[QUOTE=msinclair;29377]Hi everyone,

(I made a similar post on this in the Nvidia forums but didn’t get any replies thus far, so I figured I’d try here. The reason I posted there is my machine has an Nvidia GPU, so I have the Nvidia OpenCL version.)

At a high-level, what I’m looking for boils down to: how do I find more details on how the OpenCL compilation process works? My belief is that the equivalent of the CUDA “-keep” or “-cuda” options will lead me to this, but I haven’t been able to find one thus far.

What I’m trying to figure out is how to “keep” the intermediate files that are created when an OpenCL file is compiled. In CUDA, this can be done using the “-keep” option. Is there a similar option in OpenCL? If so, what is it? So far, the only compiler options I’ve been able to find for OpenCL are the ones that you would pass to clBuildProgram().

Thanks for any pointers you may have.

Thanks,
Matt[/QUOTE

not really shure if that answers your question but to get the binaries from your compiled opencl kernels have a look at section 5.6 in the spec. It says that you can get your binaries from the compiler with clGetProgramInfo and CL_PROGRAM_BINARIES. But keep in mind that this wont work on nvidia