Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Constant can be created as from shared memory #26901

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

praasz
Copy link
Contributor

@praasz praasz commented Oct 3, 2024

Details:

  • Add Constant constructor to create from shared memory. This constructor optimally can take shared object to take owner ship and release it on Constant end-of-life.
  • Follow up of this request

Related PR:

Tickets:

@praasz praasz requested a review from a team as a code owner October 3, 2024 12:55
@github-actions github-actions bot added category: Core OpenVINO Core (aka ngraph) category: CPP API OpenVINO CPP API bindings labels Oct 3, 2024
@praasz praasz added this to the 2024.5 milestone Oct 3, 2024
@@ -186,6 +186,24 @@ class OPENVINO_API Constant : public Op {
/// \param data A void* to constant data.
Constant(const element::Type& type, const Shape& shape, const void* data);

/// \brief Construct a tensor constant from shared memory.
///
/// The constant byte size (defined by type and shape) must be lower than shred memory size, otherwise throw
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// The constant byte size (defined by type and shape) must be lower than shred memory size, otherwise throw
/// The constant byte size (defined by type and shape) must be lower than shared memory size, otherwise throw

Comment on lines +193 to +194
/// The Constant can take ownership of shared memory if provided shared object is not null pointer manges memory
/// lifetime.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// The Constant can take ownership of shared memory if provided shared object is not null pointer manges memory
/// lifetime.
/// The Constant can take ownership of shared memory if provided shared object is not null and manages memory
/// lifetime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Core OpenVINO Core (aka ngraph) category: CPP API OpenVINO CPP API bindings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants