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
|
||||
*/
|
||||
XGB_DLL int XGBBuildInfo(char const **out);
|
||||
XGB_DLL int XGBuildInfo(char const **out);
|
||||
|
||||
/*!
|
||||
* \brief get string message of the last error
|
||||
|
||||
@ -202,7 +202,7 @@ def build_info() -> dict:
|
||||
|
||||
"""
|
||||
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
|
||||
res = json.loads(j_info.value.decode()) # pylint: disable=no-member
|
||||
return res
|
||||
|
||||
@ -55,7 +55,7 @@ void XGBBuildInfoDevice(Json *p_info) {
|
||||
} // namespace xgboost
|
||||
#endif
|
||||
|
||||
XGB_DLL int XGBBuildInfo(char const **out) {
|
||||
XGB_DLL int XGBuildInfo(char const **out) {
|
||||
API_BEGIN();
|
||||
CHECK(out) << "Invalid input pointer";
|
||||
Json info{Object{}};
|
||||
|
||||
@ -283,7 +283,7 @@ TEST(CAPI, XGBGlobalConfig) {
|
||||
|
||||
TEST(CAPI, BuildInfo) {
|
||||
char const* out;
|
||||
XGBBuildInfo(&out);
|
||||
XGBuildInfo(&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_CUDA") != get<Object const>(loaded).cend());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user