@@ -15,7 +15,27 @@ def OpenACC_PointerLikeTypeInterface : TypeInterface<"PointerLikeType"> {
15
15
let cppNamespace = "::mlir::acc";
16
16
17
17
let description = [{
18
- An interface for pointer-like types that point to an OpenACC var.
18
+ This is a minimal interface to interact with acc dialect data clause
19
+ operations to represent an OpenACC variable. The reason for its existence
20
+ is to create a minimal contract between a source dialect and the acc
21
+ dialect - and it works on the basis that this is a pointer that can
22
+ be mapped to device memory. This exists for the following reasons:
23
+ - Many dialects choose to represent their variables as pointers.
24
+ Specifically locals are created with some form of `alloca` and globals
25
+ are referred through by their address.
26
+ - Eventually all such pointers end up as LLVM pointers along with LLVM
27
+ types whose size is computable. This is the minimal information needed
28
+ to map a variable.
29
+ - The OpenACC spec describes reference counters in terms of memory
30
+ addressability. In 2.6.7. It says: "A structured reference counter
31
+ is incremented when entering each data or compute region that contain
32
+ an explicit data clause or implicitly-determined data attributes for
33
+ that section of memory". This implies addressability of memory.
34
+ - Attach semantics (2.6.8 attachment counter) are specified using
35
+ "address" terminology: "The attachment counter for a pointer is set to
36
+ one whenever the pointer is attached to new target address, and
37
+ incremented whenever an attach action for that pointer is performed for
38
+ the same target address."
19
39
}];
20
40
21
41
// By convention, any of the pointer types associated with this interface
@@ -57,8 +77,13 @@ def OpenACC_MappableTypeInterface : TypeInterface<"MappableType"> {
57
77
let cppNamespace = "::mlir::acc";
58
78
59
79
let description = [{
60
- An interface to capture type-based semantics for mapping in a manner that
61
- makes it convertible to size-based semantics.
80
+ This interface is a richer contract than being a pointer-like type
81
+ and can be used in conjunction with it.
82
+ It should be attached to types that a source dialect considers to
83
+ be variables. And unlike pointer-like type, it can be attached to variables
84
+ which the source dialect does not represent through the use of memory.
85
+ The richer API allows for post-frontend type-based semantics to be
86
+ applied such as generating recipes or extracting array bounds.
62
87
}];
63
88
64
89
let methods = [
0 commit comments