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

cleanup code

parent 40fa0208
......@@ -37,10 +37,10 @@ runtime::gpu::GPU_CallFrame::GPU_CallFrame(std::shared_ptr<GPU_ExternalFunction>
throw runtime_error("cuBLAS create handle failed");
}
cudnnStatus_t cudnnStatus = cudnnCreate(&m_cudnn_handle);
if (cudnnStatus != CUDNN_STATUS_SUCCESS)
if (cudnnStatus != CUDNN_STATUS_SUCCESS)
{
throw runtime_error("cuDnn create handle failed");
}
}
// Pass scalars as reference on the Host
cublasSetPointerMode(m_cublas_handle, CUBLAS_POINTER_MODE_HOST);
......
......@@ -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>& out)
{
writer << "{ // " << n->get_name() << "\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";
writer << " // " << n->get_name() << "\n return;\n";
}
void runtime::gpu::GPU_Emitter::EmitAdd(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>& out)
{
writer << " // " << n->get_name() << "\n return;\n";
}
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>& out)
{
writer << " // " << n->get_name() << "\n return;\n";
}
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>& out)
{
writer << " // " << n->get_name() << "\n return;\n";
}
void runtime::gpu::GPU_Emitter::EmitGreaterEq(
......
......@@ -22,12 +22,6 @@
#include <typeindex>
#include <typeinfo>
#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/compiler.hpp"
#include "ngraph/codegen/execution_engine.hpp"
......@@ -255,11 +249,6 @@ void runtime::gpu::GPU_ExternalFunction::compile()
string pch_header_source = writer.get_code();
writer += R"(
using namespace ngraph;
using namespace std;
)";
if (m_emit_timing)
{
writer << "// Declare debug timers\n";
......
......@@ -79,7 +79,6 @@ if(NGRAPH_CPU_ENABLE AND LLVM_INCLUDE_DIR)
endif()
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})
link_directories(${LLVM_LIB_DIR})
link_directories(${CUDA_LIBRARIES})
......@@ -156,9 +155,7 @@ if(LLVM_INCLUDE_DIR)
endif()
if(CUDA_INCLUDE_DIRS)
message(STATUS "--------------------cuda--------------------------")
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})
target_link_libraries(unit-test ${CUDA_LIBRARIES} ${CUDNN_LIBRARIES} ${CUDA_CUBLAS_LIBRARIES})
endif()
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