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
89c9267e
Commit
89c9267e
authored
Aug 14, 2017
by
Davis King
Browse files
Made copy_tensor() use cudaMemcpyAsync() rather than cudaMemcpy().
parent
aafa4116
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
dlib/dnn/cuda_dlib.cu
dlib/dnn/cuda_dlib.cu
+1
-1
dlib/dnn/tensor_tools.h
dlib/dnn/tensor_tools.h
+1
-0
No files found.
dlib/dnn/cuda_dlib.cu
View file @
89c9267e
...
@@ -1401,7 +1401,7 @@ namespace dlib
...
@@ -1401,7 +1401,7 @@ namespace dlib
for
(
long
i
=
0
;
i
<
src
.
num_samples
();
++
i
)
for
(
long
i
=
0
;
i
<
src
.
num_samples
();
++
i
)
{
{
CHECK_CUDA
(
cudaMemcpy
(
dest_p
,
src_p
,
block_size
*
sizeof
(
float
),
cudaMemcpyDeviceToDevice
));
CHECK_CUDA
(
cudaMemcpy
Async
(
dest_p
,
src_p
,
block_size
*
sizeof
(
float
),
cudaMemcpyDeviceToDevice
));
dest_p
+=
dest_sample_size
;
dest_p
+=
dest_sample_size
;
src_p
+=
src_sample_size
;
src_p
+=
src_sample_size
;
...
...
dlib/dnn/tensor_tools.h
View file @
89c9267e
...
@@ -1558,6 +1558,7 @@ namespace dlib { namespace tt
...
@@ -1558,6 +1558,7 @@ namespace dlib { namespace tt
- dest.k() - dest_k_offset >= count_k
- dest.k() - dest_k_offset >= count_k
- src.k() - src_k_offset >= count_k
- src.k() - src_k_offset >= count_k
- is_same_object(dest,src) == false
- is_same_object(dest,src) == false
- The memory areas of src and dest do not overlap.
ensures
ensures
- performs: dest[i, k + dest_k_offset, r, c] = src[i, k + src_k_offset, r, c], where k in [0..count_k]
- performs: dest[i, k + dest_k_offset, r, c] = src[i, k + src_k_offset, r, c], where k in [0..count_k]
Copies content of each sample from src in to corresponding place of sample at dest.
Copies content of each sample from src in to corresponding place of sample at dest.
...
...
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