Commit 4c031df7 authored by wsttiger's avatar wsttiger
Browse files

Fixed conflicts

parents d32653a5 ed5f9897
...@@ -2,9 +2,11 @@ ...@@ -2,9 +2,11 @@
#define MIGRAPH_GUARD_RTGLIB_MIOPEN_LOWERING_HPP #define MIGRAPH_GUARD_RTGLIB_MIOPEN_LOWERING_HPP
#include <migraph/program.hpp> #include <migraph/program.hpp>
#include <migraph/config.hpp>
#include <migraph/gpu/context.hpp> #include <migraph/gpu/context.hpp>
namespace migraph { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
namespace gpu { namespace gpu {
struct lowering struct lowering
...@@ -15,7 +17,7 @@ struct lowering ...@@ -15,7 +17,7 @@ struct lowering
}; };
} // namespace gpu } // namespace gpu
} // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
#endif #endif
...@@ -4,8 +4,10 @@ ...@@ -4,8 +4,10 @@
#include <migraph/manage_ptr.hpp> #include <migraph/manage_ptr.hpp>
#include <migraph/operators.hpp> #include <migraph/operators.hpp>
#include <miopen/miopen.h> #include <miopen/miopen.h>
#include <migraph/config.hpp>
namespace migraph { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
namespace gpu { namespace gpu {
using miopen_handle = MIGRAPH_MANAGE_PTR(miopenHandle_t, miopenDestroy); using miopen_handle = MIGRAPH_MANAGE_PTR(miopenHandle_t, miopenDestroy);
...@@ -115,7 +117,7 @@ inline fused_operator_args make_fused_args() ...@@ -115,7 +117,7 @@ inline fused_operator_args make_fused_args()
} }
} // namespace gpu } // namespace gpu
} // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
#endif #endif
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <migraph/operators.hpp> #include <migraph/operators.hpp>
#include <migraph/generate.hpp> #include <migraph/generate.hpp>
#include <migraph/shape_for_each.hpp> #include <migraph/shape_for_each.hpp>
#include <migraph/config.hpp>
#include <migraph/gpu/miopen.hpp> #include <migraph/gpu/miopen.hpp>
#include <migraph/gpu/hip.hpp> #include <migraph/gpu/hip.hpp>
#include <migraph/dfor.hpp> #include <migraph/dfor.hpp>
...@@ -18,6 +19,7 @@ ...@@ -18,6 +19,7 @@
#include <utility> #include <utility>
namespace migraph { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
namespace gpu { namespace gpu {
struct hip_mul struct hip_mul
...@@ -29,7 +31,7 @@ struct hip_mul ...@@ -29,7 +31,7 @@ struct hip_mul
}; };
} // namespace gpu } // namespace gpu
} // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
#endif #endif
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <migraph/operators.hpp> #include <migraph/operators.hpp>
#include <migraph/generate.hpp> #include <migraph/generate.hpp>
#include <migraph/shape_for_each.hpp> #include <migraph/shape_for_each.hpp>
#include <migraph/config.hpp>
#include <migraph/gpu/miopen.hpp> #include <migraph/gpu/miopen.hpp>
#include <migraph/gpu/hip.hpp> #include <migraph/gpu/hip.hpp>
#include <migraph/dfor.hpp> #include <migraph/dfor.hpp>
...@@ -18,6 +19,7 @@ ...@@ -18,6 +19,7 @@
#include <utility> #include <utility>
namespace migraph { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
namespace gpu { namespace gpu {
struct miopen_pooling struct miopen_pooling
...@@ -33,7 +35,7 @@ struct miopen_pooling ...@@ -33,7 +35,7 @@ struct miopen_pooling
}; };
} // namespace gpu } // namespace gpu
} // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
#endif #endif
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <migraph/operators.hpp> #include <migraph/operators.hpp>
#include <migraph/generate.hpp> #include <migraph/generate.hpp>
#include <migraph/shape_for_each.hpp> #include <migraph/shape_for_each.hpp>
#include <migraph/config.hpp>
#include <migraph/gpu/miopen.hpp> #include <migraph/gpu/miopen.hpp>
#include <migraph/gpu/hip.hpp> #include <migraph/gpu/hip.hpp>
#include <migraph/dfor.hpp> #include <migraph/dfor.hpp>
...@@ -18,6 +19,7 @@ ...@@ -18,6 +19,7 @@
#include <utility> #include <utility>
namespace migraph { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
namespace gpu { namespace gpu {
struct miopen_relu struct miopen_relu
...@@ -31,7 +33,7 @@ struct miopen_relu ...@@ -31,7 +33,7 @@ struct miopen_relu
}; };
} // namespace gpu } // namespace gpu
} // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
#endif #endif
...@@ -3,9 +3,11 @@ ...@@ -3,9 +3,11 @@
#include <migraph/manage_ptr.hpp> #include <migraph/manage_ptr.hpp>
#include <migraph/operators.hpp> #include <migraph/operators.hpp>
#include <migraph/config.hpp>
#include <rocblas.h> #include <rocblas.h>
namespace migraph { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
namespace gpu { 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);
...@@ -14,7 +16,7 @@ rocblas_handle_ptr create_rocblas_handle_ptr(); ...@@ -14,7 +16,7 @@ rocblas_handle_ptr create_rocblas_handle_ptr();
rocblas_handle_ptr create_rocblas_handle_ptr(hipStream_t s); rocblas_handle_ptr create_rocblas_handle_ptr(hipStream_t s);
} // namespace gpu } // namespace gpu
} // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
#endif #endif
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <migraph/operators.hpp> #include <migraph/operators.hpp>
#include <migraph/generate.hpp> #include <migraph/generate.hpp>
#include <migraph/shape_for_each.hpp> #include <migraph/shape_for_each.hpp>
#include <migraph/config.hpp>
#include <migraph/gpu/miopen.hpp> #include <migraph/gpu/miopen.hpp>
#include <migraph/gpu/hip.hpp> #include <migraph/gpu/hip.hpp>
#include <migraph/dfor.hpp> #include <migraph/dfor.hpp>
...@@ -18,6 +19,7 @@ ...@@ -18,6 +19,7 @@
#include <utility> #include <utility>
namespace migraph { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
namespace gpu { namespace gpu {
struct miopen_softmax struct miopen_softmax
...@@ -31,7 +33,7 @@ struct miopen_softmax ...@@ -31,7 +33,7 @@ struct miopen_softmax
}; };
} // namespace gpu } // namespace gpu
} // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
#endif #endif
...@@ -2,8 +2,10 @@ ...@@ -2,8 +2,10 @@
#define MIGRAPH_GUARD_MIGRAPHLIB_MIOPEN_TARGET_HPP #define MIGRAPH_GUARD_MIGRAPHLIB_MIOPEN_TARGET_HPP
#include <migraph/program.hpp> #include <migraph/program.hpp>
#include <migraph/config.hpp>
namespace migraph { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
namespace gpu { namespace gpu {
struct target struct target
...@@ -12,7 +14,9 @@ struct target ...@@ -12,7 +14,9 @@ struct target
std::vector<pass> get_passes(migraph::context& gctx) const; std::vector<pass> get_passes(migraph::context& gctx) const;
migraph::context get_context() const; migraph::context get_context() const;
}; };
} // namespace gpu } // namespace gpu
} // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
#endif #endif
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <migraph/gpu/context.hpp> #include <migraph/gpu/context.hpp>
namespace migraph { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
namespace gpu { namespace gpu {
...@@ -17,7 +18,7 @@ struct write_literals ...@@ -17,7 +18,7 @@ struct write_literals
}; };
} // namespace gpu } // namespace gpu
} // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
#endif #endif
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <utility> #include <utility>
namespace migraph { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
namespace gpu { namespace gpu {
shape miopen_leaky_relu::compute_shape(const std::vector<shape>& inputs) const shape miopen_leaky_relu::compute_shape(const std::vector<shape>& inputs) const
...@@ -33,5 +34,5 @@ argument miopen_leaky_relu::compute(context& ctx, ...@@ -33,5 +34,5 @@ argument miopen_leaky_relu::compute(context& ctx,
} }
} // namespace gpu } // namespace gpu
} // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <utility> #include <utility>
namespace migraph { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
namespace gpu { namespace gpu {
struct miopen_apply struct miopen_apply
...@@ -220,4 +221,5 @@ struct miopen_apply ...@@ -220,4 +221,5 @@ struct miopen_apply
void lowering::apply(program& p) const { miopen_apply{&p, ctx}.apply(); } void lowering::apply(program& p) const { miopen_apply{&p, ctx}.apply(); }
} // namespace gpu } // namespace gpu
} // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <utility> #include <utility>
namespace migraph { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
namespace gpu { namespace gpu {
shape hip_mul::compute_shape(const std::vector<shape>& inputs) const shape hip_mul::compute_shape(const std::vector<shape>& inputs) const
...@@ -21,5 +22,5 @@ argument hip_mul::compute(context& ctx, const shape&, const std::vector<argument ...@@ -21,5 +22,5 @@ argument hip_mul::compute(context& ctx, const shape&, const std::vector<argument
} }
} // namespace gpu } // namespace gpu
} // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <utility> #include <utility>
namespace migraph { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
namespace gpu { namespace gpu {
shape miopen_pooling::compute_shape(const std::vector<shape>& inputs) const shape miopen_pooling::compute_shape(const std::vector<shape>& inputs) const
...@@ -37,5 +38,5 @@ argument miopen_pooling::compute(context& ctx, ...@@ -37,5 +38,5 @@ argument miopen_pooling::compute(context& ctx,
} }
} // namespace gpu } // namespace gpu
} // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <utility> #include <utility>
namespace migraph { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
namespace gpu { namespace gpu {
shape miopen_relu::compute_shape(const std::vector<shape>& inputs) const shape miopen_relu::compute_shape(const std::vector<shape>& inputs) const
...@@ -33,5 +34,5 @@ argument miopen_relu::compute(context& ctx, ...@@ -33,5 +34,5 @@ argument miopen_relu::compute(context& ctx,
} }
} // namespace gpu } // namespace gpu
} // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
#include <migraph/gpu/rocblas.hpp> #include <migraph/gpu/rocblas.hpp>
namespace migraph { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
namespace gpu { namespace gpu {
rocblas_handle_ptr create_rocblas_handle_ptr() rocblas_handle_ptr create_rocblas_handle_ptr()
...@@ -18,5 +19,5 @@ rocblas_handle_ptr create_rocblas_handle_ptr(hipStream_t s) ...@@ -18,5 +19,5 @@ rocblas_handle_ptr create_rocblas_handle_ptr(hipStream_t s)
} }
} // namespace gpu } // namespace gpu
} // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <utility> #include <utility>
namespace migraph { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
namespace gpu { namespace gpu {
shape miopen_softmax::compute_shape(const std::vector<shape>& inputs) const shape miopen_softmax::compute_shape(const std::vector<shape>& inputs) const
...@@ -32,5 +33,5 @@ argument miopen_softmax::compute(context& ctx, ...@@ -32,5 +33,5 @@ argument miopen_softmax::compute(context& ctx,
} }
} // namespace gpu } // namespace gpu
} // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <migraph/gpu/concat_gpu_opt.hpp> #include <migraph/gpu/concat_gpu_opt.hpp>
namespace migraph { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
namespace gpu { namespace gpu {
std::vector<pass> target::get_passes(migraph::context& gctx) const std::vector<pass> target::get_passes(migraph::context& gctx) const
...@@ -60,4 +61,5 @@ std::string target::name() const { return "miopen"; } ...@@ -60,4 +61,5 @@ std::string target::name() const { return "miopen"; }
migraph::context target::get_context() const { return context{}; } migraph::context target::get_context() const { return context{}; }
} // namespace gpu } // namespace gpu
} // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include <migraph/env.hpp> #include <migraph/env.hpp>
namespace migraph { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
namespace gpu { namespace gpu {
MIGRAPH_DECLARE_ENV_VAR(MIGRAPH_COPY_LITERALS) MIGRAPH_DECLARE_ENV_VAR(MIGRAPH_COPY_LITERALS)
...@@ -51,5 +51,7 @@ void write_literals::apply(program& p) const ...@@ -51,5 +51,7 @@ void write_literals::apply(program& p) const
} }
} }
} }
} // namespace gpu } // namespace gpu
} // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
...@@ -14,6 +14,7 @@ struct contiguous_target ...@@ -14,6 +14,7 @@ struct contiguous_target
migraph::context get_context() const { return {}; } migraph::context get_context() const { return {}; }
}; };
// TODO: Add this test case
void literal_broadcast() void literal_broadcast()
{ {
migraph::program p; migraph::program p;
...@@ -25,7 +26,7 @@ void literal_broadcast() ...@@ -25,7 +26,7 @@ void literal_broadcast()
EXPECT(not p.get_shape().broadcasted()); EXPECT(not p.get_shape().broadcasted());
} }
void literal_transpose() TEST_CASE(literal_transpose)
{ {
migraph::program p; migraph::program p;
p.add_literal(get_2x2_transposed()); p.add_literal(get_2x2_transposed());
...@@ -36,7 +37,7 @@ void literal_transpose() ...@@ -36,7 +37,7 @@ void literal_transpose()
EXPECT(not p.get_shape().transposed()); EXPECT(not p.get_shape().transposed());
} }
void after_literal_transpose() TEST_CASE(after_literal_transpose)
{ {
migraph::program p; migraph::program p;
auto l = p.add_literal(get_2x2()); auto l = p.add_literal(get_2x2());
...@@ -51,7 +52,7 @@ void after_literal_transpose() ...@@ -51,7 +52,7 @@ void after_literal_transpose()
EXPECT(not p.get_shape().transposed()); EXPECT(not p.get_shape().transposed());
} }
void after_literal_broadcast() TEST_CASE(after_literal_broadcast)
{ {
migraph::program p; migraph::program p;
auto l1 = p.add_literal(get_2x2()); auto l1 = p.add_literal(get_2x2());
...@@ -67,7 +68,7 @@ void after_literal_broadcast() ...@@ -67,7 +68,7 @@ void after_literal_broadcast()
EXPECT(not p.get_shape().broadcasted()); EXPECT(not p.get_shape().broadcasted());
} }
void after_param_transpose() TEST_CASE(after_param_transpose)
{ {
migraph::program p; migraph::program p;
auto l = p.add_parameter("2x2", {migraph::shape::float_type, {2, 2}}); auto l = p.add_parameter("2x2", {migraph::shape::float_type, {2, 2}});
...@@ -82,7 +83,7 @@ void after_param_transpose() ...@@ -82,7 +83,7 @@ void after_param_transpose()
EXPECT(not p.get_shape().transposed()); EXPECT(not p.get_shape().transposed());
} }
void after_param_broadcast() TEST_CASE(after_param_broadcast)
{ {
migraph::program p; migraph::program p;
auto l1 = p.add_parameter("2x2", {migraph::shape::float_type, {2, 2}}); auto l1 = p.add_parameter("2x2", {migraph::shape::float_type, {2, 2}});
...@@ -98,12 +99,4 @@ void after_param_broadcast() ...@@ -98,12 +99,4 @@ void after_param_broadcast()
EXPECT(not p.get_shape().broadcasted()); EXPECT(not p.get_shape().broadcasted());
} }
int main() int main(int argc, const char* argv[]) { test::run(argc, argv); }
{
// literal_broadcast();
literal_transpose();
after_literal_transpose();
after_literal_broadcast();
after_param_transpose();
after_param_broadcast();
}
...@@ -14,7 +14,7 @@ struct cse_target ...@@ -14,7 +14,7 @@ struct cse_target
migraph::context get_context() const { return {}; } migraph::context get_context() const { return {}; }
}; };
void cse_test1() TEST_CASE(cse_test1)
{ {
migraph::program p1; migraph::program p1;
{ {
...@@ -38,7 +38,7 @@ void cse_test1() ...@@ -38,7 +38,7 @@ void cse_test1()
EXPECT(p1 == p2); EXPECT(p1 == p2);
} }
void cse_test2() TEST_CASE(cse_test2)
{ {
migraph::program p1; migraph::program p1;
{ {
...@@ -63,7 +63,7 @@ void cse_test2() ...@@ -63,7 +63,7 @@ void cse_test2()
EXPECT(p1 == p2); EXPECT(p1 == p2);
} }
void cse_test3() TEST_CASE(cse_test3)
{ {
migraph::program p1; migraph::program p1;
{ {
...@@ -86,7 +86,7 @@ void cse_test3() ...@@ -86,7 +86,7 @@ void cse_test3()
EXPECT(p1 == p2); EXPECT(p1 == p2);
} }
void cse_test4() TEST_CASE(cse_test4)
{ {
migraph::program p1; migraph::program p1;
{ {
...@@ -112,10 +112,4 @@ void cse_test4() ...@@ -112,10 +112,4 @@ void cse_test4()
EXPECT(p1 == p2); EXPECT(p1 == p2);
} }
int main() int main(int argc, const char* argv[]) { test::run(argc, argv); }
{
cse_test1();
cse_test2();
cse_test3();
cse_test4();
}
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