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

Method verifyMemoryModelStore

lib/Dialect/CudaTile/IR/CudaTile.cpp:5366–5393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5364//===----------------------------------------------------------------------===//
5365
5366LogicalResult
5367cuda_tile::impl::verifyMemoryModelStore(Operation *op,
5368 MemoryOrderingSemantics memoryOrdering,
5369 std::optional<MemoryScope> scope) {
5370 // First validate the memory ordering is supported
5371 switch (memoryOrdering) {
5372 case MemoryOrderingSemantics::WEAK:
5373 case MemoryOrderingSemantics::RELAXED:
5374 case MemoryOrderingSemantics::RELEASE:
5375 break; // Valid orderings
5376 default:
5377 return op->emitOpError(
5378 "expect one of: weak, relaxed, or release, but got: ")
5379 << stringifyMemoryOrderingSemantics(memoryOrdering);
5380 }
5381
5382 // Then validate scope requirements based on ordering
5383 if (memoryOrdering == MemoryOrderingSemantics::WEAK) {
5384 if (scope.has_value())
5385 return op->emitOpError("weak store must not have memory scope");
5386 } else {
5387 // RELAXED or RELEASE require scope
5388 if (!scope.has_value())
5389 return op->emitOpError("memory scope is required for ")
5390 << stringifyMemoryOrderingSemantics(memoryOrdering) << " store";
5391 }
5392 return success();
5393}
5394
5395//===----------------------------------------------------------------------===//
5396// StorePtrTkoOp

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected