Commit 3d08f40f authored by Shucai Xiao's avatar Shucai Xiao
Browse files

Merge branch 'develop' of github.com:ROCmSoftwarePlatform/AMDMIGraphX into scatter-op

parents 50cfbcda 6ba279cc
...@@ -26,6 +26,8 @@ struct allocation_model ...@@ -26,6 +26,8 @@ struct allocation_model
std::string copy() const; std::string copy() const;
/// Create an allocation operator for the given shape /// Create an allocation operator for the given shape
operation allocate(const shape& s) const; operation allocate(const shape& s) const;
/// Create a preallocated operator for the given shape
operation preallocate(const shape& s, const std::string& id) const;
}; };
#else #else
...@@ -34,7 +36,8 @@ struct allocation_model ...@@ -34,7 +36,8 @@ struct allocation_model
interface('allocation_model', interface('allocation_model',
virtual('name', returns='std::string', const=True), virtual('name', returns='std::string', const=True),
virtual('copy', returns='std::string', const=True), virtual('copy', returns='std::string', const=True),
virtual('allocate', s='const shape&', returns='operation', const=True) virtual('allocate', s='const shape&', returns='operation', const=True),
virtual('preallocate', s='const shape&', id='std::string', returns='operation', const=True)
) )
%> %>
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <migraphx/module_ref.hpp> #include <migraphx/module_ref.hpp>
#include <migraphx/serialize.hpp> #include <migraphx/serialize.hpp>
#include <migraphx/auto_any_cast.hpp> #include <migraphx/auto_any_cast.hpp>
#include <migraphx/lifetime.hpp>
#include <migraphx/config.hpp> #include <migraphx/config.hpp>
namespace migraphx { namespace migraphx {
...@@ -435,9 +436,9 @@ void from_value_op(T& x, const value& v) ...@@ -435,9 +436,9 @@ void from_value_op(T& x, const value& v)
} }
template <class T> template <class T>
bool is_borrowed_op(const T&) lifetime get_lifetime_op(const T&)
{ {
return false; return lifetime::local;
} }
} // namespace detail } // namespace detail
...@@ -453,7 +454,8 @@ bool is_borrowed_op(const T&) ...@@ -453,7 +454,8 @@ bool is_borrowed_op(const T&)
const = True, const = True,
default = 'detail::need_normalization_op'), default = 'detail::need_normalization_op'),
virtual('has_finalize', returns = 'bool', const = True, default = 'detail::has_finalize_op'), virtual('has_finalize', returns = 'bool', const = True, default = 'detail::has_finalize_op'),
virtual('is_borrowed', returns = 'bool', const = True, default = 'detail::is_borrowed_op'), virtual(
'get_lifetime', returns = 'lifetime', const = True, default = 'detail::get_lifetime_op'),
virtual('output_alias', virtual('output_alias',
returns = 'std::ptrdiff_t', returns = 'std::ptrdiff_t',
input = 'const std::vector<shape>&', input = 'const std::vector<shape>&',
......
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