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
e484e44c
Commit
e484e44c
authored
Nov 29, 2017
by
Adam Procter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
De-Eigenize acos
parent
b63acba0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
96 additions
and
2 deletions
+96
-2
acos.hpp
src/ngraph/runtime/kernel/acos.hpp
+35
-0
external_function.cpp
src/ngraph/runtime/ngvm/external_function.cpp
+2
-2
acos.hpp
src/ngraph/runtime/ngvm/instruction/acos.hpp
+59
-0
No files found.
src/ngraph/runtime/kernel/acos.hpp
0 → 100644
View file @
e484e44c
// ----------------------------------------------------------------------------
// 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
acos
(
T
*
arg
,
T
*
out
,
size_t
count
)
{
for
(
size_t
i
=
0
;
i
<
count
;
i
++
)
{
out
[
i
]
=
std
::
acos
(
arg
[
i
]);
}
}
}
}
}
src/ngraph/runtime/ngvm/external_function.cpp
View file @
e484e44c
...
...
@@ -71,7 +71,7 @@
#include "ngraph/pass/manager.hpp"
#include "ngraph/pass/topological_sort.hpp"
#include "ngraph/runtime/ngvm/eigen/abs.hpp"
#include "ngraph/runtime/ngvm/
eige
n/acos.hpp"
#include "ngraph/runtime/ngvm/
instructio
n/acos.hpp"
#include "ngraph/runtime/ngvm/instruction/add.hpp"
#include "ngraph/runtime/ngvm/eigen/asin.hpp"
#include "ngraph/runtime/ngvm/eigen/atan.hpp"
...
...
@@ -388,7 +388,7 @@ ExternalFunction::OpMap& ExternalFunction::get_op_map()
static
OpMap
op_map
;
if
(
!
initialized
)
{
REGISTER_NUMERIC_UNOP
(
op
::
Acos
,
eige
n
::
AcosInstruction
);
REGISTER_NUMERIC_UNOP
(
op
::
Acos
,
instructio
n
::
AcosInstruction
);
REGISTER_NUMERIC_UNOP
(
op
::
Asin
,
eigen
::
AsinInstruction
);
REGISTER_NUMERIC_UNOP
(
op
::
Atan
,
eigen
::
AtanInstruction
);
REGISTER_NUMERIC_UNOP
(
op
::
Ceiling
,
eigen
::
CeilingInstruction
);
...
...
src/ngraph/runtime/ngvm/instruction/acos.hpp
0 → 100644
View file @
e484e44c
// ----------------------------------------------------------------------------
// 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 "ngraph/runtime/kernel/acos.hpp"
#include "ngraph/runtime/ngvm/call_frame.hpp"
#include "ngraph/runtime/ngvm/utils.hpp"
#include "ngraph/runtime/ngvm/instruction.hpp"
#include "ngraph/runtime/tensor_view.hpp"
namespace
ngraph
{
namespace
runtime
{
namespace
ngvm
{
namespace
instruction
{
template
<
typename
ET
>
class
AcosInstruction
:
public
Instruction
{
public
:
AcosInstruction
(
const
TensorViewInfo
&
arg
,
const
TensorViewInfo
&
out
)
:
m_arg
(
arg
)
,
m_out
(
out
)
{
}
virtual
void
execute
(
CallFrame
&
call_frame
)
const
override
{
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
::
acos
<
typename
ET
::
type
>
(
arg
,
out
,
count
);
}
protected
:
TensorViewInfo
m_arg
;
TensorViewInfo
m_out
;
};
}
}
}
}
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