DirectML version history
DirectML is distributed as a system component of Windows, and is available as part of the Windows operating system (OS) in Windows 10, version 1903 (10.0; Build 18362) and newer.
Starting with DirectML version 1.4.0, DirectML is also available as a standalone redistributable package (see Microsoft.AI.DirectML), which is useful for applications that wish to use a fixed version of DirectML, or when running on older versions of Windows 10.
DirectML follows the semantic versioning conventions. That is, version numbers follow the form
major.minor.patch. The first release of DirectML has a version of 1.0.0.
|DirectML version||Feature level supported (see DirectML feature level history)||DML_TARGET_VERSION||First available in (OS)||First available in (Redistributable)|
||Windows 11 (Build 10.0.22621; 22H2)||DirectML-1.8.0|
||Windows 11 (Build 10.0.22000; 21H2)||DirectML-1.6.0|
||Windows 10, version 2004 (10.0; Build 19041) (Windows 10 May 2020 Update). Aka "20H1".||N/A|
||Windows 10, version 1903 (10.0; Build 18362) (Windows 10 May 2019 Update). Aka "19H1".||N/A|
1 The 1.2.0 and 1.3.0 intermediate releases of DirectML weren't made widely available.
Selecting a DirectML target version
For convenience, certain features in the
DirectML.h header file are declared conditionally based on the value of the
DML_TARGET_VERSION macro. By setting the
DML_TARGET_VERSION macro to certain values, you can exclude parts of
DirectML.h from your application.
That can be helpful if you're using a newer copy of
DirectML.h, but you're targeting a lower version of the DirectML binary, because it ensures that any attempt to use features beyond the chosen target level won't compile. This mechanism is similar to the
NTDDI_VERSION macro (see Macros for conditional declarations).
Here are the valid values for the
||Any features that require a version of DirectML newer than 1.10.0 are excluded from
||Any features that require a version of DirectML newer than 1.9.0 are excluded from
||Any features that require a version of DirectML newer than 1.8.0 are excluded from
||Any features that require a version of DirectML newer than 1.7.0 are excluded from
||Any features that require a version of DirectML newer than 1.6.0 are excluded from
||Any features that require a version of DirectML newer than 1.5.0 are excluded from
||Any features that require a version of DirectML newer than 1.4.0 are excluded from
||Any features that require a version of DirectML newer than 1.1.0 are excluded from
||Any features that require a version of DirectML newer than 1.0.0 are excluded from
|Not set||The target version is selected automatically for you. See below for details.|
DML_TARGET_VERSION is not set, then it is selected automatically by the following.
- If the
DML_TARGET_VERSION_USE_LATESTmacro is defined, then the latest target version is selected.
- Otherwise, the target version is selected based on the value of the
NTDDI_WIN10_NIresults in a target version of
NTDDI_WIN10_COresults in a target version of
NTDDI_WIN10_FEresults in a target version of
NTDDI_WIN10_VBresults in a target version of
NTDDI_WIN10_19H1results in a target version of
NTDDI_VERSIONis not defined, then the latest target version is selected (as if
Consider an application using version 10.0.19041.0 (Windows 10, version 2004) of the Windows Software Development Kit (SDK). From the table above, the version of DirectML that this corresponds to is 1.1.0, and the corresponding
If you don't set either the
DML_TARGET_VERSION nor the
NTDDI_VERSION macros, then the selected target version will default to
0x2000, and everything in
DirectML.h will be available for use.
If you want your application to be able to run on Windows 10, version 1903 (10.0; Build 18362), then you could
#define DML_TARGET_VERSION 0x1000, which will exclude all content in
DirectML.h that isn't supported by DirectML version 1.0.0. This ensures that any attempt to use functionality that requires a greater version will fail to compile.
DirectML version versus feature level
The DirectML version (for example, 1.0.0, or 1.4.0) describes a particular release of DirectML, including its associated
DirectML.h header file and
The feature level (for example,
DML_FEATURE_LEVEL_2_0) describes the capability of the underlying implementation of the API, which can vary from the version of
For example, an application building against a newer SDK, but running on an older version of Windows, might (at runtime) see a lower supported feature level, even if it's compiled against the latest SDK.