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