A simple question about cl::Program::getBuildInfo

Above is the method explanation of getBuildInfo, anyone knows how to call it? I’ve try in many ways but no success. I also refer to examples such as
std::string buildlog = program.getBuildInfo<CL_PROGRAM_BUILD_LOG>(dev);

But my question is why in this way as the explanation of the method is using () instead of <>?

Besides, if the build success is successful will any log be shown, or will the log only be shown when the build is not success?

Hello!

I have an example that calls this function here.

In short, the example described above is correct: CL_PROGRAM_BUILD_LOG is the template parameter and is specified in <>, and dev is the device to query that is passed using ().

The contents of the build log are implementation-defined when the build succeeds. Some implementations include a generic “success” message, other implementations include information about the build such as whether the kernel was vectorized or not, and other implementations include nothing at all.

Thanks and good luck!