Commit 0b217041 authored by Paul's avatar Paul
Browse files

Rename more things to migraphx

parent 53fd3f74
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include <migraphx/gpu/device/nary.hpp> #include <migraphx/gpu/device/nary.hpp>
namespace migraphx { namespace migraphx {
inline namespace MIGRAPH_INLINE_NS { inline namespace MIGRAPHX_INLINE_NS {
namespace gpu { namespace gpu {
namespace device { namespace device {
...@@ -14,5 +14,5 @@ void contiguous(hipStream_t stream, argument result, argument arg) ...@@ -14,5 +14,5 @@ void contiguous(hipStream_t stream, argument result, argument arg)
} // namespace device } // namespace device
} // namespace gpu } // namespace gpu
} // namespace MIGRAPH_INLINE_NS } // namespace MIGRAPHX_INLINE_NS
} // namespace migraphx } // namespace migraphx
#ifndef MIGRAPH_GUARD_RTGLIB_DEVICE_LAUNCH_HPP #ifndef MIGRAPHX_GUARD_RTGLIB_DEVICE_LAUNCH_HPP
#define MIGRAPH_GUARD_RTGLIB_DEVICE_LAUNCH_HPP #define MIGRAPHX_GUARD_RTGLIB_DEVICE_LAUNCH_HPP
#include <hip/hip_runtime.h> #include <hip/hip_runtime.h>
#include <migraphx/config.hpp> #include <migraphx/config.hpp>
namespace migraphx { namespace migraphx {
inline namespace MIGRAPH_INLINE_NS { inline namespace MIGRAPHX_INLINE_NS {
namespace gpu { namespace gpu {
namespace device { namespace device {
...@@ -53,14 +53,14 @@ inline auto gs_launch(hipStream_t stream, std::size_t n, std::size_t local = 102 ...@@ -53,14 +53,14 @@ inline auto gs_launch(hipStream_t stream, std::size_t n, std::size_t local = 102
// Workaround hcc's broken tile_static macro // Workaround hcc's broken tile_static macro
#ifdef tile_static #ifdef tile_static
#undef tile_static #undef tile_static
#define MIGRAPH_DEVICE_SHARED __attribute__((tile_static)) #define MIGRAPHX_DEVICE_SHARED __attribute__((tile_static))
#else #else
#define MIGRAPH_DEVICE_SHARED __shared__ #define MIGRAPHX_DEVICE_SHARED __shared__
#endif #endif
} // namespace device } // namespace device
} // namespace gpu } // namespace gpu
} // namespace MIGRAPH_INLINE_NS } // namespace MIGRAPHX_INLINE_NS
} // namespace migraphx } // namespace migraphx
#endif #endif
#ifndef MIGRAPH_GUARD_RTGLIB_DEVICE_NARY_HPP #ifndef MIGRAPHX_GUARD_RTGLIB_DEVICE_NARY_HPP
#define MIGRAPH_GUARD_RTGLIB_DEVICE_NARY_HPP #define MIGRAPHX_GUARD_RTGLIB_DEVICE_NARY_HPP
#include <migraphx/gpu/device/tensor.hpp> #include <migraphx/gpu/device/tensor.hpp>
#include <migraphx/gpu/device/launch.hpp> #include <migraphx/gpu/device/launch.hpp>
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include <migraphx/config.hpp> #include <migraphx/config.hpp>
namespace migraphx { namespace migraphx {
inline namespace MIGRAPH_INLINE_NS { inline namespace MIGRAPHX_INLINE_NS {
namespace gpu { namespace gpu {
namespace device { namespace device {
...@@ -87,7 +87,7 @@ void trinary_broadcast_vec_impl(hipStream_t stream, ...@@ -87,7 +87,7 @@ void trinary_broadcast_vec_impl(hipStream_t stream,
const std::size_t bdim_vec_len = bdim_len / vec_size; const std::size_t bdim_vec_len = bdim_len / vec_size;
launch(stream, nglobal, nlocal)([=](auto idx) __device__ { launch(stream, nglobal, nlocal)([=](auto idx) __device__ {
MIGRAPH_DEVICE_SHARED vec4<type> buffer[2048 / vec_size]; MIGRAPHX_DEVICE_SHARED vec4<type> buffer[2048 / vec_size];
// Load bias into LDS // Load bias into LDS
for(size_t i = idx.local; i < bdim_vec_len; i += nlocal) for(size_t i = idx.local; i < bdim_vec_len; i += nlocal)
{ {
...@@ -144,7 +144,7 @@ void trinary_broadcast_impl(hipStream_t stream, ...@@ -144,7 +144,7 @@ void trinary_broadcast_impl(hipStream_t stream,
const std::size_t n = output.size(); const std::size_t n = output.size();
launch(stream, nglobal, nlocal)([=](auto idx) __device__ { launch(stream, nglobal, nlocal)([=](auto idx) __device__ {
MIGRAPH_DEVICE_SHARED type buffer[2048]; MIGRAPHX_DEVICE_SHARED type buffer[2048];
// Load bias into LDS // Load bias into LDS
for(size_t i = idx.local; i < bdim_len; i += nlocal) for(size_t i = idx.local; i < bdim_len; i += nlocal)
{ {
...@@ -192,7 +192,7 @@ void binary_broadcast_vec_impl( ...@@ -192,7 +192,7 @@ void binary_broadcast_vec_impl(
const std::size_t bdim_vec_len = bdim_len / vec_size; const std::size_t bdim_vec_len = bdim_len / vec_size;
launch(stream, nglobal, nlocal)([=](auto idx) __device__ { launch(stream, nglobal, nlocal)([=](auto idx) __device__ {
MIGRAPH_DEVICE_SHARED vec4<type> buffer[2048 / vec_size]; MIGRAPHX_DEVICE_SHARED vec4<type> buffer[2048 / vec_size];
// Load bias into LDS // Load bias into LDS
for(size_t i = idx.local; i < bdim_vec_len; i += nlocal) for(size_t i = idx.local; i < bdim_vec_len; i += nlocal)
{ {
...@@ -243,7 +243,7 @@ void binary_broadcast_impl( ...@@ -243,7 +243,7 @@ void binary_broadcast_impl(
const std::size_t n = output.size(); const std::size_t n = output.size();
launch(stream, nglobal, nlocal)([=](auto idx) __device__ { launch(stream, nglobal, nlocal)([=](auto idx) __device__ {
MIGRAPH_DEVICE_SHARED type buffer[2048]; MIGRAPHX_DEVICE_SHARED type buffer[2048];
// Load bias into LDS // Load bias into LDS
for(size_t i = idx.local; i < bdim_len; i += nlocal) for(size_t i = idx.local; i < bdim_len; i += nlocal)
{ {
...@@ -396,7 +396,7 @@ inline auto nary(hipStream_t stream, ...@@ -396,7 +396,7 @@ inline auto nary(hipStream_t stream,
} // namespace device } // namespace device
} // namespace gpu } // namespace gpu
} // namespace MIGRAPH_INLINE_NS } // namespace MIGRAPHX_INLINE_NS
} // namespace migraphx } // namespace migraphx
#endif #endif
#ifndef MIGRAPH_GUARD_RTGLIB_DEAVICE_TENSOR_HPP #ifndef MIGRAPHX_GUARD_RTGLIB_DEAVICE_TENSOR_HPP
#define MIGRAPH_GUARD_RTGLIB_DEAVICE_TENSOR_HPP #define MIGRAPHX_GUARD_RTGLIB_DEAVICE_TENSOR_HPP
#include <hip/hip_runtime.h> #include <hip/hip_runtime.h>
#include <migraphx/functional.hpp> #include <migraphx/functional.hpp>
#include <migraphx/config.hpp> #include <migraphx/config.hpp>
namespace migraphx { namespace migraphx {
inline namespace MIGRAPH_INLINE_NS { inline namespace MIGRAPHX_INLINE_NS {
namespace gpu { namespace gpu {
namespace device { namespace device {
...@@ -87,7 +87,7 @@ struct hip_tensor_descriptor ...@@ -87,7 +87,7 @@ struct hip_tensor_descriptor
} // namespace device } // namespace device
} // namespace gpu } // namespace gpu
} // namespace MIGRAPH_INLINE_NS } // namespace MIGRAPHX_INLINE_NS
} // namespace migraphx } // namespace migraphx
#endif #endif
...@@ -5,14 +5,14 @@ ...@@ -5,14 +5,14 @@
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/ ==============================================================================*/
#ifndef MIGRAPH_GUARD_RTGLIB_GPU_DEVICE_TYPES_HPP #ifndef MIGRAPHX_GUARD_RTGLIB_GPU_DEVICE_TYPES_HPP
#define MIGRAPH_GUARD_RTGLIB_GPU_DEVICE_TYPES_HPP #define MIGRAPHX_GUARD_RTGLIB_GPU_DEVICE_TYPES_HPP
#include <migraphx/half.hpp> #include <migraphx/half.hpp>
#include <migraphx/config.hpp> #include <migraphx/config.hpp>
namespace migraphx { namespace migraphx {
inline namespace MIGRAPH_INLINE_NS { inline namespace MIGRAPHX_INLINE_NS {
namespace gpu { namespace gpu {
namespace device { namespace device {
...@@ -86,7 +86,7 @@ inline float to_hip_type(gpu_half x) { return x; } ...@@ -86,7 +86,7 @@ inline float to_hip_type(gpu_half x) { return x; }
} // namespace device } // namespace device
} // namespace gpu } // namespace gpu
} // namespace MIGRAPH_INLINE_NS } // namespace MIGRAPHX_INLINE_NS
} // namespace migraphx } // namespace migraphx
#endif #endif
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#include <migraphx/gpu/device/nary.hpp> #include <migraphx/gpu/device/nary.hpp>
namespace migraphx { namespace migraphx {
inline namespace MIGRAPH_INLINE_NS { inline namespace MIGRAPHX_INLINE_NS {
namespace gpu { namespace gpu {
namespace device { namespace device {
...@@ -22,5 +22,5 @@ void mul(hipStream_t stream, ...@@ -22,5 +22,5 @@ void mul(hipStream_t stream,
} // namespace device } // namespace device
} // namespace gpu } // namespace gpu
} // namespace MIGRAPH_INLINE_NS } // namespace MIGRAPHX_INLINE_NS
} // namespace migraphx } // namespace migraphx
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include <migraphx/gpu/device/types.hpp> #include <migraphx/gpu/device/types.hpp>
namespace migraphx { namespace migraphx {
inline namespace MIGRAPH_INLINE_NS { inline namespace MIGRAPHX_INLINE_NS {
namespace gpu { namespace gpu {
namespace device { namespace device {
...@@ -14,5 +14,5 @@ void sin(hipStream_t stream, const argument& result, const argument& arg) ...@@ -14,5 +14,5 @@ void sin(hipStream_t stream, const argument& result, const argument& arg)
} // namespace device } // namespace device
} // namespace gpu } // namespace gpu
} // namespace MIGRAPH_INLINE_NS } // namespace MIGRAPHX_INLINE_NS
} // namespace migraphx } // namespace migraphx
...@@ -9,12 +9,12 @@ ...@@ -9,12 +9,12 @@
#include <migraphx/pass_config.hpp> #include <migraphx/pass_config.hpp>
namespace migraphx { namespace migraphx {
inline namespace MIGRAPH_INLINE_NS { inline namespace MIGRAPHX_INLINE_NS {
namespace gpu { namespace gpu {
void eliminate_workspace::apply(program& p) const void eliminate_workspace::apply(program& p) const
{ {
if(!enabled(MIGRAPH_DISABLE_MEMORY_COLORING{})) if(!enabled(MIGRAPHX_DISABLE_MEMORY_COLORING{}))
return; return;
std::size_t n = 0; std::size_t n = 0;
...@@ -41,5 +41,5 @@ void eliminate_workspace::apply(program& p) const ...@@ -41,5 +41,5 @@ void eliminate_workspace::apply(program& p) const
} }
} // namespace gpu } // namespace gpu
} // namespace MIGRAPH_INLINE_NS } // namespace MIGRAPHX_INLINE_NS
} // namespace migraphx } // namespace migraphx
...@@ -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 MIGRAPHX_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)); MIGRAPHX_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"); MIGRAPHX_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"); MIGRAPHX_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"); MIGRAPHX_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"); MIGRAPHX_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"); MIGRAPHX_THROW("Failed to execute fusion plan");
return y; return y;
} }
}; };
MIGRAPH_PRED_MATCHER(bias_shape, instruction_ref ins) MIGRAPHX_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) MIGRAPHX_PRED_MATCHER(fusable_conv, instruction_ref ins)
{ {
if(ins->name() != "gpu::convolution") if(ins->name() != "gpu::convolution")
return false; return false;
...@@ -389,5 +389,5 @@ void fuse_ops::apply(program& p) const ...@@ -389,5 +389,5 @@ void fuse_ops::apply(program& p) const
} }
} // namespace gpu } // namespace gpu
} // namespace MIGRAPH_INLINE_NS } // namespace MIGRAPHX_INLINE_NS
} // namespace migraphx } // namespace migraphx
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include <utility> #include <utility>
namespace migraphx { namespace migraphx {
inline namespace MIGRAPH_INLINE_NS { inline namespace MIGRAPHX_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"); MIGRAPHX_THROW("Type unsupported by rocblas");
} }
template <class T> template <class T>
...@@ -111,5 +111,5 @@ argument miopen_gemm::compute(context& ctx, ...@@ -111,5 +111,5 @@ argument miopen_gemm::compute(context& ctx,
} }
} // namespace gpu } // namespace gpu
} // namespace MIGRAPH_INLINE_NS } // namespace MIGRAPHX_INLINE_NS
} // namespace migraphx } // namespace migraphx
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
#include <vector> #include <vector>
namespace migraphx { namespace migraphx {
inline namespace MIGRAPH_INLINE_NS { inline namespace MIGRAPHX_INLINE_NS {
namespace gpu { namespace gpu {
using hip_ptr = MIGRAPH_MANAGE_PTR(void, hipFree); using hip_ptr = MIGRAPHX_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)); }
...@@ -19,20 +19,20 @@ std::size_t get_available_gpu_memory() ...@@ -19,20 +19,20 @@ std::size_t get_available_gpu_memory()
size_t free, total; size_t free, 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)); MIGRAPHX_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)); MIGRAPHX_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)); MIGRAPHX_THROW("Gpu allocation failed: " + hip_error(status));
else else
allocate_gpu(sz, true); allocate_gpu(sz, true);
} }
...@@ -45,7 +45,7 @@ std::vector<T> read_from_gpu(const void* x, std::size_t sz) ...@@ -45,7 +45,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 MIGRAPHX_THROW("Copy from gpu failed: " + hip_error(status)); // NOLINT
return result; return result;
} }
...@@ -54,7 +54,7 @@ hip_ptr write_to_gpu(const void* x, std::size_t sz, bool host = false) ...@@ -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 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)); MIGRAPHX_THROW("Copy to gpu failed: " + hip_error(status));
return result; return result;
} }
...@@ -93,7 +93,7 @@ void set_device(std::size_t id) ...@@ -93,7 +93,7 @@ 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"); MIGRAPHX_THROW("Error setting device");
} }
void gpu_sync() { hipDeviceSynchronize(); } void gpu_sync() { hipDeviceSynchronize(); }
...@@ -103,12 +103,12 @@ void copy_to_gpu(argument src, argument dst) ...@@ -103,12 +103,12 @@ void copy_to_gpu(argument src, 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"); MIGRAPHX_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)); MIGRAPHX_THROW("Copy to gpu failed: " + hip_error(status));
} }
} // namespace gpu } // namespace gpu
} // namespace MIGRAPH_INLINE_NS } // namespace MIGRAPHX_INLINE_NS
} // namespace migraphx } // namespace migraphx
#ifndef MIGRAPH_GUARD_RTGLIB_ADD_HPP #ifndef MIGRAPHX_GUARD_RTGLIB_ADD_HPP
#define MIGRAPH_GUARD_RTGLIB_ADD_HPP #define MIGRAPHX_GUARD_RTGLIB_ADD_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 MIGRAPHX_INLINE_NS {
namespace gpu { namespace gpu {
struct hip_add struct hip_add
...@@ -40,7 +40,7 @@ struct miopen_add ...@@ -40,7 +40,7 @@ struct miopen_add
}; };
} // namespace gpu } // namespace gpu
} // namespace MIGRAPH_INLINE_NS } // namespace MIGRAPHX_INLINE_NS
} // namespace migraphx } // namespace migraphx
#endif #endif
#ifndef MIGRAPH_GUARD_RTGLIB_BATCHNORM_HPP #ifndef MIGRAPHX_GUARD_RTGLIB_BATCHNORM_HPP
#define MIGRAPH_GUARD_RTGLIB_BATCHNORM_HPP #define MIGRAPHX_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 MIGRAPHX_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 MIGRAPHX_INLINE_NS
} // namespace migraphx } // namespace migraphx
#endif #endif
#ifndef MIGRAPH_GUARD_RTGLIB_CONCAT_HPP #ifndef MIGRAPHX_GUARD_RTGLIB_CONCAT_HPP
#define MIGRAPH_GUARD_RTGLIB_CONCAT_HPP #define MIGRAPHX_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 MIGRAPHX_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 MIGRAPHX_INLINE_NS
} // namespace migraphx } // namespace migraphx
#endif #endif
#ifndef MIGRAPH_GUARD_RTGLIB_CONCAT_GPU_OPT_HPP #ifndef MIGRAPHX_GUARD_RTGLIB_CONCAT_GPU_OPT_HPP
#define MIGRAPH_GUARD_RTGLIB_CONCAT_GPU_OPT_HPP #define MIGRAPHX_GUARD_RTGLIB_CONCAT_GPU_OPT_HPP
#include <migraphx/gpu/concat.hpp> #include <migraphx/gpu/concat.hpp>
......
#ifndef MIGRAPH_GUARD_RTGLIB_CONTEXT_HPP #ifndef MIGRAPHX_GUARD_RTGLIB_CONTEXT_HPP
#define MIGRAPH_GUARD_RTGLIB_CONTEXT_HPP #define MIGRAPHX_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 MIGRAPHX_INLINE_NS {
namespace gpu { namespace gpu {
MIGRAPH_DECLARE_ENV_VAR(MIGRAPH_DISABLE_NULL_STREAM) MIGRAPHX_DECLARE_ENV_VAR(MIGRAPHX_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 = MIGRAPHX_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"); MIGRAPHX_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(MIGRAPHX_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(MIGRAPHX_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 MIGRAPHX_INLINE_NS
} // namespace migraphx } // namespace migraphx
#endif #endif
#ifndef MIGRAPH_GUARD_RTGLIB_CONTIGUOUS_HPP #ifndef MIGRAPHX_GUARD_RTGLIB_CONTIGUOUS_HPP
#define MIGRAPH_GUARD_RTGLIB_CONTIGUOUS_HPP #define MIGRAPHX_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 MIGRAPHX_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 MIGRAPHX_INLINE_NS
} // namespace migraphx } // namespace migraphx
#endif #endif
#ifndef MIGRAPH_GUARD_RTGLIB_CONVOLUTION_HPP #ifndef MIGRAPHX_GUARD_RTGLIB_CONVOLUTION_HPP
#define MIGRAPH_GUARD_RTGLIB_CONVOLUTION_HPP #define MIGRAPHX_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 MIGRAPHX_INLINE_NS {
namespace gpu { namespace gpu {
struct miopen_convolution struct miopen_convolution
...@@ -44,7 +44,7 @@ struct miopen_convolution ...@@ -44,7 +44,7 @@ struct miopen_convolution
}; };
} // namespace gpu } // namespace gpu
} // namespace MIGRAPH_INLINE_NS } // namespace MIGRAPHX_INLINE_NS
} // namespace migraphx } // namespace migraphx
#endif #endif
#ifndef MIGRAPH_GUARD_RTGLIB_DEVICE_ADD_HPP #ifndef MIGRAPHX_GUARD_RTGLIB_DEVICE_ADD_HPP
#define MIGRAPH_GUARD_RTGLIB_DEVICE_ADD_HPP #define MIGRAPHX_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 MIGRAPHX_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 MIGRAPHX_INLINE_NS
} // namespace migraphx } // namespace migraphx
#endif #endif
#ifndef MIGRAPH_GUARD_RTGLIB_DEVICE_ADD_RELU_HPP #ifndef MIGRAPHX_GUARD_RTGLIB_DEVICE_ADD_RELU_HPP
#define MIGRAPH_GUARD_RTGLIB_DEVICE_ADD_RELU_HPP #define MIGRAPHX_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 MIGRAPHX_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 MIGRAPHX_INLINE_NS
} // namespace migraphx } // namespace migraphx
#endif #endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment