diff --git a/Grid/threads/Accelerator.h b/Grid/threads/Accelerator.h index c0e07556..a7a9912d 100644 --- a/Grid/threads/Accelerator.h +++ b/Grid/threads/Accelerator.h @@ -26,11 +26,11 @@ Author: paboyle See the full license in the file "LICENSE" in the top level distribution directory *************************************************************************************/ /* END LEGAL */ + +#ifndef ACCELERATOR_H +#define ACCELERATOR_H + #pragma once - -//#ifndef ACCELERATOR_H -//#define ACCELERATOR_H - #include #ifdef HAVE_MALLOC_MALLOC_H @@ -437,22 +437,35 @@ inline void acceleratorMemSet(void *base,int value,size_t bytes) { hipMemset(bas //OpenMP Target Offloading #ifdef OMPTARGET - -//uint32_t gpu_threads=acceleratorThreads(); +#define THREAD_LIMIT acceleratorThreads() #define accelerator #define accelerator_inline strong_inline +#ifdef THREAD_LIMIT #define accelerator_for(i,num,nsimd, ... ) \ - _Pragma("omp target teams distribute parallel for") \ + _Pragma("omp target teams distribute parallel for thread_limit(THREAD_LIMIT)") \ for ( uint64_t i=0;i