Skip to content

Commit

Permalink
[OMPT] Make omp_control_tool() compliant when called from Fortran pro…
Browse files Browse the repository at this point in the history
…grams

This change fixes an incorrect behavior of the omp_control_tool function when
called from Fortran applications.  A tool callback function for this event is
supposed to get NULL for the third argument according to the specification, but
the current implementation just passes a garbage value. A possible fix is to use
the OPTIONAL attribute for the third argument.

Patch by Hansang Bae

Differential Revision: https://reviews.llvm.org/D50565

llvm-svn: 339585
  • Loading branch information
jpeyton52 committed Aug 13, 2018
1 parent 82edf8d commit a3f6d4c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion openmp/runtime/src/include/50/omp_lib.f90.var
Expand Up @@ -531,11 +531,12 @@
integer (kind=omp_lock_hint_kind), value :: hint
end subroutine omp_init_nest_lock_with_hint

function omp_control_tool(command, modifier) bind(c)
function omp_control_tool(command, modifier, arg) bind(c)
use omp_lib_kinds
integer (kind=omp_integer_kind) omp_control_tool
integer (kind=omp_control_tool_kind), value :: command
integer (kind=omp_control_tool_kind), value :: modifier
integer (kind=kmp_pointer_kind), optional :: arg
end function omp_control_tool

end interface
Expand Down
3 changes: 2 additions & 1 deletion openmp/runtime/src/include/50/omp_lib.h.var
Expand Up @@ -506,11 +506,12 @@
integer (kind=omp_lock_hint_kind), value :: hint
end subroutine omp_init_nest_lock_with_hint

function omp_control_tool(command, modifier) bind(c)
function omp_control_tool(command, modifier, arg) bind(c)
import
integer (kind=omp_integer_kind) omp_control_tool
integer (kind=omp_control_tool_kind), value :: command
integer (kind=omp_control_tool_kind), value :: modifier
integer (kind=kmp_pointer_kind), optional :: arg
end function omp_control_tool

end interface
Expand Down

0 comments on commit a3f6d4c

Please sign in to comment.