Inplace replace in Array based on a condition This function does the C-equivalent of the following statement, except that the operation happens on a GPU for all elements simultaneously. ```text a = cond ? a : b; /// where cond, a & b are all objects of type Array ``` # Parameters - `a` is the Array whose element will be replaced with element from `b` if corresponding element in `cond` Array is
(a: &mut Array<T>, cond: &Array<bool>, b: &Array<T>)
| 885 | /// |
| 886 | /// None |
| 887 | pub fn replace<T>(a: &mut Array<T>, cond: &Array<bool>, b: &Array<T>) |
| 888 | where |
| 889 | T: HasAfEnum, |
| 890 | { |
| 891 | unsafe { |
| 892 | let err_val = af_replace(a.get() as *mut af_array, cond.get(), b.get()); |
| 893 | HANDLE_ERROR(AfError::from(err_val)); |
| 894 | } |
| 895 | } |
| 896 | |
| 897 | /// Inplace replace in Array based on a condition |
| 898 | /// |
no test coverage detected