You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I notice that "Or you could use HLSL to write a compute shader, perhaps to implement a physics simulation. However, if for example you're inclined to write your own convolution operator (for image processing) as HLSL in a compute shader, then you'll get better performance in that scenario if you use Direct Machine Learning (DirectML) instead." here.
Does DirectML have all the characteristics of DirectCompute?
Are all the APIs and functions in DirectCompute compatible with DirectML?
What are the differences between DirectCompute and DirectML?
In which situation should I use DirectCompute? When should I use DirectML?
The text was updated successfully, but these errors were encountered:
DirectCompute is synonymous with compute shaders, which are general-purpose programs that run on a GPU as part of the Direct3D programming API. There isn't a separate DirectCompute API, and there isn't a separate library/DLL for it; it's all just the Direct3D API and runtime library. I think DirectCompute was just a fancy marketing name back when the feature originally came out.
HLSL is the language used to write compute shaders, which are then compiled into a form of bytecode using a shader compiler. The shader bytecode is then handed off to a GPU driver using the Direct3D API.
DirectML is basically (oversimplifying here) a library of pre-compiled compute shaders. DirectML is a separate library and API that is distinct from Direct3D. The DirectML API can be viewed as an extension of the Direct3D 12 API; you cannot use DirectML without also using Direct3D 12.
Your questions:
Not sure how to answer this, because DirectML uses compute shaders. DirectML is not a superset or replacement for compute shaders, which should hopefully be more clear from background.
DirectML is compatible with Direct3D 12 and hand-written compute shaders. You can mix both types of work into the same D3D12 command lists, for example.
Hopefully explained earlier.
This is similar to asking when you should use an API like std::sort instead of writing your own sorting algorithm. You're encouraged to use the DirectML APIs if they fit your use case, but it can't cover all possible cases.
I notice that "Or you could use HLSL to write a compute shader, perhaps to implement a physics simulation. However, if for example you're inclined to write your own convolution operator (for image processing) as HLSL in a compute shader, then you'll get better performance in that scenario if you use Direct Machine Learning (DirectML) instead." here.
The text was updated successfully, but these errors were encountered: