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 log::info!("=== Kronos Implementation Initializing ===");
41 let mut initialized = ICD_INITIALIZED.lock()?;
42 if *initialized {
43 log::info!("Kronos already initialized");
44 return Ok(());
45 }
46
47 match icd_loader::initialize_icd_loader() {
50 Ok(()) => {
51 *initialized = true;
52 log::info!("Kronos initialized successfully with ICD forwarding");
53 Ok(())
54 }
55 Err(e) => {
56 warn!("Failed to initialize Vulkan ICD loader: {}", e);
58 *initialized = true; Ok(())
60 }
61 }
62}
63