[Routines] Update Exponents & Extrema with HostExecutor#332
Merged
forfudan merged 31 commits intoMar 11, 2026
Merged
Conversation
…lgorithms-group#331) This PR does the following (Mojo-Numerics-and-Algorithms-group#328 ), - Update backend with `apply_ternary` function which as of now is used for Fused Multiply Add (FMA) operations of three arrays or two arrays and a scalar. - Replace all instances of `backend()` with `HostExecutor` in arithmetic functions.
…Algorithms-group#334) `@parameter if` is being deprecated in favor of `comptime if`.
…and-Algorithms-group#335) `DeviceStorage` cannot be implicitly copied in mojo stdlib versions at or after dev2026022817
…gorithms-group#338) ## Replace Deprecated Traits with `Writable` - **Representable → Writable**: Replaces deprecated `Representable` with `Writable`. - **Stringable → Writable**: Replaces deprecated `Stringable` with `Writable`. ## Bug Fixes - **Recursive stringification in `NDArrayStrides`**: Fixes infinite recursion when `write_to` used `String(self)`, which re-entered `write_to`. Switched to `self.__str__()` in both `__repr__` and `write_to` to avoid recursion. - **`Device` and `repr()`**: Adds `write_repr_to` to `Device`. Mojo's `repr()` now calls `write_repr_to` instead of `__repr__`, which was causing failures in `tests/core/test_device.mojo`.
…errors, plus import issue (Mojo-Numerics-and-Algorithms-group#339) # Mojo Compatibility Updates ## Dependency Update - **Modular version**: Bump to `26.2.0.dev2026030605`. ## Bug Fixes ### VariadicList `is_owned` parameter - Unbinds the `is_owned` parameter on `VariadicList` usage to fix inference failures. ### SIMD.fma and `apply_ternary` type mismatch - Fixes a type mismatch where `SIMD.fma` would not match on `apply_ternary` because the kernel function has a `flag: FastMathFlag = FastMathFlag.CONTRACT` parameter. - Default values do not prevent type mismatch errors in this context. - `apply_ternary` expects `fn[DType, Int](SIMD, SIMD, SIMD) -> SIMD`, but `SIMD.fma` has signature `fn[DType, Int, +, flag: FastMathFlag = ...](self, multiplier, accumulator) -> SIMD`. - Likely caused by changes in [modular/mojo stdlib simd.mojo](https://github.com/modular/modular/blame/1ce7b57a4cac057803a54bcaa023f114eb4f7b3d/mojo/stdlib/std/builtin/simd.mojo#L274). --------- Co-authored-by: shivasankar <shivasankar.ka@gmail.com>
forfudan
approved these changes
Mar 11, 2026
Collaborator
forfudan
left a comment
There was a problem hiding this comment.
@shivasankarka There are some minor issues but not blocking. I will approve and merge this PR first and then deal with them in another PR later.
9d0fab3
into
Mojo-Numerics-and-Algorithms-group:pre-0.9
2 checks passed
forfudan
pushed a commit
that referenced
this pull request
Mar 31, 2026
This PR does the following (#328 ), - Replace all instances of backend() with HostExecutor in `exponent` and `extrema` functions. For functions that don't use backend(), replace those with appropriate `HostExecutor` overload. - Add `where dtype.is_floating_point()` constraint to all functions that internally make use of building mojo math functions. --------- Co-authored-by: josiahls <josiahls@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR does the following (#328 ),
exponentandextremafunctions. For functions that don't use backend(), replace those with appropriateHostExecutoroverload.where dtype.is_floating_point()constraint to all functions that internally make use of building mojo math functions.