Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions src/common/include/acc_macros.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,38 +129,6 @@
$:end_acc_directive
#:enddef

#:def ACC_PARALLEL_LOOP_OLD(code, collapse=None, private=None, parallelism='[gang, vector]', &
& default='present', firstprivate=None, reduction=None, reductionOp=None, &
& copy=None, copyin=None, copyinReadOnly=None, copyout=None, create=None, &
& no_create=None, present=None, deviceptr=None, attach=None, extraAccArgs=None)
#:set collapse_val = GEN_COLLAPSE_STR(collapse)
#:set parallelism_val = GEN_PARALLELISM_STR(parallelism)
#:set default_val = GEN_DEFAULT_STR(default)
#:set private_val = GEN_PRIVATE_STR(private, False).strip('\n') + GEN_PRIVATE_STR(firstprivate, True).strip('\n')
#:set reduction_val = GEN_REDUCTION_STR(reduction, reductionOp)
#:set copy_val = GEN_COPY_STR(copy)
#:set copyin_val = GEN_COPYIN_STR(copyin, False).strip('\n') + GEN_COPYIN_STR(copyinReadOnly, True).strip('\n')
#:set copyout_val = GEN_COPYOUT_STR(copyout)
#:set create_val = GEN_CREATE_STR(create)
#:set no_create_val = GEN_NOCREATE_STR(no_create)
#:set present_val = GEN_PRESENT_STR(present)
#:set deviceptr_val = GEN_DEVICEPTR_STR(deviceptr)
#:set attach_val = GEN_ATTACH_STR(attach)
#:set extraAccArgs_val = GEN_EXTRA_ARGS_STR(extraAccArgs)
#:set clause_val = collapse_val.strip('\n') + parallelism_val.strip('\n') + &
& default_val.strip('\n') + private_val.strip('\n') + reduction_val.strip('\n') + &
& copy_val.strip('\n') + copyin_val.strip('\n') + &
& copyout_val.strip('\n') + create_val.strip('\n') + &
& no_create_val.strip('\n') + present_val.strip('\n') + &
& deviceptr_val.strip('\n') + attach_val.strip('\n')
#:set acc_directive = '!$acc parallel loop ' + &
& clause_val + extraAccArgs_val.strip('\n')
#:set acc_end_directive = '!$acc end parallel loop'
$:acc_directive
$:code
$:acc_end_directive
#:enddef

#:def ACC_PARALLEL_LOOP(collapse=None, private=None, parallelism='[gang, vector]', &
& default='present', firstprivate=None, reduction=None, reductionOp=None, &
& copy=None, copyin=None, copyinReadOnly=None, copyout=None, create=None, &
Expand Down
47 changes: 0 additions & 47 deletions src/common/include/omp_macros.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,53 +149,6 @@
$:omp_end_directive
#:enddef

#:def OMP_PARALLEL_LOOP_OLD(code, collapse=None, private=None, parallelism='[gang, vector]', &
& default='present', firstprivate=None, reduction=None, reductionOp=None, &
& copy=None, copyin=None, copyinReadOnly=None, copyout=None, create=None, &
& no_create=None, present=None, deviceptr=None, attach=None, extraOmpArgs=None)

