Initial Metal backend support to dcompute#5118
Initial Metal backend support to dcompute#5118asindarov wants to merge 19 commits intoldc-developers:masterfrom
Conversation
|
In cmakelist, LDC_LLVM_VER was removed. Try LLVM_VERSION_MAJOR. |
…er and load them in the function body
be7bad2 to
5906ad4
Compare
thewilsonator
left a comment
There was a problem hiding this comment.
Looking good. Needs some tests.
| } | ||
| }; | ||
|
|
||
| struct DcomputeMetalScalarRewrite : ABIRewrite { |
There was a problem hiding this comment.
it still used in abi/metal.cpp file:
struct MetalABI : TargetABI {
DComputePointerRewrite pointerRewite;
DcomputeMetalScalarRewrite metalScalarRewrite;
.....
It is used to make scalar objects turn into a pointer in constant memory address space. Although it turns out scalars can also be stored in device level address space which will be Global in the dcompute term as I understand
There was a problem hiding this comment.
scalar arguments to kernels are just passed as parameters
| * valid values of _version are for OpenCL 100 110 120 200 210 | ||
| * and for CUDA are x*100 + y*10 for x any valid values of sm x.y | ||
| * use 0 as a wildcard to match any version. | ||
|
|
There was a problem hiding this comment.
ditto, also could you update the documentation here to specify what are the valid versions of Metal (e.g. 400)?
| * arguments MUST be compiletime constants | ||
| * valid values of _version are for OpenCL 100 110 120 200 210 | ||
| * and for CUDA are x*100 + y*10 for x any valid values of sm x.y | ||
| * and for Metal is 4.0.0 |
There was a problem hiding this comment.
This bit of documentation refers to the integer parameter passed to a function, e.g. 400 for metal 4.0.0. This should also be tested
|
|
||
| // Terminate upon errors during the LLVM passes. | ||
| if (global.errors || global.warnings) { | ||
| Logger::println("Aborting because of errors/warnings during LLVM passes"); |
There was a problem hiding this comment.
this should be an error not a logger print
| if (useIR2ObjCache) { | ||
| cache::cacheObjectFile(filename, moduleHash); | ||
| } | ||
| } |
| const DString mlir_ext = "mlir"; | ||
| const DString bc_ext = "bc"; | ||
| const DString s_ext = "s"; | ||
| const DString metallib_ext = "metallib"; |
No description provided.