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
20a9746c
Commit
20a9746c
authored
Jul 25, 2018
by
Paul
Browse files
Rename namespace to gpu
parent
c49b17e1
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
41 additions
and
41 deletions
+41
-41
src/targets/gpu/hip.cpp
src/targets/gpu/hip.cpp
+2
-2
src/targets/gpu/hip_contiguous.cpp
src/targets/gpu/hip_contiguous.cpp
+2
-2
src/targets/gpu/include/migraph/gpu/context.hpp
src/targets/gpu/include/migraph/gpu/context.hpp
+2
-2
src/targets/gpu/include/migraph/gpu/hip.hpp
src/targets/gpu/include/migraph/gpu/hip.hpp
+2
-2
src/targets/gpu/include/migraph/gpu/kernels.hpp
src/targets/gpu/include/migraph/gpu/kernels.hpp
+2
-2
src/targets/gpu/include/migraph/gpu/lowering.hpp
src/targets/gpu/include/migraph/gpu/lowering.hpp
+3
-3
src/targets/gpu/include/migraph/gpu/miopen.hpp
src/targets/gpu/include/migraph/gpu/miopen.hpp
+2
-2
src/targets/gpu/include/migraph/gpu/rocblas.hpp
src/targets/gpu/include/migraph/gpu/rocblas.hpp
+2
-2
src/targets/gpu/include/migraph/gpu/target.hpp
src/targets/gpu/include/migraph/gpu/target.hpp
+2
-2
src/targets/gpu/include/migraph/gpu/write_literals.hpp
src/targets/gpu/include/migraph/gpu/write_literals.hpp
+3
-3
src/targets/gpu/lowering.cpp
src/targets/gpu/lowering.cpp
+9
-9
src/targets/gpu/rocblas.cpp
src/targets/gpu/rocblas.cpp
+2
-2
src/targets/gpu/target.cpp
src/targets/gpu/target.cpp
+2
-2
src/targets/gpu/write_literals.cpp
src/targets/gpu/write_literals.cpp
+2
-2
test/miopen/miopen.cpp
test/miopen/miopen.cpp
+4
-4
No files found.
src/targets/gpu/hip.cpp
View file @
20a9746c
...
...
@@ -7,7 +7,7 @@
#include <vector>
namespace
migraph
{
namespace
miopen
{
namespace
gpu
{
using
hip_ptr
=
MIGRAPH_MANAGE_PTR
(
void
,
hipFree
);
...
...
@@ -67,6 +67,6 @@ migraph::argument from_gpu(migraph::argument arg)
return
result
;
}
}
// namespace
miopen
}
// namespace
gpu
}
// namespace migraph
src/targets/gpu/hip_contiguous.cpp
View file @
20a9746c
...
...
@@ -3,7 +3,7 @@
#include <migraph/operators.hpp>
namespace
migraph
{
namespace
miopen
{
namespace
gpu
{
template
<
class
F
>
void
visit_tensor_size
(
std
::
size_t
n
,
F
f
)
...
...
@@ -130,5 +130,5 @@ void hip_contiguous(migraph::shape output_shape, migraph::argument arg, migraph:
}
});
}
}
// namespace
miopen
}
// namespace
gpu
}
// namespace migraph
src/targets/gpu/include/migraph/gpu/context.hpp
View file @
20a9746c
...
...
@@ -5,7 +5,7 @@
#include <migraph/gpu/rocblas.hpp>
namespace
migraph
{
namespace
miopen
{
namespace
gpu
{
struct
context
{
...
...
@@ -13,7 +13,7 @@ struct context
shared
<
rocblas_handle_ptr
>
rbhandle
;
};
}
// namespace
miopen
}
// namespace
gpu
}
// namespace migraph
...
...
src/targets/gpu/include/migraph/gpu/hip.hpp
View file @
20a9746c
...
...
@@ -4,7 +4,7 @@
#include <migraph/operators.hpp>
namespace
migraph
{
namespace
miopen
{
namespace
gpu
{
migraph
::
argument
allocate_gpu
(
migraph
::
shape
s
);
...
...
@@ -40,7 +40,7 @@ struct hip_write
}
};
}
// namespace
miopen
}
// namespace
gpu
}
// namespace migraph
...
...
src/targets/gpu/include/migraph/gpu/kernels.hpp
View file @
20a9746c
#ifndef MIGRAPH_GUARD_MIGRAPHLIB_KERNELS_HPP
#define MIGRAPH_GUARD_MIGRAPHLIB_KERNELS_HPP
namespace
migraph
{
namespace
miopen
{
namespace
gpu
{
void
hip_contiguous
(
migraph
::
shape
output_shape
,
migraph
::
argument
arg
,
migraph
::
argument
result
);
}
// namespace
miopen
}
// namespace
gpu
}
// namespace migraph
...
...
src/targets/gpu/include/migraph/gpu/lowering.hpp
View file @
20a9746c
...
...
@@ -4,15 +4,15 @@
#include <migraph/program.hpp>
namespace
migraph
{
namespace
miopen
{
namespace
gpu
{
struct
lowering
{
std
::
string
name
()
const
{
return
"
miopen
::lowering"
;
}
std
::
string
name
()
const
{
return
"
gpu
::lowering"
;
}
void
apply
(
program
&
p
)
const
;
};
}
// namespace
miopen
}
// namespace
gpu
}
// namespace migraph
...
...
src/targets/gpu/include/migraph/gpu/miopen.hpp
View file @
20a9746c
...
...
@@ -6,7 +6,7 @@
#include <miopen/miopen.h>
namespace
migraph
{
namespace
miopen
{
namespace
gpu
{
using
miopen_handle
=
MIGRAPH_MANAGE_PTR
(
miopenHandle_t
,
miopenDestroy
);
using
tensor_descriptor
=
MIGRAPH_MANAGE_PTR
(
miopenTensorDescriptor_t
,
...
...
@@ -84,7 +84,7 @@ inline activation_descriptor make_relu()
return
ad
;
}
}
// namespace
miopen
}
// namespace
gpu
}
// namespace migraph
...
...
src/targets/gpu/include/migraph/gpu/rocblas.hpp
View file @
20a9746c
...
...
@@ -6,13 +6,13 @@
#include <rocblas.h>
namespace
migraph
{
namespace
miopen
{
namespace
gpu
{
using
rocblas_handle_ptr
=
MIGRAPH_MANAGE_PTR
(
rocblas_handle
,
rocblas_destroy_handle
);
rocblas_handle_ptr
create_rocblas_handle_ptr
();
}
// namespace
miopen
}
// namespace
gpu
}
// namespace migraph
...
...
src/targets/gpu/include/migraph/gpu/target.hpp
View file @
20a9746c
...
...
@@ -4,7 +4,7 @@
#include <migraph/program.hpp>
namespace
migraph
{
namespace
miopen
{
namespace
gpu
{
struct
target
{
...
...
@@ -13,7 +13,7 @@ struct target
migraph
::
context
get_context
()
const
;
};
}
// namespace
miopen
}
// namespace
gpu
}
// namespace migraph
...
...
src/targets/gpu/include/migraph/gpu/write_literals.hpp
View file @
20a9746c
...
...
@@ -5,16 +5,16 @@
namespace
migraph
{
namespace
miopen
{
namespace
gpu
{
struct
write_literals
{
std
::
string
name
()
const
{
return
"
miopen
::write_literals"
;
}
std
::
string
name
()
const
{
return
"
gpu
::write_literals"
;
}
void
apply
(
program
&
p
)
const
;
};
}
// namespace
miopen
}
// namespace
gpu
}
// namespace migraph
...
...
src/targets/gpu/lowering.cpp
View file @
20a9746c
...
...
@@ -13,14 +13,14 @@
#include <migraph/gpu/context.hpp>
namespace
migraph
{
namespace
miopen
{
namespace
gpu
{
struct
miopen_convolution
{
convolution
op
;
shared
<
convolution_descriptor
>
cd
;
std
::
string
name
()
const
{
return
"
miopen
::convolution"
;
}
std
::
string
name
()
const
{
return
"
gpu
::convolution"
;
}
shape
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
{
check_shapes
{
inputs
,
*
this
}.
has
(
3
);
...
...
@@ -71,7 +71,7 @@ struct miopen_pooling
pooling
op
;
shared
<
pooling_descriptor
>
pd
;
std
::
string
name
()
const
{
return
"
miopen
::pooling"
;
}
std
::
string
name
()
const
{
return
"
gpu
::pooling"
;
}
shape
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
{
check_shapes
{
inputs
,
*
this
}.
has
(
2
);
...
...
@@ -102,7 +102,7 @@ struct miopen_pooling
struct
miopen_add
{
std
::
string
name
()
const
{
return
"
miopen
::add"
;
}
std
::
string
name
()
const
{
return
"
gpu
::add"
;
}
shape
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
{
check_shapes
{
inputs
,
*
this
}.
has
(
3
);
...
...
@@ -149,7 +149,7 @@ struct miopen_add
struct
miopen_gemm
{
gemm
op
;
std
::
string
name
()
const
{
return
"
miopen
::convolution"
;
}
std
::
string
name
()
const
{
return
"
gpu
::convolution"
;
}
shape
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
{
check_shapes
{
inputs
,
*
this
}.
has
(
3
);
...
...
@@ -187,7 +187,7 @@ struct miopen_transpose
{
transpose
op
;
std
::
string
name
()
const
{
return
"
miopen
::transpose"
;
}
std
::
string
name
()
const
{
return
"
gpu
::transpose"
;
}
shape
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
{
check_shapes
{
inputs
,
*
this
}.
has
(
2
);
...
...
@@ -202,7 +202,7 @@ struct miopen_transpose
struct
miopen_contiguous
{
contiguous
op
;
std
::
string
name
()
const
{
return
"
miopen
::contiguous"
;
}
std
::
string
name
()
const
{
return
"
gpu
::contiguous"
;
}
shape
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
{
check_shapes
{
inputs
,
*
this
}.
has
(
2
);
...
...
@@ -218,7 +218,7 @@ struct miopen_contiguous
struct
miopen_relu
{
shared
<
activation_descriptor
>
ad
;
std
::
string
name
()
const
{
return
"
miopen
::relu"
;
}
std
::
string
name
()
const
{
return
"
gpu
::relu"
;
}
shape
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
{
check_shapes
{
inputs
,
*
this
}.
has
(
2
);
...
...
@@ -364,6 +364,6 @@ struct miopen_apply
void
lowering
::
apply
(
program
&
p
)
const
{
miopen_apply
{
&
p
}.
apply
();
}
}
// namespace
miopen
}
// namespace
gpu
}
// namespace migraph
src/targets/gpu/rocblas.cpp
View file @
20a9746c
#include <migraph/gpu/rocblas.hpp>
namespace
migraph
{
namespace
miopen
{
namespace
gpu
{
rocblas_handle_ptr
create_rocblas_handle_ptr
()
{
...
...
@@ -10,6 +10,6 @@ rocblas_handle_ptr create_rocblas_handle_ptr()
return
rocblas_handle_ptr
{
handle
};
}
}
// namespace
miopen
}
// namespace
gpu
}
// namespace migraph
src/targets/gpu/target.cpp
View file @
20a9746c
...
...
@@ -4,7 +4,7 @@
#include <migraph/gpu/context.hpp>
namespace
migraph
{
namespace
miopen
{
namespace
gpu
{
std
::
vector
<
pass
>
target
::
get_passes
(
migraph
::
context
&
)
const
{
...
...
@@ -19,6 +19,6 @@ migraph::context target::get_context() const
share
(
create_rocblas_handle_ptr
())};
}
}
// namespace
miopen
}
// namespace
gpu
}
// namespace migraph
src/targets/gpu/write_literals.cpp
View file @
20a9746c
...
...
@@ -5,7 +5,7 @@
namespace
migraph
{
namespace
miopen
{
namespace
gpu
{
void
write_literals
::
apply
(
program
&
p
)
const
{
...
...
@@ -20,6 +20,6 @@ void write_literals::apply(program& p) const
}
}
}
// namespace
miopen
}
// namespace
gpu
}
// namespace migraph
test/miopen/miopen.cpp
View file @
20a9746c
...
...
@@ -27,18 +27,18 @@ migraph::argument run_gpu()
{
V
v
;
auto
p
=
v
.
create_program
();
p
.
compile
(
migraph
::
miopen
::
target
{});
p
.
compile
(
migraph
::
gpu
::
target
{});
auto
m
=
v
.
create_params
();
for
(
auto
&&
e
:
m
)
{
e
.
second
=
migraph
::
miopen
::
to_gpu
(
e
.
second
);
e
.
second
=
migraph
::
gpu
::
to_gpu
(
e
.
second
);
}
m
[
"output"
]
=
migraph
::
miopen
::
to_gpu
(
migraph
::
generate_argument
(
p
.
get_parameter_shape
(
"output"
)));
migraph
::
gpu
::
to_gpu
(
migraph
::
generate_argument
(
p
.
get_parameter_shape
(
"output"
)));
return
migraph
::
miopen
::
from_gpu
(
p
.
eval
(
m
));
return
migraph
::
gpu
::
from_gpu
(
p
.
eval
(
m
));
}
template
<
class
V
>
...
...
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