MKL.NET icon indicating copy to clipboard operation
MKL.NET copied to clipboard

Provide MKL functions for pointers

Open ghost opened this issue 2 years ago • 3 comments

Hi,

First of all thanks for this library, it's really helpful to have the P/Invoke definitions available like this.

I wanted to ask whether it is possible to provide the MKL functions with double*,int signatures instead of double[]. Actually just making the original extern declarations public would be enough.

It would be really useful for example with pointers from memory-mapping or when I want to access only parts of an array.

Thanks and cheers

ghost avatar Nov 11 '21 15:11 ghost

Hi,

Yes this seems reasonable. I hoped for it to not be necessary. You can access parts of an array currently with the start and stride (e.g. int inia, int inca), but pointers would be more flexible and just be exposing the extern as you say.

I think this can be done as further overloads with extern using EntryPoint to get the function name right.

I'll look to do this soon. Feel free to PR any specific functions you need in the meantime.

AnthonyLloyd avatar Nov 11 '21 22:11 AnthonyLloyd

Hey, I would like to help out here. I think pointer support is important, especially nowadays with Span<T>. Is it OK if I message you to coordinate?

delreluca avatar Sep 30 '22 19:09 delreluca

Sure. I haven't been able to work on this for a while as I'm not working in an area that needs it at the moment.

AnthonyLloyd avatar Oct 02 '22 14:10 AnthonyLloyd