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

Method set_zero

src/targets/gpu/loop.cpp:68–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66 }
67
68 void set_zero(context& ctx, const std::vector<argument>& concatenated_outputs, int iter) const
69 {
70 if(iter >= max_iterations)
71 return;
72
73 auto elem_num = max_iterations - iter;
74 for(const auto& out : concatenated_outputs)
75 {
76 auto s = out.get_shape();
77 auto size = s.bytes() / max_iterations;
78 auto lens = s.lens();
79 lens[0] = elem_num;
80 shape ss{s.type(), lens};
81 assert(ss.bytes() + iter * size <= out.get_shape().bytes());
82 device::fill(ctx.get_stream().get(), argument(ss, out.data() + iter * size), 0);
83 }
84 }
85
86 std::unordered_map<std::string, int> get_output_params(const module& m) const
87 {

Callers

nothing calls this directly

Calls 9

lensMethod · 0.80
fillFunction · 0.50
argumentFunction · 0.50
get_shapeMethod · 0.45
bytesMethod · 0.45
typeMethod · 0.45
getMethod · 0.45
get_streamMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected