Commit 20a9746c authored by Paul's avatar Paul
Browse files

Rename namespace to gpu

parent c49b17e1
...@@ -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
...@@ -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
...@@ -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
......
...@@ -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
......
#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
......
...@@ -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
......
...@@ -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
......
...@@ -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
......
...@@ -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
......
...@@ -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
......
...@@ -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
#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
...@@ -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
...@@ -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
...@@ -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>
......
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