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
4f7c01f4
Commit
4f7c01f4
authored
Jun 12, 2018
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added more overloads of memcpy() for cuda_data_ptr.
parent
b23c7186
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
6 deletions
+22
-6
cuda_data_ptr.h
dlib/cuda/cuda_data_ptr.h
+22
-6
No files found.
dlib/cuda/cuda_data_ptr.h
View file @
4f7c01f4
...
...
@@ -178,15 +178,31 @@ namespace dlib
}
friend
void
memcpy
(
cuda_data_ptr
&
src
,
const
std
::
vector
<
T
>&
dest
cuda_data_ptr
&
dest
,
const
std
::
vector
<
T
>&
src
)
{
if
(
dest
.
size
()
!=
src
.
size
())
dest
=
cuda_data_ptr
<
T
>
(
src
.
size
());
if
(
src
.
size
()
!=
dest
.
size
())
src
=
cuda_data_ptr
<
T
>
(
dest
.
size
());
if
(
src
.
size
()
!=
0
)
memcpy
(
src
.
pdata
,
dest
.
data
());
if
(
dest
.
size
()
!=
0
)
memcpy
(
dest
.
pdata
,
src
.
data
());
}
friend
void
memcpy
(
cuda_data_ptr
&
dest
,
const
float
*
src
)
{
memcpy
(
dest
.
pdata
,
src
);
}
friend
void
memcpy
(
float
*
dest
,
const
cuda_data_ptr
&
src
)
{
memcpy
(
dest
,
src
.
pdata
);
}
private
:
...
...
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