Skip to content

How to create an NDArray from pointer and NPTypeCode? #390

Description

@LarryThermo

First of all thanks for this project.

My code calls into lower level C++ code and I wish to represent the returned array as an NDArray in C#. I have a pointer to the data, the length of the data in bytes, as well as type code. How would I go about creating an NDArray for this case? Something like:

NDArray CreateNDArray(void* data,int dataLengthBytes,NPTypeCode typeCode)
{
var storage = new UnmanagedStorage( "something here" );
var nda = new NDArray(storage);
return nda;
}

Thanks,

Lars

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions