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
1a868800
Commit
1a868800
authored
Oct 18, 2015
by
Davis King
Browse files
simplified code a little
parent
dac02110
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
39 deletions
+10
-39
dlib/dnn/cublas_dlibapi.h
dlib/dnn/cublas_dlibapi.h
+3
-13
dlib/dnn/cudnn_dlibapi.h
dlib/dnn/cudnn_dlibapi.h
+7
-26
No files found.
dlib/dnn/cublas_dlibapi.h
View file @
1a868800
...
...
@@ -29,19 +29,8 @@ namespace dlib
cublas_context
(
const
cublas_context
&
)
=
delete
;
cublas_context
&
operator
=
(
const
cublas_context
&
)
=
delete
;
// but is movable
cublas_context
(
cublas_context
&&
item
)
{
handle
=
item
.
handle
;
item
.
handle
=
nullptr
;
}
cublas_context
&
operator
=
(
cublas_context
&&
item
)
{
if
(
this
==
&
item
)
return
*
this
;
handle
=
item
.
handle
;
item
.
handle
=
nullptr
;
return
*
this
;
}
cublas_context
(
cublas_context
&&
item
)
:
cublas_context
()
{
swap
(
item
);
}
cublas_context
&
operator
=
(
cublas_context
&&
item
)
{
swap
(
item
);
return
*
this
;
}
cublas_context
();
~
cublas_context
();
...
...
@@ -50,6 +39,7 @@ namespace dlib
)
const
{
return
handle
;
}
private:
void
swap
(
cublas_context
&
item
)
{
std
::
swap
(
handle
,
item
.
handle
);
}
void
*
handle
;
};
...
...
dlib/dnn/cudnn_dlibapi.h
View file @
1a868800
...
...
@@ -25,19 +25,8 @@ namespace dlib
cudnn_context
(
const
cudnn_context
&
)
=
delete
;
cudnn_context
&
operator
=
(
const
cudnn_context
&
)
=
delete
;
// but is movable
cudnn_context
(
cudnn_context
&&
item
)
{
handle
=
item
.
handle
;
item
.
handle
=
nullptr
;
}
cudnn_context
&
operator
=
(
cudnn_context
&&
item
)
{
if
(
this
==
&
item
)
return
*
this
;
handle
=
item
.
handle
;
item
.
handle
=
nullptr
;
return
*
this
;
}
cudnn_context
(
cudnn_context
&&
item
)
:
cudnn_context
()
{
swap
(
item
);
}
cudnn_context
&
operator
=
(
cudnn_context
&&
item
)
{
swap
(
item
);
return
*
this
;
}
cudnn_context
();
~
cudnn_context
();
...
...
@@ -46,6 +35,7 @@ namespace dlib
)
const
{
return
handle
;
}
private:
void
swap
(
cudnn_context
&
item
)
{
std
::
swap
(
handle
,
item
.
handle
);
}
void
*
handle
;
};
...
...
@@ -64,19 +54,8 @@ namespace dlib
tensor_descriptor
(
const
tensor_descriptor
&
)
=
delete
;
tensor_descriptor
&
operator
=
(
const
tensor_descriptor
&
)
=
delete
;
// but is movable
tensor_descriptor
(
tensor_descriptor
&&
item
)
{
handle
=
item
.
handle
;
item
.
handle
=
nullptr
;
}
tensor_descriptor
&
operator
=
(
tensor_descriptor
&&
item
)
{
if
(
this
==
&
item
)
return
*
this
;
handle
=
item
.
handle
;
item
.
handle
=
nullptr
;
return
*
this
;
}
tensor_descriptor
(
tensor_descriptor
&&
item
)
:
tensor_descriptor
()
{
swap
(
item
);
}
tensor_descriptor
&
operator
=
(
tensor_descriptor
&&
item
)
{
swap
(
item
);
return
*
this
;
}
tensor_descriptor
();
~
tensor_descriptor
();
...
...
@@ -100,6 +79,8 @@ namespace dlib
private:
void
swap
(
tensor_descriptor
&
item
)
{
std
::
swap
(
handle
,
item
.
handle
);
}
void
*
handle
;
};
...
...
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