Discuss the OpenMP 4.0 API Specifications released July 2013 (Read Only)
- Posts: 2
- Joined: Thu Nov 07, 2013 6:42 am
I've question is related with declare target construct of OpenMP and dynamic/nested parallelism feature of GPUs. OpenACC 2.0 supports dynamic parallelism in two ways; routine directive and using parallel/kernels directives in nested way. But using nested device directives such as target, teams or distribute is prohibited in OpenMP. But declare target directive seems to me similar with routine directive of openacc.
However it's not still clear semantic and its usage. My sample code is like this.
Code: Select all
#pragma omp declare target
#pragma omp target teams distribute parallel for
#pragma omp end declare target
In that example, I am expecting that function foo will be mapped as device function. but since it has target construct inside, compiler will transform this code in some way. My question is here, what will happen when the threads encounters foo function invocation inside of target construct?