Reporting build errors

Reporting build errors

  Is there a way to report compile errors for the kernels? cl::Program::build() simply returns CL_BUILD_PROGRAM_FAILURE which doesn't give any indication where the errors are.

3 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.

You can get the build log by calling cl::Program::getInfo and passing the CL_PROGRAM_BUILD_LOG param. Have you tried that? Or you can use the KernelBuilder to verify if your kernel has any errors, if you are using the Intel OpenCL SDK.

Thanks,
Raghu

cl::Program::getBuildInfo was what I was looking for. Thanks!


  result = program.build(devices,NULL,NULL,NULL);

  std::string buildLog =

    program.getBuildInfo<CL_PROGRAM_BUILD_LOG>(devices[0]);

  if(result != CL_SUCCESS)

  {

    printf("### Kernel compile log ###n%sn",buildLog.c_str());

    exit(result);

  }

Connectez-vous pour laisser un commentaire.