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
40fa0208
Commit
40fa0208
authored
Feb 13, 2018
by
fenglei.tian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix header setting in cmake
parent
2cf7bff2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
27 deletions
+26
-27
run.sh
scripts/run.sh
+1
-1
CMakeLists.txt
src/ngraph/CMakeLists.txt
+4
-4
compiler.cpp
src/ngraph/codegen/compiler.cpp
+1
-2
gpu_emitter.cpp
src/ngraph/runtime/gpu/gpu_emitter.cpp
+20
-20
No files found.
scripts/run.sh
View file @
40fa0208
...
@@ -3,5 +3,5 @@
...
@@ -3,5 +3,5 @@
./build/test/unit-test
--gtest_filter
=
GPU.maximum
./build/test/unit-test
--gtest_filter
=
GPU.maximum
./build/test/unit-test
--gtest_filter
=
GPU.minimum
./build/test/unit-test
--gtest_filter
=
GPU.minimum
./build/test/unit-test
--gtest_filter
=
GPU.multiple
*
./build/test/unit-test
--gtest_filter
=
GPU.multiple
*
#./build/test/unit-test --gtest_filter=GPU.abs
#
#
./build/test/unit-test --gtest_filter=GPU.abs
#./build/test/unit-test --gtest_filter=GPU.dot*
#./build/test/unit-test --gtest_filter=GPU.dot*
src/ngraph/CMakeLists.txt
View file @
40fa0208
...
@@ -194,14 +194,12 @@ if (NGRAPH_CPU_ENABLE AND LLVM_INCLUDE_DIR AND
...
@@ -194,14 +194,12 @@ if (NGRAPH_CPU_ENABLE AND LLVM_INCLUDE_DIR AND
"NGRAPH_TBB_ENABLE"
"NGRAPH_TBB_ENABLE"
)
)
endif
()
endif
()
set_source_files_properties
(
codegen/compiler.cpp PROPERTIES COMPILE_DEFINITIONS
"
${
HEADER_SEARCH_DEFINES
}
"
)
set
(
NGRAPH_CPU_DEBUGINFO_ENABLE 0 CACHE STRING
"Enable debuginfo in the CPU backend"
)
set
(
NGRAPH_CPU_DEBUGINFO_ENABLE 0 CACHE STRING
"Enable debuginfo in the CPU backend"
)
# GPU backend current requires CPU because they share compiler.cpp,
# GPU backend current requires CPU because they share compiler.cpp,
# and compiler.cpp requires MKLDNN
# and compiler.cpp requires MKLDNN
if
(
NGRAPH_GPU_ENABLE
)
if
(
NGRAPH_GPU_ENABLE
)
include_directories
(
SYSTEM
${
CUDA_INCLUDE_DIRS
}
${
CUDNN_INCLUDE_DIR
}
)
include_directories
(
SYSTEM
${
CUDA_INCLUDE_DIRS
}
${
CUDNN_INCLUDE_DIR
}
)
message
(
STATUS
"cuda ---------------
${
CUDA_INCLUDE_DIRS
}
"
)
# Add sources for the GPU backend
# Add sources for the GPU backend
# and all its dependencies
# and all its dependencies
set
(
SRC
${
SRC
}
set
(
SRC
${
SRC
}
...
@@ -215,9 +213,11 @@ if (NGRAPH_CPU_ENABLE AND LLVM_INCLUDE_DIR AND
...
@@ -215,9 +213,11 @@ if (NGRAPH_CPU_ENABLE AND LLVM_INCLUDE_DIR AND
runtime/gpu/gpu_tensor_view_wrapper.cpp
runtime/gpu/gpu_tensor_view_wrapper.cpp
runtime/gpu/gpu_util.cpp
runtime/gpu/gpu_util.cpp
)
)
set_property
(
SOURCE codegen/compiler.cpp APPEND_STRING PROPERTY COMPILE_DEFINITIONS
set
(
HEADER_SEARCH_DEFINES
${
HEADER_SEARCH_DEFINES
}
"CUDA_HEADER_PATHS=
\"
${
CUDA_INCLUDE_DIRS
}
\"
;"
)
"CUDA_HEADER_PATHS=
\"
${
CUDA_INCLUDE_DIRS
}
\"
"
)
endif
()
endif
()
set_source_files_properties
(
codegen/compiler.cpp PROPERTIES COMPILE_DEFINITIONS
"
${
HEADER_SEARCH_DEFINES
}
"
)
endif
()
endif
()
...
...
src/ngraph/codegen/compiler.cpp
View file @
40fa0208
...
@@ -65,7 +65,7 @@
...
@@ -65,7 +65,7 @@
#error "This source file interfaces with LLVM and Clang and must be compiled with RTTI disabled"
#error "This source file interfaces with LLVM and Clang and must be compiled with RTTI disabled"
#endif
#endif
//
#define USE_BUILTIN
#define USE_BUILTIN
using
namespace
clang
;
using
namespace
clang
;
using
namespace
llvm
;
using
namespace
llvm
;
...
@@ -360,7 +360,6 @@ void codegen::StaticCompiler::configure_search_path()
...
@@ -360,7 +360,6 @@ void codegen::StaticCompiler::configure_search_path()
add_header_search_path
(
CLANG_BUILTIN_HEADERS_PATH
);
add_header_search_path
(
CLANG_BUILTIN_HEADERS_PATH
);
add_header_search_path
(
"/usr/include/x86_64-linux-gnu"
);
add_header_search_path
(
"/usr/include/x86_64-linux-gnu"
);
add_header_search_path
(
"/usr/include"
);
add_header_search_path
(
"/usr/include"
);
add_header_search_path
(
"/usr/local/cuda/include"
);
// Search for headers in
// Search for headers in
// /usr/include/x86_64-linux-gnu/c++/N.N
// /usr/include/x86_64-linux-gnu/c++/N.N
...
...
src/ngraph/runtime/gpu/gpu_emitter.cpp
View file @
40fa0208
...
@@ -50,26 +50,26 @@ using namespace std;
...
@@ -50,26 +50,26 @@ using namespace std;
using
namespace
ngraph
;
using
namespace
ngraph
;
#define NVRTC_SAFE_CALL(x) \
#define NVRTC_SAFE_CALL(x) \
do
{
\
do { \
nvrtcResult
result
=
x
;
\
nvrtcResult result = x; \
if
(
result
!=
NVRTC_SUCCESS
)
{
\
if (result != NVRTC_SUCCESS) { \
std
::
cerr
<<
"
\n
error: "
#
x
" failed with error "
\
std::cerr << "\nerror: " #x " failed with error " \
<< nvrtcGetErrorString(result) << '\n'; \
<< nvrtcGetErrorString(result) << '\n'; \
exit
(
1
);
\
exit(1); \
} \
} while(0)
#define CUDA_SAFE_CALL(x) \
do { \
CUresult result = x; \
if (result != CUDA_SUCCESS) { \
const char *msg; \
cuGetErrorName(result, &msg); \
std::cerr << "\nerror: " #x " failed with error " \
<< msg << '\n'; \
exit(1); \
} \
} \
}
while
(
0
)
#define CUDA_SAFE_CALL(x) \
do
{
\
CUresult
result
=
x
;
\
if
(
result
!=
CUDA_SUCCESS
)
{
\
const
char
*
msg
;
\
cuGetErrorName
(
result
,
&
msg
);
\
std
::
cerr
<<
"
\n
error: "
#
x
" failed with error "
\
<<
msg
<<
'\n'
;
\
exit
(
1
);
\
}
\
} while(0)
} while(0)
...
@@ -151,7 +151,7 @@ void runtime::gpu::GPU_Emitter::EmitDot(codegen::CodeWriter& writer,
...
@@ -151,7 +151,7 @@ void runtime::gpu::GPU_Emitter::EmitDot(codegen::CodeWriter& writer,
const
vector
<
runtime
::
gpu
::
GPU_TensorViewWrapper
>&
out
)
const
vector
<
runtime
::
gpu
::
GPU_TensorViewWrapper
>&
out
)
{
{
writer
<<
" // "
<<
n
->
get_name
()
<<
"
\n
return;
\n
"
;
writer
<<
" // "
<<
n
->
get_name
()
<<
"
\n
return;
\n
"
;
/*
const
Shape
&
arg0_shape
=
args
[
0
].
get_shape
();
const
Shape
&
arg0_shape
=
args
[
0
].
get_shape
();
const
Shape
&
arg1_shape
=
args
[
1
].
get_shape
();
const
Shape
&
arg1_shape
=
args
[
1
].
get_shape
();
if
(
arg0_shape
.
empty
()
||
arg1_shape
.
empty
())
if
(
arg0_shape
.
empty
()
||
arg1_shape
.
empty
())
...
@@ -256,7 +256,7 @@ else
...
@@ -256,7 +256,7 @@ else
{
{
// General ND Call?
// General ND Call?
}
}
*/
}
}
void
runtime
::
gpu
::
GPU_Emitter
::
EmitDivide
(
codegen
::
CodeWriter
&
writer
,
void
runtime
::
gpu
::
GPU_Emitter
::
EmitDivide
(
codegen
::
CodeWriter
&
writer
,
...
...
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