PcloudStimProd: make sh_ptrs to Pcloud*StimBuff atomic<>
This change is a bit pedantic, but since these vars aren't accessed in any hotpath, it's fine to be pedantic. We made these sh_ptrs atomic so we can use acquire and release side effects when loading and storing them. This doesn't eliminate the problem of seeing inconsistent state across microcontrollers, but it helps with simple accesses like these ones we already do.
This commit is contained in:
@@ -650,9 +650,14 @@ bool OpenClCollatingAndMeshingEngine::setupCollateDgramsArgs(
|
||||
|
||||
// Set ambienceHighVal argument (arg 4)
|
||||
uint32_t ambienceHighVal = 0;
|
||||
if (ambienceStimFrame.has_value() && parent.ambienceStimulusBuffer) {
|
||||
ambienceHighVal = parent.ambienceStimulusBuffer->ambienceHighVal;
|
||||
std::shared_ptr<PcloudAmbienceStimulusBuffer> ambienceBuff = nullptr;
|
||||
if (ambienceStimFrame.has_value()
|
||||
&& (ambienceBuff = parent.ambienceStimulusBuffer.load(
|
||||
std::memory_order_acquire)))
|
||||
{
|
||||
ambienceHighVal = ambienceBuff->ambienceHighVal;
|
||||
}
|
||||
|
||||
err = clSetKernelArg(collateKernel, 4, sizeof(uint32_t), &ambienceHighVal);
|
||||
if (err != CL_SUCCESS)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user