Function: numpy_contiguous_to_ptr
This API will be deprecated. Use acl.util.bytes_to_ptr instead.
C Prototype |
None |
|---|---|
Python Function |
ptr, data_out = acl.util.numpy_contiguous_to_ptr(data_in) |
Function Usage |
Obtains the memory data pointer address of a numpy.ndarry array. If the input numpy.ndarry array is non-contiguous in memory, convert the non-contiguous memory to contiguous one and then obtain the numpy.ndarry array after conversion and convert it to the memory data pointer address. |
Input Description |
data_in: data of the NumPy type. |
Return Value |
ptr: int, data that can be accessed by the C language. data_out: NumPy data. If the input NumPy array data_in is non-contiguous in the memory, the return value data_out is the NumPy array after the non-contiguous memory is converted into contiguous one. |
Restrictions |
If data of the int type is accessed, the memory data pointer address of the numpy.ndarray object needs to be converted to int. |
Precautions |
|