Lowering memref.alloc to cudaHostAlloc

Hello all,

Does MLIR provide lowering memref.alloc to cudaHostAlloc?

If not, I’d like to write some patches that do this. What pass/dialect would be a good place to begin?

If you only want to make host memory accessible on the device, you can allocate it using normal memref.alloc and then register it with gpu.host_register 'gpu' Dialect - MLIR.

If you need something else, you can create your own patterns for lowering memref.alloca following the ones we have that target malloc and set up a new path in your downstream project.