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
f194bdc9
Commit
f194bdc9
authored
Aug 22, 2016
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added cuda bindings: get_device_name(), set_current_device_blocking_sync().
parent
c7f27517
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
0 deletions
+34
-0
cuda_dlib.cu
dlib/dnn/cuda_dlib.cu
+15
-0
cuda_dlib.h
dlib/dnn/cuda_dlib.h
+19
-0
No files found.
dlib/dnn/cuda_dlib.cu
View file @
f194bdc9
...
...
@@ -27,6 +27,21 @@ namespace dlib
return dev;
}
std::string get_device_name (
int device
)
{
cudaDeviceProp props;
CHECK_CUDA(cudaGetDeviceProperties(&props, device));
return props.name;
}
void set_current_device_blocking_sync(
)
{
CHECK_CUDA(cudaSetDeviceFlags(cudaDeviceScheduleBlockingSync));
}
int get_num_devices (
)
{
...
...
dlib/dnn/cuda_dlib.h
View file @
f194bdc9
...
...
@@ -23,6 +23,13 @@ namespace dlib
int
get_num_devices
(
);
std
::
string
get_device_name
(
int
device
);
void
set_current_device_blocking_sync
(
);
bool
can_access_peer
(
int
device_id
,
int
peer_device_id
);
bool
can_access_peer
(
const
tensor
&
device
,
const
tensor
&
peer_device
);
...
...
@@ -285,6 +292,18 @@ namespace dlib
inline
int
get_num_devices
(
)
{
return
1
;
}
inline
std
::
string
get_device_name
(
int
device
)
{
DLIB_CASSERT
(
id
==
0
,
"dlib::cuda::set_device(id) called with an invalid device id."
);
return
"CUDA_DISABLED"
;
}
inline
void
set_current_device_blocking_sync
(
)
{}
inline
bool
can_access_peer
(
int
,
int
)
{
return
false
;
}
inline
bool
can_access_peer
(
const
tensor
&
,
const
tensor
&
)
...
...
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