rocm_rs/
lib.rs

1extern crate core;
2pub mod error;
3pub mod hip;
4pub mod miopen;
5pub mod rocblas;
6pub mod rocfft;
7pub mod rocrand;
8pub mod rocsolver;
9use crate::rocfft::examples;
10
11#[cfg(feature = "rocm_smi")]
12pub mod rocmsmi;
13// mod rocprofiler;
14pub mod rocsparse;
15
16#[cfg(test)]
17mod tests {
18    use crate::hip;
19    use crate::hip::{Device, DeviceMemory, device_synchronize, get_device_count};
20    use crate::rocfft::examples::run_1d_complex_example;
21    // use crate::rocprofiler::context::Properties;
22    // use crate::rocprofiler::profiler::{Profiler, get_metrics, version_string};
23    // use crate::rocprofiler::types::{Feature, InfoData, Parameter, ParameterName, ProfilerMode};
24    // use crate::rocrand::utils::{generate_normal_f32, generate_uniform_f64};
25    // 
26    // #[test]
27    // fn test_rocprofiler_simple() {
28    //     // Check device availability first
29    //     match hip::device_count() {
30    //         Ok(count) => println!("Found {} device(s)", count),
31    //         Err(e) => {
32    //             println!("Error getting device count: {}", e);
33    //             return;
34    //         }
35    //     }
36    // 
37    //     let device = match Device::new(0) {
38    //         Ok(dev) => {
39    //             let props = dev
40    //                 .properties()
41    //                 .unwrap_or_else(|_| panic!("Couldn't get device properties"));
42    //             println!("Using device: {}", props.name);
43    //             dev
44    //         }
45    //         Err(e) => {
46    //             println!("Failed to get device: {}", e);
47    //             return;
48    //         }
49    //     };
50    // 
51    //     // Try with a single widely-supported metric
52    //     let features = vec![Feature::new_metric(
53    //         "GRBM_COUNT",
54    //         vec![Parameter::new(ParameterName::SeMask, 0xffffffff)],
55    //     )];
56    // 
57    //     println!("Creating profiler...");
58    //     let profiler = match Profiler::new(
59    //         device,
60    //         features,
61    //         &[ProfilerMode::Standalone, ProfilerMode::SingleGroup],
62    //         None,
63    //     ) {
64    //         Ok(p) => {
65    //             println!("Profiler created successfully");
66    //             p
67    //         }
68    //         Err(e) => {
69    //             println!("Failed to create profiler: {} (code: {})", e, e.code());
70    //             return;
71    //         }
72    //     };
73    // }
74}