From 271babf4fb7d87366ff09952a54981d11bb2b9a4 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Wed, 22 Mar 2023 14:18:41 -0400 Subject: [PATCH] Add wrappers for nvperf_host --- Manifest.toml | 18 +- lib/cupti/libcupti.jl | 949 +++++++++-------- lib/nvperf/NVPERF.jl | 21 + lib/nvperf/error.jl | 8 + lib/nvperf/libnvperf_host.jl | 1481 +++++++++++++++++++++++++++ lib/nvperf/wrappers.jl | 17 + lib/utils/APIUtils.jl | 1 + lib/utils/struct_size.jl | 11 + res/wrap/README.md | 2 +- res/wrap/cupti.toml | 2 - res/wrap/libcupti_prologue.jl | 8 + res/wrap/libnvperf_host_prologue.jl | 23 + res/wrap/nvperf_host.toml | 18 + res/wrap/wrap.jl | 16 + src/CUDA.jl | 3 +- 15 files changed, 2126 insertions(+), 452 deletions(-) create mode 100644 lib/nvperf/NVPERF.jl create mode 100644 lib/nvperf/error.jl create mode 100644 lib/nvperf/libnvperf_host.jl create mode 100644 lib/nvperf/wrappers.jl create mode 100644 lib/utils/struct_size.jl create mode 100644 res/wrap/libnvperf_host_prologue.jl create mode 100644 res/wrap/nvperf_host.toml diff --git a/Manifest.toml b/Manifest.toml index 3e36304b94..8d69458bd1 100644 --- a/Manifest.toml +++ b/Manifest.toml @@ -99,9 +99,9 @@ version = "0.1.9" [[GPUArrays]] deps = ["Adapt", "GPUArraysCore", "LLVM", "LinearAlgebra", "Printf", "Random", "Reexport", "Serialization", "Statistics"] -git-tree-sha1 = "a28f752ffab0ccd6660fc7af5ad1c9ad176f45f7" +git-tree-sha1 = "7a2e790b1e2e6f648cfb25c4500c5de1f7b375ef" uuid = "0c68f7d7-f131-5f86-a1c3-88cf8149b2d7" -version = "8.6.3" +version = "8.6.5" [[GPUArraysCore]] deps = ["Adapt"] @@ -144,15 +144,15 @@ version = "0.9.0" [[LLVM]] deps = ["CEnum", "LLVMExtra_jll", "Libdl", "Printf", "Unicode"] -git-tree-sha1 = "df115c31f5c163697eede495918d8e85045c8f04" +git-tree-sha1 = "f044a2796a9e18e0531b9b3072b0019a61f264bc" uuid = "929cbde3-209d-540e-8aea-75f648917ca0" -version = "4.16.0" +version = "4.17.1" [[LLVMExtra_jll]] -deps = ["Artifacts", "JLLWrappers", "LazyArtifacts", "Libdl", "Pkg", "TOML"] -git-tree-sha1 = "7718cf44439c676bc0ec66a87099f41015a522d6" +deps = ["Artifacts", "JLLWrappers", "LazyArtifacts", "Libdl", "TOML"] +git-tree-sha1 = "070e4b5b65827f82c16ae0916376cb47377aa1b5" uuid = "dad2f222-ce93-54a1-a47d-0025e8a3acab" -version = "0.0.16+2" +version = "0.0.18+0" [[LazyArtifacts]] deps = ["Artifacts", "Pkg"] @@ -292,9 +292,9 @@ version = "2.2.0" [[StaticArrays]] deps = ["LinearAlgebra", "Random", "StaticArraysCore", "Statistics"] -git-tree-sha1 = "7756ce473bd10b67245bdebdc8d8670a85f6230b" +git-tree-sha1 = "b8d897fe7fa688e93aef573711cb207c08c9e11e" uuid = "90137ffa-7385-5640-81b9-e52037218182" -version = "1.5.18" +version = "1.5.19" [[StaticArraysCore]] git-tree-sha1 = "6b7ba252635a5eff6a0b0664a41ee140a1c9e72a" diff --git a/lib/cupti/libcupti.jl b/lib/cupti/libcupti.jl index 574c483e50..394330efa1 100644 --- a/lib/cupti/libcupti.jl +++ b/lib/cupti/libcupti.jl @@ -28,6 +28,14 @@ macro check(ex, errs...) end end +macro CUPTI_PROFILER_STRUCT_SIZE(type, lastfield) + type = esc(type) + lastfield = QuoteNode(lastfield) + quote + $struct_size($type, $lastfield) + end +end + @cenum CUptiResult::UInt32 begin CUPTI_SUCCESS = 0 CUPTI_ERROR_INVALID_PARAMETER = 1 @@ -148,23 +156,23 @@ struct CUpti_CallbackData correlationId::UInt32 end -struct var"##Ctag#668" +struct var"##Ctag#920" data::NTuple{8,UInt8} end -function Base.getproperty(x::Ptr{var"##Ctag#668"}, f::Symbol) +function Base.getproperty(x::Ptr{var"##Ctag#920"}, f::Symbol) f === :stream && return Ptr{CUstream}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#668", f::Symbol) - r = Ref{var"##Ctag#668"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#668"}, r) +function Base.getproperty(x::var"##Ctag#920", f::Symbol) + r = Ref{var"##Ctag#920"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#920"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#668"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#920"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end @@ -174,7 +182,7 @@ end function Base.getproperty(x::Ptr{CUpti_ResourceData}, f::Symbol) f === :context && return Ptr{CUcontext}(x + 0) - f === :resourceHandle && return Ptr{var"##Ctag#668"}(x + 8) + f === :resourceHandle && return Ptr{var"##Ctag#920"}(x + 8) f === :resourceDescriptor && return Ptr{Ptr{Cvoid}}(x + 16) return getfield(x, f) end @@ -884,8 +892,8 @@ struct CUpti_ActivityObjectKindId end function Base.getproperty(x::Ptr{CUpti_ActivityObjectKindId}, f::Symbol) - f === :pt && return Ptr{var"##Ctag#604"}(x + 0) - f === :dcs && return Ptr{var"##Ctag#605"}(x + 0) + f === :pt && return Ptr{var"##Ctag#947"}(x + 0) + f === :dcs && return Ptr{var"##Ctag#948"}(x + 0) return getfield(x, f) end @@ -1446,48 +1454,48 @@ struct CUpti_ActivityMemory name::Cstring end -struct var"##Ctag#639" +struct var"##Ctag#846" data::NTuple{8,UInt8} end -function Base.getproperty(x::Ptr{var"##Ctag#639"}, f::Symbol) +function Base.getproperty(x::Ptr{var"##Ctag#846"}, f::Symbol) f === :size && return Ptr{UInt64}(x + 0) f === :processId && return Ptr{UInt64}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#639", f::Symbol) - r = Ref{var"##Ctag#639"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#639"}, r) +function Base.getproperty(x::var"##Ctag#846", f::Symbol) + r = Ref{var"##Ctag#846"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#846"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#639"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#846"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#638" +struct var"##Ctag#845" data::NTuple{32,UInt8} end -function Base.getproperty(x::Ptr{var"##Ctag#638"}, f::Symbol) +function Base.getproperty(x::Ptr{var"##Ctag#845"}, f::Symbol) f === :memoryPoolType && return Ptr{CUpti_ActivityMemoryPoolType}(x + 0) f === :pad2 && return Ptr{UInt32}(x + 4) f === :address && return Ptr{UInt64}(x + 8) f === :releaseThreshold && return Ptr{UInt64}(x + 16) - f === :pool && return Ptr{var"##Ctag#639"}(x + 24) + f === :pool && return Ptr{var"##Ctag#846"}(x + 24) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#638", f::Symbol) - r = Ref{var"##Ctag#638"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#638"}, r) +function Base.getproperty(x::var"##Ctag#845", f::Symbol) + r = Ref{var"##Ctag#845"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#845"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#638"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#845"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end @@ -1526,49 +1534,49 @@ function Base.setproperty!(x::Ptr{CUpti_ActivityMemory2}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#645" +struct var"##Ctag#854" data::NTuple{8,UInt8} end -function Base.getproperty(x::Ptr{var"##Ctag#645"}, f::Symbol) +function Base.getproperty(x::Ptr{var"##Ctag#854"}, f::Symbol) f === :size && return Ptr{UInt64}(x + 0) f === :processId && return Ptr{UInt64}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#645", f::Symbol) - r = Ref{var"##Ctag#645"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#645"}, r) +function Base.getproperty(x::var"##Ctag#854", f::Symbol) + r = Ref{var"##Ctag#854"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#854"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#645"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#854"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#644" +struct var"##Ctag#853" data::NTuple{40,UInt8} end -function Base.getproperty(x::Ptr{var"##Ctag#644"}, f::Symbol) +function Base.getproperty(x::Ptr{var"##Ctag#853"}, f::Symbol) f === :memoryPoolType && return Ptr{CUpti_ActivityMemoryPoolType}(x + 0) f === :pad2 && return Ptr{UInt32}(x + 4) f === :address && return Ptr{UInt64}(x + 8) f === :releaseThreshold && return Ptr{UInt64}(x + 16) - f === :pool && return Ptr{var"##Ctag#645"}(x + 24) + f === :pool && return Ptr{var"##Ctag#854"}(x + 24) f === :utilizedSize && return Ptr{UInt64}(x + 32) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#644", f::Symbol) - r = Ref{var"##Ctag#644"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#644"}, r) +function Base.getproperty(x::var"##Ctag#853", f::Symbol) + r = Ref{var"##Ctag#853"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#853"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#644"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#853"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end @@ -1663,24 +1671,24 @@ struct CUpti_ActivityKernel reserved0::Ptr{Cvoid} end -struct var"##Ctag#612" +struct var"##Ctag#875" data::NTuple{1,UInt8} end -function Base.getproperty(x::Ptr{var"##Ctag#612"}, f::Symbol) +function Base.getproperty(x::Ptr{var"##Ctag#875"}, f::Symbol) f === :both && return Ptr{UInt8}(x + 0) - f === :config && return Ptr{var"##Ctag#613"}(x + 0) + f === :config && return Ptr{var"##Ctag#876"}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#612", f::Symbol) - r = Ref{var"##Ctag#612"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#612"}, r) +function Base.getproperty(x::var"##Ctag#875", f::Symbol) + r = Ref{var"##Ctag#875"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#875"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#612"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#875"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end @@ -1690,7 +1698,7 @@ end function Base.getproperty(x::Ptr{CUpti_ActivityKernel2}, f::Symbol) f === :kind && return Ptr{CUpti_ActivityKind}(x + 0) - f === :cacheConfig && return Ptr{var"##Ctag#612"}(x + 4) + f === :cacheConfig && return Ptr{var"##Ctag#875"}(x + 4) f === :sharedMemoryConfig && return Ptr{UInt8}(x + 5) f === :registersPerThread && return Ptr{UInt16}(x + 6) f === :start && return Ptr{UInt64}(x + 8) @@ -1727,24 +1735,24 @@ function Base.setproperty!(x::Ptr{CUpti_ActivityKernel2}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#654" +struct var"##Ctag#918" data::NTuple{1,UInt8} end -function Base.getproperty(x::Ptr{var"##Ctag#654"}, f::Symbol) +function Base.getproperty(x::Ptr{var"##Ctag#918"}, f::Symbol) f === :both && return Ptr{UInt8}(x + 0) - f === :config && return Ptr{var"##Ctag#655"}(x + 0) + f === :config && return Ptr{var"##Ctag#919"}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#654", f::Symbol) - r = Ref{var"##Ctag#654"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#654"}, r) +function Base.getproperty(x::var"##Ctag#918", f::Symbol) + r = Ref{var"##Ctag#918"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#918"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#654"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#918"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end @@ -1754,7 +1762,7 @@ end function Base.getproperty(x::Ptr{CUpti_ActivityKernel3}, f::Symbol) f === :kind && return Ptr{CUpti_ActivityKind}(x + 0) - f === :cacheConfig && return Ptr{var"##Ctag#654"}(x + 4) + f === :cacheConfig && return Ptr{var"##Ctag#918"}(x + 4) f === :sharedMemoryConfig && return Ptr{UInt8}(x + 5) f === :registersPerThread && return Ptr{UInt16}(x + 6) f === :partitionedGlobalCacheRequested && @@ -1802,24 +1810,24 @@ end CUPTI_ACTIVITY_LAUNCH_TYPE_CBL_COMMANDLIST = 3 end -struct var"##Ctag#646" +struct var"##Ctag#927" data::NTuple{1,UInt8} end -function Base.getproperty(x::Ptr{var"##Ctag#646"}, f::Symbol) +function Base.getproperty(x::Ptr{var"##Ctag#927"}, f::Symbol) f === :both && return Ptr{UInt8}(x + 0) - f === :config && return Ptr{var"##Ctag#647"}(x + 0) + f === :config && return Ptr{var"##Ctag#928"}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#646", f::Symbol) - r = Ref{var"##Ctag#646"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#646"}, r) +function Base.getproperty(x::var"##Ctag#927", f::Symbol) + r = Ref{var"##Ctag#927"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#927"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#646"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#927"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end @@ -1829,7 +1837,7 @@ end function Base.getproperty(x::Ptr{CUpti_ActivityKernel4}, f::Symbol) f === :kind && return Ptr{CUpti_ActivityKind}(x + 0) - f === :cacheConfig && return Ptr{var"##Ctag#646"}(x + 4) + f === :cacheConfig && return Ptr{var"##Ctag#927"}(x + 4) f === :sharedMemoryConfig && return Ptr{UInt8}(x + 5) f === :registersPerThread && return Ptr{UInt16}(x + 6) f === :partitionedGlobalCacheRequested && @@ -1883,24 +1891,24 @@ end CUPTI_FUNC_SHMEM_LIMIT_FORCE_INT = 2147483647 end -struct var"##Ctag#598" +struct var"##Ctag#859" data::NTuple{1,UInt8} end -function Base.getproperty(x::Ptr{var"##Ctag#598"}, f::Symbol) +function Base.getproperty(x::Ptr{var"##Ctag#859"}, f::Symbol) f === :both && return Ptr{UInt8}(x + 0) - f === :config && return Ptr{var"##Ctag#599"}(x + 0) + f === :config && return Ptr{var"##Ctag#860"}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#598", f::Symbol) - r = Ref{var"##Ctag#598"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#598"}, r) +function Base.getproperty(x::var"##Ctag#859", f::Symbol) + r = Ref{var"##Ctag#859"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#859"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#598"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#859"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end @@ -1910,7 +1918,7 @@ end function Base.getproperty(x::Ptr{CUpti_ActivityKernel5}, f::Symbol) f === :kind && return Ptr{CUpti_ActivityKind}(x + 0) - f === :cacheConfig && return Ptr{var"##Ctag#598"}(x + 4) + f === :cacheConfig && return Ptr{var"##Ctag#859"}(x + 4) f === :sharedMemoryConfig && return Ptr{UInt8}(x + 5) f === :registersPerThread && return Ptr{UInt16}(x + 6) f === :partitionedGlobalCacheRequested && @@ -1961,24 +1969,24 @@ function Base.setproperty!(x::Ptr{CUpti_ActivityKernel5}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#596" +struct var"##Ctag#935" data::NTuple{1,UInt8} end -function Base.getproperty(x::Ptr{var"##Ctag#596"}, f::Symbol) +function Base.getproperty(x::Ptr{var"##Ctag#935"}, f::Symbol) f === :both && return Ptr{UInt8}(x + 0) - f === :config && return Ptr{var"##Ctag#597"}(x + 0) + f === :config && return Ptr{var"##Ctag#936"}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#596", f::Symbol) - r = Ref{var"##Ctag#596"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#596"}, r) +function Base.getproperty(x::var"##Ctag#935", f::Symbol) + r = Ref{var"##Ctag#935"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#935"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#596"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#935"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end @@ -1988,7 +1996,7 @@ end function Base.getproperty(x::Ptr{CUpti_ActivityKernel6}, f::Symbol) f === :kind && return Ptr{CUpti_ActivityKind}(x + 0) - f === :cacheConfig && return Ptr{var"##Ctag#596"}(x + 4) + f === :cacheConfig && return Ptr{var"##Ctag#935"}(x + 4) f === :sharedMemoryConfig && return Ptr{UInt8}(x + 5) f === :registersPerThread && return Ptr{UInt16}(x + 6) f === :partitionedGlobalCacheRequested && @@ -2040,24 +2048,24 @@ function Base.setproperty!(x::Ptr{CUpti_ActivityKernel6}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#625" +struct var"##Ctag#877" data::NTuple{1,UInt8} end -function Base.getproperty(x::Ptr{var"##Ctag#625"}, f::Symbol) +function Base.getproperty(x::Ptr{var"##Ctag#877"}, f::Symbol) f === :both && return Ptr{UInt8}(x + 0) - f === :config && return Ptr{var"##Ctag#626"}(x + 0) + f === :config && return Ptr{var"##Ctag#878"}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#625", f::Symbol) - r = Ref{var"##Ctag#625"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#625"}, r) +function Base.getproperty(x::var"##Ctag#877", f::Symbol) + r = Ref{var"##Ctag#877"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#877"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#625"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#877"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end @@ -2067,7 +2075,7 @@ end function Base.getproperty(x::Ptr{CUpti_ActivityKernel7}, f::Symbol) f === :kind && return Ptr{CUpti_ActivityKind}(x + 0) - f === :cacheConfig && return Ptr{var"##Ctag#625"}(x + 4) + f === :cacheConfig && return Ptr{var"##Ctag#877"}(x + 4) f === :sharedMemoryConfig && return Ptr{UInt8}(x + 5) f === :registersPerThread && return Ptr{UInt16}(x + 6) f === :partitionedGlobalCacheRequested && @@ -2121,24 +2129,24 @@ function Base.setproperty!(x::Ptr{CUpti_ActivityKernel7}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#610" +struct var"##Ctag#843" data::NTuple{1,UInt8} end -function Base.getproperty(x::Ptr{var"##Ctag#610"}, f::Symbol) +function Base.getproperty(x::Ptr{var"##Ctag#843"}, f::Symbol) f === :both && return Ptr{UInt8}(x + 0) - f === :config && return Ptr{var"##Ctag#611"}(x + 0) + f === :config && return Ptr{var"##Ctag#844"}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#610", f::Symbol) - r = Ref{var"##Ctag#610"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#610"}, r) +function Base.getproperty(x::var"##Ctag#843", f::Symbol) + r = Ref{var"##Ctag#843"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#843"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#610"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#843"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end @@ -2148,7 +2156,7 @@ end function Base.getproperty(x::Ptr{CUpti_ActivityKernel8}, f::Symbol) f === :kind && return Ptr{CUpti_ActivityKind}(x + 0) - f === :cacheConfig && return Ptr{var"##Ctag#610"}(x + 4) + f === :cacheConfig && return Ptr{var"##Ctag#843"}(x + 4) f === :sharedMemoryConfig && return Ptr{UInt8}(x + 5) f === :registersPerThread && return Ptr{UInt16}(x + 6) f === :partitionedGlobalCacheRequested && @@ -2207,24 +2215,24 @@ function Base.setproperty!(x::Ptr{CUpti_ActivityKernel8}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#636" +struct var"##Ctag#887" data::NTuple{1,UInt8} end -function Base.getproperty(x::Ptr{var"##Ctag#636"}, f::Symbol) +function Base.getproperty(x::Ptr{var"##Ctag#887"}, f::Symbol) f === :both && return Ptr{UInt8}(x + 0) - f === :config && return Ptr{var"##Ctag#637"}(x + 0) + f === :config && return Ptr{var"##Ctag#888"}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#636", f::Symbol) - r = Ref{var"##Ctag#636"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#636"}, r) +function Base.getproperty(x::var"##Ctag#887", f::Symbol) + r = Ref{var"##Ctag#887"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#887"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#636"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#887"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end @@ -2234,7 +2242,7 @@ end function Base.getproperty(x::Ptr{CUpti_ActivityKernel9}, f::Symbol) f === :kind && return Ptr{CUpti_ActivityKind}(x + 0) - f === :cacheConfig && return Ptr{var"##Ctag#636"}(x + 4) + f === :cacheConfig && return Ptr{var"##Ctag#887"}(x + 4) f === :sharedMemoryConfig && return Ptr{UInt8}(x + 5) f === :registersPerThread && return Ptr{UInt16}(x + 6) f === :partitionedGlobalCacheRequested && @@ -2295,24 +2303,24 @@ function Base.setproperty!(x::Ptr{CUpti_ActivityKernel9}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#685" +struct var"##Ctag#907" data::NTuple{1,UInt8} end -function Base.getproperty(x::Ptr{var"##Ctag#685"}, f::Symbol) +function Base.getproperty(x::Ptr{var"##Ctag#907"}, f::Symbol) f === :both && return Ptr{UInt8}(x + 0) - f === :config && return Ptr{var"##Ctag#686"}(x + 0) + f === :config && return Ptr{var"##Ctag#908"}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#685", f::Symbol) - r = Ref{var"##Ctag#685"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#685"}, r) +function Base.getproperty(x::var"##Ctag#907", f::Symbol) + r = Ref{var"##Ctag#907"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#907"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#685"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#907"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end @@ -2322,7 +2330,7 @@ end function Base.getproperty(x::Ptr{CUpti_ActivityCdpKernel}, f::Symbol) f === :kind && return Ptr{CUpti_ActivityKind}(x + 0) - f === :cacheConfig && return Ptr{var"##Ctag#685"}(x + 4) + f === :cacheConfig && return Ptr{var"##Ctag#907"}(x + 4) f === :sharedMemoryConfig && return Ptr{UInt8}(x + 5) f === :registersPerThread && return Ptr{UInt16}(x + 6) f === :start && return Ptr{UInt64}(x + 8) @@ -2629,32 +2637,32 @@ struct CUpti_ActivityDevice4 migUuid::CUuuid end -struct var"##Ctag#627" +struct var"##Ctag#945" data::NTuple{4,UInt8} end -function Base.getproperty(x::Ptr{var"##Ctag#627"}, f::Symbol) +function Base.getproperty(x::Ptr{var"##Ctag#945"}, f::Symbol) f === :cu && return Ptr{CUdevice_attribute}(x + 0) f === :cupti && return Ptr{CUpti_DeviceAttribute}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#627", f::Symbol) - r = Ref{var"##Ctag#627"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#627"}, r) +function Base.getproperty(x::var"##Ctag#945", f::Symbol) + r = Ref{var"##Ctag#945"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#945"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#627"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#945"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#628" +struct var"##Ctag#946" data::NTuple{8,UInt8} end -function Base.getproperty(x::Ptr{var"##Ctag#628"}, f::Symbol) +function Base.getproperty(x::Ptr{var"##Ctag#946"}, f::Symbol) f === :vDouble && return Ptr{Cdouble}(x + 0) f === :vUint32 && return Ptr{UInt32}(x + 0) f === :vUint64 && return Ptr{UInt64}(x + 0) @@ -2663,14 +2671,14 @@ function Base.getproperty(x::Ptr{var"##Ctag#628"}, f::Symbol) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#628", f::Symbol) - r = Ref{var"##Ctag#628"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#628"}, r) +function Base.getproperty(x::var"##Ctag#946", f::Symbol) + r = Ref{var"##Ctag#946"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#946"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#628"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#946"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end @@ -2682,8 +2690,8 @@ function Base.getproperty(x::Ptr{CUpti_ActivityDeviceAttribute}, f::Symbol) f === :kind && return Ptr{CUpti_ActivityKind}(x + 0) f === :flags && return Ptr{CUpti_ActivityFlag}(x + 4) f === :deviceId && return Ptr{UInt32}(x + 8) - f === :attribute && return Ptr{var"##Ctag#627"}(x + 12) - f === :value && return Ptr{var"##Ctag#628"}(x + 16) + f === :attribute && return Ptr{var"##Ctag#945"}(x + 12) + f === :value && return Ptr{var"##Ctag#946"}(x + 16) return getfield(x, f) end @@ -2756,26 +2764,26 @@ struct CUpti_ActivityOverhead _end::UInt64 end -struct var"##Ctag#649" +struct var"##Ctag#861" data::NTuple{20,UInt8} end -function Base.getproperty(x::Ptr{var"##Ctag#649"}, f::Symbol) - f === :speed && return Ptr{var"##Ctag#650"}(x + 0) - f === :temperature && return Ptr{var"##Ctag#651"}(x + 0) - f === :power && return Ptr{var"##Ctag#652"}(x + 0) - f === :cooling && return Ptr{var"##Ctag#653"}(x + 0) +function Base.getproperty(x::Ptr{var"##Ctag#861"}, f::Symbol) + f === :speed && return Ptr{var"##Ctag#862"}(x + 0) + f === :temperature && return Ptr{var"##Ctag#863"}(x + 0) + f === :power && return Ptr{var"##Ctag#864"}(x + 0) + f === :cooling && return Ptr{var"##Ctag#865"}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#649", f::Symbol) - r = Ref{var"##Ctag#649"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#649"}, r) +function Base.getproperty(x::var"##Ctag#861", f::Symbol) + r = Ref{var"##Ctag#861"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#861"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#649"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#861"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end @@ -2788,7 +2796,7 @@ function Base.getproperty(x::Ptr{CUpti_ActivityEnvironment}, f::Symbol) f === :deviceId && return Ptr{UInt32}(x + 4) f === :timestamp && return Ptr{UInt64}(x + 8) f === :environmentKind && return Ptr{CUpti_ActivityEnvironmentKind}(x + 16) - f === :data && return Ptr{var"##Ctag#649"}(x + 20) + f === :data && return Ptr{var"##Ctag#861"}(x + 20) return getfield(x, f) end @@ -3162,45 +3170,45 @@ end CUPTI_DEV_TYPE_FORCE_INT = 2147483647 end -struct var"##Ctag#600" +struct var"##Ctag#883" data::NTuple{16,UInt8} end -function Base.getproperty(x::Ptr{var"##Ctag#600"}, f::Symbol) +function Base.getproperty(x::Ptr{var"##Ctag#883"}, f::Symbol) f === :uuidDev && return Ptr{CUuuid}(x + 0) - f === :npu && return Ptr{var"##Ctag#601"}(x + 0) + f === :npu && return Ptr{var"##Ctag#884"}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#600", f::Symbol) - r = Ref{var"##Ctag#600"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#600"}, r) +function Base.getproperty(x::var"##Ctag#883", f::Symbol) + r = Ref{var"##Ctag#883"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#883"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#600"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#883"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#602" +struct var"##Ctag#885" data::NTuple{16,UInt8} end -function Base.getproperty(x::Ptr{var"##Ctag#602"}, f::Symbol) +function Base.getproperty(x::Ptr{var"##Ctag#885"}, f::Symbol) f === :uuidDev && return Ptr{CUuuid}(x + 0) - f === :npu && return Ptr{var"##Ctag#603"}(x + 0) + f === :npu && return Ptr{var"##Ctag#886"}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#602", f::Symbol) - r = Ref{var"##Ctag#602"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#602"}, r) +function Base.getproperty(x::var"##Ctag#885", f::Symbol) + r = Ref{var"##Ctag#885"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#885"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#602"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#885"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end @@ -3213,8 +3221,8 @@ function Base.getproperty(x::Ptr{CUpti_ActivityNvLink}, f::Symbol) f === :nvlinkVersion && return Ptr{UInt32}(x + 4) f === :typeDev0 && return Ptr{CUpti_DevType}(x + 8) f === :typeDev1 && return Ptr{CUpti_DevType}(x + 12) - f === :idDev0 && return Ptr{var"##Ctag#600"}(x + 16) - f === :idDev1 && return Ptr{var"##Ctag#602"}(x + 32) + f === :idDev0 && return Ptr{var"##Ctag#883"}(x + 16) + f === :idDev1 && return Ptr{var"##Ctag#885"}(x + 32) f === :flag && return Ptr{UInt32}(x + 48) f === :physicalNvLinkCount && return Ptr{UInt32}(x + 52) f === :portDev0 && return Ptr{NTuple{4,Int8}}(x + 56) @@ -3234,45 +3242,45 @@ function Base.setproperty!(x::Ptr{CUpti_ActivityNvLink}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#679" +struct var"##Ctag#929" data::NTuple{16,UInt8} end -function Base.getproperty(x::Ptr{var"##Ctag#679"}, f::Symbol) +function Base.getproperty(x::Ptr{var"##Ctag#929"}, f::Symbol) f === :uuidDev && return Ptr{CUuuid}(x + 0) - f === :npu && return Ptr{var"##Ctag#680"}(x + 0) + f === :npu && return Ptr{var"##Ctag#930"}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#679", f::Symbol) - r = Ref{var"##Ctag#679"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#679"}, r) +function Base.getproperty(x::var"##Ctag#929", f::Symbol) + r = Ref{var"##Ctag#929"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#929"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#679"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#929"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#681" +struct var"##Ctag#931" data::NTuple{16,UInt8} end -function Base.getproperty(x::Ptr{var"##Ctag#681"}, f::Symbol) +function Base.getproperty(x::Ptr{var"##Ctag#931"}, f::Symbol) f === :uuidDev && return Ptr{CUuuid}(x + 0) - f === :npu && return Ptr{var"##Ctag#682"}(x + 0) + f === :npu && return Ptr{var"##Ctag#932"}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#681", f::Symbol) - r = Ref{var"##Ctag#681"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#681"}, r) +function Base.getproperty(x::var"##Ctag#931", f::Symbol) + r = Ref{var"##Ctag#931"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#931"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#681"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#931"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end @@ -3285,8 +3293,8 @@ function Base.getproperty(x::Ptr{CUpti_ActivityNvLink2}, f::Symbol) f === :nvlinkVersion && return Ptr{UInt32}(x + 4) f === :typeDev0 && return Ptr{CUpti_DevType}(x + 8) f === :typeDev1 && return Ptr{CUpti_DevType}(x + 12) - f === :idDev0 && return Ptr{var"##Ctag#679"}(x + 16) - f === :idDev1 && return Ptr{var"##Ctag#681"}(x + 32) + f === :idDev0 && return Ptr{var"##Ctag#929"}(x + 16) + f === :idDev1 && return Ptr{var"##Ctag#931"}(x + 32) f === :flag && return Ptr{UInt32}(x + 48) f === :physicalNvLinkCount && return Ptr{UInt32}(x + 52) f === :portDev0 && return Ptr{NTuple{32,Int8}}(x + 56) @@ -3306,45 +3314,45 @@ function Base.setproperty!(x::Ptr{CUpti_ActivityNvLink2}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#606" +struct var"##Ctag#866" data::NTuple{16,UInt8} end -function Base.getproperty(x::Ptr{var"##Ctag#606"}, f::Symbol) +function Base.getproperty(x::Ptr{var"##Ctag#866"}, f::Symbol) f === :uuidDev && return Ptr{CUuuid}(x + 0) - f === :npu && return Ptr{var"##Ctag#607"}(x + 0) + f === :npu && return Ptr{var"##Ctag#867"}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#606", f::Symbol) - r = Ref{var"##Ctag#606"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#606"}, r) +function Base.getproperty(x::var"##Ctag#866", f::Symbol) + r = Ref{var"##Ctag#866"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#866"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#606"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#866"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#608" +struct var"##Ctag#868" data::NTuple{16,UInt8} end -function Base.getproperty(x::Ptr{var"##Ctag#608"}, f::Symbol) +function Base.getproperty(x::Ptr{var"##Ctag#868"}, f::Symbol) f === :uuidDev && return Ptr{CUuuid}(x + 0) - f === :npu && return Ptr{var"##Ctag#609"}(x + 0) + f === :npu && return Ptr{var"##Ctag#869"}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#608", f::Symbol) - r = Ref{var"##Ctag#608"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#608"}, r) +function Base.getproperty(x::var"##Ctag#868", f::Symbol) + r = Ref{var"##Ctag#868"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#868"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#608"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#868"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end @@ -3357,8 +3365,8 @@ function Base.getproperty(x::Ptr{CUpti_ActivityNvLink3}, f::Symbol) f === :nvlinkVersion && return Ptr{UInt32}(x + 4) f === :typeDev0 && return Ptr{CUpti_DevType}(x + 8) f === :typeDev1 && return Ptr{CUpti_DevType}(x + 12) - f === :idDev0 && return Ptr{var"##Ctag#606"}(x + 16) - f === :idDev1 && return Ptr{var"##Ctag#608"}(x + 32) + f === :idDev0 && return Ptr{var"##Ctag#866"}(x + 16) + f === :idDev1 && return Ptr{var"##Ctag#868"}(x + 32) f === :flag && return Ptr{UInt32}(x + 48) f === :physicalNvLinkCount && return Ptr{UInt32}(x + 52) f === :portDev0 && return Ptr{NTuple{32,Int8}}(x + 56) @@ -3380,45 +3388,45 @@ function Base.setproperty!(x::Ptr{CUpti_ActivityNvLink3}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#669" +struct var"##Ctag#879" data::NTuple{16,UInt8} end -function Base.getproperty(x::Ptr{var"##Ctag#669"}, f::Symbol) +function Base.getproperty(x::Ptr{var"##Ctag#879"}, f::Symbol) f === :uuidDev && return Ptr{CUuuid}(x + 0) - f === :npu && return Ptr{var"##Ctag#670"}(x + 0) + f === :npu && return Ptr{var"##Ctag#880"}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#669", f::Symbol) - r = Ref{var"##Ctag#669"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#669"}, r) +function Base.getproperty(x::var"##Ctag#879", f::Symbol) + r = Ref{var"##Ctag#879"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#879"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#669"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#879"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#671" +struct var"##Ctag#881" data::NTuple{16,UInt8} end -function Base.getproperty(x::Ptr{var"##Ctag#671"}, f::Symbol) +function Base.getproperty(x::Ptr{var"##Ctag#881"}, f::Symbol) f === :uuidDev && return Ptr{CUuuid}(x + 0) - f === :npu && return Ptr{var"##Ctag#672"}(x + 0) + f === :npu && return Ptr{var"##Ctag#882"}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#671", f::Symbol) - r = Ref{var"##Ctag#671"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#671"}, r) +function Base.getproperty(x::var"##Ctag#881", f::Symbol) + r = Ref{var"##Ctag#881"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#881"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#671"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#881"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end @@ -3431,8 +3439,8 @@ function Base.getproperty(x::Ptr{CUpti_ActivityNvLink4}, f::Symbol) f === :nvlinkVersion && return Ptr{UInt32}(x + 4) f === :typeDev0 && return Ptr{CUpti_DevType}(x + 8) f === :typeDev1 && return Ptr{CUpti_DevType}(x + 12) - f === :idDev0 && return Ptr{var"##Ctag#669"}(x + 16) - f === :idDev1 && return Ptr{var"##Ctag#671"}(x + 32) + f === :idDev0 && return Ptr{var"##Ctag#879"}(x + 16) + f === :idDev1 && return Ptr{var"##Ctag#881"}(x + 32) f === :flag && return Ptr{UInt32}(x + 48) f === :physicalNvLinkCount && return Ptr{UInt32}(x + 52) f === :portDev0 && return Ptr{NTuple{32,Int8}}(x + 56) @@ -3460,45 +3468,45 @@ end CUPTI_PCIE_DEVICE_TYPE_FORCE_INT = 2147483647 end -struct var"##Ctag#656" +struct var"##Ctag#913" data::NTuple{4,UInt8} end -function Base.getproperty(x::Ptr{var"##Ctag#656"}, f::Symbol) +function Base.getproperty(x::Ptr{var"##Ctag#913"}, f::Symbol) f === :devId && return Ptr{CUdevice}(x + 0) f === :bridgeId && return Ptr{UInt32}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#656", f::Symbol) - r = Ref{var"##Ctag#656"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#656"}, r) +function Base.getproperty(x::var"##Ctag#913", f::Symbol) + r = Ref{var"##Ctag#913"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#913"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#656"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#913"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#657" +struct var"##Ctag#914" data::NTuple{144,UInt8} end -function Base.getproperty(x::Ptr{var"##Ctag#657"}, f::Symbol) - f === :gpuAttr && return Ptr{var"##Ctag#658"}(x + 0) - f === :bridgeAttr && return Ptr{var"##Ctag#659"}(x + 0) +function Base.getproperty(x::Ptr{var"##Ctag#914"}, f::Symbol) + f === :gpuAttr && return Ptr{var"##Ctag#915"}(x + 0) + f === :bridgeAttr && return Ptr{var"##Ctag#916"}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#657", f::Symbol) - r = Ref{var"##Ctag#657"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#657"}, r) +function Base.getproperty(x::var"##Ctag#914", f::Symbol) + r = Ref{var"##Ctag#914"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#914"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#657"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#914"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end @@ -3509,13 +3517,13 @@ end function Base.getproperty(x::Ptr{CUpti_ActivityPcie}, f::Symbol) f === :kind && return Ptr{CUpti_ActivityKind}(x + 0) f === :type && return Ptr{CUpti_PcieDeviceType}(x + 4) - f === :id && return Ptr{var"##Ctag#656"}(x + 8) + f === :id && return Ptr{var"##Ctag#913"}(x + 8) f === :domain && return Ptr{UInt32}(x + 12) f === :pcieGeneration && return Ptr{UInt16}(x + 16) f === :linkRate && return Ptr{UInt16}(x + 18) f === :linkWidth && return Ptr{UInt16}(x + 20) f === :upstreamBus && return Ptr{UInt16}(x + 22) - f === :attr && return Ptr{var"##Ctag#657"}(x + 24) + f === :attr && return Ptr{var"##Ctag#914"}(x + 24) return getfield(x, f) end @@ -5374,537 +5382,537 @@ end @ccall libcupti.cuptiProfilerDeviceSupported(pParams::Ptr{CUpti_Profiler_DeviceSupported_Params})::CUptiResult end -struct var"##Ctag#597" +struct var"##Ctag#844" requested::UInt8 executed::UInt8 end -function Base.getproperty(x::Ptr{var"##Ctag#597"}, f::Symbol) +function Base.getproperty(x::Ptr{var"##Ctag#844"}, f::Symbol) f === :requested && return (Ptr{UInt8}(x + 0), 0, 4) f === :executed && return (Ptr{UInt8}(x + 0), 4, 4) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#597", f::Symbol) - r = Ref{var"##Ctag#597"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#597"}, r) +function Base.getproperty(x::var"##Ctag#844", f::Symbol) + r = Ref{var"##Ctag#844"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#844"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#597"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#844"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#599" +struct var"##Ctag#860" requested::UInt8 executed::UInt8 end -function Base.getproperty(x::Ptr{var"##Ctag#599"}, f::Symbol) +function Base.getproperty(x::Ptr{var"##Ctag#860"}, f::Symbol) f === :requested && return (Ptr{UInt8}(x + 0), 0, 4) f === :executed && return (Ptr{UInt8}(x + 0), 4, 4) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#599", f::Symbol) - r = Ref{var"##Ctag#599"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#599"}, r) +function Base.getproperty(x::var"##Ctag#860", f::Symbol) + r = Ref{var"##Ctag#860"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#860"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#599"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#860"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#601" - index::UInt32 - domainId::UInt32 +struct var"##Ctag#862" + smClock::UInt32 + memoryClock::UInt32 + pcieLinkGen::UInt32 + pcieLinkWidth::UInt32 + clocksThrottleReasons::CUpti_EnvironmentClocksThrottleReason end -function Base.getproperty(x::Ptr{var"##Ctag#601"}, f::Symbol) - f === :index && return Ptr{UInt32}(x + 0) - f === :domainId && return Ptr{UInt32}(x + 4) +function Base.getproperty(x::Ptr{var"##Ctag#862"}, f::Symbol) + f === :smClock && return Ptr{UInt32}(x + 0) + f === :memoryClock && return Ptr{UInt32}(x + 4) + f === :pcieLinkGen && return Ptr{UInt32}(x + 8) + f === :pcieLinkWidth && return Ptr{UInt32}(x + 12) + f === :clocksThrottleReasons && + return Ptr{CUpti_EnvironmentClocksThrottleReason}(x + 16) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#601", f::Symbol) - r = Ref{var"##Ctag#601"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#601"}, r) +function Base.getproperty(x::var"##Ctag#862", f::Symbol) + r = Ref{var"##Ctag#862"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#862"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#601"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#862"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#603" - index::UInt32 - domainId::UInt32 +struct var"##Ctag#863" + gpuTemperature::UInt32 end -function Base.getproperty(x::Ptr{var"##Ctag#603"}, f::Symbol) - f === :index && return Ptr{UInt32}(x + 0) - f === :domainId && return Ptr{UInt32}(x + 4) +function Base.getproperty(x::Ptr{var"##Ctag#863"}, f::Symbol) + f === :gpuTemperature && return Ptr{UInt32}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#603", f::Symbol) - r = Ref{var"##Ctag#603"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#603"}, r) +function Base.getproperty(x::var"##Ctag#863", f::Symbol) + r = Ref{var"##Ctag#863"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#863"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#603"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#863"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#604" - processId::UInt32 - threadId::UInt32 +struct var"##Ctag#864" + power::UInt32 + powerLimit::UInt32 end -function Base.getproperty(x::Ptr{var"##Ctag#604"}, f::Symbol) - f === :processId && return Ptr{UInt32}(x + 0) - f === :threadId && return Ptr{UInt32}(x + 4) +function Base.getproperty(x::Ptr{var"##Ctag#864"}, f::Symbol) + f === :power && return Ptr{UInt32}(x + 0) + f === :powerLimit && return Ptr{UInt32}(x + 4) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#604", f::Symbol) - r = Ref{var"##Ctag#604"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#604"}, r) +function Base.getproperty(x::var"##Ctag#864", f::Symbol) + r = Ref{var"##Ctag#864"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#864"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#604"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#864"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#605" - deviceId::UInt32 - contextId::UInt32 - streamId::UInt32 +struct var"##Ctag#865" + fanSpeed::UInt32 end -function Base.getproperty(x::Ptr{var"##Ctag#605"}, f::Symbol) - f === :deviceId && return Ptr{UInt32}(x + 0) - f === :contextId && return Ptr{UInt32}(x + 4) - f === :streamId && return Ptr{UInt32}(x + 8) +function Base.getproperty(x::Ptr{var"##Ctag#865"}, f::Symbol) + f === :fanSpeed && return Ptr{UInt32}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#605", f::Symbol) - r = Ref{var"##Ctag#605"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#605"}, r) +function Base.getproperty(x::var"##Ctag#865", f::Symbol) + r = Ref{var"##Ctag#865"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#865"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#605"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#865"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#607" +struct var"##Ctag#867" index::UInt32 domainId::UInt32 end -function Base.getproperty(x::Ptr{var"##Ctag#607"}, f::Symbol) +function Base.getproperty(x::Ptr{var"##Ctag#867"}, f::Symbol) f === :index && return Ptr{UInt32}(x + 0) f === :domainId && return Ptr{UInt32}(x + 4) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#607", f::Symbol) - r = Ref{var"##Ctag#607"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#607"}, r) +function Base.getproperty(x::var"##Ctag#867", f::Symbol) + r = Ref{var"##Ctag#867"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#867"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#607"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#867"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#609" +struct var"##Ctag#869" index::UInt32 domainId::UInt32 end -function Base.getproperty(x::Ptr{var"##Ctag#609"}, f::Symbol) +function Base.getproperty(x::Ptr{var"##Ctag#869"}, f::Symbol) f === :index && return Ptr{UInt32}(x + 0) f === :domainId && return Ptr{UInt32}(x + 4) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#609", f::Symbol) - r = Ref{var"##Ctag#609"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#609"}, r) +function Base.getproperty(x::var"##Ctag#869", f::Symbol) + r = Ref{var"##Ctag#869"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#869"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#609"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#869"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#611" +struct var"##Ctag#876" requested::UInt8 executed::UInt8 end -function Base.getproperty(x::Ptr{var"##Ctag#611"}, f::Symbol) +function Base.getproperty(x::Ptr{var"##Ctag#876"}, f::Symbol) f === :requested && return (Ptr{UInt8}(x + 0), 0, 4) f === :executed && return (Ptr{UInt8}(x + 0), 4, 4) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#611", f::Symbol) - r = Ref{var"##Ctag#611"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#611"}, r) +function Base.getproperty(x::var"##Ctag#876", f::Symbol) + r = Ref{var"##Ctag#876"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#876"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#611"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#876"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#613" +struct var"##Ctag#878" requested::UInt8 executed::UInt8 end -function Base.getproperty(x::Ptr{var"##Ctag#613"}, f::Symbol) +function Base.getproperty(x::Ptr{var"##Ctag#878"}, f::Symbol) f === :requested && return (Ptr{UInt8}(x + 0), 0, 4) f === :executed && return (Ptr{UInt8}(x + 0), 4, 4) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#613", f::Symbol) - r = Ref{var"##Ctag#613"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#613"}, r) +function Base.getproperty(x::var"##Ctag#878", f::Symbol) + r = Ref{var"##Ctag#878"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#878"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#613"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#878"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#626" - requested::UInt8 - executed::UInt8 +struct var"##Ctag#880" + index::UInt32 + domainId::UInt32 end -function Base.getproperty(x::Ptr{var"##Ctag#626"}, f::Symbol) - f === :requested && return (Ptr{UInt8}(x + 0), 0, 4) - f === :executed && return (Ptr{UInt8}(x + 0), 4, 4) +function Base.getproperty(x::Ptr{var"##Ctag#880"}, f::Symbol) + f === :index && return Ptr{UInt32}(x + 0) + f === :domainId && return Ptr{UInt32}(x + 4) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#626", f::Symbol) - r = Ref{var"##Ctag#626"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#626"}, r) +function Base.getproperty(x::var"##Ctag#880", f::Symbol) + r = Ref{var"##Ctag#880"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#880"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#626"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#880"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#637" - requested::UInt8 - executed::UInt8 +struct var"##Ctag#882" + index::UInt32 + domainId::UInt32 end -function Base.getproperty(x::Ptr{var"##Ctag#637"}, f::Symbol) - f === :requested && return (Ptr{UInt8}(x + 0), 0, 4) - f === :executed && return (Ptr{UInt8}(x + 0), 4, 4) +function Base.getproperty(x::Ptr{var"##Ctag#882"}, f::Symbol) + f === :index && return Ptr{UInt32}(x + 0) + f === :domainId && return Ptr{UInt32}(x + 4) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#637", f::Symbol) - r = Ref{var"##Ctag#637"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#637"}, r) +function Base.getproperty(x::var"##Ctag#882", f::Symbol) + r = Ref{var"##Ctag#882"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#882"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#637"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#882"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#647" - requested::UInt8 - executed::UInt8 +struct var"##Ctag#884" + index::UInt32 + domainId::UInt32 end -function Base.getproperty(x::Ptr{var"##Ctag#647"}, f::Symbol) - f === :requested && return (Ptr{UInt8}(x + 0), 0, 4) - f === :executed && return (Ptr{UInt8}(x + 0), 4, 4) +function Base.getproperty(x::Ptr{var"##Ctag#884"}, f::Symbol) + f === :index && return Ptr{UInt32}(x + 0) + f === :domainId && return Ptr{UInt32}(x + 4) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#647", f::Symbol) - r = Ref{var"##Ctag#647"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#647"}, r) +function Base.getproperty(x::var"##Ctag#884", f::Symbol) + r = Ref{var"##Ctag#884"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#884"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#647"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#884"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#650" - smClock::UInt32 - memoryClock::UInt32 - pcieLinkGen::UInt32 - pcieLinkWidth::UInt32 - clocksThrottleReasons::CUpti_EnvironmentClocksThrottleReason +struct var"##Ctag#886" + index::UInt32 + domainId::UInt32 end -function Base.getproperty(x::Ptr{var"##Ctag#650"}, f::Symbol) - f === :smClock && return Ptr{UInt32}(x + 0) - f === :memoryClock && return Ptr{UInt32}(x + 4) - f === :pcieLinkGen && return Ptr{UInt32}(x + 8) - f === :pcieLinkWidth && return Ptr{UInt32}(x + 12) - f === :clocksThrottleReasons && - return Ptr{CUpti_EnvironmentClocksThrottleReason}(x + 16) +function Base.getproperty(x::Ptr{var"##Ctag#886"}, f::Symbol) + f === :index && return Ptr{UInt32}(x + 0) + f === :domainId && return Ptr{UInt32}(x + 4) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#650", f::Symbol) - r = Ref{var"##Ctag#650"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#650"}, r) +function Base.getproperty(x::var"##Ctag#886", f::Symbol) + r = Ref{var"##Ctag#886"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#886"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#650"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#886"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#651" - gpuTemperature::UInt32 +struct var"##Ctag#888" + requested::UInt8 + executed::UInt8 end -function Base.getproperty(x::Ptr{var"##Ctag#651"}, f::Symbol) - f === :gpuTemperature && return Ptr{UInt32}(x + 0) +function Base.getproperty(x::Ptr{var"##Ctag#888"}, f::Symbol) + f === :requested && return (Ptr{UInt8}(x + 0), 0, 4) + f === :executed && return (Ptr{UInt8}(x + 0), 4, 4) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#651", f::Symbol) - r = Ref{var"##Ctag#651"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#651"}, r) +function Base.getproperty(x::var"##Ctag#888", f::Symbol) + r = Ref{var"##Ctag#888"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#888"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#651"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#888"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#652" - power::UInt32 - powerLimit::UInt32 +struct var"##Ctag#908" + requested::UInt8 + executed::UInt8 end -function Base.getproperty(x::Ptr{var"##Ctag#652"}, f::Symbol) - f === :power && return Ptr{UInt32}(x + 0) - f === :powerLimit && return Ptr{UInt32}(x + 4) +function Base.getproperty(x::Ptr{var"##Ctag#908"}, f::Symbol) + f === :requested && return (Ptr{UInt8}(x + 0), 0, 4) + f === :executed && return (Ptr{UInt8}(x + 0), 4, 4) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#652", f::Symbol) - r = Ref{var"##Ctag#652"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#652"}, r) +function Base.getproperty(x::var"##Ctag#908", f::Symbol) + r = Ref{var"##Ctag#908"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#908"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#652"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#908"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#653" - fanSpeed::UInt32 +struct var"##Ctag#915" + uuidDev::CUuuid + peerDev::NTuple{32,CUdevice} end -function Base.getproperty(x::Ptr{var"##Ctag#653"}, f::Symbol) - f === :fanSpeed && return Ptr{UInt32}(x + 0) +function Base.getproperty(x::Ptr{var"##Ctag#915"}, f::Symbol) + f === :uuidDev && return Ptr{CUuuid}(x + 0) + f === :peerDev && return Ptr{NTuple{32,CUdevice}}(x + 16) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#653", f::Symbol) - r = Ref{var"##Ctag#653"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#653"}, r) +function Base.getproperty(x::var"##Ctag#915", f::Symbol) + r = Ref{var"##Ctag#915"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#915"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#653"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#915"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#655" - requested::UInt8 - executed::UInt8 +struct var"##Ctag#916" + secondaryBus::UInt16 + deviceId::UInt16 + vendorId::UInt16 + pad0::UInt16 end -function Base.getproperty(x::Ptr{var"##Ctag#655"}, f::Symbol) - f === :requested && return (Ptr{UInt8}(x + 0), 0, 4) - f === :executed && return (Ptr{UInt8}(x + 0), 4, 4) +function Base.getproperty(x::Ptr{var"##Ctag#916"}, f::Symbol) + f === :secondaryBus && return Ptr{UInt16}(x + 0) + f === :deviceId && return Ptr{UInt16}(x + 2) + f === :vendorId && return Ptr{UInt16}(x + 4) + f === :pad0 && return Ptr{UInt16}(x + 6) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#655", f::Symbol) - r = Ref{var"##Ctag#655"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#655"}, r) +function Base.getproperty(x::var"##Ctag#916", f::Symbol) + r = Ref{var"##Ctag#916"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#916"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#655"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#916"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#658" - uuidDev::CUuuid - peerDev::NTuple{32,CUdevice} +struct var"##Ctag#919" + requested::UInt8 + executed::UInt8 end -function Base.getproperty(x::Ptr{var"##Ctag#658"}, f::Symbol) - f === :uuidDev && return Ptr{CUuuid}(x + 0) - f === :peerDev && return Ptr{NTuple{32,CUdevice}}(x + 16) +function Base.getproperty(x::Ptr{var"##Ctag#919"}, f::Symbol) + f === :requested && return (Ptr{UInt8}(x + 0), 0, 4) + f === :executed && return (Ptr{UInt8}(x + 0), 4, 4) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#658", f::Symbol) - r = Ref{var"##Ctag#658"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#658"}, r) +function Base.getproperty(x::var"##Ctag#919", f::Symbol) + r = Ref{var"##Ctag#919"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#919"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#658"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#919"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#659" - secondaryBus::UInt16 - deviceId::UInt16 - vendorId::UInt16 - pad0::UInt16 +struct var"##Ctag#928" + requested::UInt8 + executed::UInt8 end -function Base.getproperty(x::Ptr{var"##Ctag#659"}, f::Symbol) - f === :secondaryBus && return Ptr{UInt16}(x + 0) - f === :deviceId && return Ptr{UInt16}(x + 2) - f === :vendorId && return Ptr{UInt16}(x + 4) - f === :pad0 && return Ptr{UInt16}(x + 6) +function Base.getproperty(x::Ptr{var"##Ctag#928"}, f::Symbol) + f === :requested && return (Ptr{UInt8}(x + 0), 0, 4) + f === :executed && return (Ptr{UInt8}(x + 0), 4, 4) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#659", f::Symbol) - r = Ref{var"##Ctag#659"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#659"}, r) +function Base.getproperty(x::var"##Ctag#928", f::Symbol) + r = Ref{var"##Ctag#928"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#928"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#659"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#928"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#670" +struct var"##Ctag#930" index::UInt32 domainId::UInt32 end -function Base.getproperty(x::Ptr{var"##Ctag#670"}, f::Symbol) +function Base.getproperty(x::Ptr{var"##Ctag#930"}, f::Symbol) f === :index && return Ptr{UInt32}(x + 0) f === :domainId && return Ptr{UInt32}(x + 4) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#670", f::Symbol) - r = Ref{var"##Ctag#670"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#670"}, r) +function Base.getproperty(x::var"##Ctag#930", f::Symbol) + r = Ref{var"##Ctag#930"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#930"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#670"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#930"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#672" +struct var"##Ctag#932" index::UInt32 domainId::UInt32 end -function Base.getproperty(x::Ptr{var"##Ctag#672"}, f::Symbol) +function Base.getproperty(x::Ptr{var"##Ctag#932"}, f::Symbol) f === :index && return Ptr{UInt32}(x + 0) f === :domainId && return Ptr{UInt32}(x + 4) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#672", f::Symbol) - r = Ref{var"##Ctag#672"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#672"}, r) +function Base.getproperty(x::var"##Ctag#932", f::Symbol) + r = Ref{var"##Ctag#932"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#932"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#672"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#932"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#680" - index::UInt32 - domainId::UInt32 +struct var"##Ctag#936" + requested::UInt8 + executed::UInt8 end -function Base.getproperty(x::Ptr{var"##Ctag#680"}, f::Symbol) - f === :index && return Ptr{UInt32}(x + 0) - f === :domainId && return Ptr{UInt32}(x + 4) +function Base.getproperty(x::Ptr{var"##Ctag#936"}, f::Symbol) + f === :requested && return (Ptr{UInt8}(x + 0), 0, 4) + f === :executed && return (Ptr{UInt8}(x + 0), 4, 4) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#680", f::Symbol) - r = Ref{var"##Ctag#680"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#680"}, r) +function Base.getproperty(x::var"##Ctag#936", f::Symbol) + r = Ref{var"##Ctag#936"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#936"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#680"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#936"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#682" - index::UInt32 - domainId::UInt32 +struct var"##Ctag#947" + processId::UInt32 + threadId::UInt32 end -function Base.getproperty(x::Ptr{var"##Ctag#682"}, f::Symbol) - f === :index && return Ptr{UInt32}(x + 0) - f === :domainId && return Ptr{UInt32}(x + 4) +function Base.getproperty(x::Ptr{var"##Ctag#947"}, f::Symbol) + f === :processId && return Ptr{UInt32}(x + 0) + f === :threadId && return Ptr{UInt32}(x + 4) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#682", f::Symbol) - r = Ref{var"##Ctag#682"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#682"}, r) +function Base.getproperty(x::var"##Ctag#947", f::Symbol) + r = Ref{var"##Ctag#947"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#947"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#682"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#947"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end -struct var"##Ctag#686" - requested::UInt8 - executed::UInt8 +struct var"##Ctag#948" + deviceId::UInt32 + contextId::UInt32 + streamId::UInt32 end -function Base.getproperty(x::Ptr{var"##Ctag#686"}, f::Symbol) - f === :requested && return (Ptr{UInt8}(x + 0), 0, 4) - f === :executed && return (Ptr{UInt8}(x + 0), 4, 4) +function Base.getproperty(x::Ptr{var"##Ctag#948"}, f::Symbol) + f === :deviceId && return Ptr{UInt32}(x + 0) + f === :contextId && return Ptr{UInt32}(x + 4) + f === :streamId && return Ptr{UInt32}(x + 8) return getfield(x, f) end -function Base.getproperty(x::var"##Ctag#686", f::Symbol) - r = Ref{var"##Ctag#686"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#686"}, r) +function Base.getproperty(x::var"##Ctag#948", f::Symbol) + r = Ref{var"##Ctag#948"}(x) + ptr = Base.unsafe_convert(Ptr{var"##Ctag#948"}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"##Ctag#686"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{var"##Ctag#948"}, f::Symbol, v) return unsafe_store!(getproperty(x, f), v) end @@ -5947,3 +5955,66 @@ const CUPTI_NVLINK_INVALID_PORT = -1 const CUPTI_MAX_NVLINK_PORTS = 32 const CUPTI_MAX_GPUS = 32 + +const CUpti_Profiler_Initialize_Params_STRUCT_SIZE = @CUPTI_PROFILER_STRUCT_SIZE(CUpti_Profiler_Initialize_Params, + pPriv) + +const CUpti_Profiler_DeInitialize_Params_STRUCT_SIZE = @CUPTI_PROFILER_STRUCT_SIZE(CUpti_Profiler_DeInitialize_Params, + pPriv) + +const CUpti_Profiler_CounterDataImageOptions_STRUCT_SIZE = @CUPTI_PROFILER_STRUCT_SIZE(CUpti_Profiler_CounterDataImageOptions, + maxRangeNameLength) + +const CUpti_Profiler_CounterDataImage_CalculateSize_Params_STRUCT_SIZE = @CUPTI_PROFILER_STRUCT_SIZE(CUpti_Profiler_CounterDataImage_CalculateSize_Params, + counterDataImageSize) + +const CUpti_Profiler_CounterDataImage_Initialize_Params_STRUCT_SIZE = @CUPTI_PROFILER_STRUCT_SIZE(CUpti_Profiler_CounterDataImage_Initialize_Params, + pCounterDataImage) + +const CUpti_Profiler_CounterDataImage_CalculateScratchBufferSize_Params_STRUCT_SIZE = @CUPTI_PROFILER_STRUCT_SIZE(CUpti_Profiler_CounterDataImage_CalculateScratchBufferSize_Params, + counterDataScratchBufferSize) + +const CUpti_Profiler_CounterDataImage_InitializeScratchBuffer_Params_STRUCT_SIZE = @CUPTI_PROFILER_STRUCT_SIZE(CUpti_Profiler_CounterDataImage_InitializeScratchBuffer_Params, + pCounterDataScratchBuffer) + +const CUpti_Profiler_BeginSession_Params_STRUCT_SIZE = @CUPTI_PROFILER_STRUCT_SIZE(CUpti_Profiler_BeginSession_Params, + maxLaunchesPerPass) + +const CUpti_Profiler_EndSession_Params_STRUCT_SIZE = @CUPTI_PROFILER_STRUCT_SIZE(CUpti_Profiler_EndSession_Params, + ctx) + +const CUpti_Profiler_SetConfig_Params_STRUCT_SIZE = @CUPTI_PROFILER_STRUCT_SIZE(CUpti_Profiler_SetConfig_Params, + targetNestingLevel) + +const CUpti_Profiler_UnsetConfig_Params_STRUCT_SIZE = @CUPTI_PROFILER_STRUCT_SIZE(CUpti_Profiler_UnsetConfig_Params, + ctx) + +const CUpti_Profiler_BeginPass_Params_STRUCT_SIZE = @CUPTI_PROFILER_STRUCT_SIZE(CUpti_Profiler_BeginPass_Params, + ctx) + +const CUpti_Profiler_EndPass_Params_STRUCT_SIZE = @CUPTI_PROFILER_STRUCT_SIZE(CUpti_Profiler_EndPass_Params, + allPassesSubmitted) + +const CUpti_Profiler_EnableProfiling_Params_STRUCT_SIZE = @CUPTI_PROFILER_STRUCT_SIZE(CUpti_Profiler_EnableProfiling_Params, + ctx) + +const CUpti_Profiler_DisableProfiling_Params_STRUCT_SIZE = @CUPTI_PROFILER_STRUCT_SIZE(CUpti_Profiler_DisableProfiling_Params, + ctx) + +const CUpti_Profiler_IsPassCollected_Params_STRUCT_SIZE = @CUPTI_PROFILER_STRUCT_SIZE(CUpti_Profiler_IsPassCollected_Params, + allPassesCollected) + +const CUpti_Profiler_FlushCounterData_Params_STRUCT_SIZE = @CUPTI_PROFILER_STRUCT_SIZE(CUpti_Profiler_FlushCounterData_Params, + numTraceBytesDropped) + +const CUpti_Profiler_PushRange_Params_STRUCT_SIZE = @CUPTI_PROFILER_STRUCT_SIZE(CUpti_Profiler_PushRange_Params, + rangeNameLength) + +const CUpti_Profiler_PopRange_Params_STRUCT_SIZE = @CUPTI_PROFILER_STRUCT_SIZE(CUpti_Profiler_PopRange_Params, + ctx) + +const CUpti_Profiler_GetCounterAvailability_Params_STRUCT_SIZE = @CUPTI_PROFILER_STRUCT_SIZE(CUpti_Profiler_GetCounterAvailability_Params, + pCounterAvailabilityImage) + +const CUpti_Profiler_DeviceSupported_Params_STRUCT_SIZE = @CUPTI_PROFILER_STRUCT_SIZE(CUpti_Profiler_DeviceSupported_Params, + confidentialCompute) diff --git a/lib/nvperf/NVPERF.jl b/lib/nvperf/NVPERF.jl new file mode 100644 index 0000000000..22219fc9c4 --- /dev/null +++ b/lib/nvperf/NVPERF.jl @@ -0,0 +1,21 @@ +module NVPERF + +using ..APIUtils + +using ..CUDA_Runtime + +using ..CUDA +using ..CUDA: @retry_reclaim, initialize_context +using ..CUDA: CUuuid, CUcontext, CUstream, CUdevice, CUdevice_attribute, + CUgraph, CUgraphNode, CUgraphNodeType, CUgraphExec, CUaccessPolicyWindow + +using CEnum: @cenum + + +# core library +include("libnvperf_host.jl") + +include("error.jl") +include("wrappers.jl") + +end \ No newline at end of file diff --git a/lib/nvperf/error.jl b/lib/nvperf/error.jl new file mode 100644 index 0000000000..b3d88d6f27 --- /dev/null +++ b/lib/nvperf/error.jl @@ -0,0 +1,8 @@ +struct NVPAError <: Exception + code::NVPA_Status +end + +Base.convert(::Type{NVPA_Status}, err::NVPAError) = err.code + +Base.showerror(io::IO, err::NVPAError) = + print(io, "NVPAError: $(err.code) (code $(reinterpret(Int32, err.code)))") diff --git a/lib/nvperf/libnvperf_host.jl b/lib/nvperf/libnvperf_host.jl new file mode 100644 index 0000000000..055eae018c --- /dev/null +++ b/lib/nvperf/libnvperf_host.jl @@ -0,0 +1,1481 @@ +using CEnum + +# outlined functionality to avoid GC frame allocation +@noinline function throw_api_error(res) + throw(NVPAError(res)) +end + +macro check(ex, errs...) + quote + res = $(esc(ex)) + if res != NVPA_STATUS_SUCCESS + throw_api_error(res) + end + + nothing + end +end + +macro NVPA_STRUCT_SIZE(type, lastfield) + type = esc(type) + lastfield = QuoteNode(lastfield) + quote + $struct_size($type, $lastfield) + end +end + +struct NVPW_SetLibraryLoadPaths_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + numPaths::Csize_t + ppPaths::Ptr{Cstring} +end + +struct NVPW_SetLibraryLoadPathsW_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + numPaths::Csize_t + ppwPaths::Ptr{Ptr{Cwchar_t}} +end + +@cenum NVPA_Status::UInt32 begin + NVPA_STATUS_SUCCESS = 0 + NVPA_STATUS_ERROR = 1 + NVPA_STATUS_INTERNAL_ERROR = 2 + NVPA_STATUS_NOT_INITIALIZED = 3 + NVPA_STATUS_NOT_LOADED = 4 + NVPA_STATUS_FUNCTION_NOT_FOUND = 5 + NVPA_STATUS_NOT_SUPPORTED = 6 + NVPA_STATUS_NOT_IMPLEMENTED = 7 + NVPA_STATUS_INVALID_ARGUMENT = 8 + NVPA_STATUS_INVALID_METRIC_ID = 9 + NVPA_STATUS_DRIVER_NOT_LOADED = 10 + NVPA_STATUS_OUT_OF_MEMORY = 11 + NVPA_STATUS_INVALID_THREAD_STATE = 12 + NVPA_STATUS_FAILED_CONTEXT_ALLOC = 13 + NVPA_STATUS_UNSUPPORTED_GPU = 14 + NVPA_STATUS_INSUFFICIENT_DRIVER_VERSION = 15 + NVPA_STATUS_OBJECT_NOT_REGISTERED = 16 + NVPA_STATUS_INSUFFICIENT_PRIVILEGE = 17 + NVPA_STATUS_INVALID_CONTEXT_STATE = 18 + NVPA_STATUS_INVALID_OBJECT_STATE = 19 + NVPA_STATUS_RESOURCE_UNAVAILABLE = 20 + NVPA_STATUS_DRIVER_LOADED_TOO_LATE = 21 + NVPA_STATUS_INSUFFICIENT_SPACE = 22 + NVPA_STATUS_OBJECT_MISMATCH = 23 + NVPA_STATUS_VIRTUALIZED_DEVICE_NOT_SUPPORTED = 24 + NVPA_STATUS_PROFILING_NOT_ALLOWED = 25 + NVPA_STATUS__COUNT = 26 +end + +@cenum NVPA_ActivityKind::UInt32 begin + NVPA_ACTIVITY_KIND_INVALID = 0 + NVPA_ACTIVITY_KIND_PROFILER = 1 + NVPA_ACTIVITY_KIND_REALTIME_SAMPLED = 2 + NVPA_ACTIVITY_KIND_REALTIME_PROFILER = 3 + NVPA_ACTIVITY_KIND__COUNT = 4 +end + +const NVPA_Bool = UInt8 + +# typedef NVPA_Status ( * NVPA_GenericFn ) ( void ) +const NVPA_GenericFn = Ptr{Cvoid} + +function NVPA_GetProcAddress(pFunctionName) + initialize_context() + @ccall libnvperf_host.NVPA_GetProcAddress(pFunctionName::Cstring)::NVPA_GenericFn +end + +@checked function NVPW_SetLibraryLoadPaths(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_SetLibraryLoadPaths(pParams::Ptr{NVPW_SetLibraryLoadPaths_Params})::NVPA_Status +end + +@checked function NVPW_SetLibraryLoadPathsW(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_SetLibraryLoadPathsW(pParams::Ptr{NVPW_SetLibraryLoadPathsW_Params})::NVPA_Status +end + +struct NVPW_InitializeHost_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} +end + +struct NVPW_CounterData_CalculateCounterDataImageCopySize_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pCounterDataPrefix::Ptr{UInt8} + counterDataPrefixSize::Csize_t + maxNumRanges::UInt32 + maxNumRangeTreeNodes::UInt32 + maxRangeNameLength::UInt32 + pCounterDataSrc::Ptr{UInt8} + copyDataImageCounterSize::Csize_t +end + +struct NVPW_CounterData_InitializeCounterDataImageCopy_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pCounterDataPrefix::Ptr{UInt8} + counterDataPrefixSize::Csize_t + maxNumRanges::UInt32 + maxNumRangeTreeNodes::UInt32 + maxRangeNameLength::UInt32 + pCounterDataSrc::Ptr{UInt8} + pCounterDataDst::Ptr{UInt8} +end + +mutable struct NVPA_CounterDataCombiner end + +struct NVPW_CounterDataCombiner_Create_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pCounterDataDst::Ptr{UInt8} + pCounterDataCombiner::Ptr{NVPA_CounterDataCombiner} +end + +struct NVPW_CounterDataCombiner_Destroy_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pCounterDataCombiner::Ptr{NVPA_CounterDataCombiner} +end + +struct NVPW_CounterDataCombiner_CreateRange_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pCounterDataCombiner::Ptr{NVPA_CounterDataCombiner} + numDescriptions::Csize_t + ppDescriptions::Ptr{Cstring} + rangeIndexDst::Csize_t +end + +struct NVPW_CounterDataCombiner_CopyIntoRange_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pCounterDataCombiner::Ptr{NVPA_CounterDataCombiner} + rangeIndexDst::Csize_t + pCounterDataSrc::Ptr{UInt8} + rangeIndexSrc::Csize_t +end + +struct NVPW_CounterDataCombiner_AccumulateIntoRange_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pCounterDataCombiner::Ptr{NVPA_CounterDataCombiner} + rangeIndexDst::Csize_t + dstMultiplier::UInt32 + pCounterDataSrc::Ptr{UInt8} + rangeIndexSrc::Csize_t + srcMultiplier::UInt32 +end + +struct NVPW_CounterDataCombiner_SumIntoRange_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pCounterDataCombiner::Ptr{NVPA_CounterDataCombiner} + rangeIndexDst::Csize_t + pCounterDataSrc::Ptr{UInt8} + rangeIndexSrc::Csize_t +end + +struct NVPW_CounterDataCombiner_WeightedSumIntoRange_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pCounterDataCombiner::Ptr{NVPA_CounterDataCombiner} + rangeIndexDst::Csize_t + dstMultiplier::Cdouble + pCounterDataSrc::Ptr{UInt8} + rangeIndexSrc::Csize_t + srcMultiplier::Cdouble +end + +struct NVPA_RawMetricRequest + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricName::Cstring + isolated::NVPA_Bool + keepInstances::NVPA_Bool +end + +struct NVPW_GetSupportedChipNames_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + ppChipNames::Ptr{Cstring} + numChipNames::Csize_t +end + +mutable struct NVPA_RawMetricsConfig end + +struct NVPW_RawMetricsConfig_Destroy_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pRawMetricsConfig::Ptr{NVPA_RawMetricsConfig} +end + +struct NVPW_RawMetricsConfig_SetCounterAvailability_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pRawMetricsConfig::Ptr{NVPA_RawMetricsConfig} + pCounterAvailabilityImage::Ptr{UInt8} +end + +struct NVPW_RawMetricsConfig_BeginPassGroup_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pRawMetricsConfig::Ptr{NVPA_RawMetricsConfig} + maxPassCount::Csize_t +end + +struct NVPW_RawMetricsConfig_EndPassGroup_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pRawMetricsConfig::Ptr{NVPA_RawMetricsConfig} +end + +struct NVPW_RawMetricsConfig_GetNumMetrics_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pRawMetricsConfig::Ptr{NVPA_RawMetricsConfig} + numMetrics::Csize_t +end + +struct NVPW_RawMetricsConfig_GetMetricProperties_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pRawMetricsConfig::Ptr{NVPA_RawMetricsConfig} + metricIndex::Csize_t + pMetricName::Cstring + supportsPipelined::NVPA_Bool + supportsIsolated::NVPA_Bool +end + +struct NVPW_RawMetricsConfig_GetMetricProperties_V2_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pRawMetricsConfig::Ptr{NVPA_RawMetricsConfig} + metricIndex::Csize_t + pMetricName::Cstring +end + +struct NVPW_RawMetricsConfig_AddMetrics_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pRawMetricsConfig::Ptr{NVPA_RawMetricsConfig} + pRawMetricRequests::Ptr{NVPA_RawMetricRequest} + numMetricRequests::Csize_t +end + +struct NVPW_RawMetricsConfig_IsAddMetricsPossible_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pRawMetricsConfig::Ptr{NVPA_RawMetricsConfig} + pRawMetricRequests::Ptr{NVPA_RawMetricRequest} + numMetricRequests::Csize_t + isPossible::NVPA_Bool +end + +struct NVPW_RawMetricsConfig_GenerateConfigImage_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pRawMetricsConfig::Ptr{NVPA_RawMetricsConfig} + mergeAllPassGroups::NVPA_Bool +end + +struct NVPW_RawMetricsConfig_GetConfigImage_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pRawMetricsConfig::Ptr{NVPA_RawMetricsConfig} + bytesAllocated::Csize_t + pBuffer::Ptr{UInt8} + bytesCopied::Csize_t +end + +struct NVPW_RawMetricsConfig_GetNumPasses_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pRawMetricsConfig::Ptr{NVPA_RawMetricsConfig} + numPipelinedPasses::Csize_t + numIsolatedPasses::Csize_t +end + +struct NVPW_RawMetricsConfig_GetNumPasses_V2_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pRawMetricsConfig::Ptr{NVPA_RawMetricsConfig} + numPasses::Csize_t +end + +struct NVPW_PeriodicSampler_Config_GetSocEstimatedSampleSize_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pConfig::Ptr{UInt8} + configSize::Csize_t + sampleSize::Csize_t +end + +struct NVPW_PeriodicSampler_Config_GetGpuEstimatedSampleSize_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pConfig::Ptr{UInt8} + configSize::Csize_t + sampleSize::Csize_t +end + +mutable struct NVPA_CounterDataBuilder end + +struct NVPW_CounterDataBuilder_Create_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pCounterDataBuilder::Ptr{NVPA_CounterDataBuilder} + pChipName::Cstring +end + +struct NVPW_CounterDataBuilder_Destroy_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pCounterDataBuilder::Ptr{NVPA_CounterDataBuilder} +end + +struct NVPW_CounterDataBuilder_AddMetrics_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pCounterDataBuilder::Ptr{NVPA_CounterDataBuilder} + pRawMetricRequests::Ptr{NVPA_RawMetricRequest} + numMetricRequests::Csize_t +end + +struct NVPW_CounterDataBuilder_GetCounterDataPrefix_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pCounterDataBuilder::Ptr{NVPA_CounterDataBuilder} + bytesAllocated::Csize_t + pBuffer::Ptr{UInt8} + bytesCopied::Csize_t +end + +mutable struct NVPA_MetricsContext end + +struct NVPW_MetricsContext_Destroy_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsContext::Ptr{NVPA_MetricsContext} +end + +struct NVPW_MetricsContext_RunScript_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsContext::Ptr{NVPA_MetricsContext} + printErrors::NVPA_Bool + pSource::Cstring + pFileName::Cstring +end + +struct NVPW_MetricsContext_ExecScript_Begin_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsContext::Ptr{NVPA_MetricsContext} + isStatement::NVPA_Bool + printErrors::NVPA_Bool + pSource::Cstring + pFileName::Cstring + pResultStr::Cstring +end + +struct NVPW_MetricsContext_ExecScript_End_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsContext::Ptr{NVPA_MetricsContext} +end + +struct NVPW_MetricsContext_GetCounterNames_Begin_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsContext::Ptr{NVPA_MetricsContext} + numCounters::Csize_t + ppCounterNames::Ptr{Cstring} +end + +struct NVPW_MetricsContext_GetCounterNames_End_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsContext::Ptr{NVPA_MetricsContext} +end + +struct NVPW_MetricsContext_GetThroughputNames_Begin_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsContext::Ptr{NVPA_MetricsContext} + numThroughputs::Csize_t + ppThroughputNames::Ptr{Cstring} +end + +struct NVPW_MetricsContext_GetThroughputNames_End_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsContext::Ptr{NVPA_MetricsContext} +end + +struct NVPW_MetricsContext_GetRatioNames_Begin_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsContext::Ptr{NVPA_MetricsContext} + numRatios::Csize_t + ppRatioNames::Ptr{Cstring} +end + +struct NVPW_MetricsContext_GetRatioNames_End_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsContext::Ptr{NVPA_MetricsContext} +end + +struct NVPW_MetricsContext_GetMetricNames_Begin_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsContext::Ptr{NVPA_MetricsContext} + numMetrics::Csize_t + ppMetricNames::Ptr{Cstring} + hidePeakSubMetrics::NVPA_Bool + hidePerCycleSubMetrics::NVPA_Bool + hidePctOfPeakSubMetrics::NVPA_Bool + hidePctOfPeakSubMetricsOnThroughputs::NVPA_Bool +end + +struct NVPW_MetricsContext_GetMetricNames_End_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsContext::Ptr{NVPA_MetricsContext} +end + +struct NVPW_MetricsContext_GetThroughputBreakdown_Begin_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsContext::Ptr{NVPA_MetricsContext} + pThroughputName::Cstring + ppCounterNames::Ptr{Cstring} + ppSubThroughputNames::Ptr{Cstring} +end + +struct NVPW_MetricsContext_GetThroughputBreakdown_End_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsContext::Ptr{NVPA_MetricsContext} +end + +struct NVPW_MetricsContext_GetMetricProperties_Begin_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsContext::Ptr{NVPA_MetricsContext} + pMetricName::Cstring + pDescription::Cstring + pDimUnits::Cstring + ppRawMetricDependencies::Ptr{Cstring} + gpuBurstRate::Cdouble + gpuSustainedRate::Cdouble + ppOptionalRawMetricDependencies::Ptr{Cstring} +end + +struct NVPW_MetricsContext_GetMetricProperties_End_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsContext::Ptr{NVPA_MetricsContext} +end + +struct NVPW_MetricsContext_SetCounterData_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsContext::Ptr{NVPA_MetricsContext} + pCounterDataImage::Ptr{UInt8} + rangeIndex::Csize_t + isolated::NVPA_Bool +end + +struct NVPW_MetricsContext_SetUserData_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsContext::Ptr{NVPA_MetricsContext} + frameDuration::Cdouble + regionDuration::Cdouble +end + +struct NVPW_MetricsContext_EvaluateToGpuValues_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsContext::Ptr{NVPA_MetricsContext} + numMetrics::Csize_t + ppMetricNames::Ptr{Cstring} + pMetricValues::Ptr{Cdouble} +end + +struct NVPW_MetricsContext_GetMetricSuffix_Begin_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsContext::Ptr{NVPA_MetricsContext} + pMetricName::Cstring + numSuffixes::Csize_t + ppSuffixes::Ptr{Cstring} + hidePeakSubMetrics::NVPA_Bool + hidePerCycleSubMetrics::NVPA_Bool + hidePctOfPeakSubMetrics::NVPA_Bool + hidePctOfPeakSubMetricsOnThroughputs::NVPA_Bool +end + +struct NVPW_MetricsContext_GetMetricSuffix_End_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsContext::Ptr{NVPA_MetricsContext} +end + +struct NVPW_MetricsContext_GetMetricBaseNames_Begin_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsContext::Ptr{NVPA_MetricsContext} + numMetricBaseNames::Csize_t + ppMetricBaseNames::Ptr{Cstring} +end + +struct NVPW_MetricsContext_GetMetricBaseNames_End_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsContext::Ptr{NVPA_MetricsContext} +end + +struct NVPW_MetricEvalRequest + metricIndex::Csize_t + metricType::UInt8 + rollupOp::UInt8 + submetric::UInt16 +end + +struct NVPW_DimUnitFactor + dimUnit::UInt32 + exponent::Int8 +end + +mutable struct NVPW_MetricsEvaluator end + +struct NVPW_MetricsEvaluator_Destroy_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsEvaluator::Ptr{NVPW_MetricsEvaluator} +end + +struct NVPW_MetricsEvaluator_GetMetricNames_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsEvaluator::Ptr{NVPW_MetricsEvaluator} + metricType::UInt8 + pMetricNames::Cstring + pMetricNameBeginIndices::Ptr{Csize_t} + numMetrics::Csize_t +end + +struct NVPW_MetricsEvaluator_GetMetricTypeAndIndex_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsEvaluator::Ptr{NVPW_MetricsEvaluator} + pMetricName::Cstring + metricType::UInt8 + metricIndex::Csize_t +end + +struct NVPW_MetricsEvaluator_ConvertMetricNameToMetricEvalRequest_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsEvaluator::Ptr{NVPW_MetricsEvaluator} + pMetricName::Cstring + pMetricEvalRequest::Ptr{NVPW_MetricEvalRequest} + metricEvalRequestStructSize::Csize_t +end + +struct NVPW_MetricsEvaluator_HwUnitToString_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsEvaluator::Ptr{NVPW_MetricsEvaluator} + hwUnit::UInt32 + pHwUnitName::Cstring +end + +struct NVPW_MetricsEvaluator_GetCounterProperties_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsEvaluator::Ptr{NVPW_MetricsEvaluator} + counterIndex::Csize_t + pDescription::Cstring + hwUnit::UInt32 +end + +struct NVPW_MetricsEvaluator_GetRatioMetricProperties_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsEvaluator::Ptr{NVPW_MetricsEvaluator} + ratioMetricIndex::Csize_t + pDescription::Cstring + hwUnit::UInt64 +end + +struct NVPW_MetricsEvaluator_GetThroughputMetricProperties_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsEvaluator::Ptr{NVPW_MetricsEvaluator} + throughputMetricIndex::Csize_t + pDescription::Cstring + hwUnit::UInt32 + numCounters::Csize_t + pCounterIndices::Ptr{Csize_t} + numSubThroughputs::Csize_t + pSubThroughputIndices::Ptr{Csize_t} +end + +struct NVPW_MetricsEvaluator_GetSupportedSubmetrics_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsEvaluator::Ptr{NVPW_MetricsEvaluator} + metricType::UInt8 + pSupportedSubmetrics::Ptr{UInt16} + numSupportedSubmetrics::Csize_t +end + +struct NVPW_MetricsEvaluator_GetMetricRawDependencies_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsEvaluator::Ptr{NVPW_MetricsEvaluator} + pMetricEvalRequests::Ptr{NVPW_MetricEvalRequest} + numMetricEvalRequests::Csize_t + metricEvalRequestStructSize::Csize_t + metricEvalRequestStrideSize::Csize_t + ppRawDependencies::Ptr{Cstring} + numRawDependencies::Csize_t + ppOptionalRawDependencies::Ptr{Cstring} + numOptionalRawDependencies::Csize_t +end + +struct NVPW_MetricsEvaluator_DimUnitToString_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsEvaluator::Ptr{NVPW_MetricsEvaluator} + dimUnit::UInt32 + pSingularName::Cstring + pPluralName::Cstring +end + +struct NVPW_MetricsEvaluator_GetMetricDimUnits_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsEvaluator::Ptr{NVPW_MetricsEvaluator} + pMetricEvalRequest::Ptr{NVPW_MetricEvalRequest} + metricEvalRequestStructSize::Csize_t + pDimUnits::Ptr{NVPW_DimUnitFactor} + numDimUnits::Csize_t + dimUnitFactorStructSize::Csize_t +end + +struct NVPW_MetricsEvaluator_SetUserData_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsEvaluator::Ptr{NVPW_MetricsEvaluator} + frameDuration::Cdouble + regionDuration::Cdouble + isolated::NVPA_Bool +end + +struct NVPW_MetricsEvaluator_EvaluateToGpuValues_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsEvaluator::Ptr{NVPW_MetricsEvaluator} + pMetricEvalRequests::Ptr{NVPW_MetricEvalRequest} + numMetricEvalRequests::Csize_t + metricEvalRequestStructSize::Csize_t + metricEvalRequestStrideSize::Csize_t + pCounterDataImage::Ptr{UInt8} + counterDataImageSize::Csize_t + rangeIndex::Csize_t + isolated::NVPA_Bool + pMetricValues::Ptr{Cdouble} +end + +struct NVPW_MetricsEvaluator_SetDeviceAttributes_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pMetricsEvaluator::Ptr{NVPW_MetricsEvaluator} + pCounterDataImage::Ptr{UInt8} + counterDataImageSize::Csize_t +end + +@checked function NVPW_InitializeHost(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_InitializeHost(pParams::Ptr{NVPW_InitializeHost_Params})::NVPA_Status +end + +@checked function NVPW_CounterData_CalculateCounterDataImageCopySize(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_CounterData_CalculateCounterDataImageCopySize(pParams::Ptr{NVPW_CounterData_CalculateCounterDataImageCopySize_Params})::NVPA_Status +end + +@checked function NVPW_CounterData_InitializeCounterDataImageCopy(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_CounterData_InitializeCounterDataImageCopy(pParams::Ptr{NVPW_CounterData_InitializeCounterDataImageCopy_Params})::NVPA_Status +end + +@checked function NVPW_CounterDataCombiner_Create(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_CounterDataCombiner_Create(pParams::Ptr{NVPW_CounterDataCombiner_Create_Params})::NVPA_Status +end + +@checked function NVPW_CounterDataCombiner_Destroy(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_CounterDataCombiner_Destroy(pParams::Ptr{NVPW_CounterDataCombiner_Destroy_Params})::NVPA_Status +end + +@checked function NVPW_CounterDataCombiner_CreateRange(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_CounterDataCombiner_CreateRange(pParams::Ptr{NVPW_CounterDataCombiner_CreateRange_Params})::NVPA_Status +end + +@checked function NVPW_CounterDataCombiner_CopyIntoRange(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_CounterDataCombiner_CopyIntoRange(pParams::Ptr{NVPW_CounterDataCombiner_CopyIntoRange_Params})::NVPA_Status +end + +@checked function NVPW_CounterDataCombiner_AccumulateIntoRange(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_CounterDataCombiner_AccumulateIntoRange(pParams::Ptr{NVPW_CounterDataCombiner_AccumulateIntoRange_Params})::NVPA_Status +end + +@checked function NVPW_CounterDataCombiner_SumIntoRange(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_CounterDataCombiner_SumIntoRange(pParams::Ptr{NVPW_CounterDataCombiner_SumIntoRange_Params})::NVPA_Status +end + +@checked function NVPW_CounterDataCombiner_WeightedSumIntoRange(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_CounterDataCombiner_WeightedSumIntoRange(pParams::Ptr{NVPW_CounterDataCombiner_WeightedSumIntoRange_Params})::NVPA_Status +end + +@checked function NVPW_GetSupportedChipNames(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_GetSupportedChipNames(pParams::Ptr{NVPW_GetSupportedChipNames_Params})::NVPA_Status +end + +@checked function NVPW_RawMetricsConfig_Destroy(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_RawMetricsConfig_Destroy(pParams::Ptr{NVPW_RawMetricsConfig_Destroy_Params})::NVPA_Status +end + +@checked function NVPW_RawMetricsConfig_SetCounterAvailability(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_RawMetricsConfig_SetCounterAvailability(pParams::Ptr{NVPW_RawMetricsConfig_SetCounterAvailability_Params})::NVPA_Status +end + +@checked function NVPW_RawMetricsConfig_BeginPassGroup(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_RawMetricsConfig_BeginPassGroup(pParams::Ptr{NVPW_RawMetricsConfig_BeginPassGroup_Params})::NVPA_Status +end + +@checked function NVPW_RawMetricsConfig_EndPassGroup(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_RawMetricsConfig_EndPassGroup(pParams::Ptr{NVPW_RawMetricsConfig_EndPassGroup_Params})::NVPA_Status +end + +@checked function NVPW_RawMetricsConfig_GetNumMetrics(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_RawMetricsConfig_GetNumMetrics(pParams::Ptr{NVPW_RawMetricsConfig_GetNumMetrics_Params})::NVPA_Status +end + +@checked function NVPW_RawMetricsConfig_GetMetricProperties(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_RawMetricsConfig_GetMetricProperties(pParams::Ptr{NVPW_RawMetricsConfig_GetMetricProperties_Params})::NVPA_Status +end + +@checked function NVPW_RawMetricsConfig_GetMetricProperties_V2(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_RawMetricsConfig_GetMetricProperties_V2(pParams::Ptr{NVPW_RawMetricsConfig_GetMetricProperties_V2_Params})::NVPA_Status +end + +@checked function NVPW_RawMetricsConfig_AddMetrics(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_RawMetricsConfig_AddMetrics(pParams::Ptr{NVPW_RawMetricsConfig_AddMetrics_Params})::NVPA_Status +end + +@checked function NVPW_RawMetricsConfig_IsAddMetricsPossible(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_RawMetricsConfig_IsAddMetricsPossible(pParams::Ptr{NVPW_RawMetricsConfig_IsAddMetricsPossible_Params})::NVPA_Status +end + +@checked function NVPW_RawMetricsConfig_GenerateConfigImage(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_RawMetricsConfig_GenerateConfigImage(pParams::Ptr{NVPW_RawMetricsConfig_GenerateConfigImage_Params})::NVPA_Status +end + +@checked function NVPW_RawMetricsConfig_GetConfigImage(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_RawMetricsConfig_GetConfigImage(pParams::Ptr{NVPW_RawMetricsConfig_GetConfigImage_Params})::NVPA_Status +end + +@checked function NVPW_RawMetricsConfig_GetNumPasses(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_RawMetricsConfig_GetNumPasses(pParams::Ptr{NVPW_RawMetricsConfig_GetNumPasses_Params})::NVPA_Status +end + +@checked function NVPW_RawMetricsConfig_GetNumPasses_V2(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_RawMetricsConfig_GetNumPasses_V2(pParams::Ptr{NVPW_RawMetricsConfig_GetNumPasses_V2_Params})::NVPA_Status +end + +@checked function NVPW_PeriodicSampler_Config_GetSocEstimatedSampleSize(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_PeriodicSampler_Config_GetSocEstimatedSampleSize(pParams::Ptr{NVPW_PeriodicSampler_Config_GetSocEstimatedSampleSize_Params})::NVPA_Status +end + +@checked function NVPW_PeriodicSampler_Config_GetGpuEstimatedSampleSize(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_PeriodicSampler_Config_GetGpuEstimatedSampleSize(pParams::Ptr{NVPW_PeriodicSampler_Config_GetGpuEstimatedSampleSize_Params})::NVPA_Status +end + +@checked function NVPW_CounterDataBuilder_Create(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_CounterDataBuilder_Create(pParams::Ptr{NVPW_CounterDataBuilder_Create_Params})::NVPA_Status +end + +@checked function NVPW_CounterDataBuilder_Destroy(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_CounterDataBuilder_Destroy(pParams::Ptr{NVPW_CounterDataBuilder_Destroy_Params})::NVPA_Status +end + +@checked function NVPW_CounterDataBuilder_AddMetrics(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_CounterDataBuilder_AddMetrics(pParams::Ptr{NVPW_CounterDataBuilder_AddMetrics_Params})::NVPA_Status +end + +@checked function NVPW_CounterDataBuilder_GetCounterDataPrefix(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_CounterDataBuilder_GetCounterDataPrefix(pParams::Ptr{NVPW_CounterDataBuilder_GetCounterDataPrefix_Params})::NVPA_Status +end + +@cenum NVPA_MetricDetailLevel::UInt32 begin + NVPA_METRIC_DETAIL_LEVEL_INVALID = 0 + NVPA_METRIC_DETAIL_LEVEL_GPU = 1 + NVPA_METRIC_DETAIL_LEVEL_ALL = 2 + NVPA_METRIC_DETAIL_LEVEL_GPU_AND_LEAF_INSTANCES = 3 + NVPA_METRIC_DETAIL_LEVEL__COUNT = 4 +end + +@checked function NVPW_MetricsContext_Destroy(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsContext_Destroy(pParams::Ptr{NVPW_MetricsContext_Destroy_Params})::NVPA_Status +end + +@checked function NVPW_MetricsContext_RunScript(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsContext_RunScript(pParams::Ptr{NVPW_MetricsContext_RunScript_Params})::NVPA_Status +end + +@checked function NVPW_MetricsContext_ExecScript_Begin(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsContext_ExecScript_Begin(pParams::Ptr{NVPW_MetricsContext_ExecScript_Begin_Params})::NVPA_Status +end + +@checked function NVPW_MetricsContext_ExecScript_End(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsContext_ExecScript_End(pParams::Ptr{NVPW_MetricsContext_ExecScript_End_Params})::NVPA_Status +end + +@checked function NVPW_MetricsContext_GetCounterNames_Begin(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsContext_GetCounterNames_Begin(pParams::Ptr{NVPW_MetricsContext_GetCounterNames_Begin_Params})::NVPA_Status +end + +@checked function NVPW_MetricsContext_GetCounterNames_End(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsContext_GetCounterNames_End(pParams::Ptr{NVPW_MetricsContext_GetCounterNames_End_Params})::NVPA_Status +end + +@checked function NVPW_MetricsContext_GetThroughputNames_Begin(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsContext_GetThroughputNames_Begin(pParams::Ptr{NVPW_MetricsContext_GetThroughputNames_Begin_Params})::NVPA_Status +end + +@checked function NVPW_MetricsContext_GetThroughputNames_End(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsContext_GetThroughputNames_End(pParams::Ptr{NVPW_MetricsContext_GetThroughputNames_End_Params})::NVPA_Status +end + +@checked function NVPW_MetricsContext_GetRatioNames_Begin(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsContext_GetRatioNames_Begin(pParams::Ptr{NVPW_MetricsContext_GetRatioNames_Begin_Params})::NVPA_Status +end + +@checked function NVPW_MetricsContext_GetRatioNames_End(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsContext_GetRatioNames_End(pParams::Ptr{NVPW_MetricsContext_GetRatioNames_End_Params})::NVPA_Status +end + +@checked function NVPW_MetricsContext_GetMetricNames_Begin(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsContext_GetMetricNames_Begin(pParams::Ptr{NVPW_MetricsContext_GetMetricNames_Begin_Params})::NVPA_Status +end + +@checked function NVPW_MetricsContext_GetMetricNames_End(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsContext_GetMetricNames_End(pParams::Ptr{NVPW_MetricsContext_GetMetricNames_End_Params})::NVPA_Status +end + +@checked function NVPW_MetricsContext_GetThroughputBreakdown_Begin(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsContext_GetThroughputBreakdown_Begin(pParams::Ptr{NVPW_MetricsContext_GetThroughputBreakdown_Begin_Params})::NVPA_Status +end + +@checked function NVPW_MetricsContext_GetThroughputBreakdown_End(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsContext_GetThroughputBreakdown_End(pParams::Ptr{NVPW_MetricsContext_GetThroughputBreakdown_End_Params})::NVPA_Status +end + +@checked function NVPW_MetricsContext_GetMetricProperties_Begin(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsContext_GetMetricProperties_Begin(pParams::Ptr{NVPW_MetricsContext_GetMetricProperties_Begin_Params})::NVPA_Status +end + +@checked function NVPW_MetricsContext_GetMetricProperties_End(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsContext_GetMetricProperties_End(pParams::Ptr{NVPW_MetricsContext_GetMetricProperties_End_Params})::NVPA_Status +end + +@checked function NVPW_MetricsContext_SetCounterData(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsContext_SetCounterData(pParams::Ptr{NVPW_MetricsContext_SetCounterData_Params})::NVPA_Status +end + +@checked function NVPW_MetricsContext_SetUserData(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsContext_SetUserData(pParams::Ptr{NVPW_MetricsContext_SetUserData_Params})::NVPA_Status +end + +@checked function NVPW_MetricsContext_EvaluateToGpuValues(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsContext_EvaluateToGpuValues(pParams::Ptr{NVPW_MetricsContext_EvaluateToGpuValues_Params})::NVPA_Status +end + +@checked function NVPW_MetricsContext_GetMetricSuffix_Begin(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsContext_GetMetricSuffix_Begin(pParams::Ptr{NVPW_MetricsContext_GetMetricSuffix_Begin_Params})::NVPA_Status +end + +@checked function NVPW_MetricsContext_GetMetricSuffix_End(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsContext_GetMetricSuffix_End(pParams::Ptr{NVPW_MetricsContext_GetMetricSuffix_End_Params})::NVPA_Status +end + +@checked function NVPW_MetricsContext_GetMetricBaseNames_Begin(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsContext_GetMetricBaseNames_Begin(pParams::Ptr{NVPW_MetricsContext_GetMetricBaseNames_Begin_Params})::NVPA_Status +end + +@checked function NVPW_MetricsContext_GetMetricBaseNames_End(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsContext_GetMetricBaseNames_End(pParams::Ptr{NVPW_MetricsContext_GetMetricBaseNames_End_Params})::NVPA_Status +end + +@cenum NVPW_DimUnitName::UInt32 begin + NVPW_DIM_UNIT_INVALID = 0x00000000d1b4fc15 + NVPW_DIM_UNIT_UNITLESS = 2126137902 + NVPW_DIM_UNIT_ATTRIBUTES = 0x00000000e1165b29 + NVPW_DIM_UNIT_BYTES = 0x00000000e25e984f + NVPW_DIM_UNIT_CTAS = 1960564139 + NVPW_DIM_UNIT_DRAM_CYCLES = 0x000000009e02c3cf + NVPW_DIM_UNIT_FBP_CYCLES = 1785238957 + NVPW_DIM_UNIT_FE_OPS = 0x00000000adfed52b + NVPW_DIM_UNIT_GPC_CYCLES = 1222631184 + NVPW_DIM_UNIT_IDC_REQUESTS = 2012649669 + NVPW_DIM_UNIT_INSTRUCTIONS = 1418625543 + NVPW_DIM_UNIT_KILOBYTES = 1335980302 + NVPW_DIM_UNIT_L1DATA_BANK_ACCESSES = 1479493682 + NVPW_DIM_UNIT_L1DATA_BANK_CONFLICTS = 0x00000000cca20763 + NVPW_DIM_UNIT_L1TEX_REQUESTS = 1306473767 + NVPW_DIM_UNIT_L1TEX_TAGS = 26573010 + NVPW_DIM_UNIT_L1TEX_WAVEFRONTS = 129373765 + NVPW_DIM_UNIT_L2_REQUESTS = 1143695106 + NVPW_DIM_UNIT_L2_SECTORS = 0x00000000cc17a4bc + NVPW_DIM_UNIT_L2_TAGS = 0x00000000dfda1a6d + NVPW_DIM_UNIT_NANOSECONDS = 0x00000000b5a52b80 + NVPW_DIM_UNIT_NVLRX_CYCLES = 0x00000000f1fdb0d2 + NVPW_DIM_UNIT_NVLTX_CYCLES = 1814350488 + NVPW_DIM_UNIT_PCIE_CYCLES = 1230450943 + NVPW_DIM_UNIT_PERCENT = 1284354694 + NVPW_DIM_UNIT_PIXELS = 0x00000000fbfc4f97 + NVPW_DIM_UNIT_PIXEL_SHADER_BARRIERS = 0x00000000dcdd7b36 + NVPW_DIM_UNIT_PRIMITIVES = 0x000000008d726362 + NVPW_DIM_UNIT_QUADS = 1539753497 + NVPW_DIM_UNIT_REGISTERS = 0x00000000a91d2a93 + NVPW_DIM_UNIT_SAMPLES = 746046551 + NVPW_DIM_UNIT_SECONDS = 1164825258 + NVPW_DIM_UNIT_SYS_CYCLES = 0x00000000c5572138 + NVPW_DIM_UNIT_TEXELS = 1293214069 + NVPW_DIM_UNIT_THREADS = 164261907 + NVPW_DIM_UNIT_VERTICES = 1873662209 + NVPW_DIM_UNIT_WARPS = 97951949 + NVPW_DIM_UNIT_WORKLOADS = 1728142656 +end + +@cenum NVPW_HwUnit::UInt32 begin + NVPW_HW_UNIT_INVALID = 0x00000000d07fc9f5 + NVPW_HW_UNIT_CROP = 0x00000000ab315876 + NVPW_HW_UNIT_DRAM = 1662616918 + NVPW_HW_UNIT_DRAMC = 1401232876 + NVPW_HW_UNIT_FBP = 0x00000000afaa9dc2 + NVPW_HW_UNIT_FBPA = 690045803 + NVPW_HW_UNIT_FE = 0x00000000836c79a1 + NVPW_HW_UNIT_GPC = 1911735839 + NVPW_HW_UNIT_GPU = 1014363534 + NVPW_HW_UNIT_GR = 0x00000000aedb7755 + NVPW_HW_UNIT_IDC = 842765289 + NVPW_HW_UNIT_L1TEX = 893940957 + NVPW_HW_UNIT_LTS = 0x000000008b12d309 + NVPW_HW_UNIT_NVLRX = 0x00000000b8475e25 + NVPW_HW_UNIT_NVLTX = 869679659 + NVPW_HW_UNIT_PCIE = 0x00000000cca3742e + NVPW_HW_UNIT_PDA = 345193251 + NVPW_HW_UNIT_PES = 804128425 + NVPW_HW_UNIT_PROP = 0x00000000c708fed3 + NVPW_HW_UNIT_RASTER = 187932504 + NVPW_HW_UNIT_SM = 724224710 + NVPW_HW_UNIT_SMSP = 0x00000000a9229915 + NVPW_HW_UNIT_SYS = 768990063 + NVPW_HW_UNIT_TPC = 1889024613 + NVPW_HW_UNIT_VAF = 753670509 + NVPW_HW_UNIT_VPC = 275561583 + NVPW_HW_UNIT_ZROP = 979500456 +end + +@cenum NVPW_RollupOp::UInt32 begin + NVPW_ROLLUP_OP_AVG = 0 + NVPW_ROLLUP_OP_MAX = 1 + NVPW_ROLLUP_OP_MIN = 2 + NVPW_ROLLUP_OP_SUM = 3 + NVPW_ROLLUP_OP__COUNT = 4 +end + +@cenum NVPW_MetricType::UInt32 begin + NVPW_METRIC_TYPE_COUNTER = 0 + NVPW_METRIC_TYPE_RATIO = 1 + NVPW_METRIC_TYPE_THROUGHPUT = 2 + NVPW_METRIC_TYPE__COUNT = 3 +end + +@cenum NVPW_Submetric::UInt32 begin + NVPW_SUBMETRIC_NONE = 0 + NVPW_SUBMETRIC_PEAK_SUSTAINED = 1 + NVPW_SUBMETRIC_PEAK_SUSTAINED_ACTIVE = 2 + NVPW_SUBMETRIC_PEAK_SUSTAINED_ACTIVE_PER_SECOND = 3 + NVPW_SUBMETRIC_PEAK_SUSTAINED_ELAPSED = 4 + NVPW_SUBMETRIC_PEAK_SUSTAINED_ELAPSED_PER_SECOND = 5 + NVPW_SUBMETRIC_PEAK_SUSTAINED_FRAME = 6 + NVPW_SUBMETRIC_PEAK_SUSTAINED_FRAME_PER_SECOND = 7 + NVPW_SUBMETRIC_PEAK_SUSTAINED_REGION = 8 + NVPW_SUBMETRIC_PEAK_SUSTAINED_REGION_PER_SECOND = 9 + NVPW_SUBMETRIC_PER_CYCLE_ACTIVE = 10 + NVPW_SUBMETRIC_PER_CYCLE_ELAPSED = 11 + NVPW_SUBMETRIC_PER_CYCLE_IN_FRAME = 12 + NVPW_SUBMETRIC_PER_CYCLE_IN_REGION = 13 + NVPW_SUBMETRIC_PER_SECOND = 14 + NVPW_SUBMETRIC_PCT_OF_PEAK_SUSTAINED_ACTIVE = 15 + NVPW_SUBMETRIC_PCT_OF_PEAK_SUSTAINED_ELAPSED = 16 + NVPW_SUBMETRIC_PCT_OF_PEAK_SUSTAINED_FRAME = 17 + NVPW_SUBMETRIC_PCT_OF_PEAK_SUSTAINED_REGION = 18 + NVPW_SUBMETRIC_MAX_RATE = 19 + NVPW_SUBMETRIC_PCT = 20 + NVPW_SUBMETRIC_RATIO = 21 + NVPW_SUBMETRIC__COUNT = 22 +end + +@checked function NVPW_MetricsEvaluator_Destroy(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsEvaluator_Destroy(pParams::Ptr{NVPW_MetricsEvaluator_Destroy_Params})::NVPA_Status +end + +@checked function NVPW_MetricsEvaluator_GetMetricNames(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsEvaluator_GetMetricNames(pParams::Ptr{NVPW_MetricsEvaluator_GetMetricNames_Params})::NVPA_Status +end + +@checked function NVPW_MetricsEvaluator_GetMetricTypeAndIndex(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsEvaluator_GetMetricTypeAndIndex(pParams::Ptr{NVPW_MetricsEvaluator_GetMetricTypeAndIndex_Params})::NVPA_Status +end + +@checked function NVPW_MetricsEvaluator_ConvertMetricNameToMetricEvalRequest(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsEvaluator_ConvertMetricNameToMetricEvalRequest(pParams::Ptr{NVPW_MetricsEvaluator_ConvertMetricNameToMetricEvalRequest_Params})::NVPA_Status +end + +@checked function NVPW_MetricsEvaluator_HwUnitToString(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsEvaluator_HwUnitToString(pParams::Ptr{NVPW_MetricsEvaluator_HwUnitToString_Params})::NVPA_Status +end + +@checked function NVPW_MetricsEvaluator_GetCounterProperties(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsEvaluator_GetCounterProperties(pParams::Ptr{NVPW_MetricsEvaluator_GetCounterProperties_Params})::NVPA_Status +end + +@checked function NVPW_MetricsEvaluator_GetRatioMetricProperties(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsEvaluator_GetRatioMetricProperties(pParams::Ptr{NVPW_MetricsEvaluator_GetRatioMetricProperties_Params})::NVPA_Status +end + +@checked function NVPW_MetricsEvaluator_GetThroughputMetricProperties(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsEvaluator_GetThroughputMetricProperties(pParams::Ptr{NVPW_MetricsEvaluator_GetThroughputMetricProperties_Params})::NVPA_Status +end + +@checked function NVPW_MetricsEvaluator_GetSupportedSubmetrics(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsEvaluator_GetSupportedSubmetrics(pParams::Ptr{NVPW_MetricsEvaluator_GetSupportedSubmetrics_Params})::NVPA_Status +end + +@checked function NVPW_MetricsEvaluator_GetMetricRawDependencies(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsEvaluator_GetMetricRawDependencies(pParams::Ptr{NVPW_MetricsEvaluator_GetMetricRawDependencies_Params})::NVPA_Status +end + +@checked function NVPW_MetricsEvaluator_DimUnitToString(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsEvaluator_DimUnitToString(pParams::Ptr{NVPW_MetricsEvaluator_DimUnitToString_Params})::NVPA_Status +end + +@checked function NVPW_MetricsEvaluator_GetMetricDimUnits(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsEvaluator_GetMetricDimUnits(pParams::Ptr{NVPW_MetricsEvaluator_GetMetricDimUnits_Params})::NVPA_Status +end + +@checked function NVPW_MetricsEvaluator_SetUserData(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsEvaluator_SetUserData(pParams::Ptr{NVPW_MetricsEvaluator_SetUserData_Params})::NVPA_Status +end + +@checked function NVPW_MetricsEvaluator_EvaluateToGpuValues(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsEvaluator_EvaluateToGpuValues(pParams::Ptr{NVPW_MetricsEvaluator_EvaluateToGpuValues_Params})::NVPA_Status +end + +@checked function NVPW_MetricsEvaluator_SetDeviceAttributes(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_MetricsEvaluator_SetDeviceAttributes(pParams::Ptr{NVPW_MetricsEvaluator_SetDeviceAttributes_Params})::NVPA_Status +end + +struct NVPW_CUDA_MetricsContext_Create_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pChipName::Cstring + pMetricsContext::Ptr{NVPA_MetricsContext} +end + +struct NVPW_CUDA_RawMetricsConfig_Create_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + activityKind::NVPA_ActivityKind + pChipName::Cstring + pRawMetricsConfig::Ptr{NVPA_RawMetricsConfig} +end + +struct NVPW_CUDA_RawMetricsConfig_Create_V2_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + activityKind::NVPA_ActivityKind + pChipName::Cstring + pCounterAvailabilityImage::Ptr{UInt8} + pRawMetricsConfig::Ptr{NVPA_RawMetricsConfig} +end + +struct NVPW_CUDA_CounterDataBuilder_Create_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pChipName::Cstring + pCounterAvailabilityImage::Ptr{UInt8} + pCounterDataBuilder::Ptr{NVPA_CounterDataBuilder} +end + +struct NVPW_CUDA_MetricsEvaluator_CalculateScratchBufferSize_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pChipName::Cstring + pCounterAvailabilityImage::Ptr{UInt8} + scratchBufferSize::Csize_t +end + +struct NVPW_CUDA_MetricsEvaluator_Initialize_Params + structSize::Csize_t + pPriv::Ptr{Cvoid} + pScratchBuffer::Ptr{UInt8} + scratchBufferSize::Csize_t + pChipName::Cstring + pCounterAvailabilityImage::Ptr{UInt8} + pCounterDataImage::Ptr{UInt8} + counterDataImageSize::Csize_t + pMetricsEvaluator::Ptr{NVPW_MetricsEvaluator} +end + +@checked function NVPW_CUDA_MetricsContext_Create(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_CUDA_MetricsContext_Create(pParams::Ptr{NVPW_CUDA_MetricsContext_Create_Params})::NVPA_Status +end + +@checked function NVPW_CUDA_RawMetricsConfig_Create(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_CUDA_RawMetricsConfig_Create(pParams::Ptr{NVPW_CUDA_RawMetricsConfig_Create_Params})::NVPA_Status +end + +@checked function NVPW_CUDA_RawMetricsConfig_Create_V2(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_CUDA_RawMetricsConfig_Create_V2(pParams::Ptr{NVPW_CUDA_RawMetricsConfig_Create_V2_Params})::NVPA_Status +end + +@checked function NVPW_CUDA_CounterDataBuilder_Create(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_CUDA_CounterDataBuilder_Create(pParams::Ptr{NVPW_CUDA_CounterDataBuilder_Create_Params})::NVPA_Status +end + +@checked function NVPW_CUDA_MetricsEvaluator_CalculateScratchBufferSize(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_CUDA_MetricsEvaluator_CalculateScratchBufferSize(pParams::Ptr{NVPW_CUDA_MetricsEvaluator_CalculateScratchBufferSize_Params})::NVPA_Status +end + +@checked function NVPW_CUDA_MetricsEvaluator_Initialize(pParams) + initialize_context() + @ccall libnvperf_host.NVPW_CUDA_MetricsEvaluator_Initialize(pParams::Ptr{NVPW_CUDA_MetricsEvaluator_Initialize_Params})::NVPA_Status +end + +const NVPW_SetLibraryLoadPaths_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_SetLibraryLoadPaths_Params, + ppPaths) + +const NVPW_SetLibraryLoadPathsW_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_SetLibraryLoadPathsW_Params, + ppwPaths) + +const NVPW_InitializeHost_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_InitializeHost_Params, + pPriv) + +const NVPW_CounterData_CalculateCounterDataImageCopySize_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_CounterData_CalculateCounterDataImageCopySize_Params, + copyDataImageCounterSize) + +const NVPW_CounterData_InitializeCounterDataImageCopy_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_CounterData_InitializeCounterDataImageCopy_Params, + pCounterDataDst) + +const NVPW_CounterDataCombiner_Create_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_CounterDataCombiner_Create_Params, + pCounterDataCombiner) + +const NVPW_CounterDataCombiner_Destroy_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_CounterDataCombiner_Destroy_Params, + pCounterDataCombiner) + +const NVPW_CounterDataCombiner_CreateRange_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_CounterDataCombiner_CreateRange_Params, + rangeIndexDst) + +const NVPW_CounterDataCombiner_CopyIntoRange_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_CounterDataCombiner_CopyIntoRange_Params, + rangeIndexSrc) + +const NVPW_CounterDataCombiner_AccumulateIntoRange_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_CounterDataCombiner_AccumulateIntoRange_Params, + srcMultiplier) + +const NVPW_CounterDataCombiner_SumIntoRange_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_CounterDataCombiner_SumIntoRange_Params, + rangeIndexSrc) + +const NVPW_CounterDataCombiner_WeightedSumIntoRange_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_CounterDataCombiner_WeightedSumIntoRange_Params, + srcMultiplier) + +const NVPA_RAW_METRIC_REQUEST_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPA_RawMetricRequest, + keepInstances) + +const NVPW_GetSupportedChipNames_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_GetSupportedChipNames_Params, + numChipNames) + +const NVPW_RawMetricsConfig_Destroy_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_RawMetricsConfig_Destroy_Params, + pRawMetricsConfig) + +const NVPW_RawMetricsConfig_SetCounterAvailability_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_RawMetricsConfig_SetCounterAvailability_Params, + pCounterAvailabilityImage) + +const NVPW_RawMetricsConfig_BeginPassGroup_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_RawMetricsConfig_BeginPassGroup_Params, + maxPassCount) + +const NVPW_RawMetricsConfig_EndPassGroup_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_RawMetricsConfig_EndPassGroup_Params, + pRawMetricsConfig) + +const NVPW_RawMetricsConfig_GetNumMetrics_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_RawMetricsConfig_GetNumMetrics_Params, + numMetrics) + +const NVPW_RawMetricsConfig_GetMetricProperties_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_RawMetricsConfig_GetMetricProperties_Params, + supportsIsolated) + +const NVPW_RawMetricsConfig_GetMetricProperties_V2_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_RawMetricsConfig_GetMetricProperties_V2_Params, + pMetricName) + +const NVPW_RawMetricsConfig_AddMetrics_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_RawMetricsConfig_AddMetrics_Params, + numMetricRequests) + +const NVPW_RawMetricsConfig_IsAddMetricsPossible_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_RawMetricsConfig_IsAddMetricsPossible_Params, + isPossible) + +const NVPW_RawMetricsConfig_GenerateConfigImage_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_RawMetricsConfig_GenerateConfigImage_Params, + mergeAllPassGroups) + +const NVPW_RawMetricsConfig_GetConfigImage_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_RawMetricsConfig_GetConfigImage_Params, + bytesCopied) + +const NVPW_RawMetricsConfig_GetNumPasses_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_RawMetricsConfig_GetNumPasses_Params, + numIsolatedPasses) + +const NVPW_RawMetricsConfig_GetNumPasses_V2_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_RawMetricsConfig_GetNumPasses_V2_Params, + numPasses) + +const NVPW_PeriodicSampler_Config_GetSocEstimatedSampleSize_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_PeriodicSampler_Config_GetSocEstimatedSampleSize_Params, + sampleSize) + +const NVPW_PeriodicSampler_Config_GetGpuEstimatedSampleSize_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_PeriodicSampler_Config_GetGpuEstimatedSampleSize_Params, + sampleSize) + +const NVPW_CounterDataBuilder_Create_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_CounterDataBuilder_Create_Params, + pChipName) + +const NVPW_CounterDataBuilder_Destroy_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_CounterDataBuilder_Destroy_Params, + pCounterDataBuilder) + +const NVPW_CounterDataBuilder_AddMetrics_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_CounterDataBuilder_AddMetrics_Params, + numMetricRequests) + +const NVPW_CounterDataBuilder_GetCounterDataPrefix_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_CounterDataBuilder_GetCounterDataPrefix_Params, + bytesCopied) + +const NVPW_MetricsContext_Destroy_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsContext_Destroy_Params, + pMetricsContext) + +const NVPW_MetricsContext_RunScript_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsContext_RunScript_Params, + pFileName) + +const NVPW_MetricsContext_ExecScript_Begin_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsContext_ExecScript_Begin_Params, + pResultStr) + +const NVPW_MetricsContext_ExecScript_End_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsContext_ExecScript_End_Params, + pMetricsContext) + +const NVPW_MetricsContext_GetCounterNames_Begin_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsContext_GetCounterNames_Begin_Params, + ppCounterNames) + +const NVPW_MetricsContext_GetCounterNames_End_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsContext_GetCounterNames_End_Params, + pMetricsContext) + +const NVPW_MetricsContext_GetThroughputNames_Begin_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsContext_GetThroughputNames_Begin_Params, + ppThroughputNames) + +const NVPW_MetricsContext_GetThroughputNames_End_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsContext_GetThroughputNames_End_Params, + pMetricsContext) + +const NVPW_MetricsContext_GetRatioNames_Begin_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsContext_GetRatioNames_Begin_Params, + ppRatioNames) + +const NVPW_MetricsContext_GetRatioNames_End_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsContext_GetRatioNames_End_Params, + pMetricsContext) + +const NVPW_MetricsContext_GetMetricNames_Begin_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsContext_GetMetricNames_Begin_Params, + hidePctOfPeakSubMetricsOnThroughputs) + +const NVPW_MetricsContext_GetMetricNames_End_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsContext_GetMetricNames_End_Params, + pMetricsContext) + +const NVPW_MetricsContext_GetThroughputBreakdown_Begin_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsContext_GetThroughputBreakdown_Begin_Params, + ppSubThroughputNames) + +const NVPW_MetricsContext_GetThroughputBreakdown_End_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsContext_GetThroughputBreakdown_End_Params, + pMetricsContext) + +const NVPW_MetricsContext_GetMetricProperties_Begin_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsContext_GetMetricProperties_Begin_Params, + ppOptionalRawMetricDependencies) + +const NVPW_MetricsContext_GetMetricProperties_End_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsContext_GetMetricProperties_End_Params, + pMetricsContext) + +const NVPW_MetricsContext_SetCounterData_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsContext_SetCounterData_Params, + isolated) + +const NVPW_MetricsContext_SetUserData_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsContext_SetUserData_Params, + regionDuration) + +const NVPW_MetricsContext_EvaluateToGpuValues_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsContext_EvaluateToGpuValues_Params, + pMetricValues) + +const NVPW_MetricsContext_GetMetricSuffix_Begin_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsContext_GetMetricSuffix_Begin_Params, + hidePctOfPeakSubMetricsOnThroughputs) + +const NVPW_MetricsContext_GetMetricSuffix_End_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsContext_GetMetricSuffix_End_Params, + pMetricsContext) + +const NVPW_MetricsContext_GetMetricBaseNames_Begin_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsContext_GetMetricBaseNames_Begin_Params, + ppMetricBaseNames) + +const NVPW_MetricsContext_GetMetricBaseNames_End_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsContext_GetMetricBaseNames_End_Params, + pMetricsContext) + +const NVPW_MetricEvalRequest_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricEvalRequest, + submetric) + +const NVPW_DimUnitFactor_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_DimUnitFactor, exponent) + +const NVPW_MetricsEvaluator_Destroy_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsEvaluator_Destroy_Params, + pMetricsEvaluator) + +const NVPW_MetricsEvaluator_GetMetricNames_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsEvaluator_GetMetricNames_Params, + numMetrics) + +const NVPW_MetricsEvaluator_GetMetricTypeAndIndex_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsEvaluator_GetMetricTypeAndIndex_Params, + metricIndex) + +const NVPW_MetricsEvaluator_ConvertMetricNameToMetricEvalRequest_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsEvaluator_ConvertMetricNameToMetricEvalRequest_Params, + metricEvalRequestStructSize) + +const NVPW_MetricsEvaluator_HwUnitToString_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsEvaluator_HwUnitToString_Params, + pHwUnitName) + +const NVPW_MetricsEvaluator_GetCounterProperties_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsEvaluator_GetCounterProperties_Params, + hwUnit) + +const NVPW_MetricsEvaluator_GetRatioMetricProperties_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsEvaluator_GetRatioMetricProperties_Params, + hwUnit) + +const NVPW_MetricsEvaluator_GetThroughputMetricProperties_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsEvaluator_GetThroughputMetricProperties_Params, + pSubThroughputIndices) + +const NVPW_MetricsEvaluator_GetSupportedSubmetrics_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsEvaluator_GetSupportedSubmetrics_Params, + numSupportedSubmetrics) + +const NVPW_MetricsEvaluator_GetMetricRawDependencies_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsEvaluator_GetMetricRawDependencies_Params, + numOptionalRawDependencies) + +const NVPW_MetricsEvaluator_DimUnitToString_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsEvaluator_DimUnitToString_Params, + pPluralName) + +const NVPW_MetricsEvaluator_GetMetricDimUnits_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsEvaluator_GetMetricDimUnits_Params, + dimUnitFactorStructSize) + +const NVPW_MetricsEvaluator_SetUserData_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsEvaluator_SetUserData_Params, + isolated) + +const NVPW_MetricsEvaluator_EvaluateToGpuValues_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsEvaluator_EvaluateToGpuValues_Params, + pMetricValues) + +const NVPW_MetricsEvaluator_SetDeviceAttributes_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_MetricsEvaluator_SetDeviceAttributes_Params, + counterDataImageSize) + +const NVPW_CUDA_MetricsContext_Create_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_CUDA_MetricsContext_Create_Params, + pMetricsContext) + +const NVPW_CUDA_RawMetricsConfig_Create_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_CUDA_RawMetricsConfig_Create_Params, + pRawMetricsConfig) + +const NVPW_CUDA_RawMetricsConfig_Create_V2_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_CUDA_RawMetricsConfig_Create_V2_Params, + pRawMetricsConfig) + +const NVPW_CUDA_CounterDataBuilder_Create_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_CUDA_CounterDataBuilder_Create_Params, + pCounterDataBuilder) + +const NVPW_CUDA_MetricsEvaluator_CalculateScratchBufferSize_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_CUDA_MetricsEvaluator_CalculateScratchBufferSize_Params, + scratchBufferSize) + +const NVPW_CUDA_MetricsEvaluator_Initialize_Params_STRUCT_SIZE = @NVPA_STRUCT_SIZE(NVPW_CUDA_MetricsEvaluator_Initialize_Params, + pMetricsEvaluator) diff --git a/lib/nvperf/wrappers.jl b/lib/nvperf/wrappers.jl new file mode 100644 index 0000000000..91cfe1ac27 --- /dev/null +++ b/lib/nvperf/wrappers.jl @@ -0,0 +1,17 @@ +function initialize() + params = Ref(NVPW_InitializeHost_Params(NVPW_InitializeHost_Params_STRUCT_SIZE, C_NULL)) + NVPW_InitializeHost(params) +end + +function supported_chips() + params = Ref(NVPW_GetSupportedChipNames_Params( + NVPW_GetSupportedChipNames_Params_STRUCT_SIZE, + C_NULL, C_NULL, 0)) + NVPW_GetSupportedChipNames(params) + + names = String[] + for i in params[].numChipNames + push!(names, Base.unsafe_string(Base.unsafe_load(params[].ppChipNames, i))) + end + return names +end diff --git a/lib/utils/APIUtils.jl b/lib/utils/APIUtils.jl index eb1adcc7f0..420ddce8aa 100644 --- a/lib/utils/APIUtils.jl +++ b/lib/utils/APIUtils.jl @@ -11,5 +11,6 @@ include("enum.jl") include("threading.jl") include("cache.jl") include("memoization.jl") +include("struct_size.jl") end diff --git a/lib/utils/struct_size.jl b/lib/utils/struct_size.jl new file mode 100644 index 0000000000..5fb8239950 --- /dev/null +++ b/lib/utils/struct_size.jl @@ -0,0 +1,11 @@ +export struct_size + +Base.@pure function find_field(::Type{T}, fieldname) where T + findfirst(f->f === fieldname, fieldnames(T)) +end + +function struct_size(type, lastfield) + field = find_field(type, lastfield) + @assert field !== nothing + fieldoffset(type, field) + sizeof(fieldtype(type, field)) +end \ No newline at end of file diff --git a/res/wrap/README.md b/res/wrap/README.md index 879c75d7dd..a373ea79c3 100644 --- a/res/wrap/README.md +++ b/res/wrap/README.md @@ -19,7 +19,7 @@ project environment). You can also call `main(library)` if you want to generate the wrapper for a specific `library`. The possible values for `library` are `"all"` (default), `"cuda"`, `"nvml"`, `"cupti"`, `"cublas"`, `"cufft"`, `"curand"`, `"cusparse"`, `"cusolver"`, `"cudnn"`, `"cutensor"`, -`"cutensornet"` or `"custatevec"`. +`"nvperf_host"`, `"cutensornet"` or `"custatevec"`. For each library, the script performs the following steps: diff --git a/res/wrap/cupti.toml b/res/wrap/cupti.toml index 6ebf3cdb94..8f56839c95 100644 --- a/res/wrap/cupti.toml +++ b/res/wrap/cupti.toml @@ -4,8 +4,6 @@ output_file_path = "../../lib/cupti/libcupti.jl" prologue_file_path = "./libcupti_prologue.jl" output_ignorelist = [ - # unexpanded macro (TODO: expand during rewrite?) - ".*_STRUCT_SIZE$", # these change often "^CUPTI_API_VERSION$", ] diff --git a/res/wrap/libcupti_prologue.jl b/res/wrap/libcupti_prologue.jl index 12dbac0180..bb043407fa 100644 --- a/res/wrap/libcupti_prologue.jl +++ b/res/wrap/libcupti_prologue.jl @@ -25,3 +25,11 @@ macro check(ex, errs...) nothing end end + +macro CUPTI_PROFILER_STRUCT_SIZE(type, lastfield) + type = esc(type) + lastfield = QuoteNode(lastfield) + quote + $struct_size($type, $lastfield) + end +end \ No newline at end of file diff --git a/res/wrap/libnvperf_host_prologue.jl b/res/wrap/libnvperf_host_prologue.jl new file mode 100644 index 0000000000..79fb8ce809 --- /dev/null +++ b/res/wrap/libnvperf_host_prologue.jl @@ -0,0 +1,23 @@ +# outlined functionality to avoid GC frame allocation +@noinline function throw_api_error(res) + throw(NVPAError(res)) +end + +macro check(ex, errs...) + quote + res = $(esc(ex)) + if res != NVPA_STATUS_SUCCESS + throw_api_error(res) + end + + nothing + end +end + +macro NVPA_STRUCT_SIZE(type, lastfield) + type = esc(type) + lastfield = QuoteNode(lastfield) + quote + $struct_size($type, $lastfield) + end +end \ No newline at end of file diff --git a/res/wrap/nvperf_host.toml b/res/wrap/nvperf_host.toml new file mode 100644 index 0000000000..1e577a440e --- /dev/null +++ b/res/wrap/nvperf_host.toml @@ -0,0 +1,18 @@ +[general] +library_name = "libnvperf_host" +output_file_path = "../../lib/nvperf/libnvperf_host.jl" +prologue_file_path = "./libnvperf_host_prologue.jl" + +output_ignorelist = [ + "NVPA_STRUCT_SIZE" +] + + +[codegen] +use_ccall_macro = true +always_NUL_terminated_string = true + + +[api] +checked_rettypes = [ "NVPA_Status" ] +needs_context = false \ No newline at end of file diff --git a/res/wrap/wrap.jl b/res/wrap/wrap.jl index acb1b6f171..40f9f23c1a 100644 --- a/res/wrap/wrap.jl +++ b/res/wrap/wrap.jl @@ -102,6 +102,14 @@ function rewriter!(ctx, options) end if Meta.isexpr(expr, :(=)) lhs, rhs = expr.args + if rhs isa Expr && rhs.head == :call + name = string(rhs.args[1]) + if endswith(name, "STRUCT_SIZE") + rhs.head = :macrocall + rhs.args[1] = Symbol("@", name) + insert!(rhs.args, 2, nothing) + end + end isa(lhs, Symbol) || continue if Meta.isexpr(rhs, :call) && rhs.args[1] in (:__CUDA_API_PTDS, :__CUDA_API_PTSZ) rhs = rhs.args[2] @@ -209,6 +217,14 @@ function main(name="all") targets=[r"cupti_.*.h"]) end + if name == "all" || name == "nvperf_host" + nvperf_host = joinpath(CUDA_full_jll.artifact_dir, "cuda", "extras", "CUPTI", "include") + + wrap("nvperf_host", ["$nvperf_host/nvperf_common.h", "$nvperf_host/nvperf_host.h", "$nvperf_host/nvperf_cuda_host.h"]; + include_dirs=[cuda, nvperf_host], + targets=[r"nvperf_.*.h"]) + end + if name == "all" || name == "cublas" wrap("cublas", ["$cuda/cublas_v2.h", "$cuda/cublasXt.h"]; targets=[r"cublas.*.h"], diff --git a/src/CUDA.jl b/src/CUDA.jl index b394f5d32d..8325ffa200 100644 --- a/src/CUDA.jl +++ b/src/CUDA.jl @@ -64,7 +64,8 @@ include("array.jl") # compiler libraries include("../lib/cupti/CUPTI.jl") -export CUPTI +include("../lib/nvperf/NVPERF.jl") +export CUPTI, NVPERF # compiler implementation include("compiler/compilation.jl")