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
96358e41
Commit
96358e41
authored
Nov 14, 2018
by
Paul
Browse files
Rename to migraphx
parent
80203608
Changes
190
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
147 additions
and
124 deletions
+147
-124
src/targets/cpu/include/migraphx/cpu/target.hpp
src/targets/cpu/include/migraphx/cpu/target.hpp
+23
-0
src/targets/cpu/lowering.cpp
src/targets/cpu/lowering.cpp
+9
-9
src/targets/cpu/target.cpp
src/targets/cpu/target.cpp
+6
-6
src/targets/gpu/CMakeLists.txt
src/targets/gpu/CMakeLists.txt
+12
-12
src/targets/gpu/add.cpp
src/targets/gpu/add.cpp
+7
-7
src/targets/gpu/batchnorm.cpp
src/targets/gpu/batchnorm.cpp
+6
-6
src/targets/gpu/concat.cpp
src/targets/gpu/concat.cpp
+7
-7
src/targets/gpu/contiguous.cpp
src/targets/gpu/contiguous.cpp
+6
-6
src/targets/gpu/convolution.cpp
src/targets/gpu/convolution.cpp
+6
-6
src/targets/gpu/device/add.cpp
src/targets/gpu/device/add.cpp
+4
-4
src/targets/gpu/device/add_relu.cpp
src/targets/gpu/device/add_relu.cpp
+4
-4
src/targets/gpu/device/concat.cpp
src/targets/gpu/device/concat.cpp
+9
-9
src/targets/gpu/device/contiguous.cpp
src/targets/gpu/device/contiguous.cpp
+4
-4
src/targets/gpu/device/include/migraphx/gpu/device/launch.hpp
...targets/gpu/device/include/migraphx/gpu/device/launch.hpp
+3
-3
src/targets/gpu/device/include/migraphx/gpu/device/nary.hpp
src/targets/gpu/device/include/migraphx/gpu/device/nary.hpp
+9
-9
src/targets/gpu/device/include/migraphx/gpu/device/tensor.hpp
...targets/gpu/device/include/migraphx/gpu/device/tensor.hpp
+4
-4
src/targets/gpu/device/include/migraphx/gpu/device/types.hpp
src/targets/gpu/device/include/migraphx/gpu/device/types.hpp
+4
-4
src/targets/gpu/device/mul.cpp
src/targets/gpu/device/mul.cpp
+4
-4
src/targets/gpu/eliminate_workspace.cpp
src/targets/gpu/eliminate_workspace.cpp
+11
-11
src/targets/gpu/fuse_ops.cpp
src/targets/gpu/fuse_ops.cpp
+9
-9
No files found.
src/targets/cpu/include/migraph/cpu/target.hpp
→
src/targets/cpu/include/migraph
x
/cpu/target.hpp
View file @
96358e41
#ifndef MIGRAPH_GUARD_MIGRAPHLIB_CPU_TARGET_HPP
#define MIGRAPH_GUARD_MIGRAPHLIB_CPU_TARGET_HPP
#include <migraph/program.hpp>
#include <migraph/cpu/context.hpp>
#include <migraph/config.hpp>
#include <migraph
x
/program.hpp>
#include <migraph
x
/cpu/context.hpp>
#include <migraph
x
/config.hpp>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
namespace
cpu
{
struct
target
{
std
::
string
name
()
const
;
std
::
vector
<
pass
>
get_passes
(
migraph
::
context
&
ctx
)
const
;
migraph
::
context
get_context
()
const
{
return
context
{};
}
std
::
vector
<
pass
>
get_passes
(
migraph
x
::
context
&
ctx
)
const
;
migraph
x
::
context
get_context
()
const
{
return
context
{};
}
};
}
// namespace cpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
#endif
src/targets/cpu/lowering.cpp
View file @
96358e41
#include <migraph/cpu/lowering.hpp>
#include <migraph/instruction.hpp>
#include <migraph/dfor.hpp>
#include <migraph/operators.hpp>
#include <migraph/shape_for_each.hpp>
#include <migraph/iterator_for.hpp>
#include <migraph/cpu/gemm.hpp>
#include <migraph
x
/cpu/lowering.hpp>
#include <migraph
x
/instruction.hpp>
#include <migraph
x
/dfor.hpp>
#include <migraph
x
/operators.hpp>
#include <migraph
x
/shape_for_each.hpp>
#include <migraph
x
/iterator_for.hpp>
#include <migraph
x
/cpu/gemm.hpp>
#include <unordered_map>
#include <utility>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
namespace
cpu
{
...
...
@@ -659,4 +659,4 @@ void lowering::apply(program& p) const { cpu_apply{&p}.apply(); }
}
// namespace cpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
src/targets/cpu/target.cpp
View file @
96358e41
#include <migraph/cpu/target.hpp>
#include <migraph/cpu/lowering.hpp>
#include <migraph/auto_contiguous.hpp>
#include <migraph
x
/cpu/target.hpp>
#include <migraph
x
/cpu/lowering.hpp>
#include <migraph
x
/auto_contiguous.hpp>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
namespace
cpu
{
std
::
string
target
::
name
()
const
{
return
"cpu"
;
}
std
::
vector
<
pass
>
target
::
get_passes
(
migraph
::
context
&
)
const
std
::
vector
<
pass
>
target
::
get_passes
(
migraph
x
::
context
&
)
const
{
return
{
auto_contiguous
{},
lowering
{}};
}
}
// namespace cpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
src/targets/gpu/CMakeLists.txt
View file @
96358e41
...
...
@@ -10,20 +10,20 @@ if(NOT TARGET MIOpen)
message
(
SEND_ERROR
"Cant find miopen"
)
endif
()
add_library
(
migraph_device
add_library
(
migraph
x
_device
device/add.cpp
device/add_relu.cpp
device/contiguous.cpp
device/mul.cpp
device/concat.cpp
)
set_target_properties
(
migraph_device PROPERTIES EXPORT_NAME device
)
rocm_clang_tidy_check
(
migraph_device
)
target_link_libraries
(
migraph_device migraph hip::device
)
target_include_directories
(
migraph_device PUBLIC $<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
/include>
)
target_include_directories
(
migraph_device PRIVATE $<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
/device/include>
)
set_target_properties
(
migraph
x
_device PROPERTIES EXPORT_NAME device
)
rocm_clang_tidy_check
(
migraph
x
_device
)
target_link_libraries
(
migraph
x
_device migraph
x
hip::device
)
target_include_directories
(
migraph
x
_device PUBLIC $<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
/include>
)
target_include_directories
(
migraph
x
_device PRIVATE $<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
/device/include>
)
add_library
(
migraph_gpu
add_library
(
migraph
x
_gpu
eliminate_workspace.cpp
fuse_ops.cpp
hip.cpp
...
...
@@ -43,13 +43,13 @@ add_library(migraph_gpu
write_literals.cpp
rocblas.cpp
)
set_target_properties
(
migraph_gpu PROPERTIES EXPORT_NAME gpu
)
rocm_clang_tidy_check
(
migraph_gpu
)
target_link_libraries
(
migraph_gpu PUBLIC migraph MIOpen roc::rocblas
)
target_link_libraries
(
migraph_gpu PRIVATE migraph_device
)
set_target_properties
(
migraph
x
_gpu PROPERTIES EXPORT_NAME gpu
)
rocm_clang_tidy_check
(
migraph
x
_gpu
)
target_link_libraries
(
migraph
x
_gpu PUBLIC migraph
x
MIOpen roc::rocblas
)
target_link_libraries
(
migraph
x
_gpu PRIVATE migraph
x
_device
)
rocm_install_targets
(
TARGETS migraph_gpu migraph_device
TARGETS migraph
x
_gpu migraph
x
_device
INCLUDE
${
CMAKE_CURRENT_SOURCE_DIR
}
/include
)
...
...
src/targets/gpu/add.cpp
View file @
96358e41
#include <migraph/gpu/add.hpp>
#include <migraph/operators.hpp>
#include <migraph/manage_ptr.hpp>
#include <migraph/config.hpp>
#include <migraph/gpu/miopen.hpp>
#include <migraph
x
/gpu/add.hpp>
#include <migraph
x
/operators.hpp>
#include <migraph
x
/manage_ptr.hpp>
#include <migraph
x
/config.hpp>
#include <migraph
x
/gpu/miopen.hpp>
#include <utility>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
namespace
gpu
{
...
...
@@ -52,4 +52,4 @@ argument miopen_add::compute(context& ctx,
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
src/targets/gpu/batchnorm.cpp
View file @
96358e41
#include <migraph/gpu/batchnorm.hpp>
#include <migraph/operators.hpp>
#include <migraph/manage_ptr.hpp>
#include <migraph/gpu/miopen.hpp>
#include <migraph
x
/gpu/batchnorm.hpp>
#include <migraph
x
/operators.hpp>
#include <migraph
x
/manage_ptr.hpp>
#include <migraph
x
/gpu/miopen.hpp>
#include <utility>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
namespace
gpu
{
...
...
@@ -44,4 +44,4 @@ argument miopen_batch_norm_inference::compute(context& ctx,
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
src/targets/gpu/concat.cpp
View file @
96358e41
#include <migraph/gpu/concat.hpp>
#include <migraph/operators.hpp>
#include <migraph/manage_ptr.hpp>
#include <migraph/gpu/miopen.hpp>
#include <migraph/gpu/device/concat.hpp>
#include <migraph
x
/gpu/concat.hpp>
#include <migraph
x
/operators.hpp>
#include <migraph
x
/manage_ptr.hpp>
#include <migraph
x
/gpu/miopen.hpp>
#include <migraph
x
/gpu/device/concat.hpp>
#include <utility>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
namespace
gpu
{
...
...
@@ -25,4 +25,4 @@ argument hip_concat::compute(context& ctx,
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
src/targets/gpu/contiguous.cpp
View file @
96358e41
#include <migraph/gpu/contiguous.hpp>
#include <migraph/operators.hpp>
#include <migraph/manage_ptr.hpp>
#include <migraph/gpu/miopen.hpp>
#include <migraph
x
/gpu/contiguous.hpp>
#include <migraph
x
/operators.hpp>
#include <migraph
x
/manage_ptr.hpp>
#include <migraph
x
/gpu/miopen.hpp>
#include <utility>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
namespace
gpu
{
...
...
@@ -26,4 +26,4 @@ argument miopen_contiguous::compute(context& ctx,
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
src/targets/gpu/convolution.cpp
View file @
96358e41
#include <migraph/gpu/convolution.hpp>
#include <migraph/operators.hpp>
#include <migraph/manage_ptr.hpp>
#include <migraph/gpu/miopen.hpp>
#include <migraph
x
/gpu/convolution.hpp>
#include <migraph
x
/operators.hpp>
#include <migraph
x
/manage_ptr.hpp>
#include <migraph
x
/gpu/miopen.hpp>
#include <utility>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
namespace
gpu
{
...
...
@@ -83,4 +83,4 @@ shape miopen_convolution::compile(context& ctx,
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
src/targets/gpu/device/add.cpp
View file @
96358e41
#include <migraph/gpu/device/add.hpp>
#include <migraph/gpu/device/nary.hpp>
#include <migraph
x
/gpu/device/add.hpp>
#include <migraph
x
/gpu/device/nary.hpp>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
namespace
gpu
{
namespace
device
{
...
...
@@ -23,4 +23,4 @@ void add(hipStream_t stream,
}
// namespace device
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
src/targets/gpu/device/add_relu.cpp
View file @
96358e41
#include <migraph/gpu/device/add_relu.hpp>
#include <migraph/gpu/device/nary.hpp>
#include <migraph
x
/gpu/device/add_relu.hpp>
#include <migraph
x
/gpu/device/nary.hpp>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
namespace
gpu
{
namespace
device
{
...
...
@@ -28,4 +28,4 @@ void add_relu(hipStream_t stream,
}
// namespace device
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
src/targets/gpu/device/concat.cpp
View file @
96358e41
#include <migraph/shape.hpp>
#include <migraph/argument.hpp>
#include <migraph/gpu/device/concat.hpp>
#include <migraph/gpu/device/tensor.hpp>
#include <migraph/gpu/device/launch.hpp>
#include <migraph
x
/shape.hpp>
#include <migraph
x
/argument.hpp>
#include <migraph
x
/gpu/device/concat.hpp>
#include <migraph
x
/gpu/device/tensor.hpp>
#include <migraph
x
/gpu/device/launch.hpp>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
namespace
gpu
{
namespace
device
{
argument
concat
(
hipStream_t
stream
,
const
migraph
::
shape
&
output_shape
,
std
::
vector
<
migraph
::
argument
>
args
,
const
migraph
x
::
shape
&
output_shape
,
std
::
vector
<
migraph
x
::
argument
>
args
,
std
::
vector
<
std
::
size_t
>
offsets
)
{
for
(
std
::
size_t
l
=
0
;
l
<
args
.
size
()
-
1
;
l
++
)
...
...
@@ -35,4 +35,4 @@ argument concat(hipStream_t stream,
}
// namespace device
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
src/targets/gpu/device/contiguous.cpp
View file @
96358e41
#include <migraph/gpu/device/contiguous.hpp>
#include <migraph/gpu/device/nary.hpp>
#include <migraph
x
/gpu/device/contiguous.hpp>
#include <migraph
x
/gpu/device/nary.hpp>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
namespace
gpu
{
namespace
device
{
...
...
@@ -15,4 +15,4 @@ void contiguous(hipStream_t stream, argument result, argument arg)
}
// namespace device
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
src/targets/gpu/device/include/migraph/gpu/device/launch.hpp
→
src/targets/gpu/device/include/migraph
x
/gpu/device/launch.hpp
View file @
96358e41
...
...
@@ -2,9 +2,9 @@
#define MIGRAPH_GUARD_RTGLIB_DEVICE_LAUNCH_HPP
#include <hip/hip_runtime.h>
#include <migraph/config.hpp>
#include <migraph
x
/config.hpp>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
namespace
gpu
{
namespace
device
{
...
...
@@ -61,6 +61,6 @@ inline auto gs_launch(hipStream_t stream, std::size_t n, std::size_t local = 102
}
// namespace device
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
#endif
src/targets/gpu/device/include/migraph/gpu/device/nary.hpp
→
src/targets/gpu/device/include/migraph
x
/gpu/device/nary.hpp
View file @
96358e41
#ifndef MIGRAPH_GUARD_RTGLIB_DEVICE_NARY_HPP
#define MIGRAPH_GUARD_RTGLIB_DEVICE_NARY_HPP
#include <migraph/gpu/device/tensor.hpp>
#include <migraph/gpu/device/launch.hpp>
#include <migraph/gpu/device/types.hpp>
#include <migraph/functional.hpp>
#include <migraph/ranges.hpp>
#include <migraph/config.hpp>
namespace
migraph
{
#include <migraph
x
/gpu/device/tensor.hpp>
#include <migraph
x
/gpu/device/launch.hpp>
#include <migraph
x
/gpu/device/types.hpp>
#include <migraph
x
/functional.hpp>
#include <migraph
x
/ranges.hpp>
#include <migraph
x
/config.hpp>
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
namespace
gpu
{
namespace
device
{
...
...
@@ -397,6 +397,6 @@ inline auto nary(hipStream_t stream,
}
// namespace device
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
#endif
src/targets/gpu/device/include/migraph/gpu/device/tensor.hpp
→
src/targets/gpu/device/include/migraph
x
/gpu/device/tensor.hpp
View file @
96358e41
...
...
@@ -2,10 +2,10 @@
#define MIGRAPH_GUARD_RTGLIB_DEAVICE_TENSOR_HPP
#include <hip/hip_runtime.h>
#include <migraph/functional.hpp>
#include <migraph/config.hpp>
#include <migraph
x
/functional.hpp>
#include <migraph
x
/config.hpp>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
namespace
gpu
{
namespace
device
{
...
...
@@ -88,6 +88,6 @@ struct hip_tensor_descriptor
}
// namespace device
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
#endif
src/targets/gpu/device/include/migraph/gpu/device/types.hpp
→
src/targets/gpu/device/include/migraph
x
/gpu/device/types.hpp
View file @
96358e41
...
...
@@ -8,10 +8,10 @@
#ifndef MIGRAPH_GUARD_RTGLIB_GPU_DEVICE_TYPES_HPP
#define MIGRAPH_GUARD_RTGLIB_GPU_DEVICE_TYPES_HPP
#include <migraph/half.hpp>
#include <migraph/config.hpp>
#include <migraph
x
/half.hpp>
#include <migraph
x
/config.hpp>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
namespace
gpu
{
namespace
device
{
...
...
@@ -78,6 +78,6 @@ device_type<T>* device_cast(T* x)
}
// namespace device
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
#endif
src/targets/gpu/device/mul.cpp
View file @
96358e41
#include <migraph/gpu/device/mul.hpp>
#include <migraph/gpu/device/nary.hpp>
#include <migraph
x
/gpu/device/mul.hpp>
#include <migraph
x
/gpu/device/nary.hpp>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
namespace
gpu
{
namespace
device
{
...
...
@@ -23,4 +23,4 @@ void mul(hipStream_t stream,
}
// namespace device
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
src/targets/gpu/eliminate_workspace.cpp
View file @
96358e41
#include <migraph/gpu/eliminate_workspace.hpp>
#include <migraph/gpu/hip.hpp>
#include <migraph/program.hpp>
#include <migraph/instruction.hpp>
#include <migraph/operators.hpp>
#include <migraph/iterator_for.hpp>
#include <migraph/ranges.hpp>
#include <migraph/stringutils.hpp>
#include <migraph/pass_config.hpp>
#include <migraph
x
/gpu/eliminate_workspace.hpp>
#include <migraph
x
/gpu/hip.hpp>
#include <migraph
x
/program.hpp>
#include <migraph
x
/instruction.hpp>
#include <migraph
x
/operators.hpp>
#include <migraph
x
/iterator_for.hpp>
#include <migraph
x
/ranges.hpp>
#include <migraph
x
/stringutils.hpp>
#include <migraph
x
/pass_config.hpp>
namespace
migraph
{
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
namespace
gpu
{
...
...
@@ -42,4 +42,4 @@ void eliminate_workspace::apply(program& p) const
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
src/targets/gpu/fuse_ops.cpp
View file @
96358e41
#include <migraph/gpu/fuse_ops.hpp>
#include <migraph/matcher.hpp>
#include <migraph/gpu/miopen.hpp>
#include <migraph/gpu/convolution.hpp>
#include <migraph/gpu/device/add_relu.hpp>
#include <migraph/instruction.hpp>
namespace
migraph
{
#include <migraph
x
/gpu/fuse_ops.hpp>
#include <migraph
x
/matcher.hpp>
#include <migraph
x
/gpu/miopen.hpp>
#include <migraph
x
/gpu/convolution.hpp>
#include <migraph
x
/gpu/device/add_relu.hpp>
#include <migraph
x
/instruction.hpp>
namespace
migraph
x
{
inline
namespace
MIGRAPH_INLINE_NS
{
namespace
gpu
{
...
...
@@ -390,4 +390,4 @@ void fuse_ops::apply(program& p) const
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace migraph
}
// namespace migraph
x
Prev
1
2
3
4
5
6
7
8
9
10
Next
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