-
Notifications
You must be signed in to change notification settings - Fork 787
[NFC][SYCL] Use plain context_impl *
for func params in scheduler
#19156
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -185,7 +185,6 @@ class event_impl; | |||||
class context_impl; | ||||||
class DispatchHostTask; | ||||||
|
||||||
using ContextImplPtr = std::shared_ptr<detail::context_impl>; | ||||||
using EventImplPtr = std::shared_ptr<detail::event_impl>; | ||||||
using StreamImplPtr = std::shared_ptr<detail::stream_impl>; | ||||||
|
||||||
|
@@ -214,6 +213,10 @@ struct MemObjRecord { | |||||
|
||||||
// The context which has the latest state of the memory object. | ||||||
std::shared_ptr<context_impl> MCurContext; | ||||||
context_impl *getCurContext() { return MCurContext.get(); } | ||||||
void setCurContext(context_impl *Ctx) { | ||||||
MCurContext = Ctx ? Ctx->shared_from_this() : nullptr; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My understanding was that the
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That only works during creation of the very first |
||||||
} | ||||||
|
||||||
// The mode this object can be accessed from the host (host_accessor). | ||||||
// Valid only if the current usage is on host. | ||||||
|
@@ -688,7 +691,7 @@ class Scheduler { | |||||
/// Finds dependencies for the requirement. | ||||||
std::set<Command *> findDepsForReq(MemObjRecord *Record, | ||||||
const Requirement *Req, | ||||||
const ContextImplPtr &Context); | ||||||
context_impl *Context); | ||||||
|
||||||
EmptyCommand *addEmptyCmd(Command *Cmd, | ||||||
const std::vector<Requirement *> &Req, | ||||||
|
@@ -702,7 +705,7 @@ class Scheduler { | |||||
/// Searches for suitable alloca in memory record. | ||||||
AllocaCommandBase *findAllocaForReq(MemObjRecord *Record, | ||||||
const Requirement *Req, | ||||||
const ContextImplPtr &Context, | ||||||
context_impl *Context, | ||||||
bool AllowConst = true); | ||||||
|
||||||
friend class Command; | ||||||
|
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.
Could there be a benefit to having a const overload?
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.
const-correctness and the choices we have to make (technically, C++ will allow to return non-const from const method) are intentionally left for a future refactoring separate from this activity.