ritchie46 commented on a change in pull request #9361:
URL: https://github.com/apache/arrow/pull/9361#discussion_r568389045



##########
File path: rust/arrow/src/datatypes.rs
##########
@@ -920,6 +930,32 @@ make_signed_numeric_type!(Int64Type, i64x8);
 make_signed_numeric_type!(Float32Type, f32x16);
 make_signed_numeric_type!(Float64Type, f64x8);
 
+#[cfg(simd)]
+pub trait ArrowFloatNumericType: ArrowNumericType {
+    fn pow(base: Self::Simd, raise: Self::Simd) -> Self::Simd;

Review comment:
       For non-SIMD this would work indeed. However I could not proof my `SIMD` 
type had the `powf` method without this trait/ implementation. Or am I missing 
something?

##########
File path: rust/arrow/src/compute/kernels/arithmetic.rs
##########
@@ -35,20 +35,17 @@ use crate::datatypes;
 use crate::datatypes::ArrowNumericType;
 use crate::error::{ArrowError, Result};
 use crate::{array::*, util::bit_util};
+use num::traits::Pow;
 #[cfg(simd)]
 use std::borrow::BorrowMut;
 #[cfg(simd)]
 use std::slice::{ChunksExact, ChunksExactMut};
 
 /// Helper function to perform math lambda function on values from single 
array of signed numeric
 /// type. If value is null then the output value is also null, so `-null` is 
`null`.
-pub fn signed_unary_math_op<T, F>(
-    array: &PrimitiveArray<T>,
-    op: F,
-) -> Result<PrimitiveArray<T>>
+pub fn unary_math_op<T, F>(array: &PrimitiveArray<T>, op: F) -> 
Result<PrimitiveArray<T>>

Review comment:
       Right.. Then there is some duplication. What do you propose? Use the 
`crate::array::compute::kernels::arity::unary` for the logic in this model as 
wel? To me that seems more DRY.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to