Skip to content

[CoreML] Adapt to MLMultiArray.dataPointer being deprecated #17652

@NickLucche

Description

@NickLucche

Describe the issue

Hey,

I've seen we're using this MLMultiArray.dataPointer method here https://github.com/microsoft/onnxruntime/blob/main/onnxruntime/core/providers/coreml/model/model.mm#L327 to access the underlying memory before moving that to a C lifetime-managed location.

I noticed this method appears to be deprecated on Apple docs. I am merely speculating, but maybe is it because they support non-contiguously stored MLMultiArrays..?
My question is should we do something about this, like using some of the other non-deprecated element access methods (although it may decrease performance compared to memcpy), or are we sure this won't ever cause issues going forward?

To reproduce

Urgency

No response

Platform

iOS

OS Version

/

ONNX Runtime Installation

Released Package

Compiler Version (if 'Built from Source')

No response

Package Name (if 'Released Package')

None

ONNX Runtime Version or Commit ID

1.16.0

ONNX Runtime API

C++/C

Architecture

ARM64

Execution Provider

CoreML

Execution Provider Library Version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform:mobileissues related to ONNX Runtime mobile; typically submitted using template

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions