Reporting build errors

Reporting build errors

Bild des Benutzers A Z.

  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 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.
Bild des Benutzers Raghu Muthyalampalli (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

Bild des Benutzers A Z.

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);

  }

Melden Sie sich an, um einen Kommentar zu hinterlassen.