Skip to content

Why should width be explicitly mentioned in SIMD #2330

Locked Answered by rarebreed
alfie-nsugh asked this question in Q&A
Discussion options

You must be logged in to vote

I would call that a bug.

Mojo appears to be calling the overloaded load method of load[len: Int, width: Int](self: Self, indices: StaticIntTuple[len]) -> SIMD[dtype, width] which it should not.

According to the manual's rules:

  1. Candidates with the minimal number of implicit conversions (in both arguments and parameters).
  2. Candidates without variadic arguments.
  3. Candidates without variadic parameters.
  4. Candidates with the shortest parameter signature.
  5. Non-@staticmethod candidates (over @staticmethod ones, if available).

The load method of load[width: Int](self: Self, index: Int) -> SIMD[dtype, width] should have been called because rule 1 should have been applied.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rarebreed
Comment options

Answer selected by alfie-nsugh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants