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

Method bytes

src/shape.cpp:400–422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

398std::size_t shape::elements() const { return impl->elements(); }
399
400std::size_t shape::bytes() const
401{
402 if(this->sub_shapes().empty())
403 {
404 std::size_t n = 0;
405 if(type() == fp4x2_type)
406 {
407 n = sizeof(uint8_t);
408 }
409 else
410 {
411 this->visit_type([&](auto as) { n = as.size(); });
412 }
413 return n * this->element_space();
414 }
415 else
416 {
417 return std::accumulate(this->sub_shapes().begin(),
418 this->sub_shapes().end(),
419 std::size_t{0},
420 [&](auto x, auto y) { return x + y.bytes(); });
421 }
422}
423
424std::size_t shape::type_size() const
425{

Callers 15

TEST_CASEFunction · 0.45
get_load_intervalFunction · 0.45
TEST_CASEFunction · 0.45
TEST_CASEFunction · 0.45
TEST_CASEFunction · 0.45
TEST_CASEFunction · 0.45
TEST_CASEFunction · 0.45
TEST_CASEFunction · 0.45
computeMethod · 0.45
computeMethod · 0.45
computeMethod · 0.45
build_conflict_tableFunction · 0.45

Calls 7

element_spaceMethod · 0.95
typeFunction · 0.85
accumulateFunction · 0.85
emptyMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by 9

TEST_CASEFunction · 0.36
get_load_intervalFunction · 0.36
TEST_CASEFunction · 0.36
TEST_CASEFunction · 0.36
TEST_CASEFunction · 0.36
TEST_CASEFunction · 0.36
computeMethod · 0.36
computeMethod · 0.36
computeMethod · 0.36