"src/vscode:/vscode.git/clone" did not exist on "c8aa00bfede8a070dffe6ed83a8ad07abd95a142"
allocation_model.cpp 747 Bytes
Newer Older
1
2
#include <migraphx/gpu/allocation_model.hpp>
#include <migraphx/make_op.hpp>
3
4
#include <migraphx/instruction.hpp>
#include <migraphx/module.hpp>
5
6
7
8
9
10
11
12
13
14
15

namespace migraphx {
inline namespace MIGRAPHX_INLINE_NS {
namespace gpu {

std::string gpu_allocation_model::name() const { return "hip::allocate"; }
operation gpu_allocation_model::allocate(const shape& s) const
{
    return make_op(name(), {{"shape", to_value(s)}});
}

16
17
18
19
20
operation gpu_allocation_model::preallocate(const shape& s, const std::string& id) const
{
    return make_op("hip::hip_allocate_memory", {{"shape", to_value(s)}, {"id", id}});
}

21
22
23
24
25
std::string gpu_allocation_model::copy() const { return "hip::copy"; }

} // namespace gpu
} // namespace MIGRAPHX_INLINE_NS
} // namespace migraphx