MCPcopy Create free account
hub / github.com/dmlc/xgboost / XGDMatrixGetInfoRef

Function XGDMatrixGetInfoRef

src/c_api/c_api.cc:845–860  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

843}
844
845XGB_DLL int XGDMatrixGetInfoRef(DMatrixHandle handle, char const *field, char const **out_array) {
846 API_BEGIN();
847 CHECK_HANDLE();
848 xgboost_CHECK_C_ARG_PTR(field);
849 xgboost_CHECK_C_ARG_PTR(out_array);
850
851 auto p_fmat = CastDMatrixHandle(handle);
852 MetaInfo const &info = p_fmat->Info();
853 auto aif = info.GetInfo(p_fmat->Ctx(), StringView{field});
854
855 auto &res = p_fmat->GetThreadLocal().ret_str;
856 res = aif.ArrayInterfaceStr();
857 *out_array = res.c_str();
858
859 API_END();
860}
861
862namespace {
863template <typename T>

Callers

nothing calls this directly

Calls 6

CastDMatrixHandleFunction · 0.85
GetInfoMethod · 0.80
ArrayInterfaceStrMethod · 0.80
c_strMethod · 0.80
InfoMethod · 0.45
CtxMethod · 0.45

Tested by

no test coverage detected