SpMdM: Added support for arbitrary layouts of dense factor and result when using OpenCL.

CPU and OpenCL backends pass tests, CUDA implementation still needed.