Skip to content

Add `clamp()` implementation

Ryan Curtin requested to merge rcurtin/bandicoot-code:clamp into unstable

This was originally from zoq(); I added an OpenCL implementation, did some adaptation, and added tests. Technically this wasn't in the first release checklist in #20 (closed), but it was a part of the ens branch and so it should get merged sooner or later anyway. 😄

Instead of using mtOp like Armadillo does, I just added a second aux_b field to Op, so that we can store both arguments to clamp(). All Ops should be optimized out by the compiler anyway, so it shouldn't matter if we add another member to it.

Merge request reports