DirectML/Samples/HelloDirectML
Sumit Agarwal b8730648d1
Update Samples and Release.md (#636)
2024-08-23 16:52:54 -07:00
..
HelloDirectML.sln Support Xbox in HelloDirectML sample (#394) 2023-02-23 16:21:35 -08:00
HelloDirectML.vcxproj Update Samples and Release.md (#636) 2024-08-23 16:52:54 -07:00
HelloDirectMLX.vcxproj Update Samples and Release.md (#636) 2024-08-23 16:52:54 -07:00
d3dx12.h Update README and add TensorFlow samples (#11) 2020-06-16 21:26:22 -07:00
main.cpp Support constant data nodes in DirectMLX (#564) 2024-03-15 14:26:06 -07:00
packages.config Update Samples and Release.md (#636) 2024-08-23 16:52:54 -07:00
pch.cpp Update README and add TensorFlow samples (#11) 2020-06-16 21:26:22 -07:00
pch.h Support Xbox in HelloDirectML sample (#394) 2023-02-23 16:21:35 -08:00
readme.md Update samples to use DML 1.9.0, and other small additions (#268) 2022-07-20 15:43:52 -07:00

readme.md

page_type languages products name urlFragment
sample
cpp
windows
xbox
HelloDirectML HelloDirectML

HelloDirectML sample

A minimal but complete DirectML sample that demonstrates how to initialize D3D12 and DirectML, create and compile an operator, execute the operator on the GPU, and retrieve the results.

This sample executes the DirectML "identity" operator over a 1x2x3x4 tensor. The identity operator is the simplest DirectML operator and performs the expression f(x) = x, which is functionally equivalent to a copy of the tensor contents. The expected output is:

input tensor: 1.62 1.62 1.62 1.62 1.62 1.62 1.62 1.62 1.62 1.62 1.62 1.62 1.62 1.62 1.62 1.62 1.62 1.62 1.62 1.62 1.62 1.62 1.62 1.62
output tensor: 1.62 1.62 1.62 1.62 1.62 1.62 1.62 1.62 1.62 1.62 1.62 1.62 1.62 1.62 1.62 1.62 1.62 1.62 1.62 1.62 1.62 1.62 1.62 1.62

When built using the "Debug" configuration, the sample enables the D3D12 and DirectML debug layers, which require the Graphics Tools feature-on-demand (FOD) to be installed. For more information, see Using the DirectML debug layer.