MCPcopy Create free account
hub / github.com/ROCm/AMDMIGraphX / compute

Method compute

src/targets/gpu/code_object_op.cpp:66–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66argument
67code_object_op::compute(context& ctx, const shape&, const std::vector<argument>& args) const
68{
69#if MIGRAPHX_HAS_PMR
70 std::array<char, 256> storage;
71 std::pmr::monotonic_buffer_resource resource{storage.data(), storage.size()};
72 pmr::vector<void*> kargs(&resource);
73#else
74 pmr::vector<void*> kargs;
75#endif
76 visit_flatten_args(args, [&](const auto& fargs) {
77 kargs.reserve(fargs.size());
78 std::transform(fargs.begin(),
79 fargs.end(),
80 std::back_inserter(kargs),
81 [](const argument& a) { return a.data(); });
82 });
83 auto [start, stop] = ctx.get_perf_events();
84 k.launch(ctx.get_stream().get(), global, local, kargs, start, stop);
85 return args[get_output_arg(args.size())];
86}
87void code_object_op::finalize(context&, const shape&, const std::vector<shape>&)
88{
89 assert(not code_object.empty());

Callers

nothing calls this directly

Calls 10

visit_flatten_argsFunction · 0.85
get_perf_eventsMethod · 0.80
launchMethod · 0.80
transformFunction · 0.50
dataMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
getMethod · 0.45
get_streamMethod · 0.45

Tested by

no test coverage detected