Getting intermediate files when compiling in OpenCL (ala -keep option in CUDA)

Hi everyone,

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

I know that in OpenCL we use clBuildProgram() and clCreateProgramWithSource, WithBinary, etc. to build the program, but I haven’t been able to find any details on how these steps themselves work. Do they create any intermediate files? If so, is there a compiler option we can pass in to keep these files around? In CUDA, we can look at these intermediate files using the “-keep” option, and it seems like there should be an equivalent option in OpenCL. However, since it’s doing the compilation JIT, maybe such an option isn’t possible?

I know that I can get the PTX version by using clGetProgramInfo() with CL_PROGRAM_BINARIES + CL_PROGRAM_BINARY_SIZES and printing that to a file, but I would like to be able to see the other equivalent files (e.g. the .cu.cpp equivalent, etc.).

Thanks for any pointers you may have.

Thanks,
Matt

Pinging about this again. Any input would be greatly appreciated.

One thing I realized since my first post is that the “-keep” option serves 2 purposes. It enables you to look at the PTX that is generated (which one can replicate in OpenCL with the clGetProgramInfo() function, as I mentioned above) AND it allows you to look at all the intermediate files that are generated for the host code. The second part is the part that I’m unsure how to obtain in OpenCL.

Thanks,
Matt

The Portland Group seems to have added a feature like the one I’m looking for with their “-dryrun” option (http://www.pgroup.com/products/pgcl/pgcl_ug/ch05.html). However, this flag is not recognized on my machine when I try to use it … is there an equivalent that can be used when using the Nvidia version of OpenCL?

Thanks,
Matt