ADded spdlog log level capabilites to change verbousity

This commit is contained in:
Alejandro Saucedo
2020-11-03 21:40:49 +00:00
parent 9b6f5b0424
commit fb95694944

View File

@@ -7,6 +7,20 @@ namespace py = pybind11;
PYBIND11_MODULE(kp, m) {
#if KOMPUTE_ENABLE_SPDLOG
spdlog::set_level(
static_cast<spdlog::level::level_enum>(SPDLOG_ACTIVE_LEVEL));
#endif
m.def("log_level", [](uint8_t logLevel) {
#if KOMPUTE_ENABLE_SPDLOG
spdlog::set_level(
static_cast<spdlog::level::level_enum>(SPDLOG_LEVEL_INFO));
#else
SPDLOG_WARN("SPDLOG not enabled so log level config function not supported");
#endif
});
py::enum_<kp::Tensor::TensorTypes>(m, "TensorTypes", "Enum with GPU memory types for Tensor.")
.value("device", kp::Tensor::TensorTypes::eDevice, "Tensor holding data in GPU memory.")
.value("staging", kp::Tensor::TensorTypes::eStaging, "Tensor used for transfer of data to device.")