Browse Source

Build debug in Common + exit if error

master
Daniel Gyulai 3 years ago
parent
commit
351197c53c
  1. 14
      Common/OpenCLHandler.cpp

14
Common/OpenCLHandler.cpp

@ -69,7 +69,19 @@ OpenCLHandler::OpenCLHandler(std::string kernelcode)
//std::string programSource = FileToString("../kernels/programs.cl");
std::string programSource = FileToString(kernelcode);
program = cl::Program(context, programSource);
program.build(devices);
err = program.build(devices);
if (!CheckCLError(err))
{
for (size_t devID = 0; devID < devices.size(); ++devID)
{
std::cout << "Device: " << devID << std::endl;
std::cout << "Build Status: " << program.getBuildInfo<CL_PROGRAM_BUILD_STATUS>(devices[devID]) << std::endl;
std::cout << "Build Options:\t" << program.getBuildInfo<CL_PROGRAM_BUILD_OPTIONS>(devices[devID]) << std::endl;
std::cout << "Build Log:\t " << program.getBuildInfo<CL_PROGRAM_BUILD_LOG>(devices[devID]) << std::endl;
std::cout << "--------------------------------------------------" << std::endl;
}
exit(-1);
}
}
bool OpenCLHandler::run_test(TestCase* test)

Loading…
Cancel
Save