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

Rename more things to migraphx

parent 53fd3f74
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,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_apply struct miopen_apply
...@@ -232,5 +232,5 @@ struct miopen_apply ...@@ -232,5 +232,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 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 {
shape hip_mul::compute_shape(const std::vector<shape>& inputs) const shape hip_mul::compute_shape(const std::vector<shape>& inputs) const
...@@ -22,5 +22,5 @@ argument hip_mul::compute(context& ctx, const shape&, const std::vector<argument ...@@ -22,5 +22,5 @@ argument hip_mul::compute(context& ctx, const shape&, const std::vector<argument
} }
} // 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 {
shape miopen_pooling::compute_shape(const std::vector<shape>& inputs) const shape miopen_pooling::compute_shape(const std::vector<shape>& inputs) const
...@@ -38,5 +38,5 @@ argument miopen_pooling::compute(context& ctx, ...@@ -38,5 +38,5 @@ argument miopen_pooling::compute(context& ctx,
} }
} // 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 {
shape miopen_relu::compute_shape(const std::vector<shape>& inputs) const shape miopen_relu::compute_shape(const std::vector<shape>& inputs) const
...@@ -34,5 +34,5 @@ argument miopen_relu::compute(context& ctx, ...@@ -34,5 +34,5 @@ argument miopen_relu::compute(context& ctx,
} }
} // namespace gpu } // namespace gpu
} // namespace MIGRAPH_INLINE_NS } // namespace MIGRAPHX_INLINE_NS
} // namespace migraphx } // namespace migraphx
#include <migraphx/gpu/rocblas.hpp> #include <migraphx/gpu/rocblas.hpp>
namespace migraphx { namespace migraphx {
inline namespace MIGRAPH_INLINE_NS { inline namespace MIGRAPHX_INLINE_NS {
namespace gpu { namespace gpu {
rocblas_handle_ptr create_rocblas_handle_ptr() rocblas_handle_ptr create_rocblas_handle_ptr()
...@@ -19,5 +19,5 @@ rocblas_handle_ptr create_rocblas_handle_ptr(hipStream_t s) ...@@ -19,5 +19,5 @@ rocblas_handle_ptr create_rocblas_handle_ptr(hipStream_t s)
} }
} // 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 <utility> #include <utility>
namespace migraphx { namespace migraphx {
inline namespace MIGRAPH_INLINE_NS { inline namespace MIGRAPHX_INLINE_NS {
namespace gpu { namespace gpu {
shape hip_sin::compute_shape(const std::vector<shape>& inputs) const shape hip_sin::compute_shape(const std::vector<shape>& inputs) const
...@@ -22,5 +22,5 @@ argument hip_sin::compute(context& ctx, const shape&, const std::vector<argument ...@@ -22,5 +22,5 @@ argument hip_sin::compute(context& ctx, const shape&, const std::vector<argument
} }
} // 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 {
shape miopen_softmax::compute_shape(const std::vector<shape>& inputs) const shape miopen_softmax::compute_shape(const std::vector<shape>& inputs) const
...@@ -33,5 +33,5 @@ argument miopen_softmax::compute(context& ctx, ...@@ -33,5 +33,5 @@ argument miopen_softmax::compute(context& ctx,
} }
} // namespace gpu } // namespace gpu
} // namespace MIGRAPH_INLINE_NS } // namespace MIGRAPHX_INLINE_NS
} // namespace migraphx } // namespace migraphx
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include <migraphx/gpu/concat_gpu_opt.hpp> #include <migraphx/gpu/concat_gpu_opt.hpp>
namespace migraphx { namespace migraphx {
inline namespace MIGRAPH_INLINE_NS { inline namespace MIGRAPHX_INLINE_NS {
namespace gpu { namespace gpu {
std::vector<pass> target::get_passes(migraphx::context& gctx) const std::vector<pass> target::get_passes(migraphx::context& gctx) const
...@@ -61,5 +61,5 @@ std::string target::name() const { return "miopen"; } ...@@ -61,5 +61,5 @@ std::string target::name() const { return "miopen"; }
migraphx::context target::get_context() const { return context{}; } migraphx::context target::get_context() const { return context{}; }
} // namespace gpu } // namespace gpu
} // namespace MIGRAPH_INLINE_NS } // namespace MIGRAPHX_INLINE_NS
} // namespace migraphx } // namespace migraphx
...@@ -5,10 +5,10 @@ ...@@ -5,10 +5,10 @@
#include <migraphx/env.hpp> #include <migraphx/env.hpp>
namespace migraphx { namespace migraphx {
inline namespace MIGRAPH_INLINE_NS { inline namespace MIGRAPHX_INLINE_NS {
namespace gpu { namespace gpu {
MIGRAPH_DECLARE_ENV_VAR(MIGRAPH_COPY_LITERALS) MIGRAPHX_DECLARE_ENV_VAR(MIGRAPHX_COPY_LITERALS)
struct hip_load_literal struct hip_load_literal
{ {
...@@ -33,7 +33,7 @@ void write_literals::apply(program& p) const ...@@ -33,7 +33,7 @@ void write_literals::apply(program& p) const
{ {
if(ins->name() == "@literal") if(ins->name() == "@literal")
{ {
if(enabled(MIGRAPH_COPY_LITERALS{})) if(enabled(MIGRAPHX_COPY_LITERALS{}))
{ {
literal l = ins->get_literal(); literal l = ins->get_literal();
auto pre = p.add_literal(l); auto pre = p.add_literal(l);
...@@ -53,5 +53,5 @@ void write_literals::apply(program& p) const ...@@ -53,5 +53,5 @@ void write_literals::apply(program& p) const
} }
} // namespace gpu } // namespace gpu
} // namespace MIGRAPH_INLINE_NS } // namespace MIGRAPHX_INLINE_NS
} // namespace migraphx } // namespace migraphx
...@@ -10,12 +10,12 @@ set(CTEST_PARALLEL_LEVEL ${N} CACHE STRING "CTest parallel level") ...@@ -10,12 +10,12 @@ set(CTEST_PARALLEL_LEVEL ${N} CACHE STRING "CTest parallel level")
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -j ${CTEST_PARALLEL_LEVEL} -C ${CMAKE_CFG_INTDIR} --timeout 1500) add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -j ${CTEST_PARALLEL_LEVEL} -C ${CMAKE_CFG_INTDIR} --timeout 1500)
add_custom_target(tests) add_custom_target(tests)
find_program(MIGRAPH_GDB gdb) find_program(MIGRAPHX_GDB gdb)
if(MIGRAPH_GDB) if(MIGRAPHX_GDB)
set(MIGRAPH_TEST_GDB On CACHE BOOL "") set(MIGRAPHX_TEST_GDB On CACHE BOOL "")
else() else()
set(MIGRAPH_TEST_GDB Off CACHE BOOL "") set(MIGRAPHX_TEST_GDB Off CACHE BOOL "")
endif() endif()
set(SKIP_TESTS) set(SKIP_TESTS)
...@@ -34,8 +34,8 @@ function(add_test_command NAME EXE) ...@@ -34,8 +34,8 @@ function(add_test_command NAME EXE)
%1 ${ARGN}") %1 ${ARGN}")
add_test(NAME ${NAME} COMMAND ${WINE_CMD} cmd /c "${CMAKE_CURRENT_BINARY_DIR}/test_${NAME}.cmd" $<TARGET_FILE:${EXE}>) add_test(NAME ${NAME} COMMAND ${WINE_CMD} cmd /c "${CMAKE_CURRENT_BINARY_DIR}/test_${NAME}.cmd" $<TARGET_FILE:${EXE}>)
else() else()
if(MIGRAPH_TEST_GDB) if(MIGRAPHX_TEST_GDB)
# add_test(NAME ${NAME} COMMAND ${MIGRAPH_GDB} # add_test(NAME ${NAME} COMMAND ${MIGRAPHX_GDB}
# --batch # --batch
# --return-child-result # --return-child-result
# -ex "set disable-randomization off" # -ex "set disable-randomization off"
...@@ -54,7 +54,7 @@ function(add_test_command NAME EXE) ...@@ -54,7 +54,7 @@ function(add_test_command NAME EXE)
if(EXISTS ${TEST_DIR}/core) if(EXISTS ${TEST_DIR}/core)
set(\$ENV{UBSAN_OPTIONS} print_stacktrace=1) set(\$ENV{UBSAN_OPTIONS} print_stacktrace=1)
set(\$ENV{ASAN_OPTIONS} print_stacktrace=1) set(\$ENV{ASAN_OPTIONS} print_stacktrace=1)
execute_process(COMMAND ${MIGRAPH_GDB} $<TARGET_FILE:${EXE}> ${TEST_DIR}/core -batch -ex bt) execute_process(COMMAND ${MIGRAPHX_GDB} $<TARGET_FILE:${EXE}> ${TEST_DIR}/core -batch -ex bt)
endif() endif()
message(FATAL_ERROR \"Test failed\") message(FATAL_ERROR \"Test failed\")
endif() endif()
...@@ -95,7 +95,7 @@ foreach(TEST ${TESTS}) ...@@ -95,7 +95,7 @@ foreach(TEST ${TESTS})
rocm_clang_tidy_check(test_${BASE_NAME}) rocm_clang_tidy_check(test_${BASE_NAME})
endforeach() endforeach()
if(MIGRAPH_ENABLE_GPU) if(MIGRAPHX_ENABLE_GPU)
# gpu tests # gpu tests
file(GLOB GPU_TESTS gpu/*.cpp) file(GLOB GPU_TESTS gpu/*.cpp)
...@@ -142,7 +142,7 @@ function(test_headers PREFIX) ...@@ -142,7 +142,7 @@ function(test_headers PREFIX)
string(MAKE_C_IDENTIFIER ${HEADER_REL} TEST_NAME) string(MAKE_C_IDENTIFIER ${HEADER_REL} TEST_NAME)
get_filename_component(BASE_NAME ${HEADER} NAME_WE) get_filename_component(BASE_NAME ${HEADER} NAME_WE)
test_header(header_${TEST_NAME} ${PREFIX}/${BASE_NAME}.hpp) test_header(header_${TEST_NAME} ${PREFIX}/${BASE_NAME}.hpp)
if(MIGRAPH_ENABLE_GPU) if(MIGRAPHX_ENABLE_GPU)
target_link_libraries(header_${TEST_NAME} migraphx_gpu) target_link_libraries(header_${TEST_NAME} migraphx_gpu)
endif() endif()
endforeach() endforeach()
...@@ -150,6 +150,6 @@ endfunction() ...@@ -150,6 +150,6 @@ endfunction()
test_headers(migraphx ${CMAKE_SOURCE_DIR}/src/include/migraphx/*.hpp) test_headers(migraphx ${CMAKE_SOURCE_DIR}/src/include/migraphx/*.hpp)
test_headers(migraphx/cpu ${CMAKE_SOURCE_DIR}/src/targets/cpu/include/migraphx/cpu/*.hpp) test_headers(migraphx/cpu ${CMAKE_SOURCE_DIR}/src/targets/cpu/include/migraphx/cpu/*.hpp)
if(MIGRAPH_ENABLE_GPU) if(MIGRAPHX_ENABLE_GPU)
test_headers(migraphx/gpu ${CMAKE_SOURCE_DIR}/src/targets/gpu/include/migraphx/gpu/*.hpp) test_headers(migraphx/gpu ${CMAKE_SOURCE_DIR}/src/targets/gpu/include/migraphx/gpu/*.hpp)
endif() endif()
...@@ -103,6 +103,6 @@ TEST_CASE(float_aligned) ...@@ -103,6 +103,6 @@ TEST_CASE(float_aligned)
int main(int argc, const char* argv[]) int main(int argc, const char* argv[])
{ {
setenv("MIGRAPH_DISABLE_MEMORY_COLORING", "1", 1); setenv("MIGRAPHX_DISABLE_MEMORY_COLORING", "1", 1);
test::run(argc, argv); test::run(argc, argv);
} }
...@@ -10,13 +10,13 @@ struct sum_op ...@@ -10,13 +10,13 @@ struct sum_op
{ {
migraphx::argument result; migraphx::argument result;
if(args.size() != 2) if(args.size() != 2)
MIGRAPH_THROW("Wrong args"); MIGRAPHX_THROW("Wrong args");
if(args[0].get_shape() != args[1].get_shape()) if(args[0].get_shape() != args[1].get_shape())
MIGRAPH_THROW("Wrong args"); MIGRAPHX_THROW("Wrong args");
if(args[0].get_shape().lens().size() != 1) if(args[0].get_shape().lens().size() != 1)
MIGRAPH_THROW("Wrong args"); MIGRAPHX_THROW("Wrong args");
if(args[0].get_shape().lens().front() != 1) if(args[0].get_shape().lens().front() != 1)
MIGRAPH_THROW("Wrong args"); MIGRAPHX_THROW("Wrong args");
args[0].visit_at([&](auto x) { args[0].visit_at([&](auto x) {
args[1].visit_at([&](auto y) { result = migraphx::literal{x + y}.get_argument(); }); args[1].visit_at([&](auto y) { result = migraphx::literal{x + y}.get_argument(); });
...@@ -27,7 +27,7 @@ struct sum_op ...@@ -27,7 +27,7 @@ struct sum_op
migraphx::shape compute_shape(std::vector<migraphx::shape> inputs) const migraphx::shape compute_shape(std::vector<migraphx::shape> inputs) const
{ {
if(inputs.size() != 2) if(inputs.size() != 2)
MIGRAPH_THROW("Wrong inputs"); MIGRAPHX_THROW("Wrong inputs");
return inputs.front(); return inputs.front();
} }
}; };
...@@ -40,13 +40,13 @@ struct minus_op ...@@ -40,13 +40,13 @@ struct minus_op
{ {
migraphx::argument result; migraphx::argument result;
if(args.size() != 2) if(args.size() != 2)
MIGRAPH_THROW("Wrong args"); MIGRAPHX_THROW("Wrong args");
if(args[0].get_shape() != args[1].get_shape()) if(args[0].get_shape() != args[1].get_shape())
MIGRAPH_THROW("Wrong args"); MIGRAPHX_THROW("Wrong args");
if(args[0].get_shape().lens().size() != 1) if(args[0].get_shape().lens().size() != 1)
MIGRAPH_THROW("Wrong args"); MIGRAPHX_THROW("Wrong args");
if(args[0].get_shape().lens().front() != 1) if(args[0].get_shape().lens().front() != 1)
MIGRAPH_THROW("Wrong args"); MIGRAPHX_THROW("Wrong args");
args[0].visit_at([&](auto x) { args[0].visit_at([&](auto x) {
args[1].visit_at([&](auto y) { result = migraphx::literal{x - y}.get_argument(); }); args[1].visit_at([&](auto y) { result = migraphx::literal{x - y}.get_argument(); });
...@@ -57,7 +57,7 @@ struct minus_op ...@@ -57,7 +57,7 @@ struct minus_op
migraphx::shape compute_shape(std::vector<migraphx::shape> inputs) const migraphx::shape compute_shape(std::vector<migraphx::shape> inputs) const
{ {
if(inputs.size() != 2) if(inputs.size() != 2)
MIGRAPH_THROW("Wrong inputs"); MIGRAPHX_THROW("Wrong inputs");
return inputs.front(); return inputs.front();
} }
}; };
......
#ifndef MIGRAPH_GUARD_ROB_HPP #ifndef MIGRAPHX_GUARD_ROB_HPP
#define MIGRAPH_GUARD_ROB_HPP #define MIGRAPHX_GUARD_ROB_HPP
#ifdef __clang__ #ifdef __clang__
#pragma clang diagnostic push #pragma clang diagnostic push
...@@ -30,7 +30,7 @@ struct mem_data_ptr ...@@ -30,7 +30,7 @@ struct mem_data_ptr
using type = T C::*; using type = T C::*;
}; };
#define MIGRAPH_ROB(name, Type, C, mem) \ #define MIGRAPHX_ROB(name, Type, C, mem) \
struct name##_tag : mem_data_ptr<C, Type> \ struct name##_tag : mem_data_ptr<C, Type> \
{ \ { \
}; \ }; \
......
...@@ -15,13 +15,13 @@ struct simple_operation ...@@ -15,13 +15,13 @@ struct simple_operation
std::string name() const { return "simple"; } std::string name() const { return "simple"; }
migraphx::shape compute_shape(const std::vector<migraphx::shape>&) const migraphx::shape compute_shape(const std::vector<migraphx::shape>&) const
{ {
MIGRAPH_THROW("not computable"); MIGRAPHX_THROW("not computable");
} }
migraphx::argument compute(migraphx::context&, migraphx::argument compute(migraphx::context&,
const migraphx::shape&, const migraphx::shape&,
const std::vector<migraphx::argument>&) const const std::vector<migraphx::argument>&) const
{ {
MIGRAPH_THROW("not computable"); MIGRAPHX_THROW("not computable");
} }
friend std::ostream& operator<<(std::ostream& os, const simple_operation& op) friend std::ostream& operator<<(std::ostream& os, const simple_operation& op)
{ {
...@@ -35,13 +35,13 @@ struct simple_operation_no_print ...@@ -35,13 +35,13 @@ struct simple_operation_no_print
std::string name() const { return "simple"; } std::string name() const { return "simple"; }
migraphx::shape compute_shape(const std::vector<migraphx::shape>&) const migraphx::shape compute_shape(const std::vector<migraphx::shape>&) const
{ {
MIGRAPH_THROW("not computable"); MIGRAPHX_THROW("not computable");
} }
migraphx::argument compute(migraphx::context&, migraphx::argument compute(migraphx::context&,
const migraphx::shape&, const migraphx::shape&,
const std::vector<migraphx::argument>&) const const std::vector<migraphx::argument>&) const
{ {
MIGRAPH_THROW("not computable"); MIGRAPHX_THROW("not computable");
} }
}; };
......
...@@ -39,7 +39,7 @@ TEST_CASE(incomplete_args) ...@@ -39,7 +39,7 @@ TEST_CASE(incomplete_args)
EXPECT(bool{p.validate() == ins}); EXPECT(bool{p.validate() == ins});
} }
MIGRAPH_ROB(access_ins_arguments, MIGRAPHX_ROB(access_ins_arguments,
std::vector<migraphx::instruction_ref>, std::vector<migraphx::instruction_ref>,
migraphx::instruction, migraphx::instruction,
arguments) arguments)
......
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