#:set collapse_val = GEN_COLLAPSE_STR(collapse)
#:set parallelism_val = OMP_PARALLELISM_STR(parallelism)
#:set default_val = OMP_DEFAULT_STR(default)
#:set private_val = GEN_PRIVATE_STR(private, False).strip('\n') + GEN_PRIVATE_STR(firstprivate, True).strip('\n')
#:set reduction_val = GEN_REDUCTION_STR(reduction, reductionOp)
#:set copy_val = OMP_COPY_STR(copy)
#:set copyin_val = OMP_COPYIN_STR(copyin).strip('\n') + OMP_COPYIN_STR(copyinReadOnly).strip('\n')
#:set copyout_val = OMP_COPYOUT_STR(copyout)
#:set create_val = OMP_CREATE_STR(create)
#:set no_create_val = OMP_NOCREATE_STR(no_create)
#:set present_val = OMP_PRESENT_STR(present)
#:set deviceptr_val = OMP_DEVICEPTR_STR(deviceptr)
#:set attach_val = OMP_MAP_STR('always,tofrom', attach)
#:set extraOmpArgs_val = GEN_EXTRA_ARGS_STR(extraOmpArgs)
#:set clause_val = collapse_val.strip('\n') + parallelism_val.strip('\n') + &
& default_val.strip('\n') + private_val.strip('\n') + reduction_val.strip('\n') + &
& copy_val.strip('\n') + copyin_val.strip('\n') + &
& copyout_val.strip('\n') + create_val.strip('\n') + &
& no_create_val.strip('\n') + present_val.strip('\n') + &
& deviceptr_val.strip('\n') + attach_val.strip('\n')
#! Hardcoding the parallelism for now

#:if MFC_COMPILER == NVIDIA_COMPILER_ID or MFC_COMPILER == PGI_COMPILER_ID
#:set omp_start_directive = '!$omp target teams loop defaultmap(firstprivate:scalar) bind(teams,parallel) '
#:set omp_end_directive = '!$omp end target teams loop'
#:elif MFC_COMPILER == CCE_COMPILER_ID
#:set omp_start_directive = '!$omp target teams distribute parallel do simd defaultmap(firstprivate:scalar) '
#:set omp_end_directive = '!$omp end target teams distribute parallel do simd'
#:elif MFC_COMPILER == AMD_COMPILER_ID
#:set omp_start_directive = '!$omp target teams distribute parallel do '
#:set omp_end_directive = '!$omp end target teams distribute parallel do'
#:else
#:set omp_start_directive = '!$omp target teams loop defaultmap(firstprivate:scalar) bind(teams,parallel) '
#:set omp_end_directive = '!$omp end target teams loop'
#:endif

#:set omp_directive = omp_start_directive + clause_val + extraOmpArgs_val.strip('\n')
$:omp_directive
$:code
$:omp_end_directive
#:enddef

#:def OMP_PARALLEL_LOOP(collapse=None, private=None, parallelism='[gang, vector]', &
& default='present', firstprivate=None, reduction=None, reductionOp=None, &
& copy=None, copyin=None, copyinReadOnly=None, copyout=None, create=None, &
Expand Down
17 changes: 0 additions & 17 deletions src/common/include/parallel_macros.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,6 @@

#:enddef

#:def GPU_PARALLEL_LOOP_OLD(code, collapse=None, private=None, parallelism='[gang, vector]', &
& default='present', firstprivate=None, reduction=None, reductionOp=None, &
& copy=None, copyin=None, copyinReadOnly=None, copyout=None, create=None, &
& no_create=None, present=None, deviceptr=None, attach=None, extraAccArgs=None, extraOmpArgs=None)

#:set acc_code = ACC_PARALLEL_LOOP_OLD(code, collapse, private, parallelism, default, firstprivate, reduction, reductionOp, copy, copyin, copyinReadOnly, copyout, create, no_create, present, deviceptr, attach, extraAccArgs)
#:set omp_code = OMP_PARALLEL_LOOP_OLD(code, collapse, private, parallelism, default, firstprivate, reduction, reductionOp, copy, copyin, copyinReadOnly, copyout, create, no_create, present, deviceptr, attach, extraOmpArgs)

#if defined(MFC_OpenACC)
$:acc_code
#elif defined(MFC_OpenMP)
$:omp_code
#else
$:code
#endif
#:enddef

#:def GPU_PARALLEL_LOOP(collapse=None, private=None, parallelism='[gang, vector]', &
& default='present', firstprivate=None, reduction=None, reductionOp=None, &
& copy=None, copyin=None, copyinReadOnly=None, copyout=None, create=None, &
Expand Down
Loading
Loading