1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-10 07:55:35 +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

@ -51,7 +51,7 @@ void *PointerCache::Lookup(size_t bytes) {
if (bytes < 4096 ) return NULL;
#ifdef _OPENMP
#ifdef GRID_OMP
assert(omp_in_parallel()==0);
#endif

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;
}
}