From dd6d17433e4832ee8f8942a6e80b22bf382676d5 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Mon, 10 Apr 2023 17:26:01 -0700 Subject: [PATCH] ircd::cl: Stop propagation of platform and device initialization errors. --- ircd/cl.cc | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/ircd/cl.cc b/ircd/cl.cc index d58b77efa..45e3a23cd 100644 --- a/ircd/cl.cc +++ b/ircd/cl.cc @@ -355,6 +355,7 @@ ircd::cl::init::fini_libs() size_t ircd::cl::init::init_platforms() +try { // OpenCL sez platform=null is implementation defined. constexpr auto ignore(CL_INVALID_PLATFORM); @@ -365,9 +366,21 @@ ircd::cl::init::init_platforms() return platforms; } +catch(const std::exception &e) +{ + log::logf + { + log, log::level::DERROR, + "OpenCL platforms initialization :%s", + e.what(), + }; + + return 0; +} size_t ircd::cl::init::init_devices() +try { // Get the devices. size_t devices_total(0); @@ -414,6 +427,16 @@ ircd::cl::init::init_devices() return devices_total; } +catch(const std::exception &e) +{ + log::error + { + log, "OpenCL devices initialization :%s", + e.what(), + }; + + return 0; +} size_t ircd::cl::init::init_ctxs()