mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-19 02:48:12 +08:00
Restructure GPU compilation execution pipeline (#903)
* Restructure gpu compilation execution pipeline * Add compilation server/client infrastructure * Add wgpu executor
This commit is contained in:
committed by
Keavon Chambers
parent
5a4ef40d24
commit
a492e7a4bb
15
node-graph/compilation-client/src/lib.rs
Normal file
15
node-graph/compilation-client/src/lib.rs
Normal file
@@ -0,0 +1,15 @@
|
||||
use gpu_compiler_bin_wrapper::CompileRequest;
|
||||
use graph_craft::document::*;
|
||||
|
||||
pub async fn compile<I, O>(network: NodeNetwork) -> Result<Vec<u8>, reqwest::Error> {
|
||||
let client = reqwest::Client::new();
|
||||
|
||||
let compile_request = CompileRequest::new(network, std::any::type_name::<I>().to_owned(), std::any::type_name::<O>().to_owned());
|
||||
let response = client.post("http://localhost:3000/compile/spriv").json(&compile_request).send();
|
||||
let response = response.await?;
|
||||
response.bytes().await.map(|b| b.to_vec())
|
||||
}
|
||||
|
||||
pub fn compile_sync<I: 'static, O: 'static>(network: NodeNetwork) -> Result<Vec<u8>, reqwest::Error> {
|
||||
future_executor::block_on(compile::<I, O>(network))
|
||||
}
|
||||
Reference in New Issue
Block a user