-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature[next]: Remove int type from FOAST, PAST, ITIR #1255
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Main concern is the duplication of value to literal translation and hiding it in ir_makers.
tests/next_tests/integration_tests/feature_tests/ffront_tests/test_execution.py
Outdated
Show resolved
Hide resolved
tests/next_tests/integration_tests/feature_tests/ffront_tests/test_execution.py
Outdated
Show resolved
Hide resolved
tests/next_tests/integration_tests/feature_tests/ffront_tests/test_gt4py_builtins.py
Outdated
Show resolved
Hide resolved
tests/next_tests/integration_tests/feature_tests/ffront_tests/test_scalar_if.py
Outdated
Show resolved
Hide resolved
@havogt Mostly as discussed. I have introduced a new function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a question, because I don't remember.
@@ -29,6 +30,12 @@ | |||
TYPE_BUILTINS = [Field, Dimension, int32, int64, float32, float64] + PYTHON_TYPE_BUILTINS | |||
TYPE_BUILTIN_NAMES = [t.__name__ for t in TYPE_BUILTINS] | |||
|
|||
# Be aware: Type aliases are not fully supported in the frontend yet, e.g. `IndexType(1)` will not | |||
# work. | |||
IndexType: TypeAlias = int32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the problem why we decided to add an index type? I only realize now that this is a potential problem for bindings, if the driver code has an opinion on the size of IndexType
. But let's keep it for now...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You suggested it as it is occurring in the tests multiple times (e.g. in IndexFields). I think the bindings will still accept int64
for NeighborTableOffsetProvider.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggested the alias but why did we introduce this constraint https://github.com/GridTools/gt4py/pull/1255/files#diff-1c4cbeb95e161c4e1ca0327817608ba3a8b48569e756847b2093bc43606863d6R685
This PR removes all occurrences of the
int
,float
type and replaces them by the fixed size typesint32
,int64
,float32
,float64
. In particularint
was problematic as an undetermined size lead to problems in type inference giving strange errors akin ofCan not satisfy constraint on primitive types: int ≡ int32
.Blocked by #1258 (already merged in this PR).