oxgpu 0.1.0

A lightweight GPU compute library built on wgpu
Documentation
#[cfg(test)]
mod tests {
    use oxgpu::{Buffer, Context};

    #[tokio::test]
    async fn test_map_read_write() {
        let ctx = Context::new().await.unwrap();

        // 1. Create a buffer with initial data
        let data = vec![1.0f32, 2.0, 3.0];
        // Note: Buffer::from_slice adds COPY_SRC | COPY_DST which enables our read/write abstraction.
        // This is effectively how "Map Write" (upload) and "Map Read" (download) are handled.
        let buffer = Buffer::from_slice(&ctx, &data).await;

        // 2. Read back (Map Read equivalent)
        // Internally: copies to staging buffer -> maps staging buffer -> reads
        let read_back = buffer.read(&ctx).await.unwrap();
        assert_eq!(read_back, data, "Data matches after creation");

        // 3. Write new data (Map Write equivalent)
        // Internally: queue.write_buffer (most efficient update method)
        let new_data = vec![10.0f32, 20.0, 30.0];
        buffer.write(&ctx, &new_data);

        // 4. Read again to verify write
        let read_back_new = buffer.read(&ctx).await.unwrap();
        assert_eq!(read_back_new, new_data, "Data matches after write");

        println!("Map Read/Write test passed!");
    }
}