-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[GPU] Common shape info buffer. phase 1 #28167
Conversation
0c70e6e
to
498b793
Compare
@@ -215,6 +216,7 @@ struct network { | |||
bool _is_dynamic = false; | |||
bool _enable_profiling = false; | |||
bool _reset_arguments; | |||
memory::ptr _ptr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to hold the pointer to the base buffer in the sub-buffer itself, thus their lifetimes will be better aligned
void add_offset(size_t offsetPtr) const { | ||
_usm_pointer->_ptr = (void*) ((unsigned char*) _usm_pointer->_ptr + offsetPtr); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably we shouldn't expose this function because it allows shifting the pointer of any UsmMemory. This pointer is also used for free_mem() call, and I'm not sure it will be properly handled if shifted accidently for the not-shared memory buffer. Maybe it would be better to limit shifting only with specialized c-tr like UsmMemory(const cl::UsmHelper& usmHelper, void* usm_ptr, size_t offset = 0)
, which creates UsmHolder with shared_memory=true
option
498b793
to
0efb97e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, LGTM
Co-authored-by: Vladimir Paramuzov <vladimir.paramuzov@intel.com>
### Details: - Reduce memory usage - common buffer for shape info as the first step ### Tickets: - *ticket-id* --------- Co-authored-by: Vladimir Paramuzov <vladimir.paramuzov@intel.com>
Details:
Tickets: