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
a5c1c7f6
Unverified
Commit
a5c1c7f6
authored
Feb 10, 2019
by
Paul Fultz II
Committed by
GitHub
Feb 10, 2019
Browse files
Merge branch 'develop' into mem_color_ordering_fix
parents
462a4920
d516b099
Changes
303
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
342 additions
and
97 deletions
+342
-97
src/targets/gpu/fuse_ops.cpp
src/targets/gpu/fuse_ops.cpp
+22
-25
src/targets/gpu/gather.cpp
src/targets/gpu/gather.cpp
+27
-0
src/targets/gpu/gemm.cpp
src/targets/gpu/gemm.cpp
+4
-3
src/targets/gpu/hip.cpp
src/targets/gpu/hip.cpp
+16
-15
src/targets/gpu/include/migraphx/gpu/abs.hpp
src/targets/gpu/include/migraphx/gpu/abs.hpp
+39
-0
src/targets/gpu/include/migraphx/gpu/acos.hpp
src/targets/gpu/include/migraphx/gpu/acos.hpp
+34
-0
src/targets/gpu/include/migraphx/gpu/add.hpp
src/targets/gpu/include/migraphx/gpu/add.hpp
+6
-18
src/targets/gpu/include/migraphx/gpu/asin.hpp
src/targets/gpu/include/migraphx/gpu/asin.hpp
+34
-0
src/targets/gpu/include/migraphx/gpu/atan.hpp
src/targets/gpu/include/migraphx/gpu/atan.hpp
+34
-0
src/targets/gpu/include/migraphx/gpu/batchnorm.hpp
src/targets/gpu/include/migraphx/gpu/batchnorm.hpp
+4
-4
src/targets/gpu/include/migraphx/gpu/concat.hpp
src/targets/gpu/include/migraphx/gpu/concat.hpp
+4
-4
src/targets/gpu/include/migraphx/gpu/concat_gpu_opt.hpp
src/targets/gpu/include/migraphx/gpu/concat_gpu_opt.hpp
+2
-2
src/targets/gpu/include/migraphx/gpu/context.hpp
src/targets/gpu/include/migraphx/gpu/context.hpp
+9
-9
src/targets/gpu/include/migraphx/gpu/contiguous.hpp
src/targets/gpu/include/migraphx/gpu/contiguous.hpp
+4
-4
src/targets/gpu/include/migraphx/gpu/convolution.hpp
src/targets/gpu/include/migraphx/gpu/convolution.hpp
+7
-5
src/targets/gpu/include/migraphx/gpu/cos.hpp
src/targets/gpu/include/migraphx/gpu/cos.hpp
+34
-0
src/targets/gpu/include/migraphx/gpu/cosh.hpp
src/targets/gpu/include/migraphx/gpu/cosh.hpp
+34
-0
src/targets/gpu/include/migraphx/gpu/device/acos.hpp
src/targets/gpu/include/migraphx/gpu/device/acos.hpp
+20
-0
src/targets/gpu/include/migraphx/gpu/device/add.hpp
src/targets/gpu/include/migraphx/gpu/device/add.hpp
+4
-4
src/targets/gpu/include/migraphx/gpu/device/add_relu.hpp
src/targets/gpu/include/migraphx/gpu/device/add_relu.hpp
+4
-4
No files found.
src/targets/gpu/fuse_ops.cpp
View file @
a5c1c7f6
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
#include <migraphx/instruction.hpp>
#include <migraphx/instruction.hpp>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
gpu
{
namespace
gpu
{
struct
fusion
struct
fusion
...
@@ -38,7 +38,7 @@ struct fusion
...
@@ -38,7 +38,7 @@ struct fusion
op_t
result
;
op_t
result
;
auto
status
=
miopenFusionPlanGetOp
(
fp
.
get
(),
i
,
&
result
);
auto
status
=
miopenFusionPlanGetOp
(
fp
.
get
(),
i
,
&
result
);
if
(
status
!=
miopenStatusSuccess
)
if
(
status
!=
miopenStatusSuccess
)
MIGRAPH_THROW
(
"Failed retrieving operator at "
+
std
::
to_string
(
i
));
MIGRAPH
X
_THROW
(
"Failed retrieving operator at "
+
std
::
to_string
(
i
));
return
result
;
return
result
;
}
}
...
@@ -51,7 +51,7 @@ struct fusion
...
@@ -51,7 +51,7 @@ struct fusion
auto
t
=
keep_alive
(
make_tensor
(
b
));
auto
t
=
keep_alive
(
make_tensor
(
b
));
auto
status
=
miopenCreateOpBiasForward
(
fp
.
get
(),
&
result
,
t
.
get
());
auto
status
=
miopenCreateOpBiasForward
(
fp
.
get
(),
&
result
,
t
.
get
());
if
(
status
!=
miopenStatusSuccess
)
if
(
status
!=
miopenStatusSuccess
)
MIGRAPH_THROW
(
"Creating operator failed"
);
MIGRAPH
X
_THROW
(
"Creating operator failed"
);
return
result
;
return
result
;
}
}
...
@@ -60,7 +60,7 @@ struct fusion
...
@@ -60,7 +60,7 @@ struct fusion
op_t
result
;
op_t
result
;
auto
status
=
miopenCreateOpActivationForward
(
fp
.
get
(),
&
result
,
miopenActivationRELU
);
auto
status
=
miopenCreateOpActivationForward
(
fp
.
get
(),
&
result
,
miopenActivationRELU
);
if
(
status
!=
miopenStatusSuccess
)
if
(
status
!=
miopenStatusSuccess
)
MIGRAPH_THROW
(
"Creating operator failed"
);
MIGRAPH
X
_THROW
(
"Creating operator failed"
);
return
result
;
return
result
;
}
}
...
@@ -71,7 +71,7 @@ struct fusion
...
@@ -71,7 +71,7 @@ struct fusion
auto
t
=
keep_alive
(
make_tensor
(
weights
));
auto
t
=
keep_alive
(
make_tensor
(
weights
));
auto
status
=
miopenCreateOpConvForward
(
fp
.
get
(),
&
result
,
cd
.
get
(),
t
.
get
());
auto
status
=
miopenCreateOpConvForward
(
fp
.
get
(),
&
result
,
cd
.
get
(),
t
.
get
());
if
(
status
!=
miopenStatusSuccess
)
if
(
status
!=
miopenStatusSuccess
)
MIGRAPH_THROW
(
"Creating operator failed"
);
MIGRAPH
X
_THROW
(
"Creating operator failed"
);
return
result
;
return
result
;
}
}
...
@@ -91,7 +91,7 @@ struct fusion
...
@@ -91,7 +91,7 @@ struct fusion
{
{
auto
status
=
miopenCompileFusionPlan
(
ctx
.
get_stream
().
get_miopen
(),
fp
.
get
());
auto
status
=
miopenCompileFusionPlan
(
ctx
.
get_stream
().
get_miopen
(),
fp
.
get
());
if
(
status
!=
miopenStatusSuccess
)
if
(
status
!=
miopenStatusSuccess
)
MIGRAPH_THROW
(
"Compiling fusion plan failed"
);
MIGRAPH
X
_THROW
(
"Compiling fusion plan failed"
);
}
}
argument
execute
(
context
&
ctx
,
argument
execute
(
context
&
ctx
,
...
@@ -109,12 +109,12 @@ struct fusion
...
@@ -109,12 +109,12 @@ struct fusion
y
.
implicit
(),
y
.
implicit
(),
fargs
.
get
());
fargs
.
get
());
if
(
status
!=
miopenStatusSuccess
)
if
(
status
!=
miopenStatusSuccess
)
MIGRAPH_THROW
(
"Failed to execute fusion plan"
);
MIGRAPH
X
_THROW
(
"Failed to execute fusion plan"
);
return
y
;
return
y
;
}
}
};
};
MIGRAPH_PRED_MATCHER
(
bias_shape
,
instruction_ref
ins
)
MIGRAPH
X
_PRED_MATCHER
(
bias_shape
,
instruction_ref
ins
)
{
{
auto
&&
s
=
ins
->
get_shape
();
auto
&&
s
=
ins
->
get_shape
();
return
s
.
broadcasted
()
and
s
.
strides
().
size
()
==
4
and
s
.
strides
()[
0
]
==
0
and
return
s
.
broadcasted
()
and
s
.
strides
().
size
()
==
4
and
s
.
strides
()[
0
]
==
0
and
...
@@ -128,7 +128,7 @@ std::array<T, sizeof...(Ts) + 1> make_array(T x, Ts... xs)
...
@@ -128,7 +128,7 @@ std::array<T, sizeof...(Ts) + 1> make_array(T x, Ts... xs)
return
{
std
::
move
(
x
),
std
::
move
(
static_cast
<
T
>
(
xs
))...};
return
{
std
::
move
(
x
),
std
::
move
(
static_cast
<
T
>
(
xs
))...};
}
}
MIGRAPH_PRED_MATCHER
(
fusable_conv
,
instruction_ref
ins
)
MIGRAPH
X
_PRED_MATCHER
(
fusable_conv
,
instruction_ref
ins
)
{
{
if
(
ins
->
name
()
!=
"gpu::convolution"
)
if
(
ins
->
name
()
!=
"gpu::convolution"
)
return
false
;
return
false
;
...
@@ -137,6 +137,8 @@ MIGRAPH_PRED_MATCHER(fusable_conv, instruction_ref ins)
...
@@ -137,6 +137,8 @@ MIGRAPH_PRED_MATCHER(fusable_conv, instruction_ref ins)
auto
wei
=
ins
->
inputs
().
at
(
1
)
->
get_shape
();
auto
wei
=
ins
->
inputs
().
at
(
1
)
->
get_shape
();
assert
(
wei
.
lens
().
size
()
==
4
);
assert
(
wei
.
lens
().
size
()
==
4
);
auto
conv
=
any_cast
<
miopen_convolution
>
(
ins
->
get_operator
());
auto
conv
=
any_cast
<
miopen_convolution
>
(
ins
->
get_operator
());
if
(
conv
.
op
.
group
>
1
)
return
false
;
if
(
wei
.
lens
()[
1
]
>
512
and
conv
.
algo
!=
miopenConvolutionFwdAlgoWinograd
)
if
(
wei
.
lens
()[
1
]
>
512
and
conv
.
algo
!=
miopenConvolutionFwdAlgoWinograd
)
return
false
;
return
false
;
auto
op
=
conv
.
op
;
auto
op
=
conv
.
op
;
...
@@ -265,17 +267,15 @@ struct miopen_conv_bias
...
@@ -265,17 +267,15 @@ struct miopen_conv_bias
argument
compute
(
context
&
ctx
,
const
shape
&
,
const
std
::
vector
<
argument
>&
args
)
const
argument
compute
(
context
&
ctx
,
const
shape
&
,
const
std
::
vector
<
argument
>&
args
)
const
{
{
auto
fargs
=
make_fused_args
();
auto
fargs
=
make_fused_args
();
float
alpha
=
1
,
beta
=
0
;
float
alpha
=
1
;
float
beta
=
0
;
miopenSetOpArgsConvForward
(
fargs
.
get
(),
conv
,
&
alpha
,
&
beta
,
args
[
1
].
implicit
());
miopenSetOpArgsConvForward
(
fargs
.
get
(),
conv
,
&
alpha
,
&
beta
,
args
[
1
].
implicit
());
miopenSetOpArgsBiasForward
(
fargs
.
get
(),
bias
,
&
alpha
,
&
beta
,
args
[
3
].
implicit
());
miopenSetOpArgsBiasForward
(
fargs
.
get
(),
bias
,
&
alpha
,
&
beta
,
args
[
3
].
implicit
());
return
f
.
execute
(
ctx
,
fargs
,
args
[
0
],
args
[
4
]);
return
f
.
execute
(
ctx
,
fargs
,
args
[
0
],
args
[
4
]);
}
}
shape
compile
(
context
&
ctx
)
void
finalize
(
context
&
ctx
,
const
shape
&
,
const
std
::
vector
<
shape
>&
)
{
f
.
compile
(
ctx
);
}
{
shape
get_workspace
(
context
&
ctx
)
{
return
f
.
get_workspace
(
ctx
);
}
f
.
compile
(
ctx
);
return
f
.
get_workspace
(
ctx
);
}
int
output_alias
(
const
std
::
vector
<
shape
>&
shapes
)
const
{
return
shapes
.
size
()
-
1
;
}
int
output_alias
(
const
std
::
vector
<
shape
>&
shapes
)
const
{
return
shapes
.
size
()
-
1
;
}
};
};
...
@@ -308,18 +308,15 @@ struct miopen_conv_bias_relu
...
@@ -308,18 +308,15 @@ struct miopen_conv_bias_relu
argument
compute
(
context
&
ctx
,
const
shape
&
,
const
std
::
vector
<
argument
>&
args
)
const
argument
compute
(
context
&
ctx
,
const
shape
&
,
const
std
::
vector
<
argument
>&
args
)
const
{
{
auto
fargs
=
make_fused_args
();
auto
fargs
=
make_fused_args
();
float
alpha
=
1
,
beta
=
0
;
float
alpha
=
1
;
float
beta
=
0
;
miopenSetOpArgsConvForward
(
fargs
.
get
(),
conv
,
&
alpha
,
&
beta
,
args
[
1
].
implicit
());
miopenSetOpArgsConvForward
(
fargs
.
get
(),
conv
,
&
alpha
,
&
beta
,
args
[
1
].
implicit
());
miopenSetOpArgsBiasForward
(
fargs
.
get
(),
bias
,
&
alpha
,
&
beta
,
args
[
3
].
implicit
());
miopenSetOpArgsBiasForward
(
fargs
.
get
(),
bias
,
&
alpha
,
&
beta
,
args
[
3
].
implicit
());
miopenSetOpArgsActivForward
(
fargs
.
get
(),
relu
,
&
alpha
,
&
beta
,
0
,
0
,
0
);
miopenSetOpArgsActivForward
(
fargs
.
get
(),
relu
,
&
alpha
,
&
beta
,
0
,
0
,
0
);
return
f
.
execute
(
ctx
,
fargs
,
args
[
0
],
args
[
4
]);
return
f
.
execute
(
ctx
,
fargs
,
args
[
0
],
args
[
4
]);
}
}
void
finalize
(
context
&
ctx
,
const
shape
&
,
const
std
::
vector
<
shape
>&
)
{
f
.
compile
(
ctx
);
}
shape
compile
(
context
&
ctx
)
shape
get_workspace
(
context
&
ctx
)
{
return
f
.
get_workspace
(
ctx
);
}
{
f
.
compile
(
ctx
);
return
f
.
get_workspace
(
ctx
);
}
int
output_alias
(
const
std
::
vector
<
shape
>&
shapes
)
const
{
return
shapes
.
size
()
-
1
;
}
int
output_alias
(
const
std
::
vector
<
shape
>&
shapes
)
const
{
return
shapes
.
size
()
-
1
;
}
};
};
...
@@ -346,8 +343,8 @@ void apply_conv_bias(context& ctx, program& p, match::matcher_result r)
...
@@ -346,8 +343,8 @@ void apply_conv_bias(context& ctx, program& p, match::matcher_result r)
Op
cb
{
conv_op
,
input_ins
->
get_shape
(),
weights_ins
->
get_shape
(),
bias_ins
->
get_shape
()};
Op
cb
{
conv_op
,
input_ins
->
get_shape
(),
weights_ins
->
get_shape
(),
bias_ins
->
get_shape
()};
// TODO: Insert ws allocation
// TODO: Insert ws allocation
auto
ws
=
cb
.
compil
e
(
ctx
);
auto
ws
=
cb
.
get_workspac
e
(
ctx
);
(
void
)
ws
;
p
.
replace_instruction
(
ins
,
cb
,
input_ins
,
weights_ins
,
old_ws_ins
,
bias_ins
,
alloc_ins
);
p
.
replace_instruction
(
ins
,
cb
,
input_ins
,
weights_ins
,
old_ws_ins
,
bias_ins
,
alloc_ins
);
}
}
...
@@ -389,5 +386,5 @@ void fuse_ops::apply(program& p) const
...
@@ -389,5 +386,5 @@ void fuse_ops::apply(program& p) const
}
}
}
// namespace gpu
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
src/targets/gpu/gather.cpp
0 → 100644
View file @
a5c1c7f6
#include <migraphx/gpu/gather.hpp>
#include <migraphx/operators.hpp>
#include <migraphx/manage_ptr.hpp>
#include <migraphx/gpu/miopen.hpp>
#include <migraphx/gpu/device/concat.hpp>
#include <utility>
namespace
migraphx
{
inline
namespace
MIGRAPHX_INLINE_NS
{
namespace
gpu
{
shape
hip_gather
::
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
{
inputs
.
pop_back
();
return
op
.
compute_shape
(
inputs
);
}
argument
hip_gather
::
compute
(
context
&
ctx
,
const
shape
&
output_shape
,
const
std
::
vector
<
argument
>&
args
)
const
{
return
device
::
gather
(
ctx
.
get_stream
().
get
(),
output_shape
,
args
,
op
.
axis
);
}
}
// namespace gpu
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace migraphx
src/targets/gpu/gemm.cpp
View file @
a5c1c7f6
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
#include <utility>
#include <utility>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
gpu
{
namespace
gpu
{
template
<
class
...
Ts
>
template
<
class
...
Ts
>
...
@@ -29,7 +29,7 @@ void generic_rocblas_gemm(shape::as<half>, Ts&&... xs)
...
@@ -29,7 +29,7 @@ void generic_rocblas_gemm(shape::as<half>, Ts&&... xs)
template
<
class
T
,
class
...
Ts
>
template
<
class
T
,
class
...
Ts
>
void
generic_rocblas_gemm
(
shape
::
as
<
T
>
,
Ts
&&
...)
void
generic_rocblas_gemm
(
shape
::
as
<
T
>
,
Ts
&&
...)
{
{
MIGRAPH_THROW
(
"Type unsupported by rocblas"
);
MIGRAPH
X
_THROW
(
"Type unsupported by rocblas"
);
}
}
template
<
class
T
>
template
<
class
T
>
...
@@ -107,9 +107,10 @@ argument miopen_gemm::compute(context& ctx,
...
@@ -107,9 +107,10 @@ argument miopen_gemm::compute(context& ctx,
ldc
);
ldc
);
});
});
return
args
[
2
];
return
args
[
2
];
}
}
}
// namespace gpu
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
src/targets/gpu/hip.cpp
View file @
a5c1c7f6
...
@@ -7,32 +7,33 @@
...
@@ -7,32 +7,33 @@
#include <vector>
#include <vector>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
gpu
{
namespace
gpu
{
using
hip_ptr
=
MIGRAPH_MANAGE_PTR
(
void
,
hipFree
);
using
hip_ptr
=
MIGRAPH
X
_MANAGE_PTR
(
void
,
hipFree
);
std
::
string
hip_error
(
int
error
)
{
return
hipGetErrorString
(
static_cast
<
hipError_t
>
(
error
));
}
std
::
string
hip_error
(
int
error
)
{
return
hipGetErrorString
(
static_cast
<
hipError_t
>
(
error
));
}
std
::
size_t
get_available_gpu_memory
()
std
::
size_t
get_available_gpu_memory
()
{
{
size_t
free
,
total
;
size_t
free
;
size_t
total
;
auto
status
=
hipMemGetInfo
(
&
free
,
&
total
);
auto
status
=
hipMemGetInfo
(
&
free
,
&
total
);
if
(
status
!=
hipSuccess
)
if
(
status
!=
hipSuccess
)
MIGRAPH_THROW
(
"Failed getting available memory: "
+
hip_error
(
status
));
MIGRAPH
X
_THROW
(
"Failed getting available memory: "
+
hip_error
(
status
));
return
free
;
return
free
;
}
}
hip_ptr
allocate_gpu
(
std
::
size_t
sz
,
bool
host
=
false
)
hip_ptr
allocate_gpu
(
std
::
size_t
sz
,
bool
host
=
false
)
{
{
if
(
sz
>
get_available_gpu_memory
())
if
(
sz
>
get_available_gpu_memory
())
MIGRAPH_THROW
(
"Memory not available to allocate buffer: "
+
std
::
to_string
(
sz
));
MIGRAPH
X
_THROW
(
"Memory not available to allocate buffer: "
+
std
::
to_string
(
sz
));
void
*
result
;
void
*
result
;
auto
status
=
host
?
hipHostMalloc
(
&
result
,
sz
)
:
hipMalloc
(
&
result
,
sz
);
auto
status
=
host
?
hipHostMalloc
(
&
result
,
sz
)
:
hipMalloc
(
&
result
,
sz
);
if
(
status
!=
hipSuccess
)
if
(
status
!=
hipSuccess
)
{
{
if
(
host
)
if
(
host
)
MIGRAPH_THROW
(
"Gpu allocation failed: "
+
hip_error
(
status
));
MIGRAPH
X
_THROW
(
"Gpu allocation failed: "
+
hip_error
(
status
));
else
else
allocate_gpu
(
sz
,
true
);
allocate_gpu
(
sz
,
true
);
}
}
...
@@ -45,7 +46,7 @@ std::vector<T> read_from_gpu(const void* x, std::size_t sz)
...
@@ -45,7 +46,7 @@ std::vector<T> read_from_gpu(const void* x, std::size_t sz)
std
::
vector
<
T
>
result
(
sz
);
std
::
vector
<
T
>
result
(
sz
);
auto
status
=
hipMemcpy
(
result
.
data
(),
x
,
sz
*
sizeof
(
T
),
hipMemcpyDeviceToHost
);
auto
status
=
hipMemcpy
(
result
.
data
(),
x
,
sz
*
sizeof
(
T
),
hipMemcpyDeviceToHost
);
if
(
status
!=
hipSuccess
)
if
(
status
!=
hipSuccess
)
MIGRAPH_THROW
(
"Copy from gpu failed: "
+
hip_error
(
status
));
// NOLINT
MIGRAPH
X
_THROW
(
"Copy from gpu failed: "
+
hip_error
(
status
));
// NOLINT
return
result
;
return
result
;
}
}
...
@@ -54,7 +55,7 @@ hip_ptr write_to_gpu(const void* x, std::size_t sz, bool host = false)
...
@@ -54,7 +55,7 @@ hip_ptr write_to_gpu(const void* x, std::size_t sz, bool host = false)
auto
result
=
allocate_gpu
(
sz
,
host
);
auto
result
=
allocate_gpu
(
sz
,
host
);
auto
status
=
hipMemcpy
(
result
.
get
(),
x
,
sz
,
hipMemcpyHostToDevice
);
auto
status
=
hipMemcpy
(
result
.
get
(),
x
,
sz
,
hipMemcpyHostToDevice
);
if
(
status
!=
hipSuccess
)
if
(
status
!=
hipSuccess
)
MIGRAPH_THROW
(
"Copy to gpu failed: "
+
hip_error
(
status
));
MIGRAPH
X
_THROW
(
"Copy to gpu failed: "
+
hip_error
(
status
));
return
result
;
return
result
;
}
}
...
@@ -72,13 +73,13 @@ argument allocate_gpu(const shape& s, bool host)
...
@@ -72,13 +73,13 @@ argument allocate_gpu(const shape& s, bool host)
return
{
s
,
[
p
]()
mutable
{
return
reinterpret_cast
<
char
*>
(
p
.
get
());
}};
return
{
s
,
[
p
]()
mutable
{
return
reinterpret_cast
<
char
*>
(
p
.
get
());
}};
}
}
argument
to_gpu
(
argument
arg
,
bool
host
)
argument
to_gpu
(
const
argument
&
arg
,
bool
host
)
{
{
auto
p
=
share
(
write_to_gpu
(
arg
.
data
(),
arg
.
get_shape
().
bytes
(),
host
));
auto
p
=
share
(
write_to_gpu
(
arg
.
data
(),
arg
.
get_shape
().
bytes
(),
host
));
return
{
arg
.
get_shape
(),
[
p
]()
mutable
{
return
reinterpret_cast
<
char
*>
(
p
.
get
());
}};
return
{
arg
.
get_shape
(),
[
p
]()
mutable
{
return
reinterpret_cast
<
char
*>
(
p
.
get
());
}};
}
}
argument
from_gpu
(
argument
arg
)
argument
from_gpu
(
const
argument
&
arg
)
{
{
argument
result
;
argument
result
;
arg
.
visit
([
&
](
auto
x
)
{
arg
.
visit
([
&
](
auto
x
)
{
...
@@ -93,22 +94,22 @@ void set_device(std::size_t id)
...
@@ -93,22 +94,22 @@ void set_device(std::size_t id)
{
{
auto
status
=
hipSetDevice
(
id
);
auto
status
=
hipSetDevice
(
id
);
if
(
status
!=
hipSuccess
)
if
(
status
!=
hipSuccess
)
MIGRAPH_THROW
(
"Error setting device"
);
MIGRAPH
X
_THROW
(
"Error setting device"
);
}
}
void
gpu_sync
()
{
hipDeviceSynchronize
();
}
void
gpu_sync
()
{
hipDeviceSynchronize
();
}
void
copy_to_gpu
(
argument
src
,
argument
dst
)
void
copy_to_gpu
(
const
argument
&
src
,
const
argument
&
dst
)
{
{
std
::
size_t
src_size
=
src
.
get_shape
().
bytes
();
std
::
size_t
src_size
=
src
.
get_shape
().
bytes
();
std
::
size_t
dst_size
=
dst
.
get_shape
().
bytes
();
std
::
size_t
dst_size
=
dst
.
get_shape
().
bytes
();
if
(
src_size
>
dst_size
)
if
(
src_size
>
dst_size
)
MIGRAPH_THROW
(
"Not enough memory available in destination to do copy"
);
MIGRAPH
X
_THROW
(
"Not enough memory available in destination to do copy"
);
auto
status
=
hipMemcpy
(
dst
.
data
(),
src
.
data
(),
src_size
,
hipMemcpyHostToDevice
);
auto
status
=
hipMemcpy
(
dst
.
data
(),
src
.
data
(),
src_size
,
hipMemcpyHostToDevice
);
if
(
status
!=
hipSuccess
)
if
(
status
!=
hipSuccess
)
MIGRAPH_THROW
(
"Copy to gpu failed: "
+
hip_error
(
status
));
MIGRAPH
X
_THROW
(
"Copy to gpu failed: "
+
hip_error
(
status
));
}
}
}
// namespace gpu
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
src/targets/gpu/include/migraphx/gpu/abs.hpp
0 → 100644
View file @
a5c1c7f6
#ifndef MIGRAPHX_GUARD_RTGLIB_ABS_HPP
#define MIGRAPHX_GUARD_RTGLIB_ABS_HPP
#include <migraphx/gpu/lowering.hpp>
#include <migraphx/manage_ptr.hpp>
#include <migraphx/instruction.hpp>
#include <migraphx/operators.hpp>
#include <migraphx/generate.hpp>
#include <migraphx/shape_for_each.hpp>
#include <migraphx/config.hpp>
#include <migraphx/gpu/miopen.hpp>
#include <migraphx/gpu/hip.hpp>
#include <migraphx/dfor.hpp>
#include <migraphx/gpu/device/contiguous.hpp>
#include <migraphx/gpu/device/add.hpp>
#include <migraphx/iterator_for.hpp>
#include <migraphx/gpu/rocblas.hpp>
#include <migraphx/gpu/context.hpp>
#include <utility>
namespace
migraphx
{
inline
namespace
MIGRAPHX_INLINE_NS
{
namespace
gpu
{
struct
miopen_abs
{
shared
<
activation_descriptor
>
ad
;
std
::
string
name
()
const
{
return
"gpu::abs"
;
}
shape
compute_shape
(
const
std
::
vector
<
shape
>&
inputs
)
const
;
argument
compute
(
context
&
ctx
,
const
shape
&
output_shape
,
const
std
::
vector
<
argument
>&
args
)
const
;
int
output_alias
(
const
std
::
vector
<
shape
>&
shapes
)
const
{
return
shapes
.
size
()
-
1
;
}
};
}
// namespace gpu
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace migraphx
#endif
src/targets/gpu/include/migraphx/gpu/acos.hpp
0 → 100644
View file @
a5c1c7f6
#ifndef MIGRAPHX_GUARD_RTGLIB_ACOS_HPP
#define MIGRAPHX_GUARD_RTGLIB_ACOS_HPP
#include <migraphx/gpu/lowering.hpp>
#include <migraphx/gpu/oper.hpp>
#include <migraphx/manage_ptr.hpp>
#include <migraphx/instruction.hpp>
#include <migraphx/operators.hpp>
#include <migraphx/generate.hpp>
#include <migraphx/shape_for_each.hpp>
#include <migraphx/gpu/miopen.hpp>
#include <migraphx/gpu/hip.hpp>
#include <migraphx/dfor.hpp>
#include <migraphx/gpu/device/contiguous.hpp>
#include <migraphx/gpu/device/acos.hpp>
#include <migraphx/iterator_for.hpp>
#include <migraphx/gpu/rocblas.hpp>
#include <migraphx/gpu/context.hpp>
#include <migraphx/config.hpp>
#include <utility>
namespace
migraphx
{
inline
namespace
MIGRAPHX_INLINE_NS
{
namespace
gpu
{
struct
hip_acos
:
unary_device
<
hip_acos
,
device
::
acos
>
{
};
}
// namespace gpu
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace migraphx
#endif
src/targets/gpu/include/migraphx/gpu/add.hpp
View file @
a5c1c7f6
#ifndef MIGRAPH_GUARD_RTGLIB_ADD_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_ADD_HPP
#define MIGRAPH_GUARD_RTGLIB_ADD_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_ADD_HPP
#include <migraphx/gpu/lowering.hpp>
#include <migraphx/gpu/lowering.hpp>
#include <migraphx/gpu/oper.hpp>
#include <migraphx/manage_ptr.hpp>
#include <migraphx/manage_ptr.hpp>
#include <migraphx/instruction.hpp>
#include <migraphx/instruction.hpp>
#include <migraphx/operators.hpp>
#include <migraphx/operators.hpp>
...
@@ -19,28 +20,15 @@
...
@@ -19,28 +20,15 @@
#include <utility>
#include <utility>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
gpu
{
namespace
gpu
{
struct
hip_add
struct
hip_add
:
binary_device
<
hip_add
,
device
::
add
>
{
{
std
::
string
name
()
const
{
return
"gpu::add"
;
}
shape
compute_shape
(
const
std
::
vector
<
shape
>&
inputs
)
const
;
argument
compute
(
context
&
,
const
shape
&
,
const
std
::
vector
<
argument
>&
args
)
const
;
int
output_alias
(
const
std
::
vector
<
shape
>&
shapes
)
const
{
return
shapes
.
size
()
-
1
;
}
};
struct
miopen_add
{
std
::
string
name
()
const
{
return
"gpu::add"
;
}
shape
compute_shape
(
const
std
::
vector
<
shape
>&
inputs
)
const
;
argument
compute
(
context
&
ctx
,
const
shape
&
output_shape
,
const
std
::
vector
<
argument
>&
args
)
const
;
int
output_alias
(
const
std
::
vector
<
shape
>&
shapes
)
const
{
return
shapes
.
size
()
-
1
;
}
};
};
}
// namespace gpu
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
src/targets/gpu/include/migraphx/gpu/asin.hpp
0 → 100644
View file @
a5c1c7f6
#ifndef MIGRAPHX_GUARD_RTGLIB_ASIN_HPP
#define MIGRAPHX_GUARD_RTGLIB_ASIN_HPP
#include <migraphx/gpu/lowering.hpp>
#include <migraphx/gpu/oper.hpp>
#include <migraphx/manage_ptr.hpp>
#include <migraphx/instruction.hpp>
#include <migraphx/operators.hpp>
#include <migraphx/generate.hpp>
#include <migraphx/shape_for_each.hpp>
#include <migraphx/gpu/miopen.hpp>
#include <migraphx/gpu/hip.hpp>
#include <migraphx/dfor.hpp>
#include <migraphx/gpu/device/contiguous.hpp>
#include <migraphx/gpu/device/asin.hpp>
#include <migraphx/iterator_for.hpp>
#include <migraphx/gpu/rocblas.hpp>
#include <migraphx/gpu/context.hpp>
#include <migraphx/config.hpp>
#include <utility>
namespace
migraphx
{
inline
namespace
MIGRAPHX_INLINE_NS
{
namespace
gpu
{
struct
hip_asin
:
unary_device
<
hip_asin
,
device
::
asin
>
{
};
}
// namespace gpu
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace migraphx
#endif
src/targets/gpu/include/migraphx/gpu/atan.hpp
0 → 100644
View file @
a5c1c7f6
#ifndef MIGRAPHX_GUARD_RTGLIB_ATAN_HPP
#define MIGRAPHX_GUARD_RTGLIB_ATAN_HPP
#include <migraphx/gpu/lowering.hpp>
#include <migraphx/gpu/oper.hpp>
#include <migraphx/manage_ptr.hpp>
#include <migraphx/instruction.hpp>
#include <migraphx/operators.hpp>
#include <migraphx/generate.hpp>
#include <migraphx/shape_for_each.hpp>
#include <migraphx/gpu/miopen.hpp>
#include <migraphx/gpu/hip.hpp>
#include <migraphx/dfor.hpp>
#include <migraphx/gpu/device/contiguous.hpp>
#include <migraphx/gpu/device/atan.hpp>
#include <migraphx/iterator_for.hpp>
#include <migraphx/gpu/rocblas.hpp>
#include <migraphx/gpu/context.hpp>
#include <migraphx/config.hpp>
#include <utility>
namespace
migraphx
{
inline
namespace
MIGRAPHX_INLINE_NS
{
namespace
gpu
{
struct
hip_atan
:
unary_device
<
hip_atan
,
device
::
atan
>
{
};
}
// namespace gpu
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace migraphx
#endif
src/targets/gpu/include/migraphx/gpu/batchnorm.hpp
View file @
a5c1c7f6
#ifndef MIGRAPH_GUARD_RTGLIB_BATCHNORM_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_BATCHNORM_HPP
#define MIGRAPH_GUARD_RTGLIB_BATCHNORM_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_BATCHNORM_HPP
#include <migraphx/gpu/lowering.hpp>
#include <migraphx/gpu/lowering.hpp>
#include <migraphx/manage_ptr.hpp>
#include <migraphx/manage_ptr.hpp>
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
#include <utility>
#include <utility>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
gpu
{
namespace
gpu
{
struct
miopen_batch_norm_inference
struct
miopen_batch_norm_inference
...
@@ -33,7 +33,7 @@ struct miopen_batch_norm_inference
...
@@ -33,7 +33,7 @@ struct miopen_batch_norm_inference
};
};
}
// namespace gpu
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
src/targets/gpu/include/migraphx/gpu/concat.hpp
View file @
a5c1c7f6
#ifndef MIGRAPH_GUARD_RTGLIB_CONCAT_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_CONCAT_HPP
#define MIGRAPH_GUARD_RTGLIB_CONCAT_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_CONCAT_HPP
#include <migraphx/gpu/lowering.hpp>
#include <migraphx/gpu/lowering.hpp>
#include <migraphx/manage_ptr.hpp>
#include <migraphx/manage_ptr.hpp>
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
#include <utility>
#include <utility>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
gpu
{
namespace
gpu
{
struct
hip_concat
struct
hip_concat
...
@@ -34,7 +34,7 @@ struct hip_concat
...
@@ -34,7 +34,7 @@ struct hip_concat
};
};
}
// namespace gpu
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
src/targets/gpu/include/migraphx/gpu/concat_gpu_opt.hpp
View file @
a5c1c7f6
#ifndef MIGRAPH_GUARD_RTGLIB_CONCAT_GPU_OPT_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_CONCAT_GPU_OPT_HPP
#define MIGRAPH_GUARD_RTGLIB_CONCAT_GPU_OPT_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_CONCAT_GPU_OPT_HPP
#include <migraphx/gpu/concat.hpp>
#include <migraphx/gpu/concat.hpp>
...
...
src/targets/gpu/include/migraphx/gpu/context.hpp
View file @
a5c1c7f6
#ifndef MIGRAPH_GUARD_RTGLIB_CONTEXT_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_CONTEXT_HPP
#define MIGRAPH_GUARD_RTGLIB_CONTEXT_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_CONTEXT_HPP
#include <migraphx/gpu/miopen.hpp>
#include <migraphx/gpu/miopen.hpp>
#include <migraphx/gpu/rocblas.hpp>
#include <migraphx/gpu/rocblas.hpp>
...
@@ -8,10 +8,10 @@
...
@@ -8,10 +8,10 @@
#include <migraphx/config.hpp>
#include <migraphx/config.hpp>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
gpu
{
namespace
gpu
{
MIGRAPH_DECLARE_ENV_VAR
(
MIGRAPH_DISABLE_NULL_STREAM
)
MIGRAPH
X
_DECLARE_ENV_VAR
(
MIGRAPH
X
_DISABLE_NULL_STREAM
)
struct
hip_device
struct
hip_device
{
{
...
@@ -21,7 +21,7 @@ struct hip_device
...
@@ -21,7 +21,7 @@ struct hip_device
struct
stream
struct
stream
{
{
using
hip_stream_ptr
=
MIGRAPH_MANAGE_PTR
(
hipStream_t
,
hipStreamDestroy
);
using
hip_stream_ptr
=
MIGRAPH
X
_MANAGE_PTR
(
hipStream_t
,
hipStreamDestroy
);
stream
()
{}
stream
()
{}
...
@@ -34,13 +34,13 @@ struct hip_device
...
@@ -34,13 +34,13 @@ struct hip_device
hipStream_t
result
=
nullptr
;
hipStream_t
result
=
nullptr
;
auto
status
=
hipStreamCreate
(
&
result
);
auto
status
=
hipStreamCreate
(
&
result
);
if
(
status
!=
hipSuccess
)
if
(
status
!=
hipSuccess
)
MIGRAPH_THROW
(
"Failed to allocate stream"
);
MIGRAPH
X
_THROW
(
"Failed to allocate stream"
);
return
hip_stream_ptr
{
result
};
return
hip_stream_ptr
{
result
};
}
}
hipStream_t
get
()
hipStream_t
get
()
{
{
if
(
enabled
(
MIGRAPH_DISABLE_NULL_STREAM
{}))
if
(
enabled
(
MIGRAPH
X
_DISABLE_NULL_STREAM
{}))
{
{
setup
();
setup
();
if
(
s
==
nullptr
)
if
(
s
==
nullptr
)
...
@@ -53,7 +53,7 @@ struct hip_device
...
@@ -53,7 +53,7 @@ struct hip_device
auto
create_miopen_handle
()
auto
create_miopen_handle
()
{
{
if
(
enabled
(
MIGRAPH_DISABLE_NULL_STREAM
{}))
if
(
enabled
(
MIGRAPH
X
_DISABLE_NULL_STREAM
{}))
return
make_obj
<
miopen_handle
>
(
&
miopenCreateWithStream
,
get
());
return
make_obj
<
miopen_handle
>
(
&
miopenCreateWithStream
,
get
());
else
else
return
make_obj
<
miopen_handle
>
(
&
miopenCreate
);
return
make_obj
<
miopen_handle
>
(
&
miopenCreate
);
...
@@ -116,7 +116,7 @@ struct context
...
@@ -116,7 +116,7 @@ struct context
std
::
shared_ptr
<
hip_device
>
current_device
;
std
::
shared_ptr
<
hip_device
>
current_device
;
};
};
}
// namespace gpu
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
src/targets/gpu/include/migraphx/gpu/contiguous.hpp
View file @
a5c1c7f6
#ifndef MIGRAPH_GUARD_RTGLIB_CONTIGUOUS_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_CONTIGUOUS_HPP
#define MIGRAPH_GUARD_RTGLIB_CONTIGUOUS_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_CONTIGUOUS_HPP
#include <migraphx/gpu/lowering.hpp>
#include <migraphx/gpu/lowering.hpp>
#include <migraphx/manage_ptr.hpp>
#include <migraphx/manage_ptr.hpp>
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
#include <utility>
#include <utility>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
gpu
{
namespace
gpu
{
struct
miopen_contiguous
struct
miopen_contiguous
...
@@ -32,7 +32,7 @@ struct miopen_contiguous
...
@@ -32,7 +32,7 @@ struct miopen_contiguous
};
};
}
// namespace gpu
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
src/targets/gpu/include/migraphx/gpu/convolution.hpp
View file @
a5c1c7f6
#ifndef MIGRAPH_GUARD_RTGLIB_CONVOLUTION_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_CONVOLUTION_HPP
#define MIGRAPH_GUARD_RTGLIB_CONVOLUTION_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_CONVOLUTION_HPP
#include <migraphx/gpu/lowering.hpp>
#include <migraphx/gpu/lowering.hpp>
#include <migraphx/manage_ptr.hpp>
#include <migraphx/manage_ptr.hpp>
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
#include <utility>
#include <utility>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
gpu
{
namespace
gpu
{
struct
miopen_convolution
struct
miopen_convolution
...
@@ -27,6 +27,7 @@ struct miopen_convolution
...
@@ -27,6 +27,7 @@ struct miopen_convolution
op
::
convolution
op
;
op
::
convolution
op
;
shared
<
convolution_descriptor
>
cd
;
shared
<
convolution_descriptor
>
cd
;
miopenConvFwdAlgorithm_t
algo
{};
miopenConvFwdAlgorithm_t
algo
{};
miopenHandle_t
handle
=
nullptr
;
template
<
class
Self
,
class
F
>
template
<
class
Self
,
class
F
>
static
auto
reflect
(
Self
&
self
,
F
f
)
static
auto
reflect
(
Self
&
self
,
F
f
)
...
@@ -39,12 +40,13 @@ struct miopen_convolution
...
@@ -39,12 +40,13 @@ struct miopen_convolution
shape
compute_shape
(
const
std
::
vector
<
shape
>&
inputs
)
const
;
shape
compute_shape
(
const
std
::
vector
<
shape
>&
inputs
)
const
;
argument
argument
compute
(
context
&
ctx
,
const
shape
&
output_shape
,
const
std
::
vector
<
argument
>&
args
)
const
;
compute
(
context
&
ctx
,
const
shape
&
output_shape
,
const
std
::
vector
<
argument
>&
args
)
const
;
shape
compile
(
context
&
ctx
,
const
shape
&
output_shape
,
std
::
vector
<
instruction_ref
>
inputs
);
shape
compile
(
context
&
ctx
,
const
shape
&
output_shape
,
std
::
vector
<
shape
>
inputs
);
void
finalize
(
context
&
ctx
,
const
shape
&
output_shape
,
std
::
vector
<
shape
>
inputs
);
int
output_alias
(
const
std
::
vector
<
shape
>&
shapes
)
const
{
return
shapes
.
size
()
-
1
;
}
int
output_alias
(
const
std
::
vector
<
shape
>&
shapes
)
const
{
return
shapes
.
size
()
-
1
;
}
};
};
}
// namespace gpu
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
src/targets/gpu/include/migraphx/gpu/cos.hpp
0 → 100644
View file @
a5c1c7f6
#ifndef MIGRAPHX_GUARD_RTGLIB_COS_HPP
#define MIGRAPHX_GUARD_RTGLIB_COS_HPP
#include <migraphx/gpu/lowering.hpp>
#include <migraphx/gpu/oper.hpp>
#include <migraphx/manage_ptr.hpp>
#include <migraphx/instruction.hpp>
#include <migraphx/operators.hpp>
#include <migraphx/generate.hpp>
#include <migraphx/shape_for_each.hpp>
#include <migraphx/gpu/miopen.hpp>
#include <migraphx/gpu/hip.hpp>
#include <migraphx/dfor.hpp>
#include <migraphx/gpu/device/contiguous.hpp>
#include <migraphx/gpu/device/cos.hpp>
#include <migraphx/iterator_for.hpp>
#include <migraphx/gpu/rocblas.hpp>
#include <migraphx/gpu/context.hpp>
#include <migraphx/config.hpp>
#include <utility>
namespace
migraphx
{
inline
namespace
MIGRAPHX_INLINE_NS
{
namespace
gpu
{
struct
hip_cos
:
unary_device
<
hip_cos
,
device
::
cos
>
{
};
}
// namespace gpu
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace migraphx
#endif
src/targets/gpu/include/migraphx/gpu/cosh.hpp
0 → 100644
View file @
a5c1c7f6
#ifndef MIGRAPHX_GUARD_RTGLIB_COSH_HPP
#define MIGRAPHX_GUARD_RTGLIB_COSH_HPP
#include <migraphx/gpu/lowering.hpp>
#include <migraphx/gpu/oper.hpp>
#include <migraphx/manage_ptr.hpp>
#include <migraphx/instruction.hpp>
#include <migraphx/operators.hpp>
#include <migraphx/generate.hpp>
#include <migraphx/shape_for_each.hpp>
#include <migraphx/gpu/miopen.hpp>
#include <migraphx/gpu/hip.hpp>
#include <migraphx/dfor.hpp>
#include <migraphx/gpu/device/contiguous.hpp>
#include <migraphx/gpu/device/cosh.hpp>
#include <migraphx/iterator_for.hpp>
#include <migraphx/gpu/rocblas.hpp>
#include <migraphx/gpu/context.hpp>
#include <migraphx/config.hpp>
#include <utility>
namespace
migraphx
{
inline
namespace
MIGRAPHX_INLINE_NS
{
namespace
gpu
{
struct
hip_cosh
:
unary_device
<
hip_cosh
,
device
::
cosh
>
{
};
}
// namespace gpu
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace migraphx
#endif
src/targets/gpu/include/migraphx/gpu/device/acos.hpp
0 → 100644
View file @
a5c1c7f6
#ifndef MIGRAPHX_GUARD_RTGLIB_DEVICE_ACOS_HPP
#define MIGRAPHX_GUARD_RTGLIB_DEVICE_ACOS_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
acos
(
hipStream_t
stream
,
const
argument
&
result
,
const
argument
&
arg
);
}
// namespace device
}
// namespace gpu
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace migraphx
#endif
src/targets/gpu/include/migraphx/gpu/device/add.hpp
View file @
a5c1c7f6
#ifndef MIGRAPH_GUARD_RTGLIB_DEVICE_ADD_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_DEVICE_ADD_HPP
#define MIGRAPH_GUARD_RTGLIB_DEVICE_ADD_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_DEVICE_ADD_HPP
#include <migraphx/argument.hpp>
#include <migraphx/argument.hpp>
#include <migraphx/config.hpp>
#include <migraphx/config.hpp>
#include <hip/hip_runtime_api.h>
#include <hip/hip_runtime_api.h>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
gpu
{
namespace
gpu
{
namespace
device
{
namespace
device
{
...
@@ -21,7 +21,7 @@ void add(hipStream_t stream,
...
@@ -21,7 +21,7 @@ void add(hipStream_t stream,
}
// namespace device
}
// namespace device
}
// namespace gpu
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
src/targets/gpu/include/migraphx/gpu/device/add_relu.hpp
View file @
a5c1c7f6
#ifndef MIGRAPH_GUARD_RTGLIB_DEVICE_ADD_RELU_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_DEVICE_ADD_RELU_HPP
#define MIGRAPH_GUARD_RTGLIB_DEVICE_ADD_RELU_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_DEVICE_ADD_RELU_HPP
#include <migraphx/argument.hpp>
#include <migraphx/argument.hpp>
#include <migraphx/config.hpp>
#include <migraphx/config.hpp>
#include <hip/hip_runtime_api.h>
#include <hip/hip_runtime_api.h>
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
gpu
{
namespace
gpu
{
namespace
device
{
namespace
device
{
...
@@ -24,7 +24,7 @@ void add_relu(hipStream_t stream,
...
@@ -24,7 +24,7 @@ void add_relu(hipStream_t stream,
}
// namespace device
}
// namespace device
}
// namespace gpu
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
}
// namespace migraphx
#endif
#endif
Prev
1
…
4
5
6
7
8
9
10
11
12
…
16
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