Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exploration #1

Closed
Jasper-Bekkers opened this issue Jul 27, 2020 · 3 comments
Closed

Exploration #1

Jasper-Bekkers opened this issue Jul 27, 2020 · 3 comments

Comments

@Jasper-Bekkers
Copy link
Contributor

@khyperia
Copy link
Contributor

Some very high level tasks, in vague order of implementation order:

  1. Create infrastructure for emitting a module, i.e. wiring the rspirv context module through function emission, and emit the file at the end of compilation.
  2. Start on the guts of the codegen, e.g. start off with a big ol' match statement that translates the simple things, that slowly gets filled out.
  3. Create testing framework, e.g. a way to ergonomically write "here's some rust, I expect this spirv".
  4. Implement multi-crate support. I imagine this means writing a spirv linker, taking the spirv output of dependent libs and linking it into the current crate?
  5. Design an ergonomic way to use the project. This is a whole brainstorm, but for example, have users specify in a build.rs a path to a crate, and it outputs a file that you can include_bytes! or whatever.
  6. Extension of step 2, actually implement the complex codegen scenarios. Make sure everything works. Do complex compilery stuff, e.g. if we want to mem2reg the output (phi nodes), stuff like that. I imagine 90% of the project time will be here.
  7. Publish to the world!

@MarnixKuijs
Copy link
Member

MarnixKuijs commented Sep 16, 2020

  1. Design an ergonomic way to use the project. This is a whole brainstorm, but for example, have users specify in a build.rs a path to a crate, and it outputs a file that you can include_bytes! or whatever.

the rust cuda ecosystem has something like this (https://crates.io/crates/ptx-builder). All you have to specify in a build.rs file is:

use ptx_builder::error::Result;
use ptx_builder::prelude::*;

fn main() -> Result<()> {
    let builder = Builder::new(".")?;
    CargoAdapter::with_env_var("KERNEL_PTX_PATH").build(builder);
}

which allows a user to get the contents of their ptx file through:

let ptx_file = CString::new(include_str!(env!("KERNEL_PTX_PATH"))).unwrap();

I'm currently doing some research to see how it works

@khyperia
Copy link
Contributor

We've mostly already implemented things in this issue, and it's mostly been replicated in #47, so closing this.

geieredgar pushed a commit to geieredgar/rust-gpu that referenced this issue Aug 17, 2024
…Studios#1)

* Change URLs
* Switch away from paid runners.
* Drop copyright from MIT license. Similar to the Rust project. See the git history of
https://github.com/rust-lang/rust/blob/master/LICENSE-MIT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants