Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
0bedc5e8
Commit
0bedc5e8
authored
Aug 23, 2018
by
Paul
Browse files
Move device library to seperate directory
parent
8e8f9c3e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
7 deletions
+11
-7
src/targets/gpu/CMakeLists.txt
src/targets/gpu/CMakeLists.txt
+2
-1
src/targets/gpu/device/contiguous.cpp
src/targets/gpu/device/contiguous.cpp
+4
-2
src/targets/gpu/include/migraph/gpu/device/contiguous.hpp
src/targets/gpu/include/migraph/gpu/device/contiguous.hpp
+3
-2
src/targets/gpu/lowering.cpp
src/targets/gpu/lowering.cpp
+2
-2
No files found.
src/targets/gpu/CMakeLists.txt
View file @
0bedc5e8
...
...
@@ -11,11 +11,12 @@ if(NOT TARGET MIOpen)
endif
()
add_library
(
migraph_device
hip_
contiguous.cpp
device/
contiguous.cpp
)
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>
)
add_library
(
migraph_gpu
eliminate_allocation.cpp
...
...
src/targets/gpu/
hip_
contiguous.cpp
→
src/targets/gpu/
device/
contiguous.cpp
View file @
0bedc5e8
#include <hip/hip_runtime.h>
#include <migraph/
operator
s.hpp>
#include <migraph/
gpu/device/contiguou
s.hpp>
namespace
migraph
{
namespace
gpu
{
namespace
device
{
struct
index
{
...
...
@@ -107,7 +108,7 @@ struct hip_tensor_descriptor
size_t
strides
[
NDim
]
=
{};
};
void
hip_
contiguous
(
migraph
::
shape
output_shape
,
migraph
::
argument
arg
,
migraph
::
argument
result
)
void
contiguous
(
shape
output_shape
,
argument
arg
,
argument
result
)
{
visit_all
(
result
,
arg
)([
&
](
auto
output
,
auto
input
)
{
visit_tensor_size
(
output_shape
.
lens
().
size
(),
[
&
](
auto
ndim
)
{
...
...
@@ -130,5 +131,6 @@ void hip_contiguous(migraph::shape output_shape, migraph::argument arg, migraph:
});
});
}
}
// namespace device
}
// namespace gpu
}
// namespace migraph
src/targets/gpu/include/migraph/gpu/
kernel
s.hpp
→
src/targets/gpu/include/migraph/gpu/
device/contiguou
s.hpp
View file @
0bedc5e8
...
...
@@ -5,11 +5,12 @@
namespace
migraph
{
namespace
gpu
{
namespace
device
{
void
hip_
contiguous
(
shape
output_shape
,
argument
arg
,
argument
result
);
void
contiguous
(
shape
output_shape
,
argument
arg
,
argument
result
);
}
// namespace device
}
// namespace gpu
}
// namespace migraph
#endif
src/targets/gpu/lowering.cpp
View file @
0bedc5e8
...
...
@@ -8,7 +8,7 @@
#include <migraph/gpu/miopen.hpp>
#include <migraph/gpu/hip.hpp>
#include <migraph/dfor.hpp>
#include <migraph/gpu/
kernel
s.hpp>
#include <migraph/gpu/
device/contiguou
s.hpp>
#include <migraph/iterator_for.hpp>
#include <migraph/gpu/rocblas.hpp>
#include <migraph/gpu/context.hpp>
...
...
@@ -252,7 +252,7 @@ struct miopen_contiguous
{
assert
(
output_shape
==
args
[
1
].
get_shape
());
assert
(
output_shape
.
standard
());
hip_
contiguous
(
std
::
move
(
output_shape
),
args
.
at
(
0
),
args
.
at
(
1
));
device
::
contiguous
(
std
::
move
(
output_shape
),
args
.
at
(
0
),
args
.
at
(
1
));
return
args
.
at
(
1
);
}
};
...
...
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