Caffe2 - Python API
A deep learning, cross platform ML framework
rocm.py
1 import os
2 from .env import check_env_flag, check_negative_env_flag
3 
4 # Get ROCm Home Path
5 ROCM_HOME = os.getenv("ROCM_HOME", "/opt/rocm")
6 ROCM_VERSION = ""
7 USE_ROCM = False
8 
9 # Check if ROCm disabled.
10 if check_negative_env_flag("USE_ROCM"):
11  USE_ROCM = False
12 else:
13  # If ROCM home exists or we explicitly enable ROCm
14  if os.path.exists(ROCM_HOME) or check_env_flag('USE_ROCM'):
15  USE_ROCM = True