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
0babe27a
Commit
0babe27a
authored
Dec 12, 2015
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed race condition that could happen if set_size() was called while a cuda
kernel was still running.
parent
0f840db3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
gpu_data.cpp
dlib/dnn/gpu_data.cpp
+14
-0
No files found.
dlib/dnn/gpu_data.cpp
View file @
0babe27a
...
...
@@ -81,6 +81,13 @@ namespace dlib
{
if
(
new_size
==
0
)
{
if
(
device_in_use
)
{
// Wait for any possible CUDA kernels that might be using our memory block to
// complete before we free the memory.
CHECK_CUDA
(
cudaStreamSynchronize
(
0
));
device_in_use
=
false
;
}
wait_for_transfer_to_finish
();
data_size
=
0
;
host_current
=
true
;
...
...
@@ -91,6 +98,13 @@ namespace dlib
}
else
if
(
new_size
!=
data_size
)
{
if
(
device_in_use
)
{
// Wait for any possible CUDA kernels that might be using our memory block to
// complete before we free the memory.
CHECK_CUDA
(
cudaStreamSynchronize
(
0
));
device_in_use
=
false
;
}
wait_for_transfer_to_finish
();
data_size
=
new_size
;
host_current
=
true
;
...
...
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