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
de34309c
Commit
de34309c
authored
Oct 18, 2015
by
Davis King
Browse files
fixed move constructor
parent
c9fd6d0b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
dlib/dnn/gpu_data.h
dlib/dnn/gpu_data.h
+12
-2
No files found.
dlib/dnn/gpu_data.h
View file @
de34309c
...
@@ -46,8 +46,8 @@ namespace dlib
...
@@ -46,8 +46,8 @@ namespace dlib
gpu_data
&
operator
=
(
const
gpu_data
&
)
=
delete
;
gpu_data
&
operator
=
(
const
gpu_data
&
)
=
delete
;
// but is movable
// but is movable
gpu_data
(
gpu_data
&&
)
=
default
;
gpu_data
(
gpu_data
&&
item
)
:
gpu_data
()
{
swap
(
item
);
}
gpu_data
&
operator
=
(
gpu_data
&&
)
=
default
;
gpu_data
&
operator
=
(
gpu_data
&&
item
)
{
swap
(
item
);
return
*
this
;
}
#ifdef DLIB_USE_CUDA
#ifdef DLIB_USE_CUDA
...
@@ -112,6 +112,16 @@ namespace dlib
...
@@ -112,6 +112,16 @@ namespace dlib
size_t
size
()
const
{
return
data_size
;
}
size_t
size
()
const
{
return
data_size
;
}
void
swap
(
gpu_data
&
item
)
{
std
::
swap
(
data_size
,
item
.
data_size
);
std
::
swap
(
host_current
,
item
.
host_current
);
std
::
swap
(
device_current
,
item
.
device_current
);
std
::
swap
(
have_active_transfer
,
item
.
have_active_transfer
);
std
::
swap
(
data_host
,
item
.
data_host
);
std
::
swap
(
data_device
,
item
.
data_device
);
std
::
swap
(
cuda_stream
,
item
.
cuda_stream
);
}
private:
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