Rename build info function to be consistent with rest of the API. (#7553)
This commit is contained in:
parent
e94b766310
commit
52277cc3da
@ -49,7 +49,7 @@ XGB_DLL void XGBoostVersion(int* major, int* minor, int* patch);
|
|||||||
*
|
*
|
||||||
* \return 0 for success, -1 for failure
|
* \return 0 for success, -1 for failure
|
||||||
*/
|
*/
|
||||||
XGB_DLL int XGBBuildInfo(char const **out);
|
XGB_DLL int XGBuildInfo(char const **out);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief get string message of the last error
|
* \brief get string message of the last error
|
||||||
|
|||||||
@ -202,7 +202,7 @@ def build_info() -> dict:
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
j_info = ctypes.c_char_p()
|
j_info = ctypes.c_char_p()
|
||||||
_check_call(_LIB.XGBBuildInfo(ctypes.byref(j_info)))
|
_check_call(_LIB.XGBuildInfo(ctypes.byref(j_info)))
|
||||||
assert j_info.value is not None
|
assert j_info.value is not None
|
||||||
res = json.loads(j_info.value.decode()) # pylint: disable=no-member
|
res = json.loads(j_info.value.decode()) # pylint: disable=no-member
|
||||||
return res
|
return res
|
||||||
|
|||||||
@ -55,7 +55,7 @@ void XGBBuildInfoDevice(Json *p_info) {
|
|||||||
} // namespace xgboost
|
} // namespace xgboost
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
XGB_DLL int XGBBuildInfo(char const **out) {
|
XGB_DLL int XGBuildInfo(char const **out) {
|
||||||
API_BEGIN();
|
API_BEGIN();
|
||||||
CHECK(out) << "Invalid input pointer";
|
CHECK(out) << "Invalid input pointer";
|
||||||
Json info{Object{}};
|
Json info{Object{}};
|
||||||
|
|||||||
@ -283,7 +283,7 @@ TEST(CAPI, XGBGlobalConfig) {
|
|||||||
|
|
||||||
TEST(CAPI, BuildInfo) {
|
TEST(CAPI, BuildInfo) {
|
||||||
char const* out;
|
char const* out;
|
||||||
XGBBuildInfo(&out);
|
XGBuildInfo(&out);
|
||||||
auto loaded = Json::Load(StringView{out});
|
auto loaded = Json::Load(StringView{out});
|
||||||
ASSERT_TRUE(get<Object const>(loaded).find("USE_OPENMP") != get<Object const>(loaded).cend());
|
ASSERT_TRUE(get<Object const>(loaded).find("USE_OPENMP") != get<Object const>(loaded).cend());
|
||||||
ASSERT_TRUE(get<Object const>(loaded).find("USE_CUDA") != get<Object const>(loaded).cend());
|
ASSERT_TRUE(get<Object const>(loaded).find("USE_CUDA") != get<Object const>(loaded).cend());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user