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
a32fdab5
Commit
a32fdab5
authored
Mar 13, 2018
by
Fenglei
Committed by
Robert Kimball
Mar 13, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix old style cast error (#632)
parent
490e4e63
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
44 deletions
+20
-44
gpu_cuda_kernel_emitters.cpp
src/ngraph/runtime/gpu/gpu_cuda_kernel_emitters.cpp
+3
-3
gpu_emitter.cpp
src/ngraph/runtime/gpu/gpu_emitter.cpp
+1
-6
gpu_external_function.cpp
src/ngraph/runtime/gpu/gpu_external_function.cpp
+14
-33
gpu_tensor_view.cpp
src/ngraph/runtime/gpu/gpu_tensor_view.cpp
+1
-1
gpu_util.cpp
src/ngraph/runtime/gpu/gpu_util.cpp
+1
-1
No files found.
src/ngraph/runtime/gpu/gpu_cuda_kernel_emitters.cpp
View file @
a32fdab5
...
...
@@ -53,12 +53,12 @@ void cuda_)" + name + "(" + data_type +
//convert runtime ptr to driver api ptr
CUdeviceptr
d_ptr_in
,
d_ptr_out
;
d_ptr_in
=
(
CUdeviceptr
)
in
;
d_ptr_out
=
(
CUdeviceptr
)
out
;
d_ptr_in
=
CUdeviceptr
(
in
)
;
d_ptr_out
=
CUdeviceptr
(
out
)
;
void
*
args_list
[]
=
{
&
d_ptr_in
,
&
d_ptr_out
,
&
repeat_size
,
&
repeat_times
,
&
count
};
CUDA_SAFE_CALL
(
cuLaunchKernel
(
*
CudaFunctionPool
::
instance
().
get
(
name
).
get
(),
count
,
static_cast
<
unsigned
int
>
(
count
)
,
1
,
1
,
// grid dim
1
,
...
...
src/ngraph/runtime/gpu/gpu_emitter.cpp
View file @
a32fdab5
...
...
@@ -183,7 +183,6 @@ cudnnSetOpTensorDescriptor(opTensorDesc,
return
;
}
const
ngraph
::
op
::
Dot
*
dot
=
static_cast
<
const
ngraph
::
op
::
Dot
*>
(
node
);
const
Shape
&
arg0_shape
=
args
[
0
].
get_shape
();
const
Shape
&
arg1_shape
=
args
[
1
].
get_shape
();
if
(
arg0_shape
.
empty
()
||
arg1_shape
.
empty
())
...
...
@@ -504,15 +503,11 @@ cudnnSetOpTensorDescriptor(opTensorDesc,
writer
.
indent
++
;
auto
arg_shape
=
args
[
0
].
get_shape
();
auto
arg_rank
=
arg_shape
.
size
();
auto
result_shape
=
out
[
0
].
get_shape
();
auto
&
result_element_type
=
out
[
0
].
get_element_type
();
auto
input_order
=
reshape
->
get_input_order
();
bool
same_layout
=
is_sorted
(
input_order
.
begin
(),
input_order
.
end
());
size_t
result_shape_product
=
1
;
for
(
auto
i
:
result_shape
)
{
result_shape_product
*=
i
;
...
...
src/ngraph/runtime/gpu/gpu_external_function.cpp
View file @
a32fdab5
...
...
@@ -427,9 +427,6 @@ using namespace std;
for
(
shared_ptr
<
Function
>
current_function
:
pass_manager
.
get_state
().
get_functions
())
{
bool
temporaries_used
=
false
;
size_t
worst_case_tmp_size
=
0
;
set
<
string
>
output_names
;
for
(
shared_ptr
<
Node
>
op
:
current_function
->
get_results
())
{
...
...
@@ -454,18 +451,6 @@ using namespace std;
continue
;
}
string
match_function_name
;
for
(
size_t
j
=
i
+
1
;
j
<
op_list
.
size
();
j
++
)
{
if
(
0
)
//op_list[i]->is_functionally_identical(*op_list[j]))
{
if
(
match_function_name
.
empty
())
{
match_function_name
=
"func_"
+
op_list
[
i
]
->
get_name
();
match_functions
.
insert
({
op_list
[
i
].
get
(),
match_function_name
});
}
match_functions
.
insert
({
op_list
[
j
].
get
(),
match_function_name
});
}
}
if
(
!
match_function_name
.
empty
())
{
writer
<<
"static void "
<<
match_function_name
<<
"("
;
...
...
@@ -545,28 +530,24 @@ using namespace std;
writer
<<
"{
\n
"
;
writer
.
indent
++
;
for
(
shared_ptr
<
Function
>
current_function
:
pass_manager
.
get_state
().
get_functions
())
for
(
shared_ptr
<
Node
>
node
:
current_function
->
get_ordered_ops
())
{
for
(
shared_ptr
<
Node
>
node
:
current_function
->
get_ordered_ops
())
const
op
::
Constant
*
c
=
dynamic_cast
<
op
::
Constant
*>
(
node
.
get
());
if
(
c
)
{
const
op
::
Constant
*
c
=
dynamic_cast
<
op
::
Constant
*>
(
node
.
get
());
if
(
c
)
{
shared_ptr
<
descriptor
::
TensorView
>
tv
=
node
->
get_outputs
()[
0
].
get_tensor_view
();
writer
<<
"if("
<<
tv
->
get_tensor
().
get_name
()
<<
" == NULL)
\n
"
;
writer
<<
"{
\n
"
;
writer
.
indent
++
;
writer
<<
"runtime::gpu::cuda_memcpyHtD("
<<
tv
->
get_tensor
().
get_name
()
<<
", "
<<
tv
->
get_tensor
().
get_name
()
<<
"_cpu, "
<<
tv
->
get_tensor
().
size
()
<<
");
\n
"
;
writer
.
indent
--
;
writer
<<
"}
\n
"
;
}
shared_ptr
<
descriptor
::
TensorView
>
tv
=
node
->
get_outputs
()[
0
].
get_tensor_view
();
writer
<<
"if("
<<
tv
->
get_tensor
().
get_name
()
<<
" == NULL)
\n
"
;
writer
<<
"{
\n
"
;
writer
.
indent
++
;
writer
<<
"runtime::gpu::cuda_memcpyHtD("
<<
tv
->
get_tensor
().
get_name
()
<<
", "
<<
tv
->
get_tensor
().
get_name
()
<<
"_cpu, "
<<
tv
->
get_tensor
().
size
()
<<
");
\n
"
;
writer
.
indent
--
;
writer
<<
"}
\n
"
;
}
}
bool
temporaries_used
=
false
;
size_t
worst_case_tmp_size
=
0
;
for
(
shared_ptr
<
Node
>
node
:
current_function
->
get_ordered_ops
())
...
...
src/ngraph/runtime/gpu/gpu_tensor_view.cpp
View file @
a32fdab5
...
...
@@ -41,7 +41,7 @@ runtime::gpu::GPU_TensorView::GPU_TensorView(const ngraph::element::Type& elemen
m_buffer_size
=
shape_size
(
shape
)
*
element_type
.
size
();
if
(
m_buffer_size
>
0
)
{
cudaMalloc
(
(
void
**
)
&
m_allocated_buffer_pool
,
m_buffer_size
);
cudaMalloc
(
static_cast
<
void
**>
(
&
m_allocated_buffer_pool
)
,
m_buffer_size
);
}
}
...
...
src/ngraph/runtime/gpu/gpu_util.cpp
View file @
a32fdab5
...
...
@@ -50,7 +50,7 @@ void runtime::gpu::check_cuda_errors(CUresult err)
void
*
runtime
::
gpu
::
create_gpu_buffer
(
size_t
buffer_size
)
{
void
*
allocated_buffer_pool
;
cudaMalloc
(
(
void
**
)
&
allocated_buffer_pool
,
buffer_size
);
cudaMalloc
(
static_cast
<
void
**>
(
&
allocated_buffer_pool
)
,
buffer_size
);
return
allocated_buffer_pool
;
}
...
...
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