style: format Rust workspace
This commit is contained in:
@@ -6,8 +6,8 @@
|
||||
use half::bf16;
|
||||
use std::ffi::c_void;
|
||||
use std::thread;
|
||||
use xserv_cuda::{device, GpuBuffer};
|
||||
use xserv_distributed::{get_unique_id, PpContext};
|
||||
use xserv_cuda::{GpuBuffer, device};
|
||||
use xserv_distributed::{PpContext, get_unique_id};
|
||||
|
||||
#[test]
|
||||
fn pp_send_recv_two_stages() {
|
||||
@@ -30,7 +30,8 @@ fn pp_send_recv_two_stages() {
|
||||
if stage == 0 {
|
||||
// Fill with a known pattern and send to stage 1.
|
||||
let host: Vec<bf16> = (0..n).map(|i| bf16::from_f32((i % 97) as f32)).collect();
|
||||
let src = unsafe { std::slice::from_raw_parts(host.as_ptr() as *const u8, n * 2) };
|
||||
let src =
|
||||
unsafe { std::slice::from_raw_parts(host.as_ptr() as *const u8, n * 2) };
|
||||
buf.copy_from_host(src).unwrap();
|
||||
pp.send_bf16_ptr(buf.as_mut_ptr() as *const c_void, n, 1);
|
||||
device::synchronize().unwrap();
|
||||
|
||||
Reference in New Issue
Block a user