Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
e1572794
"python-package/vscode:/vscode.git/clone" did not exist on "702fff227d8960e532dd9ad4abd8e4456084345a"
Unverified
Commit
e1572794
authored
Sep 22, 2021
by
James Lamb
Committed by
GitHub
Sep 22, 2021
Browse files
move Network method implementations from network.h to network.cpp (fixes #4464) (#4496)
parent
b52ecb16
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
include/LightGBM/network.h
include/LightGBM/network.h
+2
-10
src/network/network.cpp
src/network/network.cpp
+8
-0
No files found.
include/LightGBM/network.h
View file @
e1572794
...
@@ -100,9 +100,9 @@ class Network {
...
@@ -100,9 +100,9 @@ class Network {
/*! \brief Free this static class */
/*! \brief Free this static class */
static
void
Dispose
();
static
void
Dispose
();
/*! \brief Get rank of this machine */
/*! \brief Get rank of this machine */
static
inline
int
rank
();
static
int
rank
();
/*! \brief Get total number of machines */
/*! \brief Get total number of machines */
static
inline
int
num_machines
();
static
int
num_machines
();
/*!
/*!
* \brief Perform all_reduce. if data size is small,
* \brief Perform all_reduce. if data size is small,
...
@@ -312,14 +312,6 @@ class Network {
...
@@ -312,14 +312,6 @@ class Network {
static
THREAD_LOCAL
AllgatherFunction
allgather_ext_fun_
;
static
THREAD_LOCAL
AllgatherFunction
allgather_ext_fun_
;
};
};
inline
int
Network
::
rank
()
{
return
rank_
;
}
inline
int
Network
::
num_machines
()
{
return
num_machines_
;
}
}
// namespace LightGBM
}
// namespace LightGBM
#endif // LightGBM_NETWORK_H_
#endif // LightGBM_NETWORK_H_
src/network/network.cpp
View file @
e1572794
...
@@ -317,4 +317,12 @@ void Network::ReduceScatterRing(char* input, comm_size_t, int type_size,
...
@@ -317,4 +317,12 @@ void Network::ReduceScatterRing(char* input, comm_size_t, int type_size,
std
::
memcpy
(
output
,
input
+
block_start
[
rank_
],
block_len
[
rank_
]);
std
::
memcpy
(
output
,
input
+
block_start
[
rank_
],
block_len
[
rank_
]);
}
}
int
Network
::
rank
()
{
return
rank_
;
}
int
Network
::
num_machines
()
{
return
num_machines_
;
}
}
// namespace LightGBM
}
// namespace LightGBM
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment