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
909ca040
Commit
909ca040
authored
Apr 30, 2016
by
Davis King
Browse files
Made launch_kernel() not generate CUDA errors if you ask it to launch a kernel of size 0.
parent
f5abfca1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
dlib/dnn/cuda_utils.h
dlib/dnn/cuda_utils.h
+2
-0
No files found.
dlib/dnn/cuda_utils.h
View file @
909ca040
...
@@ -167,6 +167,8 @@ namespace dlib
...
@@ -167,6 +167,8 @@ namespace dlib
launch_kernel().
launch_kernel().
!*/
!*/
{
{
if
(
m
.
num
==
0
)
return
;
int
num_blocks
,
num_threads
;
int
num_blocks
,
num_threads
;
CHECK_CUDA
(
cudaOccupancyMaxPotentialBlockSize
(
&
num_blocks
,
&
num_threads
,
K
));
CHECK_CUDA
(
cudaOccupancyMaxPotentialBlockSize
(
&
num_blocks
,
&
num_threads
,
K
));
// Check if the job is really small and we don't really need to launch a kernel
// Check if the job is really small and we don't really need to launch a kernel
...
...
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