Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 2 Packages Projects Releases Wiki Activity
Files
b112bfeda9dba77c6d7e8eef92125e7002c43e68
rust/library/core/tests/simd.rs

15 lines
263 B
Rust
Raw Normal View History

Test core::simd works These tests just verify some basic APIs of core::simd function, and guarantees that attempting to access the wrong things doesn't work. The majority of tests are stochastic, and so remain upstream, but a few deterministic tests arrive in the subtree as doc tests.
2021-10-22 00:47:12 -07:00
use core::simd::f32x4;
Introduce core::simd trait imports in tests
2022-07-20 18:08:14 -07:00
use core::simd::SimdFloat;
Test core::simd works These tests just verify some basic APIs of core::simd function, and guarantees that attempting to access the wrong things doesn't work. The majority of tests are stochastic, and so remain upstream, but a few deterministic tests arrive in the subtree as doc tests.
2021-10-22 00:47:12 -07:00
#[test]
fn testing() {
let x = f32x4::from_array([1.0, 1.0, 1.0, 1.0]);
let y = -x;
Force splatting in SIMD test
2021-12-02 19:22:00 -08:00
let h = x * f32x4::splat(0.5);
Test core::simd works These tests just verify some basic APIs of core::simd function, and guarantees that attempting to access the wrong things doesn't work. The majority of tests are stochastic, and so remain upstream, but a few deterministic tests arrive in the subtree as doc tests.
2021-10-22 00:47:12 -07:00
let r = y.abs();
assert_eq!(x, r);
assert_eq!(h, f32x4::splat(0.5));
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 409ms Template: 20ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API