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

14 lines
241 B
Rust
Raw Normal View History

Fix library tests
2023-11-19 12:06:25 -05:00
use core::simd::prelude::*;
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: 609ms Template: 7ms
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