You can also run Cycles' CUDA backend with ROCm on amdgpu (somewhat..).
However, you need Cycles, and not Eevee. They have very significant difference in quality.
https://all3dp.com/2/blender-render-from-eevee-simply-explai...
> You can also run Cycles' CUDA backend with ROCm on amdgpu (somewhat..).
No. No. No, you can't.
They support only some GPUs !!!AND CPUs!!!. No support for RX 5xxx-6xxx XT. They are very picky about the hardware they support.
https://github.com/ROCm/ROCm.github.io/blob/master/hardware....
https://github.com/ROCm/ROCm.github.io/blob/master/hardware....
I think a lot of progress is being made on that front.
https://code.blender.org/2021/04/cycles-x/
> Deprecation
As part of the new architecture, we are removing some functionality. Most notably:
OpenCL rendering kernels. The combination of the limited Cycles split kernel implementation, driver bugs, and stalled OpenCL standard has made maintenance too difficult. We can only make the kinds of bigger changes we are working on now by starting from a clean slate.
Do they? Blender uses OpenCL implementation for AMD GPUs.
The programming model is also quite different, so code will have to be rewritten.
So, I think you need to abstract your code at the services level, and provide an implementations for each platform you need to support (the number may be 1 or more than 1).
I think you need to direct your "compute learning" energy at the algorithm level. Numerics and all that. The GPU API:s are just the obtuse implementation detail, but not the meat of the thing.
There are some cross-platform capabilities via SPIRV-Cross. The LLVM folks are working on MLIR that might provide even better features wrt. a common abstraction layer going forward.