From d9d8fe122d7dbf1c9319706e2f72cf45218f55b0 Mon Sep 17 00:00:00 2001 From: Clemens Lutz Date: Thu, 4 Mar 2021 17:13:25 +0100 Subject: [PATCH 1/3] Tell bindgen to use `usize` in place of `size_t` --- cublas-sys/bindgen.sh | 1 + cuda-driver-sys/bindgen.sh | 1 + cuda-runtime-sys/bindgen.sh | 1 + 3 files changed, 3 insertions(+) mode change 100755 => 100644 cublas-sys/bindgen.sh mode change 100755 => 100644 cuda-driver-sys/bindgen.sh mode change 100755 => 100644 cuda-runtime-sys/bindgen.sh diff --git a/cublas-sys/bindgen.sh b/cublas-sys/bindgen.sh old mode 100755 new mode 100644 index cb1b5b0..987cf76 --- a/cublas-sys/bindgen.sh +++ b/cublas-sys/bindgen.sh @@ -12,4 +12,5 @@ bindgen \ --with-derive-ord \ /opt/cuda/include/cublas.h \ -- -I/opt/cuda/include \ + --size_t-is-usize \ > src/cublas.rs diff --git a/cuda-driver-sys/bindgen.sh b/cuda-driver-sys/bindgen.sh old mode 100755 new mode 100644 index 2b06303..a12aef3 --- a/cuda-driver-sys/bindgen.sh +++ b/cuda-driver-sys/bindgen.sh @@ -17,4 +17,5 @@ bindgen \ --with-derive-hash \ --with-derive-ord \ wrapper.h -- -I/opt/cuda/include \ + --size_t-is-usize \ > src/cuda.rs diff --git a/cuda-runtime-sys/bindgen.sh b/cuda-runtime-sys/bindgen.sh old mode 100755 new mode 100644 index e2e7d1e..26996c9 --- a/cuda-runtime-sys/bindgen.sh +++ b/cuda-runtime-sys/bindgen.sh @@ -14,4 +14,5 @@ bindgen \ --with-derive-hash \ --with-derive-ord \ /opt/cuda/include/cuda_runtime.h \ + --size_t-is-usize \ > src/cuda_runtime.rs From 64a72e5dc56d9e830ddc31059b64315eb137c81b Mon Sep 17 00:00:00 2001 From: Clemens Lutz Date: Thu, 4 Mar 2021 17:14:43 +0100 Subject: [PATCH 2/3] Specify header paths for bindgen with `$CUDA_PATH` environment variable --- cublas-sys/bindgen.sh | 4 ++-- cuda-driver-sys/bindgen.sh | 2 +- cuda-runtime-sys/bindgen.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) mode change 100644 => 100755 cublas-sys/bindgen.sh mode change 100644 => 100755 cuda-driver-sys/bindgen.sh mode change 100644 => 100755 cuda-runtime-sys/bindgen.sh diff --git a/cublas-sys/bindgen.sh b/cublas-sys/bindgen.sh old mode 100644 new mode 100755 index 987cf76..9b1c2be --- a/cublas-sys/bindgen.sh +++ b/cublas-sys/bindgen.sh @@ -10,7 +10,7 @@ bindgen \ --with-derive-eq \ --with-derive-hash \ --with-derive-ord \ - /opt/cuda/include/cublas.h \ - -- -I/opt/cuda/include \ --size_t-is-usize \ + "$CUDA_PATH/include/cublas.h" \ + -- -I"$CUDA_PATH/include" \ > src/cublas.rs diff --git a/cuda-driver-sys/bindgen.sh b/cuda-driver-sys/bindgen.sh old mode 100644 new mode 100755 index a12aef3..77f731e --- a/cuda-driver-sys/bindgen.sh +++ b/cuda-driver-sys/bindgen.sh @@ -16,6 +16,6 @@ bindgen \ --with-derive-eq \ --with-derive-hash \ --with-derive-ord \ - wrapper.h -- -I/opt/cuda/include \ --size_t-is-usize \ + wrapper.h -- -I"$CUDA_PATH/include" \ > src/cuda.rs diff --git a/cuda-runtime-sys/bindgen.sh b/cuda-runtime-sys/bindgen.sh old mode 100644 new mode 100755 index 26996c9..4904441 --- a/cuda-runtime-sys/bindgen.sh +++ b/cuda-runtime-sys/bindgen.sh @@ -13,6 +13,6 @@ bindgen \ --with-derive-eq \ --with-derive-hash \ --with-derive-ord \ - /opt/cuda/include/cuda_runtime.h \ --size_t-is-usize \ + "$CUDA_PATH/include/cuda_runtime.h" \ > src/cuda_runtime.rs From 89567d5ca4a46ea549c1cdd6488a45382cd578e0 Mon Sep 17 00:00:00 2001 From: Clemens Lutz Date: Thu, 4 Mar 2021 17:15:50 +0100 Subject: [PATCH 3/3] Regenerate based on CUDA 11.2 --- cublas-sys/src/cublas.rs | 47 +- cuda-driver-sys/src/cuda.rs | 2032 +++++++++++++++++++++++--- cuda-runtime-sys/src/cuda_runtime.rs | 1398 +++++++++++++++++- 3 files changed, 3212 insertions(+), 265 deletions(-) diff --git a/cublas-sys/src/cublas.rs b/cublas-sys/src/cublas.rs index 63c09a0..99fc365 100644 --- a/cublas-sys/src/cublas.rs +++ b/cublas-sys/src/cublas.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen */ +/* automatically generated by rust-bindgen 0.55.1 */ #[repr(C)] #[repr(align(8))] @@ -81,18 +81,32 @@ pub type cudaStream_t = *mut CUstream_st; pub enum cudaDataType_t { CUDA_R_16F = 2, CUDA_C_16F = 6, + CUDA_R_16BF = 14, + CUDA_C_16BF = 15, CUDA_R_32F = 0, CUDA_C_32F = 4, CUDA_R_64F = 1, CUDA_C_64F = 5, + CUDA_R_4I = 16, + CUDA_C_4I = 17, + CUDA_R_4U = 18, + CUDA_C_4U = 19, CUDA_R_8I = 3, CUDA_C_8I = 7, CUDA_R_8U = 8, CUDA_C_8U = 9, + CUDA_R_16I = 20, + CUDA_C_16I = 21, + CUDA_R_16U = 22, + CUDA_C_16U = 23, CUDA_R_32I = 10, CUDA_C_32I = 11, CUDA_R_32U = 12, CUDA_C_32U = 13, + CUDA_R_64I = 24, + CUDA_C_64I = 25, + CUDA_R_64U = 26, + CUDA_C_64U = 27, } pub use self::cudaDataType_t as cudaDataType; #[repr(u32)] @@ -220,8 +234,26 @@ pub enum cublasGemmAlgo_t { pub enum cublasMath_t { CUBLAS_DEFAULT_MATH = 0, CUBLAS_TENSOR_OP_MATH = 1, + CUBLAS_PEDANTIC_MATH = 2, + CUBLAS_TF32_TENSOR_OP_MATH = 3, + CUBLAS_MATH_DISALLOW_REDUCED_PRECISION_REDUCTION = 16, } pub use self::cudaDataType as cublasDataType_t; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub enum cublasComputeType_t { + CUBLAS_COMPUTE_16F = 64, + CUBLAS_COMPUTE_16F_PEDANTIC = 65, + CUBLAS_COMPUTE_32F = 68, + CUBLAS_COMPUTE_32F_PEDANTIC = 69, + CUBLAS_COMPUTE_32F_FAST_16F = 74, + CUBLAS_COMPUTE_32F_FAST_16BF = 75, + CUBLAS_COMPUTE_32F_FAST_TF32 = 77, + CUBLAS_COMPUTE_64F = 70, + CUBLAS_COMPUTE_64F_PEDANTIC = 71, + CUBLAS_COMPUTE_32I = 72, + CUBLAS_COMPUTE_32I_PEDANTIC = 73, +} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cublasContext { @@ -249,6 +281,13 @@ extern "C" { extern "C" { pub fn cublasGetCudartVersion() -> usize; } +extern "C" { + pub fn cublasSetWorkspace_v2( + handle: cublasHandle_t, + workspace: *mut ::std::os::raw::c_void, + workspaceSizeInBytes: usize, + ) -> cublasStatus_t; +} extern "C" { pub fn cublasSetStream_v2(handle: cublasHandle_t, streamId: cudaStream_t) -> cublasStatus_t; } @@ -2280,7 +2319,7 @@ extern "C" { C: *mut ::std::os::raw::c_void, Ctype: cudaDataType, ldc: ::std::os::raw::c_int, - computeType: cudaDataType, + computeType: cublasComputeType_t, algo: cublasGemmAlgo_t, ) -> cublasStatus_t; } @@ -3042,7 +3081,7 @@ extern "C" { Ctype: cudaDataType, ldc: ::std::os::raw::c_int, batchCount: ::std::os::raw::c_int, - computeType: cudaDataType, + computeType: cublasComputeType_t, algo: cublasGemmAlgo_t, ) -> cublasStatus_t; } @@ -3069,7 +3108,7 @@ extern "C" { ldc: ::std::os::raw::c_int, strideC: ::std::os::raw::c_longlong, batchCount: ::std::os::raw::c_int, - computeType: cudaDataType, + computeType: cublasComputeType_t, algo: cublasGemmAlgo_t, ) -> cublasStatus_t; } diff --git a/cuda-driver-sys/src/cuda.rs b/cuda-driver-sys/src/cuda.rs index ef61be0..6877d25 100644 --- a/cuda-driver-sys/src/cuda.rs +++ b/cuda-driver-sys/src/cuda.rs @@ -1,6 +1,6 @@ -/* automatically generated by rust-bindgen */ +/* automatically generated by rust-bindgen 0.55.1 */ -pub const CUDA_VERSION: u32 = 10020; +pub const CUDA_VERSION: u32 = 11020; pub const CU_IPC_HANDLE_SIZE: u32 = 64; pub const CU_MEMHOSTALLOC_PORTABLE: u32 = 1; pub const CU_MEMHOSTALLOC_DEVICEMAP: u32 = 2; @@ -8,11 +8,14 @@ pub const CU_MEMHOSTALLOC_WRITECOMBINED: u32 = 4; pub const CU_MEMHOSTREGISTER_PORTABLE: u32 = 1; pub const CU_MEMHOSTREGISTER_DEVICEMAP: u32 = 2; pub const CU_MEMHOSTREGISTER_IOMEMORY: u32 = 4; +pub const CU_MEMHOSTREGISTER_READ_ONLY: u32 = 8; +pub const CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL: u32 = 1; pub const CUDA_EXTERNAL_MEMORY_DEDICATED: u32 = 1; pub const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_SKIP_NVSCIBUF_MEMSYNC: u32 = 1; pub const CUDA_EXTERNAL_SEMAPHORE_WAIT_SKIP_NVSCIBUF_MEMSYNC: u32 = 2; pub const CUDA_NVSCISYNC_ATTR_SIGNAL: u32 = 1; pub const CUDA_NVSCISYNC_ATTR_WAIT: u32 = 2; +pub const CU_MEM_CREATE_USAGE_TILE_POOL: u32 = 1; pub const CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_PRE_LAUNCH_SYNC: u32 = 1; pub const CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_POST_LAUNCH_SYNC: u32 = 2; pub const CUDA_ARRAY3D_LAYERED: u32 = 1; @@ -22,10 +25,12 @@ pub const CUDA_ARRAY3D_CUBEMAP: u32 = 4; pub const CUDA_ARRAY3D_TEXTURE_GATHER: u32 = 8; pub const CUDA_ARRAY3D_DEPTH_TEXTURE: u32 = 16; pub const CUDA_ARRAY3D_COLOR_ATTACHMENT: u32 = 32; +pub const CUDA_ARRAY3D_SPARSE: u32 = 64; pub const CU_TRSA_OVERRIDE_FORMAT: u32 = 1; pub const CU_TRSF_READ_AS_INTEGER: u32 = 1; pub const CU_TRSF_NORMALIZED_COORDINATES: u32 = 2; pub const CU_TRSF_SRGB: u32 = 16; +pub const CU_TRSF_DISABLE_TRILINEAR_OPTIMIZATION: u32 = 32; pub const CU_PARAM_TR_DEFAULT: i32 = -1; pub type __uint32_t = ::std::os::raw::c_uint; pub type __uint64_t = ::std::os::raw::c_ulong; @@ -199,6 +204,12 @@ pub struct CUgraphExec_st { } pub type CUgraphExec = *mut CUgraphExec_st; #[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CUmemPoolHandle_st { + _unused: [u8; 0], +} +pub type CUmemoryPool = *mut CUmemPoolHandle_st; +#[repr(C)] #[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] pub struct CUuuid_st { pub bytes: [::std::os::raw::c_char; 16usize], @@ -343,6 +354,20 @@ pub enum CUevent_flags_enum { pub use self::CUevent_flags_enum as CUevent_flags; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub enum CUevent_record_flags_enum { + CU_EVENT_RECORD_DEFAULT = 0, + CU_EVENT_RECORD_EXTERNAL = 1, +} +pub use self::CUevent_record_flags_enum as CUevent_record_flags; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub enum CUevent_wait_flags_enum { + CU_EVENT_WAIT_DEFAULT = 0, + CU_EVENT_WAIT_EXTERNAL = 1, +} +pub use self::CUevent_wait_flags_enum as CUevent_wait_flags; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] pub enum CUstreamWaitValue_flags_enum { CU_STREAM_WAIT_VALUE_GEQ = 0, CU_STREAM_WAIT_VALUE_EQ = 1, @@ -870,6 +895,7 @@ pub enum CUarray_format_enum { CU_AD_FORMAT_SIGNED_INT32 = 10, CU_AD_FORMAT_HALF = 16, CU_AD_FORMAT_FLOAT = 32, + CU_AD_FORMAT_NV12 = 176, } pub use self::CUarray_format_enum as CUarray_format; #[repr(u32)] @@ -908,6 +934,10 @@ impl CUdevice_attribute_enum { pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_NUMSLICES: CUdevice_attribute_enum = CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS; } +impl CUdevice_attribute_enum { + pub const CU_DEVICE_ATTRIBUTE_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED: CUdevice_attribute_enum = + CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_VIRTUAL_ADDRESS_MANAGEMENT_SUPPORTED; +} #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] pub enum CUdevice_attribute_enum { @@ -1016,7 +1046,17 @@ pub enum CUdevice_attribute_enum { CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR_SUPPORTED = 103, CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_WIN32_HANDLE_SUPPORTED = 104, CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_WIN32_KMT_HANDLE_SUPPORTED = 105, - CU_DEVICE_ATTRIBUTE_MAX = 106, + CU_DEVICE_ATTRIBUTE_MAX_BLOCKS_PER_MULTIPROCESSOR = 106, + CU_DEVICE_ATTRIBUTE_GENERIC_COMPRESSION_SUPPORTED = 107, + CU_DEVICE_ATTRIBUTE_MAX_PERSISTING_L2_CACHE_SIZE = 108, + CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE = 109, + CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WITH_CUDA_VMM_SUPPORTED = 110, + CU_DEVICE_ATTRIBUTE_RESERVED_SHARED_MEMORY_PER_BLOCK = 111, + CU_DEVICE_ATTRIBUTE_SPARSE_CUDA_ARRAY_SUPPORTED = 112, + CU_DEVICE_ATTRIBUTE_READ_ONLY_HOST_REGISTER_SUPPORTED = 113, + CU_DEVICE_ATTRIBUTE_TIMELINE_SEMAPHORE_INTEROP_SUPPORTED = 114, + CU_DEVICE_ATTRIBUTE_MEMORY_POOLS_SUPPORTED = 115, + CU_DEVICE_ATTRIBUTE_MAX = 116, } pub use self::CUdevice_attribute_enum as CUdevice_attribute; #[repr(C)] @@ -1166,6 +1206,8 @@ pub enum CUpointer_attribute_enum { CU_POINTER_ATTRIBUTE_RANGE_SIZE = 12, CU_POINTER_ATTRIBUTE_MAPPED = 13, CU_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES = 14, + CU_POINTER_ATTRIBUTE_IS_GPU_DIRECT_RDMA_CAPABLE = 15, + CU_POINTER_ATTRIBUTE_ACCESS_FLAGS = 16, } pub use self::CUpointer_attribute_enum as CUpointer_attribute; #[repr(u32)] @@ -1290,6 +1332,8 @@ pub enum CUjit_target_enum { CU_TARGET_COMPUTE_70 = 70, CU_TARGET_COMPUTE_72 = 72, CU_TARGET_COMPUTE_75 = 75, + CU_TARGET_COMPUTE_80 = 80, + CU_TARGET_COMPUTE_86 = 86, } pub use self::CUjit_target_enum as CUjit_target; #[repr(u32)] @@ -1362,7 +1406,8 @@ pub enum CUlimit_enum { CU_LIMIT_DEV_RUNTIME_SYNC_DEPTH = 3, CU_LIMIT_DEV_RUNTIME_PENDING_LAUNCH_COUNT = 4, CU_LIMIT_MAX_L2_FETCH_GRANULARITY = 5, - CU_LIMIT_MAX = 6, + CU_LIMIT_PERSISTING_L2_CACHE_SIZE = 6, + CU_LIMIT_MAX = 7, } pub use self::CUlimit_enum as CUlimit; #[repr(u32)] @@ -1376,6 +1421,100 @@ pub enum CUresourcetype_enum { pub use self::CUresourcetype_enum as CUresourcetype; pub type CUhostFn = ::std::option::Option; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub enum CUaccessProperty_enum { + CU_ACCESS_PROPERTY_NORMAL = 0, + CU_ACCESS_PROPERTY_STREAMING = 1, + CU_ACCESS_PROPERTY_PERSISTING = 2, +} +pub use self::CUaccessProperty_enum as CUaccessProperty; +#[repr(C)] +#[derive(Debug, Copy, Clone, PartialOrd, PartialEq)] +pub struct CUaccessPolicyWindow_st { + pub base_ptr: *mut ::std::os::raw::c_void, + pub num_bytes: usize, + pub hitRatio: f32, + pub hitProp: CUaccessProperty, + pub missProp: CUaccessProperty, +} +#[test] +fn bindgen_test_layout_CUaccessPolicyWindow_st() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(CUaccessPolicyWindow_st)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(CUaccessPolicyWindow_st)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).base_ptr as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(CUaccessPolicyWindow_st), + "::", + stringify!(base_ptr) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).num_bytes as *const _ as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CUaccessPolicyWindow_st), + "::", + stringify!(num_bytes) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).hitRatio as *const _ as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CUaccessPolicyWindow_st), + "::", + stringify!(hitRatio) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).hitProp as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CUaccessPolicyWindow_st), + "::", + stringify!(hitProp) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).missProp as *const _ as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CUaccessPolicyWindow_st), + "::", + stringify!(missProp) + ) + ); +} +impl Default for CUaccessPolicyWindow_st { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type CUaccessPolicyWindow = CUaccessPolicyWindow_st; #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] pub struct CUDA_KERNEL_NODE_PARAMS_st { @@ -1678,11 +1817,81 @@ pub enum CUgraphNodeType_enum { CU_GRAPH_NODE_TYPE_HOST = 3, CU_GRAPH_NODE_TYPE_GRAPH = 4, CU_GRAPH_NODE_TYPE_EMPTY = 5, - CU_GRAPH_NODE_TYPE_COUNT = 6, + CU_GRAPH_NODE_TYPE_WAIT_EVENT = 6, + CU_GRAPH_NODE_TYPE_EVENT_RECORD = 7, + CU_GRAPH_NODE_TYPE_EXT_SEMAS_SIGNAL = 8, + CU_GRAPH_NODE_TYPE_EXT_SEMAS_WAIT = 9, } pub use self::CUgraphNodeType_enum as CUgraphNodeType; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub enum CUsynchronizationPolicy_enum { + CU_SYNC_POLICY_AUTO = 1, + CU_SYNC_POLICY_SPIN = 2, + CU_SYNC_POLICY_YIELD = 3, + CU_SYNC_POLICY_BLOCKING_SYNC = 4, +} +pub use self::CUsynchronizationPolicy_enum as CUsynchronizationPolicy; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub enum CUkernelNodeAttrID_enum { + CU_KERNEL_NODE_ATTRIBUTE_ACCESS_POLICY_WINDOW = 1, + CU_KERNEL_NODE_ATTRIBUTE_COOPERATIVE = 2, +} +pub use self::CUkernelNodeAttrID_enum as CUkernelNodeAttrID; +#[repr(C)] +#[derive(Copy, Clone)] +pub union CUkernelNodeAttrValue_union { + pub accessPolicyWindow: CUaccessPolicyWindow, + pub cooperative: ::std::os::raw::c_int, + _bindgen_union_align: [u64; 4usize], +} +#[test] +fn bindgen_test_layout_CUkernelNodeAttrValue_union() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(CUkernelNodeAttrValue_union)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(CUkernelNodeAttrValue_union)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).accessPolicyWindow as *const _ + as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(CUkernelNodeAttrValue_union), + "::", + stringify!(accessPolicyWindow) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).cooperative as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(CUkernelNodeAttrValue_union), + "::", + stringify!(cooperative) + ) + ); +} +impl Default for CUkernelNodeAttrValue_union { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type CUkernelNodeAttrValue = CUkernelNodeAttrValue_union; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] pub enum CUstreamCaptureStatus_enum { CU_STREAM_CAPTURE_STATUS_NONE = 0, CU_STREAM_CAPTURE_STATUS_ACTIVE = 1, @@ -1699,6 +1908,64 @@ pub enum CUstreamCaptureMode_enum { pub use self::CUstreamCaptureMode_enum as CUstreamCaptureMode; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub enum CUstreamAttrID_enum { + CU_STREAM_ATTRIBUTE_ACCESS_POLICY_WINDOW = 1, + CU_STREAM_ATTRIBUTE_SYNCHRONIZATION_POLICY = 3, +} +pub use self::CUstreamAttrID_enum as CUstreamAttrID; +#[repr(C)] +#[derive(Copy, Clone)] +pub union CUstreamAttrValue_union { + pub accessPolicyWindow: CUaccessPolicyWindow, + pub syncPolicy: CUsynchronizationPolicy, + _bindgen_union_align: [u64; 4usize], +} +#[test] +fn bindgen_test_layout_CUstreamAttrValue_union() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(CUstreamAttrValue_union)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(CUstreamAttrValue_union)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).accessPolicyWindow as *const _ + as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(CUstreamAttrValue_union), + "::", + stringify!(accessPolicyWindow) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).syncPolicy as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(CUstreamAttrValue_union), + "::", + stringify!(syncPolicy) + ) + ); +} +impl Default for CUstreamAttrValue_union { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type CUstreamAttrValue = CUstreamAttrValue_union; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] pub enum cudaError_enum { CUDA_SUCCESS = 0, CUDA_ERROR_INVALID_VALUE = 1, @@ -1709,8 +1976,10 @@ pub enum cudaError_enum { CUDA_ERROR_PROFILER_NOT_INITIALIZED = 6, CUDA_ERROR_PROFILER_ALREADY_STARTED = 7, CUDA_ERROR_PROFILER_ALREADY_STOPPED = 8, + CUDA_ERROR_STUB_LIBRARY = 34, CUDA_ERROR_NO_DEVICE = 100, CUDA_ERROR_INVALID_DEVICE = 101, + CUDA_ERROR_DEVICE_NOT_LICENSED = 102, CUDA_ERROR_INVALID_IMAGE = 200, CUDA_ERROR_INVALID_CONTEXT = 201, CUDA_ERROR_CONTEXT_ALREADY_CURRENT = 202, @@ -1731,6 +2000,8 @@ pub enum cudaError_enum { CUDA_ERROR_INVALID_GRAPHICS_CONTEXT = 219, CUDA_ERROR_NVLINK_UNCORRECTABLE = 220, CUDA_ERROR_JIT_COMPILER_NOT_FOUND = 221, + CUDA_ERROR_UNSUPPORTED_PTX_VERSION = 222, + CUDA_ERROR_JIT_COMPILATION_DISABLED = 223, CUDA_ERROR_INVALID_SOURCE = 300, CUDA_ERROR_FILE_NOT_FOUND = 301, CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND = 302, @@ -2780,151 +3051,303 @@ impl Default for CUDA_ARRAY3D_DESCRIPTOR_st { } pub type CUDA_ARRAY3D_DESCRIPTOR = CUDA_ARRAY3D_DESCRIPTOR_st; #[repr(C)] -#[derive(Copy, Clone)] -pub struct CUDA_RESOURCE_DESC_st { - pub resType: CUresourcetype, - pub res: CUDA_RESOURCE_DESC_st__bindgen_ty_1, +#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +pub struct CUDA_ARRAY_SPARSE_PROPERTIES_st { + pub tileExtent: CUDA_ARRAY_SPARSE_PROPERTIES_st__bindgen_ty_1, + pub miptailFirstLevel: ::std::os::raw::c_uint, + pub miptailSize: ::std::os::raw::c_ulonglong, pub flags: ::std::os::raw::c_uint, + pub reserved: [::std::os::raw::c_uint; 4usize], } #[repr(C)] -#[derive(Copy, Clone)] -pub union CUDA_RESOURCE_DESC_st__bindgen_ty_1 { - pub array: CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_1, - pub mipmap: CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_2, - pub linear: CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_3, - pub pitch2D: CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_4, - pub reserved: CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_5, - _bindgen_union_align: [u64; 16usize], -} -#[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] -pub struct CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_1 { - pub hArray: CUarray, +#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +pub struct CUDA_ARRAY_SPARSE_PROPERTIES_st__bindgen_ty_1 { + pub width: ::std::os::raw::c_uint, + pub height: ::std::os::raw::c_uint, + pub depth: ::std::os::raw::c_uint, } #[test] -fn bindgen_test_layout_CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_1() { +fn bindgen_test_layout_CUDA_ARRAY_SPARSE_PROPERTIES_st__bindgen_ty_1() { assert_eq!( - ::std::mem::size_of::(), - 8usize, + ::std::mem::size_of::(), + 12usize, concat!( "Size of: ", - stringify!(CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_1) + stringify!(CUDA_ARRAY_SPARSE_PROPERTIES_st__bindgen_ty_1) ) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, + ::std::mem::align_of::(), + 4usize, concat!( "Alignment of ", - stringify!(CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_1) + stringify!(CUDA_ARRAY_SPARSE_PROPERTIES_st__bindgen_ty_1) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).hArray + &(*(::std::ptr::null::())).width as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_1), + stringify!(CUDA_ARRAY_SPARSE_PROPERTIES_st__bindgen_ty_1), "::", - stringify!(hArray) - ) - ); -} -impl Default for CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_1 { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] -pub struct CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_2 { - pub hMipmappedArray: CUmipmappedArray, -} -#[test] -fn bindgen_test_layout_CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_2() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_2) + stringify!(width) ) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, + unsafe { + &(*(::std::ptr::null::())).height + as *const _ as usize + }, + 4usize, concat!( - "Alignment of ", - stringify!(CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_2) + "Offset of field: ", + stringify!(CUDA_ARRAY_SPARSE_PROPERTIES_st__bindgen_ty_1), + "::", + stringify!(height) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())) - .hMipmappedArray as *const _ as usize + &(*(::std::ptr::null::())).depth + as *const _ as usize }, - 0usize, + 8usize, concat!( "Offset of field: ", - stringify!(CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_2), + stringify!(CUDA_ARRAY_SPARSE_PROPERTIES_st__bindgen_ty_1), "::", - stringify!(hMipmappedArray) + stringify!(depth) ) ); } -impl Default for CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_2 { - fn default() -> Self { - unsafe { ::std::mem::zeroed() } - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] -pub struct CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_3 { - pub devPtr: CUdeviceptr, - pub format: CUarray_format, - pub numChannels: ::std::os::raw::c_uint, - pub sizeInBytes: usize, -} #[test] -fn bindgen_test_layout_CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_3() { +fn bindgen_test_layout_CUDA_ARRAY_SPARSE_PROPERTIES_st() { assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!( - "Size of: ", - stringify!(CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_3) - ) + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(CUDA_ARRAY_SPARSE_PROPERTIES_st)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!( - "Alignment of ", - stringify!(CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_3) - ) + concat!("Alignment of ", stringify!(CUDA_ARRAY_SPARSE_PROPERTIES_st)) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).devPtr - as *const _ as usize + &(*(::std::ptr::null::())).tileExtent as *const _ + as usize }, 0usize, concat!( "Offset of field: ", - stringify!(CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_3), + stringify!(CUDA_ARRAY_SPARSE_PROPERTIES_st), "::", - stringify!(devPtr) + stringify!(tileExtent) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).format + &(*(::std::ptr::null::())).miptailFirstLevel as *const _ as usize }, - 8usize, + 12usize, + concat!( + "Offset of field: ", + stringify!(CUDA_ARRAY_SPARSE_PROPERTIES_st), + "::", + stringify!(miptailFirstLevel) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).miptailSize as *const _ + as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CUDA_ARRAY_SPARSE_PROPERTIES_st), + "::", + stringify!(miptailSize) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).flags as *const _ as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CUDA_ARRAY_SPARSE_PROPERTIES_st), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).reserved as *const _ + as usize + }, + 28usize, + concat!( + "Offset of field: ", + stringify!(CUDA_ARRAY_SPARSE_PROPERTIES_st), + "::", + stringify!(reserved) + ) + ); +} +pub type CUDA_ARRAY_SPARSE_PROPERTIES = CUDA_ARRAY_SPARSE_PROPERTIES_st; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct CUDA_RESOURCE_DESC_st { + pub resType: CUresourcetype, + pub res: CUDA_RESOURCE_DESC_st__bindgen_ty_1, + pub flags: ::std::os::raw::c_uint, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union CUDA_RESOURCE_DESC_st__bindgen_ty_1 { + pub array: CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_1, + pub mipmap: CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_2, + pub linear: CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_3, + pub pitch2D: CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_4, + pub reserved: CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_5, + _bindgen_union_align: [u64; 16usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +pub struct CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_1 { + pub hArray: CUarray, +} +#[test] +fn bindgen_test_layout_CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!( + "Size of: ", + stringify!(CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_1) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!( + "Alignment of ", + stringify!(CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).hArray + as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(hArray) + ) + ); +} +impl Default for CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_1 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +pub struct CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_2 { + pub hMipmappedArray: CUmipmappedArray, +} +#[test] +fn bindgen_test_layout_CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_2() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!( + "Size of: ", + stringify!(CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_2) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!( + "Alignment of ", + stringify!(CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_2) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())) + .hMipmappedArray as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_2), + "::", + stringify!(hMipmappedArray) + ) + ); +} +impl Default for CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_2 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +pub struct CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_3 { + pub devPtr: CUdeviceptr, + pub format: CUarray_format, + pub numChannels: ::std::os::raw::c_uint, + pub sizeInBytes: usize, +} +#[test] +fn bindgen_test_layout_CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_3() { + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!( + "Size of: ", + stringify!(CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_3) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!( + "Alignment of ", + stringify!(CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_3) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).devPtr + as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_3), + "::", + stringify!(devPtr) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).format + as *const _ as usize + }, + 8usize, concat!( "Offset of field: ", stringify!(CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_3), @@ -3631,6 +4054,14 @@ fn bindgen_test_layout_CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st() { ); } pub type CUDA_POINTER_ATTRIBUTE_P2P_TOKENS = CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub enum CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum { + CU_POINTER_ATTRIBUTE_ACCESS_FLAG_NONE = 0, + CU_POINTER_ATTRIBUTE_ACCESS_FLAG_READ = 1, + CU_POINTER_ATTRIBUTE_ACCESS_FLAG_READWRITE = 3, +} +pub use self::CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum as CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS; #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] pub struct CUDA_LAUNCH_PARAMS_st { @@ -4179,6 +4610,8 @@ pub enum CUexternalSemaphoreHandleType_enum { CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC = 6, CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX = 7, CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT = 8, + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD = 9, + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32 = 10, } pub use self::CUexternalSemaphoreHandleType_enum as CUexternalSemaphoreHandleType; #[repr(C)] @@ -5011,82 +5444,723 @@ impl Default for CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st { } } pub type CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS = CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st; -pub type CUmemGenericAllocationHandle = ::std::os::raw::c_ulonglong; -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] -pub enum CUmemAllocationHandleType_enum { - CU_MEM_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR = 1, - CU_MEM_HANDLE_TYPE_WIN32 = 2, - CU_MEM_HANDLE_TYPE_WIN32_KMT = 4, - CU_MEM_HANDLE_TYPE_MAX = 4294967295, -} -pub use self::CUmemAllocationHandleType_enum as CUmemAllocationHandleType; -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] -pub enum CUmemAccess_flags_enum { - CU_MEM_ACCESS_FLAGS_PROT_NONE = 0, - CU_MEM_ACCESS_FLAGS_PROT_READ = 1, - CU_MEM_ACCESS_FLAGS_PROT_READWRITE = 3, - CU_MEM_ACCESS_FLAGS_PROT_MAX = 4294967295, -} -pub use self::CUmemAccess_flags_enum as CUmemAccess_flags; -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] -pub enum CUmemLocationType_enum { - CU_MEM_LOCATION_TYPE_INVALID = 0, - CU_MEM_LOCATION_TYPE_DEVICE = 1, - CU_MEM_LOCATION_TYPE_MAX = 4294967295, -} -pub use self::CUmemLocationType_enum as CUmemLocationType; -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] -pub enum CUmemAllocationType_enum { - CU_MEM_ALLOCATION_TYPE_INVALID = 0, - CU_MEM_ALLOCATION_TYPE_PINNED = 1, - CU_MEM_ALLOCATION_TYPE_MAX = 4294967295, -} -pub use self::CUmemAllocationType_enum as CUmemAllocationType; -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] -pub enum CUmemAllocationGranularity_flags_enum { - CU_MEM_ALLOC_GRANULARITY_MINIMUM = 0, - CU_MEM_ALLOC_GRANULARITY_RECOMMENDED = 1, -} -pub use self::CUmemAllocationGranularity_flags_enum as CUmemAllocationGranularity_flags; #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] -pub struct CUmemLocation_st { - pub type_: CUmemLocationType, - pub id: ::std::os::raw::c_int, +pub struct CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st { + pub extSemArray: *mut CUexternalSemaphore, + pub paramsArray: *const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS, + pub numExtSems: ::std::os::raw::c_uint, } #[test] -fn bindgen_test_layout_CUmemLocation_st() { +fn bindgen_test_layout_CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st() { assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(CUmemLocation_st)) + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st)) ); assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(CUmemLocation_st)) + ::std::mem::align_of::(), + 8usize, + concat!( + "Alignment of ", + stringify!(CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st) + ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::())).extSemArray as *const _ + as usize + }, 0usize, concat!( "Offset of field: ", - stringify!(CUmemLocation_st), + stringify!(CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st), "::", - stringify!(type_) + stringify!(extSemArray) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).id as *const _ as usize }, - 4usize, + unsafe { + &(*(::std::ptr::null::())).paramsArray as *const _ + as usize + }, + 8usize, concat!( "Offset of field: ", - stringify!(CUmemLocation_st), + stringify!(CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st), + "::", + stringify!(paramsArray) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).numExtSems as *const _ + as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st), + "::", + stringify!(numExtSems) + ) + ); +} +impl Default for CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type CUDA_EXT_SEM_SIGNAL_NODE_PARAMS = CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st; +#[repr(C)] +#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +pub struct CUDA_EXT_SEM_WAIT_NODE_PARAMS_st { + pub extSemArray: *mut CUexternalSemaphore, + pub paramsArray: *const CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS, + pub numExtSems: ::std::os::raw::c_uint, +} +#[test] +fn bindgen_test_layout_CUDA_EXT_SEM_WAIT_NODE_PARAMS_st() { + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(CUDA_EXT_SEM_WAIT_NODE_PARAMS_st)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!( + "Alignment of ", + stringify!(CUDA_EXT_SEM_WAIT_NODE_PARAMS_st) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).extSemArray as *const _ + as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(CUDA_EXT_SEM_WAIT_NODE_PARAMS_st), + "::", + stringify!(extSemArray) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).paramsArray as *const _ + as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CUDA_EXT_SEM_WAIT_NODE_PARAMS_st), + "::", + stringify!(paramsArray) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).numExtSems as *const _ + as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CUDA_EXT_SEM_WAIT_NODE_PARAMS_st), + "::", + stringify!(numExtSems) + ) + ); +} +impl Default for CUDA_EXT_SEM_WAIT_NODE_PARAMS_st { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type CUDA_EXT_SEM_WAIT_NODE_PARAMS = CUDA_EXT_SEM_WAIT_NODE_PARAMS_st; +pub type CUmemGenericAllocationHandle = ::std::os::raw::c_ulonglong; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub enum CUmemAllocationHandleType_enum { + CU_MEM_HANDLE_TYPE_NONE = 0, + CU_MEM_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR = 1, + CU_MEM_HANDLE_TYPE_WIN32 = 2, + CU_MEM_HANDLE_TYPE_WIN32_KMT = 4, + CU_MEM_HANDLE_TYPE_MAX = 4294967295, +} +pub use self::CUmemAllocationHandleType_enum as CUmemAllocationHandleType; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub enum CUmemAccess_flags_enum { + CU_MEM_ACCESS_FLAGS_PROT_NONE = 0, + CU_MEM_ACCESS_FLAGS_PROT_READ = 1, + CU_MEM_ACCESS_FLAGS_PROT_READWRITE = 3, + CU_MEM_ACCESS_FLAGS_PROT_MAX = 4294967295, +} +pub use self::CUmemAccess_flags_enum as CUmemAccess_flags; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub enum CUmemLocationType_enum { + CU_MEM_LOCATION_TYPE_INVALID = 0, + CU_MEM_LOCATION_TYPE_DEVICE = 1, + CU_MEM_LOCATION_TYPE_MAX = 4294967295, +} +pub use self::CUmemLocationType_enum as CUmemLocationType; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub enum CUmemAllocationType_enum { + CU_MEM_ALLOCATION_TYPE_INVALID = 0, + CU_MEM_ALLOCATION_TYPE_PINNED = 1, + CU_MEM_ALLOCATION_TYPE_MAX = 4294967295, +} +pub use self::CUmemAllocationType_enum as CUmemAllocationType; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub enum CUmemAllocationGranularity_flags_enum { + CU_MEM_ALLOC_GRANULARITY_MINIMUM = 0, + CU_MEM_ALLOC_GRANULARITY_RECOMMENDED = 1, +} +pub use self::CUmemAllocationGranularity_flags_enum as CUmemAllocationGranularity_flags; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub enum CUarraySparseSubresourceType_enum { + CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_SPARSE_LEVEL = 0, + CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_MIPTAIL = 1, +} +pub use self::CUarraySparseSubresourceType_enum as CUarraySparseSubresourceType; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub enum CUmemOperationType_enum { + CU_MEM_OPERATION_TYPE_MAP = 1, + CU_MEM_OPERATION_TYPE_UNMAP = 2, +} +pub use self::CUmemOperationType_enum as CUmemOperationType; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub enum CUmemHandleType_enum { + CU_MEM_HANDLE_TYPE_GENERIC = 0, +} +pub use self::CUmemHandleType_enum as CUmemHandleType; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct CUarrayMapInfo_st { + pub resourceType: CUresourcetype, + pub resource: CUarrayMapInfo_st__bindgen_ty_1, + pub subresourceType: CUarraySparseSubresourceType, + pub subresource: CUarrayMapInfo_st__bindgen_ty_2, + pub memOperationType: CUmemOperationType, + pub memHandleType: CUmemHandleType, + pub memHandle: CUarrayMapInfo_st__bindgen_ty_3, + pub offset: ::std::os::raw::c_ulonglong, + pub deviceBitMask: ::std::os::raw::c_uint, + pub flags: ::std::os::raw::c_uint, + pub reserved: [::std::os::raw::c_uint; 2usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union CUarrayMapInfo_st__bindgen_ty_1 { + pub mipmap: CUmipmappedArray, + pub array: CUarray, + _bindgen_union_align: u64, +} +#[test] +fn bindgen_test_layout_CUarrayMapInfo_st__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(CUarrayMapInfo_st__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(CUarrayMapInfo_st__bindgen_ty_1)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).mipmap as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(CUarrayMapInfo_st__bindgen_ty_1), + "::", + stringify!(mipmap) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).array as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(CUarrayMapInfo_st__bindgen_ty_1), + "::", + stringify!(array) + ) + ); +} +impl Default for CUarrayMapInfo_st__bindgen_ty_1 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union CUarrayMapInfo_st__bindgen_ty_2 { + pub sparseLevel: CUarrayMapInfo_st__bindgen_ty_2__bindgen_ty_1, + pub miptail: CUarrayMapInfo_st__bindgen_ty_2__bindgen_ty_2, + _bindgen_union_align: [u64; 4usize], +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +pub struct CUarrayMapInfo_st__bindgen_ty_2__bindgen_ty_1 { + pub level: ::std::os::raw::c_uint, + pub layer: ::std::os::raw::c_uint, + pub offsetX: ::std::os::raw::c_uint, + pub offsetY: ::std::os::raw::c_uint, + pub offsetZ: ::std::os::raw::c_uint, + pub extentWidth: ::std::os::raw::c_uint, + pub extentHeight: ::std::os::raw::c_uint, + pub extentDepth: ::std::os::raw::c_uint, +} +#[test] +fn bindgen_test_layout_CUarrayMapInfo_st__bindgen_ty_2__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!( + "Size of: ", + stringify!(CUarrayMapInfo_st__bindgen_ty_2__bindgen_ty_1) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!( + "Alignment of ", + stringify!(CUarrayMapInfo_st__bindgen_ty_2__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).level + as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(CUarrayMapInfo_st__bindgen_ty_2__bindgen_ty_1), + "::", + stringify!(level) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).layer + as *const _ as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(CUarrayMapInfo_st__bindgen_ty_2__bindgen_ty_1), + "::", + stringify!(layer) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).offsetX + as *const _ as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CUarrayMapInfo_st__bindgen_ty_2__bindgen_ty_1), + "::", + stringify!(offsetX) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).offsetY + as *const _ as usize + }, + 12usize, + concat!( + "Offset of field: ", + stringify!(CUarrayMapInfo_st__bindgen_ty_2__bindgen_ty_1), + "::", + stringify!(offsetY) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).offsetZ + as *const _ as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CUarrayMapInfo_st__bindgen_ty_2__bindgen_ty_1), + "::", + stringify!(offsetZ) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).extentWidth + as *const _ as usize + }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CUarrayMapInfo_st__bindgen_ty_2__bindgen_ty_1), + "::", + stringify!(extentWidth) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).extentHeight + as *const _ as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CUarrayMapInfo_st__bindgen_ty_2__bindgen_ty_1), + "::", + stringify!(extentHeight) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).extentDepth + as *const _ as usize + }, + 28usize, + concat!( + "Offset of field: ", + stringify!(CUarrayMapInfo_st__bindgen_ty_2__bindgen_ty_1), + "::", + stringify!(extentDepth) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +pub struct CUarrayMapInfo_st__bindgen_ty_2__bindgen_ty_2 { + pub layer: ::std::os::raw::c_uint, + pub offset: ::std::os::raw::c_ulonglong, + pub size: ::std::os::raw::c_ulonglong, +} +#[test] +fn bindgen_test_layout_CUarrayMapInfo_st__bindgen_ty_2__bindgen_ty_2() { + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!( + "Size of: ", + stringify!(CUarrayMapInfo_st__bindgen_ty_2__bindgen_ty_2) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!( + "Alignment of ", + stringify!(CUarrayMapInfo_st__bindgen_ty_2__bindgen_ty_2) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).layer + as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(CUarrayMapInfo_st__bindgen_ty_2__bindgen_ty_2), + "::", + stringify!(layer) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).offset + as *const _ as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CUarrayMapInfo_st__bindgen_ty_2__bindgen_ty_2), + "::", + stringify!(offset) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).size + as *const _ as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CUarrayMapInfo_st__bindgen_ty_2__bindgen_ty_2), + "::", + stringify!(size) + ) + ); +} +#[test] +fn bindgen_test_layout_CUarrayMapInfo_st__bindgen_ty_2() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(CUarrayMapInfo_st__bindgen_ty_2)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(CUarrayMapInfo_st__bindgen_ty_2)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).sparseLevel as *const _ + as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(CUarrayMapInfo_st__bindgen_ty_2), + "::", + stringify!(sparseLevel) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).miptail as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(CUarrayMapInfo_st__bindgen_ty_2), + "::", + stringify!(miptail) + ) + ); +} +impl Default for CUarrayMapInfo_st__bindgen_ty_2 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union CUarrayMapInfo_st__bindgen_ty_3 { + pub memHandle: CUmemGenericAllocationHandle, + _bindgen_union_align: u64, +} +#[test] +fn bindgen_test_layout_CUarrayMapInfo_st__bindgen_ty_3() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(CUarrayMapInfo_st__bindgen_ty_3)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(CUarrayMapInfo_st__bindgen_ty_3)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).memHandle as *const _ + as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(CUarrayMapInfo_st__bindgen_ty_3), + "::", + stringify!(memHandle) + ) + ); +} +impl Default for CUarrayMapInfo_st__bindgen_ty_3 { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[test] +fn bindgen_test_layout_CUarrayMapInfo_st() { + assert_eq!( + ::std::mem::size_of::(), + 96usize, + concat!("Size of: ", stringify!(CUarrayMapInfo_st)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(CUarrayMapInfo_st)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).resourceType as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(CUarrayMapInfo_st), + "::", + stringify!(resourceType) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).resource as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CUarrayMapInfo_st), + "::", + stringify!(resource) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).subresourceType as *const _ as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CUarrayMapInfo_st), + "::", + stringify!(subresourceType) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).subresource as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CUarrayMapInfo_st), + "::", + stringify!(subresource) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).memOperationType as *const _ as usize + }, + 56usize, + concat!( + "Offset of field: ", + stringify!(CUarrayMapInfo_st), + "::", + stringify!(memOperationType) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).memHandleType as *const _ as usize }, + 60usize, + concat!( + "Offset of field: ", + stringify!(CUarrayMapInfo_st), + "::", + stringify!(memHandleType) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).memHandle as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CUarrayMapInfo_st), + "::", + stringify!(memHandle) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).offset as *const _ as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(CUarrayMapInfo_st), + "::", + stringify!(offset) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).deviceBitMask as *const _ as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(CUarrayMapInfo_st), + "::", + stringify!(deviceBitMask) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + 84usize, + concat!( + "Offset of field: ", + stringify!(CUarrayMapInfo_st), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reserved as *const _ as usize }, + 88usize, + concat!( + "Offset of field: ", + stringify!(CUarrayMapInfo_st), + "::", + stringify!(reserved) + ) + ); +} +impl Default for CUarrayMapInfo_st { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type CUarrayMapInfo = CUarrayMapInfo_st; +#[repr(C)] +#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +pub struct CUmemLocation_st { + pub type_: CUmemLocationType, + pub id: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_CUmemLocation_st() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(CUmemLocation_st)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(CUmemLocation_st)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(CUmemLocation_st), + "::", + stringify!(type_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).id as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(CUmemLocation_st), "::", stringify!(id) ) @@ -5098,6 +6172,13 @@ impl Default for CUmemLocation_st { } } pub type CUmemLocation = CUmemLocation_st; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub enum CUmemAllocationCompType_enum { + CU_MEM_ALLOCATION_COMP_NONE = 0, + CU_MEM_ALLOCATION_COMP_GENERIC = 1, +} +pub use self::CUmemAllocationCompType_enum as CUmemAllocationCompType; #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] pub struct CUmemAllocationProp_st { @@ -5105,7 +6186,86 @@ pub struct CUmemAllocationProp_st { pub requestedHandleTypes: CUmemAllocationHandleType, pub location: CUmemLocation, pub win32HandleMetaData: *mut ::std::os::raw::c_void, - pub reserved: ::std::os::raw::c_ulonglong, + pub allocFlags: CUmemAllocationProp_st__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +pub struct CUmemAllocationProp_st__bindgen_ty_1 { + pub compressionType: ::std::os::raw::c_uchar, + pub gpuDirectRDMACapable: ::std::os::raw::c_uchar, + pub usage: ::std::os::raw::c_ushort, + pub reserved: [::std::os::raw::c_uchar; 4usize], +} +#[test] +fn bindgen_test_layout_CUmemAllocationProp_st__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!( + "Size of: ", + stringify!(CUmemAllocationProp_st__bindgen_ty_1) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 2usize, + concat!( + "Alignment of ", + stringify!(CUmemAllocationProp_st__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).compressionType + as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(CUmemAllocationProp_st__bindgen_ty_1), + "::", + stringify!(compressionType) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).gpuDirectRDMACapable + as *const _ as usize + }, + 1usize, + concat!( + "Offset of field: ", + stringify!(CUmemAllocationProp_st__bindgen_ty_1), + "::", + stringify!(gpuDirectRDMACapable) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).usage as *const _ + as usize + }, + 2usize, + concat!( + "Offset of field: ", + stringify!(CUmemAllocationProp_st__bindgen_ty_1), + "::", + stringify!(usage) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).reserved as *const _ + as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(CUmemAllocationProp_st__bindgen_ty_1), + "::", + stringify!(reserved) + ) + ); } #[test] fn bindgen_test_layout_CUmemAllocationProp_st() { @@ -5117,128 +6277,257 @@ fn bindgen_test_layout_CUmemAllocationProp_st() { assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(CUmemAllocationProp_st)) + concat!("Alignment of ", stringify!(CUmemAllocationProp_st)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(CUmemAllocationProp_st), + "::", + stringify!(type_) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).requestedHandleTypes as *const _ + as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(CUmemAllocationProp_st), + "::", + stringify!(requestedHandleTypes) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).location as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CUmemAllocationProp_st), + "::", + stringify!(location) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).win32HandleMetaData as *const _ + as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CUmemAllocationProp_st), + "::", + stringify!(win32HandleMetaData) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).allocFlags as *const _ as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CUmemAllocationProp_st), + "::", + stringify!(allocFlags) + ) + ); +} +impl Default for CUmemAllocationProp_st { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type CUmemAllocationProp = CUmemAllocationProp_st; +#[repr(C)] +#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +pub struct CUmemAccessDesc_st { + pub location: CUmemLocation, + pub flags: CUmemAccess_flags, +} +#[test] +fn bindgen_test_layout_CUmemAccessDesc_st() { + assert_eq!( + ::std::mem::size_of::(), + 12usize, + concat!("Size of: ", stringify!(CUmemAccessDesc_st)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(CUmemAccessDesc_st)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).location as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(CUmemAccessDesc_st), + "::", + stringify!(location) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CUmemAccessDesc_st), + "::", + stringify!(flags) + ) + ); +} +impl Default for CUmemAccessDesc_st { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub type CUmemAccessDesc = CUmemAccessDesc_st; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub enum CUgraphExecUpdateResult_enum { + CU_GRAPH_EXEC_UPDATE_SUCCESS = 0, + CU_GRAPH_EXEC_UPDATE_ERROR = 1, + CU_GRAPH_EXEC_UPDATE_ERROR_TOPOLOGY_CHANGED = 2, + CU_GRAPH_EXEC_UPDATE_ERROR_NODE_TYPE_CHANGED = 3, + CU_GRAPH_EXEC_UPDATE_ERROR_FUNCTION_CHANGED = 4, + CU_GRAPH_EXEC_UPDATE_ERROR_PARAMETERS_CHANGED = 5, + CU_GRAPH_EXEC_UPDATE_ERROR_NOT_SUPPORTED = 6, + CU_GRAPH_EXEC_UPDATE_ERROR_UNSUPPORTED_FUNCTION_CHANGE = 7, +} +pub use self::CUgraphExecUpdateResult_enum as CUgraphExecUpdateResult; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub enum CUmemPool_attribute_enum { + CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES = 1, + CU_MEMPOOL_ATTR_REUSE_ALLOW_OPPORTUNISTIC = 2, + CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES = 3, + CU_MEMPOOL_ATTR_RELEASE_THRESHOLD = 4, +} +pub use self::CUmemPool_attribute_enum as CUmemPool_attribute; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct CUmemPoolProps_st { + pub allocType: CUmemAllocationType, + pub handleTypes: CUmemAllocationHandleType, + pub location: CUmemLocation, + pub win32SecurityAttributes: *mut ::std::os::raw::c_void, + pub reserved: [::std::os::raw::c_uchar; 64usize], +} +#[test] +fn bindgen_test_layout_CUmemPoolProps_st() { + assert_eq!( + ::std::mem::size_of::(), + 88usize, + concat!("Size of: ", stringify!(CUmemPoolProps_st)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(CUmemPoolProps_st)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).allocType as *const _ as usize }, 0usize, concat!( "Offset of field: ", - stringify!(CUmemAllocationProp_st), + stringify!(CUmemPoolProps_st), "::", - stringify!(type_) + stringify!(allocType) ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).requestedHandleTypes as *const _ - as usize - }, + unsafe { &(*(::std::ptr::null::())).handleTypes as *const _ as usize }, 4usize, concat!( "Offset of field: ", - stringify!(CUmemAllocationProp_st), + stringify!(CUmemPoolProps_st), "::", - stringify!(requestedHandleTypes) + stringify!(handleTypes) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).location as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).location as *const _ as usize }, 8usize, concat!( "Offset of field: ", - stringify!(CUmemAllocationProp_st), + stringify!(CUmemPoolProps_st), "::", stringify!(location) ) ); assert_eq!( unsafe { - &(*(::std::ptr::null::())).win32HandleMetaData as *const _ + &(*(::std::ptr::null::())).win32SecurityAttributes as *const _ as usize }, 16usize, concat!( "Offset of field: ", - stringify!(CUmemAllocationProp_st), + stringify!(CUmemPoolProps_st), "::", - stringify!(win32HandleMetaData) + stringify!(win32SecurityAttributes) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved as *const _ as usize }, + unsafe { &(*(::std::ptr::null::())).reserved as *const _ as usize }, 24usize, concat!( "Offset of field: ", - stringify!(CUmemAllocationProp_st), + stringify!(CUmemPoolProps_st), "::", stringify!(reserved) ) ); } -impl Default for CUmemAllocationProp_st { +impl Default for CUmemPoolProps_st { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } -pub type CUmemAllocationProp = CUmemAllocationProp_st; +pub type CUmemPoolProps = CUmemPoolProps_st; #[repr(C)] -#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] -pub struct CUmemAccessDesc_st { - pub location: CUmemLocation, - pub flags: CUmemAccess_flags, +#[derive(Copy, Clone)] +pub struct CUmemPoolPtrExportData_st { + pub reserved: [::std::os::raw::c_uchar; 64usize], } #[test] -fn bindgen_test_layout_CUmemAccessDesc_st() { +fn bindgen_test_layout_CUmemPoolPtrExportData_st() { assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(CUmemAccessDesc_st)) + ::std::mem::size_of::(), + 64usize, + concat!("Size of: ", stringify!(CUmemPoolPtrExportData_st)) ); assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(CUmemAccessDesc_st)) + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(CUmemPoolPtrExportData_st)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).location as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::())).reserved as *const _ as usize + }, 0usize, concat!( "Offset of field: ", - stringify!(CUmemAccessDesc_st), - "::", - stringify!(location) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CUmemAccessDesc_st), + stringify!(CUmemPoolPtrExportData_st), "::", - stringify!(flags) + stringify!(reserved) ) ); } -impl Default for CUmemAccessDesc_st { +impl Default for CUmemPoolPtrExportData_st { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } -pub type CUmemAccessDesc = CUmemAccessDesc_st; -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] -pub enum CUgraphExecUpdateResult_enum { - CU_GRAPH_EXEC_UPDATE_SUCCESS = 0, - CU_GRAPH_EXEC_UPDATE_ERROR = 1, - CU_GRAPH_EXEC_UPDATE_ERROR_TOPOLOGY_CHANGED = 2, - CU_GRAPH_EXEC_UPDATE_ERROR_NODE_TYPE_CHANGED = 3, - CU_GRAPH_EXEC_UPDATE_ERROR_FUNCTION_CHANGED = 4, - CU_GRAPH_EXEC_UPDATE_ERROR_PARAMETERS_CHANGED = 5, - CU_GRAPH_EXEC_UPDATE_ERROR_NOT_SUPPORTED = 6, -} -pub use self::CUgraphExecUpdateResult_enum as CUgraphExecUpdateResult; +pub type CUmemPoolPtrExportData = CUmemPoolPtrExportData_st; extern "C" { pub fn cuGetErrorString(error: CUresult, pStr: *mut *const ::std::os::raw::c_char) -> CUresult; } @@ -5267,9 +6556,24 @@ extern "C" { extern "C" { pub fn cuDeviceGetUuid(uuid: *mut CUuuid, dev: CUdevice) -> CUresult; } +extern "C" { + pub fn cuDeviceGetLuid( + luid: *mut ::std::os::raw::c_char, + deviceNodeMask: *mut ::std::os::raw::c_uint, + dev: CUdevice, + ) -> CUresult; +} extern "C" { pub fn cuDeviceTotalMem_v2(bytes: *mut usize, dev: CUdevice) -> CUresult; } +extern "C" { + pub fn cuDeviceGetTexture1DLinearMaxWidth( + maxWidthInElements: *mut usize, + format: CUarray_format, + numChannels: ::std::os::raw::c_uint, + dev: CUdevice, + ) -> CUresult; +} extern "C" { pub fn cuDeviceGetAttribute( pi: *mut ::std::os::raw::c_int, @@ -5284,6 +6588,15 @@ extern "C" { flags: ::std::os::raw::c_int, ) -> CUresult; } +extern "C" { + pub fn cuDeviceSetMemPool(dev: CUdevice, pool: CUmemoryPool) -> CUresult; +} +extern "C" { + pub fn cuDeviceGetMemPool(pool: *mut CUmemoryPool, dev: CUdevice) -> CUresult; +} +extern "C" { + pub fn cuDeviceGetDefaultMemPool(pool_out: *mut CUmemoryPool, dev: CUdevice) -> CUresult; +} extern "C" { pub fn cuDeviceGetProperties(prop: *mut CUdevprop, dev: CUdevice) -> CUresult; } @@ -5298,10 +6611,10 @@ extern "C" { pub fn cuDevicePrimaryCtxRetain(pctx: *mut CUcontext, dev: CUdevice) -> CUresult; } extern "C" { - pub fn cuDevicePrimaryCtxRelease(dev: CUdevice) -> CUresult; + pub fn cuDevicePrimaryCtxRelease_v2(dev: CUdevice) -> CUresult; } extern "C" { - pub fn cuDevicePrimaryCtxSetFlags(dev: CUdevice, flags: ::std::os::raw::c_uint) -> CUresult; + pub fn cuDevicePrimaryCtxSetFlags_v2(dev: CUdevice, flags: ::std::os::raw::c_uint) -> CUresult; } extern "C" { pub fn cuDevicePrimaryCtxGetState( @@ -5311,7 +6624,7 @@ extern "C" { ) -> CUresult; } extern "C" { - pub fn cuDevicePrimaryCtxReset(dev: CUdevice) -> CUresult; + pub fn cuDevicePrimaryCtxReset_v2(dev: CUdevice) -> CUresult; } extern "C" { pub fn cuCtxCreate_v2( @@ -5371,6 +6684,9 @@ extern "C" { greatestPriority: *mut ::std::os::raw::c_int, ) -> CUresult; } +extern "C" { + pub fn cuCtxResetPersistingL2Cache() -> CUresult; +} extern "C" { pub fn cuCtxAttach(pctx: *mut CUcontext, flags: ::std::os::raw::c_uint) -> CUresult; } @@ -5554,7 +6870,7 @@ extern "C" { pub fn cuIpcGetMemHandle(pHandle: *mut CUipcMemHandle, dptr: CUdeviceptr) -> CUresult; } extern "C" { - pub fn cuIpcOpenMemHandle( + pub fn cuIpcOpenMemHandle_v2( pdptr: *mut CUdeviceptr, handle: CUipcMemHandle, Flags: ::std::os::raw::c_uint, @@ -5836,6 +7152,25 @@ extern "C" { hArray: CUarray, ) -> CUresult; } +extern "C" { + pub fn cuArrayGetSparseProperties( + sparseProperties: *mut CUDA_ARRAY_SPARSE_PROPERTIES, + array: CUarray, + ) -> CUresult; +} +extern "C" { + pub fn cuMipmappedArrayGetSparseProperties( + sparseProperties: *mut CUDA_ARRAY_SPARSE_PROPERTIES, + mipmap: CUmipmappedArray, + ) -> CUresult; +} +extern "C" { + pub fn cuArrayGetPlane( + pPlaneArray: *mut CUarray, + hArray: CUarray, + planeIdx: ::std::os::raw::c_uint, + ) -> CUresult; +} extern "C" { pub fn cuArrayDestroy(hArray: CUarray) -> CUresult; } @@ -5900,6 +7235,13 @@ extern "C" { flags: ::std::os::raw::c_ulonglong, ) -> CUresult; } +extern "C" { + pub fn cuMemMapArrayAsync( + mapInfoList: *mut CUarrayMapInfo, + count: ::std::os::raw::c_uint, + hStream: CUstream, + ) -> CUresult; +} extern "C" { pub fn cuMemUnmap(ptr: CUdeviceptr, size: usize) -> CUresult; } @@ -5946,6 +7288,92 @@ extern "C" { handle: CUmemGenericAllocationHandle, ) -> CUresult; } +extern "C" { + pub fn cuMemRetainAllocationHandle( + handle: *mut CUmemGenericAllocationHandle, + addr: *mut ::std::os::raw::c_void, + ) -> CUresult; +} +extern "C" { + pub fn cuMemFreeAsync(dptr: CUdeviceptr, hStream: CUstream) -> CUresult; +} +extern "C" { + pub fn cuMemAllocAsync(dptr: *mut CUdeviceptr, bytesize: usize, hStream: CUstream) -> CUresult; +} +extern "C" { + pub fn cuMemPoolTrimTo(pool: CUmemoryPool, minBytesToKeep: usize) -> CUresult; +} +extern "C" { + pub fn cuMemPoolSetAttribute( + pool: CUmemoryPool, + attr: CUmemPool_attribute, + value: *mut ::std::os::raw::c_void, + ) -> CUresult; +} +extern "C" { + pub fn cuMemPoolGetAttribute( + pool: CUmemoryPool, + attr: CUmemPool_attribute, + value: *mut ::std::os::raw::c_void, + ) -> CUresult; +} +extern "C" { + pub fn cuMemPoolSetAccess( + pool: CUmemoryPool, + map: *const CUmemAccessDesc, + count: usize, + ) -> CUresult; +} +extern "C" { + pub fn cuMemPoolGetAccess( + flags: *mut CUmemAccess_flags, + memPool: CUmemoryPool, + location: *mut CUmemLocation, + ) -> CUresult; +} +extern "C" { + pub fn cuMemPoolCreate(pool: *mut CUmemoryPool, poolProps: *const CUmemPoolProps) -> CUresult; +} +extern "C" { + pub fn cuMemPoolDestroy(pool: CUmemoryPool) -> CUresult; +} +extern "C" { + pub fn cuMemAllocFromPoolAsync( + dptr: *mut CUdeviceptr, + bytesize: usize, + pool: CUmemoryPool, + hStream: CUstream, + ) -> CUresult; +} +extern "C" { + pub fn cuMemPoolExportToShareableHandle( + handle_out: *mut ::std::os::raw::c_void, + pool: CUmemoryPool, + handleType: CUmemAllocationHandleType, + flags: ::std::os::raw::c_ulonglong, + ) -> CUresult; +} +extern "C" { + pub fn cuMemPoolImportFromShareableHandle( + pool_out: *mut CUmemoryPool, + handle: *mut ::std::os::raw::c_void, + handleType: CUmemAllocationHandleType, + flags: ::std::os::raw::c_ulonglong, + ) -> CUresult; +} +extern "C" { + pub fn cuMemPoolExportPointer( + shareData_out: *mut CUmemPoolPtrExportData, + ptr: CUdeviceptr, + ) -> CUresult; +} +extern "C" { + pub fn cuMemPoolImportPointer( + ptr_out: *mut CUdeviceptr, + pool: CUmemoryPool, + shareData: *mut CUmemPoolPtrExportData, + ) -> CUresult; +} extern "C" { pub fn cuPointerGetAttribute( data: *mut ::std::os::raw::c_void, @@ -6077,12 +7505,36 @@ extern "C" { extern "C" { pub fn cuStreamDestroy_v2(hStream: CUstream) -> CUresult; } +extern "C" { + pub fn cuStreamCopyAttributes(dst: CUstream, src: CUstream) -> CUresult; +} +extern "C" { + pub fn cuStreamGetAttribute( + hStream: CUstream, + attr: CUstreamAttrID, + value_out: *mut CUstreamAttrValue, + ) -> CUresult; +} +extern "C" { + pub fn cuStreamSetAttribute( + hStream: CUstream, + attr: CUstreamAttrID, + value: *const CUstreamAttrValue, + ) -> CUresult; +} extern "C" { pub fn cuEventCreate(phEvent: *mut CUevent, Flags: ::std::os::raw::c_uint) -> CUresult; } extern "C" { pub fn cuEventRecord(hEvent: CUevent, hStream: CUstream) -> CUresult; } +extern "C" { + pub fn cuEventRecordWithFlags( + hEvent: CUevent, + hStream: CUstream, + flags: ::std::os::raw::c_uint, + ) -> CUresult; +} extern "C" { pub fn cuEventQuery(hEvent: CUevent) -> CUresult; } @@ -6412,6 +7864,78 @@ extern "C" { numDependencies: usize, ) -> CUresult; } +extern "C" { + pub fn cuGraphAddEventRecordNode( + phGraphNode: *mut CUgraphNode, + hGraph: CUgraph, + dependencies: *const CUgraphNode, + numDependencies: usize, + event: CUevent, + ) -> CUresult; +} +extern "C" { + pub fn cuGraphEventRecordNodeGetEvent(hNode: CUgraphNode, event_out: *mut CUevent) -> CUresult; +} +extern "C" { + pub fn cuGraphEventRecordNodeSetEvent(hNode: CUgraphNode, event: CUevent) -> CUresult; +} +extern "C" { + pub fn cuGraphAddEventWaitNode( + phGraphNode: *mut CUgraphNode, + hGraph: CUgraph, + dependencies: *const CUgraphNode, + numDependencies: usize, + event: CUevent, + ) -> CUresult; +} +extern "C" { + pub fn cuGraphEventWaitNodeGetEvent(hNode: CUgraphNode, event_out: *mut CUevent) -> CUresult; +} +extern "C" { + pub fn cuGraphEventWaitNodeSetEvent(hNode: CUgraphNode, event: CUevent) -> CUresult; +} +extern "C" { + pub fn cuGraphAddExternalSemaphoresSignalNode( + phGraphNode: *mut CUgraphNode, + hGraph: CUgraph, + dependencies: *const CUgraphNode, + numDependencies: usize, + nodeParams: *const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS, + ) -> CUresult; +} +extern "C" { + pub fn cuGraphExternalSemaphoresSignalNodeGetParams( + hNode: CUgraphNode, + params_out: *mut CUDA_EXT_SEM_SIGNAL_NODE_PARAMS, + ) -> CUresult; +} +extern "C" { + pub fn cuGraphExternalSemaphoresSignalNodeSetParams( + hNode: CUgraphNode, + nodeParams: *const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS, + ) -> CUresult; +} +extern "C" { + pub fn cuGraphAddExternalSemaphoresWaitNode( + phGraphNode: *mut CUgraphNode, + hGraph: CUgraph, + dependencies: *const CUgraphNode, + numDependencies: usize, + nodeParams: *const CUDA_EXT_SEM_WAIT_NODE_PARAMS, + ) -> CUresult; +} +extern "C" { + pub fn cuGraphExternalSemaphoresWaitNodeGetParams( + hNode: CUgraphNode, + params_out: *mut CUDA_EXT_SEM_WAIT_NODE_PARAMS, + ) -> CUresult; +} +extern "C" { + pub fn cuGraphExternalSemaphoresWaitNodeSetParams( + hNode: CUgraphNode, + nodeParams: *const CUDA_EXT_SEM_WAIT_NODE_PARAMS, + ) -> CUresult; +} extern "C" { pub fn cuGraphClone(phGraphClone: *mut CUgraph, originalGraph: CUgraph) -> CUresult; } @@ -6481,7 +8005,7 @@ extern "C" { pub fn cuGraphDestroyNode(hNode: CUgraphNode) -> CUresult; } extern "C" { - pub fn cuGraphInstantiate( + pub fn cuGraphInstantiate_v2( phGraphExec: *mut CUgraphExec, hGraph: CUgraph, phErrorNode: *mut CUgraphNode, @@ -6519,6 +8043,44 @@ extern "C" { nodeParams: *const CUDA_HOST_NODE_PARAMS, ) -> CUresult; } +extern "C" { + pub fn cuGraphExecChildGraphNodeSetParams( + hGraphExec: CUgraphExec, + hNode: CUgraphNode, + childGraph: CUgraph, + ) -> CUresult; +} +extern "C" { + pub fn cuGraphExecEventRecordNodeSetEvent( + hGraphExec: CUgraphExec, + hNode: CUgraphNode, + event: CUevent, + ) -> CUresult; +} +extern "C" { + pub fn cuGraphExecEventWaitNodeSetEvent( + hGraphExec: CUgraphExec, + hNode: CUgraphNode, + event: CUevent, + ) -> CUresult; +} +extern "C" { + pub fn cuGraphExecExternalSemaphoresSignalNodeSetParams( + hGraphExec: CUgraphExec, + hNode: CUgraphNode, + nodeParams: *const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS, + ) -> CUresult; +} +extern "C" { + pub fn cuGraphExecExternalSemaphoresWaitNodeSetParams( + hGraphExec: CUgraphExec, + hNode: CUgraphNode, + nodeParams: *const CUDA_EXT_SEM_WAIT_NODE_PARAMS, + ) -> CUresult; +} +extern "C" { + pub fn cuGraphUpload(hGraphExec: CUgraphExec, hStream: CUstream) -> CUresult; +} extern "C" { pub fn cuGraphLaunch(hGraphExec: CUgraphExec, hStream: CUstream) -> CUresult; } @@ -6536,6 +8098,23 @@ extern "C" { updateResult_out: *mut CUgraphExecUpdateResult, ) -> CUresult; } +extern "C" { + pub fn cuGraphKernelNodeCopyAttributes(dst: CUgraphNode, src: CUgraphNode) -> CUresult; +} +extern "C" { + pub fn cuGraphKernelNodeGetAttribute( + hNode: CUgraphNode, + attr: CUkernelNodeAttrID, + value_out: *mut CUkernelNodeAttrValue, + ) -> CUresult; +} +extern "C" { + pub fn cuGraphKernelNodeSetAttribute( + hNode: CUgraphNode, + attr: CUkernelNodeAttrID, + value: *const CUkernelNodeAttrValue, + ) -> CUresult; +} extern "C" { pub fn cuOccupancyMaxActiveBlocksPerMultiprocessor( numBlocks: *mut ::std::os::raw::c_int, @@ -6574,6 +8153,14 @@ extern "C" { flags: ::std::os::raw::c_uint, ) -> CUresult; } +extern "C" { + pub fn cuOccupancyAvailableDynamicSMemPerBlock( + dynamicSmemSize: *mut usize, + func: CUfunction, + numBlocks: ::std::os::raw::c_int, + blockSize: ::std::os::raw::c_int, + ) -> CUresult; +} extern "C" { pub fn cuTexRefSetArray( hTexRef: CUtexref, @@ -6832,6 +8419,9 @@ extern "C" { pExportTableId: *const CUuuid, ) -> CUresult; } +extern "C" { + pub fn cuFuncGetModule(hmod: *mut CUmodule, hfunc: CUfunction) -> CUresult; +} #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] pub enum CUoutput_mode_enum { @@ -6857,18 +8447,32 @@ extern "C" { pub enum cudaDataType_t { CUDA_R_16F = 2, CUDA_C_16F = 6, + CUDA_R_16BF = 14, + CUDA_C_16BF = 15, CUDA_R_32F = 0, CUDA_C_32F = 4, CUDA_R_64F = 1, CUDA_C_64F = 5, + CUDA_R_4I = 16, + CUDA_C_4I = 17, + CUDA_R_4U = 18, + CUDA_C_4U = 19, CUDA_R_8I = 3, CUDA_C_8I = 7, CUDA_R_8U = 8, CUDA_C_8U = 9, + CUDA_R_16I = 20, + CUDA_C_16I = 21, + CUDA_R_16U = 22, + CUDA_C_16U = 23, CUDA_R_32I = 10, CUDA_C_32I = 11, CUDA_R_32U = 12, CUDA_C_32U = 13, + CUDA_R_64I = 24, + CUDA_C_64I = 25, + CUDA_R_64U = 26, + CUDA_C_64U = 27, } pub use self::cudaDataType_t as cudaDataType; #[repr(u32)] diff --git a/cuda-runtime-sys/src/cuda_runtime.rs b/cuda-runtime-sys/src/cuda_runtime.rs index c87fc04..4e55dea 100644 --- a/cuda-runtime-sys/src/cuda_runtime.rs +++ b/cuda-runtime-sys/src/cuda_runtime.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen */ +/* automatically generated by rust-bindgen 0.55.1 */ pub const cudaHostAllocDefault: u32 = 0; pub const cudaHostAllocPortable: u32 = 1; @@ -8,6 +8,7 @@ pub const cudaHostRegisterDefault: u32 = 0; pub const cudaHostRegisterPortable: u32 = 1; pub const cudaHostRegisterMapped: u32 = 2; pub const cudaHostRegisterIoMemory: u32 = 4; +pub const cudaHostRegisterReadOnly: u32 = 8; pub const cudaPeerAccessDefault: u32 = 0; pub const cudaStreamDefault: u32 = 0; pub const cudaStreamNonBlocking: u32 = 1; @@ -15,6 +16,10 @@ pub const cudaEventDefault: u32 = 0; pub const cudaEventBlockingSync: u32 = 1; pub const cudaEventDisableTiming: u32 = 2; pub const cudaEventInterprocess: u32 = 4; +pub const cudaEventRecordDefault: u32 = 0; +pub const cudaEventRecordExternal: u32 = 1; +pub const cudaEventWaitDefault: u32 = 0; +pub const cudaEventWaitExternal: u32 = 1; pub const cudaDeviceScheduleAuto: u32 = 0; pub const cudaDeviceScheduleSpin: u32 = 1; pub const cudaDeviceScheduleYield: u32 = 2; @@ -30,6 +35,7 @@ pub const cudaArraySurfaceLoadStore: u32 = 2; pub const cudaArrayCubemap: u32 = 4; pub const cudaArrayTextureGather: u32 = 8; pub const cudaArrayColorAttachment: u32 = 32; +pub const cudaArraySparse: u32 = 64; pub const cudaIpcMemLazyEnablePeerAccess: u32 = 1; pub const cudaMemAttachGlobal: u32 = 1; pub const cudaMemAttachHost: u32 = 2; @@ -38,6 +44,7 @@ pub const cudaOccupancyDefault: u32 = 0; pub const cudaOccupancyDisableCachingOverride: u32 = 1; pub const cudaCooperativeLaunchMultiDeviceNoPreSync: u32 = 1; pub const cudaCooperativeLaunchMultiDeviceNoPostSync: u32 = 2; +pub const cudaArraySparsePropertiesSingleMipTail: u32 = 1; pub const cudaExternalMemoryDedicated: u32 = 1; pub const cudaExternalSemaphoreSignalSkipNvSciBufMemSync: u32 = 1; pub const cudaExternalSemaphoreWaitSkipNvSciBufMemSync: u32 = 2; @@ -130,7 +137,9 @@ pub enum cudaError { cudaErrorMixedDeviceExecution = 28, cudaErrorNotYetImplemented = 31, cudaErrorMemoryValueTooLarge = 32, + cudaErrorStubLibrary = 34, cudaErrorInsufficientDriver = 35, + cudaErrorCallRequiresNewerDriver = 36, cudaErrorInvalidSurface = 37, cudaErrorDuplicateVariableName = 43, cudaErrorDuplicateTextureName = 44, @@ -147,6 +156,8 @@ pub enum cudaError { cudaErrorInvalidDeviceFunction = 98, cudaErrorNoDevice = 100, cudaErrorInvalidDevice = 101, + cudaErrorDeviceNotLicensed = 102, + cudaErrorSoftwareValidityNotEstablished = 103, cudaErrorStartupFailure = 127, cudaErrorInvalidKernelImage = 200, cudaErrorDeviceUninitialized = 201, @@ -167,6 +178,8 @@ pub enum cudaError { cudaErrorInvalidGraphicsContext = 219, cudaErrorNvlinkUncorrectable = 220, cudaErrorJitCompilerNotFound = 221, + cudaErrorUnsupportedPtxVersion = 222, + cudaErrorJitCompilationDisabled = 223, cudaErrorInvalidSource = 300, cudaErrorFileNotFound = 301, cudaErrorSharedObjectSymbolNotFound = 302, @@ -221,6 +234,7 @@ pub enum cudaChannelFormatKind { cudaChannelFormatKindUnsigned = 1, cudaChannelFormatKindFloat = 2, cudaChannelFormatKindNone = 3, + cudaChannelFormatKindNV12 = 4, } #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] @@ -313,6 +327,152 @@ pub struct cudaMipmappedArray { } pub type cudaMipmappedArray_t = *mut cudaMipmappedArray; pub type cudaMipmappedArray_const_t = *const cudaMipmappedArray; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +pub struct cudaArraySparseProperties { + pub tileExtent: cudaArraySparseProperties__bindgen_ty_1, + pub miptailFirstLevel: ::std::os::raw::c_uint, + pub miptailSize: ::std::os::raw::c_ulonglong, + pub flags: ::std::os::raw::c_uint, + pub reserved: [::std::os::raw::c_uint; 4usize], +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +pub struct cudaArraySparseProperties__bindgen_ty_1 { + pub width: ::std::os::raw::c_uint, + pub height: ::std::os::raw::c_uint, + pub depth: ::std::os::raw::c_uint, +} +#[test] +fn bindgen_test_layout_cudaArraySparseProperties__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::(), + 12usize, + concat!( + "Size of: ", + stringify!(cudaArraySparseProperties__bindgen_ty_1) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!( + "Alignment of ", + stringify!(cudaArraySparseProperties__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).width as *const _ + as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(cudaArraySparseProperties__bindgen_ty_1), + "::", + stringify!(width) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).height as *const _ + as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(cudaArraySparseProperties__bindgen_ty_1), + "::", + stringify!(height) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).depth as *const _ + as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(cudaArraySparseProperties__bindgen_ty_1), + "::", + stringify!(depth) + ) + ); +} +#[test] +fn bindgen_test_layout_cudaArraySparseProperties() { + assert_eq!( + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(cudaArraySparseProperties)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(cudaArraySparseProperties)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).tileExtent as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(cudaArraySparseProperties), + "::", + stringify!(tileExtent) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).miptailFirstLevel as *const _ + as usize + }, + 12usize, + concat!( + "Offset of field: ", + stringify!(cudaArraySparseProperties), + "::", + stringify!(miptailFirstLevel) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).miptailSize as *const _ as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(cudaArraySparseProperties), + "::", + stringify!(miptailSize) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(cudaArraySparseProperties), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).reserved as *const _ as usize + }, + 28usize, + concat!( + "Offset of field: ", + stringify!(cudaArraySparseProperties), + "::", + stringify!(reserved) + ) + ); +} #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] pub enum cudaMemoryType { @@ -815,6 +975,92 @@ impl Default for cudaMemsetParams { unsafe { ::std::mem::zeroed() } } } +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub enum cudaAccessProperty { + cudaAccessPropertyNormal = 0, + cudaAccessPropertyStreaming = 1, + cudaAccessPropertyPersisting = 2, +} +#[repr(C)] +#[derive(Debug, Copy, Clone, PartialOrd, PartialEq)] +pub struct cudaAccessPolicyWindow { + pub base_ptr: *mut ::std::os::raw::c_void, + pub num_bytes: usize, + pub hitRatio: f32, + pub hitProp: cudaAccessProperty, + pub missProp: cudaAccessProperty, +} +#[test] +fn bindgen_test_layout_cudaAccessPolicyWindow() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(cudaAccessPolicyWindow)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(cudaAccessPolicyWindow)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).base_ptr as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(cudaAccessPolicyWindow), + "::", + stringify!(base_ptr) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).num_bytes as *const _ as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(cudaAccessPolicyWindow), + "::", + stringify!(num_bytes) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).hitRatio as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(cudaAccessPolicyWindow), + "::", + stringify!(hitRatio) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).hitProp as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(cudaAccessPolicyWindow), + "::", + stringify!(hitProp) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).missProp as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(cudaAccessPolicyWindow), + "::", + stringify!(missProp) + ) + ); +} +impl Default for cudaAccessPolicyWindow { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} pub type cudaHostFn_t = ::std::option::Option; #[repr(C)] @@ -875,6 +1121,67 @@ pub enum cudaStreamCaptureMode { cudaStreamCaptureModeThreadLocal = 1, cudaStreamCaptureModeRelaxed = 2, } +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub enum cudaSynchronizationPolicy { + cudaSyncPolicyAuto = 1, + cudaSyncPolicySpin = 2, + cudaSyncPolicyYield = 3, + cudaSyncPolicyBlockingSync = 4, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub enum cudaStreamAttrID { + cudaStreamAttributeAccessPolicyWindow = 1, + cudaStreamAttributeSynchronizationPolicy = 3, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union cudaStreamAttrValue { + pub accessPolicyWindow: cudaAccessPolicyWindow, + pub syncPolicy: cudaSynchronizationPolicy, + _bindgen_union_align: [u64; 4usize], +} +#[test] +fn bindgen_test_layout_cudaStreamAttrValue() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(cudaStreamAttrValue)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(cudaStreamAttrValue)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).accessPolicyWindow as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(cudaStreamAttrValue), + "::", + stringify!(accessPolicyWindow) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).syncPolicy as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(cudaStreamAttrValue), + "::", + stringify!(syncPolicy) + ) + ); +} +impl Default for cudaStreamAttrValue { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cudaGraphicsResource { @@ -908,6 +1215,62 @@ pub enum cudaGraphicsCubeFace { } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub enum cudaKernelNodeAttrID { + cudaKernelNodeAttributeAccessPolicyWindow = 1, + cudaKernelNodeAttributeCooperative = 2, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union cudaKernelNodeAttrValue { + pub accessPolicyWindow: cudaAccessPolicyWindow, + pub cooperative: ::std::os::raw::c_int, + _bindgen_union_align: [u64; 4usize], +} +#[test] +fn bindgen_test_layout_cudaKernelNodeAttrValue() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(cudaKernelNodeAttrValue)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(cudaKernelNodeAttrValue)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).accessPolicyWindow as *const _ + as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(cudaKernelNodeAttrValue), + "::", + stringify!(accessPolicyWindow) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).cooperative as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(cudaKernelNodeAttrValue), + "::", + stringify!(cooperative) + ) + ); +} +impl Default for cudaKernelNodeAttrValue { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] pub enum cudaResourceType { cudaResourceTypeArray = 0, cudaResourceTypeMipmappedArray = 1, @@ -1441,18 +1804,16 @@ impl Default for cudaResourceViewDesc { #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] pub struct cudaPointerAttributes { - pub memoryType: cudaMemoryType, pub type_: cudaMemoryType, pub device: ::std::os::raw::c_int, pub devicePointer: *mut ::std::os::raw::c_void, pub hostPointer: *mut ::std::os::raw::c_void, - pub isManaged: ::std::os::raw::c_int, } #[test] fn bindgen_test_layout_cudaPointerAttributes() { assert_eq!( ::std::mem::size_of::(), - 40usize, + 24usize, concat!("Size of: ", stringify!(cudaPointerAttributes)) ); assert_eq!( @@ -1460,21 +1821,9 @@ fn bindgen_test_layout_cudaPointerAttributes() { 8usize, concat!("Alignment of ", stringify!(cudaPointerAttributes)) ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).memoryType as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(cudaPointerAttributes), - "::", - stringify!(memoryType) - ) - ); assert_eq!( unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, - 4usize, + 0usize, concat!( "Offset of field: ", stringify!(cudaPointerAttributes), @@ -1484,7 +1833,7 @@ fn bindgen_test_layout_cudaPointerAttributes() { ); assert_eq!( unsafe { &(*(::std::ptr::null::())).device as *const _ as usize }, - 8usize, + 4usize, concat!( "Offset of field: ", stringify!(cudaPointerAttributes), @@ -1496,7 +1845,7 @@ fn bindgen_test_layout_cudaPointerAttributes() { unsafe { &(*(::std::ptr::null::())).devicePointer as *const _ as usize }, - 16usize, + 8usize, concat!( "Offset of field: ", stringify!(cudaPointerAttributes), @@ -1508,7 +1857,7 @@ fn bindgen_test_layout_cudaPointerAttributes() { unsafe { &(*(::std::ptr::null::())).hostPointer as *const _ as usize }, - 24usize, + 16usize, concat!( "Offset of field: ", stringify!(cudaPointerAttributes), @@ -1516,16 +1865,6 @@ fn bindgen_test_layout_cudaPointerAttributes() { stringify!(hostPointer) ) ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).isManaged as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(cudaPointerAttributes), - "::", - stringify!(isManaged) - ) - ); } impl Default for cudaPointerAttributes { fn default() -> Self { @@ -1721,6 +2060,7 @@ pub enum cudaLimit { cudaLimitDevRuntimeSyncDepth = 3, cudaLimitDevRuntimePendingLaunchCount = 4, cudaLimitMaxL2FetchGranularity = 5, + cudaLimitPersistingL2CacheSize = 6, } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] @@ -1849,6 +2189,251 @@ pub enum cudaDeviceAttr { cudaDevAttrHostRegisterSupported = 99, cudaDevAttrPageableMemoryAccessUsesHostPageTables = 100, cudaDevAttrDirectManagedMemAccessFromHost = 101, + cudaDevAttrMaxBlocksPerMultiprocessor = 106, + cudaDevAttrReservedSharedMemoryPerBlock = 111, + cudaDevAttrSparseCudaArraySupported = 112, + cudaDevAttrHostRegisterReadOnlySupported = 113, + cudaDevAttrMaxTimelineSemaphoreInteropSupported = 114, + cudaDevAttrMemoryPoolsSupported = 115, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub enum cudaMemPoolAttr { + cudaMemPoolReuseFollowEventDependencies = 1, + cudaMemPoolReuseAllowOpportunistic = 2, + cudaMemPoolReuseAllowInternalDependencies = 3, + cudaMemPoolAttrReleaseThreshold = 4, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub enum cudaMemLocationType { + cudaMemLocationTypeInvalid = 0, + cudaMemLocationTypeDevice = 1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +pub struct cudaMemLocation { + pub type_: cudaMemLocationType, + pub id: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_cudaMemLocation() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(cudaMemLocation)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(cudaMemLocation)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(cudaMemLocation), + "::", + stringify!(type_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).id as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(cudaMemLocation), + "::", + stringify!(id) + ) + ); +} +impl Default for cudaMemLocation { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub enum cudaMemAccessFlags { + cudaMemAccessFlagsProtNone = 0, + cudaMemAccessFlagsProtRead = 1, + cudaMemAccessFlagsProtReadWrite = 3, +} +#[repr(C)] +#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +pub struct cudaMemAccessDesc { + pub location: cudaMemLocation, + pub flags: cudaMemAccessFlags, +} +#[test] +fn bindgen_test_layout_cudaMemAccessDesc() { + assert_eq!( + ::std::mem::size_of::(), + 12usize, + concat!("Size of: ", stringify!(cudaMemAccessDesc)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(cudaMemAccessDesc)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).location as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(cudaMemAccessDesc), + "::", + stringify!(location) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(cudaMemAccessDesc), + "::", + stringify!(flags) + ) + ); +} +impl Default for cudaMemAccessDesc { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub enum cudaMemAllocationType { + cudaMemAllocationTypeInvalid = 0, + cudaMemAllocationTypePinned = 1, + cudaMemAllocationTypeMax = 4294967295, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub enum cudaMemAllocationHandleType { + cudaMemHandleTypeNone = 0, + cudaMemHandleTypePosixFileDescriptor = 1, + cudaMemHandleTypeWin32 = 2, + cudaMemHandleTypeWin32Kmt = 4, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct cudaMemPoolProps { + pub allocType: cudaMemAllocationType, + pub handleTypes: cudaMemAllocationHandleType, + pub location: cudaMemLocation, + pub win32SecurityAttributes: *mut ::std::os::raw::c_void, + pub reserved: [::std::os::raw::c_uchar; 64usize], +} +#[test] +fn bindgen_test_layout_cudaMemPoolProps() { + assert_eq!( + ::std::mem::size_of::(), + 88usize, + concat!("Size of: ", stringify!(cudaMemPoolProps)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(cudaMemPoolProps)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).allocType as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(cudaMemPoolProps), + "::", + stringify!(allocType) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).handleTypes as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(cudaMemPoolProps), + "::", + stringify!(handleTypes) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).location as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(cudaMemPoolProps), + "::", + stringify!(location) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).win32SecurityAttributes as *const _ + as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(cudaMemPoolProps), + "::", + stringify!(win32SecurityAttributes) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reserved as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(cudaMemPoolProps), + "::", + stringify!(reserved) + ) + ); +} +impl Default for cudaMemPoolProps { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct cudaMemPoolPtrExportData { + pub reserved: [::std::os::raw::c_uchar; 64usize], +} +#[test] +fn bindgen_test_layout_cudaMemPoolPtrExportData() { + assert_eq!( + ::std::mem::size_of::(), + 64usize, + concat!("Size of: ", stringify!(cudaMemPoolPtrExportData)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(cudaMemPoolPtrExportData)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).reserved as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(cudaMemPoolPtrExportData), + "::", + stringify!(reserved) + ) + ); +} +impl Default for cudaMemPoolPtrExportData { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] @@ -1946,6 +2531,7 @@ pub struct cudaDeviceProp { pub memoryClockRate: ::std::os::raw::c_int, pub memoryBusWidth: ::std::os::raw::c_int, pub l2CacheSize: ::std::os::raw::c_int, + pub persistingL2CacheMaxSize: ::std::os::raw::c_int, pub maxThreadsPerMultiProcessor: ::std::os::raw::c_int, pub streamPrioritiesSupported: ::std::os::raw::c_int, pub globalL1CacheSupported: ::std::os::raw::c_int, @@ -1966,12 +2552,15 @@ pub struct cudaDeviceProp { pub sharedMemPerBlockOptin: usize, pub pageableMemoryAccessUsesHostPageTables: ::std::os::raw::c_int, pub directManagedMemAccessFromHost: ::std::os::raw::c_int, + pub maxBlocksPerMultiProcessor: ::std::os::raw::c_int, + pub accessPolicyMaxWindowSize: ::std::os::raw::c_int, + pub reservedSharedMemPerBlock: usize, } #[test] fn bindgen_test_layout_cudaDeviceProp() { assert_eq!( ::std::mem::size_of::(), - 712usize, + 728usize, concat!("Size of: ", stringify!(cudaDeviceProp)) ); assert_eq!( @@ -2581,12 +3170,24 @@ fn bindgen_test_layout_cudaDeviceProp() { stringify!(l2CacheSize) ) ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).persistingL2CacheMaxSize as *const _ as usize + }, + 620usize, + concat!( + "Offset of field: ", + stringify!(cudaDeviceProp), + "::", + stringify!(persistingL2CacheMaxSize) + ) + ); assert_eq!( unsafe { &(*(::std::ptr::null::())).maxThreadsPerMultiProcessor as *const _ as usize }, - 620usize, + 624usize, concat!( "Offset of field: ", stringify!(cudaDeviceProp), @@ -2599,7 +3200,7 @@ fn bindgen_test_layout_cudaDeviceProp() { &(*(::std::ptr::null::())).streamPrioritiesSupported as *const _ as usize }, - 624usize, + 628usize, concat!( "Offset of field: ", stringify!(cudaDeviceProp), @@ -2611,7 +3212,7 @@ fn bindgen_test_layout_cudaDeviceProp() { unsafe { &(*(::std::ptr::null::())).globalL1CacheSupported as *const _ as usize }, - 628usize, + 632usize, concat!( "Offset of field: ", stringify!(cudaDeviceProp), @@ -2623,7 +3224,7 @@ fn bindgen_test_layout_cudaDeviceProp() { unsafe { &(*(::std::ptr::null::())).localL1CacheSupported as *const _ as usize }, - 632usize, + 636usize, concat!( "Offset of field: ", stringify!(cudaDeviceProp), @@ -2827,6 +3428,45 @@ fn bindgen_test_layout_cudaDeviceProp() { stringify!(directManagedMemAccessFromHost) ) ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).maxBlocksPerMultiProcessor as *const _ + as usize + }, + 712usize, + concat!( + "Offset of field: ", + stringify!(cudaDeviceProp), + "::", + stringify!(maxBlocksPerMultiProcessor) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).accessPolicyMaxWindowSize as *const _ + as usize + }, + 716usize, + concat!( + "Offset of field: ", + stringify!(cudaDeviceProp), + "::", + stringify!(accessPolicyMaxWindowSize) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).reservedSharedMemPerBlock as *const _ + as usize + }, + 720usize, + concat!( + "Offset of field: ", + stringify!(cudaDeviceProp), + "::", + stringify!(reservedSharedMemPerBlock) + ) + ); } impl Default for cudaDeviceProp { fn default() -> Self { @@ -3279,6 +3919,8 @@ pub enum cudaExternalSemaphoreHandleType { cudaExternalSemaphoreHandleTypeNvSciSync = 6, cudaExternalSemaphoreHandleTypeKeyedMutex = 7, cudaExternalSemaphoreHandleTypeKeyedMutexKmt = 8, + cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd = 9, + cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32 = 10, } #[repr(C)] #[derive(Copy, Clone)] @@ -3473,6 +4115,7 @@ impl Default for cudaExternalSemaphoreHandleDesc { pub struct cudaExternalSemaphoreSignalParams { pub params: cudaExternalSemaphoreSignalParams__bindgen_ty_1, pub flags: ::std::os::raw::c_uint, + pub reserved: [::std::os::raw::c_uint; 16usize], } #[repr(C)] #[derive(Copy, Clone)] @@ -3480,6 +4123,7 @@ pub struct cudaExternalSemaphoreSignalParams__bindgen_ty_1 { pub fence: cudaExternalSemaphoreSignalParams__bindgen_ty_1__bindgen_ty_1, pub nvSciSync: cudaExternalSemaphoreSignalParams__bindgen_ty_1__bindgen_ty_2, pub keyedMutex: cudaExternalSemaphoreSignalParams__bindgen_ty_1__bindgen_ty_3, + pub reserved: [::std::os::raw::c_uint; 12usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] @@ -3620,7 +4264,7 @@ fn bindgen_test_layout_cudaExternalSemaphoreSignalParams__bindgen_ty_1__bindgen_ fn bindgen_test_layout_cudaExternalSemaphoreSignalParams__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::(), - 24usize, + 72usize, concat!( "Size of: ", stringify!(cudaExternalSemaphoreSignalParams__bindgen_ty_1) @@ -3673,6 +4317,19 @@ fn bindgen_test_layout_cudaExternalSemaphoreSignalParams__bindgen_ty_1() { stringify!(keyedMutex) ) ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).reserved + as *const _ as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(cudaExternalSemaphoreSignalParams__bindgen_ty_1), + "::", + stringify!(reserved) + ) + ); } impl Default for cudaExternalSemaphoreSignalParams__bindgen_ty_1 { fn default() -> Self { @@ -3683,7 +4340,7 @@ impl Default for cudaExternalSemaphoreSignalParams__bindgen_ty_1 { fn bindgen_test_layout_cudaExternalSemaphoreSignalParams() { assert_eq!( ::std::mem::size_of::(), - 32usize, + 144usize, concat!("Size of: ", stringify!(cudaExternalSemaphoreSignalParams)) ); assert_eq!( @@ -3711,7 +4368,7 @@ fn bindgen_test_layout_cudaExternalSemaphoreSignalParams() { unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, - 24usize, + 72usize, concat!( "Offset of field: ", stringify!(cudaExternalSemaphoreSignalParams), @@ -3719,6 +4376,19 @@ fn bindgen_test_layout_cudaExternalSemaphoreSignalParams() { stringify!(flags) ) ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).reserved as *const _ + as usize + }, + 76usize, + concat!( + "Offset of field: ", + stringify!(cudaExternalSemaphoreSignalParams), + "::", + stringify!(reserved) + ) + ); } impl Default for cudaExternalSemaphoreSignalParams { fn default() -> Self { @@ -3730,6 +4400,7 @@ impl Default for cudaExternalSemaphoreSignalParams { pub struct cudaExternalSemaphoreWaitParams { pub params: cudaExternalSemaphoreWaitParams__bindgen_ty_1, pub flags: ::std::os::raw::c_uint, + pub reserved: [::std::os::raw::c_uint; 16usize], } #[repr(C)] #[derive(Copy, Clone)] @@ -3737,6 +4408,7 @@ pub struct cudaExternalSemaphoreWaitParams__bindgen_ty_1 { pub fence: cudaExternalSemaphoreWaitParams__bindgen_ty_1__bindgen_ty_1, pub nvSciSync: cudaExternalSemaphoreWaitParams__bindgen_ty_1__bindgen_ty_2, pub keyedMutex: cudaExternalSemaphoreWaitParams__bindgen_ty_1__bindgen_ty_3, + pub reserved: [::std::os::raw::c_uint; 10usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] @@ -3887,7 +4559,7 @@ fn bindgen_test_layout_cudaExternalSemaphoreWaitParams__bindgen_ty_1__bindgen_ty fn bindgen_test_layout_cudaExternalSemaphoreWaitParams__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::(), - 32usize, + 72usize, concat!( "Size of: ", stringify!(cudaExternalSemaphoreWaitParams__bindgen_ty_1) @@ -3940,6 +4612,19 @@ fn bindgen_test_layout_cudaExternalSemaphoreWaitParams__bindgen_ty_1() { stringify!(keyedMutex) ) ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).reserved + as *const _ as usize + }, + 32usize, + concat!( + "Offset of field: ", + stringify!(cudaExternalSemaphoreWaitParams__bindgen_ty_1), + "::", + stringify!(reserved) + ) + ); } impl Default for cudaExternalSemaphoreWaitParams__bindgen_ty_1 { fn default() -> Self { @@ -3950,7 +4635,7 @@ impl Default for cudaExternalSemaphoreWaitParams__bindgen_ty_1 { fn bindgen_test_layout_cudaExternalSemaphoreWaitParams() { assert_eq!( ::std::mem::size_of::(), - 40usize, + 144usize, concat!("Size of: ", stringify!(cudaExternalSemaphoreWaitParams)) ); assert_eq!( @@ -3974,7 +4659,7 @@ fn bindgen_test_layout_cudaExternalSemaphoreWaitParams() { unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, - 32usize, + 72usize, concat!( "Offset of field: ", stringify!(cudaExternalSemaphoreWaitParams), @@ -3982,6 +4667,19 @@ fn bindgen_test_layout_cudaExternalSemaphoreWaitParams() { stringify!(flags) ) ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).reserved as *const _ + as usize + }, + 76usize, + concat!( + "Offset of field: ", + stringify!(cudaExternalSemaphoreWaitParams), + "::", + stringify!(reserved) + ) + ); } impl Default for cudaExternalSemaphoreWaitParams { fn default() -> Self { @@ -4027,6 +4725,18 @@ pub struct CUgraphNode_st { _unused: [u8; 0], } pub type cudaGraphNode_t = *mut CUgraphNode_st; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CUfunc_st { + _unused: [u8; 0], +} +pub type cudaFunction_t = *mut CUfunc_st; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CUmemPoolHandle_st { + _unused: [u8; 0], +} +pub type cudaMemPool_t = *mut CUmemPoolHandle_st; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] pub enum cudaCGScope { @@ -4214,6 +4924,143 @@ impl Default for cudaKernelNodeParams { unsafe { ::std::mem::zeroed() } } } +#[repr(C)] +#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +pub struct cudaExternalSemaphoreSignalNodeParams { + pub extSemArray: *mut cudaExternalSemaphore_t, + pub paramsArray: *const cudaExternalSemaphoreSignalParams, + pub numExtSems: ::std::os::raw::c_uint, +} +#[test] +fn bindgen_test_layout_cudaExternalSemaphoreSignalNodeParams() { + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!( + "Size of: ", + stringify!(cudaExternalSemaphoreSignalNodeParams) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!( + "Alignment of ", + stringify!(cudaExternalSemaphoreSignalNodeParams) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).extSemArray + as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(cudaExternalSemaphoreSignalNodeParams), + "::", + stringify!(extSemArray) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).paramsArray + as *const _ as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(cudaExternalSemaphoreSignalNodeParams), + "::", + stringify!(paramsArray) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).numExtSems as *const _ + as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(cudaExternalSemaphoreSignalNodeParams), + "::", + stringify!(numExtSems) + ) + ); +} +impl Default for cudaExternalSemaphoreSignalNodeParams { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] +pub struct cudaExternalSemaphoreWaitNodeParams { + pub extSemArray: *mut cudaExternalSemaphore_t, + pub paramsArray: *const cudaExternalSemaphoreWaitParams, + pub numExtSems: ::std::os::raw::c_uint, +} +#[test] +fn bindgen_test_layout_cudaExternalSemaphoreWaitNodeParams() { + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(cudaExternalSemaphoreWaitNodeParams)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!( + "Alignment of ", + stringify!(cudaExternalSemaphoreWaitNodeParams) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).extSemArray as *const _ + as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(cudaExternalSemaphoreWaitNodeParams), + "::", + stringify!(extSemArray) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).paramsArray as *const _ + as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(cudaExternalSemaphoreWaitNodeParams), + "::", + stringify!(paramsArray) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).numExtSems as *const _ + as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(cudaExternalSemaphoreWaitNodeParams), + "::", + stringify!(numExtSems) + ) + ); +} +impl Default for cudaExternalSemaphoreWaitNodeParams { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] pub enum cudaGraphNodeType { @@ -4223,7 +5070,9 @@ pub enum cudaGraphNodeType { cudaGraphNodeTypeHost = 3, cudaGraphNodeTypeGraph = 4, cudaGraphNodeTypeEmpty = 5, - cudaGraphNodeTypeCount = 6, + cudaGraphNodeTypeWaitEvent = 6, + cudaGraphNodeTypeEventRecord = 7, + cudaGraphNodeTypeCount = 8, } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -4241,6 +5090,7 @@ pub enum cudaGraphExecUpdateResult { cudaGraphExecUpdateErrorFunctionChanged = 4, cudaGraphExecUpdateErrorParametersChanged = 5, cudaGraphExecUpdateErrorNotSupported = 6, + cudaGraphExecUpdateErrorUnsupportedFunctionChange = 7, } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] @@ -4322,7 +5172,8 @@ pub struct textureReference { pub mipmapLevelBias: f32, pub minMipmapLevelClamp: f32, pub maxMipmapLevelClamp: f32, - pub __cudaReserved: [::std::os::raw::c_int; 15usize], + pub disableTrilinearOptimization: ::std::os::raw::c_int, + pub __cudaReserved: [::std::os::raw::c_int; 14usize], } #[test] fn bindgen_test_layout_textureReference() { @@ -4445,8 +5296,21 @@ fn bindgen_test_layout_textureReference() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).__cudaReserved as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::())).disableTrilinearOptimization as *const _ + as usize + }, 64usize, + concat!( + "Offset of field: ", + stringify!(textureReference), + "::", + stringify!(disableTrilinearOptimization) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).__cudaReserved as *const _ as usize }, + 68usize, concat!( "Offset of field: ", stringify!(textureReference), @@ -4474,12 +5338,13 @@ pub struct cudaTextureDesc { pub mipmapLevelBias: f32, pub minMipmapLevelClamp: f32, pub maxMipmapLevelClamp: f32, + pub disableTrilinearOptimization: ::std::os::raw::c_int, } #[test] fn bindgen_test_layout_cudaTextureDesc() { assert_eq!( ::std::mem::size_of::(), - 64usize, + 68usize, concat!("Size of: ", stringify!(cudaTextureDesc)) ); assert_eq!( @@ -4605,6 +5470,19 @@ fn bindgen_test_layout_cudaTextureDesc() { stringify!(maxMipmapLevelClamp) ) ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).disableTrilinearOptimization as *const _ + as usize + }, + 64usize, + concat!( + "Offset of field: ", + stringify!(cudaTextureDesc), + "::", + stringify!(disableTrilinearOptimization) + ) + ); } impl Default for cudaTextureDesc { fn default() -> Self { @@ -4617,18 +5495,32 @@ pub type cudaTextureObject_t = ::std::os::raw::c_ulonglong; pub enum cudaDataType_t { CUDA_R_16F = 2, CUDA_C_16F = 6, + CUDA_R_16BF = 14, + CUDA_C_16BF = 15, CUDA_R_32F = 0, CUDA_C_32F = 4, CUDA_R_64F = 1, CUDA_C_64F = 5, + CUDA_R_4I = 16, + CUDA_C_4I = 17, + CUDA_R_4U = 18, + CUDA_C_4U = 19, CUDA_R_8I = 3, CUDA_C_8I = 7, CUDA_R_8U = 8, CUDA_C_8U = 9, + CUDA_R_16I = 20, + CUDA_C_16I = 21, + CUDA_R_16U = 22, + CUDA_C_16U = 23, CUDA_R_32I = 10, CUDA_C_32I = 11, CUDA_R_32U = 12, CUDA_C_32U = 13, + CUDA_R_64I = 24, + CUDA_C_64I = 25, + CUDA_R_64U = 26, + CUDA_C_64U = 27, } pub use self::cudaDataType_t as cudaDataType; extern "C" { @@ -4643,6 +5535,13 @@ extern "C" { extern "C" { pub fn cudaDeviceGetLimit(pValue: *mut usize, limit: cudaLimit) -> cudaError_t; } +extern "C" { + pub fn cudaDeviceGetTexture1DLinearMaxWidth( + maxWidthInElements: *mut usize, + fmtDesc: *const cudaChannelFormatDesc, + device: ::std::os::raw::c_int, + ) -> cudaError_t; +} extern "C" { pub fn cudaDeviceGetCacheConfig(pCacheConfig: *mut cudaFuncCache) -> cudaError_t; } @@ -4748,6 +5647,24 @@ extern "C" { device: ::std::os::raw::c_int, ) -> cudaError_t; } +extern "C" { + pub fn cudaDeviceGetDefaultMemPool( + memPool: *mut cudaMemPool_t, + device: ::std::os::raw::c_int, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaDeviceSetMemPool( + device: ::std::os::raw::c_int, + memPool: cudaMemPool_t, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaDeviceGetMemPool( + memPool: *mut cudaMemPool_t, + device: ::std::os::raw::c_int, + ) -> cudaError_t; +} extern "C" { pub fn cudaDeviceGetNvSciSyncAttributes( nvSciSyncAttrList: *mut ::std::os::raw::c_void, @@ -4815,6 +5732,26 @@ extern "C" { flags: *mut ::std::os::raw::c_uint, ) -> cudaError_t; } +extern "C" { + pub fn cudaCtxResetPersistingL2Cache() -> cudaError_t; +} +extern "C" { + pub fn cudaStreamCopyAttributes(dst: cudaStream_t, src: cudaStream_t) -> cudaError_t; +} +extern "C" { + pub fn cudaStreamGetAttribute( + hStream: cudaStream_t, + attr: cudaStreamAttrID, + value_out: *mut cudaStreamAttrValue, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaStreamSetAttribute( + hStream: cudaStream_t, + attr: cudaStreamAttrID, + value: *const cudaStreamAttrValue, + ) -> cudaError_t; +} extern "C" { pub fn cudaStreamDestroy(stream: cudaStream_t) -> cudaError_t; } @@ -4889,6 +5826,13 @@ extern "C" { extern "C" { pub fn cudaEventRecord(event: cudaEvent_t, stream: cudaStream_t) -> cudaError_t; } +extern "C" { + pub fn cudaEventRecordWithFlags( + event: cudaEvent_t, + stream: cudaStream_t, + flags: ::std::os::raw::c_uint, + ) -> cudaError_t; +} extern "C" { pub fn cudaEventQuery(event: cudaEvent_t) -> cudaError_t; } @@ -4931,7 +5875,7 @@ extern "C" { ) -> cudaError_t; } extern "C" { - pub fn cudaSignalExternalSemaphoresAsync( + pub fn cudaSignalExternalSemaphoresAsync_v2( extSemArray: *const cudaExternalSemaphore_t, paramsArray: *const cudaExternalSemaphoreSignalParams, numExtSems: ::std::os::raw::c_uint, @@ -4939,7 +5883,7 @@ extern "C" { ) -> cudaError_t; } extern "C" { - pub fn cudaWaitExternalSemaphoresAsync( + pub fn cudaWaitExternalSemaphoresAsync_v2( extSemArray: *const cudaExternalSemaphore_t, paramsArray: *const cudaExternalSemaphoreWaitParams, numExtSems: ::std::os::raw::c_uint, @@ -5022,6 +5966,14 @@ extern "C" { dynamicSMemSize: usize, ) -> cudaError_t; } +extern "C" { + pub fn cudaOccupancyAvailableDynamicSMemPerBlock( + dynamicSmemSize: *mut usize, + func: *const ::std::os::raw::c_void, + numBlocks: ::std::os::raw::c_int, + blockSize: ::std::os::raw::c_int, + ) -> cudaError_t; +} extern "C" { pub fn cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags( numBlocks: *mut ::std::os::raw::c_int, @@ -5156,6 +6108,25 @@ extern "C" { array: cudaArray_t, ) -> cudaError_t; } +extern "C" { + pub fn cudaArrayGetPlane( + pPlaneArray: *mut cudaArray_t, + hArray: cudaArray_t, + planeIdx: ::std::os::raw::c_uint, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaArrayGetSparseProperties( + sparseProperties: *mut cudaArraySparseProperties, + array: cudaArray_t, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaMipmappedArrayGetSparseProperties( + sparseProperties: *mut cudaArraySparseProperties, + mipmap: cudaMipmappedArray_t, + ) -> cudaError_t; +} extern "C" { pub fn cudaMemcpy( dst: *mut ::std::os::raw::c_void, @@ -5466,6 +6437,94 @@ extern "C" { stream: cudaStream_t, ) -> cudaError_t; } +extern "C" { + pub fn cudaMallocAsync( + devPtr: *mut *mut ::std::os::raw::c_void, + size: usize, + hStream: cudaStream_t, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaFreeAsync(devPtr: *mut ::std::os::raw::c_void, hStream: cudaStream_t) + -> cudaError_t; +} +extern "C" { + pub fn cudaMemPoolTrimTo(memPool: cudaMemPool_t, minBytesToKeep: usize) -> cudaError_t; +} +extern "C" { + pub fn cudaMemPoolSetAttribute( + memPool: cudaMemPool_t, + attr: cudaMemPoolAttr, + value: *mut ::std::os::raw::c_void, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaMemPoolGetAttribute( + memPool: cudaMemPool_t, + attr: cudaMemPoolAttr, + value: *mut ::std::os::raw::c_void, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaMemPoolSetAccess( + memPool: cudaMemPool_t, + descList: *const cudaMemAccessDesc, + count: usize, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaMemPoolGetAccess( + flags: *mut cudaMemAccessFlags, + memPool: cudaMemPool_t, + location: *mut cudaMemLocation, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaMemPoolCreate( + memPool: *mut cudaMemPool_t, + poolProps: *const cudaMemPoolProps, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaMemPoolDestroy(memPool: cudaMemPool_t) -> cudaError_t; +} +extern "C" { + pub fn cudaMallocFromPoolAsync( + ptr: *mut *mut ::std::os::raw::c_void, + size: usize, + memPool: cudaMemPool_t, + stream: cudaStream_t, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaMemPoolExportToShareableHandle( + shareableHandle: *mut ::std::os::raw::c_void, + memPool: cudaMemPool_t, + handleType: cudaMemAllocationHandleType, + flags: ::std::os::raw::c_uint, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaMemPoolImportFromShareableHandle( + memPool: *mut cudaMemPool_t, + shareableHandle: *mut ::std::os::raw::c_void, + handleType: cudaMemAllocationHandleType, + flags: ::std::os::raw::c_uint, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaMemPoolExportPointer( + exportData: *mut cudaMemPoolPtrExportData, + ptr: *mut ::std::os::raw::c_void, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaMemPoolImportPointer( + ptr: *mut *mut ::std::os::raw::c_void, + memPool: cudaMemPool_t, + exportData: *mut cudaMemPoolPtrExportData, + ) -> cudaError_t; +} extern "C" { pub fn cudaPointerGetAttributes( attributes: *mut cudaPointerAttributes, @@ -5683,6 +6742,26 @@ extern "C" { pNodeParams: *const cudaKernelNodeParams, ) -> cudaError_t; } +extern "C" { + pub fn cudaGraphKernelNodeCopyAttributes( + hSrc: cudaGraphNode_t, + hDst: cudaGraphNode_t, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaGraphKernelNodeGetAttribute( + hNode: cudaGraphNode_t, + attr: cudaKernelNodeAttrID, + value_out: *mut cudaKernelNodeAttrValue, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaGraphKernelNodeSetAttribute( + hNode: cudaGraphNode_t, + attr: cudaKernelNodeAttrID, + value: *const cudaKernelNodeAttrValue, + ) -> cudaError_t; +} extern "C" { pub fn cudaGraphAddMemcpyNode( pGraphNode: *mut cudaGraphNode_t, @@ -5692,6 +6771,44 @@ extern "C" { pCopyParams: *const cudaMemcpy3DParms, ) -> cudaError_t; } +extern "C" { + pub fn cudaGraphAddMemcpyNodeToSymbol( + pGraphNode: *mut cudaGraphNode_t, + graph: cudaGraph_t, + pDependencies: *const cudaGraphNode_t, + numDependencies: usize, + symbol: *const ::std::os::raw::c_void, + src: *const ::std::os::raw::c_void, + count: usize, + offset: usize, + kind: cudaMemcpyKind, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaGraphAddMemcpyNodeFromSymbol( + pGraphNode: *mut cudaGraphNode_t, + graph: cudaGraph_t, + pDependencies: *const cudaGraphNode_t, + numDependencies: usize, + dst: *mut ::std::os::raw::c_void, + symbol: *const ::std::os::raw::c_void, + count: usize, + offset: usize, + kind: cudaMemcpyKind, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaGraphAddMemcpyNode1D( + pGraphNode: *mut cudaGraphNode_t, + graph: cudaGraph_t, + pDependencies: *const cudaGraphNode_t, + numDependencies: usize, + dst: *mut ::std::os::raw::c_void, + src: *const ::std::os::raw::c_void, + count: usize, + kind: cudaMemcpyKind, + ) -> cudaError_t; +} extern "C" { pub fn cudaGraphMemcpyNodeGetParams( node: cudaGraphNode_t, @@ -5704,6 +6821,35 @@ extern "C" { pNodeParams: *const cudaMemcpy3DParms, ) -> cudaError_t; } +extern "C" { + pub fn cudaGraphMemcpyNodeSetParamsToSymbol( + node: cudaGraphNode_t, + symbol: *const ::std::os::raw::c_void, + src: *const ::std::os::raw::c_void, + count: usize, + offset: usize, + kind: cudaMemcpyKind, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaGraphMemcpyNodeSetParamsFromSymbol( + node: cudaGraphNode_t, + dst: *mut ::std::os::raw::c_void, + symbol: *const ::std::os::raw::c_void, + count: usize, + offset: usize, + kind: cudaMemcpyKind, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaGraphMemcpyNodeSetParams1D( + node: cudaGraphNode_t, + dst: *mut ::std::os::raw::c_void, + src: *const ::std::os::raw::c_void, + count: usize, + kind: cudaMemcpyKind, + ) -> cudaError_t; +} extern "C" { pub fn cudaGraphAddMemsetNode( pGraphNode: *mut cudaGraphNode_t, @@ -5769,6 +6915,88 @@ extern "C" { numDependencies: usize, ) -> cudaError_t; } +extern "C" { + pub fn cudaGraphAddEventRecordNode( + pGraphNode: *mut cudaGraphNode_t, + graph: cudaGraph_t, + pDependencies: *const cudaGraphNode_t, + numDependencies: usize, + event: cudaEvent_t, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaGraphEventRecordNodeGetEvent( + node: cudaGraphNode_t, + event_out: *mut cudaEvent_t, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaGraphEventRecordNodeSetEvent( + node: cudaGraphNode_t, + event: cudaEvent_t, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaGraphAddEventWaitNode( + pGraphNode: *mut cudaGraphNode_t, + graph: cudaGraph_t, + pDependencies: *const cudaGraphNode_t, + numDependencies: usize, + event: cudaEvent_t, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaGraphEventWaitNodeGetEvent( + node: cudaGraphNode_t, + event_out: *mut cudaEvent_t, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaGraphEventWaitNodeSetEvent(node: cudaGraphNode_t, event: cudaEvent_t) + -> cudaError_t; +} +extern "C" { + pub fn cudaGraphAddExternalSemaphoresSignalNode( + pGraphNode: *mut cudaGraphNode_t, + graph: cudaGraph_t, + pDependencies: *const cudaGraphNode_t, + numDependencies: usize, + nodeParams: *const cudaExternalSemaphoreSignalNodeParams, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaGraphExternalSemaphoresSignalNodeGetParams( + hNode: cudaGraphNode_t, + params_out: *mut cudaExternalSemaphoreSignalNodeParams, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaGraphExternalSemaphoresSignalNodeSetParams( + hNode: cudaGraphNode_t, + nodeParams: *const cudaExternalSemaphoreSignalNodeParams, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaGraphAddExternalSemaphoresWaitNode( + pGraphNode: *mut cudaGraphNode_t, + graph: cudaGraph_t, + pDependencies: *const cudaGraphNode_t, + numDependencies: usize, + nodeParams: *const cudaExternalSemaphoreWaitNodeParams, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaGraphExternalSemaphoresWaitNodeGetParams( + hNode: cudaGraphNode_t, + params_out: *mut cudaExternalSemaphoreWaitNodeParams, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaGraphExternalSemaphoresWaitNodeSetParams( + hNode: cudaGraphNode_t, + nodeParams: *const cudaExternalSemaphoreWaitNodeParams, + ) -> cudaError_t; +} extern "C" { pub fn cudaGraphClone(pGraphClone: *mut cudaGraph_t, originalGraph: cudaGraph_t) -> cudaError_t; @@ -5864,6 +7092,38 @@ extern "C" { pNodeParams: *const cudaMemcpy3DParms, ) -> cudaError_t; } +extern "C" { + pub fn cudaGraphExecMemcpyNodeSetParamsToSymbol( + hGraphExec: cudaGraphExec_t, + node: cudaGraphNode_t, + symbol: *const ::std::os::raw::c_void, + src: *const ::std::os::raw::c_void, + count: usize, + offset: usize, + kind: cudaMemcpyKind, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaGraphExecMemcpyNodeSetParamsFromSymbol( + hGraphExec: cudaGraphExec_t, + node: cudaGraphNode_t, + dst: *mut ::std::os::raw::c_void, + symbol: *const ::std::os::raw::c_void, + count: usize, + offset: usize, + kind: cudaMemcpyKind, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaGraphExecMemcpyNodeSetParams1D( + hGraphExec: cudaGraphExec_t, + node: cudaGraphNode_t, + dst: *mut ::std::os::raw::c_void, + src: *const ::std::os::raw::c_void, + count: usize, + kind: cudaMemcpyKind, + ) -> cudaError_t; +} extern "C" { pub fn cudaGraphExecMemsetNodeSetParams( hGraphExec: cudaGraphExec_t, @@ -5878,6 +7138,41 @@ extern "C" { pNodeParams: *const cudaHostNodeParams, ) -> cudaError_t; } +extern "C" { + pub fn cudaGraphExecChildGraphNodeSetParams( + hGraphExec: cudaGraphExec_t, + node: cudaGraphNode_t, + childGraph: cudaGraph_t, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaGraphExecEventRecordNodeSetEvent( + hGraphExec: cudaGraphExec_t, + hNode: cudaGraphNode_t, + event: cudaEvent_t, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaGraphExecEventWaitNodeSetEvent( + hGraphExec: cudaGraphExec_t, + hNode: cudaGraphNode_t, + event: cudaEvent_t, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaGraphExecExternalSemaphoresSignalNodeSetParams( + hGraphExec: cudaGraphExec_t, + hNode: cudaGraphNode_t, + nodeParams: *const cudaExternalSemaphoreSignalNodeParams, + ) -> cudaError_t; +} +extern "C" { + pub fn cudaGraphExecExternalSemaphoresWaitNodeSetParams( + hGraphExec: cudaGraphExec_t, + hNode: cudaGraphNode_t, + nodeParams: *const cudaExternalSemaphoreWaitNodeParams, + ) -> cudaError_t; +} extern "C" { pub fn cudaGraphExecUpdate( hGraphExec: cudaGraphExec_t, @@ -5886,6 +7181,9 @@ extern "C" { updateResult_out: *mut cudaGraphExecUpdateResult, ) -> cudaError_t; } +extern "C" { + pub fn cudaGraphUpload(graphExec: cudaGraphExec_t, stream: cudaStream_t) -> cudaError_t; +} extern "C" { pub fn cudaGraphLaunch(graphExec: cudaGraphExec_t, stream: cudaStream_t) -> cudaError_t; } @@ -5901,3 +7199,9 @@ extern "C" { pExportTableId: *const cudaUUID_t, ) -> cudaError_t; } +extern "C" { + pub fn cudaGetFuncBySymbol( + functionPtr: *mut cudaFunction_t, + symbolPtr: *const ::std::os::raw::c_void, + ) -> cudaError_t; +}