void LogOpenCLError(cl_int err, const char* message) { if (err != CL_SUCCESS) { std::ostringstream errorMessage; errorMessage << "OpenCL Error " << err << ": " << errorCodeToString(err) << " " << getCLErrorResolveHint(err) << std::endl << message; LogErrorCustom("OpenCL", errorMessage.str()); } }
void bindTexture(const Volume& volume, const TextureUnit& texUnit) { if (auto volumeGL = volume.getRepresentation<VolumeGL>()) { volumeGL->bindTexture(texUnit.getEnum()); } else { LogErrorCustom("TextureUtils", "Could not get a GL representation from volume"); } }
void OpenCL::printBuildError(const std::vector<cl::Device>& devices, const cl::Program& program, const std::string& filename) { for (::size_t i = 0; i < devices.size(); ++i) { cl_build_status status = program.getBuildInfo<CL_PROGRAM_BUILD_STATUS>(devices[i]); // Houston, we have a problem if (status == CL_BUILD_ERROR) { std::string buildLog = program.getBuildInfo<CL_PROGRAM_BUILD_LOG>(devices[i]); LogErrorCustom("OpenCL", filename << " build error:" << std::endl << buildLog); } } }