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
2ef72022
Commit
2ef72022
authored
Feb 26, 2018
by
fenglei.tian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more code style
parent
59df2998
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
11 deletions
+11
-11
gpu_cuda_context_manager.hpp
src/ngraph/runtime/gpu/gpu_cuda_context_manager.hpp
+1
-1
gpu_cuda_kernel_builder.hpp
src/ngraph/runtime/gpu/gpu_cuda_kernel_builder.hpp
+1
-1
gpu_cuda_kernel_emitters.cpp
src/ngraph/runtime/gpu/gpu_cuda_kernel_emitters.cpp
+9
-9
No files found.
src/ngraph/runtime/gpu/gpu_cuda_context_manager.hpp
View file @
2ef72022
...
...
@@ -41,7 +41,7 @@ namespace ngraph
CudaContextManager
&
operator
=
(
CudaContextManager
const
&
)
=
delete
;
CudaContextManager
&
operator
=
(
CudaContextManager
&&
)
=
delete
;
std
::
shared_ptr
<
CUcontext
>
GetContext
()
{
return
context_ptr
;
}
std
::
shared_ptr
<
CUcontext
>
GetContext
()
{
return
m_
context_ptr
;
}
protected
:
CudaContextManager
()
{
...
...
src/ngraph/runtime/gpu/gpu_cuda_kernel_builder.hpp
View file @
2ef72022
...
...
@@ -24,7 +24,7 @@ namespace ngraph
{
namespace
gpu
{
class
Cuda
_kernel_b
uilder
class
Cuda
KernelB
uilder
{
public
:
static
void
Get_1_element_op
(
const
std
::
string
&
name
,
...
...
src/ngraph/runtime/gpu/gpu_cuda_kernel_emitters.cpp
View file @
2ef72022
...
...
@@ -36,24 +36,24 @@ namespace ngraph
{
std
::
string
name
=
"abs"
;
// Create an instance of nvrtcProgram with the code string.
if
(
Cuda
_function_p
ool
::
Instance
().
Get
(
name
)
==
nullptr
)
if
(
Cuda
FunctionP
ool
::
Instance
().
Get
(
name
)
==
nullptr
)
{
const
char
*
opts
[]
=
{
"--gpu-architecture=compute_35"
,
"--relocatable-device-code=true"
};
std
::
string
kernel
;
Cuda
_kernel_b
uilder
::
Get_1_element_op
(
name
,
"float"
,
"fabsf"
,
kernel
);
Cuda
_function_p
ool
::
Instance
().
Set
(
Cuda
KernelB
uilder
::
Get_1_element_op
(
name
,
"float"
,
"fabsf"
,
kernel
);
Cuda
FunctionP
ool
::
Instance
().
Set
(
name
,
CudaFunctionBuilder
::
Get
(
"cuda_"
+
name
,
kernel
,
2
,
opts
));
}
//convert runtime ptr to driver api ptr
CUdeviceptr
d
PtrIn
,
dPtrO
ut
;
d
PtrI
n
=
(
CUdeviceptr
)
in
;
d
PtrO
ut
=
(
CUdeviceptr
)
out
;
CUdeviceptr
d
_ptr_in
,
d_ptr_o
ut
;
d
_ptr_i
n
=
(
CUdeviceptr
)
in
;
d
_ptr_o
ut
=
(
CUdeviceptr
)
out
;
void
*
args
List
[]
=
{
&
dPtrIn
,
&
dPtrO
ut
,
&
count
};
void
*
args
_list
[]
=
{
&
d_ptr_in
,
&
d_ptr_o
ut
,
&
count
};
CUDA_SAFE_CALL
(
cuLaunchKernel
(
*
Cuda
_function_p
ool
::
Instance
().
Get
(
name
).
get
(),
cuLaunchKernel
(
*
Cuda
FunctionP
ool
::
Instance
().
Get
(
name
).
get
(),
count
,
1
,
1
,
// grid dim
...
...
@@ -62,7 +62,7 @@ namespace ngraph
1
,
// block dim
0
,
NULL
,
// shared mem and stream
args
L
ist
,
args
_l
ist
,
0
));
// arguments
CUDA_SAFE_CALL
(
cuCtxSynchronize
());
// Retrieve and print output.
}
...
...
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