Skip to content

Commit

Permalink
Fix vector type
Browse files Browse the repository at this point in the history
  • Loading branch information
aalmada committed Feb 27, 2024
1 parent f3ab532 commit 1fcf3c4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/NetFabric.Numerics.Tensors/IndexOfPredicateBinary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ public static int IndexOfPredicate<T, TPredicateOperator>(ReadOnlySpan<T> x, T y
ref var currentVector = ref Unsafe.Add(ref vectorsRef, indexVector);
if (TPredicateOperator.Invoke(ref currentVector, ref yVector))
{
for (var indexElement = 0; indexElement < Vector<int>.Count; indexElement++)
for (var indexElement = 0; indexElement < Vector<T>.Count; indexElement++)
{
if (TPredicateOperator.Invoke(currentVector[indexElement], y))
return ((int)indexVector * Vector<int>.Count) + indexElement;
return ((int)indexVector * Vector<T>.Count) + indexElement;
}
}
}

indexSource = indexVector * Vector<int>.Count;
indexSource = indexVector * Vector<T>.Count;
}

ref var xRef = ref MemoryMarshal.GetReference(x);
Expand Down
6 changes: 3 additions & 3 deletions src/NetFabric.Numerics.Tensors/IndexOfPredicateTernary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ public static int IndexOfPredicate<T, TPredicateOperator>(ReadOnlySpan<T> x, T y
ref var currentVector = ref Unsafe.Add(ref vectorsRef, indexVector);
if (TPredicateOperator.Invoke(ref currentVector, ref yVector, ref zVector))
{
for (var indexElement = 0; indexElement < Vector<int>.Count; indexElement++)
for (var indexElement = 0; indexElement < Vector<T>.Count; indexElement++)
{
if (TPredicateOperator.Invoke(currentVector[indexElement], y, z))
return ((int)indexVector * Vector<int>.Count) + indexElement;
return ((int)indexVector * Vector<T>.Count) + indexElement;
}
}
}

indexSource = indexVector * Vector<int>.Count;
indexSource = indexVector * Vector<T>.Count;
}

ref var xRef = ref MemoryMarshal.GetReference(x);
Expand Down
6 changes: 3 additions & 3 deletions src/NetFabric.Numerics.Tensors/IndexOfPredicateUnary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ public static int IndexOfPredicate<T, TPredicateOperator>(ReadOnlySpan<T> x)
ref var currentVector = ref Unsafe.Add(ref vectorsRef, indexVector);
if (TPredicateOperator.Invoke(ref currentVector))
{
for (var indexElement = 0; indexElement < Vector<int>.Count; indexElement++)
for (var indexElement = 0; indexElement < Vector<T>.Count; indexElement++)
{
if (TPredicateOperator.Invoke(currentVector[indexElement]))
return ((int)indexVector * Vector<int>.Count) + indexElement;
return ((int)indexVector * Vector<T>.Count) + indexElement;
}
}
}

indexSource = indexVector * Vector<int>.Count;
indexSource = indexVector * Vector<T>.Count;
}

ref var xRef = ref MemoryMarshal.GetReference(x);
Expand Down

0 comments on commit 1fcf3c4

Please sign in to comment.