Commit 3bbeaa31 authored by fenglei.tian's avatar fenglei.tian

clang format

parent e34a6b2b
...@@ -154,16 +154,10 @@ void runtime::gpu::GPU_Emitter::EmitDot(codegen::CodeWriter& writer, ...@@ -154,16 +154,10 @@ void runtime::gpu::GPU_Emitter::EmitDot(codegen::CodeWriter& writer,
auto& second = (arg0_shape.empty() ? args[1] : args[0]); auto& second = (arg0_shape.empty() ? args[1] : args[0]);
writer << "{ // " << n->get_name() << "\n"; writer << "{ // " << n->get_name() << "\n";
writer.indent++; writer.indent++;
// clang-format off writer << "cublasSdot("
writer << "cublasSdot(" << "cublas_handle," << second.get_size() << "," << first.get_name() << ","
<< "cublas_handle," << "1," << second.get_name() << ","
<< second.get_size() << "," << "1," << out[0].get_name() << ");\n";
<< first.get_name() << ","
<< "1,"
<< second.get_name() << ","
<< "1,"
<< out[0].get_name() << ");\n";
// clang-format on
writer.indent--; writer.indent--;
writer << "}\n"; writer << "}\n";
} }
...@@ -172,16 +166,10 @@ void runtime::gpu::GPU_Emitter::EmitDot(codegen::CodeWriter& writer, ...@@ -172,16 +166,10 @@ void runtime::gpu::GPU_Emitter::EmitDot(codegen::CodeWriter& writer,
{ {
writer << "{ // " << n->get_name() << "\n"; writer << "{ // " << n->get_name() << "\n";
writer.indent++; writer.indent++;
// clang-format off writer << "cublasSdot("
writer << "cublasSdot(" << "cublas_handle," << arg0_shape[0] << "," << args[0].get_name() << ","
<< "cublas_handle," << "1," << args[1].get_name() << ","
<< arg0_shape[0] << "," << "1," << out[0].get_name() << ");\n";
<< args[0].get_name() << ","
<< "1,"
<< args[1].get_name() << ","
<< "1,"
<< out[0].get_name() << ");\n";
// clang-format on
writer.indent--; writer.indent--;
writer << "}\n"; writer << "}\n";
} }
...@@ -193,22 +181,15 @@ void runtime::gpu::GPU_Emitter::EmitDot(codegen::CodeWriter& writer, ...@@ -193,22 +181,15 @@ void runtime::gpu::GPU_Emitter::EmitDot(codegen::CodeWriter& writer,
writer << "static const float beta = 1.0;\n"; writer << "static const float beta = 1.0;\n";
writer << "cublasSetPointerMode(cublas_handle, CUBLAS_POINTER_MODE_HOST);\n"; writer << "cublasSetPointerMode(cublas_handle, CUBLAS_POINTER_MODE_HOST);\n";
; ;
// clang-format off writer << "cublasSgemv("
writer << "cublasSgemv(" << "cublas_handle,"
<< "cublas_handle," << "CUBLAS_OP_T," << arg0_shape[0] << "," << arg0_shape[1] << ","
<< "CUBLAS_OP_T," << "&alpha," // Alpha
<< arg0_shape[0] << "," << args[0].get_name() << "," << arg0_shape[1] << "," << args[1].get_name() << ","
<< arg0_shape[1] << "," << "1,"
<< "&alpha," // Alpha << "&beta," // beta
<< args[0].get_name() << "," << out[0].get_name() << ","
<< arg0_shape[1] << "," << "1);\n";
<< args[1].get_name() << ","
<< "1,"
<< "&beta," // beta
<< out[0].get_name() << ","
<< "1);\n";
// clang-format on
;
writer.indent--; writer.indent--;
writer << "}\n"; writer << "}\n";
} }
...@@ -226,23 +207,20 @@ void runtime::gpu::GPU_Emitter::EmitDot(codegen::CodeWriter& writer, ...@@ -226,23 +207,20 @@ void runtime::gpu::GPU_Emitter::EmitDot(codegen::CodeWriter& writer,
writer << "int n = " << arg1_shape[1] << ";\n"; writer << "int n = " << arg1_shape[1] << ";\n";
writer << "int k = " << arg0_shape[0] << ";\n"; writer << "int k = " << arg0_shape[0] << ";\n";
writer << "cublasSetPointerMode(cublas_handle, CUBLAS_POINTER_MODE_HOST);\n"; writer << "cublasSetPointerMode(cublas_handle, CUBLAS_POINTER_MODE_HOST);\n";
// clang-format off writer << "cublasSgemm("
writer << "cublasSgemm(" << "cublas_handle,"
<< "cublas_handle," << "CUBLAS_OP_N,"
<< "CUBLAS_OP_N," << "CUBLAS_OP_N,"
<< "CUBLAS_OP_N," << "n,"
<< "n," << "m,"
<< "m," << "k,"
<< "k," << "&alpha," // Alpha
<< "&alpha," // Alpha << args[1].get_name() << ","
<< args[1].get_name() << "," << "n," << args[0].get_name() << ","
<< "n," << "k,"
<< args[0].get_name() << "," << "&beta," // beta
<< "k," << out[0].get_name() << ","
<< "&beta," // beta << "n);\n";
<< out[0].get_name() << ","
<< "n);\n";
// clang-format on
writer.indent--; writer.indent--;
writer << "}\n"; writer << "}\n";
} }
...@@ -522,92 +500,86 @@ void runtime::gpu::GPU_Emitter::EmitReshape(codegen::CodeWriter& writer, ...@@ -522,92 +500,86 @@ void runtime::gpu::GPU_Emitter::EmitReshape(codegen::CodeWriter& writer,
// If there *is* a layout change in the 2D case, we transpose the input. // If there *is* a layout change in the 2D case, we transpose the input.
else if (arg_rank == 2) else if (arg_rank == 2)
{ {
// clang-format off
// TODO Assert arg0_shape[0] == arg1_shape[0]? // TODO Assert arg0_shape[0] == arg1_shape[0]?
writer << "{ // " << n->get_name() << "\n"; writer << "{ // " << n->get_name() << "\n";
writer.indent++; writer.indent++;
writer << "static const float alpha = 1.0;\n"; writer << "static const float alpha = 1.0;\n";
writer << "static const float beta = 0.0;\n"; writer << "static const float beta = 0.0;\n";
writer << "cublasSetPointerMode(cublas_handle, CUBLAS_POINTER_MODE_HOST);\n";; writer << "cublasSetPointerMode(cublas_handle, CUBLAS_POINTER_MODE_HOST);\n";
;
writer << "cublasSgeam(" writer << "cublasSgeam("
<< "cublas_handle," << "cublas_handle,"
<< "CUBLAS_OP_T," << "CUBLAS_OP_T,"
<< "CUBLAS_OP_T," << "CUBLAS_OP_T," << arg_shape[0] << "," << arg_shape[1] << ","
<< arg_shape[0] << "," << "&alpha," // Alpha
<< arg_shape[1] << "," << args[0].get_name() << "," << arg_shape[1] << ","
<< "&alpha," // Alpha << "&beta," // beta
<< args[0].get_name() << "," << args[0].get_name() << "," << arg_shape[1] << "," << out[0].get_name() << ","
<< arg_shape[1] << "," << out[0].get_shape()[1] << ");\n";
<< "&beta," // beta
<< args[0].get_name() << ","
<< arg_shape[1] << ","
<< out[0].get_name() << ","
<< out[0].get_shape()[1] << ");\n";
writer.indent--; writer.indent--;
writer << "}\n"; writer << "}\n";
//clang-format on
} }
// Other cases (reordering of axes for tensors with rank>2) are not handled yet. // Other cases (reordering of axes for tensors with rank>2) are not handled yet.
else else
{ {
throw ngraph_error( throw ngraph_error(
"Axis permutation in reshape is not implemented yet for tensors with rank>2"); "Axis permutation in reshape is not implemented yet for tensors with rank>2");
} }
writer.indent--; writer.indent--;
writer << "}\n"; writer << "}\n";
} }
void runtime::gpu::GPU_Emitter::EmitFunctionCall( void runtime::gpu::GPU_Emitter::EmitFunctionCall(
codegen::CodeWriter& writer, codegen::CodeWriter& writer,
const ngraph::Node* n, const ngraph::Node* n,
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)
{ {
} }
void runtime::gpu::GPU_Emitter::EmitReduce(codegen::CodeWriter& writer, void runtime::gpu::GPU_Emitter::EmitReduce(codegen::CodeWriter& writer,
const ngraph::Node* n, const ngraph::Node* n,
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"; writer << " // " << n->get_name() << "\n return;\n";
} }
void runtime::gpu::GPU_Emitter::EmitSign(codegen::CodeWriter& writer, void runtime::gpu::GPU_Emitter::EmitSign(codegen::CodeWriter& writer,
const ngraph::Node* n, const ngraph::Node* n,
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"; writer << " // " << n->get_name() << "\n return;\n";
} }
void runtime::gpu::GPU_Emitter::EmitSlice(codegen::CodeWriter& writer, void runtime::gpu::GPU_Emitter::EmitSlice(codegen::CodeWriter& writer,
const ngraph::Node* n, const ngraph::Node* n,
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"; writer << " // " << n->get_name() << "\n return;\n";
} }
void runtime::gpu::GPU_Emitter::EmitSum(codegen::CodeWriter& writer, void runtime::gpu::GPU_Emitter::EmitSum(codegen::CodeWriter& writer,
const ngraph::Node* n, const ngraph::Node* n,
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"; writer << " // " << n->get_name() << "\n return;\n";
} }
void runtime::gpu::GPU_Emitter::EmitMultiply( void runtime::gpu::GPU_Emitter::EmitMultiply(
codegen::CodeWriter& writer, codegen::CodeWriter& writer,
const ngraph::Node* n, const ngraph::Node* n,
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";
writer.indent++; writer.indent++;
writer << "int count = " << out[0].get_size() << ";\n"; writer << "int count = " << out[0].get_size() << ";\n";
writer << "if(count == 0) return;\n"; writer << "if(count == 0) return;\n";
writer += R"( writer += R"(
float alpha1 = 1.0, alpha2 = 1.0, beta = 0; float alpha1 = 1.0, alpha2 = 1.0, beta = 0;
cudnnTensorDescriptor_t descriptor; cudnnTensorDescriptor_t descriptor;
cudnnCreateTensorDescriptor(&descriptor); cudnnCreateTensorDescriptor(&descriptor);
...@@ -627,153 +599,149 @@ cudnnSetOpTensorDescriptor(opTensorDesc, ...@@ -627,153 +599,149 @@ cudnnSetOpTensorDescriptor(opTensorDesc,
CUDNN_NOT_PROPAGATE_NAN); CUDNN_NOT_PROPAGATE_NAN);
)"; )";
writer << "cudnnOpTensor(cudnn_handle," writer << "cudnnOpTensor(cudnn_handle,"
<< "opTensorDesc," << "opTensorDesc,"
<< "&alpha1," << "&alpha1,"
<< "descriptor," << "descriptor," << args[0].get_name() << ","
<< args[0].get_name() << "," << "&alpha2,"
<< "&alpha2," << "descriptor," << args[1].get_name() << ","
<< "descriptor," << "&beta,"
<< args[1].get_name() << "," << "descriptor," << out[0].get_name() << ");\n";
<< "&beta,"
<< "descriptor,"
<< out[0].get_name() << ");\n";
writer.indent--; writer.indent--;
writer << "}\n"; writer << "}\n";
} }
void runtime::gpu::GPU_Emitter::EmitExp(codegen::CodeWriter& writer, void runtime::gpu::GPU_Emitter::EmitExp(codegen::CodeWriter& writer,
const ngraph::Node* n, const ngraph::Node* n,
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"; writer << " // " << n->get_name() << "\n return;\n";
} }
void runtime::gpu::GPU_Emitter::EmitSin(codegen::CodeWriter& writer, void runtime::gpu::GPU_Emitter::EmitSin(codegen::CodeWriter& writer,
const ngraph::Node* n, const ngraph::Node* n,
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"; writer << " // " << n->get_name() << "\n return;\n";
} }
void runtime::gpu::GPU_Emitter::EmitSinh(codegen::CodeWriter& writer, void runtime::gpu::GPU_Emitter::EmitSinh(codegen::CodeWriter& writer,
const ngraph::Node* n, const ngraph::Node* n,
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"; writer << " // " << n->get_name() << "\n return;\n";
} }
void runtime::gpu::GPU_Emitter::EmitCos(codegen::CodeWriter& writer, void runtime::gpu::GPU_Emitter::EmitCos(codegen::CodeWriter& writer,
const ngraph::Node* n, const ngraph::Node* n,
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"; writer << " // " << n->get_name() << "\n return;\n";
} }
void runtime::gpu::GPU_Emitter::EmitCosh(codegen::CodeWriter& writer, void runtime::gpu::GPU_Emitter::EmitCosh(codegen::CodeWriter& writer,
const ngraph::Node* n, const ngraph::Node* n,
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"; writer << " // " << n->get_name() << "\n return;\n";
} }
void runtime::gpu::GPU_Emitter::EmitTan(codegen::CodeWriter& writer, void runtime::gpu::GPU_Emitter::EmitTan(codegen::CodeWriter& writer,
const ngraph::Node* n, const ngraph::Node* n,
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"; writer << " // " << n->get_name() << "\n return;\n";
} }
void runtime::gpu::GPU_Emitter::EmitTanh(codegen::CodeWriter& writer, void runtime::gpu::GPU_Emitter::EmitTanh(codegen::CodeWriter& writer,
const ngraph::Node* n, const ngraph::Node* n,
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"; writer << " // " << n->get_name() << "\n return;\n";
} }
void runtime::gpu::GPU_Emitter::EmitAsin(codegen::CodeWriter& writer, void runtime::gpu::GPU_Emitter::EmitAsin(codegen::CodeWriter& writer,
const ngraph::Node* n, const ngraph::Node* n,
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"; writer << " // " << n->get_name() << "\n return;\n";
} }
void runtime::gpu::GPU_Emitter::EmitAcos(codegen::CodeWriter& writer, void runtime::gpu::GPU_Emitter::EmitAcos(codegen::CodeWriter& writer,
const ngraph::Node* n, const ngraph::Node* n,
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"; writer << " // " << n->get_name() << "\n return;\n";
} }
void runtime::gpu::GPU_Emitter::EmitAtan(codegen::CodeWriter& writer, void runtime::gpu::GPU_Emitter::EmitAtan(codegen::CodeWriter& writer,
const ngraph::Node* n, const ngraph::Node* n,
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"; writer << " // " << n->get_name() << "\n return;\n";
} }
void runtime::gpu::GPU_Emitter::EmitPower(codegen::CodeWriter& writer, void runtime::gpu::GPU_Emitter::EmitPower(codegen::CodeWriter& writer,
const ngraph::Node* n, const ngraph::Node* n,
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"; writer << " // " << n->get_name() << "\n return;\n";
} }
void runtime::gpu::GPU_Emitter::EmitReplaceSlice( void runtime::gpu::GPU_Emitter::EmitReplaceSlice(
codegen::CodeWriter& writer, codegen::CodeWriter& writer,
const ngraph::Node* n, const ngraph::Node* n,
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"; writer << " // " << n->get_name() << "\n return;\n";
} }
void runtime::gpu::GPU_Emitter::EmitOneHot(codegen::CodeWriter& writer, void runtime::gpu::GPU_Emitter::EmitOneHot(codegen::CodeWriter& writer,
const ngraph::Node* n, const ngraph::Node* n,
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"; writer << " // " << n->get_name() << "\n return;\n";
} }
void runtime::gpu::GPU_Emitter::EmitCeiling(codegen::CodeWriter& writer, void runtime::gpu::GPU_Emitter::EmitCeiling(codegen::CodeWriter& writer,
const ngraph::Node* n, const ngraph::Node* n,
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"; writer << " // " << n->get_name() << "\n return;\n";
} }
void runtime::gpu::GPU_Emitter::EmitFloor(codegen::CodeWriter& writer, void runtime::gpu::GPU_Emitter::EmitFloor(codegen::CodeWriter& writer,
const ngraph::Node* n, const ngraph::Node* n,
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"; writer << " // " << n->get_name() << "\n return;\n";
} }
void runtime::gpu::GPU_Emitter::EmitSqrt(codegen::CodeWriter& writer, void runtime::gpu::GPU_Emitter::EmitSqrt(codegen::CodeWriter& writer,
const ngraph::Node* n, const ngraph::Node* n,
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";
writer.indent++; writer.indent++;
writer << "int count = " << out[0].get_size() << ";\n"; writer << "int count = " << out[0].get_size() << ";\n";
writer << "if(count == 0) return;\n"; writer << "if(count == 0) return;\n";
writer += R"( writer += R"(
float alpha1 = 1.0, alpha2 = 0, beta = 0; float alpha1 = 1.0, alpha2 = 0, beta = 0;
cudnnTensorDescriptor_t descriptor; cudnnTensorDescriptor_t descriptor;
cudnnCreateTensorDescriptor(&descriptor); cudnnCreateTensorDescriptor(&descriptor);
...@@ -793,68 +761,65 @@ cudnnSetOpTensorDescriptor(opTensorDesc, ...@@ -793,68 +761,65 @@ cudnnSetOpTensorDescriptor(opTensorDesc,
CUDNN_NOT_PROPAGATE_NAN); CUDNN_NOT_PROPAGATE_NAN);
)"; )";
writer << "cudnnOpTensor(cudnn_handle," writer << "cudnnOpTensor(cudnn_handle,"
<< "opTensorDesc," << "opTensorDesc,"
<< "&alpha1," << "&alpha1,"
<< "descriptor," << "descriptor," << args[0].get_name() << ","
<< args[0].get_name() << "," << "&alpha2,"
<< "&alpha2," << "descriptor," << args[0].get_name() << ","
<< "descriptor," << "&beta,"
<< args[0].get_name() << "," << "descriptor," << out[0].get_name() << ");\n";
<< "&beta,"
<< "descriptor,"
<< out[0].get_name() << ");\n";
writer.indent--; writer.indent--;
writer << "}\n"; writer << "}\n";
} }
void runtime::gpu::GPU_Emitter::EmitConvolution( void runtime::gpu::GPU_Emitter::EmitConvolution(
codegen::CodeWriter& writer, codegen::CodeWriter& writer,
const ngraph::Node* n, const ngraph::Node* n,
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"; writer << " // " << n->get_name() << "\n return;\n";
} }
void runtime::gpu::GPU_Emitter::EmitNot(codegen::CodeWriter& writer, void runtime::gpu::GPU_Emitter::EmitNot(codegen::CodeWriter& writer,
const ngraph::Node* n, const ngraph::Node* n,
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"; writer << " // " << n->get_name() << "\n return;\n";
} }
void runtime::gpu::GPU_Emitter::EmitMaxPool(codegen::CodeWriter& writer, void runtime::gpu::GPU_Emitter::EmitMaxPool(codegen::CodeWriter& writer,
const ngraph::Node* n, const ngraph::Node* n,
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"; writer << " // " << n->get_name() << "\n return;\n";
} }
void runtime::gpu::GPU_Emitter::EmitReverse(codegen::CodeWriter& writer, void runtime::gpu::GPU_Emitter::EmitReverse(codegen::CodeWriter& writer,
const ngraph::Node* n, const ngraph::Node* n,
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"; writer << " // " << n->get_name() << "\n return;\n";
} }
void runtime::gpu::GPU_Emitter::EmitReduceWindow( void runtime::gpu::GPU_Emitter::EmitReduceWindow(
codegen::CodeWriter& writer, codegen::CodeWriter& writer,
const ngraph::Node* n, const ngraph::Node* n,
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"; writer << " // " << n->get_name() << "\n return;\n";
} }
void runtime::gpu::GPU_Emitter::EmitSelectAndScatter( void runtime::gpu::GPU_Emitter::EmitSelectAndScatter(
codegen::CodeWriter& writer, codegen::CodeWriter& writer,
const ngraph::Node* n, const ngraph::Node* n,
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"; writer << " // " << n->get_name() << "\n return;\n";
} }
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