-
Notifications
You must be signed in to change notification settings - Fork 790
[SYCL] Introduce thread-safety for kernels and programs cache #866
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
[SYCL] Introduce thread-safety for kernels and programs cache #866
Conversation
a705759
to
2938404
Compare
Resolved comments by @AlexeySachkov |
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.
LGTM.
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.
LGTM, thanks
2533609
to
05ffed3
Compare
assert(false && "We've build a program that is already have been built."); | ||
} | ||
|
||
ProgramWithState->State.store(BS_Built); |
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.
Can we use more relaxed memory models for all loads and stores you are adding?
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 don't think we may use relaxed memory model here as current (sequentially consistent model) makes other threads to synchronize on this variable.
state = WithBuildState->State.load(); | ||
} | ||
|
||
// expected to be null if state eq BuildFailed |
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.
How the nullptr is handled on the callers side?
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.
Now there will be an exception thrown according to spec.
78ba70e
to
84fc26a
Compare
84fc26a
to
53eebbd
Compare
|
||
Cache.notifyAllBuild(); | ||
|
||
std::rethrow_exception(std::current_exception()); |
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.
Is just
throw;
not enough?
063ec1d
to
b36dc7c
Compare
b36dc7c
to
ab4c8f2
Compare
KernelProgramCache::EntityWithState<RetT> *WithState; | ||
|
||
{ | ||
auto Locked = Acquire(Cache); |
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.
Please, do not use auto when the type is not clear for the line itself. Please, apply to whole patch.
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.
Done.
BTW, it is template function. It is intended to not know the exact type here.
ce17aee
to
977858d
Compare
@s-kanaev, could you please rebase your patch and resolve merge conflicts? |
977858d
to
8a4f32f
Compare
Done |
Signed-off-by: Sergey Kanaev <[email protected]>
8a4f32f
to
f2620b5
Compare
No description provided.