1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-12-23 14:14:30 +00:00

Thread macro changes

This commit is contained in:
paboyle
2018-01-24 13:30:23 +00:00
parent ac56965306
commit 3318de27d6
2 changed files with 3 additions and 7 deletions

View File

@@ -169,10 +169,7 @@ public:
// std::cout << "alignedAllocator " << std::hex << ptr <<std::dec <<std::endl;
// First touch optimise in threaded loop
uint8_t *cp = (uint8_t *)ptr;
#ifdef GRID_OMP
#pragma omp parallel for
#endif
for(size_type n=0;n<bytes;n+=4096){
thread_loop(size_type n=0;n<bytes;n+=4096){
cp[n]=0;
}
return ptr;
@@ -277,8 +274,7 @@ public:
uint8_t *cp = (uint8_t *)ptr;
if ( ptr ) {
// One touch per 4k page, static OMP loop to catch same loop order
#pragma omp parallel for schedule(static)
for(size_type n=0;n<bytes;n+=4096){
thread_loop(size_type n=0;n<bytes;n+=4096){
cp[n]=0;
}
}