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

Function get_grid_size

src/jit/impl/mlir/executable_cuda.cpp:24–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22namespace {
23
24int64_t get_grid_size(int64_t nr_elements, int64_t block_size) {
25 // unroll three times in the kernel
26 int64_t a = nr_elements / (block_size * 2);
27 int64_t b = (nr_elements - 1) / (block_size * 3) + 1;
28 return std::max(a, b);
29}
30
31template <int out_dim, typename ctype>
32void setup_and_launch(const JITExecutor* fusion_opr, CUfunction func, int block_size) {

Callers 1

setup_and_launchFunction · 0.85

Calls 1

maxFunction · 0.85

Tested by

no test coverage detected