[Migrated] Initializing workgroup memory
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Rust
- Star
- 3.4k
- Fork
- 126
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
Issue automatically imported from old repo: https://github.com/EmbarkStudios/rust-gpu/issues/1077
Old labels: t: enhancement
Originally creatd by kevinboulain on 2023-07-04T20:07:53Z
As far as I can tell, the workgroup/shared memory (context) can not be declared as to be zero-initialized and one has to do it manually.
https://github.com/KhronosGroup/Vulkan-Docs/issues/1457 has a bunch of interesting links: the extension VK_KHR_zero_initialize_workgroup_memory (promoted to core in Vulkan 1.3) allows to declare workgroup/shared variables with a null initializer. On the SPIR-V side, OpVariable with a Workgroup storage class is allowed to be initialized with OpConstantNull only (like so).
I don't know what the project would prefer, it could be an option to pass to the SpirvBuilder (I assume it could be desirable to always initialize these variables) or another symbol (similarly to how storage_buffer allows extra arguments):
#[spirv(compute(threads(256)))]
fn compute(
#[spirv(workgroup, null_initialized = true)] array: &mut [u32; N],
// ...
) {
// ...
}
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách lần theo SpirvBuilder và cách xử lý hiện có đối với bộ nhớ workgroup/shared, sau đó đối chiếu với các quy tắc Vulkan và SPIR-V được liên kết cho OpConstantNull. Công việc được xem là hoàn tất khi dự án có một API đã được quyết định để yêu cầu bộ nhớ workgroup được khởi tạo bằng 0 và hỗ trợ đầu ra SPIR-V hợp lệ tương ứng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- rust
- Lĩnh vực
- compilers, computer-graphics
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 25/100