Skip to content

Commit

Permalink
Also remove IsNPU function if not building with npu support
Browse files Browse the repository at this point in the history
  • Loading branch information
Sheil Kumar committed Nov 20, 2023
1 parent ac870ac commit b33adb9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions onnxruntime/core/providers/dml/dml_provider_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,15 @@ static bool IsGPU(IDXCoreAdapter* compute_adapter) {
return compute_adapter->IsAttributeSupported(DXCORE_ADAPTER_ATTRIBUTE_D3D12_GRAPHICS);
}

#ifdef ENABLE_NPU_ADAPTER_ENUMERATION
static bool IsNPU(IDXCoreAdapter* compute_adapter) {
// Only considering hardware adapters
if (!IsHardwareAdapter(compute_adapter)) {
return false;
}
return !(compute_adapter->IsAttributeSupported(DXCORE_ADAPTER_ATTRIBUTE_D3D12_GRAPHICS));
}
#endif

enum class DeviceType { GPU, NPU, BadDevice };

Expand Down

0 comments on commit b33adb9

Please sign in to comment.