# Parallelization on GPU with Intel compiler

**URL:** <https://fortran-lang.discourse.group/t/parallelization-on-gpu-with-intel-compiler/7804>\
**Category:** Intel\
**Created:** [April 9, 2024, 5:50pm UTC](https://fortran-lang.discourse.group/t/parallelization-on-gpu-with-intel-compiler/7804 "2024-04-09T17:50:30Z")\
**Posts on this page:** 1\
**Showing post:** 35

<div class="post-metadata">

**Author:** ![PierU](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/pieru/32/1848_2.png) [@PierU](https://fortran-lang.discourse.group/u/PierU)\
**Post date:** [April 11, 2024, 1:37pm UTC](https://fortran-lang.discourse.group/t/parallelization-on-gpu-with-intel-compiler/7804/35 "2024-04-11T13:37:14Z")

</div>

> [@ivanpribec](#):
>
> I’m having trouble interpreting what exactly this means. It’s obvious for the iteration variables associated to a task generating construct. But the first part of the sentence implies that it’s private also in cases like this one:

Wow… I have been heavily using OpenMP for 25 years, and I am only discovering today that **all** loop indexes are privatized by default, even the ones of the loops that are not parallelized!

```auto
use omp_lib
use iso_fortran_env
implicit none
integer :: i, k
integer(int64) :: iloc, kloc

iloc = loc(i)
kloc = loc(k)

!$omp parallel num_threads(2)
print*, omp_get_thread_num(), "i:", loc(i)-iloc
print*, omp_get_thread_num(), "k:", loc(k)-kloc
do k = 1, 10
   continue
end do
!$omp end parallel

end

```

Output with gfortan (similar with ifx):

```auto
           0 i: 0
           0 k: -92
           1 i: 0
           1 k: -327285035964

```

---

_[View the full topic](https://fortran-lang.discourse.group/t/parallelization-on-gpu-with-intel-compiler/7804)._
