You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by al...@apache.org on 2021/07/13 10:54:39 UTC

[arrow-rs] branch master updated: Test for simd build (#534)

This is an automated email from the ASF dual-hosted git repository.

alamb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git


The following commit(s) were added to refs/heads/master by this push:
     new d6334aa  Test for simd build (#534)
d6334aa is described below

commit d6334aa64d5a7aeb9a7ce7269d0b67adf376d03f
Author: Andrew Lamb <an...@nerdnetworks.org>
AuthorDate: Tue Jul 13 06:54:29 2021 -0400

    Test for simd build (#534)
---
 .github/workflows/rust.yml              |  6 ++++++
 arrow/src/compute/kernels/comparison.rs |  4 ++--
 arrow/test/dependency/simd/Cargo.toml   | 29 +++++++++++++++++++++++++++++
 arrow/test/dependency/simd/src/main.rs  |  3 +++
 4 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
index d65de5a..76511bf 100644
--- a/.github/workflows/rust.yml
+++ b/.github/workflows/rust.yml
@@ -161,6 +161,12 @@ jobs:
           export CARGO_TARGET_DIR="/github/home/target"
           cd arrow
           cargo test --features "simd"
+      - name: Check new project build with simd features
+        run: |
+          export CARGO_HOME="/github/home/.cargo"
+          export CARGO_TARGET_DIR="/github/home/target"
+          cd arrow/test/dependency/simd
+          cargo check
 
   windows-and-macos:
     name: Test on ${{ matrix.os }} Rust ${{ matrix.rust }}
diff --git a/arrow/src/compute/kernels/comparison.rs b/arrow/src/compute/kernels/comparison.rs
index bd74ceb..816c8bd 100644
--- a/arrow/src/compute/kernels/comparison.rs
+++ b/arrow/src/compute/kernels/comparison.rs
@@ -591,7 +591,7 @@ where
 
                 let bitmask = T::mask_to_u64(&simd_result);
                 let bytes = bitmask.to_le_bytes();
-                &result_slice[0..lanes / 8].copy_from_slice(&bytes[0..lanes / 8]);
+                result_slice[0..lanes / 8].copy_from_slice(&bytes[0..lanes / 8]);
 
                 &mut result_slice[lanes / 8..]
             },
@@ -669,7 +669,7 @@ where
 
             let bitmask = T::mask_to_u64(&simd_result);
             let bytes = bitmask.to_le_bytes();
-            &result_slice[0..lanes / 8].copy_from_slice(&bytes[0..lanes / 8]);
+            result_slice[0..lanes / 8].copy_from_slice(&bytes[0..lanes / 8]);
 
             &mut result_slice[lanes / 8..]
         },
diff --git a/arrow/test/dependency/simd/Cargo.toml b/arrow/test/dependency/simd/Cargo.toml
new file mode 100644
index 0000000..c676c7f
--- /dev/null
+++ b/arrow/test/dependency/simd/Cargo.toml
@@ -0,0 +1,29 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+[package]
+name = "defeault-features"
+description = "Models a user application of arrow that uses the simd feature of arrow"
+version = "0.1.0"
+edition = "2018"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
+arrow = { path = "../../../../arrow", version = "5.0.0-SNAPSHOT", features = ["simd"]}
+
+[workspace]
diff --git a/arrow/test/dependency/simd/src/main.rs b/arrow/test/dependency/simd/src/main.rs
new file mode 100644
index 0000000..e7a11a9
--- /dev/null
+++ b/arrow/test/dependency/simd/src/main.rs
@@ -0,0 +1,3 @@
+fn main() {
+    println!("Hello, world!");
+}