Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
ngraph
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ngraph
Commits
f1ebcd3e
Commit
f1ebcd3e
authored
Jul 05, 2018
by
Fenglei
Committed by
Robert Kimball
Jul 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bugs in align_to_block_size function (#1191)
* extra *block_size * change grid_size to threads
parent
af956916
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
9 deletions
+5
-9
cuda_emitter.cpp
src/ngraph/runtime/gpu/cuda_emitter.cpp
+4
-8
cuda_emitter.hpp
src/ngraph/runtime/gpu/cuda_emitter.hpp
+1
-1
No files found.
src/ngraph/runtime/gpu/cuda_emitter.cpp
View file @
f1ebcd3e
...
...
@@ -1813,16 +1813,12 @@ __device__ __forceinline__ int64_t load(const int64_t* __restrict__ in, int i=
return
ss
.
str
();
}
uint32_t
runtime
::
gpu
::
CUDAEmitter
::
align_to_block_size
(
uint32_t
grid_size
,
uint32_t
block_size
)
uint32_t
runtime
::
gpu
::
CUDAEmitter
::
align_to_block_size
(
uint32_t
threads
,
uint32_t
block_size
)
{
if
(
grid_size
>
(
1u
<<
31
)
-
1
)
if
(
threads
>
(
1u
<<
31
)
-
1
)
{
throw
std
::
runtime_error
(
"Cuda can't handle grid_size_x > 2^31 - 1."
);
}
uint32_t
r
=
(
grid_size
+
block_size
-
1
)
/
block_size
*
block_size
;
if
(
grid_size
>
(
1u
<<
31
)
-
1
)
{
throw
std
::
runtime_error
(
"Cuda can't handle grid_size_x > 2^31 - 1."
);
throw
std
::
runtime_error
(
"Cuda can't handle threads > 2^31 - 1."
);
}
uint32_t
r
=
(
threads
+
block_size
-
1
)
/
block_size
;
return
r
;
}
src/ngraph/runtime/gpu/cuda_emitter.hpp
View file @
f1ebcd3e
...
...
@@ -151,7 +151,7 @@ namespace ngraph
private
:
CUDAEmitter
(
GPUPrimitiveEmitter
*
emitter
);
uint32_t
align_to_block_size
(
uint32_t
grid_size
,
uint32_t
block_size
);
uint32_t
align_to_block_size
(
uint32_t
threads
,
uint32_t
block_size
);
void
print_tensor_from_gpu
(
codegen
::
CodeWriter
&
writer
,
const
std
::
string
&
tensor_name
,
GPUShape
shape
);
...
...
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