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
682ad83a
Commit
682ad83a
authored
Nov 28, 2018
by
Shucai Xiao
Browse files
merge rename migraph to migraphx from master.
parents
66e48e7e
84e7335e
Changes
195
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
86 additions
and
86 deletions
+86
-86
src/targets/gpu/device/sin.cpp
src/targets/gpu/device/sin.cpp
+2
-2
src/targets/gpu/device/sinh.cpp
src/targets/gpu/device/sinh.cpp
+2
-2
src/targets/gpu/device/tan.cpp
src/targets/gpu/device/tan.cpp
+2
-2
src/targets/gpu/eliminate_workspace.cpp
src/targets/gpu/eliminate_workspace.cpp
+3
-3
src/targets/gpu/elu.cpp
src/targets/gpu/elu.cpp
+2
-2
src/targets/gpu/fuse_ops.cpp
src/targets/gpu/fuse_ops.cpp
+10
-10
src/targets/gpu/gemm.cpp
src/targets/gpu/gemm.cpp
+3
-3
src/targets/gpu/hip.cpp
src/targets/gpu/hip.cpp
+11
-11
src/targets/gpu/include/migraphx/gpu/abs.hpp
src/targets/gpu/include/migraphx/gpu/abs.hpp
+4
-4
src/targets/gpu/include/migraphx/gpu/acos.hpp
src/targets/gpu/include/migraphx/gpu/acos.hpp
+4
-4
src/targets/gpu/include/migraphx/gpu/add.hpp
src/targets/gpu/include/migraphx/gpu/add.hpp
+4
-4
src/targets/gpu/include/migraphx/gpu/asin.hpp
src/targets/gpu/include/migraphx/gpu/asin.hpp
+4
-4
src/targets/gpu/include/migraphx/gpu/atan.hpp
src/targets/gpu/include/migraphx/gpu/atan.hpp
+4
-4
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
+4
-4
src/targets/gpu/include/migraphx/gpu/cos.hpp
src/targets/gpu/include/migraphx/gpu/cos.hpp
+4
-4
No files found.
src/targets/gpu/device/sin.cpp
View file @
682ad83a
...
...
@@ -3,7 +3,7 @@
#include <migraphx/gpu/device/types.hpp>
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
gpu
{
namespace
device
{
...
...
@@ -14,5 +14,5 @@ void sin(hipStream_t stream, const argument& result, const argument& arg)
}
// namespace device
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
src/targets/gpu/device/sinh.cpp
View file @
682ad83a
...
...
@@ -3,7 +3,7 @@
#include <migraphx/gpu/device/types.hpp>
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
gpu
{
namespace
device
{
...
...
@@ -14,5 +14,5 @@ void sinh(hipStream_t stream, const argument& result, const argument& arg)
}
// namespace device
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
src/targets/gpu/device/tan.cpp
View file @
682ad83a
...
...
@@ -3,7 +3,7 @@
#include <migraphx/gpu/device/types.hpp>
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
gpu
{
namespace
device
{
...
...
@@ -14,5 +14,5 @@ void tan(hipStream_t stream, const argument& result, const argument& arg)
}
// namespace device
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
src/targets/gpu/eliminate_workspace.cpp
View file @
682ad83a
...
...
@@ -9,12 +9,12 @@
#include <migraphx/pass_config.hpp>
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
gpu
{
void
eliminate_workspace
::
apply
(
program
&
p
)
const
{
if
(
!
enabled
(
MIGRAPH_DISABLE_MEMORY_COLORING
{}))
if
(
!
enabled
(
MIGRAPH
X
_DISABLE_MEMORY_COLORING
{}))
return
;
std
::
size_t
n
=
0
;
...
...
@@ -41,5 +41,5 @@ void eliminate_workspace::apply(program& p) const
}
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
src/targets/gpu/elu.cpp
View file @
682ad83a
...
...
@@ -5,7 +5,7 @@
#include <utility>
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
gpu
{
shape
miopen_elu
::
compute_shape
(
const
std
::
vector
<
shape
>&
inputs
)
const
...
...
@@ -34,5 +34,5 @@ argument miopen_elu::compute(context& ctx,
}
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
src/targets/gpu/fuse_ops.cpp
View file @
682ad83a
...
...
@@ -6,7 +6,7 @@
#include <migraphx/instruction.hpp>
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
gpu
{
struct
fusion
...
...
@@ -38,7 +38,7 @@ struct fusion
op_t
result
;
auto
status
=
miopenFusionPlanGetOp
(
fp
.
get
(),
i
,
&
result
);
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
;
}
...
...
@@ -51,7 +51,7 @@ struct fusion
auto
t
=
keep_alive
(
make_tensor
(
b
));
auto
status
=
miopenCreateOpBiasForward
(
fp
.
get
(),
&
result
,
t
.
get
());
if
(
status
!=
miopenStatusSuccess
)
MIGRAPH_THROW
(
"Creating operator failed"
);
MIGRAPH
X
_THROW
(
"Creating operator failed"
);
return
result
;
}
...
...
@@ -60,7 +60,7 @@ struct fusion
op_t
result
;
auto
status
=
miopenCreateOpActivationForward
(
fp
.
get
(),
&
result
,
miopenActivationRELU
);
if
(
status
!=
miopenStatusSuccess
)
MIGRAPH_THROW
(
"Creating operator failed"
);
MIGRAPH
X
_THROW
(
"Creating operator failed"
);
return
result
;
}
...
...
@@ -71,7 +71,7 @@ struct fusion
auto
t
=
keep_alive
(
make_tensor
(
weights
));
auto
status
=
miopenCreateOpConvForward
(
fp
.
get
(),
&
result
,
cd
.
get
(),
t
.
get
());
if
(
status
!=
miopenStatusSuccess
)
MIGRAPH_THROW
(
"Creating operator failed"
);
MIGRAPH
X
_THROW
(
"Creating operator failed"
);
return
result
;
}
...
...
@@ -91,7 +91,7 @@ struct fusion
{
auto
status
=
miopenCompileFusionPlan
(
ctx
.
get_stream
().
get_miopen
(),
fp
.
get
());
if
(
status
!=
miopenStatusSuccess
)
MIGRAPH_THROW
(
"Compiling fusion plan failed"
);
MIGRAPH
X
_THROW
(
"Compiling fusion plan failed"
);
}
argument
execute
(
context
&
ctx
,
...
...
@@ -109,12 +109,12 @@ struct fusion
y
.
implicit
(),
fargs
.
get
());
if
(
status
!=
miopenStatusSuccess
)
MIGRAPH_THROW
(
"Failed to execute fusion plan"
);
MIGRAPH
X
_THROW
(
"Failed to execute fusion plan"
);
return
y
;
}
};
MIGRAPH_PRED_MATCHER
(
bias_shape
,
instruction_ref
ins
)
MIGRAPH
X
_PRED_MATCHER
(
bias_shape
,
instruction_ref
ins
)
{
auto
&&
s
=
ins
->
get_shape
();
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)
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"
)
return
false
;
...
...
@@ -389,5 +389,5 @@ void fuse_ops::apply(program& p) const
}
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
src/targets/gpu/gemm.cpp
View file @
682ad83a
...
...
@@ -5,7 +5,7 @@
#include <utility>
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
gpu
{
template
<
class
...
Ts
>
...
...
@@ -29,7 +29,7 @@ void generic_rocblas_gemm(shape::as<half>, Ts&&... xs)
template
<
class
T
,
class
...
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
>
...
...
@@ -111,5 +111,5 @@ argument miopen_gemm::compute(context& ctx,
}
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
src/targets/gpu/hip.cpp
View file @
682ad83a
...
...
@@ -7,10 +7,10 @@
#include <vector>
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
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
));
}
...
...
@@ -19,20 +19,20 @@ std::size_t get_available_gpu_memory()
size_t
free
,
total
;
auto
status
=
hipMemGetInfo
(
&
free
,
&
total
);
if
(
status
!=
hipSuccess
)
MIGRAPH_THROW
(
"Failed getting available memory: "
+
hip_error
(
status
));
MIGRAPH
X
_THROW
(
"Failed getting available memory: "
+
hip_error
(
status
));
return
free
;
}
hip_ptr
allocate_gpu
(
std
::
size_t
sz
,
bool
host
=
false
)
{
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
;
auto
status
=
host
?
hipHostMalloc
(
&
result
,
sz
)
:
hipMalloc
(
&
result
,
sz
);
if
(
status
!=
hipSuccess
)
{
if
(
host
)
MIGRAPH_THROW
(
"Gpu allocation failed: "
+
hip_error
(
status
));
MIGRAPH
X
_THROW
(
"Gpu allocation failed: "
+
hip_error
(
status
));
else
allocate_gpu
(
sz
,
true
);
}
...
...
@@ -45,7 +45,7 @@ std::vector<T> read_from_gpu(const void* x, std::size_t sz)
std
::
vector
<
T
>
result
(
sz
);
auto
status
=
hipMemcpy
(
result
.
data
(),
x
,
sz
*
sizeof
(
T
),
hipMemcpyDeviceToHost
);
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
;
}
...
...
@@ -54,7 +54,7 @@ hip_ptr write_to_gpu(const void* x, std::size_t sz, bool host = false)
auto
result
=
allocate_gpu
(
sz
,
host
);
auto
status
=
hipMemcpy
(
result
.
get
(),
x
,
sz
,
hipMemcpyHostToDevice
);
if
(
status
!=
hipSuccess
)
MIGRAPH_THROW
(
"Copy to gpu failed: "
+
hip_error
(
status
));
MIGRAPH
X
_THROW
(
"Copy to gpu failed: "
+
hip_error
(
status
));
return
result
;
}
...
...
@@ -93,7 +93,7 @@ void set_device(std::size_t id)
{
auto
status
=
hipSetDevice
(
id
);
if
(
status
!=
hipSuccess
)
MIGRAPH_THROW
(
"Error setting device"
);
MIGRAPH
X
_THROW
(
"Error setting device"
);
}
void
gpu_sync
()
{
hipDeviceSynchronize
();
}
...
...
@@ -103,12 +103,12 @@ void copy_to_gpu(argument src, argument dst)
std
::
size_t
src_size
=
src
.
get_shape
().
bytes
();
std
::
size_t
dst_size
=
dst
.
get_shape
().
bytes
();
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
);
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 MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
src/targets/gpu/include/migraphx/gpu/abs.hpp
View file @
682ad83a
#ifndef MIGRAPH_GUARD_RTGLIB_ABS_HPP
#define MIGRAPH_GUARD_RTGLIB_ABS_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_ABS_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_ABS_HPP
#include <migraphx/gpu/lowering.hpp>
#include <migraphx/manage_ptr.hpp>
...
...
@@ -19,7 +19,7 @@
#include <utility>
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
gpu
{
struct
miopen_abs
...
...
@@ -33,7 +33,7 @@ struct miopen_abs
};
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
#endif
src/targets/gpu/include/migraphx/gpu/acos.hpp
View file @
682ad83a
#ifndef MIGRAPH_GUARD_RTGLIB_ACOS_HPP
#define MIGRAPH_GUARD_RTGLIB_ACOS_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_ACOS_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_ACOS_HPP
#include <migraphx/gpu/lowering.hpp>
#include <migraphx/manage_ptr.hpp>
...
...
@@ -19,7 +19,7 @@
#include <utility>
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
gpu
{
struct
hip_acos
...
...
@@ -31,7 +31,7 @@ struct hip_acos
};
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
#endif
src/targets/gpu/include/migraphx/gpu/add.hpp
View file @
682ad83a
#ifndef MIGRAPH_GUARD_RTGLIB_ADD_HPP
#define MIGRAPH_GUARD_RTGLIB_ADD_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_ADD_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_ADD_HPP
#include <migraphx/gpu/lowering.hpp>
#include <migraphx/manage_ptr.hpp>
...
...
@@ -19,7 +19,7 @@
#include <utility>
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
gpu
{
struct
hip_add
...
...
@@ -40,7 +40,7 @@ struct miopen_add
};
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
#endif
src/targets/gpu/include/migraphx/gpu/asin.hpp
View file @
682ad83a
#ifndef MIGRAPH_GUARD_RTGLIB_ASIN_HPP
#define MIGRAPH_GUARD_RTGLIB_ASIN_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_ASIN_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_ASIN_HPP
#include <migraphx/gpu/lowering.hpp>
#include <migraphx/manage_ptr.hpp>
...
...
@@ -19,7 +19,7 @@
#include <utility>
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
gpu
{
struct
hip_asin
...
...
@@ -31,7 +31,7 @@ struct hip_asin
};
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
#endif
src/targets/gpu/include/migraphx/gpu/atan.hpp
View file @
682ad83a
#ifndef MIGRAPH_GUARD_RTGLIB_ATAN_HPP
#define MIGRAPH_GUARD_RTGLIB_ATAN_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_ATAN_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_ATAN_HPP
#include <migraphx/gpu/lowering.hpp>
#include <migraphx/manage_ptr.hpp>
...
...
@@ -19,7 +19,7 @@
#include <utility>
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
gpu
{
struct
hip_atan
...
...
@@ -31,7 +31,7 @@ struct hip_atan
};
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
#endif
src/targets/gpu/include/migraphx/gpu/batchnorm.hpp
View file @
682ad83a
#ifndef MIGRAPH_GUARD_RTGLIB_BATCHNORM_HPP
#define MIGRAPH_GUARD_RTGLIB_BATCHNORM_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_BATCHNORM_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_BATCHNORM_HPP
#include <migraphx/gpu/lowering.hpp>
#include <migraphx/manage_ptr.hpp>
...
...
@@ -19,7 +19,7 @@
#include <utility>
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
gpu
{
struct
miopen_batch_norm_inference
...
...
@@ -33,7 +33,7 @@ struct miopen_batch_norm_inference
};
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
#endif
src/targets/gpu/include/migraphx/gpu/concat.hpp
View file @
682ad83a
#ifndef MIGRAPH_GUARD_RTGLIB_CONCAT_HPP
#define MIGRAPH_GUARD_RTGLIB_CONCAT_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_CONCAT_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_CONCAT_HPP
#include <migraphx/gpu/lowering.hpp>
#include <migraphx/manage_ptr.hpp>
...
...
@@ -19,7 +19,7 @@
#include <utility>
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
gpu
{
struct
hip_concat
...
...
@@ -34,7 +34,7 @@ struct hip_concat
};
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
#endif
src/targets/gpu/include/migraphx/gpu/concat_gpu_opt.hpp
View file @
682ad83a
#ifndef MIGRAPH_GUARD_RTGLIB_CONCAT_GPU_OPT_HPP
#define MIGRAPH_GUARD_RTGLIB_CONCAT_GPU_OPT_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_CONCAT_GPU_OPT_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_CONCAT_GPU_OPT_HPP
#include <migraphx/gpu/concat.hpp>
...
...
src/targets/gpu/include/migraphx/gpu/context.hpp
View file @
682ad83a
#ifndef MIGRAPH_GUARD_RTGLIB_CONTEXT_HPP
#define MIGRAPH_GUARD_RTGLIB_CONTEXT_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_CONTEXT_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_CONTEXT_HPP
#include <migraphx/gpu/miopen.hpp>
#include <migraphx/gpu/rocblas.hpp>
...
...
@@ -8,10 +8,10 @@
#include <migraphx/config.hpp>
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
gpu
{
MIGRAPH_DECLARE_ENV_VAR
(
MIGRAPH_DISABLE_NULL_STREAM
)
MIGRAPH
X
_DECLARE_ENV_VAR
(
MIGRAPH
X
_DISABLE_NULL_STREAM
)
struct
hip_device
{
...
...
@@ -21,7 +21,7 @@ struct hip_device
struct
stream
{
using
hip_stream_ptr
=
MIGRAPH_MANAGE_PTR
(
hipStream_t
,
hipStreamDestroy
);
using
hip_stream_ptr
=
MIGRAPH
X
_MANAGE_PTR
(
hipStream_t
,
hipStreamDestroy
);
stream
()
{}
...
...
@@ -34,13 +34,13 @@ struct hip_device
hipStream_t
result
=
nullptr
;
auto
status
=
hipStreamCreate
(
&
result
);
if
(
status
!=
hipSuccess
)
MIGRAPH_THROW
(
"Failed to allocate stream"
);
MIGRAPH
X
_THROW
(
"Failed to allocate stream"
);
return
hip_stream_ptr
{
result
};
}
hipStream_t
get
()
{
if
(
enabled
(
MIGRAPH_DISABLE_NULL_STREAM
{}))
if
(
enabled
(
MIGRAPH
X
_DISABLE_NULL_STREAM
{}))
{
setup
();
if
(
s
==
nullptr
)
...
...
@@ -53,7 +53,7 @@ struct hip_device
auto
create_miopen_handle
()
{
if
(
enabled
(
MIGRAPH_DISABLE_NULL_STREAM
{}))
if
(
enabled
(
MIGRAPH
X
_DISABLE_NULL_STREAM
{}))
return
make_obj
<
miopen_handle
>
(
&
miopenCreateWithStream
,
get
());
else
return
make_obj
<
miopen_handle
>
(
&
miopenCreate
);
...
...
@@ -116,7 +116,7 @@ struct context
std
::
shared_ptr
<
hip_device
>
current_device
;
};
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
#endif
src/targets/gpu/include/migraphx/gpu/contiguous.hpp
View file @
682ad83a
#ifndef MIGRAPH_GUARD_RTGLIB_CONTIGUOUS_HPP
#define MIGRAPH_GUARD_RTGLIB_CONTIGUOUS_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_CONTIGUOUS_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_CONTIGUOUS_HPP
#include <migraphx/gpu/lowering.hpp>
#include <migraphx/manage_ptr.hpp>
...
...
@@ -19,7 +19,7 @@
#include <utility>
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
gpu
{
struct
miopen_contiguous
...
...
@@ -32,7 +32,7 @@ struct miopen_contiguous
};
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
#endif
src/targets/gpu/include/migraphx/gpu/convolution.hpp
View file @
682ad83a
#ifndef MIGRAPH_GUARD_RTGLIB_CONVOLUTION_HPP
#define MIGRAPH_GUARD_RTGLIB_CONVOLUTION_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_CONVOLUTION_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_CONVOLUTION_HPP
#include <migraphx/gpu/lowering.hpp>
#include <migraphx/manage_ptr.hpp>
...
...
@@ -19,7 +19,7 @@
#include <utility>
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
gpu
{
struct
miopen_convolution
...
...
@@ -44,7 +44,7 @@ struct miopen_convolution
};
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
#endif
src/targets/gpu/include/migraphx/gpu/cos.hpp
View file @
682ad83a
#ifndef MIGRAPH_GUARD_RTGLIB_COS_HPP
#define MIGRAPH_GUARD_RTGLIB_COS_HPP
#ifndef MIGRAPH
X
_GUARD_RTGLIB_COS_HPP
#define MIGRAPH
X
_GUARD_RTGLIB_COS_HPP
#include <migraphx/gpu/lowering.hpp>
#include <migraphx/manage_ptr.hpp>
...
...
@@ -20,7 +20,7 @@
#include <utility>
namespace
migraphx
{
inline
namespace
MIGRAPH_INLINE_NS
{
inline
namespace
MIGRAPH
X
_INLINE_NS
{
namespace
gpu
{
struct
hip_cos
...
...
@@ -32,7 +32,7 @@ struct hip_cos
};
}
// namespace gpu
}
// namespace MIGRAPH_INLINE_NS
}
// namespace MIGRAPH
X
_INLINE_NS
}
// namespace migraphx
#endif
Prev
1
…
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