MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / fill_tensor

Method fill_tensor

examples/cl_cache.cpp:126–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124 }
125
126 void fill_tensor(CLTensor &tensor)
127 {
128 tensor.map();
129 Window window;
130 window.use_tensor_dimensions(tensor.info()->tensor_shape());
131 Iterator it_tensor(&tensor, window);
132 unsigned char val(0);
133 execute_window_loop(
134 window, [&](const Coordinates &) { *reinterpret_cast<unsigned char *>(it_tensor.ptr()) = val++; },
135 it_tensor);
136 tensor.unmap();
137 }
138 void init_tensor(const TensorShape shape, CLTensor &tensor, DataType type, DataLayout layout)
139 {
140 tensor.allocator()->init(TensorInfo(shape, 1, type).set_data_layout(layout));

Callers 2

do_setupMethod · 0.45
do_setupMethod · 0.45

Calls 4

mapMethod · 0.45
infoMethod · 0.45
ptrMethod · 0.45
unmapMethod · 0.45

Tested by

no test coverage detected