Commit 070ea46c authored by Chris Sullivan's avatar Chris Sullivan Committed by Scott Cyphers

Add op::Sigmoid to nvgpu. (#1398)

parent 80514868
...@@ -61,6 +61,8 @@ namespace ngraph ...@@ -61,6 +61,8 @@ namespace ngraph
class And; class And;
class Or; class Or;
class Nop; class Nop;
class Sigmoid;
class SigmoidBackprop;
} }
namespace runtime namespace runtime
{ {
...@@ -363,6 +365,20 @@ namespace ngraph ...@@ -363,6 +365,20 @@ namespace ngraph
static constexpr const char* math_kernel = ""; static constexpr const char* math_kernel = "";
static constexpr const char* atomic = ""; static constexpr const char* atomic = "";
}; };
template <>
struct CudaOpMap<ngraph::op::Sigmoid>
{
static constexpr const char* op = "sigmoid";
static constexpr const char* math_kernel = "1 / (1 + expf(-x0))";
};
template <>
struct CudaOpMap<ngraph::op::SigmoidBackprop>
{
static constexpr const char* op = "sigmoid_backprop";
static constexpr const char* math_kernel = "x1 / (2 + expf(-x0) + expf(x0))";
};
} }
} }
} }
...@@ -88,6 +88,7 @@ ...@@ -88,6 +88,7 @@
#include "ngraph/op/reverse_sequence.hpp" #include "ngraph/op/reverse_sequence.hpp"
#include "ngraph/op/select.hpp" #include "ngraph/op/select.hpp"
#include "ngraph/op/select_and_scatter.hpp" #include "ngraph/op/select_and_scatter.hpp"
#include "ngraph/op/sigmoid.hpp"
#include "ngraph/op/sign.hpp" #include "ngraph/op/sign.hpp"
#include "ngraph/op/sin.hpp" #include "ngraph/op/sin.hpp"
#include "ngraph/op/sinh.hpp" #include "ngraph/op/sinh.hpp"
...@@ -236,6 +237,9 @@ static const runtime::gpu::OpMap dispatcher{ ...@@ -236,6 +237,9 @@ static const runtime::gpu::OpMap dispatcher{
{TI(ngraph::op::ReluBackprop), {TI(ngraph::op::ReluBackprop),
&runtime::gpu::GPU_Emitter::emit_elementwise<ngraph::op::ReluBackprop>}, &runtime::gpu::GPU_Emitter::emit_elementwise<ngraph::op::ReluBackprop>},
{TI(ngraph::op::Softmax), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Softmax>}, {TI(ngraph::op::Softmax), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Softmax>},
{TI(ngraph::op::Sigmoid), &runtime::gpu::GPU_Emitter::emit_elementwise<ngraph::op::Sigmoid>},
{TI(ngraph::op::SigmoidBackprop),
&runtime::gpu::GPU_Emitter::emit_elementwise<ngraph::op::SigmoidBackprop>},
{TI(ngraph::op::And), &runtime::gpu::GPU_Emitter::emit_elementwise<ngraph::op::And>}, {TI(ngraph::op::And), &runtime::gpu::GPU_Emitter::emit_elementwise<ngraph::op::And>},
{TI(ngraph::op::Or), &runtime::gpu::GPU_Emitter::emit_elementwise<ngraph::op::Or>}}; {TI(ngraph::op::Or), &runtime::gpu::GPU_Emitter::emit_elementwise<ngraph::op::Or>}};
......
...@@ -24,11 +24,6 @@ select_and_scatter_with_overlap ...@@ -24,11 +24,6 @@ select_and_scatter_with_overlap
select_and_scatter_without_overlap select_and_scatter_without_overlap
#custom_mem is not implemented on GPU #custom_mem is not implemented on GPU
tensorview_custom_mem tensorview_custom_mem
#sigmoid not implemented
sigmoid_n1c1h2w2
sigmoid_n1c1h4
sigmoid_bprop_n1c1h4
backwards_sigmoid
#integer is not supported by cuDNN on backward pooling #integer is not supported by cuDNN on backward pooling
backwards_maxpool_n4_c1_hw4_2x2_max backwards_maxpool_n4_c1_hw4_2x2_max
backwards_maxpool_n2_c1_hw5_3x3_str2_max backwards_maxpool_n2_c1_hw5_3x3_str2_max
......
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