Read-only communication operator
AssigneeMicrosoft Technology Licensing, LLC
InventorsYosseff Levanoni, Paul F. Ringseth, Weirong Zhu, Lingli Zhang
Life of this patent
Estimating the term…
Abstract
A high level programming language provides a read-only communication operator that prevents a computational space from being written. An indexable type with a rank and element type defines the computational space. For an input indexable type, the read-only communication operator produces an output indexable type with the same rank and element type as the input indexable type but ensures that the output indexable type may not be written. The read-only communication operator ensures that any attempt to write to the output indexable type will be detected as an error at compile time.
Claims20
A computer readable storage device storing computer-executable instructions that, when executed by a computer system, cause the computer system to perform a method comprising:
- applying a read-only communication operator to an input indexable type to form an immutable computational space, the read-only communication operator applied in a data parallel source code configured for execution on one or more data parallel compute nodes;
- generating an output indexable type from said application, the output indexable type is a data type forming an immutable computational space;
- and
- performing a data parallel algorithm using the output indexable type,
- wherein the read-only communication operator is based on a template operator that defines one or more of constant accessors, index operators, or subscript operators for the output indexable type,
- wherein the read-only communication operator includes a template-enclosed code portion that checks a Parent type and range of the input indexable type using a conditional operator that returns a read-only Parent range, wherein the template-enclosed code portion optionally includes an internal casting of the Parent type to prevent a cast inadvertently made to a lvalue-reference of the input indexable type that might occur outside of the template-enclosed code portion, and
- in case the input indexable type returns its index operators and subscript operators as by-lvalue-references, a template-based conditional base class is implemented to enforce the corresponding return type as a rvalue-reference or a by-value depending on the Parent type.
A method implemented on a computing device having at least one processor, the method comprising:
- identifying a read-only communication operator in data parallel source code configured for execution on one or more data parallel compute nodes, the read-only communication operator used to form an immutable computational space;
- and
- generating data parallel executable code from the data parallel source code such that the data parallel executable code implements read-only communication operator by generating an output indexable type from an input indexable type, the output indexable type forming the immutable computational space in memory,
- wherein the read-only communication operator is based on a template operator that defines one or more of constant accessors, index operators, and subscript operators for the output indexable type,
- wherein the read-only communication operator includes a template-enclosed code portion that checks a Parent type and range of the input indexable type using a conditional operator that returns a read-only Parent range, wherein the template-enclosed code portion optionally includes an internal casting of the Parent type to prevent a cast inadvertently made to a lvalue-reference of the input indexable type that might occur outside of the template-enclosed code portion, and
- in case the input indexable type returns its index operators and subscript operators as by-lvalue-references, a template-based conditional base class is implemented to enforce the corresponding return type as a rvalue-reference or a by-value depending on the Parent type.
A computer readable storage device storing computer-executable instructions that, when executed by at least one processor, perform a method comprising:
- applying a read-only communication operator to form an immutable computational space by generating an output indexable type with a rank and an element type from an input indexable type with the rank and the element type;
- and
- performing a data parallel algorithm using the output indexable type;
- wherein the read-only communications operator is included in data parallel source code written in a high level general purpose programming language with data parallel extensions,
- wherein the read-only communication operator includes a template-enclosed code portion that checks a Parent type and range of the input indexable type using a conditional operator that returns a read-only Parent range, wherein the template-enclosed code portion optionally includes an internal casting of the Parent type to prevent a cast inadvertently made to a lvalue-reference of the input indexable type that might occur outside of the template-enclosed code portion,
- in case the input indexable type returns its index operators and subscript operators as by-lvalue-references, a template-based conditional base class is implemented to enforce the corresponding return type as a rvalue-reference or a by-value depending on the Parent type,
- wherein the output indexable type is a data type that forms an immutable computational space in memory, and
- wherein the read-only communication operator defines one or more of constant accessors, index operators, or subscript operators for the output indexable type.
Dependencies are inferred from the claim text.