np.float64 attribute from host crashes compiler, broken error message #90
Labels
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: M-Labs/nac3#90
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Sometimes code using numpy ends up with a
numpy.float64
type instead offloat
. If such a value is used as a KernelInvariant, nac3 breaks.Repro:
results in:
np.float64 KernelInvariant crashes compiler, broken error messageto np.float64 attribute from host crashes compiler, broken error messageDoes not need to be
KernelInvariant
,foo: float
causes the same behavior.I guess this is because symbol resolver fails to resolve the type, it should break as this is not intended, we can support float64. The error message is interesting though.
I wouldn't introduce a
float64
type and its associated complexity... I propose:float64
objects tofloat
when they arrive inside NAC3.Actually floats are now f64, I mean we can convert numpy float64 into our float.
I think I have encountered the error message before, but not clear how to solve that in a good way for now, since we synthesize the starting point..
It is because we cannot get the type of
base
in our synthesized starting point of the code (symbol resolver cannot confirm thatnumpy.float
is compatible with float at here when getting the type ofbase
)we can fix this simply by returning an error when we cannot get the value of
base
.The error message is okay now.
We should simply treat the special case of
np.float64
asfloat
I guess.