pub struct RocmEnv { /* private fields */ }Expand description
ROCm environment information, lazily detected from the system.
All detection delegates to platform::linux. This struct provides
a convenient cached view of the ROCm environment for installer use.
§Validation
- VAL-INFRA-007: ROCm env uses platform::linux (no duplicate detection)
- VAL-INFRA-008: ROCm version detection returns semantic version
Implementations§
Source§impl RocmEnv
impl RocmEnv
Sourcepub fn detect() -> Self
pub fn detect() -> Self
Detect the ROCm environment from the system.
This calls platform::linux::detect_rocm_path() and
platform::linux::get_rocm_version() — no duplicate detection.
Sourcepub fn from_known(path: Option<PathBuf>, version: String) -> Self
pub fn from_known(path: Option<PathBuf>, version: String) -> Self
Create a RocmEnv with known values (useful for testing).
Sourcepub fn version(&self) -> &str
pub fn version(&self) -> &str
Get the ROCm version string.
Returns an empty string if ROCm is not installed or version cannot be determined.
Sourcepub fn is_detected(&self) -> bool
pub fn is_detected(&self) -> bool
Check if a ROCm installation was found.
Sourcepub fn bin_path(&self) -> Option<PathBuf>
pub fn bin_path(&self) -> Option<PathBuf>
Get the ROCm bin directory path.
Returns None if ROCm is not detected or the bin directory
does not exist.
Sourcepub fn lib_path(&self) -> Option<PathBuf>
pub fn lib_path(&self) -> Option<PathBuf>
Get the ROCm lib directory path.
Checks both lib and lib64 subdirectories.
Sourcepub fn include_path(&self) -> Option<PathBuf>
pub fn include_path(&self) -> Option<PathBuf>
Get the ROCm include directory path.
Sourcepub fn tool_exists(&self, tool_name: &str) -> bool
pub fn tool_exists(&self, tool_name: &str) -> bool
Check if a specific ROCm tool exists.
Checks both in the ROCm bin directory and in the system PATH.
Sourcepub fn tool_path(&self, tool_name: &str) -> Option<PathBuf>
pub fn tool_path(&self, tool_name: &str) -> Option<PathBuf>
Get the full path to a ROCm tool.
Returns None if the tool is not found.
Sourcepub fn version_major_minor(&self) -> String
pub fn version_major_minor(&self) -> String
Get the ROCm major.minor version (e.g., “7.2” from “7.2.0”).
Returns an empty string if version cannot be parsed.
Sourcepub fn series_candidates(&self) -> Vec<String>
pub fn series_candidates(&self) -> Vec<String>
Get the ROCm series candidates for wheel index probing.
Returns the detected version first, then common fallback versions.
Sourcepub fn torch_index_url(&self, channel: &str, series: &str) -> String
pub fn torch_index_url(&self, channel: &str, series: &str) -> String
Get the PyTorch index URL for a given channel and ROCm series.
Sourcepub fn torch_radeon_index_url(&self, series: &str) -> String
pub fn torch_radeon_index_url(&self, series: &str) -> String
Get the Radeon PyTorch index URL for a given ROCm series.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RocmEnv
impl RefUnwindSafe for RocmEnv
impl Send for RocmEnv
impl Sync for RocmEnv
impl Unpin for RocmEnv
impl UnsafeUnpin for RocmEnv
impl UnwindSafe for RocmEnv
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more