Offloading and Threadprivate variables

Offloading and Threadprivate variables

Is it not possible to offload threadprivate globals?

Compiling the following:

module mymodule   
    integer var_save
    !dir$ attributes offload:mic :: var_save
    !$omp threadprivate(var_save)
end module mymodule

Yields this error:

error #8690: *MIC* A threadprivate variable cannot appear in a DECLARE TARGET directive.   [VAR_SAVE]

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.


!dir$ attributes offload:mic :: var_save is equivalent to !$OMP DECLARE TARGET (var_save), which is not permitted by the OMP 4.0 Spec, Section 2.9.4:



      A threadprivate variable cannot appear in a declare target directive.



Leave a Comment

Please sign in to add a comment. Not a member? Join today