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
OpenDAS
dlib
Commits
ee0576de
Commit
ee0576de
authored
Feb 10, 2017
by
Davis King
Browse files
Fixed incorrect comment.
parent
45d047de
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
dlib/dnn/trainer.h
dlib/dnn/trainer.h
+4
-3
No files found.
dlib/dnn/trainer.h
View file @
ee0576de
...
@@ -649,9 +649,10 @@ namespace dlib
...
@@ -649,9 +649,10 @@ namespace dlib
// We make separate thread pools with just one thread in them because we want
// We make separate thread pools with just one thread in them because we want
// to make sure each device is always executed on the same thread. We care
// to make sure each device is always executed on the same thread. We care
// about this because there are thread_local context variables for some cuda
// about this because there are thread_local context variables for some cuda
// components and they get regenerated when the current cuda device changes.
// components and they get allocated for each combination of thread and device.
// Recreating them over and over is somewhat expensive so we want to avoid
// So if we make sure the same device always uses the same thread this will
// that.
// reduce the number of contexts we allocate from num_devices*num_devices to
// just num_devices.
std
::
vector
<
std
::
shared_ptr
<
thread_pool
>>
tp
;
std
::
vector
<
std
::
shared_ptr
<
thread_pool
>>
tp
;
for
(
size_t
i
=
0
;
i
<
devices
.
size
();
++
i
)
for
(
size_t
i
=
0
;
i
<
devices
.
size
();
++
i
)
tp
.
push_back
(
std
::
make_shared
<
thread_pool
>
(
1
));
tp
.
push_back
(
std
::
make_shared
<
thread_pool
>
(
1
));
...
...
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