12 integer,
private ::
col(7) = [int(z
'0000ff00'), int(z
'000000ff'), int(z
'00ffff00'), int(z
'00ff00ff'), int(z
'0000ffff'), &
13 & int(z
'00ff0000'), int(z
'00ffffff')]
17 type,
bind(C) :: nvtxEventAttributes
18 integer(c_int16_t) :: version = 1
19 integer(c_int16_t) :: size = 48
20 integer(c_int) :: category = 0
21 integer(c_int) :: colortype = 1
22 integer(c_int) :: color
23 integer(c_int) :: payloadtype = 0
24 integer(c_int) :: reserved0
25 integer(c_int64_t) :: payload
26 integer(c_int) :: messagetype = 1
27 type(c_ptr) :: message
30#if defined(MFC_GPU) && defined(__PGI)
33 subroutine nvtxrangepusha(name) bind(C, name='nvtxRangePushA')
37 character(kind=c_char, len=*),
intent(in) :: name
39 end subroutine nvtxrangepusha
41 subroutine nvtxrangepushex(event) bind(C, name='nvtxRangePushEx')
48 end subroutine nvtxrangepushex
63 character(kind=c_char, len=*),
intent(in) :: name
64 integer,
intent(in),
optional :: id
67#if defined(MFC_GPU) && defined(__PGI)
70 if (.not.
present(id))
then
73 event%color =
col(mod(id, 7) + 1)
75 call nvtxrangepushex(event)
84#if defined(MFC_GPU) && defined(__PGI)
NVIDIA NVTX profiling API bindings for GPU performance instrumentation.
subroutine nvtxstartrange(name, id)
Push a named NVTX range for GPU profiling, optionally with a color based on the given identifier.
character(len=256), private tempname
subroutine nvtxendrange
Pop the current NVTX range to end the GPU profiling region.
integer, dimension(7), private col