kronos_compute/implementation/
mod.rs1use std::sync::Mutex;
4use log::warn;
5
6pub mod error;
7pub mod instance;
8pub mod device;
9pub mod memory;
10pub mod buffer;
11pub mod pipeline;
12pub mod descriptor;
13pub mod sync;
14pub mod icd_loader;
15pub mod forward;
16pub mod persistent_descriptors;
17pub mod barrier_policy;
18pub mod timeline_batching;
19pub mod pool_allocator;
20
21#[cfg(test)]
22mod tests;
23
24pub use instance::*;
26pub use device::*;
27pub use memory::*;
28pub use buffer::*;
29pub use pipeline::*;
30pub use descriptor::*;
31pub use sync::*;
32
33lazy_static::lazy_static! {
35 pub static ref ICD_INITIALIZED: Mutex<bool> = Mutex::new(false);
36}
37
38pub fn initialize_kronos() -> Result<(), error::KronosError> {
40 let mut initialized = ICD_INITIALIZED.lock()?;
41 if *initialized {
42 return Ok(());
43 }
44
45 match icd_loader::initialize_icd_loader() {
48 Ok(()) => {
49 *initialized = true;
50 log::info!("Kronos initialized successfully with ICD forwarding");
51 Ok(())
52 }
53 Err(e) => {
54 warn!("Failed to initialize Vulkan ICD loader: {}", e);
56 *initialized = true; Ok(())
58 }
59 }
60}
61