Skip to content

Commit

Permalink
race condition in future state calculation fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
chrxh committed Dec 29, 2024
1 parent 05b13ed commit 4e9f5d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions source/EngineGpuKernels/CellProcessor.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public:
__inline__ __device__ static void verletVelocityUpdate(SimulationData& data);

__inline__ __device__ static void aging(SimulationData& data);
__inline__ __device__ static void livingStateTransition_calcNextState(SimulationData& data);
__inline__ __device__ static void livingStateTransition_calcFutureState(SimulationData& data);
__inline__ __device__ static void livingStateTransition_applyNextState(SimulationData& data);

__inline__ __device__ static void applyInnerFriction(SimulationData& data);
Expand Down Expand Up @@ -593,7 +593,7 @@ __inline__ __device__ void CellProcessor::aging(SimulationData& data)
}


__inline__ __device__ void CellProcessor::livingStateTransition_calcNextState(SimulationData& data)
__inline__ __device__ void CellProcessor::livingStateTransition_calcFutureState(SimulationData& data)
{
auto& cells = data.objects.cellPointers;
auto partition = calcAllThreadsPartition(cells.getNumEntries());
Expand Down
2 changes: 1 addition & 1 deletion source/EngineGpuKernels/SimulationKernels.cu
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ __global__ void cudaNextTimestep_cellFunction_prepare_substep1(SimulationData da
{
CellProcessor::aging(data);
MutationProcessor::applyRandomMutations(data);
CellProcessor::livingStateTransition_calcFutureState(data);
}

__global__ void cudaNextTimestep_cellFunction_prepare_substep2(SimulationData data)
{
CellProcessor::livingStateTransition_calcNextState(data);
CellProcessor::livingStateTransition_applyNextState(data);
CellFunctionProcessor::collectCellFunctionOperations(data);
CellFunctionProcessor::updateRenderingData(data);
Expand Down

0 comments on commit 4e9f5d0

Please sign in to comment.