Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for building with feature gates ["simd"] #534

Merged
merged 1 commit into from
Jul 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 2 additions & 2 deletions arrow/src/compute/kernels/comparison.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems unrelated, was it a needless borrow clippy lint?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes -- sorry -- I should have mentioned that. When I was testing the project with simd locally this was flagged as a compiler warning so I fixed it.


&mut result_slice[lanes / 8..]
},
Expand Down Expand Up @@ -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..]
},
Expand Down
29 changes: 29 additions & 0 deletions arrow/test/dependency/simd/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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]
3 changes: 3 additions & 0 deletions arrow/test/dependency/simd/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}