Commit 860c51df authored by BRAMAS Berenger's avatar BRAMAS Berenger

update interval computation in order to use morton index

parent c8b69a4b
......@@ -130,7 +130,7 @@ public:
: allocatedMemoryInByte(0), memoryBuffer(nullptr), blockHeader(nullptr), cellSizes(nullptr),
cellIndexes(nullptr), blockCells(nullptr),
cellMultipoles(nullptr), cellLocals(nullptr), deleteBuffer(true){
FAssertLF(int(inEndingIndex-inStartingIndex) >= inNumberOfCells);
FAssertLF((inEndingIndex-inStartingIndex) >= MortonIndex(inNumberOfCells));
// Total number of bytes in the block
const size_t memoryToAlloc = sizeof(BlockHeader) + sizeof(CellClassSizes)
+ (inNumberOfCells*sizeof(MortonIndex))
......@@ -252,8 +252,8 @@ public:
}
/** The size of the interval endingIndex-startingIndex (set from the constructor) */
int getSizeOfInterval() const {
return int(blockHeader->endingIndex-blockHeader->startingIndex);
MortonIndex getSizeOfInterval() const {
return (blockHeader->endingIndex-blockHeader->startingIndex);
}
/** Return true if inIndex should be located in the current block */
......
......@@ -136,7 +136,7 @@ public:
const FSize nbParticlesAllocatedInGroup = RoundToUpperParticles(nbParticlesInGroup+(MemoryAlignementParticles-1)*inNumberOfLeaves);
// Find the number of leaf to allocate in the blocks
FAssertLF(int(inEndingIndex-inStartingIndex) >= inNumberOfLeaves);
FAssertLF((inEndingIndex-inStartingIndex) >= MortonIndex(inNumberOfLeaves));
// Total number of bytes in the block
const size_t sizeOfOneParticle = (3*sizeof(FReal) + NbSymbAttributes*sizeof(AttributeClass));
const size_t memoryToAlloc = sizeof(BlockHeader)
......@@ -252,8 +252,8 @@ public:
}
/** The size of the interval endingIndex-startingIndex (set from the constructor) */
int getSizeOfInterval() const {
return int(blockHeader->endingIndex-blockHeader->startingIndex);
MortonIndex getSizeOfInterval() const {
return (blockHeader->endingIndex-blockHeader->startingIndex);
}
/** Return true if inIndex should be located in the current block */
......
......@@ -103,7 +103,7 @@ public:
totalDown += sizePerLeafDown[idxLeaf];
}
FAssertLF(int(inEndingIndex-inStartingIndex) >= inNumberOfLeaves);
FAssertLF((inEndingIndex-inStartingIndex) >= MortonIndex(inNumberOfLeaves));
// Total number of bytes in the block
const size_t memoryToAllocSymb = sizeof(BlockHeader)
+ (inNumberOfLeaves*sizeof(LeafHeader))
......@@ -209,8 +209,8 @@ public:
}
/** The size of the interval endingIndex-startingIndex (set from the constructor) */
int getSizeOfInterval() const {
return int(blockHeader->endingIndex-blockHeader->startingIndex);
MortonIndex getSizeOfInterval() const {
return (blockHeader->endingIndex-blockHeader->startingIndex);
}
/** Return true if inIndex should be located in the current block */
......
......@@ -101,8 +101,8 @@ public:
}
/** The size of the interval endingIndex-startingIndex (set from the constructor) */
int getSizeOfInterval() const {
return int(blockHeader->endingIndex-blockHeader->startingIndex);
MortonIndex getSizeOfInterval() const {
return (blockHeader->endingIndex-blockHeader->startingIndex);
}
/** Return true if inIndex should be located in the current block */
......
......@@ -127,8 +127,8 @@ public:
}
/** The size of the interval endingIndex-startingIndex (set from the constructor) */
__device__ int getSizeOfInterval() const {
return int(blockHeader->endingIndex-blockHeader->startingIndex);
__device__ MortonIndex getSizeOfInterval() const {
return (blockHeader->endingIndex-blockHeader->startingIndex);
}
/** Return true if inIndex should be located in the current block */
......
......@@ -452,7 +452,7 @@ MortonIndex FOpenCLGroupOfCells_getEndingIndex(const struct FOpenCLGroupOfCells*
int FOpenCLGroupOfCells_getNumberOfCellsInBlock(const struct FOpenCLGroupOfCells* group) {
return group->blockHeader->numberOfCellsInBlock;
}
int FOpenCLGroupOfCells_getSizeOfInterval(const struct FOpenCLGroupOfCells* group) {
MortonIndex FOpenCLGroupOfCells_getSizeOfInterval(const struct FOpenCLGroupOfCells* group) {
return group->blockHeader->endingIndex - group->blockHeader->startingIndex;
}
bool FOpenCLGroupOfCells_isInside(const struct FOpenCLGroupOfCells* group, const MortonIndex inIndex){
......
......@@ -586,7 +586,6 @@ struct RunContainer{
std::cout << "\n>> Using " << omp_get_max_threads() << " omp threads.\n" << std::endl;
typedef FUnifKernel<FReal,GroupCellClass,GroupContainerClass,MatrixKernelClass,ORDER> GroupKernelClass;
// Set the number of threads
omp_set_num_threads(FParameters::getValue(argc,argv,FParameterDefinitions::NbThreads.options, omp_get_max_threads()));
typedef FGroupTaskDepAlgorithm<GroupOctreeClass, typename GroupOctreeClass::CellGroupClass, GroupCellClass,
GroupCellSymbClass, GroupCellUpClass, GroupCellDownClass, GroupKernelClass, typename GroupOctreeClass::ParticleGroupClass, GroupContainerClass > GroupAlgorithm;
std::cout << "Using FGroupTaskDepAlgorithm" << std::endl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment