MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / GetBuildLog

Method GetBuildLog

src/treelearner/gpu_tree_learner.cpp:546–567  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

544}
545
546std::string GPUTreeLearner::GetBuildLog(const std::string &opts) {
547 boost::compute::program program = boost::compute::program::create_with_source(kernel_source_, ctx_);
548 try {
549 program.build(opts);
550 }
551 catch (boost::compute::opencl_error &e) {
552 auto error_code = e.error_code();
553 std::string log("No log available.\n");
554 // for other types of failure, build log might not be available; program.build_log() can crash
555 if (error_code == CL_INVALID_PROGRAM || error_code == CL_BUILD_PROGRAM_FAILURE) {
556 try {
557 log = program.build_log();
558 }
559 catch(...) {
560 // Something bad happened. Just return "No log available."
561 }
562 }
563 return log;
564 }
565 // build is okay, log may contain warnings
566 return program.build_log();
567}
568
569void GPUTreeLearner::BuildGPUKernels() {
570 Log::Info("Compiling OpenCL Kernel with %d bins...", device_bin_size_);

Callers

nothing calls this directly

Calls 3

buildMethod · 0.80
error_codeMethod · 0.80
build_logMethod · 0.45

Tested by

no test coverage detected