MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / exec

Method exec

dnn/src/cuda/where/where_forward.cpp:9–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7namespace cuda {
8
9void WhereForwardImpl::exec(
10 _megdnn_tensor_in mask, _megdnn_tensor_in data1, _megdnn_tensor_in data2,
11 _megdnn_tensor_out dst, _megdnn_workspace workspace) {
12 check_exec(mask.layout, data1.layout, data2.layout, dst.layout, workspace.size);
13 auto stream = cuda_stream(this->handle());
14 auto n = data1.layout.total_nr_elems();
15#define cb(DType) \
16 if (data1.layout.dtype == DType()) { \
17 using ctype = typename DTypeTrait<DType>::ctype; \
18 where::forward_proxy<ctype>( \
19 mask.ptr<dt_bool>(), data1.ptr<ctype>(), data2.ptr<ctype>(), \
20 dst.ptr<ctype>(), n, stream); \
21 }
22 MEGDNN_FOREACH_COMPUTING_DTYPE(cb)
23 cb(::megdnn::dtype::Bool)
24#undef cb
25}
26
27} // namespace cuda
28} // namespace megdnn

Callers

nothing calls this directly

Calls 4

cuda_streamFunction · 0.85
cbFunction · 0.50
handleMethod · 0.45
total_nr_elemsMethod · 0.45

Tested by

no test coverage detected