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
f89a679a
Commit
f89a679a
authored
Feb 21, 2018
by
fenglei.tian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix name bug and apply clang format
parent
ca07b7f0
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
11 deletions
+11
-11
gpu_cuda_function_builder.hpp
src/ngraph/runtime/gpu/gpu_cuda_function_builder.hpp
+2
-2
gpu_cuda_kernel_builder.hpp
src/ngraph/runtime/gpu/gpu_cuda_kernel_builder.hpp
+7
-7
gpu_cuda_kernel_emitters.cpp
src/ngraph/runtime/gpu/gpu_cuda_kernel_emitters.cpp
+2
-2
No files found.
src/ngraph/runtime/gpu/gpu_cuda_function_builder.hpp
View file @
f89a679a
...
@@ -30,8 +30,8 @@ namespace ngraph
...
@@ -30,8 +30,8 @@ namespace ngraph
class
Cuda_function_builder
class
Cuda_function_builder
{
{
public
:
public
:
static
std
::
shared_ptr
<
CUfunction
>
Get
(
std
::
string
&
kernel
,
static
std
::
shared_ptr
<
CUfunction
>
Get
(
const
std
::
string
&
name
,
std
::
string
&
name
,
const
std
::
string
&
kernel
,
int
number_of_options
,
int
number_of_options
,
const
char
**
options
)
const
char
**
options
)
{
{
...
...
src/ngraph/runtime/gpu/gpu_cuda_kernel_builder.hpp
View file @
f89a679a
...
@@ -34,13 +34,13 @@ namespace ngraph
...
@@ -34,13 +34,13 @@ namespace ngraph
{
{
kernel
=
R"(
kernel
=
R"(
extern "C" __global__
extern "C" __global__
void cuda_
op_)"
+
name
+
"("
+
void cuda_
)"
+
name
+
"("
+
data_type
+
data_type
+
"* in, "
+
data_type
+
"* out, size_t n)
\n
"
+
R"({
"* in, "
+
data_type
+
"* out, size_t n)
\n
"
+
R"({
size_t tid = blockIdx.x * blockDim.x + threadIdx.x;
size_t tid = blockIdx.x * blockDim.x + threadIdx.x;
if(tid < n)
if(tid < n)
{
{
out[tid] =
" + op + "(in[tid]);\n"
out[tid] =
)"
+
op
+
"(in[tid]);
\n
"
+
+
R"(}
R"(}
})"
;
})"
;
return
;
return
;
}
}
...
@@ -52,9 +52,9 @@ out[tid] = " + op + "(in[tid]);\n"
...
@@ -52,9 +52,9 @@ out[tid] = " + op + "(in[tid]);\n"
{
{
kernel
=
R"(
kernel
=
R"(
extern "C" __global__
extern "C" __global__
void
cuda_op_)"
+
name
+
"("
+
void
)"
+
name
+
"("
+
data_type
+
data_type
+
"* in1, "
+
data_type
+
"* in2, "
+
data_type
+
"* in1, "
+
data_type
+
"* in2, "
+
data_type
+
"* out, size_t n)
\n
"
+
"* out, size_t n)
\n
"
+
R"({
R"({
size_t tid = blockIdx.x * blockDim.x + threadIdx.x;
size_t tid = blockIdx.x * blockDim.x + threadIdx.x;
if(tid < n)
if(tid < n)
{
{
...
...
src/ngraph/runtime/gpu/gpu_cuda_kernel_emitters.cpp
View file @
f89a679a
...
@@ -23,10 +23,10 @@
...
@@ -23,10 +23,10 @@
#include <cudnn_v7.h>
#include <cudnn_v7.h>
#include <nvrtc.h>
#include <nvrtc.h>
#include "ngraph/runtime/gpu/gpu_cuda_kernel_emitters.hpp"
#include "ngraph/runtime/gpu/gpu_cuda_function_builder.hpp"
#include "ngraph/runtime/gpu/gpu_cuda_function_builder.hpp"
#include "ngraph/runtime/gpu/gpu_cuda_function_pool.hpp"
#include "ngraph/runtime/gpu/gpu_cuda_function_pool.hpp"
#include "ngraph/runtime/gpu/gpu_cuda_kernel_builder.hpp"
#include "ngraph/runtime/gpu/gpu_cuda_kernel_builder.hpp"
#include "ngraph/runtime/gpu/gpu_cuda_kernel_emitters.hpp"
namespace
ngraph
namespace
ngraph
{
{
...
@@ -49,7 +49,7 @@ namespace ngraph
...
@@ -49,7 +49,7 @@ namespace ngraph
std
::
string
kernel
;
std
::
string
kernel
;
Cuda_kernel_builder
::
Get_1_element_op
(
name
,
"float"
,
"fabsf"
,
kernel
);
Cuda_kernel_builder
::
Get_1_element_op
(
name
,
"float"
,
"fabsf"
,
kernel
);
Cuda_function_pool
::
Instance
().
Set
(
Cuda_function_pool
::
Instance
().
Set
(
name
,
Cuda_function_builder
::
Get
(
name
,
kernel
,
2
,
opts
));
name
,
Cuda_function_builder
::
Get
(
"cuda_"
+
name
,
kernel
,
2
,
opts
));
}
}
//convert runtime ptr to driver api ptr
//convert runtime ptr to driver api ptr
...
...
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