Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
ee0576de
Commit
ee0576de
authored
Feb 11, 2017
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed incorrect comment.
parent
45d047de
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
trainer.h
dlib/dnn/trainer.h
+4
-3
No files found.
dlib/dnn/trainer.h
View file @
ee0576de
...
...
@@ -649,9 +649,10 @@ namespace dlib
// 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
// about this because there are thread_local context variables for some cuda
// components and they get regenerated when the current cuda device changes.
// Recreating them over and over is somewhat expensive so we want to avoid
// that.
// components and they get allocated for each combination of thread and device.
// So if we make sure the same device always uses the same thread this will
// reduce the number of contexts we allocate from num_devices*num_devices to
// just num_devices.
std
::
vector
<
std
::
shared_ptr
<
thread_pool
>>
tp
;
for
(
size_t
i
=
0
;
i
<
devices
.
size
();
++
i
)
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