MCPcopy Create free account
hub / github.com/MegEngine/MegCC / check_layout_equal

Function check_layout_equal

compiler/test/kernel/common/src/cc_proxy.cpp:112–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110using KernType = KernelGen::KernelPack::KernType;
111
112static inline bool check_layout_equal(const Layout& l1, const Layout& l2) {
113 bool ok_dim = l1.nr_dim == l2.nr_dim && l1.format == l2.format;
114 if (!ok_dim) {
115 return false;
116 }
117 for (int i = 0; i < l1.nr_dim; ++i) {
118 bool ok_shape = l1.dims[i] == l2.dims[i] && l1.stride[i] == l2.stride[i];
119 if (!ok_shape) {
120 return false;
121 }
122 }
123 return true;
124}
125PerformanceResult proxy_kernel(
126 TensorNDArray tensor_array, StdKernelCall func, StdKernelInitCall init_func,
127 StdKernelWorkspaceCall workspace_func, StdKernelDeduceCall deduce_func,

Callers 1

proxy_kernelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected