Skip to content

Commit

Permalink
Filter CPU case for IsFloat16Supported (#2802)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ori Levari authored Jan 13, 2020
1 parent 8d017f5 commit 6ad3e74
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions winml/lib/Api.Image/DeviceHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <d3d11on12.h>
#include <wil/winrt.h>
#include "inc/DeviceHelpers.h"
#include "LearningModelDevice.h"

namespace DeviceHelpers {
constexpr uint32_t c_intelVendorId = 0x8086;
Expand Down Expand Up @@ -133,6 +134,10 @@ static HRESULT IsFloat16Blocked(ID3D12Device& device, bool* isBlocked) {
}

bool IsFloat16Supported(const winrt::Windows::AI::MachineLearning::LearningModelDevice& device) {
auto modelImpl = device.as<winmlp::LearningModelDevice>();
if (modelImpl->IsCpuDevice()) {
return true;
}
winrt::com_ptr<ID3D12Device> d3d12Device;
if (FAILED(GetD3D12Device(device, d3d12Device.put()))) {
return false;
Expand Down

0 comments on commit 6ad3e74

Please sign in to comment.