MCPcopy Create free account
hub / github.com/NVIDIA/cuda-tile / extractCudaTileModuleOp

Method extractCudaTileModuleOp

lib/Dialect/CudaTile/IR/CudaTile.cpp:62–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62cuda_tile::ModuleOp cuda_tile::extractCudaTileModuleOp(Operation *op) {
63 // Try direct cast first
64 if (auto directCudaTileModule = dyn_cast<cuda_tile::ModuleOp>(op))
65 return directCudaTileModule;
66
67 // Try nested case: look inside a regular ModuleOp
68 if (auto moduleOp = dyn_cast<mlir::ModuleOp>(op)) {
69 if (!moduleOp.getBody()->empty()) {
70 if (auto nestedCudaTileModule =
71 dyn_cast<cuda_tile::ModuleOp>(&moduleOp.getBody()->front()))
72 return nestedCudaTileModule;
73 }
74 }
75
76 // Not found
77 return {};
78}
79
80namespace {
81

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected