Commit f7d97aa1 authored by fenglei.tian's avatar fenglei.tian

cleanup code

parent 40fa0208
...@@ -85,13 +85,7 @@ void runtime::gpu::GPU_Emitter::EmitAbs(codegen::CodeWriter& writer, ...@@ -85,13 +85,7 @@ void runtime::gpu::GPU_Emitter::EmitAbs(codegen::CodeWriter& writer,
const vector<runtime::gpu::GPU_TensorViewWrapper>& args, const vector<runtime::gpu::GPU_TensorViewWrapper>& args,
const vector<runtime::gpu::GPU_TensorViewWrapper>& out) const vector<runtime::gpu::GPU_TensorViewWrapper>& out)
{ {
writer << "{ // " << n->get_name() << "\n"; writer << " // " << n->get_name() << "\n return;\n";
writer.indent++;
writer << "int count = " << out[0].get_size() << ";\n";
writer << "if(count == 0) return;\n";
writer << "ngraph::runtime::gpu::cuda::kernel::emit_abs((void*) " << args[0].get_name() << ", (void*) " << out[0].get_name() << ", count);\n";
writer.indent--;
writer << "}\n";
} }
void runtime::gpu::GPU_Emitter::EmitAdd(codegen::CodeWriter& writer, void runtime::gpu::GPU_Emitter::EmitAdd(codegen::CodeWriter& writer,
...@@ -264,6 +258,7 @@ void runtime::gpu::GPU_Emitter::EmitDivide(codegen::CodeWriter& writer, ...@@ -264,6 +258,7 @@ void runtime::gpu::GPU_Emitter::EmitDivide(codegen::CodeWriter& writer,
const vector<runtime::gpu::GPU_TensorViewWrapper>& args, const vector<runtime::gpu::GPU_TensorViewWrapper>& args,
const vector<runtime::gpu::GPU_TensorViewWrapper>& out) const vector<runtime::gpu::GPU_TensorViewWrapper>& out)
{ {
writer << " // " << n->get_name() << "\n return;\n";
} }
void runtime::gpu::GPU_Emitter::EmitEqual(codegen::CodeWriter& writer, void runtime::gpu::GPU_Emitter::EmitEqual(codegen::CodeWriter& writer,
...@@ -271,6 +266,7 @@ void runtime::gpu::GPU_Emitter::EmitEqual(codegen::CodeWriter& writer, ...@@ -271,6 +266,7 @@ void runtime::gpu::GPU_Emitter::EmitEqual(codegen::CodeWriter& writer,
const vector<runtime::gpu::GPU_TensorViewWrapper>& args, const vector<runtime::gpu::GPU_TensorViewWrapper>& args,
const vector<runtime::gpu::GPU_TensorViewWrapper>& out) const vector<runtime::gpu::GPU_TensorViewWrapper>& out)
{ {
writer << " // " << n->get_name() << "\n return;\n";
} }
void runtime::gpu::GPU_Emitter::EmitGreater(codegen::CodeWriter& writer, void runtime::gpu::GPU_Emitter::EmitGreater(codegen::CodeWriter& writer,
...@@ -278,6 +274,7 @@ void runtime::gpu::GPU_Emitter::EmitGreater(codegen::CodeWriter& writer, ...@@ -278,6 +274,7 @@ void runtime::gpu::GPU_Emitter::EmitGreater(codegen::CodeWriter& writer,
const vector<runtime::gpu::GPU_TensorViewWrapper>& args, const vector<runtime::gpu::GPU_TensorViewWrapper>& args,
const vector<runtime::gpu::GPU_TensorViewWrapper>& out) const vector<runtime::gpu::GPU_TensorViewWrapper>& out)
{ {
writer << " // " << n->get_name() << "\n return;\n";
} }
void runtime::gpu::GPU_Emitter::EmitGreaterEq( void runtime::gpu::GPU_Emitter::EmitGreaterEq(
......
...@@ -22,12 +22,6 @@ ...@@ -22,12 +22,6 @@
#include <typeindex> #include <typeindex>
#include <typeinfo> #include <typeinfo>
#include <unordered_map> #include <unordered_map>
#include "cuda_runtime.h"
#include "cudnn_v7.h"
#include "cublas_v2.h"
#include "cuda.h"
#include "ngraph/codegen/code_writer.hpp" #include "ngraph/codegen/code_writer.hpp"
#include "ngraph/codegen/compiler.hpp" #include "ngraph/codegen/compiler.hpp"
#include "ngraph/codegen/execution_engine.hpp" #include "ngraph/codegen/execution_engine.hpp"
...@@ -255,11 +249,6 @@ void runtime::gpu::GPU_ExternalFunction::compile() ...@@ -255,11 +249,6 @@ void runtime::gpu::GPU_ExternalFunction::compile()
string pch_header_source = writer.get_code(); string pch_header_source = writer.get_code();
writer += R"(
using namespace ngraph;
using namespace std;
)";
if (m_emit_timing) if (m_emit_timing)
{ {
writer << "// Declare debug timers\n"; writer << "// Declare debug timers\n";
......
...@@ -79,7 +79,6 @@ if(NGRAPH_CPU_ENABLE AND LLVM_INCLUDE_DIR) ...@@ -79,7 +79,6 @@ if(NGRAPH_CPU_ENABLE AND LLVM_INCLUDE_DIR)
endif() endif()
if(NGRAPH_GPU_ENABLE AND LLVM_INCLUDE_DIR) if(NGRAPH_GPU_ENABLE AND LLVM_INCLUDE_DIR)
message(STATUS "GPU PATH: ${CUDA_INCLUDE_DIRS} AND ${CUDNN_INCLUDE_DIR}")
include_directories(SYSTEM /usr/local/cuda/include ${LLVM_INCLUDE_DIR} ${CUDA_INCLUDE_DIRS} ${CUDNN_INCLUDE_DIR}) include_directories(SYSTEM /usr/local/cuda/include ${LLVM_INCLUDE_DIR} ${CUDA_INCLUDE_DIRS} ${CUDNN_INCLUDE_DIR})
link_directories(${LLVM_LIB_DIR}) link_directories(${LLVM_LIB_DIR})
link_directories(${CUDA_LIBRARIES}) link_directories(${CUDA_LIBRARIES})
...@@ -156,9 +155,7 @@ if(LLVM_INCLUDE_DIR) ...@@ -156,9 +155,7 @@ if(LLVM_INCLUDE_DIR)
endif() endif()
if(CUDA_INCLUDE_DIRS) if(CUDA_INCLUDE_DIRS)
message(STATUS "--------------------cuda--------------------------") target_link_libraries(unit-test ${CUDA_LIBRARIES} ${CUDNN_LIBRARIES} ${CUDA_CUBLAS_LIBRARIES})
find_library(CUDA_nvrtc_LIBRARY nvrtc /usr/local/cuda/lib64)
target_link_libraries(unit-test ${CUDA_nvrtc_LIBRARY} ${CUDA_LIBRARIES} ${CUDNN_LIBRARIES} ${CUDA_CUBLAS_LIBRARIES})
endif() endif()
target_link_libraries(unit-test ngraph libgtest pthread) target_link_libraries(unit-test ngraph libgtest pthread)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment