remove has methods

This commit is contained in:
harisreedhar
2026-02-12 19:45:55 +05:30
committed by henryruhs
parent 300b4f73a1
commit f71bbab71e
2 changed files with 5 additions and 13 deletions
+3 -3
View File
@@ -113,11 +113,11 @@ def resolve_cache_path() -> str:
def resolve_cudnn_conv_algo_search(execution_providers : List[ExecutionProvider]) -> str:
execution_devices = detect_static_graphic_devices(tuple(execution_providers))
graphic_devices = detect_static_graphic_devices(tuple(execution_providers))
product_names = ('GeForce GTX 1630', 'GeForce GTX 1650', 'GeForce GTX 1660')
for execution_device in execution_devices:
if execution_device.get('product').get('name').startswith(product_names):
for graphic_device in graphic_devices:
if graphic_device.get('product').get('name').startswith(product_names):
return 'DEFAULT'
return 'EXHAUSTIVE'
+2 -10
View File
@@ -29,21 +29,13 @@ def detect_static_graphic_devices(execution_providers : Tuple[ExecutionProvider,
def detect_graphic_devices(execution_providers : Tuple[ExecutionProvider, ...]) -> List[GraphicDevice]:
if has_amd_execution_provider(execution_providers):
if 'rocm' in execution_providers or 'migraphx' in execution_providers:
return detect_amd_graphic_devices()
if has_nvidia_execution_provider(execution_providers):
if 'cuda' in execution_providers or 'tensorrt' in execution_providers:
return detect_nvidia_graphic_devices()
return []
def has_amd_execution_provider(execution_providers : Tuple[ExecutionProvider, ...]) -> bool:
return 'rocm' in execution_providers or 'migraphx' in execution_providers
def has_nvidia_execution_provider(execution_providers : Tuple[ExecutionProvider, ...]) -> bool:
return 'cuda' in execution_providers or 'tensorrt' in execution_providers
def detect_nvidia_graphic_devices() -> List[GraphicDevice]:
pynvml = importlib.import_module('pynvml')
graphic_devices : List[GraphicDevice] = []