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