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

Function test_memory_scope_attr

test/python/cuda_tile_public_bindings.py:198–218  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

196
197
198def test_memory_scope_attr():
199 from cuda_tile._mlir._mlir_libs._cuda_tile import MemoryScopeAttr
200 from cuda_tile._mlir.ir import Context, Attribute
201
202 with Context() as ctx:
203 register_dialect(ctx, load=True)
204 # Skip parsing test as the attribute mnemonic isn't registered for parsing
205 # directly create the attribute
206 created = MemoryScopeAttr.get("tl_blk")
207 assert created.value == "tl_blk"
208
209 # Test other memory scopes
210 device_scope = MemoryScopeAttr.get("device")
211 assert device_scope.value == "device"
212
213 sys_scope = MemoryScopeAttr.get("sys")
214 assert sys_scope.value == "sys"
215
216 # Test invalid memory scope
217 with pytest.raises(ValueError, match="Invalid memory scope: invalid_scope"):
218 MemoryScopeAttr.get("invalid_scope")
219
220
221###############################################################################

Callers

nothing calls this directly

Calls 1

getMethod · 0.80

Tested by

no test coverage detected