Fix if spacing (#562)
This commit is contained in:
Родитель
12abc68ea5
Коммит
224ceb74ff
|
@ -302,7 +302,7 @@ CommandLineArgs::CommandLineArgs(int argc, char** argv)
|
|||
m_inputRelPath = result["input_path"].as<std::filesystem::path>();
|
||||
}
|
||||
|
||||
if(result.count("output_path"))
|
||||
if (result.count("output_path"))
|
||||
{
|
||||
m_outputRelPath = result["output_path"].as<std::filesystem::path>();
|
||||
}
|
||||
|
@ -378,7 +378,7 @@ CommandLineArgs::CommandLineArgs(int argc, char** argv)
|
|||
}
|
||||
}
|
||||
|
||||
if(result.count("dml_feature_level"))
|
||||
if (result.count("dml_feature_level"))
|
||||
{
|
||||
m_dmlFeatureLevel = GetDmlFeatureLevelFromString(result["dml_feature_level"].as<std::string>());
|
||||
}
|
||||
|
@ -545,7 +545,7 @@ void CommandLineArgs::SetAdapter(IAdapter* adapter)
|
|||
{
|
||||
m_commandListType = D3D12_COMMAND_LIST_TYPE_DIRECT;
|
||||
}
|
||||
else if(adapter->IsAttributeSupported(DXCORE_ADAPTER_ATTRIBUTE_D3D12_CORE_COMPUTE))
|
||||
else if (adapter->IsAttributeSupported(DXCORE_ADAPTER_ATTRIBUTE_D3D12_CORE_COMPUTE))
|
||||
{
|
||||
m_commandListType = D3D12_COMMAND_LIST_TYPE_COMPUTE;
|
||||
}
|
||||
|
|
|
@ -105,13 +105,13 @@ Device::Device(
|
|||
featureLevel,
|
||||
IID_PPV_ARGS(&m_d3d)));
|
||||
|
||||
if(enableDred)
|
||||
if (enableDred)
|
||||
{
|
||||
// Enables more debug info for TDRs, can be used with Debugger
|
||||
// extension see following link for more info:
|
||||
// https://learn.microsoft.com/en-us/windows/win32/direct3d12/use-dred
|
||||
ComPtr<ID3D12DeviceRemovedExtendedDataSettings> pDredSettings;
|
||||
if(SUCCEEDED(m_d3dModule->GetDebugInterface(IID_PPV_ARGS(&pDredSettings))))
|
||||
if (SUCCEEDED(m_d3dModule->GetDebugInterface(IID_PPV_ARGS(&pDredSettings))))
|
||||
{
|
||||
pDredSettings->SetAutoBreadcrumbsEnablement(D3D12_DRED_ENABLEMENT_FORCED_ON);
|
||||
pDredSettings->SetPageFaultEnablement(D3D12_DRED_ENABLEMENT_FORCED_ON);
|
||||
|
@ -455,7 +455,7 @@ std::vector<std::byte> Device::Download(Microsoft::WRL::ComPtr<ID3D12Resource> d
|
|||
}
|
||||
|
||||
ExecuteCommandListAndWait();
|
||||
if(defaultBuffer->GetDesc().Width > std::numeric_limits<size_t>::max())
|
||||
if (defaultBuffer->GetDesc().Width > std::numeric_limits<size_t>::max())
|
||||
{
|
||||
throw std::invalid_argument(fmt::format("Buffer width '{}' is too large.", defaultBuffer->GetDesc().Width));
|
||||
}
|
||||
|
|
|
@ -148,7 +148,7 @@ void DmlDispatchable::Initialize()
|
|||
FillBindingData(m_desc.bindPoints.inputs, &m_initBindings, nullptr, inputBindingData, true);
|
||||
|
||||
DML_BUFFER_ARRAY_BINDING bufferArrayBindings = {};
|
||||
if(inputBindingData.bufferBindings.size() > std::numeric_limits<uint32_t>::max())
|
||||
if (inputBindingData.bufferBindings.size() > std::numeric_limits<uint32_t>::max())
|
||||
{
|
||||
throw std::invalid_argument(fmt::format("Initialization Input BindingCount '{}' is too large.", inputBindingData.bufferBindings.size()));
|
||||
}
|
||||
|
@ -217,7 +217,7 @@ void DmlDispatchable::Bind(const Bindings& bindings, uint32_t iteration)
|
|||
|
||||
THROW_IF_FAILED(m_device->DML()->CreateBindingTable(&bindingTableDesc, IID_PPV_ARGS(m_bindingTable.ReleaseAndGetAddressOf())));
|
||||
|
||||
if(inputBindingData.bindingDescs.size() > std::numeric_limits<uint32_t>::max())
|
||||
if (inputBindingData.bindingDescs.size() > std::numeric_limits<uint32_t>::max())
|
||||
{
|
||||
throw std::invalid_argument(fmt::format("BindInputs count '{}' is too large.", inputBindingData.bindingDescs.size()));
|
||||
}
|
||||
|
@ -242,7 +242,7 @@ void DmlDispatchable::Bind(const Bindings& bindings, uint32_t iteration)
|
|||
DML_BINDING_DESC bindingDesc = { DML_BINDING_TYPE_BUFFER, &bufferBinding };
|
||||
m_bindingTable->BindPersistentResource(&bindingDesc);
|
||||
}
|
||||
if(outputBindingData.bindingDescs.size() > std::numeric_limits<uint32_t>::max())
|
||||
if (outputBindingData.bindingDescs.size() > std::numeric_limits<uint32_t>::max())
|
||||
{
|
||||
throw std::invalid_argument(fmt::format("BindOutputs count '{}' is too large.", outputBindingData.bindingDescs.size()));
|
||||
}
|
||||
|
|
|
@ -72,10 +72,10 @@ D3d12Module::D3d12Module(bool disableAgilitySDK, const char* moduleName) : Modul
|
|||
if (m_module)
|
||||
{
|
||||
#if !defined(_GAMING_XBOX) && defined(WIN32)
|
||||
if(!disableAgilitySDK)
|
||||
if (!disableAgilitySDK)
|
||||
{
|
||||
InitSymbol(&m_d3d12SDKConfiguration, "D3D12GetInterface");
|
||||
if(m_d3d12SDKConfiguration)
|
||||
if (m_d3d12SDKConfiguration)
|
||||
{
|
||||
ComPtr<ID3D12SDKConfiguration1> pD3D12SDKConfiguration;
|
||||
THROW_IF_FAILED(m_d3d12SDKConfiguration(CLSID_D3D12SDKConfiguration, IID_PPV_ARGS(&pD3D12SDKConfiguration)));
|
||||
|
|
|
@ -441,7 +441,7 @@ std::ostream& operator<<(std::ostream& os, const BufferDataView<T>& view)
|
|||
{
|
||||
auto nBytes = std::max(view.desc.sizeInBytes, (uint64_t) view.desc.initialValues.size());
|
||||
uint64_t elementCount = nBytes / Device::GetSizeInBytes(view.desc.initialValuesDataType);
|
||||
if(elementCount > std::numeric_limits<uint32_t>::max())
|
||||
if (elementCount > std::numeric_limits<uint32_t>::max())
|
||||
{
|
||||
throw std::invalid_argument("Buffer size is too large");
|
||||
}
|
||||
|
@ -518,7 +518,7 @@ void Executor::operator()(const Model::PrintCommand& command)
|
|||
resource = m_resources[command.resourceName].Get();
|
||||
bufferDesc = bufferDescTemp;
|
||||
}
|
||||
if(resource)
|
||||
if (resource)
|
||||
{
|
||||
outputValuesStorage = m_device->Download(resource);
|
||||
outputValues = outputValuesStorage;
|
||||
|
@ -573,7 +573,7 @@ void Executor::operator()(const Model::WriteFileCommand& command)
|
|||
dimensions = std::vector<uint32_t>(command.dimensions);
|
||||
tensorType = bufferDesc.initialValuesDataType;
|
||||
}
|
||||
if(resource)
|
||||
if (resource)
|
||||
{
|
||||
fileDataStorage = m_device->Download(resource);
|
||||
fileData = fileDataStorage;
|
||||
|
|
|
@ -369,7 +369,7 @@ void HlslDispatchable::Bind(const Bindings& bindings, uint32_t iteration)
|
|||
auto FillViewDesc = [&](auto& viewDesc)
|
||||
{
|
||||
viewDesc.Buffer.StructureByteStride = bindPoint.structureByteStride;
|
||||
if(source.elementCount > std::numeric_limits<uint32_t>::max())
|
||||
if (source.elementCount > std::numeric_limits<uint32_t>::max())
|
||||
{
|
||||
throw std::invalid_argument(fmt::format("ElementCount '{}' is too large.", source.elementCount));
|
||||
}
|
||||
|
|
|
@ -415,7 +415,7 @@ void OnnxDispatchable::Bind(const Bindings& jsonBindings, uint32_t iteration)
|
|||
tensorShapeUint32.push_back(1);
|
||||
}
|
||||
|
||||
if(tensorShapeUint32.size() > std::numeric_limits<uint32_t>::max())
|
||||
if (tensorShapeUint32.size() > std::numeric_limits<uint32_t>::max())
|
||||
{
|
||||
throw std::invalid_argument(fmt::format("TensorShapeUint32 '{}' is too large.", tensorShapeUint32.size()));
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ HRESULT DxDispatch::CreateDxDispatchFromJsonString(
|
|||
ComPtr<DxDispatch> dxDispatchImpl;
|
||||
ComPtr<IAdapter> adapter;
|
||||
|
||||
if(adapterUnk)
|
||||
if (adapterUnk)
|
||||
{
|
||||
RETURN_IF_FAILED(adapterUnk->QueryInterface(IID_PPV_ARGS(&adapter)));
|
||||
}
|
||||
|
|
|
@ -23,14 +23,14 @@ int main(int argc, char** argv)
|
|||
nullptr, // will log to console if not overwritten
|
||||
&dispatch
|
||||
);
|
||||
if(hr == S_OK)
|
||||
if (hr == S_OK)
|
||||
{
|
||||
RETURN_IF_FAILED(dispatch->RunAll());
|
||||
}
|
||||
else
|
||||
{
|
||||
// ignores S_FALSE
|
||||
if(FAILED(hr))
|
||||
if (FAILED(hr))
|
||||
{
|
||||
printf("%s failed with hr=0x%08x\n",argv[0], hr);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче