Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
3655fc2b
Commit
3655fc2b
authored
Jul 02, 2019
by
Shucai Xiao
Browse files
add the operator pow
parent
35ab7614
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
80 additions
and
0 deletions
+80
-0
src/include/migraphx/op/pow.hpp
src/include/migraphx/op/pow.hpp
+23
-0
src/targets/gpu/device/pow.cpp
src/targets/gpu/device/pow.cpp
+17
-0
src/targets/gpu/include/migraphx/gpu/device/pow.hpp
src/targets/gpu/include/migraphx/gpu/device/pow.hpp
+21
-0
src/targets/gpu/include/migraphx/gpu/pow.hpp
src/targets/gpu/include/migraphx/gpu/pow.hpp
+19
-0
No files found.
src/include/migraphx/op/pow.hpp
0 → 100644
View file @
3655fc2b
#ifndef MIGRAPHX_GUARD_OPERATORS_POW_HPP
#define MIGRAPHX_GUARD_OPERATORS_POW_HPP
#include <migraphx/op/binary.hpp>
#include <migraphx/config.hpp>
namespace
migraphx
{
inline
namespace
MIGRAPHX_INLINE_NS
{
namespace
op
{
struct
pow
:
binary
<
pow
>
{
auto
apply
()
const
{
return
[](
auto
x
,
auto
y
)
{
return
std
::
pow
(
x
,
y
);
};
}
};
}
// namespace op
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace migraphx
#endif
src/targets/gpu/device/pow.cpp
0 → 100644
View file @
3655fc2b
#include <migraphx/gpu/device/pow.hpp>
#include <migraphx/gpu/device/nary.hpp>
namespace
migraphx
{
inline
namespace
MIGRAPHX_INLINE_NS
{
namespace
gpu
{
namespace
device
{
void
pow
(
hipStream_t
stream
,
const
argument
&
result
,
const
argument
&
arg1
,
const
argument
&
arg2
)
{
nary
(
stream
,
result
,
arg1
,
arg2
)([](
auto
x
,
auto
y
)
{
return
::
pow
(
to_hip_type
(
x
),
to_hip_type
(
y
));
});
}
}
// namespace device
}
// namespace gpu
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace migraphx
src/targets/gpu/include/migraphx/gpu/device/pow.hpp
0 → 100644
View file @
3655fc2b
#ifndef MIGRAPHX_GUARD_RTGLIB_DEVICE_POW_HPP
#define MIGRAPHX_GUARD_RTGLIB_DEVICE_POW_HPP
#include <migraphx/argument.hpp>
#include <migraphx/config.hpp>
#include <hip/hip_runtime_api.h>
namespace
migraphx
{
inline
namespace
MIGRAPHX_INLINE_NS
{
namespace
gpu
{
namespace
device
{
void
pow
(
hipStream_t
stream
,
const
argument
&
result
,
const
argument
&
arg1
,
const
argument
&
arg2
);
}
// namespace device
}
// namespace gpu
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace migraphx
#endif
src/targets/gpu/include/migraphx/gpu/pow.hpp
0 → 100644
View file @
3655fc2b
#ifndef MIGRAPHX_GUARD_RTGLIB_POW_HPP
#define MIGRAPHX_GUARD_RTGLIB_POW_HPP
#include <migraphx/gpu/oper.hpp>
#include <migraphx/gpu/device/pow.hpp>
namespace
migraphx
{
inline
namespace
MIGRAPHX_INLINE_NS
{
namespace
gpu
{
struct
hip_pow
:
binary_device
<
hip_pow
,
device
::
pow
>
{
};
}
// namespace gpu
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace migraphx
#endif
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