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
8aaebcb5
Commit
8aaebcb5
authored
Nov 29, 2017
by
Adam Procter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
De-Eigenize remaining unops
parent
6a0a0a32
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
720 additions
and
114 deletions
+720
-114
asin.hpp
src/ngraph/runtime/kernel/asin.hpp
+35
-0
atan.hpp
src/ngraph/runtime/kernel/atan.hpp
+35
-0
ceiling.hpp
src/ngraph/runtime/kernel/ceiling.hpp
+35
-0
cos.hpp
src/ngraph/runtime/kernel/cos.hpp
+35
-0
cosh.hpp
src/ngraph/runtime/kernel/cosh.hpp
+35
-0
exp.hpp
src/ngraph/runtime/kernel/exp.hpp
+35
-0
floor.hpp
src/ngraph/runtime/kernel/floor.hpp
+35
-0
log.hpp
src/ngraph/runtime/kernel/log.hpp
+35
-0
negate.hpp
src/ngraph/runtime/kernel/negate.hpp
+35
-0
sign.hpp
src/ngraph/runtime/kernel/sign.hpp
+35
-0
sin.hpp
src/ngraph/runtime/kernel/sin.hpp
+35
-0
sinh.hpp
src/ngraph/runtime/kernel/sinh.hpp
+35
-0
sqrt.hpp
src/ngraph/runtime/kernel/sqrt.hpp
+35
-0
tan.hpp
src/ngraph/runtime/kernel/tan.hpp
+35
-0
tanh.hpp
src/ngraph/runtime/kernel/tanh.hpp
+35
-0
external_function.cpp
src/ngraph/runtime/ngvm/external_function.cpp
+30
-30
asin.hpp
src/ngraph/runtime/ngvm/instruction/asin.hpp
+11
-6
atan.hpp
src/ngraph/runtime/ngvm/instruction/atan.hpp
+11
-6
ceiling.hpp
src/ngraph/runtime/ngvm/instruction/ceiling.hpp
+11
-6
cos.hpp
src/ngraph/runtime/ngvm/instruction/cos.hpp
+11
-6
cosh.hpp
src/ngraph/runtime/ngvm/instruction/cosh.hpp
+11
-6
exp.hpp
src/ngraph/runtime/ngvm/instruction/exp.hpp
+11
-5
floor.hpp
src/ngraph/runtime/ngvm/instruction/floor.hpp
+11
-6
log.hpp
src/ngraph/runtime/ngvm/instruction/log.hpp
+11
-5
negate.hpp
src/ngraph/runtime/ngvm/instruction/negate.hpp
+11
-4
sign.hpp
src/ngraph/runtime/ngvm/instruction/sign.hpp
+11
-5
sin.hpp
src/ngraph/runtime/ngvm/instruction/sin.hpp
+11
-5
sinh.hpp
src/ngraph/runtime/ngvm/instruction/sinh.hpp
+11
-6
sqrt.hpp
src/ngraph/runtime/ngvm/instruction/sqrt.hpp
+11
-6
tan.hpp
src/ngraph/runtime/ngvm/instruction/tan.hpp
+11
-6
tanh.hpp
src/ngraph/runtime/ngvm/instruction/tanh.hpp
+11
-6
No files found.
src/ngraph/runtime/kernel/asin.hpp
0 → 100644
View file @
8aaebcb5
// ----------------------------------------------------------------------------
// Copyright 2017 Nervana Systems Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// ----------------------------------------------------------------------------
#pragma once
#include <cmath>
namespace
ngraph
{
namespace
runtime
{
namespace
kernel
{
template
<
typename
T
>
void
asin
(
T
*
arg
,
T
*
out
,
size_t
count
)
{
for
(
size_t
i
=
0
;
i
<
count
;
i
++
)
{
out
[
i
]
=
std
::
asin
(
arg
[
i
]);
}
}
}
}
}
src/ngraph/runtime/kernel/atan.hpp
0 → 100644
View file @
8aaebcb5
// ----------------------------------------------------------------------------
// Copyright 2017 Nervana Systems Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// ----------------------------------------------------------------------------
#pragma once
#include <cmath>
namespace
ngraph
{
namespace
runtime
{
namespace
kernel
{
template
<
typename
T
>
void
atan
(
T
*
arg
,
T
*
out
,
size_t
count
)
{
for
(
size_t
i
=
0
;
i
<
count
;
i
++
)
{
out
[
i
]
=
std
::
atan
(
arg
[
i
]);
}
}
}
}
}
src/ngraph/runtime/kernel/ceiling.hpp
0 → 100644
View file @
8aaebcb5
// ----------------------------------------------------------------------------
// Copyright 2017 Nervana Systems Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// ----------------------------------------------------------------------------
#pragma once
#include <cmath>
namespace
ngraph
{
namespace
runtime
{
namespace
kernel
{
template
<
typename
T
>
void
ceiling
(
T
*
arg
,
T
*
out
,
size_t
count
)
{
for
(
size_t
i
=
0
;
i
<
count
;
i
++
)
{
out
[
i
]
=
std
::
ceil
(
arg
[
i
]);
}
}
}
}
}
src/ngraph/runtime/kernel/cos.hpp
0 → 100644
View file @
8aaebcb5
// ----------------------------------------------------------------------------
// Copyright 2017 Nervana Systems Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// ----------------------------------------------------------------------------
#pragma once
#include <cmath>
namespace
ngraph
{
namespace
runtime
{
namespace
kernel
{
template
<
typename
T
>
void
cos
(
T
*
arg
,
T
*
out
,
size_t
count
)
{
for
(
size_t
i
=
0
;
i
<
count
;
i
++
)
{
out
[
i
]
=
std
::
cos
(
arg
[
i
]);
}
}
}
}
}
src/ngraph/runtime/kernel/cosh.hpp
0 → 100644
View file @
8aaebcb5
// ----------------------------------------------------------------------------
// Copyright 2017 Nervana Systems Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// ----------------------------------------------------------------------------
#pragma once
#include <cmath>
namespace
ngraph
{
namespace
runtime
{
namespace
kernel
{
template
<
typename
T
>
void
cosh
(
T
*
arg
,
T
*
out
,
size_t
count
)
{
for
(
size_t
i
=
0
;
i
<
count
;
i
++
)
{
out
[
i
]
=
std
::
cosh
(
arg
[
i
]);
}
}
}
}
}
src/ngraph/runtime/kernel/exp.hpp
0 → 100644
View file @
8aaebcb5
// ----------------------------------------------------------------------------
// Copyright 2017 Nervana Systems Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// ----------------------------------------------------------------------------
#pragma once
#include <cmath>
namespace
ngraph
{
namespace
runtime
{
namespace
kernel
{
template
<
typename
T
>
void
exp
(
T
*
arg
,
T
*
out
,
size_t
count
)
{
for
(
size_t
i
=
0
;
i
<
count
;
i
++
)
{
out
[
i
]
=
std
::
exp
(
arg
[
i
]);
}
}
}
}
}
src/ngraph/runtime/kernel/floor.hpp
0 → 100644
View file @
8aaebcb5
// ----------------------------------------------------------------------------
// Copyright 2017 Nervana Systems Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// ----------------------------------------------------------------------------
#pragma once
#include <cmath>
namespace
ngraph
{
namespace
runtime
{
namespace
kernel
{
template
<
typename
T
>
void
floor
(
T
*
arg
,
T
*
out
,
size_t
count
)
{
for
(
size_t
i
=
0
;
i
<
count
;
i
++
)
{
out
[
i
]
=
std
::
floor
(
arg
[
i
]);
}
}
}
}
}
src/ngraph/runtime/kernel/log.hpp
0 → 100644
View file @
8aaebcb5
// ----------------------------------------------------------------------------
// Copyright 2017 Nervana Systems Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// ----------------------------------------------------------------------------
#pragma once
#include <cmath>
namespace
ngraph
{
namespace
runtime
{
namespace
kernel
{
template
<
typename
T
>
void
log
(
T
*
arg
,
T
*
out
,
size_t
count
)
{
for
(
size_t
i
=
0
;
i
<
count
;
i
++
)
{
out
[
i
]
=
std
::
log
(
arg
[
i
]);
}
}
}
}
}
src/ngraph/runtime/kernel/negate.hpp
0 → 100644
View file @
8aaebcb5
// ----------------------------------------------------------------------------
// Copyright 2017 Nervana Systems Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// ----------------------------------------------------------------------------
#pragma once
#include <cmath>
namespace
ngraph
{
namespace
runtime
{
namespace
kernel
{
template
<
typename
T
>
void
negate
(
T
*
arg
,
T
*
out
,
size_t
count
)
{
for
(
size_t
i
=
0
;
i
<
count
;
i
++
)
{
out
[
i
]
=
-
arg
[
i
];
}
}
}
}
}
src/ngraph/runtime/kernel/sign.hpp
0 → 100644
View file @
8aaebcb5
// ----------------------------------------------------------------------------
// Copyright 2017 Nervana Systems Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// ----------------------------------------------------------------------------
#pragma once
#include <cmath>
namespace
ngraph
{
namespace
runtime
{
namespace
kernel
{
template
<
typename
T
>
void
sign
(
T
*
arg
,
T
*
out
,
size_t
count
)
{
for
(
size_t
i
=
0
;
i
<
count
;
i
++
)
{
out
[
i
]
=
(
arg
[
i
]
<
0
?
-
1
:
(
arg
[
i
]
>
0
?
1
:
0
));
}
}
}
}
}
src/ngraph/runtime/kernel/sin.hpp
0 → 100644
View file @
8aaebcb5
// ----------------------------------------------------------------------------
// Copyright 2017 Nervana Systems Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// ----------------------------------------------------------------------------
#pragma once
#include <cmath>
namespace
ngraph
{
namespace
runtime
{
namespace
kernel
{
template
<
typename
T
>
void
sin
(
T
*
arg
,
T
*
out
,
size_t
count
)
{
for
(
size_t
i
=
0
;
i
<
count
;
i
++
)
{
out
[
i
]
=
std
::
sin
(
arg
[
i
]);
}
}
}
}
}
src/ngraph/runtime/kernel/sinh.hpp
0 → 100644
View file @
8aaebcb5
// ----------------------------------------------------------------------------
// Copyright 2017 Nervana Systems Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// ----------------------------------------------------------------------------
#pragma once
#include <cmath>
namespace
ngraph
{
namespace
runtime
{
namespace
kernel
{
template
<
typename
T
>
void
sinh
(
T
*
arg
,
T
*
out
,
size_t
count
)
{
for
(
size_t
i
=
0
;
i
<
count
;
i
++
)
{
out
[
i
]
=
std
::
sinh
(
arg
[
i
]);
}
}
}
}
}
src/ngraph/runtime/kernel/sqrt.hpp
0 → 100644
View file @
8aaebcb5
// ----------------------------------------------------------------------------
// Copyright 2017 Nervana Systems Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// ----------------------------------------------------------------------------
#pragma once
#include <cmath>
namespace
ngraph
{
namespace
runtime
{
namespace
kernel
{
template
<
typename
T
>
void
sqrt
(
T
*
arg
,
T
*
out
,
size_t
count
)
{
for
(
size_t
i
=
0
;
i
<
count
;
i
++
)
{
out
[
i
]
=
std
::
sqrt
(
arg
[
i
]);
}
}
}
}
}
src/ngraph/runtime/kernel/tan.hpp
0 → 100644
View file @
8aaebcb5
// ----------------------------------------------------------------------------
// Copyright 2017 Nervana Systems Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// ----------------------------------------------------------------------------
#pragma once
#include <cmath>
namespace
ngraph
{
namespace
runtime
{
namespace
kernel
{
template
<
typename
T
>
void
tan
(
T
*
arg
,
T
*
out
,
size_t
count
)
{
for
(
size_t
i
=
0
;
i
<
count
;
i
++
)
{
out
[
i
]
=
std
::
tan
(
arg
[
i
]);
}
}
}
}
}
src/ngraph/runtime/kernel/tanh.hpp
0 → 100644
View file @
8aaebcb5
// ----------------------------------------------------------------------------
// Copyright 2017 Nervana Systems Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// ----------------------------------------------------------------------------
#pragma once
#include <cmath>
namespace
ngraph
{
namespace
runtime
{
namespace
kernel
{
template
<
typename
T
>
void
tanh
(
T
*
arg
,
T
*
out
,
size_t
count
)
{
for
(
size_t
i
=
0
;
i
<
count
;
i
++
)
{
out
[
i
]
=
std
::
tanh
(
arg
[
i
]);
}
}
}
}
}
src/ngraph/runtime/ngvm/external_function.cpp
View file @
8aaebcb5
...
...
@@ -73,30 +73,30 @@
#include "ngraph/runtime/ngvm/eigen/abs.hpp"
#include "ngraph/runtime/ngvm/instruction/acos.hpp"
#include "ngraph/runtime/ngvm/instruction/add.hpp"
#include "ngraph/runtime/ngvm/
eige
n/asin.hpp"
#include "ngraph/runtime/ngvm/
eige
n/atan.hpp"
#include "ngraph/runtime/ngvm/
instructio
n/asin.hpp"
#include "ngraph/runtime/ngvm/
instructio
n/atan.hpp"
#include "ngraph/runtime/ngvm/eigen/broadcast_scalar.hpp"
#include "ngraph/runtime/ngvm/eigen/broadcast_vector_colwise.hpp"
#include "ngraph/runtime/ngvm/eigen/broadcast_vector_rowwise.hpp"
#include "ngraph/runtime/ngvm/eigen/call.hpp"
#include "ngraph/runtime/ngvm/
eige
n/ceiling.hpp"
#include "ngraph/runtime/ngvm/
instructio
n/ceiling.hpp"
#include "ngraph/runtime/ngvm/eigen/concat_matrix.hpp"
#include "ngraph/runtime/ngvm/eigen/concat_vector.hpp"
#include "ngraph/runtime/ngvm/eigen/constant.hpp"
#include "ngraph/runtime/ngvm/eigen/convert.hpp"
#include "ngraph/runtime/ngvm/eigen/copy.hpp"
#include "ngraph/runtime/ngvm/
eige
n/cos.hpp"
#include "ngraph/runtime/ngvm/
eige
n/cosh.hpp"
#include "ngraph/runtime/ngvm/
instructio
n/cos.hpp"
#include "ngraph/runtime/ngvm/
instructio
n/cosh.hpp"
#include "ngraph/runtime/ngvm/eigen/divide.hpp"
#include "ngraph/runtime/ngvm/eigen/dot.hpp"
#include "ngraph/runtime/ngvm/eigen/equal.hpp"
#include "ngraph/runtime/ngvm/
eige
n/exp.hpp"
#include "ngraph/runtime/ngvm/
eige
n/floor.hpp"
#include "ngraph/runtime/ngvm/
instructio
n/exp.hpp"
#include "ngraph/runtime/ngvm/
instructio
n/floor.hpp"
#include "ngraph/runtime/ngvm/eigen/greater_eq.hpp"
#include "ngraph/runtime/ngvm/eigen/greater_than.hpp"
#include "ngraph/runtime/ngvm/eigen/less_eq.hpp"
#include "ngraph/runtime/ngvm/eigen/less_than.hpp"
#include "ngraph/runtime/ngvm/
eige
n/log.hpp"
#include "ngraph/runtime/ngvm/
instructio
n/log.hpp"
#include "ngraph/runtime/ngvm/eigen/matrix_mult.hpp"
#include "ngraph/runtime/ngvm/eigen/matrix_slice.hpp"
#include "ngraph/runtime/ngvm/eigen/matrix_transpose.hpp"
...
...
@@ -104,7 +104,7 @@
#include "ngraph/runtime/ngvm/eigen/maximum.hpp"
#include "ngraph/runtime/ngvm/eigen/minimum.hpp"
#include "ngraph/runtime/ngvm/eigen/multiply.hpp"
#include "ngraph/runtime/ngvm/
eige
n/negate.hpp"
#include "ngraph/runtime/ngvm/
instructio
n/negate.hpp"
#include "ngraph/runtime/ngvm/eigen/not.hpp"
#include "ngraph/runtime/ngvm/eigen/not_equal.hpp"
#include "ngraph/runtime/ngvm/eigen/power.hpp"
...
...
@@ -116,16 +116,16 @@
#include "ngraph/runtime/ngvm/eigen/return.hpp"
#include "ngraph/runtime/ngvm/eigen/scalar_tensor_product.hpp"
#include "ngraph/runtime/ngvm/eigen/select.hpp"
#include "ngraph/runtime/ngvm/
eige
n/sign.hpp"
#include "ngraph/runtime/ngvm/
eige
n/sin.hpp"
#include "ngraph/runtime/ngvm/
eige
n/sinh.hpp"
#include "ngraph/runtime/ngvm/
eige
n/sqrt.hpp"
#include "ngraph/runtime/ngvm/
instructio
n/sign.hpp"
#include "ngraph/runtime/ngvm/
instructio
n/sin.hpp"
#include "ngraph/runtime/ngvm/
instructio
n/sinh.hpp"
#include "ngraph/runtime/ngvm/
instructio
n/sqrt.hpp"
#include "ngraph/runtime/ngvm/eigen/subtract.hpp"
#include "ngraph/runtime/ngvm/eigen/sum_matrix_columns.hpp"
#include "ngraph/runtime/ngvm/eigen/sum_matrix_rows.hpp"
#include "ngraph/runtime/ngvm/eigen/sum_to_scalar.hpp"
#include "ngraph/runtime/ngvm/
eige
n/tan.hpp"
#include "ngraph/runtime/ngvm/
eige
n/tanh.hpp"
#include "ngraph/runtime/ngvm/
instructio
n/tan.hpp"
#include "ngraph/runtime/ngvm/
instructio
n/tanh.hpp"
#include "ngraph/runtime/ngvm/eigen/vector_slice.hpp"
#include "ngraph/runtime/ngvm/external_function.hpp"
#include "ngraph/runtime/utils.hpp"
...
...
@@ -389,21 +389,21 @@ ExternalFunction::OpMap& ExternalFunction::get_op_map()
if
(
!
initialized
)
{
REGISTER_NUMERIC_UNOP
(
op
::
Acos
,
instruction
::
AcosInstruction
);
REGISTER_NUMERIC_UNOP
(
op
::
Asin
,
eige
n
::
AsinInstruction
);
REGISTER_NUMERIC_UNOP
(
op
::
Atan
,
eige
n
::
AtanInstruction
);
REGISTER_NUMERIC_UNOP
(
op
::
Ceiling
,
eige
n
::
CeilingInstruction
);
REGISTER_NUMERIC_UNOP
(
op
::
Cos
,
eige
n
::
CosInstruction
);
REGISTER_NUMERIC_UNOP
(
op
::
Cosh
,
eige
n
::
CoshInstruction
);
REGISTER_NUMERIC_UNOP
(
op
::
Exp
,
eige
n
::
ExpInstruction
);
REGISTER_NUMERIC_UNOP
(
op
::
Floor
,
eige
n
::
FloorInstruction
);
REGISTER_NUMERIC_UNOP
(
op
::
Log
,
eige
n
::
LogInstruction
);
REGISTER_NUMERIC_UNOP
(
op
::
Negative
,
eige
n
::
NegateInstruction
);
REGISTER_NUMERIC_UNOP
(
op
::
Sign
,
eige
n
::
SignInstruction
);
REGISTER_NUMERIC_UNOP
(
op
::
Sin
,
eige
n
::
SinInstruction
);
REGISTER_NUMERIC_UNOP
(
op
::
Sinh
,
eige
n
::
SinhInstruction
);
REGISTER_NUMERIC_UNOP
(
op
::
Sqrt
,
eige
n
::
SqrtInstruction
);
REGISTER_NUMERIC_UNOP
(
op
::
Tan
,
eige
n
::
TanInstruction
);
REGISTER_NUMERIC_UNOP
(
op
::
Tanh
,
eige
n
::
TanhInstruction
);
REGISTER_NUMERIC_UNOP
(
op
::
Asin
,
instructio
n
::
AsinInstruction
);
REGISTER_NUMERIC_UNOP
(
op
::
Atan
,
instructio
n
::
AtanInstruction
);
REGISTER_NUMERIC_UNOP
(
op
::
Ceiling
,
instructio
n
::
CeilingInstruction
);
REGISTER_NUMERIC_UNOP
(
op
::
Cos
,
instructio
n
::
CosInstruction
);
REGISTER_NUMERIC_UNOP
(
op
::
Cosh
,
instructio
n
::
CoshInstruction
);
REGISTER_NUMERIC_UNOP
(
op
::
Exp
,
instructio
n
::
ExpInstruction
);
REGISTER_NUMERIC_UNOP
(
op
::
Floor
,
instructio
n
::
FloorInstruction
);
REGISTER_NUMERIC_UNOP
(
op
::
Log
,
instructio
n
::
LogInstruction
);
REGISTER_NUMERIC_UNOP
(
op
::
Negative
,
instructio
n
::
NegateInstruction
);
REGISTER_NUMERIC_UNOP
(
op
::
Sign
,
instructio
n
::
SignInstruction
);
REGISTER_NUMERIC_UNOP
(
op
::
Sin
,
instructio
n
::
SinInstruction
);
REGISTER_NUMERIC_UNOP
(
op
::
Sinh
,
instructio
n
::
SinhInstruction
);
REGISTER_NUMERIC_UNOP
(
op
::
Sqrt
,
instructio
n
::
SqrtInstruction
);
REGISTER_NUMERIC_UNOP
(
op
::
Tan
,
instructio
n
::
TanInstruction
);
REGISTER_NUMERIC_UNOP
(
op
::
Tanh
,
instructio
n
::
TanhInstruction
);
REGISTER_SIGNED_NUMERIC_UNOP
(
op
::
Abs
,
eigen
::
AbsInstruction
);
...
...
src/ngraph/runtime/ngvm/
eige
n/asin.hpp
→
src/ngraph/runtime/ngvm/
instructio
n/asin.hpp
View file @
8aaebcb5
// ----------------------------------------------------------------------------
// Copyright 2017 Nervana Systems Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
...
...
@@ -15,8 +14,9 @@
#pragma once
#include "ngraph/runtime/kernel/asin.hpp"
#include "ngraph/runtime/ngvm/call_frame.hpp"
#include "ngraph/runtime/ngvm/
eigen/
utils.hpp"
#include "ngraph/runtime/ngvm/utils.hpp"
#include "ngraph/runtime/ngvm/instruction.hpp"
#include "ngraph/runtime/tensor_view.hpp"
...
...
@@ -26,13 +26,14 @@ namespace ngraph
{
namespace
ngvm
{
namespace
eige
n
namespace
instructio
n
{
template
<
typename
ET
>
class
AsinInstruction
:
public
Instruction
{
public
:
AsinInstruction
(
TensorViewInfo
arg
,
TensorViewInfo
out
)
AsinInstruction
(
const
TensorViewInfo
&
arg
,
const
TensorViewInfo
&
out
)
:
m_arg
(
arg
)
,
m_out
(
out
)
{
...
...
@@ -40,8 +41,12 @@ namespace ngraph
virtual
void
execute
(
CallFrame
&
call_frame
)
const
override
{
EigenArray1d
<
ET
,
fmt
::
V
>
(
call_frame
,
m_out
)
=
EigenArray1d
<
ET
,
fmt
::
V
>
(
call_frame
,
m_arg
).
asin
();
typename
ET
::
type
*
arg
=
get_tensor_data_ptr
<
ET
>
(
call_frame
,
m_arg
);
typename
ET
::
type
*
out
=
get_tensor_data_ptr
<
ET
>
(
call_frame
,
m_out
);
size_t
count
=
get_tensor_element_count
(
call_frame
,
m_arg
);
kernel
::
asin
<
typename
ET
::
type
>
(
arg
,
out
,
count
);
}
protected
:
...
...
src/ngraph/runtime/ngvm/
eige
n/atan.hpp
→
src/ngraph/runtime/ngvm/
instructio
n/atan.hpp
View file @
8aaebcb5
// ----------------------------------------------------------------------------
// Copyright 2017 Nervana Systems Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
...
...
@@ -15,8 +14,9 @@
#pragma once
#include "ngraph/runtime/kernel/atan.hpp"
#include "ngraph/runtime/ngvm/call_frame.hpp"
#include "ngraph/runtime/ngvm/
eigen/
utils.hpp"
#include "ngraph/runtime/ngvm/utils.hpp"
#include "ngraph/runtime/ngvm/instruction.hpp"
#include "ngraph/runtime/tensor_view.hpp"
...
...
@@ -26,13 +26,14 @@ namespace ngraph
{
namespace
ngvm
{
namespace
eige
n
namespace
instructio
n
{
template
<
typename
ET
>
class
AtanInstruction
:
public
Instruction
{
public
:
AtanInstruction
(
TensorViewInfo
arg
,
TensorViewInfo
out
)
AtanInstruction
(
const
TensorViewInfo
&
arg
,
const
TensorViewInfo
&
out
)
:
m_arg
(
arg
)
,
m_out
(
out
)
{
...
...
@@ -40,8 +41,12 @@ namespace ngraph
virtual
void
execute
(
CallFrame
&
call_frame
)
const
override
{
EigenArray1d
<
ET
,
fmt
::
V
>
(
call_frame
,
m_out
)
=
EigenArray1d
<
ET
,
fmt
::
V
>
(
call_frame
,
m_arg
).
atan
();
typename
ET
::
type
*
arg
=
get_tensor_data_ptr
<
ET
>
(
call_frame
,
m_arg
);
typename
ET
::
type
*
out
=
get_tensor_data_ptr
<
ET
>
(
call_frame
,
m_out
);
size_t
count
=
get_tensor_element_count
(
call_frame
,
m_arg
);
kernel
::
atan
<
typename
ET
::
type
>
(
arg
,
out
,
count
);
}
protected
:
...
...
src/ngraph/runtime/ngvm/
eige
n/ceiling.hpp
→
src/ngraph/runtime/ngvm/
instructio
n/ceiling.hpp
View file @
8aaebcb5
// ----------------------------------------------------------------------------
// Copyright 2017 Nervana Systems Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
...
...
@@ -15,8 +14,9 @@
#pragma once
#include "ngraph/runtime/kernel/ceiling.hpp"
#include "ngraph/runtime/ngvm/call_frame.hpp"
#include "ngraph/runtime/ngvm/
eigen/
utils.hpp"
#include "ngraph/runtime/ngvm/utils.hpp"
#include "ngraph/runtime/ngvm/instruction.hpp"
#include "ngraph/runtime/tensor_view.hpp"
...
...
@@ -26,13 +26,14 @@ namespace ngraph
{
namespace
ngvm
{
namespace
eige
n
namespace
instructio
n
{
template
<
typename
ET
>
class
CeilingInstruction
:
public
Instruction
{
public
:
CeilingInstruction
(
TensorViewInfo
arg
,
TensorViewInfo
out
)
CeilingInstruction
(
const
TensorViewInfo
&
arg
,
const
TensorViewInfo
&
out
)
:
m_arg
(
arg
)
,
m_out
(
out
)
{
...
...
@@ -40,8 +41,12 @@ namespace ngraph
virtual
void
execute
(
CallFrame
&
call_frame
)
const
override
{
EigenArray1d
<
ET
,
fmt
::
V
>
(
call_frame
,
m_out
)
=
EigenArray1d
<
ET
,
fmt
::
V
>
(
call_frame
,
m_arg
).
ceil
();
typename
ET
::
type
*
arg
=
get_tensor_data_ptr
<
ET
>
(
call_frame
,
m_arg
);
typename
ET
::
type
*
out
=
get_tensor_data_ptr
<
ET
>
(
call_frame
,
m_out
);
size_t
count
=
get_tensor_element_count
(
call_frame
,
m_arg
);
kernel
::
ceiling
<
typename
ET
::
type
>
(
arg
,
out
,
count
);
}
protected
:
...
...
src/ngraph/runtime/ngvm/
eige
n/cos.hpp
→
src/ngraph/runtime/ngvm/
instructio
n/cos.hpp
View file @
8aaebcb5
// ----------------------------------------------------------------------------
// Copyright 2017 Nervana Systems Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
...
...
@@ -15,8 +14,9 @@
#pragma once
#include "ngraph/runtime/kernel/cos.hpp"
#include "ngraph/runtime/ngvm/call_frame.hpp"
#include "ngraph/runtime/ngvm/
eigen/
utils.hpp"
#include "ngraph/runtime/ngvm/utils.hpp"
#include "ngraph/runtime/ngvm/instruction.hpp"
#include "ngraph/runtime/tensor_view.hpp"
...
...
@@ -26,13 +26,14 @@ namespace ngraph
{
namespace
ngvm
{
namespace
eige
n
namespace
instructio
n
{
template
<
typename
ET
>
class
CosInstruction
:
public
Instruction
{
public
:
CosInstruction
(
TensorViewInfo
arg
,
TensorViewInfo
out
)
CosInstruction
(
const
TensorViewInfo
&
arg
,
const
TensorViewInfo
&
out
)
:
m_arg
(
arg
)
,
m_out
(
out
)
{
...
...
@@ -40,8 +41,12 @@ namespace ngraph
virtual
void
execute
(
CallFrame
&
call_frame
)
const
override
{
EigenArray1d
<
ET
,
fmt
::
V
>
(
call_frame
,
m_out
)
=
EigenArray1d
<
ET
,
fmt
::
V
>
(
call_frame
,
m_arg
).
cos
();
typename
ET
::
type
*
arg
=
get_tensor_data_ptr
<
ET
>
(
call_frame
,
m_arg
);
typename
ET
::
type
*
out
=
get_tensor_data_ptr
<
ET
>
(
call_frame
,
m_out
);
size_t
count
=
get_tensor_element_count
(
call_frame
,
m_arg
);
kernel
::
cos
<
typename
ET
::
type
>
(
arg
,
out
,
count
);
}
protected
:
...
...
src/ngraph/runtime/ngvm/
eige
n/cosh.hpp
→
src/ngraph/runtime/ngvm/
instructio
n/cosh.hpp
View file @
8aaebcb5
// ----------------------------------------------------------------------------
// Copyright 2017 Nervana Systems Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
...
...
@@ -15,8 +14,9 @@
#pragma once
#include "ngraph/runtime/kernel/cosh.hpp"
#include "ngraph/runtime/ngvm/call_frame.hpp"
#include "ngraph/runtime/ngvm/
eigen/
utils.hpp"
#include "ngraph/runtime/ngvm/utils.hpp"
#include "ngraph/runtime/ngvm/instruction.hpp"
#include "ngraph/runtime/tensor_view.hpp"
...
...
@@ -26,13 +26,14 @@ namespace ngraph
{
namespace
ngvm
{
namespace
eige
n
namespace
instructio
n
{
template
<
typename
ET
>
class
CoshInstruction
:
public
Instruction
{
public
:
CoshInstruction
(
TensorViewInfo
arg
,
TensorViewInfo
out
)
CoshInstruction
(
const
TensorViewInfo
&
arg
,
const
TensorViewInfo
&
out
)
:
m_arg
(
arg
)
,
m_out
(
out
)
{
...
...
@@ -40,8 +41,12 @@ namespace ngraph
virtual
void
execute
(
CallFrame
&
call_frame
)
const
override
{
EigenArray1d
<
ET
,
fmt
::
V
>
(
call_frame
,
m_out
)
=
EigenArray1d
<
ET
,
fmt
::
V
>
(
call_frame
,
m_arg
).
cosh
();
typename
ET
::
type
*
arg
=
get_tensor_data_ptr
<
ET
>
(
call_frame
,
m_arg
);
typename
ET
::
type
*
out
=
get_tensor_data_ptr
<
ET
>
(
call_frame
,
m_out
);
size_t
count
=
get_tensor_element_count
(
call_frame
,
m_arg
);
kernel
::
cosh
<
typename
ET
::
type
>
(
arg
,
out
,
count
);
}
protected
:
...
...
src/ngraph/runtime/ngvm/
eige
n/exp.hpp
→
src/ngraph/runtime/ngvm/
instructio
n/exp.hpp
View file @
8aaebcb5
...
...
@@ -14,8 +14,9 @@
#pragma once
#include "ngraph/runtime/kernel/exp.hpp"
#include "ngraph/runtime/ngvm/call_frame.hpp"
#include "ngraph/runtime/ngvm/
eigen/
utils.hpp"
#include "ngraph/runtime/ngvm/utils.hpp"
#include "ngraph/runtime/ngvm/instruction.hpp"
#include "ngraph/runtime/tensor_view.hpp"
...
...
@@ -25,13 +26,14 @@ namespace ngraph
{
namespace
ngvm
{
namespace
eige
n
namespace
instructio
n
{
template
<
typename
ET
>
class
ExpInstruction
:
public
Instruction
{
public
:
ExpInstruction
(
TensorViewInfo
arg
,
TensorViewInfo
out
)
ExpInstruction
(
const
TensorViewInfo
&
arg
,
const
TensorViewInfo
&
out
)
:
m_arg
(
arg
)
,
m_out
(
out
)
{
...
...
@@ -39,8 +41,12 @@ namespace ngraph
virtual
void
execute
(
CallFrame
&
call_frame
)
const
override
{
EigenArray1d
<
ET
,
fmt
::
V
>
(
call_frame
,
m_out
)
=
EigenArray1d
<
ET
,
fmt
::
V
>
(
call_frame
,
m_arg
).
exp
();
typename
ET
::
type
*
arg
=
get_tensor_data_ptr
<
ET
>
(
call_frame
,
m_arg
);
typename
ET
::
type
*
out
=
get_tensor_data_ptr
<
ET
>
(
call_frame
,
m_out
);
size_t
count
=
get_tensor_element_count
(
call_frame
,
m_arg
);
kernel
::
exp
<
typename
ET
::
type
>
(
arg
,
out
,
count
);
}
protected
:
...
...
src/ngraph/runtime/ngvm/
eige
n/floor.hpp
→
src/ngraph/runtime/ngvm/
instructio
n/floor.hpp
View file @
8aaebcb5
// ----------------------------------------------------------------------------
// Copyright 2017 Nervana Systems Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
...
...
@@ -15,8 +14,9 @@
#pragma once
#include "ngraph/runtime/kernel/floor.hpp"
#include "ngraph/runtime/ngvm/call_frame.hpp"
#include "ngraph/runtime/ngvm/
eigen/
utils.hpp"
#include "ngraph/runtime/ngvm/utils.hpp"
#include "ngraph/runtime/ngvm/instruction.hpp"
#include "ngraph/runtime/tensor_view.hpp"
...
...
@@ -26,13 +26,14 @@ namespace ngraph
{
namespace
ngvm
{
namespace
eige
n
namespace
instructio
n
{
template
<
typename
ET
>
class
FloorInstruction
:
public
Instruction
{
public
:
FloorInstruction
(
TensorViewInfo
arg
,
TensorViewInfo
out
)
FloorInstruction
(
const
TensorViewInfo
&
arg
,
const
TensorViewInfo
&
out
)
:
m_arg
(
arg
)
,
m_out
(
out
)
{
...
...
@@ -40,8 +41,12 @@ namespace ngraph
virtual
void
execute
(
CallFrame
&
call_frame
)
const
override
{
EigenArray1d
<
ET
,
fmt
::
V
>
(
call_frame
,
m_out
)
=
EigenArray1d
<
ET
,
fmt
::
V
>
(
call_frame
,
m_arg
).
floor
();
typename
ET
::
type
*
arg
=
get_tensor_data_ptr
<
ET
>
(
call_frame
,
m_arg
);
typename
ET
::
type
*
out
=
get_tensor_data_ptr
<
ET
>
(
call_frame
,
m_out
);
size_t
count
=
get_tensor_element_count
(
call_frame
,
m_arg
);
kernel
::
floor
<
typename
ET
::
type
>
(
arg
,
out
,
count
);
}
protected
:
...
...
src/ngraph/runtime/ngvm/
eige
n/log.hpp
→
src/ngraph/runtime/ngvm/
instructio
n/log.hpp
View file @
8aaebcb5
...
...
@@ -14,8 +14,9 @@
#pragma once
#include "ngraph/runtime/kernel/log.hpp"
#include "ngraph/runtime/ngvm/call_frame.hpp"
#include "ngraph/runtime/ngvm/
eigen/
utils.hpp"
#include "ngraph/runtime/ngvm/utils.hpp"
#include "ngraph/runtime/ngvm/instruction.hpp"
#include "ngraph/runtime/tensor_view.hpp"
...
...
@@ -25,13 +26,14 @@ namespace ngraph
{
namespace
ngvm
{
namespace
eige
n
namespace
instructio
n
{
template
<
typename
ET
>
class
LogInstruction
:
public
Instruction
{
public
:
LogInstruction
(
TensorViewInfo
arg
,
TensorViewInfo
out
)
LogInstruction
(
const
TensorViewInfo
&
arg
,
const
TensorViewInfo
&
out
)
:
m_arg
(
arg
)
,
m_out
(
out
)
{
...
...
@@ -39,8 +41,12 @@ namespace ngraph
virtual
void
execute
(
CallFrame
&
call_frame
)
const
override
{
EigenArray1d
<
ET
,
fmt
::
V
>
(
call_frame
,
m_out
)
=
Eigen
::
log
(
EigenArray1d
<
ET
,
fmt
::
V
>
(
call_frame
,
m_arg
));
typename
ET
::
type
*
arg
=
get_tensor_data_ptr
<
ET
>
(
call_frame
,
m_arg
);
typename
ET
::
type
*
out
=
get_tensor_data_ptr
<
ET
>
(
call_frame
,
m_out
);
size_t
count
=
get_tensor_element_count
(
call_frame
,
m_arg
);
kernel
::
log
<
typename
ET
::
type
>
(
arg
,
out
,
count
);
}
protected
:
...
...
src/ngraph/runtime/ngvm/
eige
n/negate.hpp
→
src/ngraph/runtime/ngvm/
instructio
n/negate.hpp
View file @
8aaebcb5
...
...
@@ -14,8 +14,9 @@
#pragma once
#include "ngraph/runtime/kernel/negate.hpp"
#include "ngraph/runtime/ngvm/call_frame.hpp"
#include "ngraph/runtime/ngvm/
eigen/
utils.hpp"
#include "ngraph/runtime/ngvm/utils.hpp"
#include "ngraph/runtime/ngvm/instruction.hpp"
#include "ngraph/runtime/tensor_view.hpp"
...
...
@@ -25,13 +26,14 @@ namespace ngraph
{
namespace
ngvm
{
namespace
eige
n
namespace
instructio
n
{
template
<
typename
ET
>
class
NegateInstruction
:
public
Instruction
{
public
:
NegateInstruction
(
TensorViewInfo
arg
,
TensorViewInfo
out
)
NegateInstruction
(
const
TensorViewInfo
&
arg
,
const
TensorViewInfo
&
out
)
:
m_arg
(
arg
)
,
m_out
(
out
)
{
...
...
@@ -39,7 +41,12 @@ namespace ngraph
virtual
void
execute
(
CallFrame
&
call_frame
)
const
override
{
EigenArray1d
<
ET
>
(
call_frame
,
m_out
)
=
-
EigenArray1d
<
ET
>
(
call_frame
,
m_arg
);
typename
ET
::
type
*
arg
=
get_tensor_data_ptr
<
ET
>
(
call_frame
,
m_arg
);
typename
ET
::
type
*
out
=
get_tensor_data_ptr
<
ET
>
(
call_frame
,
m_out
);
size_t
count
=
get_tensor_element_count
(
call_frame
,
m_arg
);
kernel
::
negate
<
typename
ET
::
type
>
(
arg
,
out
,
count
);
}
protected
:
...
...
src/ngraph/runtime/ngvm/
eige
n/sign.hpp
→
src/ngraph/runtime/ngvm/
instructio
n/sign.hpp
View file @
8aaebcb5
...
...
@@ -14,8 +14,9 @@
#pragma once
#include "ngraph/runtime/kernel/sign.hpp"
#include "ngraph/runtime/ngvm/call_frame.hpp"
#include "ngraph/runtime/ngvm/
eigen/
utils.hpp"
#include "ngraph/runtime/ngvm/utils.hpp"
#include "ngraph/runtime/ngvm/instruction.hpp"
#include "ngraph/runtime/tensor_view.hpp"
...
...
@@ -25,13 +26,14 @@ namespace ngraph
{
namespace
ngvm
{
namespace
eige
n
namespace
instructio
n
{
template
<
typename
ET
>
class
SignInstruction
:
public
Instruction
{
public
:
SignInstruction
(
TensorViewInfo
arg
,
TensorViewInfo
out
)
SignInstruction
(
const
TensorViewInfo
&
arg
,
const
TensorViewInfo
&
out
)
:
m_arg
(
arg
)
,
m_out
(
out
)
{
...
...
@@ -39,8 +41,12 @@ namespace ngraph
virtual
void
execute
(
CallFrame
&
call_frame
)
const
override
{
EigenArray1d
<
ET
,
fmt
::
V
>
(
call_frame
,
m_out
)
=
EigenArray1d
<
ET
,
fmt
::
V
>
(
call_frame
,
m_arg
).
sign
();
typename
ET
::
type
*
arg
=
get_tensor_data_ptr
<
ET
>
(
call_frame
,
m_arg
);
typename
ET
::
type
*
out
=
get_tensor_data_ptr
<
ET
>
(
call_frame
,
m_out
);
size_t
count
=
get_tensor_element_count
(
call_frame
,
m_arg
);
kernel
::
sign
<
typename
ET
::
type
>
(
arg
,
out
,
count
);
}
protected
:
...
...
src/ngraph/runtime/ngvm/
eige
n/sin.hpp
→
src/ngraph/runtime/ngvm/
instructio
n/sin.hpp
100755 → 100644
View file @
8aaebcb5
...
...
@@ -14,8 +14,9 @@
#pragma once
#include "ngraph/runtime/kernel/sin.hpp"
#include "ngraph/runtime/ngvm/call_frame.hpp"
#include "ngraph/runtime/ngvm/
eigen/
utils.hpp"
#include "ngraph/runtime/ngvm/utils.hpp"
#include "ngraph/runtime/ngvm/instruction.hpp"
#include "ngraph/runtime/tensor_view.hpp"
...
...
@@ -25,13 +26,14 @@ namespace ngraph
{
namespace
ngvm
{
namespace
eige
n
namespace
instructio
n
{
template
<
typename
ET
>
class
SinInstruction
:
public
Instruction
{
public
:
SinInstruction
(
TensorViewInfo
arg
,
TensorViewInfo
out
)
SinInstruction
(
const
TensorViewInfo
&
arg
,
const
TensorViewInfo
&
out
)
:
m_arg
(
arg
)
,
m_out
(
out
)
{
...
...
@@ -39,8 +41,12 @@ namespace ngraph
virtual
void
execute
(
CallFrame
&
call_frame
)
const
override
{
EigenArray1d
<
ET
,
fmt
::
V
>
(
call_frame
,
m_out
)
=
EigenArray1d
<
ET
,
fmt
::
V
>
(
call_frame
,
m_arg
).
sin
();
typename
ET
::
type
*
arg
=
get_tensor_data_ptr
<
ET
>
(
call_frame
,
m_arg
);
typename
ET
::
type
*
out
=
get_tensor_data_ptr
<
ET
>
(
call_frame
,
m_out
);
size_t
count
=
get_tensor_element_count
(
call_frame
,
m_arg
);
kernel
::
sin
<
typename
ET
::
type
>
(
arg
,
out
,
count
);
}
protected
:
...
...
src/ngraph/runtime/ngvm/
eige
n/sinh.hpp
→
src/ngraph/runtime/ngvm/
instructio
n/sinh.hpp
View file @
8aaebcb5
// ----------------------------------------------------------------------------
// Copyright 2017 Nervana Systems Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
...
...
@@ -15,8 +14,9 @@
#pragma once
#include "ngraph/runtime/kernel/sinh.hpp"
#include "ngraph/runtime/ngvm/call_frame.hpp"
#include "ngraph/runtime/ngvm/
eigen/
utils.hpp"
#include "ngraph/runtime/ngvm/utils.hpp"
#include "ngraph/runtime/ngvm/instruction.hpp"
#include "ngraph/runtime/tensor_view.hpp"
...
...
@@ -26,13 +26,14 @@ namespace ngraph
{
namespace
ngvm
{
namespace
eige
n
namespace
instructio
n
{
template
<
typename
ET
>
class
SinhInstruction
:
public
Instruction
{
public
:
SinhInstruction
(
TensorViewInfo
arg
,
TensorViewInfo
out
)
SinhInstruction
(
const
TensorViewInfo
&
arg
,
const
TensorViewInfo
&
out
)
:
m_arg
(
arg
)
,
m_out
(
out
)
{
...
...
@@ -40,8 +41,12 @@ namespace ngraph
virtual
void
execute
(
CallFrame
&
call_frame
)
const
override
{
EigenArray1d
<
ET
,
fmt
::
V
>
(
call_frame
,
m_out
)
=
EigenArray1d
<
ET
,
fmt
::
V
>
(
call_frame
,
m_arg
).
sinh
();
typename
ET
::
type
*
arg
=
get_tensor_data_ptr
<
ET
>
(
call_frame
,
m_arg
);
typename
ET
::
type
*
out
=
get_tensor_data_ptr
<
ET
>
(
call_frame
,
m_out
);
size_t
count
=
get_tensor_element_count
(
call_frame
,
m_arg
);
kernel
::
sinh
<
typename
ET
::
type
>
(
arg
,
out
,
count
);
}
protected
:
...
...
src/ngraph/runtime/ngvm/
eige
n/sqrt.hpp
→
src/ngraph/runtime/ngvm/
instructio
n/sqrt.hpp
View file @
8aaebcb5
...
...
@@ -14,11 +14,11 @@
#pragma once
#include "ngraph/runtime/kernel/sqrt.hpp"
#include "ngraph/runtime/ngvm/call_frame.hpp"
#include "ngraph/runtime/ngvm/
eigen/
utils.hpp"
#include "ngraph/runtime/ngvm/utils.hpp"
#include "ngraph/runtime/ngvm/instruction.hpp"
#include "ngraph/runtime/tensor_view.hpp"
#include "ngraph/runtime/tensor_view_info.hpp"
namespace
ngraph
{
...
...
@@ -26,13 +26,14 @@ namespace ngraph
{
namespace
ngvm
{
namespace
eige
n
namespace
instructio
n
{
template
<
typename
ET
>
class
SqrtInstruction
:
public
Instruction
{
public
:
SqrtInstruction
(
const
TensorViewInfo
&
arg
,
const
TensorViewInfo
&
out
)
SqrtInstruction
(
const
TensorViewInfo
&
arg
,
const
TensorViewInfo
&
out
)
:
m_arg
(
arg
)
,
m_out
(
out
)
{
...
...
@@ -40,8 +41,12 @@ namespace ngraph
virtual
void
execute
(
CallFrame
&
call_frame
)
const
override
{
EigenArray1d
<
ET
>
(
call_frame
,
m_out
)
=
Eigen
::
sqrt
(
EigenArray1d
<
ET
>
(
call_frame
,
m_arg
));
typename
ET
::
type
*
arg
=
get_tensor_data_ptr
<
ET
>
(
call_frame
,
m_arg
);
typename
ET
::
type
*
out
=
get_tensor_data_ptr
<
ET
>
(
call_frame
,
m_out
);
size_t
count
=
get_tensor_element_count
(
call_frame
,
m_arg
);
kernel
::
sqrt
<
typename
ET
::
type
>
(
arg
,
out
,
count
);
}
protected
:
...
...
src/ngraph/runtime/ngvm/
eige
n/tan.hpp
→
src/ngraph/runtime/ngvm/
instructio
n/tan.hpp
View file @
8aaebcb5
// ----------------------------------------------------------------------------
// Copyright 2017 Nervana Systems Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
...
...
@@ -15,8 +14,9 @@
#pragma once
#include "ngraph/runtime/kernel/tan.hpp"
#include "ngraph/runtime/ngvm/call_frame.hpp"
#include "ngraph/runtime/ngvm/
eigen/
utils.hpp"
#include "ngraph/runtime/ngvm/utils.hpp"
#include "ngraph/runtime/ngvm/instruction.hpp"
#include "ngraph/runtime/tensor_view.hpp"
...
...
@@ -26,13 +26,14 @@ namespace ngraph
{
namespace
ngvm
{
namespace
eige
n
namespace
instructio
n
{
template
<
typename
ET
>
class
TanInstruction
:
public
Instruction
{
public
:
TanInstruction
(
TensorViewInfo
arg
,
TensorViewInfo
out
)
TanInstruction
(
const
TensorViewInfo
&
arg
,
const
TensorViewInfo
&
out
)
:
m_arg
(
arg
)
,
m_out
(
out
)
{
...
...
@@ -40,8 +41,12 @@ namespace ngraph
virtual
void
execute
(
CallFrame
&
call_frame
)
const
override
{
EigenArray1d
<
ET
,
fmt
::
V
>
(
call_frame
,
m_out
)
=
EigenArray1d
<
ET
,
fmt
::
V
>
(
call_frame
,
m_arg
).
tan
();
typename
ET
::
type
*
arg
=
get_tensor_data_ptr
<
ET
>
(
call_frame
,
m_arg
);
typename
ET
::
type
*
out
=
get_tensor_data_ptr
<
ET
>
(
call_frame
,
m_out
);
size_t
count
=
get_tensor_element_count
(
call_frame
,
m_arg
);
kernel
::
tan
<
typename
ET
::
type
>
(
arg
,
out
,
count
);
}
protected
:
...
...
src/ngraph/runtime/ngvm/
eige
n/tanh.hpp
→
src/ngraph/runtime/ngvm/
instructio
n/tanh.hpp
View file @
8aaebcb5
// ----------------------------------------------------------------------------
// Copyright 2017 Nervana Systems Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
...
...
@@ -15,8 +14,9 @@
#pragma once
#include "ngraph/runtime/kernel/tanh.hpp"
#include "ngraph/runtime/ngvm/call_frame.hpp"
#include "ngraph/runtime/ngvm/
eigen/
utils.hpp"
#include "ngraph/runtime/ngvm/utils.hpp"
#include "ngraph/runtime/ngvm/instruction.hpp"
#include "ngraph/runtime/tensor_view.hpp"
...
...
@@ -26,13 +26,14 @@ namespace ngraph
{
namespace
ngvm
{
namespace
eige
n
namespace
instructio
n
{
template
<
typename
ET
>
class
TanhInstruction
:
public
Instruction
{
public
:
TanhInstruction
(
TensorViewInfo
arg
,
TensorViewInfo
out
)
TanhInstruction
(
const
TensorViewInfo
&
arg
,
const
TensorViewInfo
&
out
)
:
m_arg
(
arg
)
,
m_out
(
out
)
{
...
...
@@ -40,8 +41,12 @@ namespace ngraph
virtual
void
execute
(
CallFrame
&
call_frame
)
const
override
{
EigenArray1d
<
ET
,
fmt
::
V
>
(
call_frame
,
m_out
)
=
EigenArray1d
<
ET
,
fmt
::
V
>
(
call_frame
,
m_arg
).
tanh
();
typename
ET
::
type
*
arg
=
get_tensor_data_ptr
<
ET
>
(
call_frame
,
m_arg
);
typename
ET
::
type
*
out
=
get_tensor_data_ptr
<
ET
>
(
call_frame
,
m_out
);
size_t
count
=
get_tensor_element_count
(
call_frame
,
m_arg
);
kernel
::
tanh
<
typename
ET
::
type
>
(
arg
,
out
,
count
);
}
protected
:
...
...
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