Skip to content

Commit

Permalink
infinity encoding in genome decoder fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
chrxh committed Oct 14, 2023
1 parent 08a4f52 commit 19917ea
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/EngineGpuKernels/GenomeDecoder.cuh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include <nppdefs.h>

#include "EngineInterface/CellFunctionConstants.h"
#include "EngineInterface/GenomeConstants.h"
#include "Base.cuh"
Expand Down Expand Up @@ -349,7 +351,8 @@ __inline__ __device__ bool GenomeDecoder::isSingleConstruction(ConstructorFuncti

__inline__ __device__ int GenomeDecoder::getNumRepetitions(ConstructorFunction const& constructor)
{
return max(1, constructor.genome[Const::GenomeHeaderNumRepetitionsPos]);
int result = max(1, toInt(constructor.genome[Const::GenomeHeaderNumRepetitionsPos]));
return result == 255 ? NPP_MAX_32S : result;
}

template <typename ConstructorOrInjector>
Expand Down

0 comments on commit 19917ea

Please sign in to comment.