Repository: vosen/ZLUDA Branch: master Commit: dcc6bb8fdad2 Files: 871 Total size: 17.8 MB Directory structure: gitextract_ehz427hu/ ├── .cargo/ │ └── config.toml ├── .devcontainer/ │ ├── Dockerfile │ └── devcontainer.json ├── .git-blame-ignore-revs ├── .gitattributes ├── .github/ │ ├── ISSUE_TEMPLATE/ │ │ ├── config.yml │ │ └── zluda_dump.yml │ └── workflows/ │ ├── move_tests.sh │ ├── nightly_tests.yml │ ├── pr_master.yml │ ├── push_master.yml │ ├── rocm_setup_build.sh │ ├── rocm_setup_run.sh │ └── trigger_nightly_tests.yml ├── .gitignore ├── .gitmodules ├── .rustfmt.toml ├── Cargo.toml ├── LICENSE-APACHE ├── LICENSE-MIT ├── README.md ├── compiler/ │ ├── Cargo.toml │ └── src/ │ ├── error.rs │ └── main.rs ├── cuda_check/ │ ├── Cargo.toml │ └── src/ │ ├── main.rs │ └── win.rs ├── cuda_macros/ │ ├── .rustfmt.toml │ ├── Cargo.toml │ ├── build/ │ │ └── wrapper.h │ └── src/ │ ├── cublas.rs │ ├── cublaslt.rs │ ├── cublaslt_internal.rs │ ├── cuda.rs │ ├── cudnn8.rs │ ├── cudnn9.rs │ ├── cufft.rs │ ├── cusparse.rs │ ├── lib.rs │ └── nvml.rs ├── cuda_types/ │ ├── .rustfmt.toml │ ├── Cargo.toml │ └── src/ │ ├── cublas.rs │ ├── cublaslt.rs │ ├── cuda.rs │ ├── cudnn.rs │ ├── cudnn8.rs │ ├── cudnn9.rs │ ├── cufft.rs │ ├── cusparse.rs │ ├── dark_api.rs │ ├── lib.rs │ └── nvml.rs ├── dark_api/ │ ├── Cargo.toml │ └── src/ │ ├── fatbin.rs │ └── lib.rs ├── detours-sys/ │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── README.md │ ├── build/ │ │ └── wrapper.h │ ├── build.rs │ └── src/ │ ├── bundled_bindings.rs │ └── lib.rs ├── docs/ │ ├── .gitignore │ ├── .readthedocs.yaml │ ├── book.toml │ └── src/ │ ├── SUMMARY.md │ ├── building.md │ ├── faq.md │ ├── hip_sdk.md │ ├── llama_cpp.md │ ├── precompiling.md │ ├── quick_start.md │ └── troubleshooting.md ├── ext/ │ ├── detours/ │ │ ├── .github/ │ │ │ ├── ISSUE_TEMPLATE/ │ │ │ │ ├── bug-report.md │ │ │ │ └── question.md │ │ │ ├── PULL_REQUEST_TEMPLATE/ │ │ │ │ └── pull_request_template.md │ │ │ ├── codeql/ │ │ │ │ └── codeql-config.yml │ │ │ └── workflows/ │ │ │ └── main.yml │ │ ├── .gitignore │ │ ├── CREDITS.TXT │ │ ├── LICENSE.md │ │ ├── Makefile │ │ ├── README.md │ │ ├── samples/ │ │ │ ├── Makefile │ │ │ ├── README.TXT │ │ │ ├── comeasy/ │ │ │ │ ├── Makefile │ │ │ │ ├── comeasy.cpp │ │ │ │ ├── wrotei.cpp │ │ │ │ └── wrotei.rc │ │ │ ├── commem/ │ │ │ │ ├── Makefile │ │ │ │ └── commem.cpp │ │ │ ├── common.mak │ │ │ ├── cping/ │ │ │ │ ├── Makefile │ │ │ │ ├── ReadMe.Txt │ │ │ │ ├── cping.cpp │ │ │ │ └── iping.idl │ │ │ ├── disas/ │ │ │ │ ├── Makefile │ │ │ │ ├── arm.asm │ │ │ │ ├── disas.cpp │ │ │ │ ├── ia64.asm │ │ │ │ ├── unk.cpp │ │ │ │ ├── x64.asm │ │ │ │ └── x86.cpp │ │ │ ├── dtest/ │ │ │ │ ├── Makefile │ │ │ │ ├── NORMAL_IA64.TXT │ │ │ │ ├── NORMAL_X64.TXT │ │ │ │ ├── NORMAL_X86.TXT │ │ │ │ ├── dtarge.cpp │ │ │ │ ├── dtarge.h │ │ │ │ ├── dtarge.rc │ │ │ │ └── dtest.cpp │ │ │ ├── dumpe/ │ │ │ │ ├── Makefile │ │ │ │ └── dumpe.cpp │ │ │ ├── dumpi/ │ │ │ │ ├── Makefile │ │ │ │ └── dumpi.cpp │ │ │ ├── dynamic_alloc/ │ │ │ │ ├── Makefile │ │ │ │ ├── main.cpp │ │ │ │ ├── x64.asm │ │ │ │ └── x86.asm │ │ │ ├── echo/ │ │ │ │ ├── Makefile │ │ │ │ ├── echofx.cpp │ │ │ │ ├── echofx.rc │ │ │ │ ├── echonul.cpp │ │ │ │ └── main.cpp │ │ │ ├── einst/ │ │ │ │ ├── Makefile │ │ │ │ ├── edll1x.cpp │ │ │ │ ├── edll2x.cpp │ │ │ │ ├── edll3x.cpp │ │ │ │ └── einst.cpp │ │ │ ├── excep/ │ │ │ │ ├── Makefile │ │ │ │ ├── excep.cpp │ │ │ │ ├── firstexc.cpp │ │ │ │ └── firstexc.h │ │ │ ├── findfunc/ │ │ │ │ ├── Makefile │ │ │ │ ├── extend.cpp │ │ │ │ ├── extend.rc │ │ │ │ ├── findfunc.cpp │ │ │ │ ├── symtest.cpp │ │ │ │ ├── target.cpp │ │ │ │ ├── target.h │ │ │ │ └── target.rc │ │ │ ├── impmunge/ │ │ │ │ ├── Makefile │ │ │ │ └── impmunge.cpp │ │ │ ├── member/ │ │ │ │ ├── Makefile │ │ │ │ └── member.cpp │ │ │ ├── opengl/ │ │ │ │ ├── Makefile │ │ │ │ ├── ogldet.cpp │ │ │ │ ├── ogldet.rc │ │ │ │ └── testogl.cpp │ │ │ ├── region/ │ │ │ │ ├── Makefile │ │ │ │ └── region.cpp │ │ │ ├── setdll/ │ │ │ │ ├── Makefile │ │ │ │ └── setdll.cpp │ │ │ ├── simple/ │ │ │ │ ├── Makefile │ │ │ │ ├── simple.cpp │ │ │ │ ├── simple.rc │ │ │ │ └── sleep5.cpp │ │ │ ├── slept/ │ │ │ │ ├── Makefile │ │ │ │ ├── NORMAL_IA64.TXT │ │ │ │ ├── NORMAL_X64.TXT │ │ │ │ ├── NORMAL_X86.TXT │ │ │ │ ├── dslept.cpp │ │ │ │ ├── dslept.rc │ │ │ │ ├── sleepbed.cpp │ │ │ │ ├── sleepnew.cpp │ │ │ │ ├── sleepold.cpp │ │ │ │ ├── slept.cpp │ │ │ │ ├── slept.h │ │ │ │ ├── slept.rc │ │ │ │ └── verify.cpp │ │ │ ├── syelog/ │ │ │ │ ├── Makefile │ │ │ │ ├── sltest.cpp │ │ │ │ ├── sltestp.cpp │ │ │ │ ├── syelog.cpp │ │ │ │ ├── syelog.h │ │ │ │ └── syelogd.cpp │ │ │ ├── talloc/ │ │ │ │ ├── Makefile │ │ │ │ ├── NORMAL_IA64.TXT │ │ │ │ ├── NORMAL_X64.TXT │ │ │ │ ├── talloc.cpp │ │ │ │ ├── tdll1x.cpp │ │ │ │ ├── tdll2x.cpp │ │ │ │ ├── tdll3x.cpp │ │ │ │ ├── tdll4x.cpp │ │ │ │ ├── tdll5x.cpp │ │ │ │ ├── tdll6x.cpp │ │ │ │ ├── tdll7x.cpp │ │ │ │ ├── tdll8x.cpp │ │ │ │ └── tdll9x.cpp │ │ │ ├── traceapi/ │ │ │ │ ├── Makefile │ │ │ │ ├── _win32.cpp │ │ │ │ ├── testapi.cpp │ │ │ │ ├── trcapi.cpp │ │ │ │ └── trcapi.rc │ │ │ ├── tracebld/ │ │ │ │ ├── Makefile │ │ │ │ ├── tracebld.cpp │ │ │ │ ├── tracebld.h │ │ │ │ ├── trcbld.cpp │ │ │ │ └── trcbld.rc │ │ │ ├── tracelnk/ │ │ │ │ ├── Makefile │ │ │ │ ├── trclnk.cpp │ │ │ │ └── trclnk.rc │ │ │ ├── tracemem/ │ │ │ │ ├── Makefile │ │ │ │ ├── trcmem.cpp │ │ │ │ └── trcmem.rc │ │ │ ├── tracereg/ │ │ │ │ ├── Makefile │ │ │ │ ├── trcreg.cpp │ │ │ │ └── trcreg.rc │ │ │ ├── traceser/ │ │ │ │ ├── Makefile │ │ │ │ ├── trcser.cpp │ │ │ │ └── trcser.rc │ │ │ ├── tracessl/ │ │ │ │ ├── Makefile │ │ │ │ ├── trcssl.cpp │ │ │ │ └── trcssl.rc │ │ │ ├── tracetcp/ │ │ │ │ ├── Makefile │ │ │ │ ├── trctcp.cpp │ │ │ │ └── trctcp.rc │ │ │ ├── tryman/ │ │ │ │ ├── Makefile │ │ │ │ ├── managed.cs │ │ │ │ ├── size.cpp │ │ │ │ ├── tryman.cpp │ │ │ │ ├── tstman.cpp │ │ │ │ └── tstman.rc │ │ │ └── withdll/ │ │ │ ├── Makefile │ │ │ └── withdll.cpp │ │ ├── src/ │ │ │ ├── Makefile │ │ │ ├── creatwth.cpp │ │ │ ├── detours.cpp │ │ │ ├── detours.h │ │ │ ├── detver.h │ │ │ ├── disasm.cpp │ │ │ ├── disolarm.cpp │ │ │ ├── disolarm64.cpp │ │ │ ├── disolia64.cpp │ │ │ ├── disolx64.cpp │ │ │ ├── disolx86.cpp │ │ │ ├── image.cpp │ │ │ ├── modules.cpp │ │ │ └── uimports.cpp │ │ ├── system.mak │ │ ├── tests/ │ │ │ ├── Makefile │ │ │ ├── catch.hpp │ │ │ ├── corruptor.cpp │ │ │ ├── corruptor.h │ │ │ ├── main.cpp │ │ │ ├── test_image_api.cpp │ │ │ └── test_module_api.cpp │ │ └── vc/ │ │ ├── Detours.sln │ │ ├── Detours.vcxproj │ │ └── Detours.vcxproj.filters │ ├── highs-sys/ │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── build.rs │ │ ├── install-dependencies.sh │ │ ├── src/ │ │ │ ├── c_bindings.rs │ │ │ └── lib.rs │ │ ├── tests/ │ │ │ ├── test_highs_call.rs │ │ │ └── test_highs_functions.rs │ │ └── wrapper.h │ ├── hip_runtime-sys/ │ │ ├── .rustfmt.toml │ │ ├── Cargo.toml │ │ ├── build.rs │ │ └── src/ │ │ └── lib.rs │ ├── hipblaslt-sys/ │ │ ├── .rustfmt.toml │ │ ├── Cargo.toml │ │ ├── build.rs │ │ └── src/ │ │ └── lib.rs │ ├── miopen-sys/ │ │ ├── .rustfmt.toml │ │ ├── Cargo.toml │ │ ├── build.rs │ │ └── src/ │ │ └── lib.rs │ ├── rocblas-sys/ │ │ ├── .rustfmt.toml │ │ ├── Cargo.toml │ │ ├── build.rs │ │ └── src/ │ │ └── lib.rs │ ├── rocm_smi-sys/ │ │ ├── .rustfmt.toml │ │ ├── Cargo.toml │ │ ├── build.rs │ │ └── src/ │ │ └── lib.rs │ └── rocsparse-sys/ │ ├── .rustfmt.toml │ ├── Cargo.toml │ ├── build.rs │ └── src/ │ └── lib.rs ├── format/ │ ├── .rustfmt.toml │ ├── Cargo.toml │ └── src/ │ ├── dark_api.rs │ ├── dnn8.rs │ ├── dnn9.rs │ ├── format_generated.rs │ ├── format_generated_blas.rs │ ├── format_generated_blaslt.rs │ ├── format_generated_blaslt_internal.rs │ ├── format_generated_dnn8.rs │ ├── format_generated_dnn9.rs │ ├── format_generated_fft.rs │ ├── format_generated_nvml.rs │ ├── format_generated_sparse.rs │ └── lib.rs ├── llvm_zluda/ │ ├── Cargo.toml │ ├── build.rs │ └── src/ │ ├── compile.rs │ ├── device-libs/ │ │ ├── LICENSE.TXT │ │ ├── README.md │ │ ├── ockl.bc │ │ └── ocml.bc │ ├── ffi.rs │ ├── lib.cpp │ ├── lib.rs │ └── utils.rs ├── ptx/ │ ├── Cargo.toml │ ├── lib/ │ │ ├── zluda_ptx_impl.bc │ │ └── zluda_ptx_impl.cpp │ └── src/ │ ├── lib.rs │ ├── pass/ │ │ ├── deparamize_functions.rs │ │ ├── expand_operands.rs │ │ ├── fix_special_registers.rs │ │ ├── hoist_globals.rs │ │ ├── insert_explicit_load_store.rs │ │ ├── insert_implicit_conversions.rs │ │ ├── insert_post_saturation.rs │ │ ├── instruction_mode_to_global_mode/ │ │ │ ├── call_with_mode.ptx │ │ │ ├── fold_denormal.ptx │ │ │ ├── mod.rs │ │ │ └── test.rs │ │ ├── llvm/ │ │ │ ├── attributes.rs │ │ │ ├── emit.rs │ │ │ └── mod.rs │ │ ├── mod.rs │ │ ├── normalize_basic_blocks.rs │ │ ├── normalize_identifiers.rs │ │ ├── normalize_predicates.rs │ │ ├── remove_unreachable_basic_blocks.rs │ │ ├── replace_instructions_with_functions.rs │ │ ├── replace_instructions_with_functions_fp_required.rs │ │ ├── replace_known_functions.rs │ │ ├── resolve_function_pointers.rs │ │ └── test/ │ │ ├── expand_operands/ │ │ │ ├── immediate_conversion.ptx │ │ │ ├── immediates.ptx │ │ │ ├── mod.rs │ │ │ ├── vector_extract.ptx │ │ │ ├── vector_operand.ptx │ │ │ └── vector_operand_convert.ptx │ │ ├── insert_implicit_conversions/ │ │ │ ├── default.ptx │ │ │ ├── default_reg_b32_reg_f16x2.ptx │ │ │ ├── default_reg_b32_reg_v2_b16.ptx │ │ │ ├── default_relaxed.ptx │ │ │ └── mod.rs │ │ ├── instruction_mode_to_global_mode/ │ │ │ ├── mod.rs │ │ │ └── mode_conflict.ptx │ │ ├── mod.rs │ │ └── normalize_basic_blocks/ │ │ ├── mod.rs │ │ └── trap.ptx │ └── test/ │ ├── _Z9vectorAddPKfS0_Pfi.ptx │ ├── ll/ │ │ ├── _attributes.ll │ │ ├── abs.ll │ │ ├── activemask.ll │ │ ├── add.ll │ │ ├── add_extended.ll │ │ ├── add_ftz.ll │ │ ├── add_non_coherent.ll │ │ ├── add_s32_sat.ll │ │ ├── add_tuning.ll │ │ ├── addc_cc_s32.ll │ │ ├── and.ll │ │ ├── assertfail.ll │ │ ├── atom_add.ll │ │ ├── atom_add_float.ll │ │ ├── atom_cas.ll │ │ ├── atom_inc.ll │ │ ├── b64tof64.ll │ │ ├── bar_red_and_pred.ll │ │ ├── bench.ll │ │ ├── bfe.ll │ │ ├── bfi.ll │ │ ├── block.ll │ │ ├── bmsk_clamp_b32.ll │ │ ├── bra.ll │ │ ├── brev.ll │ │ ├── call.ll │ │ ├── call_rnd.ll │ │ ├── clz.ll │ │ ├── const.ll │ │ ├── const_ident.ll │ │ ├── constant_f32.ll │ │ ├── constant_negative.ll │ │ ├── copysign.ll │ │ ├── cos.ll │ │ ├── cp_async.ll │ │ ├── createpolicy.ll │ │ ├── cvt_f16x2_f32.ll │ │ ├── cvt_f64_f32.ll │ │ ├── cvt_pack.ll │ │ ├── cvt_relu_f16x2_f32.ll │ │ ├── cvt_rn_bf16x2_f32.ll │ │ ├── cvt_rn_f16x2_e4m3x2.ll │ │ ├── cvt_rn_f16x2_e5m2x2.ll │ │ ├── cvt_rn_satfinite_e4m3x2_f32.ll │ │ ├── cvt_rn_satfinite_e5m2x2_f32.ll │ │ ├── cvt_rni.ll │ │ ├── cvt_rni_u16_f32.ll │ │ ├── cvt_rzi.ll │ │ ├── cvt_s16_s8.ll │ │ ├── cvt_s32_f32.ll │ │ ├── cvt_s64_s32.ll │ │ ├── cvt_sat_s_u.ll │ │ ├── cvta.ll │ │ ├── div_approx.ll │ │ ├── div_ftz.ll │ │ ├── div_noftz.ll │ │ ├── dp2a.ll │ │ ├── dp4a.ll │ │ ├── ex2.ll │ │ ├── extern_func.ll │ │ ├── extern_shared.ll │ │ ├── extern_shared_call.ll │ │ ├── fma.ll │ │ ├── fma_bf16x2.ll │ │ ├── fma_f16x2.ll │ │ ├── fmax.ll │ │ ├── global_array.ll │ │ ├── global_array_f32.ll │ │ ├── lanemask_le.ll │ │ ├── lanemask_lt.ll │ │ ├── ld_st.ll │ │ ├── ld_st_implicit.ll │ │ ├── ld_st_offset.ll │ │ ├── ldmatrix.ll │ │ ├── ldmatrix_trans.ll │ │ ├── lg2.ll │ │ ├── local_align.ll │ │ ├── mad_extended.ll │ │ ├── mad_s32.ll │ │ ├── mad_wide.ll │ │ ├── malformed_label.ll │ │ ├── max.ll │ │ ├── membar.ll │ │ ├── min.ll │ │ ├── min_f16.ll │ │ ├── min_nan_f16.ll │ │ ├── mma_m16n8k16_f32_bf16_bf16_f32.ll │ │ ├── mma_m16n8k16_f32_bf16_bf16_f32_2x.ll │ │ ├── mma_m16n8k16_f32_f16_f16_f32.ll │ │ ├── mma_m16n8k32_s32_s8_s8_s32.ll │ │ ├── mma_m16n8k32_s32_s8_s8_s32_interleave.ll │ │ ├── mov.ll │ │ ├── mov_address.ll │ │ ├── mul24_hi_s32.ll │ │ ├── mul24_hi_u32.ll │ │ ├── mul24_lo_s32.ll │ │ ├── mul24_lo_u32.ll │ │ ├── mul_ftz.ll │ │ ├── mul_hi.ll │ │ ├── mul_lo.ll │ │ ├── mul_non_ftz.ll │ │ ├── mul_wide.ll │ │ ├── multiple_return.ll │ │ ├── nanosleep.ll │ │ ├── neg.ll │ │ ├── non_scalar_ptr_offset.ll │ │ ├── noreturn.ll │ │ ├── not.ll │ │ ├── ntid.ll │ │ ├── or.ll │ │ ├── param_is_addressable.ll │ │ ├── popc.ll │ │ ├── pred_not.ll │ │ ├── prmt.ll │ │ ├── prmt_slow.ll │ │ ├── rcp.ll │ │ ├── redux_sync_add_u32_partial.ll │ │ ├── redux_sync_op_s32.ll │ │ ├── redux_sync_op_u32.ll │ │ ├── reg_local.ll │ │ ├── reg_multi.ll │ │ ├── rem.ll │ │ ├── rsqrt.ll │ │ ├── sad_s64.ll │ │ ├── selp.ll │ │ ├── selp_true.ll │ │ ├── set_f16.ll │ │ ├── setp.ll │ │ ├── setp_gt.ll │ │ ├── setp_leu.ll │ │ ├── setp_nan.ll │ │ ├── setp_num.ll │ │ ├── shared_ptr_32.ll │ │ ├── shared_ptr_take_address.ll │ │ ├── shared_unify_extern.ll │ │ ├── shared_unify_local.ll │ │ ├── shared_variable.ll │ │ ├── shf_l.ll │ │ ├── shf_l_clamp.ll │ │ ├── shf_l_wrap.ll │ │ ├── shf_r.ll │ │ ├── shf_r_clamp.ll │ │ ├── shf_r_wrap.ll │ │ ├── shfl_sync_bfly_b32_pred.ll │ │ ├── shfl_sync_down_b32_pred.ll │ │ ├── shfl_sync_idx_b32_pred.ll │ │ ├── shfl_sync_mode_b32.ll │ │ ├── shfl_sync_up_b32_pred.ll │ │ ├── shl.ll │ │ ├── shr.ll │ │ ├── shr_oob.ll │ │ ├── sign_extend.ll │ │ ├── sin.ll │ │ ├── sqrt.ll │ │ ├── sqrt_rn_ftz.ll │ │ ├── stateful_ld_st_ntid.ll │ │ ├── stateful_ld_st_ntid_chain.ll │ │ ├── stateful_ld_st_ntid_sub.ll │ │ ├── stateful_ld_st_simple.ll │ │ ├── stateful_neg_offset.ll │ │ ├── sub.ll │ │ ├── sub_extended.ll │ │ ├── subc_cc_s32.ll │ │ ├── tanh.ll │ │ ├── tid.ll │ │ ├── trap.ll │ │ ├── uint_to_fp_bf16.ll │ │ ├── vector.ll │ │ ├── vector4.ll │ │ ├── vector8.ll │ │ ├── vector8_extract.ll │ │ ├── vector_extract.ll │ │ ├── vector_operand.ll │ │ ├── vote_all.ll │ │ ├── vote_all_sub.ll │ │ ├── vote_any.ll │ │ ├── vote_ballot.ll │ │ ├── warp_sz.ll │ │ └── xor.ll │ ├── mod.rs │ ├── operands.ptx │ ├── spirv_build/ │ │ ├── bar_sync.ptx │ │ ├── global_extern_array.ptx │ │ └── param_func_array_0.ptx │ ├── spirv_fail/ │ │ ├── const_ptr.ptx │ │ ├── global_ptr.ptx │ │ ├── local_ptr.txt │ │ ├── param_entry_array_0.ptx │ │ ├── param_vector.ptx │ │ ├── shared_ptr.ptx │ │ └── shared_ptr2.ptx │ ├── spirv_run/ │ │ ├── abs.ptx │ │ ├── activemask.ptx │ │ ├── add.ptx │ │ ├── add_extended.ptx │ │ ├── add_ftz.ptx │ │ ├── add_non_coherent.ptx │ │ ├── add_s32_sat.ptx │ │ ├── add_tuning.ptx │ │ ├── addc_cc_s32.ptx │ │ ├── and.ptx │ │ ├── assertfail.ptx │ │ ├── atom_add.ptx │ │ ├── atom_add_float.ptx │ │ ├── atom_cas.ptx │ │ ├── atom_inc.ptx │ │ ├── atomics_128.ptx │ │ ├── b64tof64.ptx │ │ ├── bar_red_and_pred.ptx │ │ ├── bfe.ptx │ │ ├── bfi.ptx │ │ ├── block.ptx │ │ ├── bmsk_clamp_b32.ptx │ │ ├── bra.ptx │ │ ├── brev.ptx │ │ ├── call.ptx │ │ ├── call_rnd.ptx │ │ ├── clz.ptx │ │ ├── const.ptx │ │ ├── const_ident.ptx │ │ ├── constant_f32.ptx │ │ ├── constant_negative.ptx │ │ ├── copysign.ptx │ │ ├── cos.ptx │ │ ├── cp_async.ptx │ │ ├── createpolicy.ptx │ │ ├── cvt_f16x2_f32.ptx │ │ ├── cvt_f64_f32.ptx │ │ ├── cvt_pack.ptx │ │ ├── cvt_relu_f16x2_f32.ptx │ │ ├── cvt_rn_bf16x2_f32.ptx │ │ ├── cvt_rn_f16x2_e4m3x2.ptx │ │ ├── cvt_rn_f16x2_e5m2x2.ptx │ │ ├── cvt_rn_satfinite_e4m3x2_f32.ptx │ │ ├── cvt_rn_satfinite_e5m2x2_f32.ptx │ │ ├── cvt_rni.ptx │ │ ├── cvt_rni_u16_f32.ptx │ │ ├── cvt_rzi.ptx │ │ ├── cvt_s16_s8.ptx │ │ ├── cvt_s32_f32.ptx │ │ ├── cvt_s64_s32.ptx │ │ ├── cvt_sat_s_u.ptx │ │ ├── cvta.ptx │ │ ├── div_approx.ptx │ │ ├── div_ftz.ptx │ │ ├── div_noftz.ptx │ │ ├── dp2a.ptx │ │ ├── dp4a.ptx │ │ ├── ex2.ptx │ │ ├── extern_func.ptx │ │ ├── extern_shared.ptx │ │ ├── extern_shared_call.ptx │ │ ├── fma.ptx │ │ ├── fma_bf16x2.ptx │ │ ├── fma_f16x2.ptx │ │ ├── fmax.ptx │ │ ├── func_ptr.ptx │ │ ├── global_array.ptx │ │ ├── global_array_f32.ptx │ │ ├── implicit_param.ptx │ │ ├── lanemask_lt.ptx │ │ ├── ld_st.ptx │ │ ├── ld_st_implicit.ptx │ │ ├── ld_st_offset.ptx │ │ ├── ldmatrix.ptx │ │ ├── ldmatrix_trans.ptx │ │ ├── lg2.ptx │ │ ├── local_align.ptx │ │ ├── mad_extended.ptx │ │ ├── mad_s32.ptx │ │ ├── mad_wide.ptx │ │ ├── malformed_label.ptx │ │ ├── max.ptx │ │ ├── membar.ptx │ │ ├── min.ptx │ │ ├── min_f16.ptx │ │ ├── min_nan_f16.ptx │ │ ├── mma_m16n8k16_f32_bf16_bf16_f32.ptx │ │ ├── mma_m16n8k16_f32_bf16_bf16_f32_2x.ptx │ │ ├── mma_m16n8k16_f32_f16_f16_f32.ptx │ │ ├── mma_m16n8k32_s32_s8_s8_s32.ptx │ │ ├── mma_m16n8k32_s32_s8_s8_s32_interleave.ptx │ │ ├── mod.rs │ │ ├── mov.ptx │ │ ├── mov_address.ptx │ │ ├── mul24_hi_s32.ptx │ │ ├── mul24_hi_u32.ptx │ │ ├── mul24_lo_s32.ptx │ │ ├── mul24_lo_u32.ptx │ │ ├── mul_ftz.ptx │ │ ├── mul_hi.ptx │ │ ├── mul_lo.ptx │ │ ├── mul_non_ftz.ptx │ │ ├── mul_wide.ptx │ │ ├── multiple_return.ptx │ │ ├── nanosleep.ptx │ │ ├── neg.ptx │ │ ├── non_scalar_ptr_offset.ptx │ │ ├── noreturn.ptx │ │ ├── not.ptx │ │ ├── ntid.ptx │ │ ├── or.ptx │ │ ├── param_is_addressable.ptx │ │ ├── popc.ptx │ │ ├── pred_not.ptx │ │ ├── prmt.ptx │ │ ├── prmt_slow.ptx │ │ ├── rcp.ptx │ │ ├── redux_sync_add_u32_partial.ptx │ │ ├── redux_sync_op_s32.ptx │ │ ├── redux_sync_op_u32.ptx │ │ ├── reg_local.ptx │ │ ├── reg_multi.ptx │ │ ├── rem.ptx │ │ ├── rsqrt.ptx │ │ ├── sad_s64.ptx │ │ ├── selp.ptx │ │ ├── selp_true.ptx │ │ ├── set_f16.ptx │ │ ├── setp.ptx │ │ ├── setp_gt.ptx │ │ ├── setp_leu.ptx │ │ ├── setp_nan.ptx │ │ ├── setp_num.ptx │ │ ├── shared_ptr_32.ptx │ │ ├── shared_ptr_take_address.ptx │ │ ├── shared_unify_extern.ptx │ │ ├── shared_unify_local.ptx │ │ ├── shared_variable.ptx │ │ ├── shf_l.ptx │ │ ├── shf_l_clamp.ptx │ │ ├── shf_l_wrap.ptx │ │ ├── shf_r.ptx │ │ ├── shf_r_clamp.ptx │ │ ├── shf_r_wrap.ptx │ │ ├── shfl_sync_bfly_b32_pred.ptx │ │ ├── shfl_sync_down_b32_pred.ptx │ │ ├── shfl_sync_idx_b32_pred.ptx │ │ ├── shfl_sync_mode_b32.ptx │ │ ├── shfl_sync_up_b32_pred.ptx │ │ ├── shl.ptx │ │ ├── shr.ptx │ │ ├── shr_oob.ptx │ │ ├── sign_extend.ptx │ │ ├── sin.ptx │ │ ├── sqrt.ptx │ │ ├── sqrt_rn_ftz.ptx │ │ ├── stateful_ld_st_ntid.ptx │ │ ├── stateful_ld_st_ntid_chain.ptx │ │ ├── stateful_ld_st_ntid_sub.ptx │ │ ├── stateful_ld_st_simple.ptx │ │ ├── stateful_neg_offset.ptx │ │ ├── sub.ptx │ │ ├── sub_extended.ptx │ │ ├── subc_cc_s32.ptx │ │ ├── tanh.ptx │ │ ├── tid.ptx │ │ ├── trap.ptx │ │ ├── uint_to_fp_bf16.ptx │ │ ├── vector.ptx │ │ ├── vector4.ptx │ │ ├── vector8.ptx │ │ ├── vector8_extract.ptx │ │ ├── vector_extract.ptx │ │ ├── vector_operand.ptx │ │ ├── verify.py │ │ ├── vote_all.ptx │ │ ├── vote_all_sub.ptx │ │ ├── vote_any.ptx │ │ ├── vote_ballot.ptx │ │ ├── warp_sz.ptx │ │ └── xor.ptx │ ├── vectorAdd_11.ptx │ └── vectorAdd_kernel64.ptx ├── ptx_parser/ │ ├── Cargo.toml │ └── src/ │ ├── ast.rs │ ├── check_args.py │ └── lib.rs ├── ptx_parser_macros/ │ ├── Cargo.toml │ └── src/ │ └── lib.rs ├── ptx_parser_macros_impl/ │ ├── Cargo.toml │ └── src/ │ ├── lib.rs │ └── parser.rs ├── ptxas/ │ ├── Cargo.toml │ └── src/ │ └── main.rs ├── xtask/ │ ├── Cargo.toml │ └── src/ │ └── main.rs ├── zluda/ │ ├── Cargo.toml │ ├── build.rs │ └── src/ │ ├── impl/ │ │ ├── context.rs │ │ ├── device.rs │ │ ├── driver.rs │ │ ├── event.rs │ │ ├── function.rs │ │ ├── graph.rs │ │ ├── hipfix.rs │ │ ├── kernel.rs │ │ ├── library.rs │ │ ├── memory.rs │ │ ├── mod.rs │ │ ├── module.rs │ │ ├── os_unix.rs │ │ ├── os_win.rs │ │ ├── pointer.rs │ │ └── stream.rs │ ├── lib.rs │ ├── os_unix.rs │ ├── os_win.rs │ └── tests.rs ├── zluda_bindgen/ │ ├── Cargo.toml │ ├── build/ │ │ ├── cublasLt_internal.h │ │ ├── cublas_wrapper.h │ │ ├── cuda_wrapper.h │ │ ├── cudnn_v8/ │ │ │ ├── cudnn_adv_infer.h │ │ │ ├── cudnn_adv_train.h │ │ │ ├── cudnn_backend.h │ │ │ ├── cudnn_cnn_infer.h │ │ │ ├── cudnn_cnn_train.h │ │ │ ├── cudnn_ops_infer.h │ │ │ ├── cudnn_ops_train.h │ │ │ └── cudnn_version.h │ │ ├── cufft_wraper.h │ │ └── decompile_cublaslt_internal.py │ └── src/ │ ├── main.rs │ └── process_table.rs ├── zluda_blas/ │ ├── Cargo.toml │ ├── build.rs │ └── src/ │ ├── impl.rs │ ├── lib.rs │ └── tests.rs ├── zluda_blaslt/ │ ├── Cargo.toml │ ├── build.rs │ └── src/ │ ├── impl.rs │ └── lib.rs ├── zluda_cache/ │ ├── Cargo.toml │ ├── diesel.toml │ ├── migrations/ │ │ ├── .keep │ │ └── 2025-08-04-203347_create_initial/ │ │ ├── down.sql │ │ └── up.sql │ └── src/ │ ├── lib.rs │ ├── models.rs │ └── schema.rs ├── zluda_common/ │ ├── Cargo.toml │ └── src/ │ ├── constants.rs │ ├── lib.rs │ ├── os_unix.rs │ └── os_win.rs ├── zluda_dnn/ │ ├── Cargo.toml │ └── src/ │ ├── impl.rs │ └── lib.rs ├── zluda_dnn8/ │ ├── Cargo.toml │ ├── build.rs │ └── src/ │ └── lib.rs ├── zluda_dnn9/ │ ├── Cargo.toml │ ├── build.rs │ └── src/ │ ├── lib.rs │ └── tests.rs ├── zluda_fft/ │ ├── Cargo.toml │ └── src/ │ ├── impl.rs │ └── lib.rs ├── zluda_inject/ │ ├── Cargo.toml │ ├── build.rs │ ├── src/ │ │ ├── args.rs │ │ ├── bin.rs │ │ ├── main.rs │ │ └── win.rs │ └── tests/ │ ├── helpers/ │ │ ├── direct_cuinit.rs │ │ ├── do_cuinit.rs │ │ ├── do_cuinit_early.rs │ │ ├── do_cuinit_late.rs │ │ ├── do_cuinit_late_clr.cs │ │ ├── indirect_cuinit.rs │ │ └── subprocess.rs │ └── inject.rs ├── zluda_ld/ │ ├── Cargo.toml │ └── src/ │ └── lib.rs ├── zluda_ml/ │ ├── Cargo.toml │ └── src/ │ ├── impl_common.rs │ ├── impl_unix.rs │ ├── impl_win.rs │ └── lib.rs ├── zluda_precompile/ │ ├── Cargo.toml │ └── src/ │ └── main.rs ├── zluda_redirect/ │ ├── Cargo.toml │ └── src/ │ └── lib.rs ├── zluda_sparse/ │ ├── Cargo.toml │ ├── build.rs │ └── src/ │ ├── impl.rs │ └── lib.rs ├── zluda_trace/ │ ├── Cargo.toml │ └── src/ │ ├── dark_api.rs │ ├── lib.rs │ ├── log.rs │ ├── os_unix.rs │ ├── os_win.rs │ └── trace.rs ├── zluda_trace_blas/ │ ├── Cargo.toml │ └── src/ │ └── lib.rs ├── zluda_trace_blaslt/ │ ├── Cargo.toml │ └── src/ │ └── lib.rs ├── zluda_trace_common/ │ ├── Cargo.toml │ └── src/ │ └── lib.rs ├── zluda_trace_dnn8/ │ ├── Cargo.toml │ └── src/ │ └── lib.rs ├── zluda_trace_dnn9/ │ ├── Cargo.toml │ └── src/ │ └── lib.rs ├── zluda_trace_fft/ │ ├── Cargo.toml │ └── src/ │ └── lib.rs ├── zluda_trace_nvml/ │ ├── Cargo.toml │ └── src/ │ └── lib.rs ├── zluda_trace_sparse/ │ ├── Cargo.toml │ └── src/ │ └── lib.rs └── zluda_windows/ ├── Cargo.toml ├── library.manifest ├── manifest.rc └── src/ └── lib.rs ================================================ FILE CONTENTS ================================================ ================================================ FILE: .cargo/config.toml ================================================ [alias] xtask = "run --package xtask --" [target.x86_64-pc-windows-msvc] rustflags = ["-Ctarget-feature=+crt-static"] ================================================ FILE: .devcontainer/Dockerfile ================================================ FROM nvidia/cuda:13.0.1-base-ubuntu24.04 RUN DEBIAN_FRONTEND=noninteractive apt update -y && DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \ wget \ build-essential \ cmake \ ninja-build \ python3 \ ripgrep \ git \ ltrace \ # required by llvm 17 lsb-release software-properties-common gnupg ARG LLVM_VERSION=17 RUN wget https://apt.llvm.org/llvm.sh && \ chmod +x llvm.sh && \ ./llvm.sh ${LLVM_VERSION} # Feel free to change to a newer version if you have a newer verison on your host ARG CUDA_PKG_VERSION=13-0 # Docker <-> host driver version compatiblity is newer host <-> older docker # Driver 580+ is required for CUDA 13 ARG CUDA_DRIVER=580 RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/libcudnn8-dev_8.9.7.29-1+cuda12.2_amd64.deb && \ dpkg-deb -R libcudnn8-dev_8.9.7.29-1+cuda12.2_amd64.deb /opt && \ rm libcudnn8-dev_8.9.7.29-1+cuda12.2_amd64.deb RUN DEBIAN_FRONTEND=noninteractive apt update -y && DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \ # CUDA headers need it for interop libgl-dev libegl-dev libvdpau-dev \ nvidia-headless-no-dkms-${CUDA_DRIVER}-open \ cuda-cudart-dev-${CUDA_PKG_VERSION} \ cuda-nvml-dev-${CUDA_PKG_VERSION} \ cuda-cudart-${CUDA_PKG_VERSION} \ cuda-profiler-api-${CUDA_PKG_VERSION} \ cuda-nvcc-${CUDA_PKG_VERSION} \ cudnn9-cuda-${CUDA_PKG_VERSION} \ libcufft-dev-${CUDA_PKG_VERSION} \ libcublas-dev-${CUDA_PKG_VERSION} \ libcusparse-dev-${CUDA_PKG_VERSION} ARG ROCM_VERSION=6.4.4 RUN mkdir --parents --mode=0755 /etc/apt/keyrings && \ wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | \ gpg --dearmor | tee /etc/apt/keyrings/rocm.gpg > /dev/null && \ echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/${ROCM_VERSION} noble main" > /etc/apt/sources.list.d/rocm.list && \ echo 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' > /etc/apt/preferences.d/rocm-pin-600 && \ DEBIAN_FRONTEND=noninteractive apt update -y && DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \ rocminfo \ rocm-gdb \ rocm-smi-lib amd-smi-lib \ rocm-llvm-dev \ hip-runtime-amd \ miopen-hip-dev \ rocfft-dev \ rocblas-dev \ hipblaslt-dev \ rocsolver-dev \ rocsparse-dev \ hip-dev && \ echo '/opt/rocm/lib' > /etc/ld.so.conf.d/rocm.conf && \ ldconfig ENV PATH=$PATH:/opt/rocm-${ROCM_VERSION}/bin ================================================ FILE: .devcontainer/devcontainer.json ================================================ // For format details, see https://aka.ms/devcontainer.json. For config options, see the // README at: https://github.com/devcontainers/templates/tree/main/src/rust { "name": "zluda", "build": { "dockerfile": "Dockerfile" }, "securityOpt": [ "seccomp=unconfined" ], "runArgs": [ //"--runtime=nvidia", "--device=/dev/kfd", "--device=/dev/dri", "--group-add=video" ], "mounts": [ { "source": "${localEnv:HOME}/.cargo/", "target": "/root/.cargo", "type": "bind" } ], // https://containers.dev/features. "features": { "ghcr.io/devcontainers/features/rust:1": {} }, // https://aka.ms/dev-containers-non-root. "remoteUser": "root", "hostRequirements": { "gpu": true }, "customizations": { "vscode": { "extensions": [ "mhutchie.git-graph" ] } }, "containerEnv": { "NVIDIA_DISABLE_REQUIRE": "1" } } ================================================ FILE: .git-blame-ignore-revs ================================================ 21ef5f60a3a5efa17855a30f6b5c7d1968cd46ba ================================================ FILE: .gitattributes ================================================ ext/** linguist-vendored *.dll filter=lfs diff=lfs merge=lfs -text *.bc filter=lfs diff=lfs merge=lfs -text ================================================ FILE: .github/ISSUE_TEMPLATE/config.yml ================================================ blank_issues_enabled: true ================================================ FILE: .github/ISSUE_TEMPLATE/zluda_dump.yml ================================================ name: Bug Report description: Report an issue with ZLUDA body: - type: markdown attributes: value: | If you are reporting an application that is not supported by ZLUDA, please use zluda_trace to create logs. See instructions here: https://zluda.readthedocs.io/latest/troubleshooting.html - type: textarea id: logs attributes: label: zluda_trace logs (tarball/zip file) description: | Please create a tarball (`.tar.gz`) or zip file (`.zip`) of your log directory and attach it here. You can drag and drop files directly into the comment box. Please also include zluda_trace logs using CUDA if you have NVIDIA hardware to test on. placeholder: Attach file (e.g., drag and drop) validations: required: false - type: textarea id: description attributes: label: Description description: | Describe the issue you've encountered. What is the expected behavior? What is the actual behavior? placeholder: Description validations: required: false - type: textarea id: reproduce attributes: label: Steps to reproduce description: | Please describe the application you were running and provide clear, step-by-step instructions to run it. placeholder: | example: 1. Download llm.c: git clone https://github.com/karpathy/llm.c.git 2. Navigate to the directory: cd llm.c 3. Download the model and train it: chmod u+x ./dev/download_starter_pack.sh ./dev/download_starter_pack.sh make train_gpt2fp32cu ./train_gpt2fp32cu 4. Build and run the tests: make test_gpt2fp32cu LD_LIBRARY_PATH= ./test_gpt2fp32cu validations: required: true - type: input id: version attributes: label: ZLUDA version description: What version of ZLUDA are you using? Due to legal issues **versions older than 4 are not supported** placeholder: "example: 5-preview.113" validations: required: true - type: input id: os attributes: label: Operating System description: What operating system are you using? (e.g., distribution and version) placeholder: "example: Ubuntu 22.04.5 LTS" validations: required: true - type: input id: gpu attributes: label: GPU description: What GPU are you using? placeholder: "example: AMD Radeon RX 6600" validations: required: true ================================================ FILE: .github/workflows/move_tests.sh ================================================ #!/bin/bash set -ex TEST_EXECUTABLES_DIR=$1 SUFFIX=$2 ls ${TEST_EXECUTABLES_DIR}/* | sort -u | while read -r executable; do output=$("$executable" --list 2>/dev/null) exit_code=$? if [ $exit_code -eq 0 ] && echo "$output" | grep -q "_${SUFFIX}: test$"; then mv "$executable" "${TEST_EXECUTABLES_DIR}/../${SUFFIX}/" fi done ================================================ FILE: .github/workflows/nightly_tests.yml ================================================ name: Nightly tests on: workflow_call: workflow_dispatch: env: ROCM_VERSION: "6.3.4" AMDGPU_VERSION: "6.4.4" TEST_THREADS: 24 jobs: run_tests: runs-on: gpu_large steps: - uses: actions/checkout@v4 with: repository: 'vosen/ZLUDA' path: zluda-src sparse-checkout: | .github/workflows/rocm_setup_run.sh - name: Install ROCm run: sudo bash zluda-src/.github/workflows/rocm_setup_run.sh ${{ env.ROCM_VERSION }} ${{ env.AMDGPU_VERSION }} - uses: actions/checkout@v4 with: repository: 'vosen/ptx_tests' - uses: robinraju/release-downloader@v1 with: repository: 'vosen/ZLUDA' latest: true preRelease: true extract: true fileName: 'zluda-linux-*.tar.gz' - name: Build and run run: | DEBIAN_FRONTEND=noninteractive sudo apt install -y --no-install-recommends curl curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain nightly --profile minimal -y source ~/.cargo/env pids=() exit_codes=() for i in $(seq 0 $((${{ env.TEST_THREADS }} - 1))); do cargo run -r -- zluda/libcuda.so.1 --shard-index $i --shard-count ${{ env.TEST_THREADS }} > output_$i.log 2>&1 & pids+=($!) done for pid in "${pids[@]}"; do wait $pid exit_codes+=($?) done error_occurred=0 for i in "${!exit_codes[@]}"; do if [ ${exit_codes[$i]} -ne 0 ]; then error_occurred=1 fi done exit $error_occurred - name: Upload logs if: always() uses: actions/upload-artifact@v4 with: name: output_logs path: output_*.log ================================================ FILE: .github/workflows/pr_master.yml ================================================ name: ZLUDA on: pull_request: branches: [ master ] env: CARGO_TERM_COLOR: always CARGO_PROFILE: release SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" SCCACHE_MAX_FRAME_LENGTH: "104857600" # 100 MB ROCM_VERSION: "6.3.4" AMDGPU_VERSION: "6.4.4" jobs: check_whitespace: name: Check Whitespace runs-on: ubuntu-22.04 steps: - run: | sudo apt install fd-find fdfind \ --exclude '*.bc' \ --exclude '*.exe' \ --exclude '*.lib' \ --exclude ext/detours \ --strip-cwd-prefix \ --type file \ --exec bash -c ' diff \ --unified \ --label "a/$0" \ --label "b/$0" \ <(cat "$0") \ <(sed --regexp-extended "s/\s+$//; \$a\\" "$0") ' formatting: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - uses: actions-rust-lang/setup-rust-toolchain@v1 with: components: rustfmt - name: Check Rust formatting uses: actions-rust-lang/rustfmt@v1 build_linux: name: Build (Linux) runs-on: ubuntu-22.04 steps: - uses: jlumbroso/free-disk-space@v1.3.1 - uses: actions/checkout@v4 with: lfs: true submodules: true - name: Install ROCm run: sudo bash .github/workflows/rocm_setup_build.sh ${{ env.ROCM_VERSION }} - name: Run sccache-cache uses: mozilla-actions/sccache-action@v0.0.9 - name: Build # https://github.com/actions/upload-artifact/issues/39 run: | cargo xtask zip --profile ${{ env.CARGO_PROFILE }} mkdir target/${{ env.CARGO_PROFILE }}/zluda tar -xzf target/${{ env.CARGO_PROFILE }}/zluda.tar.gz -C target/${{ env.CARGO_PROFILE }}/zluda - name: Set revision hash run: echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV - name: Upload uses: actions/upload-artifact@v4 with: name: zluda-linux-${{ env.SHORT_SHA }} path: target/${{ env.CARGO_PROFILE }}/zluda build_windows: name: Build (Windows) runs-on: windows-2022 steps: - uses: actions/checkout@v4 with: lfs: true submodules: true - name: Run sccache-cache uses: mozilla-actions/sccache-action@v0.0.9 - name: Build run: | cargo xtask zip --profile ${{ env.CARGO_PROFILE }} Expand-Archive -Path target/${{ env.CARGO_PROFILE }}/zluda.zip -DestinationPath target/${{ env.CARGO_PROFILE }}/zluda - name: Set revision hash run: echo "SHORT_SHA=$("${{ github.sha }}".SubString(0, 7))" >> $env:GITHUB_ENV - name: Upload uses: actions/upload-artifact@v4 with: name: zluda-windows-${{ env.SHORT_SHA }} path: target/${{ env.CARGO_PROFILE }}/zluda build_tests: name: Build AMD GPU unit tests runs-on: gpu_small outputs: test_package: ${{ steps.upload_artifacts.outputs.artifact-id }} steps: - uses: jlumbroso/free-disk-space@v1.3.1 - name: Install build tools run: | sudo apt update sudo apt install -y git git-lfs build-essential cmake - uses: actions/checkout@v4 with: lfs: true submodules: true - uses: actions-rust-lang/setup-rust-toolchain@v1 with: rustflags: "" - name: Install ROCm run: sudo bash .github/workflows/rocm_setup_build.sh ${{ env.ROCM_VERSION }} - name: Run sccache-cache uses: mozilla-actions/sccache-action@v0.0.9 - uses: taiki-e/install-action@v2 with: tool: cargo-export - name: Build run: | cargo export target/tests -- test --features ci_build --workspace \ --exclude cuda_macros \ --exclude ptx_parser_macros \ --exclude zluda_inject \ --exclude zluda_redirect mkdir -p target/amdgpu bash .github/workflows/move_tests.sh target/tests amdgpu strip target/amdgpu/* - name: Upload id: upload_artifacts uses: actions/upload-artifact@v4 with: name: tests path: target/amdgpu retention-days: 7 run_tests: name: Run AMD GPU unit tests runs-on: gpu_small needs: [build_tests] steps: - uses: actions/checkout@v4 with: submodules: false sparse-checkout: .github - name: Install ROCm run: sudo bash .github/workflows/rocm_setup_run.sh ${{ env.ROCM_VERSION }} ${{ env.AMDGPU_VERSION }} - uses: actions/download-artifact@v4 with: artifact-ids: ${{ needs.build_tests.outputs.test_package }} path: target - name: Run tests run: | chmod +x target/tests/* error_occurred=0 for exe in target/tests/*; do ./"$exe" _amdgpu || { error_occurred=1; true; } done exit $error_occurred ================================================ FILE: .github/workflows/push_master.yml ================================================ name: ZLUDA on: workflow_dispatch: push: branches: [ master ] env: CARGO_TERM_COLOR: always CARGO_PROFILE: release-lto SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" SCCACHE_MAX_FRAME_LENGTH: "104857600" # 100 MB ROCM_VERSION: "6.3.4" AMDGPU_VERSION: "6.4.4" jobs: build_linux: name: Build (Linux) runs-on: ubuntu-22.04 permissions: contents: write steps: - uses: jlumbroso/free-disk-space@v1.3.1 - uses: actions/checkout@v4 # fetch-depth and fetch-tags are required to properly tag pre-release builds with: fetch-depth: 0 fetch-tags: true lfs: true submodules: true - name: Install ROCm run: sudo bash .github/workflows/rocm_setup_build.sh ${{ env.ROCM_VERSION }} - name: Run sccache-cache uses: mozilla-actions/sccache-action@v0.0.9 - name: Build # https://github.com/actions/upload-artifact/issues/39 run: | cargo xtask zip --profile ${{ env.CARGO_PROFILE }} mkdir target/${{ env.CARGO_PROFILE }}/zluda tar -xzf target/${{ env.CARGO_PROFILE }}/zluda.tar.gz -C target/${{ env.CARGO_PROFILE }}/zluda - name: Set revision hash run: echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV - name: Upload uses: actions/upload-artifact@v4 with: name: zluda-linux-${{ env.SHORT_SHA }} path: target/${{ env.CARGO_PROFILE }}/zluda - name: Prepare artifact for release run: | mv target/${{ env.CARGO_PROFILE }}/zluda.tar.gz target/${{ env.CARGO_PROFILE }}/zluda-linux-${{ env.SHORT_SHA }}.tar.gz latest_tag=$(git tag -l "v*" | grep -E "^v[0-9]+$" | sort -V | tail -n 1) next_version="$((${latest_tag:1} + 1))" offset=$(git rev-list $latest_tag..HEAD --count) echo "VERSION=$next_version-preview.$offset" >> $GITHUB_OUTPUT id: prepare_artifacts - uses: ncipollo/release-action@v1 with: prerelease: true generateReleaseNotes: true allowUpdates: true omitNameDuringUpdate: true artifacts: "target/${{ env.CARGO_PROFILE }}/zluda-linux-${{ env.SHORT_SHA }}.tar.gz" name: "Version ${{ steps.prepare_artifacts.outputs.VERSION }}" tag: "v${{ steps.prepare_artifacts.outputs.VERSION }}" build_windows: name: Build (Windows) runs-on: windows-2022 permissions: contents: write steps: - uses: actions/checkout@v4 # fetch-depth and fetch-tags are required to properly tag pre-release builds with: fetch-depth: 0 fetch-tags: true lfs: true submodules: true - name: Run sccache-cache uses: mozilla-actions/sccache-action@v0.0.9 - name: Build run: | cargo xtask zip --profile ${{ env.CARGO_PROFILE }} Expand-Archive -Path target/${{ env.CARGO_PROFILE }}/zluda.zip -DestinationPath target/${{ env.CARGO_PROFILE }}/zluda - name: Set revision hash run: echo "SHORT_SHA=$("${{ github.sha }}".SubString(0, 7))" >> $env:GITHUB_ENV - name: Upload uses: actions/upload-artifact@v4 with: name: zluda-windows-${{ env.SHORT_SHA }} path: target/${{ env.CARGO_PROFILE }}/zluda - name: Prepare artifact for release shell: bash working-directory: ${{ github.workspace }} run: | mv target/${{ env.CARGO_PROFILE }}/zluda.zip target/${{ env.CARGO_PROFILE }}/zluda-windows-${{ env.SHORT_SHA }}.zip latest_tag=$(git tag -l "v*" | grep -E "^v[0-9]+$" | sort -V | tail -n 1) next_version="$((${latest_tag:1} + 1))" offset=$(git rev-list $latest_tag..HEAD --count) echo "VERSION=$next_version-preview.$offset" >> $GITHUB_OUTPUT id: prepare_artifacts - uses: ncipollo/release-action@v1 with: prerelease: true generateReleaseNotes: true allowUpdates: true omitNameDuringUpdate: true artifacts: "target/${{ env.CARGO_PROFILE }}/zluda-windows-${{ env.SHORT_SHA }}.zip" name: "Version ${{ steps.prepare_artifacts.outputs.VERSION }}" tag: "v${{ steps.prepare_artifacts.outputs.VERSION }}" build_tests: name: Build AMD GPU unit tests runs-on: gpu_small outputs: test_package: ${{ steps.upload_artifacts.outputs.artifact-id }} steps: - uses: jlumbroso/free-disk-space@v1.3.1 - name: Install build tools run: | sudo apt update sudo apt install -y git git-lfs build-essential cmake - uses: actions/checkout@v4 with: lfs: true submodules: true - uses: actions-rust-lang/setup-rust-toolchain@v1 with: rustflags: "" - name: Install ROCm run: sudo bash .github/workflows/rocm_setup_build.sh ${{ env.ROCM_VERSION }} ${{ env.AMDGPU_VERSION }} - name: Run sccache-cache uses: mozilla-actions/sccache-action@v0.0.9 - uses: taiki-e/install-action@v2 with: tool: cargo-export - name: Build run: | cargo export target/tests -- test --features ci_build --workspace \ --exclude cuda_macros \ --exclude ptx_parser_macros \ --exclude zluda_inject \ --exclude zluda_redirect mkdir -p target/amdgpu bash .github/workflows/move_tests.sh target/tests amdgpu strip target/amdgpu/* - name: Upload id: upload_artifacts uses: actions/upload-artifact@v4 with: name: tests path: target/amdgpu retention-days: 7 run_tests: name: Run AMD GPU unit tests runs-on: gpu_small needs: [build_tests] steps: - uses: actions/checkout@v4 with: submodules: false sparse-checkout: .github - name: Install ROCm run: sudo bash .github/workflows/rocm_setup_run.sh ${{ env.ROCM_VERSION }} ${{ env.AMDGPU_VERSION }} - uses: actions/download-artifact@v4 with: artifact-ids: ${{ needs.build_tests.outputs.test_package }} path: target - name: Run tests run: | chmod +x target/tests/* error_occurred=0 for exe in target/tests/*; do ./"$exe" _amdgpu || { error_occurred=1; true; } done exit $error_occurred ================================================ FILE: .github/workflows/rocm_setup_build.sh ================================================ #!/bin/bash set -ex ROCM_VERSION=$1 DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends gpg patchelf # Source: https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/install-methods/package-manager/package-manager-ubuntu.html mkdir --parents --mode=0755 /etc/apt/keyrings wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | \ gpg --dearmor | tee /etc/apt/keyrings/rocm.gpg > /dev/null echo deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/$ROCM_VERSION jammy main | tee /etc/apt/sources.list.d/rocm.list echo -e 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' \ | tee /etc/apt/preferences.d/rocm-pin-600 DEBIAN_FRONTEND=noninteractive apt update -y DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends rocm-smi-lib rocm-llvm-dev hip-runtime-amd hip-dev rocblas-dev hipblaslt-dev miopen-hip-dev rocsparse-dev echo 'export PATH="$PATH:/opt/rocm/bin"' | tee /etc/profile.d/rocm.sh echo "/opt/rocm/lib" | tee /etc/ld.so.conf.d/rocm.conf ldconfig ================================================ FILE: .github/workflows/rocm_setup_run.sh ================================================ #!/bin/bash set -ex ROCM_VERSION=$1 AMDGPU_VERSION=$2 DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends gpg zstd unzip "linux-headers-$(uname -r)" "linux-modules-extra-$(uname -r)" # Source: https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/install-methods/package-manager/package-manager-ubuntu.html mkdir --parents --mode=0755 /etc/apt/keyrings wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | \ gpg --dearmor | tee /etc/apt/keyrings/rocm.gpg > /dev/null echo deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/$ROCM_VERSION noble main | tee /etc/apt/sources.list.d/rocm.list echo deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/amdgpu/$AMDGPU_VERSION/ubuntu noble main | tee /etc/apt/sources.list.d/amdgpu.list echo -e 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' \ | tee /etc/apt/preferences.d/rocm-pin-600 DEBIAN_FRONTEND=noninteractive apt update -y # rocm-smi-lib shouldn't be necessary, but somehow ptx tests started linking to it. # Result of Rust 1.90 linker change? DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends amdgpu-dkms hip-runtime-amd rocm-smi-lib echo 'export PATH="$PATH:/opt/rocm/bin"' | tee /etc/profile.d/rocm.sh echo "/opt/rocm/lib" | tee /etc/ld.so.conf.d/rocm.conf ldconfig #Grant access to GPUs to all users via udev rules cat <<'EOF' > /etc/udev/rules.d/70-amdgpu.rules KERNEL=="kfd", MODE="0666" SUBSYSTEM=="drm", KERNEL=="renderD*", MODE="0666" EOF udevadm control --reload-rules && udevadm trigger modprobe amdgpu ================================================ FILE: .github/workflows/trigger_nightly_tests.yml ================================================ name: Trigger nightly tests on: schedule: - cron: "0 8 * * *" jobs: check_last_nightly_run: runs-on: 'ubuntu-latest' outputs: last_sha: ${{ fromJson(steps.check_last_run.outputs.data).workflow_runs[0].head_sha }} steps: - uses: octokit/request-action@v2.4.0 id: check_last_run with: route: GET /repos/${{github.repository}}/actions/workflows/nightly_tests.yml/runs?per_page=1&status=completed env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: "echo Last nightly build: ${{ fromJson(steps.check_last_run.outputs.data).workflow_runs[0].head_sha }}" build: needs: [check_last_nightly_run] if: needs.check_last_nightly_run.outputs.last_sha != github.sha uses: ./.github/workflows/nightly_tests.yml secrets: inherit ================================================ FILE: .gitignore ================================================ target/ Cargo.lock .vscode/ .idea/ ptx/lib/zluda_ptx_impl.ll ================================================ FILE: .gitmodules ================================================ [submodule "ext/llvm-project"] path = ext/llvm-project url = https://github.com/vosen/llvm-project.git branch = main shallow = true [submodule "ext/HiGHS"] path = ext/HiGHS url = https://github.com/ERGO-Code/HiGHS.git shallow = true ================================================ FILE: .rustfmt.toml ================================================ newline_style = "Unix" ================================================ FILE: Cargo.toml ================================================ [workspace] resolver = "2" members = [ "cuda_check", "cuda_macros", "cuda_types", "dark_api", "detours-sys", "ext/highs-sys", "ext/hip_runtime-sys", "ext/hipblaslt-sys", "ext/miopen-sys", "ext/rocblas-sys", "format", "ptx", "ptx_parser", "ptx_parser_macros", "ptx_parser_macros_impl", "ptxas", "xtask", "zluda", "zluda_bindgen", "zluda_blas", "zluda_blaslt", "zluda_cache", "zluda_common", "zluda_dnn", "zluda_dnn8", "zluda_dnn9", "zluda_trace", "zluda_trace_blas", "zluda_trace_blaslt", "zluda_trace_common", "zluda_trace_dnn8", "zluda_trace_dnn9", "zluda_trace_fft", "zluda_trace_nvml", "zluda_trace_sparse", "zluda_fft", "zluda_inject", "zluda_ld", "zluda_ml", "zluda_precompile", "zluda_redirect", "zluda_sparse", "compiler", ] default-members = ["zluda", "zluda_ml", "zluda_inject", "zluda_redirect", "compiler"] [profile.release-lto] inherits = "release" codegen-units = 1 lto = true # By default (even in dev) we build LLVM in Release (opt-level is controlled # by cmake). That's because LLVM in Debug is excruciatingly slow and makes any # kind of debugging impossible. This profile is a special configuration for when # you want to build LLVM in Debug [profile.dev-llvm] inherits = "dev" [profile.dev-llvm.package.xtask] opt-level = 2 [profile.dev.package.xtask] opt-level = 2 [patch.crates-io] highs-sys = { path = "ext/highs-sys" } ================================================ FILE: LICENSE-APACHE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS ================================================ FILE: LICENSE-MIT ================================================ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================ ZLUDA is a drop-in replacement for CUDA on non-NVIDIA GPUs. ZLUDA allows running unmodified CUDA applications using non-NVIDIA GPUs with near-native performance
[](https://zluda.readthedocs.io) [](https://discord.gg/sg6BNzXuc7) [](https://vosen.github.io/ZLUDA/)
================================================ FILE: compiler/Cargo.toml ================================================ [package] name = "compiler" description = "ZLUDA offline compiler" version = "0.0.0" authors = ["Joëlle van Essen "] edition = "2021" [[bin]] name = "zoc" path = "src/main.rs" [dependencies] bpaf = { version = "0.9.19", features = ["derive", "bright-color"] } llvm_zluda = { path = "../llvm_zluda" } ptx = { path = "../ptx" } ptx_parser = { path = "../ptx_parser" } libloading = "0.8" thiserror = "2.0.12" [package.metadata.zluda] debug_only = true ================================================ FILE: compiler/src/error.rs ================================================ use ptx::TranslateError; use ptx_parser::PtxError; use std::ffi::FromBytesUntilNulError; use std::io; use std::str::Utf8Error; #[derive(Debug, thiserror::Error)] pub enum CompilerError { #[error("HIP error code: {0:?}")] HipError(u32), #[error(transparent)] Libloading(#[from] libloading::Error), #[error(transparent)] IoError(#[from] io::Error), #[error(transparent)] Utf8Error(#[from] Utf8Error), #[error(transparent)] FromBytesUntilNulError(#[from] FromBytesUntilNulError), #[error("{message}")] GenericError { #[source] cause: Option>, message: String, }, } impl From>> for CompilerError { fn from(causes: Vec) -> Self { let errors: Vec = causes .iter() .map(|e| { let msg = match e { PtxError::UnrecognizedStatement(value) | PtxError::UnrecognizedDirective(value) => value.to_string(), other => other.to_string(), }; format!("PtxError::{}: {}", e.as_ref(), msg) }) .collect(); let message = errors.join("\n"); CompilerError::GenericError { cause: None, message, } } } impl From for CompilerError { fn from(cause: TranslateError) -> Self { let message = format!("PTX TranslateError::{}", cause.as_ref()); let cause = Some(Box::new(cause) as Box); CompilerError::GenericError { cause, message } } } impl From for CompilerError { fn from(message: String) -> Self { Self::GenericError { cause: None, message, } } } ================================================ FILE: compiler/src/main.rs ================================================ use bpaf::Bpaf; use error::CompilerError; use std::ffi::CStr; use std::fs::{self, File}; use std::io::{self, Write}; use std::path::{Path, PathBuf}; use std::process::ExitCode; use std::str; use std::time::Instant; use std::{env, mem}; mod error; const DEFAULT_ARCH: &'static str = "gfx1100"; #[derive(Debug, Clone, Bpaf)] #[bpaf(options, version)] pub struct Options { #[bpaf(argument("output-dir"))] /// Output directory output_dir: Option, #[bpaf(long("arch"))] /// Target GPU architecture arch: Option, #[bpaf(long("ignore-errors"))] /// Try to ignore errors. This will try and produce output even if there are /// parsing errors (e.g. an unimplemented instruction) ignore_errors: bool, #[bpaf(positional("filename"))] /// PTX file ptx_path: String, } fn main() -> ExitCode { if let Err(e) = main_core() { eprintln!("Error: {}", e); return ExitCode::FAILURE; } ExitCode::SUCCESS } fn main_core() -> Result<(), CompilerError> { let opts = options().run(); let ptx_path = Path::new(&opts.ptx_path).to_path_buf(); let filename_base = ptx_path .file_name() .map(|osstr| osstr.to_str().unwrap_or("output")) .unwrap_or("output"); let mut output_path = match opts.output_dir { Some(value) => { std::fs::create_dir_all(&value)?; value } None => match ptx_path.parent() { Some(dir) => dir.to_path_buf(), None => env::current_dir()?, }, }; output_path.push(filename_base); let arch: String = match opts.arch { Some(s) => s, None => (|| { let runtime = hip::Runtime::load()?; runtime.init()?; get_gpu_arch(&runtime) })() .unwrap_or_else(|_| DEFAULT_ARCH.to_owned()), }; let ptx = fs::read(&ptx_path).map_err(CompilerError::from)?; let ptx = str::from_utf8(&ptx).map_err(CompilerError::from)?; let llvm = ptx_to_llvm(opts.ignore_errors, ptx).map_err(CompilerError::from)?; write_to_file(&llvm.llvm_ir, output_path.with_extension("ll").as_path())?; let compiler_hook = |bytes: &Vec, extension: String| { let output_path = output_path.with_extension(extension); write_to_file(bytes, &output_path).unwrap(); }; let mut start = Instant::now(); llvm_zluda::compile( &llvm.context, &arch, llvm.main, &llvm.linked_bitcode, llvm.attributes, Some(&compiler_hook), )?; report_pass_time("compile_bitcode", &mut start); Ok(()) } fn ptx_to_llvm(ignore_errors: bool, ptx: &str) -> Result { let ast = if ignore_errors { ptx_parser::parse_module_unchecked(ptx) } else { ptx_parser::parse_module_checked(ptx).map_err(CompilerError::from)? }; let mut start = Instant::now(); let module = ptx::to_llvm_module( ast, ptx::Attributes { clock_rate: 2124000, }, |pass| { report_pass_time(pass, &mut start); }, ) .map_err(CompilerError::from)?; let llvm_ir = module.llvm_ir.print_module_to_string().to_bytes().to_vec(); let linked_bitcode = module.linked_bitcode().to_vec(); let main = module.llvm_ir; let attributes = module.attributes_ir; Ok(LLVMArtifacts { context: module.context, main, linked_bitcode, attributes, llvm_ir, }) } fn report_pass_time(pass: &str, start: &mut Instant) { let duration = start.elapsed(); println!("Pass {:?} took {:?}", pass, duration); *start = Instant::now(); } struct LLVMArtifacts { main: llvm_zluda::utils::Module, attributes: llvm_zluda::utils::Module, context: llvm_zluda::utils::Context, linked_bitcode: Vec, llvm_ir: Vec, } fn get_gpu_arch(runtime: &hip::Runtime) -> Result { let mut dev_props = unsafe { mem::zeroed() }; runtime.device_get_properties(&mut dev_props, 0)?; let gcn_arch_name = &dev_props.gcnArchName; let gcn_arch_name = unsafe { CStr::from_ptr(gcn_arch_name.as_ptr()) }; let gcn_arch_name = gcn_arch_name.to_str()?; Ok(gcn_arch_name.to_string()) } fn write_to_file(content: &[u8], path: &Path) -> io::Result<()> { let mut file = File::create(path)?; file.write_all(content)?; file.flush()?; println!("Wrote to {}", path.to_str().unwrap()); Ok(()) } mod hip { use crate::error::CompilerError; // We lazy load HIP runtime because we want to work on systems with no // HIP driver installed pub struct Runtime(libloading::Library); impl Runtime { fn hip_check(err: u32) -> Result<(), CompilerError> { match err { 0 => Ok(()), err_code => Err(CompilerError::HipError(err_code)), } } pub fn load() -> Result { #[cfg(windows)] let lib_name_6 = "amdhip64_6.dll\0"; #[cfg(windows)] let lib_name_7 = "amdhip64_7.dll\0"; #[cfg(unix)] let lib_name_6 = "libamdhip64.so.6\0"; #[cfg(unix)] let lib_name_7 = "libamdhip64.so.7\0"; let library = unsafe { libloading::Library::new(lib_name_7) .or_else(|_| libloading::Library::new(lib_name_6))? }; Ok(Self(library)) } pub fn init(&self) -> Result<(), CompilerError> { unsafe { let hip_init: libloading::Symbol u32> = self.0.get(b"hipInit\0")?; Self::hip_check(hip_init(0)) } } pub fn device_get_properties( &self, prop: &mut hipDeviceProp_tR0600, device: i32, ) -> Result<(), CompilerError> { unsafe { let hip_get_device_properties: libloading::Symbol< unsafe extern "C" fn(*mut hipDeviceProp_tR0600, i32) -> u32, > = self.0.get(b"hipGetDevicePropertiesR0600\0")?; Self::hip_check(hip_get_device_properties(prop, device)) } } } #[allow(non_snake_case, non_camel_case_types)] #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct hipDeviceProp_tR0600 { ///< Device name. pub name: [::core::ffi::c_char; 256usize], ///< UUID of a device pub uuid: hipUUID, ///< 8-byte unique identifier. Only valid on windows pub luid: [::core::ffi::c_char; 8usize], ///< LUID node mask pub luidDeviceNodeMask: ::core::ffi::c_uint, ///< Size of global memory region (in bytes). pub totalGlobalMem: usize, ///< Size of shared memory per block (in bytes). pub sharedMemPerBlock: usize, ///< Registers per block. pub regsPerBlock: ::core::ffi::c_int, ///< Warp size. pub warpSize: ::core::ffi::c_int, /**< Maximum pitch in bytes allowed by memory copies < pitched memory*/ pub memPitch: usize, ///< Max work items per work group or workgroup max size. pub maxThreadsPerBlock: ::core::ffi::c_int, ///< Max number of threads in each dimension (XYZ) of a block. pub maxThreadsDim: [::core::ffi::c_int; 3usize], ///< Max grid dimensions (XYZ). pub maxGridSize: [::core::ffi::c_int; 3usize], ///< Max clock frequency of the multiProcessors in khz. pub clockRate: ::core::ffi::c_int, /**< Size of shared constant memory region on the device < (in bytes).*/ pub totalConstMem: usize, /**< Major compute capability. On HCC, this is an approximation and features may < differ from CUDA CC. See the arch feature flags for portable ways to query < feature caps.*/ pub major: ::core::ffi::c_int, /**< Minor compute capability. On HCC, this is an approximation and features may < differ from CUDA CC. See the arch feature flags for portable ways to query < feature caps.*/ pub minor: ::core::ffi::c_int, ///< Alignment requirement for textures pub textureAlignment: usize, ///< Pitch alignment requirement for texture references bound to pub texturePitchAlignment: usize, ///< Deprecated. Use asyncEngineCount instead pub deviceOverlap: ::core::ffi::c_int, ///< Number of multi-processors (compute units). pub multiProcessorCount: ::core::ffi::c_int, ///< Run time limit for kernels executed on the device pub kernelExecTimeoutEnabled: ::core::ffi::c_int, ///< APU vs dGPU pub integrated: ::core::ffi::c_int, ///< Check whether HIP can map host memory pub canMapHostMemory: ::core::ffi::c_int, ///< Compute mode. pub computeMode: ::core::ffi::c_int, ///< Maximum number of elements in 1D images pub maxTexture1D: ::core::ffi::c_int, ///< Maximum 1D mipmap texture size pub maxTexture1DMipmap: ::core::ffi::c_int, ///< Maximum size for 1D textures bound to linear memory pub maxTexture1DLinear: ::core::ffi::c_int, ///< Maximum dimensions (width, height) of 2D images, in image elements pub maxTexture2D: [::core::ffi::c_int; 2usize], ///< Maximum number of elements in 2D array mipmap of images pub maxTexture2DMipmap: [::core::ffi::c_int; 2usize], ///< Maximum 2D tex dimensions if tex are bound to pitched memory pub maxTexture2DLinear: [::core::ffi::c_int; 3usize], ///< Maximum 2D tex dimensions if gather has to be performed pub maxTexture2DGather: [::core::ffi::c_int; 2usize], /**< Maximum dimensions (width, height, depth) of 3D images, in image < elements*/ pub maxTexture3D: [::core::ffi::c_int; 3usize], ///< Maximum alternate 3D texture dims pub maxTexture3DAlt: [::core::ffi::c_int; 3usize], ///< Maximum cubemap texture dims pub maxTextureCubemap: ::core::ffi::c_int, ///< Maximum number of elements in 1D array images pub maxTexture1DLayered: [::core::ffi::c_int; 2usize], ///< Maximum number of elements in 2D array images pub maxTexture2DLayered: [::core::ffi::c_int; 3usize], ///< Maximum cubemaps layered texture dims pub maxTextureCubemapLayered: [::core::ffi::c_int; 2usize], ///< Maximum 1D surface size pub maxSurface1D: ::core::ffi::c_int, ///< Maximum 2D surface size pub maxSurface2D: [::core::ffi::c_int; 2usize], ///< Maximum 3D surface size pub maxSurface3D: [::core::ffi::c_int; 3usize], ///< Maximum 1D layered surface size pub maxSurface1DLayered: [::core::ffi::c_int; 2usize], ///< Maximum 2D layared surface size pub maxSurface2DLayered: [::core::ffi::c_int; 3usize], ///< Maximum cubemap surface size pub maxSurfaceCubemap: ::core::ffi::c_int, ///< Maximum cubemap layered surface size pub maxSurfaceCubemapLayered: [::core::ffi::c_int; 2usize], ///< Alignment requirement for surface pub surfaceAlignment: usize, ///< Device can possibly execute multiple kernels concurrently. pub concurrentKernels: ::core::ffi::c_int, ///< Device has ECC support enabled pub ECCEnabled: ::core::ffi::c_int, ///< PCI Bus ID. pub pciBusID: ::core::ffi::c_int, ///< PCI Device ID. pub pciDeviceID: ::core::ffi::c_int, ///< PCI Domain ID pub pciDomainID: ::core::ffi::c_int, ///< 1:If device is Tesla device using TCC driver, else 0 pub tccDriver: ::core::ffi::c_int, ///< Number of async engines pub asyncEngineCount: ::core::ffi::c_int, ///< Does device and host share unified address space pub unifiedAddressing: ::core::ffi::c_int, ///< Max global memory clock frequency in khz. pub memoryClockRate: ::core::ffi::c_int, ///< Global memory bus width in bits. pub memoryBusWidth: ::core::ffi::c_int, ///< L2 cache size. pub l2CacheSize: ::core::ffi::c_int, ///< Device's max L2 persisting lines in bytes pub persistingL2CacheMaxSize: ::core::ffi::c_int, ///< Maximum resident threads per multi-processor. pub maxThreadsPerMultiProcessor: ::core::ffi::c_int, ///< Device supports stream priority pub streamPrioritiesSupported: ::core::ffi::c_int, ///< Indicates globals are cached in L1 pub globalL1CacheSupported: ::core::ffi::c_int, ///< Locals are cahced in L1 pub localL1CacheSupported: ::core::ffi::c_int, ///< Amount of shared memory available per multiprocessor. pub sharedMemPerMultiprocessor: usize, ///< registers available per multiprocessor pub regsPerMultiprocessor: ::core::ffi::c_int, ///< Device supports allocating managed memory on this system pub managedMemory: ::core::ffi::c_int, ///< 1 if device is on a multi-GPU board, 0 if not. pub isMultiGpuBoard: ::core::ffi::c_int, ///< Unique identifier for a group of devices on same multiboard GPU pub multiGpuBoardGroupID: ::core::ffi::c_int, ///< Link between host and device supports native atomics pub hostNativeAtomicSupported: ::core::ffi::c_int, ///< Deprecated. CUDA only. pub singleToDoublePrecisionPerfRatio: ::core::ffi::c_int, /**< Device supports coherently accessing pageable memory < without calling hipHostRegister on it*/ pub pageableMemoryAccess: ::core::ffi::c_int, /**< Device can coherently access managed memory concurrently with < the CPU*/ pub concurrentManagedAccess: ::core::ffi::c_int, ///< Is compute preemption supported on the device pub computePreemptionSupported: ::core::ffi::c_int, /**< Device can access host registered memory with same < address as the host*/ pub canUseHostPointerForRegisteredMem: ::core::ffi::c_int, ///< HIP device supports cooperative launch pub cooperativeLaunch: ::core::ffi::c_int, /**< HIP device supports cooperative launch on multiple < devices*/ pub cooperativeMultiDeviceLaunch: ::core::ffi::c_int, ///< Per device m ax shared mem per block usable by special opt in pub sharedMemPerBlockOptin: usize, /**< Device accesses pageable memory via the host's < page tables*/ pub pageableMemoryAccessUsesHostPageTables: ::core::ffi::c_int, /**< Host can directly access managed memory on the device < without migration*/ pub directManagedMemAccessFromHost: ::core::ffi::c_int, ///< Max number of blocks on CU pub maxBlocksPerMultiProcessor: ::core::ffi::c_int, ///< Max value of access policy window pub accessPolicyMaxWindowSize: ::core::ffi::c_int, ///< Shared memory reserved by driver per block pub reservedSharedMemPerBlock: usize, ///< Device supports hipHostRegister pub hostRegisterSupported: ::core::ffi::c_int, ///< Indicates if device supports sparse hip arrays pub sparseHipArraySupported: ::core::ffi::c_int, /**< Device supports using the hipHostRegisterReadOnly flag < with hipHostRegistger*/ pub hostRegisterReadOnlySupported: ::core::ffi::c_int, ///< Indicates external timeline semaphore support pub timelineSemaphoreInteropSupported: ::core::ffi::c_int, ///< Indicates if device supports hipMallocAsync and hipMemPool APIs pub memoryPoolsSupported: ::core::ffi::c_int, ///< Indicates device support of RDMA APIs pub gpuDirectRDMASupported: ::core::ffi::c_int, /**< Bitmask to be interpreted according to < hipFlushGPUDirectRDMAWritesOptions*/ pub gpuDirectRDMAFlushWritesOptions: ::core::ffi::c_uint, ///< value of hipGPUDirectRDMAWritesOrdering pub gpuDirectRDMAWritesOrdering: ::core::ffi::c_int, ///< Bitmask of handle types support with mempool based IPC pub memoryPoolSupportedHandleTypes: ::core::ffi::c_uint, /**< Device supports deferred mapping HIP arrays and HIP < mipmapped arrays*/ pub deferredMappingHipArraySupported: ::core::ffi::c_int, ///< Device supports IPC events pub ipcEventSupported: ::core::ffi::c_int, ///< Device supports cluster launch pub clusterLaunch: ::core::ffi::c_int, ///< Indicates device supports unified function pointers pub unifiedFunctionPointers: ::core::ffi::c_int, ///< CUDA Reserved. pub reserved: [::core::ffi::c_int; 63usize], ///< Reserved for adding new entries for HIP/CUDA. pub hipReserved: [::core::ffi::c_int; 32usize], ///< AMD GCN Arch Name. HIP Only. pub gcnArchName: [::core::ffi::c_char; 256usize], ///< Maximum Shared Memory Per CU. HIP Only. pub maxSharedMemoryPerMultiProcessor: usize, /**< Frequency in khz of the timer used by the device-side "clock*" < instructions. New for HIP.*/ pub clockInstructionRate: ::core::ffi::c_int, ///< Architectural feature flags. New for HIP. pub arch: hipDeviceArch_t, ///< Addres of HDP_MEM_COHERENCY_FLUSH_CNTL register pub hdpMemFlushCntl: *mut ::core::ffi::c_uint, ///< Addres of HDP_REG_COHERENCY_FLUSH_CNTL register pub hdpRegFlushCntl: *mut ::core::ffi::c_uint, /**< HIP device supports cooperative launch on < multiple*/ pub cooperativeMultiDeviceUnmatchedFunc: ::core::ffi::c_int, /**< HIP device supports cooperative launch on < multiple*/ pub cooperativeMultiDeviceUnmatchedGridDim: ::core::ffi::c_int, /**< HIP device supports cooperative launch on < multiple*/ pub cooperativeMultiDeviceUnmatchedBlockDim: ::core::ffi::c_int, /**< HIP device supports cooperative launch on < multiple*/ pub cooperativeMultiDeviceUnmatchedSharedMem: ::core::ffi::c_int, ///< 1: if it is a large PCI bar device, else 0 pub isLargeBar: ::core::ffi::c_int, ///< Revision of the GPU in this device pub asicRevision: ::core::ffi::c_int, } #[allow(non_snake_case, non_camel_case_types)] #[repr(C)] #[repr(align(4))] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct hipDeviceArch_t { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 3usize]>, pub __bindgen_padding_0: u8, } #[repr(C)] #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] pub struct __BindgenBitfieldUnit { storage: Storage, } #[allow(non_camel_case_types)] #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct hipUUID_t { pub bytes: [::core::ffi::c_char; 16usize], } #[allow(non_camel_case_types)] pub type hipUUID = hipUUID_t; } ================================================ FILE: cuda_check/Cargo.toml ================================================ [package] name = "cuda_check" version = "0.0.0" authors = ["Andrzej Janik "] edition = "2021" [[bin]] name = "cuda_check" path = "src/main.rs" [dependencies] cuda_types = { path = "../cuda_types" } zluda_windows = { path = "../zluda_windows" } bpaf = { version = "0.9.19", features = ["derive", "bright-color"] } owo-colors = { version = "4", features = ["supports-colors"] } rand = "0.9.2" libloading = "0.8" [target.'cfg(windows)'.dependencies] windows = { version = "0.62.2", features = ["Win32_Foundation"] } [package.metadata.zluda] windows_only = true ================================================ FILE: cuda_check/src/main.rs ================================================ #[cfg(windows)] mod win; #[cfg(windows)] fn main() { win::main() } #[cfg(not(windows))] fn main() {} ================================================ FILE: cuda_check/src/win.rs ================================================ use bpaf::{construct, pure, Bpaf, Parser}; use owo_colors::{OwoColorize, Stream}; use rand::seq::SliceRandom; use std::{ffi::OsString, mem}; use windows::Win32::Foundation::HMODULE; use zluda_windows::{get_module_path_utf16, LibraryInfo}; #[derive(Debug, Bpaf)] #[bpaf(options)] struct Options { #[bpaf(external)] libraries: Vec<&'static LibraryInfo>, #[bpaf(switch)] driver_first: bool, } fn libraries() -> impl Parser> { zluda_windows::LIBRARIES.iter().fold( Parser::boxed(pure(Vec::with_capacity(zluda_windows::LIBRARIES.len()))), |parser, library| { let dlls = library.ascii_name; let arg = bpaf::long(library.short_name) .help(&*format!("Look for {dlls}")) .switch(); construct!(parser, arg) .map(move |(mut acc, cur)| { if cur { acc.push(library); } acc }) .boxed() }, ) } pub fn main() { let mut opts = options().run(); if opts.libraries.is_empty() { opts.libraries = zluda_windows::LIBRARIES.iter().collect(); } let mut lib_set = opts.libraries; if !opts.driver_first { lib_set.shuffle(&mut rand::rng()); } else { let (_, remainder) = lib_set.split_first_mut().unwrap(); remainder.shuffle(&mut rand::rng()); } for lib in lib_set { print_result(lib.short_name, unsafe { try_load_library(lib) }); } } fn print_result(short_name: &str, lib: Result, Error>) { print!("{:<10}: ", short_name); match lib { Ok(None) => println!( "{}", "OK".if_supports_color(Stream::Stdout, |text| text.green()) ), Ok(Some(path)) => println!( "{} ({})", "OK".if_supports_color(Stream::Stdout, |text| text.green()), path.display() ), Err(err) => println!( "{}", format!("ERROR: {:?}", err).if_supports_color(Stream::Stdout, |text| text.red()) ), } } unsafe fn try_load_library(lib: &LibraryInfo) -> Result, Error> { let library = if lib.in_system32 { libloading::Library::new(lib.ascii_name)? } else { match std::env::var("CUDA_PATH") { Ok(cuda_path) => { let path = std::path::Path::new(&cuda_path) .join("bin") .join("x64") .join(lib.ascii_name); libloading::Library::new(path)? } Err(_) => libloading::Library::new(lib.ascii_name)?, } }; match lib.short_name { "nvcuda" => check_cuda(library), "nvml" => check_nvml(library), "cudnn8" => check_cudnn8(library), "cudnn9" => check_cudnn9(library), "cublas11" => check_cublas(library), "cublas12" => check_cublas(library), "cublas13" => check_cublas(library), "cublaslt11" => check_cublaslt(library), "cublaslt12" => check_cublaslt(library), "cublaslt13" => check_cublaslt(library), "cusparse10" => check_cusparse(library), "cusparse11" => check_cusparse(library), "cusparse12" => check_cusparse(library), "cufft10" => check_cufft(library), "cufft11" => check_cufft(library), "cufft12" => check_cufft(library), _ => Err(Error::Initialization( format!("Library check not implemented for {}", lib.short_name), 0, )), } } unsafe fn path_for_loaded_lib(lib: &'static str) -> Option { let lib = libloading::os::windows::Library::open_already_loaded(lib).ok()?; let lib_handle = lib.into_raw(); let path = get_module_path_utf16(HMODULE(lib_handle as _)); libloading::os::windows::Library::from_raw(lib_handle); Some(path) } unsafe fn check_cufft(library: libloading::Library) -> Result, Error> { let hip_path = || path_for_loaded_lib("hipfft.dll"); let cufft_create = library.get:: cuda_types::cufft::cufftResult>(b"cufftCreate\0")?; let cufft_destroy = library.get:: cuda_types::cufft::cufftResult>(b"cufftDestroy\0")?; let mut handle = mem::zeroed(); match cufft_create(&mut handle) { Ok(()) => {} Err(cuda_types::cufft::cufftError_t::NOT_SUPPORTED) => { return Ok(hip_path()); } Err(err) => { return Err(Error::Initialization( "cufftCreate".to_string(), err.0.get() as usize, )); } } let result = hip_path(); cufft_destroy(handle) .map_err(|err| Error::Initialization("cufftDestroy".to_string(), err.0.get() as usize))?; Ok(result) } unsafe fn check_cublas(library: libloading::Library) -> Result, Error> { let hip_path = || path_for_loaded_lib("rocblas.dll"); let cublas_create = library.get:: cuda_types::cublas::cublasStatus_t>(b"cublasCreate_v2\0")?; let cublas_destroy = library.get:: cuda_types::cublas::cublasStatus_t>(b"cublasDestroy_v2\0")?; let mut handle = mem::zeroed(); cublas_create(&mut handle).map_err(|err| { Error::Initialization("cublasCreate_v2".to_string(), err.0.get() as usize) })?; let result = hip_path(); cublas_destroy(handle).map_err(|err| { Error::Initialization("cublasDestroy_v2".to_string(), err.0.get() as usize) })?; Ok(result) } unsafe fn check_cusparse(library: libloading::Library) -> Result, Error> { let hip_path = || path_for_loaded_lib("rocsparse.dll"); let cusparse_create = library.get:: cuda_types::cusparse::cusparseStatus_t>(b"cusparseCreate\0")?; let cusparse_destroy = library.get:: cuda_types::cusparse::cusparseStatus_t>(b"cusparseDestroy\0")?; let mut handle = mem::zeroed(); match cusparse_create(&mut handle) { Ok(()) => {} Err(cuda_types::cusparse::cusparseError_t::NOT_SUPPORTED) => { return Ok(hip_path()); } Err(err) => { return Err(Error::Initialization( "cusparseCreate".to_string(), err.0.get() as usize, )); } } let result = hip_path(); cusparse_destroy(handle).map_err(|err| { Error::Initialization("cusparseDestroy".to_string(), err.0.get() as usize) })?; Ok(result) } unsafe fn check_cublaslt(library: libloading::Library) -> Result, Error> { let hip_path = || path_for_loaded_lib("hipblaslt.dll").or_else(|| path_for_loaded_lib("libhipblaslt.dll")); let cublaslt_create = library.get:: cuda_types::cublas::cublasStatus_t>(b"cublasLtCreate\0")?; let cublaslt_destroy = library.get:: cuda_types::cublas::cublasStatus_t>(b"cublasLtDestroy\0")?; let mut handle = mem::zeroed(); cublaslt_create(&mut handle) .map_err(|err| Error::Initialization("cublasLtCreate".to_string(), err.0.get() as usize))?; let result = hip_path(); cublaslt_destroy(handle).map_err(|err| { Error::Initialization("cublasLtDestroy".to_string(), err.0.get() as usize) })?; Ok(result) } unsafe fn check_cuda(library: libloading::Library) -> Result, Error> { let cu_init = library .get:: cuda_types::cuda::CUresult>( b"cuInit\0", )?; cu_init(0).map_err(|err| Error::Initialization("cuInit".to_string(), err.0.get() as usize))?; Ok(path_for_loaded_lib("amdhip64_7.dll").or_else(|| path_for_loaded_lib("amdhip64_6.dll"))) } unsafe fn check_nvml(library: libloading::Library) -> Result, Error> { use cuda_types::nvml::nvmlReturn_tConsts; let nvml_init = library.get:: cuda_types::nvml::nvmlReturn_t>(b"nvmlInit_v2\0")?; match nvml_init() { Ok(()) | cuda_types::nvml::nvmlReturn_t::ERROR_NOT_SUPPORTED => { Ok(path_for_loaded_lib("rocm_smi64.dll")) } Err(err) => Err(Error::Initialization( "nvmlInit_v2".to_string(), err.0.get() as usize, )), } } unsafe fn check_cudnn8(library: libloading::Library) -> Result, Error> { let hip_path = || path_for_loaded_lib("MIOpen.dll"); let cudnn_create = library.get:: cuda_types::cudnn8::cudnnStatus_t>(b"cudnnCreate\0")?; let cudnn_destroy = library.get:: cuda_types::cudnn8::cudnnStatus_t>(b"cudnnDestroy\0")?; let mut handle = mem::zeroed(); cudnn_create(&mut handle) .map_err(|err| Error::Initialization("cudnnCreate".to_string(), err.0.get() as usize))?; let result = hip_path(); cudnn_destroy(handle) .map_err(|err| Error::Initialization("cudnnDestroy".to_string(), err.0.get() as usize))?; Ok(result) } unsafe fn check_cudnn9(library: libloading::Library) -> Result, Error> { let hip_path = || path_for_loaded_lib("MIOpen.dll"); let cudnn_create = library.get:: cuda_types::cudnn9::cudnnStatus_t>(b"cudnnCreate\0")?; let cudnn_destroy = library.get:: cuda_types::cudnn9::cudnnStatus_t>(b"cudnnDestroy\0")?; let mut handle = mem::zeroed(); cudnn_create(&mut handle) .map_err(|err| Error::Initialization("cudnnCreate".to_string(), err.0.get() as usize))?; let result = hip_path(); cudnn_destroy(handle) .map_err(|err| Error::Initialization("cudnnDestroy".to_string(), err.0.get() as usize))?; Ok(result) } #[derive(Debug)] #[allow(dead_code)] enum Error { Loading(libloading::Error), Initialization(String, usize), } impl From for Error { fn from(err: libloading::Error) -> Self { Error::Loading(err) } } ================================================ FILE: cuda_macros/.rustfmt.toml ================================================ disable_all_formatting = true ================================================ FILE: cuda_macros/Cargo.toml ================================================ [package] name = "cuda_macros" version = "0.0.0" authors = ["Andrzej Janik "] edition = "2021" [dependencies] quote = "1.0" syn = { version = "2.0", features = ["full", "visit-mut", "extra-traits"] } proc-macro2 = "1.0" rustc-hash = "2.0.0" [lib] proc-macro = true ================================================ FILE: cuda_macros/build/wrapper.h ================================================ #define __CUDA_API_VERSION_INTERNAL #include #include #include #include #include #include ================================================ FILE: cuda_macros/src/cublas.rs ================================================ // Generated automatically by zluda_bindgen // DO NOT EDIT MANUALLY #![allow(warnings)] extern "system" { #[must_use] fn cublasCreate_v2( handle: *mut cuda_types::cublas::cublasHandle_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDestroy_v2( handle: cuda_types::cublas::cublasHandle_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasGetVersion_v2( handle: cuda_types::cublas::cublasHandle_t, version: *mut ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasGetProperty( type_: cuda_types::cublas::libraryPropertyType, value: *mut ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; fn cublasGetCudartVersion() -> usize; #[must_use] fn cublasSetWorkspace_v2( handle: cuda_types::cublas::cublasHandle_t, workspace: *mut ::core::ffi::c_void, workspaceSizeInBytes: usize, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSetStream_v2( handle: cuda_types::cublas::cublasHandle_t, streamId: cuda_types::cublas::cudaStream_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasGetStream_v2( handle: cuda_types::cublas::cublasHandle_t, streamId: *mut cuda_types::cublas::cudaStream_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasGetPointerMode_v2( handle: cuda_types::cublas::cublasHandle_t, mode: *mut cuda_types::cublas::cublasPointerMode_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSetPointerMode_v2( handle: cuda_types::cublas::cublasHandle_t, mode: cuda_types::cublas::cublasPointerMode_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasGetAtomicsMode( handle: cuda_types::cublas::cublasHandle_t, mode: *mut cuda_types::cublas::cublasAtomicsMode_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSetAtomicsMode( handle: cuda_types::cublas::cublasHandle_t, mode: cuda_types::cublas::cublasAtomicsMode_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasGetMathMode( handle: cuda_types::cublas::cublasHandle_t, mode: *mut cuda_types::cublas::cublasMath_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSetMathMode( handle: cuda_types::cublas::cublasHandle_t, mode: cuda_types::cublas::cublasMath_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasGetSmCountTarget( handle: cuda_types::cublas::cublasHandle_t, smCountTarget: *mut ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSetSmCountTarget( handle: cuda_types::cublas::cublasHandle_t, smCountTarget: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasGetEmulationStrategy( handle: cuda_types::cublas::cublasHandle_t, emulationStrategy: *mut cuda_types::cublas::cublasEmulationStrategy_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSetEmulationStrategy( handle: cuda_types::cublas::cublasHandle_t, emulationStrategy: cuda_types::cublas::cublasEmulationStrategy_t, ) -> cuda_types::cublas::cublasStatus_t; fn cublasGetStatusName( status: cuda_types::cublas::cublasStatus_t, ) -> *const ::core::ffi::c_char; fn cublasGetStatusString( status: cuda_types::cublas::cublasStatus_t, ) -> *const ::core::ffi::c_char; #[must_use] fn cublasLoggerConfigure( logIsOn: ::core::ffi::c_int, logToStdOut: ::core::ffi::c_int, logToStdErr: ::core::ffi::c_int, logFileName: *const ::core::ffi::c_char, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSetLoggerCallback( userCallback: cuda_types::cublas::cublasLogCallback, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasGetLoggerCallback( userCallback: *mut cuda_types::cublas::cublasLogCallback, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSetVector( n: ::core::ffi::c_int, elemSize: ::core::ffi::c_int, x: *const ::core::ffi::c_void, incx: ::core::ffi::c_int, devicePtr: *mut ::core::ffi::c_void, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSetVector_64( n: i64, elemSize: i64, x: *const ::core::ffi::c_void, incx: i64, devicePtr: *mut ::core::ffi::c_void, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasGetVector( n: ::core::ffi::c_int, elemSize: ::core::ffi::c_int, x: *const ::core::ffi::c_void, incx: ::core::ffi::c_int, y: *mut ::core::ffi::c_void, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasGetVector_64( n: i64, elemSize: i64, x: *const ::core::ffi::c_void, incx: i64, y: *mut ::core::ffi::c_void, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSetMatrix( rows: ::core::ffi::c_int, cols: ::core::ffi::c_int, elemSize: ::core::ffi::c_int, A: *const ::core::ffi::c_void, lda: ::core::ffi::c_int, B: *mut ::core::ffi::c_void, ldb: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSetMatrix_64( rows: i64, cols: i64, elemSize: i64, A: *const ::core::ffi::c_void, lda: i64, B: *mut ::core::ffi::c_void, ldb: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasGetMatrix( rows: ::core::ffi::c_int, cols: ::core::ffi::c_int, elemSize: ::core::ffi::c_int, A: *const ::core::ffi::c_void, lda: ::core::ffi::c_int, B: *mut ::core::ffi::c_void, ldb: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasGetMatrix_64( rows: i64, cols: i64, elemSize: i64, A: *const ::core::ffi::c_void, lda: i64, B: *mut ::core::ffi::c_void, ldb: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSetVectorAsync( n: ::core::ffi::c_int, elemSize: ::core::ffi::c_int, hostPtr: *const ::core::ffi::c_void, incx: ::core::ffi::c_int, devicePtr: *mut ::core::ffi::c_void, incy: ::core::ffi::c_int, stream: cuda_types::cublas::cudaStream_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSetVectorAsync_64( n: i64, elemSize: i64, hostPtr: *const ::core::ffi::c_void, incx: i64, devicePtr: *mut ::core::ffi::c_void, incy: i64, stream: cuda_types::cublas::cudaStream_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasGetVectorAsync( n: ::core::ffi::c_int, elemSize: ::core::ffi::c_int, devicePtr: *const ::core::ffi::c_void, incx: ::core::ffi::c_int, hostPtr: *mut ::core::ffi::c_void, incy: ::core::ffi::c_int, stream: cuda_types::cublas::cudaStream_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasGetVectorAsync_64( n: i64, elemSize: i64, devicePtr: *const ::core::ffi::c_void, incx: i64, hostPtr: *mut ::core::ffi::c_void, incy: i64, stream: cuda_types::cublas::cudaStream_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSetMatrixAsync( rows: ::core::ffi::c_int, cols: ::core::ffi::c_int, elemSize: ::core::ffi::c_int, A: *const ::core::ffi::c_void, lda: ::core::ffi::c_int, B: *mut ::core::ffi::c_void, ldb: ::core::ffi::c_int, stream: cuda_types::cublas::cudaStream_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSetMatrixAsync_64( rows: i64, cols: i64, elemSize: i64, A: *const ::core::ffi::c_void, lda: i64, B: *mut ::core::ffi::c_void, ldb: i64, stream: cuda_types::cublas::cudaStream_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasGetMatrixAsync( rows: ::core::ffi::c_int, cols: ::core::ffi::c_int, elemSize: ::core::ffi::c_int, A: *const ::core::ffi::c_void, lda: ::core::ffi::c_int, B: *mut ::core::ffi::c_void, ldb: ::core::ffi::c_int, stream: cuda_types::cublas::cudaStream_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasGetMatrixAsync_64( rows: i64, cols: i64, elemSize: i64, A: *const ::core::ffi::c_void, lda: i64, B: *mut ::core::ffi::c_void, ldb: i64, stream: cuda_types::cublas::cudaStream_t, ) -> cuda_types::cublas::cublasStatus_t; fn cublasXerbla(srName: *const ::core::ffi::c_char, info: ::core::ffi::c_int) -> (); #[must_use] fn cublasNrm2Ex( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *const ::core::ffi::c_void, xType: cuda_types::cublas::cudaDataType, incx: ::core::ffi::c_int, result: *mut ::core::ffi::c_void, resultType: cuda_types::cublas::cudaDataType, executionType: cuda_types::cublas::cudaDataType, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasNrm2Ex_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *const ::core::ffi::c_void, xType: cuda_types::cublas::cudaDataType, incx: i64, result: *mut ::core::ffi::c_void, resultType: cuda_types::cublas::cudaDataType, executionType: cuda_types::cublas::cudaDataType, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSnrm2_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *const f32, incx: ::core::ffi::c_int, result: *mut f32, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSnrm2_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *const f32, incx: i64, result: *mut f32, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDnrm2_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *const f64, incx: ::core::ffi::c_int, result: *mut f64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDnrm2_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *const f64, incx: i64, result: *mut f64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasScnrm2_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *const cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, result: *mut f32, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasScnrm2_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *const cuda_types::cublas::cuComplex, incx: i64, result: *mut f32, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDznrm2_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *const cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, result: *mut f64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDznrm2_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *const cuda_types::cublas::cuDoubleComplex, incx: i64, result: *mut f64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDotEx( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *const ::core::ffi::c_void, xType: cuda_types::cublas::cudaDataType, incx: ::core::ffi::c_int, y: *const ::core::ffi::c_void, yType: cuda_types::cublas::cudaDataType, incy: ::core::ffi::c_int, result: *mut ::core::ffi::c_void, resultType: cuda_types::cublas::cudaDataType, executionType: cuda_types::cublas::cudaDataType, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDotEx_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *const ::core::ffi::c_void, xType: cuda_types::cublas::cudaDataType, incx: i64, y: *const ::core::ffi::c_void, yType: cuda_types::cublas::cudaDataType, incy: i64, result: *mut ::core::ffi::c_void, resultType: cuda_types::cublas::cudaDataType, executionType: cuda_types::cublas::cudaDataType, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDotcEx( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *const ::core::ffi::c_void, xType: cuda_types::cublas::cudaDataType, incx: ::core::ffi::c_int, y: *const ::core::ffi::c_void, yType: cuda_types::cublas::cudaDataType, incy: ::core::ffi::c_int, result: *mut ::core::ffi::c_void, resultType: cuda_types::cublas::cudaDataType, executionType: cuda_types::cublas::cudaDataType, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDotcEx_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *const ::core::ffi::c_void, xType: cuda_types::cublas::cudaDataType, incx: i64, y: *const ::core::ffi::c_void, yType: cuda_types::cublas::cudaDataType, incy: i64, result: *mut ::core::ffi::c_void, resultType: cuda_types::cublas::cudaDataType, executionType: cuda_types::cublas::cudaDataType, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSdot_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *const f32, incx: ::core::ffi::c_int, y: *const f32, incy: ::core::ffi::c_int, result: *mut f32, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSdot_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *const f32, incx: i64, y: *const f32, incy: i64, result: *mut f32, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDdot_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *const f64, incx: ::core::ffi::c_int, y: *const f64, incy: ::core::ffi::c_int, result: *mut f64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDdot_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *const f64, incx: i64, y: *const f64, incy: i64, result: *mut f64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCdotu_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *const cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, y: *const cuda_types::cublas::cuComplex, incy: ::core::ffi::c_int, result: *mut cuda_types::cublas::cuComplex, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCdotu_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *const cuda_types::cublas::cuComplex, incx: i64, y: *const cuda_types::cublas::cuComplex, incy: i64, result: *mut cuda_types::cublas::cuComplex, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCdotc_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *const cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, y: *const cuda_types::cublas::cuComplex, incy: ::core::ffi::c_int, result: *mut cuda_types::cublas::cuComplex, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCdotc_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *const cuda_types::cublas::cuComplex, incx: i64, y: *const cuda_types::cublas::cuComplex, incy: i64, result: *mut cuda_types::cublas::cuComplex, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZdotu_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *const cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, y: *const cuda_types::cublas::cuDoubleComplex, incy: ::core::ffi::c_int, result: *mut cuda_types::cublas::cuDoubleComplex, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZdotu_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *const cuda_types::cublas::cuDoubleComplex, incx: i64, y: *const cuda_types::cublas::cuDoubleComplex, incy: i64, result: *mut cuda_types::cublas::cuDoubleComplex, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZdotc_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *const cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, y: *const cuda_types::cublas::cuDoubleComplex, incy: ::core::ffi::c_int, result: *mut cuda_types::cublas::cuDoubleComplex, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZdotc_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *const cuda_types::cublas::cuDoubleComplex, incx: i64, y: *const cuda_types::cublas::cuDoubleComplex, incy: i64, result: *mut cuda_types::cublas::cuDoubleComplex, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasScalEx( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, alpha: *const ::core::ffi::c_void, alphaType: cuda_types::cublas::cudaDataType, x: *mut ::core::ffi::c_void, xType: cuda_types::cublas::cudaDataType, incx: ::core::ffi::c_int, executionType: cuda_types::cublas::cudaDataType, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasScalEx_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, alpha: *const ::core::ffi::c_void, alphaType: cuda_types::cublas::cudaDataType, x: *mut ::core::ffi::c_void, xType: cuda_types::cublas::cudaDataType, incx: i64, executionType: cuda_types::cublas::cudaDataType, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSscal_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, alpha: *const f32, x: *mut f32, incx: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSscal_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, alpha: *const f32, x: *mut f32, incx: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDscal_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, alpha: *const f64, x: *mut f64, incx: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDscal_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, alpha: *const f64, x: *mut f64, incx: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCscal_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, x: *mut cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCscal_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, alpha: *const cuda_types::cublas::cuComplex, x: *mut cuda_types::cublas::cuComplex, incx: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCsscal_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, alpha: *const f32, x: *mut cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCsscal_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, alpha: *const f32, x: *mut cuda_types::cublas::cuComplex, incx: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZscal_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuDoubleComplex, x: *mut cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZscal_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, alpha: *const cuda_types::cublas::cuDoubleComplex, x: *mut cuda_types::cublas::cuDoubleComplex, incx: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZdscal_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, alpha: *const f64, x: *mut cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZdscal_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, alpha: *const f64, x: *mut cuda_types::cublas::cuDoubleComplex, incx: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasAxpyEx( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, alpha: *const ::core::ffi::c_void, alphaType: cuda_types::cublas::cudaDataType, x: *const ::core::ffi::c_void, xType: cuda_types::cublas::cudaDataType, incx: ::core::ffi::c_int, y: *mut ::core::ffi::c_void, yType: cuda_types::cublas::cudaDataType, incy: ::core::ffi::c_int, executiontype: cuda_types::cublas::cudaDataType, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasAxpyEx_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, alpha: *const ::core::ffi::c_void, alphaType: cuda_types::cublas::cudaDataType, x: *const ::core::ffi::c_void, xType: cuda_types::cublas::cudaDataType, incx: i64, y: *mut ::core::ffi::c_void, yType: cuda_types::cublas::cudaDataType, incy: i64, executiontype: cuda_types::cublas::cudaDataType, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSaxpy_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, alpha: *const f32, x: *const f32, incx: ::core::ffi::c_int, y: *mut f32, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSaxpy_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, alpha: *const f32, x: *const f32, incx: i64, y: *mut f32, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDaxpy_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, alpha: *const f64, x: *const f64, incx: ::core::ffi::c_int, y: *mut f64, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDaxpy_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, alpha: *const f64, x: *const f64, incx: i64, y: *mut f64, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCaxpy_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, x: *const cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, y: *mut cuda_types::cublas::cuComplex, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCaxpy_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, alpha: *const cuda_types::cublas::cuComplex, x: *const cuda_types::cublas::cuComplex, incx: i64, y: *mut cuda_types::cublas::cuComplex, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZaxpy_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuDoubleComplex, x: *const cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, y: *mut cuda_types::cublas::cuDoubleComplex, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZaxpy_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, alpha: *const cuda_types::cublas::cuDoubleComplex, x: *const cuda_types::cublas::cuDoubleComplex, incx: i64, y: *mut cuda_types::cublas::cuDoubleComplex, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCopyEx( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *const ::core::ffi::c_void, xType: cuda_types::cublas::cudaDataType, incx: ::core::ffi::c_int, y: *mut ::core::ffi::c_void, yType: cuda_types::cublas::cudaDataType, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCopyEx_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *const ::core::ffi::c_void, xType: cuda_types::cublas::cudaDataType, incx: i64, y: *mut ::core::ffi::c_void, yType: cuda_types::cublas::cudaDataType, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasScopy_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *const f32, incx: ::core::ffi::c_int, y: *mut f32, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasScopy_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *const f32, incx: i64, y: *mut f32, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDcopy_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *const f64, incx: ::core::ffi::c_int, y: *mut f64, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDcopy_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *const f64, incx: i64, y: *mut f64, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCcopy_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *const cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, y: *mut cuda_types::cublas::cuComplex, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCcopy_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *const cuda_types::cublas::cuComplex, incx: i64, y: *mut cuda_types::cublas::cuComplex, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZcopy_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *const cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, y: *mut cuda_types::cublas::cuDoubleComplex, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZcopy_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *const cuda_types::cublas::cuDoubleComplex, incx: i64, y: *mut cuda_types::cublas::cuDoubleComplex, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSswap_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *mut f32, incx: ::core::ffi::c_int, y: *mut f32, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSswap_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *mut f32, incx: i64, y: *mut f32, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDswap_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *mut f64, incx: ::core::ffi::c_int, y: *mut f64, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDswap_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *mut f64, incx: i64, y: *mut f64, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCswap_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *mut cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, y: *mut cuda_types::cublas::cuComplex, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCswap_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *mut cuda_types::cublas::cuComplex, incx: i64, y: *mut cuda_types::cublas::cuComplex, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZswap_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *mut cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, y: *mut cuda_types::cublas::cuDoubleComplex, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZswap_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *mut cuda_types::cublas::cuDoubleComplex, incx: i64, y: *mut cuda_types::cublas::cuDoubleComplex, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSwapEx( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *mut ::core::ffi::c_void, xType: cuda_types::cublas::cudaDataType, incx: ::core::ffi::c_int, y: *mut ::core::ffi::c_void, yType: cuda_types::cublas::cudaDataType, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSwapEx_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *mut ::core::ffi::c_void, xType: cuda_types::cublas::cudaDataType, incx: i64, y: *mut ::core::ffi::c_void, yType: cuda_types::cublas::cudaDataType, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasIsamax_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *const f32, incx: ::core::ffi::c_int, result: *mut ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasIsamax_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *const f32, incx: i64, result: *mut i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasIdamax_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *const f64, incx: ::core::ffi::c_int, result: *mut ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasIdamax_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *const f64, incx: i64, result: *mut i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasIcamax_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *const cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, result: *mut ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasIcamax_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *const cuda_types::cublas::cuComplex, incx: i64, result: *mut i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasIzamax_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *const cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, result: *mut ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasIzamax_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *const cuda_types::cublas::cuDoubleComplex, incx: i64, result: *mut i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasIamaxEx( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *const ::core::ffi::c_void, xType: cuda_types::cublas::cudaDataType, incx: ::core::ffi::c_int, result: *mut ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasIamaxEx_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *const ::core::ffi::c_void, xType: cuda_types::cublas::cudaDataType, incx: i64, result: *mut i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasIsamin_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *const f32, incx: ::core::ffi::c_int, result: *mut ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasIsamin_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *const f32, incx: i64, result: *mut i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasIdamin_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *const f64, incx: ::core::ffi::c_int, result: *mut ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasIdamin_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *const f64, incx: i64, result: *mut i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasIcamin_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *const cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, result: *mut ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasIcamin_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *const cuda_types::cublas::cuComplex, incx: i64, result: *mut i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasIzamin_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *const cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, result: *mut ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasIzamin_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *const cuda_types::cublas::cuDoubleComplex, incx: i64, result: *mut i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasIaminEx( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *const ::core::ffi::c_void, xType: cuda_types::cublas::cudaDataType, incx: ::core::ffi::c_int, result: *mut ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasIaminEx_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *const ::core::ffi::c_void, xType: cuda_types::cublas::cudaDataType, incx: i64, result: *mut i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasAsumEx( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *const ::core::ffi::c_void, xType: cuda_types::cublas::cudaDataType, incx: ::core::ffi::c_int, result: *mut ::core::ffi::c_void, resultType: cuda_types::cublas::cudaDataType, executiontype: cuda_types::cublas::cudaDataType, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasAsumEx_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *const ::core::ffi::c_void, xType: cuda_types::cublas::cudaDataType, incx: i64, result: *mut ::core::ffi::c_void, resultType: cuda_types::cublas::cudaDataType, executiontype: cuda_types::cublas::cudaDataType, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSasum_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *const f32, incx: ::core::ffi::c_int, result: *mut f32, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSasum_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *const f32, incx: i64, result: *mut f32, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDasum_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *const f64, incx: ::core::ffi::c_int, result: *mut f64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDasum_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *const f64, incx: i64, result: *mut f64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasScasum_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *const cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, result: *mut f32, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasScasum_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *const cuda_types::cublas::cuComplex, incx: i64, result: *mut f32, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDzasum_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *const cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, result: *mut f64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDzasum_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *const cuda_types::cublas::cuDoubleComplex, incx: i64, result: *mut f64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSrot_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *mut f32, incx: ::core::ffi::c_int, y: *mut f32, incy: ::core::ffi::c_int, c: *const f32, s: *const f32, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSrot_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *mut f32, incx: i64, y: *mut f32, incy: i64, c: *const f32, s: *const f32, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDrot_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *mut f64, incx: ::core::ffi::c_int, y: *mut f64, incy: ::core::ffi::c_int, c: *const f64, s: *const f64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDrot_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *mut f64, incx: i64, y: *mut f64, incy: i64, c: *const f64, s: *const f64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCrot_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *mut cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, y: *mut cuda_types::cublas::cuComplex, incy: ::core::ffi::c_int, c: *const f32, s: *const cuda_types::cublas::cuComplex, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCrot_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *mut cuda_types::cublas::cuComplex, incx: i64, y: *mut cuda_types::cublas::cuComplex, incy: i64, c: *const f32, s: *const cuda_types::cublas::cuComplex, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCsrot_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *mut cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, y: *mut cuda_types::cublas::cuComplex, incy: ::core::ffi::c_int, c: *const f32, s: *const f32, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCsrot_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *mut cuda_types::cublas::cuComplex, incx: i64, y: *mut cuda_types::cublas::cuComplex, incy: i64, c: *const f32, s: *const f32, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZrot_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *mut cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, y: *mut cuda_types::cublas::cuDoubleComplex, incy: ::core::ffi::c_int, c: *const f64, s: *const cuda_types::cublas::cuDoubleComplex, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZrot_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *mut cuda_types::cublas::cuDoubleComplex, incx: i64, y: *mut cuda_types::cublas::cuDoubleComplex, incy: i64, c: *const f64, s: *const cuda_types::cublas::cuDoubleComplex, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZdrot_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *mut cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, y: *mut cuda_types::cublas::cuDoubleComplex, incy: ::core::ffi::c_int, c: *const f64, s: *const f64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZdrot_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *mut cuda_types::cublas::cuDoubleComplex, incx: i64, y: *mut cuda_types::cublas::cuDoubleComplex, incy: i64, c: *const f64, s: *const f64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasRotEx( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *mut ::core::ffi::c_void, xType: cuda_types::cublas::cudaDataType, incx: ::core::ffi::c_int, y: *mut ::core::ffi::c_void, yType: cuda_types::cublas::cudaDataType, incy: ::core::ffi::c_int, c: *const ::core::ffi::c_void, s: *const ::core::ffi::c_void, csType: cuda_types::cublas::cudaDataType, executiontype: cuda_types::cublas::cudaDataType, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasRotEx_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *mut ::core::ffi::c_void, xType: cuda_types::cublas::cudaDataType, incx: i64, y: *mut ::core::ffi::c_void, yType: cuda_types::cublas::cudaDataType, incy: i64, c: *const ::core::ffi::c_void, s: *const ::core::ffi::c_void, csType: cuda_types::cublas::cudaDataType, executiontype: cuda_types::cublas::cudaDataType, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSrotg_v2( handle: cuda_types::cublas::cublasHandle_t, a: *mut f32, b: *mut f32, c: *mut f32, s: *mut f32, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDrotg_v2( handle: cuda_types::cublas::cublasHandle_t, a: *mut f64, b: *mut f64, c: *mut f64, s: *mut f64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCrotg_v2( handle: cuda_types::cublas::cublasHandle_t, a: *mut cuda_types::cublas::cuComplex, b: *mut cuda_types::cublas::cuComplex, c: *mut f32, s: *mut cuda_types::cublas::cuComplex, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZrotg_v2( handle: cuda_types::cublas::cublasHandle_t, a: *mut cuda_types::cublas::cuDoubleComplex, b: *mut cuda_types::cublas::cuDoubleComplex, c: *mut f64, s: *mut cuda_types::cublas::cuDoubleComplex, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasRotgEx( handle: cuda_types::cublas::cublasHandle_t, a: *mut ::core::ffi::c_void, b: *mut ::core::ffi::c_void, abType: cuda_types::cublas::cudaDataType, c: *mut ::core::ffi::c_void, s: *mut ::core::ffi::c_void, csType: cuda_types::cublas::cudaDataType, executiontype: cuda_types::cublas::cudaDataType, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSrotm_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *mut f32, incx: ::core::ffi::c_int, y: *mut f32, incy: ::core::ffi::c_int, param: *const f32, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSrotm_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *mut f32, incx: i64, y: *mut f32, incy: i64, param: *const f32, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDrotm_v2( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *mut f64, incx: ::core::ffi::c_int, y: *mut f64, incy: ::core::ffi::c_int, param: *const f64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDrotm_v2_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *mut f64, incx: i64, y: *mut f64, incy: i64, param: *const f64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasRotmEx( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, x: *mut ::core::ffi::c_void, xType: cuda_types::cublas::cudaDataType, incx: ::core::ffi::c_int, y: *mut ::core::ffi::c_void, yType: cuda_types::cublas::cudaDataType, incy: ::core::ffi::c_int, param: *const ::core::ffi::c_void, paramType: cuda_types::cublas::cudaDataType, executiontype: cuda_types::cublas::cudaDataType, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasRotmEx_64( handle: cuda_types::cublas::cublasHandle_t, n: i64, x: *mut ::core::ffi::c_void, xType: cuda_types::cublas::cudaDataType, incx: i64, y: *mut ::core::ffi::c_void, yType: cuda_types::cublas::cudaDataType, incy: i64, param: *const ::core::ffi::c_void, paramType: cuda_types::cublas::cudaDataType, executiontype: cuda_types::cublas::cudaDataType, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSrotmg_v2( handle: cuda_types::cublas::cublasHandle_t, d1: *mut f32, d2: *mut f32, x1: *mut f32, y1: *const f32, param: *mut f32, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDrotmg_v2( handle: cuda_types::cublas::cublasHandle_t, d1: *mut f64, d2: *mut f64, x1: *mut f64, y1: *const f64, param: *mut f64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasRotmgEx( handle: cuda_types::cublas::cublasHandle_t, d1: *mut ::core::ffi::c_void, d1Type: cuda_types::cublas::cudaDataType, d2: *mut ::core::ffi::c_void, d2Type: cuda_types::cublas::cudaDataType, x1: *mut ::core::ffi::c_void, x1Type: cuda_types::cublas::cudaDataType, y1: *const ::core::ffi::c_void, y1Type: cuda_types::cublas::cudaDataType, param: *mut ::core::ffi::c_void, paramType: cuda_types::cublas::cudaDataType, executiontype: cuda_types::cublas::cudaDataType, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSgemv_v2( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const f32, A: *const f32, lda: ::core::ffi::c_int, x: *const f32, incx: ::core::ffi::c_int, beta: *const f32, y: *mut f32, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSgemv_v2_64( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, alpha: *const f32, A: *const f32, lda: i64, x: *const f32, incx: i64, beta: *const f32, y: *mut f32, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDgemv_v2( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const f64, A: *const f64, lda: ::core::ffi::c_int, x: *const f64, incx: ::core::ffi::c_int, beta: *const f64, y: *mut f64, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDgemv_v2_64( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, alpha: *const f64, A: *const f64, lda: i64, x: *const f64, incx: i64, beta: *const f64, y: *mut f64, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCgemv_v2( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, x: *const cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuComplex, y: *mut cuda_types::cublas::cuComplex, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCgemv_v2_64( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: i64, x: *const cuda_types::cublas::cuComplex, incx: i64, beta: *const cuda_types::cublas::cuComplex, y: *mut cuda_types::cublas::cuComplex, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZgemv_v2( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, x: *const cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuDoubleComplex, y: *mut cuda_types::cublas::cuDoubleComplex, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZgemv_v2_64( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: i64, x: *const cuda_types::cublas::cuDoubleComplex, incx: i64, beta: *const cuda_types::cublas::cuDoubleComplex, y: *mut cuda_types::cublas::cuDoubleComplex, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSgbmv_v2( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, kl: ::core::ffi::c_int, ku: ::core::ffi::c_int, alpha: *const f32, A: *const f32, lda: ::core::ffi::c_int, x: *const f32, incx: ::core::ffi::c_int, beta: *const f32, y: *mut f32, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSgbmv_v2_64( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, kl: i64, ku: i64, alpha: *const f32, A: *const f32, lda: i64, x: *const f32, incx: i64, beta: *const f32, y: *mut f32, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDgbmv_v2( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, kl: ::core::ffi::c_int, ku: ::core::ffi::c_int, alpha: *const f64, A: *const f64, lda: ::core::ffi::c_int, x: *const f64, incx: ::core::ffi::c_int, beta: *const f64, y: *mut f64, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDgbmv_v2_64( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, kl: i64, ku: i64, alpha: *const f64, A: *const f64, lda: i64, x: *const f64, incx: i64, beta: *const f64, y: *mut f64, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCgbmv_v2( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, kl: ::core::ffi::c_int, ku: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, x: *const cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuComplex, y: *mut cuda_types::cublas::cuComplex, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCgbmv_v2_64( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, kl: i64, ku: i64, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: i64, x: *const cuda_types::cublas::cuComplex, incx: i64, beta: *const cuda_types::cublas::cuComplex, y: *mut cuda_types::cublas::cuComplex, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZgbmv_v2( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, kl: ::core::ffi::c_int, ku: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, x: *const cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuDoubleComplex, y: *mut cuda_types::cublas::cuDoubleComplex, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZgbmv_v2_64( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, kl: i64, ku: i64, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: i64, x: *const cuda_types::cublas::cuDoubleComplex, incx: i64, beta: *const cuda_types::cublas::cuDoubleComplex, y: *mut cuda_types::cublas::cuDoubleComplex, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasStrmv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: ::core::ffi::c_int, A: *const f32, lda: ::core::ffi::c_int, x: *mut f32, incx: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasStrmv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: i64, A: *const f32, lda: i64, x: *mut f32, incx: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDtrmv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: ::core::ffi::c_int, A: *const f64, lda: ::core::ffi::c_int, x: *mut f64, incx: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDtrmv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: i64, A: *const f64, lda: i64, x: *mut f64, incx: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCtrmv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: ::core::ffi::c_int, A: *const cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, x: *mut cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCtrmv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: i64, A: *const cuda_types::cublas::cuComplex, lda: i64, x: *mut cuda_types::cublas::cuComplex, incx: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZtrmv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: ::core::ffi::c_int, A: *const cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, x: *mut cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZtrmv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: i64, A: *const cuda_types::cublas::cuDoubleComplex, lda: i64, x: *mut cuda_types::cublas::cuDoubleComplex, incx: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasStbmv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: ::core::ffi::c_int, k: ::core::ffi::c_int, A: *const f32, lda: ::core::ffi::c_int, x: *mut f32, incx: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasStbmv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: i64, k: i64, A: *const f32, lda: i64, x: *mut f32, incx: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDtbmv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: ::core::ffi::c_int, k: ::core::ffi::c_int, A: *const f64, lda: ::core::ffi::c_int, x: *mut f64, incx: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDtbmv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: i64, k: i64, A: *const f64, lda: i64, x: *mut f64, incx: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCtbmv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: ::core::ffi::c_int, k: ::core::ffi::c_int, A: *const cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, x: *mut cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCtbmv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: i64, k: i64, A: *const cuda_types::cublas::cuComplex, lda: i64, x: *mut cuda_types::cublas::cuComplex, incx: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZtbmv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: ::core::ffi::c_int, k: ::core::ffi::c_int, A: *const cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, x: *mut cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZtbmv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: i64, k: i64, A: *const cuda_types::cublas::cuDoubleComplex, lda: i64, x: *mut cuda_types::cublas::cuDoubleComplex, incx: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasStpmv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: ::core::ffi::c_int, AP: *const f32, x: *mut f32, incx: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasStpmv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: i64, AP: *const f32, x: *mut f32, incx: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDtpmv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: ::core::ffi::c_int, AP: *const f64, x: *mut f64, incx: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDtpmv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: i64, AP: *const f64, x: *mut f64, incx: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCtpmv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: ::core::ffi::c_int, AP: *const cuda_types::cublas::cuComplex, x: *mut cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCtpmv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: i64, AP: *const cuda_types::cublas::cuComplex, x: *mut cuda_types::cublas::cuComplex, incx: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZtpmv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: ::core::ffi::c_int, AP: *const cuda_types::cublas::cuDoubleComplex, x: *mut cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZtpmv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: i64, AP: *const cuda_types::cublas::cuDoubleComplex, x: *mut cuda_types::cublas::cuDoubleComplex, incx: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasStrsv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: ::core::ffi::c_int, A: *const f32, lda: ::core::ffi::c_int, x: *mut f32, incx: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasStrsv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: i64, A: *const f32, lda: i64, x: *mut f32, incx: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDtrsv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: ::core::ffi::c_int, A: *const f64, lda: ::core::ffi::c_int, x: *mut f64, incx: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDtrsv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: i64, A: *const f64, lda: i64, x: *mut f64, incx: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCtrsv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: ::core::ffi::c_int, A: *const cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, x: *mut cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCtrsv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: i64, A: *const cuda_types::cublas::cuComplex, lda: i64, x: *mut cuda_types::cublas::cuComplex, incx: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZtrsv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: ::core::ffi::c_int, A: *const cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, x: *mut cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZtrsv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: i64, A: *const cuda_types::cublas::cuDoubleComplex, lda: i64, x: *mut cuda_types::cublas::cuDoubleComplex, incx: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasStpsv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: ::core::ffi::c_int, AP: *const f32, x: *mut f32, incx: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasStpsv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: i64, AP: *const f32, x: *mut f32, incx: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDtpsv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: ::core::ffi::c_int, AP: *const f64, x: *mut f64, incx: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDtpsv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: i64, AP: *const f64, x: *mut f64, incx: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCtpsv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: ::core::ffi::c_int, AP: *const cuda_types::cublas::cuComplex, x: *mut cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCtpsv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: i64, AP: *const cuda_types::cublas::cuComplex, x: *mut cuda_types::cublas::cuComplex, incx: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZtpsv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: ::core::ffi::c_int, AP: *const cuda_types::cublas::cuDoubleComplex, x: *mut cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZtpsv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: i64, AP: *const cuda_types::cublas::cuDoubleComplex, x: *mut cuda_types::cublas::cuDoubleComplex, incx: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasStbsv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: ::core::ffi::c_int, k: ::core::ffi::c_int, A: *const f32, lda: ::core::ffi::c_int, x: *mut f32, incx: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasStbsv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: i64, k: i64, A: *const f32, lda: i64, x: *mut f32, incx: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDtbsv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: ::core::ffi::c_int, k: ::core::ffi::c_int, A: *const f64, lda: ::core::ffi::c_int, x: *mut f64, incx: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDtbsv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: i64, k: i64, A: *const f64, lda: i64, x: *mut f64, incx: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCtbsv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: ::core::ffi::c_int, k: ::core::ffi::c_int, A: *const cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, x: *mut cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCtbsv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: i64, k: i64, A: *const cuda_types::cublas::cuComplex, lda: i64, x: *mut cuda_types::cublas::cuComplex, incx: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZtbsv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: ::core::ffi::c_int, k: ::core::ffi::c_int, A: *const cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, x: *mut cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZtbsv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, n: i64, k: i64, A: *const cuda_types::cublas::cuDoubleComplex, lda: i64, x: *mut cuda_types::cublas::cuDoubleComplex, incx: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSsymv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, alpha: *const f32, A: *const f32, lda: ::core::ffi::c_int, x: *const f32, incx: ::core::ffi::c_int, beta: *const f32, y: *mut f32, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSsymv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: i64, alpha: *const f32, A: *const f32, lda: i64, x: *const f32, incx: i64, beta: *const f32, y: *mut f32, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDsymv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, alpha: *const f64, A: *const f64, lda: ::core::ffi::c_int, x: *const f64, incx: ::core::ffi::c_int, beta: *const f64, y: *mut f64, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDsymv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: i64, alpha: *const f64, A: *const f64, lda: i64, x: *const f64, incx: i64, beta: *const f64, y: *mut f64, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCsymv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, x: *const cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuComplex, y: *mut cuda_types::cublas::cuComplex, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCsymv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: i64, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: i64, x: *const cuda_types::cublas::cuComplex, incx: i64, beta: *const cuda_types::cublas::cuComplex, y: *mut cuda_types::cublas::cuComplex, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZsymv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, x: *const cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuDoubleComplex, y: *mut cuda_types::cublas::cuDoubleComplex, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZsymv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: i64, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: i64, x: *const cuda_types::cublas::cuDoubleComplex, incx: i64, beta: *const cuda_types::cublas::cuDoubleComplex, y: *mut cuda_types::cublas::cuDoubleComplex, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasChemv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, x: *const cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuComplex, y: *mut cuda_types::cublas::cuComplex, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasChemv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: i64, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: i64, x: *const cuda_types::cublas::cuComplex, incx: i64, beta: *const cuda_types::cublas::cuComplex, y: *mut cuda_types::cublas::cuComplex, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZhemv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, x: *const cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuDoubleComplex, y: *mut cuda_types::cublas::cuDoubleComplex, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZhemv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: i64, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: i64, x: *const cuda_types::cublas::cuDoubleComplex, incx: i64, beta: *const cuda_types::cublas::cuDoubleComplex, y: *mut cuda_types::cublas::cuDoubleComplex, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSsbmv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const f32, A: *const f32, lda: ::core::ffi::c_int, x: *const f32, incx: ::core::ffi::c_int, beta: *const f32, y: *mut f32, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSsbmv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: i64, k: i64, alpha: *const f32, A: *const f32, lda: i64, x: *const f32, incx: i64, beta: *const f32, y: *mut f32, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDsbmv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const f64, A: *const f64, lda: ::core::ffi::c_int, x: *const f64, incx: ::core::ffi::c_int, beta: *const f64, y: *mut f64, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDsbmv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: i64, k: i64, alpha: *const f64, A: *const f64, lda: i64, x: *const f64, incx: i64, beta: *const f64, y: *mut f64, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasChbmv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, x: *const cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuComplex, y: *mut cuda_types::cublas::cuComplex, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasChbmv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: i64, k: i64, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: i64, x: *const cuda_types::cublas::cuComplex, incx: i64, beta: *const cuda_types::cublas::cuComplex, y: *mut cuda_types::cublas::cuComplex, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZhbmv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, x: *const cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuDoubleComplex, y: *mut cuda_types::cublas::cuDoubleComplex, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZhbmv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: i64, k: i64, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: i64, x: *const cuda_types::cublas::cuDoubleComplex, incx: i64, beta: *const cuda_types::cublas::cuDoubleComplex, y: *mut cuda_types::cublas::cuDoubleComplex, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSspmv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, alpha: *const f32, AP: *const f32, x: *const f32, incx: ::core::ffi::c_int, beta: *const f32, y: *mut f32, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSspmv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: i64, alpha: *const f32, AP: *const f32, x: *const f32, incx: i64, beta: *const f32, y: *mut f32, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDspmv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, alpha: *const f64, AP: *const f64, x: *const f64, incx: ::core::ffi::c_int, beta: *const f64, y: *mut f64, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDspmv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: i64, alpha: *const f64, AP: *const f64, x: *const f64, incx: i64, beta: *const f64, y: *mut f64, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasChpmv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, AP: *const cuda_types::cublas::cuComplex, x: *const cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuComplex, y: *mut cuda_types::cublas::cuComplex, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasChpmv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: i64, alpha: *const cuda_types::cublas::cuComplex, AP: *const cuda_types::cublas::cuComplex, x: *const cuda_types::cublas::cuComplex, incx: i64, beta: *const cuda_types::cublas::cuComplex, y: *mut cuda_types::cublas::cuComplex, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZhpmv_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuDoubleComplex, AP: *const cuda_types::cublas::cuDoubleComplex, x: *const cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuDoubleComplex, y: *mut cuda_types::cublas::cuDoubleComplex, incy: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZhpmv_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: i64, alpha: *const cuda_types::cublas::cuDoubleComplex, AP: *const cuda_types::cublas::cuDoubleComplex, x: *const cuda_types::cublas::cuDoubleComplex, incx: i64, beta: *const cuda_types::cublas::cuDoubleComplex, y: *mut cuda_types::cublas::cuDoubleComplex, incy: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSger_v2( handle: cuda_types::cublas::cublasHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const f32, x: *const f32, incx: ::core::ffi::c_int, y: *const f32, incy: ::core::ffi::c_int, A: *mut f32, lda: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSger_v2_64( handle: cuda_types::cublas::cublasHandle_t, m: i64, n: i64, alpha: *const f32, x: *const f32, incx: i64, y: *const f32, incy: i64, A: *mut f32, lda: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDger_v2( handle: cuda_types::cublas::cublasHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const f64, x: *const f64, incx: ::core::ffi::c_int, y: *const f64, incy: ::core::ffi::c_int, A: *mut f64, lda: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDger_v2_64( handle: cuda_types::cublas::cublasHandle_t, m: i64, n: i64, alpha: *const f64, x: *const f64, incx: i64, y: *const f64, incy: i64, A: *mut f64, lda: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCgeru_v2( handle: cuda_types::cublas::cublasHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, x: *const cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, y: *const cuda_types::cublas::cuComplex, incy: ::core::ffi::c_int, A: *mut cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCgeru_v2_64( handle: cuda_types::cublas::cublasHandle_t, m: i64, n: i64, alpha: *const cuda_types::cublas::cuComplex, x: *const cuda_types::cublas::cuComplex, incx: i64, y: *const cuda_types::cublas::cuComplex, incy: i64, A: *mut cuda_types::cublas::cuComplex, lda: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCgerc_v2( handle: cuda_types::cublas::cublasHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, x: *const cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, y: *const cuda_types::cublas::cuComplex, incy: ::core::ffi::c_int, A: *mut cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCgerc_v2_64( handle: cuda_types::cublas::cublasHandle_t, m: i64, n: i64, alpha: *const cuda_types::cublas::cuComplex, x: *const cuda_types::cublas::cuComplex, incx: i64, y: *const cuda_types::cublas::cuComplex, incy: i64, A: *mut cuda_types::cublas::cuComplex, lda: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZgeru_v2( handle: cuda_types::cublas::cublasHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuDoubleComplex, x: *const cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, y: *const cuda_types::cublas::cuDoubleComplex, incy: ::core::ffi::c_int, A: *mut cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZgeru_v2_64( handle: cuda_types::cublas::cublasHandle_t, m: i64, n: i64, alpha: *const cuda_types::cublas::cuDoubleComplex, x: *const cuda_types::cublas::cuDoubleComplex, incx: i64, y: *const cuda_types::cublas::cuDoubleComplex, incy: i64, A: *mut cuda_types::cublas::cuDoubleComplex, lda: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZgerc_v2( handle: cuda_types::cublas::cublasHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuDoubleComplex, x: *const cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, y: *const cuda_types::cublas::cuDoubleComplex, incy: ::core::ffi::c_int, A: *mut cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZgerc_v2_64( handle: cuda_types::cublas::cublasHandle_t, m: i64, n: i64, alpha: *const cuda_types::cublas::cuDoubleComplex, x: *const cuda_types::cublas::cuDoubleComplex, incx: i64, y: *const cuda_types::cublas::cuDoubleComplex, incy: i64, A: *mut cuda_types::cublas::cuDoubleComplex, lda: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSsyr_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, alpha: *const f32, x: *const f32, incx: ::core::ffi::c_int, A: *mut f32, lda: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSsyr_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: i64, alpha: *const f32, x: *const f32, incx: i64, A: *mut f32, lda: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDsyr_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, alpha: *const f64, x: *const f64, incx: ::core::ffi::c_int, A: *mut f64, lda: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDsyr_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: i64, alpha: *const f64, x: *const f64, incx: i64, A: *mut f64, lda: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCsyr_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, x: *const cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, A: *mut cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCsyr_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: i64, alpha: *const cuda_types::cublas::cuComplex, x: *const cuda_types::cublas::cuComplex, incx: i64, A: *mut cuda_types::cublas::cuComplex, lda: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZsyr_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuDoubleComplex, x: *const cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, A: *mut cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZsyr_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: i64, alpha: *const cuda_types::cublas::cuDoubleComplex, x: *const cuda_types::cublas::cuDoubleComplex, incx: i64, A: *mut cuda_types::cublas::cuDoubleComplex, lda: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCher_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, alpha: *const f32, x: *const cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, A: *mut cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCher_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: i64, alpha: *const f32, x: *const cuda_types::cublas::cuComplex, incx: i64, A: *mut cuda_types::cublas::cuComplex, lda: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZher_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, alpha: *const f64, x: *const cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, A: *mut cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZher_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: i64, alpha: *const f64, x: *const cuda_types::cublas::cuDoubleComplex, incx: i64, A: *mut cuda_types::cublas::cuDoubleComplex, lda: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSspr_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, alpha: *const f32, x: *const f32, incx: ::core::ffi::c_int, AP: *mut f32, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSspr_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: i64, alpha: *const f32, x: *const f32, incx: i64, AP: *mut f32, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDspr_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, alpha: *const f64, x: *const f64, incx: ::core::ffi::c_int, AP: *mut f64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDspr_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: i64, alpha: *const f64, x: *const f64, incx: i64, AP: *mut f64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasChpr_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, alpha: *const f32, x: *const cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, AP: *mut cuda_types::cublas::cuComplex, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasChpr_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: i64, alpha: *const f32, x: *const cuda_types::cublas::cuComplex, incx: i64, AP: *mut cuda_types::cublas::cuComplex, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZhpr_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, alpha: *const f64, x: *const cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, AP: *mut cuda_types::cublas::cuDoubleComplex, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZhpr_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: i64, alpha: *const f64, x: *const cuda_types::cublas::cuDoubleComplex, incx: i64, AP: *mut cuda_types::cublas::cuDoubleComplex, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSsyr2_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, alpha: *const f32, x: *const f32, incx: ::core::ffi::c_int, y: *const f32, incy: ::core::ffi::c_int, A: *mut f32, lda: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSsyr2_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: i64, alpha: *const f32, x: *const f32, incx: i64, y: *const f32, incy: i64, A: *mut f32, lda: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDsyr2_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, alpha: *const f64, x: *const f64, incx: ::core::ffi::c_int, y: *const f64, incy: ::core::ffi::c_int, A: *mut f64, lda: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDsyr2_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: i64, alpha: *const f64, x: *const f64, incx: i64, y: *const f64, incy: i64, A: *mut f64, lda: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCsyr2_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, x: *const cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, y: *const cuda_types::cublas::cuComplex, incy: ::core::ffi::c_int, A: *mut cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCsyr2_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: i64, alpha: *const cuda_types::cublas::cuComplex, x: *const cuda_types::cublas::cuComplex, incx: i64, y: *const cuda_types::cublas::cuComplex, incy: i64, A: *mut cuda_types::cublas::cuComplex, lda: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZsyr2_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuDoubleComplex, x: *const cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, y: *const cuda_types::cublas::cuDoubleComplex, incy: ::core::ffi::c_int, A: *mut cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZsyr2_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: i64, alpha: *const cuda_types::cublas::cuDoubleComplex, x: *const cuda_types::cublas::cuDoubleComplex, incx: i64, y: *const cuda_types::cublas::cuDoubleComplex, incy: i64, A: *mut cuda_types::cublas::cuDoubleComplex, lda: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCher2_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, x: *const cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, y: *const cuda_types::cublas::cuComplex, incy: ::core::ffi::c_int, A: *mut cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCher2_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: i64, alpha: *const cuda_types::cublas::cuComplex, x: *const cuda_types::cublas::cuComplex, incx: i64, y: *const cuda_types::cublas::cuComplex, incy: i64, A: *mut cuda_types::cublas::cuComplex, lda: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZher2_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuDoubleComplex, x: *const cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, y: *const cuda_types::cublas::cuDoubleComplex, incy: ::core::ffi::c_int, A: *mut cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZher2_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: i64, alpha: *const cuda_types::cublas::cuDoubleComplex, x: *const cuda_types::cublas::cuDoubleComplex, incx: i64, y: *const cuda_types::cublas::cuDoubleComplex, incy: i64, A: *mut cuda_types::cublas::cuDoubleComplex, lda: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSspr2_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, alpha: *const f32, x: *const f32, incx: ::core::ffi::c_int, y: *const f32, incy: ::core::ffi::c_int, AP: *mut f32, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSspr2_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: i64, alpha: *const f32, x: *const f32, incx: i64, y: *const f32, incy: i64, AP: *mut f32, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDspr2_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, alpha: *const f64, x: *const f64, incx: ::core::ffi::c_int, y: *const f64, incy: ::core::ffi::c_int, AP: *mut f64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDspr2_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: i64, alpha: *const f64, x: *const f64, incx: i64, y: *const f64, incy: i64, AP: *mut f64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasChpr2_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, x: *const cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, y: *const cuda_types::cublas::cuComplex, incy: ::core::ffi::c_int, AP: *mut cuda_types::cublas::cuComplex, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasChpr2_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: i64, alpha: *const cuda_types::cublas::cuComplex, x: *const cuda_types::cublas::cuComplex, incx: i64, y: *const cuda_types::cublas::cuComplex, incy: i64, AP: *mut cuda_types::cublas::cuComplex, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZhpr2_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuDoubleComplex, x: *const cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, y: *const cuda_types::cublas::cuDoubleComplex, incy: ::core::ffi::c_int, AP: *mut cuda_types::cublas::cuDoubleComplex, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZhpr2_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: i64, alpha: *const cuda_types::cublas::cuDoubleComplex, x: *const cuda_types::cublas::cuDoubleComplex, incx: i64, y: *const cuda_types::cublas::cuDoubleComplex, incy: i64, AP: *mut cuda_types::cublas::cuDoubleComplex, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSgemvBatched( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const f32, Aarray: *const *const f32, lda: ::core::ffi::c_int, xarray: *const *const f32, incx: ::core::ffi::c_int, beta: *const f32, yarray: *const *mut f32, incy: ::core::ffi::c_int, batchCount: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSgemvBatched_64( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, alpha: *const f32, Aarray: *const *const f32, lda: i64, xarray: *const *const f32, incx: i64, beta: *const f32, yarray: *const *mut f32, incy: i64, batchCount: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDgemvBatched( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const f64, Aarray: *const *const f64, lda: ::core::ffi::c_int, xarray: *const *const f64, incx: ::core::ffi::c_int, beta: *const f64, yarray: *const *mut f64, incy: ::core::ffi::c_int, batchCount: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDgemvBatched_64( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, alpha: *const f64, Aarray: *const *const f64, lda: i64, xarray: *const *const f64, incx: i64, beta: *const f64, yarray: *const *mut f64, incy: i64, batchCount: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCgemvBatched( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, Aarray: *const *const cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, xarray: *const *const cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuComplex, yarray: *const *mut cuda_types::cublas::cuComplex, incy: ::core::ffi::c_int, batchCount: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCgemvBatched_64( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, alpha: *const cuda_types::cublas::cuComplex, Aarray: *const *const cuda_types::cublas::cuComplex, lda: i64, xarray: *const *const cuda_types::cublas::cuComplex, incx: i64, beta: *const cuda_types::cublas::cuComplex, yarray: *const *mut cuda_types::cublas::cuComplex, incy: i64, batchCount: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZgemvBatched( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuDoubleComplex, Aarray: *const *const cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, xarray: *const *const cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuDoubleComplex, yarray: *const *mut cuda_types::cublas::cuDoubleComplex, incy: ::core::ffi::c_int, batchCount: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZgemvBatched_64( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, alpha: *const cuda_types::cublas::cuDoubleComplex, Aarray: *const *const cuda_types::cublas::cuDoubleComplex, lda: i64, xarray: *const *const cuda_types::cublas::cuDoubleComplex, incx: i64, beta: *const cuda_types::cublas::cuDoubleComplex, yarray: *const *mut cuda_types::cublas::cuDoubleComplex, incy: i64, batchCount: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasHSHgemvBatched( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const f32, Aarray: *const *const cuda_types::cublas::__half, lda: ::core::ffi::c_int, xarray: *const *const cuda_types::cublas::__half, incx: ::core::ffi::c_int, beta: *const f32, yarray: *const *mut cuda_types::cublas::__half, incy: ::core::ffi::c_int, batchCount: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasHSHgemvBatched_64( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, alpha: *const f32, Aarray: *const *const cuda_types::cublas::__half, lda: i64, xarray: *const *const cuda_types::cublas::__half, incx: i64, beta: *const f32, yarray: *const *mut cuda_types::cublas::__half, incy: i64, batchCount: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasHSSgemvBatched( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const f32, Aarray: *const *const cuda_types::cublas::__half, lda: ::core::ffi::c_int, xarray: *const *const cuda_types::cublas::__half, incx: ::core::ffi::c_int, beta: *const f32, yarray: *const *mut f32, incy: ::core::ffi::c_int, batchCount: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasHSSgemvBatched_64( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, alpha: *const f32, Aarray: *const *const cuda_types::cublas::__half, lda: i64, xarray: *const *const cuda_types::cublas::__half, incx: i64, beta: *const f32, yarray: *const *mut f32, incy: i64, batchCount: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasTSTgemvBatched( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const f32, Aarray: *const *const cuda_types::cublas::__nv_bfloat16, lda: ::core::ffi::c_int, xarray: *const *const cuda_types::cublas::__nv_bfloat16, incx: ::core::ffi::c_int, beta: *const f32, yarray: *const *mut cuda_types::cublas::__nv_bfloat16, incy: ::core::ffi::c_int, batchCount: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasTSTgemvBatched_64( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, alpha: *const f32, Aarray: *const *const cuda_types::cublas::__nv_bfloat16, lda: i64, xarray: *const *const cuda_types::cublas::__nv_bfloat16, incx: i64, beta: *const f32, yarray: *const *mut cuda_types::cublas::__nv_bfloat16, incy: i64, batchCount: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasTSSgemvBatched( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const f32, Aarray: *const *const cuda_types::cublas::__nv_bfloat16, lda: ::core::ffi::c_int, xarray: *const *const cuda_types::cublas::__nv_bfloat16, incx: ::core::ffi::c_int, beta: *const f32, yarray: *const *mut f32, incy: ::core::ffi::c_int, batchCount: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasTSSgemvBatched_64( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, alpha: *const f32, Aarray: *const *const cuda_types::cublas::__nv_bfloat16, lda: i64, xarray: *const *const cuda_types::cublas::__nv_bfloat16, incx: i64, beta: *const f32, yarray: *const *mut f32, incy: i64, batchCount: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSgemvStridedBatched( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const f32, A: *const f32, lda: ::core::ffi::c_int, strideA: ::core::ffi::c_longlong, x: *const f32, incx: ::core::ffi::c_int, stridex: ::core::ffi::c_longlong, beta: *const f32, y: *mut f32, incy: ::core::ffi::c_int, stridey: ::core::ffi::c_longlong, batchCount: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSgemvStridedBatched_64( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, alpha: *const f32, A: *const f32, lda: i64, strideA: ::core::ffi::c_longlong, x: *const f32, incx: i64, stridex: ::core::ffi::c_longlong, beta: *const f32, y: *mut f32, incy: i64, stridey: ::core::ffi::c_longlong, batchCount: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDgemvStridedBatched( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const f64, A: *const f64, lda: ::core::ffi::c_int, strideA: ::core::ffi::c_longlong, x: *const f64, incx: ::core::ffi::c_int, stridex: ::core::ffi::c_longlong, beta: *const f64, y: *mut f64, incy: ::core::ffi::c_int, stridey: ::core::ffi::c_longlong, batchCount: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDgemvStridedBatched_64( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, alpha: *const f64, A: *const f64, lda: i64, strideA: ::core::ffi::c_longlong, x: *const f64, incx: i64, stridex: ::core::ffi::c_longlong, beta: *const f64, y: *mut f64, incy: i64, stridey: ::core::ffi::c_longlong, batchCount: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCgemvStridedBatched( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, strideA: ::core::ffi::c_longlong, x: *const cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, stridex: ::core::ffi::c_longlong, beta: *const cuda_types::cublas::cuComplex, y: *mut cuda_types::cublas::cuComplex, incy: ::core::ffi::c_int, stridey: ::core::ffi::c_longlong, batchCount: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCgemvStridedBatched_64( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: i64, strideA: ::core::ffi::c_longlong, x: *const cuda_types::cublas::cuComplex, incx: i64, stridex: ::core::ffi::c_longlong, beta: *const cuda_types::cublas::cuComplex, y: *mut cuda_types::cublas::cuComplex, incy: i64, stridey: ::core::ffi::c_longlong, batchCount: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZgemvStridedBatched( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, strideA: ::core::ffi::c_longlong, x: *const cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, stridex: ::core::ffi::c_longlong, beta: *const cuda_types::cublas::cuDoubleComplex, y: *mut cuda_types::cublas::cuDoubleComplex, incy: ::core::ffi::c_int, stridey: ::core::ffi::c_longlong, batchCount: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZgemvStridedBatched_64( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: i64, strideA: ::core::ffi::c_longlong, x: *const cuda_types::cublas::cuDoubleComplex, incx: i64, stridex: ::core::ffi::c_longlong, beta: *const cuda_types::cublas::cuDoubleComplex, y: *mut cuda_types::cublas::cuDoubleComplex, incy: i64, stridey: ::core::ffi::c_longlong, batchCount: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasHSHgemvStridedBatched( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const f32, A: *const cuda_types::cublas::__half, lda: ::core::ffi::c_int, strideA: ::core::ffi::c_longlong, x: *const cuda_types::cublas::__half, incx: ::core::ffi::c_int, stridex: ::core::ffi::c_longlong, beta: *const f32, y: *mut cuda_types::cublas::__half, incy: ::core::ffi::c_int, stridey: ::core::ffi::c_longlong, batchCount: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasHSHgemvStridedBatched_64( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, alpha: *const f32, A: *const cuda_types::cublas::__half, lda: i64, strideA: ::core::ffi::c_longlong, x: *const cuda_types::cublas::__half, incx: i64, stridex: ::core::ffi::c_longlong, beta: *const f32, y: *mut cuda_types::cublas::__half, incy: i64, stridey: ::core::ffi::c_longlong, batchCount: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasHSSgemvStridedBatched( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const f32, A: *const cuda_types::cublas::__half, lda: ::core::ffi::c_int, strideA: ::core::ffi::c_longlong, x: *const cuda_types::cublas::__half, incx: ::core::ffi::c_int, stridex: ::core::ffi::c_longlong, beta: *const f32, y: *mut f32, incy: ::core::ffi::c_int, stridey: ::core::ffi::c_longlong, batchCount: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasHSSgemvStridedBatched_64( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, alpha: *const f32, A: *const cuda_types::cublas::__half, lda: i64, strideA: ::core::ffi::c_longlong, x: *const cuda_types::cublas::__half, incx: i64, stridex: ::core::ffi::c_longlong, beta: *const f32, y: *mut f32, incy: i64, stridey: ::core::ffi::c_longlong, batchCount: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasTSTgemvStridedBatched( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const f32, A: *const cuda_types::cublas::__nv_bfloat16, lda: ::core::ffi::c_int, strideA: ::core::ffi::c_longlong, x: *const cuda_types::cublas::__nv_bfloat16, incx: ::core::ffi::c_int, stridex: ::core::ffi::c_longlong, beta: *const f32, y: *mut cuda_types::cublas::__nv_bfloat16, incy: ::core::ffi::c_int, stridey: ::core::ffi::c_longlong, batchCount: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasTSTgemvStridedBatched_64( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, alpha: *const f32, A: *const cuda_types::cublas::__nv_bfloat16, lda: i64, strideA: ::core::ffi::c_longlong, x: *const cuda_types::cublas::__nv_bfloat16, incx: i64, stridex: ::core::ffi::c_longlong, beta: *const f32, y: *mut cuda_types::cublas::__nv_bfloat16, incy: i64, stridey: ::core::ffi::c_longlong, batchCount: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasTSSgemvStridedBatched( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const f32, A: *const cuda_types::cublas::__nv_bfloat16, lda: ::core::ffi::c_int, strideA: ::core::ffi::c_longlong, x: *const cuda_types::cublas::__nv_bfloat16, incx: ::core::ffi::c_int, stridex: ::core::ffi::c_longlong, beta: *const f32, y: *mut f32, incy: ::core::ffi::c_int, stridey: ::core::ffi::c_longlong, batchCount: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasTSSgemvStridedBatched_64( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, alpha: *const f32, A: *const cuda_types::cublas::__nv_bfloat16, lda: i64, strideA: ::core::ffi::c_longlong, x: *const cuda_types::cublas::__nv_bfloat16, incx: i64, stridex: ::core::ffi::c_longlong, beta: *const f32, y: *mut f32, incy: i64, stridey: ::core::ffi::c_longlong, batchCount: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSgemm_v2( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const f32, A: *const f32, lda: ::core::ffi::c_int, B: *const f32, ldb: ::core::ffi::c_int, beta: *const f32, C: *mut f32, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSgemm_v2_64( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, k: i64, alpha: *const f32, A: *const f32, lda: i64, B: *const f32, ldb: i64, beta: *const f32, C: *mut f32, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDgemm_v2( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const f64, A: *const f64, lda: ::core::ffi::c_int, B: *const f64, ldb: ::core::ffi::c_int, beta: *const f64, C: *mut f64, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDgemm_v2_64( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, k: i64, alpha: *const f64, A: *const f64, lda: i64, B: *const f64, ldb: i64, beta: *const f64, C: *mut f64, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCgemm_v2( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, B: *const cuda_types::cublas::cuComplex, ldb: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuComplex, C: *mut cuda_types::cublas::cuComplex, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCgemm_v2_64( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, k: i64, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: i64, B: *const cuda_types::cublas::cuComplex, ldb: i64, beta: *const cuda_types::cublas::cuComplex, C: *mut cuda_types::cublas::cuComplex, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCgemm3m( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, B: *const cuda_types::cublas::cuComplex, ldb: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuComplex, C: *mut cuda_types::cublas::cuComplex, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCgemm3m_64( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, k: i64, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: i64, B: *const cuda_types::cublas::cuComplex, ldb: i64, beta: *const cuda_types::cublas::cuComplex, C: *mut cuda_types::cublas::cuComplex, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCgemm3mEx( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, A: *const ::core::ffi::c_void, Atype: cuda_types::cublas::cudaDataType, lda: ::core::ffi::c_int, B: *const ::core::ffi::c_void, Btype: cuda_types::cublas::cudaDataType, ldb: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuComplex, C: *mut ::core::ffi::c_void, Ctype: cuda_types::cublas::cudaDataType, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCgemm3mEx_64( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, k: i64, alpha: *const cuda_types::cublas::cuComplex, A: *const ::core::ffi::c_void, Atype: cuda_types::cublas::cudaDataType, lda: i64, B: *const ::core::ffi::c_void, Btype: cuda_types::cublas::cudaDataType, ldb: i64, beta: *const cuda_types::cublas::cuComplex, C: *mut ::core::ffi::c_void, Ctype: cuda_types::cublas::cudaDataType, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZgemm_v2( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, B: *const cuda_types::cublas::cuDoubleComplex, ldb: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuDoubleComplex, C: *mut cuda_types::cublas::cuDoubleComplex, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZgemm_v2_64( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, k: i64, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: i64, B: *const cuda_types::cublas::cuDoubleComplex, ldb: i64, beta: *const cuda_types::cublas::cuDoubleComplex, C: *mut cuda_types::cublas::cuDoubleComplex, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZgemm3m( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, B: *const cuda_types::cublas::cuDoubleComplex, ldb: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuDoubleComplex, C: *mut cuda_types::cublas::cuDoubleComplex, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZgemm3m_64( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, k: i64, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: i64, B: *const cuda_types::cublas::cuDoubleComplex, ldb: i64, beta: *const cuda_types::cublas::cuDoubleComplex, C: *mut cuda_types::cublas::cuDoubleComplex, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasHgemm( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const cuda_types::cublas::__half, A: *const cuda_types::cublas::__half, lda: ::core::ffi::c_int, B: *const cuda_types::cublas::__half, ldb: ::core::ffi::c_int, beta: *const cuda_types::cublas::__half, C: *mut cuda_types::cublas::__half, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasHgemm_64( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, k: i64, alpha: *const cuda_types::cublas::__half, A: *const cuda_types::cublas::__half, lda: i64, B: *const cuda_types::cublas::__half, ldb: i64, beta: *const cuda_types::cublas::__half, C: *mut cuda_types::cublas::__half, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSgemmEx( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const f32, A: *const ::core::ffi::c_void, Atype: cuda_types::cublas::cudaDataType, lda: ::core::ffi::c_int, B: *const ::core::ffi::c_void, Btype: cuda_types::cublas::cudaDataType, ldb: ::core::ffi::c_int, beta: *const f32, C: *mut ::core::ffi::c_void, Ctype: cuda_types::cublas::cudaDataType, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSgemmEx_64( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, k: i64, alpha: *const f32, A: *const ::core::ffi::c_void, Atype: cuda_types::cublas::cudaDataType, lda: i64, B: *const ::core::ffi::c_void, Btype: cuda_types::cublas::cudaDataType, ldb: i64, beta: *const f32, C: *mut ::core::ffi::c_void, Ctype: cuda_types::cublas::cudaDataType, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasGemmEx( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const ::core::ffi::c_void, A: *const ::core::ffi::c_void, Atype: cuda_types::cublas::cudaDataType, lda: ::core::ffi::c_int, B: *const ::core::ffi::c_void, Btype: cuda_types::cublas::cudaDataType, ldb: ::core::ffi::c_int, beta: *const ::core::ffi::c_void, C: *mut ::core::ffi::c_void, Ctype: cuda_types::cublas::cudaDataType, ldc: ::core::ffi::c_int, computeType: cuda_types::cublas::cublasComputeType_t, algo: cuda_types::cublas::cublasGemmAlgo_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasGemmEx_64( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, k: i64, alpha: *const ::core::ffi::c_void, A: *const ::core::ffi::c_void, Atype: cuda_types::cublas::cudaDataType, lda: i64, B: *const ::core::ffi::c_void, Btype: cuda_types::cublas::cudaDataType, ldb: i64, beta: *const ::core::ffi::c_void, C: *mut ::core::ffi::c_void, Ctype: cuda_types::cublas::cudaDataType, ldc: i64, computeType: cuda_types::cublas::cublasComputeType_t, algo: cuda_types::cublas::cublasGemmAlgo_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCgemmEx( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, A: *const ::core::ffi::c_void, Atype: cuda_types::cublas::cudaDataType, lda: ::core::ffi::c_int, B: *const ::core::ffi::c_void, Btype: cuda_types::cublas::cudaDataType, ldb: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuComplex, C: *mut ::core::ffi::c_void, Ctype: cuda_types::cublas::cudaDataType, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCgemmEx_64( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, k: i64, alpha: *const cuda_types::cublas::cuComplex, A: *const ::core::ffi::c_void, Atype: cuda_types::cublas::cudaDataType, lda: i64, B: *const ::core::ffi::c_void, Btype: cuda_types::cublas::cudaDataType, ldb: i64, beta: *const cuda_types::cublas::cuComplex, C: *mut ::core::ffi::c_void, Ctype: cuda_types::cublas::cudaDataType, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSsyrk_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const f32, A: *const f32, lda: ::core::ffi::c_int, beta: *const f32, C: *mut f32, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSsyrk_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: i64, k: i64, alpha: *const f32, A: *const f32, lda: i64, beta: *const f32, C: *mut f32, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDsyrk_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const f64, A: *const f64, lda: ::core::ffi::c_int, beta: *const f64, C: *mut f64, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDsyrk_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: i64, k: i64, alpha: *const f64, A: *const f64, lda: i64, beta: *const f64, C: *mut f64, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCsyrk_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuComplex, C: *mut cuda_types::cublas::cuComplex, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCsyrk_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: i64, k: i64, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: i64, beta: *const cuda_types::cublas::cuComplex, C: *mut cuda_types::cublas::cuComplex, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZsyrk_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuDoubleComplex, C: *mut cuda_types::cublas::cuDoubleComplex, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZsyrk_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: i64, k: i64, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: i64, beta: *const cuda_types::cublas::cuDoubleComplex, C: *mut cuda_types::cublas::cuDoubleComplex, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCsyrkEx( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, A: *const ::core::ffi::c_void, Atype: cuda_types::cublas::cudaDataType, lda: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuComplex, C: *mut ::core::ffi::c_void, Ctype: cuda_types::cublas::cudaDataType, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCsyrkEx_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: i64, k: i64, alpha: *const cuda_types::cublas::cuComplex, A: *const ::core::ffi::c_void, Atype: cuda_types::cublas::cudaDataType, lda: i64, beta: *const cuda_types::cublas::cuComplex, C: *mut ::core::ffi::c_void, Ctype: cuda_types::cublas::cudaDataType, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCsyrk3mEx( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, A: *const ::core::ffi::c_void, Atype: cuda_types::cublas::cudaDataType, lda: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuComplex, C: *mut ::core::ffi::c_void, Ctype: cuda_types::cublas::cudaDataType, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCsyrk3mEx_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: i64, k: i64, alpha: *const cuda_types::cublas::cuComplex, A: *const ::core::ffi::c_void, Atype: cuda_types::cublas::cudaDataType, lda: i64, beta: *const cuda_types::cublas::cuComplex, C: *mut ::core::ffi::c_void, Ctype: cuda_types::cublas::cudaDataType, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCherk_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const f32, A: *const cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, beta: *const f32, C: *mut cuda_types::cublas::cuComplex, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCherk_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: i64, k: i64, alpha: *const f32, A: *const cuda_types::cublas::cuComplex, lda: i64, beta: *const f32, C: *mut cuda_types::cublas::cuComplex, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZherk_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const f64, A: *const cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, beta: *const f64, C: *mut cuda_types::cublas::cuDoubleComplex, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZherk_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: i64, k: i64, alpha: *const f64, A: *const cuda_types::cublas::cuDoubleComplex, lda: i64, beta: *const f64, C: *mut cuda_types::cublas::cuDoubleComplex, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCherkEx( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const f32, A: *const ::core::ffi::c_void, Atype: cuda_types::cublas::cudaDataType, lda: ::core::ffi::c_int, beta: *const f32, C: *mut ::core::ffi::c_void, Ctype: cuda_types::cublas::cudaDataType, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCherkEx_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: i64, k: i64, alpha: *const f32, A: *const ::core::ffi::c_void, Atype: cuda_types::cublas::cudaDataType, lda: i64, beta: *const f32, C: *mut ::core::ffi::c_void, Ctype: cuda_types::cublas::cudaDataType, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCherk3mEx( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const f32, A: *const ::core::ffi::c_void, Atype: cuda_types::cublas::cudaDataType, lda: ::core::ffi::c_int, beta: *const f32, C: *mut ::core::ffi::c_void, Ctype: cuda_types::cublas::cudaDataType, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCherk3mEx_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: i64, k: i64, alpha: *const f32, A: *const ::core::ffi::c_void, Atype: cuda_types::cublas::cudaDataType, lda: i64, beta: *const f32, C: *mut ::core::ffi::c_void, Ctype: cuda_types::cublas::cudaDataType, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSsyr2k_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const f32, A: *const f32, lda: ::core::ffi::c_int, B: *const f32, ldb: ::core::ffi::c_int, beta: *const f32, C: *mut f32, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSsyr2k_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: i64, k: i64, alpha: *const f32, A: *const f32, lda: i64, B: *const f32, ldb: i64, beta: *const f32, C: *mut f32, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDsyr2k_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const f64, A: *const f64, lda: ::core::ffi::c_int, B: *const f64, ldb: ::core::ffi::c_int, beta: *const f64, C: *mut f64, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDsyr2k_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: i64, k: i64, alpha: *const f64, A: *const f64, lda: i64, B: *const f64, ldb: i64, beta: *const f64, C: *mut f64, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCsyr2k_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, B: *const cuda_types::cublas::cuComplex, ldb: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuComplex, C: *mut cuda_types::cublas::cuComplex, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCsyr2k_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: i64, k: i64, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: i64, B: *const cuda_types::cublas::cuComplex, ldb: i64, beta: *const cuda_types::cublas::cuComplex, C: *mut cuda_types::cublas::cuComplex, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZsyr2k_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, B: *const cuda_types::cublas::cuDoubleComplex, ldb: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuDoubleComplex, C: *mut cuda_types::cublas::cuDoubleComplex, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZsyr2k_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: i64, k: i64, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: i64, B: *const cuda_types::cublas::cuDoubleComplex, ldb: i64, beta: *const cuda_types::cublas::cuDoubleComplex, C: *mut cuda_types::cublas::cuDoubleComplex, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCher2k_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, B: *const cuda_types::cublas::cuComplex, ldb: ::core::ffi::c_int, beta: *const f32, C: *mut cuda_types::cublas::cuComplex, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCher2k_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: i64, k: i64, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: i64, B: *const cuda_types::cublas::cuComplex, ldb: i64, beta: *const f32, C: *mut cuda_types::cublas::cuComplex, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZher2k_v2( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, B: *const cuda_types::cublas::cuDoubleComplex, ldb: ::core::ffi::c_int, beta: *const f64, C: *mut cuda_types::cublas::cuDoubleComplex, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZher2k_v2_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: i64, k: i64, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: i64, B: *const cuda_types::cublas::cuDoubleComplex, ldb: i64, beta: *const f64, C: *mut cuda_types::cublas::cuDoubleComplex, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSsyrkx( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const f32, A: *const f32, lda: ::core::ffi::c_int, B: *const f32, ldb: ::core::ffi::c_int, beta: *const f32, C: *mut f32, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSsyrkx_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: i64, k: i64, alpha: *const f32, A: *const f32, lda: i64, B: *const f32, ldb: i64, beta: *const f32, C: *mut f32, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDsyrkx( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const f64, A: *const f64, lda: ::core::ffi::c_int, B: *const f64, ldb: ::core::ffi::c_int, beta: *const f64, C: *mut f64, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDsyrkx_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: i64, k: i64, alpha: *const f64, A: *const f64, lda: i64, B: *const f64, ldb: i64, beta: *const f64, C: *mut f64, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCsyrkx( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, B: *const cuda_types::cublas::cuComplex, ldb: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuComplex, C: *mut cuda_types::cublas::cuComplex, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCsyrkx_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: i64, k: i64, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: i64, B: *const cuda_types::cublas::cuComplex, ldb: i64, beta: *const cuda_types::cublas::cuComplex, C: *mut cuda_types::cublas::cuComplex, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZsyrkx( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, B: *const cuda_types::cublas::cuDoubleComplex, ldb: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuDoubleComplex, C: *mut cuda_types::cublas::cuDoubleComplex, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZsyrkx_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: i64, k: i64, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: i64, B: *const cuda_types::cublas::cuDoubleComplex, ldb: i64, beta: *const cuda_types::cublas::cuDoubleComplex, C: *mut cuda_types::cublas::cuDoubleComplex, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCherkx( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, B: *const cuda_types::cublas::cuComplex, ldb: ::core::ffi::c_int, beta: *const f32, C: *mut cuda_types::cublas::cuComplex, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCherkx_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: i64, k: i64, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: i64, B: *const cuda_types::cublas::cuComplex, ldb: i64, beta: *const f32, C: *mut cuda_types::cublas::cuComplex, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZherkx( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, B: *const cuda_types::cublas::cuDoubleComplex, ldb: ::core::ffi::c_int, beta: *const f64, C: *mut cuda_types::cublas::cuDoubleComplex, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZherkx_64( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, n: i64, k: i64, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: i64, B: *const cuda_types::cublas::cuDoubleComplex, ldb: i64, beta: *const f64, C: *mut cuda_types::cublas::cuDoubleComplex, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSsymm_v2( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const f32, A: *const f32, lda: ::core::ffi::c_int, B: *const f32, ldb: ::core::ffi::c_int, beta: *const f32, C: *mut f32, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSsymm_v2_64( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, m: i64, n: i64, alpha: *const f32, A: *const f32, lda: i64, B: *const f32, ldb: i64, beta: *const f32, C: *mut f32, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDsymm_v2( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const f64, A: *const f64, lda: ::core::ffi::c_int, B: *const f64, ldb: ::core::ffi::c_int, beta: *const f64, C: *mut f64, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDsymm_v2_64( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, m: i64, n: i64, alpha: *const f64, A: *const f64, lda: i64, B: *const f64, ldb: i64, beta: *const f64, C: *mut f64, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCsymm_v2( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, B: *const cuda_types::cublas::cuComplex, ldb: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuComplex, C: *mut cuda_types::cublas::cuComplex, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCsymm_v2_64( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, m: i64, n: i64, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: i64, B: *const cuda_types::cublas::cuComplex, ldb: i64, beta: *const cuda_types::cublas::cuComplex, C: *mut cuda_types::cublas::cuComplex, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZsymm_v2( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, B: *const cuda_types::cublas::cuDoubleComplex, ldb: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuDoubleComplex, C: *mut cuda_types::cublas::cuDoubleComplex, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZsymm_v2_64( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, m: i64, n: i64, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: i64, B: *const cuda_types::cublas::cuDoubleComplex, ldb: i64, beta: *const cuda_types::cublas::cuDoubleComplex, C: *mut cuda_types::cublas::cuDoubleComplex, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasChemm_v2( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, B: *const cuda_types::cublas::cuComplex, ldb: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuComplex, C: *mut cuda_types::cublas::cuComplex, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasChemm_v2_64( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, m: i64, n: i64, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: i64, B: *const cuda_types::cublas::cuComplex, ldb: i64, beta: *const cuda_types::cublas::cuComplex, C: *mut cuda_types::cublas::cuComplex, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZhemm_v2( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, B: *const cuda_types::cublas::cuDoubleComplex, ldb: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuDoubleComplex, C: *mut cuda_types::cublas::cuDoubleComplex, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZhemm_v2_64( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, m: i64, n: i64, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: i64, B: *const cuda_types::cublas::cuDoubleComplex, ldb: i64, beta: *const cuda_types::cublas::cuDoubleComplex, C: *mut cuda_types::cublas::cuDoubleComplex, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasStrsm_v2( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const f32, A: *const f32, lda: ::core::ffi::c_int, B: *mut f32, ldb: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasStrsm_v2_64( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, m: i64, n: i64, alpha: *const f32, A: *const f32, lda: i64, B: *mut f32, ldb: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDtrsm_v2( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const f64, A: *const f64, lda: ::core::ffi::c_int, B: *mut f64, ldb: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDtrsm_v2_64( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, m: i64, n: i64, alpha: *const f64, A: *const f64, lda: i64, B: *mut f64, ldb: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCtrsm_v2( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, B: *mut cuda_types::cublas::cuComplex, ldb: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCtrsm_v2_64( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, m: i64, n: i64, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: i64, B: *mut cuda_types::cublas::cuComplex, ldb: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZtrsm_v2( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, B: *mut cuda_types::cublas::cuDoubleComplex, ldb: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZtrsm_v2_64( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, m: i64, n: i64, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: i64, B: *mut cuda_types::cublas::cuDoubleComplex, ldb: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasStrmm_v2( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const f32, A: *const f32, lda: ::core::ffi::c_int, B: *const f32, ldb: ::core::ffi::c_int, C: *mut f32, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasStrmm_v2_64( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, m: i64, n: i64, alpha: *const f32, A: *const f32, lda: i64, B: *const f32, ldb: i64, C: *mut f32, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDtrmm_v2( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const f64, A: *const f64, lda: ::core::ffi::c_int, B: *const f64, ldb: ::core::ffi::c_int, C: *mut f64, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDtrmm_v2_64( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, m: i64, n: i64, alpha: *const f64, A: *const f64, lda: i64, B: *const f64, ldb: i64, C: *mut f64, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCtrmm_v2( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, B: *const cuda_types::cublas::cuComplex, ldb: ::core::ffi::c_int, C: *mut cuda_types::cublas::cuComplex, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCtrmm_v2_64( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, m: i64, n: i64, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: i64, B: *const cuda_types::cublas::cuComplex, ldb: i64, C: *mut cuda_types::cublas::cuComplex, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZtrmm_v2( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, B: *const cuda_types::cublas::cuDoubleComplex, ldb: ::core::ffi::c_int, C: *mut cuda_types::cublas::cuDoubleComplex, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZtrmm_v2_64( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, m: i64, n: i64, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: i64, B: *const cuda_types::cublas::cuDoubleComplex, ldb: i64, C: *mut cuda_types::cublas::cuDoubleComplex, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasHgemmBatched( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const cuda_types::cublas::__half, Aarray: *const *const cuda_types::cublas::__half, lda: ::core::ffi::c_int, Barray: *const *const cuda_types::cublas::__half, ldb: ::core::ffi::c_int, beta: *const cuda_types::cublas::__half, Carray: *const *mut cuda_types::cublas::__half, ldc: ::core::ffi::c_int, batchCount: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasHgemmBatched_64( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, k: i64, alpha: *const cuda_types::cublas::__half, Aarray: *const *const cuda_types::cublas::__half, lda: i64, Barray: *const *const cuda_types::cublas::__half, ldb: i64, beta: *const cuda_types::cublas::__half, Carray: *const *mut cuda_types::cublas::__half, ldc: i64, batchCount: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSgemmBatched( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const f32, Aarray: *const *const f32, lda: ::core::ffi::c_int, Barray: *const *const f32, ldb: ::core::ffi::c_int, beta: *const f32, Carray: *const *mut f32, ldc: ::core::ffi::c_int, batchCount: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSgemmBatched_64( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, k: i64, alpha: *const f32, Aarray: *const *const f32, lda: i64, Barray: *const *const f32, ldb: i64, beta: *const f32, Carray: *const *mut f32, ldc: i64, batchCount: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDgemmBatched( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const f64, Aarray: *const *const f64, lda: ::core::ffi::c_int, Barray: *const *const f64, ldb: ::core::ffi::c_int, beta: *const f64, Carray: *const *mut f64, ldc: ::core::ffi::c_int, batchCount: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDgemmBatched_64( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, k: i64, alpha: *const f64, Aarray: *const *const f64, lda: i64, Barray: *const *const f64, ldb: i64, beta: *const f64, Carray: *const *mut f64, ldc: i64, batchCount: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCgemmBatched( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, Aarray: *const *const cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, Barray: *const *const cuda_types::cublas::cuComplex, ldb: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuComplex, Carray: *const *mut cuda_types::cublas::cuComplex, ldc: ::core::ffi::c_int, batchCount: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCgemmBatched_64( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, k: i64, alpha: *const cuda_types::cublas::cuComplex, Aarray: *const *const cuda_types::cublas::cuComplex, lda: i64, Barray: *const *const cuda_types::cublas::cuComplex, ldb: i64, beta: *const cuda_types::cublas::cuComplex, Carray: *const *mut cuda_types::cublas::cuComplex, ldc: i64, batchCount: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCgemm3mBatched( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, Aarray: *const *const cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, Barray: *const *const cuda_types::cublas::cuComplex, ldb: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuComplex, Carray: *const *mut cuda_types::cublas::cuComplex, ldc: ::core::ffi::c_int, batchCount: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCgemm3mBatched_64( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, k: i64, alpha: *const cuda_types::cublas::cuComplex, Aarray: *const *const cuda_types::cublas::cuComplex, lda: i64, Barray: *const *const cuda_types::cublas::cuComplex, ldb: i64, beta: *const cuda_types::cublas::cuComplex, Carray: *const *mut cuda_types::cublas::cuComplex, ldc: i64, batchCount: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZgemmBatched( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuDoubleComplex, Aarray: *const *const cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, Barray: *const *const cuda_types::cublas::cuDoubleComplex, ldb: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuDoubleComplex, Carray: *const *mut cuda_types::cublas::cuDoubleComplex, ldc: ::core::ffi::c_int, batchCount: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZgemmBatched_64( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, k: i64, alpha: *const cuda_types::cublas::cuDoubleComplex, Aarray: *const *const cuda_types::cublas::cuDoubleComplex, lda: i64, Barray: *const *const cuda_types::cublas::cuDoubleComplex, ldb: i64, beta: *const cuda_types::cublas::cuDoubleComplex, Carray: *const *mut cuda_types::cublas::cuDoubleComplex, ldc: i64, batchCount: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasHgemmStridedBatched( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const cuda_types::cublas::__half, A: *const cuda_types::cublas::__half, lda: ::core::ffi::c_int, strideA: ::core::ffi::c_longlong, B: *const cuda_types::cublas::__half, ldb: ::core::ffi::c_int, strideB: ::core::ffi::c_longlong, beta: *const cuda_types::cublas::__half, C: *mut cuda_types::cublas::__half, ldc: ::core::ffi::c_int, strideC: ::core::ffi::c_longlong, batchCount: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasHgemmStridedBatched_64( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, k: i64, alpha: *const cuda_types::cublas::__half, A: *const cuda_types::cublas::__half, lda: i64, strideA: ::core::ffi::c_longlong, B: *const cuda_types::cublas::__half, ldb: i64, strideB: ::core::ffi::c_longlong, beta: *const cuda_types::cublas::__half, C: *mut cuda_types::cublas::__half, ldc: i64, strideC: ::core::ffi::c_longlong, batchCount: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSgemmStridedBatched( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const f32, A: *const f32, lda: ::core::ffi::c_int, strideA: ::core::ffi::c_longlong, B: *const f32, ldb: ::core::ffi::c_int, strideB: ::core::ffi::c_longlong, beta: *const f32, C: *mut f32, ldc: ::core::ffi::c_int, strideC: ::core::ffi::c_longlong, batchCount: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSgemmStridedBatched_64( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, k: i64, alpha: *const f32, A: *const f32, lda: i64, strideA: ::core::ffi::c_longlong, B: *const f32, ldb: i64, strideB: ::core::ffi::c_longlong, beta: *const f32, C: *mut f32, ldc: i64, strideC: ::core::ffi::c_longlong, batchCount: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDgemmStridedBatched( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const f64, A: *const f64, lda: ::core::ffi::c_int, strideA: ::core::ffi::c_longlong, B: *const f64, ldb: ::core::ffi::c_int, strideB: ::core::ffi::c_longlong, beta: *const f64, C: *mut f64, ldc: ::core::ffi::c_int, strideC: ::core::ffi::c_longlong, batchCount: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDgemmStridedBatched_64( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, k: i64, alpha: *const f64, A: *const f64, lda: i64, strideA: ::core::ffi::c_longlong, B: *const f64, ldb: i64, strideB: ::core::ffi::c_longlong, beta: *const f64, C: *mut f64, ldc: i64, strideC: ::core::ffi::c_longlong, batchCount: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCgemmStridedBatched( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, strideA: ::core::ffi::c_longlong, B: *const cuda_types::cublas::cuComplex, ldb: ::core::ffi::c_int, strideB: ::core::ffi::c_longlong, beta: *const cuda_types::cublas::cuComplex, C: *mut cuda_types::cublas::cuComplex, ldc: ::core::ffi::c_int, strideC: ::core::ffi::c_longlong, batchCount: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCgemmStridedBatched_64( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, k: i64, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: i64, strideA: ::core::ffi::c_longlong, B: *const cuda_types::cublas::cuComplex, ldb: i64, strideB: ::core::ffi::c_longlong, beta: *const cuda_types::cublas::cuComplex, C: *mut cuda_types::cublas::cuComplex, ldc: i64, strideC: ::core::ffi::c_longlong, batchCount: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCgemm3mStridedBatched( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, strideA: ::core::ffi::c_longlong, B: *const cuda_types::cublas::cuComplex, ldb: ::core::ffi::c_int, strideB: ::core::ffi::c_longlong, beta: *const cuda_types::cublas::cuComplex, C: *mut cuda_types::cublas::cuComplex, ldc: ::core::ffi::c_int, strideC: ::core::ffi::c_longlong, batchCount: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCgemm3mStridedBatched_64( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, k: i64, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: i64, strideA: ::core::ffi::c_longlong, B: *const cuda_types::cublas::cuComplex, ldb: i64, strideB: ::core::ffi::c_longlong, beta: *const cuda_types::cublas::cuComplex, C: *mut cuda_types::cublas::cuComplex, ldc: i64, strideC: ::core::ffi::c_longlong, batchCount: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZgemmStridedBatched( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, strideA: ::core::ffi::c_longlong, B: *const cuda_types::cublas::cuDoubleComplex, ldb: ::core::ffi::c_int, strideB: ::core::ffi::c_longlong, beta: *const cuda_types::cublas::cuDoubleComplex, C: *mut cuda_types::cublas::cuDoubleComplex, ldc: ::core::ffi::c_int, strideC: ::core::ffi::c_longlong, batchCount: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZgemmStridedBatched_64( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, k: i64, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: i64, strideA: ::core::ffi::c_longlong, B: *const cuda_types::cublas::cuDoubleComplex, ldb: i64, strideB: ::core::ffi::c_longlong, beta: *const cuda_types::cublas::cuDoubleComplex, C: *mut cuda_types::cublas::cuDoubleComplex, ldc: i64, strideC: ::core::ffi::c_longlong, batchCount: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasGemmBatchedEx( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const ::core::ffi::c_void, Aarray: *const *const ::core::ffi::c_void, Atype: cuda_types::cublas::cudaDataType, lda: ::core::ffi::c_int, Barray: *const *const ::core::ffi::c_void, Btype: cuda_types::cublas::cudaDataType, ldb: ::core::ffi::c_int, beta: *const ::core::ffi::c_void, Carray: *const *mut ::core::ffi::c_void, Ctype: cuda_types::cublas::cudaDataType, ldc: ::core::ffi::c_int, batchCount: ::core::ffi::c_int, computeType: cuda_types::cublas::cublasComputeType_t, algo: cuda_types::cublas::cublasGemmAlgo_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasGemmBatchedEx_64( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, k: i64, alpha: *const ::core::ffi::c_void, Aarray: *const *const ::core::ffi::c_void, Atype: cuda_types::cublas::cudaDataType, lda: i64, Barray: *const *const ::core::ffi::c_void, Btype: cuda_types::cublas::cudaDataType, ldb: i64, beta: *const ::core::ffi::c_void, Carray: *const *mut ::core::ffi::c_void, Ctype: cuda_types::cublas::cudaDataType, ldc: i64, batchCount: i64, computeType: cuda_types::cublas::cublasComputeType_t, algo: cuda_types::cublas::cublasGemmAlgo_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasGemmStridedBatchedEx( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, k: ::core::ffi::c_int, alpha: *const ::core::ffi::c_void, A: *const ::core::ffi::c_void, Atype: cuda_types::cublas::cudaDataType, lda: ::core::ffi::c_int, strideA: ::core::ffi::c_longlong, B: *const ::core::ffi::c_void, Btype: cuda_types::cublas::cudaDataType, ldb: ::core::ffi::c_int, strideB: ::core::ffi::c_longlong, beta: *const ::core::ffi::c_void, C: *mut ::core::ffi::c_void, Ctype: cuda_types::cublas::cudaDataType, ldc: ::core::ffi::c_int, strideC: ::core::ffi::c_longlong, batchCount: ::core::ffi::c_int, computeType: cuda_types::cublas::cublasComputeType_t, algo: cuda_types::cublas::cublasGemmAlgo_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasGemmStridedBatchedEx_64( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, k: i64, alpha: *const ::core::ffi::c_void, A: *const ::core::ffi::c_void, Atype: cuda_types::cublas::cudaDataType, lda: i64, strideA: ::core::ffi::c_longlong, B: *const ::core::ffi::c_void, Btype: cuda_types::cublas::cudaDataType, ldb: i64, strideB: ::core::ffi::c_longlong, beta: *const ::core::ffi::c_void, C: *mut ::core::ffi::c_void, Ctype: cuda_types::cublas::cudaDataType, ldc: i64, strideC: ::core::ffi::c_longlong, batchCount: i64, computeType: cuda_types::cublas::cublasComputeType_t, algo: cuda_types::cublas::cublasGemmAlgo_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSgemmGroupedBatched( handle: cuda_types::cublas::cublasHandle_t, transa_array: *const cuda_types::cublas::cublasOperation_t, transb_array: *const cuda_types::cublas::cublasOperation_t, m_array: *const ::core::ffi::c_int, n_array: *const ::core::ffi::c_int, k_array: *const ::core::ffi::c_int, alpha_array: *const f32, Aarray: *const *const f32, lda_array: *const ::core::ffi::c_int, Barray: *const *const f32, ldb_array: *const ::core::ffi::c_int, beta_array: *const f32, Carray: *const *mut f32, ldc_array: *const ::core::ffi::c_int, group_count: ::core::ffi::c_int, group_size: *const ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSgemmGroupedBatched_64( handle: cuda_types::cublas::cublasHandle_t, transa_array: *const cuda_types::cublas::cublasOperation_t, transb_array: *const cuda_types::cublas::cublasOperation_t, m_array: *const i64, n_array: *const i64, k_array: *const i64, alpha_array: *const f32, Aarray: *const *const f32, lda_array: *const i64, Barray: *const *const f32, ldb_array: *const i64, beta_array: *const f32, Carray: *const *mut f32, ldc_array: *const i64, group_count: i64, group_size: *const i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDgemmGroupedBatched( handle: cuda_types::cublas::cublasHandle_t, transa_array: *const cuda_types::cublas::cublasOperation_t, transb_array: *const cuda_types::cublas::cublasOperation_t, m_array: *const ::core::ffi::c_int, n_array: *const ::core::ffi::c_int, k_array: *const ::core::ffi::c_int, alpha_array: *const f64, Aarray: *const *const f64, lda_array: *const ::core::ffi::c_int, Barray: *const *const f64, ldb_array: *const ::core::ffi::c_int, beta_array: *const f64, Carray: *const *mut f64, ldc_array: *const ::core::ffi::c_int, group_count: ::core::ffi::c_int, group_size: *const ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDgemmGroupedBatched_64( handle: cuda_types::cublas::cublasHandle_t, transa_array: *const cuda_types::cublas::cublasOperation_t, transb_array: *const cuda_types::cublas::cublasOperation_t, m_array: *const i64, n_array: *const i64, k_array: *const i64, alpha_array: *const f64, Aarray: *const *const f64, lda_array: *const i64, Barray: *const *const f64, ldb_array: *const i64, beta_array: *const f64, Carray: *const *mut f64, ldc_array: *const i64, group_count: i64, group_size: *const i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasGemmGroupedBatchedEx( handle: cuda_types::cublas::cublasHandle_t, transa_array: *const cuda_types::cublas::cublasOperation_t, transb_array: *const cuda_types::cublas::cublasOperation_t, m_array: *const ::core::ffi::c_int, n_array: *const ::core::ffi::c_int, k_array: *const ::core::ffi::c_int, alpha_array: *const ::core::ffi::c_void, Aarray: *const *const ::core::ffi::c_void, Atype: cuda_types::cublas::cudaDataType_t, lda_array: *const ::core::ffi::c_int, Barray: *const *const ::core::ffi::c_void, Btype: cuda_types::cublas::cudaDataType_t, ldb_array: *const ::core::ffi::c_int, beta_array: *const ::core::ffi::c_void, Carray: *const *mut ::core::ffi::c_void, Ctype: cuda_types::cublas::cudaDataType_t, ldc_array: *const ::core::ffi::c_int, group_count: ::core::ffi::c_int, group_size: *const ::core::ffi::c_int, computeType: cuda_types::cublas::cublasComputeType_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasGemmGroupedBatchedEx_64( handle: cuda_types::cublas::cublasHandle_t, transa_array: *const cuda_types::cublas::cublasOperation_t, transb_array: *const cuda_types::cublas::cublasOperation_t, m_array: *const i64, n_array: *const i64, k_array: *const i64, alpha_array: *const ::core::ffi::c_void, Aarray: *const *const ::core::ffi::c_void, Atype: cuda_types::cublas::cudaDataType_t, lda_array: *const i64, Barray: *const *const ::core::ffi::c_void, Btype: cuda_types::cublas::cudaDataType_t, ldb_array: *const i64, beta_array: *const ::core::ffi::c_void, Carray: *const *mut ::core::ffi::c_void, Ctype: cuda_types::cublas::cudaDataType_t, ldc_array: *const i64, group_count: i64, group_size: *const i64, computeType: cuda_types::cublas::cublasComputeType_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSgeam( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const f32, A: *const f32, lda: ::core::ffi::c_int, beta: *const f32, B: *const f32, ldb: ::core::ffi::c_int, C: *mut f32, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSgeam_64( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, alpha: *const f32, A: *const f32, lda: i64, beta: *const f32, B: *const f32, ldb: i64, C: *mut f32, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDgeam( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const f64, A: *const f64, lda: ::core::ffi::c_int, beta: *const f64, B: *const f64, ldb: ::core::ffi::c_int, C: *mut f64, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDgeam_64( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, alpha: *const f64, A: *const f64, lda: i64, beta: *const f64, B: *const f64, ldb: i64, C: *mut f64, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCgeam( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuComplex, B: *const cuda_types::cublas::cuComplex, ldb: ::core::ffi::c_int, C: *mut cuda_types::cublas::cuComplex, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCgeam_64( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, alpha: *const cuda_types::cublas::cuComplex, A: *const cuda_types::cublas::cuComplex, lda: i64, beta: *const cuda_types::cublas::cuComplex, B: *const cuda_types::cublas::cuComplex, ldb: i64, C: *mut cuda_types::cublas::cuComplex, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZgeam( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, beta: *const cuda_types::cublas::cuDoubleComplex, B: *const cuda_types::cublas::cuDoubleComplex, ldb: ::core::ffi::c_int, C: *mut cuda_types::cublas::cuDoubleComplex, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZgeam_64( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, m: i64, n: i64, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const cuda_types::cublas::cuDoubleComplex, lda: i64, beta: *const cuda_types::cublas::cuDoubleComplex, B: *const cuda_types::cublas::cuDoubleComplex, ldb: i64, C: *mut cuda_types::cublas::cuDoubleComplex, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasStrsmBatched( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const f32, A: *const *const f32, lda: ::core::ffi::c_int, B: *const *mut f32, ldb: ::core::ffi::c_int, batchCount: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasStrsmBatched_64( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, m: i64, n: i64, alpha: *const f32, A: *const *const f32, lda: i64, B: *const *mut f32, ldb: i64, batchCount: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDtrsmBatched( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const f64, A: *const *const f64, lda: ::core::ffi::c_int, B: *const *mut f64, ldb: ::core::ffi::c_int, batchCount: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDtrsmBatched_64( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, m: i64, n: i64, alpha: *const f64, A: *const *const f64, lda: i64, B: *const *mut f64, ldb: i64, batchCount: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCtrsmBatched( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuComplex, A: *const *const cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, B: *const *mut cuda_types::cublas::cuComplex, ldb: ::core::ffi::c_int, batchCount: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCtrsmBatched_64( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, m: i64, n: i64, alpha: *const cuda_types::cublas::cuComplex, A: *const *const cuda_types::cublas::cuComplex, lda: i64, B: *const *mut cuda_types::cublas::cuComplex, ldb: i64, batchCount: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZtrsmBatched( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const *const cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, B: *const *mut cuda_types::cublas::cuDoubleComplex, ldb: ::core::ffi::c_int, batchCount: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZtrsmBatched_64( handle: cuda_types::cublas::cublasHandle_t, side: cuda_types::cublas::cublasSideMode_t, uplo: cuda_types::cublas::cublasFillMode_t, trans: cuda_types::cublas::cublasOperation_t, diag: cuda_types::cublas::cublasDiagType_t, m: i64, n: i64, alpha: *const cuda_types::cublas::cuDoubleComplex, A: *const *const cuda_types::cublas::cuDoubleComplex, lda: i64, B: *const *mut cuda_types::cublas::cuDoubleComplex, ldb: i64, batchCount: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSdgmm( handle: cuda_types::cublas::cublasHandle_t, mode: cuda_types::cublas::cublasSideMode_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, A: *const f32, lda: ::core::ffi::c_int, x: *const f32, incx: ::core::ffi::c_int, C: *mut f32, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSdgmm_64( handle: cuda_types::cublas::cublasHandle_t, mode: cuda_types::cublas::cublasSideMode_t, m: i64, n: i64, A: *const f32, lda: i64, x: *const f32, incx: i64, C: *mut f32, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDdgmm( handle: cuda_types::cublas::cublasHandle_t, mode: cuda_types::cublas::cublasSideMode_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, A: *const f64, lda: ::core::ffi::c_int, x: *const f64, incx: ::core::ffi::c_int, C: *mut f64, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDdgmm_64( handle: cuda_types::cublas::cublasHandle_t, mode: cuda_types::cublas::cublasSideMode_t, m: i64, n: i64, A: *const f64, lda: i64, x: *const f64, incx: i64, C: *mut f64, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCdgmm( handle: cuda_types::cublas::cublasHandle_t, mode: cuda_types::cublas::cublasSideMode_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, A: *const cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, x: *const cuda_types::cublas::cuComplex, incx: ::core::ffi::c_int, C: *mut cuda_types::cublas::cuComplex, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCdgmm_64( handle: cuda_types::cublas::cublasHandle_t, mode: cuda_types::cublas::cublasSideMode_t, m: i64, n: i64, A: *const cuda_types::cublas::cuComplex, lda: i64, x: *const cuda_types::cublas::cuComplex, incx: i64, C: *mut cuda_types::cublas::cuComplex, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZdgmm( handle: cuda_types::cublas::cublasHandle_t, mode: cuda_types::cublas::cublasSideMode_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, A: *const cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, x: *const cuda_types::cublas::cuDoubleComplex, incx: ::core::ffi::c_int, C: *mut cuda_types::cublas::cuDoubleComplex, ldc: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZdgmm_64( handle: cuda_types::cublas::cublasHandle_t, mode: cuda_types::cublas::cublasSideMode_t, m: i64, n: i64, A: *const cuda_types::cublas::cuDoubleComplex, lda: i64, x: *const cuda_types::cublas::cuDoubleComplex, incx: i64, C: *mut cuda_types::cublas::cuDoubleComplex, ldc: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSmatinvBatched( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, A: *const *const f32, lda: ::core::ffi::c_int, Ainv: *const *mut f32, lda_inv: ::core::ffi::c_int, info: *mut ::core::ffi::c_int, batchSize: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDmatinvBatched( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, A: *const *const f64, lda: ::core::ffi::c_int, Ainv: *const *mut f64, lda_inv: ::core::ffi::c_int, info: *mut ::core::ffi::c_int, batchSize: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCmatinvBatched( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, A: *const *const cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, Ainv: *const *mut cuda_types::cublas::cuComplex, lda_inv: ::core::ffi::c_int, info: *mut ::core::ffi::c_int, batchSize: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZmatinvBatched( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, A: *const *const cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, Ainv: *const *mut cuda_types::cublas::cuDoubleComplex, lda_inv: ::core::ffi::c_int, info: *mut ::core::ffi::c_int, batchSize: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSgeqrfBatched( handle: cuda_types::cublas::cublasHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, Aarray: *const *mut f32, lda: ::core::ffi::c_int, TauArray: *const *mut f32, info: *mut ::core::ffi::c_int, batchSize: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDgeqrfBatched( handle: cuda_types::cublas::cublasHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, Aarray: *const *mut f64, lda: ::core::ffi::c_int, TauArray: *const *mut f64, info: *mut ::core::ffi::c_int, batchSize: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCgeqrfBatched( handle: cuda_types::cublas::cublasHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, Aarray: *const *mut cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, TauArray: *const *mut cuda_types::cublas::cuComplex, info: *mut ::core::ffi::c_int, batchSize: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZgeqrfBatched( handle: cuda_types::cublas::cublasHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, Aarray: *const *mut cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, TauArray: *const *mut cuda_types::cublas::cuDoubleComplex, info: *mut ::core::ffi::c_int, batchSize: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSgelsBatched( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nrhs: ::core::ffi::c_int, Aarray: *const *mut f32, lda: ::core::ffi::c_int, Carray: *const *mut f32, ldc: ::core::ffi::c_int, info: *mut ::core::ffi::c_int, devInfoArray: *mut ::core::ffi::c_int, batchSize: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDgelsBatched( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nrhs: ::core::ffi::c_int, Aarray: *const *mut f64, lda: ::core::ffi::c_int, Carray: *const *mut f64, ldc: ::core::ffi::c_int, info: *mut ::core::ffi::c_int, devInfoArray: *mut ::core::ffi::c_int, batchSize: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCgelsBatched( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nrhs: ::core::ffi::c_int, Aarray: *const *mut cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, Carray: *const *mut cuda_types::cublas::cuComplex, ldc: ::core::ffi::c_int, info: *mut ::core::ffi::c_int, devInfoArray: *mut ::core::ffi::c_int, batchSize: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZgelsBatched( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nrhs: ::core::ffi::c_int, Aarray: *const *mut cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, Carray: *const *mut cuda_types::cublas::cuDoubleComplex, ldc: ::core::ffi::c_int, info: *mut ::core::ffi::c_int, devInfoArray: *mut ::core::ffi::c_int, batchSize: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasStpttr( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, AP: *const f32, A: *mut f32, lda: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDtpttr( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, AP: *const f64, A: *mut f64, lda: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCtpttr( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, AP: *const cuda_types::cublas::cuComplex, A: *mut cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZtpttr( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, AP: *const cuda_types::cublas::cuDoubleComplex, A: *mut cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasStrttp( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, A: *const f32, lda: ::core::ffi::c_int, AP: *mut f32, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDtrttp( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, A: *const f64, lda: ::core::ffi::c_int, AP: *mut f64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCtrttp( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, A: *const cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, AP: *mut cuda_types::cublas::cuComplex, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZtrttp( handle: cuda_types::cublas::cublasHandle_t, uplo: cuda_types::cublas::cublasFillMode_t, n: ::core::ffi::c_int, A: *const cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, AP: *mut cuda_types::cublas::cuDoubleComplex, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSgetrfBatched( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, A: *const *mut f32, lda: ::core::ffi::c_int, P: *mut ::core::ffi::c_int, info: *mut ::core::ffi::c_int, batchSize: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDgetrfBatched( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, A: *const *mut f64, lda: ::core::ffi::c_int, P: *mut ::core::ffi::c_int, info: *mut ::core::ffi::c_int, batchSize: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCgetrfBatched( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, A: *const *mut cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, P: *mut ::core::ffi::c_int, info: *mut ::core::ffi::c_int, batchSize: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZgetrfBatched( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, A: *const *mut cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, P: *mut ::core::ffi::c_int, info: *mut ::core::ffi::c_int, batchSize: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSgetriBatched( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, A: *const *const f32, lda: ::core::ffi::c_int, P: *const ::core::ffi::c_int, C: *const *mut f32, ldc: ::core::ffi::c_int, info: *mut ::core::ffi::c_int, batchSize: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDgetriBatched( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, A: *const *const f64, lda: ::core::ffi::c_int, P: *const ::core::ffi::c_int, C: *const *mut f64, ldc: ::core::ffi::c_int, info: *mut ::core::ffi::c_int, batchSize: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCgetriBatched( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, A: *const *const cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, P: *const ::core::ffi::c_int, C: *const *mut cuda_types::cublas::cuComplex, ldc: ::core::ffi::c_int, info: *mut ::core::ffi::c_int, batchSize: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZgetriBatched( handle: cuda_types::cublas::cublasHandle_t, n: ::core::ffi::c_int, A: *const *const cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, P: *const ::core::ffi::c_int, C: *const *mut cuda_types::cublas::cuDoubleComplex, ldc: ::core::ffi::c_int, info: *mut ::core::ffi::c_int, batchSize: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSgetrsBatched( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, n: ::core::ffi::c_int, nrhs: ::core::ffi::c_int, Aarray: *const *const f32, lda: ::core::ffi::c_int, devIpiv: *const ::core::ffi::c_int, Barray: *const *mut f32, ldb: ::core::ffi::c_int, info: *mut ::core::ffi::c_int, batchSize: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasDgetrsBatched( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, n: ::core::ffi::c_int, nrhs: ::core::ffi::c_int, Aarray: *const *const f64, lda: ::core::ffi::c_int, devIpiv: *const ::core::ffi::c_int, Barray: *const *mut f64, ldb: ::core::ffi::c_int, info: *mut ::core::ffi::c_int, batchSize: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasCgetrsBatched( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, n: ::core::ffi::c_int, nrhs: ::core::ffi::c_int, Aarray: *const *const cuda_types::cublas::cuComplex, lda: ::core::ffi::c_int, devIpiv: *const ::core::ffi::c_int, Barray: *const *mut cuda_types::cublas::cuComplex, ldb: ::core::ffi::c_int, info: *mut ::core::ffi::c_int, batchSize: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasZgetrsBatched( handle: cuda_types::cublas::cublasHandle_t, trans: cuda_types::cublas::cublasOperation_t, n: ::core::ffi::c_int, nrhs: ::core::ffi::c_int, Aarray: *const *const cuda_types::cublas::cuDoubleComplex, lda: ::core::ffi::c_int, devIpiv: *const ::core::ffi::c_int, Barray: *const *mut cuda_types::cublas::cuDoubleComplex, ldb: ::core::ffi::c_int, info: *mut ::core::ffi::c_int, batchSize: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasUint8gemmBias( handle: cuda_types::cublas::cublasHandle_t, transa: cuda_types::cublas::cublasOperation_t, transb: cuda_types::cublas::cublasOperation_t, transc: cuda_types::cublas::cublasOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, k: ::core::ffi::c_int, A: *const ::core::ffi::c_uchar, A_bias: ::core::ffi::c_int, lda: ::core::ffi::c_int, B: *const ::core::ffi::c_uchar, B_bias: ::core::ffi::c_int, ldb: ::core::ffi::c_int, C: *mut ::core::ffi::c_uchar, C_bias: ::core::ffi::c_int, ldc: ::core::ffi::c_int, C_mult: ::core::ffi::c_int, C_shift: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasSetEnvironmentMode( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, ) -> cuda_types::cublas::cublasStatus_t; } ================================================ FILE: cuda_macros/src/cublaslt.rs ================================================ // Generated automatically by zluda_bindgen // DO NOT EDIT MANUALLY #![allow(warnings)] extern "system" { #[must_use] fn cublasLtCreate( lightHandle: *mut cuda_types::cublaslt::cublasLtHandle_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasLtDestroy( lightHandle: cuda_types::cublaslt::cublasLtHandle_t, ) -> cuda_types::cublas::cublasStatus_t; fn cublasLtGetStatusName( status: cuda_types::cublas::cublasStatus_t, ) -> *const ::core::ffi::c_char; fn cublasLtGetStatusString( status: cuda_types::cublas::cublasStatus_t, ) -> *const ::core::ffi::c_char; fn cublasLtGetVersion() -> usize; fn cublasLtGetCudartVersion() -> usize; #[must_use] fn cublasLtGetProperty( type_: cuda_types::cublaslt::libraryPropertyType, value: *mut ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasLtHeuristicsCacheGetCapacity( capacity: *mut usize, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] fn cublasLtHeuristicsCacheSetCapacity( capacity: usize, ) -> cuda_types::cublas::cublasStatus_t; /** Restricts usage of CPU instructions (ISA) specified by the flags in the mask. Flags can be combined with bitwise OR(|) operator. Supported flags: - 0x1 -- x86-64 AVX512 ISA Default mask: 0 (any applicable ISA is allowed). The function returns the previous value of the mask. The function takes precedence over the environment variable CUBLASLT_DISABLE_CPU_INSTRUCTIONS_MASK.*/ fn cublasLtDisableCpuInstructionsSetMask( mask: ::core::ffi::c_uint, ) -> ::core::ffi::c_uint; #[must_use] /** Execute matrix multiplication (D = alpha * op(A) * op(B) + beta * C). \retval CUBLAS_STATUS_NOT_INITIALIZED if cuBLASLt handle has not been initialized \retval CUBLAS_STATUS_INVALID_VALUE if parameters are in conflict or in an impossible configuration; e.g. when workspaceSizeInBytes is less than workspace required by configured algo \retval CUBLAS_STATUS_NOT_SUPPORTED if current implementation on selected device doesn't support configured operation \retval CUBLAS_STATUS_ARCH_MISMATCH if configured operation cannot be run using selected device \retval CUBLAS_STATUS_EXECUTION_FAILED if cuda reported execution error from the device \retval CUBLAS_STATUS_SUCCESS if the operation completed successfully*/ fn cublasLtMatmul( lightHandle: cuda_types::cublaslt::cublasLtHandle_t, computeDesc: cuda_types::cublaslt::cublasLtMatmulDesc_t, alpha: *const ::core::ffi::c_void, A: *const ::core::ffi::c_void, Adesc: cuda_types::cublaslt::cublasLtMatrixLayout_t, B: *const ::core::ffi::c_void, Bdesc: cuda_types::cublaslt::cublasLtMatrixLayout_t, beta: *const ::core::ffi::c_void, C: *const ::core::ffi::c_void, Cdesc: cuda_types::cublaslt::cublasLtMatrixLayout_t, D: *mut ::core::ffi::c_void, Ddesc: cuda_types::cublaslt::cublasLtMatrixLayout_t, algo: *const cuda_types::cublaslt::cublasLtMatmulAlgo_t, workspace: *mut ::core::ffi::c_void, workspaceSizeInBytes: usize, stream: cuda_types::cublaslt::cudaStream_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] /** Matrix layout conversion helper (C = alpha * op(A) + beta * op(B)) Can be used to change memory order of data or to scale and shift the values. \retval CUBLAS_STATUS_NOT_INITIALIZED if cuBLASLt handle has not been initialized \retval CUBLAS_STATUS_INVALID_VALUE if parameters are in conflict or in an impossible configuration; e.g. when A is not NULL, but Adesc is NULL \retval CUBLAS_STATUS_NOT_SUPPORTED if current implementation on selected device doesn't support configured operation \retval CUBLAS_STATUS_ARCH_MISMATCH if configured operation cannot be run using selected device \retval CUBLAS_STATUS_EXECUTION_FAILED if cuda reported execution error from the device \retval CUBLAS_STATUS_SUCCESS if the operation completed successfully*/ fn cublasLtMatrixTransform( lightHandle: cuda_types::cublaslt::cublasLtHandle_t, transformDesc: cuda_types::cublaslt::cublasLtMatrixTransformDesc_t, alpha: *const ::core::ffi::c_void, A: *const ::core::ffi::c_void, Adesc: cuda_types::cublaslt::cublasLtMatrixLayout_t, beta: *const ::core::ffi::c_void, B: *const ::core::ffi::c_void, Bdesc: cuda_types::cublaslt::cublasLtMatrixLayout_t, C: *mut ::core::ffi::c_void, Cdesc: cuda_types::cublaslt::cublasLtMatrixLayout_t, stream: cuda_types::cublaslt::cudaStream_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] /// Internal. Do not use directly. fn cublasLtMatrixLayoutInit_internal( matLayout: cuda_types::cublaslt::cublasLtMatrixLayout_t, size: usize, type_: cuda_types::cublaslt::cudaDataType, rows: u64, cols: u64, ld: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] /** Create new matrix layout descriptor. \retval CUBLAS_STATUS_ALLOC_FAILED if memory could not be allocated \retval CUBLAS_STATUS_SUCCESS if desciptor was created successfully*/ fn cublasLtMatrixLayoutCreate( matLayout: *mut cuda_types::cublaslt::cublasLtMatrixLayout_t, type_: cuda_types::cublaslt::cudaDataType, rows: u64, cols: u64, ld: i64, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] /** Destroy matrix layout descriptor. \retval CUBLAS_STATUS_SUCCESS if operation was successful*/ fn cublasLtMatrixLayoutDestroy( matLayout: cuda_types::cublaslt::cublasLtMatrixLayout_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] /** Set matrix layout descriptor attribute. \param[in] matLayout The descriptor \param[in] attr The attribute \param[in] buf memory address containing the new value \param[in] sizeInBytes size of buf buffer for verification (in bytes) \retval CUBLAS_STATUS_INVALID_VALUE if buf is NULL or sizeInBytes doesn't match size of internal storage for selected attribute \retval CUBLAS_STATUS_SUCCESS if attribute was set successfully*/ fn cublasLtMatrixLayoutSetAttribute( matLayout: cuda_types::cublaslt::cublasLtMatrixLayout_t, attr: cuda_types::cublaslt::cublasLtMatrixLayoutAttribute_t, buf: *const ::core::ffi::c_void, sizeInBytes: usize, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] /** Get matrix layout descriptor attribute. \param[in] matLayout The descriptor \param[in] attr The attribute \param[out] buf memory address containing the new value \param[in] sizeInBytes size of buf buffer for verification (in bytes) \param[out] sizeWritten only valid when return value is CUBLAS_STATUS_SUCCESS. If sizeInBytes is non-zero: number of bytes actually written, if sizeInBytes is 0: number of bytes needed to write full contents \retval CUBLAS_STATUS_INVALID_VALUE if sizeInBytes is 0 and sizeWritten is NULL, or if sizeInBytes is non-zero and buf is NULL or sizeInBytes doesn't match size of internal storage for selected attribute \retval CUBLAS_STATUS_SUCCESS if attribute's value was successfully written to user memory*/ fn cublasLtMatrixLayoutGetAttribute( matLayout: cuda_types::cublaslt::cublasLtMatrixLayout_t, attr: cuda_types::cublaslt::cublasLtMatrixLayoutAttribute_t, buf: *mut ::core::ffi::c_void, sizeInBytes: usize, sizeWritten: *mut usize, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] /// Internal. Do not use directly. fn cublasLtMatmulDescInit_internal( matmulDesc: cuda_types::cublaslt::cublasLtMatmulDesc_t, size: usize, computeType: cuda_types::cublas::cublasComputeType_t, scaleType: cuda_types::cublaslt::cudaDataType_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] /** Create new matmul operation descriptor. \retval CUBLAS_STATUS_ALLOC_FAILED if memory could not be allocated \retval CUBLAS_STATUS_SUCCESS if desciptor was created successfully*/ fn cublasLtMatmulDescCreate( matmulDesc: *mut cuda_types::cublaslt::cublasLtMatmulDesc_t, computeType: cuda_types::cublas::cublasComputeType_t, scaleType: cuda_types::cublaslt::cudaDataType_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] /** Destroy matmul operation descriptor. \retval CUBLAS_STATUS_SUCCESS if operation was successful*/ fn cublasLtMatmulDescDestroy( matmulDesc: cuda_types::cublaslt::cublasLtMatmulDesc_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] /** Set matmul operation descriptor attribute. \param[in] matmulDesc The descriptor \param[in] attr The attribute \param[in] buf memory address containing the new value \param[in] sizeInBytes size of buf buffer for verification (in bytes) \retval CUBLAS_STATUS_INVALID_VALUE if buf is NULL or sizeInBytes doesn't match size of internal storage for selected attribute \retval CUBLAS_STATUS_SUCCESS if attribute was set successfully*/ fn cublasLtMatmulDescSetAttribute( matmulDesc: cuda_types::cublaslt::cublasLtMatmulDesc_t, attr: cuda_types::cublaslt::cublasLtMatmulDescAttributes_t, buf: *const ::core::ffi::c_void, sizeInBytes: usize, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] /** Get matmul operation descriptor attribute. \param[in] matmulDesc The descriptor \param[in] attr The attribute \param[out] buf memory address containing the new value \param[in] sizeInBytes size of buf buffer for verification (in bytes) \param[out] sizeWritten only valid when return value is CUBLAS_STATUS_SUCCESS. If sizeInBytes is non-zero: number of bytes actually written, if sizeInBytes is 0: number of bytes needed to write full contents \retval CUBLAS_STATUS_INVALID_VALUE if sizeInBytes is 0 and sizeWritten is NULL, or if sizeInBytes is non-zero and buf is NULL or sizeInBytes doesn't match size of internal storage for selected attribute \retval CUBLAS_STATUS_SUCCESS if attribute's value was successfully written to user memory*/ fn cublasLtMatmulDescGetAttribute( matmulDesc: cuda_types::cublaslt::cublasLtMatmulDesc_t, attr: cuda_types::cublaslt::cublasLtMatmulDescAttributes_t, buf: *mut ::core::ffi::c_void, sizeInBytes: usize, sizeWritten: *mut usize, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] /// Internal. Do not use directly. fn cublasLtMatrixTransformDescInit_internal( transformDesc: cuda_types::cublaslt::cublasLtMatrixTransformDesc_t, size: usize, scaleType: cuda_types::cublaslt::cudaDataType, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] /** Create new matrix transform operation descriptor. \retval CUBLAS_STATUS_ALLOC_FAILED if memory could not be allocated \retval CUBLAS_STATUS_SUCCESS if desciptor was created successfully*/ fn cublasLtMatrixTransformDescCreate( transformDesc: *mut cuda_types::cublaslt::cublasLtMatrixTransformDesc_t, scaleType: cuda_types::cublaslt::cudaDataType, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] /** Destroy matrix transform operation descriptor. \retval CUBLAS_STATUS_SUCCESS if operation was successful*/ fn cublasLtMatrixTransformDescDestroy( transformDesc: cuda_types::cublaslt::cublasLtMatrixTransformDesc_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] /** Set matrix transform operation descriptor attribute. \param[in] transformDesc The descriptor \param[in] attr The attribute \param[in] buf memory address containing the new value \param[in] sizeInBytes size of buf buffer for verification (in bytes) \retval CUBLAS_STATUS_INVALID_VALUE if buf is NULL or sizeInBytes doesn't match size of internal storage for selected attribute \retval CUBLAS_STATUS_SUCCESS if attribute was set successfully*/ fn cublasLtMatrixTransformDescSetAttribute( transformDesc: cuda_types::cublaslt::cublasLtMatrixTransformDesc_t, attr: cuda_types::cublaslt::cublasLtMatrixTransformDescAttributes_t, buf: *const ::core::ffi::c_void, sizeInBytes: usize, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] /** Get matrix transform operation descriptor attribute. \param[in] transformDesc The descriptor \param[in] attr The attribute \param[out] buf memory address containing the new value \param[in] sizeInBytes size of buf buffer for verification (in bytes) \param[out] sizeWritten only valid when return value is CUBLAS_STATUS_SUCCESS. If sizeInBytes is non-zero: number of bytes actually written, if sizeInBytes is 0: number of bytes needed to write full contents \retval CUBLAS_STATUS_INVALID_VALUE if sizeInBytes is 0 and sizeWritten is NULL, or if sizeInBytes is non-zero and buf is NULL or sizeInBytes doesn't match size of internal storage for selected attribute \retval CUBLAS_STATUS_SUCCESS if attribute's value was successfully written to user memory*/ fn cublasLtMatrixTransformDescGetAttribute( transformDesc: cuda_types::cublaslt::cublasLtMatrixTransformDesc_t, attr: cuda_types::cublaslt::cublasLtMatrixTransformDescAttributes_t, buf: *mut ::core::ffi::c_void, sizeInBytes: usize, sizeWritten: *mut usize, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] /// Internal. Do not use directly. fn cublasLtMatmulPreferenceInit_internal( pref: cuda_types::cublaslt::cublasLtMatmulPreference_t, size: usize, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] /** Create new matmul heuristic search preference descriptor. \retval CUBLAS_STATUS_ALLOC_FAILED if memory could not be allocated \retval CUBLAS_STATUS_SUCCESS if desciptor was created successfully*/ fn cublasLtMatmulPreferenceCreate( pref: *mut cuda_types::cublaslt::cublasLtMatmulPreference_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] /** Destroy matmul heuristic search preference descriptor. \retval CUBLAS_STATUS_SUCCESS if operation was successful*/ fn cublasLtMatmulPreferenceDestroy( pref: cuda_types::cublaslt::cublasLtMatmulPreference_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] /** Set matmul heuristic search preference descriptor attribute. \param[in] pref The descriptor \param[in] attr The attribute \param[in] buf memory address containing the new value \param[in] sizeInBytes size of buf buffer for verification (in bytes) \retval CUBLAS_STATUS_INVALID_VALUE if buf is NULL or sizeInBytes doesn't match size of internal storage for selected attribute \retval CUBLAS_STATUS_SUCCESS if attribute was set successfully*/ fn cublasLtMatmulPreferenceSetAttribute( pref: cuda_types::cublaslt::cublasLtMatmulPreference_t, attr: cuda_types::cublaslt::cublasLtMatmulPreferenceAttributes_t, buf: *const ::core::ffi::c_void, sizeInBytes: usize, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] /** Get matmul heuristic search preference descriptor attribute. \param[in] pref The descriptor \param[in] attr The attribute \param[out] buf memory address containing the new value \param[in] sizeInBytes size of buf buffer for verification (in bytes) \param[out] sizeWritten only valid when return value is CUBLAS_STATUS_SUCCESS. If sizeInBytes is non-zero: number of bytes actually written, if sizeInBytes is 0: number of bytes needed to write full contents \retval CUBLAS_STATUS_INVALID_VALUE if sizeInBytes is 0 and sizeWritten is NULL, or if sizeInBytes is non-zero and buf is NULL or sizeInBytes doesn't match size of internal storage for selected attribute \retval CUBLAS_STATUS_SUCCESS if attribute's value was successfully written to user memory*/ fn cublasLtMatmulPreferenceGetAttribute( pref: cuda_types::cublaslt::cublasLtMatmulPreference_t, attr: cuda_types::cublaslt::cublasLtMatmulPreferenceAttributes_t, buf: *mut ::core::ffi::c_void, sizeInBytes: usize, sizeWritten: *mut usize, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] /** Query cublasLt heuristic for algorithm appropriate for given use case. \param[in] lightHandle Pointer to the allocated cuBLASLt handle for the cuBLASLt context. See cublasLtHandle_t. \param[in] operationDesc Handle to the matrix multiplication descriptor. \param[in] Adesc Handle to the layout descriptors for matrix A. \param[in] Bdesc Handle to the layout descriptors for matrix B. \param[in] Cdesc Handle to the layout descriptors for matrix C. \param[in] Ddesc Handle to the layout descriptors for matrix D. \param[in] preference Pointer to the structure holding the heuristic search preferences descriptor. See cublasLtMatrixLayout_t. \param[in] requestedAlgoCount Size of heuristicResultsArray (in elements) and requested maximum number of algorithms to return. \param[in, out] heuristicResultsArray Output algorithms and associated runtime characteristics, ordered in increasing estimated compute time. \param[out] returnAlgoCount The number of heuristicResultsArray elements written. \retval CUBLAS_STATUS_INVALID_VALUE if requestedAlgoCount is less or equal to zero \retval CUBLAS_STATUS_NOT_SUPPORTED if no heuristic function available for current configuration \retval CUBLAS_STATUS_SUCCESS if query was successful, inspect heuristicResultsArray[0 to (returnAlgoCount - 1)].state for detail status of results*/ fn cublasLtMatmulAlgoGetHeuristic( lightHandle: cuda_types::cublaslt::cublasLtHandle_t, operationDesc: cuda_types::cublaslt::cublasLtMatmulDesc_t, Adesc: cuda_types::cublaslt::cublasLtMatrixLayout_t, Bdesc: cuda_types::cublaslt::cublasLtMatrixLayout_t, Cdesc: cuda_types::cublaslt::cublasLtMatrixLayout_t, Ddesc: cuda_types::cublaslt::cublasLtMatrixLayout_t, preference: cuda_types::cublaslt::cublasLtMatmulPreference_t, requestedAlgoCount: ::core::ffi::c_int, heuristicResultsArray: *mut cuda_types::cublaslt::cublasLtMatmulHeuristicResult_t, returnAlgoCount: *mut ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] /** Routine to get all algo IDs that can potentially run \param[in] int requestedAlgoCount requested number of algos (must be less or equal to size of algoIdsA (in elements)) \param[out] algoIdsA array to write algoIds to \param[out] returnAlgoCount number of algoIds actually written \retval CUBLAS_STATUS_INVALID_VALUE if requestedAlgoCount is less or equal to zero \retval CUBLAS_STATUS_SUCCESS if query was successful, inspect returnAlgoCount to get actual number of IDs available*/ fn cublasLtMatmulAlgoGetIds( lightHandle: cuda_types::cublaslt::cublasLtHandle_t, computeType: cuda_types::cublas::cublasComputeType_t, scaleType: cuda_types::cublaslt::cudaDataType_t, Atype: cuda_types::cublaslt::cudaDataType_t, Btype: cuda_types::cublaslt::cudaDataType_t, Ctype: cuda_types::cublaslt::cudaDataType_t, Dtype: cuda_types::cublaslt::cudaDataType_t, requestedAlgoCount: ::core::ffi::c_int, algoIdsArray: *mut ::core::ffi::c_int, returnAlgoCount: *mut ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] /** Initialize algo structure \retval CUBLAS_STATUS_INVALID_VALUE if algo is NULL or algoId is outside of recognized range \retval CUBLAS_STATUS_NOT_SUPPORTED if algoId is not supported for given combination of data types \retval CUBLAS_STATUS_SUCCESS if the structure was successfully initialized*/ fn cublasLtMatmulAlgoInit( lightHandle: cuda_types::cublaslt::cublasLtHandle_t, computeType: cuda_types::cublas::cublasComputeType_t, scaleType: cuda_types::cublaslt::cudaDataType_t, Atype: cuda_types::cublaslt::cudaDataType_t, Btype: cuda_types::cublaslt::cudaDataType_t, Ctype: cuda_types::cublaslt::cudaDataType_t, Dtype: cuda_types::cublaslt::cudaDataType_t, algoId: ::core::ffi::c_int, algo: *mut cuda_types::cublaslt::cublasLtMatmulAlgo_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] /** Check configured algo descriptor for correctness and support on current device. Result includes required workspace size and calculated wave count. CUBLAS_STATUS_SUCCESS doesn't fully guarantee algo will run (will fail if e.g. buffers are not correctly aligned); but if cublasLtMatmulAlgoCheck fails, the algo will not run. \param[in] algo algo configuration to check \param[out] result result structure to report algo runtime characteristics; algo field is never updated \retval CUBLAS_STATUS_INVALID_VALUE if matrix layout descriptors or operation descriptor don't match algo descriptor \retval CUBLAS_STATUS_NOT_SUPPORTED if algo configuration or data type combination is not currently supported on given device \retval CUBLAS_STATUS_ARCH_MISMATCH if algo configuration cannot be run using the selected device \retval CUBLAS_STATUS_SUCCESS if check was successful*/ fn cublasLtMatmulAlgoCheck( lightHandle: cuda_types::cublaslt::cublasLtHandle_t, operationDesc: cuda_types::cublaslt::cublasLtMatmulDesc_t, Adesc: cuda_types::cublaslt::cublasLtMatrixLayout_t, Bdesc: cuda_types::cublaslt::cublasLtMatrixLayout_t, Cdesc: cuda_types::cublaslt::cublasLtMatrixLayout_t, Ddesc: cuda_types::cublaslt::cublasLtMatrixLayout_t, algo: *const cuda_types::cublaslt::cublasLtMatmulAlgo_t, result: *mut cuda_types::cublaslt::cublasLtMatmulHeuristicResult_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] /** Get algo capability attribute. E.g. to get list of supported Tile IDs: cublasLtMatmulTile_t tiles[CUBLASLT_MATMUL_TILE_END]; size_t num_tiles, size_written; if (cublasLtMatmulAlgoCapGetAttribute(algo, CUBLASLT_ALGO_CAP_TILE_IDS, tiles, sizeof(tiles), size_written) == CUBLAS_STATUS_SUCCESS) { num_tiles = size_written / sizeof(tiles[0]); } \param[in] algo The algo descriptor \param[in] attr The attribute \param[out] buf memory address containing the new value \param[in] sizeInBytes size of buf buffer for verification (in bytes) \param[out] sizeWritten only valid when return value is CUBLAS_STATUS_SUCCESS. If sizeInBytes is non-zero: number of bytes actually written, if sizeInBytes is 0: number of bytes needed to write full contents \retval CUBLAS_STATUS_INVALID_VALUE if sizeInBytes is 0 and sizeWritten is NULL, or if sizeInBytes is non-zero and buf is NULL or sizeInBytes doesn't match size of internal storage for selected attribute \retval CUBLAS_STATUS_SUCCESS if attribute's value was successfully written to user memory*/ fn cublasLtMatmulAlgoCapGetAttribute( algo: *const cuda_types::cublaslt::cublasLtMatmulAlgo_t, attr: cuda_types::cublaslt::cublasLtMatmulAlgoCapAttributes_t, buf: *mut ::core::ffi::c_void, sizeInBytes: usize, sizeWritten: *mut usize, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] /** Set algo configuration attribute. \param[in] algo The algo descriptor \param[in] attr The attribute \param[in] buf memory address containing the new value \param[in] sizeInBytes size of buf buffer for verification (in bytes) \retval CUBLAS_STATUS_INVALID_VALUE if buf is NULL or sizeInBytes doesn't match size of internal storage for selected attribute \retval CUBLAS_STATUS_SUCCESS if attribute was set successfully*/ fn cublasLtMatmulAlgoConfigSetAttribute( algo: *mut cuda_types::cublaslt::cublasLtMatmulAlgo_t, attr: cuda_types::cublaslt::cublasLtMatmulAlgoConfigAttributes_t, buf: *const ::core::ffi::c_void, sizeInBytes: usize, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] /** Get algo configuration attribute. \param[in] algo The algo descriptor \param[in] attr The attribute \param[out] buf memory address containing the new value \param[in] sizeInBytes size of buf buffer for verification (in bytes) \param[out] sizeWritten only valid when return value is CUBLAS_STATUS_SUCCESS. If sizeInBytes is non-zero: number of bytes actually written, if sizeInBytes is 0: number of bytes needed to write full contents \retval CUBLAS_STATUS_INVALID_VALUE if sizeInBytes is 0 and sizeWritten is NULL, or if sizeInBytes is non-zero and buf is NULL or sizeInBytes doesn't match size of internal storage for selected attribute \retval CUBLAS_STATUS_SUCCESS if attribute's value was successfully written to user memory*/ fn cublasLtMatmulAlgoConfigGetAttribute( algo: *const cuda_types::cublaslt::cublasLtMatmulAlgo_t, attr: cuda_types::cublaslt::cublasLtMatmulAlgoConfigAttributes_t, buf: *mut ::core::ffi::c_void, sizeInBytes: usize, sizeWritten: *mut usize, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] /** Experimental: Logger callback setter. \param[in] callback a user defined callback function to be called by the logger \retval CUBLAS_STATUS_SUCCESS if callback was set successfully*/ fn cublasLtLoggerSetCallback( callback: cuda_types::cublaslt::cublasLtLoggerCallback_t, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] /** Experimental: Log file setter. \param[in] file an open file with write permissions \retval CUBLAS_STATUS_SUCCESS if log file was set successfully*/ fn cublasLtLoggerSetFile( file: *mut cuda_types::FILE, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] /** Experimental: Open log file. \param[in] logFile log file path. if the log file does not exist, it will be created \retval CUBLAS_STATUS_SUCCESS if log file was created successfully*/ fn cublasLtLoggerOpenFile( logFile: *const ::core::ffi::c_char, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] /** Experimental: Log level setter. \param[in] level log level, should be one of the following: 0. Off 1. Errors 2. Performance Trace 3. Performance Hints 4. Heuristics Trace 5. API Trace \retval CUBLAS_STATUS_INVALID_VALUE if log level is not one of the above levels \retval CUBLAS_STATUS_SUCCESS if log level was set successfully*/ fn cublasLtLoggerSetLevel( level: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] /** Experimental: Log mask setter. \param[in] mask log mask, should be a combination of the following masks: 0. Off 1. Errors 2. Performance Trace 4. Performance Hints 8. Heuristics Trace 16. API Trace \retval CUBLAS_STATUS_SUCCESS if log mask was set successfully*/ fn cublasLtLoggerSetMask( mask: ::core::ffi::c_int, ) -> cuda_types::cublas::cublasStatus_t; #[must_use] /** Experimental: Disable logging for the entire session. \retval CUBLAS_STATUS_SUCCESS if disabled logging*/ fn cublasLtLoggerForceDisable() -> cuda_types::cublas::cublasStatus_t; } ================================================ FILE: cuda_macros/src/cublaslt_internal.rs ================================================ /* automatically generated by rust-bindgen 0.70.1 */ extern "system" { fn cublasLtShutdownCtx(param_1: ::core::ffi::c_ulonglong) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtSetEnvironmentMode( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtGetEnvironmentMode( param_1: ::core::ffi::c_ulonglong, param_2: *mut ::core::ffi::c_uint, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtCtxInit(param_1: ::core::ffi::c_ulonglong) -> ::core::ffi::c_int; } extern "system" { fn cublasLtHeuristicsCacheDestroy( param_1: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtHeuristicLutSerializeEntry( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, param_11: ::core::ffi::c_ulonglong, param_12: *mut ::core::ffi::c_ulonglong, param_13: *mut ::core::ffi::c_ulonglong, param_14: ::core::ffi::c_ulonglong, param_15: *mut ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtHeuristicsCachePut( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, param_11: ::core::ffi::c_ulonglong, param_12: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtHeuristicsCacheGet( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, param_11: ::core::ffi::c_ulonglong, param_12: ::core::ffi::c_ulonglong, param_13: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtHeuristicsCacheCreate( param_1: *mut ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtLegacyGemmACC( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: *mut ::core::ffi::c_int, param_4: ::core::ffi::c_uint, param_5: ::core::ffi::c_uint, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_uint, param_10: ::core::ffi::c_ulonglong, param_11: ::core::ffi::c_ulonglong, param_12: ::core::ffi::c_ulonglong, param_13: ::core::ffi::c_uint, param_14: ::core::ffi::c_uint, param_15: ::core::ffi::c_ulonglong, param_16: ::core::ffi::c_uint, param_17: ::core::ffi::c_uint, param_18: ::core::ffi::c_ulonglong, param_19: ::core::ffi::c_uint, param_20: ::core::ffi::c_uint, param_21: ::core::ffi::c_uint, param_22: ::core::ffi::c_uint, param_23: ::core::ffi::c_uint, param_24: ::core::ffi::c_uchar, param_25: ::core::ffi::c_ulonglong, param_26: ::core::ffi::c_ulonglong, param_27: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtLegacyGemmBII( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: *mut ::core::ffi::c_int, param_4: ::core::ffi::c_uint, param_5: ::core::ffi::c_uint, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_uint, param_10: ::core::ffi::c_ulonglong, param_11: ::core::ffi::c_ulonglong, param_12: ::core::ffi::c_ulonglong, param_13: ::core::ffi::c_uint, param_14: ::core::ffi::c_uint, param_15: ::core::ffi::c_ulonglong, param_16: ::core::ffi::c_uint, param_17: ::core::ffi::c_uint, param_18: ::core::ffi::c_ulonglong, param_19: ::core::ffi::c_uint, param_20: ::core::ffi::c_uint, param_21: ::core::ffi::c_uint, param_22: ::core::ffi::c_uint, param_23: ::core::ffi::c_uint, param_24: ::core::ffi::c_uchar, param_25: ::core::ffi::c_ulonglong, param_26: ::core::ffi::c_ulonglong, param_27: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtLegacyGemmBSS( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: *mut ::core::ffi::c_int, param_4: ::core::ffi::c_uint, param_5: ::core::ffi::c_uint, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_uint, param_10: ::core::ffi::c_ulonglong, param_11: ::core::ffi::c_ulonglong, param_12: ::core::ffi::c_ulonglong, param_13: ::core::ffi::c_uint, param_14: ::core::ffi::c_uint, param_15: ::core::ffi::c_ulonglong, param_16: ::core::ffi::c_uint, param_17: ::core::ffi::c_uint, param_18: ::core::ffi::c_ulonglong, param_19: ::core::ffi::c_uint, param_20: ::core::ffi::c_uint, param_21: ::core::ffi::c_uint, param_22: ::core::ffi::c_uint, param_23: ::core::ffi::c_uint, param_24: ::core::ffi::c_uchar, param_25: ::core::ffi::c_ulonglong, param_26: ::core::ffi::c_ulonglong, param_27: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtLegacyGemmCCC( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: *mut ::core::ffi::c_int, param_4: ::core::ffi::c_uint, param_5: ::core::ffi::c_uint, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_uint, param_10: ::core::ffi::c_ulonglong, param_11: ::core::ffi::c_ulonglong, param_12: ::core::ffi::c_ulonglong, param_13: ::core::ffi::c_uint, param_14: ::core::ffi::c_uint, param_15: ::core::ffi::c_ulonglong, param_16: ::core::ffi::c_uint, param_17: ::core::ffi::c_uint, param_18: ::core::ffi::c_ulonglong, param_19: ::core::ffi::c_uint, param_20: ::core::ffi::c_uint, param_21: ::core::ffi::c_uint, param_22: ::core::ffi::c_uint, param_23: ::core::ffi::c_uint, param_24: ::core::ffi::c_uchar, param_25: ::core::ffi::c_ulonglong, param_26: ::core::ffi::c_ulonglong, param_27: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtLegacyGemmDDD( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: *mut ::core::ffi::c_int, param_4: ::core::ffi::c_uint, param_5: ::core::ffi::c_uint, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_uint, param_10: ::core::ffi::c_ulonglong, param_11: ::core::ffi::c_ulonglong, param_12: ::core::ffi::c_ulonglong, param_13: ::core::ffi::c_uint, param_14: ::core::ffi::c_uint, param_15: ::core::ffi::c_ulonglong, param_16: ::core::ffi::c_uint, param_17: ::core::ffi::c_uint, param_18: ::core::ffi::c_ulonglong, param_19: ::core::ffi::c_uint, param_20: ::core::ffi::c_uint, param_21: ::core::ffi::c_uint, param_22: ::core::ffi::c_uint, param_23: ::core::ffi::c_uint, param_24: ::core::ffi::c_uchar, param_25: ::core::ffi::c_ulonglong, param_26: ::core::ffi::c_ulonglong, param_27: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtLegacyGemmHHH( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: *mut ::core::ffi::c_int, param_4: ::core::ffi::c_uint, param_5: ::core::ffi::c_uint, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_uint, param_10: ::core::ffi::c_ulonglong, param_11: ::core::ffi::c_ulonglong, param_12: ::core::ffi::c_ulonglong, param_13: ::core::ffi::c_uint, param_14: ::core::ffi::c_uint, param_15: ::core::ffi::c_ulonglong, param_16: ::core::ffi::c_uint, param_17: ::core::ffi::c_uint, param_18: ::core::ffi::c_ulonglong, param_19: ::core::ffi::c_uint, param_20: ::core::ffi::c_uint, param_21: ::core::ffi::c_uint, param_22: ::core::ffi::c_uint, param_23: ::core::ffi::c_uint, param_24: ::core::ffi::c_uchar, param_25: ::core::ffi::c_ulonglong, param_26: ::core::ffi::c_ulonglong, param_27: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtLegacyGemmHSS( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: *mut ::core::ffi::c_int, param_4: ::core::ffi::c_uint, param_5: ::core::ffi::c_uint, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_uint, param_10: ::core::ffi::c_ulonglong, param_11: ::core::ffi::c_ulonglong, param_12: ::core::ffi::c_ulonglong, param_13: ::core::ffi::c_uint, param_14: ::core::ffi::c_uint, param_15: ::core::ffi::c_ulonglong, param_16: ::core::ffi::c_uint, param_17: ::core::ffi::c_uint, param_18: ::core::ffi::c_ulonglong, param_19: ::core::ffi::c_uint, param_20: ::core::ffi::c_uint, param_21: ::core::ffi::c_uint, param_22: ::core::ffi::c_uint, param_23: ::core::ffi::c_uint, param_24: ::core::ffi::c_uchar, param_25: ::core::ffi::c_ulonglong, param_26: ::core::ffi::c_ulonglong, param_27: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtLegacyGemmHSH( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: *mut ::core::ffi::c_int, param_4: ::core::ffi::c_uint, param_5: ::core::ffi::c_uint, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_uint, param_10: ::core::ffi::c_ulonglong, param_11: ::core::ffi::c_ulonglong, param_12: ::core::ffi::c_ulonglong, param_13: ::core::ffi::c_uint, param_14: ::core::ffi::c_uint, param_15: ::core::ffi::c_ulonglong, param_16: ::core::ffi::c_uint, param_17: ::core::ffi::c_uint, param_18: ::core::ffi::c_ulonglong, param_19: ::core::ffi::c_uint, param_20: ::core::ffi::c_uint, param_21: ::core::ffi::c_uint, param_22: ::core::ffi::c_uint, param_23: ::core::ffi::c_uint, param_24: ::core::ffi::c_uchar, param_25: ::core::ffi::c_ulonglong, param_26: ::core::ffi::c_ulonglong, param_27: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtLegacyGemmSSS( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: *mut ::core::ffi::c_int, param_4: ::core::ffi::c_uint, param_5: ::core::ffi::c_uint, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_uint, param_10: ::core::ffi::c_ulonglong, param_11: ::core::ffi::c_ulonglong, param_12: ::core::ffi::c_ulonglong, param_13: ::core::ffi::c_uint, param_14: ::core::ffi::c_uint, param_15: ::core::ffi::c_ulonglong, param_16: ::core::ffi::c_uint, param_17: ::core::ffi::c_uint, param_18: ::core::ffi::c_ulonglong, param_19: ::core::ffi::c_uint, param_20: ::core::ffi::c_uint, param_21: ::core::ffi::c_uint, param_22: ::core::ffi::c_uint, param_23: ::core::ffi::c_uint, param_24: ::core::ffi::c_uchar, param_25: ::core::ffi::c_ulonglong, param_26: ::core::ffi::c_ulonglong, param_27: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtLegacyGemmTSS( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: *mut ::core::ffi::c_int, param_4: ::core::ffi::c_uint, param_5: ::core::ffi::c_uint, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_uint, param_10: ::core::ffi::c_ulonglong, param_11: ::core::ffi::c_ulonglong, param_12: ::core::ffi::c_ulonglong, param_13: ::core::ffi::c_uint, param_14: ::core::ffi::c_uint, param_15: ::core::ffi::c_ulonglong, param_16: ::core::ffi::c_uint, param_17: ::core::ffi::c_uint, param_18: ::core::ffi::c_ulonglong, param_19: ::core::ffi::c_uint, param_20: ::core::ffi::c_uint, param_21: ::core::ffi::c_uint, param_22: ::core::ffi::c_uint, param_23: ::core::ffi::c_uint, param_24: ::core::ffi::c_uchar, param_25: ::core::ffi::c_ulonglong, param_26: ::core::ffi::c_ulonglong, param_27: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtLegacyGemmTST( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: *mut ::core::ffi::c_int, param_4: ::core::ffi::c_uint, param_5: ::core::ffi::c_uint, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_uint, param_10: ::core::ffi::c_ulonglong, param_11: ::core::ffi::c_ulonglong, param_12: ::core::ffi::c_ulonglong, param_13: ::core::ffi::c_uint, param_14: ::core::ffi::c_uint, param_15: ::core::ffi::c_ulonglong, param_16: ::core::ffi::c_uint, param_17: ::core::ffi::c_uint, param_18: ::core::ffi::c_ulonglong, param_19: ::core::ffi::c_uint, param_20: ::core::ffi::c_uint, param_21: ::core::ffi::c_uint, param_22: ::core::ffi::c_uint, param_23: ::core::ffi::c_uint, param_24: ::core::ffi::c_uchar, param_25: ::core::ffi::c_ulonglong, param_26: ::core::ffi::c_ulonglong, param_27: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtLegacyGemmZZZ( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: *mut ::core::ffi::c_int, param_4: ::core::ffi::c_uint, param_5: ::core::ffi::c_uint, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_uint, param_10: ::core::ffi::c_ulonglong, param_11: ::core::ffi::c_ulonglong, param_12: ::core::ffi::c_ulonglong, param_13: ::core::ffi::c_uint, param_14: ::core::ffi::c_uint, param_15: ::core::ffi::c_ulonglong, param_16: ::core::ffi::c_uint, param_17: ::core::ffi::c_uint, param_18: ::core::ffi::c_ulonglong, param_19: ::core::ffi::c_uint, param_20: ::core::ffi::c_uint, param_21: ::core::ffi::c_uint, param_22: ::core::ffi::c_uint, param_23: ::core::ffi::c_uint, param_24: ::core::ffi::c_uchar, param_25: ::core::ffi::c_ulonglong, param_26: ::core::ffi::c_ulonglong, param_27: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtClearNvjetCache(param_1: ::core::ffi::c_ulonglong) -> (); } extern "system" { fn cublasLtAlgoCharacteristicGetAttribute( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_int, param_4: ::core::ffi::c_int, param_5: ::core::ffi::c_int, param_6: *mut ::core::ffi::c_char, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtMatmulAlgoConfigGetAttributeRange() -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtHHHMatmulAlgoGetIds( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_uint, param_4: ::core::ffi::c_int, param_5: ::core::ffi::c_int, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_int, param_9: ::core::ffi::c_ulonglong, param_10: *mut ::core::ffi::c_int, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtHHHMatmulAlgoInit( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_uint, param_4: ::core::ffi::c_uint, param_5: ::core::ffi::c_uint, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtHHHMatmulAlgoCapGetAttribute( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtHHHMatmul( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, param_11: ::core::ffi::c_ulonglong, param_12: ::core::ffi::c_ulonglong, param_13: ::core::ffi::c_ulonglong, param_14: ::core::ffi::c_ulonglong, param_15: ::core::ffi::c_ulonglong, param_16: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtHHHMatmulAlgoCheck( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtHHHMatmulAlgoGetHeuristic( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: *mut ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtHSHMatmulAlgoGetIds( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_uint, param_4: ::core::ffi::c_int, param_5: ::core::ffi::c_int, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_int, param_9: ::core::ffi::c_ulonglong, param_10: *mut ::core::ffi::c_int, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtHSHMatmulAlgoInit( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_uint, param_4: ::core::ffi::c_uint, param_5: ::core::ffi::c_uint, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtHSHMatmulAlgoCapGetAttribute( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtHSHMatmul( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, param_11: ::core::ffi::c_ulonglong, param_12: ::core::ffi::c_ulonglong, param_13: ::core::ffi::c_ulonglong, param_14: ::core::ffi::c_ulonglong, param_15: ::core::ffi::c_ulonglong, param_16: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtHSHMatmulAlgoCheck( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtHSHMatmulAlgoGetHeuristic( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: *mut ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtSSSMatmulAlgoGetIds( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_uint, param_4: ::core::ffi::c_int, param_5: ::core::ffi::c_int, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_int, param_9: ::core::ffi::c_ulonglong, param_10: *mut ::core::ffi::c_int, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtSSSMatmulAlgoInit( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_uint, param_4: ::core::ffi::c_uint, param_5: ::core::ffi::c_uint, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtSSSMatmulAlgoCapGetAttribute( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtSSSMatmul( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, param_11: ::core::ffi::c_ulonglong, param_12: ::core::ffi::c_ulonglong, param_13: ::core::ffi::c_ulonglong, param_14: ::core::ffi::c_ulonglong, param_15: ::core::ffi::c_ulonglong, param_16: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtSSSMatmulAlgoCheck( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtSSSMatmulAlgoGetHeuristic( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: *mut ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtDDDMatmulAlgoGetIds( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_uint, param_4: ::core::ffi::c_int, param_5: ::core::ffi::c_int, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_int, param_9: ::core::ffi::c_ulonglong, param_10: *mut ::core::ffi::c_int, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtDDDMatmulAlgoInit( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_uint, param_4: ::core::ffi::c_uint, param_5: ::core::ffi::c_uint, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtDDDMatmulAlgoCapGetAttribute( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtDDDMatmul( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, param_11: ::core::ffi::c_ulonglong, param_12: ::core::ffi::c_ulonglong, param_13: ::core::ffi::c_ulonglong, param_14: ::core::ffi::c_ulonglong, param_15: ::core::ffi::c_ulonglong, param_16: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtDDDMatmulAlgoCheck( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtDDDMatmulAlgoGetHeuristic( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: *mut ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtBSSMatmulAlgoGetIds( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_uint, param_4: ::core::ffi::c_int, param_5: ::core::ffi::c_int, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_int, param_9: ::core::ffi::c_ulonglong, param_10: *mut ::core::ffi::c_int, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtBSSMatmulAlgoInit( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_uint, param_4: ::core::ffi::c_uint, param_5: ::core::ffi::c_uint, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtBSSMatmulAlgoCapGetAttribute( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtBSSMatmul( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, param_11: ::core::ffi::c_ulonglong, param_12: ::core::ffi::c_ulonglong, param_13: ::core::ffi::c_ulonglong, param_14: ::core::ffi::c_ulonglong, param_15: ::core::ffi::c_ulonglong, param_16: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtBSSMatmulAlgoCheck( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtBSSMatmulAlgoGetHeuristic( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: *mut ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtCCCMatmulAlgoGetIds( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_uint, param_4: ::core::ffi::c_int, param_5: ::core::ffi::c_int, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_int, param_9: ::core::ffi::c_ulonglong, param_10: *mut ::core::ffi::c_int, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtCCCMatmulAlgoInit( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_uint, param_4: ::core::ffi::c_uint, param_5: ::core::ffi::c_uint, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtCCCMatmulAlgoCapGetAttribute( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtCCCMatmul( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, param_11: ::core::ffi::c_ulonglong, param_12: ::core::ffi::c_ulonglong, param_13: ::core::ffi::c_ulonglong, param_14: ::core::ffi::c_ulonglong, param_15: ::core::ffi::c_ulonglong, param_16: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtCCCMatmulAlgoCheck( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtCCCMatmulAlgoGetHeuristic( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: *mut ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtZZZMatmulAlgoGetIds( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_uint, param_4: ::core::ffi::c_int, param_5: ::core::ffi::c_int, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_int, param_9: ::core::ffi::c_ulonglong, param_10: *mut ::core::ffi::c_int, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtZZZMatmulAlgoInit( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_uint, param_4: ::core::ffi::c_uint, param_5: ::core::ffi::c_uint, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtZZZMatmulAlgoCapGetAttribute( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtZZZMatmul( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, param_11: ::core::ffi::c_ulonglong, param_12: ::core::ffi::c_ulonglong, param_13: ::core::ffi::c_ulonglong, param_14: ::core::ffi::c_ulonglong, param_15: ::core::ffi::c_ulonglong, param_16: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtZZZMatmulAlgoCheck( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtZZZMatmulAlgoGetHeuristic( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: *mut ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtACCMatmulAlgoGetIds( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_uint, param_4: ::core::ffi::c_int, param_5: ::core::ffi::c_int, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_int, param_9: ::core::ffi::c_ulonglong, param_10: *mut ::core::ffi::c_int, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtACCMatmulAlgoInit( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_uint, param_4: ::core::ffi::c_uint, param_5: ::core::ffi::c_uint, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtACCMatmulAlgoCapGetAttribute( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtACCMatmul( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, param_11: ::core::ffi::c_ulonglong, param_12: ::core::ffi::c_ulonglong, param_13: ::core::ffi::c_ulonglong, param_14: ::core::ffi::c_ulonglong, param_15: ::core::ffi::c_ulonglong, param_16: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtACCMatmulAlgoCheck( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtACCMatmulAlgoGetHeuristic( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: *mut ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtBIIMatmulAlgoGetIds( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_uint, param_4: ::core::ffi::c_int, param_5: ::core::ffi::c_int, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_int, param_9: ::core::ffi::c_ulonglong, param_10: *mut ::core::ffi::c_int, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtBIIMatmulAlgoInit( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_uint, param_4: ::core::ffi::c_uint, param_5: ::core::ffi::c_uint, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtBIIMatmulAlgoCapGetAttribute( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtBIIMatmul( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, param_11: ::core::ffi::c_ulonglong, param_12: ::core::ffi::c_ulonglong, param_13: ::core::ffi::c_ulonglong, param_14: ::core::ffi::c_ulonglong, param_15: ::core::ffi::c_ulonglong, param_16: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtBIIMatmulAlgoCheck( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtBIIMatmulAlgoGetHeuristic( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: *mut ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtBSBMatmulAlgoGetIds( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_uint, param_4: ::core::ffi::c_int, param_5: ::core::ffi::c_int, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_int, param_9: ::core::ffi::c_ulonglong, param_10: *mut ::core::ffi::c_int, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtBSBMatmulAlgoInit( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_uint, param_4: ::core::ffi::c_uint, param_5: ::core::ffi::c_uint, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtBSBMatmulAlgoCapGetAttribute( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtBSBMatmul( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, param_11: ::core::ffi::c_ulonglong, param_12: ::core::ffi::c_ulonglong, param_13: ::core::ffi::c_ulonglong, param_14: ::core::ffi::c_ulonglong, param_15: ::core::ffi::c_ulonglong, param_16: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtBSBMatmulAlgoCheck( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtBSBMatmulAlgoGetHeuristic( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: *mut ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtHSSMatmulAlgoGetIds( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_uint, param_4: ::core::ffi::c_int, param_5: ::core::ffi::c_int, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_int, param_9: ::core::ffi::c_ulonglong, param_10: *mut ::core::ffi::c_int, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtHSSMatmulAlgoInit( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_uint, param_4: ::core::ffi::c_uint, param_5: ::core::ffi::c_uint, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtHSSMatmulAlgoCapGetAttribute( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtHSSMatmul( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, param_11: ::core::ffi::c_ulonglong, param_12: ::core::ffi::c_ulonglong, param_13: ::core::ffi::c_ulonglong, param_14: ::core::ffi::c_ulonglong, param_15: ::core::ffi::c_ulonglong, param_16: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtHSSMatmulAlgoCheck( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtHSSMatmulAlgoGetHeuristic( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: *mut ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtKCCMatmulAlgoGetIds( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_uint, param_4: ::core::ffi::c_int, param_5: ::core::ffi::c_int, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_int, param_9: ::core::ffi::c_ulonglong, param_10: *mut ::core::ffi::c_int, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtKCCMatmulAlgoInit( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_uint, param_4: ::core::ffi::c_uint, param_5: ::core::ffi::c_uint, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtKCCMatmulAlgoCapGetAttribute( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtKCCMatmul( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, param_11: ::core::ffi::c_ulonglong, param_12: ::core::ffi::c_ulonglong, param_13: ::core::ffi::c_ulonglong, param_14: ::core::ffi::c_ulonglong, param_15: ::core::ffi::c_ulonglong, param_16: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtKCCMatmulAlgoCheck( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtKCCMatmulAlgoGetHeuristic( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: *mut ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtKCKMatmulAlgoGetIds( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_uint, param_4: ::core::ffi::c_int, param_5: ::core::ffi::c_int, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_int, param_9: ::core::ffi::c_ulonglong, param_10: *mut ::core::ffi::c_int, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtKCKMatmulAlgoInit( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_uint, param_4: ::core::ffi::c_uint, param_5: ::core::ffi::c_uint, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtKCKMatmulAlgoCapGetAttribute( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtKCKMatmul( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, param_11: ::core::ffi::c_ulonglong, param_12: ::core::ffi::c_ulonglong, param_13: ::core::ffi::c_ulonglong, param_14: ::core::ffi::c_ulonglong, param_15: ::core::ffi::c_ulonglong, param_16: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtKCKMatmulAlgoCheck( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtKCKMatmulAlgoGetHeuristic( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: *mut ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtTSSMatmulAlgoGetIds( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_uint, param_4: ::core::ffi::c_int, param_5: ::core::ffi::c_int, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_int, param_9: ::core::ffi::c_ulonglong, param_10: *mut ::core::ffi::c_int, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtTSSMatmulAlgoInit( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_uint, param_4: ::core::ffi::c_uint, param_5: ::core::ffi::c_uint, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtTSSMatmulAlgoCapGetAttribute( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtTSSMatmul( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, param_11: ::core::ffi::c_ulonglong, param_12: ::core::ffi::c_ulonglong, param_13: ::core::ffi::c_ulonglong, param_14: ::core::ffi::c_ulonglong, param_15: ::core::ffi::c_ulonglong, param_16: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtTSSMatmulAlgoCheck( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtTSSMatmulAlgoGetHeuristic( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: *mut ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtTSTMatmulAlgoGetIds( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_uint, param_4: ::core::ffi::c_int, param_5: ::core::ffi::c_int, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_int, param_9: ::core::ffi::c_ulonglong, param_10: *mut ::core::ffi::c_int, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtTSTMatmulAlgoInit( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_uint, param_4: ::core::ffi::c_uint, param_5: ::core::ffi::c_uint, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtTSTMatmulAlgoCapGetAttribute( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtTSTMatmul( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, param_11: ::core::ffi::c_ulonglong, param_12: ::core::ffi::c_ulonglong, param_13: ::core::ffi::c_ulonglong, param_14: ::core::ffi::c_ulonglong, param_15: ::core::ffi::c_ulonglong, param_16: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtTSTMatmulAlgoCheck( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtTSTMatmulAlgoGetHeuristic( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: *mut ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtVCCMatmulAlgoGetIds( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_uint, param_4: ::core::ffi::c_int, param_5: ::core::ffi::c_int, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_int, param_9: ::core::ffi::c_ulonglong, param_10: *mut ::core::ffi::c_int, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtVCCMatmulAlgoInit( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_uint, param_4: ::core::ffi::c_uint, param_5: ::core::ffi::c_uint, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtVCCMatmulAlgoCapGetAttribute( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtVCCMatmul( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, param_11: ::core::ffi::c_ulonglong, param_12: ::core::ffi::c_ulonglong, param_13: ::core::ffi::c_ulonglong, param_14: ::core::ffi::c_ulonglong, param_15: ::core::ffi::c_ulonglong, param_16: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtVCCMatmulAlgoCheck( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtVCCMatmulAlgoGetHeuristic( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: *mut ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtVCVMatmulAlgoGetIds( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_uint, param_4: ::core::ffi::c_int, param_5: ::core::ffi::c_int, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_int, param_9: ::core::ffi::c_ulonglong, param_10: *mut ::core::ffi::c_int, ) -> ::core::ffi::c_ulonglong; } extern "system" { fn cublasLtVCVMatmulAlgoInit( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_uint, param_4: ::core::ffi::c_uint, param_5: ::core::ffi::c_uint, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtVCVMatmulAlgoCapGetAttribute( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_uint, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtVCVMatmul( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, param_11: ::core::ffi::c_ulonglong, param_12: ::core::ffi::c_ulonglong, param_13: ::core::ffi::c_ulonglong, param_14: ::core::ffi::c_ulonglong, param_15: ::core::ffi::c_ulonglong, param_16: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtVCVMatmulAlgoCheck( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLtVCVMatmulAlgoGetHeuristic( param_1: ::core::ffi::c_ulonglong, param_2: ::core::ffi::c_ulonglong, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_ulonglong, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_ulonglong, param_7: *mut ::core::ffi::c_ulonglong, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_ulonglong, ) -> ::core::ffi::c_uint; } extern "system" { fn cublasLt_for_cublas_BII() -> *mut ::core::ffi::c_void; } extern "system" { fn cublasLt_for_cublas_BSS() -> *mut ::core::ffi::c_void; } extern "system" { fn cublasLt_for_cublas_DDD() -> *mut ::core::ffi::c_void; } extern "system" { fn cublasLt_for_cublas_HHH() -> *mut ::core::ffi::c_void; } extern "system" { fn cublasLt_for_cublas_HSH() -> *mut ::core::ffi::c_void; } extern "system" { fn cublasLt_for_cublas_HSS() -> *mut ::core::ffi::c_void; } extern "system" { fn cublasLt_for_cublas_SSS() -> *mut ::core::ffi::c_void; } extern "system" { fn cublasLt_for_cublas_TSS() -> *mut ::core::ffi::c_void; } extern "system" { fn cublasLt_for_cublas_TST() -> *mut ::core::ffi::c_void; } ================================================ FILE: cuda_macros/src/cuda.rs ================================================ // Generated automatically by zluda_bindgen // DO NOT EDIT MANUALLY #![allow(warnings)] extern "system" { /** \brief Gets the string description of an error code Sets \p *pStr to the address of a NULL-terminated string description of the error code \p error. If the error code is not recognized, ::CUDA_ERROR_INVALID_VALUE will be returned and \p *pStr will be set to the NULL address. \param error - Error code to convert to string \param pStr - Address of the string pointer. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE \sa ::CUresult, ::cudaGetErrorString*/ fn cuGetErrorString( error: cuda_types::cuda::CUresult, pStr: *mut *const ::core::ffi::c_char, ) -> cuda_types::cuda::CUresult; /** \brief Gets the string representation of an error code enum name Sets \p *pStr to the address of a NULL-terminated string representation of the name of the enum error code \p error. If the error code is not recognized, ::CUDA_ERROR_INVALID_VALUE will be returned and \p *pStr will be set to the NULL address. \param error - Error code to convert to string \param pStr - Address of the string pointer. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE \sa ::CUresult, ::cudaGetErrorName*/ fn cuGetErrorName( error: cuda_types::cuda::CUresult, pStr: *mut *const ::core::ffi::c_char, ) -> cuda_types::cuda::CUresult; /** \brief Initialize the CUDA driver API Initializes the driver API and must be called before any other function from the driver API in the current process. Currently, the \p Flags parameter must be 0. If ::cuInit() has not been called, any function from the driver API will return ::CUDA_ERROR_NOT_INITIALIZED. Note: cuInit preloads various libraries needed for JIT compilation. To opt-out of this behavior, set the environment variable CUDA_FORCE_PRELOAD_LIBRARIES=0. CUDA will lazily load JIT libraries as needed. To disable JIT entirely, set the environment variable CUDA_DISABLE_JIT=1. \param Flags - Initialization flag for CUDA. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_DEVICE, ::CUDA_ERROR_SYSTEM_DRIVER_MISMATCH, ::CUDA_ERROR_COMPAT_NOT_SUPPORTED_ON_DEVICE \notefnerr*/ fn cuInit(Flags: ::core::ffi::c_uint) -> cuda_types::cuda::CUresult; /** \brief Returns the latest CUDA version supported by driver Returns in \p *driverVersion the version of CUDA supported by the driver. The version is returned as (1000 * major + 10 * minor). For example, CUDA 9.2 would be represented by 9020. This function automatically returns ::CUDA_ERROR_INVALID_VALUE if \p driverVersion is NULL. \param driverVersion - Returns the CUDA driver version \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cudaDriverGetVersion, ::cudaRuntimeGetVersion*/ fn cuDriverGetVersion( driverVersion: *mut ::core::ffi::c_int, ) -> cuda_types::cuda::CUresult; /** \brief Returns a handle to a compute device Returns in \p *device a device handle given an ordinal in the range [0, ::cuDeviceGetCount()-1]. \param device - Returned device handle \param ordinal - Device number to get handle for \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_DEVICE \notefnerr \sa ::cuDeviceGetAttribute, ::cuDeviceGetCount, ::cuDeviceGetName, ::cuDeviceGetUuid, ::cuDeviceGetLuid, ::cuDeviceTotalMem, ::cuDeviceGetExecAffinitySupport*/ fn cuDeviceGet( device: *mut cuda_types::cuda::CUdevice, ordinal: ::core::ffi::c_int, ) -> cuda_types::cuda::CUresult; /** \brief Returns the number of compute-capable devices Returns in \p *count the number of devices with compute capability greater than or equal to 2.0 that are available for execution. If there is no such device, ::cuDeviceGetCount() returns 0. \param count - Returned number of compute-capable devices \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuDeviceGetAttribute, ::cuDeviceGetName, ::cuDeviceGetUuid, ::cuDeviceGetLuid, ::cuDeviceGet, ::cuDeviceTotalMem, ::cuDeviceGetExecAffinitySupport, ::cudaGetDeviceCount*/ fn cuDeviceGetCount(count: *mut ::core::ffi::c_int) -> cuda_types::cuda::CUresult; /** \brief Returns an identifier string for the device Returns an ASCII string identifying the device \p dev in the NULL-terminated string pointed to by \p name. \p len specifies the maximum length of the string that may be returned. \p name is shortened to the specified \p len, if \p len is less than the device name \param name - Returned identifier string for the device \param len - Maximum length of string to store in \p name \param dev - Device to get identifier string for \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_DEVICE \notefnerr \sa ::cuDeviceGetAttribute, ::cuDeviceGetUuid, ::cuDeviceGetLuid, ::cuDeviceGetCount, ::cuDeviceGet, ::cuDeviceTotalMem, ::cuDeviceGetExecAffinitySupport, ::cudaGetDeviceProperties*/ fn cuDeviceGetName( name: *mut ::core::ffi::c_char, len: ::core::ffi::c_int, dev: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; /** \brief Return an UUID for the device Returns 16-octets identifying the device \p dev in the structure pointed by the \p uuid. If the device is in MIG mode, returns its MIG UUID which uniquely identifies the subscribed MIG compute instance. \param uuid - Returned UUID \param dev - Device to get identifier string for \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_DEVICE \notefnerr \sa ::cuDeviceGetAttribute, ::cuDeviceGetCount, ::cuDeviceGetName, ::cuDeviceGetLuid, ::cuDeviceGet, ::cuDeviceTotalMem, ::cudaGetDeviceProperties*/ fn cuDeviceGetUuid_v2( uuid: *mut cuda_types::cuda::CUuuid, dev: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; /** \brief Return an LUID and device node mask for the device Return identifying information (\p luid and \p deviceNodeMask) to allow matching device with graphics APIs. \param luid - Returned LUID \param deviceNodeMask - Returned device node mask \param dev - Device to get identifier string for \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_DEVICE \notefnerr \sa ::cuDeviceGetAttribute, ::cuDeviceGetCount, ::cuDeviceGetName, ::cuDeviceGet, ::cuDeviceTotalMem, ::cuDeviceGetExecAffinitySupport, ::cudaGetDeviceProperties*/ fn cuDeviceGetLuid( luid: *mut ::core::ffi::c_char, deviceNodeMask: *mut ::core::ffi::c_uint, dev: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; /** \brief Returns the total amount of memory on the device Returns in \p *bytes the total amount of memory available on the device \p dev in bytes. \param bytes - Returned memory available on device in bytes \param dev - Device handle \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_DEVICE \notefnerr \sa ::cuDeviceGetAttribute, ::cuDeviceGetCount, ::cuDeviceGetName, ::cuDeviceGetUuid, ::cuDeviceGet, ::cuDeviceGetExecAffinitySupport, ::cudaMemGetInfo*/ fn cuDeviceTotalMem_v2( bytes: *mut usize, dev: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; /** \brief Returns the maximum number of elements allocatable in a 1D linear texture for a given texture element size. Returns in \p maxWidthInElements the maximum number of texture elements allocatable in a 1D linear texture for given \p format and \p numChannels. \param maxWidthInElements - Returned maximum number of texture elements allocatable for given \p format and \p numChannels. \param format - Texture format. \param numChannels - Number of channels per texture element. \param dev - Device handle. \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_DEVICE \notefnerr \sa ::cuDeviceGetAttribute, ::cuDeviceGetCount, ::cuDeviceGetName, ::cuDeviceGetUuid, ::cuDeviceGet, ::cudaMemGetInfo, ::cuDeviceTotalMem*/ fn cuDeviceGetTexture1DLinearMaxWidth( maxWidthInElements: *mut usize, format: cuda_types::cuda::CUarray_format, numChannels: ::core::ffi::c_uint, dev: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; /** \brief Returns information about the device Returns in \p *pi the integer value of the attribute \p attrib on device \p dev. \param pi - Returned device attribute value \param attrib - Device attribute to query \param dev - Device handle \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_DEVICE \notefnerr \sa ::cuDeviceGetCount, ::cuDeviceGetName, ::cuDeviceGetUuid, ::cuDeviceGet, ::cuDeviceTotalMem, ::cuDeviceGetExecAffinitySupport, ::cudaDeviceGetAttribute, ::cudaGetDeviceProperties*/ fn cuDeviceGetAttribute( pi: *mut ::core::ffi::c_int, attrib: cuda_types::cuda::CUdevice_attribute, dev: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; /** \brief Queries details about atomic operations supported between the device and host. Returns in \p *capabilities the details about requested atomic \p *operations over the the link between \p dev and the host. The allocated size of \p *operations and \p *capabilities must be \p count. For each ::CUatomicOperation in \p *operations, the corresponding result in \p *capabilities will be a bitmask indicating which of ::CUatomicOperationCapability the link supports natively. Returns ::CUDA_ERROR_INVALID_DEVICE if \p dev is not valid. Returns ::CUDA_ERROR_INVALID_VALUE if \p *capabilities or \p *operations is NULL, if \p count is 0, or if any of \p *operations is not valid. \param capabilities - Returned capability details of each requested operation \param operations - Requested operations \param count - Count of requested operations and size of capabilities \param dev - Device handle \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_DEVICE, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuDeviceGetAttribute, ::cuDeviceGetP2PAtomicCapabilities, ::cudaDeviceGeHostAtomicCapabilities*/ fn cuDeviceGetHostAtomicCapabilities( capabilities: *mut ::core::ffi::c_uint, operations: *const cuda_types::cuda::CUatomicOperation, count: ::core::ffi::c_uint, dev: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; /** \brief Return NvSciSync attributes that this device can support. Returns in \p nvSciSyncAttrList, the properties of NvSciSync that this CUDA device, \p dev can support. The returned \p nvSciSyncAttrList can be used to create an NvSciSync object that matches this device's capabilities. If NvSciSyncAttrKey_RequiredPerm field in \p nvSciSyncAttrList is already set this API will return ::CUDA_ERROR_INVALID_VALUE. The applications should set \p nvSciSyncAttrList to a valid NvSciSyncAttrList failing which this API will return ::CUDA_ERROR_INVALID_HANDLE. The \p flags controls how applications intends to use the NvSciSync created from the \p nvSciSyncAttrList. The valid flags are: - ::CUDA_NVSCISYNC_ATTR_SIGNAL, specifies that the applications intends to signal an NvSciSync on this CUDA device. - ::CUDA_NVSCISYNC_ATTR_WAIT, specifies that the applications intends to wait on an NvSciSync on this CUDA device. At least one of these flags must be set, failing which the API returns ::CUDA_ERROR_INVALID_VALUE. Both the flags are orthogonal to one another: a developer may set both these flags that allows to set both wait and signal specific attributes in the same \p nvSciSyncAttrList. Note that this API updates the input \p nvSciSyncAttrList with values equivalent to the following public attribute key-values: NvSciSyncAttrKey_RequiredPerm is set to - NvSciSyncAccessPerm_SignalOnly if ::CUDA_NVSCISYNC_ATTR_SIGNAL is set in \p flags. - NvSciSyncAccessPerm_WaitOnly if ::CUDA_NVSCISYNC_ATTR_WAIT is set in \p flags. - NvSciSyncAccessPerm_WaitSignal if both ::CUDA_NVSCISYNC_ATTR_WAIT and ::CUDA_NVSCISYNC_ATTR_SIGNAL are set in \p flags. NvSciSyncAttrKey_PrimitiveInfo is set to - NvSciSyncAttrValPrimitiveType_SysmemSemaphore on any valid \p device. - NvSciSyncAttrValPrimitiveType_Syncpoint if \p device is a Tegra device. - NvSciSyncAttrValPrimitiveType_SysmemSemaphorePayload64b if \p device is GA10X+. NvSciSyncAttrKey_GpuId is set to the same UUID that is returned for this \p device from ::cuDeviceGetUuid. \param nvSciSyncAttrList - Return NvSciSync attributes supported. \param dev - Valid Cuda Device to get NvSciSync attributes for. \param flags - flags describing NvSciSync usage. \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_INVALID_DEVICE, ::CUDA_ERROR_NOT_SUPPORTED, ::CUDA_ERROR_OUT_OF_MEMORY \sa ::cuImportExternalSemaphore, ::cuDestroyExternalSemaphore, ::cuSignalExternalSemaphoresAsync, ::cuWaitExternalSemaphoresAsync*/ fn cuDeviceGetNvSciSyncAttributes( nvSciSyncAttrList: *mut ::core::ffi::c_void, dev: cuda_types::cuda::CUdevice, flags: ::core::ffi::c_int, ) -> cuda_types::cuda::CUresult; /** \brief Sets the current memory pool of a device The memory pool must be local to the specified device. ::cuMemAllocAsync allocates from the current mempool of the provided stream's device. By default, a device's current memory pool is its default memory pool. \note Use ::cuMemAllocFromPoolAsync to specify asynchronous allocations from a device different than the one the stream runs on. \returns ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE \sa ::cuDeviceGetDefaultMemPool, ::cuDeviceGetMemPool, ::cuMemPoolCreate, ::cuMemPoolDestroy, ::cuMemAllocFromPoolAsync*/ fn cuDeviceSetMemPool( dev: cuda_types::cuda::CUdevice, pool: cuda_types::cuda::CUmemoryPool, ) -> cuda_types::cuda::CUresult; /** \brief Gets the current mempool for a device Returns the last pool provided to ::cuDeviceSetMemPool for this device or the device's default memory pool if ::cuDeviceSetMemPool has never been called. By default the current mempool is the default mempool for a device. Otherwise the returned pool must have been set with ::cuDeviceSetMemPool. \returns ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE \sa ::cuDeviceGetDefaultMemPool, ::cuMemPoolCreate, ::cuDeviceSetMemPool*/ fn cuDeviceGetMemPool( pool: *mut cuda_types::cuda::CUmemoryPool, dev: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; /** \brief Returns the default mempool of a device The default mempool of a device contains device memory from that device. \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_DEVICE, ::CUDA_ERROR_NOT_SUPPORTED \notefnerr \sa ::cuMemAllocAsync, ::cuMemPoolTrimTo, ::cuMemPoolGetAttribute, ::cuMemPoolSetAttribute, cuMemPoolSetAccess, ::cuDeviceGetMemPool, ::cuMemPoolCreate*/ fn cuDeviceGetDefaultMemPool( pool_out: *mut cuda_types::cuda::CUmemoryPool, dev: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; /** \brief Returns information about the execution affinity support of the device. Returns in \p *pi whether execution affinity type \p type is supported by device \p dev. The supported types are: - ::CU_EXEC_AFFINITY_TYPE_SM_COUNT: 1 if context with limited SMs is supported by the device, or 0 if not; \param pi - 1 if the execution affinity type \p type is supported by the device, or 0 if not \param type - Execution affinity type to query \param dev - Device handle \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_DEVICE \notefnerr \sa ::cuDeviceGetAttribute, ::cuDeviceGetCount, ::cuDeviceGetName, ::cuDeviceGetUuid, ::cuDeviceGet, ::cuDeviceTotalMem*/ fn cuDeviceGetExecAffinitySupport( pi: *mut ::core::ffi::c_int, type_: cuda_types::cuda::CUexecAffinityType, dev: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; /** \brief Blocks until remote writes are visible to the specified scope Blocks until GPUDirect RDMA writes to the target context via mappings created through APIs like nvidia_p2p_get_pages (see https://docs.nvidia.com/cuda/gpudirect-rdma for more information), are visible to the specified scope. If the scope equals or lies within the scope indicated by ::CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WRITES_ORDERING, the call will be a no-op and can be safely omitted for performance. This can be determined by comparing the numerical values between the two enums, with smaller scopes having smaller values. On platforms that support GPUDirect RDMA writes via more than one path in hardware (see ::CU_MEM_RANGE_FLAG_DMA_BUF_MAPPING_TYPE_PCIE), the user should consider those paths as belonging to separate ordering domains. Note that in such cases CUDA driver will report both RDMA writes ordering and RDMA write scope as ALL_DEVICES and a call to cuFlushGPUDirectRDMA will be a no-op, but when these multiple paths are used simultaneously, it is the user's responsibility to ensure ordering by using mechanisms outside the scope of CUDA. Users may query support for this API via ::CU_DEVICE_ATTRIBUTE_FLUSH_FLUSH_GPU_DIRECT_RDMA_OPTIONS. \param target - The target of the operation, see ::CUflushGPUDirectRDMAWritesTarget \param scope - The scope of the operation, see ::CUflushGPUDirectRDMAWritesScope \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, \notefnerr */ fn cuFlushGPUDirectRDMAWrites( target: cuda_types::cuda::CUflushGPUDirectRDMAWritesTarget, scope: cuda_types::cuda::CUflushGPUDirectRDMAWritesScope, ) -> cuda_types::cuda::CUresult; /** \brief Returns properties for a selected device \deprecated This function was deprecated as of CUDA 5.0 and replaced by ::cuDeviceGetAttribute(). Returns in \p *prop the properties of device \p dev. The ::CUdevprop structure is defined as: \code typedef struct CUdevprop_st { int maxThreadsPerBlock; int maxThreadsDim[3]; int maxGridSize[3]; int sharedMemPerBlock; int totalConstantMemory; int SIMDWidth; int memPitch; int regsPerBlock; int clockRate; int textureAlign } CUdevprop; \endcode where: - ::maxThreadsPerBlock is the maximum number of threads per block; - ::maxThreadsDim[3] is the maximum sizes of each dimension of a block; - ::maxGridSize[3] is the maximum sizes of each dimension of a grid; - ::sharedMemPerBlock is the total amount of shared memory available per block in bytes; - ::totalConstantMemory is the total amount of constant memory available on the device in bytes; - ::SIMDWidth is the warp size; - ::memPitch is the maximum pitch allowed by the memory copy functions that involve memory regions allocated through ::cuMemAllocPitch(); - ::regsPerBlock is the total number of registers available per block; - ::clockRate is the clock frequency in kilohertz; - ::textureAlign is the alignment requirement; texture base addresses that are aligned to ::textureAlign bytes do not need an offset applied to texture fetches. \param prop - Returned properties of device \param dev - Device to get properties for \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_DEVICE \notefnerr \sa ::cuDeviceGetAttribute, ::cuDeviceGetCount, ::cuDeviceGetName, ::cuDeviceGetUuid, ::cuDeviceGet, ::cuDeviceTotalMem*/ fn cuDeviceGetProperties( prop: *mut cuda_types::cuda::CUdevprop, dev: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; /** \brief Returns the compute capability of the device \deprecated This function was deprecated as of CUDA 5.0 and its functionality superseded by ::cuDeviceGetAttribute(). Returns in \p *major and \p *minor the major and minor revision numbers that define the compute capability of the device \p dev. \param major - Major revision number \param minor - Minor revision number \param dev - Device handle \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_DEVICE \notefnerr \sa ::cuDeviceGetAttribute, ::cuDeviceGetCount, ::cuDeviceGetName, ::cuDeviceGetUuid, ::cuDeviceGet, ::cuDeviceTotalMem*/ fn cuDeviceComputeCapability( major: *mut ::core::ffi::c_int, minor: *mut ::core::ffi::c_int, dev: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; /** \brief Retain the primary context on the GPU Retains the primary context on the device. Once the user successfully retains the primary context, the primary context will be active and available to the user until the user releases it with ::cuDevicePrimaryCtxRelease() or resets it with ::cuDevicePrimaryCtxReset(). Unlike ::cuCtxCreate() the newly retained context is not pushed onto the stack. Retaining the primary context for the first time will fail with ::CUDA_ERROR_UNKNOWN if the compute mode of the device is ::CU_COMPUTEMODE_PROHIBITED. The function ::cuDeviceGetAttribute() can be used with ::CU_DEVICE_ATTRIBUTE_COMPUTE_MODE to determine the compute mode of the device. The nvidia-smi tool can be used to set the compute mode for devices. Documentation for nvidia-smi can be obtained by passing a -h option to it. Please note that the primary context always supports pinned allocations. Other flags can be specified by ::cuDevicePrimaryCtxSetFlags(). \param pctx - Returned context handle of the new context \param dev - Device for which primary context is requested \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_DEVICE, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_OUT_OF_MEMORY, ::CUDA_ERROR_UNKNOWN \notefnerr \sa ::cuDevicePrimaryCtxRelease, ::cuDevicePrimaryCtxSetFlags, ::cuCtxCreate, ::cuCtxGetApiVersion, ::cuCtxGetCacheConfig, ::cuCtxGetDevice, ::cuCtxGetFlags, ::cuCtxGetLimit, ::cuCtxPopCurrent, ::cuCtxPushCurrent, ::cuCtxSetCacheConfig, ::cuCtxSetLimit, ::cuCtxSynchronize*/ fn cuDevicePrimaryCtxRetain( pctx: *mut cuda_types::cuda::CUcontext, dev: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; /** \brief Release the primary context on the GPU Releases the primary context interop on the device. A retained context should always be released once the user is done using it. The context is automatically reset once the last reference to it is released. This behavior is different when the primary context was retained by the CUDA runtime from CUDA 4.0 and earlier. In this case, the primary context remains always active. Releasing a primary context that has not been previously retained will fail with ::CUDA_ERROR_INVALID_CONTEXT. Please note that unlike ::cuCtxDestroy() this method does not pop the context from stack in any circumstances. \param dev - Device which primary context is released \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_DEVICE, ::CUDA_ERROR_INVALID_CONTEXT \notefnerr \sa ::cuDevicePrimaryCtxRetain, ::cuCtxDestroy, ::cuCtxGetApiVersion, ::cuCtxGetCacheConfig, ::cuCtxGetDevice, ::cuCtxGetFlags, ::cuCtxGetLimit, ::cuCtxPopCurrent, ::cuCtxPushCurrent, ::cuCtxSetCacheConfig, ::cuCtxSetLimit, ::cuCtxSynchronize*/ fn cuDevicePrimaryCtxRelease_v2( dev: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; /** \brief Set flags for the primary context Sets the flags for the primary context on the device overwriting perviously set ones. The three LSBs of the \p flags parameter can be used to control how the OS thread, which owns the CUDA context at the time of an API call, interacts with the OS scheduler when waiting for results from the GPU. Only one of the scheduling flags can be set when creating a context. - ::CU_CTX_SCHED_SPIN: Instruct CUDA to actively spin when waiting for results from the GPU. This can decrease latency when waiting for the GPU, but may lower the performance of CPU threads if they are performing work in parallel with the CUDA thread. - ::CU_CTX_SCHED_YIELD: Instruct CUDA to yield its thread when waiting for results from the GPU. This can increase latency when waiting for the GPU, but can increase the performance of CPU threads performing work in parallel with the GPU. - ::CU_CTX_SCHED_BLOCKING_SYNC: Instruct CUDA to block the CPU thread on a synchronization primitive when waiting for the GPU to finish work. - ::CU_CTX_BLOCKING_SYNC: Instruct CUDA to block the CPU thread on a synchronization primitive when waiting for the GPU to finish work.
Deprecated: This flag was deprecated as of CUDA 4.0 and was replaced with ::CU_CTX_SCHED_BLOCKING_SYNC. - ::CU_CTX_SCHED_AUTO: The default value if the \p flags parameter is zero, uses a heuristic based on the number of active CUDA contexts in the process \e C and the number of logical processors in the system \e P. If \e C > \e P, then CUDA will yield to other OS threads when waiting for the GPU (::CU_CTX_SCHED_YIELD), otherwise CUDA will not yield while waiting for results and actively spin on the processor (::CU_CTX_SCHED_SPIN). Additionally, on Tegra devices, ::CU_CTX_SCHED_AUTO uses a heuristic based on the power profile of the platform and may choose ::CU_CTX_SCHED_BLOCKING_SYNC for low-powered devices. - ::CU_CTX_LMEM_RESIZE_TO_MAX: Instruct CUDA to not reduce local memory after resizing local memory for a kernel. This can prevent thrashing by local memory allocations when launching many kernels with high local memory usage at the cost of potentially increased memory usage.
Deprecated: This flag is deprecated and the behavior enabled by this flag is now the default and cannot be disabled. - ::CU_CTX_COREDUMP_ENABLE: If GPU coredumps have not been enabled globally with ::cuCoredumpSetAttributeGlobal or environment variables, this flag can be set during context creation to instruct CUDA to create a coredump if this context raises an exception during execution. These environment variables are described in the CUDA-GDB user guide under the "GPU core dump support" section. The initial settings will be taken from the global settings at the time of context creation. The other settings that control coredump output can be modified by calling ::cuCoredumpSetAttribute from the created context after it becomes current. - ::CU_CTX_USER_COREDUMP_ENABLE: If user-triggered GPU coredumps have not been enabled globally with ::cuCoredumpSetAttributeGlobal or environment variables, this flag can be set during context creation to instruct CUDA to create a coredump if data is written to a certain pipe that is present in the OS space. These environment variables are described in the CUDA-GDB user guide under the "GPU core dump support" section. It is important to note that the pipe name *must* be set with ::cuCoredumpSetAttributeGlobal before creating the context if this flag is used. Setting this flag implies that ::CU_CTX_COREDUMP_ENABLE is set. The initial settings will be taken from the global settings at the time of context creation. The other settings that control coredump output can be modified by calling ::cuCoredumpSetAttribute from the created context after it becomes current. - ::CU_CTX_SYNC_MEMOPS: Ensures that synchronous memory operations initiated on this context will always synchronize. See further documentation in the section titled "API Synchronization behavior" to learn more about cases when synchronous memory operations can exhibit asynchronous behavior. \param dev - Device for which the primary context flags are set \param flags - New flags for the device \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_DEVICE, ::CUDA_ERROR_INVALID_VALUE, \notefnerr \sa ::cuDevicePrimaryCtxRetain, ::cuDevicePrimaryCtxGetState, ::cuCtxCreate, ::cuCtxGetFlags, ::cuCtxSetFlags, ::cudaSetDeviceFlags*/ fn cuDevicePrimaryCtxSetFlags_v2( dev: cuda_types::cuda::CUdevice, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Get the state of the primary context Returns in \p *flags the flags for the primary context of \p dev, and in \p *active whether it is active. See ::cuDevicePrimaryCtxSetFlags for flag values. \param dev - Device to get primary context flags for \param flags - Pointer to store flags \param active - Pointer to store context state; 0 = inactive, 1 = active \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_DEVICE, ::CUDA_ERROR_INVALID_VALUE, \notefnerr \sa ::cuDevicePrimaryCtxSetFlags, ::cuCtxGetFlags, ::cuCtxSetFlags, ::cudaGetDeviceFlags*/ fn cuDevicePrimaryCtxGetState( dev: cuda_types::cuda::CUdevice, flags: *mut ::core::ffi::c_uint, active: *mut ::core::ffi::c_int, ) -> cuda_types::cuda::CUresult; /** \brief Destroy all allocations and reset all state on the primary context Explicitly destroys and cleans up all resources associated with the current device in the current process. Note that it is responsibility of the calling function to ensure that no other module in the process is using the device any more. For that reason it is recommended to use ::cuDevicePrimaryCtxRelease() in most cases. However it is safe for other modules to call ::cuDevicePrimaryCtxRelease() even after resetting the device. Resetting the primary context does not release it, an application that has retained the primary context should explicitly release its usage. \param dev - Device for which primary context is destroyed \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_DEVICE, ::CUDA_ERROR_PRIMARY_CONTEXT_ACTIVE \notefnerr \sa ::cuDevicePrimaryCtxRetain, ::cuDevicePrimaryCtxRelease, ::cuCtxGetApiVersion, ::cuCtxGetCacheConfig, ::cuCtxGetDevice, ::cuCtxGetFlags, ::cuCtxGetLimit, ::cuCtxPopCurrent, ::cuCtxPushCurrent, ::cuCtxSetCacheConfig, ::cuCtxSetLimit, ::cuCtxSynchronize, ::cudaDeviceReset*/ fn cuDevicePrimaryCtxReset_v2( dev: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; /** \brief Create a CUDA context Creates a new CUDA context and associates it with the calling thread. The \p flags parameter is described below. The context is created with a usage count of 1 and the caller of ::cuCtxCreate() must call ::cuCtxDestroy() when done using the context. If a context is already current to the thread, it is supplanted by the newly created context and may be restored by a subsequent call to ::cuCtxPopCurrent(). CUDA context can be created with execution affinity. The type and the amount of execution resource the context can use is limited by \p paramsArray and \p numExecAffinityParams in \p execAffinity. The \p paramsArray is an array of \p CUexecAffinityParam and the \p numExecAffinityParams describes the size of the paramsArray. If two \p CUexecAffinityParam in the array have the same type, the latter execution affinity parameter overrides the former execution affinity parameter. The supported execution affinity types are: - ::CU_EXEC_AFFINITY_TYPE_SM_COUNT limits the portion of SMs that the context can use. The portion of SMs is specified as the number of SMs via \p CUexecAffinitySmCount. This limit will be internally rounded up to the next hardware-supported amount. Hence, it is imperative to query the actual execution affinity of the context via \p cuCtxGetExecAffinity after context creation. Currently, this attribute is only supported under Volta+ MPS. CUDA context can be created in CIG(CUDA in Graphics) mode by setting \p cigParams. Data from graphics client is shared with CUDA via the \p sharedData in \p cigParams. Support for D3D12 graphics client can be determined using ::cuDeviceGetAttribute() with ::CU_DEVICE_ATTRIBUTE_D3D12_CIG_SUPPORTED. \p sharedData is a ID3D12CommandQueue handle. Support for Vulkan graphics client can be determined using ::cuDeviceGetAttribute() with ::CU_DEVICE_ATTRIBUTE_VULKAN_CIG_SUPPORTED. \p sharedData is a Nvidia specific data blob populated by calling vkGetExternalComputeQueueDataNV(). Either \p execAffinityParams or \p cigParams can be set to a non-null value. Setting both to a non-null value will result in an undefined behavior. The three LSBs of the \p flags parameter can be used to control how the OS thread, which owns the CUDA context at the time of an API call, interacts with the OS scheduler when waiting for results from the GPU. Only one of the scheduling flags can be set when creating a context. - ::CU_CTX_SCHED_SPIN: Instruct CUDA to actively spin when waiting for results from the GPU. This can decrease latency when waiting for the GPU, but may lower the performance of CPU threads if they are performing work in parallel with the CUDA thread. - ::CU_CTX_SCHED_YIELD: Instruct CUDA to yield its thread when waiting for results from the GPU. This can increase latency when waiting for the GPU, but can increase the performance of CPU threads performing work in parallel with the GPU. - ::CU_CTX_SCHED_BLOCKING_SYNC: Instruct CUDA to block the CPU thread on a synchronization primitive when waiting for the GPU to finish work. - ::CU_CTX_BLOCKING_SYNC: Instruct CUDA to block the CPU thread on a synchronization primitive when waiting for the GPU to finish work.
Deprecated: This flag was deprecated as of CUDA 4.0 and was replaced with ::CU_CTX_SCHED_BLOCKING_SYNC. - ::CU_CTX_SCHED_AUTO: The default value if the \p flags parameter is zero, uses a heuristic based on the number of active CUDA contexts in the process \e C and the number of logical processors in the system \e P. If \e C > \e P, then CUDA will yield to other OS threads when waiting for the GPU (::CU_CTX_SCHED_YIELD), otherwise CUDA will not yield while waiting for results and actively spin on the processor (::CU_CTX_SCHED_SPIN). Additionally, on Tegra devices, ::CU_CTX_SCHED_AUTO uses a heuristic based on the power profile of the platform and may choose ::CU_CTX_SCHED_BLOCKING_SYNC for low-powered devices. - ::CU_CTX_MAP_HOST: Instruct CUDA to support mapped pinned allocations. This flag must be set in order to allocate pinned host memory that is accessible to the GPU. - ::CU_CTX_LMEM_RESIZE_TO_MAX: Instruct CUDA to not reduce local memory after resizing local memory for a kernel. This can prevent thrashing by local memory allocations when launching many kernels with high local memory usage at the cost of potentially increased memory usage.
Deprecated: This flag is deprecated and the behavior enabled by this flag is now the default and cannot be disabled. Instead, the per-thread stack size can be controlled with ::cuCtxSetLimit(). - ::CU_CTX_COREDUMP_ENABLE: If GPU coredumps have not been enabled globally with ::cuCoredumpSetAttributeGlobal or environment variables, this flag can be set during context creation to instruct CUDA to create a coredump if this context raises an exception during execution. These environment variables are described in the CUDA-GDB user guide under the "GPU core dump support" section. The initial attributes will be taken from the global attributes at the time of context creation. The other attributes that control coredump output can be modified by calling ::cuCoredumpSetAttribute from the created context after it becomes current. This flag is not supported when CUDA context is created in CIG(CUDA in Graphics) mode. - ::CU_CTX_USER_COREDUMP_ENABLE: If user-triggered GPU coredumps have not been enabled globally with ::cuCoredumpSetAttributeGlobal or environment variables, this flag can be set during context creation to instruct CUDA to create a coredump if data is written to a certain pipe that is present in the OS space. These environment variables are described in the CUDA-GDB user guide under the "GPU core dump support" section. It is important to note that the pipe name *must* be set with ::cuCoredumpSetAttributeGlobal before creating the context if this flag is used. Setting this flag implies that ::CU_CTX_COREDUMP_ENABLE is set. The initial attributes will be taken from the global attributes at the time of context creation. The other attributes that control coredump output can be modified by calling ::cuCoredumpSetAttribute from the created context after it becomes current. Setting this flag on any context creation is equivalent to setting the ::CU_COREDUMP_ENABLE_USER_TRIGGER attribute to \p true globally. This flag is not supported when CUDA context is created in CIG(CUDA in Graphics) mode. - ::CU_CTX_SYNC_MEMOPS: Ensures that synchronous memory operations initiated on this context will always synchronize. See further documentation in the section titled "API Synchronization behavior" to learn more about cases when synchronous memory operations can exhibit asynchronous behavior. Context creation will fail with ::CUDA_ERROR_UNKNOWN if the compute mode of the device is ::CU_COMPUTEMODE_PROHIBITED. The function ::cuDeviceGetAttribute() can be used with ::CU_DEVICE_ATTRIBUTE_COMPUTE_MODE to determine the compute mode of the device. The nvidia-smi tool can be used to set the compute mode for * devices. Documentation for nvidia-smi can be obtained by passing a -h option to it. Context creation will fail with :: CUDA_ERROR_INVALID_VALUE if invalid parameter was passed by client to create the CUDA context. Context creation in CIG mode will fail with ::CUDA_ERROR_NOT_SUPPORTED if CIG is not supported by the device or the driver. \param pctx - Returned context handle of the new context \param ctxCreateParams - Context creation parameters \param flags - Context creation flags \param dev - Device to create context on \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_DEVICE, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_SUPPORTED, ::CUDA_ERROR_OUT_OF_MEMORY, ::CUDA_ERROR_UNKNOWN \notefnerr \sa ::cuCtxDestroy, ::cuCtxGetApiVersion, ::cuCtxGetCacheConfig, ::cuCtxGetDevice, ::cuCtxGetFlags, ::cuCtxGetLimit, ::cuCtxPopCurrent, ::cuCtxPushCurrent, ::cuCtxSetCacheConfig, ::cuCtxSetLimit, ::cuCoredumpSetAttributeGlobal, ::cuCoredumpSetAttribute, ::cuCtxSynchronize*/ fn cuCtxCreate_v4( pctx: *mut cuda_types::cuda::CUcontext, ctxCreateParams: *mut cuda_types::cuda::CUctxCreateParams, flags: ::core::ffi::c_uint, dev: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; /** \brief Destroy a CUDA context Destroys the CUDA context specified by \p ctx. The context \p ctx will be destroyed regardless of how many threads it is current to. It is the responsibility of the calling function to ensure that no API call issues using \p ctx while ::cuCtxDestroy() is executing. Destroys and cleans up all resources associated with the context. It is the caller's responsibility to ensure that the context or its resources are not accessed or passed in subsequent API calls and doing so will result in undefined behavior. These resources include CUDA types ::CUmodule, ::CUfunction, ::CUstream, ::CUevent, ::CUarray, ::CUmipmappedArray, ::CUtexObject, ::CUsurfObject, ::CUtexref, ::CUsurfref, ::CUgraphicsResource, ::CUlinkState, ::CUexternalMemory and ::CUexternalSemaphore. These resources also include memory allocations by ::cuMemAlloc(), ::cuMemAllocHost(), ::cuMemAllocManaged() and ::cuMemAllocPitch(). If \p ctx is current to the calling thread then \p ctx will also be popped from the current thread's context stack (as though ::cuCtxPopCurrent() were called). If \p ctx is current to other threads, then \p ctx will remain current to those threads, and attempting to access \p ctx from those threads will result in the error ::CUDA_ERROR_CONTEXT_IS_DESTROYED. \note ::cuCtxDestroy() will not destroy memory allocations by ::cuMemCreate(), ::cuMemAllocAsync() and ::cuMemAllocFromPoolAsync(). These memory allocations are not associated with any CUDA context and need to be destroyed explicitly. \param ctx - Context to destroy \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuCtxCreate, ::cuCtxGetApiVersion, ::cuCtxGetCacheConfig, ::cuCtxGetDevice, ::cuCtxGetFlags, ::cuCtxGetLimit, ::cuCtxPopCurrent, ::cuCtxPushCurrent, ::cuCtxSetCacheConfig, ::cuCtxSetLimit, ::cuCtxSynchronize*/ fn cuCtxDestroy_v2(ctx: cuda_types::cuda::CUcontext) -> cuda_types::cuda::CUresult; /** \brief Pushes a context on the current CPU thread Pushes the given context \p ctx onto the CPU thread's stack of current contexts. The specified context becomes the CPU thread's current context, so all CUDA functions that operate on the current context are affected. The previous current context may be made current again by calling ::cuCtxDestroy() or ::cuCtxPopCurrent(). \param ctx - Context to push \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuCtxCreate, ::cuCtxDestroy, ::cuCtxGetApiVersion, ::cuCtxGetCacheConfig, ::cuCtxGetDevice, ::cuCtxGetFlags, ::cuCtxGetLimit, ::cuCtxPopCurrent, ::cuCtxSetCacheConfig, ::cuCtxSetLimit, ::cuCtxSynchronize*/ fn cuCtxPushCurrent_v2( ctx: cuda_types::cuda::CUcontext, ) -> cuda_types::cuda::CUresult; /** \brief Pops the current CUDA context from the current CPU thread. Pops the current CUDA context from the CPU thread and passes back the old context handle in \p *pctx. That context may then be made current to a different CPU thread by calling ::cuCtxPushCurrent(). If a context was current to the CPU thread before ::cuCtxCreate() or ::cuCtxPushCurrent() was called, this function makes that context current to the CPU thread again. \param pctx - Returned popped context handle \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT \notefnerr \sa ::cuCtxCreate, ::cuCtxDestroy, ::cuCtxGetApiVersion, ::cuCtxGetCacheConfig, ::cuCtxGetDevice, ::cuCtxGetFlags, ::cuCtxGetLimit, ::cuCtxPushCurrent, ::cuCtxSetCacheConfig, ::cuCtxSetLimit, ::cuCtxSynchronize*/ fn cuCtxPopCurrent_v2( pctx: *mut cuda_types::cuda::CUcontext, ) -> cuda_types::cuda::CUresult; /** \brief Binds the specified CUDA context to the calling CPU thread Binds the specified CUDA context to the calling CPU thread. If \p ctx is NULL then the CUDA context previously bound to the calling CPU thread is unbound and ::CUDA_SUCCESS is returned. If there exists a CUDA context stack on the calling CPU thread, this will replace the top of that stack with \p ctx. If \p ctx is NULL then this will be equivalent to popping the top of the calling CPU thread's CUDA context stack (or a no-op if the calling CPU thread's CUDA context stack is empty). \param ctx - Context to bind to the calling CPU thread \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT \notefnerr \sa ::cuCtxGetCurrent, ::cuCtxCreate, ::cuCtxDestroy, ::cudaSetDevice*/ fn cuCtxSetCurrent(ctx: cuda_types::cuda::CUcontext) -> cuda_types::cuda::CUresult; /** \brief Returns the CUDA context bound to the calling CPU thread. Returns in \p *pctx the CUDA context bound to the calling CPU thread. If no context is bound to the calling CPU thread then \p *pctx is set to NULL and ::CUDA_SUCCESS is returned. \param pctx - Returned context handle \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, \notefnerr \sa ::cuCtxSetCurrent, ::cuCtxCreate, ::cuCtxDestroy, ::cudaGetDevice*/ fn cuCtxGetCurrent( pctx: *mut cuda_types::cuda::CUcontext, ) -> cuda_types::cuda::CUresult; /** \brief Returns the device handle for the current context Returns in \p *device the handle of the current context's device. \param device - Returned device handle for the current context \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, \notefnerr \sa ::cuCtxCreate, ::cuCtxDestroy, ::cuCtxGetApiVersion, ::cuCtxGetCacheConfig, ::cuCtxGetFlags, ::cuCtxGetLimit, ::cuCtxPopCurrent, ::cuCtxPushCurrent, ::cuCtxSetCacheConfig, ::cuCtxSetLimit, ::cuCtxSynchronize, ::cudaGetDevice*/ fn cuCtxGetDevice( device: *mut cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; /** \brief Returns the device handle for the specified context Returns in \p *device the handle of the specified context's device. If the specified context is NULL, the API will return the current context's device. \param device - Returned device handle for the specified context \param ctx - Context for which to obtain the device \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuCtxGetCurrent, ::cuCtxPopCurrent, ::cuCtxPushCurrent*/ fn cuCtxGetDevice_v2( device: *mut cuda_types::cuda::CUdevice, ctx: cuda_types::cuda::CUcontext, ) -> cuda_types::cuda::CUresult; /** \brief Returns the flags for the current context Returns in \p *flags the flags of the current context. See ::cuCtxCreate for flag values. \param flags - Pointer to store flags of current context \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, \notefnerr \sa ::cuCtxCreate, ::cuCtxGetApiVersion, ::cuCtxGetCacheConfig, ::cuCtxGetCurrent, ::cuCtxGetDevice, ::cuCtxGetLimit, ::cuCtxGetSharedMemConfig, ::cuCtxGetStreamPriorityRange, ::cuCtxSetFlags, ::cudaGetDeviceFlags*/ fn cuCtxGetFlags(flags: *mut ::core::ffi::c_uint) -> cuda_types::cuda::CUresult; /** \brief Sets the flags for the current context Sets the flags for the current context overwriting previously set ones. See ::cuDevicePrimaryCtxSetFlags for flag values. \param flags - Flags to set on the current context \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, \notefnerr \sa ::cuCtxCreate, ::cuCtxGetApiVersion, ::cuCtxGetCacheConfig, ::cuCtxGetCurrent, ::cuCtxGetDevice, ::cuCtxGetLimit, ::cuCtxGetSharedMemConfig, ::cuCtxGetStreamPriorityRange, ::cuCtxGetFlags, ::cudaGetDeviceFlags, ::cuDevicePrimaryCtxSetFlags,*/ fn cuCtxSetFlags(flags: ::core::ffi::c_uint) -> cuda_types::cuda::CUresult; /** \brief Returns the unique Id associated with the context supplied Returns in \p ctxId the unique Id which is associated with a given context. The Id is unique for the life of the program for this instance of CUDA. If context is supplied as NULL and there is one current, the Id of the current context is returned. \param ctx - Context for which to obtain the Id \param ctxId - Pointer to store the Id of the context \return ::CUDA_SUCCESS, ::CUDA_ERROR_CONTEXT_IS_DESTROYED, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuCtxCreate, ::cuCtxDestroy, ::cuCtxGetApiVersion, ::cuCtxGetCacheConfig, ::cuCtxGetDevice, ::cuCtxGetFlags, ::cuCtxGetLimit, ::cuCtxPushCurrent*/ fn cuCtxGetId( ctx: cuda_types::cuda::CUcontext, ctxId: *mut ::core::ffi::c_ulonglong, ) -> cuda_types::cuda::CUresult; /** \brief Block for the current context's tasks to complete Blocks until the current context has completed all preceding requested tasks. If the current context is the primary context, green contexts that have been created will also be synchronized. ::cuCtxSynchronize() returns an error if one of the preceding tasks failed. If the context was created with the ::CU_CTX_SCHED_BLOCKING_SYNC flag, the CPU thread will block until the GPU context has finished its work. \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT \notefnerr \sa ::cuCtxCreate, ::cuCtxDestroy, ::cuCtxGetApiVersion, ::cuCtxGetCacheConfig, ::cuCtxGetDevice, ::cuCtxGetFlags, ::cuCtxGetLimit, ::cuCtxPopCurrent, ::cuCtxPushCurrent, ::cuCtxSetCacheConfig, ::cuCtxSetLimit, ::cudaDeviceSynchronize*/ fn cuCtxSynchronize() -> cuda_types::cuda::CUresult; /** \brief Block for the specified context's tasks to complete Blocks until the specified context has completed all preceding requested tasks. If the specified context is the primary context, green contexts that have been created will also be synchronized. The API returns an error if one of the preceding tasks failed. If the context was created with the ::CU_CTX_SCHED_BLOCKING_SYNC flag, the CPU thread will block until the GPU context has finished its work. If the specified context is NULL, the API will operate on the current context. \param ctx - Context to synchronize \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuCtxGetCurrent, ::cuCtxPopCurrent, ::cuCtxPushCurrent, ::cuGreenCtxCreate, ::cuCtxFromGreenCtx, ::cudaDeviceSynchronize*/ fn cuCtxSynchronize_v2( ctx: cuda_types::cuda::CUcontext, ) -> cuda_types::cuda::CUresult; /** \brief Set resource limits Setting \p limit to \p value is a request by the application to update the current limit maintained by the context. The driver is free to modify the requested value to meet h/w requirements (this could be clamping to minimum or maximum values, rounding up to nearest element size, etc). The application can use ::cuCtxGetLimit() to find out exactly what the limit has been set to. Setting each ::CUlimit has its own specific restrictions, so each is discussed here. - ::CU_LIMIT_STACK_SIZE controls the stack size in bytes of each GPU thread. The driver automatically increases the per-thread stack size for each kernel launch as needed. This size isn't reset back to the original value after each launch. Setting this value will take effect immediately, and if necessary, the device will block until all preceding requested tasks are complete. - ::CU_LIMIT_PRINTF_FIFO_SIZE controls the size in bytes of the FIFO used by the ::printf() device system call. Setting ::CU_LIMIT_PRINTF_FIFO_SIZE must be performed before launching any kernel that uses the ::printf() device system call, otherwise ::CUDA_ERROR_INVALID_VALUE will be returned. - ::CU_LIMIT_MALLOC_HEAP_SIZE controls the size in bytes of the heap used by the ::malloc() and ::free() device system calls. Setting ::CU_LIMIT_MALLOC_HEAP_SIZE must be performed before launching any kernel that uses the ::malloc() or ::free() device system calls, otherwise ::CUDA_ERROR_INVALID_VALUE will be returned. - ::CU_LIMIT_DEV_RUNTIME_SYNC_DEPTH controls the maximum nesting depth of a grid at which a thread can safely call ::cudaDeviceSynchronize(). Setting this limit must be performed before any launch of a kernel that uses the device runtime and calls ::cudaDeviceSynchronize() above the default sync depth, two levels of grids. Calls to ::cudaDeviceSynchronize() will fail with error code ::cudaErrorSyncDepthExceeded if the limitation is violated. This limit can be set smaller than the default or up the maximum launch depth of 24. When setting this limit, keep in mind that additional levels of sync depth require the driver to reserve large amounts of device memory which can no longer be used for user allocations. If these reservations of device memory fail, ::cuCtxSetLimit() will return ::CUDA_ERROR_OUT_OF_MEMORY, and the limit can be reset to a lower value. This limit is only applicable to devices of compute capability < 9.0. Attempting to set this limit on devices of other compute capability versions will result in the error ::CUDA_ERROR_UNSUPPORTED_LIMIT being returned. - ::CU_LIMIT_DEV_RUNTIME_PENDING_LAUNCH_COUNT controls the maximum number of outstanding device runtime launches that can be made from the current context. A grid is outstanding from the point of launch up until the grid is known to have been completed. Device runtime launches which violate this limitation fail and return ::cudaErrorLaunchPendingCountExceeded when ::cudaGetLastError() is called after launch. If more pending launches than the default (2048 launches) are needed for a module using the device runtime, this limit can be increased. Keep in mind that being able to sustain additional pending launches will require the driver to reserve larger amounts of device memory upfront which can no longer be used for allocations. If these reservations fail, ::cuCtxSetLimit() will return ::CUDA_ERROR_OUT_OF_MEMORY, and the limit can be reset to a lower value. This limit is only applicable to devices of compute capability 3.5 and higher. Attempting to set this limit on devices of compute capability less than 3.5 will result in the error ::CUDA_ERROR_UNSUPPORTED_LIMIT being returned. - ::CU_LIMIT_MAX_L2_FETCH_GRANULARITY controls the L2 cache fetch granularity. Values can range from 0B to 128B. This is purely a performance hint and it can be ignored or clamped depending on the platform. - ::CU_LIMIT_PERSISTING_L2_CACHE_SIZE controls size in bytes available for persisting L2 cache. This is purely a performance hint and it can be ignored or clamped depending on the platform. \param limit - Limit to set \param value - Size of limit \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_UNSUPPORTED_LIMIT, ::CUDA_ERROR_OUT_OF_MEMORY, ::CUDA_ERROR_INVALID_CONTEXT \notefnerr \sa ::cuCtxCreate, ::cuCtxDestroy, ::cuCtxGetApiVersion, ::cuCtxGetCacheConfig, ::cuCtxGetDevice, ::cuCtxGetFlags, ::cuCtxGetLimit, ::cuCtxPopCurrent, ::cuCtxPushCurrent, ::cuCtxSetCacheConfig, ::cuCtxSynchronize, ::cudaDeviceSetLimit*/ fn cuCtxSetLimit( limit: cuda_types::cuda::CUlimit, value: usize, ) -> cuda_types::cuda::CUresult; /** \brief Returns resource limits Returns in \p *pvalue the current size of \p limit. The supported ::CUlimit values are: - ::CU_LIMIT_STACK_SIZE: stack size in bytes of each GPU thread. - ::CU_LIMIT_PRINTF_FIFO_SIZE: size in bytes of the FIFO used by the ::printf() device system call. - ::CU_LIMIT_MALLOC_HEAP_SIZE: size in bytes of the heap used by the ::malloc() and ::free() device system calls. - ::CU_LIMIT_DEV_RUNTIME_SYNC_DEPTH: maximum grid depth at which a thread can issue the device runtime call ::cudaDeviceSynchronize() to wait on child grid launches to complete. - ::CU_LIMIT_DEV_RUNTIME_PENDING_LAUNCH_COUNT: maximum number of outstanding device runtime launches that can be made from this context. - ::CU_LIMIT_MAX_L2_FETCH_GRANULARITY: L2 cache fetch granularity. - ::CU_LIMIT_PERSISTING_L2_CACHE_SIZE: Persisting L2 cache size in bytes \param limit - Limit to query \param pvalue - Returned size of limit \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_UNSUPPORTED_LIMIT \notefnerr \sa ::cuCtxCreate, ::cuCtxDestroy, ::cuCtxGetApiVersion, ::cuCtxGetCacheConfig, ::cuCtxGetDevice, ::cuCtxGetFlags, ::cuCtxPopCurrent, ::cuCtxPushCurrent, ::cuCtxSetCacheConfig, ::cuCtxSetLimit, ::cuCtxSynchronize, ::cudaDeviceGetLimit*/ fn cuCtxGetLimit( pvalue: *mut usize, limit: cuda_types::cuda::CUlimit, ) -> cuda_types::cuda::CUresult; /** \brief Returns the preferred cache configuration for the current context. On devices where the L1 cache and shared memory use the same hardware resources, this function returns through \p pconfig the preferred cache configuration for the current context. This is only a preference. The driver will use the requested configuration if possible, but it is free to choose a different configuration if required to execute functions. This will return a \p pconfig of ::CU_FUNC_CACHE_PREFER_NONE on devices where the size of the L1 cache and shared memory are fixed. The supported cache configurations are: - ::CU_FUNC_CACHE_PREFER_NONE: no preference for shared memory or L1 (default) - ::CU_FUNC_CACHE_PREFER_SHARED: prefer larger shared memory and smaller L1 cache - ::CU_FUNC_CACHE_PREFER_L1: prefer larger L1 cache and smaller shared memory - ::CU_FUNC_CACHE_PREFER_EQUAL: prefer equal sized L1 cache and shared memory \param pconfig - Returned cache configuration \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuCtxCreate, ::cuCtxDestroy, ::cuCtxGetApiVersion, ::cuCtxGetDevice, ::cuCtxGetFlags, ::cuCtxGetLimit, ::cuCtxPopCurrent, ::cuCtxPushCurrent, ::cuCtxSetCacheConfig, ::cuCtxSetLimit, ::cuCtxSynchronize, ::cuFuncSetCacheConfig, ::cudaDeviceGetCacheConfig*/ fn cuCtxGetCacheConfig( pconfig: *mut cuda_types::cuda::CUfunc_cache, ) -> cuda_types::cuda::CUresult; /** \brief Sets the preferred cache configuration for the current context. On devices where the L1 cache and shared memory use the same hardware resources, this sets through \p config the preferred cache configuration for the current context. This is only a preference. The driver will use the requested configuration if possible, but it is free to choose a different configuration if required to execute the function. Any function preference set via ::cuFuncSetCacheConfig() or ::cuKernelSetCacheConfig() will be preferred over this context-wide setting. Setting the context-wide cache configuration to ::CU_FUNC_CACHE_PREFER_NONE will cause subsequent kernel launches to prefer to not change the cache configuration unless required to launch the kernel. This setting does nothing on devices where the size of the L1 cache and shared memory are fixed. Launching a kernel with a different preference than the most recent preference setting may insert a device-side synchronization point. The supported cache configurations are: - ::CU_FUNC_CACHE_PREFER_NONE: no preference for shared memory or L1 (default) - ::CU_FUNC_CACHE_PREFER_SHARED: prefer larger shared memory and smaller L1 cache - ::CU_FUNC_CACHE_PREFER_L1: prefer larger L1 cache and smaller shared memory - ::CU_FUNC_CACHE_PREFER_EQUAL: prefer equal sized L1 cache and shared memory \param config - Requested cache configuration \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuCtxCreate, ::cuCtxDestroy, ::cuCtxGetApiVersion, ::cuCtxGetCacheConfig, ::cuCtxGetDevice, ::cuCtxGetFlags, ::cuCtxGetLimit, ::cuCtxPopCurrent, ::cuCtxPushCurrent, ::cuCtxSetLimit, ::cuCtxSynchronize, ::cuFuncSetCacheConfig, ::cudaDeviceSetCacheConfig, ::cuKernelSetCacheConfig*/ fn cuCtxSetCacheConfig( config: cuda_types::cuda::CUfunc_cache, ) -> cuda_types::cuda::CUresult; /** \brief Gets the context's API version. Returns a version number in \p version corresponding to the capabilities of the context (e.g. 3010 or 3020), which library developers can use to direct callers to a specific API version. If \p ctx is NULL, returns the API version used to create the currently bound context. Note that new API versions are only introduced when context capabilities are changed that break binary compatibility, so the API version and driver version may be different. For example, it is valid for the API version to be 3020 while the driver version is 4020. \param ctx - Context to check \param version - Pointer to version \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_UNKNOWN \notefnerr \sa ::cuCtxCreate, ::cuCtxDestroy, ::cuCtxGetDevice, ::cuCtxGetFlags, ::cuCtxGetLimit, ::cuCtxPopCurrent, ::cuCtxPushCurrent, ::cuCtxSetCacheConfig, ::cuCtxSetLimit, ::cuCtxSynchronize*/ fn cuCtxGetApiVersion( ctx: cuda_types::cuda::CUcontext, version: *mut ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Returns numerical values that correspond to the least and greatest stream priorities. Returns in \p *leastPriority and \p *greatestPriority the numerical values that correspond to the least and greatest stream priorities respectively. Stream priorities follow a convention where lower numbers imply greater priorities. The range of meaningful stream priorities is given by [\p *greatestPriority, \p *leastPriority]. If the user attempts to create a stream with a priority value that is outside the meaningful range as specified by this API, the priority is automatically clamped down or up to either \p *leastPriority or \p *greatestPriority respectively. See ::cuStreamCreateWithPriority for details on creating a priority stream. A NULL may be passed in for \p *leastPriority or \p *greatestPriority if the value is not desired. This function will return '0' in both \p *leastPriority and \p *greatestPriority if the current context's device does not support stream priorities (see ::cuDeviceGetAttribute). \param leastPriority - Pointer to an int in which the numerical value for least stream priority is returned \param greatestPriority - Pointer to an int in which the numerical value for greatest stream priority is returned \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, \notefnerr \sa ::cuStreamCreateWithPriority, ::cuStreamGetPriority, ::cuCtxGetDevice, ::cuCtxGetFlags, ::cuCtxSetLimit, ::cuCtxSynchronize, ::cudaDeviceGetStreamPriorityRange*/ fn cuCtxGetStreamPriorityRange( leastPriority: *mut ::core::ffi::c_int, greatestPriority: *mut ::core::ffi::c_int, ) -> cuda_types::cuda::CUresult; /** \brief Resets all persisting lines in cache to normal status. ::cuCtxResetPersistingL2Cache Resets all persisting lines in cache to normal status. Takes effect on function return. \return ::CUDA_SUCCESS, ::CUDA_ERROR_NOT_SUPPORTED \notefnerr \sa ::CUaccessPolicyWindow*/ fn cuCtxResetPersistingL2Cache() -> cuda_types::cuda::CUresult; /** \brief Returns the execution affinity setting for the current context. Returns in \p *pExecAffinity the current value of \p type. The supported ::CUexecAffinityType values are: - ::CU_EXEC_AFFINITY_TYPE_SM_COUNT: number of SMs the context is limited to use. \param type - Execution affinity type to query \param pExecAffinity - Returned execution affinity \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_UNSUPPORTED_EXEC_AFFINITY \notefnerr \sa ::CUexecAffinityParam*/ fn cuCtxGetExecAffinity( pExecAffinity: *mut cuda_types::cuda::CUexecAffinityParam, type_: cuda_types::cuda::CUexecAffinityType, ) -> cuda_types::cuda::CUresult; /** \brief Records an event. Captures in \p hEvent all the activities of the context \p hCtx at the time of this call. \p hEvent and \p hCtx must be from the same CUDA context, otherwise ::CUDA_ERROR_INVALID_HANDLE will be returned. Calls such as ::cuEventQuery() or ::cuCtxWaitEvent() will then examine or wait for completion of the work that was captured. Uses of \p hCtx after this call do not modify \p hEvent. If the context passed to \p hCtx is the primary context, \p hEvent will capture all the activities of the primary context and its green contexts. If the context passed to \p hCtx is a context converted from green context via ::cuCtxFromGreenCtx(), \p hEvent will capture only the activities of the green context. \note The API will return ::CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED if the specified context \p hCtx has a stream in the capture mode. In such a case, the call will invalidate all the conflicting captures. \param hCtx - Context to record event for \param hEvent - Event to record \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED \sa ::cuCtxWaitEvent, ::cuGreenCtxRecordEvent, ::cuGreenCtxWaitEvent, ::cuEventRecord*/ fn cuCtxRecordEvent( hCtx: cuda_types::cuda::CUcontext, hEvent: cuda_types::cuda::CUevent, ) -> cuda_types::cuda::CUresult; /** \brief Make a context wait on an event Makes all future work submitted to context \p hCtx wait for all work captured in \p hEvent. The synchronization will be performed on the device and will not block the calling CPU thread. See ::cuCtxRecordEvent() for details on what is captured by an event. If the context passed to \p hCtx is the primary context, the primary context and its green contexts will wait for \p hEvent. If the context passed to \p hCtx is a context converted from green context via ::cuCtxFromGreenCtx(), the green context will wait for \p hEvent. \note \p hEvent may be from a different context or device than \p hCtx. \note The API will return ::CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED and invalidate the capture if the specified event \p hEvent is part of an ongoing capture sequence or if the specified context \p hCtx has a stream in the capture mode. \param hCtx - Context to wait \param hEvent - Event to wait on \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED \sa ::cuCtxRecordEvent, ::cuGreenCtxRecordEvent, ::cuGreenCtxWaitEvent, ::cuStreamWaitEvent*/ fn cuCtxWaitEvent( hCtx: cuda_types::cuda::CUcontext, hEvent: cuda_types::cuda::CUevent, ) -> cuda_types::cuda::CUresult; /** \brief Increment a context's usage-count \deprecated Note that this function is deprecated and should not be used. Increments the usage count of the context and passes back a context handle in \p *pctx that must be passed to ::cuCtxDetach() when the application is done with the context. ::cuCtxAttach() fails if there is no context current to the thread. Currently, the \p flags parameter must be 0. \param pctx - Returned context handle of the current context \param flags - Context attach flags (must be 0) \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuCtxCreate, ::cuCtxDestroy, ::cuCtxDetach, ::cuCtxGetApiVersion, ::cuCtxGetCacheConfig, ::cuCtxGetDevice, ::cuCtxGetFlags, ::cuCtxGetLimit, ::cuCtxPopCurrent, ::cuCtxPushCurrent, ::cuCtxSetCacheConfig, ::cuCtxSetLimit, ::cuCtxSynchronize*/ fn cuCtxAttach( pctx: *mut cuda_types::cuda::CUcontext, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Decrement a context's usage-count \deprecated Note that this function is deprecated and should not be used. Decrements the usage count of the context \p ctx, and destroys the context if the usage count goes to 0. The context must be a handle that was passed back by ::cuCtxCreate() or ::cuCtxAttach(), and must be current to the calling thread. \param ctx - Context to destroy \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT \notefnerr \sa ::cuCtxCreate, ::cuCtxDestroy, ::cuCtxGetApiVersion, ::cuCtxGetCacheConfig, ::cuCtxGetDevice, ::cuCtxGetFlags, ::cuCtxGetLimit, ::cuCtxPopCurrent, ::cuCtxPushCurrent, ::cuCtxSetCacheConfig, ::cuCtxSetLimit, ::cuCtxSynchronize*/ fn cuCtxDetach(ctx: cuda_types::cuda::CUcontext) -> cuda_types::cuda::CUresult; /** \brief Returns the current shared memory configuration for the current context. \deprecated This function will return in \p pConfig the current size of shared memory banks in the current context. On devices with configurable shared memory banks, ::cuCtxSetSharedMemConfig can be used to change this setting, so that all subsequent kernel launches will by default use the new bank size. When ::cuCtxGetSharedMemConfig is called on devices without configurable shared memory, it will return the fixed bank size of the hardware. The returned bank configurations can be either: - ::CU_SHARED_MEM_CONFIG_FOUR_BYTE_BANK_SIZE: shared memory bank width is four bytes. - ::CU_SHARED_MEM_CONFIG_EIGHT_BYTE_BANK_SIZE: shared memory bank width will eight bytes. \param pConfig - returned shared memory configuration \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuCtxCreate, ::cuCtxDestroy, ::cuCtxGetApiVersion, ::cuCtxGetCacheConfig, ::cuCtxGetDevice, ::cuCtxGetFlags, ::cuCtxGetLimit, ::cuCtxPopCurrent, ::cuCtxPushCurrent, ::cuCtxSetLimit, ::cuCtxSynchronize, ::cuCtxGetSharedMemConfig, ::cuFuncSetCacheConfig, ::cudaDeviceGetSharedMemConfig*/ fn cuCtxGetSharedMemConfig( pConfig: *mut cuda_types::cuda::CUsharedconfig, ) -> cuda_types::cuda::CUresult; /** \brief Sets the shared memory configuration for the current context. \deprecated On devices with configurable shared memory banks, this function will set the context's shared memory bank size which is used for subsequent kernel launches. Changed the shared memory configuration between launches may insert a device side synchronization point between those launches. Changing the shared memory bank size will not increase shared memory usage or affect occupancy of kernels, but may have major effects on performance. Larger bank sizes will allow for greater potential bandwidth to shared memory, but will change what kinds of accesses to shared memory will result in bank conflicts. This function will do nothing on devices with fixed shared memory bank size. The supported bank configurations are: - ::CU_SHARED_MEM_CONFIG_DEFAULT_BANK_SIZE: set bank width to the default initial setting (currently, four bytes). - ::CU_SHARED_MEM_CONFIG_FOUR_BYTE_BANK_SIZE: set shared memory bank width to be natively four bytes. - ::CU_SHARED_MEM_CONFIG_EIGHT_BYTE_BANK_SIZE: set shared memory bank width to be natively eight bytes. \param config - requested shared memory configuration \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuCtxCreate, ::cuCtxDestroy, ::cuCtxGetApiVersion, ::cuCtxGetCacheConfig, ::cuCtxGetDevice, ::cuCtxGetFlags, ::cuCtxGetLimit, ::cuCtxPopCurrent, ::cuCtxPushCurrent, ::cuCtxSetLimit, ::cuCtxSynchronize, ::cuCtxGetSharedMemConfig, ::cuFuncSetCacheConfig, ::cudaDeviceSetSharedMemConfig*/ fn cuCtxSetSharedMemConfig( config: cuda_types::cuda::CUsharedconfig, ) -> cuda_types::cuda::CUresult; /** \brief Loads a compute module Takes a filename \p fname and loads the corresponding module \p module into the current context. The CUDA driver API does not attempt to lazily allocate the resources needed by a module; if the memory for functions and data (constant and global) needed by the module cannot be allocated, ::cuModuleLoad() fails. The file should be a \e cubin file as output by \b nvcc, or a \e PTX file either as output by \b nvcc or handwritten, or a \e fatbin file as output by \b nvcc from toolchain 4.0 or later. \param module - Returned module \param fname - Filename of module to load \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_PTX, ::CUDA_ERROR_UNSUPPORTED_PTX_VERSION, ::CUDA_ERROR_NOT_FOUND, ::CUDA_ERROR_OUT_OF_MEMORY, ::CUDA_ERROR_FILE_NOT_FOUND, ::CUDA_ERROR_NO_BINARY_FOR_GPU, ::CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND, ::CUDA_ERROR_SHARED_OBJECT_INIT_FAILED, ::CUDA_ERROR_JIT_COMPILER_NOT_FOUND \notefnerr \sa ::cuModuleGetFunction, ::cuModuleGetGlobal, ::cuModuleGetTexRef, ::cuModuleLoadData, ::cuModuleLoadDataEx, ::cuModuleLoadFatBinary, ::cuModuleUnload*/ fn cuModuleLoad( module: *mut cuda_types::cuda::CUmodule, fname: *const ::core::ffi::c_char, ) -> cuda_types::cuda::CUresult; /** \brief Load a module's data Takes a pointer \p image and loads the corresponding module \p module into the current context. The \p image may be a \e cubin or \e fatbin as output by \b nvcc, or a NULL-terminated \e PTX, either as output by \b nvcc or hand-written. \param module - Returned module \param image - Module data to load \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_PTX, ::CUDA_ERROR_UNSUPPORTED_PTX_VERSION, ::CUDA_ERROR_OUT_OF_MEMORY, ::CUDA_ERROR_NO_BINARY_FOR_GPU, ::CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND, ::CUDA_ERROR_SHARED_OBJECT_INIT_FAILED, ::CUDA_ERROR_JIT_COMPILER_NOT_FOUND \notefnerr \sa ::cuModuleGetFunction, ::cuModuleGetGlobal, ::cuModuleGetTexRef, ::cuModuleLoad, ::cuModuleLoadDataEx, ::cuModuleLoadFatBinary, ::cuModuleUnload*/ fn cuModuleLoadData( module: *mut cuda_types::cuda::CUmodule, image: *const ::core::ffi::c_void, ) -> cuda_types::cuda::CUresult; /** \brief Load a module's data with options Takes a pointer \p image and loads the corresponding module \p module into the current context. The \p image may be a \e cubin or \e fatbin as output by \b nvcc, or a NULL-terminated \e PTX, either as output by \b nvcc or hand-written. \param module - Returned module \param image - Module data to load \param numOptions - Number of options \param options - Options for JIT \param optionValues - Option values for JIT \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_PTX, ::CUDA_ERROR_UNSUPPORTED_PTX_VERSION, ::CUDA_ERROR_OUT_OF_MEMORY, ::CUDA_ERROR_NO_BINARY_FOR_GPU, ::CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND, ::CUDA_ERROR_SHARED_OBJECT_INIT_FAILED, ::CUDA_ERROR_JIT_COMPILER_NOT_FOUND \notefnerr \sa ::cuModuleGetFunction, ::cuModuleGetGlobal, ::cuModuleGetTexRef, ::cuModuleLoad, ::cuModuleLoadData, ::cuModuleLoadFatBinary, ::cuModuleUnload*/ fn cuModuleLoadDataEx( module: *mut cuda_types::cuda::CUmodule, image: *const ::core::ffi::c_void, numOptions: ::core::ffi::c_uint, options: *mut cuda_types::cuda::CUjit_option, optionValues: *mut *mut ::core::ffi::c_void, ) -> cuda_types::cuda::CUresult; /** \brief Load a module's data Takes a pointer \p fatCubin and loads the corresponding module \p module into the current context. The pointer represents a fat binary object, which is a collection of different \e cubin and/or \e PTX files, all representing the same device code, but compiled and optimized for different architectures. Prior to CUDA 4.0, there was no documented API for constructing and using fat binary objects by programmers. Starting with CUDA 4.0, fat binary objects can be constructed by providing the -fatbin option to \b nvcc. More information can be found in the \b nvcc document. \param module - Returned module \param fatCubin - Fat binary to load \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_PTX, ::CUDA_ERROR_UNSUPPORTED_PTX_VERSION, ::CUDA_ERROR_NOT_FOUND, ::CUDA_ERROR_OUT_OF_MEMORY, ::CUDA_ERROR_NO_BINARY_FOR_GPU, ::CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND, ::CUDA_ERROR_SHARED_OBJECT_INIT_FAILED, ::CUDA_ERROR_JIT_COMPILER_NOT_FOUND \notefnerr \sa ::cuModuleGetFunction, ::cuModuleGetGlobal, ::cuModuleGetTexRef, ::cuModuleLoad, ::cuModuleLoadData, ::cuModuleLoadDataEx, ::cuModuleUnload*/ fn cuModuleLoadFatBinary( module: *mut cuda_types::cuda::CUmodule, fatCubin: *const ::core::ffi::c_void, ) -> cuda_types::cuda::CUresult; /** \brief Unloads a module Unloads a module \p hmod from the current context. Attempting to unload a module which was obtained from the Library Management API such as ::cuLibraryGetModule will return ::CUDA_ERROR_NOT_PERMITTED. \param hmod - Module to unload \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_PERMITTED \notefnerr \note_destroy_ub \sa ::cuModuleGetFunction, ::cuModuleGetGlobal, ::cuModuleGetTexRef, ::cuModuleLoad, ::cuModuleLoadData, ::cuModuleLoadDataEx, ::cuModuleLoadFatBinary*/ fn cuModuleUnload(hmod: cuda_types::cuda::CUmodule) -> cuda_types::cuda::CUresult; /** \brief Query lazy loading mode Returns lazy loading mode Module loading mode is controlled by CUDA_MODULE_LOADING env variable \param mode - Returns the lazy loading mode \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, \notefnerr \sa ::cuModuleLoad,*/ fn cuModuleGetLoadingMode( mode: *mut cuda_types::cuda::CUmoduleLoadingMode, ) -> cuda_types::cuda::CUresult; /** \brief Returns a function handle Returns in \p *hfunc the handle of the function of name \p name located in module \p hmod. If no function of that name exists, ::cuModuleGetFunction() returns ::CUDA_ERROR_NOT_FOUND. \param hfunc - Returned function handle \param hmod - Module to retrieve function from \param name - Name of function to retrieve \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_FOUND \notefnerr \sa ::cuModuleGetGlobal, ::cuModuleGetTexRef, ::cuModuleLoad, ::cuModuleLoadData, ::cuModuleLoadDataEx, ::cuModuleLoadFatBinary, ::cuModuleUnload*/ fn cuModuleGetFunction( hfunc: *mut cuda_types::cuda::CUfunction, hmod: cuda_types::cuda::CUmodule, name: *const ::core::ffi::c_char, ) -> cuda_types::cuda::CUresult; /** \brief Returns the number of functions within a module Returns in \p count the number of functions in \p mod. \param count - Number of functions found within the module \param mod - Module to query \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_INVALID_VALUE*/ fn cuModuleGetFunctionCount( count: *mut ::core::ffi::c_uint, mod_: cuda_types::cuda::CUmodule, ) -> cuda_types::cuda::CUresult; /** \brief Returns the function handles within a module. Returns in \p functions a maximum number of \p numFunctions function handles within \p mod. When function loading mode is set to LAZY the function retrieved may be partially loaded. The loading state of a function can be queried using ::cuFunctionIsLoaded. CUDA APIs may load the function automatically when called with partially loaded function handle which may incur additional latency. Alternatively, ::cuFunctionLoad can be used to explicitly load a function. The returned function handles become invalid when the module is unloaded. \param functions - Buffer where the function handles are returned to \param numFunctions - Maximum number of function handles may be returned to the buffer \param mod - Module to query from \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_INVALID_VALUE \sa ::cuModuleGetFunction, ::cuModuleGetFunctionCount, ::cuFuncIsLoaded, ::cuFuncLoad*/ fn cuModuleEnumerateFunctions( functions: *mut cuda_types::cuda::CUfunction, numFunctions: ::core::ffi::c_uint, mod_: cuda_types::cuda::CUmodule, ) -> cuda_types::cuda::CUresult; /** \brief Returns a global pointer from a module Returns in \p *dptr and \p *bytes the base pointer and size of the global of name \p name located in module \p hmod. If no variable of that name exists, ::cuModuleGetGlobal() returns ::CUDA_ERROR_NOT_FOUND. One of the parameters \p dptr or \p bytes (not both) can be NULL in which case it is ignored. \param dptr - Returned global device pointer \param bytes - Returned global size in bytes \param hmod - Module to retrieve global from \param name - Name of global to retrieve \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_FOUND \notefnerr \sa ::cuModuleGetFunction, ::cuModuleGetTexRef, ::cuModuleLoad, ::cuModuleLoadData, ::cuModuleLoadDataEx, ::cuModuleLoadFatBinary, ::cuModuleUnload, ::cudaGetSymbolAddress, ::cudaGetSymbolSize*/ fn cuModuleGetGlobal_v2( dptr: *mut cuda_types::cuda::CUdeviceptr, bytes: *mut usize, hmod: cuda_types::cuda::CUmodule, name: *const ::core::ffi::c_char, ) -> cuda_types::cuda::CUresult; /** \brief Creates a pending JIT linker invocation. If the call is successful, the caller owns the returned CUlinkState, which should eventually be destroyed with ::cuLinkDestroy. The device code machine size (32 or 64 bit) will match the calling application. Both linker and compiler options may be specified. Compiler options will be applied to inputs to this linker action which must be compiled from PTX. The options ::CU_JIT_WALL_TIME, ::CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES, and ::CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES will accumulate data until the CUlinkState is destroyed. The data passed in via ::cuLinkAddData and ::cuLinkAddFile will be treated as relocatable (-rdc=true to nvcc) when linking the final cubin during ::cuLinkComplete and will have similar consequences as offline relocatable device code linking. \p optionValues must remain valid for the life of the CUlinkState if output options are used. No other references to inputs are maintained after this call returns. \note For LTO-IR input, only LTO-IR compiled with toolkits prior to CUDA 12.0 will be accepted \param numOptions Size of options arrays \param options Array of linker and compiler options \param optionValues Array of option values, each cast to void * \param stateOut On success, this will contain a CUlinkState to specify and complete this action \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_OUT_OF_MEMORY, ::CUDA_ERROR_JIT_COMPILER_NOT_FOUND \notefnerr \sa ::cuLinkAddData, ::cuLinkAddFile, ::cuLinkComplete, ::cuLinkDestroy*/ fn cuLinkCreate_v2( numOptions: ::core::ffi::c_uint, options: *mut cuda_types::cuda::CUjit_option, optionValues: *mut *mut ::core::ffi::c_void, stateOut: *mut cuda_types::cuda::CUlinkState, ) -> cuda_types::cuda::CUresult; /** \brief Add an input to a pending linker invocation Ownership of \p data is retained by the caller. No reference is retained to any inputs after this call returns. This method accepts only compiler options, which are used if the data must be compiled from PTX, and does not accept any of ::CU_JIT_WALL_TIME, ::CU_JIT_INFO_LOG_BUFFER, ::CU_JIT_ERROR_LOG_BUFFER, ::CU_JIT_TARGET_FROM_CUCONTEXT, or ::CU_JIT_TARGET. \note For LTO-IR input, only LTO-IR compiled with toolkits prior to CUDA 12.0 will be accepted \param state A pending linker action. \param type The type of the input data. \param data The input data. PTX must be NULL-terminated. \param size The length of the input data. \param name An optional name for this input in log messages. \param numOptions Size of options. \param options Options to be applied only for this input (overrides options from ::cuLinkCreate). \param optionValues Array of option values, each cast to void *. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_IMAGE, ::CUDA_ERROR_INVALID_PTX, ::CUDA_ERROR_UNSUPPORTED_PTX_VERSION, ::CUDA_ERROR_OUT_OF_MEMORY, ::CUDA_ERROR_NO_BINARY_FOR_GPU \sa ::cuLinkCreate, ::cuLinkAddFile, ::cuLinkComplete, ::cuLinkDestroy*/ fn cuLinkAddData_v2( state: cuda_types::cuda::CUlinkState, type_: cuda_types::cuda::CUjitInputType, data: *mut ::core::ffi::c_void, size: usize, name: *const ::core::ffi::c_char, numOptions: ::core::ffi::c_uint, options: *mut cuda_types::cuda::CUjit_option, optionValues: *mut *mut ::core::ffi::c_void, ) -> cuda_types::cuda::CUresult; /** \brief Add a file input to a pending linker invocation No reference is retained to any inputs after this call returns. This method accepts only compiler options, which are used if the input must be compiled from PTX, and does not accept any of ::CU_JIT_WALL_TIME, ::CU_JIT_INFO_LOG_BUFFER, ::CU_JIT_ERROR_LOG_BUFFER, ::CU_JIT_TARGET_FROM_CUCONTEXT, or ::CU_JIT_TARGET. This method is equivalent to invoking ::cuLinkAddData on the contents of the file. \note For LTO-IR input, only LTO-IR compiled with toolkits prior to CUDA 12.0 will be accepted \param state A pending linker action \param type The type of the input data \param path Path to the input file \param numOptions Size of options \param options Options to be applied only for this input (overrides options from ::cuLinkCreate) \param optionValues Array of option values, each cast to void * \return ::CUDA_SUCCESS, ::CUDA_ERROR_FILE_NOT_FOUND ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_IMAGE, ::CUDA_ERROR_INVALID_PTX, ::CUDA_ERROR_UNSUPPORTED_PTX_VERSION, ::CUDA_ERROR_OUT_OF_MEMORY, ::CUDA_ERROR_NO_BINARY_FOR_GPU \sa ::cuLinkCreate, ::cuLinkAddData, ::cuLinkComplete, ::cuLinkDestroy*/ fn cuLinkAddFile_v2( state: cuda_types::cuda::CUlinkState, type_: cuda_types::cuda::CUjitInputType, path: *const ::core::ffi::c_char, numOptions: ::core::ffi::c_uint, options: *mut cuda_types::cuda::CUjit_option, optionValues: *mut *mut ::core::ffi::c_void, ) -> cuda_types::cuda::CUresult; /** \brief Complete a pending linker invocation Completes the pending linker action and returns the cubin image for the linked device code, which can be used with ::cuModuleLoadData. The cubin is owned by \p state, so it should be loaded before \p state is destroyed via ::cuLinkDestroy. This call does not destroy \p state. \param state A pending linker invocation \param cubinOut On success, this will point to the output image \param sizeOut Optional parameter to receive the size of the generated image \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_OUT_OF_MEMORY \sa ::cuLinkCreate, ::cuLinkAddData, ::cuLinkAddFile, ::cuLinkDestroy, ::cuModuleLoadData*/ fn cuLinkComplete( state: cuda_types::cuda::CUlinkState, cubinOut: *mut *mut ::core::ffi::c_void, sizeOut: *mut usize, ) -> cuda_types::cuda::CUresult; /** \brief Destroys state for a JIT linker invocation. \param state State object for the linker invocation \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_HANDLE \sa ::cuLinkCreate*/ fn cuLinkDestroy(state: cuda_types::cuda::CUlinkState) -> cuda_types::cuda::CUresult; /** \brief Returns a handle to a texture reference \deprecated Returns in \p *pTexRef the handle of the texture reference of name \p name in the module \p hmod. If no texture reference of that name exists, ::cuModuleGetTexRef() returns ::CUDA_ERROR_NOT_FOUND. This texture reference handle should not be destroyed, since it will be destroyed when the module is unloaded. \param pTexRef - Returned texture reference \param hmod - Module to retrieve texture reference from \param name - Name of texture reference to retrieve \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_FOUND \notefnerr \sa ::cuModuleGetFunction, ::cuModuleGetGlobal, ::cuModuleGetSurfRef, ::cuModuleLoad, ::cuModuleLoadData, ::cuModuleLoadDataEx, ::cuModuleLoadFatBinary, ::cuModuleUnload*/ fn cuModuleGetTexRef( pTexRef: *mut cuda_types::cuda::CUtexref, hmod: cuda_types::cuda::CUmodule, name: *const ::core::ffi::c_char, ) -> cuda_types::cuda::CUresult; /** \brief Returns a handle to a surface reference \deprecated Returns in \p *pSurfRef the handle of the surface reference of name \p name in the module \p hmod. If no surface reference of that name exists, ::cuModuleGetSurfRef() returns ::CUDA_ERROR_NOT_FOUND. \param pSurfRef - Returned surface reference \param hmod - Module to retrieve surface reference from \param name - Name of surface reference to retrieve \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_FOUND \notefnerr \sa ::cuModuleGetFunction, ::cuModuleGetGlobal, ::cuModuleGetTexRef, ::cuModuleLoad, ::cuModuleLoadData, ::cuModuleLoadDataEx, ::cuModuleLoadFatBinary, ::cuModuleUnload*/ fn cuModuleGetSurfRef( pSurfRef: *mut cuda_types::cuda::CUsurfref, hmod: cuda_types::cuda::CUmodule, name: *const ::core::ffi::c_char, ) -> cuda_types::cuda::CUresult; /** \brief Load a library with specified code and options Takes a pointer \p code and loads the corresponding library \p library based on the application defined library loading mode: - If module loading is set to EAGER, via the environment variables described in "Module loading", \p library is loaded eagerly into all contexts at the time of the call and future contexts at the time of creation until the library is unloaded with ::cuLibraryUnload(). - If the environment variables are set to LAZY, \p library is not immediately loaded onto all existent contexts and will only be loaded when a function is needed for that context, such as a kernel launch. These environment variables are described in the CUDA programming guide under the "CUDA environment variables" section. The \p code may be a \e cubin or \e fatbin as output by \b nvcc, or a NULL-terminated \e PTX, either as output by \b nvcc or hand-written. A fatbin should also contain relocatable code when doing separate compilation. Options are passed as an array via \p jitOptions and any corresponding parameters are passed in \p jitOptionsValues. The number of total JIT options is supplied via \p numJitOptions. Any outputs will be returned via \p jitOptionsValues. Library load options are passed as an array via \p libraryOptions and any corresponding parameters are passed in \p libraryOptionValues. The number of total library load options is supplied via \p numLibraryOptions. \note If the library contains managed variables and no device in the system supports managed variables this call is expected to return ::CUDA_ERROR_NOT_SUPPORTED \param library - Returned library \param code - Code to load \param jitOptions - Options for JIT \param jitOptionsValues - Option values for JIT \param numJitOptions - Number of options \param libraryOptions - Options for loading \param libraryOptionValues - Option values for loading \param numLibraryOptions - Number of options for loading \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_PTX, ::CUDA_ERROR_UNSUPPORTED_PTX_VERSION, ::CUDA_ERROR_OUT_OF_MEMORY, ::CUDA_ERROR_NO_BINARY_FOR_GPU, ::CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND, ::CUDA_ERROR_SHARED_OBJECT_INIT_FAILED, ::CUDA_ERROR_JIT_COMPILER_NOT_FOUND, ::CUDA_ERROR_NOT_SUPPORTED \sa ::cuLibraryLoadFromFile, ::cuLibraryUnload, ::cuModuleLoad, ::cuModuleLoadData, ::cuModuleLoadDataEx*/ fn cuLibraryLoadData( library: *mut cuda_types::cuda::CUlibrary, code: *const ::core::ffi::c_void, jitOptions: *mut cuda_types::cuda::CUjit_option, jitOptionsValues: *mut *mut ::core::ffi::c_void, numJitOptions: ::core::ffi::c_uint, libraryOptions: *mut cuda_types::cuda::CUlibraryOption, libraryOptionValues: *mut *mut ::core::ffi::c_void, numLibraryOptions: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Load a library with specified file and options Takes a pointer \p code and loads the corresponding library \p library based on the application defined library loading mode: - If module loading is set to EAGER, via the environment variables described in "Module loading", \p library is loaded eagerly into all contexts at the time of the call and future contexts at the time of creation until the library is unloaded with ::cuLibraryUnload(). - If the environment variables are set to LAZY, \p library is not immediately loaded onto all existent contexts and will only be loaded when a function is needed for that context, such as a kernel launch. These environment variables are described in the CUDA programming guide under the "CUDA environment variables" section. The file should be a \e cubin file as output by \b nvcc, or a \e PTX file either as output by \b nvcc or handwritten, or a \e fatbin file as output by \b nvcc. A fatbin should also contain relocatable code when doing separate compilation. Options are passed as an array via \p jitOptions and any corresponding parameters are passed in \p jitOptionsValues. The number of total options is supplied via \p numJitOptions. Any outputs will be returned via \p jitOptionsValues. Library load options are passed as an array via \p libraryOptions and any corresponding parameters are passed in \p libraryOptionValues. The number of total library load options is supplied via \p numLibraryOptions. \note If the library contains managed variables and no device in the system supports managed variables this call is expected to return ::CUDA_ERROR_NOT_SUPPORTED \param library - Returned library \param fileName - File to load from \param jitOptions - Options for JIT \param jitOptionsValues - Option values for JIT \param numJitOptions - Number of options \param libraryOptions - Options for loading \param libraryOptionValues - Option values for loading \param numLibraryOptions - Number of options for loading \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_PTX, ::CUDA_ERROR_UNSUPPORTED_PTX_VERSION, ::CUDA_ERROR_OUT_OF_MEMORY, ::CUDA_ERROR_NO_BINARY_FOR_GPU, ::CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND, ::CUDA_ERROR_SHARED_OBJECT_INIT_FAILED, ::CUDA_ERROR_JIT_COMPILER_NOT_FOUND, ::CUDA_ERROR_NOT_SUPPORTED \sa ::cuLibraryLoadData, ::cuLibraryUnload, ::cuModuleLoad, ::cuModuleLoadData, ::cuModuleLoadDataEx*/ fn cuLibraryLoadFromFile( library: *mut cuda_types::cuda::CUlibrary, fileName: *const ::core::ffi::c_char, jitOptions: *mut cuda_types::cuda::CUjit_option, jitOptionsValues: *mut *mut ::core::ffi::c_void, numJitOptions: ::core::ffi::c_uint, libraryOptions: *mut cuda_types::cuda::CUlibraryOption, libraryOptionValues: *mut *mut ::core::ffi::c_void, numLibraryOptions: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Unloads a library Unloads the library specified with \p library \param library - Library to unload \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \sa ::cuLibraryLoadData, ::cuLibraryLoadFromFile, ::cuModuleUnload*/ fn cuLibraryUnload( library: cuda_types::cuda::CUlibrary, ) -> cuda_types::cuda::CUresult; /** \brief Returns a kernel handle Returns in \p pKernel the handle of the kernel with name \p name located in library \p library. If kernel handle is not found, the call returns ::CUDA_ERROR_NOT_FOUND. \param pKernel - Returned kernel handle \param library - Library to retrieve kernel from \param name - Name of kernel to retrieve \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_NOT_FOUND \sa ::cuLibraryLoadData, ::cuLibraryLoadFromFile, ::cuLibraryUnload, ::cuKernelGetFunction, ::cuLibraryGetModule, ::cuModuleGetFunction*/ fn cuLibraryGetKernel( pKernel: *mut cuda_types::cuda::CUkernel, library: cuda_types::cuda::CUlibrary, name: *const ::core::ffi::c_char, ) -> cuda_types::cuda::CUresult; /** \brief Returns the number of kernels within a library Returns in \p count the number of kernels in \p lib. \param count - Number of kernels found within the library \param lib - Library to query \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_INVALID_VALUE*/ fn cuLibraryGetKernelCount( count: *mut ::core::ffi::c_uint, lib: cuda_types::cuda::CUlibrary, ) -> cuda_types::cuda::CUresult; /** \brief Retrieve the kernel handles within a library. Returns in \p kernels a maximum number of \p numKernels kernel handles within \p lib. The returned kernel handle becomes invalid when the library is unloaded. \param kernels - Buffer where the kernel handles are returned to \param numKernels - Maximum number of kernel handles may be returned to the buffer \param lib - Library to query from \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_INVALID_VALUE \sa ::cuLibraryGetKernelCount*/ fn cuLibraryEnumerateKernels( kernels: *mut cuda_types::cuda::CUkernel, numKernels: ::core::ffi::c_uint, lib: cuda_types::cuda::CUlibrary, ) -> cuda_types::cuda::CUresult; /** \brief Returns a module handle Returns in \p pMod the module handle associated with the current context located in library \p library. If module handle is not found, the call returns ::CUDA_ERROR_NOT_FOUND. \param pMod - Returned module handle \param library - Library to retrieve module from \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_NOT_FOUND, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_CONTEXT_IS_DESTROYED \sa ::cuLibraryLoadData, ::cuLibraryLoadFromFile, ::cuLibraryUnload, ::cuModuleGetFunction*/ fn cuLibraryGetModule( pMod: *mut cuda_types::cuda::CUmodule, library: cuda_types::cuda::CUlibrary, ) -> cuda_types::cuda::CUresult; /** \brief Returns a function handle Returns in \p pFunc the handle of the function for the requested kernel \p kernel and the current context. If function handle is not found, the call returns ::CUDA_ERROR_NOT_FOUND. \param pFunc - Returned function handle \param kernel - Kernel to retrieve function for the requested context \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_NOT_FOUND, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_CONTEXT_IS_DESTROYED \sa ::cuLibraryLoadData, ::cuLibraryLoadFromFile, ::cuLibraryUnload, ::cuLibraryGetKernel, ::cuLibraryGetModule, ::cuModuleGetFunction*/ fn cuKernelGetFunction( pFunc: *mut cuda_types::cuda::CUfunction, kernel: cuda_types::cuda::CUkernel, ) -> cuda_types::cuda::CUresult; /** \brief Returns a library handle Returns in \p pLib the handle of the library for the requested kernel \p kernel \param pLib - Returned library handle \param kernel - Kernel to retrieve library handle \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_NOT_FOUND \sa ::cuLibraryLoadData, ::cuLibraryLoadFromFile, ::cuLibraryUnload, ::cuLibraryGetKernel*/ fn cuKernelGetLibrary( pLib: *mut cuda_types::cuda::CUlibrary, kernel: cuda_types::cuda::CUkernel, ) -> cuda_types::cuda::CUresult; /** \brief Returns a global device pointer Returns in \p *dptr and \p *bytes the base pointer and size of the global with name \p name for the requested library \p library and the current context. If no global for the requested name \p name exists, the call returns ::CUDA_ERROR_NOT_FOUND. One of the parameters \p dptr or \p bytes (not both) can be NULL in which case it is ignored. \param dptr - Returned global device pointer for the requested context \param bytes - Returned global size in bytes \param library - Library to retrieve global from \param name - Name of global to retrieve \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_NOT_FOUND, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_CONTEXT_IS_DESTROYED \sa ::cuLibraryLoadData, ::cuLibraryLoadFromFile, ::cuLibraryUnload, ::cuLibraryGetModule, cuModuleGetGlobal*/ fn cuLibraryGetGlobal( dptr: *mut cuda_types::cuda::CUdeviceptr, bytes: *mut usize, library: cuda_types::cuda::CUlibrary, name: *const ::core::ffi::c_char, ) -> cuda_types::cuda::CUresult; /** \brief Returns a pointer to managed memory Returns in \p *dptr and \p *bytes the base pointer and size of the managed memory with name \p name for the requested library \p library. If no managed memory with the requested name \p name exists, the call returns ::CUDA_ERROR_NOT_FOUND. One of the parameters \p dptr or \p bytes (not both) can be NULL in which case it is ignored. Note that managed memory for library \p library is shared across devices and is registered when the library is loaded into atleast one context. \param dptr - Returned pointer to the managed memory \param bytes - Returned memory size in bytes \param library - Library to retrieve managed memory from \param name - Name of managed memory to retrieve \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_NOT_FOUND \sa ::cuLibraryLoadData, ::cuLibraryLoadFromFile, ::cuLibraryUnload*/ fn cuLibraryGetManaged( dptr: *mut cuda_types::cuda::CUdeviceptr, bytes: *mut usize, library: cuda_types::cuda::CUlibrary, name: *const ::core::ffi::c_char, ) -> cuda_types::cuda::CUresult; /** \brief Returns a pointer to a unified function Returns in \p *fptr the function pointer to a unified function denoted by \p symbol. If no unified function with name \p symbol exists, the call returns ::CUDA_ERROR_NOT_FOUND. If there is no device with attribute ::CU_DEVICE_ATTRIBUTE_UNIFIED_FUNCTION_POINTERS present in the system, the call may return ::CUDA_ERROR_NOT_FOUND. \param fptr - Returned pointer to a unified function \param library - Library to retrieve function pointer memory from \param symbol - Name of function pointer to retrieve \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_NOT_FOUND \sa ::cuLibraryLoadData, ::cuLibraryLoadFromFile, ::cuLibraryUnload*/ fn cuLibraryGetUnifiedFunction( fptr: *mut *mut ::core::ffi::c_void, library: cuda_types::cuda::CUlibrary, symbol: *const ::core::ffi::c_char, ) -> cuda_types::cuda::CUresult; /** \brief Returns information about a kernel Returns in \p *pi the integer value of the attribute \p attrib for the kernel \p kernel for the requested device \p dev. The supported attributes are: - ::CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK: The maximum number of threads per block, beyond which a launch of the kernel would fail. This number depends on both the kernel and the requested device. - ::CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES: The size in bytes of statically-allocated shared memory per block required by this kernel. This does not include dynamically-allocated shared memory requested by the user at runtime. - ::CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES: The size in bytes of user-allocated constant memory required by this kernel. - ::CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES: The size in bytes of local memory used by each thread of this kernel. - ::CU_FUNC_ATTRIBUTE_NUM_REGS: The number of registers used by each thread of this kernel. - ::CU_FUNC_ATTRIBUTE_PTX_VERSION: The PTX virtual architecture version for which the kernel was compiled. This value is the major PTX version * 10 + the minor PTX version, so a PTX version 1.3 function would return the value 13. Note that this may return the undefined value of 0 for cubins compiled prior to CUDA 3.0. - ::CU_FUNC_ATTRIBUTE_BINARY_VERSION: The binary architecture version for which the kernel was compiled. This value is the major binary version * 10 + the minor binary version, so a binary version 1.3 function would return the value 13. Note that this will return a value of 10 for legacy cubins that do not have a properly-encoded binary architecture version. - ::CU_FUNC_CACHE_MODE_CA: The attribute to indicate whether the kernel has been compiled with user specified option "-Xptxas --dlcm=ca" set. - ::CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES: The maximum size in bytes of dynamically-allocated shared memory. - ::CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT: Preferred shared memory-L1 cache split ratio in percent of total shared memory. - ::CU_FUNC_ATTRIBUTE_CLUSTER_SIZE_MUST_BE_SET: If this attribute is set, the kernel must launch with a valid cluster size specified. - ::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_WIDTH: The required cluster width in blocks. - ::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_HEIGHT: The required cluster height in blocks. - ::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_DEPTH: The required cluster depth in blocks. - ::CU_FUNC_ATTRIBUTE_NON_PORTABLE_CLUSTER_SIZE_ALLOWED: Indicates whether the function can be launched with non-portable cluster size. 1 is allowed, 0 is disallowed. A non-portable cluster size may only function on the specific SKUs the program is tested on. The launch might fail if the program is run on a different hardware platform. CUDA API provides cudaOccupancyMaxActiveClusters to assist with checking whether the desired size can be launched on the current device. A portable cluster size is guaranteed to be functional on all compute capabilities higher than the target compute capability. The portable cluster size for sm_90 is 8 blocks per cluster. This value may increase for future compute capabilities. The specific hardware unit may support higher cluster sizes that’s not guaranteed to be portable. - ::CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE: The block scheduling policy of a function. The value type is CUclusterSchedulingPolicy. \note If another thread is trying to set the same attribute on the same device using ::cuKernelSetAttribute() simultaneously, the attribute query will give the old or new value depending on the interleavings chosen by the OS scheduler and memory consistency. \param pi - Returned attribute value \param attrib - Attribute requested \param kernel - Kernel to query attribute of \param dev - Device to query attribute of \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_DEVICE \sa ::cuLibraryLoadData, ::cuLibraryLoadFromFile, ::cuLibraryUnload, ::cuKernelSetAttribute, ::cuLibraryGetKernel, ::cuLaunchKernel, ::cuKernelGetFunction, ::cuLibraryGetModule, ::cuModuleGetFunction, ::cuFuncGetAttribute*/ fn cuKernelGetAttribute( pi: *mut ::core::ffi::c_int, attrib: cuda_types::cuda::CUfunction_attribute, kernel: cuda_types::cuda::CUkernel, dev: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; /** \brief Sets information about a kernel This call sets the value of a specified attribute \p attrib on the kernel \p kernel for the requested device \p dev to an integer value specified by \p val. This function returns CUDA_SUCCESS if the new value of the attribute could be successfully set. If the set fails, this call will return an error. Not all attributes can have values set. Attempting to set a value on a read-only attribute will result in an error (CUDA_ERROR_INVALID_VALUE) Note that attributes set using ::cuFuncSetAttribute() will override the attribute set by this API irrespective of whether the call to ::cuFuncSetAttribute() is made before or after this API call. However, ::cuKernelGetAttribute() will always return the attribute value set by this API. Supported attributes are: - ::CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES: This is the maximum size in bytes of dynamically-allocated shared memory. The value should contain the requested maximum size of dynamically-allocated shared memory. The sum of this value and the function attribute ::CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES cannot exceed the device attribute ::CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN. The maximal size of requestable dynamic shared memory may differ by GPU architecture. - ::CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT: On devices where the L1 cache and shared memory use the same hardware resources, this sets the shared memory carveout preference, in percent of the total shared memory. See ::CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR This is only a hint, and the driver can choose a different ratio if required to execute the function. - ::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_WIDTH: The required cluster width in blocks. The width, height, and depth values must either all be 0 or all be positive. The validity of the cluster dimensions is checked at launch time. If the value is set during compile time, it cannot be set at runtime. Setting it at runtime will return CUDA_ERROR_NOT_PERMITTED. - ::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_HEIGHT: The required cluster height in blocks. The width, height, and depth values must either all be 0 or all be positive. The validity of the cluster dimensions is checked at launch time. If the value is set during compile time, it cannot be set at runtime. Setting it at runtime will return CUDA_ERROR_NOT_PERMITTED. - ::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_DEPTH: The required cluster depth in blocks. The width, height, and depth values must either all be 0 or all be positive. The validity of the cluster dimensions is checked at launch time. If the value is set during compile time, it cannot be set at runtime. Setting it at runtime will return CUDA_ERROR_NOT_PERMITTED. - ::CU_FUNC_ATTRIBUTE_NON_PORTABLE_CLUSTER_SIZE_ALLOWED: Indicates whether the function can be launched with non-portable cluster size. 1 is allowed, 0 is disallowed. - ::CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE: The block scheduling policy of a function. The value type is CUclusterSchedulingPolicy. \note The API has stricter locking requirements in comparison to its legacy counterpart ::cuFuncSetAttribute() due to device-wide semantics. If multiple threads are trying to set the same attribute on the same device simultaneously, the attribute setting will depend on the interleavings chosen by the OS scheduler and memory consistency. \param attrib - Attribute requested \param val - Value to set \param kernel - Kernel to set attribute of \param dev - Device to set attribute of \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_DEVICE, ::CUDA_ERROR_OUT_OF_MEMORY \sa ::cuLibraryLoadData, ::cuLibraryLoadFromFile, ::cuLibraryUnload, ::cuKernelGetAttribute, ::cuLibraryGetKernel, ::cuLaunchKernel, ::cuKernelGetFunction, ::cuLibraryGetModule, ::cuModuleGetFunction, ::cuFuncSetAttribute*/ fn cuKernelSetAttribute( attrib: cuda_types::cuda::CUfunction_attribute, val: ::core::ffi::c_int, kernel: cuda_types::cuda::CUkernel, dev: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; /** \brief Sets the preferred cache configuration for a device kernel. On devices where the L1 cache and shared memory use the same hardware resources, this sets through \p config the preferred cache configuration for the device kernel \p kernel on the requested device \p dev. This is only a preference. The driver will use the requested configuration if possible, but it is free to choose a different configuration if required to execute \p kernel. Any context-wide preference set via ::cuCtxSetCacheConfig() will be overridden by this per-kernel setting. Note that attributes set using ::cuFuncSetCacheConfig() will override the attribute set by this API irrespective of whether the call to ::cuFuncSetCacheConfig() is made before or after this API call. This setting does nothing on devices where the size of the L1 cache and shared memory are fixed. Launching a kernel with a different preference than the most recent preference setting may insert a device-side synchronization point. The supported cache configurations are: - ::CU_FUNC_CACHE_PREFER_NONE: no preference for shared memory or L1 (default) - ::CU_FUNC_CACHE_PREFER_SHARED: prefer larger shared memory and smaller L1 cache - ::CU_FUNC_CACHE_PREFER_L1: prefer larger L1 cache and smaller shared memory - ::CU_FUNC_CACHE_PREFER_EQUAL: prefer equal sized L1 cache and shared memory \note The API has stricter locking requirements in comparison to its legacy counterpart ::cuFuncSetCacheConfig() due to device-wide semantics. If multiple threads are trying to set a config on the same device simultaneously, the cache config setting will depend on the interleavings chosen by the OS scheduler and memory consistency. \param kernel - Kernel to configure cache for \param config - Requested cache configuration \param dev - Device to set attribute of \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_DEVICE, ::CUDA_ERROR_OUT_OF_MEMORY \sa ::cuLibraryLoadData, ::cuLibraryLoadFromFile, ::cuLibraryUnload, ::cuLibraryGetKernel, ::cuKernelGetFunction, ::cuLibraryGetModule, ::cuModuleGetFunction, ::cuFuncSetCacheConfig, ::cuCtxSetCacheConfig, ::cuLaunchKernel*/ fn cuKernelSetCacheConfig( kernel: cuda_types::cuda::CUkernel, config: cuda_types::cuda::CUfunc_cache, dev: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; /** \brief Returns the function name for a ::CUkernel handle Returns in \p **name the function name associated with the kernel handle \p hfunc . The function name is returned as a null-terminated string. The returned name is only valid when the kernel handle is valid. If the library is unloaded or reloaded, one must call the API again to get the updated name. This API may return a mangled name if the function is not declared as having C linkage. If either \p **name or \p hfunc is NULL, ::CUDA_ERROR_INVALID_VALUE is returned. \param name - The returned name of the function \param hfunc - The function handle to retrieve the name for \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE \notefnerr */ fn cuKernelGetName( name: *mut *const ::core::ffi::c_char, hfunc: cuda_types::cuda::CUkernel, ) -> cuda_types::cuda::CUresult; /** \brief Returns the offset and size of a kernel parameter in the device-side parameter layout Queries the kernel parameter at \p paramIndex into \p kernel's list of parameters, and returns in \p paramOffset and \p paramSize the offset and size, respectively, where the parameter will reside in the device-side parameter layout. This information can be used to update kernel node parameters from the device via ::cudaGraphKernelNodeSetParam() and ::cudaGraphKernelNodeUpdatesApply(). \p paramIndex must be less than the number of parameters that \p kernel takes. \p paramSize can be set to NULL if only the parameter offset is desired. \param kernel - The kernel to query \param paramIndex - The parameter index to query \param paramOffset - Returns the offset into the device-side parameter layout at which the parameter resides \param paramSize - Optionally returns the size of the parameter in the device-side parameter layout \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, \notefnerr \sa ::cuFuncGetParamInfo*/ fn cuKernelGetParamInfo( kernel: cuda_types::cuda::CUkernel, paramIndex: usize, paramOffset: *mut usize, paramSize: *mut usize, ) -> cuda_types::cuda::CUresult; /** \brief Gets free and total memory Returns in \p *total the total amount of memory available to the the current context. Returns in \p *free the amount of memory on the device that is free according to the OS. CUDA is not guaranteed to be able to allocate all of the memory that the OS reports as free. In a multi-tenet situation, free estimate returned is prone to race condition where a new allocation/free done by a different process or a different thread in the same process between the time when free memory was estimated and reported, will result in deviation in free value reported and actual free memory. The integrated GPU on Tegra shares memory with CPU and other component of the SoC. The free and total values returned by the API excludes the SWAP memory space maintained by the OS on some platforms. The OS may move some of the memory pages into swap area as the GPU or CPU allocate or access memory. See Tegra app note on how to calculate total and free memory on Tegra. \param free - Returned free memory in bytes \param total - Returned total memory in bytes \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D16, ::cuMemsetD2D32, ::cuMemsetD8, ::cuMemsetD16, ::cuMemsetD32, ::cudaMemGetInfo*/ fn cuMemGetInfo_v2( free: *mut usize, total: *mut usize, ) -> cuda_types::cuda::CUresult; /** \brief Allocates device memory Allocates \p bytesize bytes of linear memory on the device and returns in \p *dptr a pointer to the allocated memory. The allocated memory is suitably aligned for any kind of variable. The memory is not cleared. If \p bytesize is 0, ::cuMemAlloc() returns ::CUDA_ERROR_INVALID_VALUE. \param dptr - Returned device pointer \param bytesize - Requested allocation size in bytes \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_OUT_OF_MEMORY \notefnerr \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D16, ::cuMemsetD2D32, ::cuMemsetD8, ::cuMemsetD16, ::cuMemsetD32, ::cudaMalloc*/ fn cuMemAlloc_v2( dptr: *mut cuda_types::cuda::CUdeviceptr, bytesize: usize, ) -> cuda_types::cuda::CUresult; /** \brief Allocates pitched device memory Allocates at least \p WidthInBytes * \p Height bytes of linear memory on the device and returns in \p *dptr a pointer to the allocated memory. The function may pad the allocation to ensure that corresponding pointers in any given row will continue to meet the alignment requirements for coalescing as the address is updated from row to row. \p ElementSizeBytes specifies the size of the largest reads and writes that will be performed on the memory range. \p ElementSizeBytes may be 4, 8 or 16 (since coalesced memory transactions are not possible on other data sizes). If \p ElementSizeBytes is smaller than the actual read/write size of a kernel, the kernel will run correctly, but possibly at reduced speed. The pitch returned in \p *pPitch by ::cuMemAllocPitch() is the width in bytes of the allocation. The intended usage of pitch is as a separate parameter of the allocation, used to compute addresses within the 2D array. Given the row and column of an array element of type \b T, the address is computed as: \code T* pElement = (T*)((char*)BaseAddress + Row * Pitch) + Column; \endcode The pitch returned by ::cuMemAllocPitch() is guaranteed to work with ::cuMemcpy2D() under all circumstances. For allocations of 2D arrays, it is recommended that programmers consider performing pitch allocations using ::cuMemAllocPitch(). Due to alignment restrictions in the hardware, this is especially true if the application will be performing 2D memory copies between different regions of device memory (whether linear memory or CUDA arrays). The byte alignment of the pitch returned by ::cuMemAllocPitch() is guaranteed to match or exceed the alignment requirement for texture binding with ::cuTexRefSetAddress2D(). \param dptr - Returned device pointer \param pPitch - Returned pitch of allocation in bytes \param WidthInBytes - Requested allocation width in bytes \param Height - Requested allocation height in rows \param ElementSizeBytes - Size of largest reads/writes for range \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_OUT_OF_MEMORY \notefnerr \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D16, ::cuMemsetD2D32, ::cuMemsetD8, ::cuMemsetD16, ::cuMemsetD32, ::cudaMallocPitch*/ fn cuMemAllocPitch_v2( dptr: *mut cuda_types::cuda::CUdeviceptr, pPitch: *mut usize, WidthInBytes: usize, Height: usize, ElementSizeBytes: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Frees device memory Frees the memory space pointed to by \p dptr, which must have been returned by a previous call to one of the following memory allocation APIs - ::cuMemAlloc(), ::cuMemAllocPitch(), ::cuMemAllocManaged(), ::cuMemAllocAsync(), ::cuMemAllocFromPoolAsync() Note - This API will not perform any implict synchronization when the pointer was allocated with ::cuMemAllocAsync or ::cuMemAllocFromPoolAsync. Callers must ensure that all accesses to these pointer have completed before invoking ::cuMemFree. For best performance and memory reuse, users should use ::cuMemFreeAsync to free memory allocated via the stream ordered memory allocator. For all other pointers, this API may perform implicit synchronization. \param dptr - Pointer to memory to free \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemAllocManaged, ::cuMemAllocAsync, ::cuMemAllocFromPoolAsync, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemFreeAsync, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D16, ::cuMemsetD2D32, ::cuMemsetD8, ::cuMemsetD16, ::cuMemsetD32, ::cudaFree*/ fn cuMemFree_v2(dptr: cuda_types::cuda::CUdeviceptr) -> cuda_types::cuda::CUresult; /** \brief Get information on memory allocations Returns the base address in \p *pbase and size in \p *psize of the allocation by ::cuMemAlloc() or ::cuMemAllocPitch() that contains the input pointer \p dptr. Both parameters \p pbase and \p psize are optional. If one of them is NULL, it is ignored. \param pbase - Returned base address \param psize - Returned size of device memory allocation \param dptr - Device pointer to query \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_NOT_FOUND, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D16, ::cuMemsetD2D32, ::cuMemsetD8, ::cuMemsetD16, ::cuMemsetD32*/ fn cuMemGetAddressRange_v2( pbase: *mut cuda_types::cuda::CUdeviceptr, psize: *mut usize, dptr: cuda_types::cuda::CUdeviceptr, ) -> cuda_types::cuda::CUresult; /** \brief Allocates page-locked host memory Allocates \p bytesize bytes of host memory that is page-locked and accessible to the device. The driver tracks the virtual memory ranges allocated with this function and automatically accelerates calls to functions such as ::cuMemcpy(). Since the memory can be accessed directly by the device, it can be read or written with much higher bandwidth than pageable memory obtained with functions such as ::malloc(). On systems where ::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES is true, ::cuMemAllocHost may not page-lock the allocated memory. Page-locking excessive amounts of memory with ::cuMemAllocHost() may degrade system performance, since it reduces the amount of memory available to the system for paging. As a result, this function is best used sparingly to allocate staging areas for data exchange between host and device. Note all host memory allocated using ::cuMemAllocHost() will automatically be immediately accessible to all contexts on all devices which support unified addressing (as may be queried using ::CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING). The device pointer that may be used to access this host memory from those contexts is always equal to the returned host pointer \p *pp. See \ref CUDA_UNIFIED for additional details. \param pp - Returned pointer to host memory \param bytesize - Requested allocation size in bytes \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_OUT_OF_MEMORY \notefnerr \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D16, ::cuMemsetD2D32, ::cuMemsetD8, ::cuMemsetD16, ::cuMemsetD32, ::cudaMallocHost*/ fn cuMemAllocHost_v2( pp: *mut *mut ::core::ffi::c_void, bytesize: usize, ) -> cuda_types::cuda::CUresult; /** \brief Frees page-locked host memory Frees the memory space pointed to by \p p, which must have been returned by a previous call to ::cuMemAllocHost(). \param p - Pointer to memory to free \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D16, ::cuMemsetD2D32, ::cuMemsetD8, ::cuMemsetD16, ::cuMemsetD32, ::cudaFreeHost*/ fn cuMemFreeHost(p: *mut ::core::ffi::c_void) -> cuda_types::cuda::CUresult; /** \brief Allocates page-locked host memory Allocates \p bytesize bytes of host memory that is page-locked and accessible to the device. The driver tracks the virtual memory ranges allocated with this function and automatically accelerates calls to functions such as ::cuMemcpyHtoD(). Since the memory can be accessed directly by the device, it can be read or written with much higher bandwidth than pageable memory obtained with functions such as ::malloc(). On systems where ::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES is true, ::cuMemHostAlloc may not page-lock the allocated memory. Page-locking excessive amounts of memory may degrade system performance, since it reduces the amount of memory available to the system for paging. As a result, this function is best used sparingly to allocate staging areas for data exchange between host and device. The \p Flags parameter enables different options to be specified that affect the allocation, as follows. - ::CU_MEMHOSTALLOC_PORTABLE: The memory returned by this call will be considered as pinned memory by all CUDA contexts, not just the one that performed the allocation. - ::CU_MEMHOSTALLOC_DEVICEMAP: Maps the allocation into the CUDA address space. The device pointer to the memory may be obtained by calling ::cuMemHostGetDevicePointer(). - ::CU_MEMHOSTALLOC_WRITECOMBINED: Allocates the memory as write-combined (WC). WC memory can be transferred across the PCI Express bus more quickly on some system configurations, but cannot be read efficiently by most CPUs. WC memory is a good option for buffers that will be written by the CPU and read by the GPU via mapped pinned memory or host->device transfers. All of these flags are orthogonal to one another: a developer may allocate memory that is portable, mapped and/or write-combined with no restrictions. The ::CU_MEMHOSTALLOC_DEVICEMAP flag may be specified on CUDA contexts for devices that do not support mapped pinned memory. The failure is deferred to ::cuMemHostGetDevicePointer() because the memory may be mapped into other CUDA contexts via the ::CU_MEMHOSTALLOC_PORTABLE flag. The memory allocated by this function must be freed with ::cuMemFreeHost(). Note all host memory allocated using ::cuMemHostAlloc() will automatically be immediately accessible to all contexts on all devices which support unified addressing (as may be queried using ::CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING). Unless the flag ::CU_MEMHOSTALLOC_WRITECOMBINED is specified, the device pointer that may be used to access this host memory from those contexts is always equal to the returned host pointer \p *pp. If the flag ::CU_MEMHOSTALLOC_WRITECOMBINED is specified, then the function ::cuMemHostGetDevicePointer() must be used to query the device pointer, even if the context supports unified addressing. See \ref CUDA_UNIFIED for additional details. \param pp - Returned pointer to host memory \param bytesize - Requested allocation size in bytes \param Flags - Flags for allocation request \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_OUT_OF_MEMORY \notefnerr \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D16, ::cuMemsetD2D32, ::cuMemsetD8, ::cuMemsetD16, ::cuMemsetD32, ::cudaHostAlloc*/ fn cuMemHostAlloc( pp: *mut *mut ::core::ffi::c_void, bytesize: usize, Flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Passes back device pointer of mapped pinned memory Passes back the device pointer \p pdptr corresponding to the mapped, pinned host buffer \p p allocated by ::cuMemHostAlloc. ::cuMemHostGetDevicePointer() will fail if the ::CU_MEMHOSTALLOC_DEVICEMAP flag was not specified at the time the memory was allocated, or if the function is called on a GPU that does not support mapped pinned memory. For devices that have a non-zero value for the device attribute ::CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM, the memory can also be accessed from the device using the host pointer \p p. The device pointer returned by ::cuMemHostGetDevicePointer() may or may not match the original host pointer \p p and depends on the devices visible to the application. If all devices visible to the application have a non-zero value for the device attribute, the device pointer returned by ::cuMemHostGetDevicePointer() will match the original pointer \p p. If any device visible to the application has a zero value for the device attribute, the device pointer returned by ::cuMemHostGetDevicePointer() will not match the original host pointer \p p, but it will be suitable for use on all devices provided Unified Virtual Addressing is enabled. In such systems, it is valid to access the memory using either pointer on devices that have a non-zero value for the device attribute. Note however that such devices should access the memory using only one of the two pointers and not both. \p Flags provides for future releases. For now, it must be set to 0. \param pdptr - Returned device pointer \param p - Host pointer \param Flags - Options (must be 0) \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemsetD2D8, ::cuMemsetD2D16, ::cuMemsetD2D32, ::cuMemsetD8, ::cuMemsetD16, ::cuMemsetD32, ::cudaHostGetDevicePointer*/ fn cuMemHostGetDevicePointer_v2( pdptr: *mut cuda_types::cuda::CUdeviceptr, p: *mut ::core::ffi::c_void, Flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Passes back flags that were used for a pinned allocation Passes back the flags \p pFlags that were specified when allocating the pinned host buffer \p p allocated by ::cuMemHostAlloc. ::cuMemHostGetFlags() will fail if the pointer does not reside in an allocation performed by ::cuMemAllocHost() or ::cuMemHostAlloc(). \param pFlags - Returned flags word \param p - Host pointer \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuMemAllocHost, ::cuMemHostAlloc, ::cudaHostGetFlags*/ fn cuMemHostGetFlags( pFlags: *mut ::core::ffi::c_uint, p: *mut ::core::ffi::c_void, ) -> cuda_types::cuda::CUresult; /** \brief Allocates memory that will be automatically managed by the Unified Memory system Allocates \p bytesize bytes of managed memory on the device and returns in \p *dptr a pointer to the allocated memory. If the device doesn't support allocating managed memory, ::CUDA_ERROR_NOT_SUPPORTED is returned. Support for managed memory can be queried using the device attribute ::CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY. The allocated memory is suitably aligned for any kind of variable. The memory is not cleared. If \p bytesize is 0, ::cuMemAllocManaged returns ::CUDA_ERROR_INVALID_VALUE. The pointer is valid on the CPU and on all GPUs in the system that support managed memory. All accesses to this pointer must obey the Unified Memory programming model. \p flags specifies the default stream association for this allocation. \p flags must be one of ::CU_MEM_ATTACH_GLOBAL or ::CU_MEM_ATTACH_HOST. If ::CU_MEM_ATTACH_GLOBAL is specified, then this memory is accessible from any stream on any device. If ::CU_MEM_ATTACH_HOST is specified, then the allocation should not be accessed from devices that have a zero value for the device attribute ::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS; an explicit call to ::cuStreamAttachMemAsync will be required to enable access on such devices. If the association is later changed via ::cuStreamAttachMemAsync to a single stream, the default association as specified during ::cuMemAllocManaged is restored when that stream is destroyed. For __managed__ variables, the default association is always ::CU_MEM_ATTACH_GLOBAL. Note that destroying a stream is an asynchronous operation, and as a result, the change to default association won't happen until all work in the stream has completed. Memory allocated with ::cuMemAllocManaged should be released with ::cuMemFree. Device memory oversubscription is possible for GPUs that have a non-zero value for the device attribute ::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS. Managed memory on such GPUs may be evicted from device memory to host memory at any time by the Unified Memory driver in order to make room for other allocations. In a system where all GPUs have a non-zero value for the device attribute ::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS, managed memory may not be populated when this API returns and instead may be populated on access. In such systems, managed memory can migrate to any processor's memory at any time. The Unified Memory driver will employ heuristics to maintain data locality and prevent excessive page faults to the extent possible. The application can also guide the driver about memory usage patterns via ::cuMemAdvise. The application can also explicitly migrate memory to a desired processor's memory via ::cuMemPrefetchAsync. In a multi-GPU system where all of the GPUs have a zero value for the device attribute ::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS and all the GPUs have peer-to-peer support with each other, the physical storage for managed memory is created on the GPU which is active at the time ::cuMemAllocManaged is called. All other GPUs will reference the data at reduced bandwidth via peer mappings over the PCIe bus. The Unified Memory driver does not migrate memory among such GPUs. In a multi-GPU system where not all GPUs have peer-to-peer support with each other and where the value of the device attribute ::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS is zero for at least one of those GPUs, the location chosen for physical storage of managed memory is system-dependent. - On Linux, the location chosen will be device memory as long as the current set of active contexts are on devices that either have peer-to-peer support with each other or have a non-zero value for the device attribute ::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS. If there is an active context on a GPU that does not have a non-zero value for that device attribute and it does not have peer-to-peer support with the other devices that have active contexts on them, then the location for physical storage will be 'zero-copy' or host memory. Note that this means that managed memory that is located in device memory is migrated to host memory if a new context is created on a GPU that doesn't have a non-zero value for the device attribute and does not support peer-to-peer with at least one of the other devices that has an active context. This in turn implies that context creation may fail if there is insufficient host memory to migrate all managed allocations. - On Windows, the physical storage is always created in 'zero-copy' or host memory. All GPUs will reference the data at reduced bandwidth over the PCIe bus. In these circumstances, use of the environment variable CUDA_VISIBLE_DEVICES is recommended to restrict CUDA to only use those GPUs that have peer-to-peer support. Alternatively, users can also set CUDA_MANAGED_FORCE_DEVICE_ALLOC to a non-zero value to force the driver to always use device memory for physical storage. When this environment variable is set to a non-zero value, all contexts created in that process on devices that support managed memory have to be peer-to-peer compatible with each other. Context creation will fail if a context is created on a device that supports managed memory and is not peer-to-peer compatible with any of the other managed memory supporting devices on which contexts were previously created, even if those contexts have been destroyed. These environment variables are described in the CUDA programming guide under the "CUDA environment variables" section. - On ARM, managed memory is not available on discrete gpu with Drive PX-2. \param dptr - Returned device pointer \param bytesize - Requested allocation size in bytes \param flags - Must be one of ::CU_MEM_ATTACH_GLOBAL or ::CU_MEM_ATTACH_HOST \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_NOT_SUPPORTED, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_OUT_OF_MEMORY \notefnerr \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D16, ::cuMemsetD2D32, ::cuMemsetD8, ::cuMemsetD16, ::cuMemsetD32, ::cuDeviceGetAttribute, ::cuStreamAttachMemAsync, ::cudaMallocManaged*/ fn cuMemAllocManaged( dptr: *mut cuda_types::cuda::CUdeviceptr, bytesize: usize, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Registers a callback function to receive async notifications Registers \p callbackFunc to receive async notifications. The \p userData parameter is passed to the callback function at async notification time. Likewise, \p callback is also passed to the callback function to distinguish between multiple registered callbacks. The callback function being registered should be designed to return quickly (~10ms). Any long running tasks should be queued for execution on an application thread. Callbacks may not call cuDeviceRegisterAsyncNotification or cuDeviceUnregisterAsyncNotification. Doing so will result in ::CUDA_ERROR_NOT_PERMITTED. Async notification callbacks execute in an undefined order and may be serialized. Returns in \p *callback a handle representing the registered callback instance. \param device - The device on which to register the callback \param callbackFunc - The function to register as a callback \param userData - A generic pointer to user data. This is passed into the callback function. \param callback - A handle representing the registered callback instance \return ::CUDA_SUCCESS, ::CUDA_ERROR_NOT_SUPPORTED, ::CUDA_ERROR_INVALID_DEVICE, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_PERMITTED, ::CUDA_ERROR_UNKNOWN \notefnerr \sa ::cuDeviceUnregisterAsyncNotification*/ fn cuDeviceRegisterAsyncNotification( device: cuda_types::cuda::CUdevice, callbackFunc: cuda_types::cuda::CUasyncCallback, userData: *mut ::core::ffi::c_void, callback: *mut cuda_types::cuda::CUasyncCallbackHandle, ) -> cuda_types::cuda::CUresult; /** \brief Unregisters an async notification callback Unregisters \p callback so that the corresponding callback function will stop receiving async notifications. \param device - The device from which to remove \p callback. \param callback - The callback instance to unregister from receiving async notifications. \return ::CUDA_SUCCESS, ::CUDA_ERROR_NOT_SUPPORTED, ::CUDA_ERROR_INVALID_DEVICE, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_PERMITTED, ::CUDA_ERROR_UNKNOWN \notefnerr \sa ::cuDeviceRegisterAsyncNotification*/ fn cuDeviceUnregisterAsyncNotification( device: cuda_types::cuda::CUdevice, callback: cuda_types::cuda::CUasyncCallbackHandle, ) -> cuda_types::cuda::CUresult; /** \brief Returns a handle to a compute device Returns in \p *device a device handle given a PCI bus ID string. \param dev - Returned device handle \param pciBusId - String in one of the following forms: [domain]:[bus]:[device].[function] [domain]:[bus]:[device] [bus]:[device].[function] where \p domain, \p bus, \p device, and \p function are all hexadecimal values \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_DEVICE \notefnerr \sa ::cuDeviceGet, ::cuDeviceGetAttribute, ::cuDeviceGetPCIBusId, ::cudaDeviceGetByPCIBusId*/ fn cuDeviceGetByPCIBusId( dev: *mut cuda_types::cuda::CUdevice, pciBusId: *const ::core::ffi::c_char, ) -> cuda_types::cuda::CUresult; /** \brief Returns a PCI Bus Id string for the device Returns an ASCII string identifying the device \p dev in the NULL-terminated string pointed to by \p pciBusId. \p len specifies the maximum length of the string that may be returned. \param pciBusId - Returned identifier string for the device in the following format [domain]:[bus]:[device].[function] where \p domain, \p bus, \p device, and \p function are all hexadecimal values. pciBusId should be large enough to store 13 characters including the NULL-terminator. \param len - Maximum length of string to store in \p name \param dev - Device to get identifier string for \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_DEVICE \notefnerr \sa ::cuDeviceGet, ::cuDeviceGetAttribute, ::cuDeviceGetByPCIBusId, ::cudaDeviceGetPCIBusId*/ fn cuDeviceGetPCIBusId( pciBusId: *mut ::core::ffi::c_char, len: ::core::ffi::c_int, dev: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; /** \brief Gets an interprocess handle for a previously allocated event Takes as input a previously allocated event. This event must have been created with the ::CU_EVENT_INTERPROCESS and ::CU_EVENT_DISABLE_TIMING flags set. This opaque handle may be copied into other processes and opened with ::cuIpcOpenEventHandle to allow efficient hardware synchronization between GPU work in different processes. After the event has been opened in the importing process, ::cuEventRecord, ::cuEventSynchronize, ::cuStreamWaitEvent and ::cuEventQuery may be used in either process. Performing operations on the imported event after the exported event has been freed with ::cuEventDestroy will result in undefined behavior. IPC functionality is restricted to devices with support for unified addressing on Linux and Windows operating systems. IPC functionality on Windows is supported for compatibility purposes but not recommended as it comes with performance cost. Users can test their device for IPC functionality by calling ::cuDeviceGetAttribute with ::CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED \param pHandle - Pointer to a user allocated CUipcEventHandle in which to return the opaque event handle \param event - Event allocated with ::CU_EVENT_INTERPROCESS and ::CU_EVENT_DISABLE_TIMING flags. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_OUT_OF_MEMORY, ::CUDA_ERROR_MAP_FAILED, ::CUDA_ERROR_INVALID_VALUE \sa ::cuEventCreate, ::cuEventDestroy, ::cuEventSynchronize, ::cuEventQuery, ::cuStreamWaitEvent, ::cuIpcOpenEventHandle, ::cuIpcGetMemHandle, ::cuIpcOpenMemHandle, ::cuIpcCloseMemHandle, ::cudaIpcGetEventHandle*/ fn cuIpcGetEventHandle( pHandle: *mut cuda_types::cuda::CUipcEventHandle, event: cuda_types::cuda::CUevent, ) -> cuda_types::cuda::CUresult; /** \brief Opens an interprocess event handle for use in the current process Opens an interprocess event handle exported from another process with ::cuIpcGetEventHandle. This function returns a ::CUevent that behaves like a locally created event with the ::CU_EVENT_DISABLE_TIMING flag specified. This event must be freed with ::cuEventDestroy. Performing operations on the imported event after the exported event has been freed with ::cuEventDestroy will result in undefined behavior. IPC functionality is restricted to devices with support for unified addressing on Linux and Windows operating systems. IPC functionality on Windows is supported for compatibility purposes but not recommended as it comes with performance cost. Users can test their device for IPC functionality by calling ::cuapiDeviceGetAttribute with ::CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED \param phEvent - Returns the imported event \param handle - Interprocess handle to open \returns ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_MAP_FAILED, ::CUDA_ERROR_PEER_ACCESS_UNSUPPORTED, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_INVALID_VALUE \sa ::cuEventCreate, ::cuEventDestroy, ::cuEventSynchronize, ::cuEventQuery, ::cuStreamWaitEvent, ::cuIpcGetEventHandle, ::cuIpcGetMemHandle, ::cuIpcOpenMemHandle, ::cuIpcCloseMemHandle, ::cudaIpcOpenEventHandle*/ fn cuIpcOpenEventHandle( phEvent: *mut cuda_types::cuda::CUevent, handle: cuda_types::cuda::CUipcEventHandle, ) -> cuda_types::cuda::CUresult; /** \brief Gets an interprocess memory handle for an existing device memory allocation Takes a pointer to the base of an existing device memory allocation created with ::cuMemAlloc and exports it for use in another process. This is a lightweight operation and may be called multiple times on an allocation without adverse effects. If a region of memory is freed with ::cuMemFree and a subsequent call to ::cuMemAlloc returns memory with the same device address, ::cuIpcGetMemHandle will return a unique handle for the new memory. IPC functionality is restricted to devices with support for unified addressing on Linux and Windows operating systems. IPC functionality on Windows is supported for compatibility purposes but not recommended as it comes with performance cost. Users can test their device for IPC functionality by calling ::cuapiDeviceGetAttribute with ::CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED \param pHandle - Pointer to user allocated ::CUipcMemHandle to return the handle in. \param dptr - Base pointer to previously allocated device memory \returns ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_OUT_OF_MEMORY, ::CUDA_ERROR_MAP_FAILED, ::CUDA_ERROR_INVALID_VALUE \sa ::cuMemAlloc, ::cuMemFree, ::cuIpcGetEventHandle, ::cuIpcOpenEventHandle, ::cuIpcOpenMemHandle, ::cuIpcCloseMemHandle, ::cudaIpcGetMemHandle*/ fn cuIpcGetMemHandle( pHandle: *mut cuda_types::cuda::CUipcMemHandle, dptr: cuda_types::cuda::CUdeviceptr, ) -> cuda_types::cuda::CUresult; /** \brief Opens an interprocess memory handle exported from another process and returns a device pointer usable in the local process. Maps memory exported from another process with ::cuIpcGetMemHandle into the current device address space. For contexts on different devices ::cuIpcOpenMemHandle can attempt to enable peer access between the devices as if the user called ::cuCtxEnablePeerAccess. This behavior is controlled by the ::CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS flag. ::cuDeviceCanAccessPeer can determine if a mapping is possible. Contexts that may open ::CUipcMemHandles are restricted in the following way. ::CUipcMemHandles from each ::CUdevice in a given process may only be opened by one ::CUcontext per ::CUdevice per other process. If the memory handle has already been opened by the current context, the reference count on the handle is incremented by 1 and the existing device pointer is returned. Memory returned from ::cuIpcOpenMemHandle must be freed with ::cuIpcCloseMemHandle. Calling ::cuMemFree on an exported memory region before calling ::cuIpcCloseMemHandle in the importing context will result in undefined behavior. IPC functionality is restricted to devices with support for unified addressing on Linux and Windows operating systems. IPC functionality on Windows is supported for compatibility purposes but not recommended as it comes with performance cost. Users can test their device for IPC functionality by calling ::cuapiDeviceGetAttribute with ::CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED \param pdptr - Returned device pointer \param handle - ::CUipcMemHandle to open \param Flags - Flags for this operation. Must be specified as ::CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS \returns ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_MAP_FAILED, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_TOO_MANY_PEERS, ::CUDA_ERROR_INVALID_VALUE \note No guarantees are made about the address returned in \p *pdptr. In particular, multiple processes may not receive the same address for the same \p handle. \sa ::cuMemAlloc, ::cuMemFree, ::cuIpcGetEventHandle, ::cuIpcOpenEventHandle, ::cuIpcGetMemHandle, ::cuIpcCloseMemHandle, ::cuCtxEnablePeerAccess, ::cuDeviceCanAccessPeer, ::cudaIpcOpenMemHandle*/ fn cuIpcOpenMemHandle_v2( pdptr: *mut cuda_types::cuda::CUdeviceptr, handle: cuda_types::cuda::CUipcMemHandle, Flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Attempts to close memory mapped with ::cuIpcOpenMemHandle Decrements the reference count of the memory returned by ::cuIpcOpenMemHandle by 1. When the reference count reaches 0, this API unmaps the memory. The original allocation in the exporting process as well as imported mappings in other processes will be unaffected. Any resources used to enable peer access will be freed if this is the last mapping using them. IPC functionality is restricted to devices with support for unified addressing on Linux and Windows operating systems. IPC functionality on Windows is supported for compatibility purposes but not recommended as it comes with performance cost. Users can test their device for IPC functionality by calling ::cuapiDeviceGetAttribute with ::CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED \param dptr - Device pointer returned by ::cuIpcOpenMemHandle \returns ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_MAP_FAILED, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_INVALID_VALUE \sa ::cuMemAlloc, ::cuMemFree, ::cuIpcGetEventHandle, ::cuIpcOpenEventHandle, ::cuIpcGetMemHandle, ::cuIpcOpenMemHandle, ::cudaIpcCloseMemHandle*/ fn cuIpcCloseMemHandle( dptr: cuda_types::cuda::CUdeviceptr, ) -> cuda_types::cuda::CUresult; /** \brief Registers an existing host memory range for use by CUDA Page-locks the memory range specified by \p p and \p bytesize and maps it for the device(s) as specified by \p Flags. This memory range also is added to the same tracking mechanism as ::cuMemHostAlloc to automatically accelerate calls to functions such as ::cuMemcpyHtoD(). Since the memory can be accessed directly by the device, it can be read or written with much higher bandwidth than pageable memory that has not been registered. Page-locking excessive amounts of memory may degrade system performance, since it reduces the amount of memory available to the system for paging. As a result, this function is best used sparingly to register staging areas for data exchange between host and device. On systems where ::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES is true, ::cuMemHostRegister will not page-lock the memory range specified by \p ptr but only populate unpopulated pages. The \p Flags parameter enables different options to be specified that affect the allocation, as follows. - ::CU_MEMHOSTREGISTER_PORTABLE: The memory returned by this call will be considered as pinned memory by all CUDA contexts, not just the one that performed the allocation. - ::CU_MEMHOSTREGISTER_DEVICEMAP: Maps the allocation into the CUDA address space. The device pointer to the memory may be obtained by calling ::cuMemHostGetDevicePointer(). - ::CU_MEMHOSTREGISTER_IOMEMORY: The pointer is treated as pointing to some I/O memory space, e.g. the PCI Express resource of a 3rd party device. - ::CU_MEMHOSTREGISTER_READ_ONLY: The pointer is treated as pointing to memory that is considered read-only by the device. On platforms without ::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES, this flag is required in order to register memory mapped to the CPU as read-only. Support for the use of this flag can be queried from the device attribute ::CU_DEVICE_ATTRIBUTE_READ_ONLY_HOST_REGISTER_SUPPORTED. Using this flag with a current context associated with a device that does not have this attribute set will cause ::cuMemHostRegister to error with CUDA_ERROR_NOT_SUPPORTED. All of these flags are orthogonal to one another: a developer may page-lock memory that is portable or mapped with no restrictions. The ::CU_MEMHOSTREGISTER_DEVICEMAP flag may be specified on CUDA contexts for devices that do not support mapped pinned memory. The failure is deferred to ::cuMemHostGetDevicePointer() because the memory may be mapped into other CUDA contexts via the ::CU_MEMHOSTREGISTER_PORTABLE flag. For devices that have a non-zero value for the device attribute ::CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM, the memory can also be accessed from the device using the host pointer \p p. The device pointer returned by ::cuMemHostGetDevicePointer() may or may not match the original host pointer \p ptr and depends on the devices visible to the application. If all devices visible to the application have a non-zero value for the device attribute, the device pointer returned by ::cuMemHostGetDevicePointer() will match the original pointer \p ptr. If any device visible to the application has a zero value for the device attribute, the device pointer returned by ::cuMemHostGetDevicePointer() will not match the original host pointer \p ptr, but it will be suitable for use on all devices provided Unified Virtual Addressing is enabled. In such systems, it is valid to access the memory using either pointer on devices that have a non-zero value for the device attribute. Note however that such devices should access the memory using only of the two pointers and not both. The memory page-locked by this function must be unregistered with ::cuMemHostUnregister(). \param p - Host pointer to memory to page-lock \param bytesize - Size in bytes of the address range to page-lock \param Flags - Flags for allocation request \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_OUT_OF_MEMORY, ::CUDA_ERROR_HOST_MEMORY_ALREADY_REGISTERED, ::CUDA_ERROR_NOT_PERMITTED, ::CUDA_ERROR_NOT_SUPPORTED \notefnerr \sa ::cuMemHostUnregister, ::cuMemHostGetFlags, ::cuMemHostGetDevicePointer, ::cudaHostRegister*/ fn cuMemHostRegister_v2( p: *mut ::core::ffi::c_void, bytesize: usize, Flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Unregisters a memory range that was registered with cuMemHostRegister. Unmaps the memory range whose base address is specified by \p p, and makes it pageable again. The base address must be the same one specified to ::cuMemHostRegister(). \param p - Host pointer to memory to unregister \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_OUT_OF_MEMORY, ::CUDA_ERROR_HOST_MEMORY_NOT_REGISTERED, \notefnerr \sa ::cuMemHostRegister, ::cudaHostUnregister*/ fn cuMemHostUnregister(p: *mut ::core::ffi::c_void) -> cuda_types::cuda::CUresult; /** \brief Copies memory Copies data between two pointers. \p dst and \p src are base pointers of the destination and source, respectively. \p ByteCount specifies the number of bytes to copy. Note that this function infers the type of the transfer (host to host, host to device, device to device, or device to host) from the pointer values. This function is only allowed in contexts which support unified addressing. \param dst - Destination unified virtual address space pointer \param src - Source unified virtual address space pointer \param ByteCount - Size of memory copy in bytes \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \note_sync \note_memcpy \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D16, ::cuMemsetD2D32, ::cuMemsetD8, ::cuMemsetD16, ::cuMemsetD32, ::cudaMemcpy, ::cudaMemcpyToSymbol, ::cudaMemcpyFromSymbol*/ fn cuMemcpy_ptds( dst: cuda_types::cuda::CUdeviceptr, src: cuda_types::cuda::CUdeviceptr, ByteCount: usize, ) -> cuda_types::cuda::CUresult; /** \brief Copies device memory between two contexts Copies from device memory in one context to device memory in another context. \p dstDevice is the base device pointer of the destination memory and \p dstContext is the destination context. \p srcDevice is the base device pointer of the source memory and \p srcContext is the source pointer. \p ByteCount specifies the number of bytes to copy. \param dstDevice - Destination device pointer \param dstContext - Destination context \param srcDevice - Source device pointer \param srcContext - Source context \param ByteCount - Size of memory copy in bytes \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \note_sync \sa ::cuMemcpyDtoD, ::cuMemcpy3DPeer, ::cuMemcpyDtoDAsync, ::cuMemcpyPeerAsync, ::cuMemcpy3DPeerAsync, ::cudaMemcpyPeer*/ fn cuMemcpyPeer_ptds( dstDevice: cuda_types::cuda::CUdeviceptr, dstContext: cuda_types::cuda::CUcontext, srcDevice: cuda_types::cuda::CUdeviceptr, srcContext: cuda_types::cuda::CUcontext, ByteCount: usize, ) -> cuda_types::cuda::CUresult; /** \brief Copies memory from Host to Device Copies from host memory to device memory. \p dstDevice and \p srcHost are the base addresses of the destination and source, respectively. \p ByteCount specifies the number of bytes to copy. \param dstDevice - Destination device pointer \param srcHost - Source host pointer \param ByteCount - Size of memory copy in bytes \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \note_sync \note_memcpy \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D16, ::cuMemsetD2D32, ::cuMemsetD8, ::cuMemsetD16, ::cuMemsetD32, ::cudaMemcpy, ::cudaMemcpyToSymbol*/ fn cuMemcpyHtoD_v2_ptds( dstDevice: cuda_types::cuda::CUdeviceptr, srcHost: *const ::core::ffi::c_void, ByteCount: usize, ) -> cuda_types::cuda::CUresult; /** \brief Copies memory from Device to Host Copies from device to host memory. \p dstHost and \p srcDevice specify the base pointers of the destination and source, respectively. \p ByteCount specifies the number of bytes to copy. \param dstHost - Destination host pointer \param srcDevice - Source device pointer \param ByteCount - Size of memory copy in bytes \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \note_sync \note_memcpy \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D16, ::cuMemsetD2D32, ::cuMemsetD8, ::cuMemsetD16, ::cuMemsetD32, ::cudaMemcpy, ::cudaMemcpyFromSymbol*/ fn cuMemcpyDtoH_v2_ptds( dstHost: *mut ::core::ffi::c_void, srcDevice: cuda_types::cuda::CUdeviceptr, ByteCount: usize, ) -> cuda_types::cuda::CUresult; /** \brief Copies memory from Device to Device Copies from device memory to device memory. \p dstDevice and \p srcDevice are the base pointers of the destination and source, respectively. \p ByteCount specifies the number of bytes to copy. \param dstDevice - Destination device pointer \param srcDevice - Source device pointer \param ByteCount - Size of memory copy in bytes \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \note_sync \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D16, ::cuMemsetD2D32, ::cuMemsetD8, ::cuMemsetD16, ::cuMemsetD32, ::cudaMemcpy, ::cudaMemcpyToSymbol, ::cudaMemcpyFromSymbol*/ fn cuMemcpyDtoD_v2_ptds( dstDevice: cuda_types::cuda::CUdeviceptr, srcDevice: cuda_types::cuda::CUdeviceptr, ByteCount: usize, ) -> cuda_types::cuda::CUresult; /** \brief Copies memory from Device to Array Copies from device memory to a 1D CUDA array. \p dstArray and \p dstOffset specify the CUDA array handle and starting index of the destination data. \p srcDevice specifies the base pointer of the source. \p ByteCount specifies the number of bytes to copy. \param dstArray - Destination array \param dstOffset - Offset in bytes of destination array \param srcDevice - Source device pointer \param ByteCount - Size of memory copy in bytes \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \note_sync \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D16, ::cuMemsetD2D32, ::cuMemsetD8, ::cuMemsetD16, ::cuMemsetD32, ::cudaMemcpyToArray*/ fn cuMemcpyDtoA_v2_ptds( dstArray: cuda_types::cuda::CUarray, dstOffset: usize, srcDevice: cuda_types::cuda::CUdeviceptr, ByteCount: usize, ) -> cuda_types::cuda::CUresult; /** \brief Copies memory from Array to Device Copies from one 1D CUDA array to device memory. \p dstDevice specifies the base pointer of the destination and must be naturally aligned with the CUDA array elements. \p srcArray and \p srcOffset specify the CUDA array handle and the offset in bytes into the array where the copy is to begin. \p ByteCount specifies the number of bytes to copy and must be evenly divisible by the array element size. \param dstDevice - Destination device pointer \param srcArray - Source array \param srcOffset - Offset in bytes of source array \param ByteCount - Size of memory copy in bytes \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \note_sync \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D16, ::cuMemsetD2D32, ::cuMemsetD8, ::cuMemsetD16, ::cuMemsetD32, ::cudaMemcpyFromArray*/ fn cuMemcpyAtoD_v2_ptds( dstDevice: cuda_types::cuda::CUdeviceptr, srcArray: cuda_types::cuda::CUarray, srcOffset: usize, ByteCount: usize, ) -> cuda_types::cuda::CUresult; /** \brief Copies memory from Host to Array Copies from host memory to a 1D CUDA array. \p dstArray and \p dstOffset specify the CUDA array handle and starting offset in bytes of the destination data. \p pSrc specifies the base address of the source. \p ByteCount specifies the number of bytes to copy. \param dstArray - Destination array \param dstOffset - Offset in bytes of destination array \param srcHost - Source host pointer \param ByteCount - Size of memory copy in bytes \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \note_sync \note_memcpy \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D16, ::cuMemsetD2D32, ::cuMemsetD8, ::cuMemsetD16, ::cuMemsetD32, ::cudaMemcpyToArray*/ fn cuMemcpyHtoA_v2_ptds( dstArray: cuda_types::cuda::CUarray, dstOffset: usize, srcHost: *const ::core::ffi::c_void, ByteCount: usize, ) -> cuda_types::cuda::CUresult; /** \brief Copies memory from Array to Host Copies from one 1D CUDA array to host memory. \p dstHost specifies the base pointer of the destination. \p srcArray and \p srcOffset specify the CUDA array handle and starting offset in bytes of the source data. \p ByteCount specifies the number of bytes to copy. \param dstHost - Destination device pointer \param srcArray - Source array \param srcOffset - Offset in bytes of source array \param ByteCount - Size of memory copy in bytes \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \note_sync \note_memcpy \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D16, ::cuMemsetD2D32, ::cuMemsetD8, ::cuMemsetD16, ::cuMemsetD32, ::cudaMemcpyFromArray*/ fn cuMemcpyAtoH_v2_ptds( dstHost: *mut ::core::ffi::c_void, srcArray: cuda_types::cuda::CUarray, srcOffset: usize, ByteCount: usize, ) -> cuda_types::cuda::CUresult; /** \brief Copies memory from Array to Array Copies from one 1D CUDA array to another. \p dstArray and \p srcArray specify the handles of the destination and source CUDA arrays for the copy, respectively. \p dstOffset and \p srcOffset specify the destination and source offsets in bytes into the CUDA arrays. \p ByteCount is the number of bytes to be copied. The size of the elements in the CUDA arrays need not be the same format, but the elements must be the same size; and count must be evenly divisible by that size. \param dstArray - Destination array \param dstOffset - Offset in bytes of destination array \param srcArray - Source array \param srcOffset - Offset in bytes of source array \param ByteCount - Size of memory copy in bytes \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \note_sync \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D16, ::cuMemsetD2D32, ::cuMemsetD8, ::cuMemsetD16, ::cuMemsetD32, ::cudaMemcpyArrayToArray*/ fn cuMemcpyAtoA_v2_ptds( dstArray: cuda_types::cuda::CUarray, dstOffset: usize, srcArray: cuda_types::cuda::CUarray, srcOffset: usize, ByteCount: usize, ) -> cuda_types::cuda::CUresult; /** \brief Copies memory for 2D arrays Perform a 2D memory copy according to the parameters specified in \p pCopy. The ::CUDA_MEMCPY2D structure is defined as: \code typedef struct CUDA_MEMCPY2D_st { unsigned int srcXInBytes, srcY; CUmemorytype srcMemoryType; const void *srcHost; CUdeviceptr srcDevice; CUarray srcArray; unsigned int srcPitch; unsigned int dstXInBytes, dstY; CUmemorytype dstMemoryType; void *dstHost; CUdeviceptr dstDevice; CUarray dstArray; unsigned int dstPitch; unsigned int WidthInBytes; unsigned int Height; } CUDA_MEMCPY2D; \endcode where: - ::srcMemoryType and ::dstMemoryType specify the type of memory of the source and destination, respectively; ::CUmemorytype_enum is defined as: \code typedef enum CUmemorytype_enum { CU_MEMORYTYPE_HOST = 0x01, CU_MEMORYTYPE_DEVICE = 0x02, CU_MEMORYTYPE_ARRAY = 0x03, CU_MEMORYTYPE_UNIFIED = 0x04 } CUmemorytype; \endcode \par If ::srcMemoryType is ::CU_MEMORYTYPE_UNIFIED, ::srcDevice and ::srcPitch specify the (unified virtual address space) base address of the source data and the bytes per row to apply. ::srcArray is ignored. This value may be used only if unified addressing is supported in the calling context. \par If ::srcMemoryType is ::CU_MEMORYTYPE_HOST, ::srcHost and ::srcPitch specify the (host) base address of the source data and the bytes per row to apply. ::srcArray is ignored. \par If ::srcMemoryType is ::CU_MEMORYTYPE_DEVICE, ::srcDevice and ::srcPitch specify the (device) base address of the source data and the bytes per row to apply. ::srcArray is ignored. \par If ::srcMemoryType is ::CU_MEMORYTYPE_ARRAY, ::srcArray specifies the handle of the source data. ::srcHost, ::srcDevice and ::srcPitch are ignored. \par If ::dstMemoryType is ::CU_MEMORYTYPE_HOST, ::dstHost and ::dstPitch specify the (host) base address of the destination data and the bytes per row to apply. ::dstArray is ignored. \par If ::dstMemoryType is ::CU_MEMORYTYPE_UNIFIED, ::dstDevice and ::dstPitch specify the (unified virtual address space) base address of the source data and the bytes per row to apply. ::dstArray is ignored. This value may be used only if unified addressing is supported in the calling context. \par If ::dstMemoryType is ::CU_MEMORYTYPE_DEVICE, ::dstDevice and ::dstPitch specify the (device) base address of the destination data and the bytes per row to apply. ::dstArray is ignored. \par If ::dstMemoryType is ::CU_MEMORYTYPE_ARRAY, ::dstArray specifies the handle of the destination data. ::dstHost, ::dstDevice and ::dstPitch are ignored. - ::srcXInBytes and ::srcY specify the base address of the source data for the copy. \par For host pointers, the starting address is \code void* Start = (void*)((char*)srcHost+srcY*srcPitch + srcXInBytes); \endcode \par For device pointers, the starting address is \code CUdeviceptr Start = srcDevice+srcY*srcPitch+srcXInBytes; \endcode \par For CUDA arrays, ::srcXInBytes must be evenly divisible by the array element size. - ::dstXInBytes and ::dstY specify the base address of the destination data for the copy. \par For host pointers, the base address is \code void* dstStart = (void*)((char*)dstHost+dstY*dstPitch + dstXInBytes); \endcode \par For device pointers, the starting address is \code CUdeviceptr dstStart = dstDevice+dstY*dstPitch+dstXInBytes; \endcode \par For CUDA arrays, ::dstXInBytes must be evenly divisible by the array element size. - ::WidthInBytes and ::Height specify the width (in bytes) and height of the 2D copy being performed. - If specified, ::srcPitch must be greater than or equal to ::WidthInBytes + ::srcXInBytes, and ::dstPitch must be greater than or equal to ::WidthInBytes + dstXInBytes. \par ::cuMemcpy2D() returns an error if any pitch is greater than the maximum allowed (::CU_DEVICE_ATTRIBUTE_MAX_PITCH). ::cuMemAllocPitch() passes back pitches that always work with ::cuMemcpy2D(). On intra-device memory copies (device to device, CUDA array to device, CUDA array to CUDA array), ::cuMemcpy2D() may fail for pitches not computed by ::cuMemAllocPitch(). ::cuMemcpy2DUnaligned() does not have this restriction, but may run significantly slower in the cases where ::cuMemcpy2D() would have returned an error code. \param pCopy - Parameters for the memory copy \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \note_sync \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D16, ::cuMemsetD2D32, ::cuMemsetD8, ::cuMemsetD16, ::cuMemsetD32, ::cudaMemcpy2D, ::cudaMemcpy2DToArray, ::cudaMemcpy2DFromArray*/ fn cuMemcpy2D_v2_ptds( pCopy: *const cuda_types::cuda::CUDA_MEMCPY2D, ) -> cuda_types::cuda::CUresult; /** \brief Copies memory for 2D arrays Perform a 2D memory copy according to the parameters specified in \p pCopy. The ::CUDA_MEMCPY2D structure is defined as: \code typedef struct CUDA_MEMCPY2D_st { unsigned int srcXInBytes, srcY; CUmemorytype srcMemoryType; const void *srcHost; CUdeviceptr srcDevice; CUarray srcArray; unsigned int srcPitch; unsigned int dstXInBytes, dstY; CUmemorytype dstMemoryType; void *dstHost; CUdeviceptr dstDevice; CUarray dstArray; unsigned int dstPitch; unsigned int WidthInBytes; unsigned int Height; } CUDA_MEMCPY2D; \endcode where: - ::srcMemoryType and ::dstMemoryType specify the type of memory of the source and destination, respectively; ::CUmemorytype_enum is defined as: \code typedef enum CUmemorytype_enum { CU_MEMORYTYPE_HOST = 0x01, CU_MEMORYTYPE_DEVICE = 0x02, CU_MEMORYTYPE_ARRAY = 0x03, CU_MEMORYTYPE_UNIFIED = 0x04 } CUmemorytype; \endcode \par If ::srcMemoryType is ::CU_MEMORYTYPE_UNIFIED, ::srcDevice and ::srcPitch specify the (unified virtual address space) base address of the source data and the bytes per row to apply. ::srcArray is ignored. This value may be used only if unified addressing is supported in the calling context. \par If ::srcMemoryType is ::CU_MEMORYTYPE_HOST, ::srcHost and ::srcPitch specify the (host) base address of the source data and the bytes per row to apply. ::srcArray is ignored. \par If ::srcMemoryType is ::CU_MEMORYTYPE_DEVICE, ::srcDevice and ::srcPitch specify the (device) base address of the source data and the bytes per row to apply. ::srcArray is ignored. \par If ::srcMemoryType is ::CU_MEMORYTYPE_ARRAY, ::srcArray specifies the handle of the source data. ::srcHost, ::srcDevice and ::srcPitch are ignored. \par If ::dstMemoryType is ::CU_MEMORYTYPE_UNIFIED, ::dstDevice and ::dstPitch specify the (unified virtual address space) base address of the source data and the bytes per row to apply. ::dstArray is ignored. This value may be used only if unified addressing is supported in the calling context. \par If ::dstMemoryType is ::CU_MEMORYTYPE_HOST, ::dstHost and ::dstPitch specify the (host) base address of the destination data and the bytes per row to apply. ::dstArray is ignored. \par If ::dstMemoryType is ::CU_MEMORYTYPE_DEVICE, ::dstDevice and ::dstPitch specify the (device) base address of the destination data and the bytes per row to apply. ::dstArray is ignored. \par If ::dstMemoryType is ::CU_MEMORYTYPE_ARRAY, ::dstArray specifies the handle of the destination data. ::dstHost, ::dstDevice and ::dstPitch are ignored. - ::srcXInBytes and ::srcY specify the base address of the source data for the copy. \par For host pointers, the starting address is \code void* Start = (void*)((char*)srcHost+srcY*srcPitch + srcXInBytes); \endcode \par For device pointers, the starting address is \code CUdeviceptr Start = srcDevice+srcY*srcPitch+srcXInBytes; \endcode \par For CUDA arrays, ::srcXInBytes must be evenly divisible by the array element size. - ::dstXInBytes and ::dstY specify the base address of the destination data for the copy. \par For host pointers, the base address is \code void* dstStart = (void*)((char*)dstHost+dstY*dstPitch + dstXInBytes); \endcode \par For device pointers, the starting address is \code CUdeviceptr dstStart = dstDevice+dstY*dstPitch+dstXInBytes; \endcode \par For CUDA arrays, ::dstXInBytes must be evenly divisible by the array element size. - ::WidthInBytes and ::Height specify the width (in bytes) and height of the 2D copy being performed. - If specified, ::srcPitch must be greater than or equal to ::WidthInBytes + ::srcXInBytes, and ::dstPitch must be greater than or equal to ::WidthInBytes + dstXInBytes. \par ::cuMemcpy2D() returns an error if any pitch is greater than the maximum allowed (::CU_DEVICE_ATTRIBUTE_MAX_PITCH). ::cuMemAllocPitch() passes back pitches that always work with ::cuMemcpy2D(). On intra-device memory copies (device to device, CUDA array to device, CUDA array to CUDA array), ::cuMemcpy2D() may fail for pitches not computed by ::cuMemAllocPitch(). ::cuMemcpy2DUnaligned() does not have this restriction, but may run significantly slower in the cases where ::cuMemcpy2D() would have returned an error code. \param pCopy - Parameters for the memory copy \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \note_sync \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D16, ::cuMemsetD2D32, ::cuMemsetD8, ::cuMemsetD16, ::cuMemsetD32, ::cudaMemcpy2D, ::cudaMemcpy2DToArray, ::cudaMemcpy2DFromArray*/ fn cuMemcpy2DUnaligned_v2_ptds( pCopy: *const cuda_types::cuda::CUDA_MEMCPY2D, ) -> cuda_types::cuda::CUresult; /** \brief Copies memory for 3D arrays Perform a 3D memory copy according to the parameters specified in \p pCopy. The ::CUDA_MEMCPY3D structure is defined as: \code typedef struct CUDA_MEMCPY3D_st { unsigned int srcXInBytes, srcY, srcZ; unsigned int srcLOD; CUmemorytype srcMemoryType; const void *srcHost; CUdeviceptr srcDevice; CUarray srcArray; unsigned int srcPitch; // ignored when src is array unsigned int srcHeight; // ignored when src is array; may be 0 if Depth==1 unsigned int dstXInBytes, dstY, dstZ; unsigned int dstLOD; CUmemorytype dstMemoryType; void *dstHost; CUdeviceptr dstDevice; CUarray dstArray; unsigned int dstPitch; // ignored when dst is array unsigned int dstHeight; // ignored when dst is array; may be 0 if Depth==1 unsigned int WidthInBytes; unsigned int Height; unsigned int Depth; } CUDA_MEMCPY3D; \endcode where: - ::srcMemoryType and ::dstMemoryType specify the type of memory of the source and destination, respectively; ::CUmemorytype_enum is defined as: \code typedef enum CUmemorytype_enum { CU_MEMORYTYPE_HOST = 0x01, CU_MEMORYTYPE_DEVICE = 0x02, CU_MEMORYTYPE_ARRAY = 0x03, CU_MEMORYTYPE_UNIFIED = 0x04 } CUmemorytype; \endcode \par If ::srcMemoryType is ::CU_MEMORYTYPE_UNIFIED, ::srcDevice and ::srcPitch specify the (unified virtual address space) base address of the source data and the bytes per row to apply. ::srcArray is ignored. This value may be used only if unified addressing is supported in the calling context. \par If ::srcMemoryType is ::CU_MEMORYTYPE_HOST, ::srcHost, ::srcPitch and ::srcHeight specify the (host) base address of the source data, the bytes per row, and the height of each 2D slice of the 3D array. ::srcArray is ignored. \par If ::srcMemoryType is ::CU_MEMORYTYPE_DEVICE, ::srcDevice, ::srcPitch and ::srcHeight specify the (device) base address of the source data, the bytes per row, and the height of each 2D slice of the 3D array. ::srcArray is ignored. \par If ::srcMemoryType is ::CU_MEMORYTYPE_ARRAY, ::srcArray specifies the handle of the source data. ::srcHost, ::srcDevice, ::srcPitch and ::srcHeight are ignored. \par If ::dstMemoryType is ::CU_MEMORYTYPE_UNIFIED, ::dstDevice and ::dstPitch specify the (unified virtual address space) base address of the source data and the bytes per row to apply. ::dstArray is ignored. This value may be used only if unified addressing is supported in the calling context. \par If ::dstMemoryType is ::CU_MEMORYTYPE_HOST, ::dstHost and ::dstPitch specify the (host) base address of the destination data, the bytes per row, and the height of each 2D slice of the 3D array. ::dstArray is ignored. \par If ::dstMemoryType is ::CU_MEMORYTYPE_DEVICE, ::dstDevice and ::dstPitch specify the (device) base address of the destination data, the bytes per row, and the height of each 2D slice of the 3D array. ::dstArray is ignored. \par If ::dstMemoryType is ::CU_MEMORYTYPE_ARRAY, ::dstArray specifies the handle of the destination data. ::dstHost, ::dstDevice, ::dstPitch and ::dstHeight are ignored. - ::srcXInBytes, ::srcY and ::srcZ specify the base address of the source data for the copy. \par For host pointers, the starting address is \code void* Start = (void*)((char*)srcHost+(srcZ*srcHeight+srcY)*srcPitch + srcXInBytes); \endcode \par For device pointers, the starting address is \code CUdeviceptr Start = srcDevice+(srcZ*srcHeight+srcY)*srcPitch+srcXInBytes; \endcode \par For CUDA arrays, ::srcXInBytes must be evenly divisible by the array element size. - dstXInBytes, ::dstY and ::dstZ specify the base address of the destination data for the copy. \par For host pointers, the base address is \code void* dstStart = (void*)((char*)dstHost+(dstZ*dstHeight+dstY)*dstPitch + dstXInBytes); \endcode \par For device pointers, the starting address is \code CUdeviceptr dstStart = dstDevice+(dstZ*dstHeight+dstY)*dstPitch+dstXInBytes; \endcode \par For CUDA arrays, ::dstXInBytes must be evenly divisible by the array element size. - ::WidthInBytes, ::Height and ::Depth specify the width (in bytes), height and depth of the 3D copy being performed. - If specified, ::srcPitch must be greater than or equal to ::WidthInBytes + ::srcXInBytes, and ::dstPitch must be greater than or equal to ::WidthInBytes + dstXInBytes. - If specified, ::srcHeight must be greater than or equal to ::Height + ::srcY, and ::dstHeight must be greater than or equal to ::Height + ::dstY. \par ::cuMemcpy3D() returns an error if any pitch is greater than the maximum allowed (::CU_DEVICE_ATTRIBUTE_MAX_PITCH). The ::srcLOD and ::dstLOD members of the ::CUDA_MEMCPY3D structure must be set to 0. \param pCopy - Parameters for the memory copy \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \note_sync \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D16, ::cuMemsetD2D32, ::cuMemsetD8, ::cuMemsetD16, ::cuMemsetD32, ::cudaMemcpy3D*/ fn cuMemcpy3D_v2_ptds( pCopy: *const cuda_types::cuda::CUDA_MEMCPY3D, ) -> cuda_types::cuda::CUresult; /** \brief Copies memory between contexts Perform a 3D memory copy according to the parameters specified in \p pCopy. See the definition of the ::CUDA_MEMCPY3D_PEER structure for documentation of its parameters. \param pCopy - Parameters for the memory copy \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \note_sync \sa ::cuMemcpyDtoD, ::cuMemcpyPeer, ::cuMemcpyDtoDAsync, ::cuMemcpyPeerAsync, ::cuMemcpy3DPeerAsync, ::cudaMemcpy3DPeer*/ fn cuMemcpy3DPeer_ptds( pCopy: *const cuda_types::cuda::CUDA_MEMCPY3D_PEER, ) -> cuda_types::cuda::CUresult; /** \brief Copies memory asynchronously Copies data between two pointers. \p dst and \p src are base pointers of the destination and source, respectively. \p ByteCount specifies the number of bytes to copy. Note that this function infers the type of the transfer (host to host, host to device, device to device, or device to host) from the pointer values. This function is only allowed in contexts which support unified addressing. \param dst - Destination unified virtual address space pointer \param src - Source unified virtual address space pointer \param ByteCount - Size of memory copy in bytes \param hStream - Stream identifier \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE \notefnerr \note_async \note_null_stream \note_memcpy \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D8Async, ::cuMemsetD2D16, ::cuMemsetD2D16Async, ::cuMemsetD2D32, ::cuMemsetD2D32Async, ::cuMemsetD8, ::cuMemsetD8Async, ::cuMemsetD16, ::cuMemsetD16Async, ::cuMemsetD32, ::cuMemsetD32Async, ::cudaMemcpyAsync, ::cudaMemcpyToSymbolAsync, ::cudaMemcpyFromSymbolAsync*/ fn cuMemcpyAsync_ptsz( dst: cuda_types::cuda::CUdeviceptr, src: cuda_types::cuda::CUdeviceptr, ByteCount: usize, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Copies device memory between two contexts asynchronously. Copies from device memory in one context to device memory in another context. \p dstDevice is the base device pointer of the destination memory and \p dstContext is the destination context. \p srcDevice is the base device pointer of the source memory and \p srcContext is the source pointer. \p ByteCount specifies the number of bytes to copy. \param dstDevice - Destination device pointer \param dstContext - Destination context \param srcDevice - Source device pointer \param srcContext - Source context \param ByteCount - Size of memory copy in bytes \param hStream - Stream identifier \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE \notefnerr \note_async \note_null_stream \sa ::cuMemcpyDtoD, ::cuMemcpyPeer, ::cuMemcpy3DPeer, ::cuMemcpyDtoDAsync, ::cuMemcpy3DPeerAsync, ::cudaMemcpyPeerAsync*/ fn cuMemcpyPeerAsync_ptsz( dstDevice: cuda_types::cuda::CUdeviceptr, dstContext: cuda_types::cuda::CUcontext, srcDevice: cuda_types::cuda::CUdeviceptr, srcContext: cuda_types::cuda::CUcontext, ByteCount: usize, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Copies memory from Host to Device Copies from host memory to device memory. \p dstDevice and \p srcHost are the base addresses of the destination and source, respectively. \p ByteCount specifies the number of bytes to copy. \param dstDevice - Destination device pointer \param srcHost - Source host pointer \param ByteCount - Size of memory copy in bytes \param hStream - Stream identifier \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE \notefnerr \note_async \note_null_stream \note_memcpy \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D8Async, ::cuMemsetD2D16, ::cuMemsetD2D16Async, ::cuMemsetD2D32, ::cuMemsetD2D32Async, ::cuMemsetD8, ::cuMemsetD8Async, ::cuMemsetD16, ::cuMemsetD16Async, ::cuMemsetD32, ::cuMemsetD32Async, ::cudaMemcpyAsync, ::cudaMemcpyToSymbolAsync*/ fn cuMemcpyHtoDAsync_v2_ptsz( dstDevice: cuda_types::cuda::CUdeviceptr, srcHost: *const ::core::ffi::c_void, ByteCount: usize, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Copies memory from Device to Host Copies from device to host memory. \p dstHost and \p srcDevice specify the base pointers of the destination and source, respectively. \p ByteCount specifies the number of bytes to copy. \param dstHost - Destination host pointer \param srcDevice - Source device pointer \param ByteCount - Size of memory copy in bytes \param hStream - Stream identifier \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE \notefnerr \note_async \note_null_stream \note_memcpy \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D8Async, ::cuMemsetD2D16, ::cuMemsetD2D16Async, ::cuMemsetD2D32, ::cuMemsetD2D32Async, ::cuMemsetD8, ::cuMemsetD8Async, ::cuMemsetD16, ::cuMemsetD16Async, ::cuMemsetD32, ::cuMemsetD32Async, ::cudaMemcpyAsync, ::cudaMemcpyFromSymbolAsync*/ fn cuMemcpyDtoHAsync_v2_ptsz( dstHost: *mut ::core::ffi::c_void, srcDevice: cuda_types::cuda::CUdeviceptr, ByteCount: usize, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Copies memory from Device to Device Copies from device memory to device memory. \p dstDevice and \p srcDevice are the base pointers of the destination and source, respectively. \p ByteCount specifies the number of bytes to copy. \param dstDevice - Destination device pointer \param srcDevice - Source device pointer \param ByteCount - Size of memory copy in bytes \param hStream - Stream identifier \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE \notefnerr \note_async \note_null_stream \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D8Async, ::cuMemsetD2D16, ::cuMemsetD2D16Async, ::cuMemsetD2D32, ::cuMemsetD2D32Async, ::cuMemsetD8, ::cuMemsetD8Async, ::cuMemsetD16, ::cuMemsetD16Async, ::cuMemsetD32, ::cuMemsetD32Async, ::cudaMemcpyAsync, ::cudaMemcpyToSymbolAsync, ::cudaMemcpyFromSymbolAsync*/ fn cuMemcpyDtoDAsync_v2_ptsz( dstDevice: cuda_types::cuda::CUdeviceptr, srcDevice: cuda_types::cuda::CUdeviceptr, ByteCount: usize, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Copies memory from Host to Array Copies from host memory to a 1D CUDA array. \p dstArray and \p dstOffset specify the CUDA array handle and starting offset in bytes of the destination data. \p srcHost specifies the base address of the source. \p ByteCount specifies the number of bytes to copy. \param dstArray - Destination array \param dstOffset - Offset in bytes of destination array \param srcHost - Source host pointer \param ByteCount - Size of memory copy in bytes \param hStream - Stream identifier \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE \notefnerr \note_async \note_null_stream \note_memcpy \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D8Async, ::cuMemsetD2D16, ::cuMemsetD2D16Async, ::cuMemsetD2D32, ::cuMemsetD2D32Async, ::cuMemsetD8, ::cuMemsetD8Async, ::cuMemsetD16, ::cuMemsetD16Async, ::cuMemsetD32, ::cuMemsetD32Async, ::cudaMemcpyToArrayAsync*/ fn cuMemcpyHtoAAsync_v2_ptsz( dstArray: cuda_types::cuda::CUarray, dstOffset: usize, srcHost: *const ::core::ffi::c_void, ByteCount: usize, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Copies memory from Array to Host Copies from one 1D CUDA array to host memory. \p dstHost specifies the base pointer of the destination. \p srcArray and \p srcOffset specify the CUDA array handle and starting offset in bytes of the source data. \p ByteCount specifies the number of bytes to copy. \param dstHost - Destination pointer \param srcArray - Source array \param srcOffset - Offset in bytes of source array \param ByteCount - Size of memory copy in bytes \param hStream - Stream identifier \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE \notefnerr \note_async \note_null_stream \note_memcpy \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D8Async, ::cuMemsetD2D16, ::cuMemsetD2D16Async, ::cuMemsetD2D32, ::cuMemsetD2D32Async, ::cuMemsetD8, ::cuMemsetD8Async, ::cuMemsetD16, ::cuMemsetD16Async, ::cuMemsetD32, ::cuMemsetD32Async, ::cudaMemcpyFromArrayAsync*/ fn cuMemcpyAtoHAsync_v2_ptsz( dstHost: *mut ::core::ffi::c_void, srcArray: cuda_types::cuda::CUarray, srcOffset: usize, ByteCount: usize, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Copies memory for 2D arrays Perform a 2D memory copy according to the parameters specified in \p pCopy. The ::CUDA_MEMCPY2D structure is defined as: \code typedef struct CUDA_MEMCPY2D_st { unsigned int srcXInBytes, srcY; CUmemorytype srcMemoryType; const void *srcHost; CUdeviceptr srcDevice; CUarray srcArray; unsigned int srcPitch; unsigned int dstXInBytes, dstY; CUmemorytype dstMemoryType; void *dstHost; CUdeviceptr dstDevice; CUarray dstArray; unsigned int dstPitch; unsigned int WidthInBytes; unsigned int Height; } CUDA_MEMCPY2D; \endcode where: - ::srcMemoryType and ::dstMemoryType specify the type of memory of the source and destination, respectively; ::CUmemorytype_enum is defined as: \code typedef enum CUmemorytype_enum { CU_MEMORYTYPE_HOST = 0x01, CU_MEMORYTYPE_DEVICE = 0x02, CU_MEMORYTYPE_ARRAY = 0x03, CU_MEMORYTYPE_UNIFIED = 0x04 } CUmemorytype; \endcode \par If ::srcMemoryType is ::CU_MEMORYTYPE_HOST, ::srcHost and ::srcPitch specify the (host) base address of the source data and the bytes per row to apply. ::srcArray is ignored. \par If ::srcMemoryType is ::CU_MEMORYTYPE_UNIFIED, ::srcDevice and ::srcPitch specify the (unified virtual address space) base address of the source data and the bytes per row to apply. ::srcArray is ignored. This value may be used only if unified addressing is supported in the calling context. \par If ::srcMemoryType is ::CU_MEMORYTYPE_DEVICE, ::srcDevice and ::srcPitch specify the (device) base address of the source data and the bytes per row to apply. ::srcArray is ignored. \par If ::srcMemoryType is ::CU_MEMORYTYPE_ARRAY, ::srcArray specifies the handle of the source data. ::srcHost, ::srcDevice and ::srcPitch are ignored. \par If ::dstMemoryType is ::CU_MEMORYTYPE_UNIFIED, ::dstDevice and ::dstPitch specify the (unified virtual address space) base address of the source data and the bytes per row to apply. ::dstArray is ignored. This value may be used only if unified addressing is supported in the calling context. \par If ::dstMemoryType is ::CU_MEMORYTYPE_HOST, ::dstHost and ::dstPitch specify the (host) base address of the destination data and the bytes per row to apply. ::dstArray is ignored. \par If ::dstMemoryType is ::CU_MEMORYTYPE_DEVICE, ::dstDevice and ::dstPitch specify the (device) base address of the destination data and the bytes per row to apply. ::dstArray is ignored. \par If ::dstMemoryType is ::CU_MEMORYTYPE_ARRAY, ::dstArray specifies the handle of the destination data. ::dstHost, ::dstDevice and ::dstPitch are ignored. - ::srcXInBytes and ::srcY specify the base address of the source data for the copy. \par For host pointers, the starting address is \code void* Start = (void*)((char*)srcHost+srcY*srcPitch + srcXInBytes); \endcode \par For device pointers, the starting address is \code CUdeviceptr Start = srcDevice+srcY*srcPitch+srcXInBytes; \endcode \par For CUDA arrays, ::srcXInBytes must be evenly divisible by the array element size. - ::dstXInBytes and ::dstY specify the base address of the destination data for the copy. \par For host pointers, the base address is \code void* dstStart = (void*)((char*)dstHost+dstY*dstPitch + dstXInBytes); \endcode \par For device pointers, the starting address is \code CUdeviceptr dstStart = dstDevice+dstY*dstPitch+dstXInBytes; \endcode \par For CUDA arrays, ::dstXInBytes must be evenly divisible by the array element size. - ::WidthInBytes and ::Height specify the width (in bytes) and height of the 2D copy being performed. - If specified, ::srcPitch must be greater than or equal to ::WidthInBytes + ::srcXInBytes, and ::dstPitch must be greater than or equal to ::WidthInBytes + dstXInBytes. - If specified, ::srcPitch must be greater than or equal to ::WidthInBytes + ::srcXInBytes, and ::dstPitch must be greater than or equal to ::WidthInBytes + dstXInBytes. - If specified, ::srcHeight must be greater than or equal to ::Height + ::srcY, and ::dstHeight must be greater than or equal to ::Height + ::dstY. \par ::cuMemcpy2DAsync() returns an error if any pitch is greater than the maximum allowed (::CU_DEVICE_ATTRIBUTE_MAX_PITCH). ::cuMemAllocPitch() passes back pitches that always work with ::cuMemcpy2D(). On intra-device memory copies (device to device, CUDA array to device, CUDA array to CUDA array), ::cuMemcpy2DAsync() may fail for pitches not computed by ::cuMemAllocPitch(). \param pCopy - Parameters for the memory copy \param hStream - Stream identifier \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE \notefnerr \note_async \note_null_stream \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D8Async, ::cuMemsetD2D16, ::cuMemsetD2D16Async, ::cuMemsetD2D32, ::cuMemsetD2D32Async, ::cuMemsetD8, ::cuMemsetD8Async, ::cuMemsetD16, ::cuMemsetD16Async, ::cuMemsetD32, ::cuMemsetD32Async, ::cudaMemcpy2DAsync, ::cudaMemcpy2DToArrayAsync, ::cudaMemcpy2DFromArrayAsync*/ fn cuMemcpy2DAsync_v2_ptsz( pCopy: *const cuda_types::cuda::CUDA_MEMCPY2D, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Copies memory for 3D arrays Perform a 3D memory copy according to the parameters specified in \p pCopy. The ::CUDA_MEMCPY3D structure is defined as: \code typedef struct CUDA_MEMCPY3D_st { unsigned int srcXInBytes, srcY, srcZ; unsigned int srcLOD; CUmemorytype srcMemoryType; const void *srcHost; CUdeviceptr srcDevice; CUarray srcArray; unsigned int srcPitch; // ignored when src is array unsigned int srcHeight; // ignored when src is array; may be 0 if Depth==1 unsigned int dstXInBytes, dstY, dstZ; unsigned int dstLOD; CUmemorytype dstMemoryType; void *dstHost; CUdeviceptr dstDevice; CUarray dstArray; unsigned int dstPitch; // ignored when dst is array unsigned int dstHeight; // ignored when dst is array; may be 0 if Depth==1 unsigned int WidthInBytes; unsigned int Height; unsigned int Depth; } CUDA_MEMCPY3D; \endcode where: - ::srcMemoryType and ::dstMemoryType specify the type of memory of the source and destination, respectively; ::CUmemorytype_enum is defined as: \code typedef enum CUmemorytype_enum { CU_MEMORYTYPE_HOST = 0x01, CU_MEMORYTYPE_DEVICE = 0x02, CU_MEMORYTYPE_ARRAY = 0x03, CU_MEMORYTYPE_UNIFIED = 0x04 } CUmemorytype; \endcode \par If ::srcMemoryType is ::CU_MEMORYTYPE_UNIFIED, ::srcDevice and ::srcPitch specify the (unified virtual address space) base address of the source data and the bytes per row to apply. ::srcArray is ignored. This value may be used only if unified addressing is supported in the calling context. \par If ::srcMemoryType is ::CU_MEMORYTYPE_HOST, ::srcHost, ::srcPitch and ::srcHeight specify the (host) base address of the source data, the bytes per row, and the height of each 2D slice of the 3D array. ::srcArray is ignored. \par If ::srcMemoryType is ::CU_MEMORYTYPE_DEVICE, ::srcDevice, ::srcPitch and ::srcHeight specify the (device) base address of the source data, the bytes per row, and the height of each 2D slice of the 3D array. ::srcArray is ignored. \par If ::srcMemoryType is ::CU_MEMORYTYPE_ARRAY, ::srcArray specifies the handle of the source data. ::srcHost, ::srcDevice, ::srcPitch and ::srcHeight are ignored. \par If ::dstMemoryType is ::CU_MEMORYTYPE_UNIFIED, ::dstDevice and ::dstPitch specify the (unified virtual address space) base address of the source data and the bytes per row to apply. ::dstArray is ignored. This value may be used only if unified addressing is supported in the calling context. \par If ::dstMemoryType is ::CU_MEMORYTYPE_HOST, ::dstHost and ::dstPitch specify the (host) base address of the destination data, the bytes per row, and the height of each 2D slice of the 3D array. ::dstArray is ignored. \par If ::dstMemoryType is ::CU_MEMORYTYPE_DEVICE, ::dstDevice and ::dstPitch specify the (device) base address of the destination data, the bytes per row, and the height of each 2D slice of the 3D array. ::dstArray is ignored. \par If ::dstMemoryType is ::CU_MEMORYTYPE_ARRAY, ::dstArray specifies the handle of the destination data. ::dstHost, ::dstDevice, ::dstPitch and ::dstHeight are ignored. - ::srcXInBytes, ::srcY and ::srcZ specify the base address of the source data for the copy. \par For host pointers, the starting address is \code void* Start = (void*)((char*)srcHost+(srcZ*srcHeight+srcY)*srcPitch + srcXInBytes); \endcode \par For device pointers, the starting address is \code CUdeviceptr Start = srcDevice+(srcZ*srcHeight+srcY)*srcPitch+srcXInBytes; \endcode \par For CUDA arrays, ::srcXInBytes must be evenly divisible by the array element size. - dstXInBytes, ::dstY and ::dstZ specify the base address of the destination data for the copy. \par For host pointers, the base address is \code void* dstStart = (void*)((char*)dstHost+(dstZ*dstHeight+dstY)*dstPitch + dstXInBytes); \endcode \par For device pointers, the starting address is \code CUdeviceptr dstStart = dstDevice+(dstZ*dstHeight+dstY)*dstPitch+dstXInBytes; \endcode \par For CUDA arrays, ::dstXInBytes must be evenly divisible by the array element size. - ::WidthInBytes, ::Height and ::Depth specify the width (in bytes), height and depth of the 3D copy being performed. - If specified, ::srcPitch must be greater than or equal to ::WidthInBytes + ::srcXInBytes, and ::dstPitch must be greater than or equal to ::WidthInBytes + dstXInBytes. - If specified, ::srcHeight must be greater than or equal to ::Height + ::srcY, and ::dstHeight must be greater than or equal to ::Height + ::dstY. \par ::cuMemcpy3DAsync() returns an error if any pitch is greater than the maximum allowed (::CU_DEVICE_ATTRIBUTE_MAX_PITCH). The ::srcLOD and ::dstLOD members of the ::CUDA_MEMCPY3D structure must be set to 0. \param pCopy - Parameters for the memory copy \param hStream - Stream identifier \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE \notefnerr \note_async \note_null_stream \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D8Async, ::cuMemsetD2D16, ::cuMemsetD2D16Async, ::cuMemsetD2D32, ::cuMemsetD2D32Async, ::cuMemsetD8, ::cuMemsetD8Async, ::cuMemsetD16, ::cuMemsetD16Async, ::cuMemsetD32, ::cuMemsetD32Async, ::cudaMemcpy3DAsync*/ fn cuMemcpy3DAsync_v2_ptsz( pCopy: *const cuda_types::cuda::CUDA_MEMCPY3D, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Copies memory between contexts asynchronously. Perform a 3D memory copy according to the parameters specified in \p pCopy. See the definition of the ::CUDA_MEMCPY3D_PEER structure for documentation of its parameters. \param pCopy - Parameters for the memory copy \param hStream - Stream identifier \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \note_async \note_null_stream \sa ::cuMemcpyDtoD, ::cuMemcpyPeer, ::cuMemcpyDtoDAsync, ::cuMemcpyPeerAsync, ::cuMemcpy3DPeerAsync, ::cudaMemcpy3DPeerAsync*/ fn cuMemcpy3DPeerAsync_ptsz( pCopy: *const cuda_types::cuda::CUDA_MEMCPY3D_PEER, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Performs a batch of memory copies asynchronously. Performs a batch of memory copies. The batch as a whole executes in stream order but copies within a batch are not guaranteed to execute in any specific order. This API only supports pointer-to-pointer copies. For copies involving CUDA arrays, please see ::cuMemcpy3DBatchAsync. Performs memory copies from source buffers specified in \p srcs to destination buffers specified in \p dsts. The size of each copy is specified in \p sizes. All three arrays must be of the same length as specified by \p count. Since there are no ordering guarantees for copies within a batch, specifying any dependent copies within a batch will result in undefined behavior. Every copy in the batch has to be associated with a set of attributes specified in the \p attrs array. Each entry in this array can apply to more than one copy. This can be done by specifying in the \p attrsIdxs array, the index of the first copy that the corresponding entry in the \p attrs array applies to. Both \p attrs and \p attrsIdxs must be of the same length as specified by \p numAttrs. For example, if a batch has 10 copies listed in dst/src/sizes, the first 6 of which have one set of attributes and the remaining 4 another, then \p numAttrs will be 2, \p attrsIdxs will be {0, 6} and \p attrs will contains the two sets of attributes. Note that the first entry in \p attrsIdxs must always be 0. Also, each entry must be greater than the previous entry and the last entry should be less than \p count. Furthermore, \p numAttrs must be lesser than or equal to \p count. The ::CUmemcpyAttributes::srcAccessOrder indicates the source access ordering to be observed for copies associated with the attribute. If the source access order is set to ::CU_MEMCPY_SRC_ACCESS_ORDER_STREAM, then the source will be accessed in stream order. If the source access order is set to ::CU_MEMCPY_SRC_ACCESS_ORDER_DURING_API_CALL then it indicates that access to the source pointer can be out of stream order and all accesses must be complete before the API call returns. This flag is suited for ephemeral sources (ex., stack variables) when it's known that no prior operations in the stream can be accessing the memory and also that the lifetime of the memory is limited to the scope that the source variable was declared in. Specifying this flag allows the driver to optimize the copy and removes the need for the user to synchronize the stream after the API call. If the source access order is set to ::CU_MEMCPY_SRC_ACCESS_ORDER_ANY then it indicates that access to the source pointer can be out of stream order and the accesses can happen even after the API call returns. This flag is suited for host pointers allocated outside CUDA (ex., via malloc) when it's known that no prior operations in the stream can be accessing the memory. Specifying this flag allows the driver to optimize the copy on certain platforms. Each memcpy operation in the batch must have a valid ::CUmemcpyAttributes corresponding to it including the appropriate srcAccessOrder setting, otherwise the API will return ::CUDA_ERROR_INVALID_VALUE. The ::CUmemcpyAttributes::srcLocHint and ::CUmemcpyAttributes::dstLocHint allows applications to specify hint locations for operands of a copy when the operand doesn't have a fixed location. That is, these hints are only applicable for managed memory pointers on devices where ::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS is true or system-allocated pageable memory on devices where ::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS is true. For other cases, these hints are ignored. The ::CUmemcpyAttributes::flags field can be used to specify certain flags for copies. Setting the ::CU_MEMCPY_FLAG_PREFER_OVERLAP_WITH_COMPUTE flag indicates that the associated copies should preferably overlap with any compute work. Note that this flag is a hint and can be ignored depending on the platform and other parameters of the copy. \param dsts - Array of destination pointers. \param srcs - Array of memcpy source pointers. \param sizes - Array of sizes for memcpy operations. \param count - Size of \p dsts, \p srcs and \p sizes arrays \param attrs - Array of memcpy attributes. \param attrsIdxs - Array of indices to specify which copies each entry in the \p attrs array applies to. The attributes specified in attrs[k] will be applied to copies starting from attrsIdxs[k] through attrsIdxs[k+1] - 1. Also attrs[numAttrs-1] will apply to copies starting from attrsIdxs[numAttrs-1] through count - 1. \param numAttrs - Size of \p attrs and \p attrsIdxs arrays. \param hStream - The stream to enqueue the operations in. Must not be legacy NULL stream. \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \notefnerr \note_async \note_memcpy*/ fn cuMemcpyBatchAsync_v2_ptsz( dsts: *mut cuda_types::cuda::CUdeviceptr, srcs: *mut cuda_types::cuda::CUdeviceptr, sizes: *mut usize, count: usize, attrs: *mut cuda_types::cuda::CUmemcpyAttributes, attrsIdxs: *mut usize, numAttrs: usize, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Performs a batch of 3D memory copies asynchronously. Performs a batch of memory copies. The batch as a whole executes in stream order but copies within a batch are not guaranteed to execute in any specific order. Note that this means specifying any dependent copies within a batch will result in undefined behavior. Performs memory copies as specified in the \p opList array. The length of this array is specified in \p numOps. Each entry in this array describes a copy operation. This includes among other things, the source and destination operands for the copy as specified in ::CUDA_MEMCPY3D_BATCH_OP::src and ::CUDA_MEMCPY3D_BATCH_OP::dst respectively. The source and destination operands of a copy can either be a pointer or a CUDA array. The width, height and depth of a copy is specified in ::CUDA_MEMCPY3D_BATCH_OP::extent. The width, height and depth of a copy are specified in elements and must not be zero. For pointer-to-pointer copies, the element size is considered to be 1. For pointer to CUDA array or vice versa copies, the element size is determined by the CUDA array. For CUDA array to CUDA array copies, the element size of the two CUDA arrays must match. For a given operand, if ::CUmemcpy3DOperand::type is specified as ::CU_MEMCPY_OPERAND_TYPE_POINTER, then ::CUmemcpy3DOperand::op::ptr will be used. The ::CUmemcpy3DOperand::op::ptr::ptr field must contain the pointer where the copy should begin. The ::CUmemcpy3DOperand::op::ptr::rowLength field specifies the length of each row in elements and must either be zero or be greater than or equal to the width of the copy specified in ::CUDA_MEMCPY3D_BATCH_OP::extent::width. The ::CUmemcpy3DOperand::op::ptr::layerHeight field specifies the height of each layer and must either be zero or be greater than or equal to the height of the copy specified in ::CUDA_MEMCPY3D_BATCH_OP::extent::height. When either of these values is zero, that aspect of the operand is considered to be tightly packed according to the copy extent. For managed memory pointers on devices where ::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS is true or system-allocated pageable memory on devices where ::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS is true, the ::CUmemcpy3DOperand::op::ptr::locHint field can be used to hint the location of the operand. If an operand's type is specified as ::CU_MEMCPY_OPERAND_TYPE_ARRAY, then ::CUmemcpy3DOperand::op::array will be used. The ::CUmemcpy3DOperand::op::array::array field specifies the CUDA array and ::CUmemcpy3DOperand::op::array::offset specifies the 3D offset into that array where the copy begins. The ::CUmemcpyAttributes::srcAccessOrder indicates the source access ordering to be observed for copies associated with the attribute. If the source access order is set to ::CU_MEMCPY_SRC_ACCESS_ORDER_STREAM, then the source will be accessed in stream order. If the source access order is set to ::CU_MEMCPY_SRC_ACCESS_ORDER_DURING_API_CALL then it indicates that access to the source pointer can be out of stream order and all accesses must be complete before the API call returns. This flag is suited for ephemeral sources (ex., stack variables) when it's known that no prior operations in the stream can be accessing the memory and also that the lifetime of the memory is limited to the scope that the source variable was declared in. Specifying this flag allows the driver to optimize the copy and removes the need for the user to synchronize the stream after the API call. If the source access order is set to ::CU_MEMCPY_SRC_ACCESS_ORDER_ANY then it indicates that access to the source pointer can be out of stream order and the accesses can happen even after the API call returns. This flag is suited for host pointers allocated outside CUDA (ex., via malloc) when it's known that no prior operations in the stream can be accessing the memory. Specifying this flag allows the driver to optimize the copy on certain platforms. Each memcopy operation in \p opList must have a valid srcAccessOrder setting, otherwise this API will return ::CUDA_ERROR_INVALID_VALUE. The ::CUmemcpyAttributes::flags field can be used to specify certain flags for copies. Setting the ::CU_MEMCPY_FLAG_PREFER_OVERLAP_WITH_COMPUTE flag indicates that the associated copies should preferably overlap with any compute work. Note that this flag is a hint and can be ignored depending on the platform and other parameters of the copy. \param numOps - Total number of memcpy operations. \param opList - Array of size \p numOps containing the actual memcpy operations. \param flags - Flags for future use, must be zero now. \param hStream - The stream to enqueue the operations in. Must not be default NULL stream. \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \notefnerr \note_async \note_memcpy*/ fn cuMemcpy3DBatchAsync_v2_ptsz( numOps: usize, opList: *mut cuda_types::cuda::CUDA_MEMCPY3D_BATCH_OP, flags: ::core::ffi::c_ulonglong, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Initializes device memory Sets the memory range of \p N 8-bit values to the specified value \p uc. \param dstDevice - Destination device pointer \param uc - Value to set \param N - Number of elements \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \note_memset \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D8Async, ::cuMemsetD2D16, ::cuMemsetD2D16Async, ::cuMemsetD2D32, ::cuMemsetD2D32Async, ::cuMemsetD8Async, ::cuMemsetD16, ::cuMemsetD16Async, ::cuMemsetD32, ::cuMemsetD32Async, ::cudaMemset*/ fn cuMemsetD8_v2_ptds( dstDevice: cuda_types::cuda::CUdeviceptr, uc: ::core::ffi::c_uchar, N: usize, ) -> cuda_types::cuda::CUresult; /** \brief Initializes device memory Sets the memory range of \p N 16-bit values to the specified value \p us. The \p dstDevice pointer must be two byte aligned. \param dstDevice - Destination device pointer \param us - Value to set \param N - Number of elements \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \note_memset \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D8Async, ::cuMemsetD2D16, ::cuMemsetD2D16Async, ::cuMemsetD2D32, ::cuMemsetD2D32Async, ::cuMemsetD8, ::cuMemsetD8Async, ::cuMemsetD16Async, ::cuMemsetD32, ::cuMemsetD32Async, ::cudaMemset*/ fn cuMemsetD16_v2_ptds( dstDevice: cuda_types::cuda::CUdeviceptr, us: ::core::ffi::c_ushort, N: usize, ) -> cuda_types::cuda::CUresult; /** \brief Initializes device memory Sets the memory range of \p N 32-bit values to the specified value \p ui. The \p dstDevice pointer must be four byte aligned. \param dstDevice - Destination device pointer \param ui - Value to set \param N - Number of elements \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \note_memset \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D8Async, ::cuMemsetD2D16, ::cuMemsetD2D16Async, ::cuMemsetD2D32, ::cuMemsetD2D32Async, ::cuMemsetD8, ::cuMemsetD8Async, ::cuMemsetD16, ::cuMemsetD16Async, ::cuMemsetD32Async, ::cudaMemset*/ fn cuMemsetD32_v2_ptds( dstDevice: cuda_types::cuda::CUdeviceptr, ui: ::core::ffi::c_uint, N: usize, ) -> cuda_types::cuda::CUresult; /** \brief Initializes device memory Sets the 2D memory range of \p Width 8-bit values to the specified value \p uc. \p Height specifies the number of rows to set, and \p dstPitch specifies the number of bytes between each row. This function performs fastest when the pitch is one that has been passed back by ::cuMemAllocPitch(). \param dstDevice - Destination device pointer \param dstPitch - Pitch of destination device pointer(Unused if \p Height is 1) \param uc - Value to set \param Width - Width of row \param Height - Number of rows \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \note_memset \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8Async, ::cuMemsetD2D16, ::cuMemsetD2D16Async, ::cuMemsetD2D32, ::cuMemsetD2D32Async, ::cuMemsetD8, ::cuMemsetD8Async, ::cuMemsetD16, ::cuMemsetD16Async, ::cuMemsetD32, ::cuMemsetD32Async, ::cudaMemset2D*/ fn cuMemsetD2D8_v2_ptds( dstDevice: cuda_types::cuda::CUdeviceptr, dstPitch: usize, uc: ::core::ffi::c_uchar, Width: usize, Height: usize, ) -> cuda_types::cuda::CUresult; /** \brief Initializes device memory Sets the 2D memory range of \p Width 16-bit values to the specified value \p us. \p Height specifies the number of rows to set, and \p dstPitch specifies the number of bytes between each row. The \p dstDevice pointer and \p dstPitch offset must be two byte aligned. This function performs fastest when the pitch is one that has been passed back by ::cuMemAllocPitch(). \param dstDevice - Destination device pointer \param dstPitch - Pitch of destination device pointer(Unused if \p Height is 1) \param us - Value to set \param Width - Width of row \param Height - Number of rows \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \note_memset \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D8Async, ::cuMemsetD2D16Async, ::cuMemsetD2D32, ::cuMemsetD2D32Async, ::cuMemsetD8, ::cuMemsetD8Async, ::cuMemsetD16, ::cuMemsetD16Async, ::cuMemsetD32, ::cuMemsetD32Async, ::cudaMemset2D*/ fn cuMemsetD2D16_v2_ptds( dstDevice: cuda_types::cuda::CUdeviceptr, dstPitch: usize, us: ::core::ffi::c_ushort, Width: usize, Height: usize, ) -> cuda_types::cuda::CUresult; /** \brief Initializes device memory Sets the 2D memory range of \p Width 32-bit values to the specified value \p ui. \p Height specifies the number of rows to set, and \p dstPitch specifies the number of bytes between each row. The \p dstDevice pointer and \p dstPitch offset must be four byte aligned. This function performs fastest when the pitch is one that has been passed back by ::cuMemAllocPitch(). \param dstDevice - Destination device pointer \param dstPitch - Pitch of destination device pointer(Unused if \p Height is 1) \param ui - Value to set \param Width - Width of row \param Height - Number of rows \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \note_memset \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D8Async, ::cuMemsetD2D16, ::cuMemsetD2D16Async, ::cuMemsetD2D32Async, ::cuMemsetD8, ::cuMemsetD8Async, ::cuMemsetD16, ::cuMemsetD16Async, ::cuMemsetD32, ::cuMemsetD32Async, ::cudaMemset2D*/ fn cuMemsetD2D32_v2_ptds( dstDevice: cuda_types::cuda::CUdeviceptr, dstPitch: usize, ui: ::core::ffi::c_uint, Width: usize, Height: usize, ) -> cuda_types::cuda::CUresult; /** \brief Sets device memory Sets the memory range of \p N 8-bit values to the specified value \p uc. \param dstDevice - Destination device pointer \param uc - Value to set \param N - Number of elements \param hStream - Stream identifier \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \note_memset \note_null_stream \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D8Async, ::cuMemsetD2D16, ::cuMemsetD2D16Async, ::cuMemsetD2D32, ::cuMemsetD2D32Async, ::cuMemsetD8, ::cuMemsetD16, ::cuMemsetD16Async, ::cuMemsetD32, ::cuMemsetD32Async, ::cudaMemsetAsync*/ fn cuMemsetD8Async_ptsz( dstDevice: cuda_types::cuda::CUdeviceptr, uc: ::core::ffi::c_uchar, N: usize, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Sets device memory Sets the memory range of \p N 16-bit values to the specified value \p us. The \p dstDevice pointer must be two byte aligned. \param dstDevice - Destination device pointer \param us - Value to set \param N - Number of elements \param hStream - Stream identifier \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \note_memset \note_null_stream \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D8Async, ::cuMemsetD2D16, ::cuMemsetD2D16Async, ::cuMemsetD2D32, ::cuMemsetD2D32Async, ::cuMemsetD8, ::cuMemsetD8Async, ::cuMemsetD16, ::cuMemsetD32, ::cuMemsetD32Async, ::cudaMemsetAsync*/ fn cuMemsetD16Async_ptsz( dstDevice: cuda_types::cuda::CUdeviceptr, us: ::core::ffi::c_ushort, N: usize, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Sets device memory Sets the memory range of \p N 32-bit values to the specified value \p ui. The \p dstDevice pointer must be four byte aligned. \param dstDevice - Destination device pointer \param ui - Value to set \param N - Number of elements \param hStream - Stream identifier \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \note_memset \note_null_stream \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D8Async, ::cuMemsetD2D16, ::cuMemsetD2D16Async, ::cuMemsetD2D32, ::cuMemsetD2D32Async, ::cuMemsetD8, ::cuMemsetD8Async, ::cuMemsetD16, ::cuMemsetD16Async, ::cuMemsetD32, ::cudaMemsetAsync*/ fn cuMemsetD32Async_ptsz( dstDevice: cuda_types::cuda::CUdeviceptr, ui: ::core::ffi::c_uint, N: usize, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Sets device memory Sets the 2D memory range of \p Width 8-bit values to the specified value \p uc. \p Height specifies the number of rows to set, and \p dstPitch specifies the number of bytes between each row. This function performs fastest when the pitch is one that has been passed back by ::cuMemAllocPitch(). \param dstDevice - Destination device pointer \param dstPitch - Pitch of destination device pointer(Unused if \p Height is 1) \param uc - Value to set \param Width - Width of row \param Height - Number of rows \param hStream - Stream identifier \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \note_memset \note_null_stream \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D16, ::cuMemsetD2D16Async, ::cuMemsetD2D32, ::cuMemsetD2D32Async, ::cuMemsetD8, ::cuMemsetD8Async, ::cuMemsetD16, ::cuMemsetD16Async, ::cuMemsetD32, ::cuMemsetD32Async, ::cudaMemset2DAsync*/ fn cuMemsetD2D8Async_ptsz( dstDevice: cuda_types::cuda::CUdeviceptr, dstPitch: usize, uc: ::core::ffi::c_uchar, Width: usize, Height: usize, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Sets device memory Sets the 2D memory range of \p Width 16-bit values to the specified value \p us. \p Height specifies the number of rows to set, and \p dstPitch specifies the number of bytes between each row. The \p dstDevice pointer and \p dstPitch offset must be two byte aligned. This function performs fastest when the pitch is one that has been passed back by ::cuMemAllocPitch(). \param dstDevice - Destination device pointer \param dstPitch - Pitch of destination device pointer(Unused if \p Height is 1) \param us - Value to set \param Width - Width of row \param Height - Number of rows \param hStream - Stream identifier \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \note_memset \note_null_stream \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D8Async, ::cuMemsetD2D16, ::cuMemsetD2D32, ::cuMemsetD2D32Async, ::cuMemsetD8, ::cuMemsetD8Async, ::cuMemsetD16, ::cuMemsetD16Async, ::cuMemsetD32, ::cuMemsetD32Async, ::cudaMemset2DAsync*/ fn cuMemsetD2D16Async_ptsz( dstDevice: cuda_types::cuda::CUdeviceptr, dstPitch: usize, us: ::core::ffi::c_ushort, Width: usize, Height: usize, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Sets device memory Sets the 2D memory range of \p Width 32-bit values to the specified value \p ui. \p Height specifies the number of rows to set, and \p dstPitch specifies the number of bytes between each row. The \p dstDevice pointer and \p dstPitch offset must be four byte aligned. This function performs fastest when the pitch is one that has been passed back by ::cuMemAllocPitch(). \param dstDevice - Destination device pointer \param dstPitch - Pitch of destination device pointer(Unused if \p Height is 1) \param ui - Value to set \param Width - Width of row \param Height - Number of rows \param hStream - Stream identifier \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \note_memset \note_null_stream \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D8Async, ::cuMemsetD2D16, ::cuMemsetD2D16Async, ::cuMemsetD2D32, ::cuMemsetD8, ::cuMemsetD8Async, ::cuMemsetD16, ::cuMemsetD16Async, ::cuMemsetD32, ::cuMemsetD32Async, ::cudaMemset2DAsync*/ fn cuMemsetD2D32Async_ptsz( dstDevice: cuda_types::cuda::CUdeviceptr, dstPitch: usize, ui: ::core::ffi::c_uint, Width: usize, Height: usize, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Creates a 1D or 2D CUDA array Creates a CUDA array according to the ::CUDA_ARRAY_DESCRIPTOR structure \p pAllocateArray and returns a handle to the new CUDA array in \p *pHandle. The ::CUDA_ARRAY_DESCRIPTOR is defined as: \code typedef struct { unsigned int Width; unsigned int Height; CUarray_format Format; unsigned int NumChannels; } CUDA_ARRAY_DESCRIPTOR; \endcode where: - \p Width, and \p Height are the width, and height of the CUDA array (in elements); the CUDA array is one-dimensional if height is 0, two-dimensional otherwise; - ::Format specifies the format of the elements; ::CUarray_format is defined as: \code typedef enum CUarray_format_enum { CU_AD_FORMAT_UNSIGNED_INT8 = 0x01, CU_AD_FORMAT_UNSIGNED_INT16 = 0x02, CU_AD_FORMAT_UNSIGNED_INT32 = 0x03, CU_AD_FORMAT_SIGNED_INT8 = 0x08, CU_AD_FORMAT_SIGNED_INT16 = 0x09, CU_AD_FORMAT_SIGNED_INT32 = 0x0a, CU_AD_FORMAT_HALF = 0x10, CU_AD_FORMAT_FLOAT = 0x20, CU_AD_FORMAT_NV12 = 0xb0, CU_AD_FORMAT_UNORM_INT8X1 = 0xc0, CU_AD_FORMAT_UNORM_INT8X2 = 0xc1, CU_AD_FORMAT_UNORM_INT8X4 = 0xc2, CU_AD_FORMAT_UNORM_INT16X1 = 0xc3, CU_AD_FORMAT_UNORM_INT16X2 = 0xc4, CU_AD_FORMAT_UNORM_INT16X4 = 0xc5, CU_AD_FORMAT_SNORM_INT8X1 = 0xc6, CU_AD_FORMAT_SNORM_INT8X2 = 0xc7, CU_AD_FORMAT_SNORM_INT8X4 = 0xc8, CU_AD_FORMAT_SNORM_INT16X1 = 0xc9, CU_AD_FORMAT_SNORM_INT16X2 = 0xca, CU_AD_FORMAT_SNORM_INT16X4 = 0xcb, CU_AD_FORMAT_BC1_UNORM = 0x91, CU_AD_FORMAT_BC1_UNORM_SRGB = 0x92, CU_AD_FORMAT_BC2_UNORM = 0x93, CU_AD_FORMAT_BC2_UNORM_SRGB = 0x94, CU_AD_FORMAT_BC3_UNORM = 0x95, CU_AD_FORMAT_BC3_UNORM_SRGB = 0x96, CU_AD_FORMAT_BC4_UNORM = 0x97, CU_AD_FORMAT_BC4_SNORM = 0x98, CU_AD_FORMAT_BC5_UNORM = 0x99, CU_AD_FORMAT_BC5_SNORM = 0x9a, CU_AD_FORMAT_BC6H_UF16 = 0x9b, CU_AD_FORMAT_BC6H_SF16 = 0x9c, CU_AD_FORMAT_BC7_UNORM = 0x9d, CU_AD_FORMAT_BC7_UNORM_SRGB = 0x9e, CU_AD_FORMAT_P010 = 0x9f, CU_AD_FORMAT_P016 = 0xa1, CU_AD_FORMAT_NV16 = 0xa2, CU_AD_FORMAT_P210 = 0xa3, CU_AD_FORMAT_P216 = 0xa4, CU_AD_FORMAT_YUY2 = 0xa5, CU_AD_FORMAT_Y210 = 0xa6, CU_AD_FORMAT_Y216 = 0xa7, CU_AD_FORMAT_AYUV = 0xa8, CU_AD_FORMAT_Y410 = 0xa9, CU_AD_FORMAT_Y416 = 0xb1, CU_AD_FORMAT_Y444_PLANAR8 = 0xb2, CU_AD_FORMAT_Y444_PLANAR10 = 0xb3, CU_AD_FORMAT_YUV444_8bit_SemiPlanar = 0xb4, CU_AD_FORMAT_YUV444_16bit_SemiPlanar = 0xb5, CU_AD_FORMAT_UNORM_INT_101010_2 = 0x50, } CUarray_format; \endcode - \p NumChannels specifies the number of packed components per CUDA array element; it may be 1, 2, or 4; Here are examples of CUDA array descriptions: Description for a CUDA array of 2048 floats: \code CUDA_ARRAY_DESCRIPTOR desc; desc.Format = CU_AD_FORMAT_FLOAT; desc.NumChannels = 1; desc.Width = 2048; desc.Height = 1; \endcode Description for a 64 x 64 CUDA array of floats: \code CUDA_ARRAY_DESCRIPTOR desc; desc.Format = CU_AD_FORMAT_FLOAT; desc.NumChannels = 1; desc.Width = 64; desc.Height = 64; \endcode Description for a \p width x \p height CUDA array of 64-bit, 4x16-bit float16's: \code CUDA_ARRAY_DESCRIPTOR desc; desc.Format = CU_AD_FORMAT_HALF; desc.NumChannels = 4; desc.Width = width; desc.Height = height; \endcode Description for a \p width x \p height CUDA array of 16-bit elements, each of which is two 8-bit unsigned chars: \code CUDA_ARRAY_DESCRIPTOR arrayDesc; desc.Format = CU_AD_FORMAT_UNSIGNED_INT8; desc.NumChannels = 2; desc.Width = width; desc.Height = height; \endcode \param pHandle - Returned array \param pAllocateArray - Array descriptor \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_OUT_OF_MEMORY, ::CUDA_ERROR_UNKNOWN \notefnerr \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D16, ::cuMemsetD2D32, ::cuMemsetD8, ::cuMemsetD16, ::cuMemsetD32, ::cudaMallocArray*/ fn cuArrayCreate_v2( pHandle: *mut cuda_types::cuda::CUarray, pAllocateArray: *const cuda_types::cuda::CUDA_ARRAY_DESCRIPTOR, ) -> cuda_types::cuda::CUresult; /** \brief Get a 1D or 2D CUDA array descriptor Returns in \p *pArrayDescriptor a descriptor containing information on the format and dimensions of the CUDA array \p hArray. It is useful for subroutines that have been passed a CUDA array, but need to know the CUDA array parameters for validation or other purposes. \param pArrayDescriptor - Returned array descriptor \param hArray - Array to get descriptor of \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE \notefnerr \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D16, ::cuMemsetD2D32, ::cuMemsetD8, ::cuMemsetD16, ::cuMemsetD32, ::cudaArrayGetInfo*/ fn cuArrayGetDescriptor_v2( pArrayDescriptor: *mut cuda_types::cuda::CUDA_ARRAY_DESCRIPTOR, hArray: cuda_types::cuda::CUarray, ) -> cuda_types::cuda::CUresult; /** \brief Returns the layout properties of a sparse CUDA array Returns the layout properties of a sparse CUDA array in \p sparseProperties If the CUDA array is not allocated with flag ::CUDA_ARRAY3D_SPARSE ::CUDA_ERROR_INVALID_VALUE will be returned. If the returned value in ::CUDA_ARRAY_SPARSE_PROPERTIES::flags contains ::CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL, then ::CUDA_ARRAY_SPARSE_PROPERTIES::miptailSize represents the total size of the array. Otherwise, it will be zero. Also, the returned value in ::CUDA_ARRAY_SPARSE_PROPERTIES::miptailFirstLevel is always zero. Note that the \p array must have been allocated using ::cuArrayCreate or ::cuArray3DCreate. For CUDA arrays obtained using ::cuMipmappedArrayGetLevel, ::CUDA_ERROR_INVALID_VALUE will be returned. Instead, ::cuMipmappedArrayGetSparseProperties must be used to obtain the sparse properties of the entire CUDA mipmapped array to which \p array belongs to. \return ::CUDA_SUCCESS ::CUDA_ERROR_INVALID_VALUE \param[out] sparseProperties - Pointer to ::CUDA_ARRAY_SPARSE_PROPERTIES \param[in] array - CUDA array to get the sparse properties of \sa ::cuMipmappedArrayGetSparseProperties, ::cuMemMapArrayAsync*/ fn cuArrayGetSparseProperties( sparseProperties: *mut cuda_types::cuda::CUDA_ARRAY_SPARSE_PROPERTIES, array: cuda_types::cuda::CUarray, ) -> cuda_types::cuda::CUresult; /** \brief Returns the layout properties of a sparse CUDA mipmapped array Returns the sparse array layout properties in \p sparseProperties If the CUDA mipmapped array is not allocated with flag ::CUDA_ARRAY3D_SPARSE ::CUDA_ERROR_INVALID_VALUE will be returned. For non-layered CUDA mipmapped arrays, ::CUDA_ARRAY_SPARSE_PROPERTIES::miptailSize returns the size of the mip tail region. The mip tail region includes all mip levels whose width, height or depth is less than that of the tile. For layered CUDA mipmapped arrays, if ::CUDA_ARRAY_SPARSE_PROPERTIES::flags contains ::CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL, then ::CUDA_ARRAY_SPARSE_PROPERTIES::miptailSize specifies the size of the mip tail of all layers combined. Otherwise, ::CUDA_ARRAY_SPARSE_PROPERTIES::miptailSize specifies mip tail size per layer. The returned value of ::CUDA_ARRAY_SPARSE_PROPERTIES::miptailFirstLevel is valid only if ::CUDA_ARRAY_SPARSE_PROPERTIES::miptailSize is non-zero. \return ::CUDA_SUCCESS ::CUDA_ERROR_INVALID_VALUE \param[out] sparseProperties - Pointer to ::CUDA_ARRAY_SPARSE_PROPERTIES \param[in] mipmap - CUDA mipmapped array to get the sparse properties of \sa ::cuArrayGetSparseProperties, ::cuMemMapArrayAsync*/ fn cuMipmappedArrayGetSparseProperties( sparseProperties: *mut cuda_types::cuda::CUDA_ARRAY_SPARSE_PROPERTIES, mipmap: cuda_types::cuda::CUmipmappedArray, ) -> cuda_types::cuda::CUresult; /** \brief Returns the memory requirements of a CUDA array Returns the memory requirements of a CUDA array in \p memoryRequirements If the CUDA array is not allocated with flag ::CUDA_ARRAY3D_DEFERRED_MAPPING ::CUDA_ERROR_INVALID_VALUE will be returned. The returned value in ::CUDA_ARRAY_MEMORY_REQUIREMENTS::size represents the total size of the CUDA array. The returned value in ::CUDA_ARRAY_MEMORY_REQUIREMENTS::alignment represents the alignment necessary for mapping the CUDA array. \return ::CUDA_SUCCESS ::CUDA_ERROR_INVALID_VALUE \param[out] memoryRequirements - Pointer to ::CUDA_ARRAY_MEMORY_REQUIREMENTS \param[in] array - CUDA array to get the memory requirements of \param[in] device - Device to get the memory requirements for \sa ::cuMipmappedArrayGetMemoryRequirements, ::cuMemMapArrayAsync*/ fn cuArrayGetMemoryRequirements( memoryRequirements: *mut cuda_types::cuda::CUDA_ARRAY_MEMORY_REQUIREMENTS, array: cuda_types::cuda::CUarray, device: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; /** \brief Returns the memory requirements of a CUDA mipmapped array Returns the memory requirements of a CUDA mipmapped array in \p memoryRequirements If the CUDA mipmapped array is not allocated with flag ::CUDA_ARRAY3D_DEFERRED_MAPPING ::CUDA_ERROR_INVALID_VALUE will be returned. The returned value in ::CUDA_ARRAY_MEMORY_REQUIREMENTS::size represents the total size of the CUDA mipmapped array. The returned value in ::CUDA_ARRAY_MEMORY_REQUIREMENTS::alignment represents the alignment necessary for mapping the CUDA mipmapped array. \return ::CUDA_SUCCESS ::CUDA_ERROR_INVALID_VALUE \param[out] memoryRequirements - Pointer to ::CUDA_ARRAY_MEMORY_REQUIREMENTS \param[in] mipmap - CUDA mipmapped array to get the memory requirements of \param[in] device - Device to get the memory requirements for \sa ::cuArrayGetMemoryRequirements, ::cuMemMapArrayAsync*/ fn cuMipmappedArrayGetMemoryRequirements( memoryRequirements: *mut cuda_types::cuda::CUDA_ARRAY_MEMORY_REQUIREMENTS, mipmap: cuda_types::cuda::CUmipmappedArray, device: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; /** \brief Gets a CUDA array plane from a CUDA array Returns in \p pPlaneArray a CUDA array that represents a single format plane of the CUDA array \p hArray. If \p planeIdx is greater than the maximum number of planes in this array or if the array does not have a multi-planar format e.g: ::CU_AD_FORMAT_NV12, then ::CUDA_ERROR_INVALID_VALUE is returned. Note that if the \p hArray has format ::CU_AD_FORMAT_NV12, then passing in 0 for \p planeIdx returns a CUDA array of the same size as \p hArray but with one channel and ::CU_AD_FORMAT_UNSIGNED_INT8 as its format. If 1 is passed for \p planeIdx, then the returned CUDA array has half the height and width of \p hArray with two channels and ::CU_AD_FORMAT_UNSIGNED_INT8 as its format. \param pPlaneArray - Returned CUDA array referenced by the \p planeIdx \param hArray - Multiplanar CUDA array \param planeIdx - Plane index \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE \notefnerr \sa ::cuArrayCreate, ::cudaArrayGetPlane*/ fn cuArrayGetPlane( pPlaneArray: *mut cuda_types::cuda::CUarray, hArray: cuda_types::cuda::CUarray, planeIdx: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Destroys a CUDA array Destroys the CUDA array \p hArray. \param hArray - Array to destroy \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_ARRAY_IS_MAPPED, ::CUDA_ERROR_CONTEXT_IS_DESTROYED \notefnerr \sa ::cuArray3DCreate, ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D16, ::cuMemsetD2D32, ::cuMemsetD8, ::cuMemsetD16, ::cuMemsetD32, ::cudaFreeArray*/ fn cuArrayDestroy(hArray: cuda_types::cuda::CUarray) -> cuda_types::cuda::CUresult; /** \brief Creates a 3D CUDA array Creates a CUDA array according to the ::CUDA_ARRAY3D_DESCRIPTOR structure \p pAllocateArray and returns a handle to the new CUDA array in \p *pHandle. The ::CUDA_ARRAY3D_DESCRIPTOR is defined as: \code typedef struct { unsigned int Width; unsigned int Height; unsigned int Depth; CUarray_format Format; unsigned int NumChannels; unsigned int Flags; } CUDA_ARRAY3D_DESCRIPTOR; \endcode where: - \p Width, \p Height, and \p Depth are the width, height, and depth of the CUDA array (in elements); the following types of CUDA arrays can be allocated: - A 1D array is allocated if \p Height and \p Depth extents are both zero. - A 2D array is allocated if only \p Depth extent is zero. - A 3D array is allocated if all three extents are non-zero. - A 1D layered CUDA array is allocated if only \p Height is zero and the ::CUDA_ARRAY3D_LAYERED flag is set. Each layer is a 1D array. The number of layers is determined by the depth extent. - A 2D layered CUDA array is allocated if all three extents are non-zero and the ::CUDA_ARRAY3D_LAYERED flag is set. Each layer is a 2D array. The number of layers is determined by the depth extent. - A cubemap CUDA array is allocated if all three extents are non-zero and the ::CUDA_ARRAY3D_CUBEMAP flag is set. \p Width must be equal to \p Height, and \p Depth must be six. A cubemap is a special type of 2D layered CUDA array, where the six layers represent the six faces of a cube. The order of the six layers in memory is the same as that listed in ::CUarray_cubemap_face. - A cubemap layered CUDA array is allocated if all three extents are non-zero, and both, ::CUDA_ARRAY3D_CUBEMAP and ::CUDA_ARRAY3D_LAYERED flags are set. \p Width must be equal to \p Height, and \p Depth must be a multiple of six. A cubemap layered CUDA array is a special type of 2D layered CUDA array that consists of a collection of cubemaps. The first six layers represent the first cubemap, the next six layers form the second cubemap, and so on. - ::Format specifies the format of the elements; ::CUarray_format is defined as: \code typedef enum CUarray_format_enum { CU_AD_FORMAT_UNSIGNED_INT8 = 0x01, CU_AD_FORMAT_UNSIGNED_INT16 = 0x02, CU_AD_FORMAT_UNSIGNED_INT32 = 0x03, CU_AD_FORMAT_SIGNED_INT8 = 0x08, CU_AD_FORMAT_SIGNED_INT16 = 0x09, CU_AD_FORMAT_SIGNED_INT32 = 0x0a, CU_AD_FORMAT_HALF = 0x10, CU_AD_FORMAT_FLOAT = 0x20, CU_AD_FORMAT_NV12 = 0xb0, CU_AD_FORMAT_UNORM_INT8X1 = 0xc0, CU_AD_FORMAT_UNORM_INT8X2 = 0xc1, CU_AD_FORMAT_UNORM_INT8X4 = 0xc2, CU_AD_FORMAT_UNORM_INT16X1 = 0xc3, CU_AD_FORMAT_UNORM_INT16X2 = 0xc4, CU_AD_FORMAT_UNORM_INT16X4 = 0xc5, CU_AD_FORMAT_SNORM_INT8X1 = 0xc6, CU_AD_FORMAT_SNORM_INT8X2 = 0xc7, CU_AD_FORMAT_SNORM_INT8X4 = 0xc8, CU_AD_FORMAT_SNORM_INT16X1 = 0xc9, CU_AD_FORMAT_SNORM_INT16X2 = 0xca, CU_AD_FORMAT_SNORM_INT16X4 = 0xcb, CU_AD_FORMAT_BC1_UNORM = 0x91, CU_AD_FORMAT_BC1_UNORM_SRGB = 0x92, CU_AD_FORMAT_BC2_UNORM = 0x93, CU_AD_FORMAT_BC2_UNORM_SRGB = 0x94, CU_AD_FORMAT_BC3_UNORM = 0x95, CU_AD_FORMAT_BC3_UNORM_SRGB = 0x96, CU_AD_FORMAT_BC4_UNORM = 0x97, CU_AD_FORMAT_BC4_SNORM = 0x98, CU_AD_FORMAT_BC5_UNORM = 0x99, CU_AD_FORMAT_BC5_SNORM = 0x9a, CU_AD_FORMAT_BC6H_UF16 = 0x9b, CU_AD_FORMAT_BC6H_SF16 = 0x9c, CU_AD_FORMAT_BC7_UNORM = 0x9d, CU_AD_FORMAT_BC7_UNORM_SRGB = 0x9e, CU_AD_FORMAT_P010 = 0x9f, CU_AD_FORMAT_P016 = 0xa1, CU_AD_FORMAT_NV16 = 0xa2, CU_AD_FORMAT_P210 = 0xa3, CU_AD_FORMAT_P216 = 0xa4, CU_AD_FORMAT_YUY2 = 0xa5, CU_AD_FORMAT_Y210 = 0xa6, CU_AD_FORMAT_Y216 = 0xa7, CU_AD_FORMAT_AYUV = 0xa8, CU_AD_FORMAT_Y410 = 0xa9, CU_AD_FORMAT_Y416 = 0xb1, CU_AD_FORMAT_Y444_PLANAR8 = 0xb2, CU_AD_FORMAT_Y444_PLANAR10 = 0xb3, CU_AD_FORMAT_YUV444_8bit_SemiPlanar = 0xb4, CU_AD_FORMAT_YUV444_16bit_SemiPlanar = 0xb5, CU_AD_FORMAT_UNORM_INT_101010_2 = 0x50, } CUarray_format; \endcode - \p NumChannels specifies the number of packed components per CUDA array element; it may be 1, 2, or 4; - ::Flags may be set to - ::CUDA_ARRAY3D_LAYERED to enable creation of layered CUDA arrays. If this flag is set, \p Depth specifies the number of layers, not the depth of a 3D array. - ::CUDA_ARRAY3D_SURFACE_LDST to enable surface references to be bound to the CUDA array. If this flag is not set, ::cuSurfRefSetArray will fail when attempting to bind the CUDA array to a surface reference. - ::CUDA_ARRAY3D_CUBEMAP to enable creation of cubemaps. If this flag is set, \p Width must be equal to \p Height, and \p Depth must be six. If the ::CUDA_ARRAY3D_LAYERED flag is also set, then \p Depth must be a multiple of six. - ::CUDA_ARRAY3D_TEXTURE_GATHER to indicate that the CUDA array will be used for texture gather. Texture gather can only be performed on 2D CUDA arrays. \p Width, \p Height and \p Depth must meet certain size requirements as listed in the following table. All values are specified in elements. Note that for brevity's sake, the full name of the device attribute is not specified. For ex., TEXTURE1D_WIDTH refers to the device attribute ::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH. Note that 2D CUDA arrays have different size requirements if the ::CUDA_ARRAY3D_TEXTURE_GATHER flag is set. \p Width and \p Height must not be greater than ::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_WIDTH and ::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_HEIGHT respectively, in that case.
CUDA array type Valid extents that must always be met
{(width range in elements), (height range), (depth range)}
Valid extents with CUDA_ARRAY3D_SURFACE_LDST set
{(width range in elements), (height range), (depth range)}
1D { (1,TEXTURE1D_WIDTH), 0, 0 } { (1,SURFACE1D_WIDTH), 0, 0 }
2D { (1,TEXTURE2D_WIDTH), (1,TEXTURE2D_HEIGHT), 0 } { (1,SURFACE2D_WIDTH), (1,SURFACE2D_HEIGHT), 0 }
3D { (1,TEXTURE3D_WIDTH), (1,TEXTURE3D_HEIGHT), (1,TEXTURE3D_DEPTH) }
OR
{ (1,TEXTURE3D_WIDTH_ALTERNATE), (1,TEXTURE3D_HEIGHT_ALTERNATE), (1,TEXTURE3D_DEPTH_ALTERNATE) }
{ (1,SURFACE3D_WIDTH), (1,SURFACE3D_HEIGHT), (1,SURFACE3D_DEPTH) }
1D Layered { (1,TEXTURE1D_LAYERED_WIDTH), 0, (1,TEXTURE1D_LAYERED_LAYERS) } { (1,SURFACE1D_LAYERED_WIDTH), 0, (1,SURFACE1D_LAYERED_LAYERS) }
2D Layered { (1,TEXTURE2D_LAYERED_WIDTH), (1,TEXTURE2D_LAYERED_HEIGHT), (1,TEXTURE2D_LAYERED_LAYERS) } { (1,SURFACE2D_LAYERED_WIDTH), (1,SURFACE2D_LAYERED_HEIGHT), (1,SURFACE2D_LAYERED_LAYERS) }
Cubemap { (1,TEXTURECUBEMAP_WIDTH), (1,TEXTURECUBEMAP_WIDTH), 6 } { (1,SURFACECUBEMAP_WIDTH), (1,SURFACECUBEMAP_WIDTH), 6 }
Cubemap Layered { (1,TEXTURECUBEMAP_LAYERED_WIDTH), (1,TEXTURECUBEMAP_LAYERED_WIDTH), (1,TEXTURECUBEMAP_LAYERED_LAYERS) } { (1,SURFACECUBEMAP_LAYERED_WIDTH), (1,SURFACECUBEMAP_LAYERED_WIDTH), (1,SURFACECUBEMAP_LAYERED_LAYERS) }
Here are examples of CUDA array descriptions: Description for a CUDA array of 2048 floats: \code CUDA_ARRAY3D_DESCRIPTOR desc; desc.Format = CU_AD_FORMAT_FLOAT; desc.NumChannels = 1; desc.Width = 2048; desc.Height = 0; desc.Depth = 0; \endcode Description for a 64 x 64 CUDA array of floats: \code CUDA_ARRAY3D_DESCRIPTOR desc; desc.Format = CU_AD_FORMAT_FLOAT; desc.NumChannels = 1; desc.Width = 64; desc.Height = 64; desc.Depth = 0; \endcode Description for a \p width x \p height x \p depth CUDA array of 64-bit, 4x16-bit float16's: \code CUDA_ARRAY3D_DESCRIPTOR desc; desc.Format = CU_AD_FORMAT_HALF; desc.NumChannels = 4; desc.Width = width; desc.Height = height; desc.Depth = depth; \endcode \param pHandle - Returned array \param pAllocateArray - 3D array descriptor \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_OUT_OF_MEMORY, ::CUDA_ERROR_UNKNOWN \notefnerr \sa ::cuArray3DGetDescriptor, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D16, ::cuMemsetD2D32, ::cuMemsetD8, ::cuMemsetD16, ::cuMemsetD32, ::cudaMalloc3DArray*/ fn cuArray3DCreate_v2( pHandle: *mut cuda_types::cuda::CUarray, pAllocateArray: *const cuda_types::cuda::CUDA_ARRAY3D_DESCRIPTOR, ) -> cuda_types::cuda::CUresult; /** \brief Get a 3D CUDA array descriptor Returns in \p *pArrayDescriptor a descriptor containing information on the format and dimensions of the CUDA array \p hArray. It is useful for subroutines that have been passed a CUDA array, but need to know the CUDA array parameters for validation or other purposes. This function may be called on 1D and 2D arrays, in which case the \p Height and/or \p Depth members of the descriptor struct will be set to 0. \param pArrayDescriptor - Returned 3D array descriptor \param hArray - 3D array to get descriptor of \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_CONTEXT_IS_DESTROYED \notefnerr \sa ::cuArray3DCreate, ::cuArrayCreate, ::cuArrayDestroy, ::cuArrayGetDescriptor, ::cuMemAlloc, ::cuMemAllocHost, ::cuMemAllocPitch, ::cuMemcpy2D, ::cuMemcpy2DAsync, ::cuMemcpy2DUnaligned, ::cuMemcpy3D, ::cuMemcpy3DAsync, ::cuMemcpyAtoA, ::cuMemcpyAtoD, ::cuMemcpyAtoH, ::cuMemcpyAtoHAsync, ::cuMemcpyDtoA, ::cuMemcpyDtoD, ::cuMemcpyDtoDAsync, ::cuMemcpyDtoH, ::cuMemcpyDtoHAsync, ::cuMemcpyHtoA, ::cuMemcpyHtoAAsync, ::cuMemcpyHtoD, ::cuMemcpyHtoDAsync, ::cuMemFree, ::cuMemFreeHost, ::cuMemGetAddressRange, ::cuMemGetInfo, ::cuMemHostAlloc, ::cuMemHostGetDevicePointer, ::cuMemsetD2D8, ::cuMemsetD2D16, ::cuMemsetD2D32, ::cuMemsetD8, ::cuMemsetD16, ::cuMemsetD32, ::cudaArrayGetInfo*/ fn cuArray3DGetDescriptor_v2( pArrayDescriptor: *mut cuda_types::cuda::CUDA_ARRAY3D_DESCRIPTOR, hArray: cuda_types::cuda::CUarray, ) -> cuda_types::cuda::CUresult; /** \brief Creates a CUDA mipmapped array Creates a CUDA mipmapped array according to the ::CUDA_ARRAY3D_DESCRIPTOR structure \p pMipmappedArrayDesc and returns a handle to the new CUDA mipmapped array in \p *pHandle. \p numMipmapLevels specifies the number of mipmap levels to be allocated. This value is clamped to the range [1, 1 + floor(log2(max(width, height, depth)))]. The ::CUDA_ARRAY3D_DESCRIPTOR is defined as: \code typedef struct { unsigned int Width; unsigned int Height; unsigned int Depth; CUarray_format Format; unsigned int NumChannels; unsigned int Flags; } CUDA_ARRAY3D_DESCRIPTOR; \endcode where: - \p Width, \p Height, and \p Depth are the width, height, and depth of the CUDA array (in elements); the following types of CUDA arrays can be allocated: - A 1D mipmapped array is allocated if \p Height and \p Depth extents are both zero. - A 2D mipmapped array is allocated if only \p Depth extent is zero. - A 3D mipmapped array is allocated if all three extents are non-zero. - A 1D layered CUDA mipmapped array is allocated if only \p Height is zero and the ::CUDA_ARRAY3D_LAYERED flag is set. Each layer is a 1D array. The number of layers is determined by the depth extent. - A 2D layered CUDA mipmapped array is allocated if all three extents are non-zero and the ::CUDA_ARRAY3D_LAYERED flag is set. Each layer is a 2D array. The number of layers is determined by the depth extent. - A cubemap CUDA mipmapped array is allocated if all three extents are non-zero and the ::CUDA_ARRAY3D_CUBEMAP flag is set. \p Width must be equal to \p Height, and \p Depth must be six. A cubemap is a special type of 2D layered CUDA array, where the six layers represent the six faces of a cube. The order of the six layers in memory is the same as that listed in ::CUarray_cubemap_face. - A cubemap layered CUDA mipmapped array is allocated if all three extents are non-zero, and both, ::CUDA_ARRAY3D_CUBEMAP and ::CUDA_ARRAY3D_LAYERED flags are set. \p Width must be equal to \p Height, and \p Depth must be a multiple of six. A cubemap layered CUDA array is a special type of 2D layered CUDA array that consists of a collection of cubemaps. The first six layers represent the first cubemap, the next six layers form the second cubemap, and so on. - ::Format specifies the format of the elements; ::CUarray_format is defined as: \code typedef enum CUarray_format_enum { CU_AD_FORMAT_UNSIGNED_INT8 = 0x01, CU_AD_FORMAT_UNSIGNED_INT16 = 0x02, CU_AD_FORMAT_UNSIGNED_INT32 = 0x03, CU_AD_FORMAT_SIGNED_INT8 = 0x08, CU_AD_FORMAT_SIGNED_INT16 = 0x09, CU_AD_FORMAT_SIGNED_INT32 = 0x0a, CU_AD_FORMAT_HALF = 0x10, CU_AD_FORMAT_FLOAT = 0x20, CU_AD_FORMAT_NV12 = 0xb0, CU_AD_FORMAT_UNORM_INT8X1 = 0xc0, CU_AD_FORMAT_UNORM_INT8X2 = 0xc1, CU_AD_FORMAT_UNORM_INT8X4 = 0xc2, CU_AD_FORMAT_UNORM_INT16X1 = 0xc3, CU_AD_FORMAT_UNORM_INT16X2 = 0xc4, CU_AD_FORMAT_UNORM_INT16X4 = 0xc5, CU_AD_FORMAT_SNORM_INT8X1 = 0xc6, CU_AD_FORMAT_SNORM_INT8X2 = 0xc7, CU_AD_FORMAT_SNORM_INT8X4 = 0xc8, CU_AD_FORMAT_SNORM_INT16X1 = 0xc9, CU_AD_FORMAT_SNORM_INT16X2 = 0xca, CU_AD_FORMAT_SNORM_INT16X4 = 0xcb, CU_AD_FORMAT_BC1_UNORM = 0x91, CU_AD_FORMAT_BC1_UNORM_SRGB = 0x92, CU_AD_FORMAT_BC2_UNORM = 0x93, CU_AD_FORMAT_BC2_UNORM_SRGB = 0x94, CU_AD_FORMAT_BC3_UNORM = 0x95, CU_AD_FORMAT_BC3_UNORM_SRGB = 0x96, CU_AD_FORMAT_BC4_UNORM = 0x97, CU_AD_FORMAT_BC4_SNORM = 0x98, CU_AD_FORMAT_BC5_UNORM = 0x99, CU_AD_FORMAT_BC5_SNORM = 0x9a, CU_AD_FORMAT_BC6H_UF16 = 0x9b, CU_AD_FORMAT_BC6H_SF16 = 0x9c, CU_AD_FORMAT_BC7_UNORM = 0x9d, CU_AD_FORMAT_BC7_UNORM_SRGB = 0x9e, CU_AD_FORMAT_P010 = 0x9f, CU_AD_FORMAT_P016 = 0xa1, CU_AD_FORMAT_NV16 = 0xa2, CU_AD_FORMAT_P210 = 0xa3, CU_AD_FORMAT_P216 = 0xa4, CU_AD_FORMAT_YUY2 = 0xa5, CU_AD_FORMAT_Y210 = 0xa6, CU_AD_FORMAT_Y216 = 0xa7, CU_AD_FORMAT_AYUV = 0xa8, CU_AD_FORMAT_Y410 = 0xa9, CU_AD_FORMAT_Y416 = 0xb1, CU_AD_FORMAT_Y444_PLANAR8 = 0xb2, CU_AD_FORMAT_Y444_PLANAR10 = 0xb3, CU_AD_FORMAT_YUV444_8bit_SemiPlanar = 0xb4, CU_AD_FORMAT_YUV444_16bit_SemiPlanar = 0xb5, CU_AD_FORMAT_UNORM_INT_101010_2 = 0x50, } CUarray_format; \endcode - \p NumChannels specifies the number of packed components per CUDA array element; it may be 1, 2, or 4; - ::Flags may be set to - ::CUDA_ARRAY3D_LAYERED to enable creation of layered CUDA mipmapped arrays. If this flag is set, \p Depth specifies the number of layers, not the depth of a 3D array. - ::CUDA_ARRAY3D_SURFACE_LDST to enable surface references to be bound to individual mipmap levels of the CUDA mipmapped array. If this flag is not set, ::cuSurfRefSetArray will fail when attempting to bind a mipmap level of the CUDA mipmapped array to a surface reference. - ::CUDA_ARRAY3D_CUBEMAP to enable creation of mipmapped cubemaps. If this flag is set, \p Width must be equal to \p Height, and \p Depth must be six. If the ::CUDA_ARRAY3D_LAYERED flag is also set, then \p Depth must be a multiple of six. - ::CUDA_ARRAY3D_TEXTURE_GATHER to indicate that the CUDA mipmapped array will be used for texture gather. Texture gather can only be performed on 2D CUDA mipmapped arrays. \p Width, \p Height and \p Depth must meet certain size requirements as listed in the following table. All values are specified in elements. Note that for brevity's sake, the full name of the device attribute is not specified. For ex., TEXTURE1D_MIPMAPPED_WIDTH refers to the device attribute ::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH.
CUDA array type Valid extents that must always be met
{(width range in elements), (height range), (depth range)}
Valid extents with CUDA_ARRAY3D_SURFACE_LDST set
{(width range in elements), (height range), (depth range)}
1D { (1,TEXTURE1D_MIPMAPPED_WIDTH), 0, 0 } { (1,SURFACE1D_WIDTH), 0, 0 }
2D { (1,TEXTURE2D_MIPMAPPED_WIDTH), (1,TEXTURE2D_MIPMAPPED_HEIGHT), 0 } { (1,SURFACE2D_WIDTH), (1,SURFACE2D_HEIGHT), 0 }
3D { (1,TEXTURE3D_WIDTH), (1,TEXTURE3D_HEIGHT), (1,TEXTURE3D_DEPTH) }
OR
{ (1,TEXTURE3D_WIDTH_ALTERNATE), (1,TEXTURE3D_HEIGHT_ALTERNATE), (1,TEXTURE3D_DEPTH_ALTERNATE) }
{ (1,SURFACE3D_WIDTH), (1,SURFACE3D_HEIGHT), (1,SURFACE3D_DEPTH) }
1D Layered { (1,TEXTURE1D_LAYERED_WIDTH), 0, (1,TEXTURE1D_LAYERED_LAYERS) } { (1,SURFACE1D_LAYERED_WIDTH), 0, (1,SURFACE1D_LAYERED_LAYERS) }
2D Layered { (1,TEXTURE2D_LAYERED_WIDTH), (1,TEXTURE2D_LAYERED_HEIGHT), (1,TEXTURE2D_LAYERED_LAYERS) } { (1,SURFACE2D_LAYERED_WIDTH), (1,SURFACE2D_LAYERED_HEIGHT), (1,SURFACE2D_LAYERED_LAYERS) }
Cubemap { (1,TEXTURECUBEMAP_WIDTH), (1,TEXTURECUBEMAP_WIDTH), 6 } { (1,SURFACECUBEMAP_WIDTH), (1,SURFACECUBEMAP_WIDTH), 6 }
Cubemap Layered { (1,TEXTURECUBEMAP_LAYERED_WIDTH), (1,TEXTURECUBEMAP_LAYERED_WIDTH), (1,TEXTURECUBEMAP_LAYERED_LAYERS) } { (1,SURFACECUBEMAP_LAYERED_WIDTH), (1,SURFACECUBEMAP_LAYERED_WIDTH), (1,SURFACECUBEMAP_LAYERED_LAYERS) }
\param pHandle - Returned mipmapped array \param pMipmappedArrayDesc - mipmapped array descriptor \param numMipmapLevels - Number of mipmap levels \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_OUT_OF_MEMORY, ::CUDA_ERROR_UNKNOWN \notefnerr \sa ::cuMipmappedArrayDestroy, ::cuMipmappedArrayGetLevel, ::cuArrayCreate, ::cudaMallocMipmappedArray*/ fn cuMipmappedArrayCreate( pHandle: *mut cuda_types::cuda::CUmipmappedArray, pMipmappedArrayDesc: *const cuda_types::cuda::CUDA_ARRAY3D_DESCRIPTOR, numMipmapLevels: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Gets a mipmap level of a CUDA mipmapped array Returns in \p *pLevelArray a CUDA array that represents a single mipmap level of the CUDA mipmapped array \p hMipmappedArray. If \p level is greater than the maximum number of levels in this mipmapped array, ::CUDA_ERROR_INVALID_VALUE is returned. \param pLevelArray - Returned mipmap level CUDA array \param hMipmappedArray - CUDA mipmapped array \param level - Mipmap level \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE \notefnerr \sa ::cuMipmappedArrayCreate, ::cuMipmappedArrayDestroy, ::cuArrayCreate, ::cudaGetMipmappedArrayLevel*/ fn cuMipmappedArrayGetLevel( pLevelArray: *mut cuda_types::cuda::CUarray, hMipmappedArray: cuda_types::cuda::CUmipmappedArray, level: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Destroys a CUDA mipmapped array Destroys the CUDA mipmapped array \p hMipmappedArray. \param hMipmappedArray - Mipmapped array to destroy \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_ARRAY_IS_MAPPED, ::CUDA_ERROR_CONTEXT_IS_DESTROYED \notefnerr \sa ::cuMipmappedArrayCreate, ::cuMipmappedArrayGetLevel, ::cuArrayCreate, ::cudaFreeMipmappedArray*/ fn cuMipmappedArrayDestroy( hMipmappedArray: cuda_types::cuda::CUmipmappedArray, ) -> cuda_types::cuda::CUresult; /** \brief Retrieve handle for an address range Get a handle of the specified type to an address range. When requesting CUmemRangeHandleType::CU_MEM_RANGE_HANDLE_TYPE_DMA_BUF_FD, address range obtained by a prior call to either ::cuMemAlloc or ::cuMemAddressReserve is supported if the ::CU_DEVICE_ATTRIBUTE_DMA_BUF_SUPPORTED device attribute returns true. If the address range was obtained via ::cuMemAddressReserve, it must also be fully mapped via ::cuMemMap. Address range obtained by a prior call to either ::cuMemAllocHost or ::cuMemHostAlloc is supported if the ::CU_DEVICE_ATTRIBUTE_HOST_ALLOC_DMA_BUF_SUPPORTED device attribute returns true. As of CUDA 13.0, querying support for address range obtained by calling ::cuMemAllocHost or ::cuMemHostAlloc using the ::CU_DEVICE_ATTRIBUTE_DMA_BUF_SUPPORTED device attribute is deprecated. Users must ensure the \p dptr and \p size are aligned to the host page size. The \p handle will be interpreted as a pointer to an integer to store the dma_buf file descriptor. Users must ensure the entire address range is backed and mapped when the address range is allocated by ::cuMemAddressReserve. All the physical allocations backing the address range must be resident on the same device and have identical allocation properties. Users are also expected to retrieve a new handle every time the underlying physical allocation(s) corresponding to a previously queried VA range are changed. For CUmemRangeHandleType::CU_MEM_RANGE_HANDLE_TYPE_DMA_BUF_FD, users may set flags to ::CU_MEM_RANGE_FLAG_DMA_BUF_MAPPING_TYPE_PCIE. Which when set on a supported platform, will give a DMA_BUF handle mapped via PCIE BAR1 or will return an error otherwise. \param[out] handle - Pointer to the location where the returned handle will be stored. \param[in] dptr - Pointer to a valid CUDA device allocation. Must be aligned to host page size. \param[in] size - Length of the address range. Must be aligned to host page size. \param[in] handleType - Type of handle requested (defines type and size of the \p handle output parameter) \param[in] flags - When requesting CUmemRangeHandleType::CU_MEM_RANGE_HANDLE_TYPE_DMA_BUF_FD the value could be ::CU_MEM_RANGE_FLAG_DMA_BUF_MAPPING_TYPE_PCIE, otherwise 0. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_SUPPORTED*/ fn cuMemGetHandleForAddressRange( handle: *mut ::core::ffi::c_void, dptr: cuda_types::cuda::CUdeviceptr, size: usize, handleType: cuda_types::cuda::CUmemRangeHandleType, flags: ::core::ffi::c_ulonglong, ) -> cuda_types::cuda::CUresult; /** \brief Submit a batch of \p count independent decompression operations. \details Each of the \p count decompression operations is described by a single entry in the \p paramsArray array. Once the batch has been submitted, the function will return, and decompression will happen asynchronously w.r.t. the CPU. To the work completion tracking mechanisms in the CUDA driver, the batch will be considered a single unit of work and processed according to stream semantics, i.e., it is not possible to query the completion of individual decompression operations within a batch. The memory pointed to by each of ::CUmemDecompressParams.src, ::CUmemDecompressParams.dst, and ::CUmemDecompressParams.dstActBytes, must be capable of usage with the hardware decompress feature. That is, for each of said pointers, the pointer attribute ::CU_POINTER_ATTRIBUTE_IS_HW_DECOMPRESS_CAPABLE should give a non-zero value. To ensure this, the memory backing the pointers should have been allocated using one of the following CUDA memory allocators: * ::cuMemAlloc() * ::cuMemCreate() with the usage flag ::CU_MEM_CREATE_USAGE_HW_DECOMPRESS * ::cuMemAllocFromPoolAsync() from a pool that was created with the usage flag ::CU_MEM_POOL_CREATE_USAGE_HW_DECOMPRESS Additionally, ::CUmemDecompressParams.src, ::CUmemDecompressParams.dst, and ::CUmemDecompressParams.dstActBytes, must all be accessible from the device associated with the context where \p stream was created. For information on how to ensure this, see the documentation for the allocator of interest. \param[in] paramsArray The array of structures describing the independent decompression operations. \param[in] count The number of entries in \p paramsArray array. \param[in] flags Must be 0. \param[out] errorIndex The index into \p paramsArray of the decompression operation for which the error returned by this function pertains to. If \p index is SIZE_MAX and the value returned is not ::CUDA_SUCCESS, then the error returned by this function should be considered a general error that does not pertain to a particular decompression operation. May be \p NULL, in which case, no index will be recorded in the event of error. \param[in] stream The stream where the work will be enqueued. \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE \notefnerr \note_async \note_null_stream \sa ::cuMemAlloc, ::cuMemPoolCreate, ::cuMemAllocFromPoolAsync*/ fn cuMemBatchDecompressAsync_ptsz( paramsArray: *mut cuda_types::cuda::CUmemDecompressParams, count: usize, flags: ::core::ffi::c_uint, errorIndex: *mut usize, stream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Allocate an address range reservation. Reserves a virtual address range based on the given parameters, giving the starting address of the range in \p ptr. This API requires a system that supports UVA. The size and address parameters must be a multiple of the host page size and the alignment must be a power of two or zero for default alignment. If \p addr is 0, then the driver chooses the address at which to place the start of the reservation whereas when it is non-zero then the driver treats it as a hint about where to place the reservation. \param[out] ptr - Resulting pointer to start of virtual address range allocated \param[in] size - Size of the reserved virtual address range requested \param[in] alignment - Alignment of the reserved virtual address range requested \param[in] addr - Hint address for the start of the address range \param[in] flags - Currently unused, must be zero \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_OUT_OF_MEMORY, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_PERMITTED, ::CUDA_ERROR_NOT_SUPPORTED \sa ::cuMemAddressFree*/ fn cuMemAddressReserve( ptr: *mut cuda_types::cuda::CUdeviceptr, size: usize, alignment: usize, addr: cuda_types::cuda::CUdeviceptr, flags: ::core::ffi::c_ulonglong, ) -> cuda_types::cuda::CUresult; /** \brief Free an address range reservation. Frees a virtual address range reserved by cuMemAddressReserve. The size must match what was given to memAddressReserve and the ptr given must match what was returned from memAddressReserve. \param[in] ptr - Starting address of the virtual address range to free \param[in] size - Size of the virtual address region to free \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_PERMITTED, ::CUDA_ERROR_NOT_SUPPORTED \sa ::cuMemAddressReserve*/ fn cuMemAddressFree( ptr: cuda_types::cuda::CUdeviceptr, size: usize, ) -> cuda_types::cuda::CUresult; /** \brief Create a CUDA memory handle representing a memory allocation of a given size described by the given properties This creates a memory allocation on the target device specified through the \p prop structure. The created allocation will not have any device or host mappings. The generic memory \p handle for the allocation can be mapped to the address space of calling process via ::cuMemMap. This handle cannot be transmitted directly to other processes (see ::cuMemExportToShareableHandle). On Windows, the caller must also pass an LPSECURITYATTRIBUTE in \p prop to be associated with this handle which limits or allows access to this handle for a recipient process (see ::CUmemAllocationProp::win32HandleMetaData for more). The \p size of this allocation must be a multiple of the the value given via ::cuMemGetAllocationGranularity with the ::CU_MEM_ALLOC_GRANULARITY_MINIMUM flag. To create a CPU allocation that doesn't target any specific NUMA nodes, applications must set ::CUmemAllocationProp::CUmemLocation::type to ::CU_MEM_LOCATION_TYPE_HOST. ::CUmemAllocationProp::CUmemLocation::id is ignored for HOST allocations. HOST allocations are not IPC capable and ::CUmemAllocationProp::requestedHandleTypes must be 0, any other value will result in ::CUDA_ERROR_INVALID_VALUE. To create a CPU allocation targeting a specific host NUMA node, applications must set ::CUmemAllocationProp::CUmemLocation::type to ::CU_MEM_LOCATION_TYPE_HOST_NUMA and ::CUmemAllocationProp::CUmemLocation::id must specify the NUMA ID of the CPU. On systems where NUMA is not available ::CUmemAllocationProp::CUmemLocation::id must be set to 0. Specifying ::CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT as the ::CUmemLocation::type will result in ::CUDA_ERROR_INVALID_VALUE. Applications that intend to use ::CU_MEM_HANDLE_TYPE_FABRIC based memory sharing must ensure: (1) `nvidia-caps-imex-channels` character device is created by the driver and is listed under /proc/devices (2) have at least one IMEX channel file accessible by the user launching the application. When exporter and importer CUDA processes have been granted access to the same IMEX channel, they can securely share memory. The IMEX channel security model works on a per user basis. Which means all processes under a user can share memory if the user has access to a valid IMEX channel. When multi-user isolation is desired, a separate IMEX channel is required for each user. These channel files exist in /dev/nvidia-caps-imex-channels/channel* and can be created using standard OS native calls like mknod on Linux. For example: To create channel0 with the major number from /proc/devices users can execute the following command: `mknod /dev/nvidia-caps-imex-channels/channel0 c 0` If ::CUmemAllocationProp::allocFlags::usage contains ::CU_MEM_CREATE_USAGE_TILE_POOL flag then the memory allocation is intended only to be used as backing tile pool for sparse CUDA arrays and sparse CUDA mipmapped arrays. (see ::cuMemMapArrayAsync). \param[out] handle - Value of handle returned. All operations on this allocation are to be performed using this handle. \param[in] size - Size of the allocation requested \param[in] prop - Properties of the allocation to create. \param[in] flags - flags for future use, must be zero now. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_OUT_OF_MEMORY, ::CUDA_ERROR_INVALID_DEVICE, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_PERMITTED, ::CUDA_ERROR_NOT_SUPPORTED \notefnerr \sa ::cuMemRelease, ::cuMemExportToShareableHandle, ::cuMemImportFromShareableHandle*/ fn cuMemCreate( handle: *mut cuda_types::cuda::CUmemGenericAllocationHandle, size: usize, prop: *const cuda_types::cuda::CUmemAllocationProp, flags: ::core::ffi::c_ulonglong, ) -> cuda_types::cuda::CUresult; /** \brief Release a memory handle representing a memory allocation which was previously allocated through cuMemCreate. Frees the memory that was allocated on a device through cuMemCreate. The memory allocation will be freed when all outstanding mappings to the memory are unmapped and when all outstanding references to the handle (including it's shareable counterparts) are also released. The generic memory handle can be freed when there are still outstanding mappings made with this handle. Each time a recipient process imports a shareable handle, it needs to pair it with ::cuMemRelease for the handle to be freed. If \p handle is not a valid handle the behavior is undefined. \param[in] handle Value of handle which was returned previously by cuMemCreate. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_PERMITTED, ::CUDA_ERROR_NOT_SUPPORTED \notefnerr \sa ::cuMemCreate*/ fn cuMemRelease( handle: cuda_types::cuda::CUmemGenericAllocationHandle, ) -> cuda_types::cuda::CUresult; /** \brief Maps an allocation handle to a reserved virtual address range. Maps bytes of memory represented by \p handle starting from byte \p offset to \p size to address range [\p addr, \p addr + \p size]. This range must be an address reservation previously reserved with ::cuMemAddressReserve, and \p offset + \p size must be less than the size of the memory allocation. Both \p ptr, \p size, and \p offset must be a multiple of the value given via ::cuMemGetAllocationGranularity with the ::CU_MEM_ALLOC_GRANULARITY_MINIMUM flag. If \p handle represents a multicast object, \p ptr, \p size and \p offset must be aligned to the value returned by ::cuMulticastGetGranularity with the flag ::CU_MULTICAST_MINIMUM_GRANULARITY. For best performance however, it is recommended that \p ptr, \p size and \p offset be aligned to the value returned by ::cuMulticastGetGranularity with the flag ::CU_MULTICAST_RECOMMENDED_GRANULARITY. When \p handle represents a multicast object, this call may return CUDA_ERROR_ILLEGAL_STATE if the system configuration is in an illegal state. In such cases, to continue using multicast, verify that the system configuration is in a valid state and all required driver daemons are running properly. Please note calling ::cuMemMap does not make the address accessible, the caller needs to update accessibility of a contiguous mapped VA range by calling ::cuMemSetAccess. Once a recipient process obtains a shareable memory handle from ::cuMemImportFromShareableHandle, the process must use ::cuMemMap to map the memory into its address ranges before setting accessibility with ::cuMemSetAccess. ::cuMemMap can only create mappings on VA range reservations that are not currently mapped. \param[in] ptr - Address where memory will be mapped. \param[in] size - Size of the memory mapping. \param[in] offset - Offset into the memory represented by - \p handle from which to start mapping - Note: currently must be zero. \param[in] handle - Handle to a shareable memory \param[in] flags - flags for future use, must be zero now. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_DEVICE, ::CUDA_ERROR_OUT_OF_MEMORY, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_PERMITTED, ::CUDA_ERROR_NOT_SUPPORTED, ::CUDA_ERROR_ILLEGAL_STATE \notefnerr \sa ::cuMemUnmap, ::cuMemSetAccess, ::cuMemCreate, ::cuMemAddressReserve, ::cuMemImportFromShareableHandle*/ fn cuMemMap( ptr: cuda_types::cuda::CUdeviceptr, size: usize, offset: usize, handle: cuda_types::cuda::CUmemGenericAllocationHandle, flags: ::core::ffi::c_ulonglong, ) -> cuda_types::cuda::CUresult; /** \brief Maps or unmaps subregions of sparse CUDA arrays and sparse CUDA mipmapped arrays Performs map or unmap operations on subregions of sparse CUDA arrays and sparse CUDA mipmapped arrays. Each operation is specified by a ::CUarrayMapInfo entry in the \p mapInfoList array of size \p count. The structure ::CUarrayMapInfo is defined as follow: \code typedef struct CUarrayMapInfo_st { CUresourcetype resourceType; union { CUmipmappedArray mipmap; CUarray array; } resource; CUarraySparseSubresourceType subresourceType; union { struct { unsigned int level; unsigned int layer; unsigned int offsetX; unsigned int offsetY; unsigned int offsetZ; unsigned int extentWidth; unsigned int extentHeight; unsigned int extentDepth; } sparseLevel; struct { unsigned int layer; unsigned long long offset; unsigned long long size; } miptail; } subresource; CUmemOperationType memOperationType; CUmemHandleType memHandleType; union { CUmemGenericAllocationHandle memHandle; } memHandle; unsigned long long offset; unsigned int deviceBitMask; unsigned int flags; unsigned int reserved[2]; } CUarrayMapInfo; \endcode where ::CUarrayMapInfo::resourceType specifies the type of resource to be operated on. If ::CUarrayMapInfo::resourceType is set to ::CUresourcetype::CU_RESOURCE_TYPE_ARRAY then ::CUarrayMapInfo::resource::array must be set to a valid sparse CUDA array handle. The CUDA array must be either a 2D, 2D layered or 3D CUDA array and must have been allocated using ::cuArrayCreate or ::cuArray3DCreate with the flag ::CUDA_ARRAY3D_SPARSE or ::CUDA_ARRAY3D_DEFERRED_MAPPING. For CUDA arrays obtained using ::cuMipmappedArrayGetLevel, ::CUDA_ERROR_INVALID_VALUE will be returned. If ::CUarrayMapInfo::resourceType is set to ::CUresourcetype::CU_RESOURCE_TYPE_MIPMAPPED_ARRAY then ::CUarrayMapInfo::resource::mipmap must be set to a valid sparse CUDA mipmapped array handle. The CUDA mipmapped array must be either a 2D, 2D layered or 3D CUDA mipmapped array and must have been allocated using ::cuMipmappedArrayCreate with the flag ::CUDA_ARRAY3D_SPARSE or ::CUDA_ARRAY3D_DEFERRED_MAPPING. ::CUarrayMapInfo::subresourceType specifies the type of subresource within the resource. ::CUarraySparseSubresourceType_enum is defined as: \code typedef enum CUarraySparseSubresourceType_enum { CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_SPARSE_LEVEL = 0, CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_MIPTAIL = 1 } CUarraySparseSubresourceType; \endcode where ::CUarraySparseSubresourceType::CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_SPARSE_LEVEL indicates a sparse-miplevel which spans at least one tile in every dimension. The remaining miplevels which are too small to span at least one tile in any dimension constitute the mip tail region as indicated by ::CUarraySparseSubresourceType::CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_MIPTAIL subresource type. If ::CUarrayMapInfo::subresourceType is set to ::CUarraySparseSubresourceType::CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_SPARSE_LEVEL then ::CUarrayMapInfo::subresource::sparseLevel struct must contain valid array subregion offsets and extents. The ::CUarrayMapInfo::subresource::sparseLevel::offsetX, ::CUarrayMapInfo::subresource::sparseLevel::offsetY and ::CUarrayMapInfo::subresource::sparseLevel::offsetZ must specify valid X, Y and Z offsets respectively. The ::CUarrayMapInfo::subresource::sparseLevel::extentWidth, ::CUarrayMapInfo::subresource::sparseLevel::extentHeight and ::CUarrayMapInfo::subresource::sparseLevel::extentDepth must specify valid width, height and depth extents respectively. These offsets and extents must be aligned to the corresponding tile dimension. For CUDA mipmapped arrays ::CUarrayMapInfo::subresource::sparseLevel::level must specify a valid mip level index. Otherwise, must be zero. For layered CUDA arrays and layered CUDA mipmapped arrays ::CUarrayMapInfo::subresource::sparseLevel::layer must specify a valid layer index. Otherwise, must be zero. ::CUarrayMapInfo::subresource::sparseLevel::offsetZ must be zero and ::CUarrayMapInfo::subresource::sparseLevel::extentDepth must be set to 1 for 2D and 2D layered CUDA arrays and CUDA mipmapped arrays. Tile extents can be obtained by calling ::cuArrayGetSparseProperties and ::cuMipmappedArrayGetSparseProperties If ::CUarrayMapInfo::subresourceType is set to ::CUarraySparseSubresourceType::CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_MIPTAIL then ::CUarrayMapInfo::subresource::miptail struct must contain valid mip tail offset in ::CUarrayMapInfo::subresource::miptail::offset and size in ::CUarrayMapInfo::subresource::miptail::size. Both, mip tail offset and mip tail size must be aligned to the tile size. For layered CUDA mipmapped arrays which don't have the flag ::CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL set in ::CUDA_ARRAY_SPARSE_PROPERTIES::flags as returned by ::cuMipmappedArrayGetSparseProperties, ::CUarrayMapInfo::subresource::miptail::layer must specify a valid layer index. Otherwise, must be zero. If ::CUarrayMapInfo::resource::array or ::CUarrayMapInfo::resource::mipmap was created with ::CUDA_ARRAY3D_DEFERRED_MAPPING flag set the ::CUarrayMapInfo::subresourceType and the contents of ::CUarrayMapInfo::subresource will be ignored. ::CUarrayMapInfo::memOperationType specifies the type of operation. ::CUmemOperationType is defined as: \code typedef enum CUmemOperationType_enum { CU_MEM_OPERATION_TYPE_MAP = 1, CU_MEM_OPERATION_TYPE_UNMAP = 2 } CUmemOperationType; \endcode If ::CUarrayMapInfo::memOperationType is set to ::CUmemOperationType::CU_MEM_OPERATION_TYPE_MAP then the subresource will be mapped onto the tile pool memory specified by ::CUarrayMapInfo::memHandle at offset ::CUarrayMapInfo::offset. The tile pool allocation has to be created by specifying the ::CU_MEM_CREATE_USAGE_TILE_POOL flag when calling ::cuMemCreate. Also, ::CUarrayMapInfo::memHandleType must be set to ::CUmemHandleType::CU_MEM_HANDLE_TYPE_GENERIC. If ::CUarrayMapInfo::memOperationType is set to ::CUmemOperationType::CU_MEM_OPERATION_TYPE_UNMAP then an unmapping operation is performed. ::CUarrayMapInfo::memHandle must be NULL. ::CUarrayMapInfo::deviceBitMask specifies the list of devices that must map or unmap physical memory. Currently, this mask must have exactly one bit set, and the corresponding device must match the device associated with the stream. If ::CUarrayMapInfo::memOperationType is set to ::CUmemOperationType::CU_MEM_OPERATION_TYPE_MAP, the device must also match the device associated with the tile pool memory allocation as specified by ::CUarrayMapInfo::memHandle. ::CUarrayMapInfo::flags and ::CUarrayMapInfo::reserved[] are unused and must be set to zero. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE \param[in] mapInfoList - List of ::CUarrayMapInfo \param[in] count - Count of ::CUarrayMapInfo in \p mapInfoList \param[in] hStream - Stream identifier for the stream to use for map or unmap operations \sa ::cuMipmappedArrayCreate, ::cuArrayCreate, ::cuArray3DCreate, ::cuMemCreate, ::cuArrayGetSparseProperties, ::cuMipmappedArrayGetSparseProperties*/ fn cuMemMapArrayAsync_ptsz( mapInfoList: *mut cuda_types::cuda::CUarrayMapInfo, count: ::core::ffi::c_uint, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Unmap the backing memory of a given address range. The range must be the entire contiguous address range that was mapped to. In other words, ::cuMemUnmap cannot unmap a sub-range of an address range mapped by ::cuMemCreate / ::cuMemMap. Any backing memory allocations will be freed if there are no existing mappings and there are no unreleased memory handles. When ::cuMemUnmap returns successfully the address range is converted to an address reservation and can be used for a future calls to ::cuMemMap. Any new mapping to this virtual address will need to have access granted through ::cuMemSetAccess, as all mappings start with no accessibility setup. \param[in] ptr - Starting address for the virtual address range to unmap \param[in] size - Size of the virtual address range to unmap \returns ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_PERMITTED, ::CUDA_ERROR_NOT_SUPPORTED \notefnerr \note_sync \sa ::cuMemCreate, ::cuMemAddressReserve*/ fn cuMemUnmap( ptr: cuda_types::cuda::CUdeviceptr, size: usize, ) -> cuda_types::cuda::CUresult; /** \brief Set the access flags for each location specified in \p desc for the given virtual address range Given the virtual address range via \p ptr and \p size, and the locations in the array given by \p desc and \p count, set the access flags for the target locations. The range must be a fully mapped address range containing all allocations created by ::cuMemMap / ::cuMemCreate. Users cannot specify ::CU_MEM_LOCATION_TYPE_HOST_NUMA accessibility for allocations created on with other location types. Note: When ::CUmemAccessDesc::CUmemLocation::type is ::CU_MEM_LOCATION_TYPE_HOST_NUMA, ::CUmemAccessDesc::CUmemLocation::id is ignored. When setting the access flags for a virtual address range mapping a multicast object, \p ptr and \p size must be aligned to the value returned by ::cuMulticastGetGranularity with the flag ::CU_MULTICAST_MINIMUM_GRANULARITY. For best performance however, it is recommended that \p ptr and \p size be aligned to the value returned by ::cuMulticastGetGranularity with the flag ::CU_MULTICAST_RECOMMENDED_GRANULARITY. \param[in] ptr - Starting address for the virtual address range \param[in] size - Length of the virtual address range \param[in] desc - Array of ::CUmemAccessDesc that describe how to change the - mapping for each location specified \param[in] count - Number of ::CUmemAccessDesc in \p desc \returns ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_DEVICE, ::CUDA_ERROR_NOT_SUPPORTED \notefnerr \note_sync \sa ::cuMemSetAccess, ::cuMemCreate, :cuMemMap*/ fn cuMemSetAccess( ptr: cuda_types::cuda::CUdeviceptr, size: usize, desc: *const cuda_types::cuda::CUmemAccessDesc, count: usize, ) -> cuda_types::cuda::CUresult; /** \brief Get the access \p flags set for the given \p location and \p ptr \param[out] flags - Flags set for this location \param[in] location - Location in which to check the flags for \param[in] ptr - Address in which to check the access flags for \returns ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_DEVICE, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_PERMITTED, ::CUDA_ERROR_NOT_SUPPORTED \sa ::cuMemSetAccess*/ fn cuMemGetAccess( flags: *mut ::core::ffi::c_ulonglong, location: *const cuda_types::cuda::CUmemLocation, ptr: cuda_types::cuda::CUdeviceptr, ) -> cuda_types::cuda::CUresult; /** \brief Exports an allocation to a requested shareable handle type Given a CUDA memory handle, create a shareable memory allocation handle that can be used to share the memory with other processes. The recipient process can convert the shareable handle back into a CUDA memory handle using ::cuMemImportFromShareableHandle and map it with ::cuMemMap. The implementation of what this handle is and how it can be transferred is defined by the requested handle type in \p handleType Once all shareable handles are closed and the allocation is released, the allocated memory referenced will be released back to the OS and uses of the CUDA handle afterward will lead to undefined behavior. This API can also be used in conjunction with other APIs (e.g. Vulkan, OpenGL) that support importing memory from the shareable type \param[out] shareableHandle - Pointer to the location in which to store the requested handle type \param[in] handle - CUDA handle for the memory allocation \param[in] handleType - Type of shareable handle requested (defines type and size of the \p shareableHandle output parameter) \param[in] flags - Reserved, must be zero \returns ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_PERMITTED, ::CUDA_ERROR_NOT_SUPPORTED \sa ::cuMemImportFromShareableHandle*/ fn cuMemExportToShareableHandle( shareableHandle: *mut ::core::ffi::c_void, handle: cuda_types::cuda::CUmemGenericAllocationHandle, handleType: cuda_types::cuda::CUmemAllocationHandleType, flags: ::core::ffi::c_ulonglong, ) -> cuda_types::cuda::CUresult; /** \brief Imports an allocation from a requested shareable handle type. If the current process cannot support the memory described by this shareable handle, this API will error as ::CUDA_ERROR_NOT_SUPPORTED. If \p shHandleType is ::CU_MEM_HANDLE_TYPE_FABRIC and the importer process has not been granted access to the same IMEX channel as the exporter process, this API will error as ::CUDA_ERROR_NOT_PERMITTED. \note Importing shareable handles exported from some graphics APIs(VUlkan, OpenGL, etc) created on devices under an SLI group may not be supported, and thus this API will return CUDA_ERROR_NOT_SUPPORTED. There is no guarantee that the contents of \p handle will be the same CUDA memory handle for the same given OS shareable handle, or the same underlying allocation. \param[out] handle - CUDA Memory handle for the memory allocation. \param[in] osHandle - Shareable Handle representing the memory allocation that is to be imported. \param[in] shHandleType - handle type of the exported handle ::CUmemAllocationHandleType. \returns ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_PERMITTED, ::CUDA_ERROR_NOT_SUPPORTED \sa ::cuMemExportToShareableHandle, ::cuMemMap, ::cuMemRelease*/ fn cuMemImportFromShareableHandle( handle: *mut cuda_types::cuda::CUmemGenericAllocationHandle, osHandle: *mut ::core::ffi::c_void, shHandleType: cuda_types::cuda::CUmemAllocationHandleType, ) -> cuda_types::cuda::CUresult; /** \brief Calculates either the minimal or recommended granularity Calculates either the minimal or recommended granularity for a given allocation specification and returns it in granularity. This granularity can be used as a multiple for alignment, size, or address mapping. \param[out] granularity Returned granularity. \param[in] prop Property for which to determine the granularity for \param[in] option Determines which granularity to return \returns ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_PERMITTED, ::CUDA_ERROR_NOT_SUPPORTED \sa ::cuMemCreate, ::cuMemMap*/ fn cuMemGetAllocationGranularity( granularity: *mut usize, prop: *const cuda_types::cuda::CUmemAllocationProp, option: cuda_types::cuda::CUmemAllocationGranularity_flags, ) -> cuda_types::cuda::CUresult; /** \brief Retrieve the contents of the property structure defining properties for this handle \param[out] prop - Pointer to a properties structure which will hold the information about this handle \param[in] handle - Handle which to perform the query on \returns ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_PERMITTED, ::CUDA_ERROR_NOT_SUPPORTED \sa ::cuMemCreate, ::cuMemImportFromShareableHandle*/ fn cuMemGetAllocationPropertiesFromHandle( prop: *mut cuda_types::cuda::CUmemAllocationProp, handle: cuda_types::cuda::CUmemGenericAllocationHandle, ) -> cuda_types::cuda::CUresult; /** \brief Given an address \p addr, returns the allocation handle of the backing memory allocation. The handle is guaranteed to be the same handle value used to map the memory. If the address requested is not mapped, the function will fail. The returned handle must be released with corresponding number of calls to ::cuMemRelease. \note The address \p addr, can be any address in a range previously mapped by ::cuMemMap, and not necessarily the start address. \param[out] handle CUDA Memory handle for the backing memory allocation. \param[in] addr Memory address to query, that has been mapped previously. \returns ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_PERMITTED, ::CUDA_ERROR_NOT_SUPPORTED \sa ::cuMemCreate, ::cuMemRelease, ::cuMemMap*/ fn cuMemRetainAllocationHandle( handle: *mut cuda_types::cuda::CUmemGenericAllocationHandle, addr: *mut ::core::ffi::c_void, ) -> cuda_types::cuda::CUresult; /** \brief Frees memory with stream ordered semantics Inserts a free operation into \p hStream. The allocation must not be accessed after stream execution reaches the free. After this API returns, accessing the memory from any subsequent work launched on the GPU or querying its pointer attributes results in undefined behavior. \note During stream capture, this function results in the creation of a free node and must therefore be passed the address of a graph allocation. \param dptr - memory to free \param hStream - The stream establishing the stream ordering contract. \returns ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT (default stream specified with no current context), ::CUDA_ERROR_NOT_SUPPORTED*/ fn cuMemFreeAsync_ptsz( dptr: cuda_types::cuda::CUdeviceptr, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Allocates memory with stream ordered semantics Inserts an allocation operation into \p hStream. A pointer to the allocated memory is returned immediately in *dptr. The allocation must not be accessed until the the allocation operation completes. The allocation comes from the memory pool current to the stream's device. \note The default memory pool of a device contains device memory from that device. \note Basic stream ordering allows future work submitted into the same stream to use the allocation. Stream query, stream synchronize, and CUDA events can be used to guarantee that the allocation operation completes before work submitted in a separate stream runs. \note During stream capture, this function results in the creation of an allocation node. In this case, the allocation is owned by the graph instead of the memory pool. The memory pool's properties are used to set the node's creation parameters. \param[out] dptr - Returned device pointer \param[in] bytesize - Number of bytes to allocate \param[in] hStream - The stream establishing the stream ordering contract and the memory pool to allocate from \returns ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT (default stream specified with no current context), ::CUDA_ERROR_NOT_SUPPORTED, ::CUDA_ERROR_OUT_OF_MEMORY \sa ::cuMemAllocFromPoolAsync, ::cuMemFreeAsync, ::cuDeviceSetMemPool, ::cuDeviceGetDefaultMemPool, ::cuDeviceGetMemPool, ::cuMemPoolCreate, ::cuMemPoolSetAccess, ::cuMemPoolSetAttribute*/ fn cuMemAllocAsync_ptsz( dptr: *mut cuda_types::cuda::CUdeviceptr, bytesize: usize, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Tries to release memory back to the OS Releases memory back to the OS until the pool contains fewer than minBytesToKeep reserved bytes, or there is no more memory that the allocator can safely release. The allocator cannot release OS allocations that back outstanding asynchronous allocations. The OS allocations may happen at different granularity from the user allocations. \note: Allocations that have not been freed count as outstanding. \note: Allocations that have been asynchronously freed but whose completion has not been observed on the host (eg. by a synchronize) can count as outstanding. \param[in] pool - The memory pool to trim \param[in] minBytesToKeep - If the pool has less than minBytesToKeep reserved, the TrimTo operation is a no-op. Otherwise the pool will be guaranteed to have at least minBytesToKeep bytes reserved after the operation. \returns ::CUDA_SUCCESS, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \sa ::cuMemAllocAsync, ::cuMemFreeAsync, ::cuDeviceGetDefaultMemPool, ::cuDeviceGetMemPool, ::cuMemPoolCreate*/ fn cuMemPoolTrimTo( pool: cuda_types::cuda::CUmemoryPool, minBytesToKeep: usize, ) -> cuda_types::cuda::CUresult; /** \brief Sets attributes of a memory pool Supported attributes are: - ::CU_MEMPOOL_ATTR_RELEASE_THRESHOLD: (value type = cuuint64_t) Amount of reserved memory in bytes to hold onto before trying to release memory back to the OS. When more than the release threshold bytes of memory are held by the memory pool, the allocator will try to release memory back to the OS on the next call to stream, event or context synchronize. (default 0) - ::CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES: (value type = int) Allow ::cuMemAllocAsync to use memory asynchronously freed in another stream as long as a stream ordering dependency of the allocating stream on the free action exists. Cuda events and null stream interactions can create the required stream ordered dependencies. (default enabled) - ::CU_MEMPOOL_ATTR_REUSE_ALLOW_OPPORTUNISTIC: (value type = int) Allow reuse of already completed frees when there is no dependency between the free and allocation. (default enabled) - ::CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES: (value type = int) Allow ::cuMemAllocAsync to insert new stream dependencies in order to establish the stream ordering required to reuse a piece of memory released by ::cuMemFreeAsync (default enabled). - ::CU_MEMPOOL_ATTR_RESERVED_MEM_HIGH: (value type = cuuint64_t) Reset the high watermark that tracks the amount of backing memory that was allocated for the memory pool. It is illegal to set this attribute to a non-zero value. - ::CU_MEMPOOL_ATTR_USED_MEM_HIGH: (value type = cuuint64_t) Reset the high watermark that tracks the amount of used memory that was allocated for the memory pool. \param[in] pool - The memory pool to modify \param[in] attr - The attribute to modify \param[in] value - Pointer to the value to assign \returns ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE \sa ::cuMemAllocAsync, ::cuMemFreeAsync, ::cuDeviceGetDefaultMemPool, ::cuDeviceGetMemPool, ::cuMemPoolCreate*/ fn cuMemPoolSetAttribute( pool: cuda_types::cuda::CUmemoryPool, attr: cuda_types::cuda::CUmemPool_attribute, value: *mut ::core::ffi::c_void, ) -> cuda_types::cuda::CUresult; /** \brief Gets attributes of a memory pool Supported attributes are: - ::CU_MEMPOOL_ATTR_RELEASE_THRESHOLD: (value type = cuuint64_t) Amount of reserved memory in bytes to hold onto before trying to release memory back to the OS. When more than the release threshold bytes of memory are held by the memory pool, the allocator will try to release memory back to the OS on the next call to stream, event or context synchronize. (default 0) - ::CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES: (value type = int) Allow ::cuMemAllocAsync to use memory asynchronously freed in another stream as long as a stream ordering dependency of the allocating stream on the free action exists. Cuda events and null stream interactions can create the required stream ordered dependencies. (default enabled) - ::CU_MEMPOOL_ATTR_REUSE_ALLOW_OPPORTUNISTIC: (value type = int) Allow reuse of already completed frees when there is no dependency between the free and allocation. (default enabled) - ::CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES: (value type = int) Allow ::cuMemAllocAsync to insert new stream dependencies in order to establish the stream ordering required to reuse a piece of memory released by ::cuMemFreeAsync (default enabled). - ::CU_MEMPOOL_ATTR_RESERVED_MEM_CURRENT: (value type = cuuint64_t) Amount of backing memory currently allocated for the mempool - ::CU_MEMPOOL_ATTR_RESERVED_MEM_HIGH: (value type = cuuint64_t) High watermark of backing memory allocated for the mempool since the last time it was reset. - ::CU_MEMPOOL_ATTR_USED_MEM_CURRENT: (value type = cuuint64_t) Amount of memory from the pool that is currently in use by the application. - ::CU_MEMPOOL_ATTR_USED_MEM_HIGH: (value type = cuuint64_t) High watermark of the amount of memory from the pool that was in use by the application. \param[in] pool - The memory pool to get attributes of \param[in] attr - The attribute to get \param[out] value - Retrieved value \returns ::CUDA_SUCCESS, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \sa ::cuMemAllocAsync, ::cuMemFreeAsync, ::cuDeviceGetDefaultMemPool, ::cuDeviceGetMemPool, ::cuMemPoolCreate*/ fn cuMemPoolGetAttribute( pool: cuda_types::cuda::CUmemoryPool, attr: cuda_types::cuda::CUmemPool_attribute, value: *mut ::core::ffi::c_void, ) -> cuda_types::cuda::CUresult; /** \brief Controls visibility of pools between devices \param[in] pool - The pool being modified \param[in] map - Array of access descriptors. Each descriptor instructs the access to enable for a single gpu. \param[in] count - Number of descriptors in the map array. \returns ::CUDA_SUCCESS, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \sa ::cuMemAllocAsync, ::cuMemFreeAsync, ::cuDeviceGetDefaultMemPool, ::cuDeviceGetMemPool, ::cuMemPoolCreate*/ fn cuMemPoolSetAccess( pool: cuda_types::cuda::CUmemoryPool, map: *const cuda_types::cuda::CUmemAccessDesc, count: usize, ) -> cuda_types::cuda::CUresult; /** \brief Returns the accessibility of a pool from a device Returns the accessibility of the pool's memory from the specified location. \param[out] flags - the accessibility of the pool from the specified location \param[in] memPool - the pool being queried \param[in] location - the location accessing the pool \sa ::cuMemAllocAsync, ::cuMemFreeAsync, ::cuDeviceGetDefaultMemPool, ::cuDeviceGetMemPool, ::cuMemPoolCreate*/ fn cuMemPoolGetAccess( flags: *mut cuda_types::cuda::CUmemAccess_flags, memPool: cuda_types::cuda::CUmemoryPool, location: *mut cuda_types::cuda::CUmemLocation, ) -> cuda_types::cuda::CUresult; /** \brief Creates a memory pool Creates a CUDA memory pool and returns the handle in \p pool. The \p poolProps determines the properties of the pool such as the backing device and IPC capabilities. To create a memory pool for HOST memory not targeting a specific NUMA node, applications must set set ::CUmemPoolProps::CUmemLocation::type to ::CU_MEM_LOCATION_TYPE_HOST. ::CUmemPoolProps::CUmemLocation::id is ignored for such pools. Pools created with the type ::CU_MEM_LOCATION_TYPE_HOST are not IPC capable and ::CUmemPoolProps::handleTypes must be 0, any other values will result in ::CUDA_ERROR_INVALID_VALUE. To create a memory pool targeting a specific host NUMA node, applications must set ::CUmemPoolProps::CUmemLocation::type to ::CU_MEM_LOCATION_TYPE_HOST_NUMA and ::CUmemPoolProps::CUmemLocation::id must specify the NUMA ID of the host memory node. Specifying ::CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT as the ::CUmemPoolProps::CUmemLocation::type will result in ::CUDA_ERROR_INVALID_VALUE. By default, the pool's memory will be accessible from the device it is allocated on. In the case of pools created with ::CU_MEM_LOCATION_TYPE_HOST_NUMA or ::CU_MEM_LOCATION_TYPE_HOST, their default accessibility will be from the host CPU. Applications can control the maximum size of the pool by specifying a non-zero value for ::CUmemPoolProps::maxSize. If set to 0, the maximum size of the pool will default to a system dependent value. Applications that intend to use ::CU_MEM_HANDLE_TYPE_FABRIC based memory sharing must ensure: (1) `nvidia-caps-imex-channels` character device is created by the driver and is listed under /proc/devices (2) have at least one IMEX channel file accessible by the user launching the application. When exporter and importer CUDA processes have been granted access to the same IMEX channel, they can securely share memory. The IMEX channel security model works on a per user basis. Which means all processes under a user can share memory if the user has access to a valid IMEX channel. When multi-user isolation is desired, a separate IMEX channel is required for each user. These channel files exist in /dev/nvidia-caps-imex-channels/channel* and can be created using standard OS native calls like mknod on Linux. For example: To create channel0 with the major number from /proc/devices users can execute the following command: `mknod /dev/nvidia-caps-imex-channels/channel0 c 0` \note Specifying CU_MEM_HANDLE_TYPE_NONE creates a memory pool that will not support IPC. \returns ::CUDA_SUCCESS, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_OUT_OF_MEMORY, ::CUDA_ERROR_NOT_PERMITTED, ::CUDA_ERROR_NOT_SUPPORTED \sa ::cuDeviceSetMemPool, ::cuDeviceGetMemPool, ::cuDeviceGetDefaultMemPool, ::cuMemAllocFromPoolAsync, ::cuMemPoolExportToShareableHandle*/ fn cuMemPoolCreate( pool: *mut cuda_types::cuda::CUmemoryPool, poolProps: *const cuda_types::cuda::CUmemPoolProps, ) -> cuda_types::cuda::CUresult; /** \brief Destroys the specified memory pool If any pointers obtained from this pool haven't been freed or the pool has free operations that haven't completed when ::cuMemPoolDestroy is invoked, the function will return immediately and the resources associated with the pool will be released automatically once there are no more outstanding allocations. Destroying the current mempool of a device sets the default mempool of that device as the current mempool for that device. \note A device's default memory pool cannot be destroyed. \returns ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE \sa ::cuMemFreeAsync, ::cuDeviceSetMemPool, ::cuDeviceGetMemPool, ::cuDeviceGetDefaultMemPool, ::cuMemPoolCreate*/ fn cuMemPoolDestroy( pool: cuda_types::cuda::CUmemoryPool, ) -> cuda_types::cuda::CUresult; /** \brief Returns the default memory pool for a given location and allocation type The memory location can be of one of ::CU_MEM_LOCATION_TYPE_DEVICE, ::CU_MEM_LOCATION_TYPE_HOST or ::CU_MEM_LOCATION_TYPE_HOST_NUMA. The allocation type can be one of ::CU_MEM_ALLOCATION_TYPE_PINNED or ::CU_MEM_ALLOCATION_TYPE_MANAGED. When the allocation type is ::CU_MEM_ALLOCATION_TYPE_MANAGED, the location type can also be ::CU_MEM_LOCATION_TYPE_NONE to indicate no preferred location for the managed memory pool. In all other cases, the call returns ::CUDA_ERROR_INVALID_VALUE. \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_DEVICE, ::CUDA_ERROR_NOT_SUPPORTED \notefnerr \sa ::cuMemAllocAsync, ::cuMemPoolTrimTo, ::cuMemPoolGetAttribute, ::cuMemPoolSetAttribute, cuMemPoolSetAccess, ::cuMemGetMemPool, ::cuMemPoolCreate*/ fn cuMemGetDefaultMemPool( pool_out: *mut cuda_types::cuda::CUmemoryPool, location: *mut cuda_types::cuda::CUmemLocation, type_: cuda_types::cuda::CUmemAllocationType, ) -> cuda_types::cuda::CUresult; /** \brief Gets the current memory pool for a memory location and of a particular allocation type The memory location can be of one of ::CU_MEM_LOCATION_TYPE_DEVICE, ::CU_MEM_LOCATION_TYPE_HOST or ::CU_MEM_LOCATION_TYPE_HOST_NUMA. The allocation type can be one of ::CU_MEM_ALLOCATION_TYPE_PINNED or ::CU_MEM_ALLOCATION_TYPE_MANAGED. When the allocation type is ::CU_MEM_ALLOCATION_TYPE_MANAGED, the location type can also be ::CU_MEM_LOCATION_TYPE_NONE to indicate no preferred location for the managed memory pool. In all other cases, the call returns ::CUDA_ERROR_INVALID_VALUE Returns the last pool provided to ::cuMemSetMemPool or ::cuDeviceSetMemPool for this location and allocation type or the location's default memory pool if ::cuMemSetMemPool or ::cuDeviceSetMemPool for that allocType and location has never been called. By default the current mempool of a location is the default mempool for a device. Otherwise the returned pool must have been set with ::cuDeviceSetMemPool. \returns ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE \sa ::cuDeviceGetDefaultMemPool, ::cuMemPoolCreate, ::cuDeviceSetMemPool, ::cuMemSetMemPool*/ fn cuMemGetMemPool( pool: *mut cuda_types::cuda::CUmemoryPool, location: *mut cuda_types::cuda::CUmemLocation, type_: cuda_types::cuda::CUmemAllocationType, ) -> cuda_types::cuda::CUresult; /** \brief Sets the current memory pool for a memory location and allocation type The memory location can be of one of ::CU_MEM_LOCATION_TYPE_DEVICE, ::CU_MEM_LOCATION_TYPE_HOST or ::CU_MEM_LOCATION_TYPE_HOST_NUMA. The allocation type can be one of ::CU_MEM_ALLOCATION_TYPE_PINNED or ::CU_MEM_ALLOCATION_TYPE_MANAGED. When the allocation type is ::CU_MEM_ALLOCATION_TYPE_MANAGED, the location type can also be ::CU_MEM_LOCATION_TYPE_NONE to indicate no preferred location for the managed memory pool. In all other cases, the call returns ::CUDA_ERROR_INVALID_VALUE. When a memory pool is set as the current memory pool, the location parameter should be the same as the location of the pool. The location and allocation type specified must match those of the pool otherwise ::CUDA_ERROR_INVALID_VALUE is returned. By default, a memory location's current memory pool is its default memory pool that can be obtained via ::cuMemGetDefaultMemPool. If the location type is ::CU_MEM_LOCATION_TYPE_DEVICE and the allocation type is ::CU_MEM_ALLOCATION_TYPE_PINNED, then this API is the equivalent of calling ::cuDeviceSetMemPool with the location id as the device. For further details on the implications, please refer to the documentation for ::cuDeviceSetMemPool. \note Use ::cuMemAllocFromPoolAsync to specify asynchronous allocations from a device different than the one the stream runs on. \returns ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE \sa ::cuDeviceGetDefaultMemPool, ::cuDeviceGetMemPool, ::cuMemGetMemPool, ::cuMemPoolCreate, ::cuMemPoolDestroy, ::cuMemAllocFromPoolAsync*/ fn cuMemSetMemPool( location: *mut cuda_types::cuda::CUmemLocation, type_: cuda_types::cuda::CUmemAllocationType, pool: cuda_types::cuda::CUmemoryPool, ) -> cuda_types::cuda::CUresult; /** \brief Allocates memory from a specified pool with stream ordered semantics. Inserts an allocation operation into \p hStream. A pointer to the allocated memory is returned immediately in *dptr. The allocation must not be accessed until the the allocation operation completes. The allocation comes from the specified memory pool. \note - The specified memory pool may be from a device different than that of the specified \p hStream. - Basic stream ordering allows future work submitted into the same stream to use the allocation. Stream query, stream synchronize, and CUDA events can be used to guarantee that the allocation operation completes before work submitted in a separate stream runs. \note During stream capture, this function results in the creation of an allocation node. In this case, the allocation is owned by the graph instead of the memory pool. The memory pool's properties are used to set the node's creation parameters. \param[out] dptr - Returned device pointer \param[in] bytesize - Number of bytes to allocate \param[in] pool - The pool to allocate from \param[in] hStream - The stream establishing the stream ordering semantic \returns ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT (default stream specified with no current context), ::CUDA_ERROR_NOT_SUPPORTED, ::CUDA_ERROR_OUT_OF_MEMORY \sa ::cuMemAllocAsync, ::cuMemFreeAsync, ::cuDeviceGetDefaultMemPool, ::cuDeviceGetMemPool, ::cuMemPoolCreate, ::cuMemPoolSetAccess, ::cuMemPoolSetAttribute*/ fn cuMemAllocFromPoolAsync_ptsz( dptr: *mut cuda_types::cuda::CUdeviceptr, bytesize: usize, pool: cuda_types::cuda::CUmemoryPool, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Exports a memory pool to the requested handle type. Given an IPC capable mempool, create an OS handle to share the pool with another process. A recipient process can convert the shareable handle into a mempool with ::cuMemPoolImportFromShareableHandle. Individual pointers can then be shared with the ::cuMemPoolExportPointer and ::cuMemPoolImportPointer APIs. The implementation of what the shareable handle is and how it can be transferred is defined by the requested handle type. \note: To create an IPC capable mempool, create a mempool with a CUmemAllocationHandleType other than CU_MEM_HANDLE_TYPE_NONE. \param[out] handle_out - Returned OS handle \param[in] pool - pool to export \param[in] handleType - the type of handle to create \param[in] flags - must be 0 \returns ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_OUT_OF_MEMORY \sa ::cuMemPoolImportFromShareableHandle, ::cuMemPoolExportPointer, ::cuMemPoolImportPointer, ::cuMemAllocAsync, ::cuMemFreeAsync, ::cuDeviceGetDefaultMemPool, ::cuDeviceGetMemPool, ::cuMemPoolCreate, ::cuMemPoolSetAccess, ::cuMemPoolSetAttribute*/ fn cuMemPoolExportToShareableHandle( handle_out: *mut ::core::ffi::c_void, pool: cuda_types::cuda::CUmemoryPool, handleType: cuda_types::cuda::CUmemAllocationHandleType, flags: ::core::ffi::c_ulonglong, ) -> cuda_types::cuda::CUresult; /** \brief imports a memory pool from a shared handle. Specific allocations can be imported from the imported pool with cuMemPoolImportPointer. If \p handleType is ::CU_MEM_HANDLE_TYPE_FABRIC and the importer process has not been granted access to the same IMEX channel as the exporter process, this API will error as ::CUDA_ERROR_NOT_PERMITTED. \note Imported memory pools do not support creating new allocations. As such imported memory pools may not be used in cuDeviceSetMemPool or ::cuMemAllocFromPoolAsync calls. \param[out] pool_out - Returned memory pool \param[in] handle - OS handle of the pool to open \param[in] handleType - The type of handle being imported \param[in] flags - must be 0 \returns ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_OUT_OF_MEMORY \sa ::cuMemPoolExportToShareableHandle, ::cuMemPoolExportPointer, ::cuMemPoolImportPointer*/ fn cuMemPoolImportFromShareableHandle( pool_out: *mut cuda_types::cuda::CUmemoryPool, handle: *mut ::core::ffi::c_void, handleType: cuda_types::cuda::CUmemAllocationHandleType, flags: ::core::ffi::c_ulonglong, ) -> cuda_types::cuda::CUresult; /** \brief Export data to share a memory pool allocation between processes. Constructs \p shareData_out for sharing a specific allocation from an already shared memory pool. The recipient process can import the allocation with the ::cuMemPoolImportPointer api. The data is not a handle and may be shared through any IPC mechanism. \param[out] shareData_out - Returned export data \param[in] ptr - pointer to memory being exported \returns ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_OUT_OF_MEMORY \sa ::cuMemPoolExportToShareableHandle, ::cuMemPoolImportFromShareableHandle, ::cuMemPoolImportPointer*/ fn cuMemPoolExportPointer( shareData_out: *mut cuda_types::cuda::CUmemPoolPtrExportData, ptr: cuda_types::cuda::CUdeviceptr, ) -> cuda_types::cuda::CUresult; /** \brief Import a memory pool allocation from another process. Returns in \p ptr_out a pointer to the imported memory. The imported memory must not be accessed before the allocation operation completes in the exporting process. The imported memory must be freed from all importing processes before being freed in the exporting process. The pointer may be freed with cuMemFree or cuMemFreeAsync. If cuMemFreeAsync is used, the free must be completed on the importing process before the free operation on the exporting process. \note The cuMemFreeAsync api may be used in the exporting process before the cuMemFreeAsync operation completes in its stream as long as the cuMemFreeAsync in the exporting process specifies a stream with a stream dependency on the importing process's cuMemFreeAsync. \param[out] ptr_out - pointer to imported memory \param[in] pool - pool from which to import \param[in] shareData - data specifying the memory to import \returns ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_OUT_OF_MEMORY \sa ::cuMemPoolExportToShareableHandle, ::cuMemPoolImportFromShareableHandle, ::cuMemPoolExportPointer*/ fn cuMemPoolImportPointer( ptr_out: *mut cuda_types::cuda::CUdeviceptr, pool: cuda_types::cuda::CUmemoryPool, shareData: *mut cuda_types::cuda::CUmemPoolPtrExportData, ) -> cuda_types::cuda::CUresult; /** \brief Create a generic allocation handle representing a multicast object described by the given properties. This creates a multicast object as described by \p prop. The number of participating devices is specified by ::CUmulticastObjectProp::numDevices. Devices can be added to the multicast object via ::cuMulticastAddDevice. All participating devices must be added to the multicast object before memory can be bound to it. Memory is bound to the multicast object via either ::cuMulticastBindMem or ::cuMulticastBindAddr, and can be unbound via ::cuMulticastUnbind. The total amount of memory that can be bound per device is specified by :CUmulticastObjectProp::size. This size must be a multiple of the value returned by ::cuMulticastGetGranularity with the flag ::CU_MULTICAST_GRANULARITY_MINIMUM. For best performance however, the size should be aligned to the value returned by ::cuMulticastGetGranularity with the flag ::CU_MULTICAST_GRANULARITY_RECOMMENDED. After all participating devices have been added, multicast objects can also be mapped to a device's virtual address space using the virtual memory management APIs (see ::cuMemMap and ::cuMemSetAccess). Multicast objects can also be shared with other processes by requesting a shareable handle via ::cuMemExportToShareableHandle. Note that the desired types of shareable handles must be specified in the bitmask ::CUmulticastObjectProp::handleTypes. Multicast objects can be released using the virtual memory management API ::cuMemRelease. \param[out] mcHandle Value of handle returned. \param[in] prop Properties of the multicast object to create. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_OUT_OF_MEMORY, ::CUDA_ERROR_INVALID_DEVICE, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_PERMITTED, ::CUDA_ERROR_NOT_SUPPORTED \sa ::cuMulticastAddDevice, ::cuMulticastBindMem, ::cuMulticastBindAddr, ::cuMulticastUnbind \sa ::cuMemCreate, ::cuMemRelease, ::cuMemExportToShareableHandle, ::cuMemImportFromShareableHandle*/ fn cuMulticastCreate( mcHandle: *mut cuda_types::cuda::CUmemGenericAllocationHandle, prop: *const cuda_types::cuda::CUmulticastObjectProp, ) -> cuda_types::cuda::CUresult; /** \brief Associate a device to a multicast object. Associates a device to a multicast object. The added device will be a part of the multicast team of size specified by CUmulticastObjectProp::numDevices during ::cuMulticastCreate. The association of the device to the multicast object is permanent during the life time of the multicast object. All devices must be added to the multicast team before any memory can be bound to any device in the team. Any calls to ::cuMulticastBindMem or ::cuMulticastBindAddr will block until all devices have been added. Similarly all devices must be added to the multicast team before a virtual address range can be mapped to the multicast object. A call to ::cuMemMap will block until all devices have been added. \param[in] mcHandle Handle representing a multicast object. \param[in] dev Device that will be associated to the multicast object. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_OUT_OF_MEMORY, ::CUDA_ERROR_INVALID_DEVICE, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_PERMITTED, ::CUDA_ERROR_NOT_SUPPORTED \sa ::cuMulticastCreate, ::cuMulticastBindMem, ::cuMulticastBindAddr*/ fn cuMulticastAddDevice( mcHandle: cuda_types::cuda::CUmemGenericAllocationHandle, dev: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; /** \brief Bind a memory allocation represented by a handle to a multicast object. Binds a memory allocation specified by \p memHandle and created via ::cuMemCreate to a multicast object represented by \p mcHandle and created via ::cuMulticastCreate. The intended \p size of the bind, the offset in the multicast range \p mcOffset as well as the offset in the memory \p memOffset must be a multiple of the value returned by ::cuMulticastGetGranularity with the flag ::CU_MULTICAST_GRANULARITY_MINIMUM. For best performance however, \p size, \p mcOffset and \p memOffset should be aligned to the granularity of the memory allocation(see ::cuMemGetAllocationGranularity) or to the value returned by ::cuMulticastGetGranularity with the flag ::CU_MULTICAST_GRANULARITY_RECOMMENDED. The \p size + \p memOffset cannot be larger than the size of the allocated memory. Similarly the \p size + \p mcOffset cannot be larger than the size of the multicast object. The memory allocation must have beeen created on one of the devices that was added to the multicast team via ::cuMulticastAddDevice. Externally shareable as well as imported multicast objects can be bound only to externally shareable memory. Note that this call will return CUDA_ERROR_OUT_OF_MEMORY if there are insufficient resources required to perform the bind. This call may also return CUDA_ERROR_SYSTEM_NOT_READY if the necessary system software is not initialized or running. This call may return CUDA_ERROR_ILLEGAL_STATE if the system configuration is in an illegal state. In such cases, to continue using multicast, verify that the system configuration is in a valid state and all required driver daemons are running properly. \param[in] mcHandle Handle representing a multicast object. \param[in] mcOffset Offset into the multicast object for attachment. \param[in] memHandle Handle representing a memory allocation. \param[in] memOffset Offset into the memory for attachment. \param[in] size Size of the memory that will be bound to the multicast object. \param[in] flags Flags for future use, must be zero for now. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_DEVICE, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_PERMITTED, ::CUDA_ERROR_NOT_SUPPORTED, ::CUDA_ERROR_OUT_OF_MEMORY, ::CUDA_ERROR_SYSTEM_NOT_READY, ::CUDA_ERROR_ILLEGAL_STATE \sa ::cuMulticastCreate, ::cuMulticastAddDevice, ::cuMemCreate*/ fn cuMulticastBindMem( mcHandle: cuda_types::cuda::CUmemGenericAllocationHandle, mcOffset: usize, memHandle: cuda_types::cuda::CUmemGenericAllocationHandle, memOffset: usize, size: usize, flags: ::core::ffi::c_ulonglong, ) -> cuda_types::cuda::CUresult; /** \brief Bind a memory allocation represented by a virtual address to a multicast object. Binds a memory allocation specified by its mapped address \p memptr to a multicast object represented by \p mcHandle. The memory must have been allocated via ::cuMemCreate or ::cudaMallocAsync. The intended \p size of the bind, the offset in the multicast range \p mcOffset and \p memptr must be a multiple of the value returned by ::cuMulticastGetGranularity with the flag ::CU_MULTICAST_GRANULARITY_MINIMUM. For best performance however, \p size, \p mcOffset and \p memptr should be aligned to the value returned by ::cuMulticastGetGranularity with the flag ::CU_MULTICAST_GRANULARITY_RECOMMENDED. The \p size cannot be larger than the size of the allocated memory. Similarly the \p size + \p mcOffset cannot be larger than the total size of the multicast object. The memory allocation must have beeen created on one of the devices that was added to the multicast team via ::cuMulticastAddDevice. Externally shareable as well as imported multicast objects can be bound only to externally shareable memory. Note that this call will return CUDA_ERROR_OUT_OF_MEMORY if there are insufficient resources required to perform the bind. This call may also return CUDA_ERROR_SYSTEM_NOT_READY if the necessary system software is not initialized or running. This call may return CUDA_ERROR_ILLEGAL_STATE if the system configuration is in an illegal state. In such cases, to continue using multicast, verify that the system configuration is in a valid state and all required driver daemons are running properly. \param[in] mcHandle Handle representing a multicast object. \param[in] mcOffset Offset into multicast va range for attachment. \param[in] memptr Virtual address of the memory allocation. \param[in] size Size of memory that will be bound to the multicast object. \param[in] flags Flags for future use, must be zero now. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_DEVICE, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_PERMITTED, ::CUDA_ERROR_NOT_SUPPORTED, ::CUDA_ERROR_OUT_OF_MEMORY, ::CUDA_ERROR_SYSTEM_NOT_READY, ::CUDA_ERROR_ILLEGAL_STATE \sa ::cuMulticastCreate, ::cuMulticastAddDevice, ::cuMemCreate*/ fn cuMulticastBindAddr( mcHandle: cuda_types::cuda::CUmemGenericAllocationHandle, mcOffset: usize, memptr: cuda_types::cuda::CUdeviceptr, size: usize, flags: ::core::ffi::c_ulonglong, ) -> cuda_types::cuda::CUresult; /** \brief Unbind any memory allocations bound to a multicast object at a given offset and upto a given size. Unbinds any memory allocations hosted on \p dev and bound to a multicast object at \p mcOffset and upto a given \p size. The intended \p size of the unbind and the offset in the multicast range ( \p mcOffset ) must be a multiple of the value returned by ::cuMulticastGetGranularity flag ::CU_MULTICAST_GRANULARITY_MINIMUM. The \p size + \p mcOffset cannot be larger than the total size of the multicast object. \note Warning: The \p mcOffset and the \p size must match the corresponding values specified during the bind call. Any other values may result in undefined behavior. \param[in] mcHandle Handle representing a multicast object. \param[in] dev Device that hosts the memory allocation. \param[in] mcOffset Offset into the multicast object. \param[in] size Desired size to unbind. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_DEVICE, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_PERMITTED, ::CUDA_ERROR_NOT_SUPPORTED \sa ::cuMulticastBindMem, ::cuMulticastBindAddr*/ fn cuMulticastUnbind( mcHandle: cuda_types::cuda::CUmemGenericAllocationHandle, dev: cuda_types::cuda::CUdevice, mcOffset: usize, size: usize, ) -> cuda_types::cuda::CUresult; /** \brief Calculates either the minimal or recommended granularity for multicast object Calculates either the minimal or recommended granularity for a given set of multicast object properties and returns it in granularity. This granularity can be used as a multiple for size, bind offsets and address mappings of the multicast object. \param[out] granularity Returned granularity. \param[in] prop Properties of the multicast object. \param[in] option Determines which granularity to return. \returns ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_PERMITTED, ::CUDA_ERROR_NOT_SUPPORTED \sa ::cuMulticastCreate, ::cuMulticastBindMem, ::cuMulticastBindAddr, ::cuMulticastUnbind*/ fn cuMulticastGetGranularity( granularity: *mut usize, prop: *const cuda_types::cuda::CUmulticastObjectProp, option: cuda_types::cuda::CUmulticastGranularity_flags, ) -> cuda_types::cuda::CUresult; /** \brief Returns information about a pointer The supported attributes are: - ::CU_POINTER_ATTRIBUTE_CONTEXT: Returns in \p *data the ::CUcontext in which \p ptr was allocated or registered. The type of \p data must be ::CUcontext *. If \p ptr was not allocated by, mapped by, or registered with a ::CUcontext which uses unified virtual addressing then ::CUDA_ERROR_INVALID_VALUE is returned. - ::CU_POINTER_ATTRIBUTE_MEMORY_TYPE: Returns in \p *data the physical memory type of the memory that \p ptr addresses as a ::CUmemorytype enumerated value. The type of \p data must be unsigned int. If \p ptr addresses device memory then \p *data is set to ::CU_MEMORYTYPE_DEVICE. The particular ::CUdevice on which the memory resides is the ::CUdevice of the ::CUcontext returned by the ::CU_POINTER_ATTRIBUTE_CONTEXT attribute of \p ptr. If \p ptr addresses host memory then \p *data is set to ::CU_MEMORYTYPE_HOST. If \p ptr was not allocated by, mapped by, or registered with a ::CUcontext which uses unified virtual addressing then ::CUDA_ERROR_INVALID_VALUE is returned. If the current ::CUcontext does not support unified virtual addressing then ::CUDA_ERROR_INVALID_CONTEXT is returned. - ::CU_POINTER_ATTRIBUTE_DEVICE_POINTER: Returns in \p *data the device pointer value through which \p ptr may be accessed by kernels running in the current ::CUcontext. The type of \p data must be CUdeviceptr *. If there exists no device pointer value through which kernels running in the current ::CUcontext may access \p ptr then ::CUDA_ERROR_INVALID_VALUE is returned. If there is no current ::CUcontext then ::CUDA_ERROR_INVALID_CONTEXT is returned. Except in the exceptional disjoint addressing cases discussed below, the value returned in \p *data will equal the input value \p ptr. - ::CU_POINTER_ATTRIBUTE_HOST_POINTER: Returns in \p *data the host pointer value through which \p ptr may be accessed by by the host program. The type of \p data must be void **. If there exists no host pointer value through which the host program may directly access \p ptr then ::CUDA_ERROR_INVALID_VALUE is returned. Except in the exceptional disjoint addressing cases discussed below, the value returned in \p *data will equal the input value \p ptr. - ::CU_POINTER_ATTRIBUTE_P2P_TOKENS: Returns in \p *data two tokens for use with the nv-p2p.h Linux kernel interface. \p data must be a struct of type CUDA_POINTER_ATTRIBUTE_P2P_TOKENS. \p ptr must be a pointer to memory obtained from :cuMemAlloc(). Note that p2pToken and vaSpaceToken are only valid for the lifetime of the source allocation. A subsequent allocation at the same address may return completely different tokens. Querying this attribute has a side effect of setting the attribute ::CU_POINTER_ATTRIBUTE_SYNC_MEMOPS for the region of memory that \p ptr points to. - ::CU_POINTER_ATTRIBUTE_SYNC_MEMOPS: A boolean attribute which when set, ensures that synchronous memory operations initiated on the region of memory that \p ptr points to will always synchronize. See further documentation in the section titled "API synchronization behavior" to learn more about cases when synchronous memory operations can exhibit asynchronous behavior. - ::CU_POINTER_ATTRIBUTE_BUFFER_ID: Returns in \p *data a buffer ID which is guaranteed to be unique within the process. \p data must point to an unsigned long long. \p ptr must be a pointer to memory obtained from a CUDA memory allocation API. Every memory allocation from any of the CUDA memory allocation APIs will have a unique ID over a process lifetime. Subsequent allocations do not reuse IDs from previous freed allocations. IDs are only unique within a single process. - ::CU_POINTER_ATTRIBUTE_IS_MANAGED: Returns in \p *data a boolean that indicates whether the pointer points to managed memory or not. If \p ptr is not a valid CUDA pointer then ::CUDA_ERROR_INVALID_VALUE is returned. - ::CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL: Returns in \p *data an integer representing a device ordinal of a device against which the memory was allocated or registered. - ::CU_POINTER_ATTRIBUTE_IS_LEGACY_CUDA_IPC_CAPABLE: Returns in \p *data a boolean that indicates if this pointer maps to an allocation that is suitable for ::cudaIpcGetMemHandle. - ::CU_POINTER_ATTRIBUTE_RANGE_START_ADDR: Returns in \p *data the starting address for the allocation referenced by the device pointer \p ptr. Note that this is not necessarily the address of the mapped region, but the address of the mappable address range \p ptr references (e.g. from ::cuMemAddressReserve). - ::CU_POINTER_ATTRIBUTE_RANGE_SIZE: Returns in \p *data the size for the allocation referenced by the device pointer \p ptr. Note that this is not necessarily the size of the mapped region, but the size of the mappable address range \p ptr references (e.g. from ::cuMemAddressReserve). To retrieve the size of the mapped region, see ::cuMemGetAddressRange - ::CU_POINTER_ATTRIBUTE_MAPPED: Returns in \p *data a boolean that indicates if this pointer is in a valid address range that is mapped to a backing allocation. - ::CU_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES: Returns a bitmask of the allowed handle types for an allocation that may be passed to ::cuMemExportToShareableHandle. - ::CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE: Returns in \p *data the handle to the mempool that the allocation was obtained from. - ::CU_POINTER_ATTRIBUTE_IS_HW_DECOMPRESS_CAPABLE: Returns in \p *data a boolean that indicates whether the pointer points to memory that is capable to be used for hardware accelerated decompression. \par Note that for most allocations in the unified virtual address space the host and device pointer for accessing the allocation will be the same. The exceptions to this are - user memory registered using ::cuMemHostRegister - host memory allocated using ::cuMemHostAlloc with the ::CU_MEMHOSTALLOC_WRITECOMBINED flag For these types of allocation there will exist separate, disjoint host and device addresses for accessing the allocation. In particular - The host address will correspond to an invalid unmapped device address (which will result in an exception if accessed from the device) - The device address will correspond to an invalid unmapped host address (which will result in an exception if accessed from the host). For these types of allocations, querying ::CU_POINTER_ATTRIBUTE_HOST_POINTER and ::CU_POINTER_ATTRIBUTE_DEVICE_POINTER may be used to retrieve the host and device addresses from either address. \param data - Returned pointer attribute value \param attribute - Pointer attribute to query \param ptr - Pointer \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_DEVICE \notefnerr \sa ::cuPointerSetAttribute, ::cuMemAlloc, ::cuMemFree, ::cuMemAllocHost, ::cuMemFreeHost, ::cuMemHostAlloc, ::cuMemHostRegister, ::cuMemHostUnregister, ::cudaPointerGetAttributes*/ fn cuPointerGetAttribute( data: *mut ::core::ffi::c_void, attribute: cuda_types::cuda::CUpointer_attribute, ptr: cuda_types::cuda::CUdeviceptr, ) -> cuda_types::cuda::CUresult; /** \brief Prefetches memory to the specified destination location Prefetches memory to the specified destination location. \p devPtr is the base device pointer of the memory to be prefetched and \p location specifies the destination location. \p count specifies the number of bytes to copy. \p hStream is the stream in which the operation is enqueued. The memory range must refer to managed memory allocated via ::cuMemAllocManaged or declared via __managed__ variables. Specifying ::CU_MEM_LOCATION_TYPE_DEVICE for ::CUmemLocation::type will prefetch memory to GPU specified by device ordinal ::CUmemLocation::id which must have non-zero value for the device attribute ::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS. Additionally, \p hStream must be associated with a device that has a non-zero value for the device attribute ::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS. Specifying ::CU_MEM_LOCATION_TYPE_HOST as ::CUmemLocation::type will prefetch data to host memory. Applications can request prefetching memory to a specific host NUMA node by specifying ::CU_MEM_LOCATION_TYPE_HOST_NUMA for ::CUmemLocation::type and a valid host NUMA node id in ::CUmemLocation::id Users can also request prefetching memory to the host NUMA node closest to the current thread's CPU by specifying ::CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT for ::CUmemLocation::type. Note when ::CUmemLocation::type is etiher ::CU_MEM_LOCATION_TYPE_HOST OR ::CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT, ::CUmemLocation::id will be ignored. The start address and end address of the memory range will be rounded down and rounded up respectively to be aligned to CPU page size before the prefetch operation is enqueued in the stream. If no physical memory has been allocated for this region, then this memory region will be populated and mapped on the destination device. If there's insufficient memory to prefetch the desired region, the Unified Memory driver may evict pages from other ::cuMemAllocManaged allocations to host memory in order to make room. Device memory allocated using ::cuMemAlloc or ::cuArrayCreate will not be evicted. By default, any mappings to the previous location of the migrated pages are removed and mappings for the new location are only setup on the destination location. The exact behavior however also depends on the settings applied to this memory range via ::cuMemAdvise as described below: If ::CU_MEM_ADVISE_SET_READ_MOSTLY was set on any subset of this memory range, then that subset will create a read-only copy of the pages on destination location. If however the destination location is a host NUMA node, then any pages of that subset that are already in another host NUMA node will be transferred to the destination. If ::CU_MEM_ADVISE_SET_PREFERRED_LOCATION was called on any subset of this memory range, then the pages will be migrated to \p location even if \p location is not the preferred location of any pages in the memory range. If ::CU_MEM_ADVISE_SET_ACCESSED_BY was called on any subset of this memory range, then mappings to those pages from all the appropriate processors are updated to refer to the new location if establishing such a mapping is possible. Otherwise, those mappings are cleared. Note that this API is not required for functionality and only serves to improve performance by allowing the application to migrate data to a suitable location before it is accessed. Memory accesses to this range are always coherent and are allowed even when the data is actively being migrated. Note that this function is asynchronous with respect to the host and all work on other devices. \param devPtr - Pointer to be prefetched \param count - Size in bytes \param location - Location to prefetch to \param flags - flags for future use, must be zero now. \param hStream - Stream to enqueue prefetch operation \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_DEVICE \notefnerr \note_async \note_null_stream \sa ::cuMemcpy, ::cuMemcpyPeer, ::cuMemcpyAsync, ::cuMemcpy3DPeerAsync, ::cuMemAdvise, ::cudaMemPrefetchAsync*/ fn cuMemPrefetchAsync_v2_ptsz( devPtr: cuda_types::cuda::CUdeviceptr, count: usize, location: cuda_types::cuda::CUmemLocation, flags: ::core::ffi::c_uint, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Advise about the usage of a given memory range Advise the Unified Memory subsystem about the usage pattern for the memory range starting at \p devPtr with a size of \p count bytes. The start address and end address of the memory range will be rounded down and rounded up respectively to be aligned to CPU page size before the advice is applied. The memory range must refer to managed memory allocated via ::cuMemAllocManaged or declared via __managed__ variables. The memory range could also refer to system-allocated pageable memory provided it represents a valid, host-accessible region of memory and all additional constraints imposed by \p advice as outlined below are also satisfied. Specifying an invalid system-allocated pageable memory range results in an error being returned. The \p advice parameter can take the following values: - ::CU_MEM_ADVISE_SET_READ_MOSTLY: This implies that the data is mostly going to be read from and only occasionally written to. Any read accesses from any processor to this region will create a read-only copy of at least the accessed pages in that processor's memory. Additionally, if ::cuMemPrefetchAsync is called on this region, it will create a read-only copy of the data on the destination processor. If the target location for ::cuMemPrefetchAsync is a host NUMA node and a read-only copy already exists on another host NUMA node, that copy will be migrated to the targeted host NUMA node. If any processor writes to this region, all copies of the corresponding page will be invalidated except for the one where the write occurred. If the writing processor is the CPU and the preferred location of the page is a host NUMA node, then the page will also be migrated to that host NUMA node. The \p location argument is ignored for this advice. Note that for a page to be read-duplicated, the accessing processor must either be the CPU or a GPU that has a non-zero value for the device attribute ::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS. Also, if a context is created on a device that does not have the device attribute ::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS set, then read-duplication will not occur until all such contexts are destroyed. If the memory region refers to valid system-allocated pageable memory, then the accessing device must have a non-zero value for the device attribute ::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS for a read-only copy to be created on that device. Note however that if the accessing device also has a non-zero value for the device attribute ::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES, then setting this advice will not create a read-only copy when that device accesses this memory region. - ::CU_MEM_ADVISE_UNSET_READ_MOSTLY: Undoes the effect of ::CU_MEM_ADVISE_SET_READ_MOSTLY and also prevents the Unified Memory driver from attempting heuristic read-duplication on the memory range. Any read-duplicated copies of the data will be collapsed into a single copy. The location for the collapsed copy will be the preferred location if the page has a preferred location and one of the read-duplicated copies was resident at that location. Otherwise, the location chosen is arbitrary. Note: The \p location argument is ignored for this advice. - ::CU_MEM_ADVISE_SET_PREFERRED_LOCATION: This advice sets the preferred location for the data to be the memory belonging to \p location. When ::CUmemLocation::type is ::CU_MEM_LOCATION_TYPE_HOST, ::CUmemLocation::id is ignored and the preferred location is set to be host memory. To set the preferred location to a specific host NUMA node, applications must set ::CUmemLocation::type to ::CU_MEM_LOCATION_TYPE_HOST_NUMA and ::CUmemLocation::id must specify the NUMA ID of the host NUMA node. If ::CUmemLocation::type is set to ::CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT, ::CUmemLocation::id will be ignored and the the host NUMA node closest to the calling thread's CPU will be used as the preferred location. If ::CUmemLocation::type is a ::CU_MEM_LOCATION_TYPE_DEVICE, then ::CUmemLocation::id must be a valid device ordinal and the device must have a non-zero value for the device attribute ::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS. Setting the preferred location does not cause data to migrate to that location immediately. Instead, it guides the migration policy when a fault occurs on that memory region. If the data is already in its preferred location and the faulting processor can establish a mapping without requiring the data to be migrated, then data migration will be avoided. On the other hand, if the data is not in its preferred location or if a direct mapping cannot be established, then it will be migrated to the processor accessing it. It is important to note that setting the preferred location does not prevent data prefetching done using ::cuMemPrefetchAsync. Having a preferred location can override the page thrash detection and resolution logic in the Unified Memory driver. Normally, if a page is detected to be constantly thrashing between for example host and device memory, the page may eventually be pinned to host memory by the Unified Memory driver. But if the preferred location is set as device memory, then the page will continue to thrash indefinitely. If ::CU_MEM_ADVISE_SET_READ_MOSTLY is also set on this memory region or any subset of it, then the policies associated with that advice will override the policies of this advice, unless read accesses from \p location will not result in a read-only copy being created on that procesor as outlined in description for the advice ::CU_MEM_ADVISE_SET_READ_MOSTLY. If the memory region refers to valid system-allocated pageable memory, and ::CUmemLocation::type is CU_MEM_LOCATION_TYPE_DEVICE then ::CUmemLocation::id must be a valid device that has a non-zero alue for the device attribute ::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS. - ::CU_MEM_ADVISE_UNSET_PREFERRED_LOCATION: Undoes the effect of ::CU_MEM_ADVISE_SET_PREFERRED_LOCATION and changes the preferred location to none. The \p location argument is ignored for this advice. - ::CU_MEM_ADVISE_SET_ACCESSED_BY: This advice implies that the data will be accessed by processor \p location. The ::CUmemLocation::type must be either ::CU_MEM_LOCATION_TYPE_DEVICE with ::CUmemLocation::id representing a valid device ordinal or ::CU_MEM_LOCATION_TYPE_HOST and ::CUmemLocation::id will be ignored. All other location types are invalid. If ::CUmemLocation::id is a GPU, then the device attribute ::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS must be non-zero. This advice does not cause data migration and has no impact on the location of the data per se. Instead, it causes the data to always be mapped in the specified processor's page tables, as long as the location of the data permits a mapping to be established. If the data gets migrated for any reason, the mappings are updated accordingly. This advice is recommended in scenarios where data locality is not important, but avoiding faults is. Consider for example a system containing multiple GPUs with peer-to-peer access enabled, where the data located on one GPU is occasionally accessed by peer GPUs. In such scenarios, migrating data over to the other GPUs is not as important because the accesses are infrequent and the overhead of migration may be too high. But preventing faults can still help improve performance, and so having a mapping set up in advance is useful. Note that on CPU access of this data, the data may be migrated to host memory because the CPU typically cannot access device memory directly. Any GPU that had the ::CU_MEM_ADVISE_SET_ACCESSED_BY flag set for this data will now have its mapping updated to point to the page in host memory. If ::CU_MEM_ADVISE_SET_READ_MOSTLY is also set on this memory region or any subset of it, then the policies associated with that advice will override the policies of this advice. Additionally, if the preferred location of this memory region or any subset of it is also \p location, then the policies associated with ::CU_MEM_ADVISE_SET_PREFERRED_LOCATION will override the policies of this advice. If the memory region refers to valid system-allocated pageable memory, and ::CUmemLocation::type is ::CU_MEM_LOCATION_TYPE_DEVICE then device in ::CUmemLocation::id must have a non-zero value for the device attribute ::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS. Additionally, if ::CUmemLocation::id has a non-zero value for the device attribute ::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES, then this call has no effect. - ::CU_MEM_ADVISE_UNSET_ACCESSED_BY: Undoes the effect of ::CU_MEM_ADVISE_SET_ACCESSED_BY. Any mappings to the data from \p location may be removed at any time causing accesses to result in non-fatal page faults. If the memory region refers to valid system-allocated pageable memory, and ::CUmemLocation::type is ::CU_MEM_LOCATION_TYPE_DEVICE then device in ::CUmemLocation::id must have a non-zero value for the device attribute ::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS. Additionally, if ::CUmemLocation::id has a non-zero value for the device attribute ::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES, then this call has no effect. \param devPtr - Pointer to memory to set the advice for \param count - Size in bytes of the memory range \param advice - Advice to be applied for the specified memory range \param location - location to apply the advice for \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_DEVICE \notefnerr \note_async \note_null_stream \sa ::cuMemcpy, ::cuMemcpyPeer, ::cuMemcpyAsync, ::cuMemcpy3DPeerAsync, ::cuMemPrefetchAsync, ::cudaMemAdvise*/ fn cuMemAdvise_v2( devPtr: cuda_types::cuda::CUdeviceptr, count: usize, advice: cuda_types::cuda::CUmem_advise, location: cuda_types::cuda::CUmemLocation, ) -> cuda_types::cuda::CUresult; /** \brief Performs a batch of memory prefetches asynchronously Performs a batch of memory prefetches. The batch as a whole executes in stream order but operations within a batch are not guaranteed to execute in any specific order. All devices in the system must have a non-zero value for the device attribute ::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS otherwise the API will return an error. The semantics of the individual prefetch operations are as described in ::cuMemPrefetchAsync. Performs memory prefetch on address ranges specified in \p dptrs and \p sizes. Both arrays must be of the same length as specified by \p count. Each memory range specified must refer to managed memory allocated via ::cuMemAllocManaged or declared via __managed__ variables or it may also refer to system-allocated memory when all devices have a non-zero value for ::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS. The prefetch location for every operation in the batch is specified in the \p prefetchLocs array. Each entry in this array can apply to more than one operation. This can be done by specifying in the \p prefetchLocIdxs array, the index of the first prefetch operation that the corresponding entry in the \p prefetchLocs array applies to. Both \p prefetchLocs and \p prefetchLocIdxs must be of the same length as specified by \p numPrefetchLocs. For example, if a batch has 10 prefetches listed in dptrs/sizes, the first 4 of which are to be prefetched to one location and the remaining 6 are to be prefetched to another, then \p numPrefetchLocs will be 2, \p prefetchLocIdxs will be {0, 4} and \p prefetchLocs will contain the two locations. Note the first entry in \p prefetchLocIdxs must always be 0. Also, each entry must be greater than the previous entry and the last entry should be less than \p count. Furthermore, \p numPrefetchLocs must be lesser than or equal to \p count. \param dptrs - Array of pointers to be prefetched \param sizes - Array of sizes for memory prefetch operations. \param count - Size of \p dptrs and \p sizes arrays. \param prefetchLocs - Array of locations to prefetch to. \param prefetchLocIdxs - Array of indices to specify which operands each entry in the \p prefetchLocs array applies to. The locations specified in prefetchLocs[k] will be applied to copies starting from prefetchLocIdxs[k] through prefetchLocIdxs[k+1] - 1. Also prefetchLocs[numPrefetchLocs - 1] will apply to prefetches starting from prefetchLocIdxs[numPrefetchLocs - 1] through count - 1. \param numPrefetchLocs - Size of \p prefetchLocs and \p prefetchLocIdxs arrays. \param flags - Flags reserved for future use. Must be zero. \param hStream - The stream to enqueue the operations in. Must not be legacy NULL stream. */ fn cuMemPrefetchBatchAsync_ptsz( dptrs: *mut cuda_types::cuda::CUdeviceptr, sizes: *mut usize, count: usize, prefetchLocs: *mut cuda_types::cuda::CUmemLocation, prefetchLocIdxs: *mut usize, numPrefetchLocs: usize, flags: ::core::ffi::c_ulonglong, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Performs a batch of memory discards asynchronously Performs a batch of memory discards. The batch as a whole executes in stream order but operations within a batch are not guaranteed to execute in any specific order. All devices in the system must have a non-zero value for the device attribute ::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS otherwise the API will return an error. Discarding a memory range informs the driver that the contents of that range are no longer useful. Discarding memory ranges allows the driver to optimize certain data migrations and can also help reduce memory pressure. This operation can be undone on any part of the range by either writing to it or prefetching it via ::cuMemPrefetchAsync or ::cuMemPrefetchBatchAsync. Reading from a discarded range, without a subsequent write or prefetch to that part of the range, will return an indeterminate value. Note that any reads, writes or prefetches to any part of the memory range that occur simultaneously with the discard operation result in undefined behavior. Performs memory discard on address ranges specified in \p dptrs and \p sizes. Both arrays must be of the same length as specified by \p count. Each memory range specified must refer to managed memory allocated via ::cuMemAllocManaged or declared via __managed__ variables or it may also refer to system-allocated memory when all devices have a non-zero value for ::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS. \param dptrs - Array of pointers to be discarded \param sizes - Array of sizes for memory discard operations. \param count - Size of \p dptrs and \p sizes arrays. \param flags - Flags reserved for future use. Must be zero. \param hStream - The stream to enqueue the operations in. Must not be legacy NULL stream. */ fn cuMemDiscardBatchAsync_ptsz( dptrs: *mut cuda_types::cuda::CUdeviceptr, sizes: *mut usize, count: usize, flags: ::core::ffi::c_ulonglong, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Performs a batch of memory discards and prefetches asynchronously Performs a batch of memory discards followed by prefetches. The batch as a whole executes in stream order but operations within a batch are not guaranteed to execute in any specific order. All devices in the system must have a non-zero value for the device attribute ::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS otherwise the API will return an error. Calling ::cuMemDiscardAndPrefetchBatchAsync is semantically equivalent to calling ::cuMemDiscardBatchAsync followed by ::cuMemPrefetchBatchAsync, but is more optimal. For more details on what discarding and prefetching imply, please refer to ::cuMemDiscardBatchAsync and ::cuMemPrefetchBatchAsync respectively. Note that any reads, writes or prefetches to any part of the memory range that occur simultaneously with this combined discard+prefetch operation result in undefined behavior. Performs memory discard and prefetch on address ranges specified in \p dptrs and \p sizes. Both arrays must be of the same length as specified by \p count. Each memory range specified must refer to managed memory allocated via ::cuMemAllocManaged or declared via __managed__ variables or it may also refer to system-allocated memory when all devices have a non-zero value for ::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS. Every operation in the batch has to be associated with a valid location to prefetch the address range to and specified in the \p prefetchLocs array. Each entry in this array can apply to more than one operation. This can be done by specifying in the \p prefetchLocIdxs array, the index of the first operation that the corresponding entry in the \p prefetchLocs array applies to. Both \p prefetchLocs and \p prefetchLocIdxs must be of the same length as specified by \p numPrefetchLocs. For example, if a batch has 10 operations listed in dptrs/sizes, the first 6 of which are to be prefetched to one location and the remaining 4 are to be prefetched to another, then \p numPrefetchLocs will be 2, \p prefetchLocIdxs will be {0, 6} and \p prefetchLocs will contain the two set of locations. Note the first entry in \p prefetchLocIdxs must always be 0. Also, each entry must be greater than the previous entry and the last entry should be less than \p count. Furthermore, \p numPrefetchLocs must be lesser than or equal to \p count. \param dptrs - Array of pointers to be discarded \param sizes - Array of sizes for memory discard operations. \param count - Size of \p dptrs and \p sizes arrays. \param prefetchLocs - Array of locations to prefetch to. \param prefetchLocIdxs - Array of indices to specify which operands each entry in the \p prefetchLocs array applies to. The locations specified in prefetchLocs[k] will be applied to operations starting from prefetchLocIdxs[k] through prefetchLocIdxs[k+1] - 1. Also prefetchLocs[numPrefetchLocs - 1] will apply to copies starting from prefetchLocIdxs[numPrefetchLocs - 1] through count - 1. \param numPrefetchLocs - Size of \p prefetchLocs and \p prefetchLocIdxs arrays. \param flags - Flags reserved for future use. Must be zero. \param hStream - The stream to enqueue the operations in. Must not be legacy NULL stream. */ fn cuMemDiscardAndPrefetchBatchAsync_ptsz( dptrs: *mut cuda_types::cuda::CUdeviceptr, sizes: *mut usize, count: usize, prefetchLocs: *mut cuda_types::cuda::CUmemLocation, prefetchLocIdxs: *mut usize, numPrefetchLocs: usize, flags: ::core::ffi::c_ulonglong, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Query an attribute of a given memory range Query an attribute about the memory range starting at \p devPtr with a size of \p count bytes. The memory range must refer to managed memory allocated via ::cuMemAllocManaged or declared via __managed__ variables. The \p attribute parameter can take the following values: - ::CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY: If this attribute is specified, \p data will be interpreted as a 32-bit integer, and \p dataSize must be 4. The result returned will be 1 if all pages in the given memory range have read-duplication enabled, or 0 otherwise. - ::CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION: If this attribute is specified, \p data will be interpreted as a 32-bit integer, and \p dataSize must be 4. The result returned will be a GPU device id if all pages in the memory range have that GPU as their preferred location, or it will be CU_DEVICE_CPU if all pages in the memory range have the CPU as their preferred location, or it will be CU_DEVICE_INVALID if either all the pages don't have the same preferred location or some of the pages don't have a preferred location at all. Note that the actual location of the pages in the memory range at the time of the query may be different from the preferred location. - ::CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY: If this attribute is specified, \p data will be interpreted as an array of 32-bit integers, and \p dataSize must be a non-zero multiple of 4. The result returned will be a list of device ids that had ::CU_MEM_ADVISE_SET_ACCESSED_BY set for that entire memory range. If any device does not have that advice set for the entire memory range, that device will not be included. If \p data is larger than the number of devices that have that advice set for that memory range, CU_DEVICE_INVALID will be returned in all the extra space provided. For ex., if \p dataSize is 12 (i.e. \p data has 3 elements) and only device 0 has the advice set, then the result returned will be { 0, CU_DEVICE_INVALID, CU_DEVICE_INVALID }. If \p data is smaller than the number of devices that have that advice set, then only as many devices will be returned as can fit in the array. There is no guarantee on which specific devices will be returned, however. - ::CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION: If this attribute is specified, \p data will be interpreted as a 32-bit integer, and \p dataSize must be 4. The result returned will be the last location to which all pages in the memory range were prefetched explicitly via ::cuMemPrefetchAsync. This will either be a GPU id or CU_DEVICE_CPU depending on whether the last location for prefetch was a GPU or the CPU respectively. If any page in the memory range was never explicitly prefetched or if all pages were not prefetched to the same location, CU_DEVICE_INVALID will be returned. Note that this simply returns the last location that the application requested to prefetch the memory range to. It gives no indication as to whether the prefetch operation to that location has completed or even begun. - ::CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_TYPE: If this attribute is specified, \p data will be interpreted as a ::CUmemLocationType, and \p dataSize must be sizeof(CUmemLocationType). The ::CUmemLocationType returned will be ::CU_MEM_LOCATION_TYPE_DEVICE if all pages in the memory range have the same GPU as their preferred location, or ::CUmemLocationType will be ::CU_MEM_LOCATION_TYPE_HOST if all pages in the memory range have the CPU as their preferred location, or it will be ::CU_MEM_LOCATION_TYPE_HOST_NUMA if all the pages in the memory range have the same host NUMA node ID as their preferred location or it will be ::CU_MEM_LOCATION_TYPE_INVALID if either all the pages don't have the same preferred location or some of the pages don't have a preferred location at all. Note that the actual location type of the pages in the memory range at the time of the query may be different from the preferred location type. - ::CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_ID: If this attribute is specified, \p data will be interpreted as a 32-bit integer, and \p dataSize must be 4. If the ::CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_TYPE query for the same address range returns ::CU_MEM_LOCATION_TYPE_DEVICE, it will be a valid device ordinal or if it returns ::CU_MEM_LOCATION_TYPE_HOST_NUMA, it will be a valid host NUMA node ID or if it returns any other location type, the id should be ignored. - ::CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_TYPE: If this attribute is specified, \p data will be interpreted as a ::CUmemLocationType, and \p dataSize must be sizeof(CUmemLocationType). The result returned will be the last location to which all pages in the memory range were prefetched explicitly via ::cuMemPrefetchAsync. The ::CUmemLocationType returned will be ::CU_MEM_LOCATION_TYPE_DEVICE if the last prefetch location was a GPU or ::CU_MEM_LOCATION_TYPE_HOST if it was the CPU or ::CU_MEM_LOCATION_TYPE_HOST_NUMA if the last prefetch location was a specific host NUMA node. If any page in the memory range was never explicitly prefetched or if all pages were not prefetched to the same location, ::CUmemLocationType will be ::CU_MEM_LOCATION_TYPE_INVALID. Note that this simply returns the last location type that the application requested to prefetch the memory range to. It gives no indication as to whether the prefetch operation to that location has completed or even begun. - ::CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_ID: If this attribute is specified, \p data will be interpreted as a 32-bit integer, and \p dataSize must be 4. If the ::CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_TYPE query for the same address range returns ::CU_MEM_LOCATION_TYPE_DEVICE, it will be a valid device ordinal or if it returns ::CU_MEM_LOCATION_TYPE_HOST_NUMA, it will be a valid host NUMA node ID or if it returns any other location type, the id should be ignored. \param data - A pointers to a memory location where the result of each attribute query will be written to. \param dataSize - Array containing the size of data \param attribute - The attribute to query \param devPtr - Start of the range to query \param count - Size of the range to query \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_DEVICE \notefnerr \note_async \note_null_stream \sa ::cuMemRangeGetAttributes, ::cuMemPrefetchAsync, ::cuMemAdvise, ::cudaMemRangeGetAttribute*/ fn cuMemRangeGetAttribute( data: *mut ::core::ffi::c_void, dataSize: usize, attribute: cuda_types::cuda::CUmem_range_attribute, devPtr: cuda_types::cuda::CUdeviceptr, count: usize, ) -> cuda_types::cuda::CUresult; /** \brief Query attributes of a given memory range. Query attributes of the memory range starting at \p devPtr with a size of \p count bytes. The memory range must refer to managed memory allocated via ::cuMemAllocManaged or declared via __managed__ variables. The \p attributes array will be interpreted to have \p numAttributes entries. The \p dataSizes array will also be interpreted to have \p numAttributes entries. The results of the query will be stored in \p data. The list of supported attributes are given below. Please refer to ::cuMemRangeGetAttribute for attribute descriptions and restrictions. - ::CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY - ::CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION - ::CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY - ::CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION - ::CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_TYPE - ::CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_ID - ::CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_TYPE - ::CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_ID \param data - A two-dimensional array containing pointers to memory locations where the result of each attribute query will be written to. \param dataSizes - Array containing the sizes of each result \param attributes - An array of attributes to query (numAttributes and the number of attributes in this array should match) \param numAttributes - Number of attributes to query \param devPtr - Start of the range to query \param count - Size of the range to query \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_DEVICE \notefnerr \sa ::cuMemRangeGetAttribute, ::cuMemAdvise, ::cuMemPrefetchAsync, ::cudaMemRangeGetAttributes*/ fn cuMemRangeGetAttributes( data: *mut *mut ::core::ffi::c_void, dataSizes: *mut usize, attributes: *mut cuda_types::cuda::CUmem_range_attribute, numAttributes: usize, devPtr: cuda_types::cuda::CUdeviceptr, count: usize, ) -> cuda_types::cuda::CUresult; /** \brief Set attributes on a previously allocated memory region The supported attributes are: - ::CU_POINTER_ATTRIBUTE_SYNC_MEMOPS: A boolean attribute that can either be set (1) or unset (0). When set, the region of memory that \p ptr points to is guaranteed to always synchronize memory operations that are synchronous. If there are some previously initiated synchronous memory operations that are pending when this attribute is set, the function does not return until those memory operations are complete. See further documentation in the section titled "API synchronization behavior" to learn more about cases when synchronous memory operations can exhibit asynchronous behavior. \p value will be considered as a pointer to an unsigned integer to which this attribute is to be set. \param value - Pointer to memory containing the value to be set \param attribute - Pointer attribute to set \param ptr - Pointer to a memory region allocated using CUDA memory allocation APIs \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_DEVICE \notefnerr \sa ::cuPointerGetAttribute, ::cuPointerGetAttributes, ::cuMemAlloc, ::cuMemFree, ::cuMemAllocHost, ::cuMemFreeHost, ::cuMemHostAlloc, ::cuMemHostRegister, ::cuMemHostUnregister*/ fn cuPointerSetAttribute( value: *const ::core::ffi::c_void, attribute: cuda_types::cuda::CUpointer_attribute, ptr: cuda_types::cuda::CUdeviceptr, ) -> cuda_types::cuda::CUresult; /** \brief Returns information about a pointer. The supported attributes are (refer to ::cuPointerGetAttribute for attribute descriptions and restrictions): - ::CU_POINTER_ATTRIBUTE_CONTEXT - ::CU_POINTER_ATTRIBUTE_MEMORY_TYPE - ::CU_POINTER_ATTRIBUTE_DEVICE_POINTER - ::CU_POINTER_ATTRIBUTE_HOST_POINTER - ::CU_POINTER_ATTRIBUTE_SYNC_MEMOPS - ::CU_POINTER_ATTRIBUTE_BUFFER_ID - ::CU_POINTER_ATTRIBUTE_IS_MANAGED - ::CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL - ::CU_POINTER_ATTRIBUTE_RANGE_START_ADDR - ::CU_POINTER_ATTRIBUTE_RANGE_SIZE - ::CU_POINTER_ATTRIBUTE_MAPPED - ::CU_POINTER_ATTRIBUTE_IS_LEGACY_CUDA_IPC_CAPABLE - ::CU_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES - ::CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE - ::CU_POINTER_ATTRIBUTE_IS_HW_DECOMPRESS_CAPABLE \param numAttributes - Number of attributes to query \param attributes - An array of attributes to query (numAttributes and the number of attributes in this array should match) \param data - A two-dimensional array containing pointers to memory locations where the result of each attribute query will be written to. \param ptr - Pointer to query Unlike ::cuPointerGetAttribute, this function will not return an error when the \p ptr encountered is not a valid CUDA pointer. Instead, the attributes are assigned default NULL values and CUDA_SUCCESS is returned. If \p ptr was not allocated by, mapped by, or registered with a ::CUcontext which uses UVA (Unified Virtual Addressing), ::CUDA_ERROR_INVALID_CONTEXT is returned. \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_DEVICE \notefnerr \sa ::cuPointerGetAttribute, ::cuPointerSetAttribute, ::cudaPointerGetAttributes*/ fn cuPointerGetAttributes( numAttributes: ::core::ffi::c_uint, attributes: *mut cuda_types::cuda::CUpointer_attribute, data: *mut *mut ::core::ffi::c_void, ptr: cuda_types::cuda::CUdeviceptr, ) -> cuda_types::cuda::CUresult; /** \brief Create a stream Creates a stream and returns a handle in \p phStream. The \p Flags argument determines behaviors of the stream. Valid values for \p Flags are: - ::CU_STREAM_DEFAULT: Default stream creation flag. - ::CU_STREAM_NON_BLOCKING: Specifies that work running in the created stream may run concurrently with work in stream 0 (the NULL stream), and that the created stream should perform no implicit synchronization with stream 0. \param phStream - Returned newly created stream \param Flags - Parameters for stream creation \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_OUT_OF_MEMORY \notefnerr \sa ::cuStreamDestroy, ::cuStreamCreateWithPriority, ::cuGreenCtxStreamCreate, ::cuStreamGetPriority, ::cuStreamGetFlags, ::cuStreamGetDevice ::cuStreamWaitEvent, ::cuStreamQuery, ::cuStreamSynchronize, ::cuStreamAddCallback, ::cudaStreamCreate, ::cudaStreamCreateWithFlags*/ fn cuStreamCreate( phStream: *mut cuda_types::cuda::CUstream, Flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Create a stream with the given priority Creates a stream with the specified priority and returns a handle in \p phStream. This affects the scheduling priority of work in the stream. Priorities provide a hint to preferentially run work with higher priority when possible, but do not preempt already-running work or provide any other functional guarantee on execution order. \p priority follows a convention where lower numbers represent higher priorities. '0' represents default priority. The range of meaningful numerical priorities can be queried using ::cuCtxGetStreamPriorityRange. If the specified priority is outside the numerical range returned by ::cuCtxGetStreamPriorityRange, it will automatically be clamped to the lowest or the highest number in the range. \param phStream - Returned newly created stream \param flags - Flags for stream creation. See ::cuStreamCreate for a list of valid flags \param priority - Stream priority. Lower numbers represent higher priorities. See ::cuCtxGetStreamPriorityRange for more information about meaningful stream priorities that can be passed. \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_OUT_OF_MEMORY \notefnerr \note Stream priorities are supported only on GPUs with compute capability 3.5 or higher. \note In the current implementation, only compute kernels launched in priority streams are affected by the stream's priority. Stream priorities have no effect on host-to-device and device-to-host memory operations. \sa ::cuStreamDestroy, ::cuStreamCreate, ::cuGreenCtxStreamCreate, ::cuStreamGetPriority, ::cuCtxGetStreamPriorityRange, ::cuStreamGetFlags, ::cuStreamGetDevice, ::cuStreamWaitEvent, ::cuStreamQuery, ::cuStreamSynchronize, ::cuStreamAddCallback, ::cudaStreamCreateWithPriority*/ fn cuStreamCreateWithPriority( phStream: *mut cuda_types::cuda::CUstream, flags: ::core::ffi::c_uint, priority: ::core::ffi::c_int, ) -> cuda_types::cuda::CUresult; /** \brief Query the priority of a given stream Query the priority of a stream created using ::cuStreamCreate, ::cuStreamCreateWithPriority or ::cuGreenCtxStreamCreate and return the priority in \p priority. Note that if the stream was created with a priority outside the numerical range returned by ::cuCtxGetStreamPriorityRange, this function returns the clamped priority. See ::cuStreamCreateWithPriority for details about priority clamping. \param hStream - Handle to the stream to be queried \param priority - Pointer to a signed integer in which the stream's priority is returned \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_OUT_OF_MEMORY \notefnerr \sa ::cuStreamDestroy, ::cuStreamCreate, ::cuStreamCreateWithPriority, ::cuGreenCtxStreamCreate, ::cuCtxGetStreamPriorityRange, ::cuStreamGetFlags, ::cuStreamGetDevice, ::cudaStreamGetPriority*/ fn cuStreamGetPriority_ptsz( hStream: cuda_types::cuda::CUstream, priority: *mut ::core::ffi::c_int, ) -> cuda_types::cuda::CUresult; /** \brief Returns the device handle of the stream Returns in \p *device the device handle of the stream \param hStream - Handle to the stream to be queried \param device - Returns the device to which a stream belongs \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_OUT_OF_MEMORY \notefnerr \sa ::cuStreamDestroy, ::cuStreamCreate, ::cuGreenCtxStreamCreate, ::cuStreamGetFlags*/ fn cuStreamGetDevice_ptsz( hStream: cuda_types::cuda::CUstream, device: *mut cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; /** \brief Query the flags of a given stream Query the flags of a stream created using ::cuStreamCreate, ::cuStreamCreateWithPriority or ::cuGreenCtxStreamCreate and return the flags in \p flags. \param hStream - Handle to the stream to be queried \param flags - Pointer to an unsigned integer in which the stream's flags are returned The value returned in \p flags is a logical 'OR' of all flags that were used while creating this stream. See ::cuStreamCreate for the list of valid flags \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_OUT_OF_MEMORY \notefnerr \sa ::cuStreamDestroy, ::cuStreamCreate, ::cuGreenCtxStreamCreate, ::cuStreamGetPriority, ::cudaStreamGetFlags, ::cuStreamGetDevice*/ fn cuStreamGetFlags_ptsz( hStream: cuda_types::cuda::CUstream, flags: *mut ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Returns the unique Id associated with the stream handle supplied Returns in \p streamId the unique Id which is associated with the given stream handle. The Id is unique for the life of the program. The stream handle \p hStream can refer to any of the following:
  • a stream created via any of the CUDA driver APIs such as ::cuStreamCreate and ::cuStreamCreateWithPriority, or their runtime API equivalents such as ::cudaStreamCreate, ::cudaStreamCreateWithFlags and ::cudaStreamCreateWithPriority. Passing an invalid handle will result in undefined behavior.
  • any of the special streams such as the NULL stream, ::CU_STREAM_LEGACY and ::CU_STREAM_PER_THREAD. The runtime API equivalents of these are also accepted, which are NULL, ::cudaStreamLegacy and ::cudaStreamPerThread respectively.
\param hStream - Handle to the stream to be queried \param streamId - Pointer to store the Id of the stream \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE \notefnerr \sa ::cuStreamDestroy, ::cuStreamCreate, ::cuStreamGetPriority, ::cudaStreamGetId*/ fn cuStreamGetId_ptsz( hStream: cuda_types::cuda::CUstream, streamId: *mut ::core::ffi::c_ulonglong, ) -> cuda_types::cuda::CUresult; /** \brief Query the context associated with a stream Returns the CUDA context that the stream is associated with. If the stream was created via the API ::cuGreenCtxStreamCreate, the returned context is equivalent to the one returned by ::cuCtxFromGreenCtx() on the green context associated with the stream at creation time. The stream handle \p hStream can refer to any of the following:
  • a stream created via any of the CUDA driver APIs such as ::cuStreamCreate and ::cuStreamCreateWithPriority, or their runtime API equivalents such as ::cudaStreamCreate, ::cudaStreamCreateWithFlags and ::cudaStreamCreateWithPriority. The returned context is the context that was active in the calling thread when the stream was created. Passing an invalid handle will result in undefined behavior.
  • any of the special streams such as the NULL stream, ::CU_STREAM_LEGACY and ::CU_STREAM_PER_THREAD. The runtime API equivalents of these are also accepted, which are NULL, ::cudaStreamLegacy and ::cudaStreamPerThread respectively. Specifying any of the special handles will return the context current to the calling thread. If no context is current to the calling thread, ::CUDA_ERROR_INVALID_CONTEXT is returned.
\param hStream - Handle to the stream to be queried \param pctx - Returned context associated with the stream \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_NOT_SUPPORTED \notefnerr \sa ::cuStreamDestroy, ::cuStreamCreateWithPriority, ::cuStreamGetPriority, ::cuStreamGetFlags, ::cuStreamGetDevice ::cuStreamWaitEvent, ::cuStreamQuery, ::cuStreamSynchronize, ::cuStreamAddCallback, ::cudaStreamCreate, ::cudaStreamCreateWithFlags*/ fn cuStreamGetCtx_ptsz( hStream: cuda_types::cuda::CUstream, pctx: *mut cuda_types::cuda::CUcontext, ) -> cuda_types::cuda::CUresult; /** \brief Query the contexts associated with a stream Returns the contexts that the stream is associated with. If the stream is associated with a green context, the API returns the green context in \p pGreenCtx and the primary context of the associated device in \p pCtx. If the stream is associated with a regular context, the API returns the regular context in \p pCtx and NULL in \p pGreenCtx. The stream handle \p hStream can refer to any of the following:
  • a stream created via any of the CUDA driver APIs such as ::cuStreamCreate, ::cuStreamCreateWithPriority and ::cuGreenCtxStreamCreate, or their runtime API equivalents such as ::cudaStreamCreate, ::cudaStreamCreateWithFlags and ::cudaStreamCreateWithPriority. Passing an invalid handle will result in undefined behavior.
  • any of the special streams such as the NULL stream, ::CU_STREAM_LEGACY and ::CU_STREAM_PER_THREAD. The runtime API equivalents of these are also accepted, which are NULL, ::cudaStreamLegacy and ::cudaStreamPerThread respectively. If any of the special handles are specified, the API will operate on the context current to the calling thread. If a green context (that was converted via ::cuCtxFromGreenCtx() before setting it current) is current to the calling thread, the API will return the green context in \p pGreenCtx and the primary context of the associated device in \p pCtx. If a regular context is current, the API returns the regular context in \p pCtx and NULL in \p pGreenCtx. Note that specifying ::CU_STREAM_PER_THREAD or ::cudaStreamPerThread will return ::CUDA_ERROR_INVALID_HANDLE if a green context is current to the calling thread. If no context is current to the calling thread, ::CUDA_ERROR_INVALID_CONTEXT is returned.
\param hStream - Handle to the stream to be queried \param pCtx - Returned regular context associated with the stream \param pGreenCtx - Returned green context if the stream is associated with a green context or NULL if not \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_HANDLE \notefnerr \sa ::cuStreamDestroy, ::cuStreamCreate ::cuStreamCreateWithPriority, ::cuGreenCtxStreamCreate, ::cuStreamGetPriority, ::cuStreamGetFlags, ::cuStreamGetDevice, ::cuStreamWaitEvent, ::cuStreamQuery, ::cuStreamSynchronize, ::cuStreamAddCallback, ::cudaStreamCreate, ::cudaStreamCreateWithFlags,*/ fn cuStreamGetCtx_v2_ptsz( hStream: cuda_types::cuda::CUstream, pCtx: *mut cuda_types::cuda::CUcontext, pGreenCtx: *mut cuda_types::cuda::CUgreenCtx, ) -> cuda_types::cuda::CUresult; /** \brief Make a compute stream wait on an event Makes all future work submitted to \p hStream wait for all work captured in \p hEvent. See ::cuEventRecord() for details on what is captured by an event. The synchronization will be performed efficiently on the device when applicable. \p hEvent may be from a different context or device than \p hStream. flags include: - ::CU_EVENT_WAIT_DEFAULT: Default event creation flag. - ::CU_EVENT_WAIT_EXTERNAL: Event is captured in the graph as an external event node when performing stream capture. This flag is invalid outside of stream capture. \param hStream - Stream to wait \param hEvent - Event to wait on (may not be NULL) \param Flags - See ::CUevent_capture_flags \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_HANDLE, \note_null_stream \notefnerr \sa ::cuStreamCreate, ::cuEventRecord, ::cuStreamQuery, ::cuStreamSynchronize, ::cuStreamAddCallback, ::cuStreamDestroy, ::cudaStreamWaitEvent*/ fn cuStreamWaitEvent_ptsz( hStream: cuda_types::cuda::CUstream, hEvent: cuda_types::cuda::CUevent, Flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Add a callback to a compute stream \note This function is slated for eventual deprecation and removal. If you do not require the callback to execute in case of a device error, consider using ::cuLaunchHostFunc. Additionally, this function is not supported with ::cuStreamBeginCapture and ::cuStreamEndCapture, unlike ::cuLaunchHostFunc. Adds a callback to be called on the host after all currently enqueued items in the stream have completed. For each cuStreamAddCallback call, the callback will be executed exactly once. The callback will block later work in the stream until it is finished. The callback may be passed ::CUDA_SUCCESS or an error code. In the event of a device error, all subsequently executed callbacks will receive an appropriate ::CUresult. Callbacks must not make any CUDA API calls. Attempting to use a CUDA API will result in ::CUDA_ERROR_NOT_PERMITTED. Callbacks must not perform any synchronization that may depend on outstanding device work or other callbacks that are not mandated to run earlier. Callbacks without a mandated order (in independent streams) execute in undefined order and may be serialized. For the purposes of Unified Memory, callback execution makes a number of guarantees:
  • The callback stream is considered idle for the duration of the callback. Thus, for example, a callback may always use memory attached to the callback stream.
  • The start of execution of a callback has the same effect as synchronizing an event recorded in the same stream immediately prior to the callback. It thus synchronizes streams which have been "joined" prior to the callback.
  • Adding device work to any stream does not have the effect of making the stream active until all preceding host functions and stream callbacks have executed. Thus, for example, a callback might use global attached memory even if work has been added to another stream, if the work has been ordered behind the callback with an event.
  • Completion of a callback does not cause a stream to become active except as described above. The callback stream will remain idle if no device work follows the callback, and will remain idle across consecutive callbacks without device work in between. Thus, for example, stream synchronization can be done by signaling from a callback at the end of the stream.
\param hStream - Stream to add callback to \param callback - The function to call once preceding stream operations are complete \param userData - User specified data to be passed to the callback function \param flags - Reserved for future use, must be 0 \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_NOT_SUPPORTED \note_null_stream \notefnerr \sa ::cuStreamCreate, ::cuStreamQuery, ::cuStreamSynchronize, ::cuStreamWaitEvent, ::cuStreamDestroy, ::cuMemAllocManaged, ::cuStreamAttachMemAsync, ::cuLaunchHostFunc, ::cudaStreamAddCallback*/ fn cuStreamAddCallback_ptsz( hStream: cuda_types::cuda::CUstream, callback: cuda_types::cuda::CUstreamCallback, userData: *mut ::core::ffi::c_void, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Begins graph capture on a stream Begin graph capture on \p hStream. When a stream is in capture mode, all operations pushed into the stream will not be executed, but will instead be captured into a graph, which will be returned via ::cuStreamEndCapture. Capture may not be initiated if \p stream is CU_STREAM_LEGACY. Capture must be ended on the same stream in which it was initiated, and it may only be initiated if the stream is not already in capture mode. The capture mode may be queried via ::cuStreamIsCapturing. A unique id representing the capture sequence may be queried via ::cuStreamGetCaptureInfo. If \p mode is not ::CU_STREAM_CAPTURE_MODE_RELAXED, ::cuStreamEndCapture must be called on this stream from the same thread. \param hStream - Stream in which to initiate capture \param mode - Controls the interaction of this capture sequence with other API calls that are potentially unsafe. For more details see ::cuThreadExchangeStreamCaptureMode. \note Kernels captured using this API must not use texture and surface references. Reading or writing through any texture or surface reference is undefined behavior. This restriction does not apply to texture and surface objects. \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuStreamCreate, ::cuStreamIsCapturing, ::cuStreamEndCapture, ::cuThreadExchangeStreamCaptureMode*/ fn cuStreamBeginCapture_v2_ptsz( hStream: cuda_types::cuda::CUstream, mode: cuda_types::cuda::CUstreamCaptureMode, ) -> cuda_types::cuda::CUresult; /** \brief Begins graph capture on a stream to an existing graph Begin graph capture on \p hStream, placing new nodes into an existing graph. When a stream is in capture mode, all operations pushed into the stream will not be executed, but will instead be captured into \p hGraph. The graph will not be instantiable until the user calls ::cuStreamEndCapture. Capture may not be initiated if \p stream is CU_STREAM_LEGACY. Capture must be ended on the same stream in which it was initiated, and it may only be initiated if the stream is not already in capture mode. The capture mode may be queried via ::cuStreamIsCapturing. A unique id representing the capture sequence may be queried via ::cuStreamGetCaptureInfo. If \p mode is not ::CU_STREAM_CAPTURE_MODE_RELAXED, ::cuStreamEndCapture must be called on this stream from the same thread. \param hStream - Stream in which to initiate capture. \param hGraph - Graph to capture into. \param dependencies - Dependencies of the first node captured in the stream. Can be NULL if numDependencies is 0. \param dependencyData - Optional array of data associated with each dependency. \param numDependencies - Number of dependencies. \param mode - Controls the interaction of this capture sequence with other API calls that are potentially unsafe. For more details see ::cuThreadExchangeStreamCaptureMode. \note Kernels captured using this API must not use texture and surface references. Reading or writing through any texture or surface reference is undefined behavior. This restriction does not apply to texture and surface objects. \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuStreamBeginCapture, ::cuStreamCreate, ::cuStreamIsCapturing, ::cuStreamEndCapture, ::cuThreadExchangeStreamCaptureMode, ::cuGraphAddNode*/ fn cuStreamBeginCaptureToGraph_ptsz( hStream: cuda_types::cuda::CUstream, hGraph: cuda_types::cuda::CUgraph, dependencies: *const cuda_types::cuda::CUgraphNode, dependencyData: *const cuda_types::cuda::CUgraphEdgeData, numDependencies: usize, mode: cuda_types::cuda::CUstreamCaptureMode, ) -> cuda_types::cuda::CUresult; /** \brief Swaps the stream capture interaction mode for a thread Sets the calling thread's stream capture interaction mode to the value contained in \p *mode, and overwrites \p *mode with the previous mode for the thread. To facilitate deterministic behavior across function or module boundaries, callers are encouraged to use this API in a push-pop fashion: \code CUstreamCaptureMode mode = desiredMode; cuThreadExchangeStreamCaptureMode(&mode); ... cuThreadExchangeStreamCaptureMode(&mode); // restore previous mode \endcode During stream capture (see ::cuStreamBeginCapture), some actions, such as a call to ::cudaMalloc, may be unsafe. In the case of ::cudaMalloc, the operation is not enqueued asynchronously to a stream, and is not observed by stream capture. Therefore, if the sequence of operations captured via ::cuStreamBeginCapture depended on the allocation being replayed whenever the graph is launched, the captured graph would be invalid. Therefore, stream capture places restrictions on API calls that can be made within or concurrently to a ::cuStreamBeginCapture-::cuStreamEndCapture sequence. This behavior can be controlled via this API and flags to ::cuStreamBeginCapture. A thread's mode is one of the following: - \p CU_STREAM_CAPTURE_MODE_GLOBAL: This is the default mode. If the local thread has an ongoing capture sequence that was not initiated with \p CU_STREAM_CAPTURE_MODE_RELAXED at \p cuStreamBeginCapture, or if any other thread has a concurrent capture sequence initiated with \p CU_STREAM_CAPTURE_MODE_GLOBAL, this thread is prohibited from potentially unsafe API calls. - \p CU_STREAM_CAPTURE_MODE_THREAD_LOCAL: If the local thread has an ongoing capture sequence not initiated with \p CU_STREAM_CAPTURE_MODE_RELAXED, it is prohibited from potentially unsafe API calls. Concurrent capture sequences in other threads are ignored. - \p CU_STREAM_CAPTURE_MODE_RELAXED: The local thread is not prohibited from potentially unsafe API calls. Note that the thread is still prohibited from API calls which necessarily conflict with stream capture, for example, attempting ::cuEventQuery on an event that was last recorded inside a capture sequence. \param mode - Pointer to mode value to swap with the current mode \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuStreamBeginCapture*/ fn cuThreadExchangeStreamCaptureMode( mode: *mut cuda_types::cuda::CUstreamCaptureMode, ) -> cuda_types::cuda::CUresult; /** \brief Ends capture on a stream, returning the captured graph End capture on \p hStream, returning the captured graph via \p phGraph. Capture must have been initiated on \p hStream via a call to ::cuStreamBeginCapture. If capture was invalidated, due to a violation of the rules of stream capture, then a NULL graph will be returned. If the \p mode argument to ::cuStreamBeginCapture was not ::CU_STREAM_CAPTURE_MODE_RELAXED, this call must be from the same thread as ::cuStreamBeginCapture. \param hStream - Stream to query \param phGraph - The captured graph \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_STREAM_CAPTURE_WRONG_THREAD \notefnerr \sa ::cuStreamCreate, ::cuStreamBeginCapture, ::cuStreamIsCapturing, ::cuGraphDestroy*/ fn cuStreamEndCapture_ptsz( hStream: cuda_types::cuda::CUstream, phGraph: *mut cuda_types::cuda::CUgraph, ) -> cuda_types::cuda::CUresult; /** \brief Returns a stream's capture status Return the capture status of \p hStream via \p captureStatus. After a successful call, \p *captureStatus will contain one of the following: - ::CU_STREAM_CAPTURE_STATUS_NONE: The stream is not capturing. - ::CU_STREAM_CAPTURE_STATUS_ACTIVE: The stream is capturing. - ::CU_STREAM_CAPTURE_STATUS_INVALIDATED: The stream was capturing but an error has invalidated the capture sequence. The capture sequence must be terminated with ::cuStreamEndCapture on the stream where it was initiated in order to continue using \p hStream. Note that, if this is called on ::CU_STREAM_LEGACY (the "null stream") while a blocking stream in the same context is capturing, it will return ::CUDA_ERROR_STREAM_CAPTURE_IMPLICIT and \p *captureStatus is unspecified after the call. The blocking stream capture is not invalidated. When a blocking stream is capturing, the legacy stream is in an unusable state until the blocking stream capture is terminated. The legacy stream is not supported for stream capture, but attempted use would have an implicit dependency on the capturing stream(s). \param hStream - Stream to query \param captureStatus - Returns the stream's capture status \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_STREAM_CAPTURE_IMPLICIT \notefnerr \sa ::cuStreamCreate, ::cuStreamBeginCapture, ::cuStreamEndCapture*/ fn cuStreamIsCapturing_ptsz( hStream: cuda_types::cuda::CUstream, captureStatus: *mut cuda_types::cuda::CUstreamCaptureStatus, ) -> cuda_types::cuda::CUresult; /** \brief Query a stream's capture state Query stream state related to stream capture. If called on ::CU_STREAM_LEGACY (the "null stream") while a stream not created with ::CU_STREAM_NON_BLOCKING is capturing, returns ::CUDA_ERROR_STREAM_CAPTURE_IMPLICIT. Valid data (other than capture status) is returned only if both of the following are true: - the call returns CUDA_SUCCESS - the returned capture status is ::CU_STREAM_CAPTURE_STATUS_ACTIVE If \p edgeData_out is non-NULL then \p dependencies_out must be as well. If \p dependencies_out is non-NULL and \p edgeData_out is NULL, but there is non-zero edge data for one or more of the current stream dependencies, the call will return ::CUDA_ERROR_LOSSY_QUERY. \param hStream - The stream to query \param captureStatus_out - Location to return the capture status of the stream; required \param id_out - Optional location to return an id for the capture sequence, which is unique over the lifetime of the process \param graph_out - Optional location to return the graph being captured into. All operations other than destroy and node removal are permitted on the graph while the capture sequence is in progress. This API does not transfer ownership of the graph, which is transferred or destroyed at ::cuStreamEndCapture. Note that the graph handle may be invalidated before end of capture for certain errors. Nodes that are or become unreachable from the original stream at ::cuStreamEndCapture due to direct actions on the graph do not trigger ::CUDA_ERROR_STREAM_CAPTURE_UNJOINED. \param dependencies_out - Optional location to store a pointer to an array of nodes. The next node to be captured in the stream will depend on this set of nodes, absent operations such as event wait which modify this set. The array pointer is valid until the next API call which operates on the stream or until the capture is terminated. The node handles may be copied out and are valid until they or the graph is destroyed. The driver-owned array may also be passed directly to APIs that operate on the graph (not the stream) without copying. \param edgeData_out - Optional location to store a pointer to an array of graph edge data. This array parallels \c dependencies_out; the next node to be added has an edge to \c dependencies_out[i] with annotation \c edgeData_out[i] for each \c i. The array pointer is valid until the next API call which operates on the stream or until the capture is terminated. \param numDependencies_out - Optional location to store the size of the array returned in dependencies_out. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_STREAM_CAPTURE_IMPLICIT, ::CUDA_ERROR_LOSSY_QUERY \note_graph_thread_safety \notefnerr \sa ::cuStreamBeginCapture, ::cuStreamIsCapturing, ::cuStreamUpdateCaptureDependencies*/ fn cuStreamGetCaptureInfo_v3_ptsz( hStream: cuda_types::cuda::CUstream, captureStatus_out: *mut cuda_types::cuda::CUstreamCaptureStatus, id_out: *mut cuda_types::cuda::cuuint64_t, graph_out: *mut cuda_types::cuda::CUgraph, dependencies_out: *mut *const cuda_types::cuda::CUgraphNode, edgeData_out: *mut *const cuda_types::cuda::CUgraphEdgeData, numDependencies_out: *mut usize, ) -> cuda_types::cuda::CUresult; /** \brief Update the set of dependencies in a capturing stream Modifies the dependency set of a capturing stream. The dependency set is the set of nodes that the next captured node in the stream will depend on along with the edge data for those dependencies. Valid flags are ::CU_STREAM_ADD_CAPTURE_DEPENDENCIES and ::CU_STREAM_SET_CAPTURE_DEPENDENCIES. These control whether the set passed to the API is added to the existing set or replaces it. A flags value of 0 defaults to ::CU_STREAM_ADD_CAPTURE_DEPENDENCIES. Nodes that are removed from the dependency set via this API do not result in ::CUDA_ERROR_STREAM_CAPTURE_UNJOINED if they are unreachable from the stream at ::cuStreamEndCapture. Returns ::CUDA_ERROR_ILLEGAL_STATE if the stream is not capturing. \param hStream - The stream to update \param dependencies - The set of dependencies to add \param dependencyData - Optional array of data associated with each dependency. \param numDependencies - The size of the dependencies array \param flags - See above \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_ILLEGAL_STATE \sa ::cuStreamBeginCapture, ::cuStreamGetCaptureInfo*/ fn cuStreamUpdateCaptureDependencies_v2_ptsz( hStream: cuda_types::cuda::CUstream, dependencies: *mut cuda_types::cuda::CUgraphNode, dependencyData: *const cuda_types::cuda::CUgraphEdgeData, numDependencies: usize, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Attach memory to a stream asynchronously Enqueues an operation in \p hStream to specify stream association of \p length bytes of memory starting from \p dptr. This function is a stream-ordered operation, meaning that it is dependent on, and will only take effect when, previous work in stream has completed. Any previous association is automatically replaced. \p dptr must point to one of the following types of memories: - managed memory declared using the __managed__ keyword or allocated with ::cuMemAllocManaged. - a valid host-accessible region of system-allocated pageable memory. This type of memory may only be specified if the device associated with the stream reports a non-zero value for the device attribute ::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS. For managed allocations, \p length must be either zero or the entire allocation's size. Both indicate that the entire allocation's stream association is being changed. Currently, it is not possible to change stream association for a portion of a managed allocation. For pageable host allocations, \p length must be non-zero. The stream association is specified using \p flags which must be one of ::CUmemAttach_flags. If the ::CU_MEM_ATTACH_GLOBAL flag is specified, the memory can be accessed by any stream on any device. If the ::CU_MEM_ATTACH_HOST flag is specified, the program makes a guarantee that it won't access the memory on the device from any stream on a device that has a zero value for the device attribute ::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS. If the ::CU_MEM_ATTACH_SINGLE flag is specified and \p hStream is associated with a device that has a zero value for the device attribute ::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS, the program makes a guarantee that it will only access the memory on the device from \p hStream. It is illegal to attach singly to the NULL stream, because the NULL stream is a virtual global stream and not a specific stream. An error will be returned in this case. When memory is associated with a single stream, the Unified Memory system will allow CPU access to this memory region so long as all operations in \p hStream have completed, regardless of whether other streams are active. In effect, this constrains exclusive ownership of the managed memory region by an active GPU to per-stream activity instead of whole-GPU activity. Accessing memory on the device from streams that are not associated with it will produce undefined results. No error checking is performed by the Unified Memory system to ensure that kernels launched into other streams do not access this region. It is a program's responsibility to order calls to ::cuStreamAttachMemAsync via events, synchronization or other means to ensure legal access to memory at all times. Data visibility and coherency will be changed appropriately for all kernels which follow a stream-association change. If \p hStream is destroyed while data is associated with it, the association is removed and the association reverts to the default visibility of the allocation as specified at ::cuMemAllocManaged. For __managed__ variables, the default association is always ::CU_MEM_ATTACH_GLOBAL. Note that destroying a stream is an asynchronous operation, and as a result, the change to default association won't happen until all work in the stream has completed. \param hStream - Stream in which to enqueue the attach operation \param dptr - Pointer to memory (must be a pointer to managed memory or to a valid host-accessible region of system-allocated pageable memory) \param length - Length of memory \param flags - Must be one of ::CUmemAttach_flags \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_NOT_SUPPORTED \note_null_stream \notefnerr \sa ::cuStreamCreate, ::cuStreamQuery, ::cuStreamSynchronize, ::cuStreamWaitEvent, ::cuStreamDestroy, ::cuMemAllocManaged, ::cudaStreamAttachMemAsync*/ fn cuStreamAttachMemAsync_ptsz( hStream: cuda_types::cuda::CUstream, dptr: cuda_types::cuda::CUdeviceptr, length: usize, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Determine status of a compute stream Returns ::CUDA_SUCCESS if all operations in the stream specified by \p hStream have completed, or ::CUDA_ERROR_NOT_READY if not. For the purposes of Unified Memory, a return value of ::CUDA_SUCCESS is equivalent to having called ::cuStreamSynchronize(). \param hStream - Stream to query status of \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_NOT_READY \note_null_stream \notefnerr \sa ::cuStreamCreate, ::cuStreamWaitEvent, ::cuStreamDestroy, ::cuStreamSynchronize, ::cuStreamAddCallback, ::cudaStreamQuery*/ fn cuStreamQuery_ptsz( hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Wait until a stream's tasks are completed Waits until the device has completed all operations in the stream specified by \p hStream. If the context was created with the ::CU_CTX_SCHED_BLOCKING_SYNC flag, the CPU thread will block until the stream is finished with all of its tasks. \param hStream - Stream to wait for \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_HANDLE \note_null_stream \notefnerr \sa ::cuStreamCreate, ::cuStreamDestroy, ::cuStreamWaitEvent, ::cuStreamQuery, ::cuStreamAddCallback, ::cudaStreamSynchronize*/ fn cuStreamSynchronize_ptsz( hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Destroys a stream Destroys the stream specified by \p hStream. In case the device is still doing work in the stream \p hStream when ::cuStreamDestroy() is called, the function will return immediately and the resources associated with \p hStream will be released automatically once the device has completed all work in \p hStream. \param hStream - Stream to destroy \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE \notefnerr \sa ::cuStreamCreate, ::cuStreamWaitEvent, ::cuStreamQuery, ::cuStreamSynchronize, ::cuStreamAddCallback, ::cudaStreamDestroy*/ fn cuStreamDestroy_v2( hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Copies attributes from source stream to destination stream. Copies attributes from source stream \p src to destination stream \p dst. Both streams must have the same context. \param[out] dst Destination stream \param[in] src Source stream For list of attributes see ::CUstreamAttrID \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::CUaccessPolicyWindow*/ fn cuStreamCopyAttributes_ptsz( dst: cuda_types::cuda::CUstream, src: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Queries stream attribute. Queries attribute \p attr from \p hStream and stores it in corresponding member of \p value_out. \param[in] hStream \param[in] attr \param[out] value_out \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE \notefnerr \sa ::CUaccessPolicyWindow*/ fn cuStreamGetAttribute_ptsz( hStream: cuda_types::cuda::CUstream, attr: cuda_types::cuda::CUstreamAttrID, value_out: *mut cuda_types::cuda::CUstreamAttrValue, ) -> cuda_types::cuda::CUresult; /** \brief Sets stream attribute. Sets attribute \p attr on \p hStream from corresponding attribute of \p value. The updated attribute will be applied to subsequent work submitted to the stream. It will not affect previously submitted work. \param[out] hStream \param[in] attr \param[in] value \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE \notefnerr \sa ::CUaccessPolicyWindow*/ fn cuStreamSetAttribute_ptsz( hStream: cuda_types::cuda::CUstream, attr: cuda_types::cuda::CUstreamAttrID, value: *const cuda_types::cuda::CUstreamAttrValue, ) -> cuda_types::cuda::CUresult; /** \brief Creates an event Creates an event *phEvent for the current context with the flags specified via \p Flags. Valid flags include: - ::CU_EVENT_DEFAULT: Default event creation flag. - ::CU_EVENT_BLOCKING_SYNC: Specifies that the created event should use blocking synchronization. A CPU thread that uses ::cuEventSynchronize() to wait on an event created with this flag will block until the event has actually been recorded. - ::CU_EVENT_DISABLE_TIMING: Specifies that the created event does not need to record timing data. Events created with this flag specified and the ::CU_EVENT_BLOCKING_SYNC flag not specified will provide the best performance when used with ::cuStreamWaitEvent() and ::cuEventQuery(). - ::CU_EVENT_INTERPROCESS: Specifies that the created event may be used as an interprocess event by ::cuIpcGetEventHandle(). ::CU_EVENT_INTERPROCESS must be specified along with ::CU_EVENT_DISABLE_TIMING. \param phEvent - Returns newly created event \param Flags - Event creation flags \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_OUT_OF_MEMORY \notefnerr \sa ::cuEventRecord, ::cuEventQuery, ::cuEventSynchronize, ::cuEventDestroy, ::cuEventElapsedTime, ::cudaEventCreate, ::cudaEventCreateWithFlags*/ fn cuEventCreate( phEvent: *mut cuda_types::cuda::CUevent, Flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Records an event Captures in \p hEvent the contents of \p hStream at the time of this call. \p hEvent and \p hStream must be from the same context otherwise ::CUDA_ERROR_INVALID_HANDLE is returned. Calls such as ::cuEventQuery() or ::cuStreamWaitEvent() will then examine or wait for completion of the work that was captured. Uses of \p hStream after this call do not modify \p hEvent. See note on default stream behavior for what is captured in the default case. ::cuEventRecord() can be called multiple times on the same event and will overwrite the previously captured state. Other APIs such as ::cuStreamWaitEvent() use the most recently captured state at the time of the API call, and are not affected by later calls to ::cuEventRecord(). Before the first call to ::cuEventRecord(), an event represents an empty set of work, so for example ::cuEventQuery() would return ::CUDA_SUCCESS. \param hEvent - Event to record \param hStream - Stream to record event for \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_INVALID_VALUE \note_null_stream \notefnerr \sa ::cuEventCreate, ::cuEventQuery, ::cuEventSynchronize, ::cuStreamWaitEvent, ::cuEventDestroy, ::cuEventElapsedTime, ::cudaEventRecord, ::cuEventRecordWithFlags*/ fn cuEventRecord_ptsz( hEvent: cuda_types::cuda::CUevent, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Records an event Captures in \p hEvent the contents of \p hStream at the time of this call. \p hEvent and \p hStream must be from the same context otherwise ::CUDA_ERROR_INVALID_HANDLE is returned. Calls such as ::cuEventQuery() or ::cuStreamWaitEvent() will then examine or wait for completion of the work that was captured. Uses of \p hStream after this call do not modify \p hEvent. See note on default stream behavior for what is captured in the default case. ::cuEventRecordWithFlags() can be called multiple times on the same event and will overwrite the previously captured state. Other APIs such as ::cuStreamWaitEvent() use the most recently captured state at the time of the API call, and are not affected by later calls to ::cuEventRecordWithFlags(). Before the first call to ::cuEventRecordWithFlags(), an event represents an empty set of work, so for example ::cuEventQuery() would return ::CUDA_SUCCESS. flags include: - ::CU_EVENT_RECORD_DEFAULT: Default event creation flag. - ::CU_EVENT_RECORD_EXTERNAL: Event is captured in the graph as an external event node when performing stream capture. This flag is invalid outside of stream capture. \param hEvent - Event to record \param hStream - Stream to record event for \param flags - See ::CUevent_capture_flags \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_INVALID_VALUE \note_null_stream \notefnerr \sa ::cuEventCreate, ::cuEventQuery, ::cuEventSynchronize, ::cuStreamWaitEvent, ::cuEventDestroy, ::cuEventElapsedTime, ::cuEventRecord, ::cudaEventRecord*/ fn cuEventRecordWithFlags_ptsz( hEvent: cuda_types::cuda::CUevent, hStream: cuda_types::cuda::CUstream, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Queries an event's status Queries the status of all work currently captured by \p hEvent. See ::cuEventRecord() for details on what is captured by an event. Returns ::CUDA_SUCCESS if all captured work has been completed, or ::CUDA_ERROR_NOT_READY if any captured work is incomplete. For the purposes of Unified Memory, a return value of ::CUDA_SUCCESS is equivalent to having called ::cuEventSynchronize(). \param hEvent - Event to query \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_READY \notefnerr \sa ::cuEventCreate, ::cuEventRecord, ::cuEventSynchronize, ::cuEventDestroy, ::cuEventElapsedTime, ::cudaEventQuery*/ fn cuEventQuery(hEvent: cuda_types::cuda::CUevent) -> cuda_types::cuda::CUresult; /** \brief Waits for an event to complete Waits until the completion of all work currently captured in \p hEvent. See ::cuEventRecord() for details on what is captured by an event. Waiting for an event that was created with the ::CU_EVENT_BLOCKING_SYNC flag will cause the calling CPU thread to block until the event has been completed by the device. If the ::CU_EVENT_BLOCKING_SYNC flag has not been set, then the CPU thread will busy-wait until the event has been completed by the device. \param hEvent - Event to wait for \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_HANDLE \notefnerr \sa ::cuEventCreate, ::cuEventRecord, ::cuEventQuery, ::cuEventDestroy, ::cuEventElapsedTime, ::cudaEventSynchronize*/ fn cuEventSynchronize( hEvent: cuda_types::cuda::CUevent, ) -> cuda_types::cuda::CUresult; /** \brief Destroys an event Destroys the event specified by \p hEvent. An event may be destroyed before it is complete (i.e., while ::cuEventQuery() would return ::CUDA_ERROR_NOT_READY). In this case, the call does not block on completion of the event, and any associated resources will automatically be released asynchronously at completion. \param hEvent - Event to destroy \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_HANDLE \notefnerr \sa ::cuEventCreate, ::cuEventRecord, ::cuEventQuery, ::cuEventSynchronize, ::cuEventElapsedTime, ::cudaEventDestroy*/ fn cuEventDestroy_v2( hEvent: cuda_types::cuda::CUevent, ) -> cuda_types::cuda::CUresult; /** \brief Computes the elapsed time between two events Computes the elapsed time between two events (in milliseconds with a resolution of around 0.5 microseconds). Note this API is not guaranteed to return the latest errors for pending work. As such this API is intended to serve as an elapsed time calculation only and any polling for completion on the events to be compared should be done with ::cuEventQuery instead. If either event was last recorded in a non-NULL stream, the resulting time may be greater than expected (even if both used the same stream handle). This happens because the ::cuEventRecord() operation takes place asynchronously and there is no guarantee that the measured latency is actually just between the two events. Any number of other different stream operations could execute in between the two measured events, thus altering the timing in a significant way. If ::cuEventRecord() has not been called on either event then ::CUDA_ERROR_INVALID_HANDLE is returned. If ::cuEventRecord() has been called on both events but one or both of them has not yet been completed (that is, ::cuEventQuery() would return ::CUDA_ERROR_NOT_READY on at least one of the events), ::CUDA_ERROR_NOT_READY is returned. If either event was created with the ::CU_EVENT_DISABLE_TIMING flag, then this function will return ::CUDA_ERROR_INVALID_HANDLE. \param pMilliseconds - Time between \p hStart and \p hEnd in ms \param hStart - Starting event \param hEnd - Ending event \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_NOT_READY, ::CUDA_ERROR_UNKNOWN \notefnerr \sa ::cuEventCreate, ::cuEventRecord, ::cuEventQuery, ::cuEventSynchronize, ::cuEventDestroy, ::cudaEventElapsedTime*/ fn cuEventElapsedTime_v2( pMilliseconds: *mut f32, hStart: cuda_types::cuda::CUevent, hEnd: cuda_types::cuda::CUevent, ) -> cuda_types::cuda::CUresult; /** \brief Imports an external memory object Imports an externally allocated memory object and returns a handle to that in \p extMem_out. The properties of the handle being imported must be described in \p memHandleDesc. The ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC structure is defined as follows: \code typedef struct CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st { CUexternalMemoryHandleType type; union { int fd; struct { void *handle; const void *name; } win32; const void *nvSciBufObject; } handle; unsigned long long size; unsigned int flags; } CUDA_EXTERNAL_MEMORY_HANDLE_DESC; \endcode where ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC::type specifies the type of handle being imported. ::CUexternalMemoryHandleType is defined as: \code typedef enum CUexternalMemoryHandleType_enum { CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD = 1, CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32 = 2, CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT = 3, CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP = 4, CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE = 5, CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE = 6, CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT = 7, CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF = 8, CU_EXTERNAL_MEMORY_HANDLE_TYPE_DMABUF_FD = 9 } CUexternalMemoryHandleType; \endcode If ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC::type is ::CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD, then ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::fd must be a valid file descriptor referencing a memory object. Ownership of the file descriptor is transferred to the CUDA driver when the handle is imported successfully. Performing any operations on the file descriptor after it is imported results in undefined behavior. If ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC::type is ::CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32, then exactly one of ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::handle and ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::name must not be NULL. If ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::handle is not NULL, then it must represent a valid shared NT handle that references a memory object. Ownership of this handle is not transferred to CUDA after the import operation, so the application must release the handle using the appropriate system call. If ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::name is not NULL, then it must point to a NULL-terminated array of UTF-16 characters that refers to a memory object. If ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC::type is ::CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT, then ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::handle must be non-NULL and ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::name must be NULL. The handle specified must be a globally shared KMT handle. This handle does not hold a reference to the underlying object, and thus will be invalid when all references to the memory object are destroyed. If ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC::type is ::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP, then exactly one of ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::handle and ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::name must not be NULL. If ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::handle is not NULL, then it must represent a valid shared NT handle that is returned by ID3D12Device::CreateSharedHandle when referring to a ID3D12Heap object. This handle holds a reference to the underlying object. If ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::name is not NULL, then it must point to a NULL-terminated array of UTF-16 characters that refers to a ID3D12Heap object. If ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC::type is ::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE, then exactly one of ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::handle and ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::name must not be NULL. If ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::handle is not NULL, then it must represent a valid shared NT handle that is returned by ID3D12Device::CreateSharedHandle when referring to a ID3D12Resource object. This handle holds a reference to the underlying object. If ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::name is not NULL, then it must point to a NULL-terminated array of UTF-16 characters that refers to a ID3D12Resource object. If ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC::type is ::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE, then ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::handle must represent a valid shared NT handle that is returned by IDXGIResource1::CreateSharedHandle when referring to a ID3D11Resource object. If ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::name is not NULL, then it must point to a NULL-terminated array of UTF-16 characters that refers to a ID3D11Resource object. If ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC::type is ::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT, then ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::handle must represent a valid shared KMT handle that is returned by IDXGIResource::GetSharedHandle when referring to a ID3D11Resource object and ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::name must be NULL. If ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC::type is ::CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF, then ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::nvSciBufObject must be non-NULL and reference a valid NvSciBuf object. If the NvSciBuf object imported into CUDA is also mapped by other drivers, then the application must use ::cuWaitExternalSemaphoresAsync or ::cuSignalExternalSemaphoresAsync as appropriate barriers to maintain coherence between CUDA and the other drivers. See ::CUDA_EXTERNAL_SEMAPHORE_SIGNAL_SKIP_NVSCIBUF_MEMSYNC and ::CUDA_EXTERNAL_SEMAPHORE_WAIT_SKIP_NVSCIBUF_MEMSYNC for memory synchronization. If ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC::type is ::CU_EXTERNAL_MEMORY_HANDLE_TYPE_DMABUF_FD, then ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::fd must be a valid file descriptor referencing a dma_buf object and ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC::flags must be zero. Importing a dma_buf object is supported only on Tegra Jetson platform starting with Thor series. Mapping an imported dma_buf object as CUDA mipmapped array using ::cuExternalMemoryGetMappedMipmappedArray is not supported. The size of the memory object must be specified in ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC::size. Specifying the flag ::CUDA_EXTERNAL_MEMORY_DEDICATED in ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC::flags indicates that the resource is a dedicated resource. The definition of what a dedicated resource is outside the scope of this extension. This flag must be set if ::CUDA_EXTERNAL_MEMORY_HANDLE_DESC::type is one of the following: ::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE ::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE ::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT \param extMem_out - Returned handle to an external memory object \param memHandleDesc - Memory import handle descriptor \return ::CUDA_SUCCESS, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_OPERATING_SYSTEM \notefnerr \note If the Vulkan memory imported into CUDA is mapped on the CPU then the application must use vkInvalidateMappedMemoryRanges/vkFlushMappedMemoryRanges as well as appropriate Vulkan pipeline barriers to maintain coherence between CPU and GPU. For more information on these APIs, please refer to "Synchronization and Cache Control" chapter from Vulkan specification. \sa ::cuDestroyExternalMemory, ::cuExternalMemoryGetMappedBuffer, ::cuExternalMemoryGetMappedMipmappedArray*/ fn cuImportExternalMemory( extMem_out: *mut cuda_types::cuda::CUexternalMemory, memHandleDesc: *const cuda_types::cuda::CUDA_EXTERNAL_MEMORY_HANDLE_DESC, ) -> cuda_types::cuda::CUresult; /** \brief Maps a buffer onto an imported memory object Maps a buffer onto an imported memory object and returns a device pointer in \p devPtr. The properties of the buffer being mapped must be described in \p bufferDesc. The ::CUDA_EXTERNAL_MEMORY_BUFFER_DESC structure is defined as follows: \code typedef struct CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st { unsigned long long offset; unsigned long long size; unsigned int flags; } CUDA_EXTERNAL_MEMORY_BUFFER_DESC; \endcode where ::CUDA_EXTERNAL_MEMORY_BUFFER_DESC::offset is the offset in the memory object where the buffer's base address is. ::CUDA_EXTERNAL_MEMORY_BUFFER_DESC::size is the size of the buffer. ::CUDA_EXTERNAL_MEMORY_BUFFER_DESC::flags must be zero. The offset and size have to be suitably aligned to match the requirements of the external API. Mapping two buffers whose ranges overlap may or may not result in the same virtual address being returned for the overlapped portion. In such cases, the application must ensure that all accesses to that region from the GPU are volatile. Otherwise writes made via one address are not guaranteed to be visible via the other address, even if they're issued by the same thread. It is recommended that applications map the combined range instead of mapping separate buffers and then apply the appropriate offsets to the returned pointer to derive the individual buffers. The returned pointer \p devPtr must be freed using ::cuMemFree. \param devPtr - Returned device pointer to buffer \param extMem - Handle to external memory object \param bufferDesc - Buffer descriptor \return ::CUDA_SUCCESS, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE \notefnerr \sa ::cuImportExternalMemory, ::cuDestroyExternalMemory, ::cuExternalMemoryGetMappedMipmappedArray*/ fn cuExternalMemoryGetMappedBuffer( devPtr: *mut cuda_types::cuda::CUdeviceptr, extMem: cuda_types::cuda::CUexternalMemory, bufferDesc: *const cuda_types::cuda::CUDA_EXTERNAL_MEMORY_BUFFER_DESC, ) -> cuda_types::cuda::CUresult; /** \brief Maps a CUDA mipmapped array onto an external memory object Maps a CUDA mipmapped array onto an external object and returns a handle to it in \p mipmap. The properties of the CUDA mipmapped array being mapped must be described in \p mipmapDesc. The structure ::CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC is defined as follows: \code typedef struct CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st { unsigned long long offset; CUDA_ARRAY3D_DESCRIPTOR arrayDesc; unsigned int numLevels; } CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC; \endcode where ::CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC::offset is the offset in the memory object where the base level of the mipmap chain is. ::CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC::arrayDesc describes the format, dimensions and type of the base level of the mipmap chain. For further details on these parameters, please refer to the documentation for ::cuMipmappedArrayCreate. Note that if the mipmapped array is bound as a color target in the graphics API, then the flag ::CUDA_ARRAY3D_COLOR_ATTACHMENT must be specified in ::CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC::arrayDesc::Flags. ::CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC::numLevels specifies the total number of levels in the mipmap chain. If \p extMem was imported from a handle of type ::CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF, then ::CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC::numLevels must be equal to 1. Mapping \p extMem imported from a handle of type ::CU_EXTERNAL_MEMORY_HANDLE_TYPE_DMABUF_FD, is not supported. The returned CUDA mipmapped array must be freed using ::cuMipmappedArrayDestroy. \param mipmap - Returned CUDA mipmapped array \param extMem - Handle to external memory object \param mipmapDesc - CUDA array descriptor \return ::CUDA_SUCCESS, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE \notefnerr \sa ::cuImportExternalMemory, ::cuDestroyExternalMemory, ::cuExternalMemoryGetMappedBuffer*/ fn cuExternalMemoryGetMappedMipmappedArray( mipmap: *mut cuda_types::cuda::CUmipmappedArray, extMem: cuda_types::cuda::CUexternalMemory, mipmapDesc: *const cuda_types::cuda::CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC, ) -> cuda_types::cuda::CUresult; /** \brief Destroys an external memory object. Destroys the specified external memory object. Any existing buffers and CUDA mipmapped arrays mapped onto this object must no longer be used and must be explicitly freed using ::cuMemFree and ::cuMipmappedArrayDestroy respectively. \param extMem - External memory object to be destroyed \return ::CUDA_SUCCESS, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_HANDLE \notefnerr \sa ::cuImportExternalMemory, ::cuExternalMemoryGetMappedBuffer, ::cuExternalMemoryGetMappedMipmappedArray*/ fn cuDestroyExternalMemory( extMem: cuda_types::cuda::CUexternalMemory, ) -> cuda_types::cuda::CUresult; /** \brief Imports an external semaphore Imports an externally allocated synchronization object and returns a handle to that in \p extSem_out. The properties of the handle being imported must be described in \p semHandleDesc. The ::CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC is defined as follows: \code typedef struct CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st { CUexternalSemaphoreHandleType type; union { int fd; struct { void *handle; const void *name; } win32; const void* NvSciSyncObj; } handle; unsigned int flags; } CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC; \endcode where ::CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::type specifies the type of handle being imported. ::CUexternalSemaphoreHandleType is defined as: \code typedef enum CUexternalSemaphoreHandleType_enum { CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD = 1, CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32 = 2, CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT = 3, CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE = 4, CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE = 5, 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 } CUexternalSemaphoreHandleType; \endcode If ::CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::type is ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD, then ::CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::fd must be a valid file descriptor referencing a synchronization object. Ownership of the file descriptor is transferred to the CUDA driver when the handle is imported successfully. Performing any operations on the file descriptor after it is imported results in undefined behavior. If ::CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::type is ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32, then exactly one of ::CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::handle and ::CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::name must not be NULL. If ::CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::handle is not NULL, then it must represent a valid shared NT handle that references a synchronization object. Ownership of this handle is not transferred to CUDA after the import operation, so the application must release the handle using the appropriate system call. If ::CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::name is not NULL, then it must name a valid synchronization object. If ::CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::type is ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT, then ::CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::handle must be non-NULL and ::CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::name must be NULL. The handle specified must be a globally shared KMT handle. This handle does not hold a reference to the underlying object, and thus will be invalid when all references to the synchronization object are destroyed. If ::CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::type is ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE, then exactly one of ::CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::handle and ::CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::name must not be NULL. If ::CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::handle is not NULL, then it must represent a valid shared NT handle that is returned by ID3D12Device::CreateSharedHandle when referring to a ID3D12Fence object. This handle holds a reference to the underlying object. If ::CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::name is not NULL, then it must name a valid synchronization object that refers to a valid ID3D12Fence object. If ::CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::type is ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE, then ::CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::handle represents a valid shared NT handle that is returned by ID3D11Fence::CreateSharedHandle. If ::CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::name is not NULL, then it must name a valid synchronization object that refers to a valid ID3D11Fence object. If ::CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::type is ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC, then ::CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::nvSciSyncObj represents a valid NvSciSyncObj. ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX, then ::CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::handle represents a valid shared NT handle that is returned by IDXGIResource1::CreateSharedHandle when referring to a IDXGIKeyedMutex object. If ::CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::name is not NULL, then it must name a valid synchronization object that refers to a valid IDXGIKeyedMutex object. If ::CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::type is ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT, then ::CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::handle represents a valid shared KMT handle that is returned by IDXGIResource::GetSharedHandle when referring to a IDXGIKeyedMutex object and ::CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::name must be NULL. If ::CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::type is ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD, then ::CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::fd must be a valid file descriptor referencing a synchronization object. Ownership of the file descriptor is transferred to the CUDA driver when the handle is imported successfully. Performing any operations on the file descriptor after it is imported results in undefined behavior. If ::CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::type is ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32, then exactly one of ::CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::handle and ::CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::name must not be NULL. If ::CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::handle is not NULL, then it must represent a valid shared NT handle that references a synchronization object. Ownership of this handle is not transferred to CUDA after the import operation, so the application must release the handle using the appropriate system call. If ::CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::name is not NULL, then it must name a valid synchronization object. \param extSem_out - Returned handle to an external semaphore \param semHandleDesc - Semaphore import handle descriptor \return ::CUDA_SUCCESS, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_NOT_SUPPORTED, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_OPERATING_SYSTEM \notefnerr \sa ::cuDestroyExternalSemaphore, ::cuSignalExternalSemaphoresAsync, ::cuWaitExternalSemaphoresAsync*/ fn cuImportExternalSemaphore( extSem_out: *mut cuda_types::cuda::CUexternalSemaphore, semHandleDesc: *const cuda_types::cuda::CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC, ) -> cuda_types::cuda::CUresult; /** \brief Signals a set of external semaphore objects Enqueues a signal operation on a set of externally allocated semaphore object in the specified stream. The operations will be executed when all prior operations in the stream complete. The exact semantics of signaling a semaphore depends on the type of the object. If the semaphore object is any one of the following types: ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD, ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32, ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT then signaling the semaphore will set it to the signaled state. If the semaphore object is any one of the following types: ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE, ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE, ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD, ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32 then the semaphore will be set to the value specified in ::CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS::params::fence::value. If the semaphore object is of the type ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC this API sets ::CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS::params::nvSciSync::fence to a value that can be used by subsequent waiters of the same NvSciSync object to order operations with those currently submitted in \p stream. Such an update will overwrite previous contents of ::CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS::params::nvSciSync::fence. By default, signaling such an external semaphore object causes appropriate memory synchronization operations to be performed over all external memory objects that are imported as ::CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF. This ensures that any subsequent accesses made by other importers of the same set of NvSciBuf memory object(s) are coherent. These operations can be skipped by specifying the flag ::CUDA_EXTERNAL_SEMAPHORE_SIGNAL_SKIP_NVSCIBUF_MEMSYNC, which can be used as a performance optimization when data coherency is not required. But specifying this flag in scenarios where data coherency is required results in undefined behavior. Also, for semaphore object of the type ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC, if the NvSciSyncAttrList used to create the NvSciSyncObj had not set the flags in ::cuDeviceGetNvSciSyncAttributes to CUDA_NVSCISYNC_ATTR_SIGNAL, this API will return CUDA_ERROR_NOT_SUPPORTED. NvSciSyncFence associated with semaphore object of the type ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC can be deterministic. For this the NvSciSyncAttrList used to create the semaphore object must have value of NvSciSyncAttrKey_RequireDeterministicFences key set to true. Deterministic fences allow users to enqueue a wait over the semaphore object even before corresponding signal is enqueued. For such a semaphore object, CUDA guarantees that each signal operation will increment the fence value by '1'. Users are expected to track count of signals enqueued on the semaphore object and insert waits accordingly. When such a semaphore object is signaled from multiple streams, due to concurrent stream execution, it is possible that the order in which the semaphore gets signaled is indeterministic. This could lead to waiters of the semaphore getting unblocked incorrectly. Users are expected to handle such situations, either by not using the same semaphore object with deterministic fence support enabled in different streams or by adding explicit dependency amongst such streams so that the semaphore is signaled in order. NvSciSyncFence associated with semaphore object of the type ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC can be timestamp enabled. For this the NvSciSyncAttrList used to create the object must have the value of NvSciSyncAttrKey_WaiterRequireTimestamps key set to true. Timestamps are emitted asynchronously by the GPU and CUDA saves the GPU timestamp in the corresponding NvSciSyncFence at the time of signal on GPU. Users are expected to convert GPU clocks to CPU clocks using appropriate scaling functions. Users are expected to wait for the completion of the fence before extracting timestamp using appropriate NvSciSync APIs. Users are expected to ensure that there is only one outstanding timestamp enabled fence per Cuda-NvSciSync object at any point of time, failing which leads to undefined behavior. Extracting the timestamp before the corresponding fence is signalled could lead to undefined behaviour. Timestamp extracted via appropriate NvSciSync API would be in microseconds. If the semaphore object is any one of the following types: ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX, ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT then the keyed mutex will be released with the key specified in ::CUDA_EXTERNAL_SEMAPHORE_PARAMS::params::keyedmutex::key. \param extSemArray - Set of external semaphores to be signaled \param paramsArray - Array of semaphore parameters \param numExtSems - Number of semaphores to signal \param stream - Stream to enqueue the signal operations in \return ::CUDA_SUCCESS, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_NOT_SUPPORTED \notefnerr \sa ::cuImportExternalSemaphore, ::cuDestroyExternalSemaphore, ::cuWaitExternalSemaphoresAsync*/ fn cuSignalExternalSemaphoresAsync_ptsz( extSemArray: *const cuda_types::cuda::CUexternalSemaphore, paramsArray: *const cuda_types::cuda::CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS, numExtSems: ::core::ffi::c_uint, stream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Waits on a set of external semaphore objects Enqueues a wait operation on a set of externally allocated semaphore object in the specified stream. The operations will be executed when all prior operations in the stream complete. The exact semantics of waiting on a semaphore depends on the type of the object. If the semaphore object is any one of the following types: ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD, ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32, ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT then waiting on the semaphore will wait until the semaphore reaches the signaled state. The semaphore will then be reset to the unsignaled state. Therefore for every signal operation, there can only be one wait operation. If the semaphore object is any one of the following types: ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE, ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE, ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD, ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32 then waiting on the semaphore will wait until the value of the semaphore is greater than or equal to ::CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS::params::fence::value. If the semaphore object is of the type ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC then, waiting on the semaphore will wait until the ::CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS::params::nvSciSync::fence is signaled by the signaler of the NvSciSyncObj that was associated with this semaphore object. By default, waiting on such an external semaphore object causes appropriate memory synchronization operations to be performed over all external memory objects that are imported as ::CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF. This ensures that any subsequent accesses made by other importers of the same set of NvSciBuf memory object(s) are coherent. These operations can be skipped by specifying the flag ::CUDA_EXTERNAL_SEMAPHORE_WAIT_SKIP_NVSCIBUF_MEMSYNC, which can be used as a performance optimization when data coherency is not required. But specifying this flag in scenarios where data coherency is required results in undefined behavior. Also, for semaphore object of the type ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC, if the NvSciSyncAttrList used to create the NvSciSyncObj had not set the flags in ::cuDeviceGetNvSciSyncAttributes to CUDA_NVSCISYNC_ATTR_WAIT, this API will return CUDA_ERROR_NOT_SUPPORTED. If the semaphore object is any one of the following types: ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX, ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT then the keyed mutex will be acquired when it is released with the key specified in ::CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS::params::keyedmutex::key or until the timeout specified by ::CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS::params::keyedmutex::timeoutMs has lapsed. The timeout interval can either be a finite value specified in milliseconds or an infinite value. In case an infinite value is specified the timeout never elapses. The windows INFINITE macro must be used to specify infinite timeout. \param extSemArray - External semaphores to be waited on \param paramsArray - Array of semaphore parameters \param numExtSems - Number of semaphores to wait on \param stream - Stream to enqueue the wait operations in \return ::CUDA_SUCCESS, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_NOT_SUPPORTED, ::CUDA_ERROR_TIMEOUT \notefnerr \sa ::cuImportExternalSemaphore, ::cuDestroyExternalSemaphore, ::cuSignalExternalSemaphoresAsync*/ fn cuWaitExternalSemaphoresAsync_ptsz( extSemArray: *const cuda_types::cuda::CUexternalSemaphore, paramsArray: *const cuda_types::cuda::CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS, numExtSems: ::core::ffi::c_uint, stream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Destroys an external semaphore Destroys an external semaphore object and releases any references to the underlying resource. Any outstanding signals or waits must have completed before the semaphore is destroyed. \param extSem - External semaphore to be destroyed \return ::CUDA_SUCCESS, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_HANDLE \notefnerr \sa ::cuImportExternalSemaphore, ::cuSignalExternalSemaphoresAsync, ::cuWaitExternalSemaphoresAsync*/ fn cuDestroyExternalSemaphore( extSem: cuda_types::cuda::CUexternalSemaphore, ) -> cuda_types::cuda::CUresult; /** \brief Wait on a memory location Enqueues a synchronization of the stream on the given memory location. Work ordered after the operation will block until the given condition on the memory is satisfied. By default, the condition is to wait for (int32_t)(*addr - value) >= 0, a cyclic greater-or-equal. Other condition types can be specified via \p flags. If the memory was registered via ::cuMemHostRegister(), the device pointer should be obtained with ::cuMemHostGetDevicePointer(). This function cannot be used with managed memory (::cuMemAllocManaged). Support for CU_STREAM_WAIT_VALUE_NOR can be queried with ::cuDeviceGetAttribute() and ::CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR_V2. \note Warning: Improper use of this API may deadlock the application. Synchronization ordering established through this API is not visible to CUDA. CUDA tasks that are (even indirectly) ordered by this API should also have that order expressed with CUDA-visible dependencies such as events. This ensures that the scheduler does not serialize them in an improper order. \param stream The stream to synchronize on the memory location. \param addr The memory location to wait on. \param value The value to compare with the memory location. \param flags See ::CUstreamWaitValue_flags. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_SUPPORTED \notefnerr \sa ::cuStreamWaitValue64, ::cuStreamWriteValue32, ::cuStreamWriteValue64, ::cuStreamBatchMemOp, ::cuMemHostRegister, ::cuStreamWaitEvent*/ fn cuStreamWaitValue32_v2_ptsz( stream: cuda_types::cuda::CUstream, addr: cuda_types::cuda::CUdeviceptr, value: cuda_types::cuda::cuuint32_t, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Wait on a memory location Enqueues a synchronization of the stream on the given memory location. Work ordered after the operation will block until the given condition on the memory is satisfied. By default, the condition is to wait for (int64_t)(*addr - value) >= 0, a cyclic greater-or-equal. Other condition types can be specified via \p flags. If the memory was registered via ::cuMemHostRegister(), the device pointer should be obtained with ::cuMemHostGetDevicePointer(). Support for this can be queried with ::cuDeviceGetAttribute() and ::CU_DEVICE_ATTRIBUTE_CAN_USE_64_BIT_STREAM_MEM_OPS. \note Warning: Improper use of this API may deadlock the application. Synchronization ordering established through this API is not visible to CUDA. CUDA tasks that are (even indirectly) ordered by this API should also have that order expressed with CUDA-visible dependencies such as events. This ensures that the scheduler does not serialize them in an improper order. \param stream The stream to synchronize on the memory location. \param addr The memory location to wait on. \param value The value to compare with the memory location. \param flags See ::CUstreamWaitValue_flags. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_SUPPORTED \notefnerr \sa ::cuStreamWaitValue32, ::cuStreamWriteValue32, ::cuStreamWriteValue64, ::cuStreamBatchMemOp, ::cuMemHostRegister, ::cuStreamWaitEvent*/ fn cuStreamWaitValue64_v2_ptsz( stream: cuda_types::cuda::CUstream, addr: cuda_types::cuda::CUdeviceptr, value: cuda_types::cuda::cuuint64_t, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Write a value to memory Write a value to memory. If the memory was registered via ::cuMemHostRegister(), the device pointer should be obtained with ::cuMemHostGetDevicePointer(). This function cannot be used with managed memory (::cuMemAllocManaged). \param stream The stream to do the write in. \param addr The device address to write to. \param value The value to write. \param flags See ::CUstreamWriteValue_flags. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_SUPPORTED \notefnerr \sa ::cuStreamWriteValue64, ::cuStreamWaitValue32, ::cuStreamWaitValue64, ::cuStreamBatchMemOp, ::cuMemHostRegister, ::cuEventRecord*/ fn cuStreamWriteValue32_v2_ptsz( stream: cuda_types::cuda::CUstream, addr: cuda_types::cuda::CUdeviceptr, value: cuda_types::cuda::cuuint32_t, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Write a value to memory Write a value to memory. If the memory was registered via ::cuMemHostRegister(), the device pointer should be obtained with ::cuMemHostGetDevicePointer(). Support for this can be queried with ::cuDeviceGetAttribute() and ::CU_DEVICE_ATTRIBUTE_CAN_USE_64_BIT_STREAM_MEM_OPS. \param stream The stream to do the write in. \param addr The device address to write to. \param value The value to write. \param flags See ::CUstreamWriteValue_flags. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_SUPPORTED \notefnerr \sa ::cuStreamWriteValue32, ::cuStreamWaitValue32, ::cuStreamWaitValue64, ::cuStreamBatchMemOp, ::cuMemHostRegister, ::cuEventRecord*/ fn cuStreamWriteValue64_v2_ptsz( stream: cuda_types::cuda::CUstream, addr: cuda_types::cuda::CUdeviceptr, value: cuda_types::cuda::cuuint64_t, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Batch operations to synchronize the stream via memory operations This is a batch version of ::cuStreamWaitValue32() and ::cuStreamWriteValue32(). Batching operations may avoid some performance overhead in both the API call and the device execution versus adding them to the stream in separate API calls. The operations are enqueued in the order they appear in the array. See ::CUstreamBatchMemOpType for the full set of supported operations, and ::cuStreamWaitValue32(), ::cuStreamWaitValue64(), ::cuStreamWriteValue32(), and ::cuStreamWriteValue64() for details of specific operations. See related APIs for details on querying support for specific operations. \note Warning: Improper use of this API may deadlock the application. Synchronization ordering established through this API is not visible to CUDA. CUDA tasks that are (even indirectly) ordered by this API should also have that order expressed with CUDA-visible dependencies such as events. This ensures that the scheduler does not serialize them in an improper order. \param stream The stream to enqueue the operations in. \param count The number of operations in the array. Must be less than 256. \param paramArray The types and parameters of the individual operations. \param flags Reserved for future expansion; must be 0. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_SUPPORTED \notefnerr \sa ::cuStreamWaitValue32, ::cuStreamWaitValue64, ::cuStreamWriteValue32, ::cuStreamWriteValue64, ::cuMemHostRegister*/ fn cuStreamBatchMemOp_v2_ptsz( stream: cuda_types::cuda::CUstream, count: ::core::ffi::c_uint, paramArray: *mut cuda_types::cuda::CUstreamBatchMemOpParams, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Returns information about a function Returns in \p *pi the integer value of the attribute \p attrib on the kernel given by \p hfunc. The supported attributes are: - ::CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK: The maximum number of threads per block, beyond which a launch of the function would fail. This number depends on both the function and the device on which the function is currently loaded. - ::CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES: The size in bytes of statically-allocated shared memory per block required by this function. This does not include dynamically-allocated shared memory requested by the user at runtime. - ::CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES: The size in bytes of user-allocated constant memory required by this function. - ::CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES: The size in bytes of local memory used by each thread of this function. - ::CU_FUNC_ATTRIBUTE_NUM_REGS: The number of registers used by each thread of this function. - ::CU_FUNC_ATTRIBUTE_PTX_VERSION: The PTX virtual architecture version for which the function was compiled. This value is the major PTX version * 10 + the minor PTX version, so a PTX version 1.3 function would return the value 13. Note that this may return the undefined value of 0 for cubins compiled prior to CUDA 3.0. - ::CU_FUNC_ATTRIBUTE_BINARY_VERSION: The binary architecture version for which the function was compiled. This value is the major binary version * 10 + the minor binary version, so a binary version 1.3 function would return the value 13. Note that this will return a value of 10 for legacy cubins that do not have a properly-encoded binary architecture version. - ::CU_FUNC_CACHE_MODE_CA: The attribute to indicate whether the function has been compiled with user specified option "-Xptxas --dlcm=ca" set . - ::CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES: The maximum size in bytes of dynamically-allocated shared memory. - ::CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT: Preferred shared memory-L1 cache split ratio in percent of total shared memory. - ::CU_FUNC_ATTRIBUTE_CLUSTER_SIZE_MUST_BE_SET: If this attribute is set, the kernel must launch with a valid cluster size specified. - ::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_WIDTH: The required cluster width in blocks. - ::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_HEIGHT: The required cluster height in blocks. - ::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_DEPTH: The required cluster depth in blocks. - ::CU_FUNC_ATTRIBUTE_NON_PORTABLE_CLUSTER_SIZE_ALLOWED: Indicates whether the function can be launched with non-portable cluster size. 1 is allowed, 0 is disallowed. A non-portable cluster size may only function on the specific SKUs the program is tested on. The launch might fail if the program is run on a different hardware platform. CUDA API provides cudaOccupancyMaxActiveClusters to assist with checking whether the desired size can be launched on the current device. A portable cluster size is guaranteed to be functional on all compute capabilities higher than the target compute capability. The portable cluster size for sm_90 is 8 blocks per cluster. This value may increase for future compute capabilities. The specific hardware unit may support higher cluster sizes that’s not guaranteed to be portable. - ::CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE: The block scheduling policy of a function. The value type is CUclusterSchedulingPolicy. With a few execeptions, function attributes may also be queried on unloaded function handles returned from ::cuModuleEnumerateFunctions. ::CUDA_ERROR_FUNCTION_NOT_LOADED is returned if the attribute requires a fully loaded function but the function is not loaded. The loading state of a function may be queried using ::cuFuncIsloaded. ::cuFuncLoad may be called to explicitly load a function before querying the following attributes that require the function to be loaded: - ::CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK - ::CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES - ::CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES \param pi - Returned attribute value \param attrib - Attribute requested \param hfunc - Function to query attribute of \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_FUNCTION_NOT_LOADED \notefnerr \sa ::cuCtxGetCacheConfig, ::cuCtxSetCacheConfig, ::cuFuncSetCacheConfig, ::cuLaunchKernel, ::cudaFuncGetAttributes, ::cudaFuncSetAttribute, ::cuFuncIsLoaded, ::cuFuncLoad, ::cuKernelGetAttribute*/ fn cuFuncGetAttribute( pi: *mut ::core::ffi::c_int, attrib: cuda_types::cuda::CUfunction_attribute, hfunc: cuda_types::cuda::CUfunction, ) -> cuda_types::cuda::CUresult; /** \brief Sets information about a function This call sets the value of a specified attribute \p attrib on the kernel given by \p hfunc to an integer value specified by \p val This function returns CUDA_SUCCESS if the new value of the attribute could be successfully set. If the set fails, this call will return an error. Not all attributes can have values set. Attempting to set a value on a read-only attribute will result in an error (CUDA_ERROR_INVALID_VALUE) Supported attributes for the cuFuncSetAttribute call are: - ::CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES: This maximum size in bytes of dynamically-allocated shared memory. The value should contain the requested maximum size of dynamically-allocated shared memory. The sum of this value and the function attribute ::CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES cannot exceed the device attribute ::CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN. The maximal size of requestable dynamic shared memory may differ by GPU architecture. - ::CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT: On devices where the L1 cache and shared memory use the same hardware resources, this sets the shared memory carveout preference, in percent of the total shared memory. See ::CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR This is only a hint, and the driver can choose a different ratio if required to execute the function. - ::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_WIDTH: The required cluster width in blocks. The width, height, and depth values must either all be 0 or all be positive. The validity of the cluster dimensions is checked at launch time. If the value is set during compile time, it cannot be set at runtime. Setting it at runtime will return CUDA_ERROR_NOT_PERMITTED. - ::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_HEIGHT: The required cluster height in blocks. The width, height, and depth values must either all be 0 or all be positive. The validity of the cluster dimensions is checked at launch time. If the value is set during compile time, it cannot be set at runtime. Setting it at runtime will return CUDA_ERROR_NOT_PERMITTED. - ::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_DEPTH: The required cluster depth in blocks. The width, height, and depth values must either all be 0 or all be positive. The validity of the cluster dimensions is checked at launch time. If the value is set during compile time, it cannot be set at runtime. Setting it at runtime will return CUDA_ERROR_NOT_PERMITTED. - ::CU_FUNC_ATTRIBUTE_NON_PORTABLE_CLUSTER_SIZE_ALLOWED: Indicates whether the function can be launched with non-portable cluster size. 1 is allowed, 0 is disallowed. - ::CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE: The block scheduling policy of a function. The value type is CUclusterSchedulingPolicy. \param hfunc - Function to query attribute of \param attrib - Attribute requested \param value - The value to set \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuCtxGetCacheConfig, ::cuCtxSetCacheConfig, ::cuFuncSetCacheConfig, ::cuLaunchKernel, ::cudaFuncGetAttributes, ::cudaFuncSetAttribute, ::cuKernelSetAttribute*/ fn cuFuncSetAttribute( hfunc: cuda_types::cuda::CUfunction, attrib: cuda_types::cuda::CUfunction_attribute, value: ::core::ffi::c_int, ) -> cuda_types::cuda::CUresult; /** \brief Sets the preferred cache configuration for a device function On devices where the L1 cache and shared memory use the same hardware resources, this sets through \p config the preferred cache configuration for the device function \p hfunc. This is only a preference. The driver will use the requested configuration if possible, but it is free to choose a different configuration if required to execute \p hfunc. Any context-wide preference set via ::cuCtxSetCacheConfig() will be overridden by this per-function setting unless the per-function setting is ::CU_FUNC_CACHE_PREFER_NONE. In that case, the current context-wide setting will be used. This setting does nothing on devices where the size of the L1 cache and shared memory are fixed. Launching a kernel with a different preference than the most recent preference setting may insert a device-side synchronization point. The supported cache configurations are: - ::CU_FUNC_CACHE_PREFER_NONE: no preference for shared memory or L1 (default) - ::CU_FUNC_CACHE_PREFER_SHARED: prefer larger shared memory and smaller L1 cache - ::CU_FUNC_CACHE_PREFER_L1: prefer larger L1 cache and smaller shared memory - ::CU_FUNC_CACHE_PREFER_EQUAL: prefer equal sized L1 cache and shared memory \param hfunc - Kernel to configure cache for \param config - Requested cache configuration \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT \notefnerr \sa ::cuCtxGetCacheConfig, ::cuCtxSetCacheConfig, ::cuFuncGetAttribute, ::cuLaunchKernel, ::cudaFuncSetCacheConfig, ::cuKernelSetCacheConfig*/ fn cuFuncSetCacheConfig( hfunc: cuda_types::cuda::CUfunction, config: cuda_types::cuda::CUfunc_cache, ) -> cuda_types::cuda::CUresult; /** \brief Returns a module handle Returns in \p *hmod the handle of the module that function \p hfunc is located in. The lifetime of the module corresponds to the lifetime of the context it was loaded in or until the module is explicitly unloaded. The CUDA runtime manages its own modules loaded into the primary context. If the handle returned by this API refers to a module loaded by the CUDA runtime, calling ::cuModuleUnload() on that module will result in undefined behavior. \param hmod - Returned module handle \param hfunc - Function to retrieve module for \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_FOUND \notefnerr */ fn cuFuncGetModule( hmod: *mut cuda_types::cuda::CUmodule, hfunc: cuda_types::cuda::CUfunction, ) -> cuda_types::cuda::CUresult; /** \brief Returns the function name for a ::CUfunction handle Returns in \p **name the function name associated with the function handle \p hfunc . The function name is returned as a null-terminated string. The returned name is only valid when the function handle is valid. If the module is unloaded or reloaded, one must call the API again to get the updated name. This API may return a mangled name if the function is not declared as having C linkage. If either \p **name or \p hfunc is NULL, ::CUDA_ERROR_INVALID_VALUE is returned. \param name - The returned name of the function \param hfunc - The function handle to retrieve the name for \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, \notefnerr */ fn cuFuncGetName( name: *mut *const ::core::ffi::c_char, hfunc: cuda_types::cuda::CUfunction, ) -> cuda_types::cuda::CUresult; /** \brief Returns the offset and size of a kernel parameter in the device-side parameter layout Queries the kernel parameter at \p paramIndex into \p func's list of parameters, and returns in \p paramOffset and \p paramSize the offset and size, respectively, where the parameter will reside in the device-side parameter layout. This information can be used to update kernel node parameters from the device via ::cudaGraphKernelNodeSetParam() and ::cudaGraphKernelNodeUpdatesApply(). \p paramIndex must be less than the number of parameters that \p func takes. \p paramSize can be set to NULL if only the parameter offset is desired. \param func - The function to query \param paramIndex - The parameter index to query \param paramOffset - Returns the offset into the device-side parameter layout at which the parameter resides \param paramSize - Optionally returns the size of the parameter in the device-side parameter layout \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, \notefnerr \sa ::cuKernelGetParamInfo*/ fn cuFuncGetParamInfo( func: cuda_types::cuda::CUfunction, paramIndex: usize, paramOffset: *mut usize, paramSize: *mut usize, ) -> cuda_types::cuda::CUresult; /** \brief Returns if the function is loaded Returns in \p state the loading state of \p function. \param state - returned loading state \param function - the function to check \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_INVALID_VALUE \sa ::cuFuncLoad, ::cuModuleEnumerateFunctions*/ fn cuFuncIsLoaded( state: *mut cuda_types::cuda::CUfunctionLoadingState, function: cuda_types::cuda::CUfunction, ) -> cuda_types::cuda::CUresult; /** \brief Loads a function Finalizes function loading for \p function. Calling this API with a fully loaded function has no effect. \param function - the function to load \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_INVALID_VALUE \sa ::cuModuleEnumerateFunctions, ::cuFuncIsLoaded*/ fn cuFuncLoad(function: cuda_types::cuda::CUfunction) -> cuda_types::cuda::CUresult; /** \brief Launches a CUDA function ::CUfunction or a CUDA kernel ::CUkernel Invokes the function ::CUfunction or the kernel ::CUkernel \p f on a \p gridDimX x \p gridDimY x \p gridDimZ grid of blocks. Each block contains \p blockDimX x \p blockDimY x \p blockDimZ threads. \p sharedMemBytes sets the amount of dynamic shared memory that will be available to each thread block. Kernel parameters to \p f can be specified in one of two ways: 1) Kernel parameters can be specified via \p kernelParams. If \p f has N parameters, then \p kernelParams needs to be an array of N pointers. Each of \p kernelParams[0] through \p kernelParams[N-1] must point to a region of memory from which the actual kernel parameter will be copied. The number of kernel parameters and their offsets and sizes do not need to be specified as that information is retrieved directly from the kernel's image. 2) Kernel parameters can also be packaged by the application into a single buffer that is passed in via the \p extra parameter. This places the burden on the application of knowing each kernel parameter's size and alignment/padding within the buffer. Here is an example of using the \p extra parameter in this manner: \code size_t argBufferSize; char argBuffer[256]; // populate argBuffer and argBufferSize void *config[] = { CU_LAUNCH_PARAM_BUFFER_POINTER, argBuffer, CU_LAUNCH_PARAM_BUFFER_SIZE, &argBufferSize, CU_LAUNCH_PARAM_END }; status = cuLaunchKernel(f, gx, gy, gz, bx, by, bz, sh, s, NULL, config); \endcode The \p extra parameter exists to allow ::cuLaunchKernel to take additional less commonly used arguments. \p extra specifies a list of names of extra settings and their corresponding values. Each extra setting name is immediately followed by the corresponding value. The list must be terminated with either NULL or ::CU_LAUNCH_PARAM_END. - ::CU_LAUNCH_PARAM_END, which indicates the end of the \p extra array; - ::CU_LAUNCH_PARAM_BUFFER_POINTER, which specifies that the next value in \p extra will be a pointer to a buffer containing all the kernel parameters for launching kernel \p f; - ::CU_LAUNCH_PARAM_BUFFER_SIZE, which specifies that the next value in \p extra will be a pointer to a size_t containing the size of the buffer specified with ::CU_LAUNCH_PARAM_BUFFER_POINTER; The error ::CUDA_ERROR_INVALID_VALUE will be returned if kernel parameters are specified with both \p kernelParams and \p extra (i.e. both \p kernelParams and \p extra are non-NULL). Calling ::cuLaunchKernel() invalidates the persistent function state set through the following deprecated APIs: ::cuFuncSetBlockShape(), ::cuFuncSetSharedSize(), ::cuParamSetSize(), ::cuParamSeti(), ::cuParamSetf(), ::cuParamSetv(). Note that to use ::cuLaunchKernel(), the kernel \p f must either have been compiled with toolchain version 3.2 or later so that it will contain kernel parameter information, or have no kernel parameters. If either of these conditions is not met, then ::cuLaunchKernel() will return ::CUDA_ERROR_INVALID_IMAGE. Note that the API can also be used to launch context-less kernel ::CUkernel by querying the handle using ::cuLibraryGetKernel() and then passing it to the API by casting to ::CUfunction. Here, the context to launch the kernel on will either be taken from the specified stream \p hStream or the current context in case of NULL stream. \param f - Function ::CUfunction or Kernel ::CUkernel to launch \param gridDimX - Width of grid in blocks \param gridDimY - Height of grid in blocks \param gridDimZ - Depth of grid in blocks \param blockDimX - X dimension of each thread block \param blockDimY - Y dimension of each thread block \param blockDimZ - Z dimension of each thread block \param sharedMemBytes - Dynamic shared-memory size per thread block in bytes \param hStream - Stream identifier \param kernelParams - Array of pointers to kernel parameters \param extra - Extra options \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_INVALID_IMAGE, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_LAUNCH_FAILED, ::CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES, ::CUDA_ERROR_LAUNCH_TIMEOUT, ::CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING, ::CUDA_ERROR_SHARED_OBJECT_INIT_FAILED, ::CUDA_ERROR_NOT_FOUND \note_null_stream \notefnerr \sa ::cuCtxGetCacheConfig, ::cuCtxSetCacheConfig, ::cuFuncSetCacheConfig, ::cuFuncGetAttribute, ::cudaLaunchKernel, ::cuLibraryGetKernel, ::cuKernelSetCacheConfig, ::cuKernelGetAttribute, ::cuKernelSetAttribute*/ fn cuLaunchKernel_ptsz( f: cuda_types::cuda::CUfunction, gridDimX: ::core::ffi::c_uint, gridDimY: ::core::ffi::c_uint, gridDimZ: ::core::ffi::c_uint, blockDimX: ::core::ffi::c_uint, blockDimY: ::core::ffi::c_uint, blockDimZ: ::core::ffi::c_uint, sharedMemBytes: ::core::ffi::c_uint, hStream: cuda_types::cuda::CUstream, kernelParams: *mut *mut ::core::ffi::c_void, extra: *mut *mut ::core::ffi::c_void, ) -> cuda_types::cuda::CUresult; /** \brief Launches a CUDA function ::CUfunction or a CUDA kernel ::CUkernel with launch-time configuration Invokes the function ::CUfunction or the kernel ::CUkernel \p f with the specified launch-time configuration \p config. The ::CUlaunchConfig structure is defined as: \code typedef struct CUlaunchConfig_st { unsigned int gridDimX; unsigned int gridDimY; unsigned int gridDimZ; unsigned int blockDimX; unsigned int blockDimY; unsigned int blockDimZ; unsigned int sharedMemBytes; CUstream hStream; CUlaunchAttribute *attrs; unsigned int numAttrs; } CUlaunchConfig; \endcode where: - ::CUlaunchConfig::gridDimX is the width of the grid in blocks. - ::CUlaunchConfig::gridDimY is the height of the grid in blocks. - ::CUlaunchConfig::gridDimZ is the depth of the grid in blocks. - ::CUlaunchConfig::blockDimX is the X dimension of each thread block. - ::CUlaunchConfig::blockDimX is the Y dimension of each thread block. - ::CUlaunchConfig::blockDimZ is the Z dimension of each thread block. - ::CUlaunchConfig::sharedMemBytes is the dynamic shared-memory size per thread block in bytes. - ::CUlaunchConfig::hStream is the handle to the stream to perform the launch in. The CUDA context associated with this stream must match that associated with function f. - ::CUlaunchConfig::attrs is an array of ::CUlaunchConfig::numAttrs continguous ::CUlaunchAttribute elements. The value of this pointer is not considered if ::CUlaunchConfig::numAttrs is zero. However, in that case, it is recommended to set the pointer to NULL. - ::CUlaunchConfig::numAttrs is the number of attributes populating the first ::CUlaunchConfig::numAttrs positions of the ::CUlaunchConfig::attrs array. Launch-time configuration is specified by adding entries to ::CUlaunchConfig::attrs. Each entry is an attribute ID and a corresponding attribute value. The ::CUlaunchAttribute structure is defined as: \code typedef struct CUlaunchAttribute_st { CUlaunchAttributeID id; CUlaunchAttributeValue value; } CUlaunchAttribute; \endcode where: - ::CUlaunchAttribute::id is a unique enum identifying the attribute. - ::CUlaunchAttribute::value is a union that hold the attribute value. An example of using the \p config parameter: \code CUlaunchAttribute coopAttr = {.id = CU_LAUNCH_ATTRIBUTE_COOPERATIVE, .value = 1}; CUlaunchConfig config = {... // set block and grid dimensions .attrs = &coopAttr, .numAttrs = 1}; cuLaunchKernelEx(&config, kernel, NULL, NULL); \endcode The ::CUlaunchAttributeID enum is defined as: \code typedef enum CUlaunchAttributeID_enum { CU_LAUNCH_ATTRIBUTE_IGNORE = 0, CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW = 1, CU_LAUNCH_ATTRIBUTE_COOPERATIVE = 2, CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY = 3, CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION = 4, CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE = 5, CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION = 6, CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT = 7, CU_LAUNCH_ATTRIBUTE_PRIORITY = 8, CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP = 9, CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN = 10, CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION = 11, CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT = 12, CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE = 13, } CUlaunchAttributeID; \endcode and the corresponding ::CUlaunchAttributeValue union as : \code typedef union CUlaunchAttributeValue_union { CUaccessPolicyWindow accessPolicyWindow; int cooperative; CUsynchronizationPolicy syncPolicy; struct { unsigned int x; unsigned int y; unsigned int z; } clusterDim; CUclusterSchedulingPolicy clusterSchedulingPolicyPreference; int programmaticStreamSerializationAllowed; struct { CUevent event; int flags; int triggerAtBlockStart; } programmaticEvent; int priority; CUlaunchMemSyncDomainMap memSyncDomainMap; CUlaunchMemSyncDomain memSyncDomain; struct { unsigned int x; unsigned int y; unsigned int z; } preferredClusterDim; struct { CUevent event; int flags; } launchCompletionEvent; struct { int deviceUpdatable; CUgraphDeviceNode devNode; } deviceUpdatableKernelNode; } CUlaunchAttributeValue; \endcode Setting ::CU_LAUNCH_ATTRIBUTE_COOPERATIVE to a non-zero value causes the kernel launch to be a cooperative launch, with exactly the same usage and semantics of ::cuLaunchCooperativeKernel. Setting ::CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION to a non-zero values causes the kernel to use programmatic means to resolve its stream dependency -- enabling the CUDA runtime to opportunistically allow the grid's execution to overlap with the previous kernel in the stream, if that kernel requests the overlap. ::CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT records an event along with the kernel launch. Event recorded through this launch attribute is guaranteed to only trigger after all block in the associated kernel trigger the event. A block can trigger the event through PTX launchdep.release or CUDA builtin function cudaTriggerProgrammaticLaunchCompletion(). A trigger can also be inserted at the beginning of each block's execution if triggerAtBlockStart is set to non-0. Note that dependents (including the CPU thread calling cuEventSynchronize()) are not guaranteed to observe the release precisely when it is released. For example, cuEventSynchronize() may only observe the event trigger long after the associated kernel has completed. This recording type is primarily meant for establishing programmatic dependency between device tasks. The event supplied must not be an interprocess or interop event. The event must disable timing (i.e. created with ::CU_EVENT_DISABLE_TIMING flag set). ::CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT records an event along with the kernel launch. Nominally, the event is triggered once all blocks of the kernel have begun execution. Currently this is a best effort. If a kernel B has a launch completion dependency on a kernel A, B may wait until A is complete. Alternatively, blocks of B may begin before all blocks of A have begun, for example: - If B can claim execution resources unavailable to A, for example if they run on different GPUs. - If B is a higher priority than A. Exercise caution if such an ordering inversion could lead to deadlock. The event supplied must not be an interprocess or interop event. The event must disable timing (i.e. must be created with the ::CU_EVENT_DISABLE_TIMING flag set). Setting ::CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE to 1 on a captured launch causes the resulting kernel node to be device-updatable. This attribute is specific to graphs, and passing it to a launch in a non-capturing stream results in an error. Passing a value other than 0 or 1 is not allowed. On success, a handle will be returned via ::CUlaunchAttributeValue::deviceUpdatableKernelNode::devNode which can be passed to the various device-side update functions to update the node's kernel parameters from within another kernel. For more information on the types of device updates that can be made, as well as the relevant limitations thereof, see ::cudaGraphKernelNodeUpdatesApply. Kernel nodes which are device-updatable have additional restrictions compared to regular kernel nodes. Firstly, device-updatable nodes cannot be removed from their graph via ::cuGraphDestroyNode. Additionally, once opted-in to this functionality, a node cannot opt out, and any attempt to set the attribute to 0 will result in an error. Graphs containing one or more device-updatable node also do not allow multiple instantiation. ::CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION allows the kernel launch to specify a preferred substitute cluster dimension. Blocks may be grouped according to either the dimensions specified with this attribute (grouped into a "preferred substitute cluster"), or the one specified with ::CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION attribute (grouped into a "regular cluster"). The cluster dimensions of a "preferred substitute cluster" shall be an integer multiple greater than zero of the regular cluster dimensions. The device will attempt - on a best-effort basis - to group thread blocks into preferred clusters over grouping them into regular clusters. When it deems necessary (primarily when the device temporarily runs out of physical resources to launch the larger preferred clusters), the device may switch to launch the regular clusters instead to attempt to utilize as much of the physical device resources as possible. Each type of cluster will have its enumeration / coordinate setup as if the grid consists solely of its type of cluster. For example, if the preferred substitute cluster dimensions double the regular cluster dimensions, there might be simultaneously a regular cluster indexed at (1,0,0), and a preferred cluster indexed at (1,0,0). In this example, the preferred substitute cluster (1,0,0) replaces regular clusters (2,0,0) and (3,0,0) and groups their blocks. This attribute will only take effect when a regular cluster dimension has been specified. The preferred substitute The preferred substitute cluster dimension must be an integer multiple greater than zero of the regular cluster dimension and must divide the grid. It must also be no more than `maxBlocksPerCluster`, if it is set in the kernel's `__launch_bounds__`. Otherwise it must be less than the maximum value the driver can support. Otherwise, setting this attribute to a value physically unable to fit on any particular device is permitted. The effect of other attributes is consistent with their effect when set via persistent APIs. See ::cuStreamSetAttribute for - ::CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW - ::CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY See ::cuFuncSetAttribute for - ::CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION - ::CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE Kernel parameters to \p f can be specified in the same ways that they can be using ::cuLaunchKernel. Note that the API can also be used to launch context-less kernel ::CUkernel by querying the handle using ::cuLibraryGetKernel() and then passing it to the API by casting to ::CUfunction. Here, the context to launch the kernel on will either be taken from the specified stream ::CUlaunchConfig::hStream or the current context in case of NULL stream. \param config - Config to launch \param f - Function ::CUfunction or Kernel ::CUkernel to launch \param kernelParams - Array of pointers to kernel parameters \param extra - Extra options \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_INVALID_IMAGE, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_LAUNCH_FAILED, ::CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES, ::CUDA_ERROR_LAUNCH_TIMEOUT, ::CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING, ::CUDA_ERROR_COOPERATIVE_LAUNCH_TOO_LARGE, ::CUDA_ERROR_SHARED_OBJECT_INIT_FAILED, ::CUDA_ERROR_NOT_FOUND \note_null_stream \notefnerr \sa ::cuCtxGetCacheConfig, ::cuCtxSetCacheConfig, ::cuFuncSetCacheConfig, ::cuFuncGetAttribute, ::cudaLaunchKernel, ::cudaLaunchKernelEx, ::cuLibraryGetKernel, ::cuKernelSetCacheConfig, ::cuKernelGetAttribute, ::cuKernelSetAttribute*/ fn cuLaunchKernelEx_ptsz( config: *const cuda_types::cuda::CUlaunchConfig, f: cuda_types::cuda::CUfunction, kernelParams: *mut *mut ::core::ffi::c_void, extra: *mut *mut ::core::ffi::c_void, ) -> cuda_types::cuda::CUresult; /** \brief Launches a CUDA function ::CUfunction or a CUDA kernel ::CUkernel where thread blocks can cooperate and synchronize as they execute Invokes the function ::CUfunction or the kernel ::CUkernel \p f on a \p gridDimX x \p gridDimY x \p gridDimZ grid of blocks. Each block contains \p blockDimX x \p blockDimY x \p blockDimZ threads. \p sharedMemBytes sets the amount of dynamic shared memory that will be available to each thread block. The device on which this kernel is invoked must have a non-zero value for the device attribute ::CU_DEVICE_ATTRIBUTE_COOPERATIVE_LAUNCH. The total number of blocks launched cannot exceed the maximum number of blocks per multiprocessor as returned by ::cuOccupancyMaxActiveBlocksPerMultiprocessor (or ::cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags) times the number of multiprocessors as specified by the device attribute ::CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT. The kernel cannot make use of CUDA dynamic parallelism. Kernel parameters must be specified via \p kernelParams. If \p f has N parameters, then \p kernelParams needs to be an array of N pointers. Each of \p kernelParams[0] through \p kernelParams[N-1] must point to a region of memory from which the actual kernel parameter will be copied. The number of kernel parameters and their offsets and sizes do not need to be specified as that information is retrieved directly from the kernel's image. Calling ::cuLaunchCooperativeKernel() sets persistent function state that is the same as function state set through ::cuLaunchKernel API When the kernel \p f is launched via ::cuLaunchCooperativeKernel(), the previous block shape, shared size and parameter info associated with \p f is overwritten. Note that to use ::cuLaunchCooperativeKernel(), the kernel \p f must either have been compiled with toolchain version 3.2 or later so that it will contain kernel parameter information, or have no kernel parameters. If either of these conditions is not met, then ::cuLaunchCooperativeKernel() will return ::CUDA_ERROR_INVALID_IMAGE. Note that the API can also be used to launch context-less kernel ::CUkernel by querying the handle using ::cuLibraryGetKernel() and then passing it to the API by casting to ::CUfunction. Here, the context to launch the kernel on will either be taken from the specified stream \p hStream or the current context in case of NULL stream. \param f - Function ::CUfunction or Kernel ::CUkernel to launch \param gridDimX - Width of grid in blocks \param gridDimY - Height of grid in blocks \param gridDimZ - Depth of grid in blocks \param blockDimX - X dimension of each thread block \param blockDimY - Y dimension of each thread block \param blockDimZ - Z dimension of each thread block \param sharedMemBytes - Dynamic shared-memory size per thread block in bytes \param hStream - Stream identifier \param kernelParams - Array of pointers to kernel parameters \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_INVALID_IMAGE, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_LAUNCH_FAILED, ::CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES, ::CUDA_ERROR_LAUNCH_TIMEOUT, ::CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING, ::CUDA_ERROR_COOPERATIVE_LAUNCH_TOO_LARGE, ::CUDA_ERROR_SHARED_OBJECT_INIT_FAILED, ::CUDA_ERROR_NOT_FOUND \note_null_stream \notefnerr \sa ::cuCtxGetCacheConfig, ::cuCtxSetCacheConfig, ::cuFuncSetCacheConfig, ::cuFuncGetAttribute, ::cuLaunchCooperativeKernelMultiDevice, ::cudaLaunchCooperativeKernel, ::cuLibraryGetKernel, ::cuKernelSetCacheConfig, ::cuKernelGetAttribute, ::cuKernelSetAttribute*/ fn cuLaunchCooperativeKernel_ptsz( f: cuda_types::cuda::CUfunction, gridDimX: ::core::ffi::c_uint, gridDimY: ::core::ffi::c_uint, gridDimZ: ::core::ffi::c_uint, blockDimX: ::core::ffi::c_uint, blockDimY: ::core::ffi::c_uint, blockDimZ: ::core::ffi::c_uint, sharedMemBytes: ::core::ffi::c_uint, hStream: cuda_types::cuda::CUstream, kernelParams: *mut *mut ::core::ffi::c_void, ) -> cuda_types::cuda::CUresult; /** \brief Launches CUDA functions on multiple devices where thread blocks can cooperate and synchronize as they execute \deprecated This function is deprecated as of CUDA 11.3. Invokes kernels as specified in the \p launchParamsList array where each element of the array specifies all the parameters required to perform a single kernel launch. These kernels can cooperate and synchronize as they execute. The size of the array is specified by \p numDevices. No two kernels can be launched on the same device. All the devices targeted by this multi-device launch must be identical. All devices must have a non-zero value for the device attribute ::CU_DEVICE_ATTRIBUTE_COOPERATIVE_MULTI_DEVICE_LAUNCH. All kernels launched must be identical with respect to the compiled code. Note that any __device__, __constant__ or __managed__ variables present in the module that owns the kernel launched on each device, are independently instantiated on every device. It is the application's responsibility to ensure these variables are initialized and used appropriately. The size of the grids as specified in blocks, the size of the blocks themselves and the amount of shared memory used by each thread block must also match across all launched kernels. The streams used to launch these kernels must have been created via either ::cuStreamCreate or ::cuStreamCreateWithPriority. The NULL stream or ::CU_STREAM_LEGACY or ::CU_STREAM_PER_THREAD cannot be used. The total number of blocks launched per kernel cannot exceed the maximum number of blocks per multiprocessor as returned by ::cuOccupancyMaxActiveBlocksPerMultiprocessor (or ::cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags) times the number of multiprocessors as specified by the device attribute ::CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT. Since the total number of blocks launched per device has to match across all devices, the maximum number of blocks that can be launched per device will be limited by the device with the least number of multiprocessors. The kernels cannot make use of CUDA dynamic parallelism. The ::CUDA_LAUNCH_PARAMS structure is defined as: \code typedef struct CUDA_LAUNCH_PARAMS_st { CUfunction function; unsigned int gridDimX; unsigned int gridDimY; unsigned int gridDimZ; unsigned int blockDimX; unsigned int blockDimY; unsigned int blockDimZ; unsigned int sharedMemBytes; CUstream hStream; void **kernelParams; } CUDA_LAUNCH_PARAMS; \endcode where: - ::CUDA_LAUNCH_PARAMS::function specifies the kernel to be launched. All functions must be identical with respect to the compiled code. Note that you can also specify context-less kernel ::CUkernel by querying the handle using ::cuLibraryGetKernel() and then casting to ::CUfunction. In this case, the context to launch the kernel on be taken from the specified stream ::CUDA_LAUNCH_PARAMS::hStream. - ::CUDA_LAUNCH_PARAMS::gridDimX is the width of the grid in blocks. This must match across all kernels launched. - ::CUDA_LAUNCH_PARAMS::gridDimY is the height of the grid in blocks. This must match across all kernels launched. - ::CUDA_LAUNCH_PARAMS::gridDimZ is the depth of the grid in blocks. This must match across all kernels launched. - ::CUDA_LAUNCH_PARAMS::blockDimX is the X dimension of each thread block. This must match across all kernels launched. - ::CUDA_LAUNCH_PARAMS::blockDimX is the Y dimension of each thread block. This must match across all kernels launched. - ::CUDA_LAUNCH_PARAMS::blockDimZ is the Z dimension of each thread block. This must match across all kernels launched. - ::CUDA_LAUNCH_PARAMS::sharedMemBytes is the dynamic shared-memory size per thread block in bytes. This must match across all kernels launched. - ::CUDA_LAUNCH_PARAMS::hStream is the handle to the stream to perform the launch in. This cannot be the NULL stream or ::CU_STREAM_LEGACY or ::CU_STREAM_PER_THREAD. The CUDA context associated with this stream must match that associated with ::CUDA_LAUNCH_PARAMS::function. - ::CUDA_LAUNCH_PARAMS::kernelParams is an array of pointers to kernel parameters. If ::CUDA_LAUNCH_PARAMS::function has N parameters, then ::CUDA_LAUNCH_PARAMS::kernelParams needs to be an array of N pointers. Each of ::CUDA_LAUNCH_PARAMS::kernelParams[0] through ::CUDA_LAUNCH_PARAMS::kernelParams[N-1] must point to a region of memory from which the actual kernel parameter will be copied. The number of kernel parameters and their offsets and sizes do not need to be specified as that information is retrieved directly from the kernel's image. By default, the kernel won't begin execution on any GPU until all prior work in all the specified streams has completed. This behavior can be overridden by specifying the flag ::CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_PRE_LAUNCH_SYNC. When this flag is specified, each kernel will only wait for prior work in the stream corresponding to that GPU to complete before it begins execution. Similarly, by default, any subsequent work pushed in any of the specified streams will not begin execution until the kernels on all GPUs have completed. This behavior can be overridden by specifying the flag ::CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_POST_LAUNCH_SYNC. When this flag is specified, any subsequent work pushed in any of the specified streams will only wait for the kernel launched on the GPU corresponding to that stream to complete before it begins execution. Calling ::cuLaunchCooperativeKernelMultiDevice() sets persistent function state that is the same as function state set through ::cuLaunchKernel API when called individually for each element in \p launchParamsList. When kernels are launched via ::cuLaunchCooperativeKernelMultiDevice(), the previous block shape, shared size and parameter info associated with each ::CUDA_LAUNCH_PARAMS::function in \p launchParamsList is overwritten. Note that to use ::cuLaunchCooperativeKernelMultiDevice(), the kernels must either have been compiled with toolchain version 3.2 or later so that it will contain kernel parameter information, or have no kernel parameters. If either of these conditions is not met, then ::cuLaunchCooperativeKernelMultiDevice() will return ::CUDA_ERROR_INVALID_IMAGE. \param launchParamsList - List of launch parameters, one per device \param numDevices - Size of the \p launchParamsList array \param flags - Flags to control launch behavior \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_INVALID_IMAGE, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_LAUNCH_FAILED, ::CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES, ::CUDA_ERROR_LAUNCH_TIMEOUT, ::CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING, ::CUDA_ERROR_COOPERATIVE_LAUNCH_TOO_LARGE, ::CUDA_ERROR_SHARED_OBJECT_INIT_FAILED \note_null_stream \notefnerr \sa ::cuCtxGetCacheConfig, ::cuCtxSetCacheConfig, ::cuFuncSetCacheConfig, ::cuFuncGetAttribute, ::cuLaunchCooperativeKernel, ::cudaLaunchCooperativeKernelMultiDevice*/ fn cuLaunchCooperativeKernelMultiDevice( launchParamsList: *mut cuda_types::cuda::CUDA_LAUNCH_PARAMS, numDevices: ::core::ffi::c_uint, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Enqueues a host function call in a stream Enqueues a host function to run in a stream. The function will be called after currently enqueued work and will block work added after it. The host function must not make any CUDA API calls. Attempting to use a CUDA API may result in ::CUDA_ERROR_NOT_PERMITTED, but this is not required. The host function must not perform any synchronization that may depend on outstanding CUDA work not mandated to run earlier. Host functions without a mandated order (such as in independent streams) execute in undefined order and may be serialized. For the purposes of Unified Memory, execution makes a number of guarantees:
  • The stream is considered idle for the duration of the function's execution. Thus, for example, the function may always use memory attached to the stream it was enqueued in.
  • The start of execution of the function has the same effect as synchronizing an event recorded in the same stream immediately prior to the function. It thus synchronizes streams which have been "joined" prior to the function.
  • Adding device work to any stream does not have the effect of making the stream active until all preceding host functions and stream callbacks have executed. Thus, for example, a function might use global attached memory even if work has been added to another stream, if the work has been ordered behind the function call with an event.
  • Completion of the function does not cause a stream to become active except as described above. The stream will remain idle if no device work follows the function, and will remain idle across consecutive host functions or stream callbacks without device work in between. Thus, for example, stream synchronization can be done by signaling from a host function at the end of the stream.
Note that, in contrast to ::cuStreamAddCallback, the function will not be called in the event of an error in the CUDA context. \param hStream - Stream to enqueue function call in \param fn - The function to call once preceding stream operations are complete \param userData - User-specified data to be passed to the function \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_NOT_SUPPORTED \note_null_stream \notefnerr \sa ::cuStreamCreate, ::cuStreamQuery, ::cuStreamSynchronize, ::cuStreamWaitEvent, ::cuStreamDestroy, ::cuMemAllocManaged, ::cuStreamAttachMemAsync, ::cuStreamAddCallback*/ fn cuLaunchHostFunc_ptsz( hStream: cuda_types::cuda::CUstream, fn_: cuda_types::cuda::CUhostFn, userData: *mut ::core::ffi::c_void, ) -> cuda_types::cuda::CUresult; /** \brief Sets the block-dimensions for the function \deprecated Specifies the \p x, \p y, and \p z dimensions of the thread blocks that are created when the kernel given by \p hfunc is launched. \param hfunc - Kernel to specify dimensions of \param x - X dimension \param y - Y dimension \param z - Z dimension \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuFuncSetSharedSize, ::cuFuncSetCacheConfig, ::cuFuncGetAttribute, ::cuParamSetSize, ::cuParamSeti, ::cuParamSetf, ::cuParamSetv, ::cuLaunch, ::cuLaunchGrid, ::cuLaunchGridAsync, ::cuLaunchKernel*/ fn cuFuncSetBlockShape( hfunc: cuda_types::cuda::CUfunction, x: ::core::ffi::c_int, y: ::core::ffi::c_int, z: ::core::ffi::c_int, ) -> cuda_types::cuda::CUresult; /** \brief Sets the dynamic shared-memory size for the function \deprecated Sets through \p bytes the amount of dynamic shared memory that will be available to each thread block when the kernel given by \p hfunc is launched. \param hfunc - Kernel to specify dynamic shared-memory size for \param bytes - Dynamic shared-memory size per thread in bytes \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuFuncSetBlockShape, ::cuFuncSetCacheConfig, ::cuFuncGetAttribute, ::cuParamSetSize, ::cuParamSeti, ::cuParamSetf, ::cuParamSetv, ::cuLaunch, ::cuLaunchGrid, ::cuLaunchGridAsync, ::cuLaunchKernel*/ fn cuFuncSetSharedSize( hfunc: cuda_types::cuda::CUfunction, bytes: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Sets the parameter size for the function \deprecated Sets through \p numbytes the total size in bytes needed by the function parameters of the kernel corresponding to \p hfunc. \param hfunc - Kernel to set parameter size for \param numbytes - Size of parameter list in bytes \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuFuncSetBlockShape, ::cuFuncSetSharedSize, ::cuFuncGetAttribute, ::cuParamSetf, ::cuParamSeti, ::cuParamSetv, ::cuLaunch, ::cuLaunchGrid, ::cuLaunchGridAsync, ::cuLaunchKernel*/ fn cuParamSetSize( hfunc: cuda_types::cuda::CUfunction, numbytes: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Adds an integer parameter to the function's argument list \deprecated Sets an integer parameter that will be specified the next time the kernel corresponding to \p hfunc will be invoked. \p offset is a byte offset. \param hfunc - Kernel to add parameter to \param offset - Offset to add parameter to argument list \param value - Value of parameter \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuFuncSetBlockShape, ::cuFuncSetSharedSize, ::cuFuncGetAttribute, ::cuParamSetSize, ::cuParamSetf, ::cuParamSetv, ::cuLaunch, ::cuLaunchGrid, ::cuLaunchGridAsync, ::cuLaunchKernel*/ fn cuParamSeti( hfunc: cuda_types::cuda::CUfunction, offset: ::core::ffi::c_int, value: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Adds a floating-point parameter to the function's argument list \deprecated Sets a floating-point parameter that will be specified the next time the kernel corresponding to \p hfunc will be invoked. \p offset is a byte offset. \param hfunc - Kernel to add parameter to \param offset - Offset to add parameter to argument list \param value - Value of parameter \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuFuncSetBlockShape, ::cuFuncSetSharedSize, ::cuFuncGetAttribute, ::cuParamSetSize, ::cuParamSeti, ::cuParamSetv, ::cuLaunch, ::cuLaunchGrid, ::cuLaunchGridAsync, ::cuLaunchKernel*/ fn cuParamSetf( hfunc: cuda_types::cuda::CUfunction, offset: ::core::ffi::c_int, value: f32, ) -> cuda_types::cuda::CUresult; /** \brief Adds arbitrary data to the function's argument list \deprecated Copies an arbitrary amount of data (specified in \p numbytes) from \p ptr into the parameter space of the kernel corresponding to \p hfunc. \p offset is a byte offset. \param hfunc - Kernel to add data to \param offset - Offset to add data to argument list \param ptr - Pointer to arbitrary data \param numbytes - Size of data to copy in bytes \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuFuncSetBlockShape, ::cuFuncSetSharedSize, ::cuFuncGetAttribute, ::cuParamSetSize, ::cuParamSetf, ::cuParamSeti, ::cuLaunch, ::cuLaunchGrid, ::cuLaunchGridAsync, ::cuLaunchKernel*/ fn cuParamSetv( hfunc: cuda_types::cuda::CUfunction, offset: ::core::ffi::c_int, ptr: *mut ::core::ffi::c_void, numbytes: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Launches a CUDA function \deprecated Invokes the kernel \p f on a 1 x 1 x 1 grid of blocks. The block contains the number of threads specified by a previous call to ::cuFuncSetBlockShape(). The block shape, dynamic shared memory size, and parameter information must be set using ::cuFuncSetBlockShape(), ::cuFuncSetSharedSize(), ::cuParamSetSize(), ::cuParamSeti(), ::cuParamSetf(), and ::cuParamSetv() prior to calling this function. Launching a function via ::cuLaunchKernel() invalidates the function's block shape, dynamic shared memory size, and parameter information. After launching via cuLaunchKernel, this state must be re-initialized prior to calling this function. Failure to do so results in undefined behavior. \param f - Kernel to launch \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_LAUNCH_FAILED, ::CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES, ::CUDA_ERROR_LAUNCH_TIMEOUT, ::CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING, ::CUDA_ERROR_SHARED_OBJECT_INIT_FAILED \notefnerr \sa ::cuFuncSetBlockShape, ::cuFuncSetSharedSize, ::cuFuncGetAttribute, ::cuParamSetSize, ::cuParamSetf, ::cuParamSeti, ::cuParamSetv, ::cuLaunchGrid, ::cuLaunchGridAsync, ::cuLaunchKernel*/ fn cuLaunch(f: cuda_types::cuda::CUfunction) -> cuda_types::cuda::CUresult; /** \brief Launches a CUDA function \deprecated Invokes the kernel \p f on a \p grid_width x \p grid_height grid of blocks. Each block contains the number of threads specified by a previous call to ::cuFuncSetBlockShape(). The block shape, dynamic shared memory size, and parameter information must be set using ::cuFuncSetBlockShape(), ::cuFuncSetSharedSize(), ::cuParamSetSize(), ::cuParamSeti(), ::cuParamSetf(), and ::cuParamSetv() prior to calling this function. Launching a function via ::cuLaunchKernel() invalidates the function's block shape, dynamic shared memory size, and parameter information. After launching via cuLaunchKernel, this state must be re-initialized prior to calling this function. Failure to do so results in undefined behavior. \param f - Kernel to launch \param grid_width - Width of grid in blocks \param grid_height - Height of grid in blocks \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_LAUNCH_FAILED, ::CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES, ::CUDA_ERROR_LAUNCH_TIMEOUT, ::CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING, ::CUDA_ERROR_SHARED_OBJECT_INIT_FAILED \notefnerr \sa ::cuFuncSetBlockShape, ::cuFuncSetSharedSize, ::cuFuncGetAttribute, ::cuParamSetSize, ::cuParamSetf, ::cuParamSeti, ::cuParamSetv, ::cuLaunch, ::cuLaunchGridAsync, ::cuLaunchKernel*/ fn cuLaunchGrid( f: cuda_types::cuda::CUfunction, grid_width: ::core::ffi::c_int, grid_height: ::core::ffi::c_int, ) -> cuda_types::cuda::CUresult; /** \brief Launches a CUDA function \deprecated Invokes the kernel \p f on a \p grid_width x \p grid_height grid of blocks. Each block contains the number of threads specified by a previous call to ::cuFuncSetBlockShape(). The block shape, dynamic shared memory size, and parameter information must be set using ::cuFuncSetBlockShape(), ::cuFuncSetSharedSize(), ::cuParamSetSize(), ::cuParamSeti(), ::cuParamSetf(), and ::cuParamSetv() prior to calling this function. Launching a function via ::cuLaunchKernel() invalidates the function's block shape, dynamic shared memory size, and parameter information. After launching via cuLaunchKernel, this state must be re-initialized prior to calling this function. Failure to do so results in undefined behavior. \param f - Kernel to launch \param grid_width - Width of grid in blocks \param grid_height - Height of grid in blocks \param hStream - Stream identifier \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_LAUNCH_FAILED, ::CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES, ::CUDA_ERROR_LAUNCH_TIMEOUT, ::CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING, ::CUDA_ERROR_SHARED_OBJECT_INIT_FAILED \note In certain cases where cubins are created with no ABI (i.e., using \p ptxas \p --abi-compile \p no), this function may serialize kernel launches. The CUDA driver retains asynchronous behavior by growing the per-thread stack as needed per launch and not shrinking it afterwards. \note_null_stream \notefnerr \sa ::cuFuncSetBlockShape, ::cuFuncSetSharedSize, ::cuFuncGetAttribute, ::cuParamSetSize, ::cuParamSetf, ::cuParamSeti, ::cuParamSetv, ::cuLaunch, ::cuLaunchGrid, ::cuLaunchKernel*/ fn cuLaunchGridAsync( f: cuda_types::cuda::CUfunction, grid_width: ::core::ffi::c_int, grid_height: ::core::ffi::c_int, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Adds a texture-reference to the function's argument list \deprecated Makes the CUDA array or linear memory bound to the texture reference \p hTexRef available to a device program as a texture. In this version of CUDA, the texture-reference must be obtained via ::cuModuleGetTexRef() and the \p texunit parameter must be set to ::CU_PARAM_TR_DEFAULT. \param hfunc - Kernel to add texture-reference to \param texunit - Texture unit (must be ::CU_PARAM_TR_DEFAULT) \param hTexRef - Texture-reference to add to argument list \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr*/ fn cuParamSetTexRef( hfunc: cuda_types::cuda::CUfunction, texunit: ::core::ffi::c_int, hTexRef: cuda_types::cuda::CUtexref, ) -> cuda_types::cuda::CUresult; /** \brief Sets the shared memory configuration for a device function. \deprecated On devices with configurable shared memory banks, this function will force all subsequent launches of the specified device function to have the given shared memory bank size configuration. On any given launch of the function, the shared memory configuration of the device will be temporarily changed if needed to suit the function's preferred configuration. Changes in shared memory configuration between subsequent launches of functions, may introduce a device side synchronization point. Any per-function setting of shared memory bank size set via ::cuFuncSetSharedMemConfig will override the context wide setting set with ::cuCtxSetSharedMemConfig. Changing the shared memory bank size will not increase shared memory usage or affect occupancy of kernels, but may have major effects on performance. Larger bank sizes will allow for greater potential bandwidth to shared memory, but will change what kinds of accesses to shared memory will result in bank conflicts. This function will do nothing on devices with fixed shared memory bank size. The supported bank configurations are: - ::CU_SHARED_MEM_CONFIG_DEFAULT_BANK_SIZE: use the context's shared memory configuration when launching this function. - ::CU_SHARED_MEM_CONFIG_FOUR_BYTE_BANK_SIZE: set shared memory bank width to be natively four bytes when launching this function. - ::CU_SHARED_MEM_CONFIG_EIGHT_BYTE_BANK_SIZE: set shared memory bank width to be natively eight bytes when launching this function. \param hfunc - kernel to be given a shared memory config \param config - requested shared memory configuration \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT \notefnerr \sa ::cuCtxGetCacheConfig, ::cuCtxSetCacheConfig, ::cuCtxGetSharedMemConfig, ::cuCtxSetSharedMemConfig, ::cuFuncGetAttribute, ::cuLaunchKernel, ::cudaFuncSetSharedMemConfig*/ fn cuFuncSetSharedMemConfig( hfunc: cuda_types::cuda::CUfunction, config: cuda_types::cuda::CUsharedconfig, ) -> cuda_types::cuda::CUresult; /** \brief Creates a graph Creates an empty graph, which is returned via \p phGraph. \param phGraph - Returns newly created graph \param flags - Graph creation flags, must be 0 \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_OUT_OF_MEMORY \note_graph_thread_safety \notefnerr \sa ::cuGraphAddChildGraphNode, ::cuGraphAddEmptyNode, ::cuGraphAddKernelNode, ::cuGraphAddHostNode, ::cuGraphAddMemcpyNode, ::cuGraphAddMemsetNode, ::cuGraphInstantiate, ::cuGraphDestroy, ::cuGraphGetNodes, ::cuGraphGetRootNodes, ::cuGraphGetEdges, ::cuGraphClone*/ fn cuGraphCreate( phGraph: *mut cuda_types::cuda::CUgraph, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Creates a kernel execution node and adds it to a graph Creates a new kernel execution node and adds it to \p hGraph with \p numDependencies dependencies specified via \p dependencies and arguments specified in \p nodeParams. It is possible for \p numDependencies to be 0, in which case the node will be placed at the root of the graph. \p dependencies may not have any duplicate entries. A handle to the new node will be returned in \p phGraphNode. The CUDA_KERNEL_NODE_PARAMS structure is defined as: \code typedef struct CUDA_KERNEL_NODE_PARAMS_st { CUfunction func; unsigned int gridDimX; unsigned int gridDimY; unsigned int gridDimZ; unsigned int blockDimX; unsigned int blockDimY; unsigned int blockDimZ; unsigned int sharedMemBytes; void **kernelParams; void **extra; CUkernel kern; CUcontext ctx; } CUDA_KERNEL_NODE_PARAMS; \endcode When the graph is launched, the node will invoke kernel \p func on a (\p gridDimX x \p gridDimY x \p gridDimZ) grid of blocks. Each block contains (\p blockDimX x \p blockDimY x \p blockDimZ) threads. \p sharedMemBytes sets the amount of dynamic shared memory that will be available to each thread block. Kernel parameters to \p func can be specified in one of two ways: 1) Kernel parameters can be specified via \p kernelParams. If the kernel has N parameters, then \p kernelParams needs to be an array of N pointers. Each pointer, from \p kernelParams[0] to \p kernelParams[N-1], points to the region of memory from which the actual parameter will be copied. The number of kernel parameters and their offsets and sizes do not need to be specified as that information is retrieved directly from the kernel's image. 2) Kernel parameters for non-cooperative kernels can also be packaged by the application into a single buffer that is passed in via \p extra. This places the burden on the application of knowing each kernel parameter's size and alignment/padding within the buffer. The \p extra parameter exists to allow this function to take additional less commonly used arguments. \p extra specifies a list of names of extra settings and their corresponding values. Each extra setting name is immediately followed by the corresponding value. The list must be terminated with either NULL or CU_LAUNCH_PARAM_END. - ::CU_LAUNCH_PARAM_END, which indicates the end of the \p extra array; - ::CU_LAUNCH_PARAM_BUFFER_POINTER, which specifies that the next value in \p extra will be a pointer to a buffer containing all the kernel parameters for launching kernel \p func; - ::CU_LAUNCH_PARAM_BUFFER_SIZE, which specifies that the next value in \p extra will be a pointer to a size_t containing the size of the buffer specified with ::CU_LAUNCH_PARAM_BUFFER_POINTER; The error ::CUDA_ERROR_INVALID_VALUE will be returned if kernel parameters are specified with both \p kernelParams and \p extra (i.e. both \p kernelParams and \p extra are non-NULL). ::CUDA_ERROR_INVALID_VALUE will be returned if \p extra is used for a cooperative kernel. The \p kernelParams or \p extra array, as well as the argument values it points to, are copied during this call. \note Kernels launched using graphs must not use texture and surface references. Reading or writing through any texture or surface reference is undefined behavior. This restriction does not apply to texture and surface objects. \param phGraphNode - Returns newly created node \param hGraph - Graph to which to add the node \param dependencies - Dependencies of the node \param numDependencies - Number of dependencies \param nodeParams - Parameters for the GPU execution node \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuGraphAddNode, ::cuLaunchKernel, ::cuLaunchCooperativeKernel, ::cuGraphKernelNodeGetParams, ::cuGraphKernelNodeSetParams, ::cuGraphCreate, ::cuGraphDestroyNode, ::cuGraphAddChildGraphNode, ::cuGraphAddEmptyNode, ::cuGraphAddHostNode, ::cuGraphAddMemcpyNode, ::cuGraphAddMemsetNode*/ fn cuGraphAddKernelNode_v2( phGraphNode: *mut cuda_types::cuda::CUgraphNode, hGraph: cuda_types::cuda::CUgraph, dependencies: *const cuda_types::cuda::CUgraphNode, numDependencies: usize, nodeParams: *const cuda_types::cuda::CUDA_KERNEL_NODE_PARAMS, ) -> cuda_types::cuda::CUresult; /** \brief Returns a kernel node's parameters Returns the parameters of kernel node \p hNode in \p nodeParams. The \p kernelParams or \p extra array returned in \p nodeParams, as well as the argument values it points to, are owned by the node. This memory remains valid until the node is destroyed or its parameters are modified, and should not be modified directly. Use ::cuGraphKernelNodeSetParams to update the parameters of this node. The params will contain either \p kernelParams or \p extra, according to which of these was most recently set on the node. \param hNode - Node to get the parameters for \param nodeParams - Pointer to return the parameters \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuLaunchKernel, ::cuGraphAddKernelNode, ::cuGraphKernelNodeSetParams*/ fn cuGraphKernelNodeGetParams_v2( hNode: cuda_types::cuda::CUgraphNode, nodeParams: *mut cuda_types::cuda::CUDA_KERNEL_NODE_PARAMS, ) -> cuda_types::cuda::CUresult; /** \brief Sets a kernel node's parameters Sets the parameters of kernel node \p hNode to \p nodeParams. \param hNode - Node to set the parameters for \param nodeParams - Parameters to copy \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_OUT_OF_MEMORY \note_graph_thread_safety \notefnerr \sa ::cuGraphNodeSetParams, ::cuLaunchKernel, ::cuGraphAddKernelNode, ::cuGraphKernelNodeGetParams*/ fn cuGraphKernelNodeSetParams_v2( hNode: cuda_types::cuda::CUgraphNode, nodeParams: *const cuda_types::cuda::CUDA_KERNEL_NODE_PARAMS, ) -> cuda_types::cuda::CUresult; /** \brief Creates a memcpy node and adds it to a graph Creates a new memcpy node and adds it to \p hGraph with \p numDependencies dependencies specified via \p dependencies. It is possible for \p numDependencies to be 0, in which case the node will be placed at the root of the graph. \p dependencies may not have any duplicate entries. A handle to the new node will be returned in \p phGraphNode. When the graph is launched, the node will perform the memcpy described by \p copyParams. See ::cuMemcpy3D() for a description of the structure and its restrictions. Memcpy nodes have some additional restrictions with regards to managed memory, if the system contains at least one device which has a zero value for the device attribute ::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS. If one or more of the operands refer to managed memory, then using the memory type ::CU_MEMORYTYPE_UNIFIED is disallowed for those operand(s). The managed memory will be treated as residing on either the host or the device, depending on which memory type is specified. \param phGraphNode - Returns newly created node \param hGraph - Graph to which to add the node \param dependencies - Dependencies of the node \param numDependencies - Number of dependencies \param copyParams - Parameters for the memory copy \param ctx - Context on which to run the node \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuGraphAddNode, ::cuMemcpy3D, ::cuGraphMemcpyNodeGetParams, ::cuGraphMemcpyNodeSetParams, ::cuGraphCreate, ::cuGraphDestroyNode, ::cuGraphAddChildGraphNode, ::cuGraphAddEmptyNode, ::cuGraphAddKernelNode, ::cuGraphAddHostNode, ::cuGraphAddMemsetNode*/ fn cuGraphAddMemcpyNode( phGraphNode: *mut cuda_types::cuda::CUgraphNode, hGraph: cuda_types::cuda::CUgraph, dependencies: *const cuda_types::cuda::CUgraphNode, numDependencies: usize, copyParams: *const cuda_types::cuda::CUDA_MEMCPY3D, ctx: cuda_types::cuda::CUcontext, ) -> cuda_types::cuda::CUresult; /** \brief Returns a memcpy node's parameters Returns the parameters of memcpy node \p hNode in \p nodeParams. \param hNode - Node to get the parameters for \param nodeParams - Pointer to return the parameters \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuMemcpy3D, ::cuGraphAddMemcpyNode, ::cuGraphMemcpyNodeSetParams*/ fn cuGraphMemcpyNodeGetParams( hNode: cuda_types::cuda::CUgraphNode, nodeParams: *mut cuda_types::cuda::CUDA_MEMCPY3D, ) -> cuda_types::cuda::CUresult; /** \brief Sets a memcpy node's parameters Sets the parameters of memcpy node \p hNode to \p nodeParams. \param hNode - Node to set the parameters for \param nodeParams - Parameters to copy \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE, \note_graph_thread_safety \notefnerr \sa ::cuGraphNodeSetParams, ::cuMemcpy3D, ::cuGraphAddMemcpyNode, ::cuGraphMemcpyNodeGetParams*/ fn cuGraphMemcpyNodeSetParams( hNode: cuda_types::cuda::CUgraphNode, nodeParams: *const cuda_types::cuda::CUDA_MEMCPY3D, ) -> cuda_types::cuda::CUresult; /** \brief Creates a memset node and adds it to a graph Creates a new memset node and adds it to \p hGraph with \p numDependencies dependencies specified via \p dependencies. It is possible for \p numDependencies to be 0, in which case the node will be placed at the root of the graph. \p dependencies may not have any duplicate entries. A handle to the new node will be returned in \p phGraphNode. The element size must be 1, 2, or 4 bytes. When the graph is launched, the node will perform the memset described by \p memsetParams. \param phGraphNode - Returns newly created node \param hGraph - Graph to which to add the node \param dependencies - Dependencies of the node \param numDependencies - Number of dependencies \param memsetParams - Parameters for the memory set \param ctx - Context on which to run the node \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_CONTEXT \note_graph_thread_safety \notefnerr \sa ::cuGraphAddNode, ::cuMemsetD2D32, ::cuGraphMemsetNodeGetParams, ::cuGraphMemsetNodeSetParams, ::cuGraphCreate, ::cuGraphDestroyNode, ::cuGraphAddChildGraphNode, ::cuGraphAddEmptyNode, ::cuGraphAddKernelNode, ::cuGraphAddHostNode, ::cuGraphAddMemcpyNode*/ fn cuGraphAddMemsetNode( phGraphNode: *mut cuda_types::cuda::CUgraphNode, hGraph: cuda_types::cuda::CUgraph, dependencies: *const cuda_types::cuda::CUgraphNode, numDependencies: usize, memsetParams: *const cuda_types::cuda::CUDA_MEMSET_NODE_PARAMS, ctx: cuda_types::cuda::CUcontext, ) -> cuda_types::cuda::CUresult; /** \brief Returns a memset node's parameters Returns the parameters of memset node \p hNode in \p nodeParams. \param hNode - Node to get the parameters for \param nodeParams - Pointer to return the parameters \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuMemsetD2D32, ::cuGraphAddMemsetNode, ::cuGraphMemsetNodeSetParams*/ fn cuGraphMemsetNodeGetParams( hNode: cuda_types::cuda::CUgraphNode, nodeParams: *mut cuda_types::cuda::CUDA_MEMSET_NODE_PARAMS, ) -> cuda_types::cuda::CUresult; /** \brief Sets a memset node's parameters Sets the parameters of memset node \p hNode to \p nodeParams. \param hNode - Node to set the parameters for \param nodeParams - Parameters to copy \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuGraphNodeSetParams, ::cuMemsetD2D32, ::cuGraphAddMemsetNode, ::cuGraphMemsetNodeGetParams*/ fn cuGraphMemsetNodeSetParams( hNode: cuda_types::cuda::CUgraphNode, nodeParams: *const cuda_types::cuda::CUDA_MEMSET_NODE_PARAMS, ) -> cuda_types::cuda::CUresult; /** \brief Creates a host execution node and adds it to a graph Creates a new CPU execution node and adds it to \p hGraph with \p numDependencies dependencies specified via \p dependencies and arguments specified in \p nodeParams. It is possible for \p numDependencies to be 0, in which case the node will be placed at the root of the graph. \p dependencies may not have any duplicate entries. A handle to the new node will be returned in \p phGraphNode. When the graph is launched, the node will invoke the specified CPU function. Host nodes are not supported under MPS with pre-Volta GPUs. \param phGraphNode - Returns newly created node \param hGraph - Graph to which to add the node \param dependencies - Dependencies of the node \param numDependencies - Number of dependencies \param nodeParams - Parameters for the host node \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_NOT_SUPPORTED, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuGraphAddNode, ::cuLaunchHostFunc, ::cuGraphHostNodeGetParams, ::cuGraphHostNodeSetParams, ::cuGraphCreate, ::cuGraphDestroyNode, ::cuGraphAddChildGraphNode, ::cuGraphAddEmptyNode, ::cuGraphAddKernelNode, ::cuGraphAddMemcpyNode, ::cuGraphAddMemsetNode*/ fn cuGraphAddHostNode( phGraphNode: *mut cuda_types::cuda::CUgraphNode, hGraph: cuda_types::cuda::CUgraph, dependencies: *const cuda_types::cuda::CUgraphNode, numDependencies: usize, nodeParams: *const cuda_types::cuda::CUDA_HOST_NODE_PARAMS, ) -> cuda_types::cuda::CUresult; /** \brief Returns a host node's parameters Returns the parameters of host node \p hNode in \p nodeParams. \param hNode - Node to get the parameters for \param nodeParams - Pointer to return the parameters \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuLaunchHostFunc, ::cuGraphAddHostNode, ::cuGraphHostNodeSetParams*/ fn cuGraphHostNodeGetParams( hNode: cuda_types::cuda::CUgraphNode, nodeParams: *mut cuda_types::cuda::CUDA_HOST_NODE_PARAMS, ) -> cuda_types::cuda::CUresult; /** \brief Sets a host node's parameters Sets the parameters of host node \p hNode to \p nodeParams. \param hNode - Node to set the parameters for \param nodeParams - Parameters to copy \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuGraphNodeSetParams, ::cuLaunchHostFunc, ::cuGraphAddHostNode, ::cuGraphHostNodeGetParams*/ fn cuGraphHostNodeSetParams( hNode: cuda_types::cuda::CUgraphNode, nodeParams: *const cuda_types::cuda::CUDA_HOST_NODE_PARAMS, ) -> cuda_types::cuda::CUresult; /** \brief Creates a child graph node and adds it to a graph Creates a new node which executes an embedded graph, and adds it to \p hGraph with \p numDependencies dependencies specified via \p dependencies. It is possible for \p numDependencies to be 0, in which case the node will be placed at the root of the graph. \p dependencies may not have any duplicate entries. A handle to the new node will be returned in \p phGraphNode. If \p childGraph contains allocation nodes, free nodes, or conditional nodes, this call will return an error. The node executes an embedded child graph. The child graph is cloned in this call. \param phGraphNode - Returns newly created node \param hGraph - Graph to which to add the node \param dependencies - Dependencies of the node \param numDependencies - Number of dependencies \param childGraph - The graph to clone into this node \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE, \note_graph_thread_safety \notefnerr \sa ::cuGraphAddNode, ::cuGraphChildGraphNodeGetGraph, ::cuGraphCreate, ::cuGraphDestroyNode, ::cuGraphAddEmptyNode, ::cuGraphAddKernelNode, ::cuGraphAddHostNode, ::cuGraphAddMemcpyNode, ::cuGraphAddMemsetNode, ::cuGraphClone*/ fn cuGraphAddChildGraphNode( phGraphNode: *mut cuda_types::cuda::CUgraphNode, hGraph: cuda_types::cuda::CUgraph, dependencies: *const cuda_types::cuda::CUgraphNode, numDependencies: usize, childGraph: cuda_types::cuda::CUgraph, ) -> cuda_types::cuda::CUresult; /** \brief Gets a handle to the embedded graph of a child graph node Gets a handle to the embedded graph in a child graph node. This call does not clone the graph. Changes to the graph will be reflected in the node, and the node retains ownership of the graph. Allocation and free nodes cannot be added to the returned graph. Attempting to do so will return an error. \param hNode - Node to get the embedded graph for \param phGraph - Location to store a handle to the graph \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE, \note_graph_thread_safety \notefnerr \sa ::cuGraphAddChildGraphNode, ::cuGraphNodeFindInClone*/ fn cuGraphChildGraphNodeGetGraph( hNode: cuda_types::cuda::CUgraphNode, phGraph: *mut cuda_types::cuda::CUgraph, ) -> cuda_types::cuda::CUresult; /** \brief Creates an empty node and adds it to a graph Creates a new node which performs no operation, and adds it to \p hGraph with \p numDependencies dependencies specified via \p dependencies. It is possible for \p numDependencies to be 0, in which case the node will be placed at the root of the graph. \p dependencies may not have any duplicate entries. A handle to the new node will be returned in \p phGraphNode. An empty node performs no operation during execution, but can be used for transitive ordering. For example, a phased execution graph with 2 groups of n nodes with a barrier between them can be represented using an empty node and 2*n dependency edges, rather than no empty node and n^2 dependency edges. \param phGraphNode - Returns newly created node \param hGraph - Graph to which to add the node \param dependencies - Dependencies of the node \param numDependencies - Number of dependencies \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE, \note_graph_thread_safety \notefnerr \sa ::cuGraphAddNode, ::cuGraphCreate, ::cuGraphDestroyNode, ::cuGraphAddChildGraphNode, ::cuGraphAddKernelNode, ::cuGraphAddHostNode, ::cuGraphAddMemcpyNode, ::cuGraphAddMemsetNode*/ fn cuGraphAddEmptyNode( phGraphNode: *mut cuda_types::cuda::CUgraphNode, hGraph: cuda_types::cuda::CUgraph, dependencies: *const cuda_types::cuda::CUgraphNode, numDependencies: usize, ) -> cuda_types::cuda::CUresult; /** \brief Creates an event record node and adds it to a graph Creates a new event record node and adds it to \p hGraph with \p numDependencies dependencies specified via \p dependencies and event specified in \p event. It is possible for \p numDependencies to be 0, in which case the node will be placed at the root of the graph. \p dependencies may not have any duplicate entries. A handle to the new node will be returned in \p phGraphNode. Each launch of the graph will record \p event to capture execution of the node's dependencies. \param phGraphNode - Returns newly created node \param hGraph - Graph to which to add the node \param dependencies - Dependencies of the node \param numDependencies - Number of dependencies \param event - Event for the node \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_NOT_SUPPORTED, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuGraphAddNode, ::cuGraphAddEventWaitNode, ::cuEventRecordWithFlags, ::cuStreamWaitEvent, ::cuGraphCreate, ::cuGraphDestroyNode, ::cuGraphAddChildGraphNode, ::cuGraphAddEmptyNode, ::cuGraphAddKernelNode, ::cuGraphAddMemcpyNode, ::cuGraphAddMemsetNode*/ fn cuGraphAddEventRecordNode( phGraphNode: *mut cuda_types::cuda::CUgraphNode, hGraph: cuda_types::cuda::CUgraph, dependencies: *const cuda_types::cuda::CUgraphNode, numDependencies: usize, event: cuda_types::cuda::CUevent, ) -> cuda_types::cuda::CUresult; /** \brief Returns the event associated with an event record node Returns the event of event record node \p hNode in \p event_out. \param hNode - Node to get the event for \param event_out - Pointer to return the event \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuGraphAddEventRecordNode, ::cuGraphEventRecordNodeSetEvent, ::cuGraphEventWaitNodeGetEvent, ::cuEventRecordWithFlags, ::cuStreamWaitEvent*/ fn cuGraphEventRecordNodeGetEvent( hNode: cuda_types::cuda::CUgraphNode, event_out: *mut cuda_types::cuda::CUevent, ) -> cuda_types::cuda::CUresult; /** \brief Sets an event record node's event Sets the event of event record node \p hNode to \p event. \param hNode - Node to set the event for \param event - Event to use \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_OUT_OF_MEMORY \note_graph_thread_safety \notefnerr \sa ::cuGraphNodeSetParams, ::cuGraphAddEventRecordNode, ::cuGraphEventRecordNodeGetEvent, ::cuGraphEventWaitNodeSetEvent, ::cuEventRecordWithFlags, ::cuStreamWaitEvent*/ fn cuGraphEventRecordNodeSetEvent( hNode: cuda_types::cuda::CUgraphNode, event: cuda_types::cuda::CUevent, ) -> cuda_types::cuda::CUresult; /** \brief Creates an event wait node and adds it to a graph Creates a new event wait node and adds it to \p hGraph with \p numDependencies dependencies specified via \p dependencies and event specified in \p event. It is possible for \p numDependencies to be 0, in which case the node will be placed at the root of the graph. \p dependencies may not have any duplicate entries. A handle to the new node will be returned in \p phGraphNode. The graph node will wait for all work captured in \p event. See ::cuEventRecord() for details on what is captured by an event. \p event may be from a different context or device than the launch stream. \param phGraphNode - Returns newly created node \param hGraph - Graph to which to add the node \param dependencies - Dependencies of the node \param numDependencies - Number of dependencies \param event - Event for the node \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_NOT_SUPPORTED, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuGraphAddNode, ::cuGraphAddEventRecordNode, ::cuEventRecordWithFlags, ::cuStreamWaitEvent, ::cuGraphCreate, ::cuGraphDestroyNode, ::cuGraphAddChildGraphNode, ::cuGraphAddEmptyNode, ::cuGraphAddKernelNode, ::cuGraphAddMemcpyNode, ::cuGraphAddMemsetNode*/ fn cuGraphAddEventWaitNode( phGraphNode: *mut cuda_types::cuda::CUgraphNode, hGraph: cuda_types::cuda::CUgraph, dependencies: *const cuda_types::cuda::CUgraphNode, numDependencies: usize, event: cuda_types::cuda::CUevent, ) -> cuda_types::cuda::CUresult; /** \brief Returns the event associated with an event wait node Returns the event of event wait node \p hNode in \p event_out. \param hNode - Node to get the event for \param event_out - Pointer to return the event \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuGraphAddEventWaitNode, ::cuGraphEventWaitNodeSetEvent, ::cuGraphEventRecordNodeGetEvent, ::cuEventRecordWithFlags, ::cuStreamWaitEvent*/ fn cuGraphEventWaitNodeGetEvent( hNode: cuda_types::cuda::CUgraphNode, event_out: *mut cuda_types::cuda::CUevent, ) -> cuda_types::cuda::CUresult; /** \brief Sets an event wait node's event Sets the event of event wait node \p hNode to \p event. \param hNode - Node to set the event for \param event - Event to use \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_OUT_OF_MEMORY \note_graph_thread_safety \notefnerr \sa ::cuGraphNodeSetParams, ::cuGraphAddEventWaitNode, ::cuGraphEventWaitNodeGetEvent, ::cuGraphEventRecordNodeSetEvent, ::cuEventRecordWithFlags, ::cuStreamWaitEvent*/ fn cuGraphEventWaitNodeSetEvent( hNode: cuda_types::cuda::CUgraphNode, event: cuda_types::cuda::CUevent, ) -> cuda_types::cuda::CUresult; /** \brief Creates an external semaphore signal node and adds it to a graph Creates a new external semaphore signal node and adds it to \p hGraph with \p numDependencies dependencies specified via \p dependencies and arguments specified in \p nodeParams. It is possible for \p numDependencies to be 0, in which case the node will be placed at the root of the graph. \p dependencies may not have any duplicate entries. A handle to the new node will be returned in \p phGraphNode. Performs a signal operation on a set of externally allocated semaphore objects when the node is launched. The operation(s) will occur after all of the node's dependencies have completed. \param phGraphNode - Returns newly created node \param hGraph - Graph to which to add the node \param dependencies - Dependencies of the node \param numDependencies - Number of dependencies \param nodeParams - Parameters for the node \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_NOT_SUPPORTED, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuGraphAddNode, ::cuGraphExternalSemaphoresSignalNodeGetParams, ::cuGraphExternalSemaphoresSignalNodeSetParams, ::cuGraphExecExternalSemaphoresSignalNodeSetParams, ::cuGraphAddExternalSemaphoresWaitNode, ::cuImportExternalSemaphore, ::cuSignalExternalSemaphoresAsync, ::cuWaitExternalSemaphoresAsync, ::cuGraphCreate, ::cuGraphDestroyNode, ::cuGraphAddEventRecordNode, ::cuGraphAddEventWaitNode, ::cuGraphAddChildGraphNode, ::cuGraphAddEmptyNode, ::cuGraphAddKernelNode, ::cuGraphAddMemcpyNode, ::cuGraphAddMemsetNode*/ fn cuGraphAddExternalSemaphoresSignalNode( phGraphNode: *mut cuda_types::cuda::CUgraphNode, hGraph: cuda_types::cuda::CUgraph, dependencies: *const cuda_types::cuda::CUgraphNode, numDependencies: usize, nodeParams: *const cuda_types::cuda::CUDA_EXT_SEM_SIGNAL_NODE_PARAMS, ) -> cuda_types::cuda::CUresult; /** \brief Returns an external semaphore signal node's parameters Returns the parameters of an external semaphore signal node \p hNode in \p params_out. The \p extSemArray and \p paramsArray returned in \p params_out, are owned by the node. This memory remains valid until the node is destroyed or its parameters are modified, and should not be modified directly. Use ::cuGraphExternalSemaphoresSignalNodeSetParams to update the parameters of this node. \param hNode - Node to get the parameters for \param params_out - Pointer to return the parameters \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuLaunchKernel, ::cuGraphAddExternalSemaphoresSignalNode, ::cuGraphExternalSemaphoresSignalNodeSetParams, ::cuGraphAddExternalSemaphoresWaitNode, ::cuSignalExternalSemaphoresAsync, ::cuWaitExternalSemaphoresAsync*/ fn cuGraphExternalSemaphoresSignalNodeGetParams( hNode: cuda_types::cuda::CUgraphNode, params_out: *mut cuda_types::cuda::CUDA_EXT_SEM_SIGNAL_NODE_PARAMS, ) -> cuda_types::cuda::CUresult; /** \brief Sets an external semaphore signal node's parameters Sets the parameters of an external semaphore signal node \p hNode to \p nodeParams. \param hNode - Node to set the parameters for \param nodeParams - Parameters to copy \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_OUT_OF_MEMORY \note_graph_thread_safety \notefnerr \sa ::cuGraphNodeSetParams, ::cuGraphAddExternalSemaphoresSignalNode, ::cuGraphExternalSemaphoresSignalNodeSetParams, ::cuGraphAddExternalSemaphoresWaitNode, ::cuSignalExternalSemaphoresAsync, ::cuWaitExternalSemaphoresAsync*/ fn cuGraphExternalSemaphoresSignalNodeSetParams( hNode: cuda_types::cuda::CUgraphNode, nodeParams: *const cuda_types::cuda::CUDA_EXT_SEM_SIGNAL_NODE_PARAMS, ) -> cuda_types::cuda::CUresult; /** \brief Creates an external semaphore wait node and adds it to a graph Creates a new external semaphore wait node and adds it to \p hGraph with \p numDependencies dependencies specified via \p dependencies and arguments specified in \p nodeParams. It is possible for \p numDependencies to be 0, in which case the node will be placed at the root of the graph. \p dependencies may not have any duplicate entries. A handle to the new node will be returned in \p phGraphNode. Performs a wait operation on a set of externally allocated semaphore objects when the node is launched. The node's dependencies will not be launched until the wait operation has completed. \param phGraphNode - Returns newly created node \param hGraph - Graph to which to add the node \param dependencies - Dependencies of the node \param numDependencies - Number of dependencies \param nodeParams - Parameters for the node \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_NOT_SUPPORTED, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuGraphAddNode, ::cuGraphExternalSemaphoresWaitNodeGetParams, ::cuGraphExternalSemaphoresWaitNodeSetParams, ::cuGraphExecExternalSemaphoresWaitNodeSetParams, ::cuGraphAddExternalSemaphoresSignalNode, ::cuImportExternalSemaphore, ::cuSignalExternalSemaphoresAsync, ::cuWaitExternalSemaphoresAsync, ::cuGraphCreate, ::cuGraphDestroyNode, ::cuGraphAddEventRecordNode, ::cuGraphAddEventWaitNode, ::cuGraphAddChildGraphNode, ::cuGraphAddEmptyNode, ::cuGraphAddKernelNode, ::cuGraphAddMemcpyNode, ::cuGraphAddMemsetNode*/ fn cuGraphAddExternalSemaphoresWaitNode( phGraphNode: *mut cuda_types::cuda::CUgraphNode, hGraph: cuda_types::cuda::CUgraph, dependencies: *const cuda_types::cuda::CUgraphNode, numDependencies: usize, nodeParams: *const cuda_types::cuda::CUDA_EXT_SEM_WAIT_NODE_PARAMS, ) -> cuda_types::cuda::CUresult; /** \brief Returns an external semaphore wait node's parameters Returns the parameters of an external semaphore wait node \p hNode in \p params_out. The \p extSemArray and \p paramsArray returned in \p params_out, are owned by the node. This memory remains valid until the node is destroyed or its parameters are modified, and should not be modified directly. Use ::cuGraphExternalSemaphoresSignalNodeSetParams to update the parameters of this node. \param hNode - Node to get the parameters for \param params_out - Pointer to return the parameters \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuLaunchKernel, ::cuGraphAddExternalSemaphoresWaitNode, ::cuGraphExternalSemaphoresWaitNodeSetParams, ::cuGraphAddExternalSemaphoresWaitNode, ::cuSignalExternalSemaphoresAsync, ::cuWaitExternalSemaphoresAsync*/ fn cuGraphExternalSemaphoresWaitNodeGetParams( hNode: cuda_types::cuda::CUgraphNode, params_out: *mut cuda_types::cuda::CUDA_EXT_SEM_WAIT_NODE_PARAMS, ) -> cuda_types::cuda::CUresult; /** \brief Sets an external semaphore wait node's parameters Sets the parameters of an external semaphore wait node \p hNode to \p nodeParams. \param hNode - Node to set the parameters for \param nodeParams - Parameters to copy \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_OUT_OF_MEMORY \note_graph_thread_safety \notefnerr \sa ::cuGraphNodeSetParams, ::cuGraphAddExternalSemaphoresWaitNode, ::cuGraphExternalSemaphoresWaitNodeSetParams, ::cuGraphAddExternalSemaphoresWaitNode, ::cuSignalExternalSemaphoresAsync, ::cuWaitExternalSemaphoresAsync*/ fn cuGraphExternalSemaphoresWaitNodeSetParams( hNode: cuda_types::cuda::CUgraphNode, nodeParams: *const cuda_types::cuda::CUDA_EXT_SEM_WAIT_NODE_PARAMS, ) -> cuda_types::cuda::CUresult; /** \brief Creates a batch memory operation node and adds it to a graph Creates a new batch memory operation node and adds it to \p hGraph with \p numDependencies dependencies specified via \p dependencies and arguments specified in \p nodeParams. It is possible for \p numDependencies to be 0, in which case the node will be placed at the root of the graph. \p dependencies may not have any duplicate entries. A handle to the new node will be returned in \p phGraphNode. When the node is added, the paramArray inside \p nodeParams is copied and therefore it can be freed after the call returns. \note Warning: Improper use of this API may deadlock the application. Synchronization ordering established through this API is not visible to CUDA. CUDA tasks that are (even indirectly) ordered by this API should also have that order expressed with CUDA-visible dependencies such as events. This ensures that the scheduler does not serialize them in an improper order. \param phGraphNode - Returns newly created node \param hGraph - Graph to which to add the node \param dependencies - Dependencies of the node \param numDependencies - Number of dependencies \param nodeParams - Parameters for the node \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_NOT_SUPPORTED, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuGraphAddNode, ::cuStreamBatchMemOp, ::cuStreamWaitValue32, ::cuStreamWriteValue32, ::cuStreamWaitValue64, ::cuStreamWriteValue64, ::cuGraphBatchMemOpNodeGetParams, ::cuGraphBatchMemOpNodeSetParams, ::cuGraphCreate, ::cuGraphDestroyNode, ::cuGraphAddChildGraphNode, ::cuGraphAddEmptyNode, ::cuGraphAddKernelNode, ::cuGraphAddMemcpyNode, ::cuGraphAddMemsetNode*/ fn cuGraphAddBatchMemOpNode( phGraphNode: *mut cuda_types::cuda::CUgraphNode, hGraph: cuda_types::cuda::CUgraph, dependencies: *const cuda_types::cuda::CUgraphNode, numDependencies: usize, nodeParams: *const cuda_types::cuda::CUDA_BATCH_MEM_OP_NODE_PARAMS, ) -> cuda_types::cuda::CUresult; /** \brief Returns a batch mem op node's parameters Returns the parameters of batch mem op node \p hNode in \p nodeParams_out. The \p paramArray returned in \p nodeParams_out is owned by the node. This memory remains valid until the node is destroyed or its parameters are modified, and should not be modified directly. Use ::cuGraphBatchMemOpNodeSetParams to update the parameters of this node. \param hNode - Node to get the parameters for \param nodeParams_out - Pointer to return the parameters \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuStreamBatchMemOp, ::cuGraphAddBatchMemOpNode, ::cuGraphBatchMemOpNodeSetParams*/ fn cuGraphBatchMemOpNodeGetParams( hNode: cuda_types::cuda::CUgraphNode, nodeParams_out: *mut cuda_types::cuda::CUDA_BATCH_MEM_OP_NODE_PARAMS, ) -> cuda_types::cuda::CUresult; /** \brief Sets a batch mem op node's parameters Sets the parameters of batch mem op node \p hNode to \p nodeParams. The paramArray inside \p nodeParams is copied and therefore it can be freed after the call returns. \param hNode - Node to set the parameters for \param nodeParams - Parameters to copy \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_OUT_OF_MEMORY \note_graph_thread_safety \notefnerr \sa ::cuGraphNodeSetParams, ::cuStreamBatchMemOp, ::cuGraphAddBatchMemOpNode, ::cuGraphBatchMemOpNodeGetParams*/ fn cuGraphBatchMemOpNodeSetParams( hNode: cuda_types::cuda::CUgraphNode, nodeParams: *const cuda_types::cuda::CUDA_BATCH_MEM_OP_NODE_PARAMS, ) -> cuda_types::cuda::CUresult; /** \brief Sets the parameters for a batch mem op node in the given graphExec Sets the parameters of a batch mem op node in an executable graph \p hGraphExec. The node is identified by the corresponding node \p hNode in the non-executable graph, from which the executable graph was instantiated. The following fields on operations may be modified on an executable graph: op.waitValue.address op.waitValue.value[64] op.waitValue.flags bits corresponding to wait type (i.e. CU_STREAM_WAIT_VALUE_FLUSH bit cannot be modified) op.writeValue.address op.writeValue.value[64] Other fields, such as the context, count or type of operations, and other types of operations such as membars, may not be modified. \p hNode must not have been removed from the original graph. The modifications only affect future launches of \p hGraphExec. Already enqueued or running launches of \p hGraphExec are not affected by this call. \p hNode is also not modified by this call. The paramArray inside \p nodeParams is copied and therefore it can be freed after the call returns. \param hGraphExec - The executable graph in which to set the specified node \param hNode - Batch mem op node from the graph from which graphExec was instantiated \param nodeParams - Updated Parameters to set \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, \note_graph_thread_safety \notefnerr \sa ::cuGraphExecNodeSetParams, ::cuStreamBatchMemOp, ::cuGraphAddBatchMemOpNode, ::cuGraphBatchMemOpNodeGetParams, ::cuGraphBatchMemOpNodeSetParams, ::cuGraphInstantiate*/ fn cuGraphExecBatchMemOpNodeSetParams( hGraphExec: cuda_types::cuda::CUgraphExec, hNode: cuda_types::cuda::CUgraphNode, nodeParams: *const cuda_types::cuda::CUDA_BATCH_MEM_OP_NODE_PARAMS, ) -> cuda_types::cuda::CUresult; /** \brief Creates an allocation node and adds it to a graph Creates a new allocation node and adds it to \p hGraph with \p numDependencies dependencies specified via \p dependencies and arguments specified in \p nodeParams. It is possible for \p numDependencies to be 0, in which case the node will be placed at the root of the graph. \p dependencies may not have any duplicate entries. A handle to the new node will be returned in \p phGraphNode. \param phGraphNode - Returns newly created node \param hGraph - Graph to which to add the node \param dependencies - Dependencies of the node \param numDependencies - Number of dependencies \param nodeParams - Parameters for the node When ::cuGraphAddMemAllocNode creates an allocation node, it returns the address of the allocation in \p nodeParams.dptr. The allocation's address remains fixed across instantiations and launches. If the allocation is freed in the same graph, by creating a free node using ::cuGraphAddMemFreeNode, the allocation can be accessed by nodes ordered after the allocation node but before the free node. These allocations cannot be freed outside the owning graph, and they can only be freed once in the owning graph. If the allocation is not freed in the same graph, then it can be accessed not only by nodes in the graph which are ordered after the allocation node, but also by stream operations ordered after the graph's execution but before the allocation is freed. Allocations which are not freed in the same graph can be freed by: - passing the allocation to ::cuMemFreeAsync or ::cuMemFree; - launching a graph with a free node for that allocation; or - specifying ::CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH during instantiation, which makes each launch behave as though it called ::cuMemFreeAsync for every unfreed allocation. It is not possible to free an allocation in both the owning graph and another graph. If the allocation is freed in the same graph, a free node cannot be added to another graph. If the allocation is freed in another graph, a free node can no longer be added to the owning graph. The following restrictions apply to graphs which contain allocation and/or memory free nodes: - Nodes and edges of the graph cannot be deleted. - The graph can only be used in a child node if the ownership is moved to the parent. - Only one instantiation of the graph may exist at any point in time. - The graph cannot be cloned. \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_NOT_SUPPORTED, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuGraphAddNode, ::cuGraphAddMemFreeNode, ::cuGraphMemAllocNodeGetParams, ::cuDeviceGraphMemTrim, ::cuDeviceGetGraphMemAttribute, ::cuDeviceSetGraphMemAttribute, ::cuMemAllocAsync, ::cuMemFreeAsync, ::cuGraphCreate, ::cuGraphDestroyNode, ::cuGraphAddChildGraphNode, ::cuGraphAddEmptyNode, ::cuGraphAddEventRecordNode, ::cuGraphAddEventWaitNode, ::cuGraphAddExternalSemaphoresSignalNode, ::cuGraphAddExternalSemaphoresWaitNode, ::cuGraphAddKernelNode, ::cuGraphAddMemcpyNode, ::cuGraphAddMemsetNode*/ fn cuGraphAddMemAllocNode( phGraphNode: *mut cuda_types::cuda::CUgraphNode, hGraph: cuda_types::cuda::CUgraph, dependencies: *const cuda_types::cuda::CUgraphNode, numDependencies: usize, nodeParams: *mut cuda_types::cuda::CUDA_MEM_ALLOC_NODE_PARAMS, ) -> cuda_types::cuda::CUresult; /** \brief Returns a memory alloc node's parameters Returns the parameters of a memory alloc node \p hNode in \p params_out. The \p poolProps and \p accessDescs returned in \p params_out, are owned by the node. This memory remains valid until the node is destroyed. The returned parameters must not be modified. \param hNode - Node to get the parameters for \param params_out - Pointer to return the parameters \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuGraphAddMemAllocNode, ::cuGraphMemFreeNodeGetParams*/ fn cuGraphMemAllocNodeGetParams( hNode: cuda_types::cuda::CUgraphNode, params_out: *mut cuda_types::cuda::CUDA_MEM_ALLOC_NODE_PARAMS, ) -> cuda_types::cuda::CUresult; /** \brief Creates a memory free node and adds it to a graph Creates a new memory free node and adds it to \p hGraph with \p numDependencies dependencies specified via \p dependencies and arguments specified in \p nodeParams. It is possible for \p numDependencies to be 0, in which case the node will be placed at the root of the graph. \p dependencies may not have any duplicate entries. A handle to the new node will be returned in \p phGraphNode. \param phGraphNode - Returns newly created node \param hGraph - Graph to which to add the node \param dependencies - Dependencies of the node \param numDependencies - Number of dependencies \param dptr - Address of memory to free ::cuGraphAddMemFreeNode will return ::CUDA_ERROR_INVALID_VALUE if the user attempts to free: - an allocation twice in the same graph. - an address that was not returned by an allocation node. - an invalid address. The following restrictions apply to graphs which contain allocation and/or memory free nodes: - Nodes and edges of the graph cannot be deleted. - The graph can only be used in a child node if the ownership is moved to the parent. - Only one instantiation of the graph may exist at any point in time. - The graph cannot be cloned. \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_NOT_SUPPORTED, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuGraphAddNode, ::cuGraphAddMemAllocNode, ::cuGraphMemFreeNodeGetParams, ::cuDeviceGraphMemTrim, ::cuDeviceGetGraphMemAttribute, ::cuDeviceSetGraphMemAttribute, ::cuMemAllocAsync, ::cuMemFreeAsync, ::cuGraphCreate, ::cuGraphDestroyNode, ::cuGraphAddChildGraphNode, ::cuGraphAddEmptyNode, ::cuGraphAddEventRecordNode, ::cuGraphAddEventWaitNode, ::cuGraphAddExternalSemaphoresSignalNode, ::cuGraphAddExternalSemaphoresWaitNode, ::cuGraphAddKernelNode, ::cuGraphAddMemcpyNode, ::cuGraphAddMemsetNode*/ fn cuGraphAddMemFreeNode( phGraphNode: *mut cuda_types::cuda::CUgraphNode, hGraph: cuda_types::cuda::CUgraph, dependencies: *const cuda_types::cuda::CUgraphNode, numDependencies: usize, dptr: cuda_types::cuda::CUdeviceptr, ) -> cuda_types::cuda::CUresult; /** \brief Returns a memory free node's parameters Returns the address of a memory free node \p hNode in \p dptr_out. \param hNode - Node to get the parameters for \param dptr_out - Pointer to return the device address \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuGraphAddMemFreeNode, ::cuGraphMemAllocNodeGetParams*/ fn cuGraphMemFreeNodeGetParams( hNode: cuda_types::cuda::CUgraphNode, dptr_out: *mut cuda_types::cuda::CUdeviceptr, ) -> cuda_types::cuda::CUresult; /** \brief Free unused memory that was cached on the specified device for use with graphs back to the OS. Blocks which are not in use by a graph that is either currently executing or scheduled to execute are freed back to the operating system. \param device - The device for which cached memory should be freed. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_DEVICE \sa ::cuGraphAddMemAllocNode, ::cuGraphAddMemFreeNode, ::cuDeviceSetGraphMemAttribute, ::cuDeviceGetGraphMemAttribute*/ fn cuDeviceGraphMemTrim( device: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; /** \brief Query asynchronous allocation attributes related to graphs Valid attributes are: - ::CU_GRAPH_MEM_ATTR_USED_MEM_CURRENT: Amount of memory, in bytes, currently associated with graphs - ::CU_GRAPH_MEM_ATTR_USED_MEM_HIGH: High watermark of memory, in bytes, associated with graphs since the last time it was reset. High watermark can only be reset to zero. - ::CU_GRAPH_MEM_ATTR_RESERVED_MEM_CURRENT: Amount of memory, in bytes, currently allocated for use by the CUDA graphs asynchronous allocator. - ::CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH: High watermark of memory, in bytes, currently allocated for use by the CUDA graphs asynchronous allocator. \param device - Specifies the scope of the query \param attr - attribute to get \param value - retrieved value \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_DEVICE \sa ::cuDeviceSetGraphMemAttribute, ::cuGraphAddMemAllocNode, ::cuGraphAddMemFreeNode*/ fn cuDeviceGetGraphMemAttribute( device: cuda_types::cuda::CUdevice, attr: cuda_types::cuda::CUgraphMem_attribute, value: *mut ::core::ffi::c_void, ) -> cuda_types::cuda::CUresult; /** \brief Set asynchronous allocation attributes related to graphs Valid attributes are: - ::CU_GRAPH_MEM_ATTR_USED_MEM_HIGH: High watermark of memory, in bytes, associated with graphs since the last time it was reset. High watermark can only be reset to zero. - ::CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH: High watermark of memory, in bytes, currently allocated for use by the CUDA graphs asynchronous allocator. \param device - Specifies the scope of the query \param attr - attribute to get \param value - pointer to value to set \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_DEVICE \sa ::cuDeviceGetGraphMemAttribute, ::cuGraphAddMemAllocNode, ::cuGraphAddMemFreeNode*/ fn cuDeviceSetGraphMemAttribute( device: cuda_types::cuda::CUdevice, attr: cuda_types::cuda::CUgraphMem_attribute, value: *mut ::core::ffi::c_void, ) -> cuda_types::cuda::CUresult; /** \brief Clones a graph This function creates a copy of \p originalGraph and returns it in \p phGraphClone. All parameters are copied into the cloned graph. The original graph may be modified after this call without affecting the clone. Child graph nodes in the original graph are recursively copied into the clone. \note: Cloning is not supported for graphs which contain memory allocation nodes, memory free nodes, or conditional nodes. \param phGraphClone - Returns newly created cloned graph \param originalGraph - Graph to clone \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_OUT_OF_MEMORY \note_graph_thread_safety \notefnerr \sa ::cuGraphCreate, ::cuGraphNodeFindInClone*/ fn cuGraphClone( phGraphClone: *mut cuda_types::cuda::CUgraph, originalGraph: cuda_types::cuda::CUgraph, ) -> cuda_types::cuda::CUresult; /** \brief Finds a cloned version of a node This function returns the node in \p hClonedGraph corresponding to \p hOriginalNode in the original graph. \p hClonedGraph must have been cloned from \p hOriginalGraph via ::cuGraphClone. \p hOriginalNode must have been in \p hOriginalGraph at the time of the call to ::cuGraphClone, and the corresponding cloned node in \p hClonedGraph must not have been removed. The cloned node is then returned via \p phClonedNode. \param phNode - Returns handle to the cloned node \param hOriginalNode - Handle to the original node \param hClonedGraph - Cloned graph to query \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, \note_graph_thread_safety \notefnerr \sa ::cuGraphClone*/ fn cuGraphNodeFindInClone( phNode: *mut cuda_types::cuda::CUgraphNode, hOriginalNode: cuda_types::cuda::CUgraphNode, hClonedGraph: cuda_types::cuda::CUgraph, ) -> cuda_types::cuda::CUresult; /** \brief Returns a node's type Returns the node type of \p hNode in \p type. \param hNode - Node to query \param type - Pointer to return the node type \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuGraphGetNodes, ::cuGraphGetRootNodes, ::cuGraphChildGraphNodeGetGraph, ::cuGraphKernelNodeGetParams, ::cuGraphKernelNodeSetParams, ::cuGraphHostNodeGetParams, ::cuGraphHostNodeSetParams, ::cuGraphMemcpyNodeGetParams, ::cuGraphMemcpyNodeSetParams, ::cuGraphMemsetNodeGetParams, ::cuGraphMemsetNodeSetParams*/ fn cuGraphNodeGetType( hNode: cuda_types::cuda::CUgraphNode, type_: *mut cuda_types::cuda::CUgraphNodeType, ) -> cuda_types::cuda::CUresult; /** \brief Returns a graph's nodes Returns a list of \p hGraph's nodes. \p nodes may be NULL, in which case this function will return the number of nodes in \p numNodes. Otherwise, \p numNodes entries will be filled in. If \p numNodes is higher than the actual number of nodes, the remaining entries in \p nodes will be set to NULL, and the number of nodes actually obtained will be returned in \p numNodes. \param hGraph - Graph to query \param nodes - Pointer to return the nodes \param numNodes - See description \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuGraphCreate, ::cuGraphGetRootNodes, ::cuGraphGetEdges, ::cuGraphNodeGetType, ::cuGraphNodeGetDependencies, ::cuGraphNodeGetDependentNodes*/ fn cuGraphGetNodes( hGraph: cuda_types::cuda::CUgraph, nodes: *mut cuda_types::cuda::CUgraphNode, numNodes: *mut usize, ) -> cuda_types::cuda::CUresult; /** \brief Returns a graph's root nodes Returns a list of \p hGraph's root nodes. \p rootNodes may be NULL, in which case this function will return the number of root nodes in \p numRootNodes. Otherwise, \p numRootNodes entries will be filled in. If \p numRootNodes is higher than the actual number of root nodes, the remaining entries in \p rootNodes will be set to NULL, and the number of nodes actually obtained will be returned in \p numRootNodes. \param hGraph - Graph to query \param rootNodes - Pointer to return the root nodes \param numRootNodes - See description \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuGraphCreate, ::cuGraphGetNodes, ::cuGraphGetEdges, ::cuGraphNodeGetType, ::cuGraphNodeGetDependencies, ::cuGraphNodeGetDependentNodes*/ fn cuGraphGetRootNodes( hGraph: cuda_types::cuda::CUgraph, rootNodes: *mut cuda_types::cuda::CUgraphNode, numRootNodes: *mut usize, ) -> cuda_types::cuda::CUresult; /** \brief Returns a graph's dependency edges Returns a list of \p hGraph's dependency edges. Edges are returned via corresponding indices in \p from, \p to and \p edgeData; that is, the node in \p to[i] has a dependency on the node in \p from[i] with data \p edgeData[i]. \p from and \p to may both be NULL, in which case this function only returns the number of edges in \p numEdges. Otherwise, \p numEdges entries will be filled in. If \p numEdges is higher than the actual number of edges, the remaining entries in \p from and \p to will be set to NULL, and the number of edges actually returned will be written to \p numEdges. \p edgeData may alone be NULL, in which case the edges must all have default (zeroed) edge data. Attempting a lossy query via NULL \p edgeData will result in ::CUDA_ERROR_LOSSY_QUERY. If \p edgeData is non-NULL then \p from and \p to must be as well. \param hGraph - Graph to get the edges from \param from - Location to return edge endpoints \param to - Location to return edge endpoints \param edgeData - Optional location to return edge data \param numEdges - See description \return ::CUDA_SUCCESS, ::CUDA_ERROR_LOSSY_QUERY, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuGraphGetNodes, ::cuGraphGetRootNodes, ::cuGraphAddDependencies, ::cuGraphRemoveDependencies, ::cuGraphNodeGetDependencies, ::cuGraphNodeGetDependentNodes*/ fn cuGraphGetEdges_v2( hGraph: cuda_types::cuda::CUgraph, from: *mut cuda_types::cuda::CUgraphNode, to: *mut cuda_types::cuda::CUgraphNode, edgeData: *mut cuda_types::cuda::CUgraphEdgeData, numEdges: *mut usize, ) -> cuda_types::cuda::CUresult; /** \brief Returns a node's dependencies Returns a list of \p node's dependencies. \p dependencies may be NULL, in which case this function will return the number of dependencies in \p numDependencies. Otherwise, \p numDependencies entries will be filled in. If \p numDependencies is higher than the actual number of dependencies, the remaining entries in \p dependencies will be set to NULL, and the number of nodes actually obtained will be returned in \p numDependencies. Note that if an edge has non-zero (non-default) edge data and \p edgeData is NULL, this API will return ::CUDA_ERROR_LOSSY_QUERY. If \p edgeData is non-NULL, then \p dependencies must be as well. \param hNode - Node to query \param dependencies - Pointer to return the dependencies \param edgeData - Optional array to return edge data for each dependency \param numDependencies - See description \return ::CUDA_SUCCESS, ::CUDA_ERROR_LOSSY_QUERY, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuGraphNodeGetDependentNodes, ::cuGraphGetNodes, ::cuGraphGetRootNodes, ::cuGraphGetEdges, ::cuGraphAddDependencies, ::cuGraphRemoveDependencies*/ fn cuGraphNodeGetDependencies_v2( hNode: cuda_types::cuda::CUgraphNode, dependencies: *mut cuda_types::cuda::CUgraphNode, edgeData: *mut cuda_types::cuda::CUgraphEdgeData, numDependencies: *mut usize, ) -> cuda_types::cuda::CUresult; /** \brief Returns a node's dependent nodes Returns a list of \p node's dependent nodes. \p dependentNodes may be NULL, in which case this function will return the number of dependent nodes in \p numDependentNodes. Otherwise, \p numDependentNodes entries will be filled in. If \p numDependentNodes is higher than the actual number of dependent nodes, the remaining entries in \p dependentNodes will be set to NULL, and the number of nodes actually obtained will be returned in \p numDependentNodes. Note that if an edge has non-zero (non-default) edge data and \p edgeData is NULL, this API will return ::CUDA_ERROR_LOSSY_QUERY. If \p edgeData is non-NULL, then \p dependentNodes must be as well. \param hNode - Node to query \param dependentNodes - Pointer to return the dependent nodes \param edgeData - Optional pointer to return edge data for dependent nodes \param numDependentNodes - See description \return ::CUDA_SUCCESS, ::CUDA_ERROR_LOSSY_QUERY, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuGraphNodeGetDependencies, ::cuGraphGetNodes, ::cuGraphGetRootNodes, ::cuGraphGetEdges, ::cuGraphAddDependencies, ::cuGraphRemoveDependencies*/ fn cuGraphNodeGetDependentNodes_v2( hNode: cuda_types::cuda::CUgraphNode, dependentNodes: *mut cuda_types::cuda::CUgraphNode, edgeData: *mut cuda_types::cuda::CUgraphEdgeData, numDependentNodes: *mut usize, ) -> cuda_types::cuda::CUresult; /** \brief Adds dependency edges to a graph The number of dependencies to be added is defined by \p numDependencies Elements in \p from and \p to at corresponding indices define a dependency. Each node in \p from and \p to must belong to \p hGraph. If \p numDependencies is 0, elements in \p from and \p to will be ignored. Specifying an existing dependency will return an error. \param hGraph - Graph to which dependencies are added \param from - Array of nodes that provide the dependencies \param to - Array of dependent nodes \param edgeData - Optional array of edge data. If NULL, default (zeroed) edge data is assumed. \param numDependencies - Number of dependencies to be added \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuGraphRemoveDependencies, ::cuGraphGetEdges, ::cuGraphNodeGetDependencies, ::cuGraphNodeGetDependentNodes*/ fn cuGraphAddDependencies_v2( hGraph: cuda_types::cuda::CUgraph, from: *const cuda_types::cuda::CUgraphNode, to: *const cuda_types::cuda::CUgraphNode, edgeData: *const cuda_types::cuda::CUgraphEdgeData, numDependencies: usize, ) -> cuda_types::cuda::CUresult; /** \brief Removes dependency edges from a graph The number of \p dependencies to be removed is defined by \p numDependencies. Elements in \p from and \p to at corresponding indices define a dependency. Each node in \p from and \p to must belong to \p hGraph. If \p numDependencies is 0, elements in \p from and \p to will be ignored. Specifying an edge that does not exist in the graph, with data matching \p edgeData, results in an error. \p edgeData is nullable, which is equivalent to passing default (zeroed) data for each edge. Dependencies cannot be removed from graphs which contain allocation or free nodes. Any attempt to do so will return an error. \param hGraph - Graph from which to remove dependencies \param from - Array of nodes that provide the dependencies \param to - Array of dependent nodes \param edgeData - Optional array of edge data. If NULL, edge data is assumed to be default (zeroed). \param numDependencies - Number of dependencies to be removed \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuGraphAddDependencies, ::cuGraphGetEdges, ::cuGraphNodeGetDependencies, ::cuGraphNodeGetDependentNodes*/ fn cuGraphRemoveDependencies_v2( hGraph: cuda_types::cuda::CUgraph, from: *const cuda_types::cuda::CUgraphNode, to: *const cuda_types::cuda::CUgraphNode, edgeData: *const cuda_types::cuda::CUgraphEdgeData, numDependencies: usize, ) -> cuda_types::cuda::CUresult; /** \brief Remove a node from the graph Removes \p hNode from its graph. This operation also severs any dependencies of other nodes on \p hNode and vice versa. Nodes which belong to a graph which contains allocation or free nodes cannot be destroyed. Any attempt to do so will return an error. \param hNode - Node to remove \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuGraphAddChildGraphNode, ::cuGraphAddEmptyNode, ::cuGraphAddKernelNode, ::cuGraphAddHostNode, ::cuGraphAddMemcpyNode, ::cuGraphAddMemsetNode*/ fn cuGraphDestroyNode( hNode: cuda_types::cuda::CUgraphNode, ) -> cuda_types::cuda::CUresult; /** \brief Creates an executable graph from a graph Instantiates \p hGraph as an executable graph. The graph is validated for any structural constraints or intra-node constraints which were not previously validated. If instantiation is successful, a handle to the instantiated graph is returned in \p phGraphExec. The \p flags parameter controls the behavior of instantiation and subsequent graph launches. Valid flags are: - ::CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH, which configures a graph containing memory allocation nodes to automatically free any unfreed memory allocations before the graph is relaunched. - ::CUDA_GRAPH_INSTANTIATE_FLAG_DEVICE_LAUNCH, which configures the graph for launch from the device. If this flag is passed, the executable graph handle returned can be used to launch the graph from both the host and device. This flag can only be used on platforms which support unified addressing. This flag cannot be used in conjunction with ::CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH. - ::CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY, which causes the graph to use the priorities from the per-node attributes rather than the priority of the launch stream during execution. Note that priorities are only available on kernel nodes, and are copied from stream priority during stream capture. If \p hGraph contains any allocation or free nodes, there can be at most one executable graph in existence for that graph at a time. An attempt to instantiate a second executable graph before destroying the first with ::cuGraphExecDestroy will result in an error. The same also applies if \p hGraph contains any device-updatable kernel nodes. If \p hGraph contains kernels which call device-side cudaGraphLaunch() from multiple contexts, this will result in an error. Graphs instantiated for launch on the device have additional restrictions which do not apply to host graphs: - The graph's nodes must reside on a single context. - The graph can only contain kernel nodes, memcpy nodes, memset nodes, and child graph nodes. - The graph cannot be empty and must contain at least one kernel, memcpy, or memset node. Operation-specific restrictions are outlined below. - Kernel nodes: - Use of CUDA Dynamic Parallelism is not permitted. - Cooperative launches are permitted as long as MPS is not in use. - Memcpy nodes: - Only copies involving device memory and/or pinned device-mapped host memory are permitted. - Copies involving CUDA arrays are not permitted. - Both operands must be accessible from the current context, and the current context must match the context of other nodes in the graph. \param phGraphExec - Returns instantiated graph \param hGraph - Graph to instantiate \param flags - Flags to control instantiation. See ::CUgraphInstantiate_flags. \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuGraphInstantiate, ::cuGraphCreate, ::cuGraphUpload, ::cuGraphLaunch, ::cuGraphExecDestroy*/ fn cuGraphInstantiateWithFlags( phGraphExec: *mut cuda_types::cuda::CUgraphExec, hGraph: cuda_types::cuda::CUgraph, flags: ::core::ffi::c_ulonglong, ) -> cuda_types::cuda::CUresult; /** \brief Creates an executable graph from a graph Instantiates \p hGraph as an executable graph according to the \p instantiateParams structure. The graph is validated for any structural constraints or intra-node constraints which were not previously validated. If instantiation is successful, a handle to the instantiated graph is returned in \p phGraphExec. \p instantiateParams controls the behavior of instantiation and subsequent graph launches, as well as returning more detailed information in the event of an error. ::CUDA_GRAPH_INSTANTIATE_PARAMS is defined as: \code typedef struct { cuuint64_t flags; CUstream hUploadStream; CUgraphNode hErrNode_out; CUgraphInstantiateResult result_out; } CUDA_GRAPH_INSTANTIATE_PARAMS; \endcode The \p flags field controls the behavior of instantiation and subsequent graph launches. Valid flags are: - ::CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH, which configures a graph containing memory allocation nodes to automatically free any unfreed memory allocations before the graph is relaunched. - ::CUDA_GRAPH_INSTANTIATE_FLAG_UPLOAD, which will perform an upload of the graph into \p hUploadStream once the graph has been instantiated. - ::CUDA_GRAPH_INSTANTIATE_FLAG_DEVICE_LAUNCH, which configures the graph for launch from the device. If this flag is passed, the executable graph handle returned can be used to launch the graph from both the host and device. This flag can only be used on platforms which support unified addressing. This flag cannot be used in conjunction with ::CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH. - ::CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY, which causes the graph to use the priorities from the per-node attributes rather than the priority of the launch stream during execution. Note that priorities are only available on kernel nodes, and are copied from stream priority during stream capture. If \p hGraph contains any allocation or free nodes, there can be at most one executable graph in existence for that graph at a time. An attempt to instantiate a second executable graph before destroying the first with ::cuGraphExecDestroy will result in an error. The same also applies if \p hGraph contains any device-updatable kernel nodes. If \p hGraph contains kernels which call device-side cudaGraphLaunch() from multiple contexts, this will result in an error. Graphs instantiated for launch on the device have additional restrictions which do not apply to host graphs: - The graph's nodes must reside on a single context. - The graph can only contain kernel nodes, memcpy nodes, memset nodes, and child graph nodes. - The graph cannot be empty and must contain at least one kernel, memcpy, or memset node. Operation-specific restrictions are outlined below. - Kernel nodes: - Use of CUDA Dynamic Parallelism is not permitted. - Cooperative launches are permitted as long as MPS is not in use. - Memcpy nodes: - Only copies involving device memory and/or pinned device-mapped host memory are permitted. - Copies involving CUDA arrays are not permitted. - Both operands must be accessible from the current context, and the current context must match the context of other nodes in the graph. In the event of an error, the \p result_out and \p hErrNode_out fields will contain more information about the nature of the error. Possible error reporting includes: - ::CUDA_GRAPH_INSTANTIATE_ERROR, if passed an invalid value or if an unexpected error occurred which is described by the return value of the function. \p hErrNode_out will be set to NULL. - ::CUDA_GRAPH_INSTANTIATE_INVALID_STRUCTURE, if the graph structure is invalid. \p hErrNode_out will be set to one of the offending nodes. - ::CUDA_GRAPH_INSTANTIATE_NODE_OPERATION_NOT_SUPPORTED, if the graph is instantiated for device launch but contains a node of an unsupported node type, or a node which performs unsupported operations, such as use of CUDA dynamic parallelism within a kernel node. \p hErrNode_out will be set to this node. - ::CUDA_GRAPH_INSTANTIATE_MULTIPLE_CTXS_NOT_SUPPORTED, if the graph is instantiated for device launch but a node’s context differs from that of another node. This error can also be returned if a graph is not instantiated for device launch and it contains kernels which call device-side cudaGraphLaunch() from multiple contexts. \p hErrNode_out will be set to this node. If instantiation is successful, \p result_out will be set to ::CUDA_GRAPH_INSTANTIATE_SUCCESS, and \p hErrNode_out will be set to NULL. \param phGraphExec - Returns instantiated graph \param hGraph - Graph to instantiate \param instantiateParams - Instantiation parameters \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, \note_graph_thread_safety \notefnerr \sa ::cuGraphCreate, ::cuGraphInstantiate, ::cuGraphExecDestroy*/ fn cuGraphInstantiateWithParams_ptsz( phGraphExec: *mut cuda_types::cuda::CUgraphExec, hGraph: cuda_types::cuda::CUgraph, instantiateParams: *mut cuda_types::cuda::CUDA_GRAPH_INSTANTIATE_PARAMS, ) -> cuda_types::cuda::CUresult; /** \brief Query the instantiation flags of an executable graph Returns the flags that were passed to instantiation for the given executable graph. ::CUDA_GRAPH_INSTANTIATE_FLAG_UPLOAD will not be returned by this API as it does not affect the resulting executable graph. \param hGraphExec - The executable graph to query \param flags - Returns the instantiation flags \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, \note_graph_thread_safety \notefnerr \sa ::cuGraphInstantiate, ::cuGraphInstantiateWithParams*/ fn cuGraphExecGetFlags( hGraphExec: cuda_types::cuda::CUgraphExec, flags: *mut cuda_types::cuda::cuuint64_t, ) -> cuda_types::cuda::CUresult; /** \brief Sets the parameters for a kernel node in the given graphExec Sets the parameters of a kernel node in an executable graph \p hGraphExec. The node is identified by the corresponding node \p hNode in the non-executable graph, from which the executable graph was instantiated. \p hNode must not have been removed from the original graph. All \p nodeParams fields may change, but the following restrictions apply to \p func updates: - The owning context of the function cannot change. - A node whose function originally did not use CUDA dynamic parallelism cannot be updated to a function which uses CDP - A node whose function originally did not make device-side update calls cannot be updated to a function which makes device-side update calls. - If \p hGraphExec was not instantiated for device launch, a node whose function originally did not use device-side cudaGraphLaunch() cannot be updated to a function which uses device-side cudaGraphLaunch() unless the node resides on the same context as nodes which contained such calls at instantiate-time. If no such calls were present at instantiation, these updates cannot be performed at all. The modifications only affect future launches of \p hGraphExec. Already enqueued or running launches of \p hGraphExec are not affected by this call. \p hNode is also not modified by this call. If \p hNode is a device-updatable kernel node, the next upload/launch of \p hGraphExec will overwrite any previous device-side updates. Additionally, applying host updates to a device-updatable kernel node while it is being updated from the device will result in undefined behavior. \param hGraphExec - The executable graph in which to set the specified node \param hNode - kernel node from the graph from which graphExec was instantiated \param nodeParams - Updated Parameters to set \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, \note_graph_thread_safety \notefnerr \sa ::cuGraphExecNodeSetParams, ::cuGraphAddKernelNode, ::cuGraphKernelNodeSetParams, ::cuGraphExecMemcpyNodeSetParams, ::cuGraphExecMemsetNodeSetParams, ::cuGraphExecHostNodeSetParams, ::cuGraphExecChildGraphNodeSetParams, ::cuGraphExecEventRecordNodeSetEvent, ::cuGraphExecEventWaitNodeSetEvent, ::cuGraphExecExternalSemaphoresSignalNodeSetParams, ::cuGraphExecExternalSemaphoresWaitNodeSetParams, ::cuGraphExecUpdate, ::cuGraphInstantiate*/ fn cuGraphExecKernelNodeSetParams_v2( hGraphExec: cuda_types::cuda::CUgraphExec, hNode: cuda_types::cuda::CUgraphNode, nodeParams: *const cuda_types::cuda::CUDA_KERNEL_NODE_PARAMS, ) -> cuda_types::cuda::CUresult; /** \brief Sets the parameters for a memcpy node in the given graphExec. Updates the work represented by \p hNode in \p hGraphExec as though \p hNode had contained \p copyParams at instantiation. hNode must remain in the graph which was used to instantiate \p hGraphExec. Changed edges to and from hNode are ignored. The source and destination memory in \p copyParams must be allocated from the same contexts as the original source and destination memory. Both the instantiation-time memory operands and the memory operands in \p copyParams must be 1-dimensional. Zero-length operations are not supported. The modifications only affect future launches of \p hGraphExec. Already enqueued or running launches of \p hGraphExec are not affected by this call. hNode is also not modified by this call. Returns CUDA_ERROR_INVALID_VALUE if the memory operands' mappings changed or either the original or new memory operands are multidimensional. \param hGraphExec - The executable graph in which to set the specified node \param hNode - Memcpy node from the graph which was used to instantiate graphExec \param copyParams - The updated parameters to set \param ctx - Context on which to run the node \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, \note_graph_thread_safety \notefnerr \sa ::cuGraphExecNodeSetParams, ::cuGraphAddMemcpyNode, ::cuGraphMemcpyNodeSetParams, ::cuGraphExecKernelNodeSetParams, ::cuGraphExecMemsetNodeSetParams, ::cuGraphExecHostNodeSetParams, ::cuGraphExecChildGraphNodeSetParams, ::cuGraphExecEventRecordNodeSetEvent, ::cuGraphExecEventWaitNodeSetEvent, ::cuGraphExecExternalSemaphoresSignalNodeSetParams, ::cuGraphExecExternalSemaphoresWaitNodeSetParams, ::cuGraphExecUpdate, ::cuGraphInstantiate*/ fn cuGraphExecMemcpyNodeSetParams( hGraphExec: cuda_types::cuda::CUgraphExec, hNode: cuda_types::cuda::CUgraphNode, copyParams: *const cuda_types::cuda::CUDA_MEMCPY3D, ctx: cuda_types::cuda::CUcontext, ) -> cuda_types::cuda::CUresult; /** \brief Sets the parameters for a memset node in the given graphExec. Updates the work represented by \p hNode in \p hGraphExec as though \p hNode had contained \p memsetParams at instantiation. hNode must remain in the graph which was used to instantiate \p hGraphExec. Changed edges to and from hNode are ignored. Zero sized operations are not supported. The new destination pointer in memsetParams must be to the same kind of allocation as the original destination pointer and have the same context association and device mapping as the original destination pointer. Both the value and pointer address may be updated. Changing other aspects of the memset (width, height, element size or pitch) may cause the update to be rejected. Specifically, for 2d memsets, all dimension changes are rejected. For 1d memsets, changes in height are explicitly rejected and other changes are opportunistically allowed if the resulting work maps onto the work resources already allocated for the node. The modifications only affect future launches of \p hGraphExec. Already enqueued or running launches of \p hGraphExec are not affected by this call. hNode is also not modified by this call. \param hGraphExec - The executable graph in which to set the specified node \param hNode - Memset node from the graph which was used to instantiate graphExec \param memsetParams - The updated parameters to set \param ctx - Context on which to run the node \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, \note_graph_thread_safety \notefnerr \sa ::cuGraphExecNodeSetParams, ::cuGraphAddMemsetNode, ::cuGraphMemsetNodeSetParams, ::cuGraphExecKernelNodeSetParams, ::cuGraphExecMemcpyNodeSetParams, ::cuGraphExecHostNodeSetParams, ::cuGraphExecChildGraphNodeSetParams, ::cuGraphExecEventRecordNodeSetEvent, ::cuGraphExecEventWaitNodeSetEvent, ::cuGraphExecExternalSemaphoresSignalNodeSetParams, ::cuGraphExecExternalSemaphoresWaitNodeSetParams, ::cuGraphExecUpdate, ::cuGraphInstantiate*/ fn cuGraphExecMemsetNodeSetParams( hGraphExec: cuda_types::cuda::CUgraphExec, hNode: cuda_types::cuda::CUgraphNode, memsetParams: *const cuda_types::cuda::CUDA_MEMSET_NODE_PARAMS, ctx: cuda_types::cuda::CUcontext, ) -> cuda_types::cuda::CUresult; /** \brief Sets the parameters for a host node in the given graphExec. Updates the work represented by \p hNode in \p hGraphExec as though \p hNode had contained \p nodeParams at instantiation. hNode must remain in the graph which was used to instantiate \p hGraphExec. Changed edges to and from hNode are ignored. The modifications only affect future launches of \p hGraphExec. Already enqueued or running launches of \p hGraphExec are not affected by this call. hNode is also not modified by this call. \param hGraphExec - The executable graph in which to set the specified node \param hNode - Host node from the graph which was used to instantiate graphExec \param nodeParams - The updated parameters to set \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, \note_graph_thread_safety \notefnerr \sa ::cuGraphExecNodeSetParams, ::cuGraphAddHostNode, ::cuGraphHostNodeSetParams, ::cuGraphExecKernelNodeSetParams, ::cuGraphExecMemcpyNodeSetParams, ::cuGraphExecMemsetNodeSetParams, ::cuGraphExecChildGraphNodeSetParams, ::cuGraphExecEventRecordNodeSetEvent, ::cuGraphExecEventWaitNodeSetEvent, ::cuGraphExecExternalSemaphoresSignalNodeSetParams, ::cuGraphExecExternalSemaphoresWaitNodeSetParams, ::cuGraphExecUpdate, ::cuGraphInstantiate*/ fn cuGraphExecHostNodeSetParams( hGraphExec: cuda_types::cuda::CUgraphExec, hNode: cuda_types::cuda::CUgraphNode, nodeParams: *const cuda_types::cuda::CUDA_HOST_NODE_PARAMS, ) -> cuda_types::cuda::CUresult; /** \brief Updates node parameters in the child graph node in the given graphExec. Updates the work represented by \p hNode in \p hGraphExec as though the nodes contained in \p hNode's graph had the parameters contained in \p childGraph's nodes at instantiation. \p hNode must remain in the graph which was used to instantiate \p hGraphExec. Changed edges to and from \p hNode are ignored. The modifications only affect future launches of \p hGraphExec. Already enqueued or running launches of \p hGraphExec are not affected by this call. \p hNode is also not modified by this call. The topology of \p childGraph, as well as the node insertion order, must match that of the graph contained in \p hNode. See ::cuGraphExecUpdate() for a list of restrictions on what can be updated in an instantiated graph. The update is recursive, so child graph nodes contained within the top level child graph will also be updated. \param hGraphExec - The executable graph in which to set the specified node \param hNode - Host node from the graph which was used to instantiate graphExec \param childGraph - The graph supplying the updated parameters \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, \note_graph_thread_safety \notefnerr \sa ::cuGraphExecNodeSetParams, ::cuGraphAddChildGraphNode, ::cuGraphChildGraphNodeGetGraph, ::cuGraphExecKernelNodeSetParams, ::cuGraphExecMemcpyNodeSetParams, ::cuGraphExecMemsetNodeSetParams, ::cuGraphExecHostNodeSetParams, ::cuGraphExecEventRecordNodeSetEvent, ::cuGraphExecEventWaitNodeSetEvent, ::cuGraphExecExternalSemaphoresSignalNodeSetParams, ::cuGraphExecExternalSemaphoresWaitNodeSetParams, ::cuGraphExecUpdate, ::cuGraphInstantiate*/ fn cuGraphExecChildGraphNodeSetParams( hGraphExec: cuda_types::cuda::CUgraphExec, hNode: cuda_types::cuda::CUgraphNode, childGraph: cuda_types::cuda::CUgraph, ) -> cuda_types::cuda::CUresult; /** \brief Sets the event for an event record node in the given graphExec Sets the event of an event record node in an executable graph \p hGraphExec. The node is identified by the corresponding node \p hNode in the non-executable graph, from which the executable graph was instantiated. The modifications only affect future launches of \p hGraphExec. Already enqueued or running launches of \p hGraphExec are not affected by this call. \p hNode is also not modified by this call. \param hGraphExec - The executable graph in which to set the specified node \param hNode - event record node from the graph from which graphExec was instantiated \param event - Updated event to use \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, \note_graph_thread_safety \notefnerr \sa ::cuGraphExecNodeSetParams, ::cuGraphAddEventRecordNode, ::cuGraphEventRecordNodeGetEvent, ::cuGraphEventWaitNodeSetEvent, ::cuEventRecordWithFlags, ::cuStreamWaitEvent, ::cuGraphExecKernelNodeSetParams, ::cuGraphExecMemcpyNodeSetParams, ::cuGraphExecMemsetNodeSetParams, ::cuGraphExecHostNodeSetParams, ::cuGraphExecChildGraphNodeSetParams, ::cuGraphExecEventWaitNodeSetEvent, ::cuGraphExecExternalSemaphoresSignalNodeSetParams, ::cuGraphExecExternalSemaphoresWaitNodeSetParams, ::cuGraphExecUpdate, ::cuGraphInstantiate*/ fn cuGraphExecEventRecordNodeSetEvent( hGraphExec: cuda_types::cuda::CUgraphExec, hNode: cuda_types::cuda::CUgraphNode, event: cuda_types::cuda::CUevent, ) -> cuda_types::cuda::CUresult; /** \brief Sets the event for an event wait node in the given graphExec Sets the event of an event wait node in an executable graph \p hGraphExec. The node is identified by the corresponding node \p hNode in the non-executable graph, from which the executable graph was instantiated. The modifications only affect future launches of \p hGraphExec. Already enqueued or running launches of \p hGraphExec are not affected by this call. \p hNode is also not modified by this call. \param hGraphExec - The executable graph in which to set the specified node \param hNode - event wait node from the graph from which graphExec was instantiated \param event - Updated event to use \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, \note_graph_thread_safety \notefnerr \sa ::cuGraphExecNodeSetParams, ::cuGraphAddEventWaitNode, ::cuGraphEventWaitNodeGetEvent, ::cuGraphEventRecordNodeSetEvent, ::cuEventRecordWithFlags, ::cuStreamWaitEvent, ::cuGraphExecKernelNodeSetParams, ::cuGraphExecMemcpyNodeSetParams, ::cuGraphExecMemsetNodeSetParams, ::cuGraphExecHostNodeSetParams, ::cuGraphExecChildGraphNodeSetParams, ::cuGraphExecEventRecordNodeSetEvent, ::cuGraphExecExternalSemaphoresSignalNodeSetParams, ::cuGraphExecExternalSemaphoresWaitNodeSetParams, ::cuGraphExecUpdate, ::cuGraphInstantiate*/ fn cuGraphExecEventWaitNodeSetEvent( hGraphExec: cuda_types::cuda::CUgraphExec, hNode: cuda_types::cuda::CUgraphNode, event: cuda_types::cuda::CUevent, ) -> cuda_types::cuda::CUresult; /** \brief Sets the parameters for an external semaphore signal node in the given graphExec Sets the parameters of an external semaphore signal node in an executable graph \p hGraphExec. The node is identified by the corresponding node \p hNode in the non-executable graph, from which the executable graph was instantiated. \p hNode must not have been removed from the original graph. The modifications only affect future launches of \p hGraphExec. Already enqueued or running launches of \p hGraphExec are not affected by this call. \p hNode is also not modified by this call. Changing \p nodeParams->numExtSems is not supported. \param hGraphExec - The executable graph in which to set the specified node \param hNode - semaphore signal node from the graph from which graphExec was instantiated \param nodeParams - Updated Parameters to set \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, \note_graph_thread_safety \notefnerr \sa ::cuGraphExecNodeSetParams, ::cuGraphAddExternalSemaphoresSignalNode, ::cuImportExternalSemaphore, ::cuSignalExternalSemaphoresAsync, ::cuWaitExternalSemaphoresAsync, ::cuGraphExecKernelNodeSetParams, ::cuGraphExecMemcpyNodeSetParams, ::cuGraphExecMemsetNodeSetParams, ::cuGraphExecHostNodeSetParams, ::cuGraphExecChildGraphNodeSetParams, ::cuGraphExecEventRecordNodeSetEvent, ::cuGraphExecEventWaitNodeSetEvent, ::cuGraphExecExternalSemaphoresWaitNodeSetParams, ::cuGraphExecUpdate, ::cuGraphInstantiate*/ fn cuGraphExecExternalSemaphoresSignalNodeSetParams( hGraphExec: cuda_types::cuda::CUgraphExec, hNode: cuda_types::cuda::CUgraphNode, nodeParams: *const cuda_types::cuda::CUDA_EXT_SEM_SIGNAL_NODE_PARAMS, ) -> cuda_types::cuda::CUresult; /** \brief Sets the parameters for an external semaphore wait node in the given graphExec Sets the parameters of an external semaphore wait node in an executable graph \p hGraphExec. The node is identified by the corresponding node \p hNode in the non-executable graph, from which the executable graph was instantiated. \p hNode must not have been removed from the original graph. The modifications only affect future launches of \p hGraphExec. Already enqueued or running launches of \p hGraphExec are not affected by this call. \p hNode is also not modified by this call. Changing \p nodeParams->numExtSems is not supported. \param hGraphExec - The executable graph in which to set the specified node \param hNode - semaphore wait node from the graph from which graphExec was instantiated \param nodeParams - Updated Parameters to set \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, \note_graph_thread_safety \notefnerr \sa ::cuGraphExecNodeSetParams, ::cuGraphAddExternalSemaphoresWaitNode, ::cuImportExternalSemaphore, ::cuSignalExternalSemaphoresAsync, ::cuWaitExternalSemaphoresAsync, ::cuGraphExecKernelNodeSetParams, ::cuGraphExecMemcpyNodeSetParams, ::cuGraphExecMemsetNodeSetParams, ::cuGraphExecHostNodeSetParams, ::cuGraphExecChildGraphNodeSetParams, ::cuGraphExecEventRecordNodeSetEvent, ::cuGraphExecEventWaitNodeSetEvent, ::cuGraphExecExternalSemaphoresSignalNodeSetParams, ::cuGraphExecUpdate, ::cuGraphInstantiate*/ fn cuGraphExecExternalSemaphoresWaitNodeSetParams( hGraphExec: cuda_types::cuda::CUgraphExec, hNode: cuda_types::cuda::CUgraphNode, nodeParams: *const cuda_types::cuda::CUDA_EXT_SEM_WAIT_NODE_PARAMS, ) -> cuda_types::cuda::CUresult; /** \brief Enables or disables the specified node in the given graphExec Sets \p hNode to be either enabled or disabled. Disabled nodes are functionally equivalent to empty nodes until they are reenabled. Existing node parameters are not affected by disabling/enabling the node. The node is identified by the corresponding node \p hNode in the non-executable graph, from which the executable graph was instantiated. \p hNode must not have been removed from the original graph. The modifications only affect future launches of \p hGraphExec. Already enqueued or running launches of \p hGraphExec are not affected by this call. \p hNode is also not modified by this call. If \p hNode is a device-updatable kernel node, the next upload/launch of \p hGraphExec will overwrite any previous device-side updates. Additionally, applying host updates to a device-updatable kernel node while it is being updated from the device will result in undefined behavior. \note Currently only kernel, memset and memcpy nodes are supported. \param hGraphExec - The executable graph in which to set the specified node \param hNode - Node from the graph from which graphExec was instantiated \param isEnabled - Node is enabled if != 0, otherwise the node is disabled \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, \note_graph_thread_safety \notefnerr \sa ::cuGraphNodeGetEnabled, ::cuGraphExecUpdate, ::cuGraphInstantiate ::cuGraphLaunch*/ fn cuGraphNodeSetEnabled( hGraphExec: cuda_types::cuda::CUgraphExec, hNode: cuda_types::cuda::CUgraphNode, isEnabled: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Query whether a node in the given graphExec is enabled Sets isEnabled to 1 if \p hNode is enabled, or 0 if \p hNode is disabled. The node is identified by the corresponding node \p hNode in the non-executable graph, from which the executable graph was instantiated. \p hNode must not have been removed from the original graph. \note Currently only kernel, memset and memcpy nodes are supported. \note This function will not reflect device-side updates for device-updatable kernel nodes. \param hGraphExec - The executable graph in which to set the specified node \param hNode - Node from the graph from which graphExec was instantiated \param isEnabled - Location to return the enabled status of the node \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, \note_graph_thread_safety \notefnerr \sa ::cuGraphNodeSetEnabled, ::cuGraphExecUpdate, ::cuGraphInstantiate ::cuGraphLaunch*/ fn cuGraphNodeGetEnabled( hGraphExec: cuda_types::cuda::CUgraphExec, hNode: cuda_types::cuda::CUgraphNode, isEnabled: *mut ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Uploads an executable graph in a stream Uploads \p hGraphExec to the device in \p hStream without executing it. Uploads of the same \p hGraphExec will be serialized. Each upload is ordered behind both any previous work in \p hStream and any previous launches of \p hGraphExec. Uses memory cached by \p stream to back the allocations owned by \p hGraphExec. \param hGraphExec - Executable graph to upload \param hStream - Stream in which to upload the graph \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuGraphInstantiate, ::cuGraphLaunch, ::cuGraphExecDestroy*/ fn cuGraphUpload_ptsz( hGraphExec: cuda_types::cuda::CUgraphExec, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Launches an executable graph in a stream Executes \p hGraphExec in \p hStream. Only one instance of \p hGraphExec may be executing at a time. Each launch is ordered behind both any previous work in \p hStream and any previous launches of \p hGraphExec. To execute a graph concurrently, it must be instantiated multiple times into multiple executable graphs. If any allocations created by \p hGraphExec remain unfreed (from a previous launch) and \p hGraphExec was not instantiated with ::CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH, the launch will fail with ::CUDA_ERROR_INVALID_VALUE. \param hGraphExec - Executable graph to launch \param hStream - Stream in which to launch the graph \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuGraphInstantiate, ::cuGraphUpload, ::cuGraphExecDestroy*/ fn cuGraphLaunch_ptsz( hGraphExec: cuda_types::cuda::CUgraphExec, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Destroys an executable graph Destroys the executable graph specified by \p hGraphExec, as well as all of its executable nodes. If the executable graph is in-flight, it will not be terminated, but rather freed asynchronously on completion. \param hGraphExec - Executable graph to destroy \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuGraphInstantiate, ::cuGraphUpload, ::cuGraphLaunch*/ fn cuGraphExecDestroy( hGraphExec: cuda_types::cuda::CUgraphExec, ) -> cuda_types::cuda::CUresult; /** \brief Destroys a graph Destroys the graph specified by \p hGraph, as well as all of its nodes. \param hGraph - Graph to destroy \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \note_graph_thread_safety \notefnerr \sa ::cuGraphCreate*/ fn cuGraphDestroy(hGraph: cuda_types::cuda::CUgraph) -> cuda_types::cuda::CUresult; /** \brief Check whether an executable graph can be updated with a graph and perform the update if possible Updates the node parameters in the instantiated graph specified by \p hGraphExec with the node parameters in a topologically identical graph specified by \p hGraph. Limitations: - Kernel nodes: - The owning context of the function cannot change. - A node whose function originally did not use CUDA dynamic parallelism cannot be updated to a function which uses CDP. - A node whose function originally did not make device-side update calls cannot be updated to a function which makes device-side update calls. - A cooperative node cannot be updated to a non-cooperative node, and vice-versa. - If the graph was instantiated with CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY, the priority attribute cannot change. Equality is checked on the originally requested priority values, before they are clamped to the device's supported range. - If \p hGraphExec was not instantiated for device launch, a node whose function originally did not use device-side cudaGraphLaunch() cannot be updated to a function which uses device-side cudaGraphLaunch() unless the node resides on the same context as nodes which contained such calls at instantiate-time. If no such calls were present at instantiation, these updates cannot be performed at all. - Neither \p hGraph nor \p hGraphExec may contain device-updatable kernel nodes. - Memset and memcpy nodes: - The CUDA device(s) to which the operand(s) was allocated/mapped cannot change. - The source/destination memory must be allocated from the same contexts as the original source/destination memory. - For 2d memsets, only address and assigned value may be updated. - For 1d memsets, updating dimensions is also allowed, but may fail if the resulting operation doesn't map onto the work resources already allocated for the node. - Additional memcpy node restrictions: - Changing either the source or destination memory type(i.e. CU_MEMORYTYPE_DEVICE, CU_MEMORYTYPE_ARRAY, etc.) is not supported. - External semaphore wait nodes and record nodes: - Changing the number of semaphores is not supported. - Conditional nodes: - Changing node parameters is not supported. - Changing parameters of nodes within the conditional body graph is subject to the rules above. - Conditional handle flags and default values are updated as part of the graph update. Note: The API may add further restrictions in future releases. The return code should always be checked. cuGraphExecUpdate sets the result member of \p resultInfo to CU_GRAPH_EXEC_UPDATE_ERROR_TOPOLOGY_CHANGED under the following conditions: - The count of nodes directly in \p hGraphExec and \p hGraph differ, in which case resultInfo->errorNode is set to NULL. - \p hGraph has more exit nodes than \p hGraph, in which case resultInfo->errorNode is set to one of the exit nodes in hGraph. - A node in \p hGraph has a different number of dependencies than the node from \p hGraphExec it is paired with, in which case resultInfo->errorNode is set to the node from \p hGraph. - A node in \p hGraph has a dependency that does not match with the corresponding dependency of the paired node from \p hGraphExec. resultInfo->errorNode will be set to the node from \p hGraph. resultInfo->errorFromNode will be set to the mismatched dependency. The dependencies are paired based on edge order and a dependency does not match when the nodes are already paired based on other edges examined in the graph. cuGraphExecUpdate sets the result member of \p resultInfo to: - CU_GRAPH_EXEC_UPDATE_ERROR if passed an invalid value. - CU_GRAPH_EXEC_UPDATE_ERROR_TOPOLOGY_CHANGED if the graph topology changed - CU_GRAPH_EXEC_UPDATE_ERROR_NODE_TYPE_CHANGED if the type of a node changed, in which case \p hErrorNode_out is set to the node from \p hGraph. - CU_GRAPH_EXEC_UPDATE_ERROR_UNSUPPORTED_FUNCTION_CHANGE if the function changed in an unsupported way(see note above), in which case \p hErrorNode_out is set to the node from \p hGraph - CU_GRAPH_EXEC_UPDATE_ERROR_PARAMETERS_CHANGED if any parameters to a node changed in a way that is not supported, in which case \p hErrorNode_out is set to the node from \p hGraph. - CU_GRAPH_EXEC_UPDATE_ERROR_ATTRIBUTES_CHANGED if any attributes of a node changed in a way that is not supported, in which case \p hErrorNode_out is set to the node from \p hGraph. - CU_GRAPH_EXEC_UPDATE_ERROR_NOT_SUPPORTED if something about a node is unsupported, like the node's type or configuration, in which case \p hErrorNode_out is set to the node from \p hGraph If the update fails for a reason not listed above, the result member of \p resultInfo will be set to CU_GRAPH_EXEC_UPDATE_ERROR. If the update succeeds, the result member will be set to CU_GRAPH_EXEC_UPDATE_SUCCESS. cuGraphExecUpdate returns CUDA_SUCCESS when the updated was performed successfully. It returns CUDA_ERROR_GRAPH_EXEC_UPDATE_FAILURE if the graph update was not performed because it included changes which violated constraints specific to instantiated graph update. \param hGraphExec The instantiated graph to be updated \param hGraph The graph containing the updated parameters \param resultInfo the error info structure \return ::CUDA_SUCCESS, ::CUDA_ERROR_GRAPH_EXEC_UPDATE_FAILURE, \note_graph_thread_safety \notefnerr \sa ::cuGraphInstantiate*/ fn cuGraphExecUpdate_v2( hGraphExec: cuda_types::cuda::CUgraphExec, hGraph: cuda_types::cuda::CUgraph, resultInfo: *mut cuda_types::cuda::CUgraphExecUpdateResultInfo, ) -> cuda_types::cuda::CUresult; /** \brief Copies attributes from source node to destination node. Copies attributes from source node \p src to destination node \p dst. Both node must have the same context. \param[out] dst Destination node \param[in] src Source node For list of attributes see ::CUkernelNodeAttrID \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::CUaccessPolicyWindow*/ fn cuGraphKernelNodeCopyAttributes( dst: cuda_types::cuda::CUgraphNode, src: cuda_types::cuda::CUgraphNode, ) -> cuda_types::cuda::CUresult; /** \brief Queries node attribute. Queries attribute \p attr from node \p hNode and stores it in corresponding member of \p value_out. \param[in] hNode \param[in] attr \param[out] value_out \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE \notefnerr \sa ::CUaccessPolicyWindow*/ fn cuGraphKernelNodeGetAttribute( hNode: cuda_types::cuda::CUgraphNode, attr: cuda_types::cuda::CUkernelNodeAttrID, value_out: *mut cuda_types::cuda::CUkernelNodeAttrValue, ) -> cuda_types::cuda::CUresult; /** \brief Sets node attribute. Sets attribute \p attr on node \p hNode from corresponding attribute of \p value. \param[out] hNode \param[in] attr \param[out] value \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE \notefnerr \sa ::CUaccessPolicyWindow*/ fn cuGraphKernelNodeSetAttribute( hNode: cuda_types::cuda::CUgraphNode, attr: cuda_types::cuda::CUkernelNodeAttrID, value: *const cuda_types::cuda::CUkernelNodeAttrValue, ) -> cuda_types::cuda::CUresult; /** \brief Write a DOT file describing graph structure Using the provided \p hGraph, write to \p path a DOT formatted description of the graph. By default this includes the graph topology, node types, node id, kernel names and memcpy direction. \p flags can be specified to write more detailed information about each node type such as parameter values, kernel attributes, node and function handles. \param hGraph - The graph to create a DOT file from \param path - The path to write the DOT file to \param flags - Flags from CUgraphDebugDot_flags for specifying which additional node information to write \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_OPERATING_SYSTEM*/ fn cuGraphDebugDotPrint( hGraph: cuda_types::cuda::CUgraph, path: *const ::core::ffi::c_char, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Create a user object Create a user object with the specified destructor callback and initial reference count. The initial references are owned by the caller. Destructor callbacks cannot make CUDA API calls and should avoid blocking behavior, as they are executed by a shared internal thread. Another thread may be signaled to perform such actions, if it does not block forward progress of tasks scheduled through CUDA. See CUDA User Objects in the CUDA C++ Programming Guide for more information on user objects. \param object_out - Location to return the user object handle \param ptr - The pointer to pass to the destroy function \param destroy - Callback to free the user object when it is no longer in use \param initialRefcount - The initial refcount to create the object with, typically 1. The initial references are owned by the calling thread. \param flags - Currently it is required to pass ::CU_USER_OBJECT_NO_DESTRUCTOR_SYNC, which is the only defined flag. This indicates that the destroy callback cannot be waited on by any CUDA API. Users requiring synchronization of the callback should signal its completion manually. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE \sa ::cuUserObjectRetain, ::cuUserObjectRelease, ::cuGraphRetainUserObject, ::cuGraphReleaseUserObject, ::cuGraphCreate*/ fn cuUserObjectCreate( object_out: *mut cuda_types::cuda::CUuserObject, ptr: *mut ::core::ffi::c_void, destroy: cuda_types::cuda::CUhostFn, initialRefcount: ::core::ffi::c_uint, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Retain a reference to a user object Retains new references to a user object. The new references are owned by the caller. See CUDA User Objects in the CUDA C++ Programming Guide for more information on user objects. \param object - The object to retain \param count - The number of references to retain, typically 1. Must be nonzero and not larger than INT_MAX. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE \sa ::cuUserObjectCreate, ::cuUserObjectRelease, ::cuGraphRetainUserObject, ::cuGraphReleaseUserObject, ::cuGraphCreate*/ fn cuUserObjectRetain( object: cuda_types::cuda::CUuserObject, count: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Release a reference to a user object Releases user object references owned by the caller. The object's destructor is invoked if the reference count reaches zero. It is undefined behavior to release references not owned by the caller, or to use a user object handle after all references are released. See CUDA User Objects in the CUDA C++ Programming Guide for more information on user objects. \param object - The object to release \param count - The number of references to release, typically 1. Must be nonzero and not larger than INT_MAX. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE \sa ::cuUserObjectCreate, ::cuUserObjectRetain, ::cuGraphRetainUserObject, ::cuGraphReleaseUserObject, ::cuGraphCreate*/ fn cuUserObjectRelease( object: cuda_types::cuda::CUuserObject, count: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Retain a reference to a user object from a graph Creates or moves user object references that will be owned by a CUDA graph. See CUDA User Objects in the CUDA C++ Programming Guide for more information on user objects. \param graph - The graph to associate the reference with \param object - The user object to retain a reference for \param count - The number of references to add to the graph, typically 1. Must be nonzero and not larger than INT_MAX. \param flags - The optional flag ::CU_GRAPH_USER_OBJECT_MOVE transfers references from the calling thread, rather than create new references. Pass 0 to create new references. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE \sa ::cuUserObjectCreate, ::cuUserObjectRetain, ::cuUserObjectRelease, ::cuGraphReleaseUserObject, ::cuGraphCreate*/ fn cuGraphRetainUserObject( graph: cuda_types::cuda::CUgraph, object: cuda_types::cuda::CUuserObject, count: ::core::ffi::c_uint, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Release a user object reference from a graph Releases user object references owned by a graph. See CUDA User Objects in the CUDA C++ Programming Guide for more information on user objects. \param graph - The graph that will release the reference \param object - The user object to release a reference for \param count - The number of references to release, typically 1. Must be nonzero and not larger than INT_MAX. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE \sa ::cuUserObjectCreate, ::cuUserObjectRetain, ::cuUserObjectRelease, ::cuGraphRetainUserObject, ::cuGraphCreate*/ fn cuGraphReleaseUserObject( graph: cuda_types::cuda::CUgraph, object: cuda_types::cuda::CUuserObject, count: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Adds a node of arbitrary type to a graph Creates a new node in \p hGraph described by \p nodeParams with \p numDependencies dependencies specified via \p dependencies. \p numDependencies may be 0. \p dependencies may be null if \p numDependencies is 0. \p dependencies may not have any duplicate entries. \p nodeParams is a tagged union. The node type should be specified in the \p type field, and type-specific parameters in the corresponding union member. All unused bytes - that is, \p reserved0 and all bytes past the utilized union member - must be set to zero. It is recommended to use brace initialization or memset to ensure all bytes are initialized. Note that for some node types, \p nodeParams may contain "out parameters" which are modified during the call, such as \p nodeParams->alloc.dptr. A handle to the new node will be returned in \p phGraphNode. \param phGraphNode - Returns newly created node \param hGraph - Graph to which to add the node \param dependencies - Dependencies of the node \param dependencyData - Optional edge data for the dependencies. If NULL, the data is assumed to be default (zeroed) for all dependencies. \param numDependencies - Number of dependencies \param nodeParams - Specification of the node \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_NOT_SUPPORTED \note_graph_thread_safety \notefnerr \sa ::cuGraphCreate, ::cuGraphNodeSetParams, ::cuGraphExecNodeSetParams*/ fn cuGraphAddNode_v2( phGraphNode: *mut cuda_types::cuda::CUgraphNode, hGraph: cuda_types::cuda::CUgraph, dependencies: *const cuda_types::cuda::CUgraphNode, dependencyData: *const cuda_types::cuda::CUgraphEdgeData, numDependencies: usize, nodeParams: *mut cuda_types::cuda::CUgraphNodeParams, ) -> cuda_types::cuda::CUresult; /** \brief Update's a graph node's parameters Sets the parameters of graph node \p hNode to \p nodeParams. The node type specified by \p nodeParams->type must match the type of \p hNode. \p nodeParams must be fully initialized and all unused bytes (reserved, padding) zeroed. Modifying parameters is not supported for node types CU_GRAPH_NODE_TYPE_MEM_ALLOC and CU_GRAPH_NODE_TYPE_MEM_FREE. \param hNode - Node to set the parameters for \param nodeParams - Parameters to copy \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_SUPPORTED \note_graph_thread_safety \notefnerr \sa ::cuGraphAddNode, ::cuGraphExecNodeSetParams*/ fn cuGraphNodeSetParams( hNode: cuda_types::cuda::CUgraphNode, nodeParams: *mut cuda_types::cuda::CUgraphNodeParams, ) -> cuda_types::cuda::CUresult; /** \brief Update's a graph node's parameters in an instantiated graph Sets the parameters of a node in an executable graph \p hGraphExec. The node is identified by the corresponding node \p hNode in the non-executable graph from which the executable graph was instantiated. \p hNode must not have been removed from the original graph. The modifications only affect future launches of \p hGraphExec. Already enqueued or running launches of \p hGraphExec are not affected by this call. \p hNode is also not modified by this call. Allowed changes to parameters on executable graphs are as follows:
Node typeAllowed changes
kernelSee ::cuGraphExecKernelNodeSetParams
memcpyAddresses for 1-dimensional copies if allocated in same context; see ::cuGraphExecMemcpyNodeSetParams
memsetAddresses for 1-dimensional memsets if allocated in same context; see ::cuGraphExecMemsetNodeSetParams
hostUnrestricted
child graphTopology must match and restrictions apply recursively; see ::cuGraphExecUpdate
event waitUnrestricted
event recordUnrestricted
external semaphore signalNumber of semaphore operations cannot change
external semaphore waitNumber of semaphore operations cannot change
memory allocationAPI unsupported
memory freeAPI unsupported
batch memopsAddresses, values, and operation type for wait operations; see ::cuGraphExecBatchMemOpNodeSetParams
\param hGraphExec - The executable graph in which to update the specified node \param hNode - Corresponding node from the graph from which graphExec was instantiated \param nodeParams - Updated Parameters to set \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_SUPPORTED \note_graph_thread_safety \notefnerr \sa ::cuGraphAddNode, ::cuGraphNodeSetParams ::cuGraphExecUpdate, ::cuGraphInstantiate*/ fn cuGraphExecNodeSetParams( hGraphExec: cuda_types::cuda::CUgraphExec, hNode: cuda_types::cuda::CUgraphNode, nodeParams: *mut cuda_types::cuda::CUgraphNodeParams, ) -> cuda_types::cuda::CUresult; /** \brief Create a conditional handle Creates a conditional handle associated with \p hGraph. The conditional handle must be associated with a conditional node in this graph or one of its children. Handles not associated with a conditional node may cause graph instantiation to fail. Handles can only be set from the context with which they are associated. \param pHandle_out - Pointer used to return the handle to the caller. \param hGraph - Graph which will contain the conditional node using this handle. \param ctx - Context for the handle and associated conditional node. \param defaultLaunchValue - Optional initial value for the conditional variable. Applied at the beginning of each graph execution if CU_GRAPH_COND_ASSIGN_DEFAULT is set in \p flags. \param flags - Currently must be CU_GRAPH_COND_ASSIGN_DEFAULT or 0. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_SUPPORTED \note_graph_thread_safety \notefnerr \sa ::cuGraphAddNode*/ fn cuGraphConditionalHandleCreate( pHandle_out: *mut cuda_types::cuda::CUgraphConditionalHandle, hGraph: cuda_types::cuda::CUgraph, ctx: cuda_types::cuda::CUcontext, defaultLaunchValue: ::core::ffi::c_uint, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Returns occupancy of a function Returns in \p *numBlocks the number of the maximum active blocks per streaming multiprocessor. Note that the API can also be used with context-less kernel ::CUkernel by querying the handle using ::cuLibraryGetKernel() and then passing it to the API by casting to ::CUfunction. Here, the context to use for calculations will be the current context. \param numBlocks - Returned occupancy \param func - Kernel for which occupancy is calculated \param blockSize - Block size the kernel is intended to be launched with \param dynamicSMemSize - Per-block dynamic shared memory usage intended, in bytes \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_UNKNOWN \notefnerr \sa ::cudaOccupancyMaxActiveBlocksPerMultiprocessor*/ fn cuOccupancyMaxActiveBlocksPerMultiprocessor( numBlocks: *mut ::core::ffi::c_int, func: cuda_types::cuda::CUfunction, blockSize: ::core::ffi::c_int, dynamicSMemSize: usize, ) -> cuda_types::cuda::CUresult; /** \brief Returns occupancy of a function Returns in \p *numBlocks the number of the maximum active blocks per streaming multiprocessor. The \p Flags parameter controls how special cases are handled. The valid flags are: - ::CU_OCCUPANCY_DEFAULT, which maintains the default behavior as ::cuOccupancyMaxActiveBlocksPerMultiprocessor; - ::CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE, which suppresses the default behavior on platform where global caching affects occupancy. On such platforms, if caching is enabled, but per-block SM resource usage would result in zero occupancy, the occupancy calculator will calculate the occupancy as if caching is disabled. Setting ::CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE makes the occupancy calculator to return 0 in such cases. More information can be found about this feature in the "Unified L1/Texture Cache" section of the Maxwell tuning guide. Note that the API can also be with launch context-less kernel ::CUkernel by querying the handle using ::cuLibraryGetKernel() and then passing it to the API by casting to ::CUfunction. Here, the context to use for calculations will be the current context. \param numBlocks - Returned occupancy \param func - Kernel for which occupancy is calculated \param blockSize - Block size the kernel is intended to be launched with \param dynamicSMemSize - Per-block dynamic shared memory usage intended, in bytes \param flags - Requested behavior for the occupancy calculator \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_UNKNOWN \notefnerr \sa ::cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags*/ fn cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags( numBlocks: *mut ::core::ffi::c_int, func: cuda_types::cuda::CUfunction, blockSize: ::core::ffi::c_int, dynamicSMemSize: usize, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Suggest a launch configuration with reasonable occupancy Returns in \p *blockSize a reasonable block size that can achieve the maximum occupancy (or, the maximum number of active warps with the fewest blocks per multiprocessor), and in \p *minGridSize the minimum grid size to achieve the maximum occupancy. If \p blockSizeLimit is 0, the configurator will use the maximum block size permitted by the device / function instead. If per-block dynamic shared memory allocation is not needed, the user should leave both \p blockSizeToDynamicSMemSize and \p dynamicSMemSize as 0. If per-block dynamic shared memory allocation is needed, then if the dynamic shared memory size is constant regardless of block size, the size should be passed through \p dynamicSMemSize, and \p blockSizeToDynamicSMemSize should be NULL. Otherwise, if the per-block dynamic shared memory size varies with different block sizes, the user needs to provide a unary function through \p blockSizeToDynamicSMemSize that computes the dynamic shared memory needed by \p func for any given block size. \p dynamicSMemSize is ignored. An example signature is: \code // Take block size, returns dynamic shared memory needed size_t blockToSmem(int blockSize); \endcode Note that the API can also be used with context-less kernel ::CUkernel by querying the handle using ::cuLibraryGetKernel() and then passing it to the API by casting to ::CUfunction. Here, the context to use for calculations will be the current context. \param minGridSize - Returned minimum grid size needed to achieve the maximum occupancy \param blockSize - Returned maximum block size that can achieve the maximum occupancy \param func - Kernel for which launch configuration is calculated \param blockSizeToDynamicSMemSize - A function that calculates how much per-block dynamic shared memory \p func uses based on the block size \param dynamicSMemSize - Dynamic shared memory usage intended, in bytes \param blockSizeLimit - The maximum block size \p func is designed to handle \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_UNKNOWN \notefnerr \sa ::cudaOccupancyMaxPotentialBlockSize*/ fn cuOccupancyMaxPotentialBlockSize( minGridSize: *mut ::core::ffi::c_int, blockSize: *mut ::core::ffi::c_int, func: cuda_types::cuda::CUfunction, blockSizeToDynamicSMemSize: cuda_types::cuda::CUoccupancyB2DSize, dynamicSMemSize: usize, blockSizeLimit: ::core::ffi::c_int, ) -> cuda_types::cuda::CUresult; /** \brief Suggest a launch configuration with reasonable occupancy An extended version of ::cuOccupancyMaxPotentialBlockSize. In addition to arguments passed to ::cuOccupancyMaxPotentialBlockSize, ::cuOccupancyMaxPotentialBlockSizeWithFlags also takes a \p Flags parameter. The \p Flags parameter controls how special cases are handled. The valid flags are: - ::CU_OCCUPANCY_DEFAULT, which maintains the default behavior as ::cuOccupancyMaxPotentialBlockSize; - ::CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE, which suppresses the default behavior on platform where global caching affects occupancy. On such platforms, the launch configurations that produces maximal occupancy might not support global caching. Setting ::CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE guarantees that the the produced launch configuration is global caching compatible at a potential cost of occupancy. More information can be found about this feature in the "Unified L1/Texture Cache" section of the Maxwell tuning guide. Note that the API can also be used with context-less kernel ::CUkernel by querying the handle using ::cuLibraryGetKernel() and then passing it to the API by casting to ::CUfunction. Here, the context to use for calculations will be the current context. \param minGridSize - Returned minimum grid size needed to achieve the maximum occupancy \param blockSize - Returned maximum block size that can achieve the maximum occupancy \param func - Kernel for which launch configuration is calculated \param blockSizeToDynamicSMemSize - A function that calculates how much per-block dynamic shared memory \p func uses based on the block size \param dynamicSMemSize - Dynamic shared memory usage intended, in bytes \param blockSizeLimit - The maximum block size \p func is designed to handle \param flags - Options \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_UNKNOWN \notefnerr \sa ::cudaOccupancyMaxPotentialBlockSizeWithFlags*/ fn cuOccupancyMaxPotentialBlockSizeWithFlags( minGridSize: *mut ::core::ffi::c_int, blockSize: *mut ::core::ffi::c_int, func: cuda_types::cuda::CUfunction, blockSizeToDynamicSMemSize: cuda_types::cuda::CUoccupancyB2DSize, dynamicSMemSize: usize, blockSizeLimit: ::core::ffi::c_int, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Returns dynamic shared memory available per block when launching \p numBlocks blocks on SM Returns in \p *dynamicSmemSize the maximum size of dynamic shared memory to allow \p numBlocks blocks per SM. Note that the API can also be used with context-less kernel ::CUkernel by querying the handle using ::cuLibraryGetKernel() and then passing it to the API by casting to ::CUfunction. Here, the context to use for calculations will be the current context. \param dynamicSmemSize - Returned maximum dynamic shared memory \param func - Kernel function for which occupancy is calculated \param numBlocks - Number of blocks to fit on SM \param blockSize - Size of the blocks \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_UNKNOWN \notefnerr*/ fn cuOccupancyAvailableDynamicSMemPerBlock( dynamicSmemSize: *mut usize, func: cuda_types::cuda::CUfunction, numBlocks: ::core::ffi::c_int, blockSize: ::core::ffi::c_int, ) -> cuda_types::cuda::CUresult; /** \brief Given the kernel function (\p func) and launch configuration (\p config), return the maximum cluster size in \p *clusterSize. The cluster dimensions in \p config are ignored. If func has a required cluster size set (see ::cudaFuncGetAttributes / ::cuFuncGetAttribute),\p *clusterSize will reflect the required cluster size. By default this function will always return a value that's portable on future hardware. A higher value may be returned if the kernel function allows non-portable cluster sizes. This function will respect the compile time launch bounds. Note that the API can also be used with context-less kernel ::CUkernel by querying the handle using ::cuLibraryGetKernel() and then passing it to the API by casting to ::CUfunction. Here, the context to use for calculations will either be taken from the specified stream \p config->hStream or the current context in case of NULL stream. \param clusterSize - Returned maximum cluster size that can be launched for the given kernel function and launch configuration \param func - Kernel function for which maximum cluster size is calculated \param config - Launch configuration for the given kernel function \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_UNKNOWN \notefnerr \sa ::cudaFuncGetAttributes, ::cuFuncGetAttribute*/ fn cuOccupancyMaxPotentialClusterSize( clusterSize: *mut ::core::ffi::c_int, func: cuda_types::cuda::CUfunction, config: *const cuda_types::cuda::CUlaunchConfig, ) -> cuda_types::cuda::CUresult; /** \brief Given the kernel function (\p func) and launch configuration (\p config), return the maximum number of clusters that could co-exist on the target device in \p *numClusters. If the function has required cluster size already set (see ::cudaFuncGetAttributes / ::cuFuncGetAttribute), the cluster size from config must either be unspecified or match the required size. Without required sizes, the cluster size must be specified in config, else the function will return an error. Note that various attributes of the kernel function may affect occupancy calculation. Runtime environment may affect how the hardware schedules the clusters, so the calculated occupancy is not guaranteed to be achievable. Note that the API can also be used with context-less kernel ::CUkernel by querying the handle using ::cuLibraryGetKernel() and then passing it to the API by casting to ::CUfunction. Here, the context to use for calculations will either be taken from the specified stream \p config->hStream or the current context in case of NULL stream. \param numClusters - Returned maximum number of clusters that could co-exist on the target device \param func - Kernel function for which maximum number of clusters are calculated \param config - Launch configuration for the given kernel function \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_CLUSTER_SIZE, ::CUDA_ERROR_UNKNOWN \notefnerr \sa ::cudaFuncGetAttributes, ::cuFuncGetAttribute*/ fn cuOccupancyMaxActiveClusters( numClusters: *mut ::core::ffi::c_int, func: cuda_types::cuda::CUfunction, config: *const cuda_types::cuda::CUlaunchConfig, ) -> cuda_types::cuda::CUresult; /** \brief Binds an array as a texture reference \deprecated Binds the CUDA array \p hArray to the texture reference \p hTexRef. Any previous address or CUDA array state associated with the texture reference is superseded by this function. \p Flags must be set to ::CU_TRSA_OVERRIDE_FORMAT. Any CUDA array previously bound to \p hTexRef is unbound. \param hTexRef - Texture reference to bind \param hArray - Array to bind \param Flags - Options (must be ::CU_TRSA_OVERRIDE_FORMAT) \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTexRefSetAddress, ::cuTexRefSetAddress2D, ::cuTexRefSetAddressMode, ::cuTexRefSetFilterMode, ::cuTexRefSetFlags, ::cuTexRefSetFormat, ::cuTexRefGetAddress, ::cuTexRefGetAddressMode, ::cuTexRefGetArray, ::cuTexRefGetFilterMode, ::cuTexRefGetFlags, ::cuTexRefGetFormat*/ fn cuTexRefSetArray( hTexRef: cuda_types::cuda::CUtexref, hArray: cuda_types::cuda::CUarray, Flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Binds a mipmapped array to a texture reference \deprecated Binds the CUDA mipmapped array \p hMipmappedArray to the texture reference \p hTexRef. Any previous address or CUDA array state associated with the texture reference is superseded by this function. \p Flags must be set to ::CU_TRSA_OVERRIDE_FORMAT. Any CUDA array previously bound to \p hTexRef is unbound. \param hTexRef - Texture reference to bind \param hMipmappedArray - Mipmapped array to bind \param Flags - Options (must be ::CU_TRSA_OVERRIDE_FORMAT) \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTexRefSetAddress, ::cuTexRefSetAddress2D, ::cuTexRefSetAddressMode, ::cuTexRefSetFilterMode, ::cuTexRefSetFlags, ::cuTexRefSetFormat, ::cuTexRefGetAddress, ::cuTexRefGetAddressMode, ::cuTexRefGetArray, ::cuTexRefGetFilterMode, ::cuTexRefGetFlags, ::cuTexRefGetFormat*/ fn cuTexRefSetMipmappedArray( hTexRef: cuda_types::cuda::CUtexref, hMipmappedArray: cuda_types::cuda::CUmipmappedArray, Flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Binds an address as a texture reference \deprecated Binds a linear address range to the texture reference \p hTexRef. Any previous address or CUDA array state associated with the texture reference is superseded by this function. Any memory previously bound to \p hTexRef is unbound. Since the hardware enforces an alignment requirement on texture base addresses, ::cuTexRefSetAddress() passes back a byte offset in \p *ByteOffset that must be applied to texture fetches in order to read from the desired memory. This offset must be divided by the texel size and passed to kernels that read from the texture so they can be applied to the ::tex1Dfetch() function. If the device memory pointer was returned from ::cuMemAlloc(), the offset is guaranteed to be 0 and NULL may be passed as the \p ByteOffset parameter. The total number of elements (or texels) in the linear address range cannot exceed ::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH. The number of elements is computed as (\p bytes / bytesPerElement), where bytesPerElement is determined from the data format and number of components set using ::cuTexRefSetFormat(). \param ByteOffset - Returned byte offset \param hTexRef - Texture reference to bind \param dptr - Device pointer to bind \param bytes - Size of memory to bind in bytes \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTexRefSetAddress2D, ::cuTexRefSetAddressMode, ::cuTexRefSetArray, ::cuTexRefSetFilterMode, ::cuTexRefSetFlags, ::cuTexRefSetFormat, ::cuTexRefGetAddress, ::cuTexRefGetAddressMode, ::cuTexRefGetArray, ::cuTexRefGetFilterMode, ::cuTexRefGetFlags, ::cuTexRefGetFormat*/ fn cuTexRefSetAddress_v2( ByteOffset: *mut usize, hTexRef: cuda_types::cuda::CUtexref, dptr: cuda_types::cuda::CUdeviceptr, bytes: usize, ) -> cuda_types::cuda::CUresult; /** \brief Binds an address as a 2D texture reference \deprecated Binds a linear address range to the texture reference \p hTexRef. Any previous address or CUDA array state associated with the texture reference is superseded by this function. Any memory previously bound to \p hTexRef is unbound. Using a ::tex2D() function inside a kernel requires a call to either ::cuTexRefSetArray() to bind the corresponding texture reference to an array, or ::cuTexRefSetAddress2D() to bind the texture reference to linear memory. Function calls to ::cuTexRefSetFormat() cannot follow calls to ::cuTexRefSetAddress2D() for the same texture reference. It is required that \p dptr be aligned to the appropriate hardware-specific texture alignment. You can query this value using the device attribute ::CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT. If an unaligned \p dptr is supplied, ::CUDA_ERROR_INVALID_VALUE is returned. \p Pitch has to be aligned to the hardware-specific texture pitch alignment. This value can be queried using the device attribute ::CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT. If an unaligned \p Pitch is supplied, ::CUDA_ERROR_INVALID_VALUE is returned. Width and Height, which are specified in elements (or texels), cannot exceed ::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH and ::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT respectively. \p Pitch, which is specified in bytes, cannot exceed ::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH. \param hTexRef - Texture reference to bind \param desc - Descriptor of CUDA array \param dptr - Device pointer to bind \param Pitch - Line pitch in bytes \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTexRefSetAddress, ::cuTexRefSetAddressMode, ::cuTexRefSetArray, ::cuTexRefSetFilterMode, ::cuTexRefSetFlags, ::cuTexRefSetFormat, ::cuTexRefGetAddress, ::cuTexRefGetAddressMode, ::cuTexRefGetArray, ::cuTexRefGetFilterMode, ::cuTexRefGetFlags, ::cuTexRefGetFormat*/ fn cuTexRefSetAddress2D_v3( hTexRef: cuda_types::cuda::CUtexref, desc: *const cuda_types::cuda::CUDA_ARRAY_DESCRIPTOR, dptr: cuda_types::cuda::CUdeviceptr, Pitch: usize, ) -> cuda_types::cuda::CUresult; /** \brief Sets the format for a texture reference \deprecated Specifies the format of the data to be read by the texture reference \p hTexRef. \p fmt and \p NumPackedComponents are exactly analogous to the ::Format and ::NumChannels members of the ::CUDA_ARRAY_DESCRIPTOR structure: They specify the format of each component and the number of components per array element. \param hTexRef - Texture reference \param fmt - Format to set \param NumPackedComponents - Number of components per array element \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTexRefSetAddress, ::cuTexRefSetAddress2D, ::cuTexRefSetAddressMode, ::cuTexRefSetArray, ::cuTexRefSetFilterMode, ::cuTexRefSetFlags, ::cuTexRefGetAddress, ::cuTexRefGetAddressMode, ::cuTexRefGetArray, ::cuTexRefGetFilterMode, ::cuTexRefGetFlags, ::cuTexRefGetFormat, ::cudaCreateChannelDesc*/ fn cuTexRefSetFormat( hTexRef: cuda_types::cuda::CUtexref, fmt: cuda_types::cuda::CUarray_format, NumPackedComponents: ::core::ffi::c_int, ) -> cuda_types::cuda::CUresult; /** \brief Sets the addressing mode for a texture reference \deprecated Specifies the addressing mode \p am for the given dimension \p dim of the texture reference \p hTexRef. If \p dim is zero, the addressing mode is applied to the first parameter of the functions used to fetch from the texture; if \p dim is 1, the second, and so on. ::CUaddress_mode is defined as: \code typedef enum CUaddress_mode_enum { CU_TR_ADDRESS_MODE_WRAP = 0, CU_TR_ADDRESS_MODE_CLAMP = 1, CU_TR_ADDRESS_MODE_MIRROR = 2, CU_TR_ADDRESS_MODE_BORDER = 3 } CUaddress_mode; \endcode Note that this call has no effect if \p hTexRef is bound to linear memory. Also, if the flag, ::CU_TRSF_NORMALIZED_COORDINATES, is not set, the only supported address mode is ::CU_TR_ADDRESS_MODE_CLAMP. \param hTexRef - Texture reference \param dim - Dimension \param am - Addressing mode to set \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTexRefSetAddress, ::cuTexRefSetAddress2D, ::cuTexRefSetArray, ::cuTexRefSetFilterMode, ::cuTexRefSetFlags, ::cuTexRefSetFormat, ::cuTexRefGetAddress, ::cuTexRefGetAddressMode, ::cuTexRefGetArray, ::cuTexRefGetFilterMode, ::cuTexRefGetFlags, ::cuTexRefGetFormat*/ fn cuTexRefSetAddressMode( hTexRef: cuda_types::cuda::CUtexref, dim: ::core::ffi::c_int, am: cuda_types::cuda::CUaddress_mode, ) -> cuda_types::cuda::CUresult; /** \brief Sets the filtering mode for a texture reference \deprecated Specifies the filtering mode \p fm to be used when reading memory through the texture reference \p hTexRef. ::CUfilter_mode_enum is defined as: \code typedef enum CUfilter_mode_enum { CU_TR_FILTER_MODE_POINT = 0, CU_TR_FILTER_MODE_LINEAR = 1 } CUfilter_mode; \endcode Note that this call has no effect if \p hTexRef is bound to linear memory. \param hTexRef - Texture reference \param fm - Filtering mode to set \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTexRefSetAddress, ::cuTexRefSetAddress2D, ::cuTexRefSetAddressMode, ::cuTexRefSetArray, ::cuTexRefSetFlags, ::cuTexRefSetFormat, ::cuTexRefGetAddress, ::cuTexRefGetAddressMode, ::cuTexRefGetArray, ::cuTexRefGetFilterMode, ::cuTexRefGetFlags, ::cuTexRefGetFormat*/ fn cuTexRefSetFilterMode( hTexRef: cuda_types::cuda::CUtexref, fm: cuda_types::cuda::CUfilter_mode, ) -> cuda_types::cuda::CUresult; /** \brief Sets the mipmap filtering mode for a texture reference \deprecated Specifies the mipmap filtering mode \p fm to be used when reading memory through the texture reference \p hTexRef. ::CUfilter_mode_enum is defined as: \code typedef enum CUfilter_mode_enum { CU_TR_FILTER_MODE_POINT = 0, CU_TR_FILTER_MODE_LINEAR = 1 } CUfilter_mode; \endcode Note that this call has no effect if \p hTexRef is not bound to a mipmapped array. \param hTexRef - Texture reference \param fm - Filtering mode to set \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTexRefSetAddress, ::cuTexRefSetAddress2D, ::cuTexRefSetAddressMode, ::cuTexRefSetArray, ::cuTexRefSetFlags, ::cuTexRefSetFormat, ::cuTexRefGetAddress, ::cuTexRefGetAddressMode, ::cuTexRefGetArray, ::cuTexRefGetFilterMode, ::cuTexRefGetFlags, ::cuTexRefGetFormat*/ fn cuTexRefSetMipmapFilterMode( hTexRef: cuda_types::cuda::CUtexref, fm: cuda_types::cuda::CUfilter_mode, ) -> cuda_types::cuda::CUresult; /** \brief Sets the mipmap level bias for a texture reference \deprecated Specifies the mipmap level bias \p bias to be added to the specified mipmap level when reading memory through the texture reference \p hTexRef. Note that this call has no effect if \p hTexRef is not bound to a mipmapped array. \param hTexRef - Texture reference \param bias - Mipmap level bias \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTexRefSetAddress, ::cuTexRefSetAddress2D, ::cuTexRefSetAddressMode, ::cuTexRefSetArray, ::cuTexRefSetFlags, ::cuTexRefSetFormat, ::cuTexRefGetAddress, ::cuTexRefGetAddressMode, ::cuTexRefGetArray, ::cuTexRefGetFilterMode, ::cuTexRefGetFlags, ::cuTexRefGetFormat*/ fn cuTexRefSetMipmapLevelBias( hTexRef: cuda_types::cuda::CUtexref, bias: f32, ) -> cuda_types::cuda::CUresult; /** \brief Sets the mipmap min/max mipmap level clamps for a texture reference \deprecated Specifies the min/max mipmap level clamps, \p minMipmapLevelClamp and \p maxMipmapLevelClamp respectively, to be used when reading memory through the texture reference \p hTexRef. Note that this call has no effect if \p hTexRef is not bound to a mipmapped array. \param hTexRef - Texture reference \param minMipmapLevelClamp - Mipmap min level clamp \param maxMipmapLevelClamp - Mipmap max level clamp \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTexRefSetAddress, ::cuTexRefSetAddress2D, ::cuTexRefSetAddressMode, ::cuTexRefSetArray, ::cuTexRefSetFlags, ::cuTexRefSetFormat, ::cuTexRefGetAddress, ::cuTexRefGetAddressMode, ::cuTexRefGetArray, ::cuTexRefGetFilterMode, ::cuTexRefGetFlags, ::cuTexRefGetFormat*/ fn cuTexRefSetMipmapLevelClamp( hTexRef: cuda_types::cuda::CUtexref, minMipmapLevelClamp: f32, maxMipmapLevelClamp: f32, ) -> cuda_types::cuda::CUresult; /** \brief Sets the maximum anisotropy for a texture reference \deprecated Specifies the maximum anisotropy \p maxAniso to be used when reading memory through the texture reference \p hTexRef. Note that this call has no effect if \p hTexRef is bound to linear memory. \param hTexRef - Texture reference \param maxAniso - Maximum anisotropy \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTexRefSetAddress, ::cuTexRefSetAddress2D, ::cuTexRefSetAddressMode, ::cuTexRefSetArray, ::cuTexRefSetFlags, ::cuTexRefSetFormat, ::cuTexRefGetAddress, ::cuTexRefGetAddressMode, ::cuTexRefGetArray, ::cuTexRefGetFilterMode, ::cuTexRefGetFlags, ::cuTexRefGetFormat*/ fn cuTexRefSetMaxAnisotropy( hTexRef: cuda_types::cuda::CUtexref, maxAniso: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Sets the border color for a texture reference \deprecated Specifies the value of the RGBA color via the \p pBorderColor to the texture reference \p hTexRef. The color value supports only float type and holds color components in the following sequence: pBorderColor[0] holds 'R' component pBorderColor[1] holds 'G' component pBorderColor[2] holds 'B' component pBorderColor[3] holds 'A' component Note that the color values can be set only when the Address mode is set to CU_TR_ADDRESS_MODE_BORDER using ::cuTexRefSetAddressMode. Applications using integer border color values have to "reinterpret_cast" their values to float. \param hTexRef - Texture reference \param pBorderColor - RGBA color \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTexRefSetAddressMode, ::cuTexRefGetAddressMode, ::cuTexRefGetBorderColor*/ fn cuTexRefSetBorderColor( hTexRef: cuda_types::cuda::CUtexref, pBorderColor: *mut f32, ) -> cuda_types::cuda::CUresult; /** \brief Sets the flags for a texture reference \deprecated Specifies optional flags via \p Flags to specify the behavior of data returned through the texture reference \p hTexRef. The valid flags are: - ::CU_TRSF_READ_AS_INTEGER, which suppresses the default behavior of having the texture promote integer data to floating point data in the range [0, 1]. Note that texture with 32-bit integer format would not be promoted, regardless of whether or not this flag is specified; - ::CU_TRSF_NORMALIZED_COORDINATES, which suppresses the default behavior of having the texture coordinates range from [0, Dim) where Dim is the width or height of the CUDA array. Instead, the texture coordinates [0, 1.0) reference the entire breadth of the array dimension; - ::CU_TRSF_DISABLE_TRILINEAR_OPTIMIZATION, which disables any trilinear filtering optimizations. Trilinear optimizations improve texture filtering performance by allowing bilinear filtering on textures in scenarios where it can closely approximate the expected results. \param hTexRef - Texture reference \param Flags - Optional flags to set \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTexRefSetAddress, ::cuTexRefSetAddress2D, ::cuTexRefSetAddressMode, ::cuTexRefSetArray, ::cuTexRefSetFilterMode, ::cuTexRefSetFormat, ::cuTexRefGetAddress, ::cuTexRefGetAddressMode, ::cuTexRefGetArray, ::cuTexRefGetFilterMode, ::cuTexRefGetFlags, ::cuTexRefGetFormat*/ fn cuTexRefSetFlags( hTexRef: cuda_types::cuda::CUtexref, Flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Gets the address associated with a texture reference \deprecated Returns in \p *pdptr the base address bound to the texture reference \p hTexRef, or returns ::CUDA_ERROR_INVALID_VALUE if the texture reference is not bound to any device memory range. \param pdptr - Returned device address \param hTexRef - Texture reference \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTexRefSetAddress, ::cuTexRefSetAddress2D, ::cuTexRefSetAddressMode, ::cuTexRefSetArray, ::cuTexRefSetFilterMode, ::cuTexRefSetFlags, ::cuTexRefSetFormat, ::cuTexRefGetAddressMode, ::cuTexRefGetArray, ::cuTexRefGetFilterMode, ::cuTexRefGetFlags, ::cuTexRefGetFormat*/ fn cuTexRefGetAddress_v2( pdptr: *mut cuda_types::cuda::CUdeviceptr, hTexRef: cuda_types::cuda::CUtexref, ) -> cuda_types::cuda::CUresult; /** \brief Gets the array bound to a texture reference \deprecated Returns in \p *phArray the CUDA array bound to the texture reference \p hTexRef, or returns ::CUDA_ERROR_INVALID_VALUE if the texture reference is not bound to any CUDA array. \param phArray - Returned array \param hTexRef - Texture reference \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTexRefSetAddress, ::cuTexRefSetAddress2D, ::cuTexRefSetAddressMode, ::cuTexRefSetArray, ::cuTexRefSetFilterMode, ::cuTexRefSetFlags, ::cuTexRefSetFormat, ::cuTexRefGetAddress, ::cuTexRefGetAddressMode, ::cuTexRefGetFilterMode, ::cuTexRefGetFlags, ::cuTexRefGetFormat*/ fn cuTexRefGetArray( phArray: *mut cuda_types::cuda::CUarray, hTexRef: cuda_types::cuda::CUtexref, ) -> cuda_types::cuda::CUresult; /** \brief Gets the mipmapped array bound to a texture reference \deprecated Returns in \p *phMipmappedArray the CUDA mipmapped array bound to the texture reference \p hTexRef, or returns ::CUDA_ERROR_INVALID_VALUE if the texture reference is not bound to any CUDA mipmapped array. \param phMipmappedArray - Returned mipmapped array \param hTexRef - Texture reference \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTexRefSetAddress, ::cuTexRefSetAddress2D, ::cuTexRefSetAddressMode, ::cuTexRefSetArray, ::cuTexRefSetFilterMode, ::cuTexRefSetFlags, ::cuTexRefSetFormat, ::cuTexRefGetAddress, ::cuTexRefGetAddressMode, ::cuTexRefGetFilterMode, ::cuTexRefGetFlags, ::cuTexRefGetFormat*/ fn cuTexRefGetMipmappedArray( phMipmappedArray: *mut cuda_types::cuda::CUmipmappedArray, hTexRef: cuda_types::cuda::CUtexref, ) -> cuda_types::cuda::CUresult; /** \brief Gets the addressing mode used by a texture reference \deprecated Returns in \p *pam the addressing mode corresponding to the dimension \p dim of the texture reference \p hTexRef. Currently, the only valid value for \p dim are 0 and 1. \param pam - Returned addressing mode \param hTexRef - Texture reference \param dim - Dimension \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTexRefSetAddress, ::cuTexRefSetAddress2D, ::cuTexRefSetAddressMode, ::cuTexRefSetArray, ::cuTexRefSetFilterMode, ::cuTexRefSetFlags, ::cuTexRefSetFormat, ::cuTexRefGetAddress, ::cuTexRefGetArray, ::cuTexRefGetFilterMode, ::cuTexRefGetFlags, ::cuTexRefGetFormat*/ fn cuTexRefGetAddressMode( pam: *mut cuda_types::cuda::CUaddress_mode, hTexRef: cuda_types::cuda::CUtexref, dim: ::core::ffi::c_int, ) -> cuda_types::cuda::CUresult; /** \brief Gets the filter-mode used by a texture reference \deprecated Returns in \p *pfm the filtering mode of the texture reference \p hTexRef. \param pfm - Returned filtering mode \param hTexRef - Texture reference \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTexRefSetAddress, ::cuTexRefSetAddress2D, ::cuTexRefSetAddressMode, ::cuTexRefSetArray, ::cuTexRefSetFilterMode, ::cuTexRefSetFlags, ::cuTexRefSetFormat, ::cuTexRefGetAddress, ::cuTexRefGetAddressMode, ::cuTexRefGetArray, ::cuTexRefGetFlags, ::cuTexRefGetFormat*/ fn cuTexRefGetFilterMode( pfm: *mut cuda_types::cuda::CUfilter_mode, hTexRef: cuda_types::cuda::CUtexref, ) -> cuda_types::cuda::CUresult; /** \brief Gets the format used by a texture reference \deprecated Returns in \p *pFormat and \p *pNumChannels the format and number of components of the CUDA array bound to the texture reference \p hTexRef. If \p pFormat or \p pNumChannels is NULL, it will be ignored. \param pFormat - Returned format \param pNumChannels - Returned number of components \param hTexRef - Texture reference \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTexRefSetAddress, ::cuTexRefSetAddress2D, ::cuTexRefSetAddressMode, ::cuTexRefSetArray, ::cuTexRefSetFilterMode, ::cuTexRefSetFlags, ::cuTexRefSetFormat, ::cuTexRefGetAddress, ::cuTexRefGetAddressMode, ::cuTexRefGetArray, ::cuTexRefGetFilterMode, ::cuTexRefGetFlags*/ fn cuTexRefGetFormat( pFormat: *mut cuda_types::cuda::CUarray_format, pNumChannels: *mut ::core::ffi::c_int, hTexRef: cuda_types::cuda::CUtexref, ) -> cuda_types::cuda::CUresult; /** \brief Gets the mipmap filtering mode for a texture reference \deprecated Returns the mipmap filtering mode in \p pfm that's used when reading memory through the texture reference \p hTexRef. \param pfm - Returned mipmap filtering mode \param hTexRef - Texture reference \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTexRefSetAddress, ::cuTexRefSetAddress2D, ::cuTexRefSetAddressMode, ::cuTexRefSetArray, ::cuTexRefSetFlags, ::cuTexRefSetFormat, ::cuTexRefGetAddress, ::cuTexRefGetAddressMode, ::cuTexRefGetArray, ::cuTexRefGetFilterMode, ::cuTexRefGetFlags, ::cuTexRefGetFormat*/ fn cuTexRefGetMipmapFilterMode( pfm: *mut cuda_types::cuda::CUfilter_mode, hTexRef: cuda_types::cuda::CUtexref, ) -> cuda_types::cuda::CUresult; /** \brief Gets the mipmap level bias for a texture reference \deprecated Returns the mipmap level bias in \p pBias that's added to the specified mipmap level when reading memory through the texture reference \p hTexRef. \param pbias - Returned mipmap level bias \param hTexRef - Texture reference \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTexRefSetAddress, ::cuTexRefSetAddress2D, ::cuTexRefSetAddressMode, ::cuTexRefSetArray, ::cuTexRefSetFlags, ::cuTexRefSetFormat, ::cuTexRefGetAddress, ::cuTexRefGetAddressMode, ::cuTexRefGetArray, ::cuTexRefGetFilterMode, ::cuTexRefGetFlags, ::cuTexRefGetFormat*/ fn cuTexRefGetMipmapLevelBias( pbias: *mut f32, hTexRef: cuda_types::cuda::CUtexref, ) -> cuda_types::cuda::CUresult; /** \brief Gets the min/max mipmap level clamps for a texture reference \deprecated Returns the min/max mipmap level clamps in \p pminMipmapLevelClamp and \p pmaxMipmapLevelClamp that's used when reading memory through the texture reference \p hTexRef. \param pminMipmapLevelClamp - Returned mipmap min level clamp \param pmaxMipmapLevelClamp - Returned mipmap max level clamp \param hTexRef - Texture reference \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTexRefSetAddress, ::cuTexRefSetAddress2D, ::cuTexRefSetAddressMode, ::cuTexRefSetArray, ::cuTexRefSetFlags, ::cuTexRefSetFormat, ::cuTexRefGetAddress, ::cuTexRefGetAddressMode, ::cuTexRefGetArray, ::cuTexRefGetFilterMode, ::cuTexRefGetFlags, ::cuTexRefGetFormat*/ fn cuTexRefGetMipmapLevelClamp( pminMipmapLevelClamp: *mut f32, pmaxMipmapLevelClamp: *mut f32, hTexRef: cuda_types::cuda::CUtexref, ) -> cuda_types::cuda::CUresult; /** \brief Gets the maximum anisotropy for a texture reference \deprecated Returns the maximum anisotropy in \p pmaxAniso that's used when reading memory through the texture reference \p hTexRef. \param pmaxAniso - Returned maximum anisotropy \param hTexRef - Texture reference \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTexRefSetAddress, ::cuTexRefSetAddress2D, ::cuTexRefSetAddressMode, ::cuTexRefSetArray, ::cuTexRefSetFlags, ::cuTexRefSetFormat, ::cuTexRefGetAddress, ::cuTexRefGetAddressMode, ::cuTexRefGetArray, ::cuTexRefGetFilterMode, ::cuTexRefGetFlags, ::cuTexRefGetFormat*/ fn cuTexRefGetMaxAnisotropy( pmaxAniso: *mut ::core::ffi::c_int, hTexRef: cuda_types::cuda::CUtexref, ) -> cuda_types::cuda::CUresult; /** \brief Gets the border color used by a texture reference \deprecated Returns in \p pBorderColor, values of the RGBA color used by the texture reference \p hTexRef. The color value is of type float and holds color components in the following sequence: pBorderColor[0] holds 'R' component pBorderColor[1] holds 'G' component pBorderColor[2] holds 'B' component pBorderColor[3] holds 'A' component \param hTexRef - Texture reference \param pBorderColor - Returned Type and Value of RGBA color \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTexRefSetAddressMode, ::cuTexRefSetAddressMode, ::cuTexRefSetBorderColor*/ fn cuTexRefGetBorderColor( pBorderColor: *mut f32, hTexRef: cuda_types::cuda::CUtexref, ) -> cuda_types::cuda::CUresult; /** \brief Gets the flags used by a texture reference \deprecated Returns in \p *pFlags the flags of the texture reference \p hTexRef. \param pFlags - Returned flags \param hTexRef - Texture reference \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTexRefSetAddress, ::cuTexRefSetAddress2D, ::cuTexRefSetAddressMode, ::cuTexRefSetArray, ::cuTexRefSetFilterMode, ::cuTexRefSetFlags, ::cuTexRefSetFormat, ::cuTexRefGetAddress, ::cuTexRefGetAddressMode, ::cuTexRefGetArray, ::cuTexRefGetFilterMode, ::cuTexRefGetFormat*/ fn cuTexRefGetFlags( pFlags: *mut ::core::ffi::c_uint, hTexRef: cuda_types::cuda::CUtexref, ) -> cuda_types::cuda::CUresult; /** \brief Creates a texture reference \deprecated Creates a texture reference and returns its handle in \p *pTexRef. Once created, the application must call ::cuTexRefSetArray() or ::cuTexRefSetAddress() to associate the reference with allocated memory. Other texture reference functions are used to specify the format and interpretation (addressing, filtering, etc.) to be used when the memory is read through this texture reference. \param pTexRef - Returned texture reference \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTexRefDestroy*/ fn cuTexRefCreate( pTexRef: *mut cuda_types::cuda::CUtexref, ) -> cuda_types::cuda::CUresult; /** \brief Destroys a texture reference \deprecated Destroys the texture reference specified by \p hTexRef. \param hTexRef - Texture reference to destroy \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTexRefCreate*/ fn cuTexRefDestroy( hTexRef: cuda_types::cuda::CUtexref, ) -> cuda_types::cuda::CUresult; /** \brief Sets the CUDA array for a surface reference. \deprecated Sets the CUDA array \p hArray to be read and written by the surface reference \p hSurfRef. Any previous CUDA array state associated with the surface reference is superseded by this function. \p Flags must be set to 0. The ::CUDA_ARRAY3D_SURFACE_LDST flag must have been set for the CUDA array. Any CUDA array previously bound to \p hSurfRef is unbound. \param hSurfRef - Surface reference handle \param hArray - CUDA array handle \param Flags - set to 0 \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuModuleGetSurfRef, ::cuSurfRefGetArray*/ fn cuSurfRefSetArray( hSurfRef: cuda_types::cuda::CUsurfref, hArray: cuda_types::cuda::CUarray, Flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Passes back the CUDA array bound to a surface reference. \deprecated Returns in \p *phArray the CUDA array bound to the surface reference \p hSurfRef, or returns ::CUDA_ERROR_INVALID_VALUE if the surface reference is not bound to any CUDA array. \param phArray - Surface reference handle \param hSurfRef - Surface reference handle \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuModuleGetSurfRef, ::cuSurfRefSetArray*/ fn cuSurfRefGetArray( phArray: *mut cuda_types::cuda::CUarray, hSurfRef: cuda_types::cuda::CUsurfref, ) -> cuda_types::cuda::CUresult; /** \brief Creates a texture object Creates a texture object and returns it in \p pTexObject. \p pResDesc describes the data to texture from. \p pTexDesc describes how the data should be sampled. \p pResViewDesc is an optional argument that specifies an alternate format for the data described by \p pResDesc, and also describes the subresource region to restrict access to when texturing. \p pResViewDesc can only be specified if the type of resource is a CUDA array or a CUDA mipmapped array not in a block compressed format. Texture objects are only supported on devices of compute capability 3.0 or higher. Additionally, a texture object is an opaque value, and, as such, should only be accessed through CUDA API calls. The ::CUDA_RESOURCE_DESC structure is defined as: \code typedef struct CUDA_RESOURCE_DESC_st { CUresourcetype resType; union { struct { CUarray hArray; } array; struct { CUmipmappedArray hMipmappedArray; } mipmap; struct { CUdeviceptr devPtr; CUarray_format format; unsigned int numChannels; size_t sizeInBytes; } linear; struct { CUdeviceptr devPtr; CUarray_format format; unsigned int numChannels; size_t width; size_t height; size_t pitchInBytes; } pitch2D; } res; unsigned int flags; } CUDA_RESOURCE_DESC; \endcode where: - ::CUDA_RESOURCE_DESC::resType specifies the type of resource to texture from. CUresourceType is defined as: \code typedef enum CUresourcetype_enum { CU_RESOURCE_TYPE_ARRAY = 0x00, CU_RESOURCE_TYPE_MIPMAPPED_ARRAY = 0x01, CU_RESOURCE_TYPE_LINEAR = 0x02, CU_RESOURCE_TYPE_PITCH2D = 0x03 } CUresourcetype; \endcode \par If ::CUDA_RESOURCE_DESC::resType is set to ::CU_RESOURCE_TYPE_ARRAY, ::CUDA_RESOURCE_DESC::res::array::hArray must be set to a valid CUDA array handle. \par If ::CUDA_RESOURCE_DESC::resType is set to ::CU_RESOURCE_TYPE_MIPMAPPED_ARRAY, ::CUDA_RESOURCE_DESC::res::mipmap::hMipmappedArray must be set to a valid CUDA mipmapped array handle. \par If ::CUDA_RESOURCE_DESC::resType is set to ::CU_RESOURCE_TYPE_LINEAR, ::CUDA_RESOURCE_DESC::res::linear::devPtr must be set to a valid device pointer, that is aligned to ::CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT. ::CUDA_RESOURCE_DESC::res::linear::format and ::CUDA_RESOURCE_DESC::res::linear::numChannels describe the format of each component and the number of components per array element. ::CUDA_RESOURCE_DESC::res::linear::sizeInBytes specifies the size of the array in bytes. The total number of elements in the linear address range cannot exceed ::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH. The number of elements is computed as (sizeInBytes / (sizeof(format) * numChannels)). \par If ::CUDA_RESOURCE_DESC::resType is set to ::CU_RESOURCE_TYPE_PITCH2D, ::CUDA_RESOURCE_DESC::res::pitch2D::devPtr must be set to a valid device pointer, that is aligned to ::CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT. ::CUDA_RESOURCE_DESC::res::pitch2D::format and ::CUDA_RESOURCE_DESC::res::pitch2D::numChannels describe the format of each component and the number of components per array element. ::CUDA_RESOURCE_DESC::res::pitch2D::width and ::CUDA_RESOURCE_DESC::res::pitch2D::height specify the width and height of the array in elements, and cannot exceed ::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH and ::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT respectively. ::CUDA_RESOURCE_DESC::res::pitch2D::pitchInBytes specifies the pitch between two rows in bytes and has to be aligned to ::CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT. Pitch cannot exceed ::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH. - ::flags must be set to zero. The ::CUDA_TEXTURE_DESC struct is defined as \code typedef struct CUDA_TEXTURE_DESC_st { CUaddress_mode addressMode[3]; CUfilter_mode filterMode; unsigned int flags; unsigned int maxAnisotropy; CUfilter_mode mipmapFilterMode; float mipmapLevelBias; float minMipmapLevelClamp; float maxMipmapLevelClamp; } CUDA_TEXTURE_DESC; \endcode where - ::CUDA_TEXTURE_DESC::addressMode specifies the addressing mode for each dimension of the texture data. ::CUaddress_mode is defined as: \code typedef enum CUaddress_mode_enum { CU_TR_ADDRESS_MODE_WRAP = 0, CU_TR_ADDRESS_MODE_CLAMP = 1, CU_TR_ADDRESS_MODE_MIRROR = 2, CU_TR_ADDRESS_MODE_BORDER = 3 } CUaddress_mode; \endcode This is ignored if ::CUDA_RESOURCE_DESC::resType is ::CU_RESOURCE_TYPE_LINEAR. Also, if the flag, ::CU_TRSF_NORMALIZED_COORDINATES is not set, the only supported address mode is ::CU_TR_ADDRESS_MODE_CLAMP. - ::CUDA_TEXTURE_DESC::filterMode specifies the filtering mode to be used when fetching from the texture. CUfilter_mode is defined as: \code typedef enum CUfilter_mode_enum { CU_TR_FILTER_MODE_POINT = 0, CU_TR_FILTER_MODE_LINEAR = 1 } CUfilter_mode; \endcode This is ignored if ::CUDA_RESOURCE_DESC::resType is ::CU_RESOURCE_TYPE_LINEAR. - ::CUDA_TEXTURE_DESC::flags can be any combination of the following: - ::CU_TRSF_READ_AS_INTEGER, which suppresses the default behavior of having the texture promote integer data to floating point data in the range [0, 1]. Note that texture with 32-bit integer format would not be promoted, regardless of whether or not this flag is specified. - ::CU_TRSF_NORMALIZED_COORDINATES, which suppresses the default behavior of having the texture coordinates range from [0, Dim) where Dim is the width or height of the CUDA array. Instead, the texture coordinates [0, 1.0) reference the entire breadth of the array dimension; Note that for CUDA mipmapped arrays, this flag has to be set. - ::CU_TRSF_DISABLE_TRILINEAR_OPTIMIZATION, which disables any trilinear filtering optimizations. Trilinear optimizations improve texture filtering performance by allowing bilinear filtering on textures in scenarios where it can closely approximate the expected results. - ::CU_TRSF_SEAMLESS_CUBEMAP, which enables seamless cube map filtering. This flag can only be specified if the underlying resource is a CUDA array or a CUDA mipmapped array that was created with the flag ::CUDA_ARRAY3D_CUBEMAP. When seamless cube map filtering is enabled, texture address modes specified by ::CUDA_TEXTURE_DESC::addressMode are ignored. Instead, if the ::CUDA_TEXTURE_DESC::filterMode is set to ::CU_TR_FILTER_MODE_POINT the address mode ::CU_TR_ADDRESS_MODE_CLAMP will be applied for all dimensions. If the ::CUDA_TEXTURE_DESC::filterMode is set to ::CU_TR_FILTER_MODE_LINEAR seamless cube map filtering will be performed when sampling along the cube face borders. - ::CUDA_TEXTURE_DESC::maxAnisotropy specifies the maximum anisotropy ratio to be used when doing anisotropic filtering. This value will be clamped to the range [1,16]. - ::CUDA_TEXTURE_DESC::mipmapFilterMode specifies the filter mode when the calculated mipmap level lies between two defined mipmap levels. - ::CUDA_TEXTURE_DESC::mipmapLevelBias specifies the offset to be applied to the calculated mipmap level. - ::CUDA_TEXTURE_DESC::minMipmapLevelClamp specifies the lower end of the mipmap level range to clamp access to. - ::CUDA_TEXTURE_DESC::maxMipmapLevelClamp specifies the upper end of the mipmap level range to clamp access to. The ::CUDA_RESOURCE_VIEW_DESC struct is defined as \code typedef struct CUDA_RESOURCE_VIEW_DESC_st { CUresourceViewFormat format; size_t width; size_t height; size_t depth; unsigned int firstMipmapLevel; unsigned int lastMipmapLevel; unsigned int firstLayer; unsigned int lastLayer; } CUDA_RESOURCE_VIEW_DESC; \endcode where: - ::CUDA_RESOURCE_VIEW_DESC::format specifies how the data contained in the CUDA array or CUDA mipmapped array should be interpreted. Note that this can incur a change in size of the texture data. If the resource view format is a block compressed format, then the underlying CUDA array or CUDA mipmapped array has to have a base of format ::CU_AD_FORMAT_UNSIGNED_INT32. with 2 or 4 channels, depending on the block compressed format. For ex., BC1 and BC4 require the underlying CUDA array to have a format of ::CU_AD_FORMAT_UNSIGNED_INT32 with 2 channels. The other BC formats require the underlying resource to have the same base format but with 4 channels. - ::CUDA_RESOURCE_VIEW_DESC::width specifies the new width of the texture data. If the resource view format is a block compressed format, this value has to be 4 times the original width of the resource. For non block compressed formats, this value has to be equal to that of the original resource. - ::CUDA_RESOURCE_VIEW_DESC::height specifies the new height of the texture data. If the resource view format is a block compressed format, this value has to be 4 times the original height of the resource. For non block compressed formats, this value has to be equal to that of the original resource. - ::CUDA_RESOURCE_VIEW_DESC::depth specifies the new depth of the texture data. This value has to be equal to that of the original resource. - ::CUDA_RESOURCE_VIEW_DESC::firstMipmapLevel specifies the most detailed mipmap level. This will be the new mipmap level zero. For non-mipmapped resources, this value has to be zero.::CUDA_TEXTURE_DESC::minMipmapLevelClamp and ::CUDA_TEXTURE_DESC::maxMipmapLevelClamp will be relative to this value. For ex., if the firstMipmapLevel is set to 2, and a minMipmapLevelClamp of 1.2 is specified, then the actual minimum mipmap level clamp will be 3.2. - ::CUDA_RESOURCE_VIEW_DESC::lastMipmapLevel specifies the least detailed mipmap level. For non-mipmapped resources, this value has to be zero. - ::CUDA_RESOURCE_VIEW_DESC::firstLayer specifies the first layer index for layered textures. This will be the new layer zero. For non-layered resources, this value has to be zero. - ::CUDA_RESOURCE_VIEW_DESC::lastLayer specifies the last layer index for layered textures. For non-layered resources, this value has to be zero. \param pTexObject - Texture object to create \param pResDesc - Resource descriptor \param pTexDesc - Texture descriptor \param pResViewDesc - Resource view descriptor \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTexObjectDestroy, ::cudaCreateTextureObject*/ fn cuTexObjectCreate( pTexObject: *mut cuda_types::cuda::CUtexObject, pResDesc: *const cuda_types::cuda::CUDA_RESOURCE_DESC, pTexDesc: *const cuda_types::cuda::CUDA_TEXTURE_DESC, pResViewDesc: *const cuda_types::cuda::CUDA_RESOURCE_VIEW_DESC, ) -> cuda_types::cuda::CUresult; /** \brief Destroys a texture object Destroys the texture object specified by \p texObject. \param texObject - Texture object to destroy \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTexObjectCreate, ::cudaDestroyTextureObject*/ fn cuTexObjectDestroy( texObject: cuda_types::cuda::CUtexObject, ) -> cuda_types::cuda::CUresult; /** \brief Returns a texture object's resource descriptor Returns the resource descriptor for the texture object specified by \p texObject. \param pResDesc - Resource descriptor \param texObject - Texture object \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTexObjectCreate, ::cudaGetTextureObjectResourceDesc,*/ fn cuTexObjectGetResourceDesc( pResDesc: *mut cuda_types::cuda::CUDA_RESOURCE_DESC, texObject: cuda_types::cuda::CUtexObject, ) -> cuda_types::cuda::CUresult; /** \brief Returns a texture object's texture descriptor Returns the texture descriptor for the texture object specified by \p texObject. \param pTexDesc - Texture descriptor \param texObject - Texture object \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTexObjectCreate, ::cudaGetTextureObjectTextureDesc*/ fn cuTexObjectGetTextureDesc( pTexDesc: *mut cuda_types::cuda::CUDA_TEXTURE_DESC, texObject: cuda_types::cuda::CUtexObject, ) -> cuda_types::cuda::CUresult; /** \brief Returns a texture object's resource view descriptor Returns the resource view descriptor for the texture object specified by \p texObject. If no resource view was set for \p texObject, the ::CUDA_ERROR_INVALID_VALUE is returned. \param pResViewDesc - Resource view descriptor \param texObject - Texture object \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTexObjectCreate, ::cudaGetTextureObjectResourceViewDesc*/ fn cuTexObjectGetResourceViewDesc( pResViewDesc: *mut cuda_types::cuda::CUDA_RESOURCE_VIEW_DESC, texObject: cuda_types::cuda::CUtexObject, ) -> cuda_types::cuda::CUresult; /** \brief Creates a surface object Creates a surface object and returns it in \p pSurfObject. \p pResDesc describes the data to perform surface load/stores on. ::CUDA_RESOURCE_DESC::resType must be ::CU_RESOURCE_TYPE_ARRAY and ::CUDA_RESOURCE_DESC::res::array::hArray must be set to a valid CUDA array handle. ::CUDA_RESOURCE_DESC::flags must be set to zero. Surface objects are only supported on devices of compute capability 3.0 or higher. Additionally, a surface object is an opaque value, and, as such, should only be accessed through CUDA API calls. \param pSurfObject - Surface object to create \param pResDesc - Resource descriptor \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuSurfObjectDestroy, ::cudaCreateSurfaceObject*/ fn cuSurfObjectCreate( pSurfObject: *mut cuda_types::cuda::CUsurfObject, pResDesc: *const cuda_types::cuda::CUDA_RESOURCE_DESC, ) -> cuda_types::cuda::CUresult; /** \brief Destroys a surface object Destroys the surface object specified by \p surfObject. \param surfObject - Surface object to destroy \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuSurfObjectCreate, ::cudaDestroySurfaceObject*/ fn cuSurfObjectDestroy( surfObject: cuda_types::cuda::CUsurfObject, ) -> cuda_types::cuda::CUresult; /** \brief Returns a surface object's resource descriptor Returns the resource descriptor for the surface object specified by \p surfObject. \param pResDesc - Resource descriptor \param surfObject - Surface object \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuSurfObjectCreate, ::cudaGetSurfaceObjectResourceDesc*/ fn cuSurfObjectGetResourceDesc( pResDesc: *mut cuda_types::cuda::CUDA_RESOURCE_DESC, surfObject: cuda_types::cuda::CUsurfObject, ) -> cuda_types::cuda::CUresult; /** \brief Create a tensor map descriptor object representing tiled memory region Creates a descriptor for Tensor Memory Access (TMA) object specified by the parameters describing a tiled region and returns it in \p tensorMap. Tensor map objects are only supported on devices of compute capability 9.0 or higher. Additionally, a tensor map object is an opaque value, and, as such, should only be accessed through CUDA APIs and PTX. The parameters passed are bound to the following requirements: - \p tensorMap address must be aligned to 64 bytes. - \p tensorDataType has to be an enum from ::CUtensorMapDataType which is defined as: \code typedef enum CUtensorMapDataType_enum { CU_TENSOR_MAP_DATA_TYPE_UINT8 = 0, // 1 byte CU_TENSOR_MAP_DATA_TYPE_UINT16, // 2 bytes CU_TENSOR_MAP_DATA_TYPE_UINT32, // 4 bytes CU_TENSOR_MAP_DATA_TYPE_INT32, // 4 bytes CU_TENSOR_MAP_DATA_TYPE_UINT64, // 8 bytes CU_TENSOR_MAP_DATA_TYPE_INT64, // 8 bytes CU_TENSOR_MAP_DATA_TYPE_FLOAT16, // 2 bytes CU_TENSOR_MAP_DATA_TYPE_FLOAT32, // 4 bytes CU_TENSOR_MAP_DATA_TYPE_FLOAT64, // 8 bytes CU_TENSOR_MAP_DATA_TYPE_BFLOAT16, // 2 bytes CU_TENSOR_MAP_DATA_TYPE_FLOAT32_FTZ, // 4 bytes CU_TENSOR_MAP_DATA_TYPE_TFLOAT32, // 4 bytes CU_TENSOR_MAP_DATA_TYPE_TFLOAT32_FTZ, // 4 bytes CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B, // 4 bits CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B, // 4 bits CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B // 6 bits } CUtensorMapDataType; \endcode ::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B copies '16 x U4' packed values to memory aligned as 8 bytes. There are no gaps between packed values. ::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B copies '16 x U4' packed values to memory aligned as 16 bytes. There are 8 byte gaps between every 8 byte chunk of packed values. ::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B copies '16 x U6' packed values to memory aligned as 16 bytes. There are 4 byte gaps between every 12 byte chunk of packed values. - \p tensorRank must be non-zero and less than or equal to the maximum supported dimensionality of 5. If \p interleave is not ::CU_TENSOR_MAP_INTERLEAVE_NONE, then \p tensorRank must additionally be greater than or equal to 3. - \p globalAddress, which specifies the starting address of the memory region described, must be 16 byte aligned. The following requirements need to also be met: - When \p interleave is ::CU_TENSOR_MAP_INTERLEAVE_32B, \p globalAddress must be 32 byte aligned. - When \p tensorDataType is ::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B or ::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B, \p globalAddress must be 32 byte aligned. - \p globalDim array, which specifies tensor size of each of the \p tensorRank dimensions, must be non-zero and less than or equal to 2^32. Additionally, the following requirements need to be met for the packed data types: - When \p tensorDataType is ::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B or ::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B, globalDim[0] must be a multiple of 128. - When \p tensorDataType is ::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B, \p globalDim[0] must be a multiple of 2. - Dimension for the packed data types must reflect the number of individual U# values. - \p globalStrides array, which specifies tensor stride of each of the lower \p tensorRank - 1 dimensions in bytes, must be a multiple of 16 and less than 2^40. Additionally, the following requirements need to be met: - When \p interleave is ::CU_TENSOR_MAP_INTERLEAVE_32B, the strides must be a multiple of 32. - When \p tensorDataType is ::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B or ::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B, the strides must be a multiple of 32. Each following dimension specified includes previous dimension stride: \code globalStrides[0] = globalDim[0] * elementSizeInBytes(tensorDataType) + padding[0]; for (i = 1; i < tensorRank - 1; i++) globalStrides[i] = globalStrides[i – 1] * (globalDim[i] + padding[i]); assert(globalStrides[i] >= globalDim[i]); \endcode - \p boxDim array, which specifies number of elements to be traversed along each of the \p tensorRank dimensions, must be non-zero and less than or equal to 256. Additionally, the following requirements need to be met: - When \p interleave is ::CU_TENSOR_MAP_INTERLEAVE_NONE, { \p boxDim[0] * elementSizeInBytes( \p tensorDataType ) } must be a multiple of 16 bytes. - When \p tensorDataType is ::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B or ::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B, boxDim[0] must be 128. - \p elementStrides array, which specifies the iteration step along each of the \p tensorRank dimensions, must be non-zero and less than or equal to 8. Note that when \p interleave is ::CU_TENSOR_MAP_INTERLEAVE_NONE, the first element of this array is ignored since TMA doesn’t support the stride for dimension zero. When all elements of \p elementStrides array is one, \p boxDim specifies the number of elements to load. However, if the \p elementStrides[i] is not equal to one, then TMA loads ceil( \p boxDim[i] / \p elementStrides[i]) number of elements along i-th dimension. To load N elements along i-th dimension, \p boxDim[i] must be set to N * \p elementStrides[i]. - \p interleave specifies the interleaved layout of type ::CUtensorMapInterleave, which is defined as: \code typedef enum CUtensorMapInterleave_enum { CU_TENSOR_MAP_INTERLEAVE_NONE = 0, CU_TENSOR_MAP_INTERLEAVE_16B, CU_TENSOR_MAP_INTERLEAVE_32B } CUtensorMapInterleave; \endcode TMA supports interleaved layouts like NC/8HWC8 where C8 utilizes 16 bytes in memory assuming 2 byte per channel or NC/16HWC16 where C16 uses 32 bytes. When \p interleave is ::CU_TENSOR_MAP_INTERLEAVE_NONE and \p swizzle is not ::CU_TENSOR_MAP_SWIZZLE_NONE, the bounding box inner dimension (computed as \p boxDim[0] multiplied by element size derived from \p tensorDataType) must be less than or equal to the swizzle size. - CU_TENSOR_MAP_SWIZZLE_32B requires the bounding box inner dimension to be <= 32. - CU_TENSOR_MAP_SWIZZLE_64B requires the bounding box inner dimension to be <= 64. - CU_TENSOR_MAP_SWIZZLE_128B* require the bounding box inner dimension to be <= 128. Additionally, \p tensorDataType of ::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B requires \p interleave to be ::CU_TENSOR_MAP_INTERLEAVE_NONE. - \p swizzle, which specifies the shared memory bank swizzling pattern, has to be of type ::CUtensorMapSwizzle which is defined as: \code typedef enum CUtensorMapSwizzle_enum { CU_TENSOR_MAP_SWIZZLE_NONE = 0, CU_TENSOR_MAP_SWIZZLE_32B, // Swizzle 16B chunks within 32B span CU_TENSOR_MAP_SWIZZLE_64B, // Swizzle 16B chunks within 64B span CU_TENSOR_MAP_SWIZZLE_128B, // Swizzle 16B chunks within 128B span CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B, // Swizzle 32B chunks within 128B span CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B_FLIP_8B, // Swizzle 32B chunks within 128B span, additionally swap lower 8B with upper 8B within each 16B for every alternate row CU_TENSOR_MAP_SWIZZLE_128B_ATOM_64B // Swizzle 64B chunks within 128B span } CUtensorMapSwizzle; \endcode Data are organized in a specific order in global memory; however, this may not match the order in which the application accesses data in shared memory. This difference in data organization may cause bank conflicts when shared memory is accessed. In order to avoid this problem, data can be loaded to shared memory with shuffling across shared memory banks. When \p interleave is ::CU_TENSOR_MAP_INTERLEAVE_32B, \p swizzle must be ::CU_TENSOR_MAP_SWIZZLE_32B. Other interleave modes can have any swizzling pattern. When the \p tensorDataType is ::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B, only the following swizzle modes are supported: - CU_TENSOR_MAP_SWIZZLE_NONE (Load & Store) - CU_TENSOR_MAP_SWIZZLE_128B (Load & Store) - CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B (Load & Store) - CU_TENSOR_MAP_SWIZZLE_128B_ATOM_64B (Store only) When the \p tensorDataType is ::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B, only the following swizzle modes are supported: - CU_TENSOR_MAP_SWIZZLE_NONE (Load only) - CU_TENSOR_MAP_SWIZZLE_128B (Load only) - CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B (Load only) - \p l2Promotion specifies L2 fetch size which indicates the byte granurality at which L2 requests is filled from DRAM. It must be of type ::CUtensorMapL2promotion, which is defined as: \code typedef enum CUtensorMapL2promotion_enum { CU_TENSOR_MAP_L2_PROMOTION_NONE = 0, CU_TENSOR_MAP_L2_PROMOTION_L2_64B, CU_TENSOR_MAP_L2_PROMOTION_L2_128B, CU_TENSOR_MAP_L2_PROMOTION_L2_256B } CUtensorMapL2promotion; \endcode - \p oobFill, which indicates whether zero or a special NaN constant should be used to fill out-of-bound elements, must be of type ::CUtensorMapFloatOOBfill which is defined as: \code typedef enum CUtensorMapFloatOOBfill_enum { CU_TENSOR_MAP_FLOAT_OOB_FILL_NONE = 0, CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA } CUtensorMapFloatOOBfill; \endcode Note that ::CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA can only be used when \p tensorDataType represents a floating-point data type, and when \p tensorDataType is not ::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B, ::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B, and ::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B. \param tensorMap - Tensor map object to create \param tensorDataType - Tensor data type \param tensorRank - Dimensionality of tensor \param globalAddress - Starting address of memory region described by tensor \param globalDim - Array containing tensor size (number of elements) along each of the \p tensorRank dimensions \param globalStrides - Array containing stride size (in bytes) along each of the \p tensorRank - 1 dimensions \param boxDim - Array containing traversal box size (number of elments) along each of the \p tensorRank dimensions. Specifies how many elements to be traversed along each tensor dimension. \param elementStrides - Array containing traversal stride in each of the \p tensorRank dimensions \param interleave - Type of interleaved layout the tensor addresses \param swizzle - Bank swizzling pattern inside shared memory \param l2Promotion - L2 promotion size \param oobFill - Indicate whether zero or special NaN constant must be used to fill out-of-bound elements \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTensorMapEncodeIm2col, ::cuTensorMapEncodeIm2colWide, ::cuTensorMapReplaceAddress*/ fn cuTensorMapEncodeTiled( tensorMap: *mut cuda_types::cuda::CUtensorMap, tensorDataType: cuda_types::cuda::CUtensorMapDataType, tensorRank: cuda_types::cuda::cuuint32_t, globalAddress: *mut ::core::ffi::c_void, globalDim: *const cuda_types::cuda::cuuint64_t, globalStrides: *const cuda_types::cuda::cuuint64_t, boxDim: *const cuda_types::cuda::cuuint32_t, elementStrides: *const cuda_types::cuda::cuuint32_t, interleave: cuda_types::cuda::CUtensorMapInterleave, swizzle: cuda_types::cuda::CUtensorMapSwizzle, l2Promotion: cuda_types::cuda::CUtensorMapL2promotion, oobFill: cuda_types::cuda::CUtensorMapFloatOOBfill, ) -> cuda_types::cuda::CUresult; /** \brief Create a tensor map descriptor object representing im2col memory region Creates a descriptor for Tensor Memory Access (TMA) object specified by the parameters describing a im2col memory layout and returns it in \p tensorMap. Tensor map objects are only supported on devices of compute capability 9.0 or higher. Additionally, a tensor map object is an opaque value, and, as such, should only be accessed through CUDA APIs and PTX. The parameters passed are bound to the following requirements: - \p tensorMap address must be aligned to 64 bytes. - \p tensorDataType has to be an enum from ::CUtensorMapDataType which is defined as: \code typedef enum CUtensorMapDataType_enum { CU_TENSOR_MAP_DATA_TYPE_UINT8 = 0, // 1 byte CU_TENSOR_MAP_DATA_TYPE_UINT16, // 2 bytes CU_TENSOR_MAP_DATA_TYPE_UINT32, // 4 bytes CU_TENSOR_MAP_DATA_TYPE_INT32, // 4 bytes CU_TENSOR_MAP_DATA_TYPE_UINT64, // 8 bytes CU_TENSOR_MAP_DATA_TYPE_INT64, // 8 bytes CU_TENSOR_MAP_DATA_TYPE_FLOAT16, // 2 bytes CU_TENSOR_MAP_DATA_TYPE_FLOAT32, // 4 bytes CU_TENSOR_MAP_DATA_TYPE_FLOAT64, // 8 bytes CU_TENSOR_MAP_DATA_TYPE_BFLOAT16, // 2 bytes CU_TENSOR_MAP_DATA_TYPE_FLOAT32_FTZ, // 4 bytes CU_TENSOR_MAP_DATA_TYPE_TFLOAT32, // 4 bytes CU_TENSOR_MAP_DATA_TYPE_TFLOAT32_FTZ // 4 bytes CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B, // 4 bits CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B, // 4 bits CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B // 6 bits } CUtensorMapDataType; \endcode ::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B copies '16 x U4' packed values to memory aligned as 8 bytes. There are no gaps between packed values. ::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B copies '16 x U4' packed values to memory aligned as 16 bytes. There are 8 byte gaps between every 8 byte chunk of packed values. ::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B copies '16 x U6' packed values to memory aligned as 16 bytes. There are 4 byte gaps between every 12 byte chunk of packed values. - \p tensorRank, which specifies the number of tensor dimensions, must be 3, 4, or 5. - \p globalAddress, which specifies the starting address of the memory region described, must be 16 byte aligned. The following requirements need to also be met: - When \p interleave is ::CU_TENSOR_MAP_INTERLEAVE_32B, \p globalAddress must be 32 byte aligned. - When \p tensorDataType is ::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B or ::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B, \p globalAddress must be 32 byte aligned. - \p globalDim array, which specifies tensor size of each of the \p tensorRank dimensions, must be non-zero and less than or equal to 2^32. Additionally, the following requirements need to be met for the packed data types: - When \p tensorDataType is ::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B or ::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B, globalDim[0] must be a multiple of 128. - When \p tensorDataType is ::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B, \p globalDim[0] must be a multiple of 2. - Dimension for the packed data types must reflect the number of individual U# values. - \p globalStrides array, which specifies tensor stride of each of the lower \p tensorRank - 1 dimensions in bytes, must be a multiple of 16 and less than 2^40. Additionally, the following requirements need to be met: - When \p interleave is ::CU_TENSOR_MAP_INTERLEAVE_32B, the strides must be a multiple of 32. - When \p tensorDataType is ::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B or ::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B, the strides must be a multiple of 32. Each following dimension specified includes previous dimension stride: \code globalStrides[0] = globalDim[0] * elementSizeInBytes(tensorDataType) + padding[0]; for (i = 1; i < tensorRank - 1; i++) globalStrides[i] = globalStrides[i – 1] * (globalDim[i] + padding[i]); assert(globalStrides[i] >= globalDim[i]); \endcode - \p pixelBoxLowerCorner array specifies the coordinate offsets {D, H, W} of the bounding box from top/left/front corner. The number of offsets and their precision depend on the tensor dimensionality: - When \p tensorRank is 3, one signed offset within range [-32768, 32767] is supported. - When \p tensorRank is 4, two signed offsets each within range [-128, 127] are supported. - When \p tensorRank is 5, three offsets each within range [-16, 15] are supported. - \p pixelBoxUpperCorner array specifies the coordinate offsets {D, H, W} of the bounding box from bottom/right/back corner. The number of offsets and their precision depend on the tensor dimensionality: - When \p tensorRank is 3, one signed offset within range [-32768, 32767] is supported. - When \p tensorRank is 4, two signed offsets each within range [-128, 127] are supported. - When \p tensorRank is 5, three offsets each within range [-16, 15] are supported. The bounding box specified by \p pixelBoxLowerCorner and \p pixelBoxUpperCorner must have non-zero area. - \p channelsPerPixel, which specifies the number of elements which must be accessed along C dimension, must be less than or equal to 256. Additionally, when \p tensorDataType is ::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B or ::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B, \p channelsPerPixel must be 128. - \p pixelsPerColumn, which specifies the number of elements that must be accessed along the {N, D, H, W} dimensions, must be less than or equal to 1024. - \p elementStrides array, which specifies the iteration step along each of the \p tensorRank dimensions, must be non-zero and less than or equal to 8. Note that when \p interleave is ::CU_TENSOR_MAP_INTERLEAVE_NONE, the first element of this array is ignored since TMA doesn’t support the stride for dimension zero. When all elements of the \p elementStrides array are one, \p boxDim specifies the number of elements to load. However, if \p elementStrides[i] is not equal to one for some \p i, then TMA loads ceil( \p boxDim[i] / \p elementStrides[i]) number of elements along i-th dimension. To load N elements along i-th dimension, \p boxDim[i] must be set to N * \p elementStrides[i]. - \p interleave specifies the interleaved layout of type ::CUtensorMapInterleave, which is defined as: \code typedef enum CUtensorMapInterleave_enum { CU_TENSOR_MAP_INTERLEAVE_NONE = 0, CU_TENSOR_MAP_INTERLEAVE_16B, CU_TENSOR_MAP_INTERLEAVE_32B } CUtensorMapInterleave; \endcode TMA supports interleaved layouts like NC/8HWC8 where C8 utilizes 16 bytes in memory assuming 2 byte per channel or NC/16HWC16 where C16 uses 32 bytes. When \p interleave is ::CU_TENSOR_MAP_INTERLEAVE_NONE and \p swizzle is not ::CU_TENSOR_MAP_SWIZZLE_NONE, the bounding box inner dimension (computed as \p channelsPerPixel multiplied by element size in bytes derived from \p tensorDataType) must be less than or equal to the swizzle size. - CU_TENSOR_MAP_SWIZZLE_32B requires the bounding box inner dimension to be <= 32. - CU_TENSOR_MAP_SWIZZLE_64B requires the bounding box inner dimension to be <= 64. - CU_TENSOR_MAP_SWIZZLE_128B* require the bounding box inner dimension to be <= 128. Additionally, \p tensorDataType of ::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B requires \p interleave to be ::CU_TENSOR_MAP_INTERLEAVE_NONE. - \p swizzle, which specifies the shared memory bank swizzling pattern, has to be of type ::CUtensorMapSwizzle which is defined as: \code typedef enum CUtensorMapSwizzle_enum { CU_TENSOR_MAP_SWIZZLE_NONE = 0, CU_TENSOR_MAP_SWIZZLE_32B, // Swizzle 16B chunks within 32B span CU_TENSOR_MAP_SWIZZLE_64B, // Swizzle 16B chunks within 64B span CU_TENSOR_MAP_SWIZZLE_128B, // Swizzle 16B chunks within 128B span CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B, // Swizzle 32B chunks within 128B span CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B_FLIP_8B, // Swizzle 32B chunks within 128B span, additionally swap lower 8B with upper 8B within each 16B for every alternate row CU_TENSOR_MAP_SWIZZLE_128B_ATOM_64B // Swizzle 64B chunks within 128B span } CUtensorMapSwizzle; \endcode Data are organized in a specific order in global memory; however, this may not match the order in which the application accesses data in shared memory. This difference in data organization may cause bank conflicts when shared memory is accessed. In order to avoid this problem, data can be loaded to shared memory with shuffling across shared memory banks. When \p interleave is ::CU_TENSOR_MAP_INTERLEAVE_32B, \p swizzle must be ::CU_TENSOR_MAP_SWIZZLE_32B. Other interleave modes can have any swizzling pattern. When the \p tensorDataType is ::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B, only the following swizzle modes are supported: - CU_TENSOR_MAP_SWIZZLE_NONE (Load & Store) - CU_TENSOR_MAP_SWIZZLE_128B (Load & Store) - CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B (Load & Store) - CU_TENSOR_MAP_SWIZZLE_128B_ATOM_64B (Store only) When the \p tensorDataType is ::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B, only the following swizzle modes are supported: - CU_TENSOR_MAP_SWIZZLE_NONE (Load only) - CU_TENSOR_MAP_SWIZZLE_128B (Load only) - CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B (Load only) - \p l2Promotion specifies L2 fetch size which indicates the byte granularity at which L2 requests are filled from DRAM. It must be of type ::CUtensorMapL2promotion, which is defined as: \code typedef enum CUtensorMapL2promotion_enum { CU_TENSOR_MAP_L2_PROMOTION_NONE = 0, CU_TENSOR_MAP_L2_PROMOTION_L2_64B, CU_TENSOR_MAP_L2_PROMOTION_L2_128B, CU_TENSOR_MAP_L2_PROMOTION_L2_256B } CUtensorMapL2promotion; \endcode - \p oobFill, which indicates whether zero or a special NaN constant should be used to fill out-of-bound elements, must be of type ::CUtensorMapFloatOOBfill which is defined as: \code typedef enum CUtensorMapFloatOOBfill_enum { CU_TENSOR_MAP_FLOAT_OOB_FILL_NONE = 0, CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA } CUtensorMapFloatOOBfill; \endcode Note that ::CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA can only be used when \p tensorDataType represents a floating-point data type, and when \p tensorDataType is not ::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B, ::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B, and ::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B. \param tensorMap - Tensor map object to create \param tensorDataType - Tensor data type \param tensorRank - Dimensionality of tensor; must be at least 3 \param globalAddress - Starting address of memory region described by tensor \param globalDim - Array containing tensor size (number of elements) along each of the \p tensorRank dimensions \param globalStrides - Array containing stride size (in bytes) along each of the \p tensorRank - 1 dimensions \param pixelBoxLowerCorner - Array containing DHW dimensions of lower box corner \param pixelBoxUpperCorner - Array containing DHW dimensions of upper box corner \param channelsPerPixel - Number of channels per pixel \param pixelsPerColumn - Number of pixels per column \param elementStrides - Array containing traversal stride in each of the \p tensorRank dimensions \param interleave - Type of interleaved layout the tensor addresses \param swizzle - Bank swizzling pattern inside shared memory \param l2Promotion - L2 promotion size \param oobFill - Indicate whether zero or special NaN constant will be used to fill out-of-bound elements \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTensorMapEncodeTiled, ::cuTensorMapEncodeIm2colWide, ::cuTensorMapReplaceAddress*/ fn cuTensorMapEncodeIm2col( tensorMap: *mut cuda_types::cuda::CUtensorMap, tensorDataType: cuda_types::cuda::CUtensorMapDataType, tensorRank: cuda_types::cuda::cuuint32_t, globalAddress: *mut ::core::ffi::c_void, globalDim: *const cuda_types::cuda::cuuint64_t, globalStrides: *const cuda_types::cuda::cuuint64_t, pixelBoxLowerCorner: *const ::core::ffi::c_int, pixelBoxUpperCorner: *const ::core::ffi::c_int, channelsPerPixel: cuda_types::cuda::cuuint32_t, pixelsPerColumn: cuda_types::cuda::cuuint32_t, elementStrides: *const cuda_types::cuda::cuuint32_t, interleave: cuda_types::cuda::CUtensorMapInterleave, swizzle: cuda_types::cuda::CUtensorMapSwizzle, l2Promotion: cuda_types::cuda::CUtensorMapL2promotion, oobFill: cuda_types::cuda::CUtensorMapFloatOOBfill, ) -> cuda_types::cuda::CUresult; /** \brief Create a tensor map descriptor object representing im2col memory region, but where the elements are exclusively loaded along the W dimension. Creates a descriptor for Tensor Memory Access (TMA) object specified by the parameters describing a im2col memory layout and where the row is always loaded along the W dimensuin and returns it in \p tensorMap. This assumes the tensor layout in memory is either NDHWC, NHWC, or NWC. This API is only supported on devices of compute capability 10.0 or higher. Additionally, a tensor map object is an opaque value, and, as such, should only be accessed through CUDA APIs and PTX. The parameters passed are bound to the following requirements: - \p tensorMap address must be aligned to 64 bytes. - \p tensorDataType has to be an enum from ::CUtensorMapDataType which is defined as: \code typedef enum CUtensorMapDataType_enum { CU_TENSOR_MAP_DATA_TYPE_UINT8 = 0, // 1 byte CU_TENSOR_MAP_DATA_TYPE_UINT16, // 2 bytes CU_TENSOR_MAP_DATA_TYPE_UINT32, // 4 bytes CU_TENSOR_MAP_DATA_TYPE_INT32, // 4 bytes CU_TENSOR_MAP_DATA_TYPE_UINT64, // 8 bytes CU_TENSOR_MAP_DATA_TYPE_INT64, // 8 bytes CU_TENSOR_MAP_DATA_TYPE_FLOAT16, // 2 bytes CU_TENSOR_MAP_DATA_TYPE_FLOAT32, // 4 bytes CU_TENSOR_MAP_DATA_TYPE_FLOAT64, // 8 bytes CU_TENSOR_MAP_DATA_TYPE_BFLOAT16, // 2 bytes CU_TENSOR_MAP_DATA_TYPE_FLOAT32_FTZ, // 4 bytes CU_TENSOR_MAP_DATA_TYPE_TFLOAT32, // 4 bytes CU_TENSOR_MAP_DATA_TYPE_TFLOAT32_FTZ // 4 bytes CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B, // 4 bits CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B, // 4 bits CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B // 6 bits } CUtensorMapDataType; \endcode ::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B copies '16 x U4' packed values to memory aligned as 8 bytes. There are no gaps between packed values. ::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B copies '16 x U4' packed values to memory aligned as 16 bytes. There are 8 byte gaps between every 8 byte chunk of packed values. ::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B copies '16 x U6' packed values to memory aligned as 16 bytes. There are 4 byte gaps between every 12 byte chunk of packed values. - \p tensorRank, which specifies the number of tensor dimensions, must be 3, 4, or 5. - \p globalAddress, which specifies the starting address of the memory region described, must be 16 byte aligned. The following requirements need to also be met: - When \p interleave is ::CU_TENSOR_MAP_INTERLEAVE_32B, \p globalAddress must be 32 byte aligned. - When \p tensorDataType is ::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B or ::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B, \p globalAddress must be 32 byte aligned. - \p globalDim array, which specifies tensor size of each of the \p tensorRank dimensions, must be non-zero and less than or equal to 2^32. Additionally, the following requirements need to be met for the packed data types: - When \p tensorDataType is ::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B or ::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B, globalDim[0] must be a multiple of 128. - When \p tensorDataType is ::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B, \p globalDim[0] must be a multiple of 2. - Dimension for the packed data types must reflect the number of individual U# values. - \p globalStrides array, which specifies tensor stride of each of the lower \p tensorRank - 1 dimensions in bytes, must be a multiple of 16 and less than 2^40. Additionally, the following requirements need to be met: - When \p interleave is ::CU_TENSOR_MAP_INTERLEAVE_32B, the strides must be a multiple of 32. - When \p tensorDataType is ::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B or ::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B, the strides must be a multiple of 32. Each following dimension specified includes previous dimension stride: \code globalStrides[0] = globalDim[0] * elementSizeInBytes(tensorDataType) + padding[0]; for (i = 1; i < tensorRank - 1; i++) globalStrides[i] = globalStrides[i – 1] * (globalDim[i] + padding[i]); assert(globalStrides[i] >= globalDim[i]); \endcode - \p pixelBoxLowerCornerWidth specifies the coordinate offset W of the bounding box from left corner. The offset must be within range [-32768, 32767]. - \p pixelBoxUpperCornerWidth specifies the coordinate offset W of the bounding box from right corner. The offset must be within range [-32768, 32767]. The bounding box specified by \p pixelBoxLowerCornerWidth and \p pixelBoxUpperCornerWidth must have non-zero area. Note that the size of the box along D and H dimensions is always equal to one. - \p channelsPerPixel, which specifies the number of elements which must be accessed along C dimension, must be less than or equal to 256. Additionally, when \p tensorDataType is ::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B or ::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B, \p channelsPerPixel must be 128. - \p pixelsPerColumn, which specifies the number of elements that must be accessed along the W dimension, must be less than or equal to 1024. This field is ignored when \p mode is ::CU_TENSOR_MAP_IM2COL_WIDE_MODE_W128. - \p elementStrides array, which specifies the iteration step along each of the \p tensorRank dimensions, must be non-zero and less than or equal to 8. Note that when \p interleave is ::CU_TENSOR_MAP_INTERLEAVE_NONE, the first element of this array is ignored since TMA doesn’t support the stride for dimension zero. When all elements of the \p elementStrides array are one, \p boxDim specifies the number of elements to load. However, if \p elementStrides[i] is not equal to one for some \p i, then TMA loads ceil( \p boxDim[i] / \p elementStrides[i]) number of elements along i-th dimension. To load N elements along i-th dimension, \p boxDim[i] must be set to N * \p elementStrides[i]. - \p interleave specifies the interleaved layout of type ::CUtensorMapInterleave, which is defined as: \code typedef enum CUtensorMapInterleave_enum { CU_TENSOR_MAP_INTERLEAVE_NONE = 0, CU_TENSOR_MAP_INTERLEAVE_16B, CU_TENSOR_MAP_INTERLEAVE_32B } CUtensorMapInterleave; \endcode TMA supports interleaved layouts like NC/8HWC8 where C8 utilizes 16 bytes in memory assuming 2 byte per channel or NC/16HWC16 where C16 uses 32 bytes. When \p interleave is ::CU_TENSOR_MAP_INTERLEAVE_NONE, the bounding box inner dimension (computed as \p channelsPerPixel multiplied by element size in bytes derived from \p tensorDataType) must be less than or equal to the swizzle size. - CU_TENSOR_MAP_SWIZZLE_64B requires the bounding box inner dimension to be <= 64. - CU_TENSOR_MAP_SWIZZLE_128B* require the bounding box inner dimension to be <= 128. Additionally, \p tensorDataType of ::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B requires \p interleave to be ::CU_TENSOR_MAP_INTERLEAVE_NONE. - \p mode, which describes loading of elements loaded along the W dimension, has to be one of the following ::CUtensorMapIm2ColWideMode types: \code CU_TENSOR_MAP_IM2COL_WIDE_MODE_W, CU_TENSOR_MAP_IM2COL_WIDE_MODE_W128 \endcode ::CU_TENSOR_MAP_IM2COL_WIDE_MODE_W allows the number of elements loaded along the W dimension to be specified via the \p pixelsPerColumn field. - \p swizzle, which specifies the shared memory bank swizzling pattern, must be one of the following ::CUtensorMapSwizzle modes (other swizzle modes are not supported): \code typedef enum CUtensorMapSwizzle_enum { CU_TENSOR_MAP_SWIZZLE_64B, // Swizzle 16B chunks within 64B span CU_TENSOR_MAP_SWIZZLE_128B, // Swizzle 16B chunks within 128B span CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B, // Swizzle 32B chunks within 128B span } CUtensorMapSwizzle; \endcode Data are organized in a specific order in global memory; however, this may not match the order in which the application accesses data in shared memory. This difference in data organization may cause bank conflicts when shared memory is accessed. In order to avoid this problem, data can be loaded to shared memory with shuffling across shared memory banks. When the \p tensorDataType is ::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B, only the following swizzle modes are supported: - CU_TENSOR_MAP_SWIZZLE_128B (Load & Store) - CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B (Load & Store) When the \p tensorDataType is ::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B, only the following swizzle modes are supported: - CU_TENSOR_MAP_SWIZZLE_128B (Load only) - CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B (Load only) - \p l2Promotion specifies L2 fetch size which indicates the byte granularity at which L2 requests are filled from DRAM. It must be of type ::CUtensorMapL2promotion, which is defined as: \code typedef enum CUtensorMapL2promotion_enum { CU_TENSOR_MAP_L2_PROMOTION_NONE = 0, CU_TENSOR_MAP_L2_PROMOTION_L2_64B, CU_TENSOR_MAP_L2_PROMOTION_L2_128B, CU_TENSOR_MAP_L2_PROMOTION_L2_256B } CUtensorMapL2promotion; \endcode - \p oobFill, which indicates whether zero or a special NaN constant should be used to fill out-of-bound elements, must be of type ::CUtensorMapFloatOOBfill which is defined as: \code typedef enum CUtensorMapFloatOOBfill_enum { CU_TENSOR_MAP_FLOAT_OOB_FILL_NONE = 0, CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA } CUtensorMapFloatOOBfill; \endcode Note that ::CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA can only be used when \p tensorDataType represents a floating-point data type, and when \p tensorDataType is not ::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B, ::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B, and ::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B. \param tensorMap - Tensor map object to create \param tensorDataType - Tensor data type \param tensorRank - Dimensionality of tensor; must be at least 3 \param globalAddress - Starting address of memory region described by tensor \param globalDim - Array containing tensor size (number of elements) along each of the \p tensorRank dimensions \param globalStrides - Array containing stride size (in bytes) along each of the \p tensorRank - 1 dimensions \param pixelBoxLowerCornerWidth - Width offset of left box corner \param pixelBoxUpperCornerWidth - Width offset of right box corner \param channelsPerPixel - Number of channels per pixel \param pixelsPerColumn - Number of pixels per column \param elementStrides - Array containing traversal stride in each of the \p tensorRank dimensions \param interleave - Type of interleaved layout the tensor addresses \param mode - W or W128 mode \param swizzle - Bank swizzling pattern inside shared memory \param l2Promotion - L2 promotion size \param oobFill - Indicate whether zero or special NaN constant will be used to fill out-of-bound elements \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTensorMapEncodeTiled, ::cuTensorMapEncodeIm2col, ::cuTensorMapReplaceAddress*/ fn cuTensorMapEncodeIm2colWide( tensorMap: *mut cuda_types::cuda::CUtensorMap, tensorDataType: cuda_types::cuda::CUtensorMapDataType, tensorRank: cuda_types::cuda::cuuint32_t, globalAddress: *mut ::core::ffi::c_void, globalDim: *const cuda_types::cuda::cuuint64_t, globalStrides: *const cuda_types::cuda::cuuint64_t, pixelBoxLowerCornerWidth: ::core::ffi::c_int, pixelBoxUpperCornerWidth: ::core::ffi::c_int, channelsPerPixel: cuda_types::cuda::cuuint32_t, pixelsPerColumn: cuda_types::cuda::cuuint32_t, elementStrides: *const cuda_types::cuda::cuuint32_t, interleave: cuda_types::cuda::CUtensorMapInterleave, mode: cuda_types::cuda::CUtensorMapIm2ColWideMode, swizzle: cuda_types::cuda::CUtensorMapSwizzle, l2Promotion: cuda_types::cuda::CUtensorMapL2promotion, oobFill: cuda_types::cuda::CUtensorMapFloatOOBfill, ) -> cuda_types::cuda::CUresult; /** \brief Modify an existing tensor map descriptor with an updated global address Modifies the descriptor for Tensor Memory Access (TMA) object passed in \p tensorMap with an updated \p globalAddress. Tensor map objects are only supported on devices of compute capability 9.0 or higher. Additionally, a tensor map object is an opaque value, and, as such, should only be accessed through CUDA API calls. \param tensorMap - Tensor map object to modify \param globalAddress - Starting address of memory region described by tensor, must follow previous alignment requirements \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuTensorMapEncodeTiled, ::cuTensorMapEncodeIm2col, ::cuTensorMapEncodeIm2colWide*/ fn cuTensorMapReplaceAddress( tensorMap: *mut cuda_types::cuda::CUtensorMap, globalAddress: *mut ::core::ffi::c_void, ) -> cuda_types::cuda::CUresult; /** \brief Queries if a device may directly access a peer device's memory. Returns in \p *canAccessPeer a value of 1 if contexts on \p dev are capable of directly accessing memory from contexts on \p peerDev and 0 otherwise. If direct access of \p peerDev from \p dev is possible, then access may be enabled on two specific contexts by calling ::cuCtxEnablePeerAccess(). \param canAccessPeer - Returned access capability \param dev - Device from which allocations on \p peerDev are to be directly accessed. \param peerDev - Device on which the allocations to be directly accessed by \p dev reside. \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_DEVICE \notefnerr \sa ::cuCtxEnablePeerAccess, ::cuCtxDisablePeerAccess, ::cudaDeviceCanAccessPeer*/ fn cuDeviceCanAccessPeer( canAccessPeer: *mut ::core::ffi::c_int, dev: cuda_types::cuda::CUdevice, peerDev: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; /** \brief Enables direct access to memory allocations in a peer context. If both the current context and \p peerContext are on devices which support unified addressing (as may be queried using ::CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING) and same major compute capability, then on success all allocations from \p peerContext will immediately be accessible by the current context. See \ref CUDA_UNIFIED for additional details. Note that access granted by this call is unidirectional and that in order to access memory from the current context in \p peerContext, a separate symmetric call to ::cuCtxEnablePeerAccess() is required. Note that there are both device-wide and system-wide limitations per system configuration, as noted in the CUDA Programming Guide under the section "Peer-to-Peer Memory Access". Returns ::CUDA_ERROR_PEER_ACCESS_UNSUPPORTED if ::cuDeviceCanAccessPeer() indicates that the ::CUdevice of the current context cannot directly access memory from the ::CUdevice of \p peerContext. Returns ::CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED if direct access of \p peerContext from the current context has already been enabled. Returns ::CUDA_ERROR_TOO_MANY_PEERS if direct peer access is not possible because hardware resources required for peer access have been exhausted. Returns ::CUDA_ERROR_INVALID_CONTEXT if there is no current context, \p peerContext is not a valid context, or if the current context is \p peerContext. Returns ::CUDA_ERROR_INVALID_VALUE if \p Flags is not 0. \param peerContext - Peer context to enable direct access to from the current context \param Flags - Reserved for future use and must be set to 0 \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED, ::CUDA_ERROR_TOO_MANY_PEERS, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_PEER_ACCESS_UNSUPPORTED, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuDeviceCanAccessPeer, ::cuCtxDisablePeerAccess, ::cudaDeviceEnablePeerAccess*/ fn cuCtxEnablePeerAccess( peerContext: cuda_types::cuda::CUcontext, Flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Disables direct access to memory allocations in a peer context and unregisters any registered allocations. Returns ::CUDA_ERROR_PEER_ACCESS_NOT_ENABLED if direct peer access has not yet been enabled from \p peerContext to the current context. Returns ::CUDA_ERROR_INVALID_CONTEXT if there is no current context, or if \p peerContext is not a valid context. \param peerContext - Peer context to disable direct access to \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_PEER_ACCESS_NOT_ENABLED, ::CUDA_ERROR_INVALID_CONTEXT, \notefnerr \sa ::cuDeviceCanAccessPeer, ::cuCtxEnablePeerAccess, ::cudaDeviceDisablePeerAccess*/ fn cuCtxDisablePeerAccess( peerContext: cuda_types::cuda::CUcontext, ) -> cuda_types::cuda::CUresult; /** \brief Queries attributes of the link between two devices. Returns in \p *value the value of the requested attribute \p attrib of the link between \p srcDevice and \p dstDevice. The supported attributes are: - ::CU_DEVICE_P2P_ATTRIBUTE_PERFORMANCE_RANK: A relative value indicating the performance of the link between two devices. - ::CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED P2P: 1 if P2P Access is enable. - ::CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED: 1 if all CUDA-valid atomic operations over the link are supported. - ::CU_DEVICE_P2P_ATTRIBUTE_CUDA_ARRAY_ACCESS_SUPPORTED: 1 if cudaArray can be accessed over the link. - ::CU_DEVICE_P2P_ATTRIBUTE_ONLY_PARTIAL_NATIVE_ATOMIC_SUPPORTED: 1 if some CUDA-valid atomic operations over the link are supported. Information about specific operations can be retrieved with ::cuDeviceGetP2PAtomicCapabilities. Returns ::CUDA_ERROR_INVALID_DEVICE if \p srcDevice or \p dstDevice are not valid or if they represent the same device. Returns ::CUDA_ERROR_INVALID_VALUE if \p attrib is not valid or if \p value is a null pointer. \param value - Returned value of the requested attribute \param attrib - The requested attribute of the link between \p srcDevice and \p dstDevice. \param srcDevice - The source device of the target link. \param dstDevice - The destination device of the target link. \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_DEVICE, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuCtxEnablePeerAccess, ::cuCtxDisablePeerAccess, ::cuDeviceCanAccessPeer, ::cuDeviceGetP2PAtomicCapabilities, ::cudaDeviceGetP2PAttribute*/ fn cuDeviceGetP2PAttribute( value: *mut ::core::ffi::c_int, attrib: cuda_types::cuda::CUdevice_P2PAttribute, srcDevice: cuda_types::cuda::CUdevice, dstDevice: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; /** \brief Queries details about atomic operations supported between two devices Returns in \p *capabilities the details about requested atomic \p *operations over the the link between \p srcDevice and \p dstDevice. The allocated size of \p *operations and \p *capabilities must be \p count. For each ::CUatomicOperation in \p *operations, the corresponding result in \p *capabilities will be a bitmask indicating which of ::CUatomicOperationCapability the link supports natively. Returns ::CUDA_ERROR_INVALID_DEVICE if \p srcDevice or \p dstDevice are not valid or if they represent the same device. Returns ::CUDA_ERROR_INVALID_VALUE if \p *capabilities or \p *operations is NULL, if \p count is 0, or if any of \p *operations is not valid. \param capabilities - Returned capability details of each requested operation \param operations - Requested operations \param count - Count of requested operations and size of capabilities \param srcDevice - The source device of the target link \param dstDevice - The destination device of the target link \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_DEVICE, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuDeviceGetP2PAttribute, ::cudaDeviceGetP2PAttribute, ::cudaDeviceGetP2PAtomicCapabilities*/ fn cuDeviceGetP2PAtomicCapabilities( capabilities: *mut ::core::ffi::c_uint, operations: *const cuda_types::cuda::CUatomicOperation, count: ::core::ffi::c_uint, srcDevice: cuda_types::cuda::CUdevice, dstDevice: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; /** \brief Unregisters a graphics resource for access by CUDA Unregisters the graphics resource \p resource so it is not accessible by CUDA unless registered again. If \p resource is invalid then ::CUDA_ERROR_INVALID_HANDLE is returned. \param resource - Resource to unregister \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_UNKNOWN \notefnerr \sa ::cuGraphicsD3D9RegisterResource, ::cuGraphicsD3D10RegisterResource, ::cuGraphicsD3D11RegisterResource, ::cuGraphicsGLRegisterBuffer, ::cuGraphicsGLRegisterImage, ::cudaGraphicsUnregisterResource*/ fn cuGraphicsUnregisterResource( resource: cuda_types::cuda::CUgraphicsResource, ) -> cuda_types::cuda::CUresult; /** \brief Get an array through which to access a subresource of a mapped graphics resource. Returns in \p *pArray an array through which the subresource of the mapped graphics resource \p resource which corresponds to array index \p arrayIndex and mipmap level \p mipLevel may be accessed. The value set in \p *pArray may change every time that \p resource is mapped. If \p resource is not a texture then it cannot be accessed via an array and ::CUDA_ERROR_NOT_MAPPED_AS_ARRAY is returned. If \p arrayIndex is not a valid array index for \p resource then ::CUDA_ERROR_INVALID_VALUE is returned. If \p mipLevel is not a valid mipmap level for \p resource then ::CUDA_ERROR_INVALID_VALUE is returned. If \p resource is not mapped then ::CUDA_ERROR_NOT_MAPPED is returned. \param pArray - Returned array through which a subresource of \p resource may be accessed \param resource - Mapped resource to access \param arrayIndex - Array index for array textures or cubemap face index as defined by ::CUarray_cubemap_face for cubemap textures for the subresource to access \param mipLevel - Mipmap level for the subresource to access \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_NOT_MAPPED, ::CUDA_ERROR_NOT_MAPPED_AS_ARRAY \notefnerr \sa ::cuGraphicsResourceGetMappedPointer, ::cudaGraphicsSubResourceGetMappedArray*/ fn cuGraphicsSubResourceGetMappedArray( pArray: *mut cuda_types::cuda::CUarray, resource: cuda_types::cuda::CUgraphicsResource, arrayIndex: ::core::ffi::c_uint, mipLevel: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Get a mipmapped array through which to access a mapped graphics resource. Returns in \p *pMipmappedArray a mipmapped array through which the mapped graphics resource \p resource. The value set in \p *pMipmappedArray may change every time that \p resource is mapped. If \p resource is not a texture then it cannot be accessed via a mipmapped array and ::CUDA_ERROR_NOT_MAPPED_AS_ARRAY is returned. If \p resource is not mapped then ::CUDA_ERROR_NOT_MAPPED is returned. \param pMipmappedArray - Returned mipmapped array through which \p resource may be accessed \param resource - Mapped resource to access \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_NOT_MAPPED, ::CUDA_ERROR_NOT_MAPPED_AS_ARRAY \notefnerr \sa ::cuGraphicsResourceGetMappedPointer, ::cudaGraphicsResourceGetMappedMipmappedArray*/ fn cuGraphicsResourceGetMappedMipmappedArray( pMipmappedArray: *mut cuda_types::cuda::CUmipmappedArray, resource: cuda_types::cuda::CUgraphicsResource, ) -> cuda_types::cuda::CUresult; /** \brief Get a device pointer through which to access a mapped graphics resource. Returns in \p *pDevPtr a pointer through which the mapped graphics resource \p resource may be accessed. Returns in \p pSize the size of the memory in bytes which may be accessed from that pointer. The value set in \p pPointer may change every time that \p resource is mapped. If \p resource is not a buffer then it cannot be accessed via a pointer and ::CUDA_ERROR_NOT_MAPPED_AS_POINTER is returned. If \p resource is not mapped then ::CUDA_ERROR_NOT_MAPPED is returned. * \param pDevPtr - Returned pointer through which \p resource may be accessed \param pSize - Returned size of the buffer accessible starting at \p *pPointer \param resource - Mapped resource to access \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_NOT_MAPPED, ::CUDA_ERROR_NOT_MAPPED_AS_POINTER \notefnerr \sa ::cuGraphicsMapResources, ::cuGraphicsSubResourceGetMappedArray, ::cudaGraphicsResourceGetMappedPointer*/ fn cuGraphicsResourceGetMappedPointer_v2( pDevPtr: *mut cuda_types::cuda::CUdeviceptr, pSize: *mut usize, resource: cuda_types::cuda::CUgraphicsResource, ) -> cuda_types::cuda::CUresult; /** \brief Set usage flags for mapping a graphics resource Set \p flags for mapping the graphics resource \p resource. Changes to \p flags will take effect the next time \p resource is mapped. The \p flags argument may be any of the following: - ::CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE: Specifies no hints about how this resource will be used. It is therefore assumed that this resource will be read from and written to by CUDA kernels. This is the default value. - ::CU_GRAPHICS_MAP_RESOURCE_FLAGS_READONLY: Specifies that CUDA kernels which access this resource will not write to this resource. - ::CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITEDISCARD: Specifies that CUDA kernels which access this resource will not read from this resource and will write over the entire contents of the resource, so none of the data previously stored in the resource will be preserved. If \p resource is presently mapped for access by CUDA then ::CUDA_ERROR_ALREADY_MAPPED is returned. If \p flags is not one of the above values then ::CUDA_ERROR_INVALID_VALUE is returned. \param resource - Registered resource to set flags for \param flags - Parameters for resource mapping \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_ALREADY_MAPPED \notefnerr \sa ::cuGraphicsMapResources, ::cudaGraphicsResourceSetMapFlags*/ fn cuGraphicsResourceSetMapFlags_v2( resource: cuda_types::cuda::CUgraphicsResource, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Map graphics resources for access by CUDA Maps the \p count graphics resources in \p resources for access by CUDA. The resources in \p resources may be accessed by CUDA until they are unmapped. The graphics API from which \p resources were registered should not access any resources while they are mapped by CUDA. If an application does so, the results are undefined. This function provides the synchronization guarantee that any graphics calls issued before ::cuGraphicsMapResources() will complete before any subsequent CUDA work issued in \p stream begins. If \p resources includes any duplicate entries then ::CUDA_ERROR_INVALID_HANDLE is returned. If any of \p resources are presently mapped for access by CUDA then ::CUDA_ERROR_ALREADY_MAPPED is returned. \param count - Number of resources to map \param resources - Resources to map for CUDA usage \param hStream - Stream with which to synchronize \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_ALREADY_MAPPED, ::CUDA_ERROR_UNKNOWN \note_null_stream \notefnerr \sa ::cuGraphicsResourceGetMappedPointer, ::cuGraphicsSubResourceGetMappedArray, ::cuGraphicsUnmapResources, ::cudaGraphicsMapResources*/ fn cuGraphicsMapResources_ptsz( count: ::core::ffi::c_uint, resources: *mut cuda_types::cuda::CUgraphicsResource, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Unmap graphics resources. Unmaps the \p count graphics resources in \p resources. Once unmapped, the resources in \p resources may not be accessed by CUDA until they are mapped again. This function provides the synchronization guarantee that any CUDA work issued in \p stream before ::cuGraphicsUnmapResources() will complete before any subsequently issued graphics work begins. If \p resources includes any duplicate entries then ::CUDA_ERROR_INVALID_HANDLE is returned. If any of \p resources are not presently mapped for access by CUDA then ::CUDA_ERROR_NOT_MAPPED is returned. \param count - Number of resources to unmap \param resources - Resources to unmap \param hStream - Stream with which to synchronize \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_NOT_MAPPED, ::CUDA_ERROR_UNKNOWN \note_null_stream \notefnerr \sa ::cuGraphicsMapResources, ::cudaGraphicsUnmapResources*/ fn cuGraphicsUnmapResources_ptsz( count: ::core::ffi::c_uint, resources: *mut cuda_types::cuda::CUgraphicsResource, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Returns the requested driver API function pointer Returns in \p **pfn the address of the CUDA driver function for the requested CUDA version and flags. The CUDA version is specified as (1000 * major + 10 * minor), so CUDA 11.2 should be specified as 11020. For a requested driver symbol, if the specified CUDA version is greater than or equal to the CUDA version in which the driver symbol was introduced, this API will return the function pointer to the corresponding versioned function. If the specified CUDA version is greater than the driver version, the API will return ::CUDA_ERROR_INVALID_VALUE. The pointer returned by the API should be cast to a function pointer matching the requested driver function's definition in the API header file. The function pointer typedef can be picked up from the corresponding typedefs header file. For example, cudaTypedefs.h consists of function pointer typedefs for driver APIs defined in cuda.h. The API will return ::CUDA_SUCCESS and set the returned \p pfn to NULL if the requested driver function is not supported on the platform, no ABI compatible driver function exists for the specified \p cudaVersion or if the driver symbol is invalid. It will also set the optional \p symbolStatus to one of the values in ::CUdriverProcAddressQueryResult with the following meanings: - ::CU_GET_PROC_ADDRESS_SUCCESS - The requested symbol was succesfully found based on input arguments and \p pfn is valid - ::CU_GET_PROC_ADDRESS_SYMBOL_NOT_FOUND - The requested symbol was not found - ::CU_GET_PROC_ADDRESS_VERSION_NOT_SUFFICIENT - The requested symbol was found but is not supported by cudaVersion specified The requested flags can be: - ::CU_GET_PROC_ADDRESS_DEFAULT: This is the default mode. This is equivalent to ::CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM if the code is compiled with --default-stream per-thread compilation flag or the macro CUDA_API_PER_THREAD_DEFAULT_STREAM is defined; ::CU_GET_PROC_ADDRESS_LEGACY_STREAM otherwise. - ::CU_GET_PROC_ADDRESS_LEGACY_STREAM: This will enable the search for all driver symbols that match the requested driver symbol name except the corresponding per-thread versions. - ::CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM: This will enable the search for all driver symbols that match the requested driver symbol name including the per-thread versions. If a per-thread version is not found, the API will return the legacy version of the driver function. \param symbol - The base name of the driver API function to look for. As an example, for the driver API ::cuMemAlloc_v2, \p symbol would be cuMemAlloc and \p cudaVersion would be the ABI compatible CUDA version for the _v2 variant. \param pfn - Location to return the function pointer to the requested driver function \param cudaVersion - The CUDA version to look for the requested driver symbol \param flags - Flags to specify search options. \param symbolStatus - Optional location to store the status of the search for \p symbol based on \p cudaVersion. See ::CUdriverProcAddressQueryResult for possible values. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_SUPPORTED \note_version_mixing \sa ::cudaGetDriverEntryPointByVersion*/ fn cuGetProcAddress_v2( symbol: *const ::core::ffi::c_char, pfn: *mut *mut ::core::ffi::c_void, cudaVersion: ::core::ffi::c_int, flags: cuda_types::cuda::cuuint64_t, symbolStatus: *mut cuda_types::cuda::CUdriverProcAddressQueryResult, ) -> cuda_types::cuda::CUresult; /** \brief Allows caller to fetch a coredump attribute value for the current context Returns in \p *value the requested value specified by \p attrib. It is up to the caller to ensure that the data type and size of \p *value matches the request. If the caller calls this function with \p *value equal to NULL, the size of the memory region (in bytes) expected for \p attrib will be placed in \p size. The supported attributes are: - ::CU_COREDUMP_ENABLE_ON_EXCEPTION: Bool where ::true means that GPU exceptions from this context will create a coredump at the location specified by ::CU_COREDUMP_FILE. The default value is ::false unless set to ::true globally or locally, or the CU_CTX_USER_COREDUMP_ENABLE flag was set during context creation. - ::CU_COREDUMP_TRIGGER_HOST: Bool where ::true means that the host CPU will also create a coredump. The default value is ::true unless set to ::false globally or or locally. This value is deprecated as of CUDA 12.5 - raise the ::CU_COREDUMP_SKIP_ABORT flag to disable host device abort() if needed. - ::CU_COREDUMP_LIGHTWEIGHT: Bool where ::true means that any resulting coredumps will not have a dump of GPU memory or non-reloc ELF images. The default value is ::false unless set to ::true globally or locally. This attribute is deprecated as of CUDA 12.5, please use ::CU_COREDUMP_GENERATION_FLAGS instead. - ::CU_COREDUMP_ENABLE_USER_TRIGGER: Bool where ::true means that a coredump can be created by writing to the system pipe specified by ::CU_COREDUMP_PIPE. The default value is ::false unless set to ::true globally or locally. - ::CU_COREDUMP_FILE: String of up to 1023 characters that defines the location where any coredumps generated by this context will be written. The default value is ::core.cuda.HOSTNAME.PID where ::HOSTNAME is the host name of the machine running the CUDA applications and ::PID is the process ID of the CUDA application. - ::CU_COREDUMP_PIPE: String of up to 1023 characters that defines the name of the pipe that will be monitored if user-triggered coredumps are enabled. The default value is ::corepipe.cuda.HOSTNAME.PID where ::HOSTNAME is the host name of the machine running the CUDA application and ::PID is the process ID of the CUDA application. - ::CU_COREDUMP_GENERATION_FLAGS: An integer with values to allow granular control the data contained in a coredump specified as a bitwise OR combination of the following values: + ::CU_COREDUMP_DEFAULT_FLAGS - if set by itself, coredump generation returns to its default settings of including all memory regions that it is able to access + ::CU_COREDUMP_SKIP_NONRELOCATED_ELF_IMAGES - Coredump will not include the data from CUDA source modules that are not relocated at runtime. + ::CU_COREDUMP_SKIP_GLOBAL_MEMORY - Coredump will not include device-side global data that does not belong to any context. + ::CU_COREDUMP_SKIP_SHARED_MEMORY - Coredump will not include grid-scale shared memory for the warp that the dumped kernel belonged to. + ::CU_COREDUMP_SKIP_LOCAL_MEMORY - Coredump will not include local memory from the kernel. + ::CU_COREDUMP_LIGHTWEIGHT_FLAGS - Enables all of the above options. Equiavlent to setting the ::CU_COREDUMP_LIGHTWEIGHT attribute to ::true. + ::CU_COREDUMP_SKIP_ABORT - If set, GPU exceptions will not raise an abort() in the host CPU process. Same functional goal as ::CU_COREDUMP_TRIGGER_HOST but better reflects the default behavior. \param attrib - The enum defining which value to fetch. \param value - void* containing the requested data. \param size - The size of the memory region \p value points to. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_PERMITTED, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_CONTEXT_IS_DESTROYED \sa ::cuCoredumpGetAttributeGlobal, ::cuCoredumpSetAttribute, ::cuCoredumpSetAttributeGlobal*/ fn cuCoredumpGetAttribute( attrib: cuda_types::cuda::CUcoredumpSettings, value: *mut ::core::ffi::c_void, size: *mut usize, ) -> cuda_types::cuda::CUresult; /** \brief Allows caller to fetch a coredump attribute value for the entire application Returns in \p *value the requested value specified by \p attrib. It is up to the caller to ensure that the data type and size of \p *value matches the request. If the caller calls this function with \p *value equal to NULL, the size of the memory region (in bytes) expected for \p attrib will be placed in \p size. The supported attributes are: - ::CU_COREDUMP_ENABLE_ON_EXCEPTION: Bool where ::true means that GPU exceptions from this context will create a coredump at the location specified by ::CU_COREDUMP_FILE. The default value is ::false. - ::CU_COREDUMP_TRIGGER_HOST: Bool where ::true means that the host CPU will also create a coredump. The default value is ::true unless set to ::false globally or or locally. This value is deprecated as of CUDA 12.5 - raise the ::CU_COREDUMP_SKIP_ABORT flag to disable host device abort() if needed. - ::CU_COREDUMP_LIGHTWEIGHT: Bool where ::true means that any resulting coredumps will not have a dump of GPU memory or non-reloc ELF images. The default value is ::false. This attribute is deprecated as of CUDA 12.5, please use ::CU_COREDUMP_GENERATION_FLAGS instead. - ::CU_COREDUMP_ENABLE_USER_TRIGGER: Bool where ::true means that a coredump can be created by writing to the system pipe specified by ::CU_COREDUMP_PIPE. The default value is ::false. - ::CU_COREDUMP_FILE: String of up to 1023 characters that defines the location where any coredumps generated by this context will be written. The default value is ::core.cuda.HOSTNAME.PID where ::HOSTNAME is the host name of the machine running the CUDA applications and ::PID is the process ID of the CUDA application. - ::CU_COREDUMP_PIPE: String of up to 1023 characters that defines the name of the pipe that will be monitored if user-triggered coredumps are enabled. The default value is ::corepipe.cuda.HOSTNAME.PID where ::HOSTNAME is the host name of the machine running the CUDA application and ::PID is the process ID of the CUDA application. - ::CU_COREDUMP_GENERATION_FLAGS: An integer with values to allow granular control the data contained in a coredump specified as a bitwise OR combination of the following values: + ::CU_COREDUMP_DEFAULT_FLAGS - if set by itself, coredump generation returns to its default settings of including all memory regions that it is able to access + ::CU_COREDUMP_SKIP_NONRELOCATED_ELF_IMAGES - Coredump will not include the data from CUDA source modules that are not relocated at runtime. + ::CU_COREDUMP_SKIP_GLOBAL_MEMORY - Coredump will not include device-side global data that does not belong to any context. + ::CU_COREDUMP_SKIP_SHARED_MEMORY - Coredump will not include grid-scale shared memory for the warp that the dumped kernel belonged to. + ::CU_COREDUMP_SKIP_LOCAL_MEMORY - Coredump will not include local memory from the kernel. + ::CU_COREDUMP_LIGHTWEIGHT_FLAGS - Enables all of the above options. Equiavlent to setting the ::CU_COREDUMP_LIGHTWEIGHT attribute to ::true. + ::CU_COREDUMP_SKIP_ABORT - If set, GPU exceptions will not raise an abort() in the host CPU process. Same functional goal as ::CU_COREDUMP_TRIGGER_HOST but better reflects the default behavior. \param attrib - The enum defining which value to fetch. \param value - void* containing the requested data. \param size - The size of the memory region \p value points to. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE \sa ::cuCoredumpGetAttribute, ::cuCoredumpSetAttribute, ::cuCoredumpSetAttributeGlobal*/ fn cuCoredumpGetAttributeGlobal( attrib: cuda_types::cuda::CUcoredumpSettings, value: *mut ::core::ffi::c_void, size: *mut usize, ) -> cuda_types::cuda::CUresult; /** \brief Allows caller to set a coredump attribute value for the current context This function should be considered an alternate interface to the CUDA-GDB environment variables defined in this document: https://docs.nvidia.com/cuda/cuda-gdb/index.html#gpu-coredump An important design decision to note is that any coredump environment variable values set before CUDA initializes will take permanent precedence over any values set with this function. This decision was made to ensure no change in behavior for any users that may be currently using these variables to get coredumps. \p *value shall contain the requested value specified by \p set. It is up to the caller to ensure that the data type and size of \p *value matches the request. If the caller calls this function with \p *value equal to NULL, the size of the memory region (in bytes) expected for \p set will be placed in \p size. /note This function will return ::CUDA_ERROR_NOT_SUPPORTED if the caller attempts to set ::CU_COREDUMP_ENABLE_ON_EXCEPTION on a GPU of with Compute Capability < 6.0. ::cuCoredumpSetAttributeGlobal works on those platforms as an alternative. /note ::CU_COREDUMP_ENABLE_USER_TRIGGER and ::CU_COREDUMP_PIPE cannot be set on a per-context basis. The supported attributes are: - ::CU_COREDUMP_ENABLE_ON_EXCEPTION: Bool where ::true means that GPU exceptions from this context will create a coredump at the location specified by ::CU_COREDUMP_FILE. The default value is ::false. - ::CU_COREDUMP_TRIGGER_HOST: Bool where ::true means that the host CPU will also create a coredump. The default value is ::true unless set to ::false globally or or locally. This value is deprecated as of CUDA 12.5 - raise the ::CU_COREDUMP_SKIP_ABORT flag to disable host device abort() if needed. - ::CU_COREDUMP_LIGHTWEIGHT: Bool where ::true means that any resulting coredumps will not have a dump of GPU memory or non-reloc ELF images. The default value is ::false. This attribute is deprecated as of CUDA 12.5, please use ::CU_COREDUMP_GENERATION_FLAGS instead. - ::CU_COREDUMP_FILE: String of up to 1023 characters that defines the location where any coredumps generated by this context will be written. The default value is ::core.cuda.HOSTNAME.PID where ::HOSTNAME is the host name of the machine running the CUDA applications and ::PID is the process ID of the CUDA application. - ::CU_COREDUMP_GENERATION_FLAGS: An integer with values to allow granular control the data contained in a coredump specified as a bitwise OR combination of the following values: + ::CU_COREDUMP_DEFAULT_FLAGS - if set by itself, coredump generation returns to its default settings of including all memory regions that it is able to access + ::CU_COREDUMP_SKIP_NONRELOCATED_ELF_IMAGES - Coredump will not include the data from CUDA source modules that are not relocated at runtime. + ::CU_COREDUMP_SKIP_GLOBAL_MEMORY - Coredump will not include device-side global data that does not belong to any context. + ::CU_COREDUMP_SKIP_SHARED_MEMORY - Coredump will not include grid-scale shared memory for the warp that the dumped kernel belonged to. + ::CU_COREDUMP_SKIP_LOCAL_MEMORY - Coredump will not include local memory from the kernel. + ::CU_COREDUMP_LIGHTWEIGHT_FLAGS - Enables all of the above options. Equiavlent to setting the ::CU_COREDUMP_LIGHTWEIGHT attribute to ::true. + ::CU_COREDUMP_SKIP_ABORT - If set, GPU exceptions will not raise an abort() in the host CPU process. Same functional goal as ::CU_COREDUMP_TRIGGER_HOST but better reflects the default behavior. \param attrib - The enum defining which value to set. \param value - void* containing the requested data. \param size - The size of the memory region \p value points to. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_PERMITTED, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_CONTEXT_IS_DESTROYED, ::CUDA_ERROR_NOT_SUPPORTED \sa ::cuCoredumpGetAttributeGlobal, ::cuCoredumpGetAttribute, ::cuCoredumpSetAttributeGlobal*/ fn cuCoredumpSetAttribute( attrib: cuda_types::cuda::CUcoredumpSettings, value: *mut ::core::ffi::c_void, size: *mut usize, ) -> cuda_types::cuda::CUresult; /** \brief Allows caller to set a coredump attribute value globally This function should be considered an alternate interface to the CUDA-GDB environment variables defined in this document: https://docs.nvidia.com/cuda/cuda-gdb/index.html#gpu-coredump An important design decision to note is that any coredump environment variable values set before CUDA initializes will take permanent precedence over any values set with this function. This decision was made to ensure no change in behavior for any users that may be currently using these variables to get coredumps. \p *value shall contain the requested value specified by \p set. It is up to the caller to ensure that the data type and size of \p *value matches the request. If the caller calls this function with \p *value equal to NULL, the size of the memory region (in bytes) expected for \p set will be placed in \p size. The supported attributes are: - ::CU_COREDUMP_ENABLE_ON_EXCEPTION: Bool where ::true means that GPU exceptions from this context will create a coredump at the location specified by ::CU_COREDUMP_FILE. The default value is ::false. - ::CU_COREDUMP_TRIGGER_HOST: Bool where ::true means that the host CPU will also create a coredump. The default value is ::true unless set to ::false globally or or locally. This value is deprecated as of CUDA 12.5 - raise the ::CU_COREDUMP_SKIP_ABORT flag to disable host device abort() if needed. - ::CU_COREDUMP_LIGHTWEIGHT: Bool where ::true means that any resulting coredumps will not have a dump of GPU memory or non-reloc ELF images. The default value is ::false. This attribute is deprecated as of CUDA 12.5, please use ::CU_COREDUMP_GENERATION_FLAGS instead. - ::CU_COREDUMP_ENABLE_USER_TRIGGER: Bool where ::true means that a coredump can be created by writing to the system pipe specified by ::CU_COREDUMP_PIPE. The default value is ::false. - ::CU_COREDUMP_FILE: String of up to 1023 characters that defines the location where any coredumps generated by this context will be written. The default value is ::core.cuda.HOSTNAME.PID where ::HOSTNAME is the host name of the machine running the CUDA applications and ::PID is the process ID of the CUDA application. - ::CU_COREDUMP_PIPE: String of up to 1023 characters that defines the name of the pipe that will be monitored if user-triggered coredumps are enabled. This value may not be changed after ::CU_COREDUMP_ENABLE_USER_TRIGGER is set to ::true. The default value is ::corepipe.cuda.HOSTNAME.PID where ::HOSTNAME is the host name of the machine running the CUDA application and ::PID is the process ID of the CUDA application. - ::CU_COREDUMP_GENERATION_FLAGS: An integer with values to allow granular control the data contained in a coredump specified as a bitwise OR combination of the following values: + ::CU_COREDUMP_DEFAULT_FLAGS - if set by itself, coredump generation returns to its default settings of including all memory regions that it is able to access + ::CU_COREDUMP_SKIP_NONRELOCATED_ELF_IMAGES - Coredump will not include the data from CUDA source modules that are not relocated at runtime. + ::CU_COREDUMP_SKIP_GLOBAL_MEMORY - Coredump will not include device-side global data that does not belong to any context. + ::CU_COREDUMP_SKIP_SHARED_MEMORY - Coredump will not include grid-scale shared memory for the warp that the dumped kernel belonged to. + ::CU_COREDUMP_SKIP_LOCAL_MEMORY - Coredump will not include local memory from the kernel. + ::CU_COREDUMP_LIGHTWEIGHT_FLAGS - Enables all of the above options. Equiavlent to setting the ::CU_COREDUMP_LIGHTWEIGHT attribute to ::true. + ::CU_COREDUMP_SKIP_ABORT - If set, GPU exceptions will not raise an abort() in the host CPU process. Same functional goal as ::CU_COREDUMP_TRIGGER_HOST but better reflects the default behavior. \param attrib - The enum defining which value to set. \param value - void* containing the requested data. \param size - The size of the memory region \p value points to. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_PERMITTED \sa ::cuCoredumpGetAttribute, ::cuCoredumpGetAttributeGlobal, ::cuCoredumpSetAttribute*/ fn cuCoredumpSetAttributeGlobal( attrib: cuda_types::cuda::CUcoredumpSettings, value: *mut ::core::ffi::c_void, size: *mut usize, ) -> cuda_types::cuda::CUresult; /// @} fn cuGetExportTable( ppExportTable: *mut *const ::core::ffi::c_void, pExportTableId: *const cuda_types::cuda::CUuuid, ) -> cuda_types::cuda::CUresult; /** \brief Creates a green context with a specified set of resources. This API creates a green context with the resources specified in the descriptor \p desc and returns it in the handle represented by \p phCtx. This API will retain the primary context on device \p dev, which will is released when the green context is destroyed. It is advised to have the primary context active before calling this API to avoid the heavy cost of triggering primary context initialization and deinitialization multiple times. The API does not set the green context current. In order to set it current, you need to explicitly set it current by first converting the green context to a CUcontext using ::cuCtxFromGreenCtx and subsequently calling ::cuCtxSetCurrent / ::cuCtxPushCurrent. It should be noted that a green context can be current to only one thread at a time. There is no internal synchronization to make API calls accessing the same green context from multiple threads work. Note: The API is not supported on 32-bit platforms. \param phCtx - Pointer for the output handle to the green context \param desc - Descriptor generated via ::cuDevResourceGenerateDesc which contains the set of resources to be used \param dev - Device on which to create the green context. \param flags - One of the supported green context creation flags. \p CU_GREEN_CTX_DEFAULT_STREAM is required. The supported flags are: - \p CU_GREEN_CTX_DEFAULT_STREAM : Creates a default stream to use inside the green context. Required. \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_DEVICE, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_NOT_SUPPORTED, ::CUDA_ERROR_OUT_OF_MEMORY \sa ::cuGreenCtxDestroy, ::cuCtxFromGreenCtx, ::cuCtxSetCurrent, ::cuCtxPushCurrent, ::cuDevResourceGenerateDesc, ::cuDevicePrimaryCtxRetain, ::cuCtxCreate*/ fn cuGreenCtxCreate( phCtx: *mut cuda_types::cuda::CUgreenCtx, desc: cuda_types::cuda::CUdevResourceDesc, dev: cuda_types::cuda::CUdevice, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Destroys a green context Destroys the green context, releasing the primary context of the device that this green context was created for. Any resources provisioned for this green context (that were initially available via the resource descriptor) are released as well. The API does not destroy streams created via ::cuGreenCtxStreamCreate, ::cuStreamCreate, or ::cuStreamCreateWithPriority. Once the green context is destroyed, any subsequent API calls involving these streams (including ::cuStreamDestroy) will return ::CUDA_ERROR_CONTEXT_IS_DESTROYED. Users must explicitly destroy all such streams before invoking ::cuGreenCtxDestroy. Failure to do so will result in a memory leak. \param hCtx - Green context to be destroyed \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_CONTEXT_IS_DESTROYED \sa ::cuGreenCtxCreate, ::cuCtxDestroy*/ fn cuGreenCtxDestroy( hCtx: cuda_types::cuda::CUgreenCtx, ) -> cuda_types::cuda::CUresult; /** \brief Converts a green context into the primary context The API converts a green context into the primary context returned in \p pContext. It is important to note that the converted context \p pContext is a normal primary context but with the resources of the specified green context \p hCtx. Once converted, it can then be used to set the context current with ::cuCtxSetCurrent or with any of the CUDA APIs that accept a CUcontext parameter. Users are expected to call this API before calling any CUDA APIs that accept a CUcontext. Failing to do so will result in the APIs returning ::CUDA_ERROR_INVALID_CONTEXT. \param pContext Returned primary context with green context resources \param hCtx Green context to convert \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \sa ::cuGreenCtxCreate*/ fn cuCtxFromGreenCtx( pContext: *mut cuda_types::cuda::CUcontext, hCtx: cuda_types::cuda::CUgreenCtx, ) -> cuda_types::cuda::CUresult; /** \brief Get device resources Get the \p type resources available to the \p device. This may often be the starting point for further partitioning or configuring of resources. Note: The API is not supported on 32-bit platforms. \param device - Device to get resource for \param resource - Output pointer to a CUdevResource structure \param type - Type of resource to retrieve \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_RESOURCE_TYPE, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_DEVICE \sa ::cuDevResourceGenerateDesc*/ fn cuDeviceGetDevResource( device: cuda_types::cuda::CUdevice, resource: *mut cuda_types::cuda::CUdevResource, type_: cuda_types::cuda::CUdevResourceType, ) -> cuda_types::cuda::CUresult; /** \brief Get context resources Get the \p type resources available to the context represented by \p hCtx \param hCtx - Context to get resource for Note: The API is not supported on 32-bit platforms. \param resource - Output pointer to a CUdevResource structure \param type - Type of resource to retrieve \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_RESOURCE_TYPE, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_CONTEXT \sa ::cuDevResourceGenerateDesc*/ fn cuCtxGetDevResource( hCtx: cuda_types::cuda::CUcontext, resource: *mut cuda_types::cuda::CUdevResource, type_: cuda_types::cuda::CUdevResourceType, ) -> cuda_types::cuda::CUresult; /** \brief Get green context resources Get the \p type resources available to the green context represented by \p hCtx \param hCtx - Green context to get resource for \param resource - Output pointer to a CUdevResource structure \param type - Type of resource to retrieve \return ::CUDA_SUCCESS ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_RESOURCE_TYPE, ::CUDA_ERROR_INVALID_VALUE \sa ::cuDevResourceGenerateDesc*/ fn cuGreenCtxGetDevResource( hCtx: cuda_types::cuda::CUgreenCtx, resource: *mut cuda_types::cuda::CUdevResource, type_: cuda_types::cuda::CUdevResourceType, ) -> cuda_types::cuda::CUresult; /** \brief Splits \p CU_DEV_RESOURCE_TYPE_SM resources. Splits \p CU_DEV_RESOURCE_TYPE_SM resources into \p nbGroups, adhering to the minimum SM count specified in \p minCount and the usage flags in \p useFlags. If \p result is NULL, the API simulates a split and provides the amount of groups that would be created in \p nbGroups. Otherwise, \p nbGroups must point to the amount of elements in \p result and on return, the API will overwrite \p nbGroups with the amount actually created. The groups are written to the array in \p result. \p nbGroups can be less than the total amount if a smaller number of groups is needed. This API is used to spatially partition the input resource. The input resource needs to come from one of ::cuDeviceGetDevResource, ::cuCtxGetDevResource, or ::cuGreenCtxGetDevResource. A limitation of the API is that the output results cannot be split again without first creating a descriptor and a green context with that descriptor. When creating the groups, the API will take into account the performance and functional characteristics of the input resource, and guarantee a split that will create a disjoint set of symmetrical partitions. This may lead to fewer groups created than purely dividing the total SM count by the \p minCount due to cluster requirements or alignment and granularity requirements for the minCount. These requirements can be queried with ::cuDeviceGetDevResource, ::cuCtxGetDevResource, and ::cuGreenCtxGetDevResource for ::CU_DEV_RESOURCE_TYPE_SM, using the \p minSmPartitionSize and \p smCoscheduledAlignment fields to determine minimum partition size and alignment granularity, respectively. The \p remainder set does not have the same functional or performance guarantees as the groups in \p result. Its use should be carefully planned and future partitions of the \p remainder set are discouraged. The following flags are supported: - \p CU_DEV_SM_RESOURCE_SPLIT_IGNORE_SM_COSCHEDULING : Lower the minimum SM count and alignment, and treat each SM independent of its hierarchy. This allows more fine grained partitions but at the cost of advanced features (such as large clusters on compute capability 9.0+). - \p CU_DEV_SM_RESOURCE_SPLIT_MAX_POTENTIAL_CLUSTER_SIZE : Compute Capability 9.0+ only. Attempt to create groups that may allow for maximally sized thread clusters. This can be queried post green context creation using ::cuOccupancyMaxPotentialClusterSize. A successful API call must either have: - A valid array of \p result pointers of size passed in \p nbGroups, with \p input of type \p CU_DEV_RESOURCE_TYPE_SM. Value of \p minCount must be between 0 and the SM count specified in \p input. \p remaining may be NULL. - NULL passed in for \p result, with a valid integer pointer in \p nbGroups and \p input of type \p CU_DEV_RESOURCE_TYPE_SM. Value of \p minCount must be between 0 and the SM count specified in \p input. \p remaining may be NULL. This queries the number of groups that would be created by the API. Note: The API is not supported on 32-bit platforms. \param result - Output array of \p CUdevResource resources. Can be NULL to query the number of groups. \param nbGroups - This is a pointer, specifying the number of groups that would be or should be created as described below. \param input - Input SM resource to be split. Must be a valid \p CU_DEV_RESOURCE_TYPE_SM resource. \param remaining - If the input resource cannot be cleanly split among \p nbGroups, the remaining is placed in here. Can be ommitted (NULL) if the user does not need the remaining set. \param useFlags - Flags specifying how these partitions are used or which constraints to abide by when splitting the input. Zero is valid for default behavior. \param minCount - Minimum number of SMs required \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_DEVICE, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_RESOURCE_TYPE, ::CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION \sa ::cuGreenCtxGetDevResource, ::cuCtxGetDevResource, ::cuDeviceGetDevResource*/ fn cuDevSmResourceSplitByCount( result: *mut cuda_types::cuda::CUdevResource, nbGroups: *mut ::core::ffi::c_uint, input: *const cuda_types::cuda::CUdevResource, remaining: *mut cuda_types::cuda::CUdevResource, useFlags: ::core::ffi::c_uint, minCount: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Generate a resource descriptor Generates a single resource descriptor with the set of resources specified in \p resources. The generated resource descriptor is necessary for the creation of green contexts via the ::cuGreenCtxCreate API. Resources of the same type can be passed in, provided they meet the requirements as noted below. A successful API call must have: - A valid output pointer for the \p phDesc descriptor as well as a valid array of \p resources pointers, with the array size passed in \p nbResources. If multiple resources are provided in \p resources, the device they came from must be the same, otherwise CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION is returned. If multiple resources are provided in \p resources and they are of type ::CU_DEV_RESOURCE_TYPE_SM, they must be outputs (whether \p result or \p remaining) from the same split API instance, otherwise CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION is returned. Note: The API is not supported on 32-bit platforms. \param phDesc - Output descriptor \param resources - Array of resources to be included in the descriptor \param nbResources - Number of resources passed in \p resources \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_RESOURCE_TYPE, ::CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION \sa ::cuDevSmResourceSplitByCount*/ fn cuDevResourceGenerateDesc( phDesc: *mut cuda_types::cuda::CUdevResourceDesc, resources: *mut cuda_types::cuda::CUdevResource, nbResources: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Records an event. Captures in \p hEvent all the activities of the green context of \p hCtx at the time of this call. \p hEvent and \p hCtx must be from the same primary context otherwise ::CUDA_ERROR_INVALID_HANDLE is returned. Calls such as ::cuEventQuery() or ::cuGreenCtxWaitEvent() will then examine or wait for completion of the work that was captured. Uses of \p hCtx after this call do not modify \p hEvent. \note The API will return ::CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED if the specified green context \p hCtx has a stream in the capture mode. In such a case, the call will invalidate all the conflicting captures. \param hCtx - Green context to record event for \param hEvent - Event to record \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED \sa ::cuGreenCtxWaitEvent, ::cuEventRecord, ::cuCtxRecordEvent, ::cuCtxWaitEvent*/ fn cuGreenCtxRecordEvent( hCtx: cuda_types::cuda::CUgreenCtx, hEvent: cuda_types::cuda::CUevent, ) -> cuda_types::cuda::CUresult; /** \brief Make a green context wait on an event Makes all future work submitted to green context \p hCtx wait for all work captured in \p hEvent. The synchronization will be performed on the device and will not block the calling CPU thread. See ::cuGreenCtxRecordEvent() or ::cuEventRecord(), for details on what is captured by an event. \note \p hEvent may be from a different context or device than \p hCtx. \note The API will return ::CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED and invalidate the capture if the specified event \p hEvent is part of an ongoing capture sequence or if the specified green context \p hCtx has a stream in the capture mode. \param hCtx - Green context to wait \param hEvent - Event to wait on \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED \sa ::cuGreenCtxRecordEvent, ::cuStreamWaitEvent, ::cuCtxRecordEvent, ::cuCtxWaitEvent*/ fn cuGreenCtxWaitEvent( hCtx: cuda_types::cuda::CUgreenCtx, hEvent: cuda_types::cuda::CUevent, ) -> cuda_types::cuda::CUresult; /** \brief Query the green context associated with a stream Returns the CUDA green context that the stream is associated with, or NULL if the stream is not associated with any green context. The stream handle \p hStream can refer to any of the following:
  • a stream created via any of the CUDA driver APIs such as ::cuStreamCreate, ::cuStreamCreateWithPriority and ::cuGreenCtxStreamCreate, or their runtime API equivalents such as ::cudaStreamCreate, ::cudaStreamCreateWithFlags and ::cudaStreamCreateWithPriority. If during stream creation the context that was active in the calling thread was obtained with cuCtxFromGreenCtx, that green context is returned in \p phCtx. Otherwise, \p *phCtx is set to NULL instead.
  • special stream such as the NULL stream or ::CU_STREAM_LEGACY. In that case if context that is active in the calling thread was obtained with cuCtxFromGreenCtx, that green context is returned. Otherwise, \p *phCtx is set to NULL instead.
Passing an invalid handle will result in undefined behavior. \param hStream - Handle to the stream to be queried \param phCtx - Returned green context associated with the stream \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_HANDLE, \notefnerr \sa ::cuStreamDestroy, ::cuStreamCreate, ::cuStreamCreateWithPriority, ::cuStreamGetCtx, ::cuGreenCtxStreamCreate, ::cuStreamGetPriority, ::cuStreamGetFlags, ::cuStreamGetDevice, ::cuStreamWaitEvent, ::cuStreamQuery, ::cuStreamSynchronize, ::cuStreamAddCallback, ::cudaStreamCreate, ::cudaStreamCreateWithFlags*/ fn cuStreamGetGreenCtx( hStream: cuda_types::cuda::CUstream, phCtx: *mut cuda_types::cuda::CUgreenCtx, ) -> cuda_types::cuda::CUresult; /** \brief Create a stream for use in the green context Creates a stream for use in the specified green context \p greenCtx and returns a handle in \p phStream. The stream can be destroyed by calling ::cuStreamDestroy(). Note that the API ignores the context that is current to the calling thread and creates a stream in the specified green context \p greenCtx. The supported values for \p flags are: - ::CU_STREAM_NON_BLOCKING: This must be specified. It indicates that work running in the created stream may run concurrently with work in the default stream, and that the created stream should perform no implicit synchronization with the default stream. Specifying \p priority affects the scheduling priority of work in the stream. Priorities provide a hint to preferentially run work with higher priority when possible, but do not preempt already-running work or provide any other functional guarantee on execution order. \p priority follows a convention where lower numbers represent higher priorities. '0' represents default priority. The range of meaningful numerical priorities can be queried using ::cuCtxGetStreamPriorityRange. If the specified priority is outside the numerical range returned by ::cuCtxGetStreamPriorityRange, it will automatically be clamped to the lowest or the highest number in the range. \param phStream - Returned newly created stream \param greenCtx - Green context for which to create the stream for \param flags - Flags for stream creation. \p CU_STREAM_NON_BLOCKING must be specified. \param priority - Stream priority. Lower numbers represent higher priorities. See ::cuCtxGetStreamPriorityRange for more information about meaningful stream priorities that can be passed. \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_OUT_OF_MEMORY \notefnerr \note In the current implementation, only compute kernels launched in priority streams are affected by the stream's priority. Stream priorities have no effect on host-to-device and device-to-host memory operations. \sa ::cuStreamDestroy, ::cuGreenCtxCreate ::cuStreamCreate, ::cuStreamGetPriority, ::cuCtxGetStreamPriorityRange, ::cuStreamGetFlags, ::cuStreamGetDevice, ::cuStreamWaitEvent, ::cuStreamQuery, ::cuStreamSynchronize, ::cuStreamAddCallback, ::cudaStreamCreateWithPriority*/ fn cuGreenCtxStreamCreate( phStream: *mut cuda_types::cuda::CUstream, greenCtx: cuda_types::cuda::CUgreenCtx, flags: ::core::ffi::c_uint, priority: ::core::ffi::c_int, ) -> cuda_types::cuda::CUresult; /** \brief Returns the unique Id associated with the green context supplied Returns in \p greenCtxId the unique Id which is associated with a given green context. The Id is unique for the life of the program for this instance of CUDA. If green context is supplied as NULL and the current context is set to a green context, the Id of the current green context is returned. \param greenCtx - Green context for which to obtain the Id \param greenCtxId - Pointer to store the Id of the green context \return ::CUDA_SUCCESS, ::CUDA_ERROR_CONTEXT_IS_DESTROYED, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuGreenCtxCreate, ::cuGreenCtxDestroy, ::cuCtxGetId*/ fn cuGreenCtxGetId( greenCtx: cuda_types::cuda::CUgreenCtx, greenCtxId: *mut ::core::ffi::c_ulonglong, ) -> cuda_types::cuda::CUresult; /** \brief Register a callback function to receive error log messages \param callbackFunc - The function to register as a callback \param userData - A generic pointer to user data. This is passed into the callback function. \param callback_out - Optional location to store the callback handle after it is registered \return ::CUDA_SUCCESS ::CUDA_ERROR_INVALID_VALUE*/ fn cuLogsRegisterCallback( callbackFunc: cuda_types::cuda::CUlogsCallback, userData: *mut ::core::ffi::c_void, callback_out: *mut cuda_types::cuda::CUlogsCallbackHandle, ) -> cuda_types::cuda::CUresult; /** \brief Unregister a log message callback \param callback - The callback instance to unregister from receiving log messages \return ::CUDA_SUCCESS ::CUDA_ERROR_INVALID_VALUE*/ fn cuLogsUnregisterCallback( callback: cuda_types::cuda::CUlogsCallbackHandle, ) -> cuda_types::cuda::CUresult; /** \brief Sets log iterator to point to the end of log buffer, where the next message would be written. \param iterator_out - Location to store an iterator to the current tail of the logs \param flags - Reserved for future use, must be 0 \return ::CUDA_SUCCESS ::CUDA_ERROR_INVALID_VALUE*/ fn cuLogsCurrent( iterator_out: *mut cuda_types::cuda::CUlogIterator, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Dump accumulated driver logs into a file Logs generated by the driver are stored in an internal buffer and can be copied out using this API. This API dumps all driver logs starting from \p iterator into \p pathToFile provided. \note \p iterator is auto-advancing. Dumping logs will update the value of \p iterator to receive the next generated log. \note The driver reserves limited memory for storing logs. The oldest logs may be overwritten and become unrecoverable. An indication will appear in the destination outupt if the logs have been truncated. Call dump after each failed API to mitigate this risk. \param iterator - Optional auto-advancing iterator specifying the starting log to read. NULL value dumps all logs. \param pathToFile - Path to output file for dumping logs \param flags - Reserved for future use, must be 0 \return ::CUDA_SUCCESS ::CUDA_ERROR_INVALID_VALUE*/ fn cuLogsDumpToFile( iterator: *mut cuda_types::cuda::CUlogIterator, pathToFile: *const ::core::ffi::c_char, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Dump accumulated driver logs into a buffer Logs generated by the driver are stored in an internal buffer and can be copied out using this API. This API dumps driver logs from \p iterator into \p buffer up to the size specified in \p *size. The driver will always null terminate the buffer but there will not be a null character between log entries, only a newline \\n. The driver will then return the actual number of bytes written in \p *size, excluding the null terminator. If there are no messages to dump, \p *size will be set to 0 and the function will return ::CUDA_SUCCESS. If the provided \p buffer is not large enough to hold any messages, \p *size will be set to 0 and the function will return ::CUDA_ERROR_INVALID_VALUE. \note \p iterator is auto-advancing. Dumping logs will update the value of \p iterator to receive the next generated log. \note The driver reserves limited memory for storing logs. The maximum size of the buffer is 25600 bytes. The oldest logs may be overwritten and become unrecoverable. An indication will appear in the destination outupt if the logs have been truncated. Call dump after each failed API to mitigate this risk. \note If the provided value in \p *size is not large enough to hold all buffered messages, a message will be added at the head of the buffer indicating this. The driver then computes the number of messages it is able to store in \p buffer and writes it out. The final message in \p buffer will always be the most recent log message as of when the API is called. \param iterator - Optional auto-advancing iterator specifying the starting log to read. NULL value dumps all logs. \param buffer - Pointer to dump logs \param size - See description \param flags - Reserved for future use, must be 0 \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE*/ fn cuLogsDumpToMemory( iterator: *mut cuda_types::cuda::CUlogIterator, buffer: *mut ::core::ffi::c_char, size: *mut usize, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuMemHostRegister( p: *mut ::core::ffi::c_void, bytesize: usize, Flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuGraphicsResourceSetMapFlags( resource: cuda_types::cuda::CUgraphicsResource, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuLinkCreate( numOptions: ::core::ffi::c_uint, options: *mut cuda_types::cuda::CUjit_option, optionValues: *mut *mut ::core::ffi::c_void, stateOut: *mut cuda_types::cuda::CUlinkState, ) -> cuda_types::cuda::CUresult; fn cuLinkAddData( state: cuda_types::cuda::CUlinkState, type_: cuda_types::cuda::CUjitInputType, data: *mut ::core::ffi::c_void, size: usize, name: *const ::core::ffi::c_char, numOptions: ::core::ffi::c_uint, options: *mut cuda_types::cuda::CUjit_option, optionValues: *mut *mut ::core::ffi::c_void, ) -> cuda_types::cuda::CUresult; fn cuLinkAddFile( state: cuda_types::cuda::CUlinkState, type_: cuda_types::cuda::CUjitInputType, path: *const ::core::ffi::c_char, numOptions: ::core::ffi::c_uint, options: *mut cuda_types::cuda::CUjit_option, optionValues: *mut *mut ::core::ffi::c_void, ) -> cuda_types::cuda::CUresult; fn cuTexRefSetAddress2D_v2( hTexRef: cuda_types::cuda::CUtexref, desc: *const cuda_types::cuda::CUDA_ARRAY_DESCRIPTOR, dptr: cuda_types::cuda::CUdeviceptr, Pitch: usize, ) -> cuda_types::cuda::CUresult; fn cuDeviceTotalMem( bytes: *mut ::core::ffi::c_uint, dev: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; fn cuCtxCreate( pctx: *mut cuda_types::cuda::CUcontext, flags: ::core::ffi::c_uint, dev: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; fn cuCtxCreate_v2( pctx: *mut cuda_types::cuda::CUcontext, flags: ::core::ffi::c_uint, dev: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; fn cuCtxCreate_v3( pctx: *mut cuda_types::cuda::CUcontext, paramsArray: *mut cuda_types::cuda::CUexecAffinityParam, numParams: ::core::ffi::c_int, flags: ::core::ffi::c_uint, dev: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; fn cuModuleGetGlobal( dptr: *mut cuda_types::cuda::CUdeviceptr_v1, bytes: *mut ::core::ffi::c_uint, hmod: cuda_types::cuda::CUmodule, name: *const ::core::ffi::c_char, ) -> cuda_types::cuda::CUresult; fn cuMemGetInfo( free: *mut ::core::ffi::c_uint, total: *mut ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuMemAlloc( dptr: *mut cuda_types::cuda::CUdeviceptr_v1, bytesize: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuMemAllocPitch( dptr: *mut cuda_types::cuda::CUdeviceptr_v1, pPitch: *mut ::core::ffi::c_uint, WidthInBytes: ::core::ffi::c_uint, Height: ::core::ffi::c_uint, ElementSizeBytes: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuMemFree(dptr: cuda_types::cuda::CUdeviceptr_v1) -> cuda_types::cuda::CUresult; fn cuMemGetAddressRange( pbase: *mut cuda_types::cuda::CUdeviceptr_v1, psize: *mut ::core::ffi::c_uint, dptr: cuda_types::cuda::CUdeviceptr_v1, ) -> cuda_types::cuda::CUresult; fn cuMemAllocHost( pp: *mut *mut ::core::ffi::c_void, bytesize: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuMemHostGetDevicePointer( pdptr: *mut cuda_types::cuda::CUdeviceptr_v1, p: *mut ::core::ffi::c_void, Flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuMemcpyHtoD( dstDevice: cuda_types::cuda::CUdeviceptr_v1, srcHost: *const ::core::ffi::c_void, ByteCount: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuMemcpyDtoH( dstHost: *mut ::core::ffi::c_void, srcDevice: cuda_types::cuda::CUdeviceptr_v1, ByteCount: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuMemcpyDtoD( dstDevice: cuda_types::cuda::CUdeviceptr_v1, srcDevice: cuda_types::cuda::CUdeviceptr_v1, ByteCount: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuMemcpyDtoA( dstArray: cuda_types::cuda::CUarray, dstOffset: ::core::ffi::c_uint, srcDevice: cuda_types::cuda::CUdeviceptr_v1, ByteCount: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuMemcpyAtoD( dstDevice: cuda_types::cuda::CUdeviceptr_v1, srcArray: cuda_types::cuda::CUarray, srcOffset: ::core::ffi::c_uint, ByteCount: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuMemcpyHtoA( dstArray: cuda_types::cuda::CUarray, dstOffset: ::core::ffi::c_uint, srcHost: *const ::core::ffi::c_void, ByteCount: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuMemcpyAtoH( dstHost: *mut ::core::ffi::c_void, srcArray: cuda_types::cuda::CUarray, srcOffset: ::core::ffi::c_uint, ByteCount: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuMemcpyAtoA( dstArray: cuda_types::cuda::CUarray, dstOffset: ::core::ffi::c_uint, srcArray: cuda_types::cuda::CUarray, srcOffset: ::core::ffi::c_uint, ByteCount: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuMemcpyHtoAAsync( dstArray: cuda_types::cuda::CUarray, dstOffset: ::core::ffi::c_uint, srcHost: *const ::core::ffi::c_void, ByteCount: ::core::ffi::c_uint, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemcpyAtoHAsync( dstHost: *mut ::core::ffi::c_void, srcArray: cuda_types::cuda::CUarray, srcOffset: ::core::ffi::c_uint, ByteCount: ::core::ffi::c_uint, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemcpy2D( pCopy: *const cuda_types::cuda::CUDA_MEMCPY2D_v1, ) -> cuda_types::cuda::CUresult; fn cuMemcpy2DUnaligned( pCopy: *const cuda_types::cuda::CUDA_MEMCPY2D_v1, ) -> cuda_types::cuda::CUresult; fn cuMemcpy3D( pCopy: *const cuda_types::cuda::CUDA_MEMCPY3D_v1, ) -> cuda_types::cuda::CUresult; fn cuMemcpyHtoDAsync( dstDevice: cuda_types::cuda::CUdeviceptr_v1, srcHost: *const ::core::ffi::c_void, ByteCount: ::core::ffi::c_uint, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemcpyDtoHAsync( dstHost: *mut ::core::ffi::c_void, srcDevice: cuda_types::cuda::CUdeviceptr_v1, ByteCount: ::core::ffi::c_uint, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemcpyDtoDAsync( dstDevice: cuda_types::cuda::CUdeviceptr_v1, srcDevice: cuda_types::cuda::CUdeviceptr_v1, ByteCount: ::core::ffi::c_uint, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemcpy2DAsync( pCopy: *const cuda_types::cuda::CUDA_MEMCPY2D_v1, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemcpy3DAsync( pCopy: *const cuda_types::cuda::CUDA_MEMCPY3D_v1, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemsetD8( dstDevice: cuda_types::cuda::CUdeviceptr_v1, uc: ::core::ffi::c_uchar, N: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuMemsetD16( dstDevice: cuda_types::cuda::CUdeviceptr_v1, us: ::core::ffi::c_ushort, N: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuMemsetD32( dstDevice: cuda_types::cuda::CUdeviceptr_v1, ui: ::core::ffi::c_uint, N: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuMemsetD2D8( dstDevice: cuda_types::cuda::CUdeviceptr_v1, dstPitch: ::core::ffi::c_uint, uc: ::core::ffi::c_uchar, Width: ::core::ffi::c_uint, Height: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuMemsetD2D16( dstDevice: cuda_types::cuda::CUdeviceptr_v1, dstPitch: ::core::ffi::c_uint, us: ::core::ffi::c_ushort, Width: ::core::ffi::c_uint, Height: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuMemsetD2D32( dstDevice: cuda_types::cuda::CUdeviceptr_v1, dstPitch: ::core::ffi::c_uint, ui: ::core::ffi::c_uint, Width: ::core::ffi::c_uint, Height: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuArrayCreate( pHandle: *mut cuda_types::cuda::CUarray, pAllocateArray: *const cuda_types::cuda::CUDA_ARRAY_DESCRIPTOR_v1, ) -> cuda_types::cuda::CUresult; fn cuArrayGetDescriptor( pArrayDescriptor: *mut cuda_types::cuda::CUDA_ARRAY_DESCRIPTOR_v1, hArray: cuda_types::cuda::CUarray, ) -> cuda_types::cuda::CUresult; fn cuArray3DCreate( pHandle: *mut cuda_types::cuda::CUarray, pAllocateArray: *const cuda_types::cuda::CUDA_ARRAY3D_DESCRIPTOR_v1, ) -> cuda_types::cuda::CUresult; fn cuArray3DGetDescriptor( pArrayDescriptor: *mut cuda_types::cuda::CUDA_ARRAY3D_DESCRIPTOR_v1, hArray: cuda_types::cuda::CUarray, ) -> cuda_types::cuda::CUresult; fn cuTexRefSetAddress( ByteOffset: *mut ::core::ffi::c_uint, hTexRef: cuda_types::cuda::CUtexref, dptr: cuda_types::cuda::CUdeviceptr_v1, bytes: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuTexRefSetAddress2D( hTexRef: cuda_types::cuda::CUtexref, desc: *const cuda_types::cuda::CUDA_ARRAY_DESCRIPTOR_v1, dptr: cuda_types::cuda::CUdeviceptr_v1, Pitch: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuTexRefGetAddress( pdptr: *mut cuda_types::cuda::CUdeviceptr_v1, hTexRef: cuda_types::cuda::CUtexref, ) -> cuda_types::cuda::CUresult; fn cuGraphicsResourceGetMappedPointer( pDevPtr: *mut cuda_types::cuda::CUdeviceptr_v1, pSize: *mut ::core::ffi::c_uint, resource: cuda_types::cuda::CUgraphicsResource, ) -> cuda_types::cuda::CUresult; fn cuCtxDestroy(ctx: cuda_types::cuda::CUcontext) -> cuda_types::cuda::CUresult; fn cuCtxPopCurrent( pctx: *mut cuda_types::cuda::CUcontext, ) -> cuda_types::cuda::CUresult; fn cuCtxPushCurrent(ctx: cuda_types::cuda::CUcontext) -> cuda_types::cuda::CUresult; fn cuStreamDestroy( hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuEventDestroy(hEvent: cuda_types::cuda::CUevent) -> cuda_types::cuda::CUresult; fn cuEventElapsedTime( pMilliseconds: *mut f32, hStart: cuda_types::cuda::CUevent, hEnd: cuda_types::cuda::CUevent, ) -> cuda_types::cuda::CUresult; fn cuDevicePrimaryCtxRelease( dev: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; fn cuDevicePrimaryCtxReset( dev: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; fn cuDevicePrimaryCtxSetFlags( dev: cuda_types::cuda::CUdevice, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuDeviceGetUuid( uuid: *mut cuda_types::cuda::CUuuid, dev: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; fn cuMemcpyHtoD_v2( dstDevice: cuda_types::cuda::CUdeviceptr, srcHost: *const ::core::ffi::c_void, ByteCount: usize, ) -> cuda_types::cuda::CUresult; fn cuMemcpyDtoH_v2( dstHost: *mut ::core::ffi::c_void, srcDevice: cuda_types::cuda::CUdeviceptr, ByteCount: usize, ) -> cuda_types::cuda::CUresult; fn cuMemcpyDtoD_v2( dstDevice: cuda_types::cuda::CUdeviceptr, srcDevice: cuda_types::cuda::CUdeviceptr, ByteCount: usize, ) -> cuda_types::cuda::CUresult; fn cuMemcpyDtoA_v2( dstArray: cuda_types::cuda::CUarray, dstOffset: usize, srcDevice: cuda_types::cuda::CUdeviceptr, ByteCount: usize, ) -> cuda_types::cuda::CUresult; fn cuMemcpyAtoD_v2( dstDevice: cuda_types::cuda::CUdeviceptr, srcArray: cuda_types::cuda::CUarray, srcOffset: usize, ByteCount: usize, ) -> cuda_types::cuda::CUresult; fn cuMemcpyHtoA_v2( dstArray: cuda_types::cuda::CUarray, dstOffset: usize, srcHost: *const ::core::ffi::c_void, ByteCount: usize, ) -> cuda_types::cuda::CUresult; fn cuMemcpyAtoH_v2( dstHost: *mut ::core::ffi::c_void, srcArray: cuda_types::cuda::CUarray, srcOffset: usize, ByteCount: usize, ) -> cuda_types::cuda::CUresult; fn cuMemcpyAtoA_v2( dstArray: cuda_types::cuda::CUarray, dstOffset: usize, srcArray: cuda_types::cuda::CUarray, srcOffset: usize, ByteCount: usize, ) -> cuda_types::cuda::CUresult; fn cuMemcpyHtoAAsync_v2( dstArray: cuda_types::cuda::CUarray, dstOffset: usize, srcHost: *const ::core::ffi::c_void, ByteCount: usize, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemcpyAtoHAsync_v2( dstHost: *mut ::core::ffi::c_void, srcArray: cuda_types::cuda::CUarray, srcOffset: usize, ByteCount: usize, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemcpy2D_v2( pCopy: *const cuda_types::cuda::CUDA_MEMCPY2D, ) -> cuda_types::cuda::CUresult; fn cuMemcpy2DUnaligned_v2( pCopy: *const cuda_types::cuda::CUDA_MEMCPY2D, ) -> cuda_types::cuda::CUresult; fn cuMemcpy3D_v2( pCopy: *const cuda_types::cuda::CUDA_MEMCPY3D, ) -> cuda_types::cuda::CUresult; fn cuMemcpyHtoDAsync_v2( dstDevice: cuda_types::cuda::CUdeviceptr, srcHost: *const ::core::ffi::c_void, ByteCount: usize, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemcpyDtoHAsync_v2( dstHost: *mut ::core::ffi::c_void, srcDevice: cuda_types::cuda::CUdeviceptr, ByteCount: usize, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemcpyDtoDAsync_v2( dstDevice: cuda_types::cuda::CUdeviceptr, srcDevice: cuda_types::cuda::CUdeviceptr, ByteCount: usize, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemcpy2DAsync_v2( pCopy: *const cuda_types::cuda::CUDA_MEMCPY2D, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemcpy3DAsync_v2( pCopy: *const cuda_types::cuda::CUDA_MEMCPY3D, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemsetD8_v2( dstDevice: cuda_types::cuda::CUdeviceptr, uc: ::core::ffi::c_uchar, N: usize, ) -> cuda_types::cuda::CUresult; fn cuMemsetD16_v2( dstDevice: cuda_types::cuda::CUdeviceptr, us: ::core::ffi::c_ushort, N: usize, ) -> cuda_types::cuda::CUresult; fn cuMemsetD32_v2( dstDevice: cuda_types::cuda::CUdeviceptr, ui: ::core::ffi::c_uint, N: usize, ) -> cuda_types::cuda::CUresult; fn cuMemsetD2D8_v2( dstDevice: cuda_types::cuda::CUdeviceptr, dstPitch: usize, uc: ::core::ffi::c_uchar, Width: usize, Height: usize, ) -> cuda_types::cuda::CUresult; fn cuMemsetD2D16_v2( dstDevice: cuda_types::cuda::CUdeviceptr, dstPitch: usize, us: ::core::ffi::c_ushort, Width: usize, Height: usize, ) -> cuda_types::cuda::CUresult; fn cuMemsetD2D32_v2( dstDevice: cuda_types::cuda::CUdeviceptr, dstPitch: usize, ui: ::core::ffi::c_uint, Width: usize, Height: usize, ) -> cuda_types::cuda::CUresult; fn cuMemcpy( dst: cuda_types::cuda::CUdeviceptr, src: cuda_types::cuda::CUdeviceptr, ByteCount: usize, ) -> cuda_types::cuda::CUresult; fn cuMemcpyAsync( dst: cuda_types::cuda::CUdeviceptr, src: cuda_types::cuda::CUdeviceptr, ByteCount: usize, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemcpyPeer( dstDevice: cuda_types::cuda::CUdeviceptr, dstContext: cuda_types::cuda::CUcontext, srcDevice: cuda_types::cuda::CUdeviceptr, srcContext: cuda_types::cuda::CUcontext, ByteCount: usize, ) -> cuda_types::cuda::CUresult; fn cuMemcpyPeerAsync( dstDevice: cuda_types::cuda::CUdeviceptr, dstContext: cuda_types::cuda::CUcontext, srcDevice: cuda_types::cuda::CUdeviceptr, srcContext: cuda_types::cuda::CUcontext, ByteCount: usize, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemcpy3DPeer( pCopy: *const cuda_types::cuda::CUDA_MEMCPY3D_PEER, ) -> cuda_types::cuda::CUresult; fn cuMemcpy3DPeerAsync( pCopy: *const cuda_types::cuda::CUDA_MEMCPY3D_PEER, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemcpyBatchAsync( dsts: *mut cuda_types::cuda::CUdeviceptr, srcs: *mut cuda_types::cuda::CUdeviceptr, sizes: *mut usize, count: usize, attrs: *mut cuda_types::cuda::CUmemcpyAttributes, attrsIdxs: *mut usize, numAttrs: usize, failIdx: *mut usize, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemcpy3DBatchAsync( numOps: usize, opList: *mut cuda_types::cuda::CUDA_MEMCPY3D_BATCH_OP, failIdx: *mut usize, flags: ::core::ffi::c_ulonglong, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemcpyBatchAsync_ptsz( dsts: *mut cuda_types::cuda::CUdeviceptr, srcs: *mut cuda_types::cuda::CUdeviceptr, sizes: *mut usize, count: usize, attrs: *mut cuda_types::cuda::CUmemcpyAttributes, attrsIdxs: *mut usize, numAttrs: usize, failIdx: *mut usize, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemcpy3DBatchAsync_ptsz( numOps: usize, opList: *mut cuda_types::cuda::CUDA_MEMCPY3D_BATCH_OP, failIdx: *mut usize, flags: ::core::ffi::c_ulonglong, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemcpyBatchAsync_v2( dsts: *mut cuda_types::cuda::CUdeviceptr, srcs: *mut cuda_types::cuda::CUdeviceptr, sizes: *mut usize, count: usize, attrs: *mut cuda_types::cuda::CUmemcpyAttributes, attrsIdxs: *mut usize, numAttrs: usize, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemcpy3DBatchAsync_v2( numOps: usize, opList: *mut cuda_types::cuda::CUDA_MEMCPY3D_BATCH_OP, flags: ::core::ffi::c_ulonglong, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemsetD8Async( dstDevice: cuda_types::cuda::CUdeviceptr, uc: ::core::ffi::c_uchar, N: usize, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemsetD16Async( dstDevice: cuda_types::cuda::CUdeviceptr, us: ::core::ffi::c_ushort, N: usize, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemsetD32Async( dstDevice: cuda_types::cuda::CUdeviceptr, ui: ::core::ffi::c_uint, N: usize, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemsetD2D8Async( dstDevice: cuda_types::cuda::CUdeviceptr, dstPitch: usize, uc: ::core::ffi::c_uchar, Width: usize, Height: usize, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemsetD2D16Async( dstDevice: cuda_types::cuda::CUdeviceptr, dstPitch: usize, us: ::core::ffi::c_ushort, Width: usize, Height: usize, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemsetD2D32Async( dstDevice: cuda_types::cuda::CUdeviceptr, dstPitch: usize, ui: ::core::ffi::c_uint, Width: usize, Height: usize, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuStreamGetPriority( hStream: cuda_types::cuda::CUstream, priority: *mut ::core::ffi::c_int, ) -> cuda_types::cuda::CUresult; fn cuStreamGetId( hStream: cuda_types::cuda::CUstream, streamId: *mut ::core::ffi::c_ulonglong, ) -> cuda_types::cuda::CUresult; fn cuStreamGetFlags( hStream: cuda_types::cuda::CUstream, flags: *mut ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuStreamGetDevice( hStream: cuda_types::cuda::CUstream, device: *mut cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; fn cuStreamGetCtx( hStream: cuda_types::cuda::CUstream, pctx: *mut cuda_types::cuda::CUcontext, ) -> cuda_types::cuda::CUresult; fn cuStreamGetCtx_v2( hStream: cuda_types::cuda::CUstream, pCtx: *mut cuda_types::cuda::CUcontext, pGreenCtx: *mut cuda_types::cuda::CUgreenCtx, ) -> cuda_types::cuda::CUresult; fn cuStreamWaitEvent( hStream: cuda_types::cuda::CUstream, hEvent: cuda_types::cuda::CUevent, Flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuStreamAddCallback( hStream: cuda_types::cuda::CUstream, callback: cuda_types::cuda::CUstreamCallback, userData: *mut ::core::ffi::c_void, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuStreamAttachMemAsync( hStream: cuda_types::cuda::CUstream, dptr: cuda_types::cuda::CUdeviceptr, length: usize, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuStreamQuery(hStream: cuda_types::cuda::CUstream) -> cuda_types::cuda::CUresult; fn cuStreamSynchronize( hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuEventRecord( hEvent: cuda_types::cuda::CUevent, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuEventRecordWithFlags( hEvent: cuda_types::cuda::CUevent, hStream: cuda_types::cuda::CUstream, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuLaunchKernel( f: cuda_types::cuda::CUfunction, gridDimX: ::core::ffi::c_uint, gridDimY: ::core::ffi::c_uint, gridDimZ: ::core::ffi::c_uint, blockDimX: ::core::ffi::c_uint, blockDimY: ::core::ffi::c_uint, blockDimZ: ::core::ffi::c_uint, sharedMemBytes: ::core::ffi::c_uint, hStream: cuda_types::cuda::CUstream, kernelParams: *mut *mut ::core::ffi::c_void, extra: *mut *mut ::core::ffi::c_void, ) -> cuda_types::cuda::CUresult; fn cuLaunchKernelEx( config: *const cuda_types::cuda::CUlaunchConfig, f: cuda_types::cuda::CUfunction, kernelParams: *mut *mut ::core::ffi::c_void, extra: *mut *mut ::core::ffi::c_void, ) -> cuda_types::cuda::CUresult; fn cuLaunchHostFunc( hStream: cuda_types::cuda::CUstream, fn_: cuda_types::cuda::CUhostFn, userData: *mut ::core::ffi::c_void, ) -> cuda_types::cuda::CUresult; fn cuGraphicsMapResources( count: ::core::ffi::c_uint, resources: *mut cuda_types::cuda::CUgraphicsResource, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuGraphicsUnmapResources( count: ::core::ffi::c_uint, resources: *mut cuda_types::cuda::CUgraphicsResource, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuStreamWriteValue32( stream: cuda_types::cuda::CUstream, addr: cuda_types::cuda::CUdeviceptr, value: cuda_types::cuda::cuuint32_t, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuStreamWaitValue32( stream: cuda_types::cuda::CUstream, addr: cuda_types::cuda::CUdeviceptr, value: cuda_types::cuda::cuuint32_t, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuStreamWriteValue64( stream: cuda_types::cuda::CUstream, addr: cuda_types::cuda::CUdeviceptr, value: cuda_types::cuda::cuuint64_t, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuStreamWaitValue64( stream: cuda_types::cuda::CUstream, addr: cuda_types::cuda::CUdeviceptr, value: cuda_types::cuda::cuuint64_t, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuStreamBatchMemOp( stream: cuda_types::cuda::CUstream, count: ::core::ffi::c_uint, paramArray: *mut cuda_types::cuda::CUstreamBatchMemOpParams, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuStreamWriteValue32_ptsz( stream: cuda_types::cuda::CUstream, addr: cuda_types::cuda::CUdeviceptr, value: cuda_types::cuda::cuuint32_t, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuStreamWaitValue32_ptsz( stream: cuda_types::cuda::CUstream, addr: cuda_types::cuda::CUdeviceptr, value: cuda_types::cuda::cuuint32_t, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuStreamWriteValue64_ptsz( stream: cuda_types::cuda::CUstream, addr: cuda_types::cuda::CUdeviceptr, value: cuda_types::cuda::cuuint64_t, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuStreamWaitValue64_ptsz( stream: cuda_types::cuda::CUstream, addr: cuda_types::cuda::CUdeviceptr, value: cuda_types::cuda::cuuint64_t, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuStreamBatchMemOp_ptsz( stream: cuda_types::cuda::CUstream, count: ::core::ffi::c_uint, paramArray: *mut cuda_types::cuda::CUstreamBatchMemOpParams, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuStreamWriteValue32_v2( stream: cuda_types::cuda::CUstream, addr: cuda_types::cuda::CUdeviceptr, value: cuda_types::cuda::cuuint32_t, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuStreamWaitValue32_v2( stream: cuda_types::cuda::CUstream, addr: cuda_types::cuda::CUdeviceptr, value: cuda_types::cuda::cuuint32_t, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuStreamWriteValue64_v2( stream: cuda_types::cuda::CUstream, addr: cuda_types::cuda::CUdeviceptr, value: cuda_types::cuda::cuuint64_t, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuStreamWaitValue64_v2( stream: cuda_types::cuda::CUstream, addr: cuda_types::cuda::CUdeviceptr, value: cuda_types::cuda::cuuint64_t, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuStreamBatchMemOp_v2( stream: cuda_types::cuda::CUstream, count: ::core::ffi::c_uint, paramArray: *mut cuda_types::cuda::CUstreamBatchMemOpParams, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuMemPrefetchAsync( devPtr: cuda_types::cuda::CUdeviceptr, count: usize, dstDevice: cuda_types::cuda::CUdevice, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemPrefetchAsync_ptsz( devPtr: cuda_types::cuda::CUdeviceptr, count: usize, dstDevice: cuda_types::cuda::CUdevice, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemPrefetchAsync_v2( devPtr: cuda_types::cuda::CUdeviceptr, count: usize, location: cuda_types::cuda::CUmemLocation, flags: ::core::ffi::c_uint, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemAdvise( devPtr: cuda_types::cuda::CUdeviceptr, count: usize, advice: cuda_types::cuda::CUmem_advise, device: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; fn cuMemPrefetchBatchAsync( dptrs: *mut cuda_types::cuda::CUdeviceptr, sizes: *mut usize, count: usize, prefetchLocs: *mut cuda_types::cuda::CUmemLocation, prefetchLocIdxs: *mut usize, numPrefetchLocs: usize, flags: ::core::ffi::c_ulonglong, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemDiscardBatchAsync( dptrs: *mut cuda_types::cuda::CUdeviceptr, sizes: *mut usize, count: usize, flags: ::core::ffi::c_ulonglong, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemDiscardAndPrefetchBatchAsync( dptrs: *mut cuda_types::cuda::CUdeviceptr, sizes: *mut usize, count: usize, prefetchLocs: *mut cuda_types::cuda::CUmemLocation, prefetchLocIdxs: *mut usize, numPrefetchLocs: usize, flags: ::core::ffi::c_ulonglong, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuLaunchCooperativeKernel( f: cuda_types::cuda::CUfunction, gridDimX: ::core::ffi::c_uint, gridDimY: ::core::ffi::c_uint, gridDimZ: ::core::ffi::c_uint, blockDimX: ::core::ffi::c_uint, blockDimY: ::core::ffi::c_uint, blockDimZ: ::core::ffi::c_uint, sharedMemBytes: ::core::ffi::c_uint, hStream: cuda_types::cuda::CUstream, kernelParams: *mut *mut ::core::ffi::c_void, ) -> cuda_types::cuda::CUresult; fn cuSignalExternalSemaphoresAsync( extSemArray: *const cuda_types::cuda::CUexternalSemaphore, paramsArray: *const cuda_types::cuda::CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS, numExtSems: ::core::ffi::c_uint, stream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuWaitExternalSemaphoresAsync( extSemArray: *const cuda_types::cuda::CUexternalSemaphore, paramsArray: *const cuda_types::cuda::CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS, numExtSems: ::core::ffi::c_uint, stream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuStreamBeginCapture( hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuStreamBeginCapture_ptsz( hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuStreamBeginCapture_v2( hStream: cuda_types::cuda::CUstream, mode: cuda_types::cuda::CUstreamCaptureMode, ) -> cuda_types::cuda::CUresult; fn cuStreamBeginCaptureToGraph( hStream: cuda_types::cuda::CUstream, hGraph: cuda_types::cuda::CUgraph, dependencies: *const cuda_types::cuda::CUgraphNode, dependencyData: *const cuda_types::cuda::CUgraphEdgeData, numDependencies: usize, mode: cuda_types::cuda::CUstreamCaptureMode, ) -> cuda_types::cuda::CUresult; fn cuStreamEndCapture( hStream: cuda_types::cuda::CUstream, phGraph: *mut cuda_types::cuda::CUgraph, ) -> cuda_types::cuda::CUresult; fn cuStreamIsCapturing( hStream: cuda_types::cuda::CUstream, captureStatus: *mut cuda_types::cuda::CUstreamCaptureStatus, ) -> cuda_types::cuda::CUresult; fn cuStreamGetCaptureInfo( hStream: cuda_types::cuda::CUstream, captureStatus_out: *mut cuda_types::cuda::CUstreamCaptureStatus, id_out: *mut cuda_types::cuda::cuuint64_t, ) -> cuda_types::cuda::CUresult; fn cuStreamGetCaptureInfo_ptsz( hStream: cuda_types::cuda::CUstream, captureStatus_out: *mut cuda_types::cuda::CUstreamCaptureStatus, id_out: *mut cuda_types::cuda::cuuint64_t, ) -> cuda_types::cuda::CUresult; fn cuStreamGetCaptureInfo_v2( hStream: cuda_types::cuda::CUstream, captureStatus_out: *mut cuda_types::cuda::CUstreamCaptureStatus, id_out: *mut cuda_types::cuda::cuuint64_t, graph_out: *mut cuda_types::cuda::CUgraph, dependencies_out: *mut *const cuda_types::cuda::CUgraphNode, numDependencies_out: *mut usize, ) -> cuda_types::cuda::CUresult; fn cuStreamGetCaptureInfo_v2_ptsz( hStream: cuda_types::cuda::CUstream, captureStatus_out: *mut cuda_types::cuda::CUstreamCaptureStatus, id_out: *mut cuda_types::cuda::cuuint64_t, graph_out: *mut cuda_types::cuda::CUgraph, dependencies_out: *mut *const cuda_types::cuda::CUgraphNode, numDependencies_out: *mut usize, ) -> cuda_types::cuda::CUresult; fn cuStreamGetCaptureInfo_v3( hStream: cuda_types::cuda::CUstream, captureStatus_out: *mut cuda_types::cuda::CUstreamCaptureStatus, id_out: *mut cuda_types::cuda::cuuint64_t, graph_out: *mut cuda_types::cuda::CUgraph, dependencies_out: *mut *const cuda_types::cuda::CUgraphNode, edgeData_out: *mut *const cuda_types::cuda::CUgraphEdgeData, numDependencies_out: *mut usize, ) -> cuda_types::cuda::CUresult; fn cuGraphAddKernelNode( phGraphNode: *mut cuda_types::cuda::CUgraphNode, hGraph: cuda_types::cuda::CUgraph, dependencies: *const cuda_types::cuda::CUgraphNode, numDependencies: usize, nodeParams: *const cuda_types::cuda::CUDA_KERNEL_NODE_PARAMS_v1, ) -> cuda_types::cuda::CUresult; fn cuGraphKernelNodeGetParams( hNode: cuda_types::cuda::CUgraphNode, nodeParams: *mut cuda_types::cuda::CUDA_KERNEL_NODE_PARAMS_v1, ) -> cuda_types::cuda::CUresult; fn cuGraphKernelNodeSetParams( hNode: cuda_types::cuda::CUgraphNode, nodeParams: *const cuda_types::cuda::CUDA_KERNEL_NODE_PARAMS_v1, ) -> cuda_types::cuda::CUresult; fn cuGraphExecKernelNodeSetParams( hGraphExec: cuda_types::cuda::CUgraphExec, hNode: cuda_types::cuda::CUgraphNode, nodeParams: *const cuda_types::cuda::CUDA_KERNEL_NODE_PARAMS_v1, ) -> cuda_types::cuda::CUresult; fn cuGraphInstantiateWithParams( phGraphExec: *mut cuda_types::cuda::CUgraphExec, hGraph: cuda_types::cuda::CUgraph, instantiateParams: *mut cuda_types::cuda::CUDA_GRAPH_INSTANTIATE_PARAMS, ) -> cuda_types::cuda::CUresult; fn cuGraphExecUpdate( hGraphExec: cuda_types::cuda::CUgraphExec, hGraph: cuda_types::cuda::CUgraph, hErrorNode_out: *mut cuda_types::cuda::CUgraphNode, updateResult_out: *mut cuda_types::cuda::CUgraphExecUpdateResult, ) -> cuda_types::cuda::CUresult; fn cuGraphUpload( hGraph: cuda_types::cuda::CUgraphExec, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuGraphLaunch( hGraph: cuda_types::cuda::CUgraphExec, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuGraphGetEdges( hGraph: cuda_types::cuda::CUgraph, from: *mut cuda_types::cuda::CUgraphNode, to: *mut cuda_types::cuda::CUgraphNode, numEdges: *mut usize, ) -> cuda_types::cuda::CUresult; fn cuGraphNodeGetDependencies( hNode: cuda_types::cuda::CUgraphNode, dependencies: *mut cuda_types::cuda::CUgraphNode, numDependencies: *mut usize, ) -> cuda_types::cuda::CUresult; fn cuGraphNodeGetDependentNodes( hNode: cuda_types::cuda::CUgraphNode, dependentNodes: *mut cuda_types::cuda::CUgraphNode, numDependentNodes: *mut usize, ) -> cuda_types::cuda::CUresult; fn cuGraphAddDependencies( hGraph: cuda_types::cuda::CUgraph, from: *const cuda_types::cuda::CUgraphNode, to: *const cuda_types::cuda::CUgraphNode, numDependencies: usize, ) -> cuda_types::cuda::CUresult; fn cuGraphRemoveDependencies( hGraph: cuda_types::cuda::CUgraph, from: *const cuda_types::cuda::CUgraphNode, to: *const cuda_types::cuda::CUgraphNode, numDependencies: usize, ) -> cuda_types::cuda::CUresult; fn cuGraphAddNode( phGraphNode: *mut cuda_types::cuda::CUgraphNode, hGraph: cuda_types::cuda::CUgraph, dependencies: *const cuda_types::cuda::CUgraphNode, numDependencies: usize, nodeParams: *mut cuda_types::cuda::CUgraphNodeParams, ) -> cuda_types::cuda::CUresult; fn cuStreamCopyAttributes( dstStream: cuda_types::cuda::CUstream, srcStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuStreamGetAttribute( hStream: cuda_types::cuda::CUstream, attr: cuda_types::cuda::CUstreamAttrID, value: *mut cuda_types::cuda::CUstreamAttrValue, ) -> cuda_types::cuda::CUresult; fn cuStreamSetAttribute( hStream: cuda_types::cuda::CUstream, attr: cuda_types::cuda::CUstreamAttrID, param: *const cuda_types::cuda::CUstreamAttrValue, ) -> cuda_types::cuda::CUresult; fn cuIpcOpenMemHandle( pdptr: *mut cuda_types::cuda::CUdeviceptr, handle: cuda_types::cuda::CUipcMemHandle, Flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuGraphInstantiate( phGraphExec: *mut cuda_types::cuda::CUgraphExec, hGraph: cuda_types::cuda::CUgraph, phErrorNode: *mut cuda_types::cuda::CUgraphNode, logBuffer: *mut ::core::ffi::c_char, bufferSize: usize, ) -> cuda_types::cuda::CUresult; fn cuGraphInstantiate_v2( phGraphExec: *mut cuda_types::cuda::CUgraphExec, hGraph: cuda_types::cuda::CUgraph, phErrorNode: *mut cuda_types::cuda::CUgraphNode, logBuffer: *mut ::core::ffi::c_char, bufferSize: usize, ) -> cuda_types::cuda::CUresult; fn cuMemMapArrayAsync( mapInfoList: *mut cuda_types::cuda::CUarrayMapInfo, count: ::core::ffi::c_uint, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemFreeAsync( dptr: cuda_types::cuda::CUdeviceptr, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemAllocAsync( dptr: *mut cuda_types::cuda::CUdeviceptr, bytesize: usize, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuMemAllocFromPoolAsync( dptr: *mut cuda_types::cuda::CUdeviceptr, bytesize: usize, pool: cuda_types::cuda::CUmemoryPool, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuStreamUpdateCaptureDependencies( hStream: cuda_types::cuda::CUstream, dependencies: *mut cuda_types::cuda::CUgraphNode, numDependencies: usize, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuStreamUpdateCaptureDependencies_ptsz( hStream: cuda_types::cuda::CUstream, dependencies: *mut cuda_types::cuda::CUgraphNode, numDependencies: usize, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuStreamUpdateCaptureDependencies_v2( hStream: cuda_types::cuda::CUstream, dependencies: *mut cuda_types::cuda::CUgraphNode, dependencyData: *const cuda_types::cuda::CUgraphEdgeData, numDependencies: usize, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuMemBatchDecompressAsync( paramsArray: *mut cuda_types::cuda::CUmemDecompressParams, count: usize, flags: ::core::ffi::c_uint, errorIndex: *mut usize, stream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuGetProcAddress( symbol: *const ::core::ffi::c_char, pfn: *mut *mut ::core::ffi::c_void, cudaVersion: ::core::ffi::c_int, flags: cuda_types::cuda::cuuint64_t, ) -> cuda_types::cuda::CUresult; /** \brief Returns the restore thread ID for a CUDA process Returns in \p *tid the thread ID of the CUDA restore thread for the process specified by \p pid. \param pid - The process ID of the CUDA process \param tid - Returned restore thread ID \return ::CUDA_SUCCESS ::CUDA_ERROR_INVALID_VALUE ::CUDA_ERROR_NOT_INITIALIZED ::CUDA_ERROR_NOT_SUPPORTED*/ fn cuCheckpointProcessGetRestoreThreadId( pid: ::core::ffi::c_int, tid: *mut ::core::ffi::c_int, ) -> cuda_types::cuda::CUresult; /** \brief Returns the process state of a CUDA process Returns in \p *state the current state of the CUDA process specified by \p pid. \param pid - The process ID of the CUDA process \param state - Returned CUDA process state \return ::CUDA_SUCCESS ::CUDA_ERROR_INVALID_VALUE ::CUDA_ERROR_NOT_INITIALIZED ::CUDA_ERROR_NOT_SUPPORTED*/ fn cuCheckpointProcessGetState( pid: ::core::ffi::c_int, state: *mut cuda_types::cuda::CUprocessState, ) -> cuda_types::cuda::CUresult; /** \brief Lock a running CUDA process Lock the CUDA process specified by \p pid which will block further CUDA API calls. Process must be in the RUNNING state in order to lock. Upon successful return the process will be in the LOCKED state. If timeoutMs is specified and the timeout is reached the process will be left in the RUNNING state upon return. \param pid - The process ID of the CUDA process \param args - Optional lock operation arguments \return ::CUDA_SUCCESS ::CUDA_ERROR_INVALID_VALUE ::CUDA_ERROR_NOT_INITIALIZED ::CUDA_ERROR_ILLEGAL_STATE ::CUDA_ERROR_NOT_SUPPORTED ::CUDA_ERROR_NOT_READY*/ fn cuCheckpointProcessLock( pid: ::core::ffi::c_int, args: *mut cuda_types::cuda::CUcheckpointLockArgs, ) -> cuda_types::cuda::CUresult; /** \brief Checkpoint a CUDA process's GPU memory contents Checkpoints a CUDA process specified by \p pid that is in the LOCKED state. The GPU memory contents will be brought into host memory and all underlying references will be released. Process must be in the LOCKED state to checkpoint. Upon successful return the process will be in the CHECKPOINTED state. \param pid - The process ID of the CUDA process \param args - Optional checkpoint operation arguments \return ::CUDA_SUCCESS ::CUDA_ERROR_INVALID_VALUE ::CUDA_ERROR_NOT_INITIALIZED ::CUDA_ERROR_ILLEGAL_STATE ::CUDA_ERROR_NOT_SUPPORTED*/ fn cuCheckpointProcessCheckpoint( pid: ::core::ffi::c_int, args: *mut cuda_types::cuda::CUcheckpointCheckpointArgs, ) -> cuda_types::cuda::CUresult; /** \brief Restore a CUDA process's GPU memory contents from its last checkpoint Restores a CUDA process specified by \p pid from its last checkpoint. Process must be in the CHECKPOINTED state to restore. GPU UUID pairs can be specified in \p args to remap the process old GPUs onto new GPUs. The GPU to restore onto needs to have enough memory and be of the same chip type as the old GPU. If an array of GPU UUID pairs is specified, it must contain every checkpointed GPU. Upon successful return the process will be in the LOCKED state. CUDA process restore requires persistence mode to be enabled or ::cuInit to have been called before execution. \param pid - The process ID of the CUDA process \param args - Optional restore operation arguments \return ::CUDA_SUCCESS ::CUDA_ERROR_INVALID_VALUE ::CUDA_ERROR_NOT_INITIALIZED ::CUDA_ERROR_ILLEGAL_STATE ::CUDA_ERROR_NOT_SUPPORTED \sa ::cuInit*/ fn cuCheckpointProcessRestore( pid: ::core::ffi::c_int, args: *mut cuda_types::cuda::CUcheckpointRestoreArgs, ) -> cuda_types::cuda::CUresult; /** \brief Unlock a CUDA process to allow CUDA API calls Unlocks a process specified by \p pid allowing it to resume making CUDA API calls. Process must be in the LOCKED state. Upon successful return the process will be in the RUNNING state. \param pid - The process ID of the CUDA process \param args - Optional unlock operation arguments \return ::CUDA_SUCCESS ::CUDA_ERROR_INVALID_VALUE ::CUDA_ERROR_NOT_INITIALIZED ::CUDA_ERROR_ILLEGAL_STATE ::CUDA_ERROR_NOT_SUPPORTED*/ fn cuCheckpointProcessUnlock( pid: ::core::ffi::c_int, args: *mut cuda_types::cuda::CUcheckpointUnlockArgs, ) -> cuda_types::cuda::CUresult; /** \brief Initialize the profiling. \deprecated Note that this function is deprecated and should not be used. Starting with CUDA 12.0, it always returns error code ::CUDA_ERROR_NOT_SUPPORTED. Using this API user can initialize the CUDA profiler by specifying the configuration file, output file and output file format. This API is generally used to profile different set of counters by looping the kernel launch. The \p configFile parameter can be used to select profiling options including profiler counters. Refer to the "Compute Command Line Profiler User Guide" for supported profiler options and counters. Limitation: The CUDA profiler cannot be initialized with this API if another profiling tool is already active, as indicated by the ::CUDA_ERROR_PROFILER_DISABLED return code. Typical usage of the profiling APIs is as follows: for each set of counters/options\n {\n cuProfilerInitialize(); //Initialize profiling, set the counters or options in the config file \n ...\n cuProfilerStart(); \n // code to be profiled \n cuProfilerStop(); \n ...\n cuProfilerStart(); \n // code to be profiled \n cuProfilerStop(); \n ...\n }\n \param configFile - Name of the config file that lists the counters/options for profiling. \param outputFile - Name of the outputFile where the profiling results will be stored. \param outputMode - outputMode, can be ::CU_OUT_KEY_VALUE_PAIR or ::CU_OUT_CSV. \return ::CUDA_ERROR_NOT_SUPPORTED \notefnerr \sa ::cuProfilerStart, ::cuProfilerStop,*/ fn cuProfilerInitialize( configFile: *const ::core::ffi::c_char, outputFile: *const ::core::ffi::c_char, outputMode: cuda_types::cuda::CUoutput_mode, ) -> cuda_types::cuda::CUresult; /** \brief Enable profiling. Enables profile collection by the active profiling tool for the current context. If profiling is already enabled, then cuProfilerStart() has no effect. cuProfilerStart and cuProfilerStop APIs are used to programmatically control the profiling granularity by allowing profiling to be done only on selective pieces of code. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_CONTEXT \notefnerr \sa ::cuProfilerInitialize, ::cuProfilerStop, ::cudaProfilerStart*/ fn cuProfilerStart() -> cuda_types::cuda::CUresult; /** \brief Disable profiling. Disables profile collection by the active profiling tool for the current context. If profiling is already disabled, then cuProfilerStop() has no effect. cuProfilerStart and cuProfilerStop APIs are used to programmatically control the profiling granularity by allowing profiling to be done only on selective pieces of code. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_CONTEXT \notefnerr \sa ::cuProfilerInitialize, ::cuProfilerStart, ::cudaProfilerStop*/ fn cuProfilerStop() -> cuda_types::cuda::CUresult; /** \brief Registers an OpenGL buffer object Registers the buffer object specified by \p buffer for access by CUDA. A handle to the registered object is returned as \p pCudaResource. The register flags \p Flags specify the intended usage, as follows: - ::CU_GRAPHICS_REGISTER_FLAGS_NONE: Specifies no hints about how this resource will be used. It is therefore assumed that this resource will be read from and written to by CUDA. This is the default value. - ::CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY: Specifies that CUDA will not write to this resource. - ::CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD: Specifies that CUDA will not read from this resource and will write over the entire contents of the resource, so none of the data previously stored in the resource will be preserved. \param pCudaResource - Pointer to the returned object handle \param buffer - name of buffer object to be registered \param Flags - Register flags \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_ALREADY_MAPPED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_OPERATING_SYSTEM \notefnerr \sa ::cuGraphicsUnregisterResource, ::cuGraphicsMapResources, ::cuGraphicsResourceGetMappedPointer, ::cudaGraphicsGLRegisterBuffer*/ fn cuGraphicsGLRegisterBuffer( pCudaResource: *mut cuda_types::cuda::CUgraphicsResource, buffer: cuda_types::cuda::GLuint, Flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Register an OpenGL texture or renderbuffer object Registers the texture or renderbuffer object specified by \p image for access by CUDA. A handle to the registered object is returned as \p pCudaResource. \p target must match the type of the object, and must be one of ::GL_TEXTURE_2D, ::GL_TEXTURE_RECTANGLE, ::GL_TEXTURE_CUBE_MAP, ::GL_TEXTURE_3D, ::GL_TEXTURE_2D_ARRAY, or ::GL_RENDERBUFFER. The register flags \p Flags specify the intended usage, as follows: - ::CU_GRAPHICS_REGISTER_FLAGS_NONE: Specifies no hints about how this resource will be used. It is therefore assumed that this resource will be read from and written to by CUDA. This is the default value. - ::CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY: Specifies that CUDA will not write to this resource. - ::CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD: Specifies that CUDA will not read from this resource and will write over the entire contents of the resource, so none of the data previously stored in the resource will be preserved. - ::CU_GRAPHICS_REGISTER_FLAGS_SURFACE_LDST: Specifies that CUDA will bind this resource to a surface reference. - ::CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER: Specifies that CUDA will perform texture gather operations on this resource. The following image formats are supported. For brevity's sake, the list is abbreviated. For ex., {GL_R, GL_RG} X {8, 16} would expand to the following 4 formats {GL_R8, GL_R16, GL_RG8, GL_RG16} : - GL_RED, GL_RG, GL_RGBA, GL_LUMINANCE, GL_ALPHA, GL_LUMINANCE_ALPHA, GL_INTENSITY - {GL_R, GL_RG, GL_RGBA} X {8, 16, 16F, 32F, 8UI, 16UI, 32UI, 8I, 16I, 32I} - {GL_LUMINANCE, GL_ALPHA, GL_LUMINANCE_ALPHA, GL_INTENSITY} X {8, 16, 16F_ARB, 32F_ARB, 8UI_EXT, 16UI_EXT, 32UI_EXT, 8I_EXT, 16I_EXT, 32I_EXT} The following image classes are currently disallowed: - Textures with borders - Multisampled renderbuffers \param pCudaResource - Pointer to the returned object handle \param image - name of texture or renderbuffer object to be registered \param target - Identifies the type of object specified by \p image \param Flags - Register flags \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_ALREADY_MAPPED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_OPERATING_SYSTEM \notefnerr \sa ::cuGraphicsUnregisterResource, ::cuGraphicsMapResources, ::cuGraphicsSubResourceGetMappedArray, ::cudaGraphicsGLRegisterImage*/ fn cuGraphicsGLRegisterImage( pCudaResource: *mut cuda_types::cuda::CUgraphicsResource, image: cuda_types::cuda::GLuint, target: cuda_types::cuda::GLenum, Flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Gets the CUDA devices associated with the current OpenGL context Returns in \p *pCudaDeviceCount the number of CUDA-compatible devices corresponding to the current OpenGL context. Also returns in \p *pCudaDevices at most cudaDeviceCount of the CUDA-compatible devices corresponding to the current OpenGL context. If any of the GPUs being used by the current OpenGL context are not CUDA capable then the call will return CUDA_ERROR_NO_DEVICE. The \p deviceList argument may be any of the following: - ::CU_GL_DEVICE_LIST_ALL: Query all devices used by the current OpenGL context. - ::CU_GL_DEVICE_LIST_CURRENT_FRAME: Query the devices used by the current OpenGL context to render the current frame (in SLI). - ::CU_GL_DEVICE_LIST_NEXT_FRAME: Query the devices used by the current OpenGL context to render the next frame (in SLI). Note that this is a prediction, it can't be guaranteed that this is correct in all cases. \param pCudaDeviceCount - Returned number of CUDA devices. \param pCudaDevices - Returned CUDA devices. \param cudaDeviceCount - The size of the output device array pCudaDevices. \param deviceList - The set of devices to return. \return ::CUDA_SUCCESS, ::CUDA_ERROR_NO_DEVICE, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_GRAPHICS_CONTEXT, ::CUDA_ERROR_OPERATING_SYSTEM \notefnerr \sa ::cuWGLGetDevice, ::cudaGLGetDevices*/ fn cuGLGetDevices_v2( pCudaDeviceCount: *mut ::core::ffi::c_uint, pCudaDevices: *mut cuda_types::cuda::CUdevice, cudaDeviceCount: ::core::ffi::c_uint, deviceList: cuda_types::cuda::CUGLDeviceList, ) -> cuda_types::cuda::CUresult; /** \brief Create a CUDA context for interoperability with OpenGL \deprecated This function is deprecated as of Cuda 5.0. This function is deprecated and should no longer be used. It is no longer necessary to associate a CUDA context with an OpenGL context in order to achieve maximum interoperability performance. \param pCtx - Returned CUDA context \param Flags - Options for CUDA context creation \param device - Device on which to create the context \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_OUT_OF_MEMORY \notefnerr \sa ::cuCtxCreate, ::cuGLInit, ::cuGLMapBufferObject, ::cuGLRegisterBufferObject, ::cuGLUnmapBufferObject, ::cuGLUnregisterBufferObject, ::cuGLMapBufferObjectAsync, ::cuGLUnmapBufferObjectAsync, ::cuGLSetBufferObjectMapFlags, ::cuWGLGetDevice*/ fn cuGLCtxCreate_v2( pCtx: *mut cuda_types::cuda::CUcontext, Flags: ::core::ffi::c_uint, device: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; /** \brief Initializes OpenGL interoperability \deprecated This function is deprecated as of Cuda 3.0. Initializes OpenGL interoperability. This function is deprecated and calling it is no longer required. It may fail if the needed OpenGL driver facilities are not available. \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_UNKNOWN \notefnerr \sa ::cuGLMapBufferObject, ::cuGLRegisterBufferObject, ::cuGLUnmapBufferObject, ::cuGLUnregisterBufferObject, ::cuGLMapBufferObjectAsync, ::cuGLUnmapBufferObjectAsync, ::cuGLSetBufferObjectMapFlags, ::cuWGLGetDevice*/ fn cuGLInit() -> cuda_types::cuda::CUresult; /** \brief Registers an OpenGL buffer object \deprecated This function is deprecated as of Cuda 3.0. Registers the buffer object specified by \p buffer for access by CUDA. This function must be called before CUDA can map the buffer object. There must be a valid OpenGL context bound to the current thread when this function is called, and the buffer name is resolved by that context. \param buffer - The name of the buffer object to register. \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_ALREADY_MAPPED \notefnerr \sa ::cuGraphicsGLRegisterBuffer*/ fn cuGLRegisterBufferObject( buffer: cuda_types::cuda::GLuint, ) -> cuda_types::cuda::CUresult; /** \brief Maps an OpenGL buffer object \deprecated This function is deprecated as of Cuda 3.0. Maps the buffer object specified by \p buffer into the address space of the current CUDA context and returns in \p *dptr and \p *size the base pointer and size of the resulting mapping. There must be a valid OpenGL context bound to the current thread when this function is called. This must be the same context, or a member of the same shareGroup, as the context that was bound when the buffer was registered. All streams in the current CUDA context are synchronized with the current GL context. \param dptr - Returned mapped base pointer \param size - Returned size of mapping \param buffer - The name of the buffer object to map \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_MAP_FAILED \notefnerr \sa ::cuGraphicsMapResources*/ fn cuGLMapBufferObject_v2_ptds( dptr: *mut cuda_types::cuda::CUdeviceptr, size: *mut usize, buffer: cuda_types::cuda::GLuint, ) -> cuda_types::cuda::CUresult; /** \brief Unmaps an OpenGL buffer object \deprecated This function is deprecated as of Cuda 3.0. Unmaps the buffer object specified by \p buffer for access by CUDA. There must be a valid OpenGL context bound to the current thread when this function is called. This must be the same context, or a member of the same shareGroup, as the context that was bound when the buffer was registered. All streams in the current CUDA context are synchronized with the current GL context. \param buffer - Buffer object to unmap \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuGraphicsUnmapResources*/ fn cuGLUnmapBufferObject( buffer: cuda_types::cuda::GLuint, ) -> cuda_types::cuda::CUresult; /** \brief Unregister an OpenGL buffer object \deprecated This function is deprecated as of Cuda 3.0. Unregisters the buffer object specified by \p buffer. This releases any resources associated with the registered buffer. After this call, the buffer may no longer be mapped for access by CUDA. There must be a valid OpenGL context bound to the current thread when this function is called. This must be the same context, or a member of the same shareGroup, as the context that was bound when the buffer was registered. \param buffer - Name of the buffer object to unregister \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuGraphicsUnregisterResource*/ fn cuGLUnregisterBufferObject( buffer: cuda_types::cuda::GLuint, ) -> cuda_types::cuda::CUresult; /** \brief Set the map flags for an OpenGL buffer object \deprecated This function is deprecated as of Cuda 3.0. Sets the map flags for the buffer object specified by \p buffer. Changes to \p Flags will take effect the next time \p buffer is mapped. The \p Flags argument may be any of the following: - ::CU_GL_MAP_RESOURCE_FLAGS_NONE: Specifies no hints about how this resource will be used. It is therefore assumed that this resource will be read from and written to by CUDA kernels. This is the default value. - ::CU_GL_MAP_RESOURCE_FLAGS_READ_ONLY: Specifies that CUDA kernels which access this resource will not write to this resource. - ::CU_GL_MAP_RESOURCE_FLAGS_WRITE_DISCARD: Specifies that CUDA kernels which access this resource will not read from this resource and will write over the entire contents of the resource, so none of the data previously stored in the resource will be preserved. If \p buffer has not been registered for use with CUDA, then ::CUDA_ERROR_INVALID_HANDLE is returned. If \p buffer is presently mapped for access by CUDA, then ::CUDA_ERROR_ALREADY_MAPPED is returned. There must be a valid OpenGL context bound to the current thread when this function is called. This must be the same context, or a member of the same shareGroup, as the context that was bound when the buffer was registered. \param buffer - Buffer object to unmap \param Flags - Map flags \return ::CUDA_SUCCESS, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_ALREADY_MAPPED, ::CUDA_ERROR_INVALID_CONTEXT, \notefnerr \sa ::cuGraphicsResourceSetMapFlags*/ fn cuGLSetBufferObjectMapFlags( buffer: cuda_types::cuda::GLuint, Flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Maps an OpenGL buffer object \deprecated This function is deprecated as of Cuda 3.0. Maps the buffer object specified by \p buffer into the address space of the current CUDA context and returns in \p *dptr and \p *size the base pointer and size of the resulting mapping. There must be a valid OpenGL context bound to the current thread when this function is called. This must be the same context, or a member of the same shareGroup, as the context that was bound when the buffer was registered. Stream \p hStream in the current CUDA context is synchronized with the current GL context. \param dptr - Returned mapped base pointer \param size - Returned size of mapping \param buffer - The name of the buffer object to map \param hStream - Stream to synchronize \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_MAP_FAILED \notefnerr \sa ::cuGraphicsMapResources*/ fn cuGLMapBufferObjectAsync_v2_ptsz( dptr: *mut cuda_types::cuda::CUdeviceptr, size: *mut usize, buffer: cuda_types::cuda::GLuint, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Unmaps an OpenGL buffer object \deprecated This function is deprecated as of Cuda 3.0. Unmaps the buffer object specified by \p buffer for access by CUDA. There must be a valid OpenGL context bound to the current thread when this function is called. This must be the same context, or a member of the same shareGroup, as the context that was bound when the buffer was registered. Stream \p hStream in the current CUDA context is synchronized with the current GL context. \param buffer - Name of the buffer object to unmap \param hStream - Stream to synchronize \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuGraphicsUnmapResources*/ fn cuGLUnmapBufferObjectAsync( buffer: cuda_types::cuda::GLuint, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuGLGetDevices( pCudaDeviceCount: *mut ::core::ffi::c_uint, pCudaDevices: *mut cuda_types::cuda::CUdevice, cudaDeviceCount: ::core::ffi::c_uint, deviceList: cuda_types::cuda::CUGLDeviceList, ) -> cuda_types::cuda::CUresult; fn cuGLMapBufferObject_v2( dptr: *mut cuda_types::cuda::CUdeviceptr, size: *mut usize, buffer: cuda_types::cuda::GLuint, ) -> cuda_types::cuda::CUresult; fn cuGLMapBufferObjectAsync_v2( dptr: *mut cuda_types::cuda::CUdeviceptr, size: *mut usize, buffer: cuda_types::cuda::GLuint, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; fn cuGLCtxCreate( pCtx: *mut cuda_types::cuda::CUcontext, Flags: ::core::ffi::c_uint, device: cuda_types::cuda::CUdevice, ) -> cuda_types::cuda::CUresult; fn cuGLMapBufferObject( dptr: *mut cuda_types::cuda::CUdeviceptr_v1, size: *mut ::core::ffi::c_uint, buffer: cuda_types::cuda::GLuint, ) -> cuda_types::cuda::CUresult; fn cuGLMapBufferObjectAsync( dptr: *mut cuda_types::cuda::CUdeviceptr_v1, size: *mut ::core::ffi::c_uint, buffer: cuda_types::cuda::GLuint, hStream: cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Registers an EGL image Registers the EGLImageKHR specified by \p image for access by CUDA. A handle to the registered object is returned as \p pCudaResource. Additional Mapping/Unmapping is not required for the registered resource and ::cuGraphicsResourceGetMappedEglFrame can be directly called on the \p pCudaResource. The application will be responsible for synchronizing access to shared objects. The application must ensure that any pending operation which access the objects have completed before passing control to CUDA. This may be accomplished by issuing and waiting for glFinish command on all GLcontexts (for OpenGL and likewise for other APIs). The application will be also responsible for ensuring that any pending operation on the registered CUDA resource has completed prior to executing subsequent commands in other APIs accesing the same memory objects. This can be accomplished by calling cuCtxSynchronize or cuEventSynchronize (preferably). The surface's intended usage is specified using \p flags, as follows: - ::CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE: Specifies no hints about how this resource will be used. It is therefore assumed that this resource will be read from and written to by CUDA. This is the default value. - ::CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY: Specifies that CUDA will not write to this resource. - ::CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD: Specifies that CUDA will not read from this resource and will write over the entire contents of the resource, so none of the data previously stored in the resource will be preserved. The EGLImageKHR is an object which can be used to create EGLImage target resource. It is defined as a void pointer. typedef void* EGLImageKHR \param pCudaResource - Pointer to the returned object handle \param image - An EGLImageKHR image which can be used to create target resource. \param flags - Map flags \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_ALREADY_MAPPED, ::CUDA_ERROR_INVALID_CONTEXT, \sa ::cuGraphicsEGLRegisterImage, ::cuGraphicsUnregisterResource, ::cuGraphicsResourceSetMapFlags, ::cuGraphicsMapResources, ::cuGraphicsUnmapResources, ::cudaGraphicsEGLRegisterImage*/ fn cuGraphicsEGLRegisterImage( pCudaResource: *mut cuda_types::cuda::CUgraphicsResource, image: cuda_types::cuda::EGLImageKHR, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Connect CUDA to EGLStream as a consumer. Connect CUDA as a consumer to EGLStreamKHR specified by \p stream. The EGLStreamKHR is an EGL object that transfers a sequence of image frames from one API to another. \param conn - Pointer to the returned connection handle \param stream - EGLStreamKHR handle \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_INVALID_CONTEXT, \sa ::cuEGLStreamConsumerConnect, ::cuEGLStreamConsumerDisconnect, ::cuEGLStreamConsumerAcquireFrame, ::cuEGLStreamConsumerReleaseFrame, ::cudaEGLStreamConsumerConnect*/ fn cuEGLStreamConsumerConnect( conn: *mut cuda_types::cuda::CUeglStreamConnection, stream: cuda_types::cuda::EGLStreamKHR, ) -> cuda_types::cuda::CUresult; /** \brief Connect CUDA to EGLStream as a consumer with given flags. Connect CUDA as a consumer to EGLStreamKHR specified by \p stream with specified \p flags defined by CUeglResourceLocationFlags. The flags specify whether the consumer wants to access frames from system memory or video memory. Default is ::CU_EGL_RESOURCE_LOCATION_VIDMEM. \param conn - Pointer to the returned connection handle \param stream - EGLStreamKHR handle \param flags - Flags denote intended location - system or video. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_INVALID_CONTEXT, \sa ::cuEGLStreamConsumerConnect, ::cuEGLStreamConsumerDisconnect, ::cuEGLStreamConsumerAcquireFrame, ::cuEGLStreamConsumerReleaseFrame, ::cudaEGLStreamConsumerConnectWithFlags*/ fn cuEGLStreamConsumerConnectWithFlags( conn: *mut cuda_types::cuda::CUeglStreamConnection, stream: cuda_types::cuda::EGLStreamKHR, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Disconnect CUDA as a consumer to EGLStream . Disconnect CUDA as a consumer to EGLStreamKHR. \param conn - Conection to disconnect. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_INVALID_CONTEXT, \sa ::cuEGLStreamConsumerConnect, ::cuEGLStreamConsumerDisconnect, ::cuEGLStreamConsumerAcquireFrame, ::cuEGLStreamConsumerReleaseFrame, ::cudaEGLStreamConsumerDisconnect*/ fn cuEGLStreamConsumerDisconnect( conn: *mut cuda_types::cuda::CUeglStreamConnection, ) -> cuda_types::cuda::CUresult; /** \brief Acquire an image frame from the EGLStream with CUDA as a consumer. Acquire an image frame from EGLStreamKHR. This API can also acquire an old frame presented by the producer unless explicitly disabled by setting EGL_SUPPORT_REUSE_NV flag to EGL_FALSE during stream initialization. By default, EGLStream is created with this flag set to EGL_TRUE. ::cuGraphicsResourceGetMappedEglFrame can be called on \p pCudaResource to get ::CUeglFrame. \param conn - Connection on which to acquire \param pCudaResource - CUDA resource on which the stream frame will be mapped for use. \param pStream - CUDA stream for synchronization and any data migrations implied by ::CUeglResourceLocationFlags. \param timeout - Desired timeout in usec for a new frame to be acquired. If set as ::CUDA_EGL_INFINITE_TIMEOUT, acquire waits infinitely. After timeout occurs CUDA consumer tries to acquire an old frame if available and EGL_SUPPORT_REUSE_NV flag is set. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_LAUNCH_TIMEOUT, \sa ::cuEGLStreamConsumerConnect, ::cuEGLStreamConsumerDisconnect, ::cuEGLStreamConsumerAcquireFrame, ::cuEGLStreamConsumerReleaseFrame, ::cudaEGLStreamConsumerAcquireFrame*/ fn cuEGLStreamConsumerAcquireFrame( conn: *mut cuda_types::cuda::CUeglStreamConnection, pCudaResource: *mut cuda_types::cuda::CUgraphicsResource, pStream: *mut cuda_types::cuda::CUstream, timeout: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Releases the last frame acquired from the EGLStream. Release the acquired image frame specified by \p pCudaResource to EGLStreamKHR. If EGL_SUPPORT_REUSE_NV flag is set to EGL_TRUE, at the time of EGL creation this API doesn't release the last frame acquired on the EGLStream. By default, EGLStream is created with this flag set to EGL_TRUE. \param conn - Connection on which to release \param pCudaResource - CUDA resource whose corresponding frame is to be released \param pStream - CUDA stream on which release will be done. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_HANDLE, \sa ::cuEGLStreamConsumerConnect, ::cuEGLStreamConsumerDisconnect, ::cuEGLStreamConsumerAcquireFrame, ::cuEGLStreamConsumerReleaseFrame, ::cudaEGLStreamConsumerReleaseFrame*/ fn cuEGLStreamConsumerReleaseFrame( conn: *mut cuda_types::cuda::CUeglStreamConnection, pCudaResource: cuda_types::cuda::CUgraphicsResource, pStream: *mut cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Connect CUDA to EGLStream as a producer. Connect CUDA as a producer to EGLStreamKHR specified by \p stream. The EGLStreamKHR is an EGL object that transfers a sequence of image frames from one API to another. \param conn - Pointer to the returned connection handle \param stream - EGLStreamKHR handle \param width - width of the image to be submitted to the stream \param height - height of the image to be submitted to the stream \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_INVALID_CONTEXT, \sa ::cuEGLStreamProducerConnect, ::cuEGLStreamProducerDisconnect, ::cuEGLStreamProducerPresentFrame, ::cudaEGLStreamProducerConnect*/ fn cuEGLStreamProducerConnect( conn: *mut cuda_types::cuda::CUeglStreamConnection, stream: cuda_types::cuda::EGLStreamKHR, width: cuda_types::cuda::EGLint, height: cuda_types::cuda::EGLint, ) -> cuda_types::cuda::CUresult; /** \brief Disconnect CUDA as a producer to EGLStream . Disconnect CUDA as a producer to EGLStreamKHR. \param conn - Conection to disconnect. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_INVALID_CONTEXT, \sa ::cuEGLStreamProducerConnect, ::cuEGLStreamProducerDisconnect, ::cuEGLStreamProducerPresentFrame, ::cudaEGLStreamProducerDisconnect*/ fn cuEGLStreamProducerDisconnect( conn: *mut cuda_types::cuda::CUeglStreamConnection, ) -> cuda_types::cuda::CUresult; /** \brief Present a CUDA eglFrame to the EGLStream with CUDA as a producer. When a frame is presented by the producer, it gets associated with the EGLStream and thus it is illegal to free the frame before the producer is disconnected. If a frame is freed and reused it may lead to undefined behavior. If producer and consumer are on different GPUs (iGPU and dGPU) then frametype ::CU_EGL_FRAME_TYPE_ARRAY is not supported. ::CU_EGL_FRAME_TYPE_PITCH can be used for such cross-device applications. The ::CUeglFrame is defined as: \code typedef struct CUeglFrame_st { union { CUarray pArray[MAX_PLANES]; void* pPitch[MAX_PLANES]; } frame; unsigned int width; unsigned int height; unsigned int depth; unsigned int pitch; unsigned int planeCount; unsigned int numChannels; CUeglFrameType frameType; CUeglColorFormat eglColorFormat; CUarray_format cuFormat; } CUeglFrame; \endcode For ::CUeglFrame of type ::CU_EGL_FRAME_TYPE_PITCH, the application may present sub-region of a memory allocation. In that case, the pitched pointer will specify the start address of the sub-region in the allocation and corresponding ::CUeglFrame fields will specify the dimensions of the sub-region. \param conn - Connection on which to present the CUDA array \param eglframe - CUDA Eglstream Proucer Frame handle to be sent to the consumer over EglStream. \param pStream - CUDA stream on which to present the frame. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_HANDLE, \sa ::cuEGLStreamProducerConnect, ::cuEGLStreamProducerDisconnect, ::cuEGLStreamProducerReturnFrame, ::cudaEGLStreamProducerPresentFrame*/ fn cuEGLStreamProducerPresentFrame( conn: *mut cuda_types::cuda::CUeglStreamConnection, eglframe: cuda_types::cuda::CUeglFrame, pStream: *mut cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Return the CUDA eglFrame to the EGLStream released by the consumer. This API can potentially return CUDA_ERROR_LAUNCH_TIMEOUT if the consumer has not returned a frame to EGL stream. If timeout is returned the application can retry. \param conn - Connection on which to return \param eglframe - CUDA Eglstream Proucer Frame handle returned from the consumer over EglStream. \param pStream - CUDA stream on which to return the frame. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_LAUNCH_TIMEOUT \sa ::cuEGLStreamProducerConnect, ::cuEGLStreamProducerDisconnect, ::cuEGLStreamProducerPresentFrame, ::cudaEGLStreamProducerReturnFrame*/ fn cuEGLStreamProducerReturnFrame( conn: *mut cuda_types::cuda::CUeglStreamConnection, eglframe: *mut cuda_types::cuda::CUeglFrame, pStream: *mut cuda_types::cuda::CUstream, ) -> cuda_types::cuda::CUresult; /** \brief Get an eglFrame through which to access a registered EGL graphics resource. Returns in \p *eglFrame an eglFrame pointer through which the registered graphics resource \p resource may be accessed. This API can only be called for registered EGL graphics resources. The ::CUeglFrame is defined as: \code typedef struct CUeglFrame_st { union { CUarray pArray[MAX_PLANES]; void* pPitch[MAX_PLANES]; } frame; unsigned int width; unsigned int height; unsigned int depth; unsigned int pitch; unsigned int planeCount; unsigned int numChannels; CUeglFrameType frameType; CUeglColorFormat eglColorFormat; CUarray_format cuFormat; } CUeglFrame; \endcode If \p resource is not registered then ::CUDA_ERROR_NOT_MAPPED is returned. * \param eglFrame - Returned eglFrame. \param resource - Registered resource to access. \param index - Index for cubemap surfaces. \param mipLevel - Mipmap level for the subresource to access. \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_NOT_MAPPED \sa ::cuGraphicsMapResources, ::cuGraphicsSubResourceGetMappedArray, ::cuGraphicsResourceGetMappedPointer, ::cudaGraphicsResourceGetMappedEglFrame*/ fn cuGraphicsResourceGetMappedEglFrame( eglFrame: *mut cuda_types::cuda::CUeglFrame, resource: cuda_types::cuda::CUgraphicsResource, index: ::core::ffi::c_uint, mipLevel: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Creates an event from EGLSync object Creates an event *phEvent from an EGLSyncKHR eglSync with the flags specified via \p flags. Valid flags include: - ::CU_EVENT_DEFAULT: Default event creation flag. - ::CU_EVENT_BLOCKING_SYNC: Specifies that the created event should use blocking synchronization. A CPU thread that uses ::cuEventSynchronize() to wait on an event created with this flag will block until the event has actually been completed. Once the \p eglSync gets destroyed, ::cuEventDestroy is the only API that can be invoked on the event. ::cuEventRecord and TimingData are not supported for events created from EGLSync. The EGLSyncKHR is an opaque handle to an EGL sync object. typedef void* EGLSyncKHR \param phEvent - Returns newly created event \param eglSync - Opaque handle to EGLSync object \param flags - Event creation flags \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_OUT_OF_MEMORY \sa ::cuEventQuery, ::cuEventSynchronize, ::cuEventDestroy*/ fn cuEventCreateFromEGLSync( phEvent: *mut cuda_types::cuda::CUevent, eglSync: cuda_types::cuda::EGLSyncKHR, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Gets the CUDA device associated with a VDPAU device Returns in \p *pDevice the CUDA device associated with a \p vdpDevice, if applicable. \param pDevice - Device associated with vdpDevice \param vdpDevice - A VdpDevice handle \param vdpGetProcAddress - VDPAU's VdpGetProcAddress function pointer \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE \notefnerr \sa ::cuCtxCreate, ::cuVDPAUCtxCreate, ::cuGraphicsVDPAURegisterVideoSurface, ::cuGraphicsVDPAURegisterOutputSurface, ::cuGraphicsUnregisterResource, ::cuGraphicsResourceSetMapFlags, ::cuGraphicsMapResources, ::cuGraphicsUnmapResources, ::cuGraphicsSubResourceGetMappedArray, ::cudaVDPAUGetDevice*/ fn cuVDPAUGetDevice( pDevice: *mut cuda_types::cuda::CUdevice, vdpDevice: cuda_types::cuda::VdpDevice, vdpGetProcAddress: cuda_types::cuda::VdpGetProcAddress, ) -> cuda_types::cuda::CUresult; /** \brief Create a CUDA context for interoperability with VDPAU Creates a new CUDA context, initializes VDPAU interoperability, and associates the CUDA context with the calling thread. It must be called before performing any other VDPAU interoperability operations. It may fail if the needed VDPAU driver facilities are not available. For usage of the \p flags parameter, see ::cuCtxCreate(). \param pCtx - Returned CUDA context \param flags - Options for CUDA context creation \param device - Device on which to create the context \param vdpDevice - The VdpDevice to interop with \param vdpGetProcAddress - VDPAU's VdpGetProcAddress function pointer \return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_OUT_OF_MEMORY \notefnerr \sa ::cuCtxCreate, ::cuGraphicsVDPAURegisterVideoSurface, ::cuGraphicsVDPAURegisterOutputSurface, ::cuGraphicsUnregisterResource, ::cuGraphicsResourceSetMapFlags, ::cuGraphicsMapResources, ::cuGraphicsUnmapResources, ::cuGraphicsSubResourceGetMappedArray, ::cuVDPAUGetDevice*/ fn cuVDPAUCtxCreate_v2( pCtx: *mut cuda_types::cuda::CUcontext, flags: ::core::ffi::c_uint, device: cuda_types::cuda::CUdevice, vdpDevice: cuda_types::cuda::VdpDevice, vdpGetProcAddress: cuda_types::cuda::VdpGetProcAddress, ) -> cuda_types::cuda::CUresult; /** \brief Registers a VDPAU VdpVideoSurface object Registers the VdpVideoSurface specified by \p vdpSurface for access by CUDA. A handle to the registered object is returned as \p pCudaResource. The surface's intended usage is specified using \p flags, as follows: - ::CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE: Specifies no hints about how this resource will be used. It is therefore assumed that this resource will be read from and written to by CUDA. This is the default value. - ::CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY: Specifies that CUDA will not write to this resource. - ::CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD: Specifies that CUDA will not read from this resource and will write over the entire contents of the resource, so none of the data previously stored in the resource will be preserved. The VdpVideoSurface is presented as an array of subresources that may be accessed using pointers returned by ::cuGraphicsSubResourceGetMappedArray. The exact number of valid \p arrayIndex values depends on the VDPAU surface format. The mapping is shown in the table below. \p mipLevel must be 0. \htmlonly
VdpChromaType arrayIndexSize FormatContent
VDP_CHROMA_TYPE_4200 w x h/2R8 Top-field luma
1 w x h/2R8 Bottom-field luma
2 w/2 x h/4R8G8 Top-field chroma
3 w/2 x h/4R8G8 Bottom-field chroma
VDP_CHROMA_TYPE_4220 w x h/2R8 Top-field luma
1 w x h/2R8 Bottom-field luma
2 w/2 x h/2R8G8 Top-field chroma
3 w/2 x h/2R8G8 Bottom-field chroma
\endhtmlonly \latexonly \begin{tabular}{|l|l|l|l|l|} \hline VdpChromaType & arrayIndex & Size & Format & Content \\ \hline VDP\_CHROMA\_TYPE\_420 & 0 & w x h/2 & R8 & Top-field luma \\ & 1 & w x h/2 & R8 & Bottom-field luma \\ & 2 & w/2 x h/4 & R8G8 & Top-field chroma \\ & 3 & w/2 x h/4 & R8G8 & Bottom-field chroma \\ \hline VDP\_CHROMA\_TYPE\_422 & 0 & w x h/2 & R8 & Top-field luma \\ & 1 & w x h/2 & R8 & Bottom-field luma \\ & 2 & w/2 x h/2 & R8G8 & Top-field chroma \\ & 3 & w/2 x h/2 & R8G8 & Bottom-field chroma \\ \hline \end{tabular} \endlatexonly \param pCudaResource - Pointer to the returned object handle \param vdpSurface - The VdpVideoSurface to be registered \param flags - Map flags \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_ALREADY_MAPPED, ::CUDA_ERROR_INVALID_CONTEXT, \notefnerr \sa ::cuCtxCreate, ::cuVDPAUCtxCreate, ::cuGraphicsVDPAURegisterOutputSurface, ::cuGraphicsUnregisterResource, ::cuGraphicsResourceSetMapFlags, ::cuGraphicsMapResources, ::cuGraphicsUnmapResources, ::cuGraphicsSubResourceGetMappedArray, ::cuVDPAUGetDevice, ::cudaGraphicsVDPAURegisterVideoSurface*/ fn cuGraphicsVDPAURegisterVideoSurface( pCudaResource: *mut cuda_types::cuda::CUgraphicsResource, vdpSurface: cuda_types::cuda::VdpVideoSurface, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; /** \brief Registers a VDPAU VdpOutputSurface object Registers the VdpOutputSurface specified by \p vdpSurface for access by CUDA. A handle to the registered object is returned as \p pCudaResource. The surface's intended usage is specified using \p flags, as follows: - ::CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE: Specifies no hints about how this resource will be used. It is therefore assumed that this resource will be read from and written to by CUDA. This is the default value. - ::CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY: Specifies that CUDA will not write to this resource. - ::CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD: Specifies that CUDA will not read from this resource and will write over the entire contents of the resource, so none of the data previously stored in the resource will be preserved. The VdpOutputSurface is presented as an array of subresources that may be accessed using pointers returned by ::cuGraphicsSubResourceGetMappedArray. The exact number of valid \p arrayIndex values depends on the VDPAU surface format. The mapping is shown in the table below. \p mipLevel must be 0. \htmlonly
VdpRGBAFormat arrayIndexSize Format Content
VDP_RGBA_FORMAT_B8G8R8A8 0 w x hARGB8 Entire surface
VDP_RGBA_FORMAT_R10G10B10A20 w x hA2BGR10Entire surface
\endhtmlonly \latexonly \begin{tabular}{|l|l|l|l|l|} \hline VdpRGBAFormat & arrayIndex & Size & Format & Content \\ \hline VDP\_RGBA\_FORMAT\_B8G8R8A8 & 0 & w x h & ARGB8 & Entire surface \\ VDP\_RGBA\_FORMAT\_R10G10B10A2 & 0 & w x h & A2BGR10 & Entire surface \\ \hline \end{tabular} \endlatexonly \param pCudaResource - Pointer to the returned object handle \param vdpSurface - The VdpOutputSurface to be registered \param flags - Map flags \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_ALREADY_MAPPED, ::CUDA_ERROR_INVALID_CONTEXT, \notefnerr \sa ::cuCtxCreate, ::cuVDPAUCtxCreate, ::cuGraphicsVDPAURegisterVideoSurface, ::cuGraphicsUnregisterResource, ::cuGraphicsResourceSetMapFlags, ::cuGraphicsMapResources, ::cuGraphicsUnmapResources, ::cuGraphicsSubResourceGetMappedArray, ::cuVDPAUGetDevice, ::cudaGraphicsVDPAURegisterOutputSurface*/ fn cuGraphicsVDPAURegisterOutputSurface( pCudaResource: *mut cuda_types::cuda::CUgraphicsResource, vdpSurface: cuda_types::cuda::VdpOutputSurface, flags: ::core::ffi::c_uint, ) -> cuda_types::cuda::CUresult; fn cuVDPAUCtxCreate( pCtx: *mut cuda_types::cuda::CUcontext, flags: ::core::ffi::c_uint, device: cuda_types::cuda::CUdevice, vdpDevice: cuda_types::cuda::VdpDevice, vdpGetProcAddress: cuda_types::cuda::VdpGetProcAddress, ) -> cuda_types::cuda::CUresult; } ================================================ FILE: cuda_macros/src/cudnn8.rs ================================================ // Generated automatically by zluda_bindgen // DO NOT EDIT MANUALLY #![allow(warnings)] extern "system" { fn cudnnGetVersion() -> usize; fn cudnnGetMaxDeviceVersion() -> usize; fn cudnnGetCudartVersion() -> usize; fn cudnnGetErrorString( status: cuda_types::cudnn8::cudnnStatus_t, ) -> *const ::core::ffi::c_char; #[must_use] fn cudnnQueryRuntimeError( handle: cuda_types::cudnn8::cudnnHandle_t, rstatus: *mut cuda_types::cudnn8::cudnnStatus_t, mode: cuda_types::cudnn8::cudnnErrQueryMode_t, tag: *mut cuda_types::cudnn8::cudnnRuntimeTag_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetProperty( type_: cuda_types::cudnn8::libraryPropertyType, value: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnCreate( handle: *mut cuda_types::cudnn8::cudnnHandle_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnDestroy( handle: cuda_types::cudnn8::cudnnHandle_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetStream( handle: cuda_types::cudnn8::cudnnHandle_t, streamId: cuda_types::cudnn8::cudaStream_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetStream( handle: cuda_types::cudnn8::cudnnHandle_t, streamId: *mut cuda_types::cudnn8::cudaStream_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnCreateTensorDescriptor( tensorDesc: *mut cuda_types::cudnn8::cudnnTensorDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetTensor4dDescriptor( tensorDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, format: cuda_types::cudnn8::cudnnTensorFormat_t, dataType: cuda_types::cudnn8::cudnnDataType_t, n: ::core::ffi::c_int, c: ::core::ffi::c_int, h: ::core::ffi::c_int, w: ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetTensor4dDescriptorEx( tensorDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dataType: cuda_types::cudnn8::cudnnDataType_t, n: ::core::ffi::c_int, c: ::core::ffi::c_int, h: ::core::ffi::c_int, w: ::core::ffi::c_int, nStride: ::core::ffi::c_int, cStride: ::core::ffi::c_int, hStride: ::core::ffi::c_int, wStride: ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetTensor4dDescriptor( tensorDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dataType: *mut cuda_types::cudnn8::cudnnDataType_t, n: *mut ::core::ffi::c_int, c: *mut ::core::ffi::c_int, h: *mut ::core::ffi::c_int, w: *mut ::core::ffi::c_int, nStride: *mut ::core::ffi::c_int, cStride: *mut ::core::ffi::c_int, hStride: *mut ::core::ffi::c_int, wStride: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetTensorNdDescriptor( tensorDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dataType: cuda_types::cudnn8::cudnnDataType_t, nbDims: ::core::ffi::c_int, dimA: *const ::core::ffi::c_int, strideA: *const ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetTensorNdDescriptorEx( tensorDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, format: cuda_types::cudnn8::cudnnTensorFormat_t, dataType: cuda_types::cudnn8::cudnnDataType_t, nbDims: ::core::ffi::c_int, dimA: *const ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetTensorNdDescriptor( tensorDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, nbDimsRequested: ::core::ffi::c_int, dataType: *mut cuda_types::cudnn8::cudnnDataType_t, nbDims: *mut ::core::ffi::c_int, dimA: *mut ::core::ffi::c_int, strideA: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetTensorSizeInBytes( tensorDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, size: *mut usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnDestroyTensorDescriptor( tensorDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] /// Create a destination descriptor for cudnnTransformTensor fn cudnnInitTransformDest( transformDesc: cuda_types::cudnn8::cudnnTensorTransformDescriptor_t, srcDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, destDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, destSizeInBytes: *mut usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] /// Create an empty tensor transform descriptor fn cudnnCreateTensorTransformDescriptor( transformDesc: *mut cuda_types::cudnn8::cudnnTensorTransformDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] /// Initialize a previously created tensor transform descriptor. fn cudnnSetTensorTransformDescriptor( transformDesc: cuda_types::cudnn8::cudnnTensorTransformDescriptor_t, nbDims: u32, destFormat: cuda_types::cudnn8::cudnnTensorFormat_t, padBeforeA: *const i32, padAfterA: *const i32, foldA: *const u32, direction: cuda_types::cudnn8::cudnnFoldingDirection_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] /** Retrieves the values stored in a previously initialized tensor transform descriptor.*/ fn cudnnGetTensorTransformDescriptor( transformDesc: cuda_types::cudnn8::cudnnTensorTransformDescriptor_t, nbDimsRequested: u32, destFormat: *mut cuda_types::cudnn8::cudnnTensorFormat_t, padBeforeA: *mut i32, padAfterA: *mut i32, foldA: *mut u32, direction: *mut cuda_types::cudnn8::cudnnFoldingDirection_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] /// Destroys a previously created tensor transform descriptor. fn cudnnDestroyTensorTransformDescriptor( transformDesc: cuda_types::cudnn8::cudnnTensorTransformDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnTransformTensor( handle: cuda_types::cudnn8::cudnnHandle_t, alpha: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnTransformTensorEx( handle: cuda_types::cudnn8::cudnnHandle_t, transDesc: cuda_types::cudnn8::cudnnTensorTransformDescriptor_t, alpha: *const ::core::ffi::c_void, srcDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, srcData: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, destDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, destData: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnAddTensor( handle: cuda_types::cudnn8::cudnnHandle_t, alpha: *const ::core::ffi::c_void, aDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, A: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, cDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, C: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnCreateOpTensorDescriptor( opTensorDesc: *mut cuda_types::cudnn8::cudnnOpTensorDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetOpTensorDescriptor( opTensorDesc: cuda_types::cudnn8::cudnnOpTensorDescriptor_t, opTensorOp: cuda_types::cudnn8::cudnnOpTensorOp_t, opTensorCompType: cuda_types::cudnn8::cudnnDataType_t, opTensorNanOpt: cuda_types::cudnn8::cudnnNanPropagation_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetOpTensorDescriptor( opTensorDesc: cuda_types::cudnn8::cudnnOpTensorDescriptor_t, opTensorOp: *mut cuda_types::cudnn8::cudnnOpTensorOp_t, opTensorCompType: *mut cuda_types::cudnn8::cudnnDataType_t, opTensorNanOpt: *mut cuda_types::cudnn8::cudnnNanPropagation_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnDestroyOpTensorDescriptor( opTensorDesc: cuda_types::cudnn8::cudnnOpTensorDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnOpTensor( handle: cuda_types::cudnn8::cudnnHandle_t, opTensorDesc: cuda_types::cudnn8::cudnnOpTensorDescriptor_t, alpha1: *const ::core::ffi::c_void, aDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, A: *const ::core::ffi::c_void, alpha2: *const ::core::ffi::c_void, bDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, B: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, cDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, C: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnCreateReduceTensorDescriptor( reduceTensorDesc: *mut cuda_types::cudnn8::cudnnReduceTensorDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetReduceTensorDescriptor( reduceTensorDesc: cuda_types::cudnn8::cudnnReduceTensorDescriptor_t, reduceTensorOp: cuda_types::cudnn8::cudnnReduceTensorOp_t, reduceTensorCompType: cuda_types::cudnn8::cudnnDataType_t, reduceTensorNanOpt: cuda_types::cudnn8::cudnnNanPropagation_t, reduceTensorIndices: cuda_types::cudnn8::cudnnReduceTensorIndices_t, reduceTensorIndicesType: cuda_types::cudnn8::cudnnIndicesType_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetReduceTensorDescriptor( reduceTensorDesc: cuda_types::cudnn8::cudnnReduceTensorDescriptor_t, reduceTensorOp: *mut cuda_types::cudnn8::cudnnReduceTensorOp_t, reduceTensorCompType: *mut cuda_types::cudnn8::cudnnDataType_t, reduceTensorNanOpt: *mut cuda_types::cudnn8::cudnnNanPropagation_t, reduceTensorIndices: *mut cuda_types::cudnn8::cudnnReduceTensorIndices_t, reduceTensorIndicesType: *mut cuda_types::cudnn8::cudnnIndicesType_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnDestroyReduceTensorDescriptor( reduceTensorDesc: cuda_types::cudnn8::cudnnReduceTensorDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetReductionIndicesSize( handle: cuda_types::cudnn8::cudnnHandle_t, reduceTensorDesc: cuda_types::cudnn8::cudnnReduceTensorDescriptor_t, aDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, cDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, sizeInBytes: *mut usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetReductionWorkspaceSize( handle: cuda_types::cudnn8::cudnnHandle_t, reduceTensorDesc: cuda_types::cudnn8::cudnnReduceTensorDescriptor_t, aDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, cDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, sizeInBytes: *mut usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnReduceTensor( handle: cuda_types::cudnn8::cudnnHandle_t, reduceTensorDesc: cuda_types::cudnn8::cudnnReduceTensorDescriptor_t, indices: *mut ::core::ffi::c_void, indicesSizeInBytes: usize, workspace: *mut ::core::ffi::c_void, workspaceSizeInBytes: usize, alpha: *const ::core::ffi::c_void, aDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, A: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, cDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, C: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetTensor( handle: cuda_types::cudnn8::cudnnHandle_t, yDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, valuePtr: *const ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnScaleTensor( handle: cuda_types::cudnn8::cudnnHandle_t, yDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, alpha: *const ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnCreateFilterDescriptor( filterDesc: *mut cuda_types::cudnn8::cudnnFilterDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetFilter4dDescriptor( filterDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, dataType: cuda_types::cudnn8::cudnnDataType_t, format: cuda_types::cudnn8::cudnnTensorFormat_t, k: ::core::ffi::c_int, c: ::core::ffi::c_int, h: ::core::ffi::c_int, w: ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetFilter4dDescriptor( filterDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, dataType: *mut cuda_types::cudnn8::cudnnDataType_t, format: *mut cuda_types::cudnn8::cudnnTensorFormat_t, k: *mut ::core::ffi::c_int, c: *mut ::core::ffi::c_int, h: *mut ::core::ffi::c_int, w: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetFilterNdDescriptor( filterDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, dataType: cuda_types::cudnn8::cudnnDataType_t, format: cuda_types::cudnn8::cudnnTensorFormat_t, nbDims: ::core::ffi::c_int, filterDimA: *const ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetFilterNdDescriptor( filterDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, nbDimsRequested: ::core::ffi::c_int, dataType: *mut cuda_types::cudnn8::cudnnDataType_t, format: *mut cuda_types::cudnn8::cudnnTensorFormat_t, nbDims: *mut ::core::ffi::c_int, filterDimA: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetFilterSizeInBytes( filterDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, size: *mut usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnTransformFilter( handle: cuda_types::cudnn8::cudnnHandle_t, transDesc: cuda_types::cudnn8::cudnnTensorTransformDescriptor_t, alpha: *const ::core::ffi::c_void, srcDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, srcData: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, destDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, destData: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnDestroyFilterDescriptor( filterDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSoftmaxForward( handle: cuda_types::cudnn8::cudnnHandle_t, algo: cuda_types::cudnn8::cudnnSoftmaxAlgorithm_t, mode: cuda_types::cudnn8::cudnnSoftmaxMode_t, alpha: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnCreatePoolingDescriptor( poolingDesc: *mut cuda_types::cudnn8::cudnnPoolingDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetPooling2dDescriptor( poolingDesc: cuda_types::cudnn8::cudnnPoolingDescriptor_t, mode: cuda_types::cudnn8::cudnnPoolingMode_t, maxpoolingNanOpt: cuda_types::cudnn8::cudnnNanPropagation_t, windowHeight: ::core::ffi::c_int, windowWidth: ::core::ffi::c_int, verticalPadding: ::core::ffi::c_int, horizontalPadding: ::core::ffi::c_int, verticalStride: ::core::ffi::c_int, horizontalStride: ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetPooling2dDescriptor( poolingDesc: cuda_types::cudnn8::cudnnPoolingDescriptor_t, mode: *mut cuda_types::cudnn8::cudnnPoolingMode_t, maxpoolingNanOpt: *mut cuda_types::cudnn8::cudnnNanPropagation_t, windowHeight: *mut ::core::ffi::c_int, windowWidth: *mut ::core::ffi::c_int, verticalPadding: *mut ::core::ffi::c_int, horizontalPadding: *mut ::core::ffi::c_int, verticalStride: *mut ::core::ffi::c_int, horizontalStride: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetPoolingNdDescriptor( poolingDesc: cuda_types::cudnn8::cudnnPoolingDescriptor_t, mode: cuda_types::cudnn8::cudnnPoolingMode_t, maxpoolingNanOpt: cuda_types::cudnn8::cudnnNanPropagation_t, nbDims: ::core::ffi::c_int, windowDimA: *const ::core::ffi::c_int, paddingA: *const ::core::ffi::c_int, strideA: *const ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetPoolingNdDescriptor( poolingDesc: cuda_types::cudnn8::cudnnPoolingDescriptor_t, nbDimsRequested: ::core::ffi::c_int, mode: *mut cuda_types::cudnn8::cudnnPoolingMode_t, maxpoolingNanOpt: *mut cuda_types::cudnn8::cudnnNanPropagation_t, nbDims: *mut ::core::ffi::c_int, windowDimA: *mut ::core::ffi::c_int, paddingA: *mut ::core::ffi::c_int, strideA: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetPoolingNdForwardOutputDim( poolingDesc: cuda_types::cudnn8::cudnnPoolingDescriptor_t, inputTensorDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, nbDims: ::core::ffi::c_int, outputTensorDimA: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetPooling2dForwardOutputDim( poolingDesc: cuda_types::cudnn8::cudnnPoolingDescriptor_t, inputTensorDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, n: *mut ::core::ffi::c_int, c: *mut ::core::ffi::c_int, h: *mut ::core::ffi::c_int, w: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnDestroyPoolingDescriptor( poolingDesc: cuda_types::cudnn8::cudnnPoolingDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnPoolingForward( handle: cuda_types::cudnn8::cudnnHandle_t, poolingDesc: cuda_types::cudnn8::cudnnPoolingDescriptor_t, alpha: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnCreateActivationDescriptor( activationDesc: *mut cuda_types::cudnn8::cudnnActivationDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetActivationDescriptor( activationDesc: cuda_types::cudnn8::cudnnActivationDescriptor_t, mode: cuda_types::cudnn8::cudnnActivationMode_t, reluNanOpt: cuda_types::cudnn8::cudnnNanPropagation_t, coef: f64, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetActivationDescriptor( activationDesc: cuda_types::cudnn8::cudnnActivationDescriptor_t, mode: *mut cuda_types::cudnn8::cudnnActivationMode_t, reluNanOpt: *mut cuda_types::cudnn8::cudnnNanPropagation_t, coef: *mut f64, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetActivationDescriptorSwishBeta( activationDesc: cuda_types::cudnn8::cudnnActivationDescriptor_t, swish_beta: f64, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetActivationDescriptorSwishBeta( activationDesc: cuda_types::cudnn8::cudnnActivationDescriptor_t, swish_beta: *mut f64, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnDestroyActivationDescriptor( activationDesc: cuda_types::cudnn8::cudnnActivationDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnActivationForward( handle: cuda_types::cudnn8::cudnnHandle_t, activationDesc: cuda_types::cudnn8::cudnnActivationDescriptor_t, alpha: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnCreateLRNDescriptor( normDesc: *mut cuda_types::cudnn8::cudnnLRNDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetLRNDescriptor( normDesc: cuda_types::cudnn8::cudnnLRNDescriptor_t, lrnN: ::core::ffi::c_uint, lrnAlpha: f64, lrnBeta: f64, lrnK: f64, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetLRNDescriptor( normDesc: cuda_types::cudnn8::cudnnLRNDescriptor_t, lrnN: *mut ::core::ffi::c_uint, lrnAlpha: *mut f64, lrnBeta: *mut f64, lrnK: *mut f64, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnDestroyLRNDescriptor( lrnDesc: cuda_types::cudnn8::cudnnLRNDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnLRNCrossChannelForward( handle: cuda_types::cudnn8::cudnnHandle_t, normDesc: cuda_types::cudnn8::cudnnLRNDescriptor_t, lrnMode: cuda_types::cudnn8::cudnnLRNMode_t, alpha: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnDivisiveNormalizationForward( handle: cuda_types::cudnn8::cudnnHandle_t, normDesc: cuda_types::cudnn8::cudnnLRNDescriptor_t, mode: cuda_types::cudnn8::cudnnDivNormMode_t, alpha: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, means: *const ::core::ffi::c_void, temp: *mut ::core::ffi::c_void, temp2: *mut ::core::ffi::c_void, beta: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnDeriveBNTensorDescriptor( derivedBnDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, mode: cuda_types::cudnn8::cudnnBatchNormMode_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnBatchNormalizationForwardInference( handle: cuda_types::cudnn8::cudnnHandle_t, mode: cuda_types::cudnn8::cudnnBatchNormMode_t, alpha: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, bnScaleBiasMeanVarDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, bnScale: *const ::core::ffi::c_void, bnBias: *const ::core::ffi::c_void, estimatedMean: *const ::core::ffi::c_void, estimatedVariance: *const ::core::ffi::c_void, epsilon: f64, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnDeriveNormTensorDescriptor( derivedNormScaleBiasDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, derivedNormMeanVarDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, mode: cuda_types::cudnn8::cudnnNormMode_t, groupCnt: ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnNormalizationForwardInference( handle: cuda_types::cudnn8::cudnnHandle_t, mode: cuda_types::cudnn8::cudnnNormMode_t, normOps: cuda_types::cudnn8::cudnnNormOps_t, algo: cuda_types::cudnn8::cudnnNormAlgo_t, alpha: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, normScaleBiasDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, normScale: *const ::core::ffi::c_void, normBias: *const ::core::ffi::c_void, normMeanVarDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, estimatedMean: *const ::core::ffi::c_void, estimatedVariance: *const ::core::ffi::c_void, zDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, z: *const ::core::ffi::c_void, activationDesc: cuda_types::cudnn8::cudnnActivationDescriptor_t, yDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, epsilon: f64, groupCnt: ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnCreateSpatialTransformerDescriptor( stDesc: *mut cuda_types::cudnn8::cudnnSpatialTransformerDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetSpatialTransformerNdDescriptor( stDesc: cuda_types::cudnn8::cudnnSpatialTransformerDescriptor_t, samplerType: cuda_types::cudnn8::cudnnSamplerType_t, dataType: cuda_types::cudnn8::cudnnDataType_t, nbDims: ::core::ffi::c_int, dimA: *const ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnDestroySpatialTransformerDescriptor( stDesc: cuda_types::cudnn8::cudnnSpatialTransformerDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSpatialTfGridGeneratorForward( handle: cuda_types::cudnn8::cudnnHandle_t, stDesc: cuda_types::cudnn8::cudnnSpatialTransformerDescriptor_t, theta: *const ::core::ffi::c_void, grid: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSpatialTfSamplerForward( handle: cuda_types::cudnn8::cudnnHandle_t, stDesc: cuda_types::cudnn8::cudnnSpatialTransformerDescriptor_t, alpha: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, grid: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnCreateDropoutDescriptor( dropoutDesc: *mut cuda_types::cudnn8::cudnnDropoutDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnDestroyDropoutDescriptor( dropoutDesc: cuda_types::cudnn8::cudnnDropoutDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnDropoutGetStatesSize( handle: cuda_types::cudnn8::cudnnHandle_t, sizeInBytes: *mut usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnDropoutGetReserveSpaceSize( xdesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, sizeInBytes: *mut usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetDropoutDescriptor( dropoutDesc: cuda_types::cudnn8::cudnnDropoutDescriptor_t, handle: cuda_types::cudnn8::cudnnHandle_t, dropout: f32, states: *mut ::core::ffi::c_void, stateSizeInBytes: usize, seed: ::core::ffi::c_ulonglong, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnRestoreDropoutDescriptor( dropoutDesc: cuda_types::cudnn8::cudnnDropoutDescriptor_t, handle: cuda_types::cudnn8::cudnnHandle_t, dropout: f32, states: *mut ::core::ffi::c_void, stateSizeInBytes: usize, seed: ::core::ffi::c_ulonglong, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetDropoutDescriptor( dropoutDesc: cuda_types::cudnn8::cudnnDropoutDescriptor_t, handle: cuda_types::cudnn8::cudnnHandle_t, dropout: *mut f32, states: *mut *mut ::core::ffi::c_void, seed: *mut ::core::ffi::c_ulonglong, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnDropoutForward( handle: cuda_types::cudnn8::cudnnHandle_t, dropoutDesc: cuda_types::cudnn8::cudnnDropoutDescriptor_t, xdesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, ydesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, reserveSpace: *mut ::core::ffi::c_void, reserveSpaceSizeInBytes: usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnCreateAlgorithmDescriptor( algoDesc: *mut cuda_types::cudnn8::cudnnAlgorithmDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetAlgorithmDescriptor( algoDesc: cuda_types::cudnn8::cudnnAlgorithmDescriptor_t, algorithm: cuda_types::cudnn8::cudnnAlgorithm_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetAlgorithmDescriptor( algoDesc: cuda_types::cudnn8::cudnnAlgorithmDescriptor_t, algorithm: *mut cuda_types::cudnn8::cudnnAlgorithm_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnCopyAlgorithmDescriptor( src: cuda_types::cudnn8::cudnnAlgorithmDescriptor_t, dest: cuda_types::cudnn8::cudnnAlgorithmDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnDestroyAlgorithmDescriptor( algoDesc: cuda_types::cudnn8::cudnnAlgorithmDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnCreateAlgorithmPerformance( algoPerf: *mut cuda_types::cudnn8::cudnnAlgorithmPerformance_t, numberToCreate: ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetAlgorithmPerformance( algoPerf: cuda_types::cudnn8::cudnnAlgorithmPerformance_t, algoDesc: cuda_types::cudnn8::cudnnAlgorithmDescriptor_t, status: cuda_types::cudnn8::cudnnStatus_t, time: f32, memory: usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetAlgorithmPerformance( algoPerf: cuda_types::cudnn8::cudnnAlgorithmPerformance_t, algoDesc: *mut cuda_types::cudnn8::cudnnAlgorithmDescriptor_t, status: *mut cuda_types::cudnn8::cudnnStatus_t, time: *mut f32, memory: *mut usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnDestroyAlgorithmPerformance( algoPerf: *mut cuda_types::cudnn8::cudnnAlgorithmPerformance_t, numberToDestroy: ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetAlgorithmSpaceSize( handle: cuda_types::cudnn8::cudnnHandle_t, algoDesc: cuda_types::cudnn8::cudnnAlgorithmDescriptor_t, algoSpaceSizeInBytes: *mut usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSaveAlgorithm( handle: cuda_types::cudnn8::cudnnHandle_t, algoDesc: cuda_types::cudnn8::cudnnAlgorithmDescriptor_t, algoSpace: *mut ::core::ffi::c_void, algoSpaceSizeInBytes: usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnRestoreAlgorithm( handle: cuda_types::cudnn8::cudnnHandle_t, algoSpace: *mut ::core::ffi::c_void, algoSpaceSizeInBytes: usize, algoDesc: cuda_types::cudnn8::cudnnAlgorithmDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetCallback( mask: ::core::ffi::c_uint, udata: *mut ::core::ffi::c_void, fptr: cuda_types::cudnn8::cudnnCallback_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetCallback( mask: *mut ::core::ffi::c_uint, udata: *mut *mut ::core::ffi::c_void, fptr: *mut cuda_types::cudnn8::cudnnCallback_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnOpsInferVersionCheck() -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSoftmaxBackward( handle: cuda_types::cudnn8::cudnnHandle_t, algo: cuda_types::cudnn8::cudnnSoftmaxAlgorithm_t, mode: cuda_types::cudnn8::cudnnSoftmaxMode_t, alpha: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, y: *const ::core::ffi::c_void, dyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dy: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, dxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dx: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnPoolingBackward( handle: cuda_types::cudnn8::cudnnHandle_t, poolingDesc: cuda_types::cudnn8::cudnnPoolingDescriptor_t, alpha: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, y: *const ::core::ffi::c_void, dyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dy: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, dxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dx: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnActivationBackward( handle: cuda_types::cudnn8::cudnnHandle_t, activationDesc: cuda_types::cudnn8::cudnnActivationDescriptor_t, alpha: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, y: *const ::core::ffi::c_void, dyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dy: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, dxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dx: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnLRNCrossChannelBackward( handle: cuda_types::cudnn8::cudnnHandle_t, normDesc: cuda_types::cudnn8::cudnnLRNDescriptor_t, lrnMode: cuda_types::cudnn8::cudnnLRNMode_t, alpha: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, y: *const ::core::ffi::c_void, dyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dy: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, dxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dx: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnDivisiveNormalizationBackward( handle: cuda_types::cudnn8::cudnnHandle_t, normDesc: cuda_types::cudnn8::cudnnLRNDescriptor_t, mode: cuda_types::cudnn8::cudnnDivNormMode_t, alpha: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, means: *const ::core::ffi::c_void, dy: *const ::core::ffi::c_void, temp: *mut ::core::ffi::c_void, temp2: *mut ::core::ffi::c_void, beta: *const ::core::ffi::c_void, dXdMeansDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dx: *mut ::core::ffi::c_void, dMeans: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetBatchNormalizationForwardTrainingExWorkspaceSize( handle: cuda_types::cudnn8::cudnnHandle_t, mode: cuda_types::cudnn8::cudnnBatchNormMode_t, bnOps: cuda_types::cudnn8::cudnnBatchNormOps_t, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, zDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, yDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, bnScaleBiasMeanVarDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, activationDesc: cuda_types::cudnn8::cudnnActivationDescriptor_t, sizeInBytes: *mut usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetBatchNormalizationBackwardExWorkspaceSize( handle: cuda_types::cudnn8::cudnnHandle_t, mode: cuda_types::cudnn8::cudnnBatchNormMode_t, bnOps: cuda_types::cudnn8::cudnnBatchNormOps_t, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, yDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dzDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dBnScaleBiasDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, activationDesc: cuda_types::cudnn8::cudnnActivationDescriptor_t, sizeInBytes: *mut usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetBatchNormalizationTrainingExReserveSpaceSize( handle: cuda_types::cudnn8::cudnnHandle_t, mode: cuda_types::cudnn8::cudnnBatchNormMode_t, bnOps: cuda_types::cudnn8::cudnnBatchNormOps_t, activationDesc: cuda_types::cudnn8::cudnnActivationDescriptor_t, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, sizeInBytes: *mut usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnBatchNormalizationForwardTraining( handle: cuda_types::cudnn8::cudnnHandle_t, mode: cuda_types::cudnn8::cudnnBatchNormMode_t, alpha: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, bnScaleBiasMeanVarDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, bnScale: *const ::core::ffi::c_void, bnBias: *const ::core::ffi::c_void, exponentialAverageFactor: f64, resultRunningMean: *mut ::core::ffi::c_void, resultRunningVariance: *mut ::core::ffi::c_void, epsilon: f64, resultSaveMean: *mut ::core::ffi::c_void, resultSaveInvVariance: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnBatchNormalizationForwardTrainingEx( handle: cuda_types::cudnn8::cudnnHandle_t, mode: cuda_types::cudnn8::cudnnBatchNormMode_t, bnOps: cuda_types::cudnn8::cudnnBatchNormOps_t, alpha: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, xData: *const ::core::ffi::c_void, zDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, zData: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, yData: *mut ::core::ffi::c_void, bnScaleBiasMeanVarDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, bnScale: *const ::core::ffi::c_void, bnBias: *const ::core::ffi::c_void, exponentialAverageFactor: f64, resultRunningMean: *mut ::core::ffi::c_void, resultRunningVariance: *mut ::core::ffi::c_void, epsilon: f64, resultSaveMean: *mut ::core::ffi::c_void, resultSaveInvVariance: *mut ::core::ffi::c_void, activationDesc: cuda_types::cudnn8::cudnnActivationDescriptor_t, workspace: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, reserveSpace: *mut ::core::ffi::c_void, reserveSpaceSizeInBytes: usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnBatchNormalizationBackward( handle: cuda_types::cudnn8::cudnnHandle_t, mode: cuda_types::cudnn8::cudnnBatchNormMode_t, alphaDataDiff: *const ::core::ffi::c_void, betaDataDiff: *const ::core::ffi::c_void, alphaParamDiff: *const ::core::ffi::c_void, betaParamDiff: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, dyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dy: *const ::core::ffi::c_void, dxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dx: *mut ::core::ffi::c_void, dBnScaleBiasDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, bnScale: *const ::core::ffi::c_void, dBnScaleResult: *mut ::core::ffi::c_void, dBnBiasResult: *mut ::core::ffi::c_void, epsilon: f64, savedMean: *const ::core::ffi::c_void, savedInvVariance: *const ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnBatchNormalizationBackwardEx( handle: cuda_types::cudnn8::cudnnHandle_t, mode: cuda_types::cudnn8::cudnnBatchNormMode_t, bnOps: cuda_types::cudnn8::cudnnBatchNormOps_t, alphaDataDiff: *const ::core::ffi::c_void, betaDataDiff: *const ::core::ffi::c_void, alphaParamDiff: *const ::core::ffi::c_void, betaParamDiff: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, xData: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, yData: *const ::core::ffi::c_void, dyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dyData: *const ::core::ffi::c_void, dzDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dzData: *mut ::core::ffi::c_void, dxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dxData: *mut ::core::ffi::c_void, dBnScaleBiasDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, bnScaleData: *const ::core::ffi::c_void, bnBiasData: *const ::core::ffi::c_void, dBnScaleData: *mut ::core::ffi::c_void, dBnBiasData: *mut ::core::ffi::c_void, epsilon: f64, savedMean: *const ::core::ffi::c_void, savedInvVariance: *const ::core::ffi::c_void, activationDesc: cuda_types::cudnn8::cudnnActivationDescriptor_t, workSpace: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, reserveSpace: *mut ::core::ffi::c_void, reserveSpaceSizeInBytes: usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetNormalizationForwardTrainingWorkspaceSize( handle: cuda_types::cudnn8::cudnnHandle_t, mode: cuda_types::cudnn8::cudnnNormMode_t, normOps: cuda_types::cudnn8::cudnnNormOps_t, algo: cuda_types::cudnn8::cudnnNormAlgo_t, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, zDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, yDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, normScaleBiasDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, activationDesc: cuda_types::cudnn8::cudnnActivationDescriptor_t, normMeanVarDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, sizeInBytes: *mut usize, groupCnt: ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetNormalizationBackwardWorkspaceSize( handle: cuda_types::cudnn8::cudnnHandle_t, mode: cuda_types::cudnn8::cudnnNormMode_t, normOps: cuda_types::cudnn8::cudnnNormOps_t, algo: cuda_types::cudnn8::cudnnNormAlgo_t, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, yDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dzDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dNormScaleBiasDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, activationDesc: cuda_types::cudnn8::cudnnActivationDescriptor_t, normMeanVarDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, sizeInBytes: *mut usize, groupCnt: ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetNormalizationTrainingReserveSpaceSize( handle: cuda_types::cudnn8::cudnnHandle_t, mode: cuda_types::cudnn8::cudnnNormMode_t, normOps: cuda_types::cudnn8::cudnnNormOps_t, algo: cuda_types::cudnn8::cudnnNormAlgo_t, activationDesc: cuda_types::cudnn8::cudnnActivationDescriptor_t, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, sizeInBytes: *mut usize, groupCnt: ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnNormalizationForwardTraining( handle: cuda_types::cudnn8::cudnnHandle_t, mode: cuda_types::cudnn8::cudnnNormMode_t, normOps: cuda_types::cudnn8::cudnnNormOps_t, algo: cuda_types::cudnn8::cudnnNormAlgo_t, alpha: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, xData: *const ::core::ffi::c_void, normScaleBiasDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, normScale: *const ::core::ffi::c_void, normBias: *const ::core::ffi::c_void, exponentialAverageFactor: f64, normMeanVarDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, resultRunningMean: *mut ::core::ffi::c_void, resultRunningVariance: *mut ::core::ffi::c_void, epsilon: f64, resultSaveMean: *mut ::core::ffi::c_void, resultSaveInvVariance: *mut ::core::ffi::c_void, activationDesc: cuda_types::cudnn8::cudnnActivationDescriptor_t, zDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, zData: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, yData: *mut ::core::ffi::c_void, workspace: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, reserveSpace: *mut ::core::ffi::c_void, reserveSpaceSizeInBytes: usize, groupCnt: ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnNormalizationBackward( handle: cuda_types::cudnn8::cudnnHandle_t, mode: cuda_types::cudnn8::cudnnNormMode_t, normOps: cuda_types::cudnn8::cudnnNormOps_t, algo: cuda_types::cudnn8::cudnnNormAlgo_t, alphaDataDiff: *const ::core::ffi::c_void, betaDataDiff: *const ::core::ffi::c_void, alphaParamDiff: *const ::core::ffi::c_void, betaParamDiff: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, xData: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, yData: *const ::core::ffi::c_void, dyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dyData: *const ::core::ffi::c_void, dzDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dzData: *mut ::core::ffi::c_void, dxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dxData: *mut ::core::ffi::c_void, dNormScaleBiasDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, normScaleData: *const ::core::ffi::c_void, normBiasData: *const ::core::ffi::c_void, dNormScaleData: *mut ::core::ffi::c_void, dNormBiasData: *mut ::core::ffi::c_void, epsilon: f64, normMeanVarDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, savedMean: *const ::core::ffi::c_void, savedInvVariance: *const ::core::ffi::c_void, activationDesc: cuda_types::cudnn8::cudnnActivationDescriptor_t, workSpace: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, reserveSpace: *mut ::core::ffi::c_void, reserveSpaceSizeInBytes: usize, groupCnt: ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSpatialTfGridGeneratorBackward( handle: cuda_types::cudnn8::cudnnHandle_t, stDesc: cuda_types::cudnn8::cudnnSpatialTransformerDescriptor_t, dgrid: *const ::core::ffi::c_void, dtheta: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSpatialTfSamplerBackward( handle: cuda_types::cudnn8::cudnnHandle_t, stDesc: cuda_types::cudnn8::cudnnSpatialTransformerDescriptor_t, alpha: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, dxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dx: *mut ::core::ffi::c_void, alphaDgrid: *const ::core::ffi::c_void, dyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dy: *const ::core::ffi::c_void, grid: *const ::core::ffi::c_void, betaDgrid: *const ::core::ffi::c_void, dgrid: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnDropoutBackward( handle: cuda_types::cudnn8::cudnnHandle_t, dropoutDesc: cuda_types::cudnn8::cudnnDropoutDescriptor_t, dydesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dy: *const ::core::ffi::c_void, dxdesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dx: *mut ::core::ffi::c_void, reserveSpace: *mut ::core::ffi::c_void, reserveSpaceSizeInBytes: usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnOpsTrainVersionCheck() -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnCreateRNNDescriptor( rnnDesc: *mut cuda_types::cudnn8::cudnnRNNDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnDestroyRNNDescriptor( rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetRNNDescriptor_v8( rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, algo: cuda_types::cudnn8::cudnnRNNAlgo_t, cellMode: cuda_types::cudnn8::cudnnRNNMode_t, biasMode: cuda_types::cudnn8::cudnnRNNBiasMode_t, dirMode: cuda_types::cudnn8::cudnnDirectionMode_t, inputMode: cuda_types::cudnn8::cudnnRNNInputMode_t, dataType: cuda_types::cudnn8::cudnnDataType_t, mathPrec: cuda_types::cudnn8::cudnnDataType_t, mathType: cuda_types::cudnn8::cudnnMathType_t, inputSize: i32, hiddenSize: i32, projSize: i32, numLayers: i32, dropoutDesc: cuda_types::cudnn8::cudnnDropoutDescriptor_t, auxFlags: u32, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetRNNDescriptor_v8( rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, algo: *mut cuda_types::cudnn8::cudnnRNNAlgo_t, cellMode: *mut cuda_types::cudnn8::cudnnRNNMode_t, biasMode: *mut cuda_types::cudnn8::cudnnRNNBiasMode_t, dirMode: *mut cuda_types::cudnn8::cudnnDirectionMode_t, inputMode: *mut cuda_types::cudnn8::cudnnRNNInputMode_t, dataType: *mut cuda_types::cudnn8::cudnnDataType_t, mathPrec: *mut cuda_types::cudnn8::cudnnDataType_t, mathType: *mut cuda_types::cudnn8::cudnnMathType_t, inputSize: *mut i32, hiddenSize: *mut i32, projSize: *mut i32, numLayers: *mut i32, dropoutDesc: *mut cuda_types::cudnn8::cudnnDropoutDescriptor_t, auxFlags: *mut u32, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetRNNDescriptor_v6( handle: cuda_types::cudnn8::cudnnHandle_t, rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, hiddenSize: ::core::ffi::c_int, numLayers: ::core::ffi::c_int, dropoutDesc: cuda_types::cudnn8::cudnnDropoutDescriptor_t, inputMode: cuda_types::cudnn8::cudnnRNNInputMode_t, direction: cuda_types::cudnn8::cudnnDirectionMode_t, cellMode: cuda_types::cudnn8::cudnnRNNMode_t, algo: cuda_types::cudnn8::cudnnRNNAlgo_t, mathPrec: cuda_types::cudnn8::cudnnDataType_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetRNNDescriptor_v6( handle: cuda_types::cudnn8::cudnnHandle_t, rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, hiddenSize: *mut ::core::ffi::c_int, numLayers: *mut ::core::ffi::c_int, dropoutDesc: *mut cuda_types::cudnn8::cudnnDropoutDescriptor_t, inputMode: *mut cuda_types::cudnn8::cudnnRNNInputMode_t, direction: *mut cuda_types::cudnn8::cudnnDirectionMode_t, cellMode: *mut cuda_types::cudnn8::cudnnRNNMode_t, algo: *mut cuda_types::cudnn8::cudnnRNNAlgo_t, mathPrec: *mut cuda_types::cudnn8::cudnnDataType_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetRNNMatrixMathType( rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, mType: cuda_types::cudnn8::cudnnMathType_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetRNNMatrixMathType( rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, mType: *mut cuda_types::cudnn8::cudnnMathType_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetRNNBiasMode( rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, biasMode: cuda_types::cudnn8::cudnnRNNBiasMode_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetRNNBiasMode( rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, biasMode: *mut cuda_types::cudnn8::cudnnRNNBiasMode_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnRNNSetClip_v8( rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, clipMode: cuda_types::cudnn8::cudnnRNNClipMode_t, clipNanOpt: cuda_types::cudnn8::cudnnNanPropagation_t, lclip: f64, rclip: f64, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnRNNGetClip_v8( rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, clipMode: *mut cuda_types::cudnn8::cudnnRNNClipMode_t, clipNanOpt: *mut cuda_types::cudnn8::cudnnNanPropagation_t, lclip: *mut f64, rclip: *mut f64, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnRNNSetClip( handle: cuda_types::cudnn8::cudnnHandle_t, rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, clipMode: cuda_types::cudnn8::cudnnRNNClipMode_t, clipNanOpt: cuda_types::cudnn8::cudnnNanPropagation_t, lclip: f64, rclip: f64, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnRNNGetClip( handle: cuda_types::cudnn8::cudnnHandle_t, rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, clipMode: *mut cuda_types::cudnn8::cudnnRNNClipMode_t, clipNanOpt: *mut cuda_types::cudnn8::cudnnNanPropagation_t, lclip: *mut f64, rclip: *mut f64, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetRNNProjectionLayers( handle: cuda_types::cudnn8::cudnnHandle_t, rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, recProjSize: ::core::ffi::c_int, outProjSize: ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetRNNProjectionLayers( handle: cuda_types::cudnn8::cudnnHandle_t, rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, recProjSize: *mut ::core::ffi::c_int, outProjSize: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnCreatePersistentRNNPlan( rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, minibatch: ::core::ffi::c_int, dataType: cuda_types::cudnn8::cudnnDataType_t, plan: *mut cuda_types::cudnn8::cudnnPersistentRNNPlan_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnDestroyPersistentRNNPlan( plan: cuda_types::cudnn8::cudnnPersistentRNNPlan_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetPersistentRNNPlan( rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, plan: cuda_types::cudnn8::cudnnPersistentRNNPlan_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnBuildRNNDynamic( handle: cuda_types::cudnn8::cudnnHandle_t, rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, miniBatch: ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetRNNWorkspaceSize( handle: cuda_types::cudnn8::cudnnHandle_t, rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, seqLength: ::core::ffi::c_int, xDesc: *const cuda_types::cudnn8::cudnnTensorDescriptor_t, sizeInBytes: *mut usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetRNNTrainingReserveSize( handle: cuda_types::cudnn8::cudnnHandle_t, rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, seqLength: ::core::ffi::c_int, xDesc: *const cuda_types::cudnn8::cudnnTensorDescriptor_t, sizeInBytes: *mut usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetRNNTempSpaceSizes( handle: cuda_types::cudnn8::cudnnHandle_t, rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, fwdMode: cuda_types::cudnn8::cudnnForwardMode_t, xDesc: cuda_types::cudnn8::cudnnRNNDataDescriptor_t, workSpaceSize: *mut usize, reserveSpaceSize: *mut usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetRNNParamsSize( handle: cuda_types::cudnn8::cudnnHandle_t, rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, sizeInBytes: *mut usize, dataType: cuda_types::cudnn8::cudnnDataType_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetRNNWeightSpaceSize( handle: cuda_types::cudnn8::cudnnHandle_t, rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, weightSpaceSize: *mut usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetRNNLinLayerMatrixParams( handle: cuda_types::cudnn8::cudnnHandle_t, rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, pseudoLayer: ::core::ffi::c_int, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, wDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, w: *const ::core::ffi::c_void, linLayerID: ::core::ffi::c_int, linLayerMatDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, linLayerMat: *mut *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetRNNLinLayerBiasParams( handle: cuda_types::cudnn8::cudnnHandle_t, rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, pseudoLayer: ::core::ffi::c_int, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, wDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, w: *const ::core::ffi::c_void, linLayerID: ::core::ffi::c_int, linLayerBiasDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, linLayerBias: *mut *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetRNNWeightParams( handle: cuda_types::cudnn8::cudnnHandle_t, rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, pseudoLayer: i32, weightSpaceSize: usize, weightSpace: *const ::core::ffi::c_void, linLayerID: i32, mDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, mAddr: *mut *mut ::core::ffi::c_void, bDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, bAddr: *mut *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnRNNForwardInference( handle: cuda_types::cudnn8::cudnnHandle_t, rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, seqLength: ::core::ffi::c_int, xDesc: *const cuda_types::cudnn8::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, hxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, hx: *const ::core::ffi::c_void, cxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, cx: *const ::core::ffi::c_void, wDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, w: *const ::core::ffi::c_void, yDesc: *const cuda_types::cudnn8::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, hyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, hy: *mut ::core::ffi::c_void, cyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, cy: *mut ::core::ffi::c_void, workSpace: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetRNNPaddingMode( rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, paddingMode: ::core::ffi::c_uint, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetRNNPaddingMode( rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, paddingMode: *mut ::core::ffi::c_uint, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnCreateRNNDataDescriptor( rnnDataDesc: *mut cuda_types::cudnn8::cudnnRNNDataDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnDestroyRNNDataDescriptor( rnnDataDesc: cuda_types::cudnn8::cudnnRNNDataDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetRNNDataDescriptor( rnnDataDesc: cuda_types::cudnn8::cudnnRNNDataDescriptor_t, dataType: cuda_types::cudnn8::cudnnDataType_t, layout: cuda_types::cudnn8::cudnnRNNDataLayout_t, maxSeqLength: ::core::ffi::c_int, batchSize: ::core::ffi::c_int, vectorSize: ::core::ffi::c_int, seqLengthArray: *const ::core::ffi::c_int, paddingFill: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetRNNDataDescriptor( rnnDataDesc: cuda_types::cudnn8::cudnnRNNDataDescriptor_t, dataType: *mut cuda_types::cudnn8::cudnnDataType_t, layout: *mut cuda_types::cudnn8::cudnnRNNDataLayout_t, maxSeqLength: *mut ::core::ffi::c_int, batchSize: *mut ::core::ffi::c_int, vectorSize: *mut ::core::ffi::c_int, arrayLengthRequested: ::core::ffi::c_int, seqLengthArray: *mut ::core::ffi::c_int, paddingFill: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnRNNForwardInferenceEx( handle: cuda_types::cudnn8::cudnnHandle_t, rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, xDesc: cuda_types::cudnn8::cudnnRNNDataDescriptor_t, x: *const ::core::ffi::c_void, hxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, hx: *const ::core::ffi::c_void, cxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, cx: *const ::core::ffi::c_void, wDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, w: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn8::cudnnRNNDataDescriptor_t, y: *mut ::core::ffi::c_void, hyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, hy: *mut ::core::ffi::c_void, cyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, cy: *mut ::core::ffi::c_void, kDesc: cuda_types::cudnn8::cudnnRNNDataDescriptor_t, keys: *const ::core::ffi::c_void, cDesc: cuda_types::cudnn8::cudnnRNNDataDescriptor_t, cAttn: *mut ::core::ffi::c_void, iDesc: cuda_types::cudnn8::cudnnRNNDataDescriptor_t, iAttn: *mut ::core::ffi::c_void, qDesc: cuda_types::cudnn8::cudnnRNNDataDescriptor_t, queries: *mut ::core::ffi::c_void, workSpace: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnRNNForward( handle: cuda_types::cudnn8::cudnnHandle_t, rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, fwdMode: cuda_types::cudnn8::cudnnForwardMode_t, devSeqLengths: *const i32, xDesc: cuda_types::cudnn8::cudnnRNNDataDescriptor_t, x: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn8::cudnnRNNDataDescriptor_t, y: *mut ::core::ffi::c_void, hDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, hx: *const ::core::ffi::c_void, hy: *mut ::core::ffi::c_void, cDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, cx: *const ::core::ffi::c_void, cy: *mut ::core::ffi::c_void, weightSpaceSize: usize, weightSpace: *const ::core::ffi::c_void, workSpaceSize: usize, workSpace: *mut ::core::ffi::c_void, reserveSpaceSize: usize, reserveSpace: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetRNNAlgorithmDescriptor( handle: cuda_types::cudnn8::cudnnHandle_t, rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, algoDesc: cuda_types::cudnn8::cudnnAlgorithmDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetRNNForwardInferenceAlgorithmMaxCount( handle: cuda_types::cudnn8::cudnnHandle_t, rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, count: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnFindRNNForwardInferenceAlgorithmEx( handle: cuda_types::cudnn8::cudnnHandle_t, rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, seqLength: ::core::ffi::c_int, xDesc: *const cuda_types::cudnn8::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, hxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, hx: *const ::core::ffi::c_void, cxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, cx: *const ::core::ffi::c_void, wDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, w: *const ::core::ffi::c_void, yDesc: *const cuda_types::cudnn8::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, hyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, hy: *mut ::core::ffi::c_void, cyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, cy: *mut ::core::ffi::c_void, findIntensity: f32, requestedAlgoCount: ::core::ffi::c_int, returnedAlgoCount: *mut ::core::ffi::c_int, perfResults: *mut cuda_types::cudnn8::cudnnAlgorithmPerformance_t, workspace: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnCreateSeqDataDescriptor( seqDataDesc: *mut cuda_types::cudnn8::cudnnSeqDataDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnDestroySeqDataDescriptor( seqDataDesc: cuda_types::cudnn8::cudnnSeqDataDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetSeqDataDescriptor( seqDataDesc: cuda_types::cudnn8::cudnnSeqDataDescriptor_t, dataType: cuda_types::cudnn8::cudnnDataType_t, nbDims: ::core::ffi::c_int, dimA: *const ::core::ffi::c_int, axes: *const cuda_types::cudnn8::cudnnSeqDataAxis_t, seqLengthArraySize: usize, seqLengthArray: *const ::core::ffi::c_int, paddingFill: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetSeqDataDescriptor( seqDataDesc: cuda_types::cudnn8::cudnnSeqDataDescriptor_t, dataType: *mut cuda_types::cudnn8::cudnnDataType_t, nbDims: *mut ::core::ffi::c_int, nbDimsRequested: ::core::ffi::c_int, dimA: *mut ::core::ffi::c_int, axes: *mut cuda_types::cudnn8::cudnnSeqDataAxis_t, seqLengthArraySize: *mut usize, seqLengthSizeRequested: usize, seqLengthArray: *mut ::core::ffi::c_int, paddingFill: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnCreateAttnDescriptor( attnDesc: *mut cuda_types::cudnn8::cudnnAttnDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnDestroyAttnDescriptor( attnDesc: cuda_types::cudnn8::cudnnAttnDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetAttnDescriptor( attnDesc: cuda_types::cudnn8::cudnnAttnDescriptor_t, attnMode: ::core::ffi::c_uint, nHeads: ::core::ffi::c_int, smScaler: f64, dataType: cuda_types::cudnn8::cudnnDataType_t, computePrec: cuda_types::cudnn8::cudnnDataType_t, mathType: cuda_types::cudnn8::cudnnMathType_t, attnDropoutDesc: cuda_types::cudnn8::cudnnDropoutDescriptor_t, postDropoutDesc: cuda_types::cudnn8::cudnnDropoutDescriptor_t, qSize: ::core::ffi::c_int, kSize: ::core::ffi::c_int, vSize: ::core::ffi::c_int, qProjSize: ::core::ffi::c_int, kProjSize: ::core::ffi::c_int, vProjSize: ::core::ffi::c_int, oProjSize: ::core::ffi::c_int, qoMaxSeqLength: ::core::ffi::c_int, kvMaxSeqLength: ::core::ffi::c_int, maxBatchSize: ::core::ffi::c_int, maxBeamSize: ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetAttnDescriptor( attnDesc: cuda_types::cudnn8::cudnnAttnDescriptor_t, attnMode: *mut ::core::ffi::c_uint, nHeads: *mut ::core::ffi::c_int, smScaler: *mut f64, dataType: *mut cuda_types::cudnn8::cudnnDataType_t, computePrec: *mut cuda_types::cudnn8::cudnnDataType_t, mathType: *mut cuda_types::cudnn8::cudnnMathType_t, attnDropoutDesc: *mut cuda_types::cudnn8::cudnnDropoutDescriptor_t, postDropoutDesc: *mut cuda_types::cudnn8::cudnnDropoutDescriptor_t, qSize: *mut ::core::ffi::c_int, kSize: *mut ::core::ffi::c_int, vSize: *mut ::core::ffi::c_int, qProjSize: *mut ::core::ffi::c_int, kProjSize: *mut ::core::ffi::c_int, vProjSize: *mut ::core::ffi::c_int, oProjSize: *mut ::core::ffi::c_int, qoMaxSeqLength: *mut ::core::ffi::c_int, kvMaxSeqLength: *mut ::core::ffi::c_int, maxBatchSize: *mut ::core::ffi::c_int, maxBeamSize: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetMultiHeadAttnBuffers( handle: cuda_types::cudnn8::cudnnHandle_t, attnDesc: cuda_types::cudnn8::cudnnAttnDescriptor_t, weightSizeInBytes: *mut usize, workSpaceSizeInBytes: *mut usize, reserveSpaceSizeInBytes: *mut usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetMultiHeadAttnWeights( handle: cuda_types::cudnn8::cudnnHandle_t, attnDesc: cuda_types::cudnn8::cudnnAttnDescriptor_t, wKind: cuda_types::cudnn8::cudnnMultiHeadAttnWeightKind_t, weightSizeInBytes: usize, weights: *const ::core::ffi::c_void, wDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, wAddr: *mut *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnMultiHeadAttnForward( handle: cuda_types::cudnn8::cudnnHandle_t, attnDesc: cuda_types::cudnn8::cudnnAttnDescriptor_t, currIdx: ::core::ffi::c_int, loWinIdx: *const ::core::ffi::c_int, hiWinIdx: *const ::core::ffi::c_int, devSeqLengthsQO: *const ::core::ffi::c_int, devSeqLengthsKV: *const ::core::ffi::c_int, qDesc: cuda_types::cudnn8::cudnnSeqDataDescriptor_t, queries: *const ::core::ffi::c_void, residuals: *const ::core::ffi::c_void, kDesc: cuda_types::cudnn8::cudnnSeqDataDescriptor_t, keys: *const ::core::ffi::c_void, vDesc: cuda_types::cudnn8::cudnnSeqDataDescriptor_t, values: *const ::core::ffi::c_void, oDesc: cuda_types::cudnn8::cudnnSeqDataDescriptor_t, out: *mut ::core::ffi::c_void, weightSizeInBytes: usize, weights: *const ::core::ffi::c_void, workSpaceSizeInBytes: usize, workSpace: *mut ::core::ffi::c_void, reserveSpaceSizeInBytes: usize, reserveSpace: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnAdvInferVersionCheck() -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnRNNForwardTraining( handle: cuda_types::cudnn8::cudnnHandle_t, rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, seqLength: ::core::ffi::c_int, xDesc: *const cuda_types::cudnn8::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, hxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, hx: *const ::core::ffi::c_void, cxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, cx: *const ::core::ffi::c_void, wDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, w: *const ::core::ffi::c_void, yDesc: *const cuda_types::cudnn8::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, hyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, hy: *mut ::core::ffi::c_void, cyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, cy: *mut ::core::ffi::c_void, workSpace: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, reserveSpace: *mut ::core::ffi::c_void, reserveSpaceSizeInBytes: usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnRNNBackwardData( handle: cuda_types::cudnn8::cudnnHandle_t, rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, seqLength: ::core::ffi::c_int, yDesc: *const cuda_types::cudnn8::cudnnTensorDescriptor_t, y: *const ::core::ffi::c_void, dyDesc: *const cuda_types::cudnn8::cudnnTensorDescriptor_t, dy: *const ::core::ffi::c_void, dhyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dhy: *const ::core::ffi::c_void, dcyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dcy: *const ::core::ffi::c_void, wDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, w: *const ::core::ffi::c_void, hxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, hx: *const ::core::ffi::c_void, cxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, cx: *const ::core::ffi::c_void, dxDesc: *const cuda_types::cudnn8::cudnnTensorDescriptor_t, dx: *mut ::core::ffi::c_void, dhxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dhx: *mut ::core::ffi::c_void, dcxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dcx: *mut ::core::ffi::c_void, workSpace: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, reserveSpace: *mut ::core::ffi::c_void, reserveSpaceSizeInBytes: usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnRNNBackwardData_v8( handle: cuda_types::cudnn8::cudnnHandle_t, rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, devSeqLengths: *const i32, yDesc: cuda_types::cudnn8::cudnnRNNDataDescriptor_t, y: *const ::core::ffi::c_void, dy: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn8::cudnnRNNDataDescriptor_t, dx: *mut ::core::ffi::c_void, hDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, hx: *const ::core::ffi::c_void, dhy: *const ::core::ffi::c_void, dhx: *mut ::core::ffi::c_void, cDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, cx: *const ::core::ffi::c_void, dcy: *const ::core::ffi::c_void, dcx: *mut ::core::ffi::c_void, weightSpaceSize: usize, weightSpace: *const ::core::ffi::c_void, workSpaceSize: usize, workSpace: *mut ::core::ffi::c_void, reserveSpaceSize: usize, reserveSpace: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnRNNBackwardWeights( handle: cuda_types::cudnn8::cudnnHandle_t, rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, seqLength: ::core::ffi::c_int, xDesc: *const cuda_types::cudnn8::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, hxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, hx: *const ::core::ffi::c_void, yDesc: *const cuda_types::cudnn8::cudnnTensorDescriptor_t, y: *const ::core::ffi::c_void, workSpace: *const ::core::ffi::c_void, workSpaceSizeInBytes: usize, dwDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, dw: *mut ::core::ffi::c_void, reserveSpace: *const ::core::ffi::c_void, reserveSpaceSizeInBytes: usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnRNNBackwardWeights_v8( handle: cuda_types::cudnn8::cudnnHandle_t, rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, addGrad: cuda_types::cudnn8::cudnnWgradMode_t, devSeqLengths: *const i32, xDesc: cuda_types::cudnn8::cudnnRNNDataDescriptor_t, x: *const ::core::ffi::c_void, hDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, hx: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn8::cudnnRNNDataDescriptor_t, y: *const ::core::ffi::c_void, weightSpaceSize: usize, dweightSpace: *mut ::core::ffi::c_void, workSpaceSize: usize, workSpace: *mut ::core::ffi::c_void, reserveSpaceSize: usize, reserveSpace: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnRNNForwardTrainingEx( handle: cuda_types::cudnn8::cudnnHandle_t, rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, xDesc: cuda_types::cudnn8::cudnnRNNDataDescriptor_t, x: *const ::core::ffi::c_void, hxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, hx: *const ::core::ffi::c_void, cxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, cx: *const ::core::ffi::c_void, wDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, w: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn8::cudnnRNNDataDescriptor_t, y: *mut ::core::ffi::c_void, hyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, hy: *mut ::core::ffi::c_void, cyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, cy: *mut ::core::ffi::c_void, kDesc: cuda_types::cudnn8::cudnnRNNDataDescriptor_t, keys: *const ::core::ffi::c_void, cDesc: cuda_types::cudnn8::cudnnRNNDataDescriptor_t, cAttn: *mut ::core::ffi::c_void, iDesc: cuda_types::cudnn8::cudnnRNNDataDescriptor_t, iAttn: *mut ::core::ffi::c_void, qDesc: cuda_types::cudnn8::cudnnRNNDataDescriptor_t, queries: *mut ::core::ffi::c_void, workSpace: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, reserveSpace: *mut ::core::ffi::c_void, reserveSpaceSizeInBytes: usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnRNNBackwardDataEx( handle: cuda_types::cudnn8::cudnnHandle_t, rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, yDesc: cuda_types::cudnn8::cudnnRNNDataDescriptor_t, y: *const ::core::ffi::c_void, dyDesc: cuda_types::cudnn8::cudnnRNNDataDescriptor_t, dy: *const ::core::ffi::c_void, dcDesc: cuda_types::cudnn8::cudnnRNNDataDescriptor_t, dcAttn: *const ::core::ffi::c_void, dhyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dhy: *const ::core::ffi::c_void, dcyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dcy: *const ::core::ffi::c_void, wDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, w: *const ::core::ffi::c_void, hxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, hx: *const ::core::ffi::c_void, cxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, cx: *const ::core::ffi::c_void, dxDesc: cuda_types::cudnn8::cudnnRNNDataDescriptor_t, dx: *mut ::core::ffi::c_void, dhxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dhx: *mut ::core::ffi::c_void, dcxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dcx: *mut ::core::ffi::c_void, dkDesc: cuda_types::cudnn8::cudnnRNNDataDescriptor_t, dkeys: *mut ::core::ffi::c_void, workSpace: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, reserveSpace: *mut ::core::ffi::c_void, reserveSpaceSizeInBytes: usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnRNNBackwardWeightsEx( handle: cuda_types::cudnn8::cudnnHandle_t, rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, xDesc: cuda_types::cudnn8::cudnnRNNDataDescriptor_t, x: *const ::core::ffi::c_void, hxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, hx: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn8::cudnnRNNDataDescriptor_t, y: *const ::core::ffi::c_void, workSpace: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, dwDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, dw: *mut ::core::ffi::c_void, reserveSpace: *mut ::core::ffi::c_void, reserveSpaceSizeInBytes: usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetRNNForwardTrainingAlgorithmMaxCount( handle: cuda_types::cudnn8::cudnnHandle_t, rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, count: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnFindRNNForwardTrainingAlgorithmEx( handle: cuda_types::cudnn8::cudnnHandle_t, rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, seqLength: ::core::ffi::c_int, xDesc: *const cuda_types::cudnn8::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, hxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, hx: *const ::core::ffi::c_void, cxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, cx: *const ::core::ffi::c_void, wDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, w: *const ::core::ffi::c_void, yDesc: *const cuda_types::cudnn8::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, hyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, hy: *mut ::core::ffi::c_void, cyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, cy: *mut ::core::ffi::c_void, findIntensity: f32, requestedAlgoCount: ::core::ffi::c_int, returnedAlgoCount: *mut ::core::ffi::c_int, perfResults: *mut cuda_types::cudnn8::cudnnAlgorithmPerformance_t, workspace: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, reserveSpace: *mut ::core::ffi::c_void, reserveSpaceSizeInBytes: usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetRNNBackwardDataAlgorithmMaxCount( handle: cuda_types::cudnn8::cudnnHandle_t, rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, count: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnFindRNNBackwardDataAlgorithmEx( handle: cuda_types::cudnn8::cudnnHandle_t, rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, seqLength: ::core::ffi::c_int, yDesc: *const cuda_types::cudnn8::cudnnTensorDescriptor_t, y: *const ::core::ffi::c_void, dyDesc: *const cuda_types::cudnn8::cudnnTensorDescriptor_t, dy: *const ::core::ffi::c_void, dhyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dhy: *const ::core::ffi::c_void, dcyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dcy: *const ::core::ffi::c_void, wDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, w: *const ::core::ffi::c_void, hxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, hx: *const ::core::ffi::c_void, cxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, cx: *const ::core::ffi::c_void, dxDesc: *const cuda_types::cudnn8::cudnnTensorDescriptor_t, dx: *mut ::core::ffi::c_void, dhxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dhx: *mut ::core::ffi::c_void, dcxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dcx: *mut ::core::ffi::c_void, findIntensity: f32, requestedAlgoCount: ::core::ffi::c_int, returnedAlgoCount: *mut ::core::ffi::c_int, perfResults: *mut cuda_types::cudnn8::cudnnAlgorithmPerformance_t, workspace: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, reserveSpace: *mut ::core::ffi::c_void, reserveSpaceSizeInBytes: usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetRNNBackwardWeightsAlgorithmMaxCount( handle: cuda_types::cudnn8::cudnnHandle_t, rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, count: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnFindRNNBackwardWeightsAlgorithmEx( handle: cuda_types::cudnn8::cudnnHandle_t, rnnDesc: cuda_types::cudnn8::cudnnRNNDescriptor_t, seqLength: ::core::ffi::c_int, xDesc: *const cuda_types::cudnn8::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, hxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, hx: *const ::core::ffi::c_void, yDesc: *const cuda_types::cudnn8::cudnnTensorDescriptor_t, y: *const ::core::ffi::c_void, findIntensity: f32, requestedAlgoCount: ::core::ffi::c_int, returnedAlgoCount: *mut ::core::ffi::c_int, perfResults: *mut cuda_types::cudnn8::cudnnAlgorithmPerformance_t, workspace: *const ::core::ffi::c_void, workSpaceSizeInBytes: usize, dwDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, dw: *mut ::core::ffi::c_void, reserveSpace: *const ::core::ffi::c_void, reserveSpaceSizeInBytes: usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnMultiHeadAttnBackwardData( handle: cuda_types::cudnn8::cudnnHandle_t, attnDesc: cuda_types::cudnn8::cudnnAttnDescriptor_t, loWinIdx: *const ::core::ffi::c_int, hiWinIdx: *const ::core::ffi::c_int, devSeqLengthsDQDO: *const ::core::ffi::c_int, devSeqLengthsDKDV: *const ::core::ffi::c_int, doDesc: cuda_types::cudnn8::cudnnSeqDataDescriptor_t, dout: *const ::core::ffi::c_void, dqDesc: cuda_types::cudnn8::cudnnSeqDataDescriptor_t, dqueries: *mut ::core::ffi::c_void, queries: *const ::core::ffi::c_void, dkDesc: cuda_types::cudnn8::cudnnSeqDataDescriptor_t, dkeys: *mut ::core::ffi::c_void, keys: *const ::core::ffi::c_void, dvDesc: cuda_types::cudnn8::cudnnSeqDataDescriptor_t, dvalues: *mut ::core::ffi::c_void, values: *const ::core::ffi::c_void, weightSizeInBytes: usize, weights: *const ::core::ffi::c_void, workSpaceSizeInBytes: usize, workSpace: *mut ::core::ffi::c_void, reserveSpaceSizeInBytes: usize, reserveSpace: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnMultiHeadAttnBackwardWeights( handle: cuda_types::cudnn8::cudnnHandle_t, attnDesc: cuda_types::cudnn8::cudnnAttnDescriptor_t, addGrad: cuda_types::cudnn8::cudnnWgradMode_t, qDesc: cuda_types::cudnn8::cudnnSeqDataDescriptor_t, queries: *const ::core::ffi::c_void, kDesc: cuda_types::cudnn8::cudnnSeqDataDescriptor_t, keys: *const ::core::ffi::c_void, vDesc: cuda_types::cudnn8::cudnnSeqDataDescriptor_t, values: *const ::core::ffi::c_void, doDesc: cuda_types::cudnn8::cudnnSeqDataDescriptor_t, dout: *const ::core::ffi::c_void, weightSizeInBytes: usize, weights: *const ::core::ffi::c_void, dweights: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, workSpace: *mut ::core::ffi::c_void, reserveSpaceSizeInBytes: usize, reserveSpace: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnCreateCTCLossDescriptor( ctcLossDesc: *mut cuda_types::cudnn8::cudnnCTCLossDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetCTCLossDescriptor( ctcLossDesc: cuda_types::cudnn8::cudnnCTCLossDescriptor_t, compType: cuda_types::cudnn8::cudnnDataType_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetCTCLossDescriptorEx( ctcLossDesc: cuda_types::cudnn8::cudnnCTCLossDescriptor_t, compType: cuda_types::cudnn8::cudnnDataType_t, normMode: cuda_types::cudnn8::cudnnLossNormalizationMode_t, gradMode: cuda_types::cudnn8::cudnnNanPropagation_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetCTCLossDescriptor_v8( ctcLossDesc: cuda_types::cudnn8::cudnnCTCLossDescriptor_t, compType: cuda_types::cudnn8::cudnnDataType_t, normMode: cuda_types::cudnn8::cudnnLossNormalizationMode_t, gradMode: cuda_types::cudnn8::cudnnNanPropagation_t, maxLabelLength: ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetCTCLossDescriptor( ctcLossDesc: cuda_types::cudnn8::cudnnCTCLossDescriptor_t, compType: *mut cuda_types::cudnn8::cudnnDataType_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetCTCLossDescriptorEx( ctcLossDesc: cuda_types::cudnn8::cudnnCTCLossDescriptor_t, compType: *mut cuda_types::cudnn8::cudnnDataType_t, normMode: *mut cuda_types::cudnn8::cudnnLossNormalizationMode_t, gradMode: *mut cuda_types::cudnn8::cudnnNanPropagation_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetCTCLossDescriptor_v8( ctcLossDesc: cuda_types::cudnn8::cudnnCTCLossDescriptor_t, compType: *mut cuda_types::cudnn8::cudnnDataType_t, normMode: *mut cuda_types::cudnn8::cudnnLossNormalizationMode_t, gradMode: *mut cuda_types::cudnn8::cudnnNanPropagation_t, maxLabelLength: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnDestroyCTCLossDescriptor( ctcLossDesc: cuda_types::cudnn8::cudnnCTCLossDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnCTCLoss( handle: cuda_types::cudnn8::cudnnHandle_t, probsDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, probs: *const ::core::ffi::c_void, hostLabels: *const ::core::ffi::c_int, hostLabelLengths: *const ::core::ffi::c_int, hostInputLengths: *const ::core::ffi::c_int, costs: *mut ::core::ffi::c_void, gradientsDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, gradients: *mut ::core::ffi::c_void, algo: cuda_types::cudnn8::cudnnCTCLossAlgo_t, ctcLossDesc: cuda_types::cudnn8::cudnnCTCLossDescriptor_t, workspace: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnCTCLoss_v8( handle: cuda_types::cudnn8::cudnnHandle_t, algo: cuda_types::cudnn8::cudnnCTCLossAlgo_t, ctcLossDesc: cuda_types::cudnn8::cudnnCTCLossDescriptor_t, probsDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, probs: *const ::core::ffi::c_void, labels: *const ::core::ffi::c_int, labelLengths: *const ::core::ffi::c_int, inputLengths: *const ::core::ffi::c_int, costs: *mut ::core::ffi::c_void, gradientsDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, gradients: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, workspace: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetCTCLossWorkspaceSize( handle: cuda_types::cudnn8::cudnnHandle_t, probsDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, gradientsDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, labels: *const ::core::ffi::c_int, labelLengths: *const ::core::ffi::c_int, inputLengths: *const ::core::ffi::c_int, algo: cuda_types::cudnn8::cudnnCTCLossAlgo_t, ctcLossDesc: cuda_types::cudnn8::cudnnCTCLossDescriptor_t, sizeInBytes: *mut usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetCTCLossWorkspaceSize_v8( handle: cuda_types::cudnn8::cudnnHandle_t, algo: cuda_types::cudnn8::cudnnCTCLossAlgo_t, ctcLossDesc: cuda_types::cudnn8::cudnnCTCLossDescriptor_t, probsDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, gradientsDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, sizeInBytes: *mut usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnAdvTrainVersionCheck() -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnCreateConvolutionDescriptor( convDesc: *mut cuda_types::cudnn8::cudnnConvolutionDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnDestroyConvolutionDescriptor( convDesc: cuda_types::cudnn8::cudnnConvolutionDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetConvolutionMathType( convDesc: cuda_types::cudnn8::cudnnConvolutionDescriptor_t, mathType: cuda_types::cudnn8::cudnnMathType_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetConvolutionMathType( convDesc: cuda_types::cudnn8::cudnnConvolutionDescriptor_t, mathType: *mut cuda_types::cudnn8::cudnnMathType_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetConvolutionGroupCount( convDesc: cuda_types::cudnn8::cudnnConvolutionDescriptor_t, groupCount: ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetConvolutionGroupCount( convDesc: cuda_types::cudnn8::cudnnConvolutionDescriptor_t, groupCount: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetConvolutionReorderType( convDesc: cuda_types::cudnn8::cudnnConvolutionDescriptor_t, reorderType: cuda_types::cudnn8::cudnnReorderType_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetConvolutionReorderType( convDesc: cuda_types::cudnn8::cudnnConvolutionDescriptor_t, reorderType: *mut cuda_types::cudnn8::cudnnReorderType_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetConvolution2dDescriptor( convDesc: cuda_types::cudnn8::cudnnConvolutionDescriptor_t, pad_h: ::core::ffi::c_int, pad_w: ::core::ffi::c_int, u: ::core::ffi::c_int, v: ::core::ffi::c_int, dilation_h: ::core::ffi::c_int, dilation_w: ::core::ffi::c_int, mode: cuda_types::cudnn8::cudnnConvolutionMode_t, computeType: cuda_types::cudnn8::cudnnDataType_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetConvolution2dDescriptor( convDesc: cuda_types::cudnn8::cudnnConvolutionDescriptor_t, pad_h: *mut ::core::ffi::c_int, pad_w: *mut ::core::ffi::c_int, u: *mut ::core::ffi::c_int, v: *mut ::core::ffi::c_int, dilation_h: *mut ::core::ffi::c_int, dilation_w: *mut ::core::ffi::c_int, mode: *mut cuda_types::cudnn8::cudnnConvolutionMode_t, computeType: *mut cuda_types::cudnn8::cudnnDataType_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetConvolutionNdDescriptor( convDesc: cuda_types::cudnn8::cudnnConvolutionDescriptor_t, arrayLength: ::core::ffi::c_int, padA: *const ::core::ffi::c_int, filterStrideA: *const ::core::ffi::c_int, dilationA: *const ::core::ffi::c_int, mode: cuda_types::cudnn8::cudnnConvolutionMode_t, computeType: cuda_types::cudnn8::cudnnDataType_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetConvolutionNdDescriptor( convDesc: cuda_types::cudnn8::cudnnConvolutionDescriptor_t, arrayLengthRequested: ::core::ffi::c_int, arrayLength: *mut ::core::ffi::c_int, padA: *mut ::core::ffi::c_int, strideA: *mut ::core::ffi::c_int, dilationA: *mut ::core::ffi::c_int, mode: *mut cuda_types::cudnn8::cudnnConvolutionMode_t, computeType: *mut cuda_types::cudnn8::cudnnDataType_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetConvolution2dForwardOutputDim( convDesc: cuda_types::cudnn8::cudnnConvolutionDescriptor_t, inputTensorDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, filterDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, n: *mut ::core::ffi::c_int, c: *mut ::core::ffi::c_int, h: *mut ::core::ffi::c_int, w: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetConvolutionNdForwardOutputDim( convDesc: cuda_types::cudnn8::cudnnConvolutionDescriptor_t, inputTensorDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, filterDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, nbDims: ::core::ffi::c_int, tensorOuputDimA: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetConvolutionForwardAlgorithmMaxCount( handle: cuda_types::cudnn8::cudnnHandle_t, count: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetConvolutionForwardAlgorithm_v7( handle: cuda_types::cudnn8::cudnnHandle_t, srcDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, filterDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, convDesc: cuda_types::cudnn8::cudnnConvolutionDescriptor_t, destDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, requestedAlgoCount: ::core::ffi::c_int, returnedAlgoCount: *mut ::core::ffi::c_int, perfResults: *mut cuda_types::cudnn8::cudnnConvolutionFwdAlgoPerf_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnFindConvolutionForwardAlgorithm( handle: cuda_types::cudnn8::cudnnHandle_t, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, wDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, convDesc: cuda_types::cudnn8::cudnnConvolutionDescriptor_t, yDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, requestedAlgoCount: ::core::ffi::c_int, returnedAlgoCount: *mut ::core::ffi::c_int, perfResults: *mut cuda_types::cudnn8::cudnnConvolutionFwdAlgoPerf_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnFindConvolutionForwardAlgorithmEx( handle: cuda_types::cudnn8::cudnnHandle_t, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, wDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, w: *const ::core::ffi::c_void, convDesc: cuda_types::cudnn8::cudnnConvolutionDescriptor_t, yDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, requestedAlgoCount: ::core::ffi::c_int, returnedAlgoCount: *mut ::core::ffi::c_int, perfResults: *mut cuda_types::cudnn8::cudnnConvolutionFwdAlgoPerf_t, workSpace: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnIm2Col( handle: cuda_types::cudnn8::cudnnHandle_t, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, wDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, convDesc: cuda_types::cudnn8::cudnnConvolutionDescriptor_t, colBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnReorderFilterAndBias( handle: cuda_types::cudnn8::cudnnHandle_t, filterDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, reorderType: cuda_types::cudnn8::cudnnReorderType_t, filterData: *const ::core::ffi::c_void, reorderedFilterData: *mut ::core::ffi::c_void, reorderBias: ::core::ffi::c_int, biasData: *const ::core::ffi::c_void, reorderedBiasData: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetConvolutionForwardWorkspaceSize( handle: cuda_types::cudnn8::cudnnHandle_t, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, wDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, convDesc: cuda_types::cudnn8::cudnnConvolutionDescriptor_t, yDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, algo: cuda_types::cudnn8::cudnnConvolutionFwdAlgo_t, sizeInBytes: *mut usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnConvolutionForward( handle: cuda_types::cudnn8::cudnnHandle_t, alpha: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, wDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, w: *const ::core::ffi::c_void, convDesc: cuda_types::cudnn8::cudnnConvolutionDescriptor_t, algo: cuda_types::cudnn8::cudnnConvolutionFwdAlgo_t, workSpace: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, beta: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnConvolutionBiasActivationForward( handle: cuda_types::cudnn8::cudnnHandle_t, alpha1: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, wDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, w: *const ::core::ffi::c_void, convDesc: cuda_types::cudnn8::cudnnConvolutionDescriptor_t, algo: cuda_types::cudnn8::cudnnConvolutionFwdAlgo_t, workSpace: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, alpha2: *const ::core::ffi::c_void, zDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, z: *const ::core::ffi::c_void, biasDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, bias: *const ::core::ffi::c_void, activationDesc: cuda_types::cudnn8::cudnnActivationDescriptor_t, yDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetConvolutionBackwardDataAlgorithmMaxCount( handle: cuda_types::cudnn8::cudnnHandle_t, count: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnFindConvolutionBackwardDataAlgorithm( handle: cuda_types::cudnn8::cudnnHandle_t, wDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, dyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, convDesc: cuda_types::cudnn8::cudnnConvolutionDescriptor_t, dxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, requestedAlgoCount: ::core::ffi::c_int, returnedAlgoCount: *mut ::core::ffi::c_int, perfResults: *mut cuda_types::cudnn8::cudnnConvolutionBwdDataAlgoPerf_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnFindConvolutionBackwardDataAlgorithmEx( handle: cuda_types::cudnn8::cudnnHandle_t, wDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, w: *const ::core::ffi::c_void, dyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dy: *const ::core::ffi::c_void, convDesc: cuda_types::cudnn8::cudnnConvolutionDescriptor_t, dxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dx: *mut ::core::ffi::c_void, requestedAlgoCount: ::core::ffi::c_int, returnedAlgoCount: *mut ::core::ffi::c_int, perfResults: *mut cuda_types::cudnn8::cudnnConvolutionBwdDataAlgoPerf_t, workSpace: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetConvolutionBackwardDataAlgorithm_v7( handle: cuda_types::cudnn8::cudnnHandle_t, filterDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, diffDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, convDesc: cuda_types::cudnn8::cudnnConvolutionDescriptor_t, gradDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, requestedAlgoCount: ::core::ffi::c_int, returnedAlgoCount: *mut ::core::ffi::c_int, perfResults: *mut cuda_types::cudnn8::cudnnConvolutionBwdDataAlgoPerf_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetConvolutionBackwardDataWorkspaceSize( handle: cuda_types::cudnn8::cudnnHandle_t, wDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, dyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, convDesc: cuda_types::cudnn8::cudnnConvolutionDescriptor_t, dxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, algo: cuda_types::cudnn8::cudnnConvolutionBwdDataAlgo_t, sizeInBytes: *mut usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnConvolutionBackwardData( handle: cuda_types::cudnn8::cudnnHandle_t, alpha: *const ::core::ffi::c_void, wDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, w: *const ::core::ffi::c_void, dyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dy: *const ::core::ffi::c_void, convDesc: cuda_types::cudnn8::cudnnConvolutionDescriptor_t, algo: cuda_types::cudnn8::cudnnConvolutionBwdDataAlgo_t, workSpace: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, beta: *const ::core::ffi::c_void, dxDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dx: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetFoldedConvBackwardDataDescriptors( handle: cuda_types::cudnn8::cudnnHandle_t, filterDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, diffDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, convDesc: cuda_types::cudnn8::cudnnConvolutionDescriptor_t, gradDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, transformFormat: cuda_types::cudnn8::cudnnTensorFormat_t, foldedFilterDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, paddedDiffDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, foldedConvDesc: cuda_types::cudnn8::cudnnConvolutionDescriptor_t, foldedGradDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, filterFoldTransDesc: cuda_types::cudnn8::cudnnTensorTransformDescriptor_t, diffPadTransDesc: cuda_types::cudnn8::cudnnTensorTransformDescriptor_t, gradFoldTransDesc: cuda_types::cudnn8::cudnnTensorTransformDescriptor_t, gradUnfoldTransDesc: cuda_types::cudnn8::cudnnTensorTransformDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnCnnInferVersionCheck() -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetConvolutionBackwardFilterAlgorithmMaxCount( handle: cuda_types::cudnn8::cudnnHandle_t, count: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnFindConvolutionBackwardFilterAlgorithm( handle: cuda_types::cudnn8::cudnnHandle_t, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, convDesc: cuda_types::cudnn8::cudnnConvolutionDescriptor_t, dwDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, requestedAlgoCount: ::core::ffi::c_int, returnedAlgoCount: *mut ::core::ffi::c_int, perfResults: *mut cuda_types::cudnn8::cudnnConvolutionBwdFilterAlgoPerf_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnFindConvolutionBackwardFilterAlgorithmEx( handle: cuda_types::cudnn8::cudnnHandle_t, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, dyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, y: *const ::core::ffi::c_void, convDesc: cuda_types::cudnn8::cudnnConvolutionDescriptor_t, dwDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, dw: *mut ::core::ffi::c_void, requestedAlgoCount: ::core::ffi::c_int, returnedAlgoCount: *mut ::core::ffi::c_int, perfResults: *mut cuda_types::cudnn8::cudnnConvolutionBwdFilterAlgoPerf_t, workSpace: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetConvolutionBackwardFilterAlgorithm_v7( handle: cuda_types::cudnn8::cudnnHandle_t, srcDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, diffDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, convDesc: cuda_types::cudnn8::cudnnConvolutionDescriptor_t, gradDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, requestedAlgoCount: ::core::ffi::c_int, returnedAlgoCount: *mut ::core::ffi::c_int, perfResults: *mut cuda_types::cudnn8::cudnnConvolutionBwdFilterAlgoPerf_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetConvolutionBackwardFilterWorkspaceSize( handle: cuda_types::cudnn8::cudnnHandle_t, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, convDesc: cuda_types::cudnn8::cudnnConvolutionDescriptor_t, gradDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, algo: cuda_types::cudnn8::cudnnConvolutionBwdFilterAlgo_t, sizeInBytes: *mut usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnConvolutionBackwardFilter( handle: cuda_types::cudnn8::cudnnHandle_t, alpha: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, dyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dy: *const ::core::ffi::c_void, convDesc: cuda_types::cudnn8::cudnnConvolutionDescriptor_t, algo: cuda_types::cudnn8::cudnnConvolutionBwdFilterAlgo_t, workSpace: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, beta: *const ::core::ffi::c_void, dwDesc: cuda_types::cudnn8::cudnnFilterDescriptor_t, dw: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnConvolutionBackwardBias( handle: cuda_types::cudnn8::cudnnHandle_t, alpha: *const ::core::ffi::c_void, dyDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, dy: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, dbDesc: cuda_types::cudnn8::cudnnTensorDescriptor_t, db: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnCreateFusedOpsConstParamPack( constPack: *mut cuda_types::cudnn8::cudnnFusedOpsConstParamPack_t, ops: cuda_types::cudnn8::cudnnFusedOps_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnDestroyFusedOpsConstParamPack( constPack: cuda_types::cudnn8::cudnnFusedOpsConstParamPack_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetFusedOpsConstParamPackAttribute( constPack: cuda_types::cudnn8::cudnnFusedOpsConstParamPack_t, paramLabel: cuda_types::cudnn8::cudnnFusedOpsConstParamLabel_t, param: *const ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetFusedOpsConstParamPackAttribute( constPack: cuda_types::cudnn8::cudnnFusedOpsConstParamPack_t, paramLabel: cuda_types::cudnn8::cudnnFusedOpsConstParamLabel_t, param: *mut ::core::ffi::c_void, isNULL: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnCreateFusedOpsVariantParamPack( varPack: *mut cuda_types::cudnn8::cudnnFusedOpsVariantParamPack_t, ops: cuda_types::cudnn8::cudnnFusedOps_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnDestroyFusedOpsVariantParamPack( varPack: cuda_types::cudnn8::cudnnFusedOpsVariantParamPack_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnSetFusedOpsVariantParamPackAttribute( varPack: cuda_types::cudnn8::cudnnFusedOpsVariantParamPack_t, paramLabel: cuda_types::cudnn8::cudnnFusedOpsVariantParamLabel_t, ptr: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnGetFusedOpsVariantParamPackAttribute( varPack: cuda_types::cudnn8::cudnnFusedOpsVariantParamPack_t, paramLabel: cuda_types::cudnn8::cudnnFusedOpsVariantParamLabel_t, ptr: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnCreateFusedOpsPlan( plan: *mut cuda_types::cudnn8::cudnnFusedOpsPlan_t, ops: cuda_types::cudnn8::cudnnFusedOps_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnDestroyFusedOpsPlan( plan: cuda_types::cudnn8::cudnnFusedOpsPlan_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnMakeFusedOpsPlan( handle: cuda_types::cudnn8::cudnnHandle_t, plan: cuda_types::cudnn8::cudnnFusedOpsPlan_t, constPack: cuda_types::cudnn8::cudnnFusedOpsConstParamPack_t, workspaceSizeInBytes: *mut usize, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnFusedOpsExecute( handle: cuda_types::cudnn8::cudnnHandle_t, plan: cuda_types::cudnn8::cudnnFusedOpsPlan_t, varPack: cuda_types::cudnn8::cudnnFusedOpsVariantParamPack_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnCnnTrainVersionCheck() -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnBackendCreateDescriptor( descriptorType: cuda_types::cudnn8::cudnnBackendDescriptorType_t, descriptor: *mut cuda_types::cudnn8::cudnnBackendDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnBackendDestroyDescriptor( descriptor: cuda_types::cudnn8::cudnnBackendDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnBackendInitialize( descriptor: cuda_types::cudnn8::cudnnBackendDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnBackendFinalize( descriptor: cuda_types::cudnn8::cudnnBackendDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnBackendSetAttribute( descriptor: cuda_types::cudnn8::cudnnBackendDescriptor_t, attributeName: cuda_types::cudnn8::cudnnBackendAttributeName_t, attributeType: cuda_types::cudnn8::cudnnBackendAttributeType_t, elementCount: i64, arrayOfElements: *const ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnBackendGetAttribute( descriptor: cuda_types::cudnn8::cudnnBackendDescriptor_t, attributeName: cuda_types::cudnn8::cudnnBackendAttributeName_t, attributeType: cuda_types::cudnn8::cudnnBackendAttributeType_t, requestedElementCount: i64, elementCount: *mut i64, arrayOfElements: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn8::cudnnStatus_t; #[must_use] fn cudnnBackendExecute( handle: cuda_types::cudnn8::cudnnHandle_t, executionPlan: cuda_types::cudnn8::cudnnBackendDescriptor_t, variantPack: cuda_types::cudnn8::cudnnBackendDescriptor_t, ) -> cuda_types::cudnn8::cudnnStatus_t; } ================================================ FILE: cuda_macros/src/cudnn9.rs ================================================ // Generated automatically by zluda_bindgen // DO NOT EDIT MANUALLY #![allow(warnings)] extern "system" { fn cudnnGetVersion() -> usize; fn cudnnGetMaxDeviceVersion() -> usize; fn cudnnGetCudartVersion() -> usize; fn cudnnGetErrorString( status: cuda_types::cudnn9::cudnnStatus_t, ) -> *const ::core::ffi::c_char; fn cudnnGetLastErrorString(message: *mut ::core::ffi::c_char, max_size: usize) -> (); #[must_use] fn cudnnQueryRuntimeError( handle: cuda_types::cudnn9::cudnnHandle_t, rstatus: *mut cuda_types::cudnn9::cudnnStatus_t, mode: cuda_types::cudnn9::cudnnErrQueryMode_t, tag: *mut cuda_types::cudnn9::cudnnRuntimeTag_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetProperty( type_: cuda_types::cudnn9::libraryPropertyType, value: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnCreate( handle: *mut cuda_types::cudnn9::cudnnHandle_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnDestroy( handle: cuda_types::cudnn9::cudnnHandle_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSetStream( handle: cuda_types::cudnn9::cudnnHandle_t, streamId: cuda_types::cudnn9::cudaStream_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetStream( handle: cuda_types::cudnn9::cudnnHandle_t, streamId: *mut cuda_types::cudnn9::cudaStream_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSetCallback( mask: ::core::ffi::c_uint, udata: *mut ::core::ffi::c_void, fptr: cuda_types::cudnn9::cudnnCallback_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetCallback( mask: *mut ::core::ffi::c_uint, udata: *mut *mut ::core::ffi::c_void, fptr: *mut cuda_types::cudnn9::cudnnCallback_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGraphVersionCheck() -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnBackendCreateDescriptor( descriptorType: cuda_types::cudnn9::cudnnBackendDescriptorType_t, descriptor: *mut cuda_types::cudnn9::cudnnBackendDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnBackendDestroyDescriptor( descriptor: cuda_types::cudnn9::cudnnBackendDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnBackendInitialize( descriptor: cuda_types::cudnn9::cudnnBackendDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnBackendFinalize( descriptor: cuda_types::cudnn9::cudnnBackendDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnBackendSetAttribute( descriptor: cuda_types::cudnn9::cudnnBackendDescriptor_t, attributeName: cuda_types::cudnn9::cudnnBackendAttributeName_t, attributeType: cuda_types::cudnn9::cudnnBackendAttributeType_t, elementCount: i64, arrayOfElements: *const ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnBackendGetAttribute( descriptor: cuda_types::cudnn9::cudnnBackendDescriptor_t, attributeName: cuda_types::cudnn9::cudnnBackendAttributeName_t, attributeType: cuda_types::cudnn9::cudnnBackendAttributeType_t, requestedElementCount: i64, elementCount: *mut i64, arrayOfElements: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnBackendExecute( handle: cuda_types::cudnn9::cudnnHandle_t, executionPlan: cuda_types::cudnn9::cudnnBackendDescriptor_t, variantPack: cuda_types::cudnn9::cudnnBackendDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnBackendPopulateCudaGraph( handle: cuda_types::cudnn9::cudnnHandle_t, executionPlan: cuda_types::cudnn9::cudnnBackendDescriptor_t, variantPack: cuda_types::cudnn9::cudnnBackendDescriptor_t, graph: cuda_types::cudnn9::cudaGraph_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnBackendUpdateCudaGraph( handle: cuda_types::cudnn9::cudnnHandle_t, executionPlan: cuda_types::cudnn9::cudnnBackendDescriptor_t, variantPack: cuda_types::cudnn9::cudnnBackendDescriptor_t, graph: cuda_types::cudnn9::cudaGraph_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnCreateTensorDescriptor( tensorDesc: *mut cuda_types::cudnn9::cudnnTensorDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSetTensor4dDescriptor( tensorDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, format: cuda_types::cudnn9::cudnnTensorFormat_t, dataType: cuda_types::cudnn9::cudnnDataType_t, n: ::core::ffi::c_int, c: ::core::ffi::c_int, h: ::core::ffi::c_int, w: ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSetTensor4dDescriptorEx( tensorDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dataType: cuda_types::cudnn9::cudnnDataType_t, n: ::core::ffi::c_int, c: ::core::ffi::c_int, h: ::core::ffi::c_int, w: ::core::ffi::c_int, nStride: ::core::ffi::c_int, cStride: ::core::ffi::c_int, hStride: ::core::ffi::c_int, wStride: ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetTensor4dDescriptor( tensorDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dataType: *mut cuda_types::cudnn9::cudnnDataType_t, n: *mut ::core::ffi::c_int, c: *mut ::core::ffi::c_int, h: *mut ::core::ffi::c_int, w: *mut ::core::ffi::c_int, nStride: *mut ::core::ffi::c_int, cStride: *mut ::core::ffi::c_int, hStride: *mut ::core::ffi::c_int, wStride: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSetTensorNdDescriptor( tensorDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dataType: cuda_types::cudnn9::cudnnDataType_t, nbDims: ::core::ffi::c_int, dimA: *const ::core::ffi::c_int, strideA: *const ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSetTensorNdDescriptorEx( tensorDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, format: cuda_types::cudnn9::cudnnTensorFormat_t, dataType: cuda_types::cudnn9::cudnnDataType_t, nbDims: ::core::ffi::c_int, dimA: *const ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetTensorNdDescriptor( tensorDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, nbDimsRequested: ::core::ffi::c_int, dataType: *mut cuda_types::cudnn9::cudnnDataType_t, nbDims: *mut ::core::ffi::c_int, dimA: *mut ::core::ffi::c_int, strideA: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetTensorSizeInBytes( tensorDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, size: *mut usize, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnDestroyTensorDescriptor( tensorDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] /// Create a destination descriptor for cudnnTransformTensor fn cudnnInitTransformDest( transformDesc: cuda_types::cudnn9::cudnnTensorTransformDescriptor_t, srcDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, destDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, destSizeInBytes: *mut usize, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] /// Create an empty tensor transform descriptor fn cudnnCreateTensorTransformDescriptor( transformDesc: *mut cuda_types::cudnn9::cudnnTensorTransformDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] /// Initialize a previously created tensor transform descriptor. fn cudnnSetTensorTransformDescriptor( transformDesc: cuda_types::cudnn9::cudnnTensorTransformDescriptor_t, nbDims: u32, destFormat: cuda_types::cudnn9::cudnnTensorFormat_t, padBeforeA: *const i32, padAfterA: *const i32, foldA: *const u32, direction: cuda_types::cudnn9::cudnnFoldingDirection_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] /** Retrieves the values stored in a previously initialized tensor transform descriptor.*/ fn cudnnGetTensorTransformDescriptor( transformDesc: cuda_types::cudnn9::cudnnTensorTransformDescriptor_t, nbDimsRequested: u32, destFormat: *mut cuda_types::cudnn9::cudnnTensorFormat_t, padBeforeA: *mut i32, padAfterA: *mut i32, foldA: *mut u32, direction: *mut cuda_types::cudnn9::cudnnFoldingDirection_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] /// Destroys a previously created tensor transform descriptor. fn cudnnDestroyTensorTransformDescriptor( transformDesc: cuda_types::cudnn9::cudnnTensorTransformDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnTransformTensor( handle: cuda_types::cudnn9::cudnnHandle_t, alpha: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnTransformTensorEx( handle: cuda_types::cudnn9::cudnnHandle_t, transDesc: cuda_types::cudnn9::cudnnTensorTransformDescriptor_t, alpha: *const ::core::ffi::c_void, srcDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, srcData: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, destDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, destData: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnAddTensor( handle: cuda_types::cudnn9::cudnnHandle_t, alpha: *const ::core::ffi::c_void, aDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, A: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, cDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, C: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnCreateOpTensorDescriptor( opTensorDesc: *mut cuda_types::cudnn9::cudnnOpTensorDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSetOpTensorDescriptor( opTensorDesc: cuda_types::cudnn9::cudnnOpTensorDescriptor_t, opTensorOp: cuda_types::cudnn9::cudnnOpTensorOp_t, opTensorCompType: cuda_types::cudnn9::cudnnDataType_t, opTensorNanOpt: cuda_types::cudnn9::cudnnNanPropagation_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetOpTensorDescriptor( opTensorDesc: cuda_types::cudnn9::cudnnOpTensorDescriptor_t, opTensorOp: *mut cuda_types::cudnn9::cudnnOpTensorOp_t, opTensorCompType: *mut cuda_types::cudnn9::cudnnDataType_t, opTensorNanOpt: *mut cuda_types::cudnn9::cudnnNanPropagation_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnDestroyOpTensorDescriptor( opTensorDesc: cuda_types::cudnn9::cudnnOpTensorDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnOpTensor( handle: cuda_types::cudnn9::cudnnHandle_t, opTensorDesc: cuda_types::cudnn9::cudnnOpTensorDescriptor_t, alpha1: *const ::core::ffi::c_void, aDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, A: *const ::core::ffi::c_void, alpha2: *const ::core::ffi::c_void, bDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, B: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, cDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, C: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnCreateReduceTensorDescriptor( reduceTensorDesc: *mut cuda_types::cudnn9::cudnnReduceTensorDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSetReduceTensorDescriptor( reduceTensorDesc: cuda_types::cudnn9::cudnnReduceTensorDescriptor_t, reduceTensorOp: cuda_types::cudnn9::cudnnReduceTensorOp_t, reduceTensorCompType: cuda_types::cudnn9::cudnnDataType_t, reduceTensorNanOpt: cuda_types::cudnn9::cudnnNanPropagation_t, reduceTensorIndices: cuda_types::cudnn9::cudnnReduceTensorIndices_t, reduceTensorIndicesType: cuda_types::cudnn9::cudnnIndicesType_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetReduceTensorDescriptor( reduceTensorDesc: cuda_types::cudnn9::cudnnReduceTensorDescriptor_t, reduceTensorOp: *mut cuda_types::cudnn9::cudnnReduceTensorOp_t, reduceTensorCompType: *mut cuda_types::cudnn9::cudnnDataType_t, reduceTensorNanOpt: *mut cuda_types::cudnn9::cudnnNanPropagation_t, reduceTensorIndices: *mut cuda_types::cudnn9::cudnnReduceTensorIndices_t, reduceTensorIndicesType: *mut cuda_types::cudnn9::cudnnIndicesType_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnDestroyReduceTensorDescriptor( reduceTensorDesc: cuda_types::cudnn9::cudnnReduceTensorDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetReductionIndicesSize( handle: cuda_types::cudnn9::cudnnHandle_t, reduceTensorDesc: cuda_types::cudnn9::cudnnReduceTensorDescriptor_t, aDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, cDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, sizeInBytes: *mut usize, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetReductionWorkspaceSize( handle: cuda_types::cudnn9::cudnnHandle_t, reduceTensorDesc: cuda_types::cudnn9::cudnnReduceTensorDescriptor_t, aDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, cDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, sizeInBytes: *mut usize, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnReduceTensor( handle: cuda_types::cudnn9::cudnnHandle_t, reduceTensorDesc: cuda_types::cudnn9::cudnnReduceTensorDescriptor_t, indices: *mut ::core::ffi::c_void, indicesSizeInBytes: usize, workspace: *mut ::core::ffi::c_void, workspaceSizeInBytes: usize, alpha: *const ::core::ffi::c_void, aDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, A: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, cDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, C: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSetTensor( handle: cuda_types::cudnn9::cudnnHandle_t, yDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, valuePtr: *const ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnScaleTensor( handle: cuda_types::cudnn9::cudnnHandle_t, yDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, alpha: *const ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnCreateFilterDescriptor( filterDesc: *mut cuda_types::cudnn9::cudnnFilterDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSetFilter4dDescriptor( filterDesc: cuda_types::cudnn9::cudnnFilterDescriptor_t, dataType: cuda_types::cudnn9::cudnnDataType_t, format: cuda_types::cudnn9::cudnnTensorFormat_t, k: ::core::ffi::c_int, c: ::core::ffi::c_int, h: ::core::ffi::c_int, w: ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetFilter4dDescriptor( filterDesc: cuda_types::cudnn9::cudnnFilterDescriptor_t, dataType: *mut cuda_types::cudnn9::cudnnDataType_t, format: *mut cuda_types::cudnn9::cudnnTensorFormat_t, k: *mut ::core::ffi::c_int, c: *mut ::core::ffi::c_int, h: *mut ::core::ffi::c_int, w: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSetFilterNdDescriptor( filterDesc: cuda_types::cudnn9::cudnnFilterDescriptor_t, dataType: cuda_types::cudnn9::cudnnDataType_t, format: cuda_types::cudnn9::cudnnTensorFormat_t, nbDims: ::core::ffi::c_int, filterDimA: *const ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetFilterNdDescriptor( filterDesc: cuda_types::cudnn9::cudnnFilterDescriptor_t, nbDimsRequested: ::core::ffi::c_int, dataType: *mut cuda_types::cudnn9::cudnnDataType_t, format: *mut cuda_types::cudnn9::cudnnTensorFormat_t, nbDims: *mut ::core::ffi::c_int, filterDimA: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetFilterSizeInBytes( filterDesc: cuda_types::cudnn9::cudnnFilterDescriptor_t, size: *mut usize, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnTransformFilter( handle: cuda_types::cudnn9::cudnnHandle_t, transDesc: cuda_types::cudnn9::cudnnTensorTransformDescriptor_t, alpha: *const ::core::ffi::c_void, srcDesc: cuda_types::cudnn9::cudnnFilterDescriptor_t, srcData: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, destDesc: cuda_types::cudnn9::cudnnFilterDescriptor_t, destData: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnDestroyFilterDescriptor( filterDesc: cuda_types::cudnn9::cudnnFilterDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSoftmaxForward( handle: cuda_types::cudnn9::cudnnHandle_t, algo: cuda_types::cudnn9::cudnnSoftmaxAlgorithm_t, mode: cuda_types::cudnn9::cudnnSoftmaxMode_t, alpha: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnCreatePoolingDescriptor( poolingDesc: *mut cuda_types::cudnn9::cudnnPoolingDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSetPooling2dDescriptor( poolingDesc: cuda_types::cudnn9::cudnnPoolingDescriptor_t, mode: cuda_types::cudnn9::cudnnPoolingMode_t, maxpoolingNanOpt: cuda_types::cudnn9::cudnnNanPropagation_t, windowHeight: ::core::ffi::c_int, windowWidth: ::core::ffi::c_int, verticalPadding: ::core::ffi::c_int, horizontalPadding: ::core::ffi::c_int, verticalStride: ::core::ffi::c_int, horizontalStride: ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetPooling2dDescriptor( poolingDesc: cuda_types::cudnn9::cudnnPoolingDescriptor_t, mode: *mut cuda_types::cudnn9::cudnnPoolingMode_t, maxpoolingNanOpt: *mut cuda_types::cudnn9::cudnnNanPropagation_t, windowHeight: *mut ::core::ffi::c_int, windowWidth: *mut ::core::ffi::c_int, verticalPadding: *mut ::core::ffi::c_int, horizontalPadding: *mut ::core::ffi::c_int, verticalStride: *mut ::core::ffi::c_int, horizontalStride: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSetPoolingNdDescriptor( poolingDesc: cuda_types::cudnn9::cudnnPoolingDescriptor_t, mode: cuda_types::cudnn9::cudnnPoolingMode_t, maxpoolingNanOpt: cuda_types::cudnn9::cudnnNanPropagation_t, nbDims: ::core::ffi::c_int, windowDimA: *const ::core::ffi::c_int, paddingA: *const ::core::ffi::c_int, strideA: *const ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetPoolingNdDescriptor( poolingDesc: cuda_types::cudnn9::cudnnPoolingDescriptor_t, nbDimsRequested: ::core::ffi::c_int, mode: *mut cuda_types::cudnn9::cudnnPoolingMode_t, maxpoolingNanOpt: *mut cuda_types::cudnn9::cudnnNanPropagation_t, nbDims: *mut ::core::ffi::c_int, windowDimA: *mut ::core::ffi::c_int, paddingA: *mut ::core::ffi::c_int, strideA: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetPoolingNdForwardOutputDim( poolingDesc: cuda_types::cudnn9::cudnnPoolingDescriptor_t, inputTensorDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, nbDims: ::core::ffi::c_int, outputTensorDimA: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetPooling2dForwardOutputDim( poolingDesc: cuda_types::cudnn9::cudnnPoolingDescriptor_t, inputTensorDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, n: *mut ::core::ffi::c_int, c: *mut ::core::ffi::c_int, h: *mut ::core::ffi::c_int, w: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnDestroyPoolingDescriptor( poolingDesc: cuda_types::cudnn9::cudnnPoolingDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnPoolingForward( handle: cuda_types::cudnn9::cudnnHandle_t, poolingDesc: cuda_types::cudnn9::cudnnPoolingDescriptor_t, alpha: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnCreateActivationDescriptor( activationDesc: *mut cuda_types::cudnn9::cudnnActivationDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSetActivationDescriptor( activationDesc: cuda_types::cudnn9::cudnnActivationDescriptor_t, mode: cuda_types::cudnn9::cudnnActivationMode_t, reluNanOpt: cuda_types::cudnn9::cudnnNanPropagation_t, coef: f64, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetActivationDescriptor( activationDesc: cuda_types::cudnn9::cudnnActivationDescriptor_t, mode: *mut cuda_types::cudnn9::cudnnActivationMode_t, reluNanOpt: *mut cuda_types::cudnn9::cudnnNanPropagation_t, coef: *mut f64, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSetActivationDescriptorSwishBeta( activationDesc: cuda_types::cudnn9::cudnnActivationDescriptor_t, swish_beta: f64, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetActivationDescriptorSwishBeta( activationDesc: cuda_types::cudnn9::cudnnActivationDescriptor_t, swish_beta: *mut f64, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnDestroyActivationDescriptor( activationDesc: cuda_types::cudnn9::cudnnActivationDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnActivationForward( handle: cuda_types::cudnn9::cudnnHandle_t, activationDesc: cuda_types::cudnn9::cudnnActivationDescriptor_t, alpha: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnCreateLRNDescriptor( normDesc: *mut cuda_types::cudnn9::cudnnLRNDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSetLRNDescriptor( normDesc: cuda_types::cudnn9::cudnnLRNDescriptor_t, lrnN: ::core::ffi::c_uint, lrnAlpha: f64, lrnBeta: f64, lrnK: f64, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetLRNDescriptor( normDesc: cuda_types::cudnn9::cudnnLRNDescriptor_t, lrnN: *mut ::core::ffi::c_uint, lrnAlpha: *mut f64, lrnBeta: *mut f64, lrnK: *mut f64, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnDestroyLRNDescriptor( lrnDesc: cuda_types::cudnn9::cudnnLRNDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnLRNCrossChannelForward( handle: cuda_types::cudnn9::cudnnHandle_t, normDesc: cuda_types::cudnn9::cudnnLRNDescriptor_t, lrnMode: cuda_types::cudnn9::cudnnLRNMode_t, alpha: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnDivisiveNormalizationForward( handle: cuda_types::cudnn9::cudnnHandle_t, normDesc: cuda_types::cudnn9::cudnnLRNDescriptor_t, mode: cuda_types::cudnn9::cudnnDivNormMode_t, alpha: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, means: *const ::core::ffi::c_void, temp: *mut ::core::ffi::c_void, temp2: *mut ::core::ffi::c_void, beta: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnDeriveBNTensorDescriptor( derivedBnDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, mode: cuda_types::cudnn9::cudnnBatchNormMode_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnBatchNormalizationForwardInference( handle: cuda_types::cudnn9::cudnnHandle_t, mode: cuda_types::cudnn9::cudnnBatchNormMode_t, alpha: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, bnScaleBiasMeanVarDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, bnScale: *const ::core::ffi::c_void, bnBias: *const ::core::ffi::c_void, estimatedMean: *const ::core::ffi::c_void, estimatedVariance: *const ::core::ffi::c_void, epsilon: f64, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnDeriveNormTensorDescriptor( derivedNormScaleBiasDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, derivedNormMeanVarDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, mode: cuda_types::cudnn9::cudnnNormMode_t, groupCnt: ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnNormalizationForwardInference( handle: cuda_types::cudnn9::cudnnHandle_t, mode: cuda_types::cudnn9::cudnnNormMode_t, normOps: cuda_types::cudnn9::cudnnNormOps_t, algo: cuda_types::cudnn9::cudnnNormAlgo_t, alpha: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, normScaleBiasDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, normScale: *const ::core::ffi::c_void, normBias: *const ::core::ffi::c_void, normMeanVarDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, estimatedMean: *const ::core::ffi::c_void, estimatedVariance: *const ::core::ffi::c_void, zDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, z: *const ::core::ffi::c_void, activationDesc: cuda_types::cudnn9::cudnnActivationDescriptor_t, yDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, epsilon: f64, groupCnt: ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnCreateSpatialTransformerDescriptor( stDesc: *mut cuda_types::cudnn9::cudnnSpatialTransformerDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSetSpatialTransformerNdDescriptor( stDesc: cuda_types::cudnn9::cudnnSpatialTransformerDescriptor_t, samplerType: cuda_types::cudnn9::cudnnSamplerType_t, dataType: cuda_types::cudnn9::cudnnDataType_t, nbDims: ::core::ffi::c_int, dimA: *const ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnDestroySpatialTransformerDescriptor( stDesc: cuda_types::cudnn9::cudnnSpatialTransformerDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSpatialTfGridGeneratorForward( handle: cuda_types::cudnn9::cudnnHandle_t, stDesc: cuda_types::cudnn9::cudnnSpatialTransformerDescriptor_t, theta: *const ::core::ffi::c_void, grid: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSpatialTfSamplerForward( handle: cuda_types::cudnn9::cudnnHandle_t, stDesc: cuda_types::cudnn9::cudnnSpatialTransformerDescriptor_t, alpha: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, grid: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnCreateDropoutDescriptor( dropoutDesc: *mut cuda_types::cudnn9::cudnnDropoutDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnDestroyDropoutDescriptor( dropoutDesc: cuda_types::cudnn9::cudnnDropoutDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnDropoutGetStatesSize( handle: cuda_types::cudnn9::cudnnHandle_t, sizeInBytes: *mut usize, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnDropoutGetReserveSpaceSize( xdesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, sizeInBytes: *mut usize, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSetDropoutDescriptor( dropoutDesc: cuda_types::cudnn9::cudnnDropoutDescriptor_t, handle: cuda_types::cudnn9::cudnnHandle_t, dropout: f32, states: *mut ::core::ffi::c_void, stateSizeInBytes: usize, seed: ::core::ffi::c_ulonglong, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnRestoreDropoutDescriptor( dropoutDesc: cuda_types::cudnn9::cudnnDropoutDescriptor_t, handle: cuda_types::cudnn9::cudnnHandle_t, dropout: f32, states: *mut ::core::ffi::c_void, stateSizeInBytes: usize, seed: ::core::ffi::c_ulonglong, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetDropoutDescriptor( dropoutDesc: cuda_types::cudnn9::cudnnDropoutDescriptor_t, handle: cuda_types::cudnn9::cudnnHandle_t, dropout: *mut f32, states: *mut *mut ::core::ffi::c_void, seed: *mut ::core::ffi::c_ulonglong, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnDropoutForward( handle: cuda_types::cudnn9::cudnnHandle_t, dropoutDesc: cuda_types::cudnn9::cudnnDropoutDescriptor_t, xdesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, ydesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, reserveSpace: *mut ::core::ffi::c_void, reserveSpaceSizeInBytes: usize, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnOpsVersionCheck() -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSoftmaxBackward( handle: cuda_types::cudnn9::cudnnHandle_t, algo: cuda_types::cudnn9::cudnnSoftmaxAlgorithm_t, mode: cuda_types::cudnn9::cudnnSoftmaxMode_t, alpha: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, y: *const ::core::ffi::c_void, dyDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dy: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, dxDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dx: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnPoolingBackward( handle: cuda_types::cudnn9::cudnnHandle_t, poolingDesc: cuda_types::cudnn9::cudnnPoolingDescriptor_t, alpha: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, y: *const ::core::ffi::c_void, dyDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dy: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, dxDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dx: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnActivationBackward( handle: cuda_types::cudnn9::cudnnHandle_t, activationDesc: cuda_types::cudnn9::cudnnActivationDescriptor_t, alpha: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, y: *const ::core::ffi::c_void, dyDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dy: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, dxDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dx: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnLRNCrossChannelBackward( handle: cuda_types::cudnn9::cudnnHandle_t, normDesc: cuda_types::cudnn9::cudnnLRNDescriptor_t, lrnMode: cuda_types::cudnn9::cudnnLRNMode_t, alpha: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, y: *const ::core::ffi::c_void, dyDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dy: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, dxDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dx: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnDivisiveNormalizationBackward( handle: cuda_types::cudnn9::cudnnHandle_t, normDesc: cuda_types::cudnn9::cudnnLRNDescriptor_t, mode: cuda_types::cudnn9::cudnnDivNormMode_t, alpha: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, means: *const ::core::ffi::c_void, dy: *const ::core::ffi::c_void, temp: *mut ::core::ffi::c_void, temp2: *mut ::core::ffi::c_void, beta: *const ::core::ffi::c_void, dXdMeansDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dx: *mut ::core::ffi::c_void, dMeans: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetBatchNormalizationForwardTrainingExWorkspaceSize( handle: cuda_types::cudnn9::cudnnHandle_t, mode: cuda_types::cudnn9::cudnnBatchNormMode_t, bnOps: cuda_types::cudnn9::cudnnBatchNormOps_t, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, zDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, yDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, bnScaleBiasMeanVarDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, activationDesc: cuda_types::cudnn9::cudnnActivationDescriptor_t, sizeInBytes: *mut usize, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetBatchNormalizationBackwardExWorkspaceSize( handle: cuda_types::cudnn9::cudnnHandle_t, mode: cuda_types::cudnn9::cudnnBatchNormMode_t, bnOps: cuda_types::cudnn9::cudnnBatchNormOps_t, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, yDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dyDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dzDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dxDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dBnScaleBiasDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, activationDesc: cuda_types::cudnn9::cudnnActivationDescriptor_t, sizeInBytes: *mut usize, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetBatchNormalizationTrainingExReserveSpaceSize( handle: cuda_types::cudnn9::cudnnHandle_t, mode: cuda_types::cudnn9::cudnnBatchNormMode_t, bnOps: cuda_types::cudnn9::cudnnBatchNormOps_t, activationDesc: cuda_types::cudnn9::cudnnActivationDescriptor_t, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, sizeInBytes: *mut usize, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnBatchNormalizationForwardTraining( handle: cuda_types::cudnn9::cudnnHandle_t, mode: cuda_types::cudnn9::cudnnBatchNormMode_t, alpha: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, bnScaleBiasMeanVarDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, bnScale: *const ::core::ffi::c_void, bnBias: *const ::core::ffi::c_void, exponentialAverageFactor: f64, resultRunningMean: *mut ::core::ffi::c_void, resultRunningVariance: *mut ::core::ffi::c_void, epsilon: f64, resultSaveMean: *mut ::core::ffi::c_void, resultSaveInvVariance: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnBatchNormalizationForwardTrainingEx( handle: cuda_types::cudnn9::cudnnHandle_t, mode: cuda_types::cudnn9::cudnnBatchNormMode_t, bnOps: cuda_types::cudnn9::cudnnBatchNormOps_t, alpha: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, xData: *const ::core::ffi::c_void, zDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, zData: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, yData: *mut ::core::ffi::c_void, bnScaleBiasMeanVarDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, bnScale: *const ::core::ffi::c_void, bnBias: *const ::core::ffi::c_void, exponentialAverageFactor: f64, resultRunningMean: *mut ::core::ffi::c_void, resultRunningVariance: *mut ::core::ffi::c_void, epsilon: f64, resultSaveMean: *mut ::core::ffi::c_void, resultSaveInvVariance: *mut ::core::ffi::c_void, activationDesc: cuda_types::cudnn9::cudnnActivationDescriptor_t, workspace: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, reserveSpace: *mut ::core::ffi::c_void, reserveSpaceSizeInBytes: usize, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnBatchNormalizationBackward( handle: cuda_types::cudnn9::cudnnHandle_t, mode: cuda_types::cudnn9::cudnnBatchNormMode_t, alphaDataDiff: *const ::core::ffi::c_void, betaDataDiff: *const ::core::ffi::c_void, alphaParamDiff: *const ::core::ffi::c_void, betaParamDiff: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, dyDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dy: *const ::core::ffi::c_void, dxDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dx: *mut ::core::ffi::c_void, dBnScaleBiasDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, bnScale: *const ::core::ffi::c_void, dBnScaleResult: *mut ::core::ffi::c_void, dBnBiasResult: *mut ::core::ffi::c_void, epsilon: f64, savedMean: *const ::core::ffi::c_void, savedInvVariance: *const ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnBatchNormalizationBackwardEx( handle: cuda_types::cudnn9::cudnnHandle_t, mode: cuda_types::cudnn9::cudnnBatchNormMode_t, bnOps: cuda_types::cudnn9::cudnnBatchNormOps_t, alphaDataDiff: *const ::core::ffi::c_void, betaDataDiff: *const ::core::ffi::c_void, alphaParamDiff: *const ::core::ffi::c_void, betaParamDiff: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, xData: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, yData: *const ::core::ffi::c_void, dyDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dyData: *const ::core::ffi::c_void, dzDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dzData: *mut ::core::ffi::c_void, dxDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dxData: *mut ::core::ffi::c_void, dBnScaleBiasDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, bnScaleData: *const ::core::ffi::c_void, bnBiasData: *const ::core::ffi::c_void, dBnScaleData: *mut ::core::ffi::c_void, dBnBiasData: *mut ::core::ffi::c_void, epsilon: f64, savedMean: *const ::core::ffi::c_void, savedInvVariance: *const ::core::ffi::c_void, activationDesc: cuda_types::cudnn9::cudnnActivationDescriptor_t, workSpace: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, reserveSpace: *mut ::core::ffi::c_void, reserveSpaceSizeInBytes: usize, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetNormalizationForwardTrainingWorkspaceSize( handle: cuda_types::cudnn9::cudnnHandle_t, mode: cuda_types::cudnn9::cudnnNormMode_t, normOps: cuda_types::cudnn9::cudnnNormOps_t, algo: cuda_types::cudnn9::cudnnNormAlgo_t, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, zDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, yDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, normScaleBiasDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, activationDesc: cuda_types::cudnn9::cudnnActivationDescriptor_t, normMeanVarDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, sizeInBytes: *mut usize, groupCnt: ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetNormalizationBackwardWorkspaceSize( handle: cuda_types::cudnn9::cudnnHandle_t, mode: cuda_types::cudnn9::cudnnNormMode_t, normOps: cuda_types::cudnn9::cudnnNormOps_t, algo: cuda_types::cudnn9::cudnnNormAlgo_t, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, yDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dyDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dzDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dxDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dNormScaleBiasDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, activationDesc: cuda_types::cudnn9::cudnnActivationDescriptor_t, normMeanVarDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, sizeInBytes: *mut usize, groupCnt: ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetNormalizationTrainingReserveSpaceSize( handle: cuda_types::cudnn9::cudnnHandle_t, mode: cuda_types::cudnn9::cudnnNormMode_t, normOps: cuda_types::cudnn9::cudnnNormOps_t, algo: cuda_types::cudnn9::cudnnNormAlgo_t, activationDesc: cuda_types::cudnn9::cudnnActivationDescriptor_t, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, sizeInBytes: *mut usize, groupCnt: ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnNormalizationForwardTraining( handle: cuda_types::cudnn9::cudnnHandle_t, mode: cuda_types::cudnn9::cudnnNormMode_t, normOps: cuda_types::cudnn9::cudnnNormOps_t, algo: cuda_types::cudnn9::cudnnNormAlgo_t, alpha: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, xData: *const ::core::ffi::c_void, normScaleBiasDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, normScale: *const ::core::ffi::c_void, normBias: *const ::core::ffi::c_void, exponentialAverageFactor: f64, normMeanVarDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, resultRunningMean: *mut ::core::ffi::c_void, resultRunningVariance: *mut ::core::ffi::c_void, epsilon: f64, resultSaveMean: *mut ::core::ffi::c_void, resultSaveInvVariance: *mut ::core::ffi::c_void, activationDesc: cuda_types::cudnn9::cudnnActivationDescriptor_t, zDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, zData: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, yData: *mut ::core::ffi::c_void, workspace: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, reserveSpace: *mut ::core::ffi::c_void, reserveSpaceSizeInBytes: usize, groupCnt: ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnNormalizationBackward( handle: cuda_types::cudnn9::cudnnHandle_t, mode: cuda_types::cudnn9::cudnnNormMode_t, normOps: cuda_types::cudnn9::cudnnNormOps_t, algo: cuda_types::cudnn9::cudnnNormAlgo_t, alphaDataDiff: *const ::core::ffi::c_void, betaDataDiff: *const ::core::ffi::c_void, alphaParamDiff: *const ::core::ffi::c_void, betaParamDiff: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, xData: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, yData: *const ::core::ffi::c_void, dyDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dyData: *const ::core::ffi::c_void, dzDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dzData: *mut ::core::ffi::c_void, dxDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dxData: *mut ::core::ffi::c_void, dNormScaleBiasDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, normScaleData: *const ::core::ffi::c_void, normBiasData: *const ::core::ffi::c_void, dNormScaleData: *mut ::core::ffi::c_void, dNormBiasData: *mut ::core::ffi::c_void, epsilon: f64, normMeanVarDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, savedMean: *const ::core::ffi::c_void, savedInvVariance: *const ::core::ffi::c_void, activationDesc: cuda_types::cudnn9::cudnnActivationDescriptor_t, workSpace: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, reserveSpace: *mut ::core::ffi::c_void, reserveSpaceSizeInBytes: usize, groupCnt: ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSpatialTfGridGeneratorBackward( handle: cuda_types::cudnn9::cudnnHandle_t, stDesc: cuda_types::cudnn9::cudnnSpatialTransformerDescriptor_t, dgrid: *const ::core::ffi::c_void, dtheta: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSpatialTfSamplerBackward( handle: cuda_types::cudnn9::cudnnHandle_t, stDesc: cuda_types::cudnn9::cudnnSpatialTransformerDescriptor_t, alpha: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, dxDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dx: *mut ::core::ffi::c_void, alphaDgrid: *const ::core::ffi::c_void, dyDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dy: *const ::core::ffi::c_void, grid: *const ::core::ffi::c_void, betaDgrid: *const ::core::ffi::c_void, dgrid: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnDropoutBackward( handle: cuda_types::cudnn9::cudnnHandle_t, dropoutDesc: cuda_types::cudnn9::cudnnDropoutDescriptor_t, dydesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dy: *const ::core::ffi::c_void, dxdesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dx: *mut ::core::ffi::c_void, reserveSpace: *mut ::core::ffi::c_void, reserveSpaceSizeInBytes: usize, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnCreateRNNDescriptor( rnnDesc: *mut cuda_types::cudnn9::cudnnRNNDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnDestroyRNNDescriptor( rnnDesc: cuda_types::cudnn9::cudnnRNNDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSetRNNDescriptor_v8( rnnDesc: cuda_types::cudnn9::cudnnRNNDescriptor_t, algo: cuda_types::cudnn9::cudnnRNNAlgo_t, cellMode: cuda_types::cudnn9::cudnnRNNMode_t, biasMode: cuda_types::cudnn9::cudnnRNNBiasMode_t, dirMode: cuda_types::cudnn9::cudnnDirectionMode_t, inputMode: cuda_types::cudnn9::cudnnRNNInputMode_t, dataType: cuda_types::cudnn9::cudnnDataType_t, mathPrec: cuda_types::cudnn9::cudnnDataType_t, mathType: cuda_types::cudnn9::cudnnMathType_t, inputSize: i32, hiddenSize: i32, projSize: i32, numLayers: i32, dropoutDesc: cuda_types::cudnn9::cudnnDropoutDescriptor_t, auxFlags: u32, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetRNNDescriptor_v8( rnnDesc: cuda_types::cudnn9::cudnnRNNDescriptor_t, algo: *mut cuda_types::cudnn9::cudnnRNNAlgo_t, cellMode: *mut cuda_types::cudnn9::cudnnRNNMode_t, biasMode: *mut cuda_types::cudnn9::cudnnRNNBiasMode_t, dirMode: *mut cuda_types::cudnn9::cudnnDirectionMode_t, inputMode: *mut cuda_types::cudnn9::cudnnRNNInputMode_t, dataType: *mut cuda_types::cudnn9::cudnnDataType_t, mathPrec: *mut cuda_types::cudnn9::cudnnDataType_t, mathType: *mut cuda_types::cudnn9::cudnnMathType_t, inputSize: *mut i32, hiddenSize: *mut i32, projSize: *mut i32, numLayers: *mut i32, dropoutDesc: *mut cuda_types::cudnn9::cudnnDropoutDescriptor_t, auxFlags: *mut u32, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnRNNSetClip_v8( rnnDesc: cuda_types::cudnn9::cudnnRNNDescriptor_t, clipMode: cuda_types::cudnn9::cudnnRNNClipMode_t, clipNanOpt: cuda_types::cudnn9::cudnnNanPropagation_t, lclip: f64, rclip: f64, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnRNNSetClip_v9( rnnDesc: cuda_types::cudnn9::cudnnRNNDescriptor_t, clipMode: cuda_types::cudnn9::cudnnRNNClipMode_t, lclip: f64, rclip: f64, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnRNNGetClip_v8( rnnDesc: cuda_types::cudnn9::cudnnRNNDescriptor_t, clipMode: *mut cuda_types::cudnn9::cudnnRNNClipMode_t, clipNanOpt: *mut cuda_types::cudnn9::cudnnNanPropagation_t, lclip: *mut f64, rclip: *mut f64, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnRNNGetClip_v9( rnnDesc: cuda_types::cudnn9::cudnnRNNDescriptor_t, clipMode: *mut cuda_types::cudnn9::cudnnRNNClipMode_t, lclip: *mut f64, rclip: *mut f64, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnBuildRNNDynamic( handle: cuda_types::cudnn9::cudnnHandle_t, rnnDesc: cuda_types::cudnn9::cudnnRNNDescriptor_t, miniBatch: ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetRNNTempSpaceSizes( handle: cuda_types::cudnn9::cudnnHandle_t, rnnDesc: cuda_types::cudnn9::cudnnRNNDescriptor_t, fwdMode: cuda_types::cudnn9::cudnnForwardMode_t, xDesc: cuda_types::cudnn9::cudnnRNNDataDescriptor_t, workSpaceSize: *mut usize, reserveSpaceSize: *mut usize, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetRNNWeightSpaceSize( handle: cuda_types::cudnn9::cudnnHandle_t, rnnDesc: cuda_types::cudnn9::cudnnRNNDescriptor_t, weightSpaceSize: *mut usize, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetRNNWeightParams( handle: cuda_types::cudnn9::cudnnHandle_t, rnnDesc: cuda_types::cudnn9::cudnnRNNDescriptor_t, pseudoLayer: i32, weightSpaceSize: usize, weightSpace: *const ::core::ffi::c_void, linLayerID: i32, mDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, mAddr: *mut *mut ::core::ffi::c_void, bDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, bAddr: *mut *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnCreateRNNDataDescriptor( rnnDataDesc: *mut cuda_types::cudnn9::cudnnRNNDataDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnDestroyRNNDataDescriptor( rnnDataDesc: cuda_types::cudnn9::cudnnRNNDataDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSetRNNDataDescriptor( rnnDataDesc: cuda_types::cudnn9::cudnnRNNDataDescriptor_t, dataType: cuda_types::cudnn9::cudnnDataType_t, layout: cuda_types::cudnn9::cudnnRNNDataLayout_t, maxSeqLength: ::core::ffi::c_int, batchSize: ::core::ffi::c_int, vectorSize: ::core::ffi::c_int, seqLengthArray: *const ::core::ffi::c_int, paddingFill: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetRNNDataDescriptor( rnnDataDesc: cuda_types::cudnn9::cudnnRNNDataDescriptor_t, dataType: *mut cuda_types::cudnn9::cudnnDataType_t, layout: *mut cuda_types::cudnn9::cudnnRNNDataLayout_t, maxSeqLength: *mut ::core::ffi::c_int, batchSize: *mut ::core::ffi::c_int, vectorSize: *mut ::core::ffi::c_int, arrayLengthRequested: ::core::ffi::c_int, seqLengthArray: *mut ::core::ffi::c_int, paddingFill: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnRNNForward( handle: cuda_types::cudnn9::cudnnHandle_t, rnnDesc: cuda_types::cudnn9::cudnnRNNDescriptor_t, fwdMode: cuda_types::cudnn9::cudnnForwardMode_t, devSeqLengths: *const i32, xDesc: cuda_types::cudnn9::cudnnRNNDataDescriptor_t, x: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn9::cudnnRNNDataDescriptor_t, y: *mut ::core::ffi::c_void, hDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, hx: *const ::core::ffi::c_void, hy: *mut ::core::ffi::c_void, cDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, cx: *const ::core::ffi::c_void, cy: *mut ::core::ffi::c_void, weightSpaceSize: usize, weightSpace: *const ::core::ffi::c_void, workSpaceSize: usize, workSpace: *mut ::core::ffi::c_void, reserveSpaceSize: usize, reserveSpace: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnCreateSeqDataDescriptor( seqDataDesc: *mut cuda_types::cudnn9::cudnnSeqDataDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnDestroySeqDataDescriptor( seqDataDesc: cuda_types::cudnn9::cudnnSeqDataDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSetSeqDataDescriptor( seqDataDesc: cuda_types::cudnn9::cudnnSeqDataDescriptor_t, dataType: cuda_types::cudnn9::cudnnDataType_t, nbDims: ::core::ffi::c_int, dimA: *const ::core::ffi::c_int, axes: *const cuda_types::cudnn9::cudnnSeqDataAxis_t, seqLengthArraySize: usize, seqLengthArray: *const ::core::ffi::c_int, paddingFill: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetSeqDataDescriptor( seqDataDesc: cuda_types::cudnn9::cudnnSeqDataDescriptor_t, dataType: *mut cuda_types::cudnn9::cudnnDataType_t, nbDims: *mut ::core::ffi::c_int, nbDimsRequested: ::core::ffi::c_int, dimA: *mut ::core::ffi::c_int, axes: *mut cuda_types::cudnn9::cudnnSeqDataAxis_t, seqLengthArraySize: *mut usize, seqLengthSizeRequested: usize, seqLengthArray: *mut ::core::ffi::c_int, paddingFill: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnCreateAttnDescriptor( attnDesc: *mut cuda_types::cudnn9::cudnnAttnDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnDestroyAttnDescriptor( attnDesc: cuda_types::cudnn9::cudnnAttnDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSetAttnDescriptor( attnDesc: cuda_types::cudnn9::cudnnAttnDescriptor_t, attnMode: ::core::ffi::c_uint, nHeads: ::core::ffi::c_int, smScaler: f64, dataType: cuda_types::cudnn9::cudnnDataType_t, computePrec: cuda_types::cudnn9::cudnnDataType_t, mathType: cuda_types::cudnn9::cudnnMathType_t, attnDropoutDesc: cuda_types::cudnn9::cudnnDropoutDescriptor_t, postDropoutDesc: cuda_types::cudnn9::cudnnDropoutDescriptor_t, qSize: ::core::ffi::c_int, kSize: ::core::ffi::c_int, vSize: ::core::ffi::c_int, qProjSize: ::core::ffi::c_int, kProjSize: ::core::ffi::c_int, vProjSize: ::core::ffi::c_int, oProjSize: ::core::ffi::c_int, qoMaxSeqLength: ::core::ffi::c_int, kvMaxSeqLength: ::core::ffi::c_int, maxBatchSize: ::core::ffi::c_int, maxBeamSize: ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetAttnDescriptor( attnDesc: cuda_types::cudnn9::cudnnAttnDescriptor_t, attnMode: *mut ::core::ffi::c_uint, nHeads: *mut ::core::ffi::c_int, smScaler: *mut f64, dataType: *mut cuda_types::cudnn9::cudnnDataType_t, computePrec: *mut cuda_types::cudnn9::cudnnDataType_t, mathType: *mut cuda_types::cudnn9::cudnnMathType_t, attnDropoutDesc: *mut cuda_types::cudnn9::cudnnDropoutDescriptor_t, postDropoutDesc: *mut cuda_types::cudnn9::cudnnDropoutDescriptor_t, qSize: *mut ::core::ffi::c_int, kSize: *mut ::core::ffi::c_int, vSize: *mut ::core::ffi::c_int, qProjSize: *mut ::core::ffi::c_int, kProjSize: *mut ::core::ffi::c_int, vProjSize: *mut ::core::ffi::c_int, oProjSize: *mut ::core::ffi::c_int, qoMaxSeqLength: *mut ::core::ffi::c_int, kvMaxSeqLength: *mut ::core::ffi::c_int, maxBatchSize: *mut ::core::ffi::c_int, maxBeamSize: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetMultiHeadAttnBuffers( handle: cuda_types::cudnn9::cudnnHandle_t, attnDesc: cuda_types::cudnn9::cudnnAttnDescriptor_t, weightSizeInBytes: *mut usize, workSpaceSizeInBytes: *mut usize, reserveSpaceSizeInBytes: *mut usize, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetMultiHeadAttnWeights( handle: cuda_types::cudnn9::cudnnHandle_t, attnDesc: cuda_types::cudnn9::cudnnAttnDescriptor_t, wKind: cuda_types::cudnn9::cudnnMultiHeadAttnWeightKind_t, weightSizeInBytes: usize, weights: *const ::core::ffi::c_void, wDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, wAddr: *mut *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnMultiHeadAttnForward( handle: cuda_types::cudnn9::cudnnHandle_t, attnDesc: cuda_types::cudnn9::cudnnAttnDescriptor_t, currIdx: ::core::ffi::c_int, loWinIdx: *const ::core::ffi::c_int, hiWinIdx: *const ::core::ffi::c_int, devSeqLengthsQO: *const ::core::ffi::c_int, devSeqLengthsKV: *const ::core::ffi::c_int, qDesc: cuda_types::cudnn9::cudnnSeqDataDescriptor_t, queries: *const ::core::ffi::c_void, residuals: *const ::core::ffi::c_void, kDesc: cuda_types::cudnn9::cudnnSeqDataDescriptor_t, keys: *const ::core::ffi::c_void, vDesc: cuda_types::cudnn9::cudnnSeqDataDescriptor_t, values: *const ::core::ffi::c_void, oDesc: cuda_types::cudnn9::cudnnSeqDataDescriptor_t, out: *mut ::core::ffi::c_void, weightSizeInBytes: usize, weights: *const ::core::ffi::c_void, workSpaceSizeInBytes: usize, workSpace: *mut ::core::ffi::c_void, reserveSpaceSizeInBytes: usize, reserveSpace: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnAdvVersionCheck() -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnRNNBackwardData_v8( handle: cuda_types::cudnn9::cudnnHandle_t, rnnDesc: cuda_types::cudnn9::cudnnRNNDescriptor_t, devSeqLengths: *const i32, yDesc: cuda_types::cudnn9::cudnnRNNDataDescriptor_t, y: *const ::core::ffi::c_void, dy: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn9::cudnnRNNDataDescriptor_t, dx: *mut ::core::ffi::c_void, hDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, hx: *const ::core::ffi::c_void, dhy: *const ::core::ffi::c_void, dhx: *mut ::core::ffi::c_void, cDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, cx: *const ::core::ffi::c_void, dcy: *const ::core::ffi::c_void, dcx: *mut ::core::ffi::c_void, weightSpaceSize: usize, weightSpace: *const ::core::ffi::c_void, workSpaceSize: usize, workSpace: *mut ::core::ffi::c_void, reserveSpaceSize: usize, reserveSpace: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnRNNBackwardWeights_v8( handle: cuda_types::cudnn9::cudnnHandle_t, rnnDesc: cuda_types::cudnn9::cudnnRNNDescriptor_t, addGrad: cuda_types::cudnn9::cudnnWgradMode_t, devSeqLengths: *const i32, xDesc: cuda_types::cudnn9::cudnnRNNDataDescriptor_t, x: *const ::core::ffi::c_void, hDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, hx: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn9::cudnnRNNDataDescriptor_t, y: *const ::core::ffi::c_void, weightSpaceSize: usize, dweightSpace: *mut ::core::ffi::c_void, workSpaceSize: usize, workSpace: *mut ::core::ffi::c_void, reserveSpaceSize: usize, reserveSpace: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnMultiHeadAttnBackwardData( handle: cuda_types::cudnn9::cudnnHandle_t, attnDesc: cuda_types::cudnn9::cudnnAttnDescriptor_t, loWinIdx: *const ::core::ffi::c_int, hiWinIdx: *const ::core::ffi::c_int, devSeqLengthsDQDO: *const ::core::ffi::c_int, devSeqLengthsDKDV: *const ::core::ffi::c_int, doDesc: cuda_types::cudnn9::cudnnSeqDataDescriptor_t, dout: *const ::core::ffi::c_void, dqDesc: cuda_types::cudnn9::cudnnSeqDataDescriptor_t, dqueries: *mut ::core::ffi::c_void, queries: *const ::core::ffi::c_void, dkDesc: cuda_types::cudnn9::cudnnSeqDataDescriptor_t, dkeys: *mut ::core::ffi::c_void, keys: *const ::core::ffi::c_void, dvDesc: cuda_types::cudnn9::cudnnSeqDataDescriptor_t, dvalues: *mut ::core::ffi::c_void, values: *const ::core::ffi::c_void, weightSizeInBytes: usize, weights: *const ::core::ffi::c_void, workSpaceSizeInBytes: usize, workSpace: *mut ::core::ffi::c_void, reserveSpaceSizeInBytes: usize, reserveSpace: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnMultiHeadAttnBackwardWeights( handle: cuda_types::cudnn9::cudnnHandle_t, attnDesc: cuda_types::cudnn9::cudnnAttnDescriptor_t, addGrad: cuda_types::cudnn9::cudnnWgradMode_t, qDesc: cuda_types::cudnn9::cudnnSeqDataDescriptor_t, queries: *const ::core::ffi::c_void, kDesc: cuda_types::cudnn9::cudnnSeqDataDescriptor_t, keys: *const ::core::ffi::c_void, vDesc: cuda_types::cudnn9::cudnnSeqDataDescriptor_t, values: *const ::core::ffi::c_void, doDesc: cuda_types::cudnn9::cudnnSeqDataDescriptor_t, dout: *const ::core::ffi::c_void, weightSizeInBytes: usize, weights: *const ::core::ffi::c_void, dweights: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, workSpace: *mut ::core::ffi::c_void, reserveSpaceSizeInBytes: usize, reserveSpace: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnCreateCTCLossDescriptor( ctcLossDesc: *mut cuda_types::cudnn9::cudnnCTCLossDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSetCTCLossDescriptor( ctcLossDesc: cuda_types::cudnn9::cudnnCTCLossDescriptor_t, compType: cuda_types::cudnn9::cudnnDataType_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSetCTCLossDescriptorEx( ctcLossDesc: cuda_types::cudnn9::cudnnCTCLossDescriptor_t, compType: cuda_types::cudnn9::cudnnDataType_t, normMode: cuda_types::cudnn9::cudnnLossNormalizationMode_t, gradMode: cuda_types::cudnn9::cudnnNanPropagation_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSetCTCLossDescriptor_v8( ctcLossDesc: cuda_types::cudnn9::cudnnCTCLossDescriptor_t, compType: cuda_types::cudnn9::cudnnDataType_t, normMode: cuda_types::cudnn9::cudnnLossNormalizationMode_t, gradMode: cuda_types::cudnn9::cudnnNanPropagation_t, maxLabelLength: ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSetCTCLossDescriptor_v9( ctcLossDesc: cuda_types::cudnn9::cudnnCTCLossDescriptor_t, compType: cuda_types::cudnn9::cudnnDataType_t, normMode: cuda_types::cudnn9::cudnnLossNormalizationMode_t, ctcGradMode: cuda_types::cudnn9::cudnnCTCGradMode_t, maxLabelLength: ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetCTCLossDescriptor( ctcLossDesc: cuda_types::cudnn9::cudnnCTCLossDescriptor_t, compType: *mut cuda_types::cudnn9::cudnnDataType_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetCTCLossDescriptorEx( ctcLossDesc: cuda_types::cudnn9::cudnnCTCLossDescriptor_t, compType: *mut cuda_types::cudnn9::cudnnDataType_t, normMode: *mut cuda_types::cudnn9::cudnnLossNormalizationMode_t, gradMode: *mut cuda_types::cudnn9::cudnnNanPropagation_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetCTCLossDescriptor_v8( ctcLossDesc: cuda_types::cudnn9::cudnnCTCLossDescriptor_t, compType: *mut cuda_types::cudnn9::cudnnDataType_t, normMode: *mut cuda_types::cudnn9::cudnnLossNormalizationMode_t, gradMode: *mut cuda_types::cudnn9::cudnnNanPropagation_t, maxLabelLength: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetCTCLossDescriptor_v9( ctcLossDesc: cuda_types::cudnn9::cudnnCTCLossDescriptor_t, compType: *mut cuda_types::cudnn9::cudnnDataType_t, normMode: *mut cuda_types::cudnn9::cudnnLossNormalizationMode_t, ctcGradMode: *mut cuda_types::cudnn9::cudnnCTCGradMode_t, maxLabelLength: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnDestroyCTCLossDescriptor( ctcLossDesc: cuda_types::cudnn9::cudnnCTCLossDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnCTCLoss( handle: cuda_types::cudnn9::cudnnHandle_t, probsDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, probs: *const ::core::ffi::c_void, hostLabels: *const ::core::ffi::c_int, hostLabelLengths: *const ::core::ffi::c_int, hostInputLengths: *const ::core::ffi::c_int, costs: *mut ::core::ffi::c_void, gradientsDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, gradients: *mut ::core::ffi::c_void, algo: cuda_types::cudnn9::cudnnCTCLossAlgo_t, ctcLossDesc: cuda_types::cudnn9::cudnnCTCLossDescriptor_t, workspace: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnCTCLoss_v8( handle: cuda_types::cudnn9::cudnnHandle_t, algo: cuda_types::cudnn9::cudnnCTCLossAlgo_t, ctcLossDesc: cuda_types::cudnn9::cudnnCTCLossDescriptor_t, probsDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, probs: *const ::core::ffi::c_void, labels: *const ::core::ffi::c_int, labelLengths: *const ::core::ffi::c_int, inputLengths: *const ::core::ffi::c_int, costs: *mut ::core::ffi::c_void, gradientsDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, gradients: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, workspace: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetCTCLossWorkspaceSize( handle: cuda_types::cudnn9::cudnnHandle_t, probsDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, gradientsDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, labels: *const ::core::ffi::c_int, labelLengths: *const ::core::ffi::c_int, inputLengths: *const ::core::ffi::c_int, algo: cuda_types::cudnn9::cudnnCTCLossAlgo_t, ctcLossDesc: cuda_types::cudnn9::cudnnCTCLossDescriptor_t, sizeInBytes: *mut usize, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetCTCLossWorkspaceSize_v8( handle: cuda_types::cudnn9::cudnnHandle_t, algo: cuda_types::cudnn9::cudnnCTCLossAlgo_t, ctcLossDesc: cuda_types::cudnn9::cudnnCTCLossDescriptor_t, probsDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, gradientsDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, sizeInBytes: *mut usize, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnCreateConvolutionDescriptor( convDesc: *mut cuda_types::cudnn9::cudnnConvolutionDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnDestroyConvolutionDescriptor( convDesc: cuda_types::cudnn9::cudnnConvolutionDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSetConvolutionMathType( convDesc: cuda_types::cudnn9::cudnnConvolutionDescriptor_t, mathType: cuda_types::cudnn9::cudnnMathType_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetConvolutionMathType( convDesc: cuda_types::cudnn9::cudnnConvolutionDescriptor_t, mathType: *mut cuda_types::cudnn9::cudnnMathType_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSetConvolutionGroupCount( convDesc: cuda_types::cudnn9::cudnnConvolutionDescriptor_t, groupCount: ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetConvolutionGroupCount( convDesc: cuda_types::cudnn9::cudnnConvolutionDescriptor_t, groupCount: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSetConvolutionReorderType( convDesc: cuda_types::cudnn9::cudnnConvolutionDescriptor_t, reorderType: cuda_types::cudnn9::cudnnReorderType_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetConvolutionReorderType( convDesc: cuda_types::cudnn9::cudnnConvolutionDescriptor_t, reorderType: *mut cuda_types::cudnn9::cudnnReorderType_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSetConvolution2dDescriptor( convDesc: cuda_types::cudnn9::cudnnConvolutionDescriptor_t, pad_h: ::core::ffi::c_int, pad_w: ::core::ffi::c_int, u: ::core::ffi::c_int, v: ::core::ffi::c_int, dilation_h: ::core::ffi::c_int, dilation_w: ::core::ffi::c_int, mode: cuda_types::cudnn9::cudnnConvolutionMode_t, computeType: cuda_types::cudnn9::cudnnDataType_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetConvolution2dDescriptor( convDesc: cuda_types::cudnn9::cudnnConvolutionDescriptor_t, pad_h: *mut ::core::ffi::c_int, pad_w: *mut ::core::ffi::c_int, u: *mut ::core::ffi::c_int, v: *mut ::core::ffi::c_int, dilation_h: *mut ::core::ffi::c_int, dilation_w: *mut ::core::ffi::c_int, mode: *mut cuda_types::cudnn9::cudnnConvolutionMode_t, computeType: *mut cuda_types::cudnn9::cudnnDataType_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSetConvolutionNdDescriptor( convDesc: cuda_types::cudnn9::cudnnConvolutionDescriptor_t, arrayLength: ::core::ffi::c_int, padA: *const ::core::ffi::c_int, filterStrideA: *const ::core::ffi::c_int, dilationA: *const ::core::ffi::c_int, mode: cuda_types::cudnn9::cudnnConvolutionMode_t, computeType: cuda_types::cudnn9::cudnnDataType_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetConvolutionNdDescriptor( convDesc: cuda_types::cudnn9::cudnnConvolutionDescriptor_t, arrayLengthRequested: ::core::ffi::c_int, arrayLength: *mut ::core::ffi::c_int, padA: *mut ::core::ffi::c_int, strideA: *mut ::core::ffi::c_int, dilationA: *mut ::core::ffi::c_int, mode: *mut cuda_types::cudnn9::cudnnConvolutionMode_t, computeType: *mut cuda_types::cudnn9::cudnnDataType_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetConvolution2dForwardOutputDim( convDesc: cuda_types::cudnn9::cudnnConvolutionDescriptor_t, inputTensorDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, filterDesc: cuda_types::cudnn9::cudnnFilterDescriptor_t, n: *mut ::core::ffi::c_int, c: *mut ::core::ffi::c_int, h: *mut ::core::ffi::c_int, w: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetConvolutionNdForwardOutputDim( convDesc: cuda_types::cudnn9::cudnnConvolutionDescriptor_t, inputTensorDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, filterDesc: cuda_types::cudnn9::cudnnFilterDescriptor_t, nbDims: ::core::ffi::c_int, tensorOuputDimA: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetConvolutionForwardAlgorithmMaxCount( handle: cuda_types::cudnn9::cudnnHandle_t, count: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetConvolutionForwardAlgorithm_v7( handle: cuda_types::cudnn9::cudnnHandle_t, srcDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, filterDesc: cuda_types::cudnn9::cudnnFilterDescriptor_t, convDesc: cuda_types::cudnn9::cudnnConvolutionDescriptor_t, destDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, requestedAlgoCount: ::core::ffi::c_int, returnedAlgoCount: *mut ::core::ffi::c_int, perfResults: *mut cuda_types::cudnn9::cudnnConvolutionFwdAlgoPerf_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnFindConvolutionForwardAlgorithm( handle: cuda_types::cudnn9::cudnnHandle_t, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, wDesc: cuda_types::cudnn9::cudnnFilterDescriptor_t, convDesc: cuda_types::cudnn9::cudnnConvolutionDescriptor_t, yDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, requestedAlgoCount: ::core::ffi::c_int, returnedAlgoCount: *mut ::core::ffi::c_int, perfResults: *mut cuda_types::cudnn9::cudnnConvolutionFwdAlgoPerf_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnFindConvolutionForwardAlgorithmEx( handle: cuda_types::cudnn9::cudnnHandle_t, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, wDesc: cuda_types::cudnn9::cudnnFilterDescriptor_t, w: *const ::core::ffi::c_void, convDesc: cuda_types::cudnn9::cudnnConvolutionDescriptor_t, yDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, requestedAlgoCount: ::core::ffi::c_int, returnedAlgoCount: *mut ::core::ffi::c_int, perfResults: *mut cuda_types::cudnn9::cudnnConvolutionFwdAlgoPerf_t, workSpace: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnIm2Col( handle: cuda_types::cudnn9::cudnnHandle_t, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, wDesc: cuda_types::cudnn9::cudnnFilterDescriptor_t, convDesc: cuda_types::cudnn9::cudnnConvolutionDescriptor_t, colBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnReorderFilterAndBias( handle: cuda_types::cudnn9::cudnnHandle_t, filterDesc: cuda_types::cudnn9::cudnnFilterDescriptor_t, reorderType: cuda_types::cudnn9::cudnnReorderType_t, filterData: *const ::core::ffi::c_void, reorderedFilterData: *mut ::core::ffi::c_void, reorderBias: ::core::ffi::c_int, biasData: *const ::core::ffi::c_void, reorderedBiasData: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetConvolutionForwardWorkspaceSize( handle: cuda_types::cudnn9::cudnnHandle_t, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, wDesc: cuda_types::cudnn9::cudnnFilterDescriptor_t, convDesc: cuda_types::cudnn9::cudnnConvolutionDescriptor_t, yDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, algo: cuda_types::cudnn9::cudnnConvolutionFwdAlgo_t, sizeInBytes: *mut usize, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnConvolutionForward( handle: cuda_types::cudnn9::cudnnHandle_t, alpha: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, wDesc: cuda_types::cudnn9::cudnnFilterDescriptor_t, w: *const ::core::ffi::c_void, convDesc: cuda_types::cudnn9::cudnnConvolutionDescriptor_t, algo: cuda_types::cudnn9::cudnnConvolutionFwdAlgo_t, workSpace: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, beta: *const ::core::ffi::c_void, yDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnConvolutionBiasActivationForward( handle: cuda_types::cudnn9::cudnnHandle_t, alpha1: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, wDesc: cuda_types::cudnn9::cudnnFilterDescriptor_t, w: *const ::core::ffi::c_void, convDesc: cuda_types::cudnn9::cudnnConvolutionDescriptor_t, algo: cuda_types::cudnn9::cudnnConvolutionFwdAlgo_t, workSpace: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, alpha2: *const ::core::ffi::c_void, zDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, z: *const ::core::ffi::c_void, biasDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, bias: *const ::core::ffi::c_void, activationDesc: cuda_types::cudnn9::cudnnActivationDescriptor_t, yDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, y: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetConvolutionBackwardDataAlgorithmMaxCount( handle: cuda_types::cudnn9::cudnnHandle_t, count: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnFindConvolutionBackwardDataAlgorithm( handle: cuda_types::cudnn9::cudnnHandle_t, wDesc: cuda_types::cudnn9::cudnnFilterDescriptor_t, dyDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, convDesc: cuda_types::cudnn9::cudnnConvolutionDescriptor_t, dxDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, requestedAlgoCount: ::core::ffi::c_int, returnedAlgoCount: *mut ::core::ffi::c_int, perfResults: *mut cuda_types::cudnn9::cudnnConvolutionBwdDataAlgoPerf_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnFindConvolutionBackwardDataAlgorithmEx( handle: cuda_types::cudnn9::cudnnHandle_t, wDesc: cuda_types::cudnn9::cudnnFilterDescriptor_t, w: *const ::core::ffi::c_void, dyDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dy: *const ::core::ffi::c_void, convDesc: cuda_types::cudnn9::cudnnConvolutionDescriptor_t, dxDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dx: *mut ::core::ffi::c_void, requestedAlgoCount: ::core::ffi::c_int, returnedAlgoCount: *mut ::core::ffi::c_int, perfResults: *mut cuda_types::cudnn9::cudnnConvolutionBwdDataAlgoPerf_t, workSpace: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetConvolutionBackwardDataAlgorithm_v7( handle: cuda_types::cudnn9::cudnnHandle_t, filterDesc: cuda_types::cudnn9::cudnnFilterDescriptor_t, diffDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, convDesc: cuda_types::cudnn9::cudnnConvolutionDescriptor_t, gradDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, requestedAlgoCount: ::core::ffi::c_int, returnedAlgoCount: *mut ::core::ffi::c_int, perfResults: *mut cuda_types::cudnn9::cudnnConvolutionBwdDataAlgoPerf_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetConvolutionBackwardDataWorkspaceSize( handle: cuda_types::cudnn9::cudnnHandle_t, wDesc: cuda_types::cudnn9::cudnnFilterDescriptor_t, dyDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, convDesc: cuda_types::cudnn9::cudnnConvolutionDescriptor_t, dxDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, algo: cuda_types::cudnn9::cudnnConvolutionBwdDataAlgo_t, sizeInBytes: *mut usize, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnConvolutionBackwardData( handle: cuda_types::cudnn9::cudnnHandle_t, alpha: *const ::core::ffi::c_void, wDesc: cuda_types::cudnn9::cudnnFilterDescriptor_t, w: *const ::core::ffi::c_void, dyDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dy: *const ::core::ffi::c_void, convDesc: cuda_types::cudnn9::cudnnConvolutionDescriptor_t, algo: cuda_types::cudnn9::cudnnConvolutionBwdDataAlgo_t, workSpace: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, beta: *const ::core::ffi::c_void, dxDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dx: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetFoldedConvBackwardDataDescriptors( handle: cuda_types::cudnn9::cudnnHandle_t, filterDesc: cuda_types::cudnn9::cudnnFilterDescriptor_t, diffDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, convDesc: cuda_types::cudnn9::cudnnConvolutionDescriptor_t, gradDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, transformFormat: cuda_types::cudnn9::cudnnTensorFormat_t, foldedFilterDesc: cuda_types::cudnn9::cudnnFilterDescriptor_t, paddedDiffDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, foldedConvDesc: cuda_types::cudnn9::cudnnConvolutionDescriptor_t, foldedGradDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, filterFoldTransDesc: cuda_types::cudnn9::cudnnTensorTransformDescriptor_t, diffPadTransDesc: cuda_types::cudnn9::cudnnTensorTransformDescriptor_t, gradFoldTransDesc: cuda_types::cudnn9::cudnnTensorTransformDescriptor_t, gradUnfoldTransDesc: cuda_types::cudnn9::cudnnTensorTransformDescriptor_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnCnnVersionCheck() -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetConvolutionBackwardFilterAlgorithmMaxCount( handle: cuda_types::cudnn9::cudnnHandle_t, count: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnFindConvolutionBackwardFilterAlgorithm( handle: cuda_types::cudnn9::cudnnHandle_t, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dyDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, convDesc: cuda_types::cudnn9::cudnnConvolutionDescriptor_t, dwDesc: cuda_types::cudnn9::cudnnFilterDescriptor_t, requestedAlgoCount: ::core::ffi::c_int, returnedAlgoCount: *mut ::core::ffi::c_int, perfResults: *mut cuda_types::cudnn9::cudnnConvolutionBwdFilterAlgoPerf_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnFindConvolutionBackwardFilterAlgorithmEx( handle: cuda_types::cudnn9::cudnnHandle_t, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, dyDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, y: *const ::core::ffi::c_void, convDesc: cuda_types::cudnn9::cudnnConvolutionDescriptor_t, dwDesc: cuda_types::cudnn9::cudnnFilterDescriptor_t, dw: *mut ::core::ffi::c_void, requestedAlgoCount: ::core::ffi::c_int, returnedAlgoCount: *mut ::core::ffi::c_int, perfResults: *mut cuda_types::cudnn9::cudnnConvolutionBwdFilterAlgoPerf_t, workSpace: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetConvolutionBackwardFilterAlgorithm_v7( handle: cuda_types::cudnn9::cudnnHandle_t, srcDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, diffDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, convDesc: cuda_types::cudnn9::cudnnConvolutionDescriptor_t, gradDesc: cuda_types::cudnn9::cudnnFilterDescriptor_t, requestedAlgoCount: ::core::ffi::c_int, returnedAlgoCount: *mut ::core::ffi::c_int, perfResults: *mut cuda_types::cudnn9::cudnnConvolutionBwdFilterAlgoPerf_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetConvolutionBackwardFilterWorkspaceSize( handle: cuda_types::cudnn9::cudnnHandle_t, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dyDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, convDesc: cuda_types::cudnn9::cudnnConvolutionDescriptor_t, gradDesc: cuda_types::cudnn9::cudnnFilterDescriptor_t, algo: cuda_types::cudnn9::cudnnConvolutionBwdFilterAlgo_t, sizeInBytes: *mut usize, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnConvolutionBackwardFilter( handle: cuda_types::cudnn9::cudnnHandle_t, alpha: *const ::core::ffi::c_void, xDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, x: *const ::core::ffi::c_void, dyDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dy: *const ::core::ffi::c_void, convDesc: cuda_types::cudnn9::cudnnConvolutionDescriptor_t, algo: cuda_types::cudnn9::cudnnConvolutionBwdFilterAlgo_t, workSpace: *mut ::core::ffi::c_void, workSpaceSizeInBytes: usize, beta: *const ::core::ffi::c_void, dwDesc: cuda_types::cudnn9::cudnnFilterDescriptor_t, dw: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnConvolutionBackwardBias( handle: cuda_types::cudnn9::cudnnHandle_t, alpha: *const ::core::ffi::c_void, dyDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, dy: *const ::core::ffi::c_void, beta: *const ::core::ffi::c_void, dbDesc: cuda_types::cudnn9::cudnnTensorDescriptor_t, db: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnCreateFusedOpsConstParamPack( constPack: *mut cuda_types::cudnn9::cudnnFusedOpsConstParamPack_t, ops: cuda_types::cudnn9::cudnnFusedOps_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnDestroyFusedOpsConstParamPack( constPack: cuda_types::cudnn9::cudnnFusedOpsConstParamPack_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSetFusedOpsConstParamPackAttribute( constPack: cuda_types::cudnn9::cudnnFusedOpsConstParamPack_t, paramLabel: cuda_types::cudnn9::cudnnFusedOpsConstParamLabel_t, param: *const ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetFusedOpsConstParamPackAttribute( constPack: cuda_types::cudnn9::cudnnFusedOpsConstParamPack_t, paramLabel: cuda_types::cudnn9::cudnnFusedOpsConstParamLabel_t, param: *mut ::core::ffi::c_void, isNULL: *mut ::core::ffi::c_int, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnCreateFusedOpsVariantParamPack( varPack: *mut cuda_types::cudnn9::cudnnFusedOpsVariantParamPack_t, ops: cuda_types::cudnn9::cudnnFusedOps_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnDestroyFusedOpsVariantParamPack( varPack: cuda_types::cudnn9::cudnnFusedOpsVariantParamPack_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnSetFusedOpsVariantParamPackAttribute( varPack: cuda_types::cudnn9::cudnnFusedOpsVariantParamPack_t, paramLabel: cuda_types::cudnn9::cudnnFusedOpsVariantParamLabel_t, ptr: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnGetFusedOpsVariantParamPackAttribute( varPack: cuda_types::cudnn9::cudnnFusedOpsVariantParamPack_t, paramLabel: cuda_types::cudnn9::cudnnFusedOpsVariantParamLabel_t, ptr: *mut ::core::ffi::c_void, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnCreateFusedOpsPlan( plan: *mut cuda_types::cudnn9::cudnnFusedOpsPlan_t, ops: cuda_types::cudnn9::cudnnFusedOps_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnDestroyFusedOpsPlan( plan: cuda_types::cudnn9::cudnnFusedOpsPlan_t, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnMakeFusedOpsPlan( handle: cuda_types::cudnn9::cudnnHandle_t, plan: cuda_types::cudnn9::cudnnFusedOpsPlan_t, constPack: cuda_types::cudnn9::cudnnFusedOpsConstParamPack_t, workspaceSizeInBytes: *mut usize, ) -> cuda_types::cudnn9::cudnnStatus_t; #[must_use] fn cudnnFusedOpsExecute( handle: cuda_types::cudnn9::cudnnHandle_t, plan: cuda_types::cudnn9::cudnnFusedOpsPlan_t, varPack: cuda_types::cudnn9::cudnnFusedOpsVariantParamPack_t, ) -> cuda_types::cudnn9::cudnnStatus_t; } ================================================ FILE: cuda_macros/src/cufft.rs ================================================ // Generated automatically by zluda_bindgen // DO NOT EDIT MANUALLY #![allow(warnings)] extern "system" { fn cufftPlan1d( plan: *mut cuda_types::cufft::cufftHandle, nx: ::core::ffi::c_int, type_: cuda_types::cufft::cufftType, batch: ::core::ffi::c_int, ) -> cuda_types::cufft::cufftResult; fn cufftPlan2d( plan: *mut cuda_types::cufft::cufftHandle, nx: ::core::ffi::c_int, ny: ::core::ffi::c_int, type_: cuda_types::cufft::cufftType, ) -> cuda_types::cufft::cufftResult; fn cufftPlan3d( plan: *mut cuda_types::cufft::cufftHandle, nx: ::core::ffi::c_int, ny: ::core::ffi::c_int, nz: ::core::ffi::c_int, type_: cuda_types::cufft::cufftType, ) -> cuda_types::cufft::cufftResult; fn cufftPlanMany( plan: *mut cuda_types::cufft::cufftHandle, rank: ::core::ffi::c_int, n: *mut ::core::ffi::c_int, inembed: *mut ::core::ffi::c_int, istride: ::core::ffi::c_int, idist: ::core::ffi::c_int, onembed: *mut ::core::ffi::c_int, ostride: ::core::ffi::c_int, odist: ::core::ffi::c_int, type_: cuda_types::cufft::cufftType, batch: ::core::ffi::c_int, ) -> cuda_types::cufft::cufftResult; fn cufftMakePlan1d( plan: cuda_types::cufft::cufftHandle, nx: ::core::ffi::c_int, type_: cuda_types::cufft::cufftType, batch: ::core::ffi::c_int, workSize: *mut usize, ) -> cuda_types::cufft::cufftResult; fn cufftMakePlan2d( plan: cuda_types::cufft::cufftHandle, nx: ::core::ffi::c_int, ny: ::core::ffi::c_int, type_: cuda_types::cufft::cufftType, workSize: *mut usize, ) -> cuda_types::cufft::cufftResult; fn cufftMakePlan3d( plan: cuda_types::cufft::cufftHandle, nx: ::core::ffi::c_int, ny: ::core::ffi::c_int, nz: ::core::ffi::c_int, type_: cuda_types::cufft::cufftType, workSize: *mut usize, ) -> cuda_types::cufft::cufftResult; fn cufftMakePlanMany( plan: cuda_types::cufft::cufftHandle, rank: ::core::ffi::c_int, n: *mut ::core::ffi::c_int, inembed: *mut ::core::ffi::c_int, istride: ::core::ffi::c_int, idist: ::core::ffi::c_int, onembed: *mut ::core::ffi::c_int, ostride: ::core::ffi::c_int, odist: ::core::ffi::c_int, type_: cuda_types::cufft::cufftType, batch: ::core::ffi::c_int, workSize: *mut usize, ) -> cuda_types::cufft::cufftResult; fn cufftMakePlanMany64( plan: cuda_types::cufft::cufftHandle, rank: ::core::ffi::c_int, n: *mut ::core::ffi::c_longlong, inembed: *mut ::core::ffi::c_longlong, istride: ::core::ffi::c_longlong, idist: ::core::ffi::c_longlong, onembed: *mut ::core::ffi::c_longlong, ostride: ::core::ffi::c_longlong, odist: ::core::ffi::c_longlong, type_: cuda_types::cufft::cufftType, batch: ::core::ffi::c_longlong, workSize: *mut usize, ) -> cuda_types::cufft::cufftResult; fn cufftGetSizeMany64( plan: cuda_types::cufft::cufftHandle, rank: ::core::ffi::c_int, n: *mut ::core::ffi::c_longlong, inembed: *mut ::core::ffi::c_longlong, istride: ::core::ffi::c_longlong, idist: ::core::ffi::c_longlong, onembed: *mut ::core::ffi::c_longlong, ostride: ::core::ffi::c_longlong, odist: ::core::ffi::c_longlong, type_: cuda_types::cufft::cufftType, batch: ::core::ffi::c_longlong, workSize: *mut usize, ) -> cuda_types::cufft::cufftResult; fn cufftEstimate1d( nx: ::core::ffi::c_int, type_: cuda_types::cufft::cufftType, batch: ::core::ffi::c_int, workSize: *mut usize, ) -> cuda_types::cufft::cufftResult; fn cufftEstimate2d( nx: ::core::ffi::c_int, ny: ::core::ffi::c_int, type_: cuda_types::cufft::cufftType, workSize: *mut usize, ) -> cuda_types::cufft::cufftResult; fn cufftEstimate3d( nx: ::core::ffi::c_int, ny: ::core::ffi::c_int, nz: ::core::ffi::c_int, type_: cuda_types::cufft::cufftType, workSize: *mut usize, ) -> cuda_types::cufft::cufftResult; fn cufftEstimateMany( rank: ::core::ffi::c_int, n: *mut ::core::ffi::c_int, inembed: *mut ::core::ffi::c_int, istride: ::core::ffi::c_int, idist: ::core::ffi::c_int, onembed: *mut ::core::ffi::c_int, ostride: ::core::ffi::c_int, odist: ::core::ffi::c_int, type_: cuda_types::cufft::cufftType, batch: ::core::ffi::c_int, workSize: *mut usize, ) -> cuda_types::cufft::cufftResult; fn cufftCreate( handle: *mut cuda_types::cufft::cufftHandle, ) -> cuda_types::cufft::cufftResult; fn cufftGetSize1d( handle: cuda_types::cufft::cufftHandle, nx: ::core::ffi::c_int, type_: cuda_types::cufft::cufftType, batch: ::core::ffi::c_int, workSize: *mut usize, ) -> cuda_types::cufft::cufftResult; fn cufftGetSize2d( handle: cuda_types::cufft::cufftHandle, nx: ::core::ffi::c_int, ny: ::core::ffi::c_int, type_: cuda_types::cufft::cufftType, workSize: *mut usize, ) -> cuda_types::cufft::cufftResult; fn cufftGetSize3d( handle: cuda_types::cufft::cufftHandle, nx: ::core::ffi::c_int, ny: ::core::ffi::c_int, nz: ::core::ffi::c_int, type_: cuda_types::cufft::cufftType, workSize: *mut usize, ) -> cuda_types::cufft::cufftResult; fn cufftGetSizeMany( handle: cuda_types::cufft::cufftHandle, rank: ::core::ffi::c_int, n: *mut ::core::ffi::c_int, inembed: *mut ::core::ffi::c_int, istride: ::core::ffi::c_int, idist: ::core::ffi::c_int, onembed: *mut ::core::ffi::c_int, ostride: ::core::ffi::c_int, odist: ::core::ffi::c_int, type_: cuda_types::cufft::cufftType, batch: ::core::ffi::c_int, workArea: *mut usize, ) -> cuda_types::cufft::cufftResult; fn cufftGetSize( handle: cuda_types::cufft::cufftHandle, workSize: *mut usize, ) -> cuda_types::cufft::cufftResult; fn cufftSetWorkArea( plan: cuda_types::cufft::cufftHandle, workArea: *mut ::core::ffi::c_void, ) -> cuda_types::cufft::cufftResult; fn cufftSetAutoAllocation( plan: cuda_types::cufft::cufftHandle, autoAllocate: ::core::ffi::c_int, ) -> cuda_types::cufft::cufftResult; fn cufftExecC2C( plan: cuda_types::cufft::cufftHandle, idata: *mut cuda_types::cufft::cufftComplex, odata: *mut cuda_types::cufft::cufftComplex, direction: ::core::ffi::c_int, ) -> cuda_types::cufft::cufftResult; fn cufftExecR2C( plan: cuda_types::cufft::cufftHandle, idata: *mut cuda_types::cufft::cufftReal, odata: *mut cuda_types::cufft::cufftComplex, ) -> cuda_types::cufft::cufftResult; fn cufftExecC2R( plan: cuda_types::cufft::cufftHandle, idata: *mut cuda_types::cufft::cufftComplex, odata: *mut cuda_types::cufft::cufftReal, ) -> cuda_types::cufft::cufftResult; fn cufftExecZ2Z( plan: cuda_types::cufft::cufftHandle, idata: *mut cuda_types::cufft::cufftDoubleComplex, odata: *mut cuda_types::cufft::cufftDoubleComplex, direction: ::core::ffi::c_int, ) -> cuda_types::cufft::cufftResult; fn cufftExecD2Z( plan: cuda_types::cufft::cufftHandle, idata: *mut cuda_types::cufft::cufftDoubleReal, odata: *mut cuda_types::cufft::cufftDoubleComplex, ) -> cuda_types::cufft::cufftResult; fn cufftExecZ2D( plan: cuda_types::cufft::cufftHandle, idata: *mut cuda_types::cufft::cufftDoubleComplex, odata: *mut cuda_types::cufft::cufftDoubleReal, ) -> cuda_types::cufft::cufftResult; fn cufftSetStream( plan: cuda_types::cufft::cufftHandle, stream: cuda_types::cufft::cudaStream_t, ) -> cuda_types::cufft::cufftResult; fn cufftDestroy( plan: cuda_types::cufft::cufftHandle, ) -> cuda_types::cufft::cufftResult; fn cufftGetVersion( version: *mut ::core::ffi::c_int, ) -> cuda_types::cufft::cufftResult; fn cufftGetProperty( type_: cuda_types::cufft::libraryPropertyType, value: *mut ::core::ffi::c_int, ) -> cuda_types::cufft::cufftResult; fn cufftSetPlanPropertyInt64( plan: cuda_types::cufft::cufftHandle, property: cuda_types::cufft::cufftProperty, inputValueInt: ::core::ffi::c_longlong, ) -> cuda_types::cufft::cufftResult; fn cufftGetPlanPropertyInt64( plan: cuda_types::cufft::cufftHandle, property: cuda_types::cufft::cufftProperty, returnPtrValue: *mut ::core::ffi::c_longlong, ) -> cuda_types::cufft::cufftResult; fn cufftResetPlanProperty( plan: cuda_types::cufft::cufftHandle, property: cuda_types::cufft::cufftProperty, ) -> cuda_types::cufft::cufftResult; fn cufftXtSetGPUs( handle: cuda_types::cufft::cufftHandle, nGPUs: ::core::ffi::c_int, whichGPUs: *mut ::core::ffi::c_int, ) -> cuda_types::cufft::cufftResult; fn cufftXtMalloc( plan: cuda_types::cufft::cufftHandle, descriptor: *mut *mut cuda_types::cufft::cudaLibXtDesc, format: cuda_types::cufft::cufftXtSubFormat, ) -> cuda_types::cufft::cufftResult; fn cufftXtMemcpy( plan: cuda_types::cufft::cufftHandle, dstPointer: *mut ::core::ffi::c_void, srcPointer: *mut ::core::ffi::c_void, type_: cuda_types::cufft::cufftXtCopyType, ) -> cuda_types::cufft::cufftResult; fn cufftXtFree( descriptor: *mut cuda_types::cufft::cudaLibXtDesc, ) -> cuda_types::cufft::cufftResult; fn cufftXtSetWorkArea( plan: cuda_types::cufft::cufftHandle, workArea: *mut *mut ::core::ffi::c_void, ) -> cuda_types::cufft::cufftResult; fn cufftXtExecDescriptorC2C( plan: cuda_types::cufft::cufftHandle, input: *mut cuda_types::cufft::cudaLibXtDesc, output: *mut cuda_types::cufft::cudaLibXtDesc, direction: ::core::ffi::c_int, ) -> cuda_types::cufft::cufftResult; fn cufftXtExecDescriptorR2C( plan: cuda_types::cufft::cufftHandle, input: *mut cuda_types::cufft::cudaLibXtDesc, output: *mut cuda_types::cufft::cudaLibXtDesc, ) -> cuda_types::cufft::cufftResult; fn cufftXtExecDescriptorC2R( plan: cuda_types::cufft::cufftHandle, input: *mut cuda_types::cufft::cudaLibXtDesc, output: *mut cuda_types::cufft::cudaLibXtDesc, ) -> cuda_types::cufft::cufftResult; fn cufftXtExecDescriptorZ2Z( plan: cuda_types::cufft::cufftHandle, input: *mut cuda_types::cufft::cudaLibXtDesc, output: *mut cuda_types::cufft::cudaLibXtDesc, direction: ::core::ffi::c_int, ) -> cuda_types::cufft::cufftResult; fn cufftXtExecDescriptorD2Z( plan: cuda_types::cufft::cufftHandle, input: *mut cuda_types::cufft::cudaLibXtDesc, output: *mut cuda_types::cufft::cudaLibXtDesc, ) -> cuda_types::cufft::cufftResult; fn cufftXtExecDescriptorZ2D( plan: cuda_types::cufft::cufftHandle, input: *mut cuda_types::cufft::cudaLibXtDesc, output: *mut cuda_types::cufft::cudaLibXtDesc, ) -> cuda_types::cufft::cufftResult; fn cufftXtQueryPlan( plan: cuda_types::cufft::cufftHandle, queryStruct: *mut ::core::ffi::c_void, queryType: cuda_types::cufft::cufftXtQueryType, ) -> cuda_types::cufft::cufftResult; fn cufftXtSetCallback( plan: cuda_types::cufft::cufftHandle, callback_routine: *mut *mut ::core::ffi::c_void, cbType: cuda_types::cufft::cufftXtCallbackType, caller_info: *mut *mut ::core::ffi::c_void, ) -> cuda_types::cufft::cufftResult; fn cufftXtClearCallback( plan: cuda_types::cufft::cufftHandle, cbType: cuda_types::cufft::cufftXtCallbackType, ) -> cuda_types::cufft::cufftResult; fn cufftXtSetCallbackSharedSize( plan: cuda_types::cufft::cufftHandle, cbType: cuda_types::cufft::cufftXtCallbackType, sharedSize: usize, ) -> cuda_types::cufft::cufftResult; fn cufftXtSetJITCallback( plan: cuda_types::cufft::cufftHandle, lto_callback_symbol_name: *const ::core::ffi::c_char, lto_callback_fatbin: *const ::core::ffi::c_void, lto_callback_fatbin_size: usize, type_: cuda_types::cufft::cufftXtCallbackType, caller_info: *mut *mut ::core::ffi::c_void, ) -> cuda_types::cufft::cufftResult; fn cufftXtMakePlanMany( plan: cuda_types::cufft::cufftHandle, rank: ::core::ffi::c_int, n: *mut ::core::ffi::c_longlong, inembed: *mut ::core::ffi::c_longlong, istride: ::core::ffi::c_longlong, idist: ::core::ffi::c_longlong, inputtype: cuda_types::cufft::cudaDataType, onembed: *mut ::core::ffi::c_longlong, ostride: ::core::ffi::c_longlong, odist: ::core::ffi::c_longlong, outputtype: cuda_types::cufft::cudaDataType, batch: ::core::ffi::c_longlong, workSize: *mut usize, executiontype: cuda_types::cufft::cudaDataType, ) -> cuda_types::cufft::cufftResult; fn cufftXtGetSizeMany( plan: cuda_types::cufft::cufftHandle, rank: ::core::ffi::c_int, n: *mut ::core::ffi::c_longlong, inembed: *mut ::core::ffi::c_longlong, istride: ::core::ffi::c_longlong, idist: ::core::ffi::c_longlong, inputtype: cuda_types::cufft::cudaDataType, onembed: *mut ::core::ffi::c_longlong, ostride: ::core::ffi::c_longlong, odist: ::core::ffi::c_longlong, outputtype: cuda_types::cufft::cudaDataType, batch: ::core::ffi::c_longlong, workSize: *mut usize, executiontype: cuda_types::cufft::cudaDataType, ) -> cuda_types::cufft::cufftResult; fn cufftXtExec( plan: cuda_types::cufft::cufftHandle, input: *mut ::core::ffi::c_void, output: *mut ::core::ffi::c_void, direction: ::core::ffi::c_int, ) -> cuda_types::cufft::cufftResult; fn cufftXtExecDescriptor( plan: cuda_types::cufft::cufftHandle, input: *mut cuda_types::cufft::cudaLibXtDesc, output: *mut cuda_types::cufft::cudaLibXtDesc, direction: ::core::ffi::c_int, ) -> cuda_types::cufft::cufftResult; fn cufftXtSetWorkAreaPolicy( plan: cuda_types::cufft::cufftHandle, policy: cuda_types::cufft::cufftXtWorkAreaPolicy, workSize: *mut usize, ) -> cuda_types::cufft::cufftResult; fn cufftXtMakePlanGuru64( param_1: ::core::ffi::c_uint, param_2: ::core::ffi::c_int, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_int, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_uint, param_8: ::core::ffi::c_uint, param_9: ::core::ffi::c_ulonglong, param_10: ::core::ffi::c_uint, ) -> cuda_types::cufft::cufftResult; fn cufftMakePlanGuru64( param_1: ::core::ffi::c_uint, param_2: ::core::ffi::c_int, param_3: ::core::ffi::c_ulonglong, param_4: ::core::ffi::c_int, param_5: ::core::ffi::c_ulonglong, param_6: ::core::ffi::c_uint, param_7: ::core::ffi::c_ulonglong, ) -> cuda_types::cufft::cufftResult; fn cufftEnterCS() -> cuda_types::cufft::cufftResult; fn cufftLeaveCS() -> cuda_types::cufft::cufftResult; } ================================================ FILE: cuda_macros/src/cusparse.rs ================================================ // Generated automatically by zluda_bindgen // DO NOT EDIT MANUALLY #![allow(warnings)] extern "system" { #[must_use] fn cusparseCreate( handle: *mut cuda_types::cusparse::cusparseHandle_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDestroy( handle: cuda_types::cusparse::cusparseHandle_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseGetVersion( handle: cuda_types::cusparse::cusparseHandle_t, version: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseGetProperty( type_: cuda_types::cusparse::libraryPropertyType, value: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; fn cusparseGetErrorName( status: cuda_types::cusparse::cusparseStatus_t, ) -> *const ::core::ffi::c_char; fn cusparseGetErrorString( status: cuda_types::cusparse::cusparseStatus_t, ) -> *const ::core::ffi::c_char; #[must_use] fn cusparseSetStream( handle: cuda_types::cusparse::cusparseHandle_t, streamId: cuda_types::cusparse::cudaStream_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseGetStream( handle: cuda_types::cusparse::cusparseHandle_t, streamId: *mut cuda_types::cusparse::cudaStream_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseGetPointerMode( handle: cuda_types::cusparse::cusparseHandle_t, mode: *mut cuda_types::cusparse::cusparsePointerMode_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSetPointerMode( handle: cuda_types::cusparse::cusparseHandle_t, mode: cuda_types::cusparse::cusparsePointerMode_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseLoggerSetCallback( callback: cuda_types::cusparse::cusparseLoggerCallback_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseLoggerSetFile( file: *mut cuda_types::FILE, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseLoggerOpenFile( logFile: *const ::core::ffi::c_char, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseLoggerSetLevel( level: ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseLoggerSetMask( mask: ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseLoggerForceDisable() -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCreateMatDescr( descrA: *mut cuda_types::cusparse::cusparseMatDescr_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDestroyMatDescr( descrA: cuda_types::cusparse::cusparseMatDescr_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSetMatType( descrA: cuda_types::cusparse::cusparseMatDescr_t, type_: cuda_types::cusparse::cusparseMatrixType_t, ) -> cuda_types::cusparse::cusparseStatus_t; fn cusparseGetMatType( descrA: cuda_types::cusparse::cusparseMatDescr_t, ) -> cuda_types::cusparse::cusparseMatrixType_t; #[must_use] fn cusparseSetMatFillMode( descrA: cuda_types::cusparse::cusparseMatDescr_t, fillMode: cuda_types::cusparse::cusparseFillMode_t, ) -> cuda_types::cusparse::cusparseStatus_t; fn cusparseGetMatFillMode( descrA: cuda_types::cusparse::cusparseMatDescr_t, ) -> cuda_types::cusparse::cusparseFillMode_t; #[must_use] fn cusparseSetMatDiagType( descrA: cuda_types::cusparse::cusparseMatDescr_t, diagType: cuda_types::cusparse::cusparseDiagType_t, ) -> cuda_types::cusparse::cusparseStatus_t; fn cusparseGetMatDiagType( descrA: cuda_types::cusparse::cusparseMatDescr_t, ) -> cuda_types::cusparse::cusparseDiagType_t; #[must_use] fn cusparseSetMatIndexBase( descrA: cuda_types::cusparse::cusparseMatDescr_t, base: cuda_types::cusparse::cusparseIndexBase_t, ) -> cuda_types::cusparse::cusparseStatus_t; fn cusparseGetMatIndexBase( descrA: cuda_types::cusparse::cusparseMatDescr_t, ) -> cuda_types::cusparse::cusparseIndexBase_t; #[must_use] fn cusparseCreateCsric02Info( info: *mut cuda_types::cusparse::csric02Info_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDestroyCsric02Info( info: cuda_types::cusparse::csric02Info_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCreateBsric02Info( info: *mut cuda_types::cusparse::bsric02Info_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDestroyBsric02Info( info: cuda_types::cusparse::bsric02Info_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCreateCsrilu02Info( info: *mut cuda_types::cusparse::csrilu02Info_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDestroyCsrilu02Info( info: cuda_types::cusparse::csrilu02Info_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCreateBsrilu02Info( info: *mut cuda_types::cusparse::bsrilu02Info_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDestroyBsrilu02Info( info: cuda_types::cusparse::bsrilu02Info_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCreateBsrsv2Info( info: *mut cuda_types::cusparse::bsrsv2Info_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDestroyBsrsv2Info( info: cuda_types::cusparse::bsrsv2Info_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCreateBsrsm2Info( info: *mut cuda_types::cusparse::bsrsm2Info_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDestroyBsrsm2Info( info: cuda_types::cusparse::bsrsm2Info_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCreateCsru2csrInfo( info: *mut cuda_types::cusparse::csru2csrInfo_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDestroyCsru2csrInfo( info: cuda_types::cusparse::csru2csrInfo_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCreateColorInfo( info: *mut cuda_types::cusparse::cusparseColorInfo_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDestroyColorInfo( info: cuda_types::cusparse::cusparseColorInfo_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCreatePruneInfo( info: *mut cuda_types::cusparse::pruneInfo_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDestroyPruneInfo( info: cuda_types::cusparse::pruneInfo_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSgemvi( handle: cuda_types::cusparse::cusparseHandle_t, transA: cuda_types::cusparse::cusparseOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const f32, A: *const f32, lda: ::core::ffi::c_int, nnz: ::core::ffi::c_int, xVal: *const f32, xInd: *const ::core::ffi::c_int, beta: *const f32, y: *mut f32, idxBase: cuda_types::cusparse::cusparseIndexBase_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSgemvi_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, transA: cuda_types::cusparse::cusparseOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnz: ::core::ffi::c_int, pBufferSize: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDgemvi( handle: cuda_types::cusparse::cusparseHandle_t, transA: cuda_types::cusparse::cusparseOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const f64, A: *const f64, lda: ::core::ffi::c_int, nnz: ::core::ffi::c_int, xVal: *const f64, xInd: *const ::core::ffi::c_int, beta: *const f64, y: *mut f64, idxBase: cuda_types::cusparse::cusparseIndexBase_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDgemvi_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, transA: cuda_types::cusparse::cusparseOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnz: ::core::ffi::c_int, pBufferSize: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCgemvi( handle: cuda_types::cusparse::cusparseHandle_t, transA: cuda_types::cusparse::cusparseOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const cuda_types::cusparse::cuComplex, A: *const cuda_types::cusparse::cuComplex, lda: ::core::ffi::c_int, nnz: ::core::ffi::c_int, xVal: *const cuda_types::cusparse::cuComplex, xInd: *const ::core::ffi::c_int, beta: *const cuda_types::cusparse::cuComplex, y: *mut cuda_types::cusparse::cuComplex, idxBase: cuda_types::cusparse::cusparseIndexBase_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCgemvi_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, transA: cuda_types::cusparse::cusparseOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnz: ::core::ffi::c_int, pBufferSize: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZgemvi( handle: cuda_types::cusparse::cusparseHandle_t, transA: cuda_types::cusparse::cusparseOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const cuda_types::cusparse::cuDoubleComplex, A: *const cuda_types::cusparse::cuDoubleComplex, lda: ::core::ffi::c_int, nnz: ::core::ffi::c_int, xVal: *const cuda_types::cusparse::cuDoubleComplex, xInd: *const ::core::ffi::c_int, beta: *const cuda_types::cusparse::cuDoubleComplex, y: *mut cuda_types::cusparse::cuDoubleComplex, idxBase: cuda_types::cusparse::cusparseIndexBase_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZgemvi_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, transA: cuda_types::cusparse::cusparseOperation_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnz: ::core::ffi::c_int, pBufferSize: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSbsrmv( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, alpha: *const f32, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const f32, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, x: *const f32, beta: *const f32, y: *mut f32, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDbsrmv( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, alpha: *const f64, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const f64, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, x: *const f64, beta: *const f64, y: *mut f64, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCbsrmv( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, alpha: *const cuda_types::cusparse::cuComplex, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const cuda_types::cusparse::cuComplex, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, x: *const cuda_types::cusparse::cuComplex, beta: *const cuda_types::cusparse::cuComplex, y: *mut cuda_types::cusparse::cuComplex, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZbsrmv( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, alpha: *const cuda_types::cusparse::cuDoubleComplex, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const cuda_types::cusparse::cuDoubleComplex, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, x: *const cuda_types::cusparse::cuDoubleComplex, beta: *const cuda_types::cusparse::cuDoubleComplex, y: *mut cuda_types::cusparse::cuDoubleComplex, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSbsrxmv( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, sizeOfMask: ::core::ffi::c_int, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, alpha: *const f32, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const f32, bsrSortedMaskPtrA: *const ::core::ffi::c_int, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedEndPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, x: *const f32, beta: *const f32, y: *mut f32, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDbsrxmv( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, sizeOfMask: ::core::ffi::c_int, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, alpha: *const f64, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const f64, bsrSortedMaskPtrA: *const ::core::ffi::c_int, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedEndPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, x: *const f64, beta: *const f64, y: *mut f64, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCbsrxmv( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, sizeOfMask: ::core::ffi::c_int, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, alpha: *const cuda_types::cusparse::cuComplex, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const cuda_types::cusparse::cuComplex, bsrSortedMaskPtrA: *const ::core::ffi::c_int, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedEndPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, x: *const cuda_types::cusparse::cuComplex, beta: *const cuda_types::cusparse::cuComplex, y: *mut cuda_types::cusparse::cuComplex, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZbsrxmv( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, sizeOfMask: ::core::ffi::c_int, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, alpha: *const cuda_types::cusparse::cuDoubleComplex, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const cuda_types::cusparse::cuDoubleComplex, bsrSortedMaskPtrA: *const ::core::ffi::c_int, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedEndPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, x: *const cuda_types::cusparse::cuDoubleComplex, beta: *const cuda_types::cusparse::cuDoubleComplex, y: *mut cuda_types::cusparse::cuDoubleComplex, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseXbsrsv2_zeroPivot( handle: cuda_types::cusparse::cusparseHandle_t, info: cuda_types::cusparse::bsrsv2Info_t, position: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSbsrsv2_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *mut f32, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsrsv2Info_t, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDbsrsv2_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *mut f64, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsrsv2Info_t, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCbsrsv2_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *mut cuda_types::cusparse::cuComplex, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsrsv2Info_t, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZbsrsv2_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *mut cuda_types::cusparse::cuDoubleComplex, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsrsv2Info_t, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSbsrsv2_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *mut f32, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, blockSize: ::core::ffi::c_int, info: cuda_types::cusparse::bsrsv2Info_t, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDbsrsv2_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *mut f64, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, blockSize: ::core::ffi::c_int, info: cuda_types::cusparse::bsrsv2Info_t, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCbsrsv2_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *mut cuda_types::cusparse::cuComplex, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, blockSize: ::core::ffi::c_int, info: cuda_types::cusparse::bsrsv2Info_t, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZbsrsv2_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *mut cuda_types::cusparse::cuDoubleComplex, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, blockSize: ::core::ffi::c_int, info: cuda_types::cusparse::bsrsv2Info_t, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSbsrsv2_analysis( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const f32, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsrsv2Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDbsrsv2_analysis( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const f64, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsrsv2Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCbsrsv2_analysis( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const cuda_types::cusparse::cuComplex, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsrsv2Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZbsrsv2_analysis( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const cuda_types::cusparse::cuDoubleComplex, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsrsv2Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSbsrsv2_solve( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, alpha: *const f32, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const f32, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsrsv2Info_t, f: *const f32, x: *mut f32, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDbsrsv2_solve( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, alpha: *const f64, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const f64, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsrsv2Info_t, f: *const f64, x: *mut f64, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCbsrsv2_solve( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, alpha: *const cuda_types::cusparse::cuComplex, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const cuda_types::cusparse::cuComplex, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsrsv2Info_t, f: *const cuda_types::cusparse::cuComplex, x: *mut cuda_types::cusparse::cuComplex, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZbsrsv2_solve( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, alpha: *const cuda_types::cusparse::cuDoubleComplex, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const cuda_types::cusparse::cuDoubleComplex, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsrsv2Info_t, f: *const cuda_types::cusparse::cuDoubleComplex, x: *mut cuda_types::cusparse::cuDoubleComplex, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSbsrmm( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, transB: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, n: ::core::ffi::c_int, kb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, alpha: *const f32, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const f32, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, blockSize: ::core::ffi::c_int, B: *const f32, ldb: ::core::ffi::c_int, beta: *const f32, C: *mut f32, ldc: ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDbsrmm( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, transB: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, n: ::core::ffi::c_int, kb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, alpha: *const f64, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const f64, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, blockSize: ::core::ffi::c_int, B: *const f64, ldb: ::core::ffi::c_int, beta: *const f64, C: *mut f64, ldc: ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCbsrmm( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, transB: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, n: ::core::ffi::c_int, kb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, alpha: *const cuda_types::cusparse::cuComplex, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const cuda_types::cusparse::cuComplex, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, blockSize: ::core::ffi::c_int, B: *const cuda_types::cusparse::cuComplex, ldb: ::core::ffi::c_int, beta: *const cuda_types::cusparse::cuComplex, C: *mut cuda_types::cusparse::cuComplex, ldc: ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZbsrmm( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, transB: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, n: ::core::ffi::c_int, kb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, alpha: *const cuda_types::cusparse::cuDoubleComplex, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const cuda_types::cusparse::cuDoubleComplex, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, blockSize: ::core::ffi::c_int, B: *const cuda_types::cusparse::cuDoubleComplex, ldb: ::core::ffi::c_int, beta: *const cuda_types::cusparse::cuDoubleComplex, C: *mut cuda_types::cusparse::cuDoubleComplex, ldc: ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseXbsrsm2_zeroPivot( handle: cuda_types::cusparse::cusparseHandle_t, info: cuda_types::cusparse::bsrsm2Info_t, position: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSbsrsm2_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, transXY: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, n: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut f32, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockSize: ::core::ffi::c_int, info: cuda_types::cusparse::bsrsm2Info_t, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDbsrsm2_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, transXY: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, n: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut f64, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockSize: ::core::ffi::c_int, info: cuda_types::cusparse::bsrsm2Info_t, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCbsrsm2_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, transXY: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, n: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut cuda_types::cusparse::cuComplex, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockSize: ::core::ffi::c_int, info: cuda_types::cusparse::bsrsm2Info_t, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZbsrsm2_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, transXY: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, n: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut cuda_types::cusparse::cuDoubleComplex, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockSize: ::core::ffi::c_int, info: cuda_types::cusparse::bsrsm2Info_t, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSbsrsm2_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, transB: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, n: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut f32, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockSize: ::core::ffi::c_int, info: cuda_types::cusparse::bsrsm2Info_t, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDbsrsm2_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, transB: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, n: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut f64, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockSize: ::core::ffi::c_int, info: cuda_types::cusparse::bsrsm2Info_t, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCbsrsm2_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, transB: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, n: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut cuda_types::cusparse::cuComplex, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockSize: ::core::ffi::c_int, info: cuda_types::cusparse::bsrsm2Info_t, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZbsrsm2_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, transB: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, n: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut cuda_types::cusparse::cuDoubleComplex, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockSize: ::core::ffi::c_int, info: cuda_types::cusparse::bsrsm2Info_t, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSbsrsm2_analysis( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, transXY: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, n: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *const f32, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockSize: ::core::ffi::c_int, info: cuda_types::cusparse::bsrsm2Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDbsrsm2_analysis( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, transXY: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, n: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *const f64, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockSize: ::core::ffi::c_int, info: cuda_types::cusparse::bsrsm2Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCbsrsm2_analysis( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, transXY: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, n: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *const cuda_types::cusparse::cuComplex, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockSize: ::core::ffi::c_int, info: cuda_types::cusparse::bsrsm2Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZbsrsm2_analysis( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, transXY: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, n: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *const cuda_types::cusparse::cuDoubleComplex, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockSize: ::core::ffi::c_int, info: cuda_types::cusparse::bsrsm2Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSbsrsm2_solve( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, transXY: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, n: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, alpha: *const f32, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *const f32, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockSize: ::core::ffi::c_int, info: cuda_types::cusparse::bsrsm2Info_t, B: *const f32, ldb: ::core::ffi::c_int, X: *mut f32, ldx: ::core::ffi::c_int, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDbsrsm2_solve( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, transXY: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, n: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, alpha: *const f64, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *const f64, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockSize: ::core::ffi::c_int, info: cuda_types::cusparse::bsrsm2Info_t, B: *const f64, ldb: ::core::ffi::c_int, X: *mut f64, ldx: ::core::ffi::c_int, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCbsrsm2_solve( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, transXY: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, n: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, alpha: *const cuda_types::cusparse::cuComplex, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *const cuda_types::cusparse::cuComplex, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockSize: ::core::ffi::c_int, info: cuda_types::cusparse::bsrsm2Info_t, B: *const cuda_types::cusparse::cuComplex, ldb: ::core::ffi::c_int, X: *mut cuda_types::cusparse::cuComplex, ldx: ::core::ffi::c_int, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZbsrsm2_solve( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, transA: cuda_types::cusparse::cusparseOperation_t, transXY: cuda_types::cusparse::cusparseOperation_t, mb: ::core::ffi::c_int, n: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, alpha: *const cuda_types::cusparse::cuDoubleComplex, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *const cuda_types::cusparse::cuDoubleComplex, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockSize: ::core::ffi::c_int, info: cuda_types::cusparse::bsrsm2Info_t, B: *const cuda_types::cusparse::cuDoubleComplex, ldb: ::core::ffi::c_int, X: *mut cuda_types::cusparse::cuDoubleComplex, ldx: ::core::ffi::c_int, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseScsrilu02_numericBoost( handle: cuda_types::cusparse::cusparseHandle_t, info: cuda_types::cusparse::csrilu02Info_t, enable_boost: ::core::ffi::c_int, tol: *mut f64, boost_val: *mut f32, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDcsrilu02_numericBoost( handle: cuda_types::cusparse::cusparseHandle_t, info: cuda_types::cusparse::csrilu02Info_t, enable_boost: ::core::ffi::c_int, tol: *mut f64, boost_val: *mut f64, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCcsrilu02_numericBoost( handle: cuda_types::cusparse::cusparseHandle_t, info: cuda_types::cusparse::csrilu02Info_t, enable_boost: ::core::ffi::c_int, tol: *mut f64, boost_val: *mut cuda_types::cusparse::cuComplex, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZcsrilu02_numericBoost( handle: cuda_types::cusparse::cusparseHandle_t, info: cuda_types::cusparse::csrilu02Info_t, enable_boost: ::core::ffi::c_int, tol: *mut f64, boost_val: *mut cuda_types::cusparse::cuDoubleComplex, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseXcsrilu02_zeroPivot( handle: cuda_types::cusparse::cusparseHandle_t, info: cuda_types::cusparse::csrilu02Info_t, position: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseScsrilu02_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *mut f32, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, info: cuda_types::cusparse::csrilu02Info_t, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDcsrilu02_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *mut f64, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, info: cuda_types::cusparse::csrilu02Info_t, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCcsrilu02_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *mut cuda_types::cusparse::cuComplex, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, info: cuda_types::cusparse::csrilu02Info_t, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZcsrilu02_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *mut cuda_types::cusparse::cuDoubleComplex, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, info: cuda_types::cusparse::csrilu02Info_t, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseScsrilu02_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedVal: *mut f32, csrSortedRowPtr: *const ::core::ffi::c_int, csrSortedColInd: *const ::core::ffi::c_int, info: cuda_types::cusparse::csrilu02Info_t, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDcsrilu02_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedVal: *mut f64, csrSortedRowPtr: *const ::core::ffi::c_int, csrSortedColInd: *const ::core::ffi::c_int, info: cuda_types::cusparse::csrilu02Info_t, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCcsrilu02_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedVal: *mut cuda_types::cusparse::cuComplex, csrSortedRowPtr: *const ::core::ffi::c_int, csrSortedColInd: *const ::core::ffi::c_int, info: cuda_types::cusparse::csrilu02Info_t, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZcsrilu02_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedVal: *mut cuda_types::cusparse::cuDoubleComplex, csrSortedRowPtr: *const ::core::ffi::c_int, csrSortedColInd: *const ::core::ffi::c_int, info: cuda_types::cusparse::csrilu02Info_t, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseScsrilu02_analysis( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const f32, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, info: cuda_types::cusparse::csrilu02Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDcsrilu02_analysis( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const f64, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, info: cuda_types::cusparse::csrilu02Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCcsrilu02_analysis( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const cuda_types::cusparse::cuComplex, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, info: cuda_types::cusparse::csrilu02Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZcsrilu02_analysis( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const cuda_types::cusparse::cuDoubleComplex, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, info: cuda_types::cusparse::csrilu02Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseScsrilu02( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA_valM: *mut f32, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, info: cuda_types::cusparse::csrilu02Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDcsrilu02( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA_valM: *mut f64, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, info: cuda_types::cusparse::csrilu02Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCcsrilu02( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA_valM: *mut cuda_types::cusparse::cuComplex, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, info: cuda_types::cusparse::csrilu02Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZcsrilu02( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA_valM: *mut cuda_types::cusparse::cuDoubleComplex, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, info: cuda_types::cusparse::csrilu02Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSbsrilu02_numericBoost( handle: cuda_types::cusparse::cusparseHandle_t, info: cuda_types::cusparse::bsrilu02Info_t, enable_boost: ::core::ffi::c_int, tol: *mut f64, boost_val: *mut f32, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDbsrilu02_numericBoost( handle: cuda_types::cusparse::cusparseHandle_t, info: cuda_types::cusparse::bsrilu02Info_t, enable_boost: ::core::ffi::c_int, tol: *mut f64, boost_val: *mut f64, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCbsrilu02_numericBoost( handle: cuda_types::cusparse::cusparseHandle_t, info: cuda_types::cusparse::bsrilu02Info_t, enable_boost: ::core::ffi::c_int, tol: *mut f64, boost_val: *mut cuda_types::cusparse::cuComplex, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZbsrilu02_numericBoost( handle: cuda_types::cusparse::cusparseHandle_t, info: cuda_types::cusparse::bsrilu02Info_t, enable_boost: ::core::ffi::c_int, tol: *mut f64, boost_val: *mut cuda_types::cusparse::cuDoubleComplex, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseXbsrilu02_zeroPivot( handle: cuda_types::cusparse::cusparseHandle_t, info: cuda_types::cusparse::bsrilu02Info_t, position: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSbsrilu02_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut f32, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsrilu02Info_t, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDbsrilu02_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut f64, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsrilu02Info_t, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCbsrilu02_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut cuda_types::cusparse::cuComplex, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsrilu02Info_t, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZbsrilu02_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut cuda_types::cusparse::cuDoubleComplex, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsrilu02Info_t, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSbsrilu02_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut f32, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockSize: ::core::ffi::c_int, info: cuda_types::cusparse::bsrilu02Info_t, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDbsrilu02_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut f64, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockSize: ::core::ffi::c_int, info: cuda_types::cusparse::bsrilu02Info_t, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCbsrilu02_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut cuda_types::cusparse::cuComplex, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockSize: ::core::ffi::c_int, info: cuda_types::cusparse::bsrilu02Info_t, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZbsrilu02_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut cuda_types::cusparse::cuDoubleComplex, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockSize: ::core::ffi::c_int, info: cuda_types::cusparse::bsrilu02Info_t, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSbsrilu02_analysis( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut f32, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsrilu02Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDbsrilu02_analysis( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut f64, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsrilu02Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCbsrilu02_analysis( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut cuda_types::cusparse::cuComplex, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsrilu02Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZbsrilu02_analysis( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut cuda_types::cusparse::cuDoubleComplex, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsrilu02Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSbsrilu02( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut f32, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsrilu02Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDbsrilu02( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut f64, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsrilu02Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCbsrilu02( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut cuda_types::cusparse::cuComplex, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsrilu02Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZbsrilu02( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut cuda_types::cusparse::cuDoubleComplex, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsrilu02Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseXcsric02_zeroPivot( handle: cuda_types::cusparse::cusparseHandle_t, info: cuda_types::cusparse::csric02Info_t, position: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseScsric02_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *mut f32, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, info: cuda_types::cusparse::csric02Info_t, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDcsric02_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *mut f64, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, info: cuda_types::cusparse::csric02Info_t, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCcsric02_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *mut cuda_types::cusparse::cuComplex, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, info: cuda_types::cusparse::csric02Info_t, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZcsric02_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *mut cuda_types::cusparse::cuDoubleComplex, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, info: cuda_types::cusparse::csric02Info_t, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseScsric02_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedVal: *mut f32, csrSortedRowPtr: *const ::core::ffi::c_int, csrSortedColInd: *const ::core::ffi::c_int, info: cuda_types::cusparse::csric02Info_t, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDcsric02_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedVal: *mut f64, csrSortedRowPtr: *const ::core::ffi::c_int, csrSortedColInd: *const ::core::ffi::c_int, info: cuda_types::cusparse::csric02Info_t, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCcsric02_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedVal: *mut cuda_types::cusparse::cuComplex, csrSortedRowPtr: *const ::core::ffi::c_int, csrSortedColInd: *const ::core::ffi::c_int, info: cuda_types::cusparse::csric02Info_t, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZcsric02_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedVal: *mut cuda_types::cusparse::cuDoubleComplex, csrSortedRowPtr: *const ::core::ffi::c_int, csrSortedColInd: *const ::core::ffi::c_int, info: cuda_types::cusparse::csric02Info_t, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseScsric02_analysis( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const f32, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, info: cuda_types::cusparse::csric02Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDcsric02_analysis( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const f64, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, info: cuda_types::cusparse::csric02Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCcsric02_analysis( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const cuda_types::cusparse::cuComplex, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, info: cuda_types::cusparse::csric02Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZcsric02_analysis( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const cuda_types::cusparse::cuDoubleComplex, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, info: cuda_types::cusparse::csric02Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseScsric02( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA_valM: *mut f32, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, info: cuda_types::cusparse::csric02Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDcsric02( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA_valM: *mut f64, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, info: cuda_types::cusparse::csric02Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCcsric02( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA_valM: *mut cuda_types::cusparse::cuComplex, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, info: cuda_types::cusparse::csric02Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZcsric02( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA_valM: *mut cuda_types::cusparse::cuDoubleComplex, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, info: cuda_types::cusparse::csric02Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseXbsric02_zeroPivot( handle: cuda_types::cusparse::cusparseHandle_t, info: cuda_types::cusparse::bsric02Info_t, position: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSbsric02_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut f32, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsric02Info_t, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDbsric02_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut f64, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsric02Info_t, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCbsric02_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut cuda_types::cusparse::cuComplex, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsric02Info_t, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZbsric02_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut cuda_types::cusparse::cuDoubleComplex, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsric02Info_t, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSbsric02_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut f32, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockSize: ::core::ffi::c_int, info: cuda_types::cusparse::bsric02Info_t, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDbsric02_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut f64, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockSize: ::core::ffi::c_int, info: cuda_types::cusparse::bsric02Info_t, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCbsric02_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut cuda_types::cusparse::cuComplex, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockSize: ::core::ffi::c_int, info: cuda_types::cusparse::bsric02Info_t, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZbsric02_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut cuda_types::cusparse::cuDoubleComplex, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockSize: ::core::ffi::c_int, info: cuda_types::cusparse::bsric02Info_t, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSbsric02_analysis( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *const f32, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsric02Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pInputBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDbsric02_analysis( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *const f64, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsric02Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pInputBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCbsric02_analysis( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *const cuda_types::cusparse::cuComplex, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsric02Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pInputBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZbsric02_analysis( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *const cuda_types::cusparse::cuDoubleComplex, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsric02Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pInputBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSbsric02( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut f32, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsric02Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDbsric02( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut f64, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsric02Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCbsric02( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut cuda_types::cusparse::cuComplex, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsric02Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZbsric02( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedVal: *mut cuda_types::cusparse::cuDoubleComplex, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, info: cuda_types::cusparse::bsric02Info_t, policy: cuda_types::cusparse::cusparseSolvePolicy_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSgtsv2_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, dl: *const f32, d: *const f32, du: *const f32, B: *const f32, ldb: ::core::ffi::c_int, bufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDgtsv2_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, dl: *const f64, d: *const f64, du: *const f64, B: *const f64, ldb: ::core::ffi::c_int, bufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCgtsv2_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, dl: *const cuda_types::cusparse::cuComplex, d: *const cuda_types::cusparse::cuComplex, du: *const cuda_types::cusparse::cuComplex, B: *const cuda_types::cusparse::cuComplex, ldb: ::core::ffi::c_int, bufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZgtsv2_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, dl: *const cuda_types::cusparse::cuDoubleComplex, d: *const cuda_types::cusparse::cuDoubleComplex, du: *const cuda_types::cusparse::cuDoubleComplex, B: *const cuda_types::cusparse::cuDoubleComplex, ldb: ::core::ffi::c_int, bufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSgtsv2( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, dl: *const f32, d: *const f32, du: *const f32, B: *mut f32, ldb: ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDgtsv2( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, dl: *const f64, d: *const f64, du: *const f64, B: *mut f64, ldb: ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCgtsv2( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, dl: *const cuda_types::cusparse::cuComplex, d: *const cuda_types::cusparse::cuComplex, du: *const cuda_types::cusparse::cuComplex, B: *mut cuda_types::cusparse::cuComplex, ldb: ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZgtsv2( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, dl: *const cuda_types::cusparse::cuDoubleComplex, d: *const cuda_types::cusparse::cuDoubleComplex, du: *const cuda_types::cusparse::cuDoubleComplex, B: *mut cuda_types::cusparse::cuDoubleComplex, ldb: ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSgtsv2_nopivot_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, dl: *const f32, d: *const f32, du: *const f32, B: *const f32, ldb: ::core::ffi::c_int, bufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDgtsv2_nopivot_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, dl: *const f64, d: *const f64, du: *const f64, B: *const f64, ldb: ::core::ffi::c_int, bufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCgtsv2_nopivot_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, dl: *const cuda_types::cusparse::cuComplex, d: *const cuda_types::cusparse::cuComplex, du: *const cuda_types::cusparse::cuComplex, B: *const cuda_types::cusparse::cuComplex, ldb: ::core::ffi::c_int, bufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZgtsv2_nopivot_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, dl: *const cuda_types::cusparse::cuDoubleComplex, d: *const cuda_types::cusparse::cuDoubleComplex, du: *const cuda_types::cusparse::cuDoubleComplex, B: *const cuda_types::cusparse::cuDoubleComplex, ldb: ::core::ffi::c_int, bufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSgtsv2_nopivot( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, dl: *const f32, d: *const f32, du: *const f32, B: *mut f32, ldb: ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDgtsv2_nopivot( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, dl: *const f64, d: *const f64, du: *const f64, B: *mut f64, ldb: ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCgtsv2_nopivot( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, dl: *const cuda_types::cusparse::cuComplex, d: *const cuda_types::cusparse::cuComplex, du: *const cuda_types::cusparse::cuComplex, B: *mut cuda_types::cusparse::cuComplex, ldb: ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZgtsv2_nopivot( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, dl: *const cuda_types::cusparse::cuDoubleComplex, d: *const cuda_types::cusparse::cuDoubleComplex, du: *const cuda_types::cusparse::cuDoubleComplex, B: *mut cuda_types::cusparse::cuDoubleComplex, ldb: ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSgtsv2StridedBatch_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, dl: *const f32, d: *const f32, du: *const f32, x: *const f32, batchCount: ::core::ffi::c_int, batchStride: ::core::ffi::c_int, bufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDgtsv2StridedBatch_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, dl: *const f64, d: *const f64, du: *const f64, x: *const f64, batchCount: ::core::ffi::c_int, batchStride: ::core::ffi::c_int, bufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCgtsv2StridedBatch_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, dl: *const cuda_types::cusparse::cuComplex, d: *const cuda_types::cusparse::cuComplex, du: *const cuda_types::cusparse::cuComplex, x: *const cuda_types::cusparse::cuComplex, batchCount: ::core::ffi::c_int, batchStride: ::core::ffi::c_int, bufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZgtsv2StridedBatch_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, dl: *const cuda_types::cusparse::cuDoubleComplex, d: *const cuda_types::cusparse::cuDoubleComplex, du: *const cuda_types::cusparse::cuDoubleComplex, x: *const cuda_types::cusparse::cuDoubleComplex, batchCount: ::core::ffi::c_int, batchStride: ::core::ffi::c_int, bufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSgtsv2StridedBatch( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, dl: *const f32, d: *const f32, du: *const f32, x: *mut f32, batchCount: ::core::ffi::c_int, batchStride: ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDgtsv2StridedBatch( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, dl: *const f64, d: *const f64, du: *const f64, x: *mut f64, batchCount: ::core::ffi::c_int, batchStride: ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCgtsv2StridedBatch( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, dl: *const cuda_types::cusparse::cuComplex, d: *const cuda_types::cusparse::cuComplex, du: *const cuda_types::cusparse::cuComplex, x: *mut cuda_types::cusparse::cuComplex, batchCount: ::core::ffi::c_int, batchStride: ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZgtsv2StridedBatch( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, dl: *const cuda_types::cusparse::cuDoubleComplex, d: *const cuda_types::cusparse::cuDoubleComplex, du: *const cuda_types::cusparse::cuDoubleComplex, x: *mut cuda_types::cusparse::cuDoubleComplex, batchCount: ::core::ffi::c_int, batchStride: ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSgtsvInterleavedBatch_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, algo: ::core::ffi::c_int, m: ::core::ffi::c_int, dl: *const f32, d: *const f32, du: *const f32, x: *const f32, batchCount: ::core::ffi::c_int, pBufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDgtsvInterleavedBatch_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, algo: ::core::ffi::c_int, m: ::core::ffi::c_int, dl: *const f64, d: *const f64, du: *const f64, x: *const f64, batchCount: ::core::ffi::c_int, pBufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCgtsvInterleavedBatch_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, algo: ::core::ffi::c_int, m: ::core::ffi::c_int, dl: *const cuda_types::cusparse::cuComplex, d: *const cuda_types::cusparse::cuComplex, du: *const cuda_types::cusparse::cuComplex, x: *const cuda_types::cusparse::cuComplex, batchCount: ::core::ffi::c_int, pBufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZgtsvInterleavedBatch_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, algo: ::core::ffi::c_int, m: ::core::ffi::c_int, dl: *const cuda_types::cusparse::cuDoubleComplex, d: *const cuda_types::cusparse::cuDoubleComplex, du: *const cuda_types::cusparse::cuDoubleComplex, x: *const cuda_types::cusparse::cuDoubleComplex, batchCount: ::core::ffi::c_int, pBufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSgtsvInterleavedBatch( handle: cuda_types::cusparse::cusparseHandle_t, algo: ::core::ffi::c_int, m: ::core::ffi::c_int, dl: *mut f32, d: *mut f32, du: *mut f32, x: *mut f32, batchCount: ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDgtsvInterleavedBatch( handle: cuda_types::cusparse::cusparseHandle_t, algo: ::core::ffi::c_int, m: ::core::ffi::c_int, dl: *mut f64, d: *mut f64, du: *mut f64, x: *mut f64, batchCount: ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCgtsvInterleavedBatch( handle: cuda_types::cusparse::cusparseHandle_t, algo: ::core::ffi::c_int, m: ::core::ffi::c_int, dl: *mut cuda_types::cusparse::cuComplex, d: *mut cuda_types::cusparse::cuComplex, du: *mut cuda_types::cusparse::cuComplex, x: *mut cuda_types::cusparse::cuComplex, batchCount: ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZgtsvInterleavedBatch( handle: cuda_types::cusparse::cusparseHandle_t, algo: ::core::ffi::c_int, m: ::core::ffi::c_int, dl: *mut cuda_types::cusparse::cuDoubleComplex, d: *mut cuda_types::cusparse::cuDoubleComplex, du: *mut cuda_types::cusparse::cuDoubleComplex, x: *mut cuda_types::cusparse::cuDoubleComplex, batchCount: ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSgpsvInterleavedBatch_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, algo: ::core::ffi::c_int, m: ::core::ffi::c_int, ds: *const f32, dl: *const f32, d: *const f32, du: *const f32, dw: *const f32, x: *const f32, batchCount: ::core::ffi::c_int, pBufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDgpsvInterleavedBatch_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, algo: ::core::ffi::c_int, m: ::core::ffi::c_int, ds: *const f64, dl: *const f64, d: *const f64, du: *const f64, dw: *const f64, x: *const f64, batchCount: ::core::ffi::c_int, pBufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCgpsvInterleavedBatch_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, algo: ::core::ffi::c_int, m: ::core::ffi::c_int, ds: *const cuda_types::cusparse::cuComplex, dl: *const cuda_types::cusparse::cuComplex, d: *const cuda_types::cusparse::cuComplex, du: *const cuda_types::cusparse::cuComplex, dw: *const cuda_types::cusparse::cuComplex, x: *const cuda_types::cusparse::cuComplex, batchCount: ::core::ffi::c_int, pBufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZgpsvInterleavedBatch_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, algo: ::core::ffi::c_int, m: ::core::ffi::c_int, ds: *const cuda_types::cusparse::cuDoubleComplex, dl: *const cuda_types::cusparse::cuDoubleComplex, d: *const cuda_types::cusparse::cuDoubleComplex, du: *const cuda_types::cusparse::cuDoubleComplex, dw: *const cuda_types::cusparse::cuDoubleComplex, x: *const cuda_types::cusparse::cuDoubleComplex, batchCount: ::core::ffi::c_int, pBufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSgpsvInterleavedBatch( handle: cuda_types::cusparse::cusparseHandle_t, algo: ::core::ffi::c_int, m: ::core::ffi::c_int, ds: *mut f32, dl: *mut f32, d: *mut f32, du: *mut f32, dw: *mut f32, x: *mut f32, batchCount: ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDgpsvInterleavedBatch( handle: cuda_types::cusparse::cusparseHandle_t, algo: ::core::ffi::c_int, m: ::core::ffi::c_int, ds: *mut f64, dl: *mut f64, d: *mut f64, du: *mut f64, dw: *mut f64, x: *mut f64, batchCount: ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCgpsvInterleavedBatch( handle: cuda_types::cusparse::cusparseHandle_t, algo: ::core::ffi::c_int, m: ::core::ffi::c_int, ds: *mut cuda_types::cusparse::cuComplex, dl: *mut cuda_types::cusparse::cuComplex, d: *mut cuda_types::cusparse::cuComplex, du: *mut cuda_types::cusparse::cuComplex, dw: *mut cuda_types::cusparse::cuComplex, x: *mut cuda_types::cusparse::cuComplex, batchCount: ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZgpsvInterleavedBatch( handle: cuda_types::cusparse::cusparseHandle_t, algo: ::core::ffi::c_int, m: ::core::ffi::c_int, ds: *mut cuda_types::cusparse::cuDoubleComplex, dl: *mut cuda_types::cusparse::cuDoubleComplex, d: *mut cuda_types::cusparse::cuDoubleComplex, du: *mut cuda_types::cusparse::cuDoubleComplex, dw: *mut cuda_types::cusparse::cuDoubleComplex, x: *mut cuda_types::cusparse::cuDoubleComplex, batchCount: ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseScsrgeam2_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const f32, descrA: cuda_types::cusparse::cusparseMatDescr_t, nnzA: ::core::ffi::c_int, csrSortedValA: *const f32, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, beta: *const f32, descrB: cuda_types::cusparse::cusparseMatDescr_t, nnzB: ::core::ffi::c_int, csrSortedValB: *const f32, csrSortedRowPtrB: *const ::core::ffi::c_int, csrSortedColIndB: *const ::core::ffi::c_int, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValC: *const f32, csrSortedRowPtrC: *const ::core::ffi::c_int, csrSortedColIndC: *const ::core::ffi::c_int, pBufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDcsrgeam2_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const f64, descrA: cuda_types::cusparse::cusparseMatDescr_t, nnzA: ::core::ffi::c_int, csrSortedValA: *const f64, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, beta: *const f64, descrB: cuda_types::cusparse::cusparseMatDescr_t, nnzB: ::core::ffi::c_int, csrSortedValB: *const f64, csrSortedRowPtrB: *const ::core::ffi::c_int, csrSortedColIndB: *const ::core::ffi::c_int, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValC: *const f64, csrSortedRowPtrC: *const ::core::ffi::c_int, csrSortedColIndC: *const ::core::ffi::c_int, pBufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCcsrgeam2_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const cuda_types::cusparse::cuComplex, descrA: cuda_types::cusparse::cusparseMatDescr_t, nnzA: ::core::ffi::c_int, csrSortedValA: *const cuda_types::cusparse::cuComplex, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, beta: *const cuda_types::cusparse::cuComplex, descrB: cuda_types::cusparse::cusparseMatDescr_t, nnzB: ::core::ffi::c_int, csrSortedValB: *const cuda_types::cusparse::cuComplex, csrSortedRowPtrB: *const ::core::ffi::c_int, csrSortedColIndB: *const ::core::ffi::c_int, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValC: *const cuda_types::cusparse::cuComplex, csrSortedRowPtrC: *const ::core::ffi::c_int, csrSortedColIndC: *const ::core::ffi::c_int, pBufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZcsrgeam2_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const cuda_types::cusparse::cuDoubleComplex, descrA: cuda_types::cusparse::cusparseMatDescr_t, nnzA: ::core::ffi::c_int, csrSortedValA: *const cuda_types::cusparse::cuDoubleComplex, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, beta: *const cuda_types::cusparse::cuDoubleComplex, descrB: cuda_types::cusparse::cusparseMatDescr_t, nnzB: ::core::ffi::c_int, csrSortedValB: *const cuda_types::cusparse::cuDoubleComplex, csrSortedRowPtrB: *const ::core::ffi::c_int, csrSortedColIndB: *const ::core::ffi::c_int, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValC: *const cuda_types::cusparse::cuDoubleComplex, csrSortedRowPtrC: *const ::core::ffi::c_int, csrSortedColIndC: *const ::core::ffi::c_int, pBufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseXcsrgeam2Nnz( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, nnzA: ::core::ffi::c_int, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, descrB: cuda_types::cusparse::cusparseMatDescr_t, nnzB: ::core::ffi::c_int, csrSortedRowPtrB: *const ::core::ffi::c_int, csrSortedColIndB: *const ::core::ffi::c_int, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedRowPtrC: *mut ::core::ffi::c_int, nnzTotalDevHostPtr: *mut ::core::ffi::c_int, workspace: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseScsrgeam2( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const f32, descrA: cuda_types::cusparse::cusparseMatDescr_t, nnzA: ::core::ffi::c_int, csrSortedValA: *const f32, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, beta: *const f32, descrB: cuda_types::cusparse::cusparseMatDescr_t, nnzB: ::core::ffi::c_int, csrSortedValB: *const f32, csrSortedRowPtrB: *const ::core::ffi::c_int, csrSortedColIndB: *const ::core::ffi::c_int, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValC: *mut f32, csrSortedRowPtrC: *mut ::core::ffi::c_int, csrSortedColIndC: *mut ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDcsrgeam2( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const f64, descrA: cuda_types::cusparse::cusparseMatDescr_t, nnzA: ::core::ffi::c_int, csrSortedValA: *const f64, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, beta: *const f64, descrB: cuda_types::cusparse::cusparseMatDescr_t, nnzB: ::core::ffi::c_int, csrSortedValB: *const f64, csrSortedRowPtrB: *const ::core::ffi::c_int, csrSortedColIndB: *const ::core::ffi::c_int, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValC: *mut f64, csrSortedRowPtrC: *mut ::core::ffi::c_int, csrSortedColIndC: *mut ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCcsrgeam2( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const cuda_types::cusparse::cuComplex, descrA: cuda_types::cusparse::cusparseMatDescr_t, nnzA: ::core::ffi::c_int, csrSortedValA: *const cuda_types::cusparse::cuComplex, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, beta: *const cuda_types::cusparse::cuComplex, descrB: cuda_types::cusparse::cusparseMatDescr_t, nnzB: ::core::ffi::c_int, csrSortedValB: *const cuda_types::cusparse::cuComplex, csrSortedRowPtrB: *const ::core::ffi::c_int, csrSortedColIndB: *const ::core::ffi::c_int, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValC: *mut cuda_types::cusparse::cuComplex, csrSortedRowPtrC: *mut ::core::ffi::c_int, csrSortedColIndC: *mut ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZcsrgeam2( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, alpha: *const cuda_types::cusparse::cuDoubleComplex, descrA: cuda_types::cusparse::cusparseMatDescr_t, nnzA: ::core::ffi::c_int, csrSortedValA: *const cuda_types::cusparse::cuDoubleComplex, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, beta: *const cuda_types::cusparse::cuDoubleComplex, descrB: cuda_types::cusparse::cusparseMatDescr_t, nnzB: ::core::ffi::c_int, csrSortedValB: *const cuda_types::cusparse::cuDoubleComplex, csrSortedRowPtrB: *const ::core::ffi::c_int, csrSortedColIndB: *const ::core::ffi::c_int, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValC: *mut cuda_types::cusparse::cuDoubleComplex, csrSortedRowPtrC: *mut ::core::ffi::c_int, csrSortedColIndC: *mut ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseScsrcolor( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const f32, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, fractionToColor: *const f32, ncolors: *mut ::core::ffi::c_int, coloring: *mut ::core::ffi::c_int, reordering: *mut ::core::ffi::c_int, info: cuda_types::cusparse::cusparseColorInfo_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDcsrcolor( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const f64, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, fractionToColor: *const f64, ncolors: *mut ::core::ffi::c_int, coloring: *mut ::core::ffi::c_int, reordering: *mut ::core::ffi::c_int, info: cuda_types::cusparse::cusparseColorInfo_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCcsrcolor( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const cuda_types::cusparse::cuComplex, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, fractionToColor: *const f32, ncolors: *mut ::core::ffi::c_int, coloring: *mut ::core::ffi::c_int, reordering: *mut ::core::ffi::c_int, info: cuda_types::cusparse::cusparseColorInfo_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZcsrcolor( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const cuda_types::cusparse::cuDoubleComplex, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, fractionToColor: *const f64, ncolors: *mut ::core::ffi::c_int, coloring: *mut ::core::ffi::c_int, reordering: *mut ::core::ffi::c_int, info: cuda_types::cusparse::cusparseColorInfo_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSnnz( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, A: *const f32, lda: ::core::ffi::c_int, nnzPerRowCol: *mut ::core::ffi::c_int, nnzTotalDevHostPtr: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDnnz( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, A: *const f64, lda: ::core::ffi::c_int, nnzPerRowCol: *mut ::core::ffi::c_int, nnzTotalDevHostPtr: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCnnz( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, A: *const cuda_types::cusparse::cuComplex, lda: ::core::ffi::c_int, nnzPerRowCol: *mut ::core::ffi::c_int, nnzTotalDevHostPtr: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZnnz( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, A: *const cuda_types::cusparse::cuDoubleComplex, lda: ::core::ffi::c_int, nnzPerRowCol: *mut ::core::ffi::c_int, nnzTotalDevHostPtr: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSnnz_compress( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, descr: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const f32, csrSortedRowPtrA: *const ::core::ffi::c_int, nnzPerRow: *mut ::core::ffi::c_int, nnzC: *mut ::core::ffi::c_int, tol: f32, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDnnz_compress( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, descr: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const f64, csrSortedRowPtrA: *const ::core::ffi::c_int, nnzPerRow: *mut ::core::ffi::c_int, nnzC: *mut ::core::ffi::c_int, tol: f64, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCnnz_compress( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, descr: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const cuda_types::cusparse::cuComplex, csrSortedRowPtrA: *const ::core::ffi::c_int, nnzPerRow: *mut ::core::ffi::c_int, nnzC: *mut ::core::ffi::c_int, tol: cuda_types::cusparse::cuComplex, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZnnz_compress( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, descr: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const cuda_types::cusparse::cuDoubleComplex, csrSortedRowPtrA: *const ::core::ffi::c_int, nnzPerRow: *mut ::core::ffi::c_int, nnzC: *mut ::core::ffi::c_int, tol: cuda_types::cusparse::cuDoubleComplex, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseScsr2csr_compress( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const f32, csrSortedColIndA: *const ::core::ffi::c_int, csrSortedRowPtrA: *const ::core::ffi::c_int, nnzA: ::core::ffi::c_int, nnzPerRow: *const ::core::ffi::c_int, csrSortedValC: *mut f32, csrSortedColIndC: *mut ::core::ffi::c_int, csrSortedRowPtrC: *mut ::core::ffi::c_int, tol: f32, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDcsr2csr_compress( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const f64, csrSortedColIndA: *const ::core::ffi::c_int, csrSortedRowPtrA: *const ::core::ffi::c_int, nnzA: ::core::ffi::c_int, nnzPerRow: *const ::core::ffi::c_int, csrSortedValC: *mut f64, csrSortedColIndC: *mut ::core::ffi::c_int, csrSortedRowPtrC: *mut ::core::ffi::c_int, tol: f64, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCcsr2csr_compress( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const cuda_types::cusparse::cuComplex, csrSortedColIndA: *const ::core::ffi::c_int, csrSortedRowPtrA: *const ::core::ffi::c_int, nnzA: ::core::ffi::c_int, nnzPerRow: *const ::core::ffi::c_int, csrSortedValC: *mut cuda_types::cusparse::cuComplex, csrSortedColIndC: *mut ::core::ffi::c_int, csrSortedRowPtrC: *mut ::core::ffi::c_int, tol: cuda_types::cusparse::cuComplex, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZcsr2csr_compress( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const cuda_types::cusparse::cuDoubleComplex, csrSortedColIndA: *const ::core::ffi::c_int, csrSortedRowPtrA: *const ::core::ffi::c_int, nnzA: ::core::ffi::c_int, nnzPerRow: *const ::core::ffi::c_int, csrSortedValC: *mut cuda_types::cusparse::cuDoubleComplex, csrSortedColIndC: *mut ::core::ffi::c_int, csrSortedRowPtrC: *mut ::core::ffi::c_int, tol: cuda_types::cusparse::cuDoubleComplex, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseXcoo2csr( handle: cuda_types::cusparse::cusparseHandle_t, cooRowInd: *const ::core::ffi::c_int, nnz: ::core::ffi::c_int, m: ::core::ffi::c_int, csrSortedRowPtr: *mut ::core::ffi::c_int, idxBase: cuda_types::cusparse::cusparseIndexBase_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseXcsr2coo( handle: cuda_types::cusparse::cusparseHandle_t, csrSortedRowPtr: *const ::core::ffi::c_int, nnz: ::core::ffi::c_int, m: ::core::ffi::c_int, cooRowInd: *mut ::core::ffi::c_int, idxBase: cuda_types::cusparse::cusparseIndexBase_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseXcsr2bsrNnz( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, descrC: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedRowPtrC: *mut ::core::ffi::c_int, nnzTotalDevHostPtr: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseScsr2bsr( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const f32, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, descrC: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValC: *mut f32, bsrSortedRowPtrC: *mut ::core::ffi::c_int, bsrSortedColIndC: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDcsr2bsr( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const f64, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, descrC: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValC: *mut f64, bsrSortedRowPtrC: *mut ::core::ffi::c_int, bsrSortedColIndC: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCcsr2bsr( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const cuda_types::cusparse::cuComplex, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, descrC: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValC: *mut cuda_types::cusparse::cuComplex, bsrSortedRowPtrC: *mut ::core::ffi::c_int, bsrSortedColIndC: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZcsr2bsr( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const cuda_types::cusparse::cuDoubleComplex, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, descrC: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValC: *mut cuda_types::cusparse::cuDoubleComplex, bsrSortedRowPtrC: *mut ::core::ffi::c_int, bsrSortedColIndC: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSbsr2csr( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const f32, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValC: *mut f32, csrSortedRowPtrC: *mut ::core::ffi::c_int, csrSortedColIndC: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDbsr2csr( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const f64, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValC: *mut f64, csrSortedRowPtrC: *mut ::core::ffi::c_int, csrSortedColIndC: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCbsr2csr( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const cuda_types::cusparse::cuComplex, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValC: *mut cuda_types::cusparse::cuComplex, csrSortedRowPtrC: *mut ::core::ffi::c_int, csrSortedColIndC: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZbsr2csr( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const cuda_types::cusparse::cuDoubleComplex, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, blockDim: ::core::ffi::c_int, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValC: *mut cuda_types::cusparse::cuDoubleComplex, csrSortedRowPtrC: *mut ::core::ffi::c_int, csrSortedColIndC: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSgebsr2gebsc_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, bsrSortedVal: *const f32, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, rowBlockDim: ::core::ffi::c_int, colBlockDim: ::core::ffi::c_int, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDgebsr2gebsc_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, bsrSortedVal: *const f64, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, rowBlockDim: ::core::ffi::c_int, colBlockDim: ::core::ffi::c_int, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCgebsr2gebsc_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, bsrSortedVal: *const cuda_types::cusparse::cuComplex, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, rowBlockDim: ::core::ffi::c_int, colBlockDim: ::core::ffi::c_int, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZgebsr2gebsc_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, bsrSortedVal: *const cuda_types::cusparse::cuDoubleComplex, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, rowBlockDim: ::core::ffi::c_int, colBlockDim: ::core::ffi::c_int, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSgebsr2gebsc_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, bsrSortedVal: *const f32, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, rowBlockDim: ::core::ffi::c_int, colBlockDim: ::core::ffi::c_int, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDgebsr2gebsc_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, bsrSortedVal: *const f64, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, rowBlockDim: ::core::ffi::c_int, colBlockDim: ::core::ffi::c_int, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCgebsr2gebsc_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, bsrSortedVal: *const cuda_types::cusparse::cuComplex, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, rowBlockDim: ::core::ffi::c_int, colBlockDim: ::core::ffi::c_int, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZgebsr2gebsc_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, bsrSortedVal: *const cuda_types::cusparse::cuDoubleComplex, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, rowBlockDim: ::core::ffi::c_int, colBlockDim: ::core::ffi::c_int, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSgebsr2gebsc( handle: cuda_types::cusparse::cusparseHandle_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, bsrSortedVal: *const f32, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, rowBlockDim: ::core::ffi::c_int, colBlockDim: ::core::ffi::c_int, bscVal: *mut f32, bscRowInd: *mut ::core::ffi::c_int, bscColPtr: *mut ::core::ffi::c_int, copyValues: cuda_types::cusparse::cusparseAction_t, idxBase: cuda_types::cusparse::cusparseIndexBase_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDgebsr2gebsc( handle: cuda_types::cusparse::cusparseHandle_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, bsrSortedVal: *const f64, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, rowBlockDim: ::core::ffi::c_int, colBlockDim: ::core::ffi::c_int, bscVal: *mut f64, bscRowInd: *mut ::core::ffi::c_int, bscColPtr: *mut ::core::ffi::c_int, copyValues: cuda_types::cusparse::cusparseAction_t, idxBase: cuda_types::cusparse::cusparseIndexBase_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCgebsr2gebsc( handle: cuda_types::cusparse::cusparseHandle_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, bsrSortedVal: *const cuda_types::cusparse::cuComplex, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, rowBlockDim: ::core::ffi::c_int, colBlockDim: ::core::ffi::c_int, bscVal: *mut cuda_types::cusparse::cuComplex, bscRowInd: *mut ::core::ffi::c_int, bscColPtr: *mut ::core::ffi::c_int, copyValues: cuda_types::cusparse::cusparseAction_t, idxBase: cuda_types::cusparse::cusparseIndexBase_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZgebsr2gebsc( handle: cuda_types::cusparse::cusparseHandle_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, bsrSortedVal: *const cuda_types::cusparse::cuDoubleComplex, bsrSortedRowPtr: *const ::core::ffi::c_int, bsrSortedColInd: *const ::core::ffi::c_int, rowBlockDim: ::core::ffi::c_int, colBlockDim: ::core::ffi::c_int, bscVal: *mut cuda_types::cusparse::cuDoubleComplex, bscRowInd: *mut ::core::ffi::c_int, bscColPtr: *mut ::core::ffi::c_int, copyValues: cuda_types::cusparse::cusparseAction_t, idxBase: cuda_types::cusparse::cusparseIndexBase_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseXgebsr2csr( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, rowBlockDim: ::core::ffi::c_int, colBlockDim: ::core::ffi::c_int, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedRowPtrC: *mut ::core::ffi::c_int, csrSortedColIndC: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSgebsr2csr( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const f32, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, rowBlockDim: ::core::ffi::c_int, colBlockDim: ::core::ffi::c_int, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValC: *mut f32, csrSortedRowPtrC: *mut ::core::ffi::c_int, csrSortedColIndC: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDgebsr2csr( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const f64, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, rowBlockDim: ::core::ffi::c_int, colBlockDim: ::core::ffi::c_int, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValC: *mut f64, csrSortedRowPtrC: *mut ::core::ffi::c_int, csrSortedColIndC: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCgebsr2csr( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const cuda_types::cusparse::cuComplex, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, rowBlockDim: ::core::ffi::c_int, colBlockDim: ::core::ffi::c_int, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValC: *mut cuda_types::cusparse::cuComplex, csrSortedRowPtrC: *mut ::core::ffi::c_int, csrSortedColIndC: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZgebsr2csr( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const cuda_types::cusparse::cuDoubleComplex, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, rowBlockDim: ::core::ffi::c_int, colBlockDim: ::core::ffi::c_int, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValC: *mut cuda_types::cusparse::cuDoubleComplex, csrSortedRowPtrC: *mut ::core::ffi::c_int, csrSortedColIndC: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseScsr2gebsr_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const f32, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, rowBlockDim: ::core::ffi::c_int, colBlockDim: ::core::ffi::c_int, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDcsr2gebsr_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const f64, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, rowBlockDim: ::core::ffi::c_int, colBlockDim: ::core::ffi::c_int, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCcsr2gebsr_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const cuda_types::cusparse::cuComplex, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, rowBlockDim: ::core::ffi::c_int, colBlockDim: ::core::ffi::c_int, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZcsr2gebsr_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const cuda_types::cusparse::cuDoubleComplex, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, rowBlockDim: ::core::ffi::c_int, colBlockDim: ::core::ffi::c_int, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseScsr2gebsr_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const f32, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, rowBlockDim: ::core::ffi::c_int, colBlockDim: ::core::ffi::c_int, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDcsr2gebsr_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const f64, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, rowBlockDim: ::core::ffi::c_int, colBlockDim: ::core::ffi::c_int, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCcsr2gebsr_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const cuda_types::cusparse::cuComplex, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, rowBlockDim: ::core::ffi::c_int, colBlockDim: ::core::ffi::c_int, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZcsr2gebsr_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const cuda_types::cusparse::cuDoubleComplex, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, rowBlockDim: ::core::ffi::c_int, colBlockDim: ::core::ffi::c_int, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseXcsr2gebsrNnz( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, descrC: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedRowPtrC: *mut ::core::ffi::c_int, rowBlockDim: ::core::ffi::c_int, colBlockDim: ::core::ffi::c_int, nnzTotalDevHostPtr: *mut ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseScsr2gebsr( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const f32, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, descrC: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValC: *mut f32, bsrSortedRowPtrC: *mut ::core::ffi::c_int, bsrSortedColIndC: *mut ::core::ffi::c_int, rowBlockDim: ::core::ffi::c_int, colBlockDim: ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDcsr2gebsr( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const f64, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, descrC: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValC: *mut f64, bsrSortedRowPtrC: *mut ::core::ffi::c_int, bsrSortedColIndC: *mut ::core::ffi::c_int, rowBlockDim: ::core::ffi::c_int, colBlockDim: ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCcsr2gebsr( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const cuda_types::cusparse::cuComplex, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, descrC: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValC: *mut cuda_types::cusparse::cuComplex, bsrSortedRowPtrC: *mut ::core::ffi::c_int, bsrSortedColIndC: *mut ::core::ffi::c_int, rowBlockDim: ::core::ffi::c_int, colBlockDim: ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZcsr2gebsr( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const cuda_types::cusparse::cuDoubleComplex, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, descrC: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValC: *mut cuda_types::cusparse::cuDoubleComplex, bsrSortedRowPtrC: *mut ::core::ffi::c_int, bsrSortedColIndC: *mut ::core::ffi::c_int, rowBlockDim: ::core::ffi::c_int, colBlockDim: ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSgebsr2gebsr_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const f32, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, rowBlockDimA: ::core::ffi::c_int, colBlockDimA: ::core::ffi::c_int, rowBlockDimC: ::core::ffi::c_int, colBlockDimC: ::core::ffi::c_int, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDgebsr2gebsr_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const f64, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, rowBlockDimA: ::core::ffi::c_int, colBlockDimA: ::core::ffi::c_int, rowBlockDimC: ::core::ffi::c_int, colBlockDimC: ::core::ffi::c_int, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCgebsr2gebsr_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const cuda_types::cusparse::cuComplex, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, rowBlockDimA: ::core::ffi::c_int, colBlockDimA: ::core::ffi::c_int, rowBlockDimC: ::core::ffi::c_int, colBlockDimC: ::core::ffi::c_int, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZgebsr2gebsr_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const cuda_types::cusparse::cuDoubleComplex, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, rowBlockDimA: ::core::ffi::c_int, colBlockDimA: ::core::ffi::c_int, rowBlockDimC: ::core::ffi::c_int, colBlockDimC: ::core::ffi::c_int, pBufferSizeInBytes: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSgebsr2gebsr_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const f32, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, rowBlockDimA: ::core::ffi::c_int, colBlockDimA: ::core::ffi::c_int, rowBlockDimC: ::core::ffi::c_int, colBlockDimC: ::core::ffi::c_int, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDgebsr2gebsr_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const f64, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, rowBlockDimA: ::core::ffi::c_int, colBlockDimA: ::core::ffi::c_int, rowBlockDimC: ::core::ffi::c_int, colBlockDimC: ::core::ffi::c_int, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCgebsr2gebsr_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const cuda_types::cusparse::cuComplex, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, rowBlockDimA: ::core::ffi::c_int, colBlockDimA: ::core::ffi::c_int, rowBlockDimC: ::core::ffi::c_int, colBlockDimC: ::core::ffi::c_int, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZgebsr2gebsr_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const cuda_types::cusparse::cuDoubleComplex, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, rowBlockDimA: ::core::ffi::c_int, colBlockDimA: ::core::ffi::c_int, rowBlockDimC: ::core::ffi::c_int, colBlockDimC: ::core::ffi::c_int, pBufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseXgebsr2gebsrNnz( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, rowBlockDimA: ::core::ffi::c_int, colBlockDimA: ::core::ffi::c_int, descrC: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedRowPtrC: *mut ::core::ffi::c_int, rowBlockDimC: ::core::ffi::c_int, colBlockDimC: ::core::ffi::c_int, nnzTotalDevHostPtr: *mut ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSgebsr2gebsr( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const f32, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, rowBlockDimA: ::core::ffi::c_int, colBlockDimA: ::core::ffi::c_int, descrC: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValC: *mut f32, bsrSortedRowPtrC: *mut ::core::ffi::c_int, bsrSortedColIndC: *mut ::core::ffi::c_int, rowBlockDimC: ::core::ffi::c_int, colBlockDimC: ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDgebsr2gebsr( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const f64, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, rowBlockDimA: ::core::ffi::c_int, colBlockDimA: ::core::ffi::c_int, descrC: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValC: *mut f64, bsrSortedRowPtrC: *mut ::core::ffi::c_int, bsrSortedColIndC: *mut ::core::ffi::c_int, rowBlockDimC: ::core::ffi::c_int, colBlockDimC: ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCgebsr2gebsr( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const cuda_types::cusparse::cuComplex, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, rowBlockDimA: ::core::ffi::c_int, colBlockDimA: ::core::ffi::c_int, descrC: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValC: *mut cuda_types::cusparse::cuComplex, bsrSortedRowPtrC: *mut ::core::ffi::c_int, bsrSortedColIndC: *mut ::core::ffi::c_int, rowBlockDimC: ::core::ffi::c_int, colBlockDimC: ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZgebsr2gebsr( handle: cuda_types::cusparse::cusparseHandle_t, dirA: cuda_types::cusparse::cusparseDirection_t, mb: ::core::ffi::c_int, nb: ::core::ffi::c_int, nnzb: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValA: *const cuda_types::cusparse::cuDoubleComplex, bsrSortedRowPtrA: *const ::core::ffi::c_int, bsrSortedColIndA: *const ::core::ffi::c_int, rowBlockDimA: ::core::ffi::c_int, colBlockDimA: ::core::ffi::c_int, descrC: cuda_types::cusparse::cusparseMatDescr_t, bsrSortedValC: *mut cuda_types::cusparse::cuDoubleComplex, bsrSortedRowPtrC: *mut ::core::ffi::c_int, bsrSortedColIndC: *mut ::core::ffi::c_int, rowBlockDimC: ::core::ffi::c_int, colBlockDimC: ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCreateIdentityPermutation( handle: cuda_types::cusparse::cusparseHandle_t, n: ::core::ffi::c_int, p: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseXcoosort_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnz: ::core::ffi::c_int, cooRowsA: *const ::core::ffi::c_int, cooColsA: *const ::core::ffi::c_int, pBufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseXcoosortByRow( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnz: ::core::ffi::c_int, cooRowsA: *mut ::core::ffi::c_int, cooColsA: *mut ::core::ffi::c_int, P: *mut ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseXcoosortByColumn( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnz: ::core::ffi::c_int, cooRowsA: *mut ::core::ffi::c_int, cooColsA: *mut ::core::ffi::c_int, P: *mut ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseXcsrsort_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnz: ::core::ffi::c_int, csrRowPtrA: *const ::core::ffi::c_int, csrColIndA: *const ::core::ffi::c_int, pBufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseXcsrsort( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrRowPtrA: *const ::core::ffi::c_int, csrColIndA: *mut ::core::ffi::c_int, P: *mut ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseXcscsort_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnz: ::core::ffi::c_int, cscColPtrA: *const ::core::ffi::c_int, cscRowIndA: *const ::core::ffi::c_int, pBufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseXcscsort( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, cscColPtrA: *const ::core::ffi::c_int, cscRowIndA: *mut ::core::ffi::c_int, P: *mut ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseScsru2csr_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnz: ::core::ffi::c_int, csrVal: *mut f32, csrRowPtr: *const ::core::ffi::c_int, csrColInd: *mut ::core::ffi::c_int, info: cuda_types::cusparse::csru2csrInfo_t, pBufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDcsru2csr_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnz: ::core::ffi::c_int, csrVal: *mut f64, csrRowPtr: *const ::core::ffi::c_int, csrColInd: *mut ::core::ffi::c_int, info: cuda_types::cusparse::csru2csrInfo_t, pBufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCcsru2csr_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnz: ::core::ffi::c_int, csrVal: *mut cuda_types::cusparse::cuComplex, csrRowPtr: *const ::core::ffi::c_int, csrColInd: *mut ::core::ffi::c_int, info: cuda_types::cusparse::csru2csrInfo_t, pBufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZcsru2csr_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnz: ::core::ffi::c_int, csrVal: *mut cuda_types::cusparse::cuDoubleComplex, csrRowPtr: *const ::core::ffi::c_int, csrColInd: *mut ::core::ffi::c_int, info: cuda_types::cusparse::csru2csrInfo_t, pBufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseScsru2csr( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrVal: *mut f32, csrRowPtr: *const ::core::ffi::c_int, csrColInd: *mut ::core::ffi::c_int, info: cuda_types::cusparse::csru2csrInfo_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDcsru2csr( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrVal: *mut f64, csrRowPtr: *const ::core::ffi::c_int, csrColInd: *mut ::core::ffi::c_int, info: cuda_types::cusparse::csru2csrInfo_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCcsru2csr( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrVal: *mut cuda_types::cusparse::cuComplex, csrRowPtr: *const ::core::ffi::c_int, csrColInd: *mut ::core::ffi::c_int, info: cuda_types::cusparse::csru2csrInfo_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZcsru2csr( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrVal: *mut cuda_types::cusparse::cuDoubleComplex, csrRowPtr: *const ::core::ffi::c_int, csrColInd: *mut ::core::ffi::c_int, info: cuda_types::cusparse::csru2csrInfo_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseScsr2csru( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrVal: *mut f32, csrRowPtr: *const ::core::ffi::c_int, csrColInd: *mut ::core::ffi::c_int, info: cuda_types::cusparse::csru2csrInfo_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDcsr2csru( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrVal: *mut f64, csrRowPtr: *const ::core::ffi::c_int, csrColInd: *mut ::core::ffi::c_int, info: cuda_types::cusparse::csru2csrInfo_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCcsr2csru( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrVal: *mut cuda_types::cusparse::cuComplex, csrRowPtr: *const ::core::ffi::c_int, csrColInd: *mut ::core::ffi::c_int, info: cuda_types::cusparse::csru2csrInfo_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseZcsr2csru( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnz: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrVal: *mut cuda_types::cusparse::cuDoubleComplex, csrRowPtr: *const ::core::ffi::c_int, csrColInd: *mut ::core::ffi::c_int, info: cuda_types::cusparse::csru2csrInfo_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpruneDense2csr_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, A: *const f32, lda: ::core::ffi::c_int, threshold: *const f32, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValC: *const f32, csrSortedRowPtrC: *const ::core::ffi::c_int, csrSortedColIndC: *const ::core::ffi::c_int, pBufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDpruneDense2csr_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, A: *const f64, lda: ::core::ffi::c_int, threshold: *const f64, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValC: *const f64, csrSortedRowPtrC: *const ::core::ffi::c_int, csrSortedColIndC: *const ::core::ffi::c_int, pBufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpruneDense2csrNnz( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, A: *const f32, lda: ::core::ffi::c_int, threshold: *const f32, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrRowPtrC: *mut ::core::ffi::c_int, nnzTotalDevHostPtr: *mut ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDpruneDense2csrNnz( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, A: *const f64, lda: ::core::ffi::c_int, threshold: *const f64, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedRowPtrC: *mut ::core::ffi::c_int, nnzTotalDevHostPtr: *mut ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpruneDense2csr( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, A: *const f32, lda: ::core::ffi::c_int, threshold: *const f32, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValC: *mut f32, csrSortedRowPtrC: *const ::core::ffi::c_int, csrSortedColIndC: *mut ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDpruneDense2csr( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, A: *const f64, lda: ::core::ffi::c_int, threshold: *const f64, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValC: *mut f64, csrSortedRowPtrC: *const ::core::ffi::c_int, csrSortedColIndC: *mut ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpruneCsr2csr_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnzA: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const f32, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, threshold: *const f32, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValC: *const f32, csrSortedRowPtrC: *const ::core::ffi::c_int, csrSortedColIndC: *const ::core::ffi::c_int, pBufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDpruneCsr2csr_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnzA: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const f64, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, threshold: *const f64, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValC: *const f64, csrSortedRowPtrC: *const ::core::ffi::c_int, csrSortedColIndC: *const ::core::ffi::c_int, pBufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpruneCsr2csrNnz( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnzA: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const f32, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, threshold: *const f32, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedRowPtrC: *mut ::core::ffi::c_int, nnzTotalDevHostPtr: *mut ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDpruneCsr2csrNnz( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnzA: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const f64, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, threshold: *const f64, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedRowPtrC: *mut ::core::ffi::c_int, nnzTotalDevHostPtr: *mut ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpruneCsr2csr( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnzA: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const f32, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, threshold: *const f32, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValC: *mut f32, csrSortedRowPtrC: *const ::core::ffi::c_int, csrSortedColIndC: *mut ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDpruneCsr2csr( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnzA: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const f64, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, threshold: *const f64, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValC: *mut f64, csrSortedRowPtrC: *const ::core::ffi::c_int, csrSortedColIndC: *mut ::core::ffi::c_int, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpruneDense2csrByPercentage_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, A: *const f32, lda: ::core::ffi::c_int, percentage: f32, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValC: *const f32, csrSortedRowPtrC: *const ::core::ffi::c_int, csrSortedColIndC: *const ::core::ffi::c_int, info: cuda_types::cusparse::pruneInfo_t, pBufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDpruneDense2csrByPercentage_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, A: *const f64, lda: ::core::ffi::c_int, percentage: f32, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValC: *const f64, csrSortedRowPtrC: *const ::core::ffi::c_int, csrSortedColIndC: *const ::core::ffi::c_int, info: cuda_types::cusparse::pruneInfo_t, pBufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpruneDense2csrNnzByPercentage( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, A: *const f32, lda: ::core::ffi::c_int, percentage: f32, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrRowPtrC: *mut ::core::ffi::c_int, nnzTotalDevHostPtr: *mut ::core::ffi::c_int, info: cuda_types::cusparse::pruneInfo_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDpruneDense2csrNnzByPercentage( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, A: *const f64, lda: ::core::ffi::c_int, percentage: f32, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrRowPtrC: *mut ::core::ffi::c_int, nnzTotalDevHostPtr: *mut ::core::ffi::c_int, info: cuda_types::cusparse::pruneInfo_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpruneDense2csrByPercentage( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, A: *const f32, lda: ::core::ffi::c_int, percentage: f32, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValC: *mut f32, csrSortedRowPtrC: *const ::core::ffi::c_int, csrSortedColIndC: *mut ::core::ffi::c_int, info: cuda_types::cusparse::pruneInfo_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDpruneDense2csrByPercentage( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, A: *const f64, lda: ::core::ffi::c_int, percentage: f32, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValC: *mut f64, csrSortedRowPtrC: *const ::core::ffi::c_int, csrSortedColIndC: *mut ::core::ffi::c_int, info: cuda_types::cusparse::pruneInfo_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpruneCsr2csrByPercentage_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnzA: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const f32, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, percentage: f32, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValC: *const f32, csrSortedRowPtrC: *const ::core::ffi::c_int, csrSortedColIndC: *const ::core::ffi::c_int, info: cuda_types::cusparse::pruneInfo_t, pBufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDpruneCsr2csrByPercentage_bufferSizeExt( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnzA: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const f64, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, percentage: f32, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValC: *const f64, csrSortedRowPtrC: *const ::core::ffi::c_int, csrSortedColIndC: *const ::core::ffi::c_int, info: cuda_types::cusparse::pruneInfo_t, pBufferSizeInBytes: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpruneCsr2csrNnzByPercentage( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnzA: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const f32, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, percentage: f32, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedRowPtrC: *mut ::core::ffi::c_int, nnzTotalDevHostPtr: *mut ::core::ffi::c_int, info: cuda_types::cusparse::pruneInfo_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDpruneCsr2csrNnzByPercentage( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnzA: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const f64, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, percentage: f32, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedRowPtrC: *mut ::core::ffi::c_int, nnzTotalDevHostPtr: *mut ::core::ffi::c_int, info: cuda_types::cusparse::pruneInfo_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpruneCsr2csrByPercentage( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnzA: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const f32, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, percentage: f32, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValC: *mut f32, csrSortedRowPtrC: *const ::core::ffi::c_int, csrSortedColIndC: *mut ::core::ffi::c_int, info: cuda_types::cusparse::pruneInfo_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDpruneCsr2csrByPercentage( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnzA: ::core::ffi::c_int, descrA: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValA: *const f64, csrSortedRowPtrA: *const ::core::ffi::c_int, csrSortedColIndA: *const ::core::ffi::c_int, percentage: f32, descrC: cuda_types::cusparse::cusparseMatDescr_t, csrSortedValC: *mut f64, csrSortedRowPtrC: *const ::core::ffi::c_int, csrSortedColIndC: *mut ::core::ffi::c_int, info: cuda_types::cusparse::pruneInfo_t, pBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCsr2cscEx2( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnz: ::core::ffi::c_int, csrVal: *const ::core::ffi::c_void, csrRowPtr: *const ::core::ffi::c_int, csrColInd: *const ::core::ffi::c_int, cscVal: *mut ::core::ffi::c_void, cscColPtr: *mut ::core::ffi::c_int, cscRowInd: *mut ::core::ffi::c_int, valType: cuda_types::cusparse::cudaDataType, copyValues: cuda_types::cusparse::cusparseAction_t, idxBase: cuda_types::cusparse::cusparseIndexBase_t, alg: cuda_types::cusparse::cusparseCsr2CscAlg_t, buffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCsr2cscEx2_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, m: ::core::ffi::c_int, n: ::core::ffi::c_int, nnz: ::core::ffi::c_int, csrVal: *const ::core::ffi::c_void, csrRowPtr: *const ::core::ffi::c_int, csrColInd: *const ::core::ffi::c_int, cscVal: *mut ::core::ffi::c_void, cscColPtr: *mut ::core::ffi::c_int, cscRowInd: *mut ::core::ffi::c_int, valType: cuda_types::cusparse::cudaDataType, copyValues: cuda_types::cusparse::cusparseAction_t, idxBase: cuda_types::cusparse::cusparseIndexBase_t, alg: cuda_types::cusparse::cusparseCsr2CscAlg_t, bufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCreateSpVec( spVecDescr: *mut cuda_types::cusparse::cusparseSpVecDescr_t, size: i64, nnz: i64, indices: *mut ::core::ffi::c_void, values: *mut ::core::ffi::c_void, idxType: cuda_types::cusparse::cusparseIndexType_t, idxBase: cuda_types::cusparse::cusparseIndexBase_t, valueType: cuda_types::cusparse::cudaDataType, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCreateConstSpVec( spVecDescr: *mut cuda_types::cusparse::cusparseConstSpVecDescr_t, size: i64, nnz: i64, indices: *const ::core::ffi::c_void, values: *const ::core::ffi::c_void, idxType: cuda_types::cusparse::cusparseIndexType_t, idxBase: cuda_types::cusparse::cusparseIndexBase_t, valueType: cuda_types::cusparse::cudaDataType, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDestroySpVec( spVecDescr: cuda_types::cusparse::cusparseConstSpVecDescr_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpVecGet( spVecDescr: cuda_types::cusparse::cusparseSpVecDescr_t, size: *mut i64, nnz: *mut i64, indices: *mut *mut ::core::ffi::c_void, values: *mut *mut ::core::ffi::c_void, idxType: *mut cuda_types::cusparse::cusparseIndexType_t, idxBase: *mut cuda_types::cusparse::cusparseIndexBase_t, valueType: *mut cuda_types::cusparse::cudaDataType, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseConstSpVecGet( spVecDescr: cuda_types::cusparse::cusparseConstSpVecDescr_t, size: *mut i64, nnz: *mut i64, indices: *mut *const ::core::ffi::c_void, values: *mut *const ::core::ffi::c_void, idxType: *mut cuda_types::cusparse::cusparseIndexType_t, idxBase: *mut cuda_types::cusparse::cusparseIndexBase_t, valueType: *mut cuda_types::cusparse::cudaDataType, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpVecGetIndexBase( spVecDescr: cuda_types::cusparse::cusparseConstSpVecDescr_t, idxBase: *mut cuda_types::cusparse::cusparseIndexBase_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpVecGetValues( spVecDescr: cuda_types::cusparse::cusparseSpVecDescr_t, values: *mut *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseConstSpVecGetValues( spVecDescr: cuda_types::cusparse::cusparseConstSpVecDescr_t, values: *mut *const ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpVecSetValues( spVecDescr: cuda_types::cusparse::cusparseSpVecDescr_t, values: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCreateDnVec( dnVecDescr: *mut cuda_types::cusparse::cusparseDnVecDescr_t, size: i64, values: *mut ::core::ffi::c_void, valueType: cuda_types::cusparse::cudaDataType, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCreateConstDnVec( dnVecDescr: *mut cuda_types::cusparse::cusparseConstDnVecDescr_t, size: i64, values: *const ::core::ffi::c_void, valueType: cuda_types::cusparse::cudaDataType, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDestroyDnVec( dnVecDescr: cuda_types::cusparse::cusparseConstDnVecDescr_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDnVecGet( dnVecDescr: cuda_types::cusparse::cusparseDnVecDescr_t, size: *mut i64, values: *mut *mut ::core::ffi::c_void, valueType: *mut cuda_types::cusparse::cudaDataType, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseConstDnVecGet( dnVecDescr: cuda_types::cusparse::cusparseConstDnVecDescr_t, size: *mut i64, values: *mut *const ::core::ffi::c_void, valueType: *mut cuda_types::cusparse::cudaDataType, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDnVecGetValues( dnVecDescr: cuda_types::cusparse::cusparseDnVecDescr_t, values: *mut *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseConstDnVecGetValues( dnVecDescr: cuda_types::cusparse::cusparseConstDnVecDescr_t, values: *mut *const ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDnVecSetValues( dnVecDescr: cuda_types::cusparse::cusparseDnVecDescr_t, values: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDestroySpMat( spMatDescr: cuda_types::cusparse::cusparseConstSpMatDescr_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpMatGetFormat( spMatDescr: cuda_types::cusparse::cusparseConstSpMatDescr_t, format: *mut cuda_types::cusparse::cusparseFormat_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpMatGetIndexBase( spMatDescr: cuda_types::cusparse::cusparseConstSpMatDescr_t, idxBase: *mut cuda_types::cusparse::cusparseIndexBase_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpMatGetValues( spMatDescr: cuda_types::cusparse::cusparseSpMatDescr_t, values: *mut *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseConstSpMatGetValues( spMatDescr: cuda_types::cusparse::cusparseConstSpMatDescr_t, values: *mut *const ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpMatSetValues( spMatDescr: cuda_types::cusparse::cusparseSpMatDescr_t, values: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpMatGetSize( spMatDescr: cuda_types::cusparse::cusparseConstSpMatDescr_t, rows: *mut i64, cols: *mut i64, nnz: *mut i64, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpMatGetStridedBatch( spMatDescr: cuda_types::cusparse::cusparseConstSpMatDescr_t, batchCount: *mut ::core::ffi::c_int, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCooSetStridedBatch( spMatDescr: cuda_types::cusparse::cusparseSpMatDescr_t, batchCount: ::core::ffi::c_int, batchStride: i64, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCsrSetStridedBatch( spMatDescr: cuda_types::cusparse::cusparseSpMatDescr_t, batchCount: ::core::ffi::c_int, offsetsBatchStride: i64, columnsValuesBatchStride: i64, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseBsrSetStridedBatch( spMatDescr: cuda_types::cusparse::cusparseSpMatDescr_t, batchCount: ::core::ffi::c_int, offsetsBatchStride: i64, columnsBatchStride: i64, ValuesBatchStride: i64, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpMatGetAttribute( spMatDescr: cuda_types::cusparse::cusparseConstSpMatDescr_t, attribute: cuda_types::cusparse::cusparseSpMatAttribute_t, data: *mut ::core::ffi::c_void, dataSize: usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpMatSetAttribute( spMatDescr: cuda_types::cusparse::cusparseSpMatDescr_t, attribute: cuda_types::cusparse::cusparseSpMatAttribute_t, data: *mut ::core::ffi::c_void, dataSize: usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCreateCsr( spMatDescr: *mut cuda_types::cusparse::cusparseSpMatDescr_t, rows: i64, cols: i64, nnz: i64, csrRowOffsets: *mut ::core::ffi::c_void, csrColInd: *mut ::core::ffi::c_void, csrValues: *mut ::core::ffi::c_void, csrRowOffsetsType: cuda_types::cusparse::cusparseIndexType_t, csrColIndType: cuda_types::cusparse::cusparseIndexType_t, idxBase: cuda_types::cusparse::cusparseIndexBase_t, valueType: cuda_types::cusparse::cudaDataType, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCreateConstCsr( spMatDescr: *mut cuda_types::cusparse::cusparseConstSpMatDescr_t, rows: i64, cols: i64, nnz: i64, csrRowOffsets: *const ::core::ffi::c_void, csrColInd: *const ::core::ffi::c_void, csrValues: *const ::core::ffi::c_void, csrRowOffsetsType: cuda_types::cusparse::cusparseIndexType_t, csrColIndType: cuda_types::cusparse::cusparseIndexType_t, idxBase: cuda_types::cusparse::cusparseIndexBase_t, valueType: cuda_types::cusparse::cudaDataType, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCreateCsc( spMatDescr: *mut cuda_types::cusparse::cusparseSpMatDescr_t, rows: i64, cols: i64, nnz: i64, cscColOffsets: *mut ::core::ffi::c_void, cscRowInd: *mut ::core::ffi::c_void, cscValues: *mut ::core::ffi::c_void, cscColOffsetsType: cuda_types::cusparse::cusparseIndexType_t, cscRowIndType: cuda_types::cusparse::cusparseIndexType_t, idxBase: cuda_types::cusparse::cusparseIndexBase_t, valueType: cuda_types::cusparse::cudaDataType, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCreateConstCsc( spMatDescr: *mut cuda_types::cusparse::cusparseConstSpMatDescr_t, rows: i64, cols: i64, nnz: i64, cscColOffsets: *const ::core::ffi::c_void, cscRowInd: *const ::core::ffi::c_void, cscValues: *const ::core::ffi::c_void, cscColOffsetsType: cuda_types::cusparse::cusparseIndexType_t, cscRowIndType: cuda_types::cusparse::cusparseIndexType_t, idxBase: cuda_types::cusparse::cusparseIndexBase_t, valueType: cuda_types::cusparse::cudaDataType, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCsrGet( spMatDescr: cuda_types::cusparse::cusparseSpMatDescr_t, rows: *mut i64, cols: *mut i64, nnz: *mut i64, csrRowOffsets: *mut *mut ::core::ffi::c_void, csrColInd: *mut *mut ::core::ffi::c_void, csrValues: *mut *mut ::core::ffi::c_void, csrRowOffsetsType: *mut cuda_types::cusparse::cusparseIndexType_t, csrColIndType: *mut cuda_types::cusparse::cusparseIndexType_t, idxBase: *mut cuda_types::cusparse::cusparseIndexBase_t, valueType: *mut cuda_types::cusparse::cudaDataType, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseConstCsrGet( spMatDescr: cuda_types::cusparse::cusparseConstSpMatDescr_t, rows: *mut i64, cols: *mut i64, nnz: *mut i64, csrRowOffsets: *mut *const ::core::ffi::c_void, csrColInd: *mut *const ::core::ffi::c_void, csrValues: *mut *const ::core::ffi::c_void, csrRowOffsetsType: *mut cuda_types::cusparse::cusparseIndexType_t, csrColIndType: *mut cuda_types::cusparse::cusparseIndexType_t, idxBase: *mut cuda_types::cusparse::cusparseIndexBase_t, valueType: *mut cuda_types::cusparse::cudaDataType, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCscGet( spMatDescr: cuda_types::cusparse::cusparseSpMatDescr_t, rows: *mut i64, cols: *mut i64, nnz: *mut i64, cscColOffsets: *mut *mut ::core::ffi::c_void, cscRowInd: *mut *mut ::core::ffi::c_void, cscValues: *mut *mut ::core::ffi::c_void, cscColOffsetsType: *mut cuda_types::cusparse::cusparseIndexType_t, cscRowIndType: *mut cuda_types::cusparse::cusparseIndexType_t, idxBase: *mut cuda_types::cusparse::cusparseIndexBase_t, valueType: *mut cuda_types::cusparse::cudaDataType, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseConstCscGet( spMatDescr: cuda_types::cusparse::cusparseConstSpMatDescr_t, rows: *mut i64, cols: *mut i64, nnz: *mut i64, cscColOffsets: *mut *const ::core::ffi::c_void, cscRowInd: *mut *const ::core::ffi::c_void, cscValues: *mut *const ::core::ffi::c_void, cscColOffsetsType: *mut cuda_types::cusparse::cusparseIndexType_t, cscRowIndType: *mut cuda_types::cusparse::cusparseIndexType_t, idxBase: *mut cuda_types::cusparse::cusparseIndexBase_t, valueType: *mut cuda_types::cusparse::cudaDataType, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCsrSetPointers( spMatDescr: cuda_types::cusparse::cusparseSpMatDescr_t, csrRowOffsets: *mut ::core::ffi::c_void, csrColInd: *mut ::core::ffi::c_void, csrValues: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCscSetPointers( spMatDescr: cuda_types::cusparse::cusparseSpMatDescr_t, cscColOffsets: *mut ::core::ffi::c_void, cscRowInd: *mut ::core::ffi::c_void, cscValues: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCreateBsr( spMatDescr: *mut cuda_types::cusparse::cusparseSpMatDescr_t, brows: i64, bcols: i64, bnnz: i64, rowBlockSize: i64, colBlockSize: i64, bsrRowOffsets: *mut ::core::ffi::c_void, bsrColInd: *mut ::core::ffi::c_void, bsrValues: *mut ::core::ffi::c_void, bsrRowOffsetsType: cuda_types::cusparse::cusparseIndexType_t, bsrColIndType: cuda_types::cusparse::cusparseIndexType_t, idxBase: cuda_types::cusparse::cusparseIndexBase_t, valueType: cuda_types::cusparse::cudaDataType, order: cuda_types::cusparse::cusparseOrder_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCreateConstBsr( spMatDescr: *mut cuda_types::cusparse::cusparseConstSpMatDescr_t, brows: i64, bcols: i64, bnnz: i64, rowBlockDim: i64, colBlockDim: i64, bsrRowOffsets: *const ::core::ffi::c_void, bsrColInd: *const ::core::ffi::c_void, bsrValues: *const ::core::ffi::c_void, bsrRowOffsetsType: cuda_types::cusparse::cusparseIndexType_t, bsrColIndType: cuda_types::cusparse::cusparseIndexType_t, idxBase: cuda_types::cusparse::cusparseIndexBase_t, valueType: cuda_types::cusparse::cudaDataType, order: cuda_types::cusparse::cusparseOrder_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCreateCoo( spMatDescr: *mut cuda_types::cusparse::cusparseSpMatDescr_t, rows: i64, cols: i64, nnz: i64, cooRowInd: *mut ::core::ffi::c_void, cooColInd: *mut ::core::ffi::c_void, cooValues: *mut ::core::ffi::c_void, cooIdxType: cuda_types::cusparse::cusparseIndexType_t, idxBase: cuda_types::cusparse::cusparseIndexBase_t, valueType: cuda_types::cusparse::cudaDataType, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCreateConstCoo( spMatDescr: *mut cuda_types::cusparse::cusparseConstSpMatDescr_t, rows: i64, cols: i64, nnz: i64, cooRowInd: *const ::core::ffi::c_void, cooColInd: *const ::core::ffi::c_void, cooValues: *const ::core::ffi::c_void, cooIdxType: cuda_types::cusparse::cusparseIndexType_t, idxBase: cuda_types::cusparse::cusparseIndexBase_t, valueType: cuda_types::cusparse::cudaDataType, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCooGet( spMatDescr: cuda_types::cusparse::cusparseSpMatDescr_t, rows: *mut i64, cols: *mut i64, nnz: *mut i64, cooRowInd: *mut *mut ::core::ffi::c_void, cooColInd: *mut *mut ::core::ffi::c_void, cooValues: *mut *mut ::core::ffi::c_void, idxType: *mut cuda_types::cusparse::cusparseIndexType_t, idxBase: *mut cuda_types::cusparse::cusparseIndexBase_t, valueType: *mut cuda_types::cusparse::cudaDataType, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseConstCooGet( spMatDescr: cuda_types::cusparse::cusparseConstSpMatDescr_t, rows: *mut i64, cols: *mut i64, nnz: *mut i64, cooRowInd: *mut *const ::core::ffi::c_void, cooColInd: *mut *const ::core::ffi::c_void, cooValues: *mut *const ::core::ffi::c_void, idxType: *mut cuda_types::cusparse::cusparseIndexType_t, idxBase: *mut cuda_types::cusparse::cusparseIndexBase_t, valueType: *mut cuda_types::cusparse::cudaDataType, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCooSetPointers( spMatDescr: cuda_types::cusparse::cusparseSpMatDescr_t, cooRows: *mut ::core::ffi::c_void, cooColumns: *mut ::core::ffi::c_void, cooValues: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCreateBlockedEll( spMatDescr: *mut cuda_types::cusparse::cusparseSpMatDescr_t, rows: i64, cols: i64, ellBlockSize: i64, ellCols: i64, ellColInd: *mut ::core::ffi::c_void, ellValue: *mut ::core::ffi::c_void, ellIdxType: cuda_types::cusparse::cusparseIndexType_t, idxBase: cuda_types::cusparse::cusparseIndexBase_t, valueType: cuda_types::cusparse::cudaDataType, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCreateConstBlockedEll( spMatDescr: *mut cuda_types::cusparse::cusparseConstSpMatDescr_t, rows: i64, cols: i64, ellBlockSize: i64, ellCols: i64, ellColInd: *const ::core::ffi::c_void, ellValue: *const ::core::ffi::c_void, ellIdxType: cuda_types::cusparse::cusparseIndexType_t, idxBase: cuda_types::cusparse::cusparseIndexBase_t, valueType: cuda_types::cusparse::cudaDataType, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseBlockedEllGet( spMatDescr: cuda_types::cusparse::cusparseSpMatDescr_t, rows: *mut i64, cols: *mut i64, ellBlockSize: *mut i64, ellCols: *mut i64, ellColInd: *mut *mut ::core::ffi::c_void, ellValue: *mut *mut ::core::ffi::c_void, ellIdxType: *mut cuda_types::cusparse::cusparseIndexType_t, idxBase: *mut cuda_types::cusparse::cusparseIndexBase_t, valueType: *mut cuda_types::cusparse::cudaDataType, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseConstBlockedEllGet( spMatDescr: cuda_types::cusparse::cusparseConstSpMatDescr_t, rows: *mut i64, cols: *mut i64, ellBlockSize: *mut i64, ellCols: *mut i64, ellColInd: *mut *const ::core::ffi::c_void, ellValue: *mut *const ::core::ffi::c_void, ellIdxType: *mut cuda_types::cusparse::cusparseIndexType_t, idxBase: *mut cuda_types::cusparse::cusparseIndexBase_t, valueType: *mut cuda_types::cusparse::cudaDataType, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCreateSlicedEll( spMatDescr: *mut cuda_types::cusparse::cusparseSpMatDescr_t, rows: i64, cols: i64, nnz: i64, sellValuesSize: i64, sliceSize: i64, sellSliceOffsets: *mut ::core::ffi::c_void, sellColInd: *mut ::core::ffi::c_void, sellValues: *mut ::core::ffi::c_void, sellSliceOffsetsType: cuda_types::cusparse::cusparseIndexType_t, sellColIndType: cuda_types::cusparse::cusparseIndexType_t, idxBase: cuda_types::cusparse::cusparseIndexBase_t, valueType: cuda_types::cusparse::cudaDataType, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCreateConstSlicedEll( spMatDescr: *mut cuda_types::cusparse::cusparseConstSpMatDescr_t, rows: i64, cols: i64, nnz: i64, sellValuesSize: i64, sliceSize: i64, sellSliceOffsets: *const ::core::ffi::c_void, sellColInd: *const ::core::ffi::c_void, sellValues: *const ::core::ffi::c_void, sellSliceOffsetsType: cuda_types::cusparse::cusparseIndexType_t, sellColIndType: cuda_types::cusparse::cusparseIndexType_t, idxBase: cuda_types::cusparse::cusparseIndexBase_t, valueType: cuda_types::cusparse::cudaDataType, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCreateDnMat( dnMatDescr: *mut cuda_types::cusparse::cusparseDnMatDescr_t, rows: i64, cols: i64, ld: i64, values: *mut ::core::ffi::c_void, valueType: cuda_types::cusparse::cudaDataType, order: cuda_types::cusparse::cusparseOrder_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseCreateConstDnMat( dnMatDescr: *mut cuda_types::cusparse::cusparseConstDnMatDescr_t, rows: i64, cols: i64, ld: i64, values: *const ::core::ffi::c_void, valueType: cuda_types::cusparse::cudaDataType, order: cuda_types::cusparse::cusparseOrder_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDestroyDnMat( dnMatDescr: cuda_types::cusparse::cusparseConstDnMatDescr_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDnMatGet( dnMatDescr: cuda_types::cusparse::cusparseDnMatDescr_t, rows: *mut i64, cols: *mut i64, ld: *mut i64, values: *mut *mut ::core::ffi::c_void, type_: *mut cuda_types::cusparse::cudaDataType, order: *mut cuda_types::cusparse::cusparseOrder_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseConstDnMatGet( dnMatDescr: cuda_types::cusparse::cusparseConstDnMatDescr_t, rows: *mut i64, cols: *mut i64, ld: *mut i64, values: *mut *const ::core::ffi::c_void, type_: *mut cuda_types::cusparse::cudaDataType, order: *mut cuda_types::cusparse::cusparseOrder_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDnMatGetValues( dnMatDescr: cuda_types::cusparse::cusparseDnMatDescr_t, values: *mut *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseConstDnMatGetValues( dnMatDescr: cuda_types::cusparse::cusparseConstDnMatDescr_t, values: *mut *const ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDnMatSetValues( dnMatDescr: cuda_types::cusparse::cusparseDnMatDescr_t, values: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDnMatSetStridedBatch( dnMatDescr: cuda_types::cusparse::cusparseDnMatDescr_t, batchCount: ::core::ffi::c_int, batchStride: i64, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDnMatGetStridedBatch( dnMatDescr: cuda_types::cusparse::cusparseConstDnMatDescr_t, batchCount: *mut ::core::ffi::c_int, batchStride: *mut i64, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseAxpby( handle: cuda_types::cusparse::cusparseHandle_t, alpha: *const ::core::ffi::c_void, vecX: cuda_types::cusparse::cusparseConstSpVecDescr_t, beta: *const ::core::ffi::c_void, vecY: cuda_types::cusparse::cusparseDnVecDescr_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseGather( handle: cuda_types::cusparse::cusparseHandle_t, vecY: cuda_types::cusparse::cusparseConstDnVecDescr_t, vecX: cuda_types::cusparse::cusparseSpVecDescr_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseScatter( handle: cuda_types::cusparse::cusparseHandle_t, vecX: cuda_types::cusparse::cusparseConstSpVecDescr_t, vecY: cuda_types::cusparse::cusparseDnVecDescr_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseRot( handle: cuda_types::cusparse::cusparseHandle_t, c_coeff: *const ::core::ffi::c_void, s_coeff: *const ::core::ffi::c_void, vecX: cuda_types::cusparse::cusparseSpVecDescr_t, vecY: cuda_types::cusparse::cusparseDnVecDescr_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpVV_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, opX: cuda_types::cusparse::cusparseOperation_t, vecX: cuda_types::cusparse::cusparseConstSpVecDescr_t, vecY: cuda_types::cusparse::cusparseConstDnVecDescr_t, result: *const ::core::ffi::c_void, computeType: cuda_types::cusparse::cudaDataType, bufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpVV( handle: cuda_types::cusparse::cusparseHandle_t, opX: cuda_types::cusparse::cusparseOperation_t, vecX: cuda_types::cusparse::cusparseConstSpVecDescr_t, vecY: cuda_types::cusparse::cusparseConstDnVecDescr_t, result: *mut ::core::ffi::c_void, computeType: cuda_types::cusparse::cudaDataType, externalBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSparseToDense_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, matA: cuda_types::cusparse::cusparseConstSpMatDescr_t, matB: cuda_types::cusparse::cusparseDnMatDescr_t, alg: cuda_types::cusparse::cusparseSparseToDenseAlg_t, bufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSparseToDense( handle: cuda_types::cusparse::cusparseHandle_t, matA: cuda_types::cusparse::cusparseConstSpMatDescr_t, matB: cuda_types::cusparse::cusparseDnMatDescr_t, alg: cuda_types::cusparse::cusparseSparseToDenseAlg_t, externalBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDenseToSparse_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, matA: cuda_types::cusparse::cusparseConstDnMatDescr_t, matB: cuda_types::cusparse::cusparseSpMatDescr_t, alg: cuda_types::cusparse::cusparseDenseToSparseAlg_t, bufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDenseToSparse_analysis( handle: cuda_types::cusparse::cusparseHandle_t, matA: cuda_types::cusparse::cusparseConstDnMatDescr_t, matB: cuda_types::cusparse::cusparseSpMatDescr_t, alg: cuda_types::cusparse::cusparseDenseToSparseAlg_t, externalBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseDenseToSparse_convert( handle: cuda_types::cusparse::cusparseHandle_t, matA: cuda_types::cusparse::cusparseConstDnMatDescr_t, matB: cuda_types::cusparse::cusparseSpMatDescr_t, alg: cuda_types::cusparse::cusparseDenseToSparseAlg_t, externalBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpMV( handle: cuda_types::cusparse::cusparseHandle_t, opA: cuda_types::cusparse::cusparseOperation_t, alpha: *const ::core::ffi::c_void, matA: cuda_types::cusparse::cusparseConstSpMatDescr_t, vecX: cuda_types::cusparse::cusparseConstDnVecDescr_t, beta: *const ::core::ffi::c_void, vecY: cuda_types::cusparse::cusparseDnVecDescr_t, computeType: cuda_types::cusparse::cudaDataType, alg: cuda_types::cusparse::cusparseSpMVAlg_t, externalBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpMV_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, opA: cuda_types::cusparse::cusparseOperation_t, alpha: *const ::core::ffi::c_void, matA: cuda_types::cusparse::cusparseConstSpMatDescr_t, vecX: cuda_types::cusparse::cusparseConstDnVecDescr_t, beta: *const ::core::ffi::c_void, vecY: cuda_types::cusparse::cusparseDnVecDescr_t, computeType: cuda_types::cusparse::cudaDataType, alg: cuda_types::cusparse::cusparseSpMVAlg_t, bufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpMV_preprocess( handle: cuda_types::cusparse::cusparseHandle_t, opA: cuda_types::cusparse::cusparseOperation_t, alpha: *const ::core::ffi::c_void, matA: cuda_types::cusparse::cusparseConstSpMatDescr_t, vecX: cuda_types::cusparse::cusparseConstDnVecDescr_t, beta: *const ::core::ffi::c_void, vecY: cuda_types::cusparse::cusparseDnVecDescr_t, computeType: cuda_types::cusparse::cudaDataType, alg: cuda_types::cusparse::cusparseSpMVAlg_t, externalBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpSV_createDescr( descr: *mut cuda_types::cusparse::cusparseSpSVDescr_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpSV_destroyDescr( descr: cuda_types::cusparse::cusparseSpSVDescr_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpSV_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, opA: cuda_types::cusparse::cusparseOperation_t, alpha: *const ::core::ffi::c_void, matA: cuda_types::cusparse::cusparseConstSpMatDescr_t, vecX: cuda_types::cusparse::cusparseConstDnVecDescr_t, vecY: cuda_types::cusparse::cusparseDnVecDescr_t, computeType: cuda_types::cusparse::cudaDataType, alg: cuda_types::cusparse::cusparseSpSVAlg_t, spsvDescr: cuda_types::cusparse::cusparseSpSVDescr_t, bufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpSV_analysis( handle: cuda_types::cusparse::cusparseHandle_t, opA: cuda_types::cusparse::cusparseOperation_t, alpha: *const ::core::ffi::c_void, matA: cuda_types::cusparse::cusparseConstSpMatDescr_t, vecX: cuda_types::cusparse::cusparseConstDnVecDescr_t, vecY: cuda_types::cusparse::cusparseDnVecDescr_t, computeType: cuda_types::cusparse::cudaDataType, alg: cuda_types::cusparse::cusparseSpSVAlg_t, spsvDescr: cuda_types::cusparse::cusparseSpSVDescr_t, externalBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpSV_solve( handle: cuda_types::cusparse::cusparseHandle_t, opA: cuda_types::cusparse::cusparseOperation_t, alpha: *const ::core::ffi::c_void, matA: cuda_types::cusparse::cusparseConstSpMatDescr_t, vecX: cuda_types::cusparse::cusparseConstDnVecDescr_t, vecY: cuda_types::cusparse::cusparseDnVecDescr_t, computeType: cuda_types::cusparse::cudaDataType, alg: cuda_types::cusparse::cusparseSpSVAlg_t, spsvDescr: cuda_types::cusparse::cusparseSpSVDescr_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpSV_updateMatrix( handle: cuda_types::cusparse::cusparseHandle_t, spsvDescr: cuda_types::cusparse::cusparseSpSVDescr_t, newValues: *mut ::core::ffi::c_void, updatePart: cuda_types::cusparse::cusparseSpSVUpdate_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpSM_createDescr( descr: *mut cuda_types::cusparse::cusparseSpSMDescr_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpSM_destroyDescr( descr: cuda_types::cusparse::cusparseSpSMDescr_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpSM_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, opA: cuda_types::cusparse::cusparseOperation_t, opB: cuda_types::cusparse::cusparseOperation_t, alpha: *const ::core::ffi::c_void, matA: cuda_types::cusparse::cusparseConstSpMatDescr_t, matB: cuda_types::cusparse::cusparseConstDnMatDescr_t, matC: cuda_types::cusparse::cusparseDnMatDescr_t, computeType: cuda_types::cusparse::cudaDataType, alg: cuda_types::cusparse::cusparseSpSMAlg_t, spsmDescr: cuda_types::cusparse::cusparseSpSMDescr_t, bufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpSM_analysis( handle: cuda_types::cusparse::cusparseHandle_t, opA: cuda_types::cusparse::cusparseOperation_t, opB: cuda_types::cusparse::cusparseOperation_t, alpha: *const ::core::ffi::c_void, matA: cuda_types::cusparse::cusparseConstSpMatDescr_t, matB: cuda_types::cusparse::cusparseConstDnMatDescr_t, matC: cuda_types::cusparse::cusparseDnMatDescr_t, computeType: cuda_types::cusparse::cudaDataType, alg: cuda_types::cusparse::cusparseSpSMAlg_t, spsmDescr: cuda_types::cusparse::cusparseSpSMDescr_t, externalBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpSM_solve( handle: cuda_types::cusparse::cusparseHandle_t, opA: cuda_types::cusparse::cusparseOperation_t, opB: cuda_types::cusparse::cusparseOperation_t, alpha: *const ::core::ffi::c_void, matA: cuda_types::cusparse::cusparseConstSpMatDescr_t, matB: cuda_types::cusparse::cusparseConstDnMatDescr_t, matC: cuda_types::cusparse::cusparseDnMatDescr_t, computeType: cuda_types::cusparse::cudaDataType, alg: cuda_types::cusparse::cusparseSpSMAlg_t, spsmDescr: cuda_types::cusparse::cusparseSpSMDescr_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpSM_updateMatrix( handle: cuda_types::cusparse::cusparseHandle_t, spsmDescr: cuda_types::cusparse::cusparseSpSMDescr_t, newValues: *mut ::core::ffi::c_void, updatePart: cuda_types::cusparse::cusparseSpSMUpdate_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpMM_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, opA: cuda_types::cusparse::cusparseOperation_t, opB: cuda_types::cusparse::cusparseOperation_t, alpha: *const ::core::ffi::c_void, matA: cuda_types::cusparse::cusparseConstSpMatDescr_t, matB: cuda_types::cusparse::cusparseConstDnMatDescr_t, beta: *const ::core::ffi::c_void, matC: cuda_types::cusparse::cusparseDnMatDescr_t, computeType: cuda_types::cusparse::cudaDataType, alg: cuda_types::cusparse::cusparseSpMMAlg_t, bufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpMM_preprocess( handle: cuda_types::cusparse::cusparseHandle_t, opA: cuda_types::cusparse::cusparseOperation_t, opB: cuda_types::cusparse::cusparseOperation_t, alpha: *const ::core::ffi::c_void, matA: cuda_types::cusparse::cusparseConstSpMatDescr_t, matB: cuda_types::cusparse::cusparseConstDnMatDescr_t, beta: *const ::core::ffi::c_void, matC: cuda_types::cusparse::cusparseDnMatDescr_t, computeType: cuda_types::cusparse::cudaDataType, alg: cuda_types::cusparse::cusparseSpMMAlg_t, externalBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpMM( handle: cuda_types::cusparse::cusparseHandle_t, opA: cuda_types::cusparse::cusparseOperation_t, opB: cuda_types::cusparse::cusparseOperation_t, alpha: *const ::core::ffi::c_void, matA: cuda_types::cusparse::cusparseConstSpMatDescr_t, matB: cuda_types::cusparse::cusparseConstDnMatDescr_t, beta: *const ::core::ffi::c_void, matC: cuda_types::cusparse::cusparseDnMatDescr_t, computeType: cuda_types::cusparse::cudaDataType, alg: cuda_types::cusparse::cusparseSpMMAlg_t, externalBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpGEMM_createDescr( descr: *mut cuda_types::cusparse::cusparseSpGEMMDescr_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpGEMM_destroyDescr( descr: cuda_types::cusparse::cusparseSpGEMMDescr_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpGEMM_workEstimation( handle: cuda_types::cusparse::cusparseHandle_t, opA: cuda_types::cusparse::cusparseOperation_t, opB: cuda_types::cusparse::cusparseOperation_t, alpha: *const ::core::ffi::c_void, matA: cuda_types::cusparse::cusparseConstSpMatDescr_t, matB: cuda_types::cusparse::cusparseConstSpMatDescr_t, beta: *const ::core::ffi::c_void, matC: cuda_types::cusparse::cusparseSpMatDescr_t, computeType: cuda_types::cusparse::cudaDataType, alg: cuda_types::cusparse::cusparseSpGEMMAlg_t, spgemmDescr: cuda_types::cusparse::cusparseSpGEMMDescr_t, bufferSize1: *mut usize, externalBuffer1: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpGEMM_getNumProducts( spgemmDescr: cuda_types::cusparse::cusparseSpGEMMDescr_t, num_prods: *mut i64, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpGEMM_estimateMemory( handle: cuda_types::cusparse::cusparseHandle_t, opA: cuda_types::cusparse::cusparseOperation_t, opB: cuda_types::cusparse::cusparseOperation_t, alpha: *const ::core::ffi::c_void, matA: cuda_types::cusparse::cusparseConstSpMatDescr_t, matB: cuda_types::cusparse::cusparseConstSpMatDescr_t, beta: *const ::core::ffi::c_void, matC: cuda_types::cusparse::cusparseSpMatDescr_t, computeType: cuda_types::cusparse::cudaDataType, alg: cuda_types::cusparse::cusparseSpGEMMAlg_t, spgemmDescr: cuda_types::cusparse::cusparseSpGEMMDescr_t, chunk_fraction: f32, bufferSize3: *mut usize, externalBuffer3: *mut ::core::ffi::c_void, bufferSize2: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpGEMM_compute( handle: cuda_types::cusparse::cusparseHandle_t, opA: cuda_types::cusparse::cusparseOperation_t, opB: cuda_types::cusparse::cusparseOperation_t, alpha: *const ::core::ffi::c_void, matA: cuda_types::cusparse::cusparseConstSpMatDescr_t, matB: cuda_types::cusparse::cusparseConstSpMatDescr_t, beta: *const ::core::ffi::c_void, matC: cuda_types::cusparse::cusparseSpMatDescr_t, computeType: cuda_types::cusparse::cudaDataType, alg: cuda_types::cusparse::cusparseSpGEMMAlg_t, spgemmDescr: cuda_types::cusparse::cusparseSpGEMMDescr_t, bufferSize2: *mut usize, externalBuffer2: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpGEMM_copy( handle: cuda_types::cusparse::cusparseHandle_t, opA: cuda_types::cusparse::cusparseOperation_t, opB: cuda_types::cusparse::cusparseOperation_t, alpha: *const ::core::ffi::c_void, matA: cuda_types::cusparse::cusparseConstSpMatDescr_t, matB: cuda_types::cusparse::cusparseConstSpMatDescr_t, beta: *const ::core::ffi::c_void, matC: cuda_types::cusparse::cusparseSpMatDescr_t, computeType: cuda_types::cusparse::cudaDataType, alg: cuda_types::cusparse::cusparseSpGEMMAlg_t, spgemmDescr: cuda_types::cusparse::cusparseSpGEMMDescr_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpGEMMreuse_workEstimation( handle: cuda_types::cusparse::cusparseHandle_t, opA: cuda_types::cusparse::cusparseOperation_t, opB: cuda_types::cusparse::cusparseOperation_t, matA: cuda_types::cusparse::cusparseConstSpMatDescr_t, matB: cuda_types::cusparse::cusparseConstSpMatDescr_t, matC: cuda_types::cusparse::cusparseSpMatDescr_t, alg: cuda_types::cusparse::cusparseSpGEMMAlg_t, spgemmDescr: cuda_types::cusparse::cusparseSpGEMMDescr_t, bufferSize1: *mut usize, externalBuffer1: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpGEMMreuse_nnz( handle: cuda_types::cusparse::cusparseHandle_t, opA: cuda_types::cusparse::cusparseOperation_t, opB: cuda_types::cusparse::cusparseOperation_t, matA: cuda_types::cusparse::cusparseConstSpMatDescr_t, matB: cuda_types::cusparse::cusparseConstSpMatDescr_t, matC: cuda_types::cusparse::cusparseSpMatDescr_t, alg: cuda_types::cusparse::cusparseSpGEMMAlg_t, spgemmDescr: cuda_types::cusparse::cusparseSpGEMMDescr_t, bufferSize2: *mut usize, externalBuffer2: *mut ::core::ffi::c_void, bufferSize3: *mut usize, externalBuffer3: *mut ::core::ffi::c_void, bufferSize4: *mut usize, externalBuffer4: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpGEMMreuse_copy( handle: cuda_types::cusparse::cusparseHandle_t, opA: cuda_types::cusparse::cusparseOperation_t, opB: cuda_types::cusparse::cusparseOperation_t, matA: cuda_types::cusparse::cusparseConstSpMatDescr_t, matB: cuda_types::cusparse::cusparseConstSpMatDescr_t, matC: cuda_types::cusparse::cusparseSpMatDescr_t, alg: cuda_types::cusparse::cusparseSpGEMMAlg_t, spgemmDescr: cuda_types::cusparse::cusparseSpGEMMDescr_t, bufferSize5: *mut usize, externalBuffer5: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpGEMMreuse_compute( handle: cuda_types::cusparse::cusparseHandle_t, opA: cuda_types::cusparse::cusparseOperation_t, opB: cuda_types::cusparse::cusparseOperation_t, alpha: *const ::core::ffi::c_void, matA: cuda_types::cusparse::cusparseConstSpMatDescr_t, matB: cuda_types::cusparse::cusparseConstSpMatDescr_t, beta: *const ::core::ffi::c_void, matC: cuda_types::cusparse::cusparseSpMatDescr_t, computeType: cuda_types::cusparse::cudaDataType, alg: cuda_types::cusparse::cusparseSpGEMMAlg_t, spgemmDescr: cuda_types::cusparse::cusparseSpGEMMDescr_t, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSDDMM_bufferSize( handle: cuda_types::cusparse::cusparseHandle_t, opA: cuda_types::cusparse::cusparseOperation_t, opB: cuda_types::cusparse::cusparseOperation_t, alpha: *const ::core::ffi::c_void, matA: cuda_types::cusparse::cusparseConstDnMatDescr_t, matB: cuda_types::cusparse::cusparseConstDnMatDescr_t, beta: *const ::core::ffi::c_void, matC: cuda_types::cusparse::cusparseSpMatDescr_t, computeType: cuda_types::cusparse::cudaDataType, alg: cuda_types::cusparse::cusparseSDDMMAlg_t, bufferSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSDDMM_preprocess( handle: cuda_types::cusparse::cusparseHandle_t, opA: cuda_types::cusparse::cusparseOperation_t, opB: cuda_types::cusparse::cusparseOperation_t, alpha: *const ::core::ffi::c_void, matA: cuda_types::cusparse::cusparseConstDnMatDescr_t, matB: cuda_types::cusparse::cusparseConstDnMatDescr_t, beta: *const ::core::ffi::c_void, matC: cuda_types::cusparse::cusparseSpMatDescr_t, computeType: cuda_types::cusparse::cudaDataType, alg: cuda_types::cusparse::cusparseSDDMMAlg_t, externalBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSDDMM( handle: cuda_types::cusparse::cusparseHandle_t, opA: cuda_types::cusparse::cusparseOperation_t, opB: cuda_types::cusparse::cusparseOperation_t, alpha: *const ::core::ffi::c_void, matA: cuda_types::cusparse::cusparseConstDnMatDescr_t, matB: cuda_types::cusparse::cusparseConstDnMatDescr_t, beta: *const ::core::ffi::c_void, matC: cuda_types::cusparse::cusparseSpMatDescr_t, computeType: cuda_types::cusparse::cudaDataType, alg: cuda_types::cusparse::cusparseSDDMMAlg_t, externalBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpMMOp_createPlan( handle: cuda_types::cusparse::cusparseHandle_t, plan: *mut cuda_types::cusparse::cusparseSpMMOpPlan_t, opA: cuda_types::cusparse::cusparseOperation_t, opB: cuda_types::cusparse::cusparseOperation_t, matA: cuda_types::cusparse::cusparseConstSpMatDescr_t, matB: cuda_types::cusparse::cusparseConstDnMatDescr_t, matC: cuda_types::cusparse::cusparseDnMatDescr_t, computeType: cuda_types::cusparse::cudaDataType, alg: cuda_types::cusparse::cusparseSpMMOpAlg_t, addOperationNvvmBuffer: *const ::core::ffi::c_void, addOperationBufferSize: usize, mulOperationNvvmBuffer: *const ::core::ffi::c_void, mulOperationBufferSize: usize, epilogueNvvmBuffer: *const ::core::ffi::c_void, epilogueBufferSize: usize, SpMMWorkspaceSize: *mut usize, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpMMOp( plan: cuda_types::cusparse::cusparseSpMMOpPlan_t, externalBuffer: *mut ::core::ffi::c_void, ) -> cuda_types::cusparse::cusparseStatus_t; #[must_use] fn cusparseSpMMOp_destroyPlan( plan: cuda_types::cusparse::cusparseSpMMOpPlan_t, ) -> cuda_types::cusparse::cusparseStatus_t; } ================================================ FILE: cuda_macros/src/lib.rs ================================================ extern crate proc_macro; use proc_macro::TokenStream; use proc_macro2::Span; use quote::{format_ident, quote, ToTokens}; use rustc_hash::FxHashMap; use std::iter; use syn::parse::{Parse, ParseStream}; use syn::punctuated::Punctuated; use syn::visit_mut::VisitMut; use syn::{ bracketed, parse_macro_input, File, ForeignItem, ForeignItemFn, Ident, Item, Path, Signature, Token }; const CUDA_RS: &'static str = include_str! {"cuda.rs"}; const NVML_RS: &'static str = include_str! {"nvml.rs"}; const CUBLAS_RS: &'static str = include_str! {"cublas.rs"}; const CUBLASLT_RS: &'static str = include_str! {"cublaslt.rs"}; const CUBLASLT_INTERNAL_RS: &'static str = include_str! {"cublaslt_internal.rs"}; const CUFFT_RS: &'static str = include_str! {"cufft.rs"}; const CUSPARSE_RS: &'static str = include_str! {"cusparse.rs"}; const CUDNN8_RS: &'static str = include_str! {"cudnn8.rs"}; const CUDNN9_RS: &'static str = include_str! {"cudnn9.rs"}; const ROCBLAS_RS: &'static str = include_str! {"../../ext/rocblas-sys/src/lib.rs"}; const ROCSPARSE_RS: &'static str = include_str! {"../../ext/rocsparse-sys/src/lib.rs"}; const HIPBLASLT_RS: &'static str = include_str! {"../../ext/hipblaslt-sys/src/lib.rs"}; const MIOPEN_RS: &'static str = include_str! {"../../ext/miopen-sys/src/lib.rs"}; // This macro accepts following arguments: // * `normal_macro`: ident for a normal macro // * zero or more: // * `override_macro`: ident for an override macro // * `override_fns`: list of override functions // Then macro goes through every function in rust.rs, and for every fn `foo`: // * if `foo` is contained in `override_fns` then pass it into `override_macro` // * if `foo` is not contained in `override_fns` pass it to `normal_macro` // Both `override_macro` and `normal_macro` expect semicolon-separated list: // macro_foo!( // "system" fn cuCtxDetach(ctx: CUcontext) -> CUresult; // "system" fn cuCtxDetach(ctx: CUcontext) -> CUresult // ) // Additionally, it does a fixup of CUDA types so they get prefixed with `type_path` #[proc_macro] pub fn cuda_function_declarations(tokens: TokenStream) -> TokenStream { function_declarations(tokens, CUDA_RS, false) } #[proc_macro] pub fn cublas_function_declarations(tokens: TokenStream) -> TokenStream { function_declarations(tokens, CUBLAS_RS, false) } #[proc_macro] pub fn cublaslt_function_declarations(tokens: TokenStream) -> TokenStream { function_declarations(tokens, CUBLASLT_RS, false) } #[proc_macro] pub fn cublaslt_internal_function_declarations(tokens: TokenStream) -> TokenStream { function_declarations(tokens, CUBLASLT_INTERNAL_RS, false) } #[proc_macro] pub fn cufft_function_declarations(tokens: TokenStream) -> TokenStream { function_declarations(tokens, CUFFT_RS, false) } #[proc_macro] pub fn cusparse_function_declarations(tokens: TokenStream) -> TokenStream { function_declarations(tokens, CUSPARSE_RS, false) } #[proc_macro] pub fn cudnn8_function_declarations(tokens: TokenStream) -> TokenStream { function_declarations(tokens, CUDNN8_RS, false) } #[proc_macro] pub fn cudnn9_function_declarations(tokens: TokenStream) -> TokenStream { function_declarations(tokens, CUDNN9_RS, false) } #[proc_macro] pub fn rocblas_function_declarations(tokens: TokenStream) -> TokenStream { function_declarations(tokens, ROCBLAS_RS, true) } #[proc_macro] pub fn rocsparse_function_declarations(tokens: TokenStream) -> TokenStream { function_declarations(tokens, ROCSPARSE_RS, true) } #[proc_macro] pub fn hipblaslt_function_declarations(tokens: TokenStream) -> TokenStream { function_declarations(tokens, HIPBLASLT_RS, true) } #[proc_macro] pub fn miopen_function_declarations(tokens: TokenStream) -> TokenStream { function_declarations(tokens, MIOPEN_RS, true) } fn function_declarations(tokens: TokenStream, module: &str, relaxed: bool) -> TokenStream { let input = parse_macro_input!(tokens as FnDeclInput); let mut cuda_module = syn::parse_str::(module).unwrap(); let mut choose_macro = ChooseMacro::new(input); syn::visit_mut::visit_file_mut(&mut FixFnSignatures, &mut cuda_module); for item in cuda_module.items { let extern_ = if let Item::ForeignMod(extern_) = item { extern_ } else if relaxed { continue; } else { unreachable!() }; let abi = extern_.abi.name; for mut item in extern_.items { if let ForeignItem::Fn(ForeignItemFn { sig: Signature { ref ident, ref mut output, ref variadic, .. }, ref mut attrs, ref mut vis, .. }) = item { if relaxed { if variadic.is_some() { continue; } *vis = syn::Visibility::Inherited; if output == &syn::ReturnType::Default { *output = syn::ReturnType::Type( Token![->](Span::call_site()), Box::new(syn::parse_quote! { () }), ); } } *attrs = Vec::new(); choose_macro.add(ident, quote! { #abi #item }); } else { unreachable!() } } } let mut result = proc_macro2::TokenStream::new(); for (path, items) in iter::once(choose_macro.default).chain(choose_macro.override_sets.into_iter()) { if items.is_empty() { continue; } quote! { #path ! { #(#items)* } } .to_tokens(&mut result); } result.into() } #[proc_macro] pub fn nvml_function_declarations(tokens: TokenStream) -> TokenStream { function_declarations(tokens, NVML_RS, false) } struct FnDeclInput { normal_macro: Path, overrides: Punctuated, } impl Parse for FnDeclInput { fn parse(input: ParseStream) -> syn::Result { let normal_macro = input.parse::()?; let overrides = if input.is_empty() { Punctuated::new() } else { input.parse::()?; input.parse_terminated(OverrideMacro::parse, Token![,])? }; Ok(Self { normal_macro, overrides, }) } } struct OverrideMacro { macro_: Path, functions: Punctuated, } impl Parse for OverrideMacro { fn parse(input: ParseStream) -> syn::Result { let macro_ = input.parse::()?; input.parse::()?; let functions_content; bracketed!(functions_content in input); let functions = functions_content.parse_terminated(Ident::parse, Token![,])?; Ok(Self { macro_, functions }) } } struct ChooseMacro { default: (Path, Vec), override_lookup: FxHashMap, override_sets: FxHashMap>, } impl ChooseMacro { fn new(input: FnDeclInput) -> Self { let mut override_lookup = FxHashMap::default(); let mut override_sets = FxHashMap::default(); for OverrideMacro { macro_, functions } in input.overrides { for ident in functions { override_lookup.insert(ident, macro_.clone()); override_sets.insert(macro_.clone(), Vec::new()); } } Self { default: (input.normal_macro, Vec::new()), override_lookup, override_sets, } } fn add(&mut self, ident: &Ident, tokens: proc_macro2::TokenStream) { match self.override_lookup.get(ident) { Some(override_macro) => { self.override_sets .get_mut(override_macro) .unwrap() .push(tokens); } None => self.default.1.push(tokens), } } } // For some reason prettyplease will append trailing comma *only* // if there are two or more arguments struct FixFnSignatures; impl VisitMut for FixFnSignatures { fn visit_signature_mut(&mut self, s: &mut syn::Signature) { s.inputs.pop_punct(); } } const MODULES: &[&str] = &[ "context", "device", "driver", "event", "function", "graph", "kernel", "library", "link", "memory", "module", "pointer", "stream" ]; fn normalize_fn_impl( prefix: &str, default_module: Option<&str>, tokens: TokenStream, ) -> TokenStream { let mut path = parse_macro_input!(tokens as syn::Path); let fn_ = path .segments .pop() .unwrap() .into_tuple() .0 .ident .to_string(); let already_has_module = MODULES.contains(&&*path.segments.last().unwrap().ident.to_string()); let segments: Vec = split(&fn_[prefix.len()..]); // skip "cu" let fn_path = join(segments, default_module.filter(|_| !already_has_module)); quote! { #path #fn_path } .into() } #[proc_macro] pub fn cuda_normalize_fn(tokens: TokenStream) -> TokenStream { normalize_fn_impl("cu", Some("driver"), tokens) } #[proc_macro] pub fn cublas_normalize_fn(tokens: TokenStream) -> TokenStream { normalize_fn_impl("cublas", None, tokens) } #[proc_macro] pub fn cublaslt_normalize_fn(tokens: TokenStream) -> TokenStream { normalize_fn_impl("cublasLt", None, tokens) } #[proc_macro] pub fn cudnn_normalize_fn(tokens: TokenStream) -> TokenStream { normalize_fn_impl("cudnn", None, tokens) } #[proc_macro] pub fn cusparse_normalize_fn(tokens: TokenStream) -> TokenStream { normalize_fn_impl("cusparse", None, tokens) } #[proc_macro] pub fn nvml_normalize_fn(tokens: TokenStream) -> TokenStream { normalize_fn_impl("nvml", None, tokens) } fn split(fn_: &str) -> Vec { let mut result = Vec::new(); let mut chars: iter::Peekable<_> = fn_.chars().peekable(); while let Some(c) = chars.next() { // Special handling of 2D/3D etc. if c.is_ascii_digit() && chars.peek() == Some(&'D') { chars.next(); result.push(format!("{c}d")); continue; } if c.is_ascii_uppercase() { result.push(c.to_ascii_lowercase().to_string()); } else { result.last_mut().unwrap().push(c); } } result } fn join( fn_: Vec, default_module: Option<&str>, ) -> Punctuated { fn full_form(segment: &str) -> Option<&[&str]> { Some(match segment { "ctx" => &["context"], "func" => &["function"], "mem" => &["memory"], "memcpy" => &["memory", "copy"], "memset" => &["memory", "set"], _ => return None, }) } let mut normalized: Vec<&str> = Vec::new(); for segment in fn_.iter() { match full_form(segment) { Some(segments) => normalized.extend(segments.into_iter()), None => normalized.push(&*segment), } } if let Some(default_module) = default_module { if !MODULES.contains(&normalized[0]) { let mut globalized = vec![default_module]; globalized.extend(normalized); normalized = globalized; } let (module, path) = normalized.split_first().unwrap(); let path = path.join("_"); [module, &&*path] .into_iter() .map(|s| Ident::new(s, Span::call_site())) .collect() } else { return [Ident::new(&normalized.join("_"), Span::call_site())] .into_iter() .collect(); } } #[proc_macro_attribute] pub fn test_cuda(_attr: TokenStream, item: TokenStream) -> TokenStream { let fn_ = parse_macro_input!(item as syn::ItemFn); let cuda_fn = format_ident!("{}{}", fn_.sig.ident, "_nvidia"); let zluda_fn = format_ident!("{}{}", fn_.sig.ident, "_zluda"); let fn_name = fn_.sig.ident.clone(); quote! { #[test] fn #cuda_fn() { unsafe { #fn_name(::new()) } } #[test] fn #zluda_fn() { unsafe { #fn_name(::new()) } } #fn_ }.into() } ================================================ FILE: cuda_macros/src/nvml.rs ================================================ // Generated automatically by zluda_bindgen // DO NOT EDIT MANUALLY #![allow(warnings)] extern "system" { #[must_use] /** Initialize NVML, but don't initialize any GPUs yet. \note nvmlInit_v3 introduces a "flags" argument, that allows passing boolean values modifying the behaviour of nvmlInit(). \note In NVML 5.319 new nvmlInit_v2 has replaced nvmlInit"_v1" (default in NVML 4.304 and older) that did initialize all GPU devices in the system. This allows NVML to communicate with a GPU when other GPUs in the system are unstable or in a bad state. When using this API, GPUs are discovered and initialized in nvmlDeviceGetHandleBy* functions instead. \note To contrast nvmlInit_v2 with nvmlInit"_v1", NVML 4.304 nvmlInit"_v1" will fail when any detected GPU is in a bad or unstable state. For all products. This method, should be called once before invoking any other methods in the library. A reference count of the number of initializations is maintained. Shutdown only occurs when the reference count reaches zero. @return - \ref NVML_SUCCESS if NVML has been properly initialized - \ref NVML_ERROR_DRIVER_NOT_LOADED if NVIDIA driver is not running - \ref NVML_ERROR_NO_PERMISSION if NVML does not have permission to talk to the driver - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlInit_v2() -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** nvmlInitWithFlags is a variant of nvmlInit(), that allows passing a set of boolean values modifying the behaviour of nvmlInit(). Other than the "flags" parameter it is completely similar to \ref nvmlInit_v2. For all products. @param flags behaviour modifier flags @return - \ref NVML_SUCCESS if NVML has been properly initialized - \ref NVML_ERROR_DRIVER_NOT_LOADED if NVIDIA driver is not running - \ref NVML_ERROR_NO_PERMISSION if NVML does not have permission to talk to the driver - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlInitWithFlags(flags: ::core::ffi::c_uint) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Shut down NVML by releasing all GPU resources previously allocated with \ref nvmlInit_v2(). For all products. This method should be called after NVML work is done, once for each call to \ref nvmlInit_v2() A reference count of the number of initializations is maintained. Shutdown only occurs when the reference count reaches zero. For backwards compatibility, no error is reported if nvmlShutdown() is called more times than nvmlInit(). @return - \ref NVML_SUCCESS if NVML has been properly shut down - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlShutdown() -> cuda_types::nvml::nvmlReturn_t; /** Helper method for converting NVML error codes into readable strings. For all products. @param result NVML error code to convert @return String representation of the error. */ fn nvmlErrorString( result: cuda_types::nvml::nvmlReturn_t, ) -> *const ::core::ffi::c_char; #[must_use] /** Retrieves the version of the system's graphics driver. For all products. The version identifier is an alphanumeric string. It will not exceed 80 characters in length (including the NULL terminator). See \ref nvmlConstants::NVML_SYSTEM_DRIVER_VERSION_BUFFER_SIZE. @param version Reference in which to return the version identifier @param length The maximum allowed length of the string returned in \a version @return - \ref NVML_SUCCESS if \a version has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a version is NULL - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small*/ fn nvmlSystemGetDriverVersion( version: *mut ::core::ffi::c_char, length: ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the version of the NVML library. For all products. The version identifier is an alphanumeric string. It will not exceed 80 characters in length (including the NULL terminator). See \ref nvmlConstants::NVML_SYSTEM_NVML_VERSION_BUFFER_SIZE. @param version Reference in which to return the version identifier @param length The maximum allowed length of the string returned in \a version @return - \ref NVML_SUCCESS if \a version has been set - \ref NVML_ERROR_INVALID_ARGUMENT if \a version is NULL - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small*/ fn nvmlSystemGetNVMLVersion( version: *mut ::core::ffi::c_char, length: ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the version of the CUDA driver. For all products. The CUDA driver version returned will be retreived from the currently installed version of CUDA. If the cuda library is not found, this function will return a known supported version number. @param cudaDriverVersion Reference in which to return the version identifier @return - \ref NVML_SUCCESS if \a cudaDriverVersion has been set - \ref NVML_ERROR_INVALID_ARGUMENT if \a cudaDriverVersion is NULL*/ fn nvmlSystemGetCudaDriverVersion( cudaDriverVersion: *mut ::core::ffi::c_int, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the version of the CUDA driver from the shared library. For all products. The returned CUDA driver version by calling cuDriverGetVersion() @param cudaDriverVersion Reference in which to return the version identifier @return - \ref NVML_SUCCESS if \a cudaDriverVersion has been set - \ref NVML_ERROR_INVALID_ARGUMENT if \a cudaDriverVersion is NULL - \ref NVML_ERROR_LIBRARY_NOT_FOUND if \a libcuda.so.1 or libcuda.dll is not found - \ref NVML_ERROR_FUNCTION_NOT_FOUND if \a cuDriverGetVersion() is not found in the shared library*/ fn nvmlSystemGetCudaDriverVersion_v2( cudaDriverVersion: *mut ::core::ffi::c_int, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Gets name of the process with provided process id For all products. Returned process name is cropped to provided length. name string is encoded in ANSI. @param pid The identifier of the process @param name Reference in which to return the process name @param length The maximum allowed length of the string returned in \a name @return - \ref NVML_SUCCESS if \a name has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a name is NULL or \a length is 0. - \ref NVML_ERROR_NOT_FOUND if process doesn't exists - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlSystemGetProcessName( pid: ::core::ffi::c_uint, name: *mut ::core::ffi::c_char, length: ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the IDs and firmware versions for any Host Interface Cards (HICs) in the system. For S-class products. The \a hwbcCount argument is expected to be set to the size of the input \a hwbcEntries array. The HIC must be connected to an S-class system for it to be reported by this function. @param hwbcCount Size of hwbcEntries array @param hwbcEntries Array holding information about hwbc @return - \ref NVML_SUCCESS if \a hwbcCount and \a hwbcEntries have been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if either \a hwbcCount or \a hwbcEntries is NULL - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a hwbcCount indicates that the \a hwbcEntries array is too small*/ fn nvmlSystemGetHicVersion( hwbcCount: *mut ::core::ffi::c_uint, hwbcEntries: *mut cuda_types::nvml::nvmlHwbcEntry_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the set of GPUs that have a CPU affinity with the given CPU number For all products. Supported on Linux only. @param cpuNumber The CPU number @param count When zero, is set to the number of matching GPUs such that \a deviceArray can be malloc'd. When non-zero, \a deviceArray will be filled with \a count number of device handles. @param deviceArray An array of device handles for GPUs found with affinity to \a cpuNumber @return - \ref NVML_SUCCESS if \a deviceArray or \a count (if initially zero) has been set - \ref NVML_ERROR_INVALID_ARGUMENT if \a cpuNumber, or \a count is invalid, or \a deviceArray is NULL with a non-zero \a count - \ref NVML_ERROR_NOT_SUPPORTED if the device or OS does not support this feature - \ref NVML_ERROR_UNKNOWN an error has occurred in underlying topology discovery*/ fn nvmlSystemGetTopologyGpuSet( cpuNumber: ::core::ffi::c_uint, count: *mut ::core::ffi::c_uint, deviceArray: *mut cuda_types::nvml::nvmlDevice_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the driver branch of the NVIDIA driver installed on the system. For all products. The branch identifier is an alphanumeric string. It will not exceed 80 characters in length (including the NULL terminator). See \ref nvmlConstants::NVML_SYSTEM_DRIVER_VERSION_BUFFER_SIZE. @param branchInfo Pointer to the driver branch information structure \a nvmlSystemDriverBranchInfo_t @param length The maximum allowed length of the driver branch string @return - \ref NVML_SUCCESS successful completion - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a branchInfo is NULL - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlSystemGetDriverBranch( branchInfo: *mut cuda_types::nvml::nvmlSystemDriverBranchInfo_t, length: ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the number of units in the system. For S-class products. @param unitCount Reference in which to return the number of units @return - \ref NVML_SUCCESS if \a unitCount has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a unitCount is NULL - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlUnitGetCount( unitCount: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Acquire the handle for a particular unit, based on its index. For S-class products. Valid indices are derived from the \a unitCount returned by \ref nvmlUnitGetCount(). For example, if \a unitCount is 2 the valid indices are 0 and 1, corresponding to UNIT 0 and UNIT 1. The order in which NVML enumerates units has no guarantees of consistency between reboots. @param index The index of the target unit, >= 0 and < \a unitCount @param unit Reference in which to return the unit handle @return - \ref NVML_SUCCESS if \a unit has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a index is invalid or \a unit is NULL - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlUnitGetHandleByIndex( index: ::core::ffi::c_uint, unit: *mut cuda_types::nvml::nvmlUnit_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the static information associated with a unit. For S-class products. See \ref nvmlUnitInfo_t for details on available unit info. @param unit The identifier of the target unit @param info Reference in which to return the unit information @return - \ref NVML_SUCCESS if \a info has been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a unit is invalid or \a info is NULL*/ fn nvmlUnitGetUnitInfo( unit: cuda_types::nvml::nvmlUnit_t, info: *mut cuda_types::nvml::nvmlUnitInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the LED state associated with this unit. For S-class products. See \ref nvmlLedState_t for details on allowed states. @param unit The identifier of the target unit @param state Reference in which to return the current LED state @return - \ref NVML_SUCCESS if \a state has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a unit is invalid or \a state is NULL - \ref NVML_ERROR_NOT_SUPPORTED if this is not an S-class product - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlUnitSetLedState()*/ fn nvmlUnitGetLedState( unit: cuda_types::nvml::nvmlUnit_t, state: *mut cuda_types::nvml::nvmlLedState_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the PSU stats for the unit. For S-class products. See \ref nvmlPSUInfo_t for details on available PSU info. @param unit The identifier of the target unit @param psu Reference in which to return the PSU information @return - \ref NVML_SUCCESS if \a psu has been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a unit is invalid or \a psu is NULL - \ref NVML_ERROR_NOT_SUPPORTED if this is not an S-class product - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlUnitGetPsuInfo( unit: cuda_types::nvml::nvmlUnit_t, psu: *mut cuda_types::nvml::nvmlPSUInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the temperature readings for the unit, in degrees C. For S-class products. Depending on the product, readings may be available for intake (type=0), exhaust (type=1) and board (type=2). @param unit The identifier of the target unit @param type The type of reading to take @param temp Reference in which to return the intake temperature @return - \ref NVML_SUCCESS if \a temp has been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a unit or \a type is invalid or \a temp is NULL - \ref NVML_ERROR_NOT_SUPPORTED if this is not an S-class product - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlUnitGetTemperature( unit: cuda_types::nvml::nvmlUnit_t, type_: ::core::ffi::c_uint, temp: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the fan speed readings for the unit. For S-class products. See \ref nvmlUnitFanSpeeds_t for details on available fan speed info. @param unit The identifier of the target unit @param fanSpeeds Reference in which to return the fan speed information @return - \ref NVML_SUCCESS if \a fanSpeeds has been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a unit is invalid or \a fanSpeeds is NULL - \ref NVML_ERROR_NOT_SUPPORTED if this is not an S-class product - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlUnitGetFanSpeedInfo( unit: cuda_types::nvml::nvmlUnit_t, fanSpeeds: *mut cuda_types::nvml::nvmlUnitFanSpeeds_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the set of GPU devices that are attached to the specified unit. For S-class products. The \a deviceCount argument is expected to be set to the size of the input \a devices array. @param unit The identifier of the target unit @param deviceCount Reference in which to provide the \a devices array size, and to return the number of attached GPU devices @param devices Reference in which to return the references to the attached GPU devices @return - \ref NVML_SUCCESS if \a deviceCount and \a devices have been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a deviceCount indicates that the \a devices array is too small - \ref NVML_ERROR_INVALID_ARGUMENT if \a unit is invalid, either of \a deviceCount or \a devices is NULL - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlUnitGetDevices( unit: cuda_types::nvml::nvmlUnit_t, deviceCount: *mut ::core::ffi::c_uint, devices: *mut cuda_types::nvml::nvmlDevice_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the number of compute devices in the system. A compute device is a single GPU. For all products. Note: New nvmlDeviceGetCount_v2 (default in NVML 5.319) returns count of all devices in the system even if nvmlDeviceGetHandleByIndex_v2 returns NVML_ERROR_NO_PERMISSION for such device. Update your code to handle this error, or use NVML 4.304 or older nvml header file. For backward binary compatibility reasons _v1 version of the API is still present in the shared library. Old _v1 version of nvmlDeviceGetCount doesn't count devices that NVML has no permission to talk to. @param deviceCount Reference in which to return the number of accessible devices @return - \ref NVML_SUCCESS if \a deviceCount has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a deviceCount is NULL - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetCount_v2( deviceCount: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get attributes (engine counts etc.) for the given NVML device handle. @note This API currently only supports MIG device handles. For Ampere &tm; or newer fully supported devices. Supported on Linux only. @param device NVML device handle @param attributes Device attributes @return - \ref NVML_SUCCESS if \a device attributes were successfully retrieved - \ref NVML_ERROR_INVALID_ARGUMENT if \a device handle is invalid - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetAttributes_v2( device: cuda_types::nvml::nvmlDevice_t, attributes: *mut cuda_types::nvml::nvmlDeviceAttributes_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Acquire the handle for a particular device, based on its index. For all products. Valid indices are derived from the \a accessibleDevices count returned by \ref nvmlDeviceGetCount_v2(). For example, if \a accessibleDevices is 2 the valid indices are 0 and 1, corresponding to GPU 0 and GPU 1. The order in which NVML enumerates devices has no guarantees of consistency between reboots. For that reason it is recommended that devices be looked up by their PCI ids or UUID. See \ref nvmlDeviceGetHandleByUUID() and \ref nvmlDeviceGetHandleByPciBusId_v2(). Note: The NVML index may not correlate with other APIs, such as the CUDA device index. Starting from NVML 5, this API causes NVML to initialize the target GPU NVML may initialize additional GPUs if: - The target GPU is an SLI slave Note: New nvmlDeviceGetCount_v2 (default in NVML 5.319) returns count of all devices in the system even if nvmlDeviceGetHandleByIndex_v2 returns NVML_ERROR_NO_PERMISSION for such device. Update your code to handle this error, or use NVML 4.304 or older nvml header file. For backward binary compatibility reasons _v1 version of the API is still present in the shared library. Old _v1 version of nvmlDeviceGetCount doesn't count devices that NVML has no permission to talk to. This means that nvmlDeviceGetHandleByIndex_v2 and _v1 can return different devices for the same index. If you don't touch macros that map old (_v1) versions to _v2 versions at the top of the file you don't need to worry about that. @param index The index of the target GPU, >= 0 and < \a accessibleDevices @param device Reference in which to return the device handle @return - \ref NVML_SUCCESS if \a device has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a index is invalid or \a device is NULL - \ref NVML_ERROR_INSUFFICIENT_POWER if any attached devices have improperly attached external power cables - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to talk to this device - \ref NVML_ERROR_IRQ_ISSUE if NVIDIA kernel detected an interrupt issue with the attached GPUs - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlDeviceGetIndex @see nvmlDeviceGetCount*/ fn nvmlDeviceGetHandleByIndex_v2( index: ::core::ffi::c_uint, device: *mut cuda_types::nvml::nvmlDevice_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Acquire the handle for a particular device, based on its board serial number. For Fermi &tm; or newer fully supported devices. This number corresponds to the value printed directly on the board, and to the value returned by \ref nvmlDeviceGetSerial(). @deprecated Since more than one GPU can exist on a single board this function is deprecated in favor of \ref nvmlDeviceGetHandleByUUID. For dual GPU boards this function will return NVML_ERROR_INVALID_ARGUMENT. Starting from NVML 5, this API causes NVML to initialize the target GPU NVML may initialize additional GPUs as it searches for the target GPU @param serial The board serial number of the target GPU @param device Reference in which to return the device handle @return - \ref NVML_SUCCESS if \a device has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a serial is invalid, \a device is NULL or more than one device has the same serial (dual GPU boards) - \ref NVML_ERROR_NOT_FOUND if \a serial does not match a valid device on the system - \ref NVML_ERROR_INSUFFICIENT_POWER if any attached devices have improperly attached external power cables - \ref NVML_ERROR_IRQ_ISSUE if NVIDIA kernel detected an interrupt issue with the attached GPUs - \ref NVML_ERROR_GPU_IS_LOST if any GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlDeviceGetSerial @see nvmlDeviceGetHandleByUUID*/ fn nvmlDeviceGetHandleBySerial( serial: *const ::core::ffi::c_char, device: *mut cuda_types::nvml::nvmlDevice_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Acquire the handle for a particular device, based on its globally unique immutable UUID (in ASCII format) associated with each device. For all products. @param uuid The UUID of the target GPU or MIG instance @param device Reference in which to return the device handle or MIG device handle Starting from NVML 5, this API causes NVML to initialize the target GPU NVML may initialize additional GPUs as it searches for the target GPU @return - \ref NVML_SUCCESS if \a device has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a uuid is invalid or \a device is null - \ref NVML_ERROR_NOT_FOUND if \a uuid does not match a valid device on the system - \ref NVML_ERROR_INSUFFICIENT_POWER if any attached devices have improperly attached external power cables - \ref NVML_ERROR_IRQ_ISSUE if NVIDIA kernel detected an interrupt issue with the attached GPUs - \ref NVML_ERROR_GPU_IS_LOST if any GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlDeviceGetUUID*/ fn nvmlDeviceGetHandleByUUID( uuid: *const ::core::ffi::c_char, device: *mut cuda_types::nvml::nvmlDevice_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Acquire the handle for a particular device, based on its globally unique immutable UUID (in either ASCII or binary format) associated with each device. See \ref nvmlUUID_v1_t for more information on the UUID struct. The caller must set the appropriate version prior to calling this API. For all products. @param[in] uuid The UUID of the target GPU or MIG instance @param[out] device Reference in which to return the device handle or MIG device handle This API causes NVML to initialize the target GPU NVML may initialize additional GPUs as it searches for the target GPU @return - \ref NVML_SUCCESS if \a device has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a uuid is invalid, \a device is null or \a uuid->type is invalid - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH if the provided version is invalid/unsupported - \ref NVML_ERROR_NOT_FOUND if \a uuid does not match a valid device on the system - \ref NVML_ERROR_GPU_IS_LOST if any GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetHandleByUUIDV( uuid: *const cuda_types::nvml::nvmlUUID_t, device: *mut cuda_types::nvml::nvmlDevice_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Acquire the handle for a particular device, based on its PCI bus id. For all products. This value corresponds to the nvmlPciInfo_t::busId returned by \ref nvmlDeviceGetPciInfo_v3(). Starting from NVML 5, this API causes NVML to initialize the target GPU NVML may initialize additional GPUs if: - The target GPU is an SLI slave \note NVML 4.304 and older version of nvmlDeviceGetHandleByPciBusId"_v1" returns NVML_ERROR_NOT_FOUND instead of NVML_ERROR_NO_PERMISSION. @param pciBusId The PCI bus id of the target GPU Accept the following formats (all numbers in hexadecimal): domain:bus:device.function in format %x:%x:%x.%x domain:bus:device in format %x:%x:%x bus:device.function in format %x:%x.%x @param device Reference in which to return the device handle @return - \ref NVML_SUCCESS if \a device has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a pciBusId is invalid or \a device is NULL - \ref NVML_ERROR_NOT_FOUND if \a pciBusId does not match a valid device on the system - \ref NVML_ERROR_INSUFFICIENT_POWER if the attached device has improperly attached external power cables - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to talk to this device - \ref NVML_ERROR_IRQ_ISSUE if NVIDIA kernel detected an interrupt issue with the attached GPUs - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetHandleByPciBusId_v2( pciBusId: *const ::core::ffi::c_char, device: *mut cuda_types::nvml::nvmlDevice_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the name of this device. For all products. The name is an alphanumeric string that denotes a particular product, e.g. Tesla &tm; C2070. It will not exceed 96 characters in length (including the NULL terminator). See \ref nvmlConstants::NVML_DEVICE_NAME_V2_BUFFER_SIZE. When used with MIG device handles the API returns MIG device names which can be used to identify devices based on their attributes. @param device The identifier of the target device @param name Reference in which to return the product name @param length The maximum allowed length of the string returned in \a name @return - \ref NVML_SUCCESS if \a name has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a name is NULL - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetName( device: cuda_types::nvml::nvmlDevice_t, name: *mut ::core::ffi::c_char, length: ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the brand of this device. For all products. The type is a member of \ref nvmlBrandType_t defined above. @param device The identifier of the target device @param type Reference in which to return the product brand type @return - \ref NVML_SUCCESS if \a name has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a type is NULL - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetBrand( device: cuda_types::nvml::nvmlDevice_t, type_: *mut cuda_types::nvml::nvmlBrandType_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the NVML index of this device. For all products. Valid indices are derived from the \a accessibleDevices count returned by \ref nvmlDeviceGetCount_v2(). For example, if \a accessibleDevices is 2 the valid indices are 0 and 1, corresponding to GPU 0 and GPU 1. The order in which NVML enumerates devices has no guarantees of consistency between reboots. For that reason it is recommended that devices be looked up by their PCI ids or GPU UUID. See \ref nvmlDeviceGetHandleByPciBusId_v2() and \ref nvmlDeviceGetHandleByUUID(). When used with MIG device handles this API returns indices that can be passed to \ref nvmlDeviceGetMigDeviceHandleByIndex to retrieve an identical handle. MIG device indices are unique within a device. Note: The NVML index may not correlate with other APIs, such as the CUDA device index. @param device The identifier of the target device @param index Reference in which to return the NVML index of the device @return - \ref NVML_SUCCESS if \a index has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a index is NULL - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlDeviceGetHandleByIndex() @see nvmlDeviceGetCount()*/ fn nvmlDeviceGetIndex( device: cuda_types::nvml::nvmlDevice_t, index: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the globally unique board serial number associated with this device's board. For all products with an inforom. The serial number is an alphanumeric string that will not exceed 30 characters (including the NULL terminator). This number matches the serial number tag that is physically attached to the board. See \ref nvmlConstants::NVML_DEVICE_SERIAL_BUFFER_SIZE. @param device The identifier of the target device @param serial Reference in which to return the board/module serial number @param length The maximum allowed length of the string returned in \a serial @return - \ref NVML_SUCCESS if \a serial has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a serial is NULL - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetSerial( device: cuda_types::nvml::nvmlDevice_t, serial: *mut ::core::ffi::c_char, length: ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get a unique identifier for the device module on the baseboard This API retrieves a unique identifier for each GPU module that exists on a given baseboard. For non-baseboard products, this ID would always be 0. @param device The identifier of the target device @param moduleId Unique identifier for the GPU module @return - \ref NVML_SUCCESS if \a moduleId has been successfully retrieved - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device or \a moduleId is invalid - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetModuleId( device: cuda_types::nvml::nvmlDevice_t, moduleId: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the Device's C2C Mode information @param device The identifier of the target device @param c2cModeInfo Output struct containing the device's C2C Mode info @return - \ref NVML_SUCCESS if \a C2C Mode Infor query is successful - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a serial is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetC2cModeInfoV( device: cuda_types::nvml::nvmlDevice_t, c2cModeInfo: *mut cuda_types::nvml::nvmlC2cModeInfo_v1_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves an array of unsigned ints (sized to nodeSetSize) of bitmasks with the ideal memory affinity within node or socket for the device. For example, if NUMA node 0, 1 are ideal within the socket for the device and nodeSetSize == 1, result[0] = 0x3 \note If requested scope is not applicable to the target topology, the API will fall back to reporting the memory affinity for the immediate non-I/O ancestor of the device. For Kepler &tm; or newer fully supported devices. Supported on Linux only. @param device The identifier of the target device @param nodeSetSize The size of the nodeSet array that is safe to access @param nodeSet Array reference in which to return a bitmask of NODEs, 64 NODEs per unsigned long on 64-bit machines, 32 on 32-bit machines @param scope Scope that change the default behavior @return - \ref NVML_SUCCESS if \a NUMA node Affinity has been filled - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, nodeSetSize == 0, nodeSet is NULL or scope is invalid - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetMemoryAffinity( device: cuda_types::nvml::nvmlDevice_t, nodeSetSize: ::core::ffi::c_uint, nodeSet: *mut ::core::ffi::c_ulong, scope: cuda_types::nvml::nvmlAffinityScope_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves an array of unsigned ints (sized to cpuSetSize) of bitmasks with the ideal CPU affinity within node or socket for the device. For example, if processors 0, 1, 32, and 33 are ideal for the device and cpuSetSize == 2, result[0] = 0x3, result[1] = 0x3 \note If requested scope is not applicable to the target topology, the API will fall back to reporting the CPU affinity for the immediate non-I/O ancestor of the device. For Kepler &tm; or newer fully supported devices. Supported on Linux only. @param device The identifier of the target device @param cpuSetSize The size of the cpuSet array that is safe to access @param cpuSet Array reference in which to return a bitmask of CPUs, 64 CPUs per unsigned long on 64-bit machines, 32 on 32-bit machines @param scope Scope that change the default behavior @return - \ref NVML_SUCCESS if \a cpuAffinity has been filled - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, cpuSetSize == 0, cpuSet is NULL or sope is invalid - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetCpuAffinityWithinScope( device: cuda_types::nvml::nvmlDevice_t, cpuSetSize: ::core::ffi::c_uint, cpuSet: *mut ::core::ffi::c_ulong, scope: cuda_types::nvml::nvmlAffinityScope_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves an array of unsigned ints (sized to cpuSetSize) of bitmasks with the ideal CPU affinity for the device For example, if processors 0, 1, 32, and 33 are ideal for the device and cpuSetSize == 2, result[0] = 0x3, result[1] = 0x3 This is equivalent to calling \ref nvmlDeviceGetCpuAffinityWithinScope with \ref NVML_AFFINITY_SCOPE_NODE. For Kepler &tm; or newer fully supported devices. Supported on Linux only. @param device The identifier of the target device @param cpuSetSize The size of the cpuSet array that is safe to access @param cpuSet Array reference in which to return a bitmask of CPUs, 64 CPUs per unsigned long on 64-bit machines, 32 on 32-bit machines @return - \ref NVML_SUCCESS if \a cpuAffinity has been filled - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, cpuSetSize == 0, or cpuSet is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetCpuAffinity( device: cuda_types::nvml::nvmlDevice_t, cpuSetSize: ::core::ffi::c_uint, cpuSet: *mut ::core::ffi::c_ulong, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Sets the ideal affinity for the calling thread and device using the guidelines given in nvmlDeviceGetCpuAffinity(). Note, this is a change as of version 8.0. Older versions set the affinity for a calling process and all children. Currently supports up to 1024 processors. For Kepler &tm; or newer fully supported devices. Supported on Linux only. @param device The identifier of the target device @return - \ref NVML_SUCCESS if the calling process has been successfully bound - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceSetCpuAffinity( device: cuda_types::nvml::nvmlDevice_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Clear all affinity bindings for the calling thread. Note, this is a change as of version 8.0 as older versions cleared the affinity for a calling process and all children. For Kepler &tm; or newer fully supported devices. Supported on Linux only. @param device The identifier of the target device @return - \ref NVML_SUCCESS if the calling process has been successfully unbound - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceClearCpuAffinity( device: cuda_types::nvml::nvmlDevice_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get the NUMA node of the given GPU device. This only applies to platforms where the GPUs are NUMA nodes. @param[in] device The device handle @param[out] node NUMA node ID of the device @returns - \ref NVML_SUCCESS if the NUMA node is retrieved successfully - \ref NVML_ERROR_NOT_SUPPORTED if request is not supported on the current platform - \ref NVML_ERROR_INVALID_ARGUMENT if \a device \a node is invalid*/ fn nvmlDeviceGetNumaNodeId( device: cuda_types::nvml::nvmlDevice_t, node: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get the addressing mode for a given GPU. Addressing modes can be one of: 1. HMM: System allocated memory (malloc, mmap) is addressable from the device (GPU), via software-based mirroring of the CPU's page tables, on the GPU. 2. ATS: System allocated memory (malloc, mmap) is addressable from the device (GPU), via Address Translation Services. This means that there is (effectively) a single set of page tables, and the CPU and GPU both use them. 3. None: Neither HMM nor ATS is active. For Turing &tm; or newer fully supported devices. Supported on Linux only. @param[in] device The device handle @param[out] mode Pointer to addressing mode of the device @returns - \ref NVML_SUCCESS if \a mode is retrieved successfully - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH if the provided version is invalid/unsupported - \ref NVML_ERROR_NOT_SUPPORTED if request is not supported on the current platform - \ref NVML_ERROR_INVALID_ARGUMENT if \a device \a node is invalid*/ fn nvmlDeviceGetAddressingMode( device: cuda_types::nvml::nvmlDevice_t, mode: *mut cuda_types::nvml::nvmlDeviceAddressingMode_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get the repair status for TPC/Channel repair For Ampere &tm; or newer fully supported devices. @param[in] device The identifier of the target device @param[out] repairStatus Reference to \a nvmlRepairStatus_t @return - \ref NVML_SUCCESS if the query was successful - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH if the provided version is invalid/unsupported - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetRepairStatus( device: cuda_types::nvml::nvmlDevice_t, repairStatus: *mut cuda_types::nvml::nvmlRepairStatus_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /// @} fn nvmlDeviceGetTopologyCommonAncestor( device1: cuda_types::nvml::nvmlDevice_t, device2: cuda_types::nvml::nvmlDevice_t, pathInfo: *mut cuda_types::nvml::nvmlGpuTopologyLevel_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the set of GPUs that are nearest to a given device at a specific interconnectivity level For all products. Supported on Linux only. @param device The identifier of the first device @param level The \ref nvmlGpuTopologyLevel_t level to search for other GPUs @param count When zero, is set to the number of matching GPUs such that \a deviceArray can be malloc'd. When non-zero, \a deviceArray will be filled with \a count number of device handles. @param deviceArray An array of device handles for GPUs found at \a level @return - \ref NVML_SUCCESS if \a deviceArray or \a count (if initially zero) has been set - \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a level, or \a count is invalid, or \a deviceArray is NULL with a non-zero \a count - \ref NVML_ERROR_NOT_SUPPORTED if the device or OS does not support this feature - \ref NVML_ERROR_UNKNOWN an error has occurred in underlying topology discovery*/ fn nvmlDeviceGetTopologyNearestGpus( device: cuda_types::nvml::nvmlDevice_t, level: cuda_types::nvml::nvmlGpuTopologyLevel_t, count: *mut ::core::ffi::c_uint, deviceArray: *mut cuda_types::nvml::nvmlDevice_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the status for a given p2p capability index between a given pair of GPU @param device1 The first device @param device2 The second device @param p2pIndex p2p Capability Index being looked for between \a device1 and \a device2 @param p2pStatus Reference in which to return the status of the \a p2pIndex between \a device1 and \a device2 @return - \ref NVML_SUCCESS if \a p2pStatus has been populated - \ref NVML_ERROR_INVALID_ARGUMENT if \a device1 or \a device2 or \a p2pIndex is invalid or \a p2pStatus is NULL - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetP2PStatus( device1: cuda_types::nvml::nvmlDevice_t, device2: cuda_types::nvml::nvmlDevice_t, p2pIndex: cuda_types::nvml::nvmlGpuP2PCapsIndex_t, p2pStatus: *mut cuda_types::nvml::nvmlGpuP2PStatus_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the globally unique immutable UUID associated with this device, as a 5 part hexadecimal string, that augments the immutable, board serial identifier. For all products. The UUID is a globally unique identifier. It is the only available identifier for pre-Fermi-architecture products. It does NOT correspond to any identifier printed on the board. It will not exceed 96 characters in length (including the NULL terminator). See \ref nvmlConstants::NVML_DEVICE_UUID_V2_BUFFER_SIZE. When used with MIG device handles the API returns globally unique UUIDs which can be used to identify MIG devices across both GPU and MIG devices. UUIDs are immutable for the lifetime of a MIG device. @param device The identifier of the target device @param uuid Reference in which to return the GPU UUID @param length The maximum allowed length of the string returned in \a uuid @return - \ref NVML_SUCCESS if \a uuid has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a uuid is NULL - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetUUID( device: cuda_types::nvml::nvmlDevice_t, uuid: *mut ::core::ffi::c_char, length: ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves minor number for the device. The minor number for the device is such that the Nvidia device node file for each GPU will have the form /dev/nvidia[minor number]. For all products. Supported only for Linux @param device The identifier of the target device @param minorNumber Reference in which to return the minor number for the device @return - \ref NVML_SUCCESS if the minor number is successfully retrieved - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a minorNumber is NULL - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetMinorNumber( device: cuda_types::nvml::nvmlDevice_t, minorNumber: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the the device board part number which is programmed into the board's InfoROM For all products. @param device Identifier of the target device @param partNumber Reference to the buffer to return @param length Length of the buffer reference @return - \ref NVML_SUCCESS if \a partNumber has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_NOT_SUPPORTED if the needed VBIOS fields have not been filled - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a serial is NULL - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetBoardPartNumber( device: cuda_types::nvml::nvmlDevice_t, partNumber: *mut ::core::ffi::c_char, length: ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the version information for the device's infoROM object. For all products with an inforom. Fermi and higher parts have non-volatile on-board memory for persisting device info, such as aggregate ECC counts. The version of the data structures in this memory may change from time to time. It will not exceed 16 characters in length (including the NULL terminator). See \ref nvmlConstants::NVML_DEVICE_INFOROM_VERSION_BUFFER_SIZE. See \ref nvmlInforomObject_t for details on the available infoROM objects. @param device The identifier of the target device @param object The target infoROM object @param version Reference in which to return the infoROM version @param length The maximum allowed length of the string returned in \a version @return - \ref NVML_SUCCESS if \a version has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a version is NULL - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small - \ref NVML_ERROR_NOT_SUPPORTED if the device does not have an infoROM - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlDeviceGetInforomImageVersion*/ fn nvmlDeviceGetInforomVersion( device: cuda_types::nvml::nvmlDevice_t, object: cuda_types::nvml::nvmlInforomObject_t, version: *mut ::core::ffi::c_char, length: ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the global infoROM image version For all products with an inforom. Image version just like VBIOS version uniquely describes the exact version of the infoROM flashed on the board in contrast to infoROM object version which is only an indicator of supported features. Version string will not exceed 16 characters in length (including the NULL terminator). See \ref nvmlConstants::NVML_DEVICE_INFOROM_VERSION_BUFFER_SIZE. @param device The identifier of the target device @param version Reference in which to return the infoROM image version @param length The maximum allowed length of the string returned in \a version @return - \ref NVML_SUCCESS if \a version has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a version is NULL - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small - \ref NVML_ERROR_NOT_SUPPORTED if the device does not have an infoROM - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlDeviceGetInforomVersion*/ fn nvmlDeviceGetInforomImageVersion( device: cuda_types::nvml::nvmlDevice_t, version: *mut ::core::ffi::c_char, length: ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the checksum of the configuration stored in the device's infoROM. For all products with an inforom. Can be used to make sure that two GPUs have the exact same configuration. Current checksum takes into account configuration stored in PWR and ECC infoROM objects. Checksum can change between driver releases or when user changes configuration (e.g. disable/enable ECC) @param device The identifier of the target device @param checksum Reference in which to return the infoROM configuration checksum @return - \ref NVML_SUCCESS if \a checksum has been set - \ref NVML_ERROR_CORRUPTED_INFOROM if the device's checksum couldn't be retrieved due to infoROM corruption - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a checksum is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetInforomConfigurationChecksum( device: cuda_types::nvml::nvmlDevice_t, checksum: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Reads the infoROM from the flash and verifies the checksums. For all products with an inforom. @param device The identifier of the target device @return - \ref NVML_SUCCESS if infoROM is not corrupted - \ref NVML_ERROR_CORRUPTED_INFOROM if the device's infoROM is corrupted - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceValidateInforom( device: cuda_types::nvml::nvmlDevice_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the timestamp and the duration of the last flush of the BBX (blackbox) infoROM object during the current run. For all products with an inforom. @param device The identifier of the target device @param timestamp The start timestamp of the last BBX Flush @param durationUs The duration (us) of the last BBX Flush @return - \ref NVML_SUCCESS if \a timestamp and \a durationUs are successfully retrieved - \ref NVML_ERROR_NOT_READY if the BBX object has not been flushed yet - \ref NVML_ERROR_NOT_SUPPORTED if the device does not have an infoROM - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlDeviceGetInforomVersion*/ fn nvmlDeviceGetLastBBXFlushTime( device: cuda_types::nvml::nvmlDevice_t, timestamp: *mut ::core::ffi::c_ulonglong, durationUs: *mut ::core::ffi::c_ulong, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the display mode for the device. For all products. This method indicates whether a physical display (e.g. monitor) is currently connected to any of the device's connectors. See \ref nvmlEnableState_t for details on allowed modes. @param device The identifier of the target device @param display Reference in which to return the display mode @return - \ref NVML_SUCCESS if \a display has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a display is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetDisplayMode( device: cuda_types::nvml::nvmlDevice_t, display: *mut cuda_types::nvml::nvmlEnableState_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the display active state for the device. For all products. This method indicates whether a display is initialized on the device. For example whether X Server is attached to this device and has allocated memory for the screen. Display can be active even when no monitor is physically attached. See \ref nvmlEnableState_t for details on allowed modes. @param device The identifier of the target device @param isActive Reference in which to return the display active state @return - \ref NVML_SUCCESS if \a isActive has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a isActive is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetDisplayActive( device: cuda_types::nvml::nvmlDevice_t, isActive: *mut cuda_types::nvml::nvmlEnableState_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the persistence mode associated with this device. For all products. For Linux only. When driver persistence mode is enabled the driver software state is not torn down when the last client disconnects. By default this feature is disabled. See \ref nvmlEnableState_t for details on allowed modes. @param device The identifier of the target device @param mode Reference in which to return the current driver persistence mode @return - \ref NVML_SUCCESS if \a mode has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a mode is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlDeviceSetPersistenceMode()*/ fn nvmlDeviceGetPersistenceMode( device: cuda_types::nvml::nvmlDevice_t, mode: *mut cuda_types::nvml::nvmlEnableState_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves PCI attributes of this device. For all products. See \ref nvmlPciInfoExt_v1_t for details on the available PCI info. @param device The identifier of the target device @param pci Reference in which to return the PCI info @return - \ref NVML_SUCCESS if \a pci has been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a pci is NULL - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetPciInfoExt( device: cuda_types::nvml::nvmlDevice_t, pci: *mut cuda_types::nvml::nvmlPciInfoExt_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the PCI attributes of this device. For all products. See \ref nvmlPciInfo_t for details on the available PCI info. @param device The identifier of the target device @param pci Reference in which to return the PCI info @return - \ref NVML_SUCCESS if \a pci has been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a pci is NULL - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetPciInfo_v3( device: cuda_types::nvml::nvmlDevice_t, pci: *mut cuda_types::nvml::nvmlPciInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the maximum PCIe link generation possible with this device and system I.E. for a generation 2 PCIe device attached to a generation 1 PCIe bus the max link generation this function will report is generation 1. For Fermi &tm; or newer fully supported devices. @param device The identifier of the target device @param maxLinkGen Reference in which to return the max PCIe link generation @return - \ref NVML_SUCCESS if \a maxLinkGen has been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a maxLinkGen is null - \ref NVML_ERROR_NOT_SUPPORTED if PCIe link information is not available - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetMaxPcieLinkGeneration( device: cuda_types::nvml::nvmlDevice_t, maxLinkGen: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the maximum PCIe link generation supported by this device For Fermi &tm; or newer fully supported devices. @param device The identifier of the target device @param maxLinkGenDevice Reference in which to return the max PCIe link generation @return - \ref NVML_SUCCESS if \a maxLinkGenDevice has been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a maxLinkGenDevice is null - \ref NVML_ERROR_NOT_SUPPORTED if PCIe link information is not available - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetGpuMaxPcieLinkGeneration( device: cuda_types::nvml::nvmlDevice_t, maxLinkGenDevice: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the maximum PCIe link width possible with this device and system I.E. for a device with a 16x PCIe bus width attached to a 8x PCIe system bus this function will report a max link width of 8. For Fermi &tm; or newer fully supported devices. @param device The identifier of the target device @param maxLinkWidth Reference in which to return the max PCIe link generation @return - \ref NVML_SUCCESS if \a maxLinkWidth has been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a maxLinkWidth is null - \ref NVML_ERROR_NOT_SUPPORTED if PCIe link information is not available - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetMaxPcieLinkWidth( device: cuda_types::nvml::nvmlDevice_t, maxLinkWidth: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the current PCIe link generation For Fermi &tm; or newer fully supported devices. @param device The identifier of the target device @param currLinkGen Reference in which to return the current PCIe link generation @return - \ref NVML_SUCCESS if \a currLinkGen has been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a currLinkGen is null - \ref NVML_ERROR_NOT_SUPPORTED if PCIe link information is not available - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetCurrPcieLinkGeneration( device: cuda_types::nvml::nvmlDevice_t, currLinkGen: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the current PCIe link width For Fermi &tm; or newer fully supported devices. @param device The identifier of the target device @param currLinkWidth Reference in which to return the current PCIe link generation @return - \ref NVML_SUCCESS if \a currLinkWidth has been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a currLinkWidth is null - \ref NVML_ERROR_NOT_SUPPORTED if PCIe link information is not available - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetCurrPcieLinkWidth( device: cuda_types::nvml::nvmlDevice_t, currLinkWidth: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve PCIe utilization information. This function is querying a byte counter over a 20ms interval and thus is the PCIe throughput over that interval. For Maxwell &tm; or newer fully supported devices. This method is not supported in virtual machines running virtual GPU (vGPU). @param device The identifier of the target device @param counter The specific counter that should be queried \ref nvmlPcieUtilCounter_t @param value Reference in which to return throughput in KB/s @return - \ref NVML_SUCCESS if \a value has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device or \a counter is invalid, or \a value is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetPcieThroughput( device: cuda_types::nvml::nvmlDevice_t, counter: cuda_types::nvml::nvmlPcieUtilCounter_t, value: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the PCIe replay counter. For Kepler &tm; or newer fully supported devices. @param device The identifier of the target device @param value Reference in which to return the counter's value @return - \ref NVML_SUCCESS if \a value has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a value is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetPcieReplayCounter( device: cuda_types::nvml::nvmlDevice_t, value: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the current clock speeds for the device. For Fermi &tm; or newer fully supported devices. See \ref nvmlClockType_t for details on available clock information. @param device The identifier of the target device @param type Identify which clock domain to query @param clock Reference in which to return the clock speed in MHz @return - \ref NVML_SUCCESS if \a clock has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a clock is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device cannot report the specified clock - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetClockInfo( device: cuda_types::nvml::nvmlDevice_t, type_: cuda_types::nvml::nvmlClockType_t, clock: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the maximum clock speeds for the device. For Fermi &tm; or newer fully supported devices. See \ref nvmlClockType_t for details on available clock information. \note Current P0 clocks (reported by \ref nvmlDeviceGetClockInfo) can differ from max clocks by a few MHz. @param device The identifier of the target device @param type Identify which clock domain to query @param clock Reference in which to return the clock speed in MHz @return - \ref NVML_SUCCESS if \a clock has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a clock is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device cannot report the specified clock - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetMaxClockInfo( device: cuda_types::nvml::nvmlDevice_t, type_: cuda_types::nvml::nvmlClockType_t, clock: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the GPCCLK VF offset value @param[in] device The identifier of the target device @param[out] offset The retrieved GPCCLK VF offset value @return - \ref NVML_SUCCESS if \a offset has been successfully queried - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a offset is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetGpcClkVfOffset( device: cuda_types::nvml::nvmlDevice_t, offset: *mut ::core::ffi::c_int, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /// @deprecated Applications clocks are deprecated and will be removed in CUDA 14.0. fn nvmlDeviceGetApplicationsClock( device: cuda_types::nvml::nvmlDevice_t, clockType: cuda_types::nvml::nvmlClockType_t, clockMHz: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /// @deprecated Applications clocks are deprecated and will be removed in CUDA 14.0. fn nvmlDeviceGetDefaultApplicationsClock( device: cuda_types::nvml::nvmlDevice_t, clockType: cuda_types::nvml::nvmlClockType_t, clockMHz: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the clock speed for the clock specified by the clock type and clock ID. For Kepler &tm; or newer fully supported devices. @param device The identifier of the target device @param clockType Identify which clock domain to query @param clockId Identify which clock in the domain to query @param clockMHz Reference in which to return the clock in MHz @return - \ref NVML_SUCCESS if \a clockMHz has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a clockMHz is NULL or \a clockType is invalid - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetClock( device: cuda_types::nvml::nvmlDevice_t, clockType: cuda_types::nvml::nvmlClockType_t, clockId: cuda_types::nvml::nvmlClockId_t, clockMHz: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the customer defined maximum boost clock speed specified by the given clock type. For Pascal &tm; or newer fully supported devices. @param device The identifier of the target device @param clockType Identify which clock domain to query @param clockMHz Reference in which to return the clock in MHz @return - \ref NVML_SUCCESS if \a clockMHz has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a clockMHz is NULL or \a clockType is invalid - \ref NVML_ERROR_NOT_SUPPORTED if the device or the \a clockType on this device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetMaxCustomerBoostClock( device: cuda_types::nvml::nvmlDevice_t, clockType: cuda_types::nvml::nvmlClockType_t, clockMHz: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the list of possible memory clocks that can be used as an argument for \ref nvmlDeviceSetMemoryLockedClocks. For Kepler &tm; or newer fully supported devices. @param device The identifier of the target device @param count Reference in which to provide the \a clocksMHz array size, and to return the number of elements @param clocksMHz Reference in which to return the clock in MHz @return - \ref NVML_SUCCESS if \a count and \a clocksMHz have been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a count is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a count is too small (\a count is set to the number of required elements) - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlDeviceSetMemoryLockedClocks*/ fn nvmlDeviceGetSupportedMemoryClocks( device: cuda_types::nvml::nvmlDevice_t, count: *mut ::core::ffi::c_uint, clocksMHz: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the list of possible graphics clocks that can be used as an argument for \ref nvmlDeviceSetGpuLockedClocks. For Kepler &tm; or newer fully supported devices. @param device The identifier of the target device @param memoryClockMHz Memory clock for which to return possible graphics clocks @param count Reference in which to provide the \a clocksMHz array size, and to return the number of elements @param clocksMHz Reference in which to return the clocks in MHz @return - \ref NVML_SUCCESS if \a count and \a clocksMHz have been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_NOT_FOUND if the specified \a memoryClockMHz is not a supported frequency - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a clock is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a count is too small - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlDeviceSetGpuLockedClocks*/ fn nvmlDeviceGetSupportedGraphicsClocks( device: cuda_types::nvml::nvmlDevice_t, memoryClockMHz: ::core::ffi::c_uint, count: *mut ::core::ffi::c_uint, clocksMHz: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the current state of Auto Boosted clocks on a device and store it in \a isEnabled For Kepler &tm; or newer fully supported devices. Auto Boosted clocks are enabled by default on some hardware, allowing the GPU to run at higher clock rates to maximize performance as thermal limits allow. On Pascal and newer hardware, Auto Aoosted clocks are controlled through application clocks. Use \ref nvmlDeviceSetApplicationsClocks and \ref nvmlDeviceResetApplicationsClocks to control Auto Boost behavior. @param device The identifier of the target device @param isEnabled Where to store the current state of Auto Boosted clocks of the target device @param defaultIsEnabled Where to store the default Auto Boosted clocks behavior of the target device that the device will revert to when no applications are using the GPU @return - \ref NVML_SUCCESS If \a isEnabled has been been set with the Auto Boosted clocks state of \a device - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a isEnabled is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support Auto Boosted clocks - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error */ fn nvmlDeviceGetAutoBoostedClocksEnabled( device: cuda_types::nvml::nvmlDevice_t, isEnabled: *mut cuda_types::nvml::nvmlEnableState_t, defaultIsEnabled: *mut cuda_types::nvml::nvmlEnableState_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the intended operating speed of the device's fan. Note: The reported speed is the intended fan speed. If the fan is physically blocked and unable to spin, the output will not match the actual fan speed. For all discrete products with dedicated fans. The fan speed is expressed as a percentage of the product's maximum noise tolerance fan speed. This value may exceed 100% in certain cases. @param device The identifier of the target device @param speed Reference in which to return the fan speed percentage @return - \ref NVML_SUCCESS if \a speed has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a speed is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not have a fan - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetFanSpeed( device: cuda_types::nvml::nvmlDevice_t, speed: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the intended operating speed of the device's specified fan. Note: The reported speed is the intended fan speed. If the fan is physically blocked and unable to spin, the output will not match the actual fan speed. For all discrete products with dedicated fans. The fan speed is expressed as a percentage of the product's maximum noise tolerance fan speed. This value may exceed 100% in certain cases. @param device The identifier of the target device @param fan The index of the target fan, zero indexed. @param speed Reference in which to return the fan speed percentage @return - \ref NVML_SUCCESS if \a speed has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a fan is not an acceptable index, or \a speed is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not have a fan or is newer than Maxwell - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetFanSpeed_v2( device: cuda_types::nvml::nvmlDevice_t, fan: ::core::ffi::c_uint, speed: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the intended operating speed in rotations per minute (RPM) of the device's specified fan. For Maxwell &tm; or newer fully supported devices. For all discrete products with dedicated fans. Note: The reported speed is the intended fan speed. If the fan is physically blocked and unable to spin, the output will not match the actual fan speed. @param device The identifier of the target device @param fanSpeed Structure specifying the index of the target fan (input) and retrieved fan speed value (output) @return - \ref NVML_SUCCESS If everything worked - \ref NVML_ERROR_UNINITIALIZED If the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a device is invalid, \a fan is not an acceptable index, or \a speed is NULL - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH If the provided version is invalid/unsupported - \ref NVML_ERROR_NOT_SUPPORTED If the \a device does not support this feature*/ fn nvmlDeviceGetFanSpeedRPM( device: cuda_types::nvml::nvmlDevice_t, fanSpeed: *mut cuda_types::nvml::nvmlFanSpeedInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the intended target speed of the device's specified fan. Normally, the driver dynamically adjusts the fan based on the needs of the GPU. But when user set fan speed using nvmlDeviceSetFanSpeed_v2, the driver will attempt to make the fan achieve the setting in nvmlDeviceSetFanSpeed_v2. The actual current speed of the fan is reported in nvmlDeviceGetFanSpeed_v2. For all discrete products with dedicated fans. The fan speed is expressed as a percentage of the product's maximum noise tolerance fan speed. This value may exceed 100% in certain cases. @param device The identifier of the target device @param fan The index of the target fan, zero indexed. @param targetSpeed Reference in which to return the fan speed percentage @return - \ref NVML_SUCCESS if \a speed has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a fan is not an acceptable index, or \a speed is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not have a fan or is newer than Maxwell - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetTargetFanSpeed( device: cuda_types::nvml::nvmlDevice_t, fan: ::core::ffi::c_uint, targetSpeed: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the min and max fan speed that user can set for the GPU fan. For all cuda-capable discrete products with fans @param device The identifier of the target device @param minSpeed The minimum speed allowed to set @param maxSpeed The maximum speed allowed to set return NVML_SUCCESS if speed has been adjusted NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized NVML_ERROR_INVALID_ARGUMENT if device is invalid NVML_ERROR_NOT_SUPPORTED if the device does not support this (doesn't have fans) NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetMinMaxFanSpeed( device: cuda_types::nvml::nvmlDevice_t, minSpeed: *mut ::core::ffi::c_uint, maxSpeed: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Gets current fan control policy. For Maxwell &tm; or newer fully supported devices. For all cuda-capable discrete products with fans device The identifier of the target \a device policy Reference in which to return the fan control \a policy return NVML_SUCCESS if \a policy has been populated NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a policy is null or the \a fan given doesn't reference a fan that exists. NVML_ERROR_NOT_SUPPORTED if the \a device is older than Maxwell NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetFanControlPolicy_v2( device: cuda_types::nvml::nvmlDevice_t, fan: ::core::ffi::c_uint, policy: *mut cuda_types::nvml::nvmlFanControlPolicy_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the number of fans on the device. For all discrete products with dedicated fans. @param device The identifier of the target device @param numFans The number of fans @return - \ref NVML_SUCCESS if \a fan number query was successful - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a numFans is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not have a fan - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetNumFans( device: cuda_types::nvml::nvmlDevice_t, numFans: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /// @deprecated Use \ref nvmlDeviceGetTemperatureV instead fn nvmlDeviceGetTemperature( device: cuda_types::nvml::nvmlDevice_t, sensorType: cuda_types::nvml::nvmlTemperatureSensors_t, temp: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the cooler's information. Returns a cooler's control signal characteristics. The possible types are restricted, Variable and Toggle. See \ref nvmlCoolerControl_t for details on available signal types. Returns objects that cooler cools. Targets may be GPU, Memory, Power Supply or All of these. See \ref nvmlCoolerTarget_t for details on available targets. For Maxwell &tm; or newer fully supported devices. For all discrete products with dedicated fans. @param[in] device The identifier of the target device @param[out] coolerInfo Structure specifying the cooler's control signal characteristics (out) and the target that cooler cools (out) @return - \ref NVML_SUCCESS If everything worked - \ref NVML_ERROR_UNINITIALIZED If the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a device is invalid, \a signalType or \a target is NULL - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH If the provided version is invalid/unsupported - \ref NVML_ERROR_NOT_SUPPORTED If the \a device does not support this feature*/ fn nvmlDeviceGetCoolerInfo( device: cuda_types::nvml::nvmlDevice_t, coolerInfo: *mut cuda_types::nvml::nvmlCoolerInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the current temperature readings (in degrees C) for the given device. For all products. @param[in] device Target device identifier. @param[in,out] temperature Structure specifying the sensor type (input) and retrieved temperature value (output). @return - \ref NVML_SUCCESS if \a temp has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a sensorType is invalid or \a temp is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not have the specified sensor - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetTemperatureV( device: cuda_types::nvml::nvmlDevice_t, temperature: *mut cuda_types::nvml::nvmlTemperature_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the temperature threshold for the GPU with the specified threshold type in degrees C. For Kepler &tm; or newer fully supported devices. See \ref nvmlTemperatureThresholds_t for details on available temperature thresholds. Note: This API is no longer the preferred interface for retrieving the following temperature thresholds on Ada and later architectures: NVML_TEMPERATURE_THRESHOLD_SHUTDOWN, NVML_TEMPERATURE_THRESHOLD_SLOWDOWN, NVML_TEMPERATURE_THRESHOLD_MEM_MAX and NVML_TEMPERATURE_THRESHOLD_GPU_MAX. Support for reading these temperature thresholds for Ada and later architectures would be removed from this API in future releases. Please use \ref nvmlDeviceGetFieldValues with NVML_FI_DEV_TEMPERATURE_* fields to retrieve temperature thresholds on these architectures. @param device The identifier of the target device @param thresholdType The type of threshold value queried @param temp Reference in which to return the temperature reading @return - \ref NVML_SUCCESS if \a temp has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a thresholdType is invalid or \a temp is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not have a temperature sensor or is unsupported - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetTemperatureThreshold( device: cuda_types::nvml::nvmlDevice_t, thresholdType: cuda_types::nvml::nvmlTemperatureThresholds_t, temp: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the thermal margin temperature (distance to nearest slowdown threshold). @param[in] device The identifier of the target device @param[in,out] marginTempInfo Versioned structure in which to return the temperature reading @returns - \ref NVML_SUCCESS if the margin temperature was retrieved successfully - \ref NVML_ERROR_NOT_SUPPORTED if request is not supported on the current platform - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a temperature is NULL - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH if the right versioned structure is not used - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetMarginTemperature( device: cuda_types::nvml::nvmlDevice_t, marginTempInfo: *mut cuda_types::nvml::nvmlMarginTemperature_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Used to execute a list of thermal system instructions. @param device The identifier of the target device @param sensorIndex The index of the thermal sensor @param pThermalSettings Reference in which to return the thermal sensor information @return - \ref NVML_SUCCESS if \a pThermalSettings has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a pThermalSettings is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetThermalSettings( device: cuda_types::nvml::nvmlDevice_t, sensorIndex: ::core::ffi::c_uint, pThermalSettings: *mut cuda_types::nvml::nvmlGpuThermalSettings_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the current performance state for the device. For Fermi &tm; or newer fully supported devices. See \ref nvmlPstates_t for details on allowed performance states. @param device The identifier of the target device @param pState Reference in which to return the performance state reading @return - \ref NVML_SUCCESS if \a pState has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a pState is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetPerformanceState( device: cuda_types::nvml::nvmlDevice_t, pState: *mut cuda_types::nvml::nvmlPstates_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves current clocks event reasons. For all fully supported products. \note More than one bit can be enabled at the same time. Multiple reasons can be affecting clocks at once. @param device The identifier of the target device @param clocksEventReasons Reference in which to return bitmask of active clocks event reasons @return - \ref NVML_SUCCESS if \a clocksEventReasons has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a clocksEventReasons is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlClocksEventReasons @see nvmlDeviceGetSupportedClocksEventReasons*/ fn nvmlDeviceGetCurrentClocksEventReasons( device: cuda_types::nvml::nvmlDevice_t, clocksEventReasons: *mut ::core::ffi::c_ulonglong, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /// @deprecated Use \ref nvmlDeviceGetCurrentClocksEventReasons instead fn nvmlDeviceGetCurrentClocksThrottleReasons( device: cuda_types::nvml::nvmlDevice_t, clocksThrottleReasons: *mut ::core::ffi::c_ulonglong, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves bitmask of supported clocks event reasons that can be returned by \ref nvmlDeviceGetCurrentClocksEventReasons For all fully supported products. This method is not supported in virtual machines running virtual GPU (vGPU). @param device The identifier of the target device @param supportedClocksEventReasons Reference in which to return bitmask of supported clocks event reasons @return - \ref NVML_SUCCESS if \a supportedClocksEventReasons has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a supportedClocksEventReasons is NULL - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlClocksEventReasons @see nvmlDeviceGetCurrentClocksEventReasons*/ fn nvmlDeviceGetSupportedClocksEventReasons( device: cuda_types::nvml::nvmlDevice_t, supportedClocksEventReasons: *mut ::core::ffi::c_ulonglong, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /// @deprecated Use \ref nvmlDeviceGetSupportedClocksEventReasons instead fn nvmlDeviceGetSupportedClocksThrottleReasons( device: cuda_types::nvml::nvmlDevice_t, supportedClocksThrottleReasons: *mut ::core::ffi::c_ulonglong, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** @deprecated Use \ref nvmlDeviceGetPerformanceState. This function exposes an incorrect generalization. Retrieve the current performance state for the device. For Fermi &tm; or newer fully supported devices. See \ref nvmlPstates_t for details on allowed performance states. @param device The identifier of the target device @param pState Reference in which to return the performance state reading @return - \ref NVML_SUCCESS if \a pState has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a pState is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetPowerState( device: cuda_types::nvml::nvmlDevice_t, pState: *mut cuda_types::nvml::nvmlPstates_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve performance monitor samples from the associated subdevice. @param device @param pDynamicPstatesInfo @return - \ref NVML_SUCCESS if \a pDynamicPstatesInfo has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a pDynamicPstatesInfo is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetDynamicPstatesInfo( device: cuda_types::nvml::nvmlDevice_t, pDynamicPstatesInfo: *mut cuda_types::nvml::nvmlGpuDynamicPstatesInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the MemClk (Memory Clock) VF offset value. @param[in] device The identifier of the target device @param[out] offset The retrieved MemClk VF offset value @return - \ref NVML_SUCCESS if \a offset has been successfully queried - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a offset is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetMemClkVfOffset( device: cuda_types::nvml::nvmlDevice_t, offset: *mut ::core::ffi::c_int, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve min and max clocks of some clock domain for a given PState @param device The identifier of the target device @param type Clock domain @param pstate PState to query @param minClockMHz Reference in which to return min clock frequency @param maxClockMHz Reference in which to return max clock frequency @return - \ref NVML_SUCCESS if everything worked - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a type or \a minClockMHz and \a maxClockMHz are NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_UNKNOWN if \a type or \a pstate are invalid or any unexpected error*/ fn nvmlDeviceGetMinMaxClockOfPState( device: cuda_types::nvml::nvmlDevice_t, type_: cuda_types::nvml::nvmlClockType_t, pstate: cuda_types::nvml::nvmlPstates_t, minClockMHz: *mut ::core::ffi::c_uint, maxClockMHz: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get all supported Performance States (P-States) for the device. The returned array would contain a contiguous list of valid P-States supported by the device. If the number of supported P-States is fewer than the size of the array supplied missing elements would contain \a NVML_PSTATE_UNKNOWN. The number of elements in the returned list will never exceed \a NVML_MAX_GPU_PERF_PSTATES. @param device The identifier of the target device @param pstates Container to return the list of performance states supported by device @param size Size of the supplied \a pstates array in bytes @return - \ref NVML_SUCCESS if \a pstates array has been retrieved - \ref NVML_ERROR_INSUFFICIENT_SIZE if the the container supplied was not large enough to hold the resulting list - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device or \a pstates is invalid - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support performance state readings - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetSupportedPerformanceStates( device: cuda_types::nvml::nvmlDevice_t, pstates: *mut cuda_types::nvml::nvmlPstates_t, size: ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the GPCCLK min max VF offset value. @param[in] device The identifier of the target device @param[out] minOffset The retrieved GPCCLK VF min offset value @param[out] maxOffset The retrieved GPCCLK VF max offset value @return - \ref NVML_SUCCESS if \a offset has been successfully queried - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a offset is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetGpcClkMinMaxVfOffset( device: cuda_types::nvml::nvmlDevice_t, minOffset: *mut ::core::ffi::c_int, maxOffset: *mut ::core::ffi::c_int, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the MemClk (Memory Clock) min max VF offset value. @param[in] device The identifier of the target device @param[out] minOffset The retrieved MemClk VF min offset value @param[out] maxOffset The retrieved MemClk VF max offset value @return - \ref NVML_SUCCESS if \a offset has been successfully queried - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a offset is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetMemClkMinMaxVfOffset( device: cuda_types::nvml::nvmlDevice_t, minOffset: *mut ::core::ffi::c_int, maxOffset: *mut ::core::ffi::c_int, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve min, max and current clock offset of some clock domain for a given PState For Maxwell &tm; or newer fully supported devices. Note: \ref nvmlDeviceGetGpcClkVfOffset, \ref nvmlDeviceGetMemClkVfOffset, \ref nvmlDeviceGetGpcClkMinMaxVfOffset and \ref nvmlDeviceGetMemClkMinMaxVfOffset will be deprecated in a future release. Use \ref nvmlDeviceGetClockOffsets instead. @param device The identifier of the target device @param info Structure specifying the clock type (input) and the pstate (input) retrieved clock offset value (output), min clock offset (output) and max clock offset (output) @return - \ref NVML_SUCCESS If everything worked - \ref NVML_ERROR_UNINITIALIZED If the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a device, \a type or \a pstate are invalid or both \a minClockOffsetMHz and \a maxClockOffsetMHz are NULL - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH If the provided version is invalid/unsupported - \ref NVML_ERROR_NOT_SUPPORTED If the device does not support this feature*/ fn nvmlDeviceGetClockOffsets( device: cuda_types::nvml::nvmlDevice_t, info: *mut cuda_types::nvml::nvmlClockOffset_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Control current clock offset of some clock domain for a given PState For Maxwell &tm; or newer fully supported devices. Requires privileged user. @param device The identifier of the target device @param info Structure specifying the clock type (input), the pstate (input) and clock offset value (input) @return - \ref NVML_SUCCESS If everything worked - \ref NVML_ERROR_UNINITIALIZED If the library has not been successfully initialized - \ref NVML_ERROR_NO_PERMISSION If the user doesn't have permission to perform this operation - \ref NVML_ERROR_INVALID_ARGUMENT If \a device, \a type or \a pstate are invalid or both \a clockOffsetMHz is out of allowed range. - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH If the provided version is invalid/unsupported - \ref NVML_ERROR_NOT_SUPPORTED If the device does not support this feature*/ fn nvmlDeviceSetClockOffsets( device: cuda_types::nvml::nvmlDevice_t, info: *mut cuda_types::nvml::nvmlClockOffset_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves a performance mode string with all the performance modes defined for this device along with their associated GPU Clock and Memory Clock values. Not all tokens will be reported on all GPUs, and additional tokens may be added in the future. For backwards compatibility we still provide nvclock and memclock; those are the same as nvclockmin and memclockmin. Note: These clock values take into account the offset set by clients through /ref nvmlDeviceSetClockOffsets. Maximum available Pstate (P15) shows the minimum performance level (0) and vice versa. Each performance modes are returned as a comma-separated list of "token=value" pairs. Each set of performance mode tokens are separated by a ";". Valid tokens: Token Value "perf" unsigned int - the Performance level "nvclock" unsigned int - the GPU clocks (in MHz) for the perf level "nvclockmin" unsigned int - the GPU clocks min (in MHz) for the perf level "nvclockmax" unsigned int - the GPU clocks max (in MHz) for the perf level "nvclockeditable" unsigned int - if the GPU clock domain is editable for the perf level "memclock" unsigned int - the memory clocks (in MHz) for the perf level "memclockmin" unsigned int - the memory clocks min (in MHz) for the perf level "memclockmax" unsigned int - the memory clocks max (in MHz) for the perf level "memclockeditable" unsigned int - if the memory clock domain is editable for the perf level "memtransferrate" unsigned int - the memory transfer rate (in MHz) for the perf level "memtransferratemin" unsigned int - the memory transfer rate min (in MHz) for the perf level "memtransferratemax" unsigned int - the memory transfer rate max (in MHz) for the perf level "memtransferrateeditable" unsigned int - if the memory transfer rate is editable for the perf level Example: perf=0, nvclock=324, nvclockmin=324, nvclockmax=324, nvclockeditable=0, memclock=324, memclockmin=324, memclockmax=324, memclockeditable=0, memtransferrate=648, memtransferratemin=648, memtransferratemax=648, memtransferrateeditable=0 ; perf=1, nvclock=324, nvclockmin=324, nvclockmax=640, nvclockeditable=0, memclock=810, memclockmin=810, memclockmax=810, memclockeditable=0, memtransferrate=1620, memtransferrate=1620, memtransferrate=1620, memtransferrateeditable=0 ; @param device The identifier of the target device @param perfModes Reference in which to return the performance level string @return - \ref NVML_SUCCESS if \a perfModes has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a name is NULL - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetPerformanceModes( device: cuda_types::nvml::nvmlDevice_t, perfModes: *mut cuda_types::nvml::nvmlDevicePerfModes_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves a string with the associated current GPU Clock and Memory Clock values. Not all tokens will be reported on all GPUs, and additional tokens may be added in the future. Note: These clock values take into account the offset set by clients through /ref nvmlDeviceSetClockOffsets. Clock values are returned as a comma-separated list of "token=value" pairs. Valid tokens: Token Value "perf" unsigned int - the Performance level "nvclock" unsigned int - the GPU clocks (in MHz) for the perf level "nvclockmin" unsigned int - the GPU clocks min (in MHz) for the perf level "nvclockmax" unsigned int - the GPU clocks max (in MHz) for the perf level "nvclockeditable" unsigned int - if the GPU clock domain is editable for the perf level "memclock" unsigned int - the memory clocks (in MHz) for the perf level "memclockmin" unsigned int - the memory clocks min (in MHz) for the perf level "memclockmax" unsigned int - the memory clocks max (in MHz) for the perf level "memclockeditable" unsigned int - if the memory clock domain is editable for the perf level "memtransferrate" unsigned int - the memory transfer rate (in MHz) for the perf level "memtransferratemin" unsigned int - the memory transfer rate min (in MHz) for the perf level "memtransferratemax" unsigned int - the memory transfer rate max (in MHz) for the perf level "memtransferrateeditable" unsigned int - if the memory transfer rate is editable for the perf level Example: nvclock=324, nvclockmin=324, nvclockmax=324, nvclockeditable=0, memclock=324, memclockmin=324, memclockmax=324, memclockeditable=0, memtransferrate=648, memtransferratemin=648, memtransferratemax=648, memtransferrateeditable=0 ; @param device The identifier of the target device @param currentClockFreqs Reference in which to return the performance level string @return - \ref NVML_SUCCESS if \a currentClockFreqs has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a name is NULL - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetCurrentClockFreqs( device: cuda_types::nvml::nvmlDevice_t, currentClockFreqs: *mut cuda_types::nvml::nvmlDeviceCurrentClockFreqs_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** @deprecated This API has been deprecated. Retrieves the power management mode associated with this device. For products from the Fermi family. - Requires \a NVML_INFOROM_POWER version 3.0 or higher. For from the Kepler or newer families. - Does not require \a NVML_INFOROM_POWER object. This flag indicates whether any power management algorithm is currently active on the device. An enabled state does not necessarily mean the device is being actively throttled -- only that that the driver will do so if the appropriate conditions are met. See \ref nvmlEnableState_t for details on allowed modes. @param device The identifier of the target device @param mode Reference in which to return the current power management mode @return - \ref NVML_SUCCESS if \a mode has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a mode is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetPowerManagementMode( device: cuda_types::nvml::nvmlDevice_t, mode: *mut cuda_types::nvml::nvmlEnableState_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the power management limit associated with this device. For Fermi &tm; or newer fully supported devices. The power limit defines the upper boundary for the card's power draw. If the card's total power draw reaches this limit the power management algorithm kicks in. This reading is only available if power management mode is supported. See \ref nvmlDeviceGetPowerManagementMode. @param device The identifier of the target device @param limit Reference in which to return the power management limit in milliwatts @return - \ref NVML_SUCCESS if \a limit has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a limit is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetPowerManagementLimit( device: cuda_types::nvml::nvmlDevice_t, limit: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves information about possible values of power management limits on this device. For Kepler &tm; or newer fully supported devices. @param device The identifier of the target device @param minLimit Reference in which to return the minimum power management limit in milliwatts @param maxLimit Reference in which to return the maximum power management limit in milliwatts @return - \ref NVML_SUCCESS if \a minLimit and \a maxLimit have been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a minLimit or \a maxLimit is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlDeviceSetPowerManagementLimit*/ fn nvmlDeviceGetPowerManagementLimitConstraints( device: cuda_types::nvml::nvmlDevice_t, minLimit: *mut ::core::ffi::c_uint, maxLimit: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves default power management limit on this device, in milliwatts. Default power management limit is a power management limit that the device boots with. For Kepler &tm; or newer fully supported devices. @param device The identifier of the target device @param defaultLimit Reference in which to return the default power management limit in milliwatts @return - \ref NVML_SUCCESS if \a defaultLimit has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a defaultLimit is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetPowerManagementDefaultLimit( device: cuda_types::nvml::nvmlDevice_t, defaultLimit: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves power usage for this GPU in milliwatts and its associated circuitry (e.g. memory) For Fermi &tm; or newer fully supported devices. On Fermi and Kepler GPUs the reading is accurate to within +/- 5% of current power draw. On Ampere (except GA100) or newer GPUs, the API returns power averaged over 1 sec interval. On GA100 and older architectures, instantaneous power is returned. See \ref NVML_FI_DEV_POWER_AVERAGE and \ref NVML_FI_DEV_POWER_INSTANT to query specific power values. It is only available if power management mode is supported. See \ref nvmlDeviceGetPowerManagementMode. @param device The identifier of the target device @param power Reference in which to return the power usage information @return - \ref NVML_SUCCESS if \a power has been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a power is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support power readings - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetPowerUsage( device: cuda_types::nvml::nvmlDevice_t, power: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves current power mizer mode on this device. PowerMizerMode provides a hint to the driver as to how to manage the performance of the GPU. For Maxwell &tm; or newer fully supported devices. @param device The identifier of the target device @param powerMizerMode Reference in which to return the power mizer mode @param supportedPowerMizerModes Reference in which to return the bitmask of supported power mizer modes on this device. The supported modes can be combined using the bitwise OR operator '|'. For example, if a device supports all PowerMizer modes, the bitmask would be: supportedPowerMizerModes = ((1 << NVML_POWER_MIZER_MODE_ADAPTIVE) | (1 << NVML_POWER_MIZER_MODE_PREFER_MAXIMUM_PERFORMANCE) | (1 << NVML_POWER_MIZER_MODE_AUTO) | (1 << NVML_POWER_MIZER_MODE_PREFER_CONSISTENT_PERFORMANCE)); This bitmask can be used to check which power mizer modes are available on the device by performing a bitwise AND operation with the specific mode you want to check. @return - \ref NVML_SUCCESS if \a powerMizerMode has been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a powerMizerMode is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support powerMizerMode readings - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetPowerMizerMode_v1( device: cuda_types::nvml::nvmlDevice_t, powerMizerMode: *mut cuda_types::nvml::nvmlDevicePowerMizerModes_v1_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Sets the new power mizer mode. For Maxwell &tm; or newer fully supported devices. @param device The identifier of the target device @param powerMizerMode Reference in which to set the power mizer mode. @return - \ref NVML_SUCCESS if \a powerMizerMode has been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a powerMizerMode is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support powerMizerMode readings - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceSetPowerMizerMode_v1( device: cuda_types::nvml::nvmlDevice_t, powerMizerMode: *mut cuda_types::nvml::nvmlDevicePowerMizerModes_v1_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves total energy consumption for this GPU in millijoules (mJ) since the driver was last reloaded For Volta &tm; or newer fully supported devices. @param device The identifier of the target device @param energy Reference in which to return the energy consumption information @return - \ref NVML_SUCCESS if \a energy has been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a energy is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support energy readings - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetTotalEnergyConsumption( device: cuda_types::nvml::nvmlDevice_t, energy: *mut ::core::ffi::c_ulonglong, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get the effective power limit that the driver enforces after taking into account all limiters Note: This can be different from the \ref nvmlDeviceGetPowerManagementLimit if other limits are set elsewhere This includes the out of band power limit interface For Kepler &tm; or newer fully supported devices. @param device The device to communicate with @param limit Reference in which to return the power management limit in milliwatts @return - \ref NVML_SUCCESS if \a limit has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a limit is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetEnforcedPowerLimit( device: cuda_types::nvml::nvmlDevice_t, limit: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the current GOM and pending GOM (the one that GPU will switch to after reboot). For GK110 M-class and X-class Tesla &tm; products from the Kepler family. Modes \ref NVML_GOM_LOW_DP and \ref NVML_GOM_ALL_ON are supported on fully supported GeForce products. Not supported on Quadro ® and Tesla &tm; C-class products. @param device The identifier of the target device @param current Reference in which to return the current GOM @param pending Reference in which to return the pending GOM @return - \ref NVML_SUCCESS if \a mode has been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a current or \a pending is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlGpuOperationMode_t @see nvmlDeviceSetGpuOperationMode*/ fn nvmlDeviceGetGpuOperationMode( device: cuda_types::nvml::nvmlDevice_t, current: *mut cuda_types::nvml::nvmlGpuOperationMode_t, pending: *mut cuda_types::nvml::nvmlGpuOperationMode_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the amount of used, free, reserved and total memory available on the device, in bytes. The reserved amount is supported on version 2 only. For all products. Enabling ECC reduces the amount of total available memory, due to the extra required parity bits. Under WDDM most device memory is allocated and managed on startup by Windows. Under Linux and Windows TCC, the reported amount of used memory is equal to the sum of memory allocated by all active channels on the device. See \ref nvmlMemory_v2_t for details on available memory info. @note In MIG mode, if device handle is provided, the API returns aggregate information, only if the caller has appropriate privileges. Per-instance information can be queried by using specific MIG device handles. @note nvmlDeviceGetMemoryInfo_v2 adds additional memory information. @note On systems where GPUs are NUMA nodes, the accuracy of FB memory utilization provided by this API depends on the memory accounting of the operating system. This is because FB memory is managed by the operating system instead of the NVIDIA GPU driver. Typically, pages allocated from FB memory are not released even after the process terminates to enhance performance. In scenarios where the operating system is under memory pressure, it may resort to utilizing FB memory. Such actions can result in discrepancies in the accuracy of memory reporting. @note On certain SOC platforms, the integrated GPU (iGPU) does not use a dedicated framebuffer but instead shares memory with the system. As a result, \ref NVML_ERROR_NOT_SUPPORTED will be returned in this case. @param device The identifier of the target device @param memory Reference in which to return the memory information @return - \ref NVML_SUCCESS if \a memory has been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a memory is NULL - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_NOT_SUPPORTED if video memory is unsupported on the device - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetMemoryInfo( device: cuda_types::nvml::nvmlDevice_t, memory: *mut cuda_types::nvml::nvmlMemory_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /// nvmlDeviceGetMemoryInfo_v2 accounts separately for reserved memory and includes it in the used memory amount. fn nvmlDeviceGetMemoryInfo_v2( device: cuda_types::nvml::nvmlDevice_t, memory: *mut cuda_types::nvml::nvmlMemory_v2_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the current compute mode for the device. For all products. See \ref nvmlComputeMode_t for details on allowed compute modes. @param device The identifier of the target device @param mode Reference in which to return the current compute mode @return - \ref NVML_SUCCESS if \a mode has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a mode is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlDeviceSetComputeMode()*/ fn nvmlDeviceGetComputeMode( device: cuda_types::nvml::nvmlDevice_t, mode: *mut cuda_types::nvml::nvmlComputeMode_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the CUDA compute capability of the device. For all products. Returns the major and minor compute capability version numbers of the device. The major and minor versions are equivalent to the CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR and CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR attributes that would be returned by CUDA's cuDeviceGetAttribute(). @param device The identifier of the target device @param major Reference in which to return the major CUDA compute capability @param minor Reference in which to return the minor CUDA compute capability @return - \ref NVML_SUCCESS if \a major and \a minor have been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a major or \a minor are NULL - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetCudaComputeCapability( device: cuda_types::nvml::nvmlDevice_t, major: *mut ::core::ffi::c_int, minor: *mut ::core::ffi::c_int, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the current and pending DRAM Encryption modes for the device. For Blackwell &tm; or newer fully supported devices. Only applicable to devices that support DRAM Encryption Requires \a NVML_INFOROM_DEN version 1.0 or higher. Changing DRAM Encryption modes requires a reboot. The "pending" DRAM Encryption mode refers to the target mode following the next reboot. See \ref nvmlEnableState_t for details on allowed modes. @param device The identifier of the target device @param current Reference in which to return the current DRAM Encryption mode @param pending Reference in which to return the pending DRAM Encryption mode @return - \ref NVML_SUCCESS if \a current and \a pending have been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or either \a current or \a pending is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH if the argument version is not supported - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlDeviceSetDramEncryptionMode()*/ fn nvmlDeviceGetDramEncryptionMode( device: cuda_types::nvml::nvmlDevice_t, current: *mut cuda_types::nvml::nvmlDramEncryptionInfo_t, pending: *mut cuda_types::nvml::nvmlDramEncryptionInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Set the DRAM Encryption mode for the device. For Kepler &tm; or newer fully supported devices. Only applicable to devices that support DRAM Encryption. Requires \a NVML_INFOROM_DEN version 1.0 or higher. Requires root/admin permissions. The DRAM Encryption mode determines whether the GPU enables its DRAM Encryption support. This operation takes effect after the next reboot. See \ref nvmlEnableState_t for details on available modes. @param device The identifier of the target device @param dramEncryption The target DRAM Encryption mode @return - \ref NVML_SUCCESS if the DRAM Encryption mode was set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a DRAM Encryption is invalid - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH if the argument version is not supported - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlDeviceGetDramEncryptionMode()*/ fn nvmlDeviceSetDramEncryptionMode( device: cuda_types::nvml::nvmlDevice_t, dramEncryption: *const cuda_types::nvml::nvmlDramEncryptionInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the current and pending ECC modes for the device. For Fermi &tm; or newer fully supported devices. Only applicable to devices with ECC. Requires \a NVML_INFOROM_ECC version 1.0 or higher. Changing ECC modes requires a reboot. The "pending" ECC mode refers to the target mode following the next reboot. See \ref nvmlEnableState_t for details on allowed modes. @param device The identifier of the target device @param current Reference in which to return the current ECC mode @param pending Reference in which to return the pending ECC mode @return - \ref NVML_SUCCESS if \a current and \a pending have been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or either \a current or \a pending is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlDeviceSetEccMode()*/ fn nvmlDeviceGetEccMode( device: cuda_types::nvml::nvmlDevice_t, current: *mut cuda_types::nvml::nvmlEnableState_t, pending: *mut cuda_types::nvml::nvmlEnableState_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the default ECC modes for the device. For Fermi &tm; or newer fully supported devices. Only applicable to devices with ECC. Requires \a NVML_INFOROM_ECC version 1.0 or higher. See \ref nvmlEnableState_t for details on allowed modes. @param device The identifier of the target device @param defaultMode Reference in which to return the default ECC mode @return - \ref NVML_SUCCESS if \a current and \a pending have been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a default is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlDeviceSetEccMode()*/ fn nvmlDeviceGetDefaultEccMode( device: cuda_types::nvml::nvmlDevice_t, defaultMode: *mut cuda_types::nvml::nvmlEnableState_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the device boardId from 0-N. Devices with the same boardId indicate GPUs connected to the same PLX. Use in conjunction with \ref nvmlDeviceGetMultiGpuBoard() to decide if they are on the same board as well. The boardId returned is a unique ID for the current configuration. Uniqueness and ordering across reboots and system configurations is not guaranteed (i.e. if a Tesla K40c returns 0x100 and the two GPUs on a Tesla K10 in the same system returns 0x200 it is not guaranteed they will always return those values but they will always be different from each other). For Fermi &tm; or newer fully supported devices. @param device The identifier of the target device @param boardId Reference in which to return the device's board ID @return - \ref NVML_SUCCESS if \a boardId has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a boardId is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetBoardId( device: cuda_types::nvml::nvmlDevice_t, boardId: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves whether the device is on a Multi-GPU Board Devices that are on multi-GPU boards will set \a multiGpuBool to a non-zero value. For Fermi &tm; or newer fully supported devices. @param device The identifier of the target device @param multiGpuBool Reference in which to return a zero or non-zero value to indicate whether the device is on a multi GPU board @return - \ref NVML_SUCCESS if \a multiGpuBool has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a multiGpuBool is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetMultiGpuBoard( device: cuda_types::nvml::nvmlDevice_t, multiGpuBool: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the total ECC error counts for the device. For Fermi &tm; or newer fully supported devices. Only applicable to devices with ECC. Requires \a NVML_INFOROM_ECC version 1.0 or higher. Requires ECC Mode to be enabled. The total error count is the sum of errors across each of the separate memory systems, i.e. the total set of errors across the entire device. See \ref nvmlMemoryErrorType_t for a description of available error types.\n See \ref nvmlEccCounterType_t for a description of available counter types. @param device The identifier of the target device @param errorType Flag that specifies the type of the errors. @param counterType Flag that specifies the counter-type of the errors. @param eccCounts Reference in which to return the specified ECC errors @return - \ref NVML_SUCCESS if \a eccCounts has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a errorType or \a counterType is invalid, or \a eccCounts is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlDeviceClearEccErrorCounts()*/ fn nvmlDeviceGetTotalEccErrors( device: cuda_types::nvml::nvmlDevice_t, errorType: cuda_types::nvml::nvmlMemoryErrorType_t, counterType: cuda_types::nvml::nvmlEccCounterType_t, eccCounts: *mut ::core::ffi::c_ulonglong, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the detailed ECC error counts for the device. @deprecated This API supports only a fixed set of ECC error locations On different GPU architectures different locations are supported See \ref nvmlDeviceGetMemoryErrorCounter For Fermi &tm; or newer fully supported devices. Only applicable to devices with ECC. Requires \a NVML_INFOROM_ECC version 2.0 or higher to report aggregate location-based ECC counts. Requires \a NVML_INFOROM_ECC version 1.0 or higher to report all other ECC counts. Requires ECC Mode to be enabled. Detailed errors provide separate ECC counts for specific parts of the memory system. Reports zero for unsupported ECC error counters when a subset of ECC error counters are supported. See \ref nvmlMemoryErrorType_t for a description of available bit types.\n See \ref nvmlEccCounterType_t for a description of available counter types.\n See \ref nvmlEccErrorCounts_t for a description of provided detailed ECC counts. @param device The identifier of the target device @param errorType Flag that specifies the type of the errors. @param counterType Flag that specifies the counter-type of the errors. @param eccCounts Reference in which to return the specified ECC errors @return - \ref NVML_SUCCESS if \a eccCounts has been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a errorType or \a counterType is invalid, or \a eccCounts is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlDeviceClearEccErrorCounts()*/ fn nvmlDeviceGetDetailedEccErrors( device: cuda_types::nvml::nvmlDevice_t, errorType: cuda_types::nvml::nvmlMemoryErrorType_t, counterType: cuda_types::nvml::nvmlEccCounterType_t, eccCounts: *mut cuda_types::nvml::nvmlEccErrorCounts_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the requested memory error counter for the device. For Fermi &tm; or newer fully supported devices. Requires \a NVML_INFOROM_ECC version 2.0 or higher to report aggregate location-based memory error counts. Requires \a NVML_INFOROM_ECC version 1.0 or higher to report all other memory error counts. Only applicable to devices with ECC. Requires ECC Mode to be enabled. @note On MIG-enabled GPUs, per instance information can be queried using specific MIG device handles. Per instance information is currently only supported for non-DRAM uncorrectable volatile errors. Querying volatile errors using device handles is currently not supported. See \ref nvmlMemoryErrorType_t for a description of available memory error types.\n See \ref nvmlEccCounterType_t for a description of available counter types.\n See \ref nvmlMemoryLocation_t for a description of available counter locations.\n @param device The identifier of the target device @param errorType Flag that specifies the type of error. @param counterType Flag that specifies the counter-type of the errors. @param locationType Specifies the location of the counter. @param count Reference in which to return the ECC counter @return - \ref NVML_SUCCESS if \a count has been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a bitTyp,e \a counterType or \a locationType is invalid, or \a count is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support ECC error reporting in the specified memory - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetMemoryErrorCounter( device: cuda_types::nvml::nvmlDevice_t, errorType: cuda_types::nvml::nvmlMemoryErrorType_t, counterType: cuda_types::nvml::nvmlEccCounterType_t, locationType: cuda_types::nvml::nvmlMemoryLocation_t, count: *mut ::core::ffi::c_ulonglong, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the current utilization rates for the device's major subsystems. For Fermi &tm; or newer fully supported devices. See \ref nvmlUtilization_t for details on available utilization rates. \note During driver initialization when ECC is enabled one can see high GPU and Memory Utilization readings. This is caused by ECC Memory Scrubbing mechanism that is performed during driver initialization. @note On MIG-enabled GPUs, querying device utilization rates is not currently supported. @param device The identifier of the target device @param utilization Reference in which to return the utilization information @return - \ref NVML_SUCCESS if \a utilization has been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a utilization is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetUtilizationRates( device: cuda_types::nvml::nvmlDevice_t, utilization: *mut cuda_types::nvml::nvmlUtilization_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the current utilization and sampling size in microseconds for the Encoder For Kepler &tm; or newer fully supported devices. @note On MIG-enabled GPUs, querying encoder utilization is not currently supported. @param device The identifier of the target device @param utilization Reference to an unsigned int for encoder utilization info @param samplingPeriodUs Reference to an unsigned int for the sampling period in US @return - \ref NVML_SUCCESS if \a utilization has been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a utilization is NULL, or \a samplingPeriodUs is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetEncoderUtilization( device: cuda_types::nvml::nvmlDevice_t, utilization: *mut ::core::ffi::c_uint, samplingPeriodUs: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the current capacity of the device's encoder, as a percentage of maximum encoder capacity with valid values in the range 0-100. For Maxwell &tm; or newer fully supported devices. @param device The identifier of the target device @param encoderQueryType Type of encoder to query @param encoderCapacity Reference to an unsigned int for the encoder capacity @return - \ref NVML_SUCCESS if \a encoderCapacity is fetched - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a encoderCapacity is NULL, or \a device or \a encoderQueryType are invalid - \ref NVML_ERROR_NOT_SUPPORTED if device does not support the encoder specified in \a encodeQueryType - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetEncoderCapacity( device: cuda_types::nvml::nvmlDevice_t, encoderQueryType: cuda_types::nvml::nvmlEncoderType_t, encoderCapacity: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the current encoder statistics for a given device. For Maxwell &tm; or newer fully supported devices. @param device The identifier of the target device @param sessionCount Reference to an unsigned int for count of active encoder sessions @param averageFps Reference to an unsigned int for trailing average FPS of all active sessions @param averageLatency Reference to an unsigned int for encode latency in microseconds @return - \ref NVML_SUCCESS if \a sessionCount, \a averageFps and \a averageLatency is fetched - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a sessionCount, or \a device or \a averageFps, or \a averageLatency is NULL - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetEncoderStats( device: cuda_types::nvml::nvmlDevice_t, sessionCount: *mut ::core::ffi::c_uint, averageFps: *mut ::core::ffi::c_uint, averageLatency: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves information about active encoder sessions on a target device. An array of active encoder sessions is returned in the caller-supplied buffer pointed at by \a sessionInfos. The array element count is passed in \a sessionCount, and \a sessionCount is used to return the number of sessions written to the buffer. If the supplied buffer is not large enough to accommodate the active session array, the function returns NVML_ERROR_INSUFFICIENT_SIZE, with the element count of nvmlEncoderSessionInfo_t array required in \a sessionCount. To query the number of active encoder sessions, call this function with *sessionCount = 0. The code will return NVML_SUCCESS with number of active encoder sessions updated in *sessionCount. For Maxwell &tm; or newer fully supported devices. @param device The identifier of the target device @param sessionCount Reference to caller supplied array size, and returns the number of sessions. @param sessionInfos Reference in which to return the session information @return - \ref NVML_SUCCESS if \a sessionInfos is fetched - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a sessionCount is too small, array element count is returned in \a sessionCount - \ref NVML_ERROR_INVALID_ARGUMENT if \a sessionCount is NULL. - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by \a device - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetEncoderSessions( device: cuda_types::nvml::nvmlDevice_t, sessionCount: *mut ::core::ffi::c_uint, sessionInfos: *mut cuda_types::nvml::nvmlEncoderSessionInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the current utilization and sampling size in microseconds for the Decoder For Kepler &tm; or newer fully supported devices. @note On MIG-enabled GPUs, querying decoder utilization is not currently supported. @param device The identifier of the target device @param utilization Reference to an unsigned int for decoder utilization info @param samplingPeriodUs Reference to an unsigned int for the sampling period in US @return - \ref NVML_SUCCESS if \a utilization has been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a utilization is NULL, or \a samplingPeriodUs is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetDecoderUtilization( device: cuda_types::nvml::nvmlDevice_t, utilization: *mut ::core::ffi::c_uint, samplingPeriodUs: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the current utilization and sampling size in microseconds for the JPG For Turing &tm; or newer fully supported devices. @note On MIG-enabled GPUs, querying decoder utilization is not currently supported. @param device The identifier of the target device @param utilization Reference to an unsigned int for jpg utilization info @param samplingPeriodUs Reference to an unsigned int for the sampling period in US @return - \ref NVML_SUCCESS if \a utilization has been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a utilization is NULL, or \a samplingPeriodUs is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetJpgUtilization( device: cuda_types::nvml::nvmlDevice_t, utilization: *mut ::core::ffi::c_uint, samplingPeriodUs: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the current utilization and sampling size in microseconds for the OFA (Optical Flow Accelerator) For Turing &tm; or newer fully supported devices. @note On MIG-enabled GPUs, querying decoder utilization is not currently supported. @param device The identifier of the target device @param utilization Reference to an unsigned int for ofa utilization info @param samplingPeriodUs Reference to an unsigned int for the sampling period in US @return - \ref NVML_SUCCESS if \a utilization has been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a utilization is NULL, or \a samplingPeriodUs is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetOfaUtilization( device: cuda_types::nvml::nvmlDevice_t, utilization: *mut ::core::ffi::c_uint, samplingPeriodUs: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the active frame buffer capture sessions statistics for a given device. For Maxwell &tm; or newer fully supported devices. @param device The identifier of the target device @param fbcStats Reference to nvmlFBCStats_t structure containing NvFBC stats @return - \ref NVML_SUCCESS if \a fbcStats is fetched - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a fbcStats is NULL - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetFBCStats( device: cuda_types::nvml::nvmlDevice_t, fbcStats: *mut cuda_types::nvml::nvmlFBCStats_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves information about active frame buffer capture sessions on a target device. An array of active FBC sessions is returned in the caller-supplied buffer pointed at by \a sessionInfo. The array element count is passed in \a sessionCount, and \a sessionCount is used to return the number of sessions written to the buffer. If the supplied buffer is not large enough to accommodate the active session array, the function returns NVML_ERROR_INSUFFICIENT_SIZE, with the element count of nvmlFBCSessionInfo_t array required in \a sessionCount. To query the number of active FBC sessions, call this function with *sessionCount = 0. The code will return NVML_SUCCESS with number of active FBC sessions updated in *sessionCount. For Maxwell &tm; or newer fully supported devices. @note hResolution, vResolution, averageFPS and averageLatency data for a FBC session returned in \a sessionInfo may be zero if there are no new frames captured since the session started. @param device The identifier of the target device @param sessionCount Reference to caller supplied array size, and returns the number of sessions. @param sessionInfo Reference in which to return the session information @return - \ref NVML_SUCCESS if \a sessionInfo is fetched - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a sessionCount is too small, array element count is returned in \a sessionCount - \ref NVML_ERROR_INVALID_ARGUMENT if \a sessionCount is NULL. - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetFBCSessions( device: cuda_types::nvml::nvmlDevice_t, sessionCount: *mut ::core::ffi::c_uint, sessionInfo: *mut cuda_types::nvml::nvmlFBCSessionInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the current and pending driver model for the device. For Kepler &tm; or newer fully supported devices. For windows only. On Windows platforms the device driver can run in either WDDM, MCDM or WDM (TCC) modes. If a display is attached to the device it must run in WDDM mode. MCDM mode is preferred if a display is not attached. TCC mode is deprecated. See \ref nvmlDriverModel_t for details on available driver models. @param device The identifier of the target device @param current Reference in which to return the current driver model @param pending Reference in which to return the pending driver model @return - \ref NVML_SUCCESS if either \a current and/or \a pending have been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or both \a current and \a pending are NULL - \ref NVML_ERROR_NOT_SUPPORTED if the platform is not windows - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlDeviceSetDriverModel_v2()*/ fn nvmlDeviceGetDriverModel_v2( device: cuda_types::nvml::nvmlDevice_t, current: *mut cuda_types::nvml::nvmlDriverModel_t, pending: *mut cuda_types::nvml::nvmlDriverModel_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get VBIOS version of the device. For all products. The VBIOS version may change from time to time. It will not exceed 32 characters in length (including the NULL terminator). See \ref nvmlConstants::NVML_DEVICE_VBIOS_VERSION_BUFFER_SIZE. @param device The identifier of the target device @param version Reference to which to return the VBIOS version @param length The maximum allowed length of the string returned in \a version @return - \ref NVML_SUCCESS if \a version has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a version is NULL - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetVbiosVersion( device: cuda_types::nvml::nvmlDevice_t, version: *mut ::core::ffi::c_char, length: ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get Bridge Chip Information for all the bridge chips on the board. For all fully supported products. Only applicable to multi-GPU products. @param device The identifier of the target device @param bridgeHierarchy Reference to the returned bridge chip Hierarchy @return - \ref NVML_SUCCESS if bridge chip exists - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a bridgeInfo is NULL - \ref NVML_ERROR_NOT_SUPPORTED if bridge chip not supported on the device - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error */ fn nvmlDeviceGetBridgeChipInfo( device: cuda_types::nvml::nvmlDevice_t, bridgeHierarchy: *mut cuda_types::nvml::nvmlBridgeChipHierarchy_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get information about processes with a compute context on a device For Fermi &tm; or newer fully supported devices. This function returns information only about compute running processes (e.g. CUDA application which have active context). Any graphics applications (e.g. using OpenGL, DirectX) won't be listed by this function. To query the current number of running compute processes, call this function with *infoCount = 0. The return code will be NVML_ERROR_INSUFFICIENT_SIZE, or NVML_SUCCESS if none are running. For this call \a infos is allowed to be NULL. The usedGpuMemory field returned is all of the memory used by the application. Keep in mind that information returned by this call is dynamic and the number of elements might change in time. Allocate more space for \a infos table in case new compute processes are spawned. @note In MIG mode, if device handle is provided, the API returns aggregate information, only if the caller has appropriate privileges. Per-instance information can be queried by using specific MIG device handles. Querying per-instance information using MIG device handles is not supported if the device is in vGPU Host virtualization mode. @param device The device handle or MIG device handle @param infoCount Reference in which to provide the \a infos array size, and to return the number of returned elements @param infos Reference in which to return the process information @return - \ref NVML_SUCCESS if \a infoCount and \a infos have been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a infoCount indicates that the \a infos array is too small \a infoCount will contain minimal amount of space necessary for the call to complete - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, either of \a infoCount or \a infos is NULL - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by \a device - \ref NVML_ERROR_UNKNOWN on any unexpected error @see \ref nvmlSystemGetProcessName*/ fn nvmlDeviceGetComputeRunningProcesses_v3( device: cuda_types::nvml::nvmlDevice_t, infoCount: *mut ::core::ffi::c_uint, infos: *mut cuda_types::nvml::nvmlProcessInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get information about processes with a graphics context on a device For Kepler &tm; or newer fully supported devices. This function returns information only about graphics based processes (eg. applications using OpenGL, DirectX) To query the current number of running graphics processes, call this function with *infoCount = 0. The return code will be NVML_ERROR_INSUFFICIENT_SIZE, or NVML_SUCCESS if none are running. For this call \a infos is allowed to be NULL. The usedGpuMemory field returned is all of the memory used by the application. Keep in mind that information returned by this call is dynamic and the number of elements might change in time. Allocate more space for \a infos table in case new graphics processes are spawned. @note In MIG mode, if device handle is provided, the API returns aggregate information, only if the caller has appropriate privileges. Per-instance information can be queried by using specific MIG device handles. Querying per-instance information using MIG device handles is not supported if the device is in vGPU Host virtualization mode. @param device The device handle or MIG device handle @param infoCount Reference in which to provide the \a infos array size, and to return the number of returned elements @param infos Reference in which to return the process information @return - \ref NVML_SUCCESS if \a infoCount and \a infos have been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a infoCount indicates that the \a infos array is too small \a infoCount will contain minimal amount of space necessary for the call to complete - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, either of \a infoCount or \a infos is NULL - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by \a device - \ref NVML_ERROR_UNKNOWN on any unexpected error @see \ref nvmlSystemGetProcessName*/ fn nvmlDeviceGetGraphicsRunningProcesses_v3( device: cuda_types::nvml::nvmlDevice_t, infoCount: *mut ::core::ffi::c_uint, infos: *mut cuda_types::nvml::nvmlProcessInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get information about processes with a Multi-Process Service (MPS) compute context on a device For Volta &tm; or newer fully supported devices. This function returns information only about compute running processes (e.g. CUDA application which have active context) utilizing MPS. Any graphics applications (e.g. using OpenGL, DirectX) won't be listed by this function. To query the current number of running compute processes, call this function with *infoCount = 0. The return code will be NVML_ERROR_INSUFFICIENT_SIZE, or NVML_SUCCESS if none are running. For this call \a infos is allowed to be NULL. The usedGpuMemory field returned is all of the memory used by the application. Keep in mind that information returned by this call is dynamic and the number of elements might change in time. Allocate more space for \a infos table in case new compute processes are spawned. @note In MIG mode, if device handle is provided, the API returns aggregate information, only if the caller has appropriate privileges. Per-instance information can be queried by using specific MIG device handles. Querying per-instance information using MIG device handles is not supported if the device is in vGPU Host virtualization mode. @param device The device handle or MIG device handle @param infoCount Reference in which to provide the \a infos array size, and to return the number of returned elements @param infos Reference in which to return the process information @return - \ref NVML_SUCCESS if \a infoCount and \a infos have been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a infoCount indicates that the \a infos array is too small \a infoCount will contain minimal amount of space necessary for the call to complete - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, either of \a infoCount or \a infos is NULL - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by \a device - \ref NVML_ERROR_UNKNOWN on any unexpected error @see \ref nvmlSystemGetProcessName*/ fn nvmlDeviceGetMPSComputeRunningProcesses_v3( device: cuda_types::nvml::nvmlDevice_t, infoCount: *mut ::core::ffi::c_uint, infos: *mut cuda_types::nvml::nvmlProcessInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get information about running processes on a device for input context For Hopper &tm; or newer fully supported devices. This function returns information only about running processes (e.g. CUDA application which have active context). To determine the size of the \a plist->procArray array to allocate, call the function with \a plist->numProcArrayEntries set to zero and \a plist->procArray set to NULL. The return code will be either NVML_ERROR_INSUFFICIENT_SIZE (if there are valid processes of type \a plist->mode to report on, in which case the \a plist->numProcArrayEntries field will indicate the required number of entries in the array) or NVML_SUCCESS (if no processes of type \a plist->mode exist). The usedGpuMemory field returned is all of the memory used by the application. The usedGpuCcProtectedMemory field returned is all of the protected memory used by the application. Keep in mind that information returned by this call is dynamic and the number of elements might change in time. Allocate more space for \a plist->procArray table in case new processes are spawned. @note In MIG mode, if device handle is provided, the API returns aggregate information, only if the caller has appropriate privileges. Per-instance information can be queried by using specific MIG device handles. Querying per-instance information using MIG device handles is not supported if the device is in vGPU Host virtualization mode. Protected memory usage is currently not available in MIG mode and in windows. @param device The device handle or MIG device handle @param plist Reference in which to process detail list \a plist->version The api version \a plist->mode The process mode \a plist->procArray Reference in which to return the process information \a plist->numProcArrayEntries Proc array size of returned entries @return - \ref NVML_SUCCESS if \a plist->numprocArrayEntries and \a plist->procArray have been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a plist->numprocArrayEntries indicates that the \a plist->procArray is too small \a plist->numprocArrayEntries will contain minimal amount of space necessary for the call to complete - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a plist is NULL, \a plist->version is invalid, \a plist->mode is invalid, - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by \a device - \ref NVML_ERROR_UNKNOWN on any unexpected error */ fn nvmlDeviceGetRunningProcessDetailList( device: cuda_types::nvml::nvmlDevice_t, plist: *mut cuda_types::nvml::nvmlProcessDetailList_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Check if the GPU devices are on the same physical board. For all fully supported products. @param device1 The first GPU device @param device2 The second GPU device @param onSameBoard Reference in which to return the status. Non-zero indicates that the GPUs are on the same board. @return - \ref NVML_SUCCESS if \a onSameBoard has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a dev1 or \a dev2 are invalid or \a onSameBoard is NULL - \ref NVML_ERROR_NOT_SUPPORTED if this check is not supported by the device - \ref NVML_ERROR_GPU_IS_LOST if the either GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceOnSameBoard( device1: cuda_types::nvml::nvmlDevice_t, device2: cuda_types::nvml::nvmlDevice_t, onSameBoard: *mut ::core::ffi::c_int, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the root/admin permissions on the target API. See \a nvmlRestrictedAPI_t for the list of supported APIs. If an API is restricted only root users can call that API. See \a nvmlDeviceSetAPIRestriction to change current permissions. For all fully supported products. @param device The identifier of the target device @param apiType Target API type for this operation @param isRestricted Reference in which to return the current restriction NVML_FEATURE_ENABLED indicates that the API is root-only NVML_FEATURE_DISABLED indicates that the API is accessible to all users @return - \ref NVML_SUCCESS if \a isRestricted has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a apiType incorrect or \a isRestricted is NULL - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device or the device does not support the feature that is being queried (E.G. Enabling/disabling Auto Boosted clocks is not supported by the device) - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlRestrictedAPI_t*/ fn nvmlDeviceGetAPIRestriction( device: cuda_types::nvml::nvmlDevice_t, apiType: cuda_types::nvml::nvmlRestrictedAPI_t, isRestricted: *mut cuda_types::nvml::nvmlEnableState_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Gets recent samples for the GPU. For Kepler &tm; or newer fully supported devices. Based on type, this method can be used to fetch the power, utilization or clock samples maintained in the buffer by the driver. Power, Utilization and Clock samples are returned as type "unsigned int" for the union nvmlValue_t. To get the size of samples that user needs to allocate, the method is invoked with samples set to NULL. The returned samplesCount will provide the number of samples that can be queried. The user needs to allocate the buffer with size as samplesCount * sizeof(nvmlSample_t). lastSeenTimeStamp represents CPU timestamp in microseconds. Set it to 0 to fetch all the samples maintained by the underlying buffer. Set lastSeenTimeStamp to one of the timeStamps retrieved from the date of the previous query to get more recent samples. This method fetches the number of entries which can be accommodated in the provided samples array, and the reference samplesCount is updated to indicate how many samples were actually retrieved. The advantage of using this method for samples in contrast to polling via existing methods is to get get higher frequency data at lower polling cost. @note On MIG-enabled GPUs, querying the following sample types, NVML_GPU_UTILIZATION_SAMPLES, NVML_MEMORY_UTILIZATION_SAMPLES NVML_ENC_UTILIZATION_SAMPLES and NVML_DEC_UTILIZATION_SAMPLES, is not currently supported. @param device The identifier for the target device @param type Type of sampling event @param lastSeenTimeStamp Return only samples with timestamp greater than lastSeenTimeStamp. @param sampleValType Output parameter to represent the type of sample value as described in nvmlSampleVal_t @param sampleCount Reference to provide the number of elements which can be queried in samples array @param samples Reference in which samples are returned @return - \ref NVML_SUCCESS if samples are successfully retrieved - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a samplesCount is NULL or reference to \a sampleCount is 0 for non null \a samples - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_NOT_FOUND if sample entries are not found - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetSamples( device: cuda_types::nvml::nvmlDevice_t, type_: cuda_types::nvml::nvmlSamplingType_t, lastSeenTimeStamp: ::core::ffi::c_ulonglong, sampleValType: *mut cuda_types::nvml::nvmlValueType_t, sampleCount: *mut ::core::ffi::c_uint, samples: *mut cuda_types::nvml::nvmlSample_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Gets Total, Available and Used size of BAR1 memory. BAR1 is used to map the FB (device memory) so that it can be directly accessed by the CPU or by 3rd party devices (peer-to-peer on the PCIE bus). @note In MIG mode, if device handle is provided, the API returns aggregate information, only if the caller has appropriate privileges. Per-instance information can be queried by using specific MIG device handles. For Kepler &tm; or newer fully supported devices. @param device The identifier of the target device @param bar1Memory Reference in which BAR1 memory information is returned. @return - \ref NVML_SUCCESS if BAR1 memory is successfully retrieved - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a bar1Memory is NULL - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error */ fn nvmlDeviceGetBAR1MemoryInfo( device: cuda_types::nvml::nvmlDevice_t, bar1Memory: *mut cuda_types::nvml::nvmlBAR1Memory_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** @deprecated Use \ref nvmlDeviceGetFieldValues to query this data. This API will be removed in CUDA 14.0. Translations are as follows: NVML_PERF_POLICY_POWER -> NVML_FI_DEV_CLOCKS_EVENT_REASON_SW_POWER_CAP NVML_PERF_POLICY_THERMAL -> NVML_FI_DEV_CLOCKS_EVENT_REASON_SW_THERM_SLOWDOWN NVML_PERF_POLICY_SYNC_BOOST -> NVML_FI_DEV_CLOCKS_EVENT_REASON_SYNC_BOOST NVML_PERF_POLICY_BOARD_LIMIT -> NVML_FI_DEV_PERF_POLICY_BOARD_LIMIT NVML_PERF_POLICY_LOW_UTILIZATION -> NVML_FI_DEV_PERF_POLICY_LOW_UTILIZATION NVML_PERF_POLICY_RELIABILITY -> NVML_FI_DEV_PERF_POLICY_RELIABILITY NVML_PERF_POLICY_TOTAL_APP_CLOCKS -> DEPRECATED, Do not use NVML_PERF_POLICY_TOTAL_BASE_CLOCKS -> NVML_FI_DEV_PERF_POLICY_TOTAL_BASE_CLOCKS*/ fn nvmlDeviceGetViolationStatus( device: cuda_types::nvml::nvmlDevice_t, perfPolicyType: cuda_types::nvml::nvmlPerfPolicyType_t, violTime: *mut cuda_types::nvml::nvmlViolationTime_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Gets the device's interrupt number @param device The identifier of the target device @param irqNum The interrupt number associated with the specified device @return - \ref NVML_SUCCESS if irq number is successfully retrieved - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a irqNum is NULL - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible */ fn nvmlDeviceGetIrqNum( device: cuda_types::nvml::nvmlDevice_t, irqNum: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Gets the device's core count @note On MIG-enabled GPUs, querying the device's core count is currently not supported using this API. Please use \ref nvmlDeviceGetGpuInstanceProfileInfo to fetch the MIG device's core count. @param device The identifier of the target device @param numCores The number of cores for the specified device @return - \ref NVML_SUCCESS if GPU core count is successfully retrieved - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a numCores is NULL - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device or a mig device. - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible */ fn nvmlDeviceGetNumGpuCores( device: cuda_types::nvml::nvmlDevice_t, numCores: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Gets the devices power source @param device The identifier of the target device @param powerSource The power source of the device @return - \ref NVML_SUCCESS if the current power source was successfully retrieved - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a powerSource is NULL - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible */ fn nvmlDeviceGetPowerSource( device: cuda_types::nvml::nvmlDevice_t, powerSource: *mut cuda_types::nvml::nvmlPowerSource_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Gets the device's memory bus width @param device The identifier of the target device @param busWidth The devices's memory bus width @return - \ref NVML_SUCCESS if the memory bus width is successfully retrieved - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a busWidth is NULL - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible */ fn nvmlDeviceGetMemoryBusWidth( device: cuda_types::nvml::nvmlDevice_t, busWidth: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Gets the device's PCIE Max Link speed in MBPS @param device The identifier of the target device @param maxSpeed The devices's PCIE Max Link speed in MBPS @return - \ref NVML_SUCCESS if PCIe Max Link Speed is successfully retrieved - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a maxSpeed is NULL - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible */ fn nvmlDeviceGetPcieLinkMaxSpeed( device: cuda_types::nvml::nvmlDevice_t, maxSpeed: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Gets the device's PCIe Link speed in Mbps @param device The identifier of the target device @param pcieSpeed The devices's PCIe Max Link speed in Mbps @return - \ref NVML_SUCCESS if \a pcieSpeed has been retrieved - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a pcieSpeed is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support PCIe speed getting - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetPcieSpeed( device: cuda_types::nvml::nvmlDevice_t, pcieSpeed: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Gets the device's Adaptive Clock status @param device The identifier of the target device @param adaptiveClockStatus The current adaptive clocking status, either NVML_ADAPTIVE_CLOCKING_INFO_STATUS_DISABLED or NVML_ADAPTIVE_CLOCKING_INFO_STATUS_ENABLED @return - \ref NVML_SUCCESS if the current adaptive clocking status is successfully retrieved - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a adaptiveClockStatus is NULL - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible */ fn nvmlDeviceGetAdaptiveClockInfoStatus( device: cuda_types::nvml::nvmlDevice_t, adaptiveClockStatus: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get the type of the GPU Bus (PCIe, PCI, ...) @param device The identifier of the target device @param type The PCI Bus type return - \ref NVML_SUCCESS if the bus \a type is successfully retreived - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a type is NULL - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetBusType( device: cuda_types::nvml::nvmlDevice_t, type_: *mut cuda_types::nvml::nvmlBusType_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** @deprecated Will be deprecated in a future release. Use \ref nvmlDeviceGetGpuFabricInfoV instead Get fabric information associated with the device. For Hopper &tm; or newer fully supported devices. On Hopper + NVSwitch systems, GPU is registered with the NVIDIA Fabric Manager Upon successful registration, the GPU is added to the NVLink fabric to enable peer-to-peer communication. This API reports the current state of the GPU in the NVLink fabric along with other useful information. @param device The identifier of the target device @param gpuFabricInfo Information about GPU fabric state @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't support gpu fabric*/ fn nvmlDeviceGetGpuFabricInfo( device: cuda_types::nvml::nvmlDevice_t, gpuFabricInfo: *mut cuda_types::nvml::nvmlGpuFabricInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Versioned wrapper around \ref nvmlDeviceGetGpuFabricInfo that accepts a versioned \ref nvmlGpuFabricInfo_v2_t or later output structure. @note The caller must set the \ref nvmlGpuFabricInfoV_t.version field to the appropriate version prior to calling this function. For example: \code nvmlGpuFabricInfoV_t fabricInfo = { .version = nvmlGpuFabricInfo_v2 }; nvmlReturn_t result = nvmlDeviceGetGpuFabricInfoV(device,&fabricInfo); \endcode For Hopper &tm; or newer fully supported devices. @param device The identifier of the target device @param gpuFabricInfo Information about GPU fabric state @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't support gpu fabric*/ fn nvmlDeviceGetGpuFabricInfoV( device: cuda_types::nvml::nvmlDevice_t, gpuFabricInfo: *mut cuda_types::nvml::nvmlGpuFabricInfoV_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get Conf Computing System capabilities. For Ampere &tm; or newer fully supported devices. Supported on Linux, Windows TCC. @param capabilities System CC capabilities @return - \ref NVML_SUCCESS if \a capabilities were successfully queried - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a capabilities is invalid - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device*/ fn nvmlSystemGetConfComputeCapabilities( capabilities: *mut cuda_types::nvml::nvmlConfComputeSystemCaps_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get Conf Computing System State. For Ampere &tm; or newer fully supported devices. Supported on Linux, Windows TCC. @param state System CC State @return - \ref NVML_SUCCESS if \a state were successfully queried - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a state is invalid - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device*/ fn nvmlSystemGetConfComputeState( state: *mut cuda_types::nvml::nvmlConfComputeSystemState_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get Conf Computing Protected and Unprotected Memory Sizes. For Ampere &tm; or newer fully supported devices. Supported on Linux, Windows TCC. @param device Device handle @param memInfo Protected/Unprotected Memory sizes @return - \ref NVML_SUCCESS if \a memInfo were successfully queried - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a memInfo or \a device is invalid - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device*/ fn nvmlDeviceGetConfComputeMemSizeInfo( device: cuda_types::nvml::nvmlDevice_t, memInfo: *mut cuda_types::nvml::nvmlConfComputeMemSizeInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get Conf Computing GPUs ready state. For Ampere &tm; or newer fully supported devices. Supported on Linux, Windows TCC. @param isAcceptingWork Returns GPU current work accepting state, NVML_CC_ACCEPTING_CLIENT_REQUESTS_TRUE or NVML_CC_ACCEPTING_CLIENT_REQUESTS_FALSE return - \ref NVML_SUCCESS if \a current GPUs ready state were successfully queried - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a isAcceptingWork is NULL - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device*/ fn nvmlSystemGetConfComputeGpusReadyState( isAcceptingWork: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get Conf Computing protected memory usage. For Ampere &tm; or newer fully supported devices. Supported on Linux, Windows TCC. @param device The identifier of the target device @param memory Reference in which to return the memory information @return - \ref NVML_SUCCESS if \a memory has been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a memory is NULL - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetConfComputeProtectedMemoryUsage( device: cuda_types::nvml::nvmlDevice_t, memory: *mut cuda_types::nvml::nvmlMemory_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get Conf Computing GPU certificate details. For Ampere &tm; or newer fully supported devices. Supported on Linux, Windows TCC. @param device The identifier of the target device @param gpuCert Reference in which to return the gpu certificate information @return - \ref NVML_SUCCESS if \a gpu certificate info has been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a memory is NULL - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetConfComputeGpuCertificate( device: cuda_types::nvml::nvmlDevice_t, gpuCert: *mut cuda_types::nvml::nvmlConfComputeGpuCertificate_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get Conf Computing GPU attestation report. For Ampere &tm; or newer fully supported devices. Supported on Linux, Windows TCC. @param device The identifier of the target device @param gpuAtstReport Reference in which to return the gpu attestation report @return - \ref NVML_SUCCESS if \a gpu attestation report has been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a memory is NULL - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetConfComputeGpuAttestationReport( device: cuda_types::nvml::nvmlDevice_t, gpuAtstReport: *mut cuda_types::nvml::nvmlConfComputeGpuAttestationReport_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get Conf Computing key rotation threshold detail. For Hopper &tm; or newer fully supported devices. Supported on Linux, Windows TCC. @param pKeyRotationThrInfo Reference in which to return the key rotation threshold data @return - \ref NVML_SUCCESS if \a gpu key rotation threshold info has been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a memory is NULL - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlSystemGetConfComputeKeyRotationThresholdInfo( pKeyRotationThrInfo: *mut cuda_types::nvml::nvmlConfComputeGetKeyRotationThresholdInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Set Conf Computing Unprotected Memory Size. For Ampere &tm; or newer fully supported devices. Supported on Linux, Windows TCC. @param device Device Handle @param sizeKiB Unprotected Memory size to be set in KiB @return - \ref NVML_SUCCESS if \a sizeKiB successfully set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device*/ fn nvmlDeviceSetConfComputeUnprotectedMemSize( device: cuda_types::nvml::nvmlDevice_t, sizeKiB: ::core::ffi::c_ulonglong, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Set Conf Computing GPUs ready state. For Ampere &tm; or newer fully supported devices. Supported on Linux, Windows TCC. @param isAcceptingWork GPU accepting new work, NVML_CC_ACCEPTING_CLIENT_REQUESTS_TRUE or NVML_CC_ACCEPTING_CLIENT_REQUESTS_FALSE return - \ref NVML_SUCCESS if \a current GPUs ready state is successfully set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a isAcceptingWork is invalid - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device*/ fn nvmlSystemSetConfComputeGpusReadyState( isAcceptingWork: ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Set Conf Computing key rotation threshold. For Hopper &tm; or newer fully supported devices. Supported on Linux, Windows TCC. This function is to set the confidential compute key rotation threshold parameters. \a pKeyRotationThrInfo->maxAttackerAdvantage should be in the range from NVML_CC_KEY_ROTATION_THRESHOLD_ATTACKER_ADVANTAGE_MIN to NVML_CC_KEY_ROTATION_THRESHOLD_ATTACKER_ADVANTAGE_MAX. Default value is 60. @param pKeyRotationThrInfo Reference to the key rotation threshold data @return - \ref NVML_SUCCESS if \a key rotation threashold max attacker advantage has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a memory is NULL - \ref NVML_ERROR_INVALID_STATE if confidential compute GPU ready state is enabled - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlSystemSetConfComputeKeyRotationThresholdInfo( pKeyRotationThrInfo: *mut cuda_types::nvml::nvmlConfComputeSetKeyRotationThresholdInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get Conf Computing System Settings. For Hopper &tm; or newer fully supported devices. Supported on Linux, Windows TCC. @param settings System CC settings @return - \ref NVML_SUCCESS If the query is success - \ref NVML_ERROR_UNINITIALIZED If the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a device is invalid or \a counters is NULL - \ref NVML_ERROR_NOT_SUPPORTED If the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST If the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH If the provided version is invalid/unsupported - \ref NVML_ERROR_UNKNOWN On any unexpected error*/ fn nvmlSystemGetConfComputeSettings( settings: *mut cuda_types::nvml::nvmlSystemConfComputeSettings_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve GSP firmware version. The caller passes in buffer via \a version and corresponding GSP firmware numbered version is returned with the same parameter in string format. @param device Device handle @param version The retrieved GSP firmware version @return - \ref NVML_SUCCESS if GSP firmware version is sucessfully retrieved - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or GSP \a version pointer is NULL - \ref NVML_ERROR_NOT_SUPPORTED if GSP firmware is not enabled for GPU - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetGspFirmwareVersion( device: cuda_types::nvml::nvmlDevice_t, version: *mut ::core::ffi::c_char, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve GSP firmware mode. The caller passes in integer pointers. GSP firmware enablement and default mode information is returned with corresponding parameters. The return value in \a isEnabled and \a defaultMode should be treated as boolean. @param device Device handle @param isEnabled Pointer to specify if GSP firmware is enabled @param defaultMode Pointer to specify if GSP firmware is supported by default on \a device @return - \ref NVML_SUCCESS if GSP firmware mode is sucessfully retrieved - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or any of \a isEnabled or \a defaultMode is NULL - \ref NVML_ERROR_NOT_SUPPORTED if GSP firmware is not enabled for GPU - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetGspFirmwareMode( device: cuda_types::nvml::nvmlDevice_t, isEnabled: *mut ::core::ffi::c_uint, defaultMode: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get SRAM ECC error status of this device. For Ampere &tm; or newer fully supported devices. Requires root/admin permissions. See \ref nvmlEccSramErrorStatus_v1_t for more information on the struct. @param device The identifier of the target device @param status Returns SRAM ECC error status @return - \ref NVML_SUCCESS If \a limit has been set - \ref NVML_ERROR_UNINITIALIZED If the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a device is invalid or \a counters is NULL - \ref NVML_ERROR_NOT_SUPPORTED If the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST If the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH If the version of \a nvmlEccSramErrorStatus_t is invalid - \ref NVML_ERROR_UNKNOWN On any unexpected error*/ fn nvmlDeviceGetSramEccErrorStatus( device: cuda_types::nvml::nvmlDevice_t, status: *mut cuda_types::nvml::nvmlEccSramErrorStatus_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Set new power limit of this device. For Kepler &tm; or newer fully supported devices. Requires root/admin permissions. See \ref nvmlDeviceGetPowerManagementLimitConstraints to check the allowed ranges of values. See \ref nvmlPowerValue_v2_t for more information on the struct. \note Limit is not persistent across reboots or driver unloads. Enable persistent mode to prevent driver from unloading when no application is using the device. This API replaces nvmlDeviceSetPowerManagementLimit. It can be used as a drop-in replacement for the older version. @param device The identifier of the target device @param powerValue Power management limit in milliwatts to set @return - \ref NVML_SUCCESS if \a limit has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a powerValue is NULL or contains invalid values - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see NVML_FI_DEV_POWER_AVERAGE @see NVML_FI_DEV_POWER_INSTANT @see NVML_FI_DEV_POWER_MIN_LIMIT @see NVML_FI_DEV_POWER_MAX_LIMIT @see NVML_FI_DEV_POWER_CURRENT_LIMIT*/ fn nvmlDeviceSetPowerManagementLimit_v2( device: cuda_types::nvml::nvmlDevice_t, powerValue: *mut cuda_types::nvml::nvmlPowerValue_v2_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Queries the state of per process accounting mode. For Kepler &tm; or newer fully supported devices. See \ref nvmlDeviceGetAccountingStats for more details. See \ref nvmlDeviceSetAccountingMode @param device The identifier of the target device @param mode Reference in which to return the current accounting mode @return - \ref NVML_SUCCESS if the mode has been successfully retrieved - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a mode are NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetAccountingMode( device: cuda_types::nvml::nvmlDevice_t, mode: *mut cuda_types::nvml::nvmlEnableState_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Queries process's accounting stats. For Kepler &tm; or newer fully supported devices. Accounting stats capture GPU utilization and other statistics across the lifetime of a process. Accounting stats can be queried during life time of the process and after its termination. The time field in \ref nvmlAccountingStats_t is reported as 0 during the lifetime of the process and updated to actual running time after its termination. Accounting stats are kept in a circular buffer, newly created processes overwrite information about old processes. See \ref nvmlAccountingStats_t for description of each returned metric. List of processes that can be queried can be retrieved from \ref nvmlDeviceGetAccountingPids. @note Accounting Mode needs to be on. See \ref nvmlDeviceGetAccountingMode. @note Only compute and graphics applications stats can be queried. Monitoring applications stats can't be queried since they don't contribute to GPU utilization. @note In case of pid collision stats of only the latest process (that terminated last) will be reported @warning On Kepler devices per process statistics are accurate only if there's one process running on a GPU. @param device The identifier of the target device @param pid Process Id of the target process to query stats for @param stats Reference in which to return the process's accounting stats @return - \ref NVML_SUCCESS if stats have been successfully retrieved - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a stats are NULL - \ref NVML_ERROR_NOT_FOUND if process stats were not found - \ref NVML_ERROR_NOT_SUPPORTED if \a device doesn't support this feature or accounting mode is disabled or on vGPU host. - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlDeviceGetAccountingBufferSize*/ fn nvmlDeviceGetAccountingStats( device: cuda_types::nvml::nvmlDevice_t, pid: ::core::ffi::c_uint, stats: *mut cuda_types::nvml::nvmlAccountingStats_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Queries list of processes that can be queried for accounting stats. The list of processes returned can be in running or terminated state. For Kepler &tm; or newer fully supported devices. To query the number of processes under Accounting Mode, call this function with *count = 0 and pids=NULL. The return code will be NVML_ERROR_INSUFFICIENT_SIZE with an updated count value indicating the number of processes. For more details see \ref nvmlDeviceGetAccountingStats. @note In case of PID collision some processes might not be accessible before the circular buffer is full. @param device The identifier of the target device @param count Reference in which to provide the \a pids array size, and to return the number of elements ready to be queried @param pids Reference in which to return list of process ids @return - \ref NVML_SUCCESS if pids were successfully retrieved - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a count is NULL - \ref NVML_ERROR_NOT_SUPPORTED if \a device doesn't support this feature or accounting mode is disabled or on vGPU host. - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a count is too small (\a count is set to expected value) - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlDeviceGetAccountingBufferSize*/ fn nvmlDeviceGetAccountingPids( device: cuda_types::nvml::nvmlDevice_t, count: *mut ::core::ffi::c_uint, pids: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Returns the number of processes that the circular buffer with accounting pids can hold. For Kepler &tm; or newer fully supported devices. This is the maximum number of processes that accounting information will be stored for before information about oldest processes will get overwritten by information about new processes. @param device The identifier of the target device @param bufferSize Reference in which to provide the size (in number of elements) of the circular buffer for accounting stats. @return - \ref NVML_SUCCESS if buffer size was successfully retrieved - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a bufferSize is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature or accounting mode is disabled - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlDeviceGetAccountingStats @see nvmlDeviceGetAccountingPids*/ fn nvmlDeviceGetAccountingBufferSize( device: cuda_types::nvml::nvmlDevice_t, bufferSize: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Returns the list of retired pages by source, including pages that are pending retirement The address information provided from this API is the hardware address of the page that was retired. Note that this does not match the virtual address used in CUDA, but will match the address information in Xid 63 For Kepler &tm; or newer fully supported devices. @param device The identifier of the target device @param cause Filter page addresses by cause of retirement @param pageCount Reference in which to provide the \a addresses buffer size, and to return the number of retired pages that match \a cause Set to 0 to query the size without allocating an \a addresses buffer @param addresses Buffer to write the page addresses into @return - \ref NVML_SUCCESS if \a pageCount was populated and \a addresses was filled - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a pageCount indicates the buffer is not large enough to store all the matching page addresses. \a pageCount is set to the needed size. - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a pageCount is NULL, \a cause is invalid, or \a addresses is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetRetiredPages( device: cuda_types::nvml::nvmlDevice_t, cause: cuda_types::nvml::nvmlPageRetirementCause_t, pageCount: *mut ::core::ffi::c_uint, addresses: *mut ::core::ffi::c_ulonglong, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Returns the list of retired pages by source, including pages that are pending retirement The address information provided from this API is the hardware address of the page that was retired. Note that this does not match the virtual address used in CUDA, but will match the address information in Xid 63 \note nvmlDeviceGetRetiredPages_v2 adds an additional timestamps parameter to return the time of each page's retirement. This is supported for Pascal and newer architecture. For Kepler &tm; or newer fully supported devices. @param device The identifier of the target device @param cause Filter page addresses by cause of retirement @param pageCount Reference in which to provide the \a addresses buffer size, and to return the number of retired pages that match \a cause Set to 0 to query the size without allocating an \a addresses buffer @param addresses Buffer to write the page addresses into @param timestamps Buffer to write the timestamps of page retirement, additional for _v2 @return - \ref NVML_SUCCESS if \a pageCount was populated and \a addresses was filled - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a pageCount indicates the buffer is not large enough to store all the matching page addresses. \a pageCount is set to the needed size. - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a pageCount is NULL, \a cause is invalid, or \a addresses is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetRetiredPages_v2( device: cuda_types::nvml::nvmlDevice_t, cause: cuda_types::nvml::nvmlPageRetirementCause_t, pageCount: *mut ::core::ffi::c_uint, addresses: *mut ::core::ffi::c_ulonglong, timestamps: *mut ::core::ffi::c_ulonglong, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Check if any pages are pending retirement and need a reboot to fully retire. For Kepler &tm; or newer fully supported devices. @param device The identifier of the target device @param isPending Reference in which to return the pending status @return - \ref NVML_SUCCESS if \a isPending was populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a isPending is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetRetiredPagesPendingStatus( device: cuda_types::nvml::nvmlDevice_t, isPending: *mut cuda_types::nvml::nvmlEnableState_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get number of remapped rows. The number of rows reported will be based on the cause of the remapping. isPending indicates whether or not there are pending remappings. A reset will be required to actually remap the row. failureOccurred will be set if a row remapping ever failed in the past. A pending remapping won't affect future work on the GPU since error-containment and dynamic page blacklisting will take care of that. @note On MIG-enabled GPUs with active instances, querying the number of remapped rows is not supported For Ampere &tm; or newer fully supported devices. @param device The identifier of the target device @param corrRows Reference for number of rows remapped due to correctable errors @param uncRows Reference for number of rows remapped due to uncorrectable errors @param isPending Reference for whether or not remappings are pending @param failureOccurred Reference that is set when a remapping has failed in the past @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_INVALID_ARGUMENT If \a corrRows, \a uncRows, \a isPending or \a failureOccurred is invalid - \ref NVML_ERROR_NOT_SUPPORTED If MIG is enabled or if the device doesn't support this feature - \ref NVML_ERROR_UNKNOWN Unexpected error*/ fn nvmlDeviceGetRemappedRows( device: cuda_types::nvml::nvmlDevice_t, corrRows: *mut ::core::ffi::c_uint, uncRows: *mut ::core::ffi::c_uint, isPending: *mut ::core::ffi::c_uint, failureOccurred: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get the row remapper histogram. Returns the remap availability for each bank on the GPU. @param device Device handle @param values Histogram values @return - \ref NVML_SUCCESS On success - \ref NVML_ERROR_UNKNOWN On any unexpected error*/ fn nvmlDeviceGetRowRemapperHistogram( device: cuda_types::nvml::nvmlDevice_t, values: *mut cuda_types::nvml::nvmlRowRemapperHistogramValues_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get architecture for device @param device The identifier of the target device @param arch Reference where architecture is returned, if call successful. Set to NVML_DEVICE_ARCH_* upon success @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a device or \a arch (output refererence) are invalid*/ fn nvmlDeviceGetArchitecture( device: cuda_types::nvml::nvmlDevice_t, arch: *mut cuda_types::nvml::nvmlDeviceArchitecture_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the frequency monitor fault status for the device. For Ampere &tm; or newer fully supported devices. Requires root user. See \ref nvmlClkMonStatus_t for details on decoding the status output. @param device The identifier of the target device @param status Reference in which to return the clkmon fault status @return - \ref NVML_SUCCESS if \a status has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a status is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlDeviceGetClkMonStatus()*/ fn nvmlDeviceGetClkMonStatus( device: cuda_types::nvml::nvmlDevice_t, status: *mut cuda_types::nvml::nvmlClkMonStatus_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the current utilization and process ID For Maxwell &tm; or newer fully supported devices. Reads recent utilization of GPU SM (3D/Compute), framebuffer, video encoder, and video decoder for processes running. Utilization values are returned as an array of utilization sample structures in the caller-supplied buffer pointed at by \a utilization. One utilization sample structure is returned per process running, that had some non-zero utilization during the last sample period. It includes the CPU timestamp at which the samples were recorded. Individual utilization values are returned as "unsigned int" values. If no valid sample entries are found since the lastSeenTimeStamp, NVML_ERROR_NOT_FOUND is returned. To read utilization values, first determine the size of buffer required to hold the samples by invoking the function with \a utilization set to NULL. The caller should allocate a buffer of size processSamplesCount * sizeof(nvmlProcessUtilizationSample_t). Invoke the function again with the allocated buffer passed in \a utilization, and \a processSamplesCount set to the number of entries the buffer is sized for. On successful return, the function updates \a processSamplesCount with the number of process utilization sample structures that were actually written. This may differ from a previously read value as instances are created or destroyed. lastSeenTimeStamp represents the CPU timestamp in microseconds at which utilization samples were last read. Set it to 0 to read utilization based on all the samples maintained by the driver's internal sample buffer. Set lastSeenTimeStamp to a timeStamp retrieved from a previous query to read utilization since the previous query. @note On MIG-enabled GPUs, querying process utilization is not currently supported. @param device The identifier of the target device @param utilization Pointer to caller-supplied buffer in which guest process utilization samples are returned @param processSamplesCount Pointer to caller-supplied array size, and returns number of processes running @param lastSeenTimeStamp Return only samples with timestamp greater than lastSeenTimeStamp. @return - \ref NVML_SUCCESS if \a utilization has been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a utilization is NULL, or \a samplingPeriodUs is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_NOT_FOUND if sample entries are not found - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetProcessUtilization( device: cuda_types::nvml::nvmlDevice_t, utilization: *mut cuda_types::nvml::nvmlProcessUtilizationSample_t, processSamplesCount: *mut ::core::ffi::c_uint, lastSeenTimeStamp: ::core::ffi::c_ulonglong, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the recent utilization and process ID for all running processes For Maxwell &tm; or newer fully supported devices. Reads recent utilization of GPU SM (3D/Compute), framebuffer, video encoder, and video decoder, jpeg decoder, OFA (Optical Flow Accelerator) for all running processes. Utilization values are returned as an array of utilization sample structures in the caller-supplied buffer pointed at by \a procesesUtilInfo->procUtilArray. One utilization sample structure is returned per process running, that had some non-zero utilization during the last sample period. It includes the CPU timestamp at which the samples were recorded. Individual utilization values are returned as "unsigned int" values. The caller should allocate a buffer of size processSamplesCount * sizeof(nvmlProcessUtilizationInfo_t). If the buffer is too small, the API will return \a NVML_ERROR_INSUFFICIENT_SIZE, with the recommended minimal buffer size at \a procesesUtilInfo->processSamplesCount. The caller should invoke the function again with the allocated buffer passed in \a procesesUtilInfo->procUtilArray, and \a procesesUtilInfo->processSamplesCount set to the number no less than the recommended value by the previous API return. On successful return, the function updates \a procesesUtilInfo->processSamplesCount with the number of process utilization info structures that were actually written. This may differ from a previously read value as instances are created or destroyed. \a procesesUtilInfo->lastSeenTimeStamp represents the CPU timestamp in microseconds at which utilization samples were last read. Set it to 0 to read utilization based on all the samples maintained by the driver's internal sample buffer. Set \a procesesUtilInfo->lastSeenTimeStamp to a timeStamp retrieved from a previous query to read utilization since the previous query. \a procesesUtilInfo->version is the version number of the structure nvmlProcessesUtilizationInfo_t, the caller should set the correct version number to retrieve the specific version of processes utilization information. @note On MIG-enabled GPUs, querying process utilization is not currently supported. @param device The identifier of the target device @param procesesUtilInfo Pointer to the caller-provided structure of nvmlProcessesUtilizationInfo_t. @return - \ref NVML_SUCCESS If \a procesesUtilInfo->procUtilArray has been populated - \ref NVML_ERROR_UNINITIALIZED If the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a device is invalid, or \a procesesUtilInfo is NULL - \ref NVML_ERROR_NOT_SUPPORTED If the device does not support this feature - \ref NVML_ERROR_NOT_FOUND If sample entries are not found - \ref NVML_ERROR_GPU_IS_LOST If the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH If the version of \a procesesUtilInfo is invalid - \ref NVML_ERROR_INSUFFICIENT_SIZE If \a procesesUtilInfo->procUtilArray is NULL, or the buffer size of procesesUtilInfo->procUtilArray is too small. The caller should check the minimul array size from the returned procesesUtilInfo->processSamplesCount, and call the function again with a buffer no smaller than procesesUtilInfo->processSamplesCount * sizeof(nvmlProcessUtilizationInfo_t) - \ref NVML_ERROR_UNKNOWN On any unexpected error*/ fn nvmlDeviceGetProcessesUtilizationInfo( device: cuda_types::nvml::nvmlDevice_t, procesesUtilInfo: *mut cuda_types::nvml::nvmlProcessesUtilizationInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get platform information of this device. For Blackwell &tm; or newer fully supported devices. See \ref nvmlPlatformInfo_v2_t for more information on the struct. @param device The identifier of the target device @param platformInfo Pointer to the caller-provided structure of nvmlPlatformInfo_t. @return - \ref NVML_SUCCESS If \a platformInfo has been retrieved - \ref NVML_ERROR_INVALID_ARGUMENT If \a device is invalid or \a platformInfo is NULL - \ref NVML_ERROR_NOT_SUPPORTED If the device does not support this feature - \ref NVML_ERROR_MEMORY if system memory is insufficient - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH If the version of \a nvmlPlatformInfo_t is invalid - \ref NVML_ERROR_UNKNOWN On any unexpected error*/ fn nvmlDeviceGetPlatformInfo( device: cuda_types::nvml::nvmlDevice_t, platformInfo: *mut cuda_types::nvml::nvmlPlatformInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the Per Device Identifier (PDI) associated with this device. For Pascal &tm; or newer fully supported devices. See \ref nvmlPdi_v1_t for more information on the struct. @param[in] device The identifier of the target device @param[out] pdi Reference to the caller-provided structure to return the GPU PDI @return - \ref NVML_SUCCESS if \a pdi has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a pdi is NULL - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH if the version is invalid/unsupported - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetPdi( device: cuda_types::nvml::nvmlDevice_t, pdi: *mut cuda_types::nvml::nvmlPdi_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Set the hostname for the device. For Blackwell &tm; or newer fully supported devices. Requires root/admin permissions. Supported on Linux only. Sets a hostname string for the GPU device. This operation takes effect immediately. The hostname is not stored persistently across GPU resets or driver reloads. @param device The identifier of the target device @param hostname Reference to the caller-provided \ref nvmlHostname_v1_t struct containing the hostname @return - \ref NVML_SUCCESS if the hostname was set successfully - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a hostname is NULL or contains invalid characters - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlDeviceGetHostname_v1()*/ fn nvmlDeviceSetHostname_v1( device: cuda_types::nvml::nvmlDevice_t, hostname: *mut cuda_types::nvml::nvmlHostname_v1_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get the hostname for the device. For Blackwell &tm; or newer fully supported devices. Supported on Linux only. Retrieves the hostname string for the GPU device that was set using \ref nvmlDeviceSetHostname_v1(). @param device The identifier of the target device @param hostname Reference to the caller-provided \ref nvmlHostname_v1_t struct to return the hostname @return - \ref NVML_SUCCESS if the hostname was retrieved successfully - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a hostname is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlDeviceSetHostname_v1()*/ fn nvmlDeviceGetHostname_v1( device: cuda_types::nvml::nvmlDevice_t, hostname: *mut cuda_types::nvml::nvmlHostname_v1_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Set the LED state for the unit. The LED can be either green (0) or amber (1). For S-class products. Requires root/admin permissions. This operation takes effect immediately. Current S-Class products don't provide unique LEDs for each unit. As such, both front and back LEDs will be toggled in unison regardless of which unit is specified with this command. See \ref nvmlLedColor_t for available colors. @param unit The identifier of the target unit @param color The target LED color @return - \ref NVML_SUCCESS if the LED color has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a unit or \a color is invalid - \ref NVML_ERROR_NOT_SUPPORTED if this is not an S-class product - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlUnitGetLedState()*/ fn nvmlUnitSetLedState( unit: cuda_types::nvml::nvmlUnit_t, color: cuda_types::nvml::nvmlLedColor_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Set the persistence mode for the device. For all products. For Linux only. Requires root/admin permissions. The persistence mode determines whether the GPU driver software is torn down after the last client exits. This operation takes effect immediately. It is not persistent across reboots. After each reboot the persistence mode is reset to "Disabled". See \ref nvmlEnableState_t for available modes. After calling this API with mode set to NVML_FEATURE_DISABLED on a device that has its own NUMA memory, the given device handle will no longer be valid, and to continue to interact with this device, a new handle should be obtained from one of the nvmlDeviceGetHandleBy*() APIs. This limitation is currently only applicable to devices that have a coherent NVLink connection to system memory. @param device The identifier of the target device @param mode The target persistence mode @return - \ref NVML_SUCCESS if the persistence mode was set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a mode is invalid - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlDeviceGetPersistenceMode()*/ fn nvmlDeviceSetPersistenceMode( device: cuda_types::nvml::nvmlDevice_t, mode: cuda_types::nvml::nvmlEnableState_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Set the compute mode for the device. For all products. Requires root/admin permissions. The compute mode determines whether a GPU can be used for compute operations and whether it can be shared across contexts. This operation takes effect immediately. Under Linux it is not persistent across reboots and always resets to "Default". Under windows it is persistent. Under windows compute mode may only be set to DEFAULT when running in WDDM @note On MIG-enabled GPUs, compute mode would be set to DEFAULT and changing it is not supported. See \ref nvmlComputeMode_t for details on available compute modes. @param device The identifier of the target device @param mode The target compute mode @return - \ref NVML_SUCCESS if the compute mode was set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a mode is invalid - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlDeviceGetComputeMode()*/ fn nvmlDeviceSetComputeMode( device: cuda_types::nvml::nvmlDevice_t, mode: cuda_types::nvml::nvmlComputeMode_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Set the ECC mode for the device. For Kepler &tm; or newer fully supported devices. Only applicable to devices with ECC. Requires \a NVML_INFOROM_ECC version 1.0 or higher. Requires root/admin permissions. The ECC mode determines whether the GPU enables its ECC support. This operation takes effect after the next reboot. See \ref nvmlEnableState_t for details on available modes. @param device The identifier of the target device @param ecc The target ECC mode @return - \ref NVML_SUCCESS if the ECC mode was set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a ecc is invalid - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlDeviceGetEccMode()*/ fn nvmlDeviceSetEccMode( device: cuda_types::nvml::nvmlDevice_t, ecc: cuda_types::nvml::nvmlEnableState_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Clear the ECC error and other memory error counts for the device. For Kepler &tm; or newer fully supported devices. Only applicable to devices with ECC. Requires \a NVML_INFOROM_ECC version 2.0 or higher to clear aggregate location-based ECC counts. Requires \a NVML_INFOROM_ECC version 1.0 or higher to clear all other ECC counts. Requires root/admin permissions. Requires ECC Mode to be enabled. Sets all of the specified ECC counters to 0, including both detailed and total counts. This operation takes effect immediately. See \ref nvmlMemoryErrorType_t for details on available counter types. @param device The identifier of the target device @param counterType Flag that indicates which type of errors should be cleared. @return - \ref NVML_SUCCESS if the error counts were cleared - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a counterType is invalid - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see - nvmlDeviceGetDetailedEccErrors() - nvmlDeviceGetTotalEccErrors()*/ fn nvmlDeviceClearEccErrorCounts( device: cuda_types::nvml::nvmlDevice_t, counterType: cuda_types::nvml::nvmlEccCounterType_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Set the driver model for the device. For Fermi &tm; or newer fully supported devices. For windows only. Requires root/admin permissions. On Windows platforms the device driver can run in either WDDM or WDM (TCC) mode. If a display is attached to the device it must run in WDDM mode. It is possible to force the change to WDM (TCC) while the display is still attached with a force flag (nvmlFlagForce). This should only be done if the host is subsequently powered down and the display is detached from the device before the next reboot. This operation takes effect after the next reboot. Windows driver model may only be set to WDDM when running in DEFAULT compute mode. Change driver model to WDDM is not supported when GPU doesn't support graphics acceleration or will not support it after reboot. See \ref nvmlDeviceSetGpuOperationMode. See \ref nvmlDriverModel_t for details on available driver models. See \ref nvmlFlagDefault and \ref nvmlFlagForce @param device The identifier of the target device @param driverModel The target driver model @param flags Flags that change the default behavior @return - \ref NVML_SUCCESS if the driver model has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a driverModel is invalid - \ref NVML_ERROR_NOT_SUPPORTED if the platform is not windows or the device does not support this feature - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlDeviceGetDriverModel()*/ fn nvmlDeviceSetDriverModel( device: cuda_types::nvml::nvmlDevice_t, driverModel: cuda_types::nvml::nvmlDriverModel_t, flags: ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Set clocks that device will lock to. Sets the clocks that the device will be running at to the value in the range of minGpuClockMHz to maxGpuClockMHz. Can be used as a setting to request constant performance. This can be called with a pair of integer clock frequencies in MHz, or a pair of /ref nvmlClockLimitId_t values. See the table below for valid combinations of these values. minGpuClock | maxGpuClock | Effect ------------+-------------+-------------------------------------------------- tdp | tdp | Lock clock to TDP unlimited | tdp | Upper bound is TDP but clock may drift below this tdp | unlimited | Lower bound is TDP but clock may boost above this unlimited | unlimited | Unlocked (== nvmlDeviceResetGpuLockedClocks) If one arg takes one of these values, the other must be one of these values as well. Mixed numeric and symbolic calls return NVML_ERROR_INVALID_ARGUMENT. Requires root/admin permissions. After system reboot or driver reload GPU clocks go back to their default value. See \ref nvmlDeviceResetGpuLockedClocks. For Volta &tm; or newer fully supported devices. @param device The identifier of the target device @param minGpuClockMHz Requested minimum gpu clock in MHz @param maxGpuClockMHz Requested maximum gpu clock in MHz @return - \ref NVML_SUCCESS if new settings were successfully set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a minGpuClockMHz and \a maxGpuClockMHz is not a valid clock combination - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceSetGpuLockedClocks( device: cuda_types::nvml::nvmlDevice_t, minGpuClockMHz: ::core::ffi::c_uint, maxGpuClockMHz: ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Resets the gpu clock to the default value This is the gpu clock that will be used after system reboot or driver reload. Default values are idle clocks. @see nvmlDeviceSetGpuLockedClocks For Volta &tm; or newer fully supported devices. @param device The identifier of the target device @return - \ref NVML_SUCCESS if new settings were successfully set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceResetGpuLockedClocks( device: cuda_types::nvml::nvmlDevice_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Set memory clocks that device will lock to. Sets the device's memory clocks to the value in the range of minMemClockMHz to maxMemClockMHz. Can be used as a setting to request constant performance. Requires root/admin permissions. After system reboot or driver reload memory clocks go back to their default value. See \ref nvmlDeviceResetMemoryLockedClocks. For Ampere &tm; or newer fully supported devices. @param device The identifier of the target device @param minMemClockMHz Requested minimum memory clock in MHz @param maxMemClockMHz Requested maximum memory clock in MHz @return - \ref NVML_SUCCESS if new settings were successfully set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a minGpuClockMHz and \a maxGpuClockMHz is not a valid clock combination - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceSetMemoryLockedClocks( device: cuda_types::nvml::nvmlDevice_t, minMemClockMHz: ::core::ffi::c_uint, maxMemClockMHz: ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Resets the memory clock to the default value This is the memory clock that will be used after system reboot or driver reload. Default values are idle clocks. @see nvmlDeviceSetMemoryLockedClocks For Ampere &tm; or newer fully supported devices. @param device The identifier of the target device @return - \ref NVML_SUCCESS if new settings were successfully set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceResetMemoryLockedClocks( device: cuda_types::nvml::nvmlDevice_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** @deprecated Applications clocks are deprecated and will be removed in CUDA 14.0. Please use \ref nvmlDeviceSetMemoryLockedClocks for Memory Clocks and \ref nvmlDeviceSetGpuLockedClocks for Graphics Clocks.*/ fn nvmlDeviceSetApplicationsClocks( device: cuda_types::nvml::nvmlDevice_t, memClockMHz: ::core::ffi::c_uint, graphicsClockMHz: ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** @deprecated Applications clocks are deprecated and will be removed in CUDA 14.0. Please use \ref nvmlDeviceResetMemoryLockedClocks for Memory Clocks and \ref nvmlDeviceResetGpuLockedClocks for Graphics Clocks.*/ fn nvmlDeviceResetApplicationsClocks( device: cuda_types::nvml::nvmlDevice_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Try to set the current state of Auto Boosted clocks on a device. For Kepler &tm; or newer fully supported devices. Auto Boosted clocks are enabled by default on some hardware, allowing the GPU to run at higher clock rates to maximize performance as thermal limits allow. Auto Boosted clocks should be disabled if fixed clock rates are desired. Non-root users may use this API by default but can be restricted by root from using this API by calling \ref nvmlDeviceSetAPIRestriction with apiType=NVML_RESTRICTED_API_SET_AUTO_BOOSTED_CLOCKS. Note: Persistence Mode is required to modify current Auto Boost settings, therefore, it must be enabled. On Pascal and newer hardware, Auto Boosted clocks are controlled through application clocks. Use \ref nvmlDeviceSetApplicationsClocks and \ref nvmlDeviceResetApplicationsClocks to control Auto Boost behavior. @param device The identifier of the target device @param enabled What state to try to set Auto Boosted clocks of the target device to @return - \ref NVML_SUCCESS If the Auto Boosted clocks were successfully set to the state specified by \a enabled - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support Auto Boosted clocks - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error */ fn nvmlDeviceSetAutoBoostedClocksEnabled( device: cuda_types::nvml::nvmlDevice_t, enabled: cuda_types::nvml::nvmlEnableState_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Try to set the default state of Auto Boosted clocks on a device. This is the default state that Auto Boosted clocks will return to when no compute running processes (e.g. CUDA application which have an active context) are running For Kepler &tm; or newer non-GeForce fully supported devices and Maxwell or newer GeForce devices. Requires root/admin permissions. Auto Boosted clocks are enabled by default on some hardware, allowing the GPU to run at higher clock rates to maximize performance as thermal limits allow. Auto Boosted clocks should be disabled if fixed clock rates are desired. On Pascal and newer hardware, Auto Boosted clocks are controlled through application clocks. Use \ref nvmlDeviceSetApplicationsClocks and \ref nvmlDeviceResetApplicationsClocks to control Auto Boost behavior. @param device The identifier of the target device @param enabled What state to try to set default Auto Boosted clocks of the target device to @param flags Flags that change the default behavior. Currently Unused. @return - \ref NVML_SUCCESS If the Auto Boosted clock's default state was successfully set to the state specified by \a enabled - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_NO_PERMISSION If the calling user does not have permission to change Auto Boosted clock's default state. - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support Auto Boosted clocks - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error */ fn nvmlDeviceSetDefaultAutoBoostedClocksEnabled( device: cuda_types::nvml::nvmlDevice_t, enabled: cuda_types::nvml::nvmlEnableState_t, flags: ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Sets the speed of the fan control policy to default. For all cuda-capable discrete products with fans @param device The identifier of the target device @param fan The index of the fan, starting at zero return NVML_SUCCESS if speed has been adjusted NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized NVML_ERROR_INVALID_ARGUMENT if device is invalid NVML_ERROR_NOT_SUPPORTED if the device does not support this (doesn't have fans) NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceSetDefaultFanSpeed_v2( device: cuda_types::nvml::nvmlDevice_t, fan: ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Sets current fan control policy. For Maxwell &tm; or newer fully supported devices. Requires privileged user. For all cuda-capable discrete products with fans device The identifier of the target \a device policy The fan control \a policy to set return NVML_SUCCESS if \a policy has been set NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a policy is null or the \a fan given doesn't reference a fan that exists. NVML_ERROR_NOT_SUPPORTED if the \a device is older than Maxwell NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceSetFanControlPolicy( device: cuda_types::nvml::nvmlDevice_t, fan: ::core::ffi::c_uint, policy: cuda_types::nvml::nvmlFanControlPolicy_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Sets the temperature threshold for the GPU with the specified threshold type in degrees C. For Maxwell &tm; or newer fully supported devices. See \ref nvmlTemperatureThresholds_t for details on available temperature thresholds. @param device The identifier of the target device @param thresholdType The type of threshold value to be set @param temp Reference which hold the value to be set @return - \ref NVML_SUCCESS if \a temp has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a thresholdType is invalid or \a temp is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not have a temperature sensor or is unsupported - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceSetTemperatureThreshold( device: cuda_types::nvml::nvmlDevice_t, thresholdType: cuda_types::nvml::nvmlTemperatureThresholds_t, temp: *mut ::core::ffi::c_int, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Set new power limit of this device. For Kepler &tm; or newer fully supported devices. Requires root/admin permissions. See \ref nvmlDeviceGetPowerManagementLimitConstraints to check the allowed ranges of values. \note Limit is not persistent across reboots or driver unloads. Enable persistent mode to prevent driver from unloading when no application is using the device. @param device The identifier of the target device @param limit Power management limit in milliwatts to set @return - \ref NVML_SUCCESS if \a limit has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a defaultLimit is out of range - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlDeviceGetPowerManagementLimitConstraints @see nvmlDeviceGetPowerManagementDefaultLimit*/ fn nvmlDeviceSetPowerManagementLimit( device: cuda_types::nvml::nvmlDevice_t, limit: ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Sets new GOM. See \a nvmlGpuOperationMode_t for details. For GK110 M-class and X-class Tesla &tm; products from the Kepler family. Modes \ref NVML_GOM_LOW_DP and \ref NVML_GOM_ALL_ON are supported on fully supported GeForce products. Not supported on Quadro ® and Tesla &tm; C-class products. Requires root/admin permissions. Changing GOMs requires a reboot. The reboot requirement might be removed in the future. Compute only GOMs don't support graphics acceleration. Under windows switching to these GOMs when pending driver model is WDDM is not supported. See \ref nvmlDeviceSetDriverModel. @param device The identifier of the target device @param mode Target GOM @return - \ref NVML_SUCCESS if \a mode has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a mode incorrect - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support GOM or specific mode - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlGpuOperationMode_t @see nvmlDeviceGetGpuOperationMode*/ fn nvmlDeviceSetGpuOperationMode( device: cuda_types::nvml::nvmlDevice_t, mode: cuda_types::nvml::nvmlGpuOperationMode_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Changes the root/admin restructions on certain APIs. See \a nvmlRestrictedAPI_t for the list of supported APIs. This method can be used by a root/admin user to give non-root/admin access to certain otherwise-restricted APIs. The new setting lasts for the lifetime of the NVIDIA driver; it is not persistent. See \a nvmlDeviceGetAPIRestriction to query the current restriction settings. For Kepler &tm; or newer fully supported devices. Requires root/admin permissions. @param device The identifier of the target device @param apiType Target API type for this operation @param isRestricted The target restriction @return - \ref NVML_SUCCESS if \a isRestricted has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a apiType incorrect - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support changing API restrictions or the device does not support the feature that api restrictions are being set for (E.G. Enabling/disabling auto boosted clocks is not supported by the device) - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlRestrictedAPI_t*/ fn nvmlDeviceSetAPIRestriction( device: cuda_types::nvml::nvmlDevice_t, apiType: cuda_types::nvml::nvmlRestrictedAPI_t, isRestricted: cuda_types::nvml::nvmlEnableState_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Sets the speed of a specified fan. WARNING: This function changes the fan control policy to manual. It means that YOU have to monitor the temperature and adjust the fan speed accordingly. If you set the fan speed too low you can burn your GPU! Use nvmlDeviceSetDefaultFanSpeed_v2 to restore default control policy. For all cuda-capable discrete products with fans that are Maxwell or Newer. device The identifier of the target device fan The index of the fan, starting at zero speed The target speed of the fan [0-100] in % of max speed return NVML_SUCCESS if the fan speed has been set NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized NVML_ERROR_INVALID_ARGUMENT if the device is not valid, or the speed is outside acceptable ranges, or if the fan index doesn't reference an actual fan. NVML_ERROR_NOT_SUPPORTED if the device is older than Maxwell. NVML_ERROR_UNKNOWN if there was an unexpected error.*/ fn nvmlDeviceSetFanSpeed_v2( device: cuda_types::nvml::nvmlDevice_t, fan: ::core::ffi::c_uint, speed: ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** @deprecated Will be deprecated in a future release. Use \ref nvmlDeviceSetClockOffsets instead. It works on Maxwell onwards GPU architectures. Set the GPCCLK VF offset value @param[in] device The identifier of the target device @param[in] offset The GPCCLK VF offset value to set @return - \ref NVML_SUCCESS if \a offset has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a offset is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceSetGpcClkVfOffset( device: cuda_types::nvml::nvmlDevice_t, offset: ::core::ffi::c_int, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** @deprecated Will be deprecated in a future release. Use \ref nvmlDeviceSetClockOffsets instead. It works on Maxwell onwards GPU architectures. Set the MemClk (Memory Clock) VF offset value. It requires elevated privileges. @param[in] device The identifier of the target device @param[in] offset The MemClk VF offset value to set @return - \ref NVML_SUCCESS if \a offset has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a offset is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceSetMemClkVfOffset( device: cuda_types::nvml::nvmlDevice_t, offset: ::core::ffi::c_int, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Enables or disables per process accounting. For Kepler &tm; or newer fully supported devices. Requires root/admin permissions. @note This setting is not persistent and will default to disabled after driver unloads. Enable persistence mode to be sure the setting doesn't switch off to disabled. @note Enabling accounting mode has no negative impact on the GPU performance. @note Disabling accounting clears all accounting pids information. @note On MIG-enabled GPUs, accounting mode would be set to DISABLED and changing it is not supported. See \ref nvmlDeviceGetAccountingMode See \ref nvmlDeviceGetAccountingStats See \ref nvmlDeviceClearAccountingPids @param device The identifier of the target device @param mode The target accounting mode @return - \ref NVML_SUCCESS if the new mode has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device or \a mode are invalid - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceSetAccountingMode( device: cuda_types::nvml::nvmlDevice_t, mode: cuda_types::nvml::nvmlEnableState_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Clears accounting information about all processes that have already terminated. For Kepler &tm; or newer fully supported devices. Requires root/admin permissions. See \ref nvmlDeviceGetAccountingMode See \ref nvmlDeviceGetAccountingStats See \ref nvmlDeviceSetAccountingMode @param device The identifier of the target device @return - \ref NVML_SUCCESS if accounting information has been cleared - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device are invalid - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceClearAccountingPids( device: cuda_types::nvml::nvmlDevice_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the state of the device's NvLink for the link specified For Pascal &tm; or newer fully supported devices. @param device The identifier of the target device @param link Specifies the NvLink link to be queried @param isActive \a nvmlEnableState_t where NVML_FEATURE_ENABLED indicates that the link is active and NVML_FEATURE_DISABLED indicates it is inactive @return - \ref NVML_SUCCESS if \a isActive has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device or \a link is invalid or \a isActive is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetNvLinkState( device: cuda_types::nvml::nvmlDevice_t, link: ::core::ffi::c_uint, isActive: *mut cuda_types::nvml::nvmlEnableState_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the version of the device's NvLink for the link specified For Pascal &tm; or newer fully supported devices. @param device The identifier of the target device @param link Specifies the NvLink link to be queried @param version Requested NvLink version from nvmlNvlinkVersion_t @return - \ref NVML_SUCCESS if \a version has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device or \a link is invalid or \a version is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetNvLinkVersion( device: cuda_types::nvml::nvmlDevice_t, link: ::core::ffi::c_uint, version: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the requested capability from the device's NvLink for the link specified Please refer to the \a nvmlNvLinkCapability_t structure for the specific caps that can be queried The return value should be treated as a boolean. For Pascal &tm; or newer fully supported devices. @param device The identifier of the target device @param link Specifies the NvLink link to be queried @param capability Specifies the \a nvmlNvLinkCapability_t to be queried @param capResult A boolean for the queried capability indicating that feature is available @return - \ref NVML_SUCCESS if \a capResult has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a link, or \a capability is invalid or \a capResult is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetNvLinkCapability( device: cuda_types::nvml::nvmlDevice_t, link: ::core::ffi::c_uint, capability: cuda_types::nvml::nvmlNvLinkCapability_t, capResult: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the PCI information for the remote node on a NvLink link Note: pciSubSystemId is not filled in this function and is indeterminate For Pascal &tm; or newer fully supported devices. @param device The identifier of the target device @param link Specifies the NvLink link to be queried @param pci \a nvmlPciInfo_t of the remote node for the specified link @return - \ref NVML_SUCCESS if \a pci has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device or \a link is invalid or \a pci is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetNvLinkRemotePciInfo_v2( device: cuda_types::nvml::nvmlDevice_t, link: ::core::ffi::c_uint, pci: *mut cuda_types::nvml::nvmlPciInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the specified error counter value Please refer to \a nvmlNvLinkErrorCounter_t for error counters that are available For Pascal &tm; or newer fully supported devices. @param device The identifier of the target device @param link Specifies the NvLink link to be queried @param counter Specifies the NvLink counter to be queried @param counterValue Returned counter value @return - \ref NVML_SUCCESS if \a counter has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a link, or \a counter is invalid or \a counterValue is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetNvLinkErrorCounter( device: cuda_types::nvml::nvmlDevice_t, link: ::core::ffi::c_uint, counter: cuda_types::nvml::nvmlNvLinkErrorCounter_t, counterValue: *mut ::core::ffi::c_ulonglong, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Resets all error counters to zero Please refer to \a nvmlNvLinkErrorCounter_t for the list of error counters that are reset For Pascal &tm; or newer fully supported devices. @param device The identifier of the target device @param link Specifies the NvLink link to be queried @return - \ref NVML_SUCCESS if the reset is successful - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device or \a link is invalid - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceResetNvLinkErrorCounters( device: cuda_types::nvml::nvmlDevice_t, link: ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** @deprecated Setting utilization counter control is no longer supported. Set the NVLINK utilization counter control information for the specified counter, 0 or 1. Please refer to \a nvmlNvLinkUtilizationControl_t for the structure definition. Performs a reset of the counters if the reset parameter is non-zero. For Pascal &tm; or newer fully supported devices. @param device The identifier of the target device @param counter Specifies the counter that should be set (0 or 1). @param link Specifies the NvLink link to be queried @param control A reference to the \a nvmlNvLinkUtilizationControl_t to set @param reset Resets the counters on set if non-zero @return - \ref NVML_SUCCESS if the control has been set successfully - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a counter, \a link, or \a control is invalid - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceSetNvLinkUtilizationControl( device: cuda_types::nvml::nvmlDevice_t, link: ::core::ffi::c_uint, counter: ::core::ffi::c_uint, control: *mut cuda_types::nvml::nvmlNvLinkUtilizationControl_t, reset: ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** @deprecated Getting utilization counter control is no longer supported. Get the NVLINK utilization counter control information for the specified counter, 0 or 1. Please refer to \a nvmlNvLinkUtilizationControl_t for the structure definition For Pascal &tm; or newer fully supported devices. @param device The identifier of the target device @param counter Specifies the counter that should be set (0 or 1). @param link Specifies the NvLink link to be queried @param control A reference to the \a nvmlNvLinkUtilizationControl_t to place information @return - \ref NVML_SUCCESS if the control has been set successfully - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a counter, \a link, or \a control is invalid - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetNvLinkUtilizationControl( device: cuda_types::nvml::nvmlDevice_t, link: ::core::ffi::c_uint, counter: ::core::ffi::c_uint, control: *mut cuda_types::nvml::nvmlNvLinkUtilizationControl_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** @deprecated Use \ref nvmlDeviceGetFieldValues with NVML_FI_DEV_NVLINK_THROUGHPUT_* as field values instead. Retrieve the NVLINK utilization counter based on the current control for a specified counter. In general it is good practice to use \a nvmlDeviceSetNvLinkUtilizationControl before reading the utilization counters as they have no default state For Pascal &tm; or newer fully supported devices. @param device The identifier of the target device @param link Specifies the NvLink link to be queried @param counter Specifies the counter that should be read (0 or 1). @param rxcounter Receive counter return value @param txcounter Transmit counter return value @return - \ref NVML_SUCCESS if \a rxcounter and \a txcounter have been successfully set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a counter, or \a link is invalid or \a rxcounter or \a txcounter are NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetNvLinkUtilizationCounter( device: cuda_types::nvml::nvmlDevice_t, link: ::core::ffi::c_uint, counter: ::core::ffi::c_uint, rxcounter: *mut ::core::ffi::c_ulonglong, txcounter: *mut ::core::ffi::c_ulonglong, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** @deprecated Freezing NVLINK utilization counters is no longer supported. Freeze the NVLINK utilization counters Both the receive and transmit counters are operated on by this function For Pascal &tm; or newer fully supported devices. @param device The identifier of the target device @param link Specifies the NvLink link to be queried @param counter Specifies the counter that should be frozen (0 or 1). @param freeze NVML_FEATURE_ENABLED = freeze the receive and transmit counters NVML_FEATURE_DISABLED = unfreeze the receive and transmit counters @return - \ref NVML_SUCCESS if counters were successfully frozen or unfrozen - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a link, \a counter, or \a freeze is invalid - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceFreezeNvLinkUtilizationCounter( device: cuda_types::nvml::nvmlDevice_t, link: ::core::ffi::c_uint, counter: ::core::ffi::c_uint, freeze: cuda_types::nvml::nvmlEnableState_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** @deprecated Resetting NVLINK utilization counters is no longer supported. Reset the NVLINK utilization counters Both the receive and transmit counters are operated on by this function For Pascal &tm; or newer fully supported devices. @param device The identifier of the target device @param link Specifies the NvLink link to be reset @param counter Specifies the counter that should be reset (0 or 1) @return - \ref NVML_SUCCESS if counters were successfully reset - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a link, or \a counter is invalid - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceResetNvLinkUtilizationCounter( device: cuda_types::nvml::nvmlDevice_t, link: ::core::ffi::c_uint, counter: ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get the NVLink device type of the remote device connected over the given link. @param device The device handle of the target GPU @param link The NVLink link index on the target GPU @param pNvLinkDeviceType Pointer in which the output remote device type is returned @return - \ref NVML_SUCCESS if \a pNvLinkDeviceType has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_NOT_SUPPORTED if NVLink is not supported - \ref NVML_ERROR_INVALID_ARGUMENT if \a device or \a link is invalid, or \a pNvLinkDeviceType is NULL - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetNvLinkRemoteDeviceType( device: cuda_types::nvml::nvmlDevice_t, link: ::core::ffi::c_uint, pNvLinkDeviceType: *mut cuda_types::nvml::nvmlIntNvLinkDeviceType_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Set NvLink Low Power Threshold for device. For Hopper &tm; or newer fully supported devices. @param device The identifier of the target device @param info Reference to \a nvmlNvLinkPowerThres_t struct input parameters @return - \ref NVML_SUCCESS if the \a Threshold is successfully set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a Threshold is not within range - \ref NVML_ERROR_NOT_READY if an internal driver setting prevents the threshold from being used - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device */ fn nvmlDeviceSetNvLinkDeviceLowPowerThreshold( device: cuda_types::nvml::nvmlDevice_t, info: *mut cuda_types::nvml::nvmlNvLinkPowerThres_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Set the global nvlink bandwith mode @param nvlinkBwMode nvlink bandwidth mode @return - \ref NVML_SUCCESS on success - \ref NVML_ERROR_INVALID_ARGUMENT if an invalid argument is provided - \ref NVML_ERROR_IN_USE if P2P object exists - \ref NVML_ERROR_NOT_SUPPORTED if GPU is not Hopper or newer architecture. - \ref NVML_ERROR_NO_PERMISSION if not root user*/ fn nvmlSystemSetNvlinkBwMode( nvlinkBwMode: ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get the global nvlink bandwith mode @param nvlinkBwMode reference of nvlink bandwidth mode @return - \ref NVML_SUCCESS on success - \ref NVML_ERROR_INVALID_ARGUMENT if an invalid pointer is provided - \ref NVML_ERROR_NOT_SUPPORTED if GPU is not Hopper or newer architecture. - \ref NVML_ERROR_NO_PERMISSION if not root user*/ fn nvmlSystemGetNvlinkBwMode( nvlinkBwMode: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get the supported NvLink Reduced Bandwidth Modes of the device For Blackwell &tm; or newer fully supported devices. @param device The identifier of the target device @param supportedBwMode Reference to \a nvmlNvlinkSupportedBwModes_t @return - \ref NVML_SUCCESS if the query was successful - \ref NVML_ERROR_INVALID_ARGUMENT if device is invalid or supportedBwMode is NULL - \ref NVML_ERROR_NOT_SUPPORTED if this feature is not supported by the device - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH if the version specified is not supported*/ fn nvmlDeviceGetNvlinkSupportedBwModes( device: cuda_types::nvml::nvmlDevice_t, supportedBwMode: *mut cuda_types::nvml::nvmlNvlinkSupportedBwModes_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get the NvLink Reduced Bandwidth Mode for the device For Blackwell &tm; or newer fully supported devices. @param device The identifier of the target device @param getBwMode Reference to \a nvmlNvlinkGetBwMode_t @return - \ref NVML_SUCCESS if the query was successful - \ref NVML_ERROR_INVALID_ARGUMENT if device is invalid or getBwMode is NULL - \ref NVML_ERROR_NOT_SUPPORTED if this feature is not supported by the device - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH if the version specified is not supported*/ fn nvmlDeviceGetNvlinkBwMode( device: cuda_types::nvml::nvmlDevice_t, getBwMode: *mut cuda_types::nvml::nvmlNvlinkGetBwMode_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Set the NvLink Reduced Bandwidth Mode for the device For Blackwell &tm; or newer fully supported devices. @param device The identifier of the target device @param setBwMode Reference to \a nvmlNvlinkSetBwMode_t @return - \ref NVML_SUCCESS if the Bandwidth mode was successfully set - \ref NVML_ERROR_INVALID_ARGUMENT if device is invalid or setBwMode is NULL - \ref NVML_ERROR_NO_PERMISSION if user does not have permission to change Bandwidth mode - \ref NVML_ERROR_NOT_SUPPORTED if this feature is not supported by the device - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH if the version specified is not supported*/ fn nvmlDeviceSetNvlinkBwMode( device: cuda_types::nvml::nvmlDevice_t, setBwMode: *mut cuda_types::nvml::nvmlNvlinkSetBwMode_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Query NVLINK information associated with this device. @param[in] device The identifier of the target device @param[out] info Reference to \a nvmlNvLinkInfo_t @return - \ref NVML_SUCCESS if query is success - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a info is NULL - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH if the version is invalid/unsupported - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetNvLinkInfo( device: cuda_types::nvml::nvmlDevice_t, info: *mut cuda_types::nvml::nvmlNvLinkInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Create an empty set of events. Event set should be freed by \ref nvmlEventSetFree For Fermi &tm; or newer fully supported devices. @param set Reference in which to return the event handle @return - \ref NVML_SUCCESS if the event has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a set is NULL - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlEventSetFree*/ fn nvmlEventSetCreate( set: *mut cuda_types::nvml::nvmlEventSet_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Starts recording of events on a specified devices and add the events to specified \ref nvmlEventSet_t For Fermi &tm; or newer fully supported devices. ECC events are available only on ECC-enabled devices (see \ref nvmlDeviceGetTotalEccErrors) Power capping events are available only on Power Management enabled devices (see \ref nvmlDeviceGetPowerManagementMode) For Linux only. This call starts recording of events on specific device. All events that occurred before this call are not recorded. Checking if some event occurred can be done with \ref nvmlEventSetWait_v2 If function reports NVML_ERROR_UNKNOWN, event set is in undefined state and should be freed. If function reports NVML_ERROR_NOT_SUPPORTED, event set can still be used. None of the requested eventTypes are registered in that case. @param device The identifier of the target device @param eventTypes Bitmask of \ref nvmlEventType to record @param set Set to which add new event types @return - \ref NVML_SUCCESS if the event has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a eventTypes is invalid or \a set is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the platform does not support this feature or some of requested event types - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlEventType @see nvmlDeviceGetSupportedEventTypes @see nvmlEventSetWait @see nvmlEventSetFree*/ fn nvmlDeviceRegisterEvents( device: cuda_types::nvml::nvmlDevice_t, eventTypes: ::core::ffi::c_ulonglong, set: cuda_types::nvml::nvmlEventSet_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Returns information about events supported on device For Fermi &tm; or newer fully supported devices. Events are not supported on Windows. So this function returns an empty mask in \a eventTypes on Windows. @param device The identifier of the target device @param eventTypes Reference in which to return bitmask of supported events @return - \ref NVML_SUCCESS if the eventTypes has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a eventType is NULL - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlEventType @see nvmlDeviceRegisterEvents*/ fn nvmlDeviceGetSupportedEventTypes( device: cuda_types::nvml::nvmlDevice_t, eventTypes: *mut ::core::ffi::c_ulonglong, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Waits on events and delivers events For Fermi &tm; or newer fully supported devices. If some events are ready to be delivered at the time of the call, function returns immediately. If there are no events ready to be delivered, function sleeps till event arrives but not longer than specified timeout. This function in certain conditions can return before specified timeout passes (e.g. when interrupt arrives) On Windows, in case of Xid error, the function returns the most recent Xid error type seen by the system. If there are multiple Xid errors generated before nvmlEventSetWait is invoked then the last seen Xid error type is returned for all Xid error events. On Linux, every Xid error event would return the associated event data and other information if applicable. In MIG mode, if device handle is provided, the API reports all the events for the available instances, only if the caller has appropriate privileges. In absence of required privileges, only the events which affect all the instances (i.e. whole device) are reported. This API does not currently support per-instance event reporting using MIG device handles. @param set Reference to set of events to wait on @param data Reference in which to return event data @param timeoutms Maximum amount of wait time in milliseconds for registered event @return - \ref NVML_SUCCESS if the data has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a data is NULL - \ref NVML_ERROR_TIMEOUT if no event arrived in specified timeout or interrupt arrived - \ref NVML_ERROR_GPU_IS_LOST if a GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlEventType @see nvmlDeviceRegisterEvents*/ fn nvmlEventSetWait_v2( set: cuda_types::nvml::nvmlEventSet_t, data: *mut cuda_types::nvml::nvmlEventData_t, timeoutms: ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Releases events in the set For Fermi &tm; or newer fully supported devices. @param set Reference to events to be released @return - \ref NVML_SUCCESS if the event has been successfully released - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlDeviceRegisterEvents*/ fn nvmlEventSetFree( set: cuda_types::nvml::nvmlEventSet_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Create an empty set of system events. Event set should be freed by \ref nvmlSystemEventSetFree For Fermi &tm; or newer fully supported devices. @param request Reference to nvmlSystemEventSetCreateRequest_t @return - \ref NVML_SUCCESS if the event has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if request is NULL - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH for unsupported version - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlSystemEventSetFree*/ fn nvmlSystemEventSetCreate( request: *mut cuda_types::nvml::nvmlSystemEventSetCreateRequest_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Releases system event set For Fermi &tm; or newer fully supported devices. @param request Reference to nvmlSystemEventSetFreeRequest_t @return - \ref NVML_SUCCESS if the event has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if request is NULL - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH for unsupported version - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlDeviceRegisterEvents*/ fn nvmlSystemEventSetFree( request: *mut cuda_types::nvml::nvmlSystemEventSetFreeRequest_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Starts recording of events on system and add the events to specified \ref nvmlSystemEventSet_t For Linux only. This call starts recording of events on specific device. All events that occurred before this call are not recorded. Checking if some event occurred can be done with \ref nvmlSystemEventSetWait If function reports NVML_ERROR_UNKNOWN, event set is in undefined state and should be freed. If function reports NVML_ERROR_NOT_SUPPORTED, event set can still be used. None of the requested eventTypes are registered in that case. @param request Reference to the struct nvmlSystemRegisterEventRequest_t @return - \ref NVML_SUCCESS if the event has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if request is NULL - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH for unsupported version - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlSystemEventType @see nvmlSystemEventSetWait @see nvmlEventSetFree*/ fn nvmlSystemRegisterEvents( request: *mut cuda_types::nvml::nvmlSystemRegisterEventRequest_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Waits on system events and delivers events For Fermi &tm; or newer fully supported devices. If some events are ready to be delivered at the time of the call, function returns immediately. If there are no events ready to be delivered, function sleeps till event arrives but not longer than specified timeout. This function in certain conditions can return before specified timeout passes (e.g. when interrupt arrives) if the return request->numEvent equals to request->dataSize, there might be outstanding event, it is recommended to call nvmlSystemEventSetWait again to query all the events. @param request Reference in which to nvmlSystemEventSetWaitRequest_t @return - \ref NVML_SUCCESS if the event has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if request is NULL - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH for unsupported version - \ref NVML_ERROR_TIMEOUT if no event notification after timeoutms - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlSystemEventType @see nvmlSystemRegisterEvents*/ fn nvmlSystemEventSetWait( request: *mut cuda_types::nvml::nvmlSystemEventSetWaitRequest_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Modify the drain state of a GPU. This method forces a GPU to no longer accept new incoming requests. Any new NVML process will no longer see this GPU. Persistence mode for this GPU must be turned off before this call is made. Must be called as administrator. For Linux only. For Pascal &tm; or newer fully supported devices. Some Kepler devices supported. @param pciInfo The PCI address of the GPU drain state to be modified @param newState The drain state that should be entered, see \ref nvmlEnableState_t @return - \ref NVML_SUCCESS if counters were successfully reset - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a nvmlIndex or \a newState is invalid - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - \ref NVML_ERROR_NO_PERMISSION if the calling process has insufficient permissions to perform operation - \ref NVML_ERROR_IN_USE if the device has persistence mode turned on - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceModifyDrainState( pciInfo: *mut cuda_types::nvml::nvmlPciInfo_t, newState: cuda_types::nvml::nvmlEnableState_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Query the drain state of a GPU. This method is used to check if a GPU is in a currently draining state. For Linux only. For Pascal &tm; or newer fully supported devices. Some Kepler devices supported. @param pciInfo The PCI address of the GPU drain state to be queried @param currentState The current drain state for this GPU, see \ref nvmlEnableState_t @return - \ref NVML_SUCCESS if counters were successfully reset - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a nvmlIndex or \a currentState is invalid - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceQueryDrainState( pciInfo: *mut cuda_types::nvml::nvmlPciInfo_t, currentState: *mut cuda_types::nvml::nvmlEnableState_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** This method will remove the specified GPU from the view of both NVML and the NVIDIA kernel driver as long as no other processes are attached. If other processes are attached, this call will return NVML_ERROR_IN_USE and the GPU will be returned to its original "draining" state. Note: the only situation where a process can still be attached after nvmlDeviceModifyDrainState() is called to initiate the draining state is if that process was using, and is still using, a GPU before the call was made. Also note, persistence mode counts as an attachment to the GPU thus it must be disabled prior to this call. For long-running NVML processes please note that this will change the enumeration of current GPUs. For example, if there are four GPUs present and GPU1 is removed, the new enumeration will be 0-2. Also, device handles after the removed GPU will not be valid and must be re-established. Must be run as administrator. For Linux only. For Pascal &tm; or newer fully supported devices. Some Kepler devices supported. @param pciInfo The PCI address of the GPU to be removed @param gpuState Whether the GPU is to be removed, from the OS see \ref nvmlDetachGpuState_t @param linkState Requested upstream PCIe link state, see \ref nvmlPcieLinkState_t @return - \ref NVML_SUCCESS if counters were successfully reset - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a nvmlIndex is invalid - \ref NVML_ERROR_NOT_SUPPORTED if the device doesn't support this feature - \ref NVML_ERROR_IN_USE if the device is still in use and cannot be removed*/ fn nvmlDeviceRemoveGpu_v2( pciInfo: *mut cuda_types::nvml::nvmlPciInfo_t, gpuState: cuda_types::nvml::nvmlDetachGpuState_t, linkState: cuda_types::nvml::nvmlPcieLinkState_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Request the OS and the NVIDIA kernel driver to rediscover a portion of the PCI subsystem looking for GPUs that were previously removed. The portion of the PCI tree can be narrowed by specifying a domain, bus, and device. If all are zeroes then the entire PCI tree will be searched. Please note that for long-running NVML processes the enumeration will change based on how many GPUs are discovered and where they are inserted in bus order. In addition, all newly discovered GPUs will be initialized and their ECC scrubbed which may take several seconds per GPU. Also, all device handles are no longer guaranteed to be valid post discovery. Must be run as administrator. For Linux only. For Pascal &tm; or newer fully supported devices. Some Kepler devices supported. @param pciInfo The PCI tree to be searched. Only the domain, bus, and device fields are used in this call. @return - \ref NVML_SUCCESS if counters were successfully reset - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a pciInfo is invalid - \ref NVML_ERROR_NOT_SUPPORTED if the operating system does not support this feature - \ref NVML_ERROR_OPERATING_SYSTEM if the operating system is denying this feature - \ref NVML_ERROR_NO_PERMISSION if the calling process has insufficient permissions to perform operation - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceDiscoverGpus( pciInfo: *mut cuda_types::nvml::nvmlPciInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Request values for a list of fields for a device. This API allows multiple fields to be queried at once. If any of the underlying fieldIds are populated by the same driver call, the results for those field IDs will be populated from a single call rather than making a driver call for each fieldId. @param device The device handle of the GPU to request field values for @param valuesCount Number of entries in values that should be retrieved @param values Array of \a valuesCount structures to hold field values. Each value's fieldId must be populated prior to this call @return - \ref NVML_SUCCESS if any values in \a values were populated. Note that you must check the nvmlReturn field of each value for each individual status - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a values is NULL*/ fn nvmlDeviceGetFieldValues( device: cuda_types::nvml::nvmlDevice_t, valuesCount: ::core::ffi::c_int, values: *mut cuda_types::nvml::nvmlFieldValue_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Clear values for a list of fields for a device. This API allows multiple fields to be cleared at once. @param device The device handle of the GPU to request field values for @param valuesCount Number of entries in values that should be cleared @param values Array of \a valuesCount structures to hold field values. Each value's fieldId must be populated prior to this call @return - \ref NVML_SUCCESS if any values in \a values were cleared. Note that you must check the nvmlReturn field of each value for each individual status - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a values is NULL*/ fn nvmlDeviceClearFieldValues( device: cuda_types::nvml::nvmlDevice_t, valuesCount: ::core::ffi::c_int, values: *mut cuda_types::nvml::nvmlFieldValue_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** This method is used to get the virtualization mode corresponding to the GPU. For Kepler &tm; or newer fully supported devices. @param device Identifier of the target device @param pVirtualMode Reference to virtualization mode. One of NVML_GPU_VIRTUALIZATION_? @return - \ref NVML_SUCCESS if \a pVirtualMode is fetched - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a pVirtualMode is NULL - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetVirtualizationMode( device: cuda_types::nvml::nvmlDevice_t, pVirtualMode: *mut cuda_types::nvml::nvmlGpuVirtualizationMode_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Queries if SR-IOV host operation is supported on a vGPU supported device. Checks whether SR-IOV host capability is supported by the device and the driver, and indicates device is in SR-IOV mode if both of these conditions are true. @param device The identifier of the target device @param pHostVgpuMode Reference in which to return the current vGPU mode @return - \ref NVML_SUCCESS if device's vGPU mode has been successfully retrieved - \ref NVML_ERROR_INVALID_ARGUMENT if \a device handle is 0 or \a pVgpuMode is NULL - \ref NVML_ERROR_NOT_SUPPORTED if \a device doesn't support this feature. - \ref NVML_ERROR_UNKNOWN if any unexpected error occurred*/ fn nvmlDeviceGetHostVgpuMode( device: cuda_types::nvml::nvmlDevice_t, pHostVgpuMode: *mut cuda_types::nvml::nvmlHostVgpuMode_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** This method is used to set the virtualization mode corresponding to the GPU. For Kepler &tm; or newer fully supported devices. @param device Identifier of the target device @param virtualMode virtualization mode. One of NVML_GPU_VIRTUALIZATION_? @return - \ref NVML_SUCCESS if \a virtualMode is set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a virtualMode is NULL - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_NOT_SUPPORTED if setting of virtualization mode is not supported. - \ref NVML_ERROR_NO_PERMISSION if setting of virtualization mode is not allowed for this client.*/ fn nvmlDeviceSetVirtualizationMode( device: cuda_types::nvml::nvmlDevice_t, virtualMode: cuda_types::nvml::nvmlGpuVirtualizationMode_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get the vGPU heterogeneous mode for the device. When in heterogeneous mode, a vGPU can concurrently host timesliced vGPUs with differing framebuffer sizes. On successful return, the function returns \a pHeterogeneousMode->mode with the current vGPU heterogeneous mode. \a pHeterogeneousMode->version is the version number of the structure nvmlVgpuHeterogeneousMode_t, the caller should set the correct version number to retrieve the vGPU heterogeneous mode. \a pHeterogeneousMode->mode can either be \ref NVML_FEATURE_ENABLED or \ref NVML_FEATURE_DISABLED. @param device The identifier of the target device @param pHeterogeneousMode Pointer to the caller-provided structure of nvmlVgpuHeterogeneousMode_t @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a device is invalid or \a pHeterogeneousMode is NULL - \ref NVML_ERROR_NOT_SUPPORTED If MIG is enabled or \a device doesn't support this feature - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH If the version of \a pHeterogeneousMode is invalid - \ref NVML_ERROR_UNKNOWN On any unexpected error*/ fn nvmlDeviceGetVgpuHeterogeneousMode( device: cuda_types::nvml::nvmlDevice_t, pHeterogeneousMode: *mut cuda_types::nvml::nvmlVgpuHeterogeneousMode_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Enable or disable vGPU heterogeneous mode for the device. When in heterogeneous mode, a vGPU can concurrently host timesliced vGPUs with differing framebuffer sizes. API would return an appropriate error code upon unsuccessful activation. For example, the heterogeneous mode set will fail with error \ref NVML_ERROR_IN_USE if any vGPU instance is active on the device. The caller of this API is expected to shutdown the vGPU VMs and retry setting the \a mode. On KVM platform, setting heterogeneous mode is allowed, if no MDEV device is created on the device, else will fail with same error \ref NVML_ERROR_IN_USE. On successful return, the function updates the vGPU heterogeneous mode with the user provided \a pHeterogeneousMode->mode. \a pHeterogeneousMode->version is the version number of the structure nvmlVgpuHeterogeneousMode_t, the caller should set the correct version number to set the vGPU heterogeneous mode. @param device Identifier of the target device @param pHeterogeneousMode Pointer to the caller-provided structure of nvmlVgpuHeterogeneousMode_t @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a device or \a pHeterogeneousMode is NULL or \a pHeterogeneousMode->mode is invalid - \ref NVML_ERROR_IN_USE If the \a device is in use - \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation - \ref NVML_ERROR_NOT_SUPPORTED If MIG is enabled or \a device doesn't support this feature - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH If the version of \a pHeterogeneousMode is invalid - \ref NVML_ERROR_UNKNOWN On any unexpected error*/ fn nvmlDeviceSetVgpuHeterogeneousMode( device: cuda_types::nvml::nvmlDevice_t, pHeterogeneousMode: *const cuda_types::nvml::nvmlVgpuHeterogeneousMode_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Query the placement ID of active vGPU instance. When in vGPU heterogeneous mode, this function returns a valid placement ID as \a pPlacement->placementId else NVML_INVALID_VGPU_PLACEMENT_ID is returned. \a pPlacement->version is the version number of the structure nvmlVgpuPlacementId_t, the caller should set the correct version number to get placement id of the vGPU instance \a vgpuInstance. @param vgpuInstance Identifier of the target vGPU instance @param pPlacement Pointer to vGPU placement ID structure \a nvmlVgpuPlacementId_t @return - \ref NVML_SUCCESS If information is successfully retrieved - \ref NVML_ERROR_NOT_FOUND If \a vgpuInstance does not match a valid active vGPU instance - \ref NVML_ERROR_INVALID_ARGUMENT If \a vgpuInstance is invalid or \a pPlacement is NULL - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH If the version of \a pPlacement is invalid - \ref NVML_ERROR_UNKNOWN On any unexpected error*/ fn nvmlVgpuInstanceGetPlacementId( vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t, pPlacement: *mut cuda_types::nvml::nvmlVgpuPlacementId_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Query the supported vGPU placement ID of the vGPU type. The function returns an array of supported vGPU placement IDs for the specified vGPU type ID in the buffer provided by the caller at \a pPlacementList->placementIds. The required memory for the placementIds array must be allocated based on the maximum number of vGPU type instances, which is retrievable through \ref nvmlVgpuTypeGetMaxInstances(). If the provided count by the caller is insufficient, the function will return NVML_ERROR_INSUFFICIENT_SIZE along with the number of required entries in \a pPlacementList->count. The caller should then reallocate a buffer with the size of pPlacementList->count * sizeof(pPlacementList->placementIds) and invoke the function again. To obtain a list of homogeneous placement IDs, the caller needs to set \a pPlacementList->mode to NVML_VGPU_PGPU_HOMOGENEOUS_MODE. For heterogeneous placement IDs, \a pPlacementList->mode should be set to NVML_VGPU_PGPU_HETEROGENEOUS_MODE. By default, a list of heterogeneous placement IDs is returned. @param device Identifier of the target device @param vgpuTypeId Handle to vGPU type. The vGPU type ID @param pPlacementList Pointer to the vGPU placement structure \a nvmlVgpuPlacementList_t @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a device or \a vgpuTypeId is invalid or \a pPlacementList is NULL - \ref NVML_ERROR_NOT_SUPPORTED If \a device or \a vgpuTypeId isn't supported - \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH If the version of \a pPlacementList is invalid - \ref NVML_ERROR_INSUFFICIENT_SIZE If the buffer is small, element count is returned in \a pPlacementList->count - \ref NVML_ERROR_UNKNOWN On any unexpected error*/ fn nvmlDeviceGetVgpuTypeSupportedPlacements( device: cuda_types::nvml::nvmlDevice_t, vgpuTypeId: cuda_types::nvml::nvmlVgpuTypeId_t, pPlacementList: *mut cuda_types::nvml::nvmlVgpuPlacementList_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Query the creatable vGPU placement ID of the vGPU type. An array of creatable vGPU placement IDs for the vGPU type ID indicated by \a vgpuTypeId is returned in the caller-supplied buffer of \a pPlacementList->placementIds. Memory needed for the placementIds array should be allocated based on maximum instances of a vGPU type which can be queried via \ref nvmlVgpuTypeGetMaxInstances(). If the provided count by the caller is insufficient, the function will return NVML_ERROR_INSUFFICIENT_SIZE along with the number of required entries in \a pPlacementList->count. The caller should then reallocate a buffer with the size of pPlacementList->count * sizeof(pPlacementList->placementIds) and invoke the function again. The creatable vGPU placement IDs may differ over time, as there may be restrictions on what type of vGPU the vGPU instance is running. @param device The identifier of the target device @param vgpuTypeId Handle to vGPU type. The vGPU type ID @param pPlacementList Pointer to the list of vGPU placement structure \a nvmlVgpuPlacementList_t @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a device or \a vgpuTypeId is invalid or \a pPlacementList is NULL - \ref NVML_ERROR_NOT_SUPPORTED If MIG is enabled or \a device or \a vgpuTypeId isn't supported - \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH If the version of \a pPlacementList is invalid - \ref NVML_ERROR_UNKNOWN On any unexpected error*/ fn nvmlDeviceGetVgpuTypeCreatablePlacements( device: cuda_types::nvml::nvmlDevice_t, vgpuTypeId: cuda_types::nvml::nvmlVgpuTypeId_t, pPlacementList: *mut cuda_types::nvml::nvmlVgpuPlacementList_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the static GSP heap size of the vGPU type in bytes @param vgpuTypeId Handle to vGPU type @param gspHeapSize Reference to return the GSP heap size value @return - \ref NVML_SUCCESS Successful completion - \ref NVML_ERROR_UNINITIALIZED If the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a vgpuTypeId is invalid, or \a gspHeapSize is NULL - \ref NVML_ERROR_UNKNOWN On any unexpected error*/ fn nvmlVgpuTypeGetGspHeapSize( vgpuTypeId: cuda_types::nvml::nvmlVgpuTypeId_t, gspHeapSize: *mut ::core::ffi::c_ulonglong, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the static framebuffer reservation of the vGPU type in bytes @param vgpuTypeId Handle to vGPU type @param fbReservation Reference to return the framebuffer reservation @return - \ref NVML_SUCCESS Successful completion - \ref NVML_ERROR_UNINITIALIZED If the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a vgpuTypeId is invalid, or \a fbReservation is NULL - \ref NVML_ERROR_UNKNOWN On any unexpected error*/ fn nvmlVgpuTypeGetFbReservation( vgpuTypeId: cuda_types::nvml::nvmlVgpuTypeId_t, fbReservation: *mut ::core::ffi::c_ulonglong, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the currently used runtime state size of the vGPU instance This size represents the maximum in-memory data size utilized by a vGPU instance during standard operation. This measurement is exclusive of frame buffer (FB) data size assigned to the vGPU instance. For Maxwell &tm; or newer fully supported devices. @param vgpuInstance Identifier of the target vGPU instance @param pState Pointer to the vGPU runtime state's structure \a nvmlVgpuRuntimeState_t @return - \ref NVML_SUCCESS If information is successfully retrieved - \ref NVML_ERROR_UNINITIALIZED If the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a vgpuInstance is invalid, or \a pState is NULL - \ref NVML_ERROR_NOT_FOUND If \a vgpuInstance does not match a valid active vGPU instance on the system - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH If the version of \a pState is invalid - \ref NVML_ERROR_UNKNOWN On any unexpected error*/ fn nvmlVgpuInstanceGetRuntimeStateSize( vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t, pState: *mut cuda_types::nvml::nvmlVgpuRuntimeState_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Set the desirable vGPU capability of a device Refer to the \a nvmlDeviceVgpuCapability_t structure for the specific capabilities that can be set. See \ref nvmlEnableState_t for available state. @param device The identifier of the target device @param capability Specifies the \a nvmlDeviceVgpuCapability_t to be set @param state The target capability mode @return - \ref NVML_SUCCESS Successful completion - \ref NVML_ERROR_UNINITIALIZED If the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a device is invalid, or \a capability is invalid, or \a state is invalid - \ref NVML_ERROR_NOT_SUPPORTED The API is not supported in current state, or \a device not in vGPU mode - \ref NVML_ERROR_UNKNOWN On any unexpected error*/ fn nvmlDeviceSetVgpuCapabilities( device: cuda_types::nvml::nvmlDevice_t, capability: cuda_types::nvml::nvmlDeviceVgpuCapability_t, state: cuda_types::nvml::nvmlEnableState_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the vGPU Software licensable features. Identifies whether the system supports vGPU Software Licensing. If it does, return the list of licensable feature(s) and their current license status. @param device Identifier of the target device @param pGridLicensableFeatures Pointer to structure in which vGPU software licensable features are returned @return - \ref NVML_SUCCESS if licensable features are successfully retrieved - \ref NVML_ERROR_INVALID_ARGUMENT if \a pGridLicensableFeatures is NULL - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetGridLicensableFeatures_v4( device: cuda_types::nvml::nvmlDevice_t, pGridLicensableFeatures: *mut cuda_types::nvml::nvmlGridLicensableFeatures_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the requested vGPU driver capability. Refer to the \a nvmlVgpuDriverCapability_t structure for the specific capabilities that can be queried. The return value in \a capResult should be treated as a boolean, with a non-zero value indicating that the capability is supported. For Maxwell &tm; or newer fully supported devices. @param capability Specifies the \a nvmlVgpuDriverCapability_t to be queried @param capResult A boolean for the queried capability indicating that feature is supported @return - \ref NVML_SUCCESS successful completion - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a capability is invalid, or \a capResult is NULL - \ref NVML_ERROR_NOT_SUPPORTED the API is not supported in current state or \a devices not in vGPU mode - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlGetVgpuDriverCapabilities( capability: cuda_types::nvml::nvmlVgpuDriverCapability_t, capResult: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the requested vGPU capability for GPU. Refer to the \a nvmlDeviceVgpuCapability_t structure for the specific capabilities that can be queried. The return value in \a capResult reports a non-zero value indicating that the capability is supported, and also reports the capability's data based on the queried capability. For Maxwell &tm; or newer fully supported devices. @param device The identifier of the target device @param capability Specifies the \a nvmlDeviceVgpuCapability_t to be queried @param capResult Specifies that the queried capability is supported, and also returns capability's data @return - \ref NVML_SUCCESS successful completion - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a capability is invalid, or \a capResult is NULL - \ref NVML_ERROR_NOT_SUPPORTED the API is not supported in current state or \a device not in vGPU mode - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetVgpuCapabilities( device: cuda_types::nvml::nvmlDevice_t, capability: cuda_types::nvml::nvmlDeviceVgpuCapability_t, capResult: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the supported vGPU types on a physical GPU (device). An array of supported vGPU types for the physical GPU indicated by \a device is returned in the caller-supplied buffer pointed at by \a vgpuTypeIds. The element count of nvmlVgpuTypeId_t array is passed in \a vgpuCount, and \a vgpuCount is used to return the number of vGPU types written to the buffer. If the supplied buffer is not large enough to accommodate the vGPU type array, the function returns NVML_ERROR_INSUFFICIENT_SIZE, with the element count of nvmlVgpuTypeId_t array required in \a vgpuCount. To query the number of vGPU types supported for the GPU, call this function with *vgpuCount = 0. The code will return NVML_ERROR_INSUFFICIENT_SIZE, or NVML_SUCCESS if no vGPU types are supported. @param device The identifier of the target device @param vgpuCount Pointer to caller-supplied array size, and returns number of vGPU types @param vgpuTypeIds Pointer to caller-supplied array in which to return list of vGPU types @return - \ref NVML_SUCCESS successful completion - \ref NVML_ERROR_INSUFFICIENT_SIZE \a vgpuTypeIds buffer is too small, array element count is returned in \a vgpuCount - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuCount is NULL or \a device is invalid - \ref NVML_ERROR_NOT_SUPPORTED if vGPU is not supported by the device - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetSupportedVgpus( device: cuda_types::nvml::nvmlDevice_t, vgpuCount: *mut ::core::ffi::c_uint, vgpuTypeIds: *mut cuda_types::nvml::nvmlVgpuTypeId_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the currently creatable vGPU types on a physical GPU (device). An array of creatable vGPU types for the physical GPU indicated by \a device is returned in the caller-supplied buffer pointed at by \a vgpuTypeIds. The element count of nvmlVgpuTypeId_t array is passed in \a vgpuCount, and \a vgpuCount is used to return the number of vGPU types written to the buffer. The creatable vGPU types for a device may differ over time, as there may be restrictions on what type of vGPU types can concurrently run on a device. For example, if only one vGPU type is allowed at a time on a device, then the creatable list will be restricted to whatever vGPU type is already running on the device. If the supplied buffer is not large enough to accommodate the vGPU type array, the function returns NVML_ERROR_INSUFFICIENT_SIZE, with the element count of nvmlVgpuTypeId_t array required in \a vgpuCount. To query the number of vGPU types that can be created for the GPU, call this function with *vgpuCount = 0. The code will return NVML_ERROR_INSUFFICIENT_SIZE, or NVML_SUCCESS if no vGPU types are creatable. @param device The identifier of the target device @param vgpuCount Pointer to caller-supplied array size, and returns number of vGPU types @param vgpuTypeIds Pointer to caller-supplied array in which to return list of vGPU types @return - \ref NVML_SUCCESS successful completion - \ref NVML_ERROR_INSUFFICIENT_SIZE \a vgpuTypeIds buffer is too small, array element count is returned in \a vgpuCount - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuCount is NULL - \ref NVML_ERROR_NOT_SUPPORTED if vGPU is not supported by the device - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetCreatableVgpus( device: cuda_types::nvml::nvmlDevice_t, vgpuCount: *mut ::core::ffi::c_uint, vgpuTypeIds: *mut cuda_types::nvml::nvmlVgpuTypeId_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the class of a vGPU type. It will not exceed 64 characters in length (including the NUL terminator). See \ref nvmlConstants::NVML_DEVICE_NAME_BUFFER_SIZE. For Kepler &tm; or newer fully supported devices. @param vgpuTypeId Handle to vGPU type @param vgpuTypeClass Pointer to string array to return class in @param size Size of string @return - \ref NVML_SUCCESS successful completion - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuTypeId is invalid, or \a vgpuTypeClass is NULL - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a size is too small - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlVgpuTypeGetClass( vgpuTypeId: cuda_types::nvml::nvmlVgpuTypeId_t, vgpuTypeClass: *mut ::core::ffi::c_char, size: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the vGPU type name. The name is an alphanumeric string that denotes a particular vGPU, e.g. GRID M60-2Q. It will not exceed 64 characters in length (including the NUL terminator). See \ref nvmlConstants::NVML_DEVICE_NAME_BUFFER_SIZE. For Kepler &tm; or newer fully supported devices. @param vgpuTypeId Handle to vGPU type @param vgpuTypeName Pointer to buffer to return name @param size Size of buffer @return - \ref NVML_SUCCESS successful completion - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuTypeId is invalid, or \a name is NULL - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a size is too small - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlVgpuTypeGetName( vgpuTypeId: cuda_types::nvml::nvmlVgpuTypeId_t, vgpuTypeName: *mut ::core::ffi::c_char, size: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the GPU Instance Profile ID for the given vGPU type ID. The API will return a valid GPU Instance Profile ID for the MIG capable vGPU types, else INVALID_GPU_INSTANCE_PROFILE_ID is returned. For Kepler &tm; or newer fully supported devices. @param vgpuTypeId Handle to vGPU type @param gpuInstanceProfileId GPU Instance Profile ID @return - \ref NVML_SUCCESS successful completion - \ref NVML_ERROR_NOT_SUPPORTED if \a device is not in vGPU Host virtualization mode - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuTypeId is invalid, or \a gpuInstanceProfileId is NULL - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlVgpuTypeGetGpuInstanceProfileId( vgpuTypeId: cuda_types::nvml::nvmlVgpuTypeId_t, gpuInstanceProfileId: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the device ID of a vGPU type. For Kepler &tm; or newer fully supported devices. @param vgpuTypeId Handle to vGPU type @param deviceID Device ID and vendor ID of the device contained in single 32 bit value @param subsystemID Subsystem ID and subsystem vendor ID of the device contained in single 32 bit value @return - \ref NVML_SUCCESS successful completion - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuTypeId is invalid, or \a deviceId or \a subsystemID are NULL - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlVgpuTypeGetDeviceID( vgpuTypeId: cuda_types::nvml::nvmlVgpuTypeId_t, deviceID: *mut ::core::ffi::c_ulonglong, subsystemID: *mut ::core::ffi::c_ulonglong, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the vGPU framebuffer size in bytes. For Kepler &tm; or newer fully supported devices. @param vgpuTypeId Handle to vGPU type @param fbSize Pointer to framebuffer size in bytes @return - \ref NVML_SUCCESS successful completion - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuTypeId is invalid, or \a fbSize is NULL - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlVgpuTypeGetFramebufferSize( vgpuTypeId: cuda_types::nvml::nvmlVgpuTypeId_t, fbSize: *mut ::core::ffi::c_ulonglong, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve count of vGPU's supported display heads. For Kepler &tm; or newer fully supported devices. @param vgpuTypeId Handle to vGPU type @param numDisplayHeads Pointer to number of display heads @return - \ref NVML_SUCCESS successful completion - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuTypeId is invalid, or \a numDisplayHeads is NULL - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlVgpuTypeGetNumDisplayHeads( vgpuTypeId: cuda_types::nvml::nvmlVgpuTypeId_t, numDisplayHeads: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve vGPU display head's maximum supported resolution. For Kepler &tm; or newer fully supported devices. @param vgpuTypeId Handle to vGPU type @param displayIndex Zero-based index of display head @param xdim Pointer to maximum number of pixels in X dimension @param ydim Pointer to maximum number of pixels in Y dimension @return - \ref NVML_SUCCESS successful completion - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuTypeId is invalid, or \a xdim or \a ydim are NULL, or \a displayIndex is out of range. - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlVgpuTypeGetResolution( vgpuTypeId: cuda_types::nvml::nvmlVgpuTypeId_t, displayIndex: ::core::ffi::c_uint, xdim: *mut ::core::ffi::c_uint, ydim: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve license requirements for a vGPU type The license type and version required to run the specified vGPU type is returned as an alphanumeric string, in the form ",", for example "GRID-Virtual-PC,2.0". If a vGPU is runnable with* more than one type of license, the licenses are delimited by a semicolon, for example "GRID-Virtual-PC,2.0;GRID-Virtual-WS,2.0;GRID-Virtual-WS-Ext,2.0". The total length of the returned string will not exceed 128 characters, including the NUL terminator. See \ref nvmlVgpuConstants::NVML_GRID_LICENSE_BUFFER_SIZE. For Kepler &tm; or newer fully supported devices. @param vgpuTypeId Handle to vGPU type @param vgpuTypeLicenseString Pointer to buffer to return license info @param size Size of \a vgpuTypeLicenseString buffer @return - \ref NVML_SUCCESS successful completion - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuTypeId is invalid, or \a vgpuTypeLicenseString is NULL - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a size is too small - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlVgpuTypeGetLicense( vgpuTypeId: cuda_types::nvml::nvmlVgpuTypeId_t, vgpuTypeLicenseString: *mut ::core::ffi::c_char, size: ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the static frame rate limit value of the vGPU type For Kepler &tm; or newer fully supported devices. @param vgpuTypeId Handle to vGPU type @param frameRateLimit Reference to return the frame rate limit value @return - \ref NVML_SUCCESS successful completion - \ref NVML_ERROR_NOT_SUPPORTED if frame rate limiter is turned off for the vGPU type - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuTypeId is invalid, or \a frameRateLimit is NULL - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlVgpuTypeGetFrameRateLimit( vgpuTypeId: cuda_types::nvml::nvmlVgpuTypeId_t, frameRateLimit: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the maximum number of vGPU instances creatable on a device for given vGPU type For Kepler &tm; or newer fully supported devices. @param device The identifier of the target device @param vgpuTypeId Handle to vGPU type @param vgpuInstanceCount Pointer to get the max number of vGPU instances that can be created on a deicve for given vgpuTypeId @return - \ref NVML_SUCCESS successful completion - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuTypeId is invalid or is not supported on target device, or \a vgpuInstanceCount is NULL - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlVgpuTypeGetMaxInstances( device: cuda_types::nvml::nvmlDevice_t, vgpuTypeId: cuda_types::nvml::nvmlVgpuTypeId_t, vgpuInstanceCount: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the maximum number of vGPU instances supported per VM for given vGPU type For Kepler &tm; or newer fully supported devices. @param vgpuTypeId Handle to vGPU type @param vgpuInstanceCountPerVm Pointer to get the max number of vGPU instances supported per VM for given \a vgpuTypeId @return - \ref NVML_SUCCESS successful completion - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuTypeId is invalid, or \a vgpuInstanceCountPerVm is NULL - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlVgpuTypeGetMaxInstancesPerVm( vgpuTypeId: cuda_types::nvml::nvmlVgpuTypeId_t, vgpuInstanceCountPerVm: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the BAR1 info for given vGPU type. For Maxwell &tm; or newer fully supported devices. @param vgpuTypeId Handle to vGPU type @param bar1Info Pointer to the vGPU type BAR1 information structure \a nvmlVgpuTypeBar1Info_t @return - \ref NVML_SUCCESS successful completion - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuTypeId is invalid, or \a bar1Info is NULL - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlVgpuTypeGetBAR1Info( vgpuTypeId: cuda_types::nvml::nvmlVgpuTypeId_t, bar1Info: *mut cuda_types::nvml::nvmlVgpuTypeBar1Info_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the active vGPU instances on a device. An array of active vGPU instances is returned in the caller-supplied buffer pointed at by \a vgpuInstances. The array element count is passed in \a vgpuCount, and \a vgpuCount is used to return the number of vGPU instances written to the buffer. If the supplied buffer is not large enough to accommodate the vGPU instance array, the function returns NVML_ERROR_INSUFFICIENT_SIZE, with the element count of nvmlVgpuInstance_t array required in \a vgpuCount. To query the number of active vGPU instances, call this function with *vgpuCount = 0. The code will return NVML_ERROR_INSUFFICIENT_SIZE, or NVML_SUCCESS if no vGPU Types are supported. For Kepler &tm; or newer fully supported devices. @param device The identifier of the target device @param vgpuCount Pointer which passes in the array size as well as get back the number of types @param vgpuInstances Pointer to array in which to return list of vGPU instances @return - \ref NVML_SUCCESS successful completion - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, or \a vgpuCount is NULL - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a size is too small - \ref NVML_ERROR_NOT_SUPPORTED if vGPU is not supported by the device - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetActiveVgpus( device: cuda_types::nvml::nvmlDevice_t, vgpuCount: *mut ::core::ffi::c_uint, vgpuInstances: *mut cuda_types::nvml::nvmlVgpuInstance_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the VM ID associated with a vGPU instance. The VM ID is returned as a string, not exceeding 80 characters in length (including the NUL terminator). See \ref nvmlConstants::NVML_DEVICE_UUID_BUFFER_SIZE. The format of the VM ID varies by platform, and is indicated by the type identifier returned in \a vmIdType. For Kepler &tm; or newer fully supported devices. @param vgpuInstance Identifier of the target vGPU instance @param vmId Pointer to caller-supplied buffer to hold VM ID @param size Size of buffer in bytes @param vmIdType Pointer to hold VM ID type @return - \ref NVML_SUCCESS successful completion - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a vmId or \a vmIdType is NULL, or \a vgpuInstance is 0 - \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a size is too small - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlVgpuInstanceGetVmID( vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t, vmId: *mut ::core::ffi::c_char, size: ::core::ffi::c_uint, vmIdType: *mut cuda_types::nvml::nvmlVgpuVmIdType_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the UUID of a vGPU instance. The UUID is a globally unique identifier associated with the vGPU, and is returned as a 5-part hexadecimal string, not exceeding 80 characters in length (including the NULL terminator). See \ref nvmlConstants::NVML_DEVICE_UUID_BUFFER_SIZE. For Kepler &tm; or newer fully supported devices. @param vgpuInstance Identifier of the target vGPU instance @param uuid Pointer to caller-supplied buffer to hold vGPU UUID @param size Size of buffer in bytes @return - \ref NVML_SUCCESS successful completion - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a uuid is NULL - \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a size is too small - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlVgpuInstanceGetUUID( vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t, uuid: *mut ::core::ffi::c_char, size: ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the NVIDIA driver version installed in the VM associated with a vGPU. The version is returned as an alphanumeric string in the caller-supplied buffer \a version. The length of the version string will not exceed 80 characters in length (including the NUL terminator). See \ref nvmlConstants::NVML_SYSTEM_DRIVER_VERSION_BUFFER_SIZE. nvmlVgpuInstanceGetVmDriverVersion() may be called at any time for a vGPU instance. The guest VM driver version is returned as "Not Available" if no NVIDIA driver is installed in the VM, or the VM has not yet booted to the point where the NVIDIA driver is loaded and initialized. For Kepler &tm; or newer fully supported devices. @param vgpuInstance Identifier of the target vGPU instance @param version Caller-supplied buffer to return driver version string @param length Size of \a version buffer @return - \ref NVML_SUCCESS if \a version has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0 - \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlVgpuInstanceGetVmDriverVersion( vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t, version: *mut ::core::ffi::c_char, length: ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the framebuffer usage in bytes. Framebuffer usage is the amont of vGPU framebuffer memory that is currently in use by the VM. For Kepler &tm; or newer fully supported devices. @param vgpuInstance The identifier of the target instance @param fbUsage Pointer to framebuffer usage in bytes @return - \ref NVML_SUCCESS successful completion - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a fbUsage is NULL - \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlVgpuInstanceGetFbUsage( vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t, fbUsage: *mut ::core::ffi::c_ulonglong, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** @deprecated Use \ref nvmlVgpuInstanceGetLicenseInfo_v2. Retrieve the current licensing state of the vGPU instance. If the vGPU is currently licensed, \a licensed is set to 1, otherwise it is set to 0. For Kepler &tm; or newer fully supported devices. @param vgpuInstance Identifier of the target vGPU instance @param licensed Reference to return the licensing status @return - \ref NVML_SUCCESS if \a licensed has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a licensed is NULL - \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlVgpuInstanceGetLicenseStatus( vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t, licensed: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the vGPU type of a vGPU instance. Returns the vGPU type ID of vgpu assigned to the vGPU instance. For Kepler &tm; or newer fully supported devices. @param vgpuInstance Identifier of the target vGPU instance @param vgpuTypeId Reference to return the vgpuTypeId @return - \ref NVML_SUCCESS if \a vgpuTypeId has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a vgpuTypeId is NULL - \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlVgpuInstanceGetType( vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t, vgpuTypeId: *mut cuda_types::nvml::nvmlVgpuTypeId_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the frame rate limit set for the vGPU instance. Returns the value of the frame rate limit set for the vGPU instance For Kepler &tm; or newer fully supported devices. @param vgpuInstance Identifier of the target vGPU instance @param frameRateLimit Reference to return the frame rate limit @return - \ref NVML_SUCCESS if \a frameRateLimit has been set - \ref NVML_ERROR_NOT_SUPPORTED if frame rate limiter is turned off for the vGPU type - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a frameRateLimit is NULL - \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlVgpuInstanceGetFrameRateLimit( vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t, frameRateLimit: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the current ECC mode of vGPU instance. @param vgpuInstance The identifier of the target vGPU instance @param eccMode Reference in which to return the current ECC mode @return - \ref NVML_SUCCESS if the vgpuInstance's ECC mode has been successfully retrieved - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a mode is NULL - \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system - \ref NVML_ERROR_NOT_SUPPORTED if the vGPU doesn't support this feature - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlVgpuInstanceGetEccMode( vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t, eccMode: *mut cuda_types::nvml::nvmlEnableState_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the encoder capacity of a vGPU instance, as a percentage of maximum encoder capacity with valid values in the range 0-100. For Maxwell &tm; or newer fully supported devices. @param vgpuInstance Identifier of the target vGPU instance @param encoderCapacity Reference to an unsigned int for the encoder capacity @return - \ref NVML_SUCCESS if \a encoderCapacity has been retrieved - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a encoderQueryType is invalid - \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlVgpuInstanceGetEncoderCapacity( vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t, encoderCapacity: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Set the encoder capacity of a vGPU instance, as a percentage of maximum encoder capacity with valid values in the range 0-100. For Maxwell &tm; or newer fully supported devices. @param vgpuInstance Identifier of the target vGPU instance @param encoderCapacity Unsigned int for the encoder capacity value @return - \ref NVML_SUCCESS if \a encoderCapacity has been set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a encoderCapacity is out of range of 0-100. - \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlVgpuInstanceSetEncoderCapacity( vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t, encoderCapacity: ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the current encoder statistics of a vGPU Instance For Maxwell &tm; or newer fully supported devices. @param vgpuInstance Identifier of the target vGPU instance @param sessionCount Reference to an unsigned int for count of active encoder sessions @param averageFps Reference to an unsigned int for trailing average FPS of all active sessions @param averageLatency Reference to an unsigned int for encode latency in microseconds @return - \ref NVML_SUCCESS if \a sessionCount, \a averageFps and \a averageLatency is fetched - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a sessionCount , or \a averageFps or \a averageLatency is NULL or \a vgpuInstance is 0. - \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlVgpuInstanceGetEncoderStats( vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t, sessionCount: *mut ::core::ffi::c_uint, averageFps: *mut ::core::ffi::c_uint, averageLatency: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves information about all active encoder sessions on a vGPU Instance. An array of active encoder sessions is returned in the caller-supplied buffer pointed at by \a sessionInfo. The array element count is passed in \a sessionCount, and \a sessionCount is used to return the number of sessions written to the buffer. If the supplied buffer is not large enough to accommodate the active session array, the function returns NVML_ERROR_INSUFFICIENT_SIZE, with the element count of nvmlEncoderSessionInfo_t array required in \a sessionCount. To query the number of active encoder sessions, call this function with *sessionCount = 0. The code will return NVML_SUCCESS with number of active encoder sessions updated in *sessionCount. For Maxwell &tm; or newer fully supported devices. @param vgpuInstance Identifier of the target vGPU instance @param sessionCount Reference to caller supplied array size, and returns the number of sessions. @param sessionInfo Reference to caller supplied array in which the list of session information us returned. @return - \ref NVML_SUCCESS if \a sessionInfo is fetched - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a sessionCount is too small, array element count is returned in \a sessionCount - \ref NVML_ERROR_INVALID_ARGUMENT if \a sessionCount is NULL, or \a vgpuInstance is 0. - \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlVgpuInstanceGetEncoderSessions( vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t, sessionCount: *mut ::core::ffi::c_uint, sessionInfo: *mut cuda_types::nvml::nvmlEncoderSessionInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the active frame buffer capture sessions statistics of a vGPU Instance For Maxwell &tm; or newer fully supported devices. @param vgpuInstance Identifier of the target vGPU instance @param fbcStats Reference to nvmlFBCStats_t structure containing NvFBC stats @return - \ref NVML_SUCCESS if \a fbcStats is fetched - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a fbcStats is NULL - \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlVgpuInstanceGetFBCStats( vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t, fbcStats: *mut cuda_types::nvml::nvmlFBCStats_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves information about active frame buffer capture sessions on a vGPU Instance. An array of active FBC sessions is returned in the caller-supplied buffer pointed at by \a sessionInfo. The array element count is passed in \a sessionCount, and \a sessionCount is used to return the number of sessions written to the buffer. If the supplied buffer is not large enough to accommodate the active session array, the function returns NVML_ERROR_INSUFFICIENT_SIZE, with the element count of nvmlFBCSessionInfo_t array required in \a sessionCount. To query the number of active FBC sessions, call this function with *sessionCount = 0. The code will return NVML_SUCCESS with number of active FBC sessions updated in *sessionCount. For Maxwell &tm; or newer fully supported devices. @note hResolution, vResolution, averageFPS and averageLatency data for a FBC session returned in \a sessionInfo may be zero if there are no new frames captured since the session started. @param vgpuInstance Identifier of the target vGPU instance @param sessionCount Reference to caller supplied array size, and returns the number of sessions. @param sessionInfo Reference in which to return the session information @return - \ref NVML_SUCCESS if \a sessionInfo is fetched - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a sessionCount is NULL. - \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a sessionCount is too small, array element count is returned in \a sessionCount - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlVgpuInstanceGetFBCSessions( vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t, sessionCount: *mut ::core::ffi::c_uint, sessionInfo: *mut cuda_types::nvml::nvmlFBCSessionInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the GPU Instance ID for the given vGPU Instance. The API will return a valid GPU Instance ID for MIG backed vGPU Instance, else INVALID_GPU_INSTANCE_ID is returned. For Kepler &tm; or newer fully supported devices. @param vgpuInstance Identifier of the target vGPU instance @param gpuInstanceId GPU Instance ID @return - \ref NVML_SUCCESS successful completion - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a gpuInstanceId is NULL. - \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlVgpuInstanceGetGpuInstanceId( vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t, gpuInstanceId: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the PCI Id of the given vGPU Instance i.e. the PCI Id of the GPU as seen inside the VM. The vGPU PCI id is returned as "00000000:00:00.0" if NVIDIA driver is not installed on the vGPU instance. @param vgpuInstance Identifier of the target vGPU instance @param vgpuPciId Caller-supplied buffer to return vGPU PCI Id string @param length Size of the vgpuPciId buffer @return - \ref NVML_SUCCESS if vGPU PCI Id is sucessfully retrieved - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a vgpuPciId is NULL - \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system - \ref NVML_ERROR_DRIVER_NOT_LOADED if NVIDIA driver is not running on the vGPU instance - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a length is too small, \a length is set to required length - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlVgpuInstanceGetGpuPciId( vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t, vgpuPciId: *mut ::core::ffi::c_char, length: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the requested capability for a given vGPU type. Refer to the \a nvmlVgpuCapability_t structure for the specific capabilities that can be queried. The return value in \a capResult should be treated as a boolean, with a non-zero value indicating that the capability is supported. For Maxwell &tm; or newer fully supported devices. @param vgpuTypeId Handle to vGPU type @param capability Specifies the \a nvmlVgpuCapability_t to be queried @param capResult A boolean for the queried capability indicating that feature is supported @return - \ref NVML_SUCCESS successful completion - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuTypeId is invalid, or \a capability is invalid, or \a capResult is NULL - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlVgpuTypeGetCapabilities( vgpuTypeId: cuda_types::nvml::nvmlVgpuTypeId_t, capability: cuda_types::nvml::nvmlVgpuCapability_t, capResult: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the MDEV UUID of a vGPU instance. The MDEV UUID is a globally unique identifier of the mdev device assigned to the VM, and is returned as a 5-part hexadecimal string, not exceeding 80 characters in length (including the NULL terminator). MDEV UUID is displayed only on KVM platform. See \ref nvmlConstants::NVML_DEVICE_UUID_BUFFER_SIZE. For Maxwell &tm; or newer fully supported devices. @param vgpuInstance Identifier of the target vGPU instance @param mdevUuid Pointer to caller-supplied buffer to hold MDEV UUID @param size Size of buffer in bytes @return - \ref NVML_SUCCESS successful completion - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_NOT_SUPPORTED on any hypervisor other than KVM - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a mdevUuid is NULL - \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a size is too small - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlVgpuInstanceGetMdevUUID( vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t, mdevUuid: *mut ::core::ffi::c_char, size: ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Query the currently creatable vGPU types on a specific GPU Instance. The function returns an array of vGPU types that can be created for a specified GPU instance. This array is stored in a caller-supplied buffer, with the buffer's element count passed through \a pVgpus->vgpuCount. The number of vGPU types written to the buffer is indicated by \a pVgpus->vgpuCount. If the buffer is too small to hold the vGPU type array, the function returns NVML_ERROR_INSUFFICIENT_SIZE and updates \a pVgpus->vgpuCount with the required element count. To determine the creatable vGPUs for a GPU Instance, invoke this function with \a pVgpus->vgpuCount set to 0 and \a pVgpus->vgpuTypeIds as NULL. This will result in NVML_ERROR_INSUFFICIENT_SIZE being returned, along with the count value in \a pVgpus->vgpuCount. The creatable vGPU types may differ over time, as there may be restrictions on what type of vGPUs can concurrently run on the device. @param gpuInstance The GPU instance handle @param pVgpus Pointer to the caller-provided structure of nvmlVgpuTypeIdInfo_t @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a gpuInstance is NULL or invalid, or \a pVgpus is NULL or GPU Instance Id is invalid - \ref NVML_ERROR_NOT_SUPPORTED If not on a vGPU host or an unsupported GPU - \ref NVML_ERROR_INSUFFICIENT_SIZE If \a pVgpus->vgpuTypeIds buffer is small - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH If the version of \a pVgpus is invalid - \ref NVML_ERROR_UNKNOWN On any unexpected error*/ fn nvmlGpuInstanceGetCreatableVgpus( gpuInstance: cuda_types::nvml::nvmlGpuInstance_t, pVgpus: *mut cuda_types::nvml::nvmlVgpuTypeIdInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the maximum number of vGPU instances per GPU instance for given vGPU type @param pMaxInstance Pointer to the caller-provided structure of nvmlVgpuTypeMaxInstance_t @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a pMaxInstance is NULL or \a pMaxInstance->vgpuTypeId is invalid - \ref NVML_ERROR_NOT_SUPPORTED If not on a vGPU host or an unsupported GPU or non-MIG vGPU type - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH If the version of \a pMaxInstance is invalid - \ref NVML_ERROR_UNKNOWN On any unexpected error*/ fn nvmlVgpuTypeGetMaxInstancesPerGpuInstance( pMaxInstance: *mut cuda_types::nvml::nvmlVgpuTypeMaxInstance_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieve the active vGPU instances within a GPU instance. An array of active vGPU instances is returned in the caller-supplied buffer pointed at by \a pVgpuInstanceInfo->vgpuInstances. The array element count is passed in \a pVgpuInstanceInfo->vgpuCount, and \a pVgpuInstanceInfo->vgpuCount is used to return the number of vGPU instances written to the buffer. If the supplied buffer is not large enough to accommodate the vGPU instance array, the function returns NVML_ERROR_INSUFFICIENT_SIZE, with the element count of nvmlVgpuInstance_t array required in \a pVgpuInstanceInfo->vgpuCount. To query the number of active vGPU instances, call this function with pVgpuInstanceInfo->vgpuCount = 0 and pVgpuInstanceInfo->vgpuTypeIds = NULL. The code will return NVML_ERROR_INSUFFICIENT_SIZE, or NVML_SUCCESS if no vGPU Types are active. @param gpuInstance The GPU instance handle @param pVgpuInstanceInfo Pointer to the vGPU instance information structure \a nvmlActiveVgpuInstanceInfo_t @return - \ref NVML_SUCCESS Successful completion - \ref NVML_ERROR_UNINITIALIZED If the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a gpuInstance is NULL or invalid, or \a pVgpuInstanceInfo is NULL or GPU Instance Id is invalid - \ref NVML_ERROR_INSUFFICIENT_SIZE \a pVgpuInstanceInfo->vgpuTypeIds buffer is too small, array element count is returned in \a pVgpuInstanceInfo->vgpuCount - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH If the version of \a pVgpuInstanceInfo is invalid - \ref NVML_ERROR_NOT_SUPPORTED If not on a vGPU host or an unsupported GPU - \ref NVML_ERROR_UNKNOWN On any unexpected error*/ fn nvmlGpuInstanceGetActiveVgpus( gpuInstance: cuda_types::nvml::nvmlGpuInstance_t, pVgpuInstanceInfo: *mut cuda_types::nvml::nvmlActiveVgpuInstanceInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Set vGPU scheduler state for the given GPU instance For Blackwell &tm GB20x; or newer fully supported devices. Scheduler state and params will be allowed to set only when no VM is running within the GPU instance. In \a nvmlVgpuSchedulerState_t, IFF enableARRMode is enabled then provide the avgFactor and frequency as input. If enableARRMode is disabled then provide timeslice as input. The scheduler state change won't persist across module load/unload and GPU Instance creation/deletion. @param gpuInstance The GPU instance handle @param pScheduler Pointer to the caller-provided structure of nvmlVgpuSchedulerState_t @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_INVALID_ARGUMENT If \a gpuInstance is NULL or invalid, or \a pScheduler is NULL or GPU Instance Id is invalid - \ref NVML_ERROR_RESET_REQUIRED If setting the state failed with fatal error, reboot is required - \ref NVML_ERROR_NOT_SUPPORTED If not on a vGPU host or an unsupported GPU or if any vGPU instance exists - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH If the version of \a pScheduler is invalid - \ref NVML_ERROR_UNKNOWN On any unexpected error*/ fn nvmlGpuInstanceSetVgpuSchedulerState( gpuInstance: cuda_types::nvml::nvmlGpuInstance_t, pScheduler: *mut cuda_types::nvml::nvmlVgpuSchedulerState_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Returns the vGPU scheduler state for the given GPU instance. The information returned in \a nvmlVgpuSchedulerStateInfo_t is not relevant if the BEST EFFORT policy is set. For Blackwell &tm GB20x; or newer fully supported devices. @param gpuInstance The GPU instance handle @param pSchedulerStateInfo Reference in which \a pSchedulerStateInfo is returned @return - \ref NVML_SUCCESS vGPU scheduler state is successfully obtained - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a gpuInstance is NULL or invalid, or \a pSchedulerStateInfo is NULL or GPU Instance Id is invalid - \ref NVML_ERROR_NOT_SUPPORTED If not on a vGPU host or an unsupported GPU - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH If the version of \a pSchedulerStateInfo is invalid - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlGpuInstanceGetVgpuSchedulerState( gpuInstance: cuda_types::nvml::nvmlGpuInstance_t, pSchedulerStateInfo: *mut cuda_types::nvml::nvmlVgpuSchedulerStateInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Returns the vGPU scheduler logs for the given GPU instance. \a pSchedulerLogInfo points to a caller-allocated structure to contain the logs. The number of elements returned will never exceed \a NVML_SCHEDULER_SW_MAX_LOG_ENTRIES. To get the entire logs, call the function atleast 5 times a second. For Blackwell &tm GB20x; or newer fully supported devices. @param gpuInstance The GPU instance handle @param pSchedulerLogInfo Reference in which \a pSchedulerLogInfo is written @return - \ref NVML_SUCCESS vGPU scheduler logs are successfully obtained - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a gpuInstance is NULL or invalid, or \a pSchedulerLogInfo is NULL or GPU Instance Id is invalid - \ref NVML_ERROR_NOT_SUPPORTED If not on a vGPU host or an unsupported GPU - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH If the version of \a pSchedulerLogInfo is invalid - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlGpuInstanceGetVgpuSchedulerLog( gpuInstance: cuda_types::nvml::nvmlGpuInstance_t, pSchedulerLogInfo: *mut cuda_types::nvml::nvmlVgpuSchedulerLogInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Query the creatable vGPU placement ID of the vGPU type within a GPU instance. For Blackwell &tm GB20x; or newer fully supported devices. An array of creatable vGPU placement IDs for the vGPU type ID indicated by \a pCreatablePlacementInfo->vgpuTypeId is returned in the caller-supplied buffer of \a pCreatablePlacementInfo->placementIds. Memory needed for the placementIds array should be allocated based on maximum instances of a vGPU type per GPU instance which can be queried via \ref nvmlVgpuTypeGetMaxInstancesPerGpuInstance(). If the provided count by the caller is insufficient, the function will return NVML_ERROR_INSUFFICIENT_SIZE along with the number of required entries in \a pCreatablePlacementInfo->count. The caller should then reallocate a buffer with the size of pCreatablePlacementInfo->count * sizeof(pCreatablePlacementInfo->placementIds) and invoke the function again. The creatable vGPU placement IDs may differ over time, as there may be restrictions on what type of vGPU the vGPU instance is running. @param gpuInstance The GPU instance handle @param pCreatablePlacementInfo Pointer to the list of vGPU creatable placement structure \a nvmlVgpuCreatablePlacementInfo_t @return - \ref NVML_SUCCESS Successful completion - \ref NVML_ERROR_UNINITIALIZED If the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a gpuInstance is NULL or invalid, or \a pCreatablePlacementInfo is NULL or GPU Instance Id is invalid - \ref NVML_ERROR_INSUFFICIENT_SIZE If the buffer is small, element count is returned in \a pCreatablePlacementInfo->count - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH If the version of \a pCreatablePlacementInfo is invalid - \ref NVML_ERROR_NOT_SUPPORTED If not on a vGPU host or an unsupported GPU or vGPU heterogeneous mode is not enabled - \ref NVML_ERROR_UNKNOWN On any unexpected error*/ fn nvmlGpuInstanceGetVgpuTypeCreatablePlacements( gpuInstance: cuda_types::nvml::nvmlGpuInstance_t, pCreatablePlacementInfo: *mut cuda_types::nvml::nvmlVgpuCreatablePlacementInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get the vGPU heterogeneous mode for the GPU instance. When in heterogeneous mode, a vGPU can concurrently host timesliced vGPUs with differing framebuffer sizes. On successful return, the function returns \a pHeterogeneousMode->mode with the current vGPU heterogeneous mode. \a pHeterogeneousMode->version is the version number of the structure nvmlVgpuHeterogeneousMode_t, the caller should set the correct version number to retrieve the vGPU heterogeneous mode. \a pHeterogeneousMode->mode can either be \ref NVML_FEATURE_ENABLED or \ref NVML_FEATURE_DISABLED. For Blackwell &tm GB20x; or newer fully supported devices. @param gpuInstance The GPU instance handle @param pHeterogeneousMode Pointer to the caller-provided structure of nvmlVgpuHeterogeneousMode_t @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a gpuInstance is NULL or invalid, or \a pHeterogeneousMode is NULL or GPU Instance Id is invalid - \ref NVML_ERROR_NOT_SUPPORTED If not on a vGPU host or an unsupported GPU or not in MIG mode - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH If the version of \a pHeterogeneousMode is invalid - \ref NVML_ERROR_UNKNOWN On any unexpected error*/ fn nvmlGpuInstanceGetVgpuHeterogeneousMode( gpuInstance: cuda_types::nvml::nvmlGpuInstance_t, pHeterogeneousMode: *mut cuda_types::nvml::nvmlVgpuHeterogeneousMode_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Enable or disable vGPU heterogeneous mode for the GPU instance. When in heterogeneous mode, a vGPU can concurrently host timesliced vGPUs with differing framebuffer sizes. API would return an appropriate error code upon unsuccessful activation. For example, the heterogeneous mode set will fail with error \ref NVML_ERROR_IN_USE if any vGPU instance is active within the GPU instance. The caller of this API is expected to shutdown the vGPU VMs and retry setting the \a mode. On successful return, the function updates the vGPU heterogeneous mode with the user provided \a pHeterogeneousMode->mode. \a pHeterogeneousMode->version is the version number of the structure nvmlVgpuHeterogeneousMode_t, the caller should set the correct version number to set the vGPU heterogeneous mode. @param gpuInstance The GPU instance handle @param pHeterogeneousMode Pointer to the caller-provided structure of nvmlVgpuHeterogeneousMode_t @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a gpuInstance is NULL or invalid, or \a pHeterogeneousMode is NULL or \a pHeterogeneousMode->mode is invalid or GPU Instance Id is invalid - \ref NVML_ERROR_IN_USE If the \a gpuInstance is in use - \ref NVML_ERROR_NOT_SUPPORTED If not on a vGPU host or an unsupported GPU - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH If the version of \a pHeterogeneousMode is invalid - \ref NVML_ERROR_UNKNOWN On any unexpected error*/ fn nvmlGpuInstanceSetVgpuHeterogeneousMode( gpuInstance: cuda_types::nvml::nvmlGpuInstance_t, pHeterogeneousMode: *const cuda_types::nvml::nvmlVgpuHeterogeneousMode_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Returns vGPU metadata structure for a running vGPU. The structure contains information about the vGPU and its associated VM such as the currently installed NVIDIA guest driver version, together with host driver version and an opaque data section containing internal state. nvmlVgpuInstanceGetMetadata() may be called at any time for a vGPU instance. Some fields in the returned structure are dependent on information obtained from the guest VM, which may not yet have reached a state where that information is available. The current state of these dependent fields is reflected in the info structure's \ref nvmlVgpuGuestInfoState_t field. The VMM may choose to read and save the vGPU's VM info as persistent metadata associated with the VM, and provide it to Virtual GPU Manager when creating a vGPU for subsequent instances of the VM. The caller passes in a buffer via \a vgpuMetadata, with the size of the buffer in \a bufferSize. If the vGPU Metadata structure is too large to fit in the supplied buffer, the function returns NVML_ERROR_INSUFFICIENT_SIZE with the size needed in \a bufferSize. @param vgpuInstance vGPU instance handle @param vgpuMetadata Pointer to caller-supplied buffer into which vGPU metadata is written @param bufferSize Size of vgpuMetadata buffer @return - \ref NVML_SUCCESS vGPU metadata structure was successfully returned - \ref NVML_ERROR_INSUFFICIENT_SIZE vgpuMetadata buffer is too small, required size is returned in \a bufferSize - \ref NVML_ERROR_INVALID_ARGUMENT if \a bufferSize is NULL or \a vgpuInstance is 0; if \a vgpuMetadata is NULL and the value of \a bufferSize is not 0. - \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlVgpuInstanceGetMetadata( vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t, vgpuMetadata: *mut cuda_types::nvml::nvmlVgpuMetadata_t, bufferSize: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Returns a vGPU metadata structure for the physical GPU indicated by \a device. The structure contains information about the GPU and the currently installed NVIDIA host driver version that's controlling it, together with an opaque data section containing internal state. The caller passes in a buffer via \a pgpuMetadata, with the size of the buffer in \a bufferSize. If the \a pgpuMetadata structure is too large to fit in the supplied buffer, the function returns NVML_ERROR_INSUFFICIENT_SIZE with the size needed in \a bufferSize. @param device The identifier of the target device @param pgpuMetadata Pointer to caller-supplied buffer into which \a pgpuMetadata is written @param bufferSize Pointer to size of \a pgpuMetadata buffer @return - \ref NVML_SUCCESS GPU metadata structure was successfully returned - \ref NVML_ERROR_INSUFFICIENT_SIZE pgpuMetadata buffer is too small, required size is returned in \a bufferSize - \ref NVML_ERROR_INVALID_ARGUMENT if \a bufferSize is NULL or \a device is invalid; if \a pgpuMetadata is NULL and the value of \a bufferSize is not 0. - \ref NVML_ERROR_NOT_SUPPORTED vGPU is not supported by the system - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetVgpuMetadata( device: cuda_types::nvml::nvmlDevice_t, pgpuMetadata: *mut cuda_types::nvml::nvmlVgpuPgpuMetadata_t, bufferSize: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Takes a vGPU instance metadata structure read from \ref nvmlVgpuInstanceGetMetadata(), and a vGPU metadata structure for a physical GPU read from \ref nvmlDeviceGetVgpuMetadata(), and returns compatibility information of the vGPU instance and the physical GPU. The caller passes in a buffer via \a compatibilityInfo, into which a compatibility information structure is written. The structure defines the states in which the vGPU / VM may be booted on the physical GPU. If the vGPU / VM compatibility with the physical GPU is limited, a limit code indicates the factor limiting compatability. (see \ref nvmlVgpuPgpuCompatibilityLimitCode_t for details). Note: vGPU compatibility does not take into account dynamic capacity conditions that may limit a system's ability to boot a given vGPU or associated VM. @param vgpuMetadata Pointer to caller-supplied vGPU metadata structure @param pgpuMetadata Pointer to caller-supplied GPU metadata structure @param compatibilityInfo Pointer to caller-supplied buffer to hold compatibility info @return - \ref NVML_SUCCESS vGPU metadata structure was successfully returned - \ref NVML_ERROR_INVALID_ARGUMENT If \a vgpuMetadata or \a pgpuMetadata or \a bufferSize are NULL - \ref NVML_ERROR_UNKNOWN On any unexpected error*/ fn nvmlGetVgpuCompatibility( vgpuMetadata: *mut cuda_types::nvml::nvmlVgpuMetadata_t, pgpuMetadata: *mut cuda_types::nvml::nvmlVgpuPgpuMetadata_t, compatibilityInfo: *mut cuda_types::nvml::nvmlVgpuPgpuCompatibility_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Returns the properties of the physical GPU indicated by the device in an ascii-encoded string format. The caller passes in a buffer via \a pgpuMetadata, with the size of the buffer in \a bufferSize. If the string is too large to fit in the supplied buffer, the function returns NVML_ERROR_INSUFFICIENT_SIZE with the size needed in \a bufferSize. @param device The identifier of the target device @param pgpuMetadata Pointer to caller-supplied buffer into which \a pgpuMetadata is written @param bufferSize Pointer to size of \a pgpuMetadata buffer @return - \ref NVML_SUCCESS GPU metadata structure was successfully returned - \ref NVML_ERROR_INSUFFICIENT_SIZE \a pgpuMetadata buffer is too small, required size is returned in \a bufferSize - \ref NVML_ERROR_INVALID_ARGUMENT If \a bufferSize is NULL or \a device is invalid; if \a pgpuMetadata is NULL and the value of \a bufferSize is not 0. - \ref NVML_ERROR_NOT_SUPPORTED If vGPU is not supported by the system - \ref NVML_ERROR_UNKNOWN On any unexpected error*/ fn nvmlDeviceGetPgpuMetadataString( device: cuda_types::nvml::nvmlDevice_t, pgpuMetadata: *mut ::core::ffi::c_char, bufferSize: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Returns the vGPU Software scheduler logs. \a pSchedulerLog points to a caller-allocated structure to contain the logs. The number of elements returned will never exceed \a NVML_SCHEDULER_SW_MAX_LOG_ENTRIES. To get the entire logs, call the function atleast 5 times a second. For Pascal &tm; or newer fully supported devices. @param device The identifier of the target \a device @param pSchedulerLog Reference in which \a pSchedulerLog is written @return - \ref NVML_SUCCESS vGPU scheduler logs were successfully obtained - \ref NVML_ERROR_INVALID_ARGUMENT If \a pSchedulerLog is NULL or \a device is invalid - \ref NVML_ERROR_NOT_SUPPORTED If MIG is enabled or \a device not in vGPU host mode - \ref NVML_ERROR_UNKNOWN On any unexpected error*/ fn nvmlDeviceGetVgpuSchedulerLog( device: cuda_types::nvml::nvmlDevice_t, pSchedulerLog: *mut cuda_types::nvml::nvmlVgpuSchedulerLog_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Returns the vGPU scheduler state. The information returned in \a nvmlVgpuSchedulerGetState_t is not relevant if the BEST EFFORT policy is set. For Pascal &tm; or newer fully supported devices. @param device The identifier of the target \a device @param pSchedulerState Reference in which \a pSchedulerState is returned @return - \ref NVML_SUCCESS vGPU scheduler state is successfully obtained - \ref NVML_ERROR_INVALID_ARGUMENT If \a pSchedulerState is NULL or \a device is invalid - \ref NVML_ERROR_NOT_SUPPORTED If MIG is enabled or \a device not in vGPU host mode - \ref NVML_ERROR_UNKNOWN On any unexpected error*/ fn nvmlDeviceGetVgpuSchedulerState( device: cuda_types::nvml::nvmlDevice_t, pSchedulerState: *mut cuda_types::nvml::nvmlVgpuSchedulerGetState_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Returns the vGPU scheduler capabilities. The list of supported vGPU schedulers returned in \a nvmlVgpuSchedulerCapabilities_t is from the NVML_VGPU_SCHEDULER_POLICY_*. This list enumerates the supported scheduler policies if the engine is Graphics type. The other values in \a nvmlVgpuSchedulerCapabilities_t are also applicable if the engine is Graphics type. For other engine types, it is BEST EFFORT policy. If ARR is supported and enabled, scheduling frequency and averaging factor are applicable else timeSlice is applicable. For Pascal &tm; or newer fully supported devices. @param device The identifier of the target \a device @param pCapabilities Reference in which \a pCapabilities is written @return - \ref NVML_SUCCESS vGPU scheduler capabilities were successfully obtained - \ref NVML_ERROR_INVALID_ARGUMENT If \a pCapabilities is NULL or \a device is invalid - \ref NVML_ERROR_NOT_SUPPORTED The API is not supported in current state or \a device not in vGPU host mode - \ref NVML_ERROR_UNKNOWN On any unexpected error*/ fn nvmlDeviceGetVgpuSchedulerCapabilities( device: cuda_types::nvml::nvmlDevice_t, pCapabilities: *mut cuda_types::nvml::nvmlVgpuSchedulerCapabilities_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Sets the vGPU scheduler state. For Pascal &tm; or newer fully supported devices. The scheduler state change won't persist across module load/unload. Scheduler state and params will be allowed to set only when no VM is running. In \a nvmlVgpuSchedulerSetState_t, IFF enableARRMode is enabled then provide avgFactorForARR and frequency as input. If enableARRMode is disabled then provide timeslice as input. @param device The identifier of the target \a device @param pSchedulerState vGPU \a pSchedulerState to set @return - \ref NVML_SUCCESS vGPU scheduler state has been successfully set - \ref NVML_ERROR_INVALID_ARGUMENT If \a pSchedulerState is NULL or \a device is invalid - \ref NVML_ERROR_RESET_REQUIRED If setting \a pSchedulerState failed with fatal error, reboot is required to overcome from this error. - \ref NVML_ERROR_NOT_SUPPORTED If MIG is enabled or \a device not in vGPU host mode or if any vGPU instance currently exists on the \a device - \ref NVML_ERROR_UNKNOWN On any unexpected error*/ fn nvmlDeviceSetVgpuSchedulerState( device: cuda_types::nvml::nvmlDevice_t, pSchedulerState: *mut cuda_types::nvml::nvmlVgpuSchedulerSetState_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Query the ranges of supported vGPU versions. This function gets the linear range of supported vGPU versions that is preset for the NVIDIA vGPU Manager and the range set by an administrator. If the preset range has not been overridden by \ref nvmlSetVgpuVersion, both ranges are the same. The caller passes pointers to the following \ref nvmlVgpuVersion_t structures, into which the NVIDIA vGPU Manager writes the ranges: 1. \a supported structure that represents the preset range of vGPU versions supported by the NVIDIA vGPU Manager. 2. \a current structure that represents the range of supported vGPU versions set by an administrator. By default, this range is the same as the preset range. @param supported Pointer to the structure in which the preset range of vGPU versions supported by the NVIDIA vGPU Manager is written @param current Pointer to the structure in which the range of supported vGPU versions set by an administrator is written @return - \ref NVML_SUCCESS The vGPU version range structures were successfully obtained. - \ref NVML_ERROR_NOT_SUPPORTED The API is not supported. - \ref NVML_ERROR_INVALID_ARGUMENT The \a supported parameter or the \a current parameter is NULL. - \ref NVML_ERROR_UNKNOWN An error occurred while the data was being fetched.*/ fn nvmlGetVgpuVersion( supported: *mut cuda_types::nvml::nvmlVgpuVersion_t, current: *mut cuda_types::nvml::nvmlVgpuVersion_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Override the preset range of vGPU versions supported by the NVIDIA vGPU Manager with a range set by an administrator. This function configures the NVIDIA vGPU Manager with a range of supported vGPU versions set by an administrator. This range must be a subset of the preset range that the NVIDIA vGPU Manager supports. The custom range set by an administrator takes precedence over the preset range and is advertised to the guest VM for negotiating the vGPU version. See \ref nvmlGetVgpuVersion for details of how to query the preset range of versions supported. This function takes a pointer to vGPU version range structure \ref nvmlVgpuVersion_t as input to override the preset vGPU version range that the NVIDIA vGPU Manager supports. After host system reboot or driver reload, the range of supported versions reverts to the range that is preset for the NVIDIA vGPU Manager. @note 1. The range set by the administrator must be a subset of the preset range that the NVIDIA vGPU Manager supports. Otherwise, an error is returned. 2. If the range of supported guest driver versions does not overlap the range set by the administrator, the guest driver fails to load. 3. If the range of supported guest driver versions overlaps the range set by the administrator, the guest driver will load with a negotiated vGPU version that is the maximum value in the overlapping range. 4. No VMs must be running on the host when this function is called. If a VM is running on the host, the call to this function fails. @param vgpuVersion Pointer to a caller-supplied range of supported vGPU versions. @return - \ref NVML_SUCCESS The preset range of supported vGPU versions was successfully overridden. - \ref NVML_ERROR_NOT_SUPPORTED The API is not supported. - \ref NVML_ERROR_IN_USE The range was not overridden because a VM is running on the host. - \ref NVML_ERROR_INVALID_ARGUMENT The \a vgpuVersion parameter specifies a range that is outside the range supported by the NVIDIA vGPU Manager or if \a vgpuVersion is NULL.*/ fn nvmlSetVgpuVersion( vgpuVersion: *mut cuda_types::nvml::nvmlVgpuVersion_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves current utilization for vGPUs on a physical GPU (device). For Kepler &tm; or newer fully supported devices. Reads recent utilization of GPU SM (3D/Compute), framebuffer, video encoder, and video decoder for vGPU instances running on a device. Utilization values are returned as an array of utilization sample structures in the caller-supplied buffer pointed at by \a utilizationSamples. One utilization sample structure is returned per vGPU instance, and includes the CPU timestamp at which the samples were recorded. Individual utilization values are returned as "unsigned int" values in nvmlValue_t unions. The function sets the caller-supplied \a sampleValType to NVML_VALUE_TYPE_UNSIGNED_INT to indicate the returned value type. To read utilization values, first determine the size of buffer required to hold the samples by invoking the function with \a utilizationSamples set to NULL. The function will return NVML_ERROR_INSUFFICIENT_SIZE, with the current vGPU instance count in \a vgpuInstanceSamplesCount, or NVML_SUCCESS if the current vGPU instance count is zero. The caller should allocate a buffer of size vgpuInstanceSamplesCount * sizeof(nvmlVgpuInstanceUtilizationSample_t). Invoke the function again with the allocated buffer passed in \a utilizationSamples, and \a vgpuInstanceSamplesCount set to the number of entries the buffer is sized for. On successful return, the function updates \a vgpuInstanceSampleCount with the number of vGPU utilization sample structures that were actually written. This may differ from a previously read value as vGPU instances are created or destroyed. lastSeenTimeStamp represents the CPU timestamp in microseconds at which utilization samples were last read. Set it to 0 to read utilization based on all the samples maintained by the driver's internal sample buffer. Set lastSeenTimeStamp to a timeStamp retrieved from a previous query to read utilization since the previous query. @param device The identifier for the target device @param lastSeenTimeStamp Return only samples with timestamp greater than lastSeenTimeStamp. @param sampleValType Pointer to caller-supplied buffer to hold the type of returned sample values @param vgpuInstanceSamplesCount Pointer to caller-supplied array size, and returns number of vGPU instances @param utilizationSamples Pointer to caller-supplied buffer in which vGPU utilization samples are returned @return - \ref NVML_SUCCESS if utilization samples are successfully retrieved - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a vgpuInstanceSamplesCount or \a sampleValType is NULL, or a sample count of 0 is passed with a non-NULL \a utilizationSamples - \ref NVML_ERROR_INSUFFICIENT_SIZE if supplied \a vgpuInstanceSamplesCount is too small to return samples for all vGPU instances currently executing on the device - \ref NVML_ERROR_NOT_SUPPORTED if vGPU is not supported by the device - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_NOT_FOUND if sample entries are not found - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetVgpuUtilization( device: cuda_types::nvml::nvmlDevice_t, lastSeenTimeStamp: ::core::ffi::c_ulonglong, sampleValType: *mut cuda_types::nvml::nvmlValueType_t, vgpuInstanceSamplesCount: *mut ::core::ffi::c_uint, utilizationSamples: *mut cuda_types::nvml::nvmlVgpuInstanceUtilizationSample_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves recent utilization for vGPU instances running on a physical GPU (device). For Kepler &tm; or newer fully supported devices. Reads recent utilization of GPU SM (3D/Compute), framebuffer, video encoder, video decoder, jpeg decoder, and OFA for vGPU instances running on a device. Utilization values are returned as an array of utilization sample structures in the caller-supplied buffer pointed at by \a vgpuUtilInfo->vgpuUtilArray. One utilization sample structure is returned per vGPU instance, and includes the CPU timestamp at which the samples were recorded. Individual utilization values are returned as "unsigned int" values in nvmlValue_t unions. The function sets the caller-supplied \a vgpuUtilInfo->sampleValType to NVML_VALUE_TYPE_UNSIGNED_INT to indicate the returned value type. To read utilization values, first determine the size of buffer required to hold the samples by invoking the function with \a vgpuUtilInfo->vgpuUtilArray set to NULL. The function will return NVML_ERROR_INSUFFICIENT_SIZE, with the current vGPU instance count in \a vgpuUtilInfo->vgpuInstanceCount, or NVML_SUCCESS if the current vGPU instance count is zero. The caller should allocate a buffer of size vgpuUtilInfo->vgpuInstanceCount * sizeof(nvmlVgpuInstanceUtilizationInfo_t). Invoke the function again with the allocated buffer passed in \a vgpuUtilInfo->vgpuUtilArray, and \a vgpuUtilInfo->vgpuInstanceCount set to the number of entries the buffer is sized for. On successful return, the function updates \a vgpuUtilInfo->vgpuInstanceCount with the number of vGPU utilization sample structures that were actually written. This may differ from a previously read value as vGPU instances are created or destroyed. \a vgpuUtilInfo->lastSeenTimeStamp represents the CPU timestamp in microseconds at which utilization samples were last read. Set it to 0 to read utilization based on all the samples maintained by the driver's internal sample buffer. Set \a vgpuUtilInfo->lastSeenTimeStamp to a timeStamp retrieved from a previous query to read utilization since the previous query. @param device The identifier for the target device @param vgpuUtilInfo Pointer to the caller-provided structure of nvmlVgpuInstancesUtilizationInfo_t @return - \ref NVML_SUCCESS If utilization samples are successfully retrieved - \ref NVML_ERROR_UNINITIALIZED If the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a device is invalid, \a vgpuUtilInfo is NULL, or \a vgpuUtilInfo->vgpuInstanceCount is 0 - \ref NVML_ERROR_NOT_SUPPORTED If vGPU is not supported by the device - \ref NVML_ERROR_GPU_IS_LOST If the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH If the version of \a vgpuUtilInfo is invalid - \ref NVML_ERROR_INSUFFICIENT_SIZE If \a vgpuUtilInfo->vgpuUtilArray is NULL, or the buffer size of vgpuUtilInfo->vgpuInstanceCount is too small. The caller should check the current vGPU instance count from the returned vgpuUtilInfo->vgpuInstanceCount, and call the function again with a buffer of size vgpuUtilInfo->vgpuInstanceCount * sizeof(nvmlVgpuInstanceUtilizationInfo_t) - \ref NVML_ERROR_NOT_FOUND If sample entries are not found - \ref NVML_ERROR_UNKNOWN On any unexpected error*/ fn nvmlDeviceGetVgpuInstancesUtilizationInfo( device: cuda_types::nvml::nvmlDevice_t, vgpuUtilInfo: *mut cuda_types::nvml::nvmlVgpuInstancesUtilizationInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves current utilization for processes running on vGPUs on a physical GPU (device). For Maxwell &tm; or newer fully supported devices. Reads recent utilization of GPU SM (3D/Compute), framebuffer, video encoder, and video decoder for processes running on vGPU instances active on a device. Utilization values are returned as an array of utilization sample structures in the caller-supplied buffer pointed at by \a utilizationSamples. One utilization sample structure is returned per process running on vGPU instances, that had some non-zero utilization during the last sample period. It includes the CPU timestamp at which the samples were recorded. Individual utilization values are returned as "unsigned int" values. To read utilization values, first determine the size of buffer required to hold the samples by invoking the function with \a utilizationSamples set to NULL. The function will return NVML_ERROR_INSUFFICIENT_SIZE, with the current vGPU instance count in \a vgpuProcessSamplesCount. The caller should allocate a buffer of size vgpuProcessSamplesCount * sizeof(nvmlVgpuProcessUtilizationSample_t). Invoke the function again with the allocated buffer passed in \a utilizationSamples, and \a vgpuProcessSamplesCount set to the number of entries the buffer is sized for. On successful return, the function updates \a vgpuSubProcessSampleCount with the number of vGPU sub process utilization sample structures that were actually written. This may differ from a previously read value depending on the number of processes that are active in any given sample period. lastSeenTimeStamp represents the CPU timestamp in microseconds at which utilization samples were last read. Set it to 0 to read utilization based on all the samples maintained by the driver's internal sample buffer. Set lastSeenTimeStamp to a timeStamp retrieved from a previous query to read utilization since the previous query. @param device The identifier for the target device @param lastSeenTimeStamp Return only samples with timestamp greater than lastSeenTimeStamp. @param vgpuProcessSamplesCount Pointer to caller-supplied array size, and returns number of processes running on vGPU instances @param utilizationSamples Pointer to caller-supplied buffer in which vGPU sub process utilization samples are returned @return - \ref NVML_SUCCESS if utilization samples are successfully retrieved - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a vgpuProcessSamplesCount or a sample count of 0 is passed with a non-NULL \a utilizationSamples - \ref NVML_ERROR_INSUFFICIENT_SIZE if supplied \a vgpuProcessSamplesCount is too small to return samples for all vGPU instances currently executing on the device - \ref NVML_ERROR_NOT_SUPPORTED if vGPU is not supported by the device - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_NOT_FOUND if sample entries are not found - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetVgpuProcessUtilization( device: cuda_types::nvml::nvmlDevice_t, lastSeenTimeStamp: ::core::ffi::c_ulonglong, vgpuProcessSamplesCount: *mut ::core::ffi::c_uint, utilizationSamples: *mut cuda_types::nvml::nvmlVgpuProcessUtilizationSample_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves recent utilization for processes running on vGPU instances on a physical GPU (device). For Maxwell &tm; or newer fully supported devices. Reads recent utilization of GPU SM (3D/Compute), framebuffer, video encoder, video decoder, jpeg decoder, and OFA for processes running on vGPU instances active on a device. Utilization values are returned as an array of utilization sample structures in the caller-supplied buffer pointed at by \a vgpuProcUtilInfo->vgpuProcUtilArray. One utilization sample structure is returned per process running on vGPU instances, that had some non-zero utilization during the last sample period. It includes the CPU timestamp at which the samples were recorded. Individual utilization values are returned as "unsigned int" values. To read utilization values, first determine the size of buffer required to hold the samples by invoking the function with \a vgpuProcUtilInfo->vgpuProcUtilArray set to NULL. The function will return NVML_ERROR_INSUFFICIENT_SIZE, with the current processes' count running on vGPU instances in \a vgpuProcUtilInfo->vgpuProcessCount. The caller should allocate a buffer of size vgpuProcUtilInfo->vgpuProcessCount * sizeof(nvmlVgpuProcessUtilizationSample_t). Invoke the function again with the allocated buffer passed in \a vgpuProcUtilInfo->vgpuProcUtilArray, and \a vgpuProcUtilInfo->vgpuProcessCount set to the number of entries the buffer is sized for. On successful return, the function updates \a vgpuProcUtilInfo->vgpuProcessCount with the number of vGPU sub process utilization sample structures that were actually written. This may differ from a previously read value depending on the number of processes that are active in any given sample period. vgpuProcUtilInfo->lastSeenTimeStamp represents the CPU timestamp in microseconds at which utilization samples were last read. Set it to 0 to read utilization based on all the samples maintained by the driver's internal sample buffer. Set vgpuProcUtilInfo->lastSeenTimeStamp to a timeStamp retrieved from a previous query to read utilization since the previous query. @param device The identifier for the target device @param vgpuProcUtilInfo Pointer to the caller-provided structure of nvmlVgpuProcessesUtilizationInfo_t @return - \ref NVML_SUCCESS If utilization samples are successfully retrieved - \ref NVML_ERROR_UNINITIALIZED If the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a device is invalid, or \a vgpuProcUtilInfo is null - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH If the version of \a vgpuProcUtilInfo is invalid - \ref NVML_ERROR_INSUFFICIENT_SIZE If \a vgpuProcUtilInfo->vgpuProcUtilArray is null, or supplied \a vgpuProcUtilInfo->vgpuProcessCount is too small to return samples for all processes on vGPU instances currently executing on the device. The caller should check the current processes count from the returned \a vgpuProcUtilInfo->vgpuProcessCount, and call the function again with a buffer of size vgpuProcUtilInfo->vgpuProcessCount * sizeof(nvmlVgpuProcessUtilizationSample_t) - \ref NVML_ERROR_NOT_SUPPORTED If vGPU is not supported by the device - \ref NVML_ERROR_GPU_IS_LOST If the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_NOT_FOUND If sample entries are not found - \ref NVML_ERROR_UNKNOWN On any unexpected error*/ fn nvmlDeviceGetVgpuProcessesUtilizationInfo( device: cuda_types::nvml::nvmlDevice_t, vgpuProcUtilInfo: *mut cuda_types::nvml::nvmlVgpuProcessesUtilizationInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Queries the state of per process accounting mode on vGPU. For Maxwell &tm; or newer fully supported devices. @param vgpuInstance The identifier of the target vGPU instance @param mode Reference in which to return the current accounting mode @return - \ref NVML_SUCCESS if the mode has been successfully retrieved - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a mode is NULL - \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system - \ref NVML_ERROR_NOT_SUPPORTED if the vGPU doesn't support this feature - \ref NVML_ERROR_DRIVER_NOT_LOADED if NVIDIA driver is not running on the vGPU instance - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlVgpuInstanceGetAccountingMode( vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t, mode: *mut cuda_types::nvml::nvmlEnableState_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Queries list of processes running on vGPU that can be queried for accounting stats. The list of processes returned can be in running or terminated state. For Maxwell &tm; or newer fully supported devices. To just query the maximum number of processes that can be queried, call this function with *count = 0 and pids=NULL. The return code will be NVML_ERROR_INSUFFICIENT_SIZE, or NVML_SUCCESS if list is empty. For more details see \ref nvmlVgpuInstanceGetAccountingStats. @note In case of PID collision some processes might not be accessible before the circular buffer is full. @param vgpuInstance The identifier of the target vGPU instance @param count Reference in which to provide the \a pids array size, and to return the number of elements ready to be queried @param pids Reference in which to return list of process ids @return - \ref NVML_SUCCESS if pids were successfully retrieved - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a count is NULL - \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system - \ref NVML_ERROR_NOT_SUPPORTED if the vGPU doesn't support this feature or accounting mode is disabled - \ref NVML_ERROR_INSUFFICIENT_SIZE if \a count is too small (\a count is set to expected value) - \ref NVML_ERROR_UNKNOWN on any unexpected error @see nvmlVgpuInstanceGetAccountingPids*/ fn nvmlVgpuInstanceGetAccountingPids( vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t, count: *mut ::core::ffi::c_uint, pids: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Queries process's accounting stats. For Maxwell &tm; or newer fully supported devices. Accounting stats capture GPU utilization and other statistics across the lifetime of a process, and can be queried during life time of the process or after its termination. The time field in \ref nvmlAccountingStats_t is reported as 0 during the lifetime of the process and updated to actual running time after its termination. Accounting stats are kept in a circular buffer, newly created processes overwrite information about old processes. See \ref nvmlAccountingStats_t for description of each returned metric. List of processes that can be queried can be retrieved from \ref nvmlVgpuInstanceGetAccountingPids. @note Accounting Mode needs to be on. See \ref nvmlVgpuInstanceGetAccountingMode. @note Only compute and graphics applications stats can be queried. Monitoring applications stats can't be queried since they don't contribute to GPU utilization. @note In case of pid collision stats of only the latest process (that terminated last) will be reported @param vgpuInstance The identifier of the target vGPU instance @param pid Process Id of the target process to query stats for @param stats Reference in which to return the process's accounting stats @return - \ref NVML_SUCCESS if stats have been successfully retrieved - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a stats is NULL - \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system or \a stats is not found - \ref NVML_ERROR_NOT_SUPPORTED if the vGPU doesn't support this feature or accounting mode is disabled - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlVgpuInstanceGetAccountingStats( vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t, pid: ::core::ffi::c_uint, stats: *mut cuda_types::nvml::nvmlAccountingStats_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Clears accounting information of the vGPU instance that have already terminated. For Maxwell &tm; or newer fully supported devices. Requires root/admin permissions. @note Accounting Mode needs to be on. See \ref nvmlVgpuInstanceGetAccountingMode. @note Only compute and graphics applications stats are reported and can be cleared since monitoring applications stats don't contribute to GPU utilization. @param vgpuInstance The identifier of the target vGPU instance @return - \ref NVML_SUCCESS if accounting information has been cleared - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is invalid - \ref NVML_ERROR_NO_PERMISSION if the user doesn't have permission to perform this operation - \ref NVML_ERROR_NOT_SUPPORTED if the vGPU doesn't support this feature or accounting mode is disabled - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlVgpuInstanceClearAccountingPids( vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Query the license information of the vGPU instance. For Maxwell &tm; or newer fully supported devices. @param vgpuInstance Identifier of the target vGPU instance @param licenseInfo Pointer to vGPU license information structure @return - \ref NVML_SUCCESS if information is successfully retrieved - \ref NVML_ERROR_INVALID_ARGUMENT if \a vgpuInstance is 0, or \a licenseInfo is NULL - \ref NVML_ERROR_NOT_FOUND if \a vgpuInstance does not match a valid active vGPU instance on the system - \ref NVML_ERROR_DRIVER_NOT_LOADED if NVIDIA driver is not running on the vGPU instance - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlVgpuInstanceGetLicenseInfo_v2( vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t, licenseInfo: *mut cuda_types::nvml::nvmlVgpuLicenseInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the number of excluded GPU devices in the system. For all products. @param deviceCount Reference in which to return the number of excluded devices @return - \ref NVML_SUCCESS if \a deviceCount has been set - \ref NVML_ERROR_INVALID_ARGUMENT if \a deviceCount is NULL*/ fn nvmlGetExcludedDeviceCount( deviceCount: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Acquire the device information for an excluded GPU device, based on its index. For all products. Valid indices are derived from the \a deviceCount returned by \ref nvmlGetExcludedDeviceCount(). For example, if \a deviceCount is 2 the valid indices are 0 and 1, corresponding to GPU 0 and GPU 1. @param index The index of the target GPU, >= 0 and < \a deviceCount @param info Reference in which to return the device information @return - \ref NVML_SUCCESS if \a device has been set - \ref NVML_ERROR_INVALID_ARGUMENT if \a index is invalid or \a info is NULL @see nvmlGetExcludedDeviceCount*/ fn nvmlGetExcludedDeviceInfoByIndex( index: ::core::ffi::c_uint, info: *mut cuda_types::nvml::nvmlExcludedDeviceInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Read or write a GPU PRM register. The input is assumed to be in TLV format in network byte order. For Blackwell &tm; or newer fully supported devices. Supported on Linux only. @param device Identifer of target GPU device @param buffer Structure holding the input data in TLV format as well as the PRM register contents in TLV format (in the case of a successful read operation). Note: the input data and any returned data shall be in network byte order. @return - \ref NVML_SUCCESS on success - \ref NVML_ERROR_INVALID_ARGUMENT if \p device or \p buffer are invalid - \ref NVML_ERROR_NO_PERMISSION if user does not have permission to perform this operation - \ref NVML_ERROR_NOT_SUPPORTED if this feature is not supported by the device - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH if the version specified in \p buffer is not supported*/ fn nvmlDeviceReadWritePRM_v1( device: cuda_types::nvml::nvmlDevice_t, buffer: *mut cuda_types::nvml::nvmlPRMTLV_v1_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Set MIG mode for the device. For Ampere &tm; or newer fully supported devices. Requires root user. This mode determines whether a GPU instance can be created. This API may unbind or reset the device to activate the requested mode. Thus, the attributes associated with the device, such as minor number, might change. The caller of this API is expected to query such attributes again. On certain platforms like pass-through virtualization, where reset functionality may not be exposed directly, VM reboot is required. \a activationStatus would return \ref NVML_ERROR_RESET_REQUIRED for such cases. \a activationStatus would return the appropriate error code upon unsuccessful activation. For example, if device unbind fails because the device isn't idle, \ref NVML_ERROR_IN_USE would be returned. The caller of this API is expected to idle the device and retry setting the \a mode. @note On Windows, only disabling MIG mode is supported. \a activationStatus would return \ref NVML_ERROR_NOT_SUPPORTED as GPU reset is not supported on Windows through this API. @param device The identifier of the target device @param mode The mode to be set, \ref NVML_DEVICE_MIG_DISABLE or \ref NVML_DEVICE_MIG_ENABLE @param activationStatus The activationStatus status @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a device,\a mode or \a activationStatus are invalid - \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation - \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't support MIG mode*/ fn nvmlDeviceSetMigMode( device: cuda_types::nvml::nvmlDevice_t, mode: ::core::ffi::c_uint, activationStatus: *mut cuda_types::nvml::nvmlReturn_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get MIG mode for the device. For Ampere &tm; or newer fully supported devices. Changing MIG modes may require device unbind or reset. The "pending" MIG mode refers to the target mode following the next activation trigger. @param device The identifier of the target device @param currentMode Returns the current mode, \ref NVML_DEVICE_MIG_DISABLE or \ref NVML_DEVICE_MIG_ENABLE @param pendingMode Returns the pending mode, \ref NVML_DEVICE_MIG_DISABLE or \ref NVML_DEVICE_MIG_ENABLE @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a device, \a currentMode or \a pendingMode are invalid - \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't support MIG mode - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetMigMode( device: cuda_types::nvml::nvmlDevice_t, currentMode: *mut ::core::ffi::c_uint, pendingMode: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get GPU instance profile information Information provided by this API is immutable throughout the lifetime of a MIG mode. @note This API can be used to enumerate all MIG profiles supported by NVML in a forward compatible way by invoking it on \a profile values starting from 0, until the API returns \ref NVML_ERROR_INVALID_ARGUMENT. For Ampere &tm; or newer fully supported devices. Supported on Linux only. @param device The identifier of the target device @param profile One of the NVML_GPU_INSTANCE_PROFILE_* @param info Returns detailed profile information @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a device, \a profile or \a info are invalid - \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't support MIG or \a profile isn't supported - \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation*/ fn nvmlDeviceGetGpuInstanceProfileInfo( device: cuda_types::nvml::nvmlDevice_t, profile: ::core::ffi::c_uint, info: *mut cuda_types::nvml::nvmlGpuInstanceProfileInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Versioned wrapper around \ref nvmlDeviceGetGpuInstanceProfileInfo that accepts a versioned \ref nvmlGpuInstanceProfileInfo_v2_t or later output structure. @note The caller must set the \ref nvmlGpuInstanceProfileInfo_v2_t.version field to the appropriate version prior to calling this function. For example: \code nvmlGpuInstanceProfileInfo_v2_t profileInfo = { .version = nvmlGpuInstanceProfileInfo_v2 }; nvmlReturn_t result = nvmlDeviceGetGpuInstanceProfileInfoV(device, profile, &profileInfo); \endcode For Ampere &tm; or newer fully supported devices. Supported on Linux only. @param device The identifier of the target device @param profile One of the NVML_GPU_INSTANCE_PROFILE_* @param info Returns detailed profile information @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a device, \a profile, \a info, or \a info->version are invalid - \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't have MIG mode enabled or \a profile isn't supported - \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation*/ fn nvmlDeviceGetGpuInstanceProfileInfoV( device: cuda_types::nvml::nvmlDevice_t, profile: ::core::ffi::c_uint, info: *mut cuda_types::nvml::nvmlGpuInstanceProfileInfo_v2_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** GPU instance profile query function that accepts profile ID, instead of profile name. It accepts a versioned \ref nvmlGpuInstanceProfileInfo_v2_t or later output structure. @note The caller must set the \ref nvmlGpuInstanceProfileInfo_v2_t.version field to the appropriate version prior to calling this function. For example: \code nvmlGpuInstanceProfileInfo_v2_t profileInfo = { .version = nvmlGpuInstanceProfileInfo_v2 }; nvmlReturn_t result = nvmlDeviceGetGpuInstanceProfileInfoV(device, profile, &profileInfo); \endcode For Ampere &tm; or newer fully supported devices. Supported on Linux only. @param device The identifier of the target device @param profileId One of the profile IDs. @param info Returns detailed profile information @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a device, \a profileId, \a info, or \a info->version are invalid - \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't have MIG mode enabled or \a profile isn't supported - \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation*/ fn nvmlDeviceGetGpuInstanceProfileInfoByIdV( device: cuda_types::nvml::nvmlDevice_t, profileId: ::core::ffi::c_uint, info: *mut cuda_types::nvml::nvmlGpuInstanceProfileInfo_v2_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get GPU instance placements. A placement represents the location of a GPU instance within a device. This API only returns all the possible placements for the given profile regardless of whether MIG is enabled or not. A created GPU instance occupies memory slices described by its placement. Creation of new GPU instance will fail if there is overlap with the already occupied memory slices. For Ampere &tm; or newer fully supported devices. Supported on Linux only. Requires privileged user. @param device The identifier of the target device @param profileId The GPU instance profile ID. See \ref nvmlDeviceGetGpuInstanceProfileInfo @param placements Returns placements allowed for the profile. Can be NULL to discover number of allowed placements for this profile. If non-NULL must be large enough to accommodate the placements supported by the profile. @param count Returns number of allowed placemenets for the profile. @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a device, \a profileId or \a count are invalid - \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't support MIG or \a profileId isn't supported - \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation*/ fn nvmlDeviceGetGpuInstancePossiblePlacements_v2( device: cuda_types::nvml::nvmlDevice_t, profileId: ::core::ffi::c_uint, placements: *mut cuda_types::nvml::nvmlGpuInstancePlacement_t, count: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get GPU instance profile capacity. For Ampere &tm; or newer fully supported devices. Supported on Linux only. Requires privileged user. @param device The identifier of the target device @param profileId The GPU instance profile ID. See \ref nvmlDeviceGetGpuInstanceProfileInfo @param count Returns remaining instance count for the profile ID @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a device, \a profileId or \a count are invalid - \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't have MIG mode enabled or \a profileId isn't supported - \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation*/ fn nvmlDeviceGetGpuInstanceRemainingCapacity( device: cuda_types::nvml::nvmlDevice_t, profileId: ::core::ffi::c_uint, count: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Create GPU instance. For Ampere &tm; or newer fully supported devices. Supported on Linux only. Requires privileged user. If the parent device is unbound, reset or the GPU instance is destroyed explicitly, the GPU instance handle would become invalid. The GPU instance must be recreated to acquire a valid handle. @param device The identifier of the target device @param profileId The GPU instance profile ID. See \ref nvmlDeviceGetGpuInstanceProfileInfo @param gpuInstance Returns the GPU instance handle @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a device, \a profile, \a profileId or \a gpuInstance are invalid - \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't have MIG mode enabled or in vGPU guest - \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation - \ref NVML_ERROR_INSUFFICIENT_RESOURCES If the requested GPU instance could not be created*/ fn nvmlDeviceCreateGpuInstance( device: cuda_types::nvml::nvmlDevice_t, profileId: ::core::ffi::c_uint, gpuInstance: *mut cuda_types::nvml::nvmlGpuInstance_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Create GPU instance with the specified placement. For Ampere &tm; or newer fully supported devices. Supported on Linux only. Requires privileged user. If the parent device is unbound, reset or the GPU instance is destroyed explicitly, the GPU instance handle would become invalid. The GPU instance must be recreated to acquire a valid handle. @param device The identifier of the target device @param profileId The GPU instance profile ID. See \ref nvmlDeviceGetGpuInstanceProfileInfo @param placement The requested placement. See \ref nvmlDeviceGetGpuInstancePossiblePlacements_v2 @param gpuInstance Returns the GPU instance handle @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a device, \a profile, \a profileId, \a placement or \a gpuInstance are invalid - \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't have MIG mode enabled or in vGPU guest - \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation - \ref NVML_ERROR_INSUFFICIENT_RESOURCES If the requested GPU instance could not be created*/ fn nvmlDeviceCreateGpuInstanceWithPlacement( device: cuda_types::nvml::nvmlDevice_t, profileId: ::core::ffi::c_uint, placement: *const cuda_types::nvml::nvmlGpuInstancePlacement_t, gpuInstance: *mut cuda_types::nvml::nvmlGpuInstance_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Destroy GPU instance. For Ampere &tm; or newer fully supported devices. Supported on Linux only. Requires privileged user. @param gpuInstance The GPU instance handle @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a gpuInstance is invalid - \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't have MIG mode enabled or in vGPU guest - \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation - \ref NVML_ERROR_IN_USE If the GPU instance is in use. This error would be returned if processes (e.g. CUDA application) or compute instances are active on the GPU instance.*/ fn nvmlGpuInstanceDestroy( gpuInstance: cuda_types::nvml::nvmlGpuInstance_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get GPU instances for given profile ID. For Ampere &tm; or newer fully supported devices. Supported on Linux only. Requires privileged user. @param device The identifier of the target device @param profileId The GPU instance profile ID. See \ref nvmlDeviceGetGpuInstanceProfileInfo @param gpuInstances Returns pre-exiting GPU instances, the buffer must be large enough to accommodate the instances supported by the profile. See \ref nvmlDeviceGetGpuInstanceProfileInfo @param count The count of returned GPU instances @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a device, \a profileId, \a gpuInstances or \a count are invalid - \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't have MIG mode enabled - \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation*/ fn nvmlDeviceGetGpuInstances( device: cuda_types::nvml::nvmlDevice_t, profileId: ::core::ffi::c_uint, gpuInstances: *mut cuda_types::nvml::nvmlGpuInstance_t, count: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get GPU instances for given instance ID. For Ampere &tm; or newer fully supported devices. Supported on Linux only. Requires privileged user. @param device The identifier of the target device @param id The GPU instance ID @param gpuInstance Returns GPU instance @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a device, \a id or \a gpuInstance are invalid - \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't have MIG mode enabled - \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation - \ref NVML_ERROR_NOT_FOUND If the GPU instance is not found.*/ fn nvmlDeviceGetGpuInstanceById( device: cuda_types::nvml::nvmlDevice_t, id: ::core::ffi::c_uint, gpuInstance: *mut cuda_types::nvml::nvmlGpuInstance_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get GPU instance information. For Ampere &tm; or newer fully supported devices. Supported on Linux only. @param gpuInstance The GPU instance handle @param info Return GPU instance information @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a gpuInstance or \a info are invalid - \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation*/ fn nvmlGpuInstanceGetInfo( gpuInstance: cuda_types::nvml::nvmlGpuInstance_t, info: *mut cuda_types::nvml::nvmlGpuInstanceInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get compute instance profile information. Information provided by this API is immutable throughout the lifetime of a MIG mode. @note This API can be used to enumerate all MIG profiles supported by NVML in a forward compatible way by invoking it on \a profile values starting from 0, until the API returns \ref NVML_ERROR_INVALID_ARGUMENT. For Ampere &tm; or newer fully supported devices. Supported on Linux only. @param gpuInstance The identifier of the target GPU instance @param profile One of the NVML_COMPUTE_INSTANCE_PROFILE_* @param engProfile One of the NVML_COMPUTE_INSTANCE_ENGINE_PROFILE_* @param info Returns detailed profile information @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a gpuInstance, \a profile, \a engProfile or \a info are invalid - \ref NVML_ERROR_NOT_SUPPORTED If \a profile isn't supported - \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation*/ fn nvmlGpuInstanceGetComputeInstanceProfileInfo( gpuInstance: cuda_types::nvml::nvmlGpuInstance_t, profile: ::core::ffi::c_uint, engProfile: ::core::ffi::c_uint, info: *mut cuda_types::nvml::nvmlComputeInstanceProfileInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Versioned wrapper around \ref nvmlGpuInstanceGetComputeInstanceProfileInfo that accepts a versioned \ref nvmlComputeInstanceProfileInfo_v2_t or later output structure. @note The caller must set the \ref nvmlGpuInstanceProfileInfo_v2_t.version field to the appropriate version prior to calling this function. For example: \code nvmlComputeInstanceProfileInfo_v2_t profileInfo = { .version = nvmlComputeInstanceProfileInfo_v2 }; nvmlReturn_t result = nvmlGpuInstanceGetComputeInstanceProfileInfoV(gpuInstance, profile, engProfile, &profileInfo); \endcode For Ampere &tm; or newer fully supported devices. Supported on Linux only. @param gpuInstance The identifier of the target GPU instance @param profile One of the NVML_COMPUTE_INSTANCE_PROFILE_* @param engProfile One of the NVML_COMPUTE_INSTANCE_ENGINE_PROFILE_* @param info Returns detailed profile information @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a gpuInstance, \a profile, \a engProfile, \a info, or \a info->version are invalid - \ref NVML_ERROR_NOT_SUPPORTED If \a profile isn't supported - \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation*/ fn nvmlGpuInstanceGetComputeInstanceProfileInfoV( gpuInstance: cuda_types::nvml::nvmlGpuInstance_t, profile: ::core::ffi::c_uint, engProfile: ::core::ffi::c_uint, info: *mut cuda_types::nvml::nvmlComputeInstanceProfileInfo_v2_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get compute instance profile capacity. For Ampere &tm; or newer fully supported devices. Supported on Linux only. Requires privileged user. @param gpuInstance The identifier of the target GPU instance @param profileId The compute instance profile ID. See \ref nvmlGpuInstanceGetComputeInstanceProfileInfo @param count Returns remaining instance count for the profile ID @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a gpuInstance, \a profileId or \a availableCount are invalid - \ref NVML_ERROR_NOT_SUPPORTED If \a profileId isn't supported - \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation*/ fn nvmlGpuInstanceGetComputeInstanceRemainingCapacity( gpuInstance: cuda_types::nvml::nvmlGpuInstance_t, profileId: ::core::ffi::c_uint, count: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get compute instance placements. For Ampere &tm; or newer fully supported devices. Supported on Linux only. Requires privileged user. A placement represents the location of a compute instance within a GPU instance. This API only returns all the possible placements for the given profile. A created compute instance occupies compute slices described by its placement. Creation of new compute instance will fail if there is overlap with the already occupied compute slices. @param gpuInstance The identifier of the target GPU instance @param profileId The compute instance profile ID. See \ref nvmlGpuInstanceGetComputeInstanceProfileInfo @param placements Returns placements allowed for the profile. Can be NULL to discover number of allowed placements for this profile. If non-NULL must be large enough to accommodate the placements supported by the profile. @param count Returns number of allowed placemenets for the profile. @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a gpuInstance, \a profileId or \a count are invalid - \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't have MIG mode enabled or \a profileId isn't supported - \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation*/ fn nvmlGpuInstanceGetComputeInstancePossiblePlacements( gpuInstance: cuda_types::nvml::nvmlGpuInstance_t, profileId: ::core::ffi::c_uint, placements: *mut cuda_types::nvml::nvmlComputeInstancePlacement_t, count: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Create compute instance. For Ampere &tm; or newer fully supported devices. Supported on Linux only. Requires privileged user. If the parent device is unbound, reset or the parent GPU instance is destroyed or the compute instance is destroyed explicitly, the compute instance handle would become invalid. The compute instance must be recreated to acquire a valid handle. @param gpuInstance The identifier of the target GPU instance @param profileId The compute instance profile ID. See \ref nvmlGpuInstanceGetComputeInstanceProfileInfo @param computeInstance Returns the compute instance handle @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a gpuInstance, \a profile, \a profileId or \a computeInstance are invalid - \ref NVML_ERROR_NOT_SUPPORTED If \a profileId isn't supported - \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation - \ref NVML_ERROR_INSUFFICIENT_RESOURCES If the requested compute instance could not be created*/ fn nvmlGpuInstanceCreateComputeInstance( gpuInstance: cuda_types::nvml::nvmlGpuInstance_t, profileId: ::core::ffi::c_uint, computeInstance: *mut cuda_types::nvml::nvmlComputeInstance_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Create compute instance with the specified placement. For Ampere &tm; or newer fully supported devices. Supported on Linux only. Requires privileged user. If the parent device is unbound, reset or the parent GPU instance is destroyed or the compute instance is destroyed explicitly, the compute instance handle would become invalid. The compute instance must be recreated to acquire a valid handle. @param gpuInstance The identifier of the target GPU instance @param profileId The compute instance profile ID. See \ref nvmlGpuInstanceGetComputeInstanceProfileInfo @param placement The requested placement. See \ref nvmlGpuInstanceGetComputeInstancePossiblePlacements @param computeInstance Returns the compute instance handle @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a gpuInstance, \a profile, \a profileId or \a computeInstance are invalid - \ref NVML_ERROR_NOT_SUPPORTED If \a profileId isn't supported - \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation - \ref NVML_ERROR_INSUFFICIENT_RESOURCES If the requested compute instance could not be created*/ fn nvmlGpuInstanceCreateComputeInstanceWithPlacement( gpuInstance: cuda_types::nvml::nvmlGpuInstance_t, profileId: ::core::ffi::c_uint, placement: *const cuda_types::nvml::nvmlComputeInstancePlacement_t, computeInstance: *mut cuda_types::nvml::nvmlComputeInstance_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Destroy compute instance. For Ampere &tm; or newer fully supported devices. Supported on Linux only. Requires privileged user. @param computeInstance The compute instance handle @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a computeInstance is invalid - \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation - \ref NVML_ERROR_IN_USE If the compute instance is in use. This error would be returned if processes (e.g. CUDA application) are active on the compute instance.*/ fn nvmlComputeInstanceDestroy( computeInstance: cuda_types::nvml::nvmlComputeInstance_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get compute instances for given profile ID. For Ampere &tm; or newer fully supported devices. Supported on Linux only. Requires privileged user. @param gpuInstance The identifier of the target GPU instance @param profileId The compute instance profile ID. See \ref nvmlGpuInstanceGetComputeInstanceProfileInfo @param computeInstances Returns pre-exiting compute instances, the buffer must be large enough to accommodate the instances supported by the profile. See \ref nvmlGpuInstanceGetComputeInstanceProfileInfo @param count The count of returned compute instances @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a gpuInstance, \a profileId, \a computeInstances or \a count are invalid - \ref NVML_ERROR_NOT_SUPPORTED If \a profileId isn't supported - \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation*/ fn nvmlGpuInstanceGetComputeInstances( gpuInstance: cuda_types::nvml::nvmlGpuInstance_t, profileId: ::core::ffi::c_uint, computeInstances: *mut cuda_types::nvml::nvmlComputeInstance_t, count: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get compute instance for given instance ID. For Ampere &tm; or newer fully supported devices. Supported on Linux only. Requires privileged user. @param gpuInstance The identifier of the target GPU instance @param id The compute instance ID @param computeInstance Returns compute instance @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a device, \a ID or \a computeInstance are invalid - \ref NVML_ERROR_NOT_SUPPORTED If \a device doesn't have MIG mode enabled - \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation - \ref NVML_ERROR_NOT_FOUND If the compute instance is not found.*/ fn nvmlGpuInstanceGetComputeInstanceById( gpuInstance: cuda_types::nvml::nvmlGpuInstance_t, id: ::core::ffi::c_uint, computeInstance: *mut cuda_types::nvml::nvmlComputeInstance_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get compute instance information. For Ampere &tm; or newer fully supported devices. Supported on Linux only. @param computeInstance The compute instance handle @param info Return compute instance information @return - \ref NVML_SUCCESS Upon success - \ref NVML_ERROR_UNINITIALIZED If library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a computeInstance or \a info are invalid - \ref NVML_ERROR_NO_PERMISSION If user doesn't have permission to perform the operation*/ fn nvmlComputeInstanceGetInfo_v2( computeInstance: cuda_types::nvml::nvmlComputeInstance_t, info: *mut cuda_types::nvml::nvmlComputeInstanceInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Test if the given handle refers to a MIG device. A MIG device handle is an NVML abstraction which maps to a MIG compute instance. These overloaded references can be used (with some restrictions) interchangeably with a GPU device handle to execute queries at a per-compute instance granularity. For Ampere &tm; or newer fully supported devices. Supported on Linux only. @param device NVML handle to test @param isMigDevice True when handle refers to a MIG device @return - \ref NVML_SUCCESS if \a device status was successfully retrieved - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device handle or \a isMigDevice reference is invalid - \ref NVML_ERROR_NOT_SUPPORTED if this check is not supported by the device - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceIsMigDeviceHandle( device: cuda_types::nvml::nvmlDevice_t, isMigDevice: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get GPU instance ID for the given MIG device handle. GPU instance IDs are unique per device and remain valid until the GPU instance is destroyed. For Ampere &tm; or newer fully supported devices. Supported on Linux only. @param device Target MIG device handle @param id GPU instance ID @return - \ref NVML_SUCCESS if instance ID was successfully retrieved - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device or \a id reference is invalid - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetGpuInstanceId( device: cuda_types::nvml::nvmlDevice_t, id: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get compute instance ID for the given MIG device handle. Compute instance IDs are unique per GPU instance and remain valid until the compute instance is destroyed. For Ampere &tm; or newer fully supported devices. Supported on Linux only. @param device Target MIG device handle @param id Compute instance ID @return - \ref NVML_SUCCESS if instance ID was successfully retrieved - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device or \a id reference is invalid - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetComputeInstanceId( device: cuda_types::nvml::nvmlDevice_t, id: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get the maximum number of MIG devices that can exist under a given parent NVML device. Returns zero if MIG is not supported or enabled. For Ampere &tm; or newer fully supported devices. Supported on Linux only. @param device Target device handle @param count Count of MIG devices @return - \ref NVML_SUCCESS if \a count was successfully retrieved - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device or \a count reference is invalid - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetMaxMigDeviceCount( device: cuda_types::nvml::nvmlDevice_t, count: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get MIG device handle for the given index under its parent NVML device. If the compute instance is destroyed either explicitly or by destroying, resetting or unbinding the parent GPU instance or the GPU device itself the MIG device handle would remain invalid and must be requested again using this API. Handles may be reused and their properties can change in the process. For Ampere &tm; or newer fully supported devices. Supported on Linux only. @param device Reference to the parent GPU device handle @param index Index of the MIG device @param migDevice Reference to the MIG device handle @return - \ref NVML_SUCCESS if \a migDevice handle was successfully created - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device, \a index or \a migDevice reference is invalid - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device - \ref NVML_ERROR_NOT_FOUND if no valid MIG device was found at \a index - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetMigDeviceHandleByIndex( device: cuda_types::nvml::nvmlDevice_t, index: ::core::ffi::c_uint, migDevice: *mut cuda_types::nvml::nvmlDevice_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get parent device handle from a MIG device handle. For Ampere &tm; or newer fully supported devices. Supported on Linux only. @param migDevice MIG device handle @param device Device handle @return - \ref NVML_SUCCESS if \a device handle was successfully created - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a migDevice or \a device is invalid - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetDeviceHandleFromMigDeviceHandle( migDevice: cuda_types::nvml::nvmlDevice_t, device: *mut cuda_types::nvml::nvmlDevice_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Calculate GPM metrics from two samples. For Hopper &tm; or newer fully supported devices. To retrieve metrics, the user must first allocate the two sample buffers at \a metricsGet->sample1 and \a metricsGet->sample2 by calling \a nvmlGpmSampleAlloc(). Next, the user should fill in the ID of each metric in \a metricsGet->metrics[i].metricId and specify the total number of metrics to retrieve in \a metricsGet->numMetrics, The version should be set to NVML_GPM_METRICS_GET_VERSION in \a metricsGet->version. The user then calls the \a nvmlGpmSampleGet() API twice to obtain 2 samples of counters. @note The interval between these two \a nvmlGpmSampleGet() calls should be greater than 100ms due to the internal sample refresh rate. Finally, the user calls \a nvmlGpmMetricsGet to retrieve the metrics, which will be stored at \a metricsGet->metrics @param metricsGet IN/OUT: populated \a nvmlGpmMetricsGet_t struct @return - \ref NVML_SUCCESS on success - Nonzero NVML_ERROR_? enum on error*/ fn nvmlGpmMetricsGet( metricsGet: *mut cuda_types::nvml::nvmlGpmMetricsGet_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Free an allocated sample buffer that was allocated with \ref nvmlGpmSampleAlloc() For Hopper &tm; or newer fully supported devices. @param gpmSample Sample to free @return - \ref NVML_SUCCESS on success - \ref NVML_ERROR_INVALID_ARGUMENT if an invalid pointer is provided*/ fn nvmlGpmSampleFree( gpmSample: cuda_types::nvml::nvmlGpmSample_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Allocate a sample buffer to be used with NVML GPM . You will need to allocate at least two of these buffers to use with the NVML GPM feature For Hopper &tm; or newer fully supported devices. @param gpmSample Where the allocated sample will be stored @return - \ref NVML_SUCCESS on success - \ref NVML_ERROR_INVALID_ARGUMENT if an invalid pointer is provided - \ref NVML_ERROR_MEMORY if system memory is insufficient*/ fn nvmlGpmSampleAlloc( gpmSample: *mut cuda_types::nvml::nvmlGpmSample_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Read a sample of GPM metrics into the provided \a gpmSample buffer. After two samples are gathered, you can call nvmlGpmMetricGet on those samples to retrive metrics For Hopper &tm; or newer fully supported devices. @note The interval between two \a nvmlGpmSampleGet() calls should be greater than 100ms due to the internal sample refresh rate. @param device Device to get samples for @param gpmSample Buffer to read samples into @return - \ref NVML_SUCCESS on success - Nonzero NVML_ERROR_? enum on error*/ fn nvmlGpmSampleGet( device: cuda_types::nvml::nvmlDevice_t, gpmSample: cuda_types::nvml::nvmlGpmSample_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Read a sample of GPM metrics into the provided \a gpmSample buffer for a MIG GPU Instance. After two samples are gathered, you can call nvmlGpmMetricGet on those samples to retrive metrics For Hopper &tm; or newer fully supported devices. @note The interval between two \a nvmlGpmMigSampleGet() calls should be greater than 100ms due to the internal sample refresh rate. @param device Device to get samples for @param gpuInstanceId MIG GPU Instance ID @param gpmSample Buffer to read samples into @return - \ref NVML_SUCCESS on success - Nonzero NVML_ERROR_? enum on error*/ fn nvmlGpmMigSampleGet( device: cuda_types::nvml::nvmlDevice_t, gpuInstanceId: ::core::ffi::c_uint, gpmSample: cuda_types::nvml::nvmlGpmSample_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Indicate whether the supplied device supports GPM For Hopper &tm; or newer fully supported devices. @param device NVML device to query for @param gpmSupport Structure to indicate GPM support \a nvmlGpmSupport_t. Indicates GPM support per system for the supplied device @return - NVML_SUCCESS on success - Nonzero NVML_ERROR_? enum if there is an error in processing the query*/ fn nvmlGpmQueryDeviceSupport( device: cuda_types::nvml::nvmlDevice_t, gpmSupport: *mut cuda_types::nvml::nvmlGpmSupport_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get GPM stream state. For Hopper &tm; or newer fully supported devices. Supported on Linux, Windows TCC. @param device The identifier of the target device @param state Returns GPM stream state NVML_FEATURE_DISABLED or NVML_FEATURE_ENABLED @return - \ref NVML_SUCCESS if \a current GPM stream state were successfully queried - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid or \a state is NULL - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device*/ fn nvmlGpmQueryIfStreamingEnabled( device: cuda_types::nvml::nvmlDevice_t, state: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Set GPM stream state. For Hopper &tm; or newer fully supported devices. Supported on Linux, Windows TCC. @param device The identifier of the target device @param state GPM stream state, NVML_FEATURE_DISABLED or NVML_FEATURE_ENABLED @return - \ref NVML_SUCCESS if \a current GPM stream state is successfully set - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid - \ref NVML_ERROR_NOT_SUPPORTED if this query is not supported by the device*/ fn nvmlGpmSetStreamingEnabled( device: cuda_types::nvml::nvmlDevice_t, state: ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get device capabilities See \ref nvmlDeviceCapabilities_v1_t for more information on the struct. @param device The identifier of the target device @param caps Returns GPU's capabilities @return - \ref NVML_SUCCESS If the query is success - \ref NVML_ERROR_UNINITIALIZED If the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a device is invalid or \a counters is NULL - \ref NVML_ERROR_NOT_SUPPORTED If the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST If the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH If the provided version is invalid/unsupported - \ref NVML_ERROR_UNKNOWN On any unexpected error*/ fn nvmlDeviceGetCapabilities( device: cuda_types::nvml::nvmlDevice_t, caps: *mut cuda_types::nvml::nvmlDeviceCapabilities_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get Performance Profiles Information For Blackwell &tm; or newer fully supported devices. See \ref nvmlWorkloadPowerProfileProfilesInfo_v1_t for more information on the struct. The mask \a perfProfilesMask is bitmask of all supported mode indices where the mode is supported if the index is 1. Each supported mode will have a corresponding entry in the \a perfProfile array which will contain the \a profileId, the \a priority of this mode, where the lower the value, the higher the priority, and a \a conflictingMask, where each bit set in the mask corresponds to a different profile which cannot be used in conjunction with the given profile. @param device The identifier of the target device @param profilesInfo Reference to struct \a nvmlWorkloadPowerProfileProfilesInfo_t @return - \ref NVML_SUCCESS If the query is successful - \ref NVML_ERROR_INSUFFICIENT_SIZE If struct is fully allocated - \ref NVML_ERROR_UNINITIALIZED If the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a device is invalid or \a pointer to struct is NULL - \ref NVML_ERROR_NOT_SUPPORTED If the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST If the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH If the provided version is invalid/unsupported - \ref NVML_ERROR_UNKNOWN On any unexpected error*/ fn nvmlDeviceWorkloadPowerProfileGetProfilesInfo( device: cuda_types::nvml::nvmlDevice_t, profilesInfo: *mut cuda_types::nvml::nvmlWorkloadPowerProfileProfilesInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Get Current Performance Profiles For Blackwell &tm; or newer fully supported devices. See \ref nvmlWorkloadPowerProfileCurrentProfiles_v1_t for more information on the struct. This API returns a stuct which contains the current \a perfProfilesMask, \a requestedProfilesMask and \a enforcedProfilesMask. Each bit set in each bitmasks indicates the profile is supported, currently requested or currently engaged, respectively. @param device The identifier of the target device @param currentProfiles Reference to struct \a nvmlWorkloadPowerProfileCurrentProfiles_v1_t @return - \ref NVML_SUCCESS If the query is successful - \ref NVML_ERROR_UNINITIALIZED If the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a device is invalid or the pointer to struct is NULL - \ref NVML_ERROR_NOT_SUPPORTED If the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST If the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH If the provided version is invalid/unsupported - \ref NVML_ERROR_UNKNOWN On any unexpected error*/ fn nvmlDeviceWorkloadPowerProfileGetCurrentProfiles( device: cuda_types::nvml::nvmlDevice_t, currentProfiles: *mut cuda_types::nvml::nvmlWorkloadPowerProfileCurrentProfiles_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Set Requested Performance Profiles For Blackwell &tm; or newer fully supported devices. See \ref nvmlWorkloadPowerProfileRequestedProfiles_v1_t for more information on the struct. Reuqest one or more performance profiles be activated using the input bitmask \a requestedProfilesMask, where each bit set corresponds to a supported bit from the \a perfProfilesMask. These profiles will be added to existing list of currently requested profiles. Requires root/admin permissions. @param device The identifier of the target device @param requestedProfiles Reference to struct \a nvmlWorkloadPowerProfileRequestedProfiles_v1_t @return - \ref NVML_SUCCESS If the query is successful - \ref NVML_ERROR_UNINITIALIZED If the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a device is invalid or \a pointer to struct is NULL - \ref NVML_ERROR_NOT_SUPPORTED If the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST If the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH If the provided version is invalid/unsupported - \ref NVML_ERROR_UNKNOWN On any unexpected error*/ fn nvmlDeviceWorkloadPowerProfileSetRequestedProfiles( device: cuda_types::nvml::nvmlDevice_t, requestedProfiles: *mut cuda_types::nvml::nvmlWorkloadPowerProfileRequestedProfiles_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Clear Requested Performance Profiles For Blackwell &tm; or newer fully supported devices. See \ref nvmlWorkloadPowerProfileRequestedProfiles_v1_t for more information on the struct. Clear one or more performance profiles be using the input bitmask \a requestedProfilesMask, where each bit set corresponds to a supported bit from the \a perfProfilesMask. These profiles will be removed from the existing list of currently requested profiles. Requires root/admin permissions. @param device The identifier of the target device @param requestedProfiles Reference to struct \a nvmlWorkloadPowerProfileRequestedProfiles_v1_t @return - \ref NVML_SUCCESS If the query is successful - \ref NVML_ERROR_UNINITIALIZED If the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT If \a device is invalid or \a pointer to struct is NULL - \ref NVML_ERROR_NOT_SUPPORTED If the device does not support this feature - \ref NVML_ERROR_GPU_IS_LOST If the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH If the provided version is invalid/unsupported - \ref NVML_ERROR_UNKNOWN On any unexpected error*/ fn nvmlDeviceWorkloadPowerProfileClearRequestedProfiles( device: cuda_types::nvml::nvmlDevice_t, requestedProfiles: *mut cuda_types::nvml::nvmlWorkloadPowerProfileRequestedProfiles_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Activiate a specific preset profile for datacenter power smoothing. The API only sets the active preset profile based on the input profileId, and ignores the other parameters of the structure. Requires root/admin permissions. For Blackwell &tm; or newer fully supported devices. @param device The identifier of the target device @param profile Reference to \ref nvmlPowerSmoothingProfile_v1_t. Note that only \a profile->profileId is used and the rest of the structure is ignored. @return - \ref NVML_SUCCESS if the Desired Profile was successfully set - \ref NVML_ERROR_INVALID_ARGUMENT if device is invalid or structure was NULL - \ref NVML_ERROR_NO_PERMISSION if user does not have permission to change the profile number - \ref NVML_ERROR_NOT_SUPPORTED if this feature is not supported by the device */ fn nvmlDevicePowerSmoothingActivatePresetProfile( device: cuda_types::nvml::nvmlDevice_t, profile: *mut cuda_types::nvml::nvmlPowerSmoothingProfile_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Update the value of a specific profile parameter contained within \ref nvmlPowerSmoothingProfile_v1_t. Requires root/admin permissions. For Blackwell &tm; or newer fully supported devices. NVML_POWER_SMOOTHING_PROFILE_PARAM_PERCENT_TMP_FLOOR expects a value as a percentage from 00.00-100.00% NVML_POWER_SMOOTHING_PROFILE_PARAM_RAMP_UP_RATE expects a value in W/s NVML_POWER_SMOOTHING_PROFILE_PARAM_RAMP_DOWN_RATE expects a value in W/s NVML_POWER_SMOOTHING_PROFILE_PARAM_RAMP_DOWN_HYSTERESIS expects a value in ms @param device The identifier of the target device @param profile Reference to \ref nvmlPowerSmoothingProfile_v1_t struct @return - \ref NVML_SUCCESS if the Active Profile was successfully set - \ref NVML_ERROR_INVALID_ARGUMENT if device is invalid or profile parameter/value was invalid - \ref NVML_ERROR_NO_PERMISSION if user does not have permission to change any profile parameters - \ref NVML_ERROR_ARGUMENT_VERSION_MISMATCH if the structure version is not supported */ fn nvmlDevicePowerSmoothingUpdatePresetProfileParam( device: cuda_types::nvml::nvmlDevice_t, profile: *mut cuda_types::nvml::nvmlPowerSmoothingProfile_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Enable or disable the Power Smoothing Feature. Requires root/admin permissions. For Blackwell &tm; or newer fully supported devices. See \ref nvmlEnableState_t for details on allowed states @param device The identifier of the target device @param state Reference to \ref nvmlPowerSmoothingState_v1_t @return - \ref NVML_SUCCESS if the feature state was successfully set - \ref NVML_ERROR_INVALID_ARGUMENT if device is invalid or state is NULL - \ref NVML_ERROR_NO_PERMISSION if user does not have permission to change feature state - \ref NVML_ERROR_NOT_SUPPORTED if this feature is not supported by the device */ fn nvmlDevicePowerSmoothingSetState( device: cuda_types::nvml::nvmlDevice_t, state: *mut cuda_types::nvml::nvmlPowerSmoothingState_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] /** Retrieves the counts of SRAM unique uncorrected ECC errors For Blackwell &tm; or newer fully supported devices. Reads SRAM unique uncorrected ECC error counts. The total number of unique errors is returned by \a errorCounts->entryCount. Error counts are returned as an array of in the caller-supplied buffer pointed at by \a errorCounts->entries. Each error count entry holds the location/address of the unique error, the error count and whether the error is parity or not. To read SRAM unique uncorrected ECC error counts, first determine the size of buffer required to hold the error counts by invoking the function with \a errorCounts->entries set to NULL. The required array size is returned in \a errorCounts->entryCount. The caller should allocate a buffer of size "errorCounts->entryCount * sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_t)". Invoke the function again with the allocated buffer passed in \a errorCounts->entries. This time \a errorCounts->entryCount will be taken as the entry array size that caller allocates for \a errorCounts->entries. On successful return of the second query, the function updates \a errorCounts->entries with all unique errors. This may fail if \a errorCounts->entryCount is smaller than the actual number of unique errors. This can happen in cases like new errors occur since the previous query of \a errorCounts->entryCount. No matter the query succeeds or not, the latest number of unique errors will be returned in \a errorCounts->entryCount. @note The query is only supported when ECC mode is enabled. @param device The identifier of the target device @param errorCounts Pointer to caller-supplied array which returns the unique error count entries @return - \ref NVML_SUCCESS if \a utilization has been populated - \ref NVML_ERROR_UNINITIALIZED if the library has not been successfully initialized - \ref NVML_ERROR_INVALID_ARGUMENT if \a device is invalid, \a errorCounts->entryCount is NULL - \ref NVML_ERROR_NOT_SUPPORTED if the device does not support this feature or ECC mods is not enabled - \ref NVML_ERROR_INSUFFICIENT_SIZE if the allocated error entry array is not big enough - \ref NVML_ERROR_GPU_IS_LOST if the target GPU has fallen off the bus or is otherwise inaccessible - \ref NVML_ERROR_UNKNOWN on any unexpected error*/ fn nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts( device: cuda_types::nvml::nvmlDevice_t, errorCounts: *mut cuda_types::nvml::nvmlEccSramUniqueUncorrectedErrorCounts_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] fn nvmlInit() -> cuda_types::nvml::nvmlReturn_t; #[must_use] fn nvmlDeviceGetCount( deviceCount: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] fn nvmlDeviceGetHandleByIndex( index: ::core::ffi::c_uint, device: *mut cuda_types::nvml::nvmlDevice_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] fn nvmlDeviceGetHandleByPciBusId( pciBusId: *const ::core::ffi::c_char, device: *mut cuda_types::nvml::nvmlDevice_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] fn nvmlDeviceGetPciInfo( device: cuda_types::nvml::nvmlDevice_t, pci: *mut cuda_types::nvml::nvmlPciInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] fn nvmlDeviceGetPciInfo_v2( device: cuda_types::nvml::nvmlDevice_t, pci: *mut cuda_types::nvml::nvmlPciInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] fn nvmlDeviceGetNvLinkRemotePciInfo( device: cuda_types::nvml::nvmlDevice_t, link: ::core::ffi::c_uint, pci: *mut cuda_types::nvml::nvmlPciInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] fn nvmlDeviceGetGridLicensableFeatures( device: cuda_types::nvml::nvmlDevice_t, pGridLicensableFeatures: *mut cuda_types::nvml::nvmlGridLicensableFeatures_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] fn nvmlDeviceGetGridLicensableFeatures_v2( device: cuda_types::nvml::nvmlDevice_t, pGridLicensableFeatures: *mut cuda_types::nvml::nvmlGridLicensableFeatures_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] fn nvmlDeviceGetGridLicensableFeatures_v3( device: cuda_types::nvml::nvmlDevice_t, pGridLicensableFeatures: *mut cuda_types::nvml::nvmlGridLicensableFeatures_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] fn nvmlDeviceRemoveGpu( pciInfo: *mut cuda_types::nvml::nvmlPciInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] fn nvmlEventSetWait( set: cuda_types::nvml::nvmlEventSet_t, data: *mut cuda_types::nvml::nvmlEventData_t, timeoutms: ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] fn nvmlDeviceGetAttributes( device: cuda_types::nvml::nvmlDevice_t, attributes: *mut cuda_types::nvml::nvmlDeviceAttributes_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] fn nvmlComputeInstanceGetInfo( computeInstance: cuda_types::nvml::nvmlComputeInstance_t, info: *mut cuda_types::nvml::nvmlComputeInstanceInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] fn nvmlDeviceGetComputeRunningProcesses( device: cuda_types::nvml::nvmlDevice_t, infoCount: *mut ::core::ffi::c_uint, infos: *mut cuda_types::nvml::nvmlProcessInfo_v1_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] fn nvmlDeviceGetComputeRunningProcesses_v2( device: cuda_types::nvml::nvmlDevice_t, infoCount: *mut ::core::ffi::c_uint, infos: *mut cuda_types::nvml::nvmlProcessInfo_v2_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] fn nvmlDeviceGetGraphicsRunningProcesses( device: cuda_types::nvml::nvmlDevice_t, infoCount: *mut ::core::ffi::c_uint, infos: *mut cuda_types::nvml::nvmlProcessInfo_v1_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] fn nvmlDeviceGetGraphicsRunningProcesses_v2( device: cuda_types::nvml::nvmlDevice_t, infoCount: *mut ::core::ffi::c_uint, infos: *mut cuda_types::nvml::nvmlProcessInfo_v2_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] fn nvmlDeviceGetMPSComputeRunningProcesses( device: cuda_types::nvml::nvmlDevice_t, infoCount: *mut ::core::ffi::c_uint, infos: *mut cuda_types::nvml::nvmlProcessInfo_v1_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] fn nvmlDeviceGetMPSComputeRunningProcesses_v2( device: cuda_types::nvml::nvmlDevice_t, infoCount: *mut ::core::ffi::c_uint, infos: *mut cuda_types::nvml::nvmlProcessInfo_v2_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] fn nvmlDeviceGetGpuInstancePossiblePlacements( device: cuda_types::nvml::nvmlDevice_t, profileId: ::core::ffi::c_uint, placements: *mut cuda_types::nvml::nvmlGpuInstancePlacement_t, count: *mut ::core::ffi::c_uint, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] fn nvmlVgpuInstanceGetLicenseInfo( vgpuInstance: cuda_types::nvml::nvmlVgpuInstance_t, licenseInfo: *mut cuda_types::nvml::nvmlVgpuLicenseInfo_t, ) -> cuda_types::nvml::nvmlReturn_t; #[must_use] fn nvmlDeviceGetDriverModel( device: cuda_types::nvml::nvmlDevice_t, current: *mut cuda_types::nvml::nvmlDriverModel_t, pending: *mut cuda_types::nvml::nvmlDriverModel_t, ) -> cuda_types::nvml::nvmlReturn_t; } ================================================ FILE: cuda_types/.rustfmt.toml ================================================ disable_all_formatting = true ================================================ FILE: cuda_types/Cargo.toml ================================================ [package] name = "cuda_types" version = "0.0.0" authors = ["Andrzej Janik "] edition = "2021" [dependencies] cuda_macros = { path = "../cuda_macros" } hip_runtime-sys = { path = "../ext/hip_runtime-sys" } bitflags = "2.9.1" rocblas-sys = { path = "../ext/rocblas-sys" } hipblaslt-sys = { path = "../ext/hipblaslt-sys" } miopen-sys = { path = "../ext/miopen-sys" } rocsparse-sys = { path = "../ext/rocsparse-sys" } [target.'cfg(unix)'.dependencies] rocm_smi-sys = { path = "../ext/rocm_smi-sys" } ================================================ FILE: cuda_types/src/cublas.rs ================================================ // Generated automatically by zluda_bindgen // DO NOT EDIT MANUALLY #![allow(warnings)] pub type __half = u16; pub type __nv_bfloat16 = u16; pub use super::cuda::cuComplex; pub use super::cuda::cuDoubleComplex; pub use super::cuda::cudaDataType; pub use super::cuda::cudaDataType_t; pub type cudaStream_t = super::cuda::CUstream; pub use super::cuda::libraryPropertyType; pub type cudaGraphExecUpdateResultInfo_st = super::cuda::CUgraphExecUpdateResultInfo_st; pub type cudaAsyncNotificationType = super::cuda::CUasyncNotificationType_enum; pub type cudaGraph_t = super::cuda::CUgraph; pub const CUBLAS_VER_MAJOR: u32 = 13; pub const CUBLAS_VER_MINOR: u32 = 0; pub const CUBLAS_VER_PATCH: u32 = 2; pub const CUBLAS_VER_BUILD: u32 = 14; pub const CUBLAS_VERSION: u32 = 130002; impl cublasFillMode_t { pub const CUBLAS_FILL_MODE_LOWER: cublasFillMode_t = cublasFillMode_t(0); } impl cublasFillMode_t { pub const CUBLAS_FILL_MODE_UPPER: cublasFillMode_t = cublasFillMode_t(1); } impl cublasFillMode_t { pub const CUBLAS_FILL_MODE_FULL: cublasFillMode_t = cublasFillMode_t(2); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cublasFillMode_t(pub ::core::ffi::c_uint); impl cublasDiagType_t { pub const CUBLAS_DIAG_NON_UNIT: cublasDiagType_t = cublasDiagType_t(0); } impl cublasDiagType_t { pub const CUBLAS_DIAG_UNIT: cublasDiagType_t = cublasDiagType_t(1); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cublasDiagType_t(pub ::core::ffi::c_uint); impl cublasSideMode_t { pub const CUBLAS_SIDE_LEFT: cublasSideMode_t = cublasSideMode_t(0); } impl cublasSideMode_t { pub const CUBLAS_SIDE_RIGHT: cublasSideMode_t = cublasSideMode_t(1); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cublasSideMode_t(pub ::core::ffi::c_uint); impl cublasOperation_t { pub const CUBLAS_OP_N: cublasOperation_t = cublasOperation_t(0); } impl cublasOperation_t { pub const CUBLAS_OP_T: cublasOperation_t = cublasOperation_t(1); } impl cublasOperation_t { pub const CUBLAS_OP_C: cublasOperation_t = cublasOperation_t(2); } impl cublasOperation_t { pub const CUBLAS_OP_HERMITAN: cublasOperation_t = cublasOperation_t(2); } impl cublasOperation_t { pub const CUBLAS_OP_CONJG: cublasOperation_t = cublasOperation_t(3); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cublasOperation_t(pub ::core::ffi::c_uint); impl cublasPointerMode_t { pub const CUBLAS_POINTER_MODE_HOST: cublasPointerMode_t = cublasPointerMode_t(0); } impl cublasPointerMode_t { pub const CUBLAS_POINTER_MODE_DEVICE: cublasPointerMode_t = cublasPointerMode_t(1); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cublasPointerMode_t(pub ::core::ffi::c_uint); impl cublasAtomicsMode_t { pub const CUBLAS_ATOMICS_NOT_ALLOWED: cublasAtomicsMode_t = cublasAtomicsMode_t(0); } impl cublasAtomicsMode_t { pub const CUBLAS_ATOMICS_ALLOWED: cublasAtomicsMode_t = cublasAtomicsMode_t(1); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cublasAtomicsMode_t(pub ::core::ffi::c_uint); impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_DFALT: cublasGemmAlgo_t = cublasGemmAlgo_t(-1); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_DEFAULT: cublasGemmAlgo_t = cublasGemmAlgo_t(-1); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO0: cublasGemmAlgo_t = cublasGemmAlgo_t(0); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO1: cublasGemmAlgo_t = cublasGemmAlgo_t(1); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO2: cublasGemmAlgo_t = cublasGemmAlgo_t(2); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO3: cublasGemmAlgo_t = cublasGemmAlgo_t(3); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO4: cublasGemmAlgo_t = cublasGemmAlgo_t(4); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO5: cublasGemmAlgo_t = cublasGemmAlgo_t(5); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO6: cublasGemmAlgo_t = cublasGemmAlgo_t(6); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO7: cublasGemmAlgo_t = cublasGemmAlgo_t(7); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO8: cublasGemmAlgo_t = cublasGemmAlgo_t(8); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO9: cublasGemmAlgo_t = cublasGemmAlgo_t(9); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO10: cublasGemmAlgo_t = cublasGemmAlgo_t(10); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO11: cublasGemmAlgo_t = cublasGemmAlgo_t(11); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO12: cublasGemmAlgo_t = cublasGemmAlgo_t(12); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO13: cublasGemmAlgo_t = cublasGemmAlgo_t(13); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO14: cublasGemmAlgo_t = cublasGemmAlgo_t(14); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO15: cublasGemmAlgo_t = cublasGemmAlgo_t(15); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO16: cublasGemmAlgo_t = cublasGemmAlgo_t(16); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO17: cublasGemmAlgo_t = cublasGemmAlgo_t(17); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO18: cublasGemmAlgo_t = cublasGemmAlgo_t(18); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO19: cublasGemmAlgo_t = cublasGemmAlgo_t(19); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO20: cublasGemmAlgo_t = cublasGemmAlgo_t(20); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO21: cublasGemmAlgo_t = cublasGemmAlgo_t(21); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO22: cublasGemmAlgo_t = cublasGemmAlgo_t(22); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO23: cublasGemmAlgo_t = cublasGemmAlgo_t(23); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_DEFAULT_TENSOR_OP: cublasGemmAlgo_t = cublasGemmAlgo_t(99); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_DFALT_TENSOR_OP: cublasGemmAlgo_t = cublasGemmAlgo_t(99); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO0_TENSOR_OP: cublasGemmAlgo_t = cublasGemmAlgo_t(100); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO1_TENSOR_OP: cublasGemmAlgo_t = cublasGemmAlgo_t(101); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO2_TENSOR_OP: cublasGemmAlgo_t = cublasGemmAlgo_t(102); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO3_TENSOR_OP: cublasGemmAlgo_t = cublasGemmAlgo_t(103); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO4_TENSOR_OP: cublasGemmAlgo_t = cublasGemmAlgo_t(104); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO5_TENSOR_OP: cublasGemmAlgo_t = cublasGemmAlgo_t(105); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO6_TENSOR_OP: cublasGemmAlgo_t = cublasGemmAlgo_t(106); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO7_TENSOR_OP: cublasGemmAlgo_t = cublasGemmAlgo_t(107); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO8_TENSOR_OP: cublasGemmAlgo_t = cublasGemmAlgo_t(108); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO9_TENSOR_OP: cublasGemmAlgo_t = cublasGemmAlgo_t(109); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO10_TENSOR_OP: cublasGemmAlgo_t = cublasGemmAlgo_t(110); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO11_TENSOR_OP: cublasGemmAlgo_t = cublasGemmAlgo_t(111); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO12_TENSOR_OP: cublasGemmAlgo_t = cublasGemmAlgo_t(112); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO13_TENSOR_OP: cublasGemmAlgo_t = cublasGemmAlgo_t(113); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO14_TENSOR_OP: cublasGemmAlgo_t = cublasGemmAlgo_t(114); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_ALGO15_TENSOR_OP: cublasGemmAlgo_t = cublasGemmAlgo_t(115); } impl cublasGemmAlgo_t { pub const CUBLAS_GEMM_AUTOTUNE: cublasGemmAlgo_t = cublasGemmAlgo_t(999); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cublasGemmAlgo_t(pub ::core::ffi::c_int); impl cublasMath_t { pub const CUBLAS_DEFAULT_MATH: cublasMath_t = cublasMath_t(0); } impl cublasMath_t { pub const CUBLAS_TENSOR_OP_MATH: cublasMath_t = cublasMath_t(1); } impl cublasMath_t { pub const CUBLAS_PEDANTIC_MATH: cublasMath_t = cublasMath_t(2); } impl cublasMath_t { pub const CUBLAS_TF32_TENSOR_OP_MATH: cublasMath_t = cublasMath_t(3); } impl cublasMath_t { pub const CUBLAS_FP32_EMULATED_BF16X9_MATH: cublasMath_t = cublasMath_t(4); } impl cublasMath_t { pub const CUBLAS_MATH_DISALLOW_REDUCED_PRECISION_REDUCTION: cublasMath_t = cublasMath_t( 16, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cublasMath_t(pub ::core::ffi::c_uint); pub use super::cuda::cudaDataType as cublasDataType_t; impl cublasComputeType_t { pub const CUBLAS_COMPUTE_16F: cublasComputeType_t = cublasComputeType_t(64); } impl cublasComputeType_t { pub const CUBLAS_COMPUTE_16F_PEDANTIC: cublasComputeType_t = cublasComputeType_t(65); } impl cublasComputeType_t { pub const CUBLAS_COMPUTE_32F: cublasComputeType_t = cublasComputeType_t(68); } impl cublasComputeType_t { pub const CUBLAS_COMPUTE_32F_PEDANTIC: cublasComputeType_t = cublasComputeType_t(69); } impl cublasComputeType_t { pub const CUBLAS_COMPUTE_32F_FAST_16F: cublasComputeType_t = cublasComputeType_t(74); } impl cublasComputeType_t { pub const CUBLAS_COMPUTE_32F_FAST_16BF: cublasComputeType_t = cublasComputeType_t( 75, ); } impl cublasComputeType_t { pub const CUBLAS_COMPUTE_32F_FAST_TF32: cublasComputeType_t = cublasComputeType_t( 77, ); } impl cublasComputeType_t { pub const CUBLAS_COMPUTE_32F_EMULATED_16BFX9: cublasComputeType_t = cublasComputeType_t( 78, ); } impl cublasComputeType_t { pub const CUBLAS_COMPUTE_64F: cublasComputeType_t = cublasComputeType_t(70); } impl cublasComputeType_t { pub const CUBLAS_COMPUTE_64F_PEDANTIC: cublasComputeType_t = cublasComputeType_t(71); } impl cublasComputeType_t { pub const CUBLAS_COMPUTE_32I: cublasComputeType_t = cublasComputeType_t(72); } impl cublasComputeType_t { pub const CUBLAS_COMPUTE_32I_PEDANTIC: cublasComputeType_t = cublasComputeType_t(73); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cublasComputeType_t(pub ::core::ffi::c_uint); impl cublasEmulationStrategy_t { pub const CUBLAS_EMULATION_STRATEGY_DEFAULT: cublasEmulationStrategy_t = cublasEmulationStrategy_t( 0, ); } impl cublasEmulationStrategy_t { pub const CUBLAS_EMULATION_STRATEGY_PERFORMANT: cublasEmulationStrategy_t = cublasEmulationStrategy_t( 1, ); } impl cublasEmulationStrategy_t { pub const CUBLAS_EMULATION_STRATEGY_EAGER: cublasEmulationStrategy_t = cublasEmulationStrategy_t( 2, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cublasEmulationStrategy_t(pub ::core::ffi::c_uint); #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cublasContext { _unused: [u8; 0], } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cublasHandle_t(pub *mut cublasContext); pub type cublasLogCallback = ::core::option::Option< unsafe extern "C" fn(msg: *const ::core::ffi::c_char), >; impl cublasError_t { pub const r#NOT_INITIALIZED: cublasError_t = cublasError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(1) }); pub const r#ALLOC_FAILED: cublasError_t = cublasError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(3) }); pub const r#INVALID_VALUE: cublasError_t = cublasError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(7) }); pub const r#ARCH_MISMATCH: cublasError_t = cublasError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(8) }); pub const r#MAPPING_ERROR: cublasError_t = cublasError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(11) }); pub const r#EXECUTION_FAILED: cublasError_t = cublasError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(13) }); pub const r#INTERNAL_ERROR: cublasError_t = cublasError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(14) }); pub const r#NOT_SUPPORTED: cublasError_t = cublasError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(15) }); pub const r#LICENSE_ERROR: cublasError_t = cublasError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(16) }); } #[repr(transparent)] #[derive(Debug, Hash, Copy, Clone, PartialEq, Eq)] pub struct cublasError_t(pub ::core::num::NonZeroU32); pub trait cublasStatus_tConsts { const SUCCESS: cublasStatus_t = cublasStatus_t::Ok(()); const ERROR_NOT_INITIALIZED: cublasStatus_t = cublasStatus_t::Err( cublasError_t::r#NOT_INITIALIZED, ); const ERROR_ALLOC_FAILED: cublasStatus_t = cublasStatus_t::Err( cublasError_t::r#ALLOC_FAILED, ); const ERROR_INVALID_VALUE: cublasStatus_t = cublasStatus_t::Err( cublasError_t::r#INVALID_VALUE, ); const ERROR_ARCH_MISMATCH: cublasStatus_t = cublasStatus_t::Err( cublasError_t::r#ARCH_MISMATCH, ); const ERROR_MAPPING_ERROR: cublasStatus_t = cublasStatus_t::Err( cublasError_t::r#MAPPING_ERROR, ); const ERROR_EXECUTION_FAILED: cublasStatus_t = cublasStatus_t::Err( cublasError_t::r#EXECUTION_FAILED, ); const ERROR_INTERNAL_ERROR: cublasStatus_t = cublasStatus_t::Err( cublasError_t::r#INTERNAL_ERROR, ); const ERROR_NOT_SUPPORTED: cublasStatus_t = cublasStatus_t::Err( cublasError_t::r#NOT_SUPPORTED, ); const ERROR_LICENSE_ERROR: cublasStatus_t = cublasStatus_t::Err( cublasError_t::r#LICENSE_ERROR, ); } impl cublasStatus_tConsts for cublasStatus_t {} #[must_use] pub type cublasStatus_t = ::core::result::Result<(), cublasError_t>; const _: fn() = || { let _ = std::mem::transmute::; }; impl From for cublasError_t { fn from(error: rocblas_sys::rocblas_error) -> Self { Self(error.0) } } impl From for cublasError_t { fn from(error: hipblaslt_sys::hipblasLtError) -> Self { Self(error.0) } } ================================================ FILE: cuda_types/src/cublaslt.rs ================================================ // Generated automatically by zluda_bindgen // DO NOT EDIT MANUALLY #![allow(warnings)] pub type __half = u16; pub type __nv_bfloat16 = u16; pub use super::cuda::cuComplex; pub use super::cuda::cuDoubleComplex; pub use super::cuda::cudaDataType; pub use super::cuda::cudaDataType_t; pub type cudaStream_t = super::cuda::CUstream; pub use super::cuda::libraryPropertyType; pub type cudaGraphExecUpdateResultInfo_st = super::cuda::CUgraphExecUpdateResultInfo_st; pub type cudaAsyncNotificationType = super::cuda::CUasyncNotificationType_enum; pub type cudaGraph_t = super::cuda::CUgraph; pub const CUBLASLT_NUMERICAL_IMPL_FLAGS_FMA: u32 = 1; pub const CUBLASLT_NUMERICAL_IMPL_FLAGS_HMMA: u32 = 2; pub const CUBLASLT_NUMERICAL_IMPL_FLAGS_IMMA: u32 = 4; pub const CUBLASLT_NUMERICAL_IMPL_FLAGS_DMMA: u32 = 8; pub const CUBLASLT_NUMERICAL_IMPL_FLAGS_TENSOR_OP_MASK: u32 = 254; pub const CUBLASLT_NUMERICAL_IMPL_FLAGS_OP_TYPE_MASK: u32 = 255; pub const CUBLASLT_NUMERICAL_IMPL_FLAGS_ACCUMULATOR_16F: u32 = 256; pub const CUBLASLT_NUMERICAL_IMPL_FLAGS_ACCUMULATOR_32F: u32 = 512; pub const CUBLASLT_NUMERICAL_IMPL_FLAGS_ACCUMULATOR_64F: u32 = 1024; pub const CUBLASLT_NUMERICAL_IMPL_FLAGS_ACCUMULATOR_32I: u32 = 2048; pub const CUBLASLT_NUMERICAL_IMPL_FLAGS_ACCUMULATOR_TYPE_MASK: u32 = 65280; pub const CUBLASLT_NUMERICAL_IMPL_FLAGS_INPUT_16F: u32 = 65536; pub const CUBLASLT_NUMERICAL_IMPL_FLAGS_INPUT_16BF: u32 = 131072; pub const CUBLASLT_NUMERICAL_IMPL_FLAGS_INPUT_TF32: u32 = 262144; pub const CUBLASLT_NUMERICAL_IMPL_FLAGS_INPUT_32F: u32 = 524288; pub const CUBLASLT_NUMERICAL_IMPL_FLAGS_INPUT_64F: u32 = 1048576; pub const CUBLASLT_NUMERICAL_IMPL_FLAGS_INPUT_8I: u32 = 2097152; pub const CUBLASLT_NUMERICAL_IMPL_FLAGS_INPUT_8F_E4M3: u32 = 4194304; pub const CUBLASLT_NUMERICAL_IMPL_FLAGS_INPUT_8F_E5M2: u32 = 8388608; pub const CUBLASLT_NUMERICAL_IMPL_FLAGS_OP_INPUT_TYPE_MASK: u32 = 16711680; pub const CUBLASLT_NUMERICAL_IMPL_FLAGS_GAUSSIAN: u64 = 4294967296; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cublasLtContext { _unused: [u8; 0], } /// Opaque structure holding CUBLASLT context pub type cublasLtHandle_t = *mut cublasLtContext; /// Semi-opaque descriptor for matrix memory layout #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cublasLtMatrixLayoutOpaque_t { pub data: [u64; 8usize], } /// Opaque descriptor for matrix memory layout pub type cublasLtMatrixLayout_t = *mut cublasLtMatrixLayoutOpaque_t; /** Semi-opaque algorithm descriptor (to avoid complicated alloc/free schemes) This structure can be trivially serialized and later restored for use with the same version of cuBLAS library to save on selecting the right configuration again.*/ #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cublasLtMatmulAlgo_t { pub data: [u64; 8usize], } /// Semi-opaque descriptor for cublasLtMatmul() operation details #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cublasLtMatmulDescOpaque_t { pub data: [u64; 32usize], } /// Opaque descriptor for cublasLtMatmul() operation details pub type cublasLtMatmulDesc_t = *mut cublasLtMatmulDescOpaque_t; /// Semi-opaque descriptor for cublasLtMatrixTransform() operation details #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cublasLtMatrixTransformDescOpaque_t { pub data: [u64; 8usize], } /// Opaque descriptor for cublasLtMatrixTransform() operation details pub type cublasLtMatrixTransformDesc_t = *mut cublasLtMatrixTransformDescOpaque_t; /// Semi-opaque descriptor for cublasLtMatmulPreference() operation details #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cublasLtMatmulPreferenceOpaque_t { pub data: [u64; 8usize], } /// Opaque descriptor for cublasLtMatmulAlgoGetHeuristic() configuration pub type cublasLtMatmulPreference_t = *mut cublasLtMatmulPreferenceOpaque_t; impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_UNDEFINED: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 0, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_8x8: cublasLtMatmulTile_t = cublasLtMatmulTile_t(1); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_8x16: cublasLtMatmulTile_t = cublasLtMatmulTile_t(2); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_16x8: cublasLtMatmulTile_t = cublasLtMatmulTile_t(3); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_8x32: cublasLtMatmulTile_t = cublasLtMatmulTile_t(4); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_16x16: cublasLtMatmulTile_t = cublasLtMatmulTile_t(5); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_32x8: cublasLtMatmulTile_t = cublasLtMatmulTile_t(6); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_8x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t(7); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_16x32: cublasLtMatmulTile_t = cublasLtMatmulTile_t(8); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_32x16: cublasLtMatmulTile_t = cublasLtMatmulTile_t(9); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x8: cublasLtMatmulTile_t = cublasLtMatmulTile_t(10); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_32x32: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 11, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_32x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 12, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x32: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 13, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_32x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 14, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 15, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x32: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 16, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 17, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 18, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x256: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 19, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 20, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_256x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 21, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x512: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 22, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x256: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 23, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_256x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 24, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_512x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 25, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x96: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 26, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_96x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 27, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_96x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 28, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x160: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 29, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_160x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 30, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 31, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x192: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 32, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x96: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 33, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_32x256: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 34, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_256x32: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 35, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_8x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 36, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_8x192: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 37, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_8x256: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 38, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_8x320: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 39, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_8x384: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 40, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_8x448: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 41, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_8x512: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 42, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_8x576: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 43, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_8x640: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 44, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_8x704: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 45, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_8x768: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 46, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_16x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 47, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_16x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 48, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_16x192: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 49, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_16x256: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 50, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_16x320: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 51, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_16x384: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 52, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_16x448: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 53, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_16x512: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 54, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_16x576: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 55, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_16x640: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 56, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_16x704: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 57, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_16x768: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 58, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_24x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 59, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_24x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 60, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_24x192: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 61, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_24x256: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 62, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_24x320: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 63, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_24x384: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 64, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_24x448: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 65, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_24x512: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 66, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_24x576: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 67, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_24x640: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 68, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_24x704: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 69, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_24x768: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 70, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_32x192: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 71, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_32x320: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 72, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_32x384: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 73, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_32x448: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 74, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_32x512: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 75, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_32x576: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 76, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_32x640: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 77, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_32x704: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 78, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_32x768: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 79, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_40x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 80, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_40x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 81, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_40x192: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 82, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_40x256: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 83, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_40x320: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 84, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_40x384: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 85, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_40x448: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 86, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_40x512: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 87, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_40x576: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 88, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_40x640: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 89, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_40x704: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 90, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_40x768: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 91, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_48x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 92, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_48x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 93, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_48x192: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 94, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_48x256: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 95, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_48x320: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 96, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_48x384: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 97, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_48x448: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 98, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_48x512: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 99, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_48x576: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 100, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_48x640: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 101, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_48x704: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 102, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_48x768: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 103, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_56x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 104, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_56x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 105, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_56x192: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 106, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_56x256: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 107, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_56x320: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 108, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_56x384: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 109, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_56x448: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 110, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_56x512: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 111, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_56x576: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 112, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_56x640: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 113, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_56x704: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 114, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_56x768: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 115, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x192: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 116, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x320: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 117, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x384: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 118, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x448: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 119, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x576: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 120, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x640: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 121, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x704: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 122, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x768: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 123, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_72x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 124, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_72x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 125, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_72x192: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 126, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_72x256: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 127, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_72x320: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 128, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_72x384: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 129, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_72x448: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 130, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_72x512: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 131, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_72x576: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 132, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_72x640: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 133, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_80x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 134, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_80x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 135, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_80x192: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 136, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_80x256: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 137, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_80x320: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 138, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_80x384: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 139, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_80x448: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 140, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_80x512: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 141, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_80x576: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 142, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_88x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 143, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_88x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 144, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_88x192: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 145, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_88x256: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 146, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_88x320: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 147, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_88x384: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 148, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_88x448: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 149, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_88x512: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 150, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_96x192: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 151, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_96x256: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 152, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_96x320: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 153, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_96x384: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 154, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_96x448: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 155, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_96x512: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 156, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_104x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 157, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_104x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 158, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_104x192: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 159, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_104x256: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 160, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_104x320: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 161, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_104x384: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 162, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_104x448: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 163, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_112x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 164, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_112x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 165, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_112x192: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 166, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_112x256: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 167, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_112x320: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 168, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_112x384: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 169, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_120x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 170, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_120x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 171, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_120x192: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 172, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_120x256: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 173, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_120x320: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 174, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_120x384: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 175, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x320: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 176, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x384: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 177, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_136x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 178, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_136x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 179, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_136x192: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 180, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_136x256: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 181, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_136x320: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 182, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_144x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 183, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_144x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 184, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_144x192: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 185, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_144x256: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 186, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_144x320: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 187, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_152x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 188, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_152x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 189, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_152x192: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 190, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_152x256: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 191, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_152x320: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 192, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_160x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 193, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_160x192: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 194, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_160x256: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 195, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_168x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 196, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_168x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 197, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_168x192: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 198, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_168x256: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 199, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_176x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 200, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_176x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 201, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_176x192: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 202, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_176x256: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 203, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_184x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 204, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_184x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 205, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_184x192: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 206, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_184x256: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 207, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 208, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x192: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 209, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x256: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 210, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_200x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 211, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_200x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 212, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_200x192: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 213, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_208x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 214, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_208x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 215, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_208x192: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 216, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_216x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 217, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_216x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 218, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_216x192: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 219, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_224x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 220, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_224x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 221, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_224x192: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 222, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_232x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 223, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_232x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 224, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_232x192: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 225, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_240x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 226, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_240x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 227, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_240x192: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 228, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_248x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 229, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_248x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 230, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_248x192: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 231, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_256x192: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 232, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_264x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 233, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_264x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 234, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_272x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 235, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_272x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 236, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_280x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 237, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_280x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 238, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_288x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 239, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_288x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 240, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_296x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 241, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_296x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 242, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_304x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 243, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_304x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 244, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_312x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 245, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_312x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 246, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_320x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 247, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_320x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 248, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_328x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 249, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_328x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 250, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_336x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 251, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_336x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 252, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_344x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 253, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_344x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 254, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_352x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 255, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_352x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 256, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_360x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 257, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_360x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 258, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_368x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 259, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_368x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 260, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_376x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 261, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_376x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 262, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_384x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 263, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_384x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 264, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_392x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 265, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_400x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 266, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_408x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 267, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_416x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 268, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_424x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 269, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_432x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 270, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_440x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 271, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_448x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 272, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_456x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 273, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_464x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 274, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_472x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 275, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_480x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 276, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_488x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 277, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_496x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 278, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_504x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 279, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_520x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 280, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_528x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 281, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_536x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 282, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_544x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 283, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_552x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 284, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_560x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 285, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_568x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 286, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_576x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 287, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_584x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 288, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_592x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 289, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_600x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 290, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_608x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 291, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_616x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 292, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_624x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 293, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_632x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 294, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_640x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 295, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_648x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 296, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_656x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 297, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_664x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 298, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_672x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 299, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_680x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 300, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_688x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 301, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_696x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 302, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_704x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 303, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_712x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 304, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_720x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 305, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_728x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 306, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_736x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 307, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_744x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 308, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_752x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 309, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_760x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 310, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_768x64: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 311, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x16: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 312, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x24: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 313, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x40: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 314, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x48: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 315, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x56: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 316, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x72: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 317, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x80: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 318, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x88: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 319, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x104: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 320, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x112: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 321, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x120: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 322, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x136: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 323, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x144: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 324, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x152: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 325, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x160: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 326, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x168: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 327, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x176: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 328, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x184: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 329, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x200: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 330, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x208: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 331, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x216: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 332, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x224: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 333, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x232: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 334, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x240: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 335, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x248: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 336, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x264: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 337, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x272: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 338, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x280: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 339, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x288: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 340, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x296: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 341, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x304: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 342, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x312: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 343, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x328: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 344, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x336: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 345, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x344: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 346, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x352: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 347, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x360: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 348, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x368: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 349, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x376: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 350, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x392: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 351, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x400: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 352, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x408: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 353, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x416: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 354, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x424: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 355, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x432: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 356, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x440: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 357, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x456: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 358, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x464: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 359, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x472: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 360, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x480: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 361, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x488: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 362, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x496: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 363, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x504: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 364, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x520: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 365, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x528: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 366, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x536: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 367, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x544: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 368, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x552: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 369, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x560: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 370, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x568: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 371, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x584: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 372, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x592: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 373, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x600: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 374, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x608: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 375, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x616: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 376, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x624: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 377, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x632: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 378, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x648: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 379, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x656: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 380, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x664: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 381, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x672: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 382, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x680: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 383, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x688: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 384, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x696: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 385, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x712: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 386, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x720: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 387, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x728: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 388, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x736: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 389, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x744: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 390, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x752: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 391, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_64x760: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 392, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x8: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 393, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x16: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 394, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x24: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 395, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x40: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 396, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x48: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 397, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x56: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 398, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x72: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 399, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x80: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 400, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x88: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 401, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x104: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 402, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x112: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 403, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x120: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 404, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x136: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 405, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x144: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 406, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x152: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 407, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x168: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 408, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x176: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 409, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x184: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 410, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x200: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 411, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x208: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 412, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x216: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 413, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x224: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 414, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x232: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 415, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x240: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 416, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x248: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 417, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x264: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 418, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x272: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 419, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x280: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 420, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x288: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 421, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x296: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 422, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x304: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 423, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x312: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 424, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x328: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 425, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x336: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 426, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x344: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 427, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x352: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 428, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x360: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 429, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x368: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 430, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x376: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 431, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x392: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 432, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x400: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 433, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x408: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 434, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x416: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 435, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x424: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 436, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x432: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 437, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x440: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 438, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x448: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 439, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x456: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 440, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x464: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 441, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x472: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 442, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x480: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 443, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x488: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 444, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x496: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 445, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x504: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 446, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_128x512: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 447, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x8: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 448, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x16: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 449, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x24: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 450, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x32: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 451, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x40: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 452, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x48: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 453, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x56: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 454, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x72: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 455, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x80: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 456, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x88: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 457, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x96: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 458, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x104: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 459, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x112: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 460, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x120: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 461, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x136: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 462, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x144: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 463, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x152: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 464, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x160: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 465, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x168: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 466, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x176: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 467, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x184: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 468, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x200: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 469, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x208: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 470, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x216: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 471, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x224: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 472, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x232: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 473, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x240: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 474, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x248: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 475, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x264: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 476, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x272: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 477, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x280: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 478, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x288: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 479, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x296: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 480, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x304: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 481, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x312: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 482, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x320: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 483, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x328: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 484, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_192x336: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 485, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_256x8: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 486, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_256x16: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 487, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_256x24: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 488, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_256x40: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 489, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_256x48: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 490, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_256x56: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 491, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_256x72: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 492, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_256x80: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 493, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_256x88: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 494, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_256x96: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 495, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_256x104: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 496, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_256x112: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 497, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_256x120: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 498, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_256x136: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 499, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_256x144: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 500, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_256x152: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 501, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_256x160: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 502, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_256x168: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 503, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_256x176: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 504, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_256x184: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 505, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_256x200: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 506, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_256x208: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 507, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_256x216: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 508, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_256x224: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 509, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_256x232: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 510, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_256x240: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 511, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_256x248: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 512, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_256x256: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 513, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_320x8: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 514, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_320x16: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 515, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_320x24: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 516, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_320x32: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 517, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_320x40: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 518, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_320x48: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 519, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_320x56: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 520, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_320x72: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 521, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_320x80: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 522, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_320x88: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 523, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_320x96: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 524, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_320x104: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 525, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_320x112: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 526, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_320x120: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 527, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_320x136: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 528, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_320x144: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 529, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_320x152: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 530, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_320x160: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 531, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_320x168: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 532, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_320x176: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 533, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_320x184: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 534, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_320x192: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 535, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_320x200: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 536, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_384x8: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 537, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_384x16: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 538, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_384x24: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 539, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_384x32: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 540, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_384x40: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 541, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_384x48: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 542, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_384x56: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 543, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_384x72: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 544, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_384x80: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 545, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_384x88: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 546, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_384x96: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 547, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_384x104: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 548, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_384x112: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 549, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_384x120: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 550, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_384x136: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 551, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_384x144: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 552, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_384x152: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 553, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_384x160: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 554, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_384x168: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 555, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_448x8: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 556, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_448x16: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 557, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_448x24: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 558, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_448x32: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 559, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_448x40: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 560, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_448x48: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 561, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_448x56: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 562, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_448x72: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 563, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_448x80: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 564, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_448x88: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 565, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_448x96: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 566, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_448x104: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 567, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_448x112: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 568, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_448x120: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 569, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_448x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 570, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_448x136: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 571, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_448x144: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 572, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_512x8: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 573, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_512x16: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 574, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_512x24: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 575, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_512x32: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 576, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_512x40: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 577, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_512x48: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 578, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_512x56: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 579, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_512x72: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 580, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_512x80: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 581, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_512x88: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 582, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_512x96: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 583, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_512x104: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 584, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_512x112: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 585, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_512x120: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 586, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_512x128: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 587, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_576x8: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 588, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_576x16: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 589, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_576x24: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 590, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_576x32: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 591, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_576x40: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 592, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_576x48: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 593, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_576x56: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 594, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_576x72: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 595, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_576x80: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 596, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_576x88: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 597, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_576x96: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 598, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_576x104: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 599, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_576x112: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 600, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_640x8: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 601, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_640x16: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 602, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_640x24: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 603, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_640x32: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 604, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_640x40: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 605, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_640x48: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 606, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_640x56: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 607, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_640x72: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 608, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_640x80: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 609, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_640x88: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 610, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_640x96: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 611, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_704x8: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 612, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_704x16: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 613, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_704x24: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 614, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_704x32: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 615, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_704x40: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 616, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_704x48: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 617, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_704x56: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 618, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_704x72: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 619, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_704x80: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 620, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_704x88: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 621, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_768x8: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 622, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_768x16: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 623, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_768x24: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 624, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_768x32: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 625, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_768x40: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 626, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_768x48: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 627, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_768x56: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 628, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_768x72: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 629, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_768x80: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 630, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_256x512: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 631, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_256x1024: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 632, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_512x512: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 633, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_512x1024: cublasLtMatmulTile_t = cublasLtMatmulTile_t( 634, ); } impl cublasLtMatmulTile_t { pub const CUBLASLT_MATMUL_TILE_END: cublasLtMatmulTile_t = cublasLtMatmulTile_t(635); } #[repr(transparent)] /** Tile size (in C/D matrix Rows x Cols) General order of tile IDs is sorted by size first and by first dimension second.*/ #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cublasLtMatmulTile_t(pub ::core::ffi::c_uint); impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_UNDEFINED: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 0, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_16x1: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 1, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_16x2: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 2, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_16x3: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 3, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_16x4: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 4, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_16x5: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 5, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_16x6: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 6, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_32x1: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 7, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_32x2: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 8, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_32x3: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 9, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_32x4: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 10, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_32x5: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 11, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_32x6: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 12, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_64x1: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 13, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_64x2: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 14, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_64x3: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 15, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_64x4: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 16, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_64x5: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 17, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_64x6: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 18, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_128x1: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 19, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_128x2: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 20, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_128x3: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 21, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_128x4: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 22, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_128x5: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 23, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_128x6: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 24, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_32x10: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 25, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_8x4: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 26, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_16x10: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 27, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_8x5: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 28, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_8x3: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 31, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_8xAUTO: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 32, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_16xAUTO: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 33, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_32xAUTO: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 34, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_64xAUTO: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 35, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_128xAUTO: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 36, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_256xAUTO: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 37, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_768xAUTO: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 38, ); } impl cublasLtMatmulStages_t { pub const CUBLASLT_MATMUL_STAGES_END: cublasLtMatmulStages_t = cublasLtMatmulStages_t( 39, ); } #[repr(transparent)] /** Size and number of stages in which elements are read into shared memory General order of stages IDs is sorted by stage size first and by number of stages second.*/ #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cublasLtMatmulStages_t(pub ::core::ffi::c_uint); impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_AUTO: cublasLtClusterShape_t = cublasLtClusterShape_t( 0, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_1x1x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 2, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_2x1x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 3, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_4x1x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 4, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_1x2x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 5, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_2x2x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 6, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_4x2x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 7, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_1x4x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 8, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_2x4x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 9, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_4x4x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 10, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_8x1x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 11, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_1x8x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 12, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_8x2x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 13, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_2x8x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 14, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_16x1x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 15, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_1x16x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 16, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_3x1x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 17, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_5x1x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 18, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_6x1x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 19, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_7x1x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 20, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_9x1x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 21, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_10x1x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 22, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_11x1x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 23, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_12x1x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 24, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_13x1x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 25, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_14x1x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 26, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_15x1x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 27, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_3x2x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 28, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_5x2x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 29, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_6x2x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 30, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_7x2x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 31, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_1x3x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 32, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_2x3x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 33, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_3x3x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 34, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_4x3x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 35, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_5x3x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 36, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_3x4x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 37, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_1x5x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 38, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_2x5x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 39, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_3x5x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 40, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_1x6x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 41, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_2x6x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 42, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_1x7x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 43, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_2x7x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 44, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_1x9x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 45, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_1x10x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 46, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_1x11x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 47, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_1x12x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 48, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_1x13x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 49, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_1x14x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 50, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_1x15x1: cublasLtClusterShape_t = cublasLtClusterShape_t( 51, ); } impl cublasLtClusterShape_t { /// Let library pick cluster shape automatically pub const CUBLASLT_CLUSTER_SHAPE_END: cublasLtClusterShape_t = cublasLtClusterShape_t( 52, ); } #[repr(transparent)] /** Thread Block Cluster size Typically dimensioned similar to cublasLtMatmulTile_t, with the third coordinate unused at this time.*/ #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cublasLtClusterShape_t(pub ::core::ffi::c_uint); impl cublasLtMatmulInnerShape_t { pub const CUBLASLT_MATMUL_INNER_SHAPE_UNDEFINED: cublasLtMatmulInnerShape_t = cublasLtMatmulInnerShape_t( 0, ); } impl cublasLtMatmulInnerShape_t { pub const CUBLASLT_MATMUL_INNER_SHAPE_MMA884: cublasLtMatmulInnerShape_t = cublasLtMatmulInnerShape_t( 1, ); } impl cublasLtMatmulInnerShape_t { pub const CUBLASLT_MATMUL_INNER_SHAPE_MMA1684: cublasLtMatmulInnerShape_t = cublasLtMatmulInnerShape_t( 2, ); } impl cublasLtMatmulInnerShape_t { pub const CUBLASLT_MATMUL_INNER_SHAPE_MMA1688: cublasLtMatmulInnerShape_t = cublasLtMatmulInnerShape_t( 3, ); } impl cublasLtMatmulInnerShape_t { pub const CUBLASLT_MATMUL_INNER_SHAPE_MMA16816: cublasLtMatmulInnerShape_t = cublasLtMatmulInnerShape_t( 4, ); } impl cublasLtMatmulInnerShape_t { pub const CUBLASLT_MATMUL_INNER_SHAPE_END: cublasLtMatmulInnerShape_t = cublasLtMatmulInnerShape_t( 5, ); } #[repr(transparent)] /** Inner size of the kernel Represents various aspects of internal kernel design, that don't impact CUDA grid size but may have other more subtle effects. */ #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cublasLtMatmulInnerShape_t(pub ::core::ffi::c_uint); impl cublasLtMatmulMatrixScale_t { /// Scaling factors are single precision scalars applied to the whole tensor. pub const CUBLASLT_MATMUL_MATRIX_SCALE_SCALAR_32F: cublasLtMatmulMatrixScale_t = cublasLtMatmulMatrixScale_t( 0, ); } impl cublasLtMatmulMatrixScale_t { /** Scaling factors are tensors that contain a dedicated scaling factor stored as an 8-bit CUDA_R_8F_UE4M3 value for each 16-element block in the innermost dimension of the corresponding data tensor.*/ pub const CUBLASLT_MATMUL_MATRIX_SCALE_VEC16_UE4M3: cublasLtMatmulMatrixScale_t = cublasLtMatmulMatrixScale_t( 1, ); } impl cublasLtMatmulMatrixScale_t { /** Same as above, except that scaling factor tensor elements have type CUDA_R_8F_UE8M0 and the block size is 32 elements.*/ pub const CUBLASLT_MATMUL_MATRIX_SCALE_VEC32_UE8M0: cublasLtMatmulMatrixScale_t = cublasLtMatmulMatrixScale_t( 2, ); } impl cublasLtMatmulMatrixScale_t { /** Scaling factors are vectors of CUDA_R_32F values. This mode is only applicable to matrices A and B, in which case the vectors are expected to have M and N elements respectively, and each (i, j)-th element of product of A and B is multiplied by i-th element of A scale and j-th element of B scale.*/ pub const CUBLASLT_MATMUL_MATRIX_SCALE_OUTER_VEC_32F: cublasLtMatmulMatrixScale_t = cublasLtMatmulMatrixScale_t( 3, ); } impl cublasLtMatmulMatrixScale_t { /** Scaling factors are tensors that contain a dedicated CUDA_R_32F scaling factor for each 128-element block in the innermost dimension of the corresponding data tensor.*/ pub const CUBLASLT_MATMUL_MATRIX_SCALE_VEC128_32F: cublasLtMatmulMatrixScale_t = cublasLtMatmulMatrixScale_t( 4, ); } impl cublasLtMatmulMatrixScale_t { /** Scaling factors are tensors that contain a dedicated CUDA_R_32F scaling factor for each 128x128-element block in the the corresponding data tensor.*/ pub const CUBLASLT_MATMUL_MATRIX_SCALE_BLK128x128_32F: cublasLtMatmulMatrixScale_t = cublasLtMatmulMatrixScale_t( 5, ); } impl cublasLtMatmulMatrixScale_t { /** Scaling factors are tensors that contain a dedicated CUDA_R_32F scaling factor for each 128x128-element block in the the corresponding data tensor.*/ pub const CUBLASLT_MATMUL_MATRIX_SCALE_END: cublasLtMatmulMatrixScale_t = cublasLtMatmulMatrixScale_t( 6, ); } #[repr(transparent)] /// Scaling mode for per-matrix scaling. See documentation for layout information. #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cublasLtMatmulMatrixScale_t(pub ::core::ffi::c_uint); impl cublasLtPointerMode_t { /// matches CUBLAS_POINTER_MODE_HOST, pointer targets a single value host memory pub const CUBLASLT_POINTER_MODE_HOST: cublasLtPointerMode_t = cublasLtPointerMode_t( 0, ); } impl cublasLtPointerMode_t { /// matches CUBLAS_POINTER_MODE_DEVICE, pointer targets a single value device memory pub const CUBLASLT_POINTER_MODE_DEVICE: cublasLtPointerMode_t = cublasLtPointerMode_t( 1, ); } impl cublasLtPointerMode_t { /// pointer targets an array in device memory pub const CUBLASLT_POINTER_MODE_DEVICE_VECTOR: cublasLtPointerMode_t = cublasLtPointerMode_t( 2, ); } impl cublasLtPointerMode_t { /** alpha pointer targets an array in device memory, beta is zero. Note: CUBLASLT_MATMUL_DESC_ALPHA_VECTOR_BATCH_STRIDE is not supported, must be 0.*/ pub const CUBLASLT_POINTER_MODE_ALPHA_DEVICE_VECTOR_BETA_ZERO: cublasLtPointerMode_t = cublasLtPointerMode_t( 3, ); } impl cublasLtPointerMode_t { /// alpha pointer targets an array in device memory, beta is a single value in host memory. pub const CUBLASLT_POINTER_MODE_ALPHA_DEVICE_VECTOR_BETA_HOST: cublasLtPointerMode_t = cublasLtPointerMode_t( 4, ); } #[repr(transparent)] /// Pointer mode to use for alpha/beta #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cublasLtPointerMode_t(pub ::core::ffi::c_uint); impl cublasLtPointerModeMask_t { /// see CUBLASLT_POINTER_MODE_HOST pub const CUBLASLT_POINTER_MODE_MASK_HOST: cublasLtPointerModeMask_t = cublasLtPointerModeMask_t( 1, ); } impl cublasLtPointerModeMask_t { /// see CUBLASLT_POINTER_MODE_DEVICE pub const CUBLASLT_POINTER_MODE_MASK_DEVICE: cublasLtPointerModeMask_t = cublasLtPointerModeMask_t( 2, ); } impl cublasLtPointerModeMask_t { /// see CUBLASLT_POINTER_MODE_DEVICE_VECTOR pub const CUBLASLT_POINTER_MODE_MASK_DEVICE_VECTOR: cublasLtPointerModeMask_t = cublasLtPointerModeMask_t( 4, ); } impl cublasLtPointerModeMask_t { /// see CUBLASLT_POINTER_MODE_ALPHA_DEVICE_VECTOR_BETA_ZERO pub const CUBLASLT_POINTER_MODE_MASK_ALPHA_DEVICE_VECTOR_BETA_ZERO: cublasLtPointerModeMask_t = cublasLtPointerModeMask_t( 8, ); } impl cublasLtPointerModeMask_t { /// see CUBLASLT_POINTER_MODE_ALPHA_DEVICE_VECTOR_BETA_HOST pub const CUBLASLT_POINTER_MODE_MASK_ALPHA_DEVICE_VECTOR_BETA_HOST: cublasLtPointerModeMask_t = cublasLtPointerModeMask_t( 16, ); } #[repr(transparent)] /// Mask to define pointer mode capability #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cublasLtPointerModeMask_t(pub ::core::ffi::c_uint); pub type cublasLtNumericalImplFlags_t = u64; impl cublasLtOrder_t { /** Column-major Leading dimension is the stride (in elements) to the beginning of next column in memory.*/ pub const CUBLASLT_ORDER_COL: cublasLtOrder_t = cublasLtOrder_t(0); } impl cublasLtOrder_t { /** Row major Leading dimension is the stride (in elements) to the beginning of next row in memory.*/ pub const CUBLASLT_ORDER_ROW: cublasLtOrder_t = cublasLtOrder_t(1); } impl cublasLtOrder_t { /** Column-major ordered tiles of 32 columns. Leading dimension is the stride (in elements) to the beginning of next group of 32-columns. E.g. if matrix has 33 columns and 2 rows, ld must be at least (32) * 2 = 64.*/ pub const CUBLASLT_ORDER_COL32: cublasLtOrder_t = cublasLtOrder_t(2); } impl cublasLtOrder_t { /** Column-major ordered tiles of composite tiles with total 32 columns and 8 rows, tile composed of interleaved inner tiles of 4 columns within 4 even or odd rows in an alternating pattern. Leading dimension is the stride (in elements) to the beginning of the first 32 column x 8 row tile for the next 32-wide group of columns. E.g. if matrix has 33 columns and 1 row, ld must be at least (32 * 8) * 1 = 256.*/ pub const CUBLASLT_ORDER_COL4_4R2_8C: cublasLtOrder_t = cublasLtOrder_t(3); } impl cublasLtOrder_t { /** Column-major ordered tiles of composite tiles with total 32 columns ands 32 rows. Element offset within the tile is calculated as (((row%8)/2*4+row/8)*2+row%2)*32+col. Leading dimension is the stride (in elements) to the beginning of the first 32 column x 32 row tile for the next 32-wide group of columns. E.g. if matrix has 33 columns and 1 row, ld must be at least (32*32)*1 = 1024.*/ pub const CUBLASLT_ORDER_COL32_2R_4R4: cublasLtOrder_t = cublasLtOrder_t(4); } #[repr(transparent)] /// Enum for data ordering #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cublasLtOrder_t(pub ::core::ffi::c_uint); impl cublasLtBatchMode_t { /** Strided The matrices of each instance of the batch are located at fixed offsets in number of elements from their locations in the previous instance.*/ pub const CUBLASLT_BATCH_MODE_STRIDED: cublasLtBatchMode_t = cublasLtBatchMode_t(0); } impl cublasLtBatchMode_t { /** Pointer array The address of the matrix of each instance of the batch are read from arrays of pointers.*/ pub const CUBLASLT_BATCH_MODE_POINTER_ARRAY: cublasLtBatchMode_t = cublasLtBatchMode_t( 1, ); } #[repr(transparent)] /// Enum for batch mode #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cublasLtBatchMode_t(pub ::core::ffi::c_uint); impl cublasLtMatrixLayoutAttribute_t { /** Data type, see cudaDataType. uint32_t*/ pub const CUBLASLT_MATRIX_LAYOUT_TYPE: cublasLtMatrixLayoutAttribute_t = cublasLtMatrixLayoutAttribute_t( 0, ); } impl cublasLtMatrixLayoutAttribute_t { /** Memory order of the data, see cublasLtOrder_t. int32_t, default: CUBLASLT_ORDER_COL*/ pub const CUBLASLT_MATRIX_LAYOUT_ORDER: cublasLtMatrixLayoutAttribute_t = cublasLtMatrixLayoutAttribute_t( 1, ); } impl cublasLtMatrixLayoutAttribute_t { /** Number of rows. Usually only values that can be expressed as int32_t are supported. uint64_t*/ pub const CUBLASLT_MATRIX_LAYOUT_ROWS: cublasLtMatrixLayoutAttribute_t = cublasLtMatrixLayoutAttribute_t( 2, ); } impl cublasLtMatrixLayoutAttribute_t { /** Number of columns. Usually only values that can be expressed as int32_t are supported. uint64_t*/ pub const CUBLASLT_MATRIX_LAYOUT_COLS: cublasLtMatrixLayoutAttribute_t = cublasLtMatrixLayoutAttribute_t( 3, ); } impl cublasLtMatrixLayoutAttribute_t { /** Matrix leading dimension. For CUBLASLT_ORDER_COL this is stride (in elements) of matrix column, for more details and documentation for other memory orders see documentation for cublasLtOrder_t values. Currently only non-negative values are supported, must be large enough so that matrix memory locations are not overlapping (e.g. greater or equal to CUBLASLT_MATRIX_LAYOUT_ROWS in case of CUBLASLT_ORDER_COL). int64_t;*/ pub const CUBLASLT_MATRIX_LAYOUT_LD: cublasLtMatrixLayoutAttribute_t = cublasLtMatrixLayoutAttribute_t( 4, ); } impl cublasLtMatrixLayoutAttribute_t { /** Number of matmul operations to perform in the batch. See also CUBLASLT_ALGO_CAP_STRIDED_BATCH_SUPPORT and CUBLASLT_ALGO_CAP_POINTER_ARRAY_BATCH_SUPPORT int32_t, default: 1*/ pub const CUBLASLT_MATRIX_LAYOUT_BATCH_COUNT: cublasLtMatrixLayoutAttribute_t = cublasLtMatrixLayoutAttribute_t( 5, ); } impl cublasLtMatrixLayoutAttribute_t { /** Stride (in elements) to the next matrix for strided batch operation. When matrix type is planar-complex (CUBLASLT_MATRIX_LAYOUT_PLANE_OFFSET != 0), batch stride is interpreted by cublasLtMatmul() in number of real valued sub-elements. E.g. for data of type CUDA_C_16F, offset of 1024B is encoded as a stride of value 512 (since each element of the real and imaginary matrices is a 2B (16bit) floating point type). NOTE: A bug in cublasLtMatrixTransform() causes it to interpret the batch stride for a planar-complex matrix as if it was specified in number of complex elements. Therefore an offset of 1024B must be encoded as stride value 256 when calling cublasLtMatrixTransform() (each complex element is 4B with real and imaginary values 2B each). This behavior is expected to be corrected in the next major cuBLAS version. int64_t, default: 0*/ pub const CUBLASLT_MATRIX_LAYOUT_STRIDED_BATCH_OFFSET: cublasLtMatrixLayoutAttribute_t = cublasLtMatrixLayoutAttribute_t( 6, ); } impl cublasLtMatrixLayoutAttribute_t { /** Stride (in bytes) to the imaginary plane for planar complex layout. int64_t, default: 0 - 0 means that layout is regular (real and imaginary parts of complex numbers are interleaved in memory in each element)*/ pub const CUBLASLT_MATRIX_LAYOUT_PLANE_OFFSET: cublasLtMatrixLayoutAttribute_t = cublasLtMatrixLayoutAttribute_t( 7, ); } impl cublasLtMatrixLayoutAttribute_t { /** Batch mode. uint32_t, default: 0 - 0 means that batch mode is CUBLASLT_BATCH_MODE_STRIDED.*/ pub const CUBLASLT_MATRIX_LAYOUT_BATCH_MODE: cublasLtMatrixLayoutAttribute_t = cublasLtMatrixLayoutAttribute_t( 8, ); } #[repr(transparent)] /// Attributes of memory layout #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cublasLtMatrixLayoutAttribute_t(pub ::core::ffi::c_uint); impl cublasLtMatmulDescAttributes_t { /** Compute type, see cudaDataType. Defines data type used for multiply and accumulate operations and the accumulator during matrix multiplication. int32_t*/ pub const CUBLASLT_MATMUL_DESC_COMPUTE_TYPE: cublasLtMatmulDescAttributes_t = cublasLtMatmulDescAttributes_t( 0, ); } impl cublasLtMatmulDescAttributes_t { /** Scale type, see cudaDataType. Defines data type of alpha and beta. Accumulator and value from matrix C are typically converted to scale type before final scaling. Value is then converted from scale type to type of matrix D before being stored in memory. int32_t, default: same as CUBLASLT_MATMUL_DESC_COMPUTE_TYPE*/ pub const CUBLASLT_MATMUL_DESC_SCALE_TYPE: cublasLtMatmulDescAttributes_t = cublasLtMatmulDescAttributes_t( 1, ); } impl cublasLtMatmulDescAttributes_t { /** Pointer mode of alpha and beta, see cublasLtPointerMode_t. When CUBLASLT_POINTER_MODE_DEVICE_VECTOR is in use, alpha/beta vector lenghts must match number of output matrix rows. int32_t, default: CUBLASLT_POINTER_MODE_HOST*/ pub const CUBLASLT_MATMUL_DESC_POINTER_MODE: cublasLtMatmulDescAttributes_t = cublasLtMatmulDescAttributes_t( 2, ); } impl cublasLtMatmulDescAttributes_t { /** Transform of matrix A, see cublasOperation_t. int32_t, default: CUBLAS_OP_N*/ pub const CUBLASLT_MATMUL_DESC_TRANSA: cublasLtMatmulDescAttributes_t = cublasLtMatmulDescAttributes_t( 3, ); } impl cublasLtMatmulDescAttributes_t { /** Transform of matrix B, see cublasOperation_t. int32_t, default: CUBLAS_OP_N*/ pub const CUBLASLT_MATMUL_DESC_TRANSB: cublasLtMatmulDescAttributes_t = cublasLtMatmulDescAttributes_t( 4, ); } impl cublasLtMatmulDescAttributes_t { /** Transform of matrix C, see cublasOperation_t. Currently only CUBLAS_OP_N is supported. int32_t, default: CUBLAS_OP_N*/ pub const CUBLASLT_MATMUL_DESC_TRANSC: cublasLtMatmulDescAttributes_t = cublasLtMatmulDescAttributes_t( 5, ); } impl cublasLtMatmulDescAttributes_t { /** Matrix fill mode, see cublasFillMode_t. int32_t, default: CUBLAS_FILL_MODE_FULL*/ pub const CUBLASLT_MATMUL_DESC_FILL_MODE: cublasLtMatmulDescAttributes_t = cublasLtMatmulDescAttributes_t( 6, ); } impl cublasLtMatmulDescAttributes_t { /** Epilogue function, see cublasLtEpilogue_t. uint32_t, default: CUBLASLT_EPILOGUE_DEFAULT*/ pub const CUBLASLT_MATMUL_DESC_EPILOGUE: cublasLtMatmulDescAttributes_t = cublasLtMatmulDescAttributes_t( 7, ); } impl cublasLtMatmulDescAttributes_t { /** Bias or bias gradient vector pointer in the device memory. Bias case. See CUBLASLT_EPILOGUE_BIAS. For bias data type see CUBLASLT_MATMUL_DESC_BIAS_DATA_TYPE. Bias vector length must match matrix D rows count. Bias gradient case. See CUBLASLT_EPILOGUE_DRELU_BGRAD and CUBLASLT_EPILOGUE_DGELU_BGRAD. Bias gradient vector elements are the same type as the output elements (Ctype) with the exception of IMMA kernels (see above). Routines that don't dereference this pointer, like cublasLtMatmulAlgoGetHeuristic() depend on its value to determine expected pointer alignment. Bias case: const void *, default: NULL Bias gradient case: void *, default: NULL*/ pub const CUBLASLT_MATMUL_DESC_BIAS_POINTER: cublasLtMatmulDescAttributes_t = cublasLtMatmulDescAttributes_t( 8, ); } impl cublasLtMatmulDescAttributes_t { /** Batch stride for bias or bias gradient vector. Used together with CUBLASLT_MATMUL_DESC_BIAS_POINTER when matrix D's CUBLASLT_MATRIX_LAYOUT_BATCH_COUNT > 1. int64_t, default: 0*/ pub const CUBLASLT_MATMUL_DESC_BIAS_BATCH_STRIDE: cublasLtMatmulDescAttributes_t = cublasLtMatmulDescAttributes_t( 10, ); } impl cublasLtMatmulDescAttributes_t { /** Pointer for epilogue auxiliary buffer. - Output vector for ReLu bit-mask in forward pass when CUBLASLT_EPILOGUE_RELU_AUX or CUBLASLT_EPILOGUE_RELU_AUX_BIAS epilogue is used. - Input vector for ReLu bit-mask in backward pass when CUBLASLT_EPILOGUE_DRELU_BGRAD epilogue is used. - Output of GELU input matrix in forward pass when CUBLASLT_EPILOGUE_GELU_AUX_BIAS epilogue is used. - Input of GELU input matrix for backward pass when CUBLASLT_EPILOGUE_DGELU_BGRAD epilogue is used. For aux data type see CUBLASLT_MATMUL_DESC_EPILOGUE_AUX_DATA_TYPE. Routines that don't dereference this pointer, like cublasLtMatmulAlgoGetHeuristic() depend on its value to determine expected pointer alignment. Requires setting CUBLASLT_MATMUL_DESC_EPILOGUE_AUX_LD attribute. Forward pass: void *, default: NULL Backward pass: const void *, default: NULL*/ pub const CUBLASLT_MATMUL_DESC_EPILOGUE_AUX_POINTER: cublasLtMatmulDescAttributes_t = cublasLtMatmulDescAttributes_t( 11, ); } impl cublasLtMatmulDescAttributes_t { /** Leading dimension for epilogue auxiliary buffer. - ReLu bit-mask matrix leading dimension in elements (i.e. bits) when CUBLASLT_EPILOGUE_RELU_AUX, CUBLASLT_EPILOGUE_RELU_AUX_BIAS or CUBLASLT_EPILOGUE_DRELU_BGRAD epilogue is used. Must be divisible by 128 and be no less than the number of rows in the output matrix. - GELU input matrix leading dimension in elements when CUBLASLT_EPILOGUE_GELU_AUX_BIAS or CUBLASLT_EPILOGUE_DGELU_BGRAD epilogue used. Must be divisible by 8 and be no less than the number of rows in the output matrix. int64_t, default: 0*/ pub const CUBLASLT_MATMUL_DESC_EPILOGUE_AUX_LD: cublasLtMatmulDescAttributes_t = cublasLtMatmulDescAttributes_t( 12, ); } impl cublasLtMatmulDescAttributes_t { /** Batch stride for epilogue auxiliary buffer. - ReLu bit-mask matrix batch stride in elements (i.e. bits) when CUBLASLT_EPILOGUE_RELU_AUX, CUBLASLT_EPILOGUE_RELU_AUX_BIAS or CUBLASLT_EPILOGUE_DRELU_BGRAD epilogue is used. Must be divisible by 128. - GELU input matrix batch stride in elements when CUBLASLT_EPILOGUE_GELU_AUX_BIAS or CUBLASLT_EPILOGUE_DGELU_BGRAD epilogue used. Must be divisible by 8. int64_t, default: 0*/ pub const CUBLASLT_MATMUL_DESC_EPILOGUE_AUX_BATCH_STRIDE: cublasLtMatmulDescAttributes_t = cublasLtMatmulDescAttributes_t( 13, ); } impl cublasLtMatmulDescAttributes_t { /** Batch stride for alpha vector. Used together with CUBLASLT_POINTER_MODE_ALPHA_DEVICE_VECTOR_BETA_HOST when matrix D's CUBLASLT_MATRIX_LAYOUT_BATCH_COUNT > 1. If CUBLASLT_POINTER_MODE_ALPHA_DEVICE_VECTOR_BETA_ZERO is set then CUBLASLT_MATMUL_DESC_ALPHA_VECTOR_BATCH_STRIDE must be set to 0 as this mode doesnt supported batched alpha vector. int64_t, default: 0*/ pub const CUBLASLT_MATMUL_DESC_ALPHA_VECTOR_BATCH_STRIDE: cublasLtMatmulDescAttributes_t = cublasLtMatmulDescAttributes_t( 14, ); } impl cublasLtMatmulDescAttributes_t { /** Number of SMs to target for parallel execution. Optimizes heuristics for execution on a different number of SMs when user expects a concurrent stream to be using some of the device resources. int32_t, default: 0 - use the number reported by the device.*/ pub const CUBLASLT_MATMUL_DESC_SM_COUNT_TARGET: cublasLtMatmulDescAttributes_t = cublasLtMatmulDescAttributes_t( 15, ); } impl cublasLtMatmulDescAttributes_t { /** Device pointer to the scale factor value that converts data in matrix A to the compute data type range. The scaling factor value must have the same type as the compute type. If not specified, or set to NULL, the scaling factor is assumed to be 1. If set for an unsupported matrix data, scale, and compute type combination, calling cublasLtMatmul() will return CUBLAS_INVALID_VALUE. const void *, default: NULL*/ pub const CUBLASLT_MATMUL_DESC_A_SCALE_POINTER: cublasLtMatmulDescAttributes_t = cublasLtMatmulDescAttributes_t( 17, ); } impl cublasLtMatmulDescAttributes_t { /** Device pointer to the scale factor value to convert data in matrix B to compute data type range. The scaling factor value must have the same type as the compute type. If not specified, or set to NULL, the scaling factor is assumed to be 1. If set for an unsupported matrix data, scale, and compute type combination, calling cublasLtMatmul() will return CUBLAS_INVALID_VALUE. const void *, default: NULL*/ pub const CUBLASLT_MATMUL_DESC_B_SCALE_POINTER: cublasLtMatmulDescAttributes_t = cublasLtMatmulDescAttributes_t( 18, ); } impl cublasLtMatmulDescAttributes_t { /** Device pointer to the scale factor value to convert data in matrix C to compute data type range. The scaling factor value must have the same type as the compute type. If not specified, or set to NULL, the scaling factor is assumed to be 1. If set for an unsupported matrix data, scale, and compute type combination, calling cublasLtMatmul() will return CUBLAS_INVALID_VALUE. const void *, default: NULL*/ pub const CUBLASLT_MATMUL_DESC_C_SCALE_POINTER: cublasLtMatmulDescAttributes_t = cublasLtMatmulDescAttributes_t( 19, ); } impl cublasLtMatmulDescAttributes_t { /** Device pointer to the scale factor value to convert data in matrix D to compute data type range. The scaling factor value must have the same type as the compute type. If not specified, or set to NULL, the scaling factor is assumed to be 1. If set for an unsupported matrix data, scale, and compute type combination, calling cublasLtMatmul() will return CUBLAS_INVALID_VALUE. const void *, default: NULL*/ pub const CUBLASLT_MATMUL_DESC_D_SCALE_POINTER: cublasLtMatmulDescAttributes_t = cublasLtMatmulDescAttributes_t( 20, ); } impl cublasLtMatmulDescAttributes_t { /** Device pointer to the memory location that on completion will be set to the maximum of absolute values in the output matrix. The computed value has the same type as the compute type. If not specified or set to NULL, the maximum absolute value is not computed. If set for an unsupported matrix data, scale, and compute type combination, calling cublasLtMatmul() will return CUBLAS_INVALID_VALUE. void *, default: NULL*/ pub const CUBLASLT_MATMUL_DESC_AMAX_D_POINTER: cublasLtMatmulDescAttributes_t = cublasLtMatmulDescAttributes_t( 21, ); } impl cublasLtMatmulDescAttributes_t { /** Type of the data to be stored to the memory pointed to by CUBLASLT_MATMUL_DESC_EPILOGUE_AUX_POINTER. If unset, the data type defaults to the type of elements of the output matrix with some exceptions, see details below. ReLu uses a bit-mask. GELU input matrix elements type is the same as the type of elements of the output matrix with some exceptions, see details below. For fp8 kernels with output type CUDA_R_8F_E4M3 the aux data type can be CUDA_R_8F_E4M3 or CUDA_R_16F with some restrictions. See https://docs.nvidia.com/cuda/cublas/index.html#cublasLtMatmulDescAttributes_t for more details. If set for an unsupported matrix data, scale, and compute type combination, calling cublasLtMatmul() will return CUBLAS_INVALID_VALUE. int32_t based on cudaDataType, default: -1*/ pub const CUBLASLT_MATMUL_DESC_EPILOGUE_AUX_DATA_TYPE: cublasLtMatmulDescAttributes_t = cublasLtMatmulDescAttributes_t( 22, ); } impl cublasLtMatmulDescAttributes_t { /** Device pointer to the scaling factor value to convert results from compute type data range to storage data range in the auxiliary matrix that is set via CUBLASLT_MATMUL_DESC_EPILOGUE_AUX_POINTER. The scaling factor value must have the same type as the compute type. If not specified, or set to NULL, the scaling factor is assumed to be 1. If set for an unsupported matrix data, scale, and compute type combination, calling cublasLtMatmul() will return CUBLAS_INVALID_VALUE. void *, default: NULL*/ pub const CUBLASLT_MATMUL_DESC_EPILOGUE_AUX_SCALE_POINTER: cublasLtMatmulDescAttributes_t = cublasLtMatmulDescAttributes_t( 23, ); } impl cublasLtMatmulDescAttributes_t { /** Device pointer to the memory location that on completion will be set to the maximum of absolute values in the buffer that is set via CUBLASLT_MATMUL_DESC_EPILOGUE_AUX_POINTER. The computed value has the same type as the compute type. If not specified or set to NULL, the maximum absolute value is not computed. If set for an unsupported matrix data, scale, and compute type combination, calling cublasLtMatmul() will return CUBLAS_INVALID_VALUE. void *, default: NULL*/ pub const CUBLASLT_MATMUL_DESC_EPILOGUE_AUX_AMAX_POINTER: cublasLtMatmulDescAttributes_t = cublasLtMatmulDescAttributes_t( 24, ); } impl cublasLtMatmulDescAttributes_t { /** Flag for managing fp8 fast accumulation mode. When enabled, problem execution might be faster but at the cost of lower accuracy because intermediate results will not periodically be promoted to a higher precision. int8_t, default: 0 - fast accumulation mode is disabled.*/ pub const CUBLASLT_MATMUL_DESC_FAST_ACCUM: cublasLtMatmulDescAttributes_t = cublasLtMatmulDescAttributes_t( 25, ); } impl cublasLtMatmulDescAttributes_t { /** Type of bias or bias gradient vector in the device memory. Bias case: see CUBLASLT_EPILOGUE_BIAS. Bias vector elements are the same type as the elements of output matrix (Dtype) with the following exceptions: - IMMA kernels with computeType=CUDA_R_32I and Ctype=CUDA_R_8I where the bias vector elements are the same type as alpha, beta (CUBLASLT_MATMUL_DESC_SCALE_TYPE=CUDA_R_32F) - fp8 kernels with an output type of CUDA_R_32F, CUDA_R_8F_E4M3 or CUDA_R_8F_E5M2, See https://docs.nvidia.com/cuda/cublas/index.html#cublasLtMatmul for details. int32_t based on cudaDataType, default: -1*/ pub const CUBLASLT_MATMUL_DESC_BIAS_DATA_TYPE: cublasLtMatmulDescAttributes_t = cublasLtMatmulDescAttributes_t( 26, ); } impl cublasLtMatmulDescAttributes_t { /** Scaling mode that defines how the matrix scaling factor for matrix A is interpreted int32_t, default: 0*/ pub const CUBLASLT_MATMUL_DESC_A_SCALE_MODE: cublasLtMatmulDescAttributes_t = cublasLtMatmulDescAttributes_t( 31, ); } impl cublasLtMatmulDescAttributes_t { /** Scaling mode that defines how the matrix scaling factor for matrix B is interpreted int32_t, default: 0*/ pub const CUBLASLT_MATMUL_DESC_B_SCALE_MODE: cublasLtMatmulDescAttributes_t = cublasLtMatmulDescAttributes_t( 32, ); } impl cublasLtMatmulDescAttributes_t { /** Scaling mode that defines how the matrix scaling factor for matrix C is interpreted int32_t, default: 0*/ pub const CUBLASLT_MATMUL_DESC_C_SCALE_MODE: cublasLtMatmulDescAttributes_t = cublasLtMatmulDescAttributes_t( 33, ); } impl cublasLtMatmulDescAttributes_t { /** Scaling mode that defines how the matrix scaling factor for matrix D is interpreted int32_t, default: 0*/ pub const CUBLASLT_MATMUL_DESC_D_SCALE_MODE: cublasLtMatmulDescAttributes_t = cublasLtMatmulDescAttributes_t( 34, ); } impl cublasLtMatmulDescAttributes_t { /** Scaling mode that defines how the matrix scaling factor for the auxiliary matrix is interpreted int32_t, default: 0*/ pub const CUBLASLT_MATMUL_DESC_EPILOGUE_AUX_SCALE_MODE: cublasLtMatmulDescAttributes_t = cublasLtMatmulDescAttributes_t( 35, ); } impl cublasLtMatmulDescAttributes_t { /** Device pointer to the scale factors that are used to convert data in matrix D to the compute data type range. The scaling factor value type is defined by the scaling mode (see CUBLASLT_MATMUL_DESC_D_OUT_SCALE_MODE) If set for an unsupported matrix data, scale, scale mode, and compute type combination, calling cublasLtMatmul() will return CUBLAS_INVALID_VALUE. void *, default: NULL*/ pub const CUBLASLT_MATMUL_DESC_D_OUT_SCALE_POINTER: cublasLtMatmulDescAttributes_t = cublasLtMatmulDescAttributes_t( 36, ); } impl cublasLtMatmulDescAttributes_t { /** Scaling mode that defines how the output matrix scaling factor for matrix D is interpreted int32_t, default: 0*/ pub const CUBLASLT_MATMUL_DESC_D_OUT_SCALE_MODE: cublasLtMatmulDescAttributes_t = cublasLtMatmulDescAttributes_t( 37, ); } #[repr(transparent)] /// Matmul descriptor attributes to define details of the operation. #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cublasLtMatmulDescAttributes_t(pub ::core::ffi::c_uint); impl cublasLtMatrixTransformDescAttributes_t { /** Scale type, see cudaDataType. Inputs are converted to scale type for scaling and summation and results are then converted to output type to store in memory. int32_t*/ pub const CUBLASLT_MATRIX_TRANSFORM_DESC_SCALE_TYPE: cublasLtMatrixTransformDescAttributes_t = cublasLtMatrixTransformDescAttributes_t( 0, ); } impl cublasLtMatrixTransformDescAttributes_t { /** Pointer mode of alpha and beta, see cublasLtPointerMode_t. int32_t, default: CUBLASLT_POINTER_MODE_HOST*/ pub const CUBLASLT_MATRIX_TRANSFORM_DESC_POINTER_MODE: cublasLtMatrixTransformDescAttributes_t = cublasLtMatrixTransformDescAttributes_t( 1, ); } impl cublasLtMatrixTransformDescAttributes_t { /** Transform of matrix A, see cublasOperation_t. int32_t, default: CUBLAS_OP_N*/ pub const CUBLASLT_MATRIX_TRANSFORM_DESC_TRANSA: cublasLtMatrixTransformDescAttributes_t = cublasLtMatrixTransformDescAttributes_t( 2, ); } impl cublasLtMatrixTransformDescAttributes_t { /** Transform of matrix B, see cublasOperation_t. int32_t, default: CUBLAS_OP_N*/ pub const CUBLASLT_MATRIX_TRANSFORM_DESC_TRANSB: cublasLtMatrixTransformDescAttributes_t = cublasLtMatrixTransformDescAttributes_t( 3, ); } #[repr(transparent)] /// Matrix transform descriptor attributes to define details of the operation. #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cublasLtMatrixTransformDescAttributes_t(pub ::core::ffi::c_uint); impl cublasLtReductionScheme_t { /// No reduction scheme, dot-product shall be performed in one sequence. pub const CUBLASLT_REDUCTION_SCHEME_NONE: cublasLtReductionScheme_t = cublasLtReductionScheme_t( 0, ); } impl cublasLtReductionScheme_t { /** Reduction is performed "in place" - using the output buffer (and output data type) and counters (in workspace) to guarantee the sequentiality.*/ pub const CUBLASLT_REDUCTION_SCHEME_INPLACE: cublasLtReductionScheme_t = cublasLtReductionScheme_t( 1, ); } impl cublasLtReductionScheme_t { /// Intermediate results are stored in compute type in the workspace and reduced in a separate step. pub const CUBLASLT_REDUCTION_SCHEME_COMPUTE_TYPE: cublasLtReductionScheme_t = cublasLtReductionScheme_t( 2, ); } impl cublasLtReductionScheme_t { /// Intermediate results are stored in output type in the workspace and reduced in a separate step. pub const CUBLASLT_REDUCTION_SCHEME_OUTPUT_TYPE: cublasLtReductionScheme_t = cublasLtReductionScheme_t( 4, ); } impl cublasLtReductionScheme_t { /// Intermediate results are stored in output type in the workspace and reduced in a separate step. pub const CUBLASLT_REDUCTION_SCHEME_MASK: cublasLtReductionScheme_t = cublasLtReductionScheme_t( 7, ); } #[repr(transparent)] /// Reduction scheme for portions of the dot-product calculated in parallel (a. k. a. "split - K"). #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cublasLtReductionScheme_t(pub ::core::ffi::c_uint); impl cublasLtEpilogue_t { /// No special postprocessing, just scale and quantize results if necessary. pub const CUBLASLT_EPILOGUE_DEFAULT: cublasLtEpilogue_t = cublasLtEpilogue_t(1); } impl cublasLtEpilogue_t { /// ReLu, apply ReLu point-wise transform to the results (x:=max(x, 0)). pub const CUBLASLT_EPILOGUE_RELU: cublasLtEpilogue_t = cublasLtEpilogue_t(2); } impl cublasLtEpilogue_t { /** ReLu, apply ReLu point-wise transform to the results (x:=max(x, 0)). This epilogue mode produces an extra output, a ReLu bit-mask matrix, see CUBLASLT_MATMUL_DESC_EPILOGUE_AUX_POINTER.*/ pub const CUBLASLT_EPILOGUE_RELU_AUX: cublasLtEpilogue_t = cublasLtEpilogue_t(130); } impl cublasLtEpilogue_t { /** Bias, apply (broadcasted) Bias from bias vector. Bias vector length must match matrix D rows, it must be packed (stride between vector elements is 1). Bias vector is broadcasted to all columns and added before applying final postprocessing.*/ pub const CUBLASLT_EPILOGUE_BIAS: cublasLtEpilogue_t = cublasLtEpilogue_t(4); } impl cublasLtEpilogue_t { /// ReLu and Bias, apply Bias and then ReLu transform pub const CUBLASLT_EPILOGUE_RELU_BIAS: cublasLtEpilogue_t = cublasLtEpilogue_t(6); } impl cublasLtEpilogue_t { /** ReLu and Bias, apply Bias and then ReLu transform This epilogue mode produces an extra output, a ReLu bit-mask matrix, see CUBLASLT_MATMUL_DESC_EPILOGUE_AUX_POINTER.*/ pub const CUBLASLT_EPILOGUE_RELU_AUX_BIAS: cublasLtEpilogue_t = cublasLtEpilogue_t( 134, ); } impl cublasLtEpilogue_t { /** ReLu and Bias, apply Bias and then ReLu transform This epilogue mode produces an extra output, a ReLu bit-mask matrix, see CUBLASLT_MATMUL_DESC_EPILOGUE_AUX_POINTER.*/ pub const CUBLASLT_EPILOGUE_DRELU: cublasLtEpilogue_t = cublasLtEpilogue_t(136); } impl cublasLtEpilogue_t { /** ReLu and Bias, apply Bias and then ReLu transform This epilogue mode produces an extra output, a ReLu bit-mask matrix, see CUBLASLT_MATMUL_DESC_EPILOGUE_AUX_POINTER.*/ pub const CUBLASLT_EPILOGUE_DRELU_BGRAD: cublasLtEpilogue_t = cublasLtEpilogue_t( 152, ); } impl cublasLtEpilogue_t { /// GELU, apply GELU point-wise transform to the results (x:=GELU(x)). pub const CUBLASLT_EPILOGUE_GELU: cublasLtEpilogue_t = cublasLtEpilogue_t(32); } impl cublasLtEpilogue_t { /** GELU, apply GELU point-wise transform to the results (x:=GELU(x)). This epilogue mode outputs GELU input as a separate matrix (useful for training). See CUBLASLT_MATMUL_DESC_EPILOGUE_AUX_POINTER.*/ pub const CUBLASLT_EPILOGUE_GELU_AUX: cublasLtEpilogue_t = cublasLtEpilogue_t(160); } impl cublasLtEpilogue_t { /// GELU and Bias, apply Bias and then GELU transform pub const CUBLASLT_EPILOGUE_GELU_BIAS: cublasLtEpilogue_t = cublasLtEpilogue_t(36); } impl cublasLtEpilogue_t { /** GELU and Bias, apply Bias and then GELU transform This epilogue mode outputs GELU input as a separate matrix (useful for training). See CUBLASLT_MATMUL_DESC_EPILOGUE_AUX_POINTER.*/ pub const CUBLASLT_EPILOGUE_GELU_AUX_BIAS: cublasLtEpilogue_t = cublasLtEpilogue_t( 164, ); } impl cublasLtEpilogue_t { /** GELU and Bias, apply Bias and then GELU transform This epilogue mode outputs GELU input as a separate matrix (useful for training). See CUBLASLT_MATMUL_DESC_EPILOGUE_AUX_POINTER.*/ pub const CUBLASLT_EPILOGUE_DGELU: cublasLtEpilogue_t = cublasLtEpilogue_t(192); } impl cublasLtEpilogue_t { /** GELU and Bias, apply Bias and then GELU transform This epilogue mode outputs GELU input as a separate matrix (useful for training). See CUBLASLT_MATMUL_DESC_EPILOGUE_AUX_POINTER.*/ pub const CUBLASLT_EPILOGUE_DGELU_BGRAD: cublasLtEpilogue_t = cublasLtEpilogue_t( 208, ); } impl cublasLtEpilogue_t { /** Bias gradient based on the input matrix A. The bias size corresponds to the number of rows of the matrix D. The reduction happens over the GEMM's "k" dimension. Stores Bias gradient in the auxiliary output (see CUBLASLT_MATMUL_DESC_BIAS_POINTER).*/ pub const CUBLASLT_EPILOGUE_BGRADA: cublasLtEpilogue_t = cublasLtEpilogue_t(256); } impl cublasLtEpilogue_t { /** Bias gradient based on the input matrix B. The bias size corresponds to the number of columns of the matrix D. The reduction happens over the GEMM's "k" dimension. Stores Bias gradient in the auxiliary output (see CUBLASLT_MATMUL_DESC_BIAS_POINTER).*/ pub const CUBLASLT_EPILOGUE_BGRADB: cublasLtEpilogue_t = cublasLtEpilogue_t(512); } #[repr(transparent)] /// Postprocessing options for the epilogue #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cublasLtEpilogue_t(pub ::core::ffi::c_uint); impl cublasLtMatmulSearch_t { /// ask heuristics for best algo for given usecase pub const CUBLASLT_SEARCH_BEST_FIT: cublasLtMatmulSearch_t = cublasLtMatmulSearch_t( 0, ); } impl cublasLtMatmulSearch_t { /// only try to find best config for preconfigured algo id pub const CUBLASLT_SEARCH_LIMITED_BY_ALGO_ID: cublasLtMatmulSearch_t = cublasLtMatmulSearch_t( 1, ); } impl cublasLtMatmulSearch_t { /// reserved for future use pub const CUBLASLT_SEARCH_RESERVED_02: cublasLtMatmulSearch_t = cublasLtMatmulSearch_t( 2, ); } impl cublasLtMatmulSearch_t { /// reserved for future use pub const CUBLASLT_SEARCH_RESERVED_03: cublasLtMatmulSearch_t = cublasLtMatmulSearch_t( 3, ); } impl cublasLtMatmulSearch_t { /// reserved for future use pub const CUBLASLT_SEARCH_RESERVED_04: cublasLtMatmulSearch_t = cublasLtMatmulSearch_t( 4, ); } impl cublasLtMatmulSearch_t { /// reserved for future use pub const CUBLASLT_SEARCH_RESERVED_05: cublasLtMatmulSearch_t = cublasLtMatmulSearch_t( 5, ); } impl cublasLtMatmulSearch_t { /// reserved for future use pub const CUBLASLT_SEARCH_RESERVED_06: cublasLtMatmulSearch_t = cublasLtMatmulSearch_t( 6, ); } impl cublasLtMatmulSearch_t { /// reserved for future use pub const CUBLASLT_SEARCH_RESERVED_07: cublasLtMatmulSearch_t = cublasLtMatmulSearch_t( 7, ); } impl cublasLtMatmulSearch_t { /// reserved for future use pub const CUBLASLT_SEARCH_RESERVED_08: cublasLtMatmulSearch_t = cublasLtMatmulSearch_t( 8, ); } impl cublasLtMatmulSearch_t { /// reserved for future use pub const CUBLASLT_SEARCH_RESERVED_09: cublasLtMatmulSearch_t = cublasLtMatmulSearch_t( 9, ); } #[repr(transparent)] /// Matmul heuristic search mode #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cublasLtMatmulSearch_t(pub ::core::ffi::c_uint); impl cublasLtMatmulPreferenceAttributes_t { /** Search mode, see cublasLtMatmulSearch_t. uint32_t, default: CUBLASLT_SEARCH_BEST_FIT*/ pub const CUBLASLT_MATMUL_PREF_SEARCH_MODE: cublasLtMatmulPreferenceAttributes_t = cublasLtMatmulPreferenceAttributes_t( 0, ); } impl cublasLtMatmulPreferenceAttributes_t { /** Maximum allowed workspace size in bytes. uint64_t, default: 0 - no workspace allowed*/ pub const CUBLASLT_MATMUL_PREF_MAX_WORKSPACE_BYTES: cublasLtMatmulPreferenceAttributes_t = cublasLtMatmulPreferenceAttributes_t( 1, ); } impl cublasLtMatmulPreferenceAttributes_t { /** Reduction scheme mask, see cublasLtReductionScheme_t. Filters heuristic result to only include algo configs that use one of the required modes. E.g. mask value of 0x03 will allow only INPLACE and COMPUTE_TYPE reduction schemes. uint32_t, default: CUBLASLT_REDUCTION_SCHEME_MASK (allows all reduction schemes)*/ pub const CUBLASLT_MATMUL_PREF_REDUCTION_SCHEME_MASK: cublasLtMatmulPreferenceAttributes_t = cublasLtMatmulPreferenceAttributes_t( 3, ); } impl cublasLtMatmulPreferenceAttributes_t { /** Minimum buffer alignment for matrix A (in bytes). Selecting a smaller value will exclude algorithms that can not work with matrix A that is not as strictly aligned as they need. uint32_t, default: 256*/ pub const CUBLASLT_MATMUL_PREF_MIN_ALIGNMENT_A_BYTES: cublasLtMatmulPreferenceAttributes_t = cublasLtMatmulPreferenceAttributes_t( 5, ); } impl cublasLtMatmulPreferenceAttributes_t { /** Minimum buffer alignment for matrix B (in bytes). Selecting a smaller value will exclude algorithms that can not work with matrix B that is not as strictly aligned as they need. uint32_t, default: 256*/ pub const CUBLASLT_MATMUL_PREF_MIN_ALIGNMENT_B_BYTES: cublasLtMatmulPreferenceAttributes_t = cublasLtMatmulPreferenceAttributes_t( 6, ); } impl cublasLtMatmulPreferenceAttributes_t { /** Minimum buffer alignment for matrix C (in bytes). Selecting a smaller value will exclude algorithms that can not work with matrix C that is not as strictly aligned as they need. uint32_t, default: 256*/ pub const CUBLASLT_MATMUL_PREF_MIN_ALIGNMENT_C_BYTES: cublasLtMatmulPreferenceAttributes_t = cublasLtMatmulPreferenceAttributes_t( 7, ); } impl cublasLtMatmulPreferenceAttributes_t { /** Minimum buffer alignment for matrix D (in bytes). Selecting a smaller value will exclude algorithms that can not work with matrix D that is not as strictly aligned as they need. uint32_t, default: 256*/ pub const CUBLASLT_MATMUL_PREF_MIN_ALIGNMENT_D_BYTES: cublasLtMatmulPreferenceAttributes_t = cublasLtMatmulPreferenceAttributes_t( 8, ); } impl cublasLtMatmulPreferenceAttributes_t { /** Maximum wave count. See cublasLtMatmulHeuristicResult_t::wavesCount. Selecting a non-zero value will exclude algorithms that report device utilization higher than specified. float, default: 0.0f*/ pub const CUBLASLT_MATMUL_PREF_MAX_WAVES_COUNT: cublasLtMatmulPreferenceAttributes_t = cublasLtMatmulPreferenceAttributes_t( 9, ); } impl cublasLtMatmulPreferenceAttributes_t { /** Numerical implementation details mask, see cublasLtNumericalImplFlags_t. Filters heuristic result to only include algorithms that use the allowed implementations. uint64_t, default: uint64_t(-1) (allow everything)*/ pub const CUBLASLT_MATMUL_PREF_IMPL_MASK: cublasLtMatmulPreferenceAttributes_t = cublasLtMatmulPreferenceAttributes_t( 12, ); } #[repr(transparent)] /// Algo search preference to fine tune the heuristic function. #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cublasLtMatmulPreferenceAttributes_t(pub ::core::ffi::c_uint); /** Results structure used by cublasLtMatmulAlgoGetHeuristic Holds returned configured algo descriptor and its runtime properties.*/ #[repr(C)] pub struct cublasLtMatmulHeuristicResult_t { /** Matmul algorithm descriptor. Must be initialized with cublasLtMatmulAlgoInit() if preferences' CUBLASLT_MATMUL_PERF_SEARCH_MODE is set to CUBLASLT_SEARCH_LIMITED_BY_ALGO_ID*/ pub algo: cublasLtMatmulAlgo_t, /// Actual size of workspace memory required. pub workspaceSize: usize, /** Result status, other fields are only valid if after call to cublasLtMatmulAlgoGetHeuristic() this member is set to CUBLAS_STATUS_SUCCESS.*/ pub state: super::cublas::cublasStatus_t, /** Waves count - a device utilization metric. wavesCount value of 1.0f suggests that when kernel is launched it will fully occupy the GPU.*/ pub wavesCount: f32, pub reserved: [::core::ffi::c_int; 4usize], } impl cublasLtMatmulAlgoCapAttributes_t { /** support for split K, see CUBLASLT_ALGO_CONFIG_SPLITK_NUM int32_t, 0 means no support, supported otherwise*/ pub const CUBLASLT_ALGO_CAP_SPLITK_SUPPORT: cublasLtMatmulAlgoCapAttributes_t = cublasLtMatmulAlgoCapAttributes_t( 0, ); } impl cublasLtMatmulAlgoCapAttributes_t { /** reduction scheme mask, see cublasLtReductionScheme_t; shows supported reduction schemes, if reduction scheme is not masked out it is supported. e.g. int isReductionSchemeComputeTypeSupported ? (reductionSchemeMask & CUBLASLT_REDUCTION_SCHEME_COMPUTE_TYPE) == CUBLASLT_REDUCTION_SCHEME_COMPUTE_TYPE ? 1 : 0; uint32_t*/ pub const CUBLASLT_ALGO_CAP_REDUCTION_SCHEME_MASK: cublasLtMatmulAlgoCapAttributes_t = cublasLtMatmulAlgoCapAttributes_t( 1, ); } impl cublasLtMatmulAlgoCapAttributes_t { /** support for cta swizzling, see CUBLASLT_ALGO_CONFIG_CTA_SWIZZLING uint32_t, 0 means no support, 1 means supported value of 1, other values are reserved*/ pub const CUBLASLT_ALGO_CAP_CTA_SWIZZLING_SUPPORT: cublasLtMatmulAlgoCapAttributes_t = cublasLtMatmulAlgoCapAttributes_t( 2, ); } impl cublasLtMatmulAlgoCapAttributes_t { /** support strided batch int32_t, 0 means no support, supported otherwise*/ pub const CUBLASLT_ALGO_CAP_STRIDED_BATCH_SUPPORT: cublasLtMatmulAlgoCapAttributes_t = cublasLtMatmulAlgoCapAttributes_t( 3, ); } impl cublasLtMatmulAlgoCapAttributes_t { /** support results out of place (D != C in D = alpha.A.B + beta.C) int32_t, 0 means no support, supported otherwise*/ pub const CUBLASLT_ALGO_CAP_OUT_OF_PLACE_RESULT_SUPPORT: cublasLtMatmulAlgoCapAttributes_t = cublasLtMatmulAlgoCapAttributes_t( 4, ); } impl cublasLtMatmulAlgoCapAttributes_t { /** syrk/herk support (on top of regular gemm) int32_t, 0 means no support, supported otherwise*/ pub const CUBLASLT_ALGO_CAP_UPLO_SUPPORT: cublasLtMatmulAlgoCapAttributes_t = cublasLtMatmulAlgoCapAttributes_t( 5, ); } impl cublasLtMatmulAlgoCapAttributes_t { /** tile ids possible to use, see cublasLtMatmulTile_t; if no tile ids are supported use CUBLASLT_MATMUL_TILE_UNDEFINED use cublasLtMatmulAlgoCapGetAttribute() with sizeInBytes=0 to query actual count array of uint32_t*/ pub const CUBLASLT_ALGO_CAP_TILE_IDS: cublasLtMatmulAlgoCapAttributes_t = cublasLtMatmulAlgoCapAttributes_t( 6, ); } impl cublasLtMatmulAlgoCapAttributes_t { /** custom option range is from 0 to CUBLASLT_ALGO_CAP_CUSTOM_OPTION_MAX (inclusive), see CUBLASLT_ALGO_CONFIG_CUSTOM_OPTION int32_t*/ pub const CUBLASLT_ALGO_CAP_CUSTOM_OPTION_MAX: cublasLtMatmulAlgoCapAttributes_t = cublasLtMatmulAlgoCapAttributes_t( 7, ); } impl cublasLtMatmulAlgoCapAttributes_t { /** describes if the algorithm supports custom (not COL or ROW memory order), see cublasLtOrder_t int32_t 0 means only COL and ROW memory order is allowed, non-zero means that algo might have different requirements;*/ pub const CUBLASLT_ALGO_CAP_CUSTOM_MEMORY_ORDER: cublasLtMatmulAlgoCapAttributes_t = cublasLtMatmulAlgoCapAttributes_t( 10, ); } impl cublasLtMatmulAlgoCapAttributes_t { /** bitmask enumerating pointer modes algorithm supports uint32_t, see cublasLtPointerModeMask_t*/ pub const CUBLASLT_ALGO_CAP_POINTER_MODE_MASK: cublasLtMatmulAlgoCapAttributes_t = cublasLtMatmulAlgoCapAttributes_t( 11, ); } impl cublasLtMatmulAlgoCapAttributes_t { /** bitmask enumerating kinds of postprocessing algorithm supports in the epilogue uint32_t, see cublasLtEpilogue_t*/ pub const CUBLASLT_ALGO_CAP_EPILOGUE_MASK: cublasLtMatmulAlgoCapAttributes_t = cublasLtMatmulAlgoCapAttributes_t( 12, ); } impl cublasLtMatmulAlgoCapAttributes_t { /** stages ids possible to use, see cublasLtMatmulStages_t; if no stages ids are supported use CUBLASLT_MATMUL_STAGES_UNDEFINED use cublasLtMatmulAlgoCapGetAttribute() with sizeInBytes=0 to query actual count array of uint32_t*/ pub const CUBLASLT_ALGO_CAP_STAGES_IDS: cublasLtMatmulAlgoCapAttributes_t = cublasLtMatmulAlgoCapAttributes_t( 13, ); } impl cublasLtMatmulAlgoCapAttributes_t { /** support for nagative ld for all of the matrices int32_t 0 means no support, supported otherwise*/ pub const CUBLASLT_ALGO_CAP_LD_NEGATIVE: cublasLtMatmulAlgoCapAttributes_t = cublasLtMatmulAlgoCapAttributes_t( 14, ); } impl cublasLtMatmulAlgoCapAttributes_t { /** details about algorithm's implementation that affect it's numerical behavior uint64_t, see cublasLtNumericalImplFlags_t*/ pub const CUBLASLT_ALGO_CAP_NUMERICAL_IMPL_FLAGS: cublasLtMatmulAlgoCapAttributes_t = cublasLtMatmulAlgoCapAttributes_t( 15, ); } impl cublasLtMatmulAlgoCapAttributes_t { /** minimum alignment required for A matrix in bytes (required for buffer pointer, leading dimension, and possibly other strides defined for matrix memory order) uint32_t*/ pub const CUBLASLT_ALGO_CAP_MIN_ALIGNMENT_A_BYTES: cublasLtMatmulAlgoCapAttributes_t = cublasLtMatmulAlgoCapAttributes_t( 16, ); } impl cublasLtMatmulAlgoCapAttributes_t { /** minimum alignment required for B matrix in bytes (required for buffer pointer, leading dimension, and possibly other strides defined for matrix memory order) uint32_t*/ pub const CUBLASLT_ALGO_CAP_MIN_ALIGNMENT_B_BYTES: cublasLtMatmulAlgoCapAttributes_t = cublasLtMatmulAlgoCapAttributes_t( 17, ); } impl cublasLtMatmulAlgoCapAttributes_t { /** minimum alignment required for C matrix in bytes (required for buffer pointer, leading dimension, and possibly other strides defined for matrix memory order) uint32_t*/ pub const CUBLASLT_ALGO_CAP_MIN_ALIGNMENT_C_BYTES: cublasLtMatmulAlgoCapAttributes_t = cublasLtMatmulAlgoCapAttributes_t( 18, ); } impl cublasLtMatmulAlgoCapAttributes_t { /** minimum alignment required for D matrix in bytes (required for buffer pointer, leading dimension, and possibly other strides defined for matrix memory order) uint32_t*/ pub const CUBLASLT_ALGO_CAP_MIN_ALIGNMENT_D_BYTES: cublasLtMatmulAlgoCapAttributes_t = cublasLtMatmulAlgoCapAttributes_t( 19, ); } impl cublasLtMatmulAlgoCapAttributes_t { /** support pointer array batch int32_t, 0 means no support, supported otherwise*/ pub const CUBLASLT_ALGO_CAP_POINTER_ARRAY_BATCH_SUPPORT: cublasLtMatmulAlgoCapAttributes_t = cublasLtMatmulAlgoCapAttributes_t( 21, ); } impl cublasLtMatmulAlgoCapAttributes_t { /** describes if the algorithm supports floating point emulation int32_t*/ pub const CUBLASLT_ALGO_CAP_FLOATING_POINT_EMULATION_SUPPORT: cublasLtMatmulAlgoCapAttributes_t = cublasLtMatmulAlgoCapAttributes_t( 22, ); } #[repr(transparent)] /// Capabilities Attributes that can be retrieved from an initialized Algo structure #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cublasLtMatmulAlgoCapAttributes_t(pub ::core::ffi::c_uint); impl cublasLtMatmulAlgoConfigAttributes_t { /** algorithm index, see cublasLtMatmulAlgoGetIds() readonly, set by cublasLtMatmulAlgoInit() int32_t*/ pub const CUBLASLT_ALGO_CONFIG_ID: cublasLtMatmulAlgoConfigAttributes_t = cublasLtMatmulAlgoConfigAttributes_t( 0, ); } impl cublasLtMatmulAlgoConfigAttributes_t { /** tile id, see cublasLtMatmulTile_t uint32_t, default: CUBLASLT_MATMUL_TILE_UNDEFINED*/ pub const CUBLASLT_ALGO_CONFIG_TILE_ID: cublasLtMatmulAlgoConfigAttributes_t = cublasLtMatmulAlgoConfigAttributes_t( 1, ); } impl cublasLtMatmulAlgoConfigAttributes_t { /** Number of K splits. If the number of K splits is greater than one, SPLITK_NUM parts of matrix multiplication will be computed in parallel. The results will be accumulated according to CUBLASLT_ALGO_CONFIG_REDUCTION_SCHEME int32_t, default: 1*/ pub const CUBLASLT_ALGO_CONFIG_SPLITK_NUM: cublasLtMatmulAlgoConfigAttributes_t = cublasLtMatmulAlgoConfigAttributes_t( 2, ); } impl cublasLtMatmulAlgoConfigAttributes_t { /** reduction scheme, see cublasLtReductionScheme_t uint32_t, default: CUBLASLT_REDUCTION_SCHEME_NONE*/ pub const CUBLASLT_ALGO_CONFIG_REDUCTION_SCHEME: cublasLtMatmulAlgoConfigAttributes_t = cublasLtMatmulAlgoConfigAttributes_t( 3, ); } impl cublasLtMatmulAlgoConfigAttributes_t { /** cta swizzling, change mapping from CUDA grid coordinates to parts of the matrices possible values: 0, 1, other values reserved uint32_t, default: 0*/ pub const CUBLASLT_ALGO_CONFIG_CTA_SWIZZLING: cublasLtMatmulAlgoConfigAttributes_t = cublasLtMatmulAlgoConfigAttributes_t( 4, ); } impl cublasLtMatmulAlgoConfigAttributes_t { /** custom option, each algorithm can support some custom options that don't fit description of the other config attributes, see CUBLASLT_ALGO_CAP_CUSTOM_OPTION_MAX to get accepted range for any specific case uint32_t, default: 0*/ pub const CUBLASLT_ALGO_CONFIG_CUSTOM_OPTION: cublasLtMatmulAlgoConfigAttributes_t = cublasLtMatmulAlgoConfigAttributes_t( 5, ); } impl cublasLtMatmulAlgoConfigAttributes_t { /** stages id, see cublasLtMatmulStages_t uint32_t, default: CUBLASLT_MATMUL_STAGES_UNDEFINED*/ pub const CUBLASLT_ALGO_CONFIG_STAGES_ID: cublasLtMatmulAlgoConfigAttributes_t = cublasLtMatmulAlgoConfigAttributes_t( 6, ); } impl cublasLtMatmulAlgoConfigAttributes_t { /** inner shape id, see cublasLtMatmulInnerShape_t uint16_t, default: 0 (CUBLASLT_MATMUL_INNER_SHAPE_UNDEFINED)*/ pub const CUBLASLT_ALGO_CONFIG_INNER_SHAPE_ID: cublasLtMatmulAlgoConfigAttributes_t = cublasLtMatmulAlgoConfigAttributes_t( 7, ); } impl cublasLtMatmulAlgoConfigAttributes_t { /** Thread Block Cluster shape id, see cublasLtClusterShape_t. Defines cluster size to use. uint16_t, default: 0 (CUBLASLT_CLUSTER_SHAPE_AUTO)*/ pub const CUBLASLT_ALGO_CONFIG_CLUSTER_SHAPE_ID: cublasLtMatmulAlgoConfigAttributes_t = cublasLtMatmulAlgoConfigAttributes_t( 8, ); } #[repr(transparent)] /// Algo Configuration Attributes that can be set according to the Algo capabilities #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cublasLtMatmulAlgoConfigAttributes_t(pub ::core::ffi::c_uint); /// Experimental: Logger callback type. pub type cublasLtLoggerCallback_t = ::core::option::Option< unsafe extern "C" fn( logLevel: ::core::ffi::c_int, functionName: *const ::core::ffi::c_char, message: *const ::core::ffi::c_char, ), >; ================================================ FILE: cuda_types/src/cuda.rs ================================================ // Generated automatically by zluda_bindgen // DO NOT EDIT MANUALLY #![allow(warnings)] pub const CUDA_VERSION: u32 = 13000; pub const CU_IPC_HANDLE_SIZE: u32 = 64; pub const CU_COMPUTE_ACCELERATED_TARGET_BASE: u32 = 65536; pub const CU_COMPUTE_FAMILY_TARGET_BASE: u32 = 131072; pub const CU_GRAPH_COND_ASSIGN_DEFAULT: u32 = 1; pub const CU_GRAPH_KERNEL_NODE_PORT_DEFAULT: u32 = 0; pub const CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC: u32 = 1; pub const CU_GRAPH_KERNEL_NODE_PORT_LAUNCH_ORDER: u32 = 2; pub const CU_MEMHOSTALLOC_PORTABLE: u32 = 1; pub const CU_MEMHOSTALLOC_DEVICEMAP: u32 = 2; 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 CU_TENSOR_MAP_NUM_QWORDS: u32 = 16; 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 CU_MEM_CREATE_USAGE_HW_DECOMPRESS: u32 = 2; pub const CU_MEM_POOL_CREATE_USAGE_HW_DECOMPRESS: u32 = 2; 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; pub const CUDA_ARRAY3D_2DARRAY: u32 = 1; pub const CUDA_ARRAY3D_SURFACE_LDST: u32 = 2; 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 CUDA_ARRAY3D_DEFERRED_MAPPING: u32 = 128; pub const CUDA_ARRAY3D_VIDEO_ENCODE_DECODE: u32 = 256; 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_TRSF_SEAMLESS_CUBEMAP: u32 = 64; pub const CU_LAUNCH_KERNEL_REQUIRED_BLOCK_DIM: u32 = 1; pub const CU_LAUNCH_PARAM_END_AS_INT: u32 = 0; pub const CU_LAUNCH_PARAM_BUFFER_POINTER_AS_INT: u32 = 1; pub const CU_LAUNCH_PARAM_BUFFER_SIZE_AS_INT: u32 = 2; pub const CU_PARAM_TR_DEFAULT: i32 = -1; pub const CUDA_EGL_INFINITE_TIMEOUT: u32 = 4294967295; pub type cuuint32_t = u32; pub type cuuint64_t = u64; #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUdeviceptr_v2(pub *mut ::core::ffi::c_void); pub type CUdeviceptr = CUdeviceptr_v2; pub type CUdevice_v1 = ::core::ffi::c_int; pub type CUdevice = CUdevice_v1; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct CUctx_st { _unused: [u8; 0], } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUcontext(pub *mut CUctx_st); #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct CUmod_st { _unused: [u8; 0], } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUmodule(pub *mut CUmod_st); #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct CUfunc_st { _unused: [u8; 0], } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUfunction(pub *mut CUfunc_st); #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct CUlib_st { _unused: [u8; 0], } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUlibrary(pub *mut CUlib_st); #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct CUkern_st { _unused: [u8; 0], } pub type CUkernel = *mut CUkern_st; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct CUarray_st { _unused: [u8; 0], } pub type CUarray = *mut CUarray_st; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct CUmipmappedArray_st { _unused: [u8; 0], } pub type CUmipmappedArray = *mut CUmipmappedArray_st; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct CUtexref_st { _unused: [u8; 0], } pub type CUtexref = *mut CUtexref_st; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct CUsurfref_st { _unused: [u8; 0], } pub type CUsurfref = *mut CUsurfref_st; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct CUevent_st { _unused: [u8; 0], } pub type CUevent = *mut CUevent_st; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct CUstream_st { _unused: [u8; 0], } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUstream(pub *mut CUstream_st); #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct CUgraphicsResource_st { _unused: [u8; 0], } pub type CUgraphicsResource = *mut CUgraphicsResource_st; pub type CUtexObject_v1 = ::core::ffi::c_ulonglong; pub type CUtexObject = CUtexObject_v1; pub type CUsurfObject_v1 = ::core::ffi::c_ulonglong; pub type CUsurfObject = CUsurfObject_v1; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct CUextMemory_st { _unused: [u8; 0], } pub type CUexternalMemory = *mut CUextMemory_st; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct CUextSemaphore_st { _unused: [u8; 0], } pub type CUexternalSemaphore = *mut CUextSemaphore_st; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct CUgraph_st { _unused: [u8; 0], } pub type CUgraph = *mut CUgraph_st; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct CUgraphNode_st { _unused: [u8; 0], } pub type CUgraphNode = *mut CUgraphNode_st; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct CUgraphExec_st { _unused: [u8; 0], } 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, Copy, Clone)] pub struct CUuserObject_st { _unused: [u8; 0], } pub type CUuserObject = *mut CUuserObject_st; pub type CUgraphConditionalHandle = cuuint64_t; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct CUgraphDeviceUpdatableNode_st { _unused: [u8; 0], } pub type CUgraphDeviceNode = *mut CUgraphDeviceUpdatableNode_st; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct CUasyncCallbackEntry_st { _unused: [u8; 0], } pub type CUasyncCallbackHandle = *mut CUasyncCallbackEntry_st; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct CUgreenCtx_st { _unused: [u8; 0], } /** \typedef typedef struct CUgreenCtx_st* CUgreenCtx A green context handle. This handle can be used safely from only one CPU thread at a time. Created via ::cuGreenCtxCreate*/ pub type CUgreenCtx = *mut CUgreenCtx_st; #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUuuid_st { pub bytes: [::core::ffi::c_uchar; 16usize], } pub type CUuuid = CUuuid_st; /** Fabric handle - An opaque handle representing a memory allocation that can be exported to processes in same or different nodes. For IPC between processes on different nodes they must be connected via the NVSwitch fabric.*/ #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUmemFabricHandle_st { pub data: [::core::ffi::c_uchar; 64usize], } /** Fabric handle - An opaque handle representing a memory allocation that can be exported to processes in same or different nodes. For IPC between processes on different nodes they must be connected via the NVSwitch fabric.*/ pub type CUmemFabricHandle_v1 = CUmemFabricHandle_st; /** Fabric handle - An opaque handle representing a memory allocation that can be exported to processes in same or different nodes. For IPC between processes on different nodes they must be connected via the NVSwitch fabric.*/ pub type CUmemFabricHandle = CUmemFabricHandle_v1; /// CUDA IPC event handle #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUipcEventHandle_st { pub reserved: [::core::ffi::c_char; 64usize], } /// CUDA IPC event handle pub type CUipcEventHandle_v1 = CUipcEventHandle_st; /// CUDA IPC event handle pub type CUipcEventHandle = CUipcEventHandle_v1; /// CUDA IPC mem handle #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUipcMemHandle_st { pub reserved: [::core::ffi::c_char; 64usize], } /// CUDA IPC mem handle pub type CUipcMemHandle_v1 = CUipcMemHandle_st; /// CUDA IPC mem handle pub type CUipcMemHandle = CUipcMemHandle_v1; impl CUipcMem_flags_enum { ///< Automatically enable peer access between remote devices as needed pub const CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS: CUipcMem_flags_enum = CUipcMem_flags_enum( 1, ); } #[repr(transparent)] /// CUDA Ipc Mem Flags #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUipcMem_flags_enum(pub ::core::ffi::c_uint); /// CUDA Ipc Mem Flags pub use self::CUipcMem_flags_enum as CUipcMem_flags; impl CUmemAttach_flags_enum { ///< Memory can be accessed by any stream on any device pub const CU_MEM_ATTACH_GLOBAL: CUmemAttach_flags_enum = CUmemAttach_flags_enum(1); } impl CUmemAttach_flags_enum { ///< Memory cannot be accessed by any stream on any device pub const CU_MEM_ATTACH_HOST: CUmemAttach_flags_enum = CUmemAttach_flags_enum(2); } impl CUmemAttach_flags_enum { ///< Memory can only be accessed by a single stream on the associated device pub const CU_MEM_ATTACH_SINGLE: CUmemAttach_flags_enum = CUmemAttach_flags_enum(4); } #[repr(transparent)] /// CUDA Mem Attach Flags #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUmemAttach_flags_enum(pub ::core::ffi::c_uint); /// CUDA Mem Attach Flags pub use self::CUmemAttach_flags_enum as CUmemAttach_flags; impl CUctx_flags_enum { ///< Automatic scheduling pub const CU_CTX_SCHED_AUTO: CUctx_flags_enum = CUctx_flags_enum(0); } impl CUctx_flags_enum { ///< Set spin as default scheduling pub const CU_CTX_SCHED_SPIN: CUctx_flags_enum = CUctx_flags_enum(1); } impl CUctx_flags_enum { ///< Set yield as default scheduling pub const CU_CTX_SCHED_YIELD: CUctx_flags_enum = CUctx_flags_enum(2); } impl CUctx_flags_enum { ///< Set blocking synchronization as default scheduling pub const CU_CTX_SCHED_BLOCKING_SYNC: CUctx_flags_enum = CUctx_flags_enum(4); } impl CUctx_flags_enum { /**< Set blocking synchronization as default scheduling \deprecated This flag was deprecated as of CUDA 4.0 and was replaced with ::CU_CTX_SCHED_BLOCKING_SYNC.*/ pub const CU_CTX_BLOCKING_SYNC: CUctx_flags_enum = CUctx_flags_enum(4); } impl CUctx_flags_enum { pub const CU_CTX_SCHED_MASK: CUctx_flags_enum = CUctx_flags_enum(7); } impl CUctx_flags_enum { /**< \deprecated This flag was deprecated as of CUDA 11.0 and it no longer has any effect. All contexts as of CUDA 3.2 behave as though the flag is enabled.*/ pub const CU_CTX_MAP_HOST: CUctx_flags_enum = CUctx_flags_enum(8); } impl CUctx_flags_enum { ///< Keep local memory allocation after launch pub const CU_CTX_LMEM_RESIZE_TO_MAX: CUctx_flags_enum = CUctx_flags_enum(16); } impl CUctx_flags_enum { ///< Trigger coredumps from exceptions in this context pub const CU_CTX_COREDUMP_ENABLE: CUctx_flags_enum = CUctx_flags_enum(32); } impl CUctx_flags_enum { ///< Enable user pipe to trigger coredumps in this context pub const CU_CTX_USER_COREDUMP_ENABLE: CUctx_flags_enum = CUctx_flags_enum(64); } impl CUctx_flags_enum { ///< Ensure synchronous memory operations on this context will synchronize pub const CU_CTX_SYNC_MEMOPS: CUctx_flags_enum = CUctx_flags_enum(128); } impl CUctx_flags_enum { pub const CU_CTX_FLAGS_MASK: CUctx_flags_enum = CUctx_flags_enum(255); } #[repr(transparent)] /// Context creation flags #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUctx_flags_enum(pub ::core::ffi::c_uint); /// Context creation flags pub use self::CUctx_flags_enum as CUctx_flags; impl CUevent_sched_flags_enum { ///< Automatic scheduling pub const CU_EVENT_SCHED_AUTO: CUevent_sched_flags_enum = CUevent_sched_flags_enum( 0, ); } impl CUevent_sched_flags_enum { ///< Set spin as default scheduling pub const CU_EVENT_SCHED_SPIN: CUevent_sched_flags_enum = CUevent_sched_flags_enum( 1, ); } impl CUevent_sched_flags_enum { ///< Set yield as default scheduling pub const CU_EVENT_SCHED_YIELD: CUevent_sched_flags_enum = CUevent_sched_flags_enum( 2, ); } impl CUevent_sched_flags_enum { ///< Set blocking synchronization as default scheduling pub const CU_EVENT_SCHED_BLOCKING_SYNC: CUevent_sched_flags_enum = CUevent_sched_flags_enum( 4, ); } #[repr(transparent)] /// Event sched flags #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUevent_sched_flags_enum(pub ::core::ffi::c_uint); /// Event sched flags pub use self::CUevent_sched_flags_enum as CUevent_sched_flags; impl CUstream_flags_enum { ///< Default stream flag pub const CU_STREAM_DEFAULT: CUstream_flags_enum = CUstream_flags_enum(0); } impl CUstream_flags_enum { ///< Stream does not synchronize with stream 0 (the NULL stream) pub const CU_STREAM_NON_BLOCKING: CUstream_flags_enum = CUstream_flags_enum(1); } #[repr(transparent)] /// Stream creation flags #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUstream_flags_enum(pub ::core::ffi::c_uint); /// Stream creation flags pub use self::CUstream_flags_enum as CUstream_flags; impl CUevent_flags_enum { ///< Default event flag pub const CU_EVENT_DEFAULT: CUevent_flags_enum = CUevent_flags_enum(0); } impl CUevent_flags_enum { ///< Event uses blocking synchronization pub const CU_EVENT_BLOCKING_SYNC: CUevent_flags_enum = CUevent_flags_enum(1); } impl CUevent_flags_enum { ///< Event will not record timing data pub const CU_EVENT_DISABLE_TIMING: CUevent_flags_enum = CUevent_flags_enum(2); } impl CUevent_flags_enum { ///< Event is suitable for interprocess use. CU_EVENT_DISABLE_TIMING must be set pub const CU_EVENT_INTERPROCESS: CUevent_flags_enum = CUevent_flags_enum(4); } #[repr(transparent)] /// Event creation flags #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUevent_flags_enum(pub ::core::ffi::c_uint); /// Event creation flags pub use self::CUevent_flags_enum as CUevent_flags; impl CUevent_record_flags_enum { ///< Default event record flag pub const CU_EVENT_RECORD_DEFAULT: CUevent_record_flags_enum = CUevent_record_flags_enum( 0, ); } impl CUevent_record_flags_enum { /**< When using stream capture, create an event record node instead of the default behavior. This flag is invalid when used outside of capture.*/ pub const CU_EVENT_RECORD_EXTERNAL: CUevent_record_flags_enum = CUevent_record_flags_enum( 1, ); } #[repr(transparent)] /// Event record flags #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUevent_record_flags_enum(pub ::core::ffi::c_uint); /// Event record flags pub use self::CUevent_record_flags_enum as CUevent_record_flags; impl CUevent_wait_flags_enum { ///< Default event wait flag pub const CU_EVENT_WAIT_DEFAULT: CUevent_wait_flags_enum = CUevent_wait_flags_enum( 0, ); } impl CUevent_wait_flags_enum { /**< When using stream capture, create an event wait node instead of the default behavior. This flag is invalid when used outside of capture.*/ pub const CU_EVENT_WAIT_EXTERNAL: CUevent_wait_flags_enum = CUevent_wait_flags_enum( 1, ); } #[repr(transparent)] /// Event wait flags #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUevent_wait_flags_enum(pub ::core::ffi::c_uint); /// Event wait flags pub use self::CUevent_wait_flags_enum as CUevent_wait_flags; impl CUstreamWaitValue_flags_enum { /**< Wait until (int32_t)(*addr - value) >= 0 (or int64_t for 64 bit values). Note this is a cyclic comparison which ignores wraparound. (Default behavior.)*/ pub const CU_STREAM_WAIT_VALUE_GEQ: CUstreamWaitValue_flags_enum = CUstreamWaitValue_flags_enum( 0, ); } impl CUstreamWaitValue_flags_enum { ///< Wait until *addr == value. pub const CU_STREAM_WAIT_VALUE_EQ: CUstreamWaitValue_flags_enum = CUstreamWaitValue_flags_enum( 1, ); } impl CUstreamWaitValue_flags_enum { ///< Wait until (*addr & value) != 0. pub const CU_STREAM_WAIT_VALUE_AND: CUstreamWaitValue_flags_enum = CUstreamWaitValue_flags_enum( 2, ); } impl CUstreamWaitValue_flags_enum { /**< Wait until ~(*addr | value) != 0. Support for this operation can be queried with ::cuDeviceGetAttribute() and ::CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR.*/ pub const CU_STREAM_WAIT_VALUE_NOR: CUstreamWaitValue_flags_enum = CUstreamWaitValue_flags_enum( 3, ); } impl CUstreamWaitValue_flags_enum { /**< Follow the wait operation with a flush of outstanding remote writes. This means that, if a remote write operation is guaranteed to have reached the device before the wait can be satisfied, that write is guaranteed to be visible to downstream device work. The device is permitted to reorder remote writes internally. For example, this flag would be required if two remote writes arrive in a defined order, the wait is satisfied by the second write, and downstream work needs to observe the first write. Support for this operation is restricted to selected platforms and can be queried with ::CU_DEVICE_ATTRIBUTE_CAN_FLUSH_REMOTE_WRITES.*/ pub const CU_STREAM_WAIT_VALUE_FLUSH: CUstreamWaitValue_flags_enum = CUstreamWaitValue_flags_enum( 1073741824, ); } #[repr(transparent)] /// Flags for ::cuStreamWaitValue32 and ::cuStreamWaitValue64 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUstreamWaitValue_flags_enum(pub ::core::ffi::c_uint); /// Flags for ::cuStreamWaitValue32 and ::cuStreamWaitValue64 pub use self::CUstreamWaitValue_flags_enum as CUstreamWaitValue_flags; impl CUstreamWriteValue_flags_enum { ///< Default behavior pub const CU_STREAM_WRITE_VALUE_DEFAULT: CUstreamWriteValue_flags_enum = CUstreamWriteValue_flags_enum( 0, ); } impl CUstreamWriteValue_flags_enum { /**< Permits the write to be reordered with writes which were issued before it, as a performance optimization. Normally, ::cuStreamWriteValue32 will provide a memory fence before the write, which has similar semantics to __threadfence_system() but is scoped to the stream rather than a CUDA thread. This flag is not supported in the v2 API.*/ pub const CU_STREAM_WRITE_VALUE_NO_MEMORY_BARRIER: CUstreamWriteValue_flags_enum = CUstreamWriteValue_flags_enum( 1, ); } #[repr(transparent)] /// Flags for ::cuStreamWriteValue32 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUstreamWriteValue_flags_enum(pub ::core::ffi::c_uint); /// Flags for ::cuStreamWriteValue32 pub use self::CUstreamWriteValue_flags_enum as CUstreamWriteValue_flags; impl CUstreamBatchMemOpType_enum { ///< Represents a ::cuStreamWaitValue32 operation pub const CU_STREAM_MEM_OP_WAIT_VALUE_32: CUstreamBatchMemOpType_enum = CUstreamBatchMemOpType_enum( 1, ); } impl CUstreamBatchMemOpType_enum { ///< Represents a ::cuStreamWriteValue32 operation pub const CU_STREAM_MEM_OP_WRITE_VALUE_32: CUstreamBatchMemOpType_enum = CUstreamBatchMemOpType_enum( 2, ); } impl CUstreamBatchMemOpType_enum { ///< Represents a ::cuStreamWaitValue64 operation pub const CU_STREAM_MEM_OP_WAIT_VALUE_64: CUstreamBatchMemOpType_enum = CUstreamBatchMemOpType_enum( 4, ); } impl CUstreamBatchMemOpType_enum { ///< Represents a ::cuStreamWriteValue64 operation pub const CU_STREAM_MEM_OP_WRITE_VALUE_64: CUstreamBatchMemOpType_enum = CUstreamBatchMemOpType_enum( 5, ); } impl CUstreamBatchMemOpType_enum { ///< Insert a memory barrier of the specified type pub const CU_STREAM_MEM_OP_BARRIER: CUstreamBatchMemOpType_enum = CUstreamBatchMemOpType_enum( 6, ); } impl CUstreamBatchMemOpType_enum { /**< This has the same effect as ::CU_STREAM_WAIT_VALUE_FLUSH, but as a standalone operation.*/ pub const CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES: CUstreamBatchMemOpType_enum = CUstreamBatchMemOpType_enum( 3, ); } #[repr(transparent)] /// Operations for ::cuStreamBatchMemOp #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUstreamBatchMemOpType_enum(pub ::core::ffi::c_uint); /// Operations for ::cuStreamBatchMemOp pub use self::CUstreamBatchMemOpType_enum as CUstreamBatchMemOpType; impl CUstreamMemoryBarrier_flags_enum { ///< System-wide memory barrier. pub const CU_STREAM_MEMORY_BARRIER_TYPE_SYS: CUstreamMemoryBarrier_flags_enum = CUstreamMemoryBarrier_flags_enum( 0, ); } impl CUstreamMemoryBarrier_flags_enum { ///< Limit memory barrier scope to the GPU. pub const CU_STREAM_MEMORY_BARRIER_TYPE_GPU: CUstreamMemoryBarrier_flags_enum = CUstreamMemoryBarrier_flags_enum( 1, ); } #[repr(transparent)] /// Flags for ::CUstreamBatchMemOpParams::memoryBarrier #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUstreamMemoryBarrier_flags_enum(pub ::core::ffi::c_uint); /// Flags for ::CUstreamBatchMemOpParams::memoryBarrier pub use self::CUstreamMemoryBarrier_flags_enum as CUstreamMemoryBarrier_flags; /// Per-operation parameters for ::cuStreamBatchMemOp #[repr(C)] #[derive(Copy, Clone)] pub union CUstreamBatchMemOpParams_union { ///< Operation. This is the first field of all the union elemets and acts as a TAG to determine which union member is valid. pub operation: CUstreamBatchMemOpType, ///< Params for ::CU_STREAM_MEM_OP_WAIT_VALUE_32 and ::CU_STREAM_MEM_OP_WAIT_VALUE_64 operations. pub waitValue: CUstreamBatchMemOpParams_union_CUstreamMemOpWaitValueParams_st, ///< Params for ::CU_STREAM_MEM_OP_WRITE_VALUE_32 and ::CU_STREAM_MEM_OP_WRITE_VALUE_64 operations. pub writeValue: CUstreamBatchMemOpParams_union_CUstreamMemOpWriteValueParams_st, ///< Params for ::CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES operations. pub flushRemoteWrites: CUstreamBatchMemOpParams_union_CUstreamMemOpFlushRemoteWritesParams_st, ///< Params for ::CU_STREAM_MEM_OP_BARRIER operations. pub memoryBarrier: CUstreamBatchMemOpParams_union_CUstreamMemOpMemoryBarrierParams_st, pub pad: [cuuint64_t; 6usize], } #[repr(C)] #[derive(Copy, Clone)] pub struct CUstreamBatchMemOpParams_union_CUstreamMemOpWaitValueParams_st { pub operation: CUstreamBatchMemOpType, pub address: CUdeviceptr, pub __bindgen_anon_1: CUstreamBatchMemOpParams_union_CUstreamMemOpWaitValueParams_st__bindgen_ty_1, ///< See ::CUstreamWaitValue_flags. pub flags: ::core::ffi::c_uint, ///< For driver internal use. Initial value is unimportant. pub alias: CUdeviceptr, } #[repr(C)] #[derive(Copy, Clone)] pub union CUstreamBatchMemOpParams_union_CUstreamMemOpWaitValueParams_st__bindgen_ty_1 { pub value: cuuint32_t, pub value64: cuuint64_t, } #[repr(C)] #[derive(Copy, Clone)] pub struct CUstreamBatchMemOpParams_union_CUstreamMemOpWriteValueParams_st { pub operation: CUstreamBatchMemOpType, pub address: CUdeviceptr, pub __bindgen_anon_1: CUstreamBatchMemOpParams_union_CUstreamMemOpWriteValueParams_st__bindgen_ty_1, ///< See ::CUstreamWriteValue_flags. pub flags: ::core::ffi::c_uint, ///< For driver internal use. Initial value is unimportant. pub alias: CUdeviceptr, } #[repr(C)] #[derive(Copy, Clone)] pub union CUstreamBatchMemOpParams_union_CUstreamMemOpWriteValueParams_st__bindgen_ty_1 { pub value: cuuint32_t, pub value64: cuuint64_t, } #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUstreamBatchMemOpParams_union_CUstreamMemOpFlushRemoteWritesParams_st { pub operation: CUstreamBatchMemOpType, ///< Must be 0. pub flags: ::core::ffi::c_uint, } #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUstreamBatchMemOpParams_union_CUstreamMemOpMemoryBarrierParams_st { pub operation: CUstreamBatchMemOpType, ///< See ::CUstreamMemoryBarrier_flags pub flags: ::core::ffi::c_uint, } /// Per-operation parameters for ::cuStreamBatchMemOp pub type CUstreamBatchMemOpParams_v1 = CUstreamBatchMemOpParams_union; /// Per-operation parameters for ::cuStreamBatchMemOp pub type CUstreamBatchMemOpParams = CUstreamBatchMemOpParams_v1; /** Batch memory operation node parameters Used in the legacy ::cuGraphAddBatchMemOpNode api. New code should use ::cuGraphAddNode()*/ #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st { pub ctx: CUcontext, pub count: ::core::ffi::c_uint, pub paramArray: *mut CUstreamBatchMemOpParams, pub flags: ::core::ffi::c_uint, } /** Batch memory operation node parameters Used in the legacy ::cuGraphAddBatchMemOpNode api. New code should use ::cuGraphAddNode()*/ pub type CUDA_BATCH_MEM_OP_NODE_PARAMS_v1 = CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st; /** Batch memory operation node parameters Used in the legacy ::cuGraphAddBatchMemOpNode api. New code should use ::cuGraphAddNode()*/ pub type CUDA_BATCH_MEM_OP_NODE_PARAMS = CUDA_BATCH_MEM_OP_NODE_PARAMS_v1; /// Batch memory operation node parameters #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st { ///< Context to use for the operations. pub ctx: CUcontext, ///< Number of operations in paramArray. pub count: ::core::ffi::c_uint, ///< Array of batch memory operations. pub paramArray: *mut CUstreamBatchMemOpParams, ///< Flags to control the node. pub flags: ::core::ffi::c_uint, } /// Batch memory operation node parameters pub type CUDA_BATCH_MEM_OP_NODE_PARAMS_v2 = CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st; impl CUoccupancy_flags_enum { ///< Default behavior pub const CU_OCCUPANCY_DEFAULT: CUoccupancy_flags_enum = CUoccupancy_flags_enum(0); } impl CUoccupancy_flags_enum { ///< Assume global caching is enabled and cannot be automatically turned off pub const CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE: CUoccupancy_flags_enum = CUoccupancy_flags_enum( 1, ); } #[repr(transparent)] /// Occupancy calculator flag #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUoccupancy_flags_enum(pub ::core::ffi::c_uint); /// Occupancy calculator flag pub use self::CUoccupancy_flags_enum as CUoccupancy_flags; impl CUstreamUpdateCaptureDependencies_flags_enum { ///< Add new nodes to the dependency set pub const CU_STREAM_ADD_CAPTURE_DEPENDENCIES: CUstreamUpdateCaptureDependencies_flags_enum = CUstreamUpdateCaptureDependencies_flags_enum( 0, ); } impl CUstreamUpdateCaptureDependencies_flags_enum { ///< Replace the dependency set with the new nodes pub const CU_STREAM_SET_CAPTURE_DEPENDENCIES: CUstreamUpdateCaptureDependencies_flags_enum = CUstreamUpdateCaptureDependencies_flags_enum( 1, ); } #[repr(transparent)] /// Flags for ::cuStreamUpdateCaptureDependencies #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUstreamUpdateCaptureDependencies_flags_enum(pub ::core::ffi::c_uint); /// Flags for ::cuStreamUpdateCaptureDependencies pub use self::CUstreamUpdateCaptureDependencies_flags_enum as CUstreamUpdateCaptureDependencies_flags; impl CUasyncNotificationType_enum { ///< Sent when the process has exceeded its device memory budget pub const CU_ASYNC_NOTIFICATION_TYPE_OVER_BUDGET: CUasyncNotificationType_enum = CUasyncNotificationType_enum( 1, ); } #[repr(transparent)] /// Types of async notification that can be sent #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUasyncNotificationType_enum(pub ::core::ffi::c_uint); /// Types of async notification that can be sent pub use self::CUasyncNotificationType_enum as CUasyncNotificationType; /// Information passed to the user via the async notification callback #[repr(C)] #[derive(Copy, Clone)] pub struct CUasyncNotificationInfo_st { ///< The type of notification being sent pub type_: CUasyncNotificationType, ///< Information about the notification. \p type must be checked in order to interpret this field. pub info: CUasyncNotificationInfo_st__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] pub union CUasyncNotificationInfo_st__bindgen_ty_1 { ///< Information about notifications of type \p CU_ASYNC_NOTIFICATION_TYPE_OVER_BUDGET pub overBudget: CUasyncNotificationInfo_st__bindgen_ty_1__bindgen_ty_1, } #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUasyncNotificationInfo_st__bindgen_ty_1__bindgen_ty_1 { ///< The number of bytes that the process has allocated above its device memory budget pub bytesOverBudget: ::core::ffi::c_ulonglong, } /// Information passed to the user via the async notification callback pub type CUasyncNotificationInfo = CUasyncNotificationInfo_st; /** CUDA async notification callback \param info Information describing what actions to take as a result of this notification. \param userData Pointer to user defined data provided at callback registration. \param callback The callback handle associated with this specific callback.*/ pub type CUasyncCallback = ::core::option::Option< unsafe extern "system" fn( info: *mut CUasyncNotificationInfo, userData: *mut ::core::ffi::c_void, callback: CUasyncCallbackHandle, ), >; impl CUarray_format_enum { ///< Unsigned 8-bit integers pub const CU_AD_FORMAT_UNSIGNED_INT8: CUarray_format_enum = CUarray_format_enum(1); } impl CUarray_format_enum { ///< Unsigned 16-bit integers pub const CU_AD_FORMAT_UNSIGNED_INT16: CUarray_format_enum = CUarray_format_enum(2); } impl CUarray_format_enum { ///< Unsigned 32-bit integers pub const CU_AD_FORMAT_UNSIGNED_INT32: CUarray_format_enum = CUarray_format_enum(3); } impl CUarray_format_enum { ///< Signed 8-bit integers pub const CU_AD_FORMAT_SIGNED_INT8: CUarray_format_enum = CUarray_format_enum(8); } impl CUarray_format_enum { ///< Signed 16-bit integers pub const CU_AD_FORMAT_SIGNED_INT16: CUarray_format_enum = CUarray_format_enum(9); } impl CUarray_format_enum { ///< Signed 32-bit integers pub const CU_AD_FORMAT_SIGNED_INT32: CUarray_format_enum = CUarray_format_enum(10); } impl CUarray_format_enum { ///< 16-bit floating point pub const CU_AD_FORMAT_HALF: CUarray_format_enum = CUarray_format_enum(16); } impl CUarray_format_enum { ///< 32-bit floating point pub const CU_AD_FORMAT_FLOAT: CUarray_format_enum = CUarray_format_enum(32); } impl CUarray_format_enum { ///< 8-bit YUV planar format, with 4:2:0 sampling pub const CU_AD_FORMAT_NV12: CUarray_format_enum = CUarray_format_enum(176); } impl CUarray_format_enum { ///< 1 channel unsigned 8-bit normalized integer pub const CU_AD_FORMAT_UNORM_INT8X1: CUarray_format_enum = CUarray_format_enum(192); } impl CUarray_format_enum { ///< 2 channel unsigned 8-bit normalized integer pub const CU_AD_FORMAT_UNORM_INT8X2: CUarray_format_enum = CUarray_format_enum(193); } impl CUarray_format_enum { ///< 4 channel unsigned 8-bit normalized integer pub const CU_AD_FORMAT_UNORM_INT8X4: CUarray_format_enum = CUarray_format_enum(194); } impl CUarray_format_enum { ///< 1 channel unsigned 16-bit normalized integer pub const CU_AD_FORMAT_UNORM_INT16X1: CUarray_format_enum = CUarray_format_enum(195); } impl CUarray_format_enum { ///< 2 channel unsigned 16-bit normalized integer pub const CU_AD_FORMAT_UNORM_INT16X2: CUarray_format_enum = CUarray_format_enum(196); } impl CUarray_format_enum { ///< 4 channel unsigned 16-bit normalized integer pub const CU_AD_FORMAT_UNORM_INT16X4: CUarray_format_enum = CUarray_format_enum(197); } impl CUarray_format_enum { ///< 1 channel signed 8-bit normalized integer pub const CU_AD_FORMAT_SNORM_INT8X1: CUarray_format_enum = CUarray_format_enum(198); } impl CUarray_format_enum { ///< 2 channel signed 8-bit normalized integer pub const CU_AD_FORMAT_SNORM_INT8X2: CUarray_format_enum = CUarray_format_enum(199); } impl CUarray_format_enum { ///< 4 channel signed 8-bit normalized integer pub const CU_AD_FORMAT_SNORM_INT8X4: CUarray_format_enum = CUarray_format_enum(200); } impl CUarray_format_enum { ///< 1 channel signed 16-bit normalized integer pub const CU_AD_FORMAT_SNORM_INT16X1: CUarray_format_enum = CUarray_format_enum(201); } impl CUarray_format_enum { ///< 2 channel signed 16-bit normalized integer pub const CU_AD_FORMAT_SNORM_INT16X2: CUarray_format_enum = CUarray_format_enum(202); } impl CUarray_format_enum { ///< 4 channel signed 16-bit normalized integer pub const CU_AD_FORMAT_SNORM_INT16X4: CUarray_format_enum = CUarray_format_enum(203); } impl CUarray_format_enum { ///< 4 channel unsigned normalized block-compressed (BC1 compression) format pub const CU_AD_FORMAT_BC1_UNORM: CUarray_format_enum = CUarray_format_enum(145); } impl CUarray_format_enum { ///< 4 channel unsigned normalized block-compressed (BC1 compression) format with sRGB encoding pub const CU_AD_FORMAT_BC1_UNORM_SRGB: CUarray_format_enum = CUarray_format_enum( 146, ); } impl CUarray_format_enum { ///< 4 channel unsigned normalized block-compressed (BC2 compression) format pub const CU_AD_FORMAT_BC2_UNORM: CUarray_format_enum = CUarray_format_enum(147); } impl CUarray_format_enum { ///< 4 channel unsigned normalized block-compressed (BC2 compression) format with sRGB encoding pub const CU_AD_FORMAT_BC2_UNORM_SRGB: CUarray_format_enum = CUarray_format_enum( 148, ); } impl CUarray_format_enum { ///< 4 channel unsigned normalized block-compressed (BC3 compression) format pub const CU_AD_FORMAT_BC3_UNORM: CUarray_format_enum = CUarray_format_enum(149); } impl CUarray_format_enum { ///< 4 channel unsigned normalized block-compressed (BC3 compression) format with sRGB encoding pub const CU_AD_FORMAT_BC3_UNORM_SRGB: CUarray_format_enum = CUarray_format_enum( 150, ); } impl CUarray_format_enum { ///< 1 channel unsigned normalized block-compressed (BC4 compression) format pub const CU_AD_FORMAT_BC4_UNORM: CUarray_format_enum = CUarray_format_enum(151); } impl CUarray_format_enum { ///< 1 channel signed normalized block-compressed (BC4 compression) format pub const CU_AD_FORMAT_BC4_SNORM: CUarray_format_enum = CUarray_format_enum(152); } impl CUarray_format_enum { ///< 2 channel unsigned normalized block-compressed (BC5 compression) format pub const CU_AD_FORMAT_BC5_UNORM: CUarray_format_enum = CUarray_format_enum(153); } impl CUarray_format_enum { ///< 2 channel signed normalized block-compressed (BC5 compression) format pub const CU_AD_FORMAT_BC5_SNORM: CUarray_format_enum = CUarray_format_enum(154); } impl CUarray_format_enum { ///< 3 channel unsigned half-float block-compressed (BC6H compression) format pub const CU_AD_FORMAT_BC6H_UF16: CUarray_format_enum = CUarray_format_enum(155); } impl CUarray_format_enum { ///< 3 channel signed half-float block-compressed (BC6H compression) format pub const CU_AD_FORMAT_BC6H_SF16: CUarray_format_enum = CUarray_format_enum(156); } impl CUarray_format_enum { ///< 4 channel unsigned normalized block-compressed (BC7 compression) format pub const CU_AD_FORMAT_BC7_UNORM: CUarray_format_enum = CUarray_format_enum(157); } impl CUarray_format_enum { ///< 4 channel unsigned normalized block-compressed (BC7 compression) format with sRGB encoding pub const CU_AD_FORMAT_BC7_UNORM_SRGB: CUarray_format_enum = CUarray_format_enum( 158, ); } impl CUarray_format_enum { ///< 10-bit YUV planar format, with 4:2:0 sampling pub const CU_AD_FORMAT_P010: CUarray_format_enum = CUarray_format_enum(159); } impl CUarray_format_enum { ///< 16-bit YUV planar format, with 4:2:0 sampling pub const CU_AD_FORMAT_P016: CUarray_format_enum = CUarray_format_enum(161); } impl CUarray_format_enum { ///< 8-bit YUV planar format, with 4:2:2 sampling pub const CU_AD_FORMAT_NV16: CUarray_format_enum = CUarray_format_enum(162); } impl CUarray_format_enum { ///< 10-bit YUV planar format, with 4:2:2 sampling pub const CU_AD_FORMAT_P210: CUarray_format_enum = CUarray_format_enum(163); } impl CUarray_format_enum { ///< 16-bit YUV planar format, with 4:2:2 sampling pub const CU_AD_FORMAT_P216: CUarray_format_enum = CUarray_format_enum(164); } impl CUarray_format_enum { ///< 2 channel, 8-bit YUV packed planar format, with 4:2:2 sampling pub const CU_AD_FORMAT_YUY2: CUarray_format_enum = CUarray_format_enum(165); } impl CUarray_format_enum { ///< 2 channel, 10-bit YUV packed planar format, with 4:2:2 sampling pub const CU_AD_FORMAT_Y210: CUarray_format_enum = CUarray_format_enum(166); } impl CUarray_format_enum { ///< 2 channel, 16-bit YUV packed planar format, with 4:2:2 sampling pub const CU_AD_FORMAT_Y216: CUarray_format_enum = CUarray_format_enum(167); } impl CUarray_format_enum { ///< 4 channel, 8-bit YUV packed planar format, with 4:4:4 sampling pub const CU_AD_FORMAT_AYUV: CUarray_format_enum = CUarray_format_enum(168); } impl CUarray_format_enum { ///< 10-bit YUV packed planar format, with 4:4:4 sampling pub const CU_AD_FORMAT_Y410: CUarray_format_enum = CUarray_format_enum(169); } impl CUarray_format_enum { ///< 4 channel, 12-bit YUV packed planar format, with 4:4:4 sampling pub const CU_AD_FORMAT_Y416: CUarray_format_enum = CUarray_format_enum(177); } impl CUarray_format_enum { ///< 3 channel 8-bit YUV planar format, with 4:4:4 sampling pub const CU_AD_FORMAT_Y444_PLANAR8: CUarray_format_enum = CUarray_format_enum(178); } impl CUarray_format_enum { ///< 3 channel 10-bit YUV planar format, with 4:4:4 sampling pub const CU_AD_FORMAT_Y444_PLANAR10: CUarray_format_enum = CUarray_format_enum(179); } impl CUarray_format_enum { ///< 3 channel 8-bit YUV semi-planar format, with 4:4:4 sampling pub const CU_AD_FORMAT_YUV444_8bit_SemiPlanar: CUarray_format_enum = CUarray_format_enum( 180, ); } impl CUarray_format_enum { ///< 3 channel 16-bit YUV semi-planar format, with 4:4:4 sampling pub const CU_AD_FORMAT_YUV444_16bit_SemiPlanar: CUarray_format_enum = CUarray_format_enum( 181, ); } impl CUarray_format_enum { ///< 4 channel unorm R10G10B10A2 RGB format pub const CU_AD_FORMAT_UNORM_INT_101010_2: CUarray_format_enum = CUarray_format_enum( 80, ); } impl CUarray_format_enum { pub const CU_AD_FORMAT_MAX: CUarray_format_enum = CUarray_format_enum(2147483647); } #[repr(transparent)] /// Array formats #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUarray_format_enum(pub ::core::ffi::c_uint); /// Array formats pub use self::CUarray_format_enum as CUarray_format; impl CUaddress_mode_enum { ///< Wrapping address mode pub const CU_TR_ADDRESS_MODE_WRAP: CUaddress_mode_enum = CUaddress_mode_enum(0); } impl CUaddress_mode_enum { ///< Clamp to edge address mode pub const CU_TR_ADDRESS_MODE_CLAMP: CUaddress_mode_enum = CUaddress_mode_enum(1); } impl CUaddress_mode_enum { ///< Mirror address mode pub const CU_TR_ADDRESS_MODE_MIRROR: CUaddress_mode_enum = CUaddress_mode_enum(2); } impl CUaddress_mode_enum { ///< Border address mode pub const CU_TR_ADDRESS_MODE_BORDER: CUaddress_mode_enum = CUaddress_mode_enum(3); } #[repr(transparent)] /// Texture reference addressing modes #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUaddress_mode_enum(pub ::core::ffi::c_uint); /// Texture reference addressing modes pub use self::CUaddress_mode_enum as CUaddress_mode; impl CUfilter_mode_enum { ///< Point filter mode pub const CU_TR_FILTER_MODE_POINT: CUfilter_mode_enum = CUfilter_mode_enum(0); } impl CUfilter_mode_enum { ///< Linear filter mode pub const CU_TR_FILTER_MODE_LINEAR: CUfilter_mode_enum = CUfilter_mode_enum(1); } #[repr(transparent)] /// Texture reference filtering modes #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUfilter_mode_enum(pub ::core::ffi::c_uint); /// Texture reference filtering modes pub use self::CUfilter_mode_enum as CUfilter_mode; impl CUdevice_attribute_enum { ///< Maximum number of threads per block pub const CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK: CUdevice_attribute_enum = CUdevice_attribute_enum( 1, ); } impl CUdevice_attribute_enum { ///< Maximum block dimension X pub const CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X: CUdevice_attribute_enum = CUdevice_attribute_enum( 2, ); } impl CUdevice_attribute_enum { ///< Maximum block dimension Y pub const CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Y: CUdevice_attribute_enum = CUdevice_attribute_enum( 3, ); } impl CUdevice_attribute_enum { ///< Maximum block dimension Z pub const CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Z: CUdevice_attribute_enum = CUdevice_attribute_enum( 4, ); } impl CUdevice_attribute_enum { ///< Maximum grid dimension X pub const CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X: CUdevice_attribute_enum = CUdevice_attribute_enum( 5, ); } impl CUdevice_attribute_enum { ///< Maximum grid dimension Y pub const CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Y: CUdevice_attribute_enum = CUdevice_attribute_enum( 6, ); } impl CUdevice_attribute_enum { ///< Maximum grid dimension Z pub const CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Z: CUdevice_attribute_enum = CUdevice_attribute_enum( 7, ); } impl CUdevice_attribute_enum { ///< Maximum shared memory available per block in bytes pub const CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK: CUdevice_attribute_enum = CUdevice_attribute_enum( 8, ); } impl CUdevice_attribute_enum { ///< Deprecated, use CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK pub const CU_DEVICE_ATTRIBUTE_SHARED_MEMORY_PER_BLOCK: CUdevice_attribute_enum = CUdevice_attribute_enum( 8, ); } impl CUdevice_attribute_enum { ///< Memory available on device for __constant__ variables in a CUDA C kernel in bytes pub const CU_DEVICE_ATTRIBUTE_TOTAL_CONSTANT_MEMORY: CUdevice_attribute_enum = CUdevice_attribute_enum( 9, ); } impl CUdevice_attribute_enum { ///< Warp size in threads pub const CU_DEVICE_ATTRIBUTE_WARP_SIZE: CUdevice_attribute_enum = CUdevice_attribute_enum( 10, ); } impl CUdevice_attribute_enum { ///< Maximum pitch in bytes allowed by memory copies pub const CU_DEVICE_ATTRIBUTE_MAX_PITCH: CUdevice_attribute_enum = CUdevice_attribute_enum( 11, ); } impl CUdevice_attribute_enum { ///< Maximum number of 32-bit registers available per block pub const CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK: CUdevice_attribute_enum = CUdevice_attribute_enum( 12, ); } impl CUdevice_attribute_enum { ///< Deprecated, use CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK pub const CU_DEVICE_ATTRIBUTE_REGISTERS_PER_BLOCK: CUdevice_attribute_enum = CUdevice_attribute_enum( 12, ); } impl CUdevice_attribute_enum { ///< Typical clock frequency in kilohertz pub const CU_DEVICE_ATTRIBUTE_CLOCK_RATE: CUdevice_attribute_enum = CUdevice_attribute_enum( 13, ); } impl CUdevice_attribute_enum { ///< Alignment requirement for textures pub const CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT: CUdevice_attribute_enum = CUdevice_attribute_enum( 14, ); } impl CUdevice_attribute_enum { ///< Device can possibly copy memory and execute a kernel concurrently. Deprecated. Use instead CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT. pub const CU_DEVICE_ATTRIBUTE_GPU_OVERLAP: CUdevice_attribute_enum = CUdevice_attribute_enum( 15, ); } impl CUdevice_attribute_enum { ///< Number of multiprocessors on device pub const CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT: CUdevice_attribute_enum = CUdevice_attribute_enum( 16, ); } impl CUdevice_attribute_enum { ///< Specifies whether there is a run time limit on kernels pub const CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT: CUdevice_attribute_enum = CUdevice_attribute_enum( 17, ); } impl CUdevice_attribute_enum { ///< Device is integrated with host memory pub const CU_DEVICE_ATTRIBUTE_INTEGRATED: CUdevice_attribute_enum = CUdevice_attribute_enum( 18, ); } impl CUdevice_attribute_enum { ///< Device can map host memory into CUDA address space pub const CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY: CUdevice_attribute_enum = CUdevice_attribute_enum( 19, ); } impl CUdevice_attribute_enum { ///< Compute mode (See ::CUcomputemode for details) pub const CU_DEVICE_ATTRIBUTE_COMPUTE_MODE: CUdevice_attribute_enum = CUdevice_attribute_enum( 20, ); } impl CUdevice_attribute_enum { ///< Maximum 1D texture width pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum( 21, ); } impl CUdevice_attribute_enum { ///< Maximum 2D texture width pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum( 22, ); } impl CUdevice_attribute_enum { ///< Maximum 2D texture height pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_HEIGHT: CUdevice_attribute_enum = CUdevice_attribute_enum( 23, ); } impl CUdevice_attribute_enum { ///< Maximum 3D texture width pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum( 24, ); } impl CUdevice_attribute_enum { ///< Maximum 3D texture height pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT: CUdevice_attribute_enum = CUdevice_attribute_enum( 25, ); } impl CUdevice_attribute_enum { ///< Maximum 3D texture depth pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH: CUdevice_attribute_enum = CUdevice_attribute_enum( 26, ); } impl CUdevice_attribute_enum { ///< Maximum 2D layered texture width pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum( 27, ); } impl CUdevice_attribute_enum { ///< Maximum 2D layered texture height pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT: CUdevice_attribute_enum = CUdevice_attribute_enum( 28, ); } impl CUdevice_attribute_enum { ///< Maximum layers in a 2D layered texture pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS: CUdevice_attribute_enum = CUdevice_attribute_enum( 29, ); } impl CUdevice_attribute_enum { ///< Deprecated, use CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum( 27, ); } impl CUdevice_attribute_enum { ///< Deprecated, use CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_HEIGHT: CUdevice_attribute_enum = CUdevice_attribute_enum( 28, ); } impl CUdevice_attribute_enum { ///< Deprecated, use CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_NUMSLICES: CUdevice_attribute_enum = CUdevice_attribute_enum( 29, ); } impl CUdevice_attribute_enum { ///< Alignment requirement for surfaces pub const CU_DEVICE_ATTRIBUTE_SURFACE_ALIGNMENT: CUdevice_attribute_enum = CUdevice_attribute_enum( 30, ); } impl CUdevice_attribute_enum { ///< Device can possibly execute multiple kernels concurrently pub const CU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS: CUdevice_attribute_enum = CUdevice_attribute_enum( 31, ); } impl CUdevice_attribute_enum { ///< Device has ECC support enabled pub const CU_DEVICE_ATTRIBUTE_ECC_ENABLED: CUdevice_attribute_enum = CUdevice_attribute_enum( 32, ); } impl CUdevice_attribute_enum { ///< PCI bus ID of the device pub const CU_DEVICE_ATTRIBUTE_PCI_BUS_ID: CUdevice_attribute_enum = CUdevice_attribute_enum( 33, ); } impl CUdevice_attribute_enum { ///< PCI device ID of the device pub const CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID: CUdevice_attribute_enum = CUdevice_attribute_enum( 34, ); } impl CUdevice_attribute_enum { ///< Device is using TCC driver model pub const CU_DEVICE_ATTRIBUTE_TCC_DRIVER: CUdevice_attribute_enum = CUdevice_attribute_enum( 35, ); } impl CUdevice_attribute_enum { ///< Peak memory clock frequency in kilohertz pub const CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE: CUdevice_attribute_enum = CUdevice_attribute_enum( 36, ); } impl CUdevice_attribute_enum { ///< Global memory bus width in bits pub const CU_DEVICE_ATTRIBUTE_GLOBAL_MEMORY_BUS_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum( 37, ); } impl CUdevice_attribute_enum { ///< Size of L2 cache in bytes pub const CU_DEVICE_ATTRIBUTE_L2_CACHE_SIZE: CUdevice_attribute_enum = CUdevice_attribute_enum( 38, ); } impl CUdevice_attribute_enum { ///< Maximum resident threads per multiprocessor pub const CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSOR: CUdevice_attribute_enum = CUdevice_attribute_enum( 39, ); } impl CUdevice_attribute_enum { ///< Number of asynchronous engines pub const CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT: CUdevice_attribute_enum = CUdevice_attribute_enum( 40, ); } impl CUdevice_attribute_enum { ///< Device shares a unified address space with the host pub const CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING: CUdevice_attribute_enum = CUdevice_attribute_enum( 41, ); } impl CUdevice_attribute_enum { ///< Maximum 1D layered texture width pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum( 42, ); } impl CUdevice_attribute_enum { ///< Maximum layers in a 1D layered texture pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_LAYERS: CUdevice_attribute_enum = CUdevice_attribute_enum( 43, ); } impl CUdevice_attribute_enum { ///< Deprecated, do not use. pub const CU_DEVICE_ATTRIBUTE_CAN_TEX2D_GATHER: CUdevice_attribute_enum = CUdevice_attribute_enum( 44, ); } impl CUdevice_attribute_enum { ///< Maximum 2D texture width if CUDA_ARRAY3D_TEXTURE_GATHER is set pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum( 45, ); } impl CUdevice_attribute_enum { ///< Maximum 2D texture height if CUDA_ARRAY3D_TEXTURE_GATHER is set pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_HEIGHT: CUdevice_attribute_enum = CUdevice_attribute_enum( 46, ); } impl CUdevice_attribute_enum { ///< Alternate maximum 3D texture width pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH_ALTERNATE: CUdevice_attribute_enum = CUdevice_attribute_enum( 47, ); } impl CUdevice_attribute_enum { ///< Alternate maximum 3D texture height pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATE: CUdevice_attribute_enum = CUdevice_attribute_enum( 48, ); } impl CUdevice_attribute_enum { ///< Alternate maximum 3D texture depth pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH_ALTERNATE: CUdevice_attribute_enum = CUdevice_attribute_enum( 49, ); } impl CUdevice_attribute_enum { ///< PCI domain ID of the device pub const CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID: CUdevice_attribute_enum = CUdevice_attribute_enum( 50, ); } impl CUdevice_attribute_enum { ///< Pitch alignment requirement for textures pub const CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT: CUdevice_attribute_enum = CUdevice_attribute_enum( 51, ); } impl CUdevice_attribute_enum { ///< Maximum cubemap texture width/height pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum( 52, ); } impl CUdevice_attribute_enum { ///< Maximum cubemap layered texture width/height pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum( 53, ); } impl CUdevice_attribute_enum { ///< Maximum layers in a cubemap layered texture pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_LAYERS: CUdevice_attribute_enum = CUdevice_attribute_enum( 54, ); } impl CUdevice_attribute_enum { ///< Maximum 1D surface width pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum( 55, ); } impl CUdevice_attribute_enum { ///< Maximum 2D surface width pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum( 56, ); } impl CUdevice_attribute_enum { ///< Maximum 2D surface height pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_HEIGHT: CUdevice_attribute_enum = CUdevice_attribute_enum( 57, ); } impl CUdevice_attribute_enum { ///< Maximum 3D surface width pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum( 58, ); } impl CUdevice_attribute_enum { ///< Maximum 3D surface height pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_HEIGHT: CUdevice_attribute_enum = CUdevice_attribute_enum( 59, ); } impl CUdevice_attribute_enum { ///< Maximum 3D surface depth pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_DEPTH: CUdevice_attribute_enum = CUdevice_attribute_enum( 60, ); } impl CUdevice_attribute_enum { ///< Maximum 1D layered surface width pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum( 61, ); } impl CUdevice_attribute_enum { ///< Maximum layers in a 1D layered surface pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_LAYERS: CUdevice_attribute_enum = CUdevice_attribute_enum( 62, ); } impl CUdevice_attribute_enum { ///< Maximum 2D layered surface width pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum( 63, ); } impl CUdevice_attribute_enum { ///< Maximum 2D layered surface height pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_HEIGHT: CUdevice_attribute_enum = CUdevice_attribute_enum( 64, ); } impl CUdevice_attribute_enum { ///< Maximum layers in a 2D layered surface pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_LAYERS: CUdevice_attribute_enum = CUdevice_attribute_enum( 65, ); } impl CUdevice_attribute_enum { ///< Maximum cubemap surface width pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum( 66, ); } impl CUdevice_attribute_enum { ///< Maximum cubemap layered surface width pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum( 67, ); } impl CUdevice_attribute_enum { ///< Maximum layers in a cubemap layered surface pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_LAYERS: CUdevice_attribute_enum = CUdevice_attribute_enum( 68, ); } impl CUdevice_attribute_enum { ///< Deprecated, do not use. Use cudaDeviceGetTexture1DLinearMaxWidth() or cuDeviceGetTexture1DLinearMaxWidth() instead. pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum( 69, ); } impl CUdevice_attribute_enum { ///< Maximum 2D linear texture width pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum( 70, ); } impl CUdevice_attribute_enum { ///< Maximum 2D linear texture height pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT: CUdevice_attribute_enum = CUdevice_attribute_enum( 71, ); } impl CUdevice_attribute_enum { ///< Maximum 2D linear texture pitch in bytes pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH: CUdevice_attribute_enum = CUdevice_attribute_enum( 72, ); } impl CUdevice_attribute_enum { ///< Maximum mipmapped 2D texture width pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum( 73, ); } impl CUdevice_attribute_enum { ///< Maximum mipmapped 2D texture height pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHT: CUdevice_attribute_enum = CUdevice_attribute_enum( 74, ); } impl CUdevice_attribute_enum { ///< Major compute capability version number pub const CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR: CUdevice_attribute_enum = CUdevice_attribute_enum( 75, ); } impl CUdevice_attribute_enum { ///< Minor compute capability version number pub const CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR: CUdevice_attribute_enum = CUdevice_attribute_enum( 76, ); } impl CUdevice_attribute_enum { ///< Maximum mipmapped 1D texture width pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum( 77, ); } impl CUdevice_attribute_enum { ///< Device supports stream priorities pub const CU_DEVICE_ATTRIBUTE_STREAM_PRIORITIES_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum( 78, ); } impl CUdevice_attribute_enum { ///< Device supports caching globals in L1 pub const CU_DEVICE_ATTRIBUTE_GLOBAL_L1_CACHE_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum( 79, ); } impl CUdevice_attribute_enum { ///< Device supports caching locals in L1 pub const CU_DEVICE_ATTRIBUTE_LOCAL_L1_CACHE_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum( 80, ); } impl CUdevice_attribute_enum { ///< Maximum shared memory available per multiprocessor in bytes pub const CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR: CUdevice_attribute_enum = CUdevice_attribute_enum( 81, ); } impl CUdevice_attribute_enum { ///< Maximum number of 32-bit registers available per multiprocessor pub const CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR: CUdevice_attribute_enum = CUdevice_attribute_enum( 82, ); } impl CUdevice_attribute_enum { ///< Device can allocate managed memory on this system pub const CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY: CUdevice_attribute_enum = CUdevice_attribute_enum( 83, ); } impl CUdevice_attribute_enum { ///< Device is on a multi-GPU board pub const CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD: CUdevice_attribute_enum = CUdevice_attribute_enum( 84, ); } impl CUdevice_attribute_enum { ///< Unique id for a group of devices on the same multi-GPU board pub const CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD_GROUP_ID: CUdevice_attribute_enum = CUdevice_attribute_enum( 85, ); } impl CUdevice_attribute_enum { ///< Link between the device and the host supports all native atomic operations pub const CU_DEVICE_ATTRIBUTE_HOST_NATIVE_ATOMIC_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum( 86, ); } impl CUdevice_attribute_enum { ///< Ratio of single precision performance (in floating-point operations per second) to double precision performance pub const CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO: CUdevice_attribute_enum = CUdevice_attribute_enum( 87, ); } impl CUdevice_attribute_enum { ///< Device supports coherently accessing pageable memory without calling cudaHostRegister on it pub const CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS: CUdevice_attribute_enum = CUdevice_attribute_enum( 88, ); } impl CUdevice_attribute_enum { ///< Device can coherently access managed memory concurrently with the CPU pub const CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS: CUdevice_attribute_enum = CUdevice_attribute_enum( 89, ); } impl CUdevice_attribute_enum { ///< Device supports compute preemption. pub const CU_DEVICE_ATTRIBUTE_COMPUTE_PREEMPTION_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum( 90, ); } impl CUdevice_attribute_enum { ///< Device can access host registered memory at the same virtual address as the CPU pub const CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM: CUdevice_attribute_enum = CUdevice_attribute_enum( 91, ); } impl CUdevice_attribute_enum { ///< Deprecated, along with v1 MemOps API, ::cuStreamBatchMemOp and related APIs are supported. pub const CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_MEM_OPS_V1: CUdevice_attribute_enum = CUdevice_attribute_enum( 92, ); } impl CUdevice_attribute_enum { ///< Deprecated, along with v1 MemOps API, 64-bit operations are supported in ::cuStreamBatchMemOp and related APIs. pub const CU_DEVICE_ATTRIBUTE_CAN_USE_64_BIT_STREAM_MEM_OPS_V1: CUdevice_attribute_enum = CUdevice_attribute_enum( 93, ); } impl CUdevice_attribute_enum { ///< Deprecated, along with v1 MemOps API, ::CU_STREAM_WAIT_VALUE_NOR is supported. pub const CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR_V1: CUdevice_attribute_enum = CUdevice_attribute_enum( 94, ); } impl CUdevice_attribute_enum { ///< Device supports launching cooperative kernels via ::cuLaunchCooperativeKernel pub const CU_DEVICE_ATTRIBUTE_COOPERATIVE_LAUNCH: CUdevice_attribute_enum = CUdevice_attribute_enum( 95, ); } impl CUdevice_attribute_enum { ///< Deprecated, ::cuLaunchCooperativeKernelMultiDevice is deprecated. pub const CU_DEVICE_ATTRIBUTE_COOPERATIVE_MULTI_DEVICE_LAUNCH: CUdevice_attribute_enum = CUdevice_attribute_enum( 96, ); } impl CUdevice_attribute_enum { ///< Maximum optin shared memory per block pub const CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN: CUdevice_attribute_enum = CUdevice_attribute_enum( 97, ); } impl CUdevice_attribute_enum { ///< The ::CU_STREAM_WAIT_VALUE_FLUSH flag and the ::CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES MemOp are supported on the device. See \ref CUDA_MEMOP for additional details. pub const CU_DEVICE_ATTRIBUTE_CAN_FLUSH_REMOTE_WRITES: CUdevice_attribute_enum = CUdevice_attribute_enum( 98, ); } impl CUdevice_attribute_enum { ///< Device supports host memory registration via ::cudaHostRegister. pub const CU_DEVICE_ATTRIBUTE_HOST_REGISTER_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum( 99, ); } impl CUdevice_attribute_enum { ///< Device accesses pageable memory via the host's page tables. pub const CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES: CUdevice_attribute_enum = CUdevice_attribute_enum( 100, ); } impl CUdevice_attribute_enum { ///< The host can directly access managed memory on the device without migration. pub const CU_DEVICE_ATTRIBUTE_DIRECT_MANAGED_MEM_ACCESS_FROM_HOST: CUdevice_attribute_enum = CUdevice_attribute_enum( 101, ); } impl CUdevice_attribute_enum { ///< Deprecated, Use CU_DEVICE_ATTRIBUTE_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED pub const CU_DEVICE_ATTRIBUTE_VIRTUAL_ADDRESS_MANAGEMENT_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum( 102, ); } impl CUdevice_attribute_enum { ///< Device supports virtual memory management APIs like ::cuMemAddressReserve, ::cuMemCreate, ::cuMemMap and related APIs pub const CU_DEVICE_ATTRIBUTE_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum( 102, ); } impl CUdevice_attribute_enum { ///< Device supports exporting memory to a posix file descriptor with ::cuMemExportToShareableHandle, if requested via ::cuMemCreate pub const CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum( 103, ); } impl CUdevice_attribute_enum { ///< Device supports exporting memory to a Win32 NT handle with ::cuMemExportToShareableHandle, if requested via ::cuMemCreate pub const CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_WIN32_HANDLE_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum( 104, ); } impl CUdevice_attribute_enum { ///< Device supports exporting memory to a Win32 KMT handle with ::cuMemExportToShareableHandle, if requested via ::cuMemCreate pub const CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_WIN32_KMT_HANDLE_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum( 105, ); } impl CUdevice_attribute_enum { ///< Maximum number of blocks per multiprocessor pub const CU_DEVICE_ATTRIBUTE_MAX_BLOCKS_PER_MULTIPROCESSOR: CUdevice_attribute_enum = CUdevice_attribute_enum( 106, ); } impl CUdevice_attribute_enum { ///< Device supports compression of memory pub const CU_DEVICE_ATTRIBUTE_GENERIC_COMPRESSION_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum( 107, ); } impl CUdevice_attribute_enum { ///< Maximum L2 persisting lines capacity setting in bytes. pub const CU_DEVICE_ATTRIBUTE_MAX_PERSISTING_L2_CACHE_SIZE: CUdevice_attribute_enum = CUdevice_attribute_enum( 108, ); } impl CUdevice_attribute_enum { ///< Maximum value of CUaccessPolicyWindow::num_bytes. pub const CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE: CUdevice_attribute_enum = CUdevice_attribute_enum( 109, ); } impl CUdevice_attribute_enum { ///< Device supports specifying the GPUDirect RDMA flag with ::cuMemCreate pub const CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WITH_CUDA_VMM_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum( 110, ); } impl CUdevice_attribute_enum { ///< Shared memory reserved by CUDA driver per block in bytes pub const CU_DEVICE_ATTRIBUTE_RESERVED_SHARED_MEMORY_PER_BLOCK: CUdevice_attribute_enum = CUdevice_attribute_enum( 111, ); } impl CUdevice_attribute_enum { ///< Device supports sparse CUDA arrays and sparse CUDA mipmapped arrays pub const CU_DEVICE_ATTRIBUTE_SPARSE_CUDA_ARRAY_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum( 112, ); } impl CUdevice_attribute_enum { ///< Device supports using the ::cuMemHostRegister flag ::CU_MEMHOSTERGISTER_READ_ONLY to register memory that must be mapped as read-only to the GPU pub const CU_DEVICE_ATTRIBUTE_READ_ONLY_HOST_REGISTER_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum( 113, ); } impl CUdevice_attribute_enum { ///< External timeline semaphore interop is supported on the device pub const CU_DEVICE_ATTRIBUTE_TIMELINE_SEMAPHORE_INTEROP_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum( 114, ); } impl CUdevice_attribute_enum { ///< Device supports using the ::cuMemAllocAsync and ::cuMemPool family of APIs pub const CU_DEVICE_ATTRIBUTE_MEMORY_POOLS_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum( 115, ); } impl CUdevice_attribute_enum { ///< Device supports GPUDirect RDMA APIs, like nvidia_p2p_get_pages (see https://docs.nvidia.com/cuda/gpudirect-rdma for more information) pub const CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum( 116, ); } impl CUdevice_attribute_enum { ///< The returned attribute shall be interpreted as a bitmask, where the individual bits are described by the ::CUflushGPUDirectRDMAWritesOptions enum pub const CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_FLUSH_WRITES_OPTIONS: CUdevice_attribute_enum = CUdevice_attribute_enum( 117, ); } impl CUdevice_attribute_enum { ///< GPUDirect RDMA writes to the device do not need to be flushed for consumers within the scope indicated by the returned attribute. See ::CUGPUDirectRDMAWritesOrdering for the numerical values returned here. pub const CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WRITES_ORDERING: CUdevice_attribute_enum = CUdevice_attribute_enum( 118, ); } impl CUdevice_attribute_enum { ///< Handle types supported with mempool based IPC pub const CU_DEVICE_ATTRIBUTE_MEMPOOL_SUPPORTED_HANDLE_TYPES: CUdevice_attribute_enum = CUdevice_attribute_enum( 119, ); } impl CUdevice_attribute_enum { ///< Indicates device supports cluster launch pub const CU_DEVICE_ATTRIBUTE_CLUSTER_LAUNCH: CUdevice_attribute_enum = CUdevice_attribute_enum( 120, ); } impl CUdevice_attribute_enum { ///< Device supports deferred mapping CUDA arrays and CUDA mipmapped arrays pub const CU_DEVICE_ATTRIBUTE_DEFERRED_MAPPING_CUDA_ARRAY_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum( 121, ); } impl CUdevice_attribute_enum { ///< 64-bit operations are supported in ::cuStreamBatchMemOp and related MemOp APIs. pub const CU_DEVICE_ATTRIBUTE_CAN_USE_64_BIT_STREAM_MEM_OPS: CUdevice_attribute_enum = CUdevice_attribute_enum( 122, ); } impl CUdevice_attribute_enum { ///< ::CU_STREAM_WAIT_VALUE_NOR is supported by MemOp APIs. pub const CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR: CUdevice_attribute_enum = CUdevice_attribute_enum( 123, ); } impl CUdevice_attribute_enum { ///< Device supports buffer sharing with dma_buf mechanism. pub const CU_DEVICE_ATTRIBUTE_DMA_BUF_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum( 124, ); } impl CUdevice_attribute_enum { ///< Device supports IPC Events. pub const CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum( 125, ); } impl CUdevice_attribute_enum { ///< Number of memory domains the device supports. pub const CU_DEVICE_ATTRIBUTE_MEM_SYNC_DOMAIN_COUNT: CUdevice_attribute_enum = CUdevice_attribute_enum( 126, ); } impl CUdevice_attribute_enum { ///< Device supports accessing memory using Tensor Map. pub const CU_DEVICE_ATTRIBUTE_TENSOR_MAP_ACCESS_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum( 127, ); } impl CUdevice_attribute_enum { ///< Device supports exporting memory to a fabric handle with cuMemExportToShareableHandle() or requested with cuMemCreate() pub const CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_FABRIC_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum( 128, ); } impl CUdevice_attribute_enum { ///< Device supports unified function pointers. pub const CU_DEVICE_ATTRIBUTE_UNIFIED_FUNCTION_POINTERS: CUdevice_attribute_enum = CUdevice_attribute_enum( 129, ); } impl CUdevice_attribute_enum { ///< NUMA configuration of a device: value is of type ::CUdeviceNumaConfig enum pub const CU_DEVICE_ATTRIBUTE_NUMA_CONFIG: CUdevice_attribute_enum = CUdevice_attribute_enum( 130, ); } impl CUdevice_attribute_enum { ///< NUMA node ID of the GPU memory pub const CU_DEVICE_ATTRIBUTE_NUMA_ID: CUdevice_attribute_enum = CUdevice_attribute_enum( 131, ); } impl CUdevice_attribute_enum { ///< Device supports switch multicast and reduction operations. pub const CU_DEVICE_ATTRIBUTE_MULTICAST_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum( 132, ); } impl CUdevice_attribute_enum { ///< Indicates if contexts created on this device will be shared via MPS pub const CU_DEVICE_ATTRIBUTE_MPS_ENABLED: CUdevice_attribute_enum = CUdevice_attribute_enum( 133, ); } impl CUdevice_attribute_enum { ///< NUMA ID of the host node closest to the device. Returns -1 when system does not support NUMA. pub const CU_DEVICE_ATTRIBUTE_HOST_NUMA_ID: CUdevice_attribute_enum = CUdevice_attribute_enum( 134, ); } impl CUdevice_attribute_enum { ///< Device supports CIG with D3D12. pub const CU_DEVICE_ATTRIBUTE_D3D12_CIG_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum( 135, ); } impl CUdevice_attribute_enum { ///< The returned valued shall be interpreted as a bitmask, where the individual bits are described by the ::CUmemDecompressAlgorithm enum. pub const CU_DEVICE_ATTRIBUTE_MEM_DECOMPRESS_ALGORITHM_MASK: CUdevice_attribute_enum = CUdevice_attribute_enum( 136, ); } impl CUdevice_attribute_enum { ///< The returned valued is the maximum length in bytes of a single decompress operation that is allowed. pub const CU_DEVICE_ATTRIBUTE_MEM_DECOMPRESS_MAXIMUM_LENGTH: CUdevice_attribute_enum = CUdevice_attribute_enum( 137, ); } impl CUdevice_attribute_enum { ///< Device supports CIG with Vulkan. pub const CU_DEVICE_ATTRIBUTE_VULKAN_CIG_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum( 138, ); } impl CUdevice_attribute_enum { ///< The combined 16-bit PCI device ID and 16-bit PCI vendor ID. pub const CU_DEVICE_ATTRIBUTE_GPU_PCI_DEVICE_ID: CUdevice_attribute_enum = CUdevice_attribute_enum( 139, ); } impl CUdevice_attribute_enum { ///< The combined 16-bit PCI subsystem ID and 16-bit PCI subsystem vendor ID. pub const CU_DEVICE_ATTRIBUTE_GPU_PCI_SUBSYSTEM_ID: CUdevice_attribute_enum = CUdevice_attribute_enum( 140, ); } impl CUdevice_attribute_enum { ///< Device supports HOST_NUMA location with the virtual memory management APIs like ::cuMemCreate, ::cuMemMap and related APIs pub const CU_DEVICE_ATTRIBUTE_HOST_NUMA_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum( 141, ); } impl CUdevice_attribute_enum { ///< Device supports HOST_NUMA location with the ::cuMemAllocAsync and ::cuMemPool family of APIs pub const CU_DEVICE_ATTRIBUTE_HOST_NUMA_MEMORY_POOLS_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum( 142, ); } impl CUdevice_attribute_enum { ///< Device supports HOST_NUMA location IPC between nodes in a multi-node system. pub const CU_DEVICE_ATTRIBUTE_HOST_NUMA_MULTINODE_IPC_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum( 143, ); } impl CUdevice_attribute_enum { ///< Device suports HOST location with the ::cuMemAllocAsync and ::cuMemPool family of APIs pub const CU_DEVICE_ATTRIBUTE_HOST_MEMORY_POOLS_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum( 144, ); } impl CUdevice_attribute_enum { ///< Device supports HOST location with the virtual memory management APIs like ::cuMemCreate, ::cuMemMap and related APIs pub const CU_DEVICE_ATTRIBUTE_HOST_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum( 145, ); } impl CUdevice_attribute_enum { ///< Device supports page-locked host memory buffer sharing with dma_buf mechanism. pub const CU_DEVICE_ATTRIBUTE_HOST_ALLOC_DMA_BUF_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum( 146, ); } impl CUdevice_attribute_enum { ///< Link between the device and the host supports only some native atomic operations pub const CU_DEVICE_ATTRIBUTE_ONLY_PARTIAL_HOST_NATIVE_ATOMIC_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum( 147, ); } impl CUdevice_attribute_enum { pub const CU_DEVICE_ATTRIBUTE_MAX: CUdevice_attribute_enum = CUdevice_attribute_enum( 148, ); } #[repr(transparent)] /// Device properties #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUdevice_attribute_enum(pub ::core::ffi::c_uint); /// Device properties pub use self::CUdevice_attribute_enum as CUdevice_attribute; /// Legacy device properties #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUdevprop_st { ///< Maximum number of threads per block pub maxThreadsPerBlock: ::core::ffi::c_int, ///< Maximum size of each dimension of a block pub maxThreadsDim: [::core::ffi::c_int; 3usize], ///< Maximum size of each dimension of a grid pub maxGridSize: [::core::ffi::c_int; 3usize], ///< Shared memory available per block in bytes pub sharedMemPerBlock: ::core::ffi::c_int, ///< Constant memory available on device in bytes pub totalConstantMemory: ::core::ffi::c_int, ///< Warp size in threads pub SIMDWidth: ::core::ffi::c_int, ///< Maximum pitch in bytes allowed by memory copies pub memPitch: ::core::ffi::c_int, ///< 32-bit registers available per block pub regsPerBlock: ::core::ffi::c_int, ///< Clock frequency in kilohertz pub clockRate: ::core::ffi::c_int, ///< Alignment requirement for textures pub textureAlign: ::core::ffi::c_int, } /// Legacy device properties pub type CUdevprop_v1 = CUdevprop_st; /// Legacy device properties pub type CUdevprop = CUdevprop_v1; impl CUpointer_attribute_enum { ///< The ::CUcontext on which a pointer was allocated or registered pub const CU_POINTER_ATTRIBUTE_CONTEXT: CUpointer_attribute_enum = CUpointer_attribute_enum( 1, ); } impl CUpointer_attribute_enum { ///< The ::CUmemorytype describing the physical location of a pointer pub const CU_POINTER_ATTRIBUTE_MEMORY_TYPE: CUpointer_attribute_enum = CUpointer_attribute_enum( 2, ); } impl CUpointer_attribute_enum { ///< The address at which a pointer's memory may be accessed on the device pub const CU_POINTER_ATTRIBUTE_DEVICE_POINTER: CUpointer_attribute_enum = CUpointer_attribute_enum( 3, ); } impl CUpointer_attribute_enum { ///< The address at which a pointer's memory may be accessed on the host pub const CU_POINTER_ATTRIBUTE_HOST_POINTER: CUpointer_attribute_enum = CUpointer_attribute_enum( 4, ); } impl CUpointer_attribute_enum { ///< A pair of tokens for use with the nv-p2p.h Linux kernel interface pub const CU_POINTER_ATTRIBUTE_P2P_TOKENS: CUpointer_attribute_enum = CUpointer_attribute_enum( 5, ); } impl CUpointer_attribute_enum { ///< Synchronize every synchronous memory operation initiated on this region pub const CU_POINTER_ATTRIBUTE_SYNC_MEMOPS: CUpointer_attribute_enum = CUpointer_attribute_enum( 6, ); } impl CUpointer_attribute_enum { ///< A process-wide unique ID for an allocated memory region pub const CU_POINTER_ATTRIBUTE_BUFFER_ID: CUpointer_attribute_enum = CUpointer_attribute_enum( 7, ); } impl CUpointer_attribute_enum { ///< Indicates if the pointer points to managed memory pub const CU_POINTER_ATTRIBUTE_IS_MANAGED: CUpointer_attribute_enum = CUpointer_attribute_enum( 8, ); } impl CUpointer_attribute_enum { ///< A device ordinal of a device on which a pointer was allocated or registered pub const CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL: CUpointer_attribute_enum = CUpointer_attribute_enum( 9, ); } impl CUpointer_attribute_enum { ///< 1 if this pointer maps to an allocation that is suitable for ::cudaIpcGetMemHandle, 0 otherwise pub const CU_POINTER_ATTRIBUTE_IS_LEGACY_CUDA_IPC_CAPABLE: CUpointer_attribute_enum = CUpointer_attribute_enum( 10, ); } impl CUpointer_attribute_enum { ///< Starting address for this requested pointer pub const CU_POINTER_ATTRIBUTE_RANGE_START_ADDR: CUpointer_attribute_enum = CUpointer_attribute_enum( 11, ); } impl CUpointer_attribute_enum { ///< Size of the address range for this requested pointer pub const CU_POINTER_ATTRIBUTE_RANGE_SIZE: CUpointer_attribute_enum = CUpointer_attribute_enum( 12, ); } impl CUpointer_attribute_enum { ///< 1 if this pointer is in a valid address range that is mapped to a backing allocation, 0 otherwise pub const CU_POINTER_ATTRIBUTE_MAPPED: CUpointer_attribute_enum = CUpointer_attribute_enum( 13, ); } impl CUpointer_attribute_enum { ///< Bitmask of allowed ::CUmemAllocationHandleType for this allocation pub const CU_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES: CUpointer_attribute_enum = CUpointer_attribute_enum( 14, ); } impl CUpointer_attribute_enum { ///< 1 if the memory this pointer is referencing can be used with the GPUDirect RDMA API pub const CU_POINTER_ATTRIBUTE_IS_GPU_DIRECT_RDMA_CAPABLE: CUpointer_attribute_enum = CUpointer_attribute_enum( 15, ); } impl CUpointer_attribute_enum { ///< Returns the access flags the device associated with the current context has on the corresponding memory referenced by the pointer given pub const CU_POINTER_ATTRIBUTE_ACCESS_FLAGS: CUpointer_attribute_enum = CUpointer_attribute_enum( 16, ); } impl CUpointer_attribute_enum { ///< Returns the mempool handle for the allocation if it was allocated from a mempool. Otherwise returns NULL. pub const CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE: CUpointer_attribute_enum = CUpointer_attribute_enum( 17, ); } impl CUpointer_attribute_enum { ///< Size of the actual underlying mapping that the pointer belongs to pub const CU_POINTER_ATTRIBUTE_MAPPING_SIZE: CUpointer_attribute_enum = CUpointer_attribute_enum( 18, ); } impl CUpointer_attribute_enum { ///< The start address of the mapping that the pointer belongs to pub const CU_POINTER_ATTRIBUTE_MAPPING_BASE_ADDR: CUpointer_attribute_enum = CUpointer_attribute_enum( 19, ); } impl CUpointer_attribute_enum { ///< A process-wide unique id corresponding to the physical allocation the pointer belongs to pub const CU_POINTER_ATTRIBUTE_MEMORY_BLOCK_ID: CUpointer_attribute_enum = CUpointer_attribute_enum( 20, ); } impl CUpointer_attribute_enum { ///< Returns in \p *data a boolean that indicates whether the pointer points to memory that is capable to be used for hardware accelerated decompression. pub const CU_POINTER_ATTRIBUTE_IS_HW_DECOMPRESS_CAPABLE: CUpointer_attribute_enum = CUpointer_attribute_enum( 21, ); } #[repr(transparent)] /// Pointer information #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUpointer_attribute_enum(pub ::core::ffi::c_uint); /// Pointer information pub use self::CUpointer_attribute_enum as CUpointer_attribute; impl CUfunction_attribute_enum { /** The maximum number of threads per block, beyond which a launch of the function would fail. This number depends on both the function and the device on which the function is currently loaded.*/ pub const CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK: CUfunction_attribute_enum = CUfunction_attribute_enum( 0, ); } impl CUfunction_attribute_enum { /** The size in bytes of statically-allocated shared memory required by this function. This does not include dynamically-allocated shared memory requested by the user at runtime.*/ pub const CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES: CUfunction_attribute_enum = CUfunction_attribute_enum( 1, ); } impl CUfunction_attribute_enum { /** The size in bytes of user-allocated constant memory required by this function.*/ pub const CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES: CUfunction_attribute_enum = CUfunction_attribute_enum( 2, ); } impl CUfunction_attribute_enum { /// The size in bytes of local memory used by each thread of this function. pub const CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES: CUfunction_attribute_enum = CUfunction_attribute_enum( 3, ); } impl CUfunction_attribute_enum { /// The number of registers used by each thread of this function. pub const CU_FUNC_ATTRIBUTE_NUM_REGS: CUfunction_attribute_enum = CUfunction_attribute_enum( 4, ); } impl CUfunction_attribute_enum { /** The PTX virtual architecture version for which the function was compiled. This value is the major PTX version * 10 + the minor PTX version, so a PTX version 1.3 function would return the value 13. Note that this may return the undefined value of 0 for cubins compiled prior to CUDA 3.0.*/ pub const CU_FUNC_ATTRIBUTE_PTX_VERSION: CUfunction_attribute_enum = CUfunction_attribute_enum( 5, ); } impl CUfunction_attribute_enum { /** The binary architecture version for which the function was compiled. This value is the major binary version * 10 + the minor binary version, so a binary version 1.3 function would return the value 13. Note that this will return a value of 10 for legacy cubins that do not have a properly-encoded binary architecture version.*/ pub const CU_FUNC_ATTRIBUTE_BINARY_VERSION: CUfunction_attribute_enum = CUfunction_attribute_enum( 6, ); } impl CUfunction_attribute_enum { /** The attribute to indicate whether the function has been compiled with user specified option "-Xptxas --dlcm=ca" set .*/ pub const CU_FUNC_ATTRIBUTE_CACHE_MODE_CA: CUfunction_attribute_enum = CUfunction_attribute_enum( 7, ); } impl CUfunction_attribute_enum { /** The maximum size in bytes of dynamically-allocated shared memory that can be used by this function. If the user-specified dynamic shared memory size is larger than this value, the launch will fail. The default value of this attribute is ::CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK - ::CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES, except when ::CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES is greater than ::CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK, then the default value of this attribute is 0. The value can be increased to ::CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN - ::CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES. See ::cuFuncSetAttribute, ::cuKernelSetAttribute*/ pub const CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES: CUfunction_attribute_enum = CUfunction_attribute_enum( 8, ); } impl CUfunction_attribute_enum { /** On devices where the L1 cache and shared memory use the same hardware resources, this sets the shared memory carveout preference, in percent of the total shared memory. Refer to ::CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR. This is only a hint, and the driver can choose a different ratio if required to execute the function. See ::cuFuncSetAttribute, ::cuKernelSetAttribute*/ pub const CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT: CUfunction_attribute_enum = CUfunction_attribute_enum( 9, ); } impl CUfunction_attribute_enum { /** If this attribute is set, the kernel must launch with a valid cluster size specified. See ::cuFuncSetAttribute, ::cuKernelSetAttribute*/ pub const CU_FUNC_ATTRIBUTE_CLUSTER_SIZE_MUST_BE_SET: CUfunction_attribute_enum = CUfunction_attribute_enum( 10, ); } impl CUfunction_attribute_enum { /** The required cluster width in blocks. The values must either all be 0 or all be positive. The validity of the cluster dimensions is otherwise checked at launch time. If the value is set during compile time, it cannot be set at runtime. Setting it at runtime will return CUDA_ERROR_NOT_PERMITTED. See ::cuFuncSetAttribute, ::cuKernelSetAttribute*/ pub const CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_WIDTH: CUfunction_attribute_enum = CUfunction_attribute_enum( 11, ); } impl CUfunction_attribute_enum { /** The required cluster height in blocks. The values must either all be 0 or all be positive. The validity of the cluster dimensions is otherwise checked at launch time. If the value is set during compile time, it cannot be set at runtime. Setting it at runtime should return CUDA_ERROR_NOT_PERMITTED. See ::cuFuncSetAttribute, ::cuKernelSetAttribute*/ pub const CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_HEIGHT: CUfunction_attribute_enum = CUfunction_attribute_enum( 12, ); } impl CUfunction_attribute_enum { /** The required cluster depth in blocks. The values must either all be 0 or all be positive. The validity of the cluster dimensions is otherwise checked at launch time. If the value is set during compile time, it cannot be set at runtime. Setting it at runtime should return CUDA_ERROR_NOT_PERMITTED. See ::cuFuncSetAttribute, ::cuKernelSetAttribute*/ pub const CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_DEPTH: CUfunction_attribute_enum = CUfunction_attribute_enum( 13, ); } impl CUfunction_attribute_enum { /** Whether the function can be launched with non-portable cluster size. 1 is allowed, 0 is disallowed. A non-portable cluster size may only function on the specific SKUs the program is tested on. The launch might fail if the program is run on a different hardware platform. CUDA API provides cudaOccupancyMaxActiveClusters to assist with checking whether the desired size can be launched on the current device. Portable Cluster Size A portable cluster size is guaranteed to be functional on all compute capabilities higher than the target compute capability. The portable cluster size for sm_90 is 8 blocks per cluster. This value may increase for future compute capabilities. The specific hardware unit may support higher cluster sizes that’s not guaranteed to be portable. See ::cuFuncSetAttribute, ::cuKernelSetAttribute*/ pub const CU_FUNC_ATTRIBUTE_NON_PORTABLE_CLUSTER_SIZE_ALLOWED: CUfunction_attribute_enum = CUfunction_attribute_enum( 14, ); } impl CUfunction_attribute_enum { /** The block scheduling policy of a function. The value type is CUclusterSchedulingPolicy / cudaClusterSchedulingPolicy. See ::cuFuncSetAttribute, ::cuKernelSetAttribute*/ pub const CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE: CUfunction_attribute_enum = CUfunction_attribute_enum( 15, ); } impl CUfunction_attribute_enum { /** The block scheduling policy of a function. The value type is CUclusterSchedulingPolicy / cudaClusterSchedulingPolicy. See ::cuFuncSetAttribute, ::cuKernelSetAttribute*/ pub const CU_FUNC_ATTRIBUTE_MAX: CUfunction_attribute_enum = CUfunction_attribute_enum( 16, ); } #[repr(transparent)] /// Function properties #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUfunction_attribute_enum(pub ::core::ffi::c_uint); /// Function properties pub use self::CUfunction_attribute_enum as CUfunction_attribute; impl CUfunc_cache_enum { ///< no preference for shared memory or L1 (default) pub const CU_FUNC_CACHE_PREFER_NONE: CUfunc_cache_enum = CUfunc_cache_enum(0); } impl CUfunc_cache_enum { ///< prefer larger shared memory and smaller L1 cache pub const CU_FUNC_CACHE_PREFER_SHARED: CUfunc_cache_enum = CUfunc_cache_enum(1); } impl CUfunc_cache_enum { ///< prefer larger L1 cache and smaller shared memory pub const CU_FUNC_CACHE_PREFER_L1: CUfunc_cache_enum = CUfunc_cache_enum(2); } impl CUfunc_cache_enum { ///< prefer equal sized L1 cache and shared memory pub const CU_FUNC_CACHE_PREFER_EQUAL: CUfunc_cache_enum = CUfunc_cache_enum(3); } #[repr(transparent)] /// Function cache configurations #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUfunc_cache_enum(pub ::core::ffi::c_uint); /// Function cache configurations pub use self::CUfunc_cache_enum as CUfunc_cache; impl CUsharedconfig_enum { ///< set default shared memory bank size pub const CU_SHARED_MEM_CONFIG_DEFAULT_BANK_SIZE: CUsharedconfig_enum = CUsharedconfig_enum( 0, ); } impl CUsharedconfig_enum { ///< set shared memory bank width to four bytes pub const CU_SHARED_MEM_CONFIG_FOUR_BYTE_BANK_SIZE: CUsharedconfig_enum = CUsharedconfig_enum( 1, ); } impl CUsharedconfig_enum { ///< set shared memory bank width to eight bytes pub const CU_SHARED_MEM_CONFIG_EIGHT_BYTE_BANK_SIZE: CUsharedconfig_enum = CUsharedconfig_enum( 2, ); } #[repr(transparent)] /** \deprecated Shared memory configurations*/ #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUsharedconfig_enum(pub ::core::ffi::c_uint); /** \deprecated Shared memory configurations*/ pub use self::CUsharedconfig_enum as CUsharedconfig; impl CUshared_carveout_enum { ///< No preference for shared memory or L1 (default) pub const CU_SHAREDMEM_CARVEOUT_DEFAULT: CUshared_carveout_enum = CUshared_carveout_enum( -1, ); } impl CUshared_carveout_enum { ///< Prefer maximum available shared memory, minimum L1 cache pub const CU_SHAREDMEM_CARVEOUT_MAX_SHARED: CUshared_carveout_enum = CUshared_carveout_enum( 100, ); } impl CUshared_carveout_enum { ///< Prefer maximum available L1 cache, minimum shared memory pub const CU_SHAREDMEM_CARVEOUT_MAX_L1: CUshared_carveout_enum = CUshared_carveout_enum( 0, ); } #[repr(transparent)] /// Shared memory carveout configurations. These may be passed to ::cuFuncSetAttribute or ::cuKernelSetAttribute #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUshared_carveout_enum(pub ::core::ffi::c_int); /// Shared memory carveout configurations. These may be passed to ::cuFuncSetAttribute or ::cuKernelSetAttribute pub use self::CUshared_carveout_enum as CUshared_carveout; impl CUmemorytype_enum { ///< Host memory pub const CU_MEMORYTYPE_HOST: CUmemorytype_enum = CUmemorytype_enum(1); } impl CUmemorytype_enum { ///< Device memory pub const CU_MEMORYTYPE_DEVICE: CUmemorytype_enum = CUmemorytype_enum(2); } impl CUmemorytype_enum { ///< Array memory pub const CU_MEMORYTYPE_ARRAY: CUmemorytype_enum = CUmemorytype_enum(3); } impl CUmemorytype_enum { ///< Unified device or host memory pub const CU_MEMORYTYPE_UNIFIED: CUmemorytype_enum = CUmemorytype_enum(4); } #[repr(transparent)] /// Memory types #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUmemorytype_enum(pub ::core::ffi::c_uint); /// Memory types pub use self::CUmemorytype_enum as CUmemorytype; impl CUcomputemode_enum { ///< Default compute mode (Multiple contexts allowed per device) pub const CU_COMPUTEMODE_DEFAULT: CUcomputemode_enum = CUcomputemode_enum(0); } impl CUcomputemode_enum { ///< Compute-prohibited mode (No contexts can be created on this device at this time) pub const CU_COMPUTEMODE_PROHIBITED: CUcomputemode_enum = CUcomputemode_enum(2); } impl CUcomputemode_enum { ///< Compute-exclusive-process mode (Only one context used by a single process can be present on this device at a time) pub const CU_COMPUTEMODE_EXCLUSIVE_PROCESS: CUcomputemode_enum = CUcomputemode_enum( 3, ); } #[repr(transparent)] /// Compute Modes #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUcomputemode_enum(pub ::core::ffi::c_uint); /// Compute Modes pub use self::CUcomputemode_enum as CUcomputemode; impl CUmem_advise_enum { ///< Data will mostly be read and only occasionally be written to pub const CU_MEM_ADVISE_SET_READ_MOSTLY: CUmem_advise_enum = CUmem_advise_enum(1); } impl CUmem_advise_enum { ///< Undo the effect of ::CU_MEM_ADVISE_SET_READ_MOSTLY pub const CU_MEM_ADVISE_UNSET_READ_MOSTLY: CUmem_advise_enum = CUmem_advise_enum(2); } impl CUmem_advise_enum { ///< Set the preferred location for the data as the specified device pub const CU_MEM_ADVISE_SET_PREFERRED_LOCATION: CUmem_advise_enum = CUmem_advise_enum( 3, ); } impl CUmem_advise_enum { ///< Clear the preferred location for the data pub const CU_MEM_ADVISE_UNSET_PREFERRED_LOCATION: CUmem_advise_enum = CUmem_advise_enum( 4, ); } impl CUmem_advise_enum { ///< Data will be accessed by the specified device, so prevent page faults as much as possible pub const CU_MEM_ADVISE_SET_ACCESSED_BY: CUmem_advise_enum = CUmem_advise_enum(5); } impl CUmem_advise_enum { ///< Let the Unified Memory subsystem decide on the page faulting policy for the specified device pub const CU_MEM_ADVISE_UNSET_ACCESSED_BY: CUmem_advise_enum = CUmem_advise_enum(6); } #[repr(transparent)] /// Memory advise values #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUmem_advise_enum(pub ::core::ffi::c_uint); /// Memory advise values pub use self::CUmem_advise_enum as CUmem_advise; impl CUmem_range_attribute_enum { ///< Whether the range will mostly be read and only occasionally be written to pub const CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY: CUmem_range_attribute_enum = CUmem_range_attribute_enum( 1, ); } impl CUmem_range_attribute_enum { ///< The preferred location of the range pub const CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION: CUmem_range_attribute_enum = CUmem_range_attribute_enum( 2, ); } impl CUmem_range_attribute_enum { ///< Memory range has ::CU_MEM_ADVISE_SET_ACCESSED_BY set for specified device pub const CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY: CUmem_range_attribute_enum = CUmem_range_attribute_enum( 3, ); } impl CUmem_range_attribute_enum { ///< The last location to which the range was prefetched pub const CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION: CUmem_range_attribute_enum = CUmem_range_attribute_enum( 4, ); } impl CUmem_range_attribute_enum { ///< The preferred location type of the range pub const CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_TYPE: CUmem_range_attribute_enum = CUmem_range_attribute_enum( 5, ); } impl CUmem_range_attribute_enum { ///< The preferred location id of the range pub const CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_ID: CUmem_range_attribute_enum = CUmem_range_attribute_enum( 6, ); } impl CUmem_range_attribute_enum { ///< The last location type to which the range was prefetched pub const CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_TYPE: CUmem_range_attribute_enum = CUmem_range_attribute_enum( 7, ); } impl CUmem_range_attribute_enum { ///< The last location id to which the range was prefetched pub const CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_ID: CUmem_range_attribute_enum = CUmem_range_attribute_enum( 8, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUmem_range_attribute_enum(pub ::core::ffi::c_uint); pub use self::CUmem_range_attribute_enum as CUmem_range_attribute; impl CUjit_option_enum { /** Max number of registers that a thread may use.\n Option type: unsigned int\n Applies to: compiler only*/ pub const CU_JIT_MAX_REGISTERS: CUjit_option_enum = CUjit_option_enum(0); } impl CUjit_option_enum { /** IN: Specifies minimum number of threads per block to target compilation for\n OUT: Returns the number of threads the compiler actually targeted. This restricts the resource utilization of the compiler (e.g. max registers) such that a block with the given number of threads should be able to launch based on register limitations. Note, this option does not currently take into account any other resource limitations, such as shared memory utilization.\n Cannot be combined with ::CU_JIT_TARGET.\n Option type: unsigned int\n Applies to: compiler only*/ pub const CU_JIT_THREADS_PER_BLOCK: CUjit_option_enum = CUjit_option_enum(1); } impl CUjit_option_enum { /** Overwrites the option value with the total wall clock time, in milliseconds, spent in the compiler and linker\n Option type: float\n Applies to: compiler and linker*/ pub const CU_JIT_WALL_TIME: CUjit_option_enum = CUjit_option_enum(2); } impl CUjit_option_enum { /** Pointer to a buffer in which to print any log messages that are informational in nature (the buffer size is specified via option ::CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES)\n Option type: char *\n Applies to: compiler and linker*/ pub const CU_JIT_INFO_LOG_BUFFER: CUjit_option_enum = CUjit_option_enum(3); } impl CUjit_option_enum { /** IN: Log buffer size in bytes. Log messages will be capped at this size (including null terminator)\n OUT: Amount of log buffer filled with messages\n Option type: unsigned int\n Applies to: compiler and linker*/ pub const CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES: CUjit_option_enum = CUjit_option_enum( 4, ); } impl CUjit_option_enum { /** Pointer to a buffer in which to print any log messages that reflect errors (the buffer size is specified via option ::CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES)\n Option type: char *\n Applies to: compiler and linker*/ pub const CU_JIT_ERROR_LOG_BUFFER: CUjit_option_enum = CUjit_option_enum(5); } impl CUjit_option_enum { /** IN: Log buffer size in bytes. Log messages will be capped at this size (including null terminator)\n OUT: Amount of log buffer filled with messages\n Option type: unsigned int\n Applies to: compiler and linker*/ pub const CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES: CUjit_option_enum = CUjit_option_enum( 6, ); } impl CUjit_option_enum { /** Level of optimizations to apply to generated code (0 - 4), with 4 being the default and highest level of optimizations.\n Option type: unsigned int\n Applies to: compiler only*/ pub const CU_JIT_OPTIMIZATION_LEVEL: CUjit_option_enum = CUjit_option_enum(7); } impl CUjit_option_enum { /** No option value required. Determines the target based on the current attached context (default)\n Option type: No option value needed\n Applies to: compiler and linker*/ pub const CU_JIT_TARGET_FROM_CUCONTEXT: CUjit_option_enum = CUjit_option_enum(8); } impl CUjit_option_enum { /** Target is chosen based on supplied ::CUjit_target. Cannot be combined with ::CU_JIT_THREADS_PER_BLOCK.\n Option type: unsigned int for enumerated type ::CUjit_target\n Applies to: compiler and linker*/ pub const CU_JIT_TARGET: CUjit_option_enum = CUjit_option_enum(9); } impl CUjit_option_enum { /** Specifies choice of fallback strategy if matching cubin is not found. Choice is based on supplied ::CUjit_fallback. This option cannot be used with cuLink* APIs as the linker requires exact matches.\n Option type: unsigned int for enumerated type ::CUjit_fallback\n Applies to: compiler only*/ pub const CU_JIT_FALLBACK_STRATEGY: CUjit_option_enum = CUjit_option_enum(10); } impl CUjit_option_enum { /** Specifies whether to create debug information in output (-g) (0: false, default)\n Option type: int\n Applies to: compiler and linker*/ pub const CU_JIT_GENERATE_DEBUG_INFO: CUjit_option_enum = CUjit_option_enum(11); } impl CUjit_option_enum { /** Generate verbose log messages (0: false, default)\n Option type: int\n Applies to: compiler and linker*/ pub const CU_JIT_LOG_VERBOSE: CUjit_option_enum = CUjit_option_enum(12); } impl CUjit_option_enum { /** Generate line number information (-lineinfo) (0: false, default)\n Option type: int\n Applies to: compiler only*/ pub const CU_JIT_GENERATE_LINE_INFO: CUjit_option_enum = CUjit_option_enum(13); } impl CUjit_option_enum { /** Specifies whether to enable caching explicitly (-dlcm) \n Choice is based on supplied ::CUjit_cacheMode_enum.\n Option type: unsigned int for enumerated type ::CUjit_cacheMode_enum\n Applies to: compiler only*/ pub const CU_JIT_CACHE_MODE: CUjit_option_enum = CUjit_option_enum(14); } impl CUjit_option_enum { /** \deprecated This jit option is deprecated and should not be used.*/ pub const CU_JIT_NEW_SM3X_OPT: CUjit_option_enum = CUjit_option_enum(15); } impl CUjit_option_enum { /// This jit option is used for internal purpose only. pub const CU_JIT_FAST_COMPILE: CUjit_option_enum = CUjit_option_enum(16); } impl CUjit_option_enum { /** Array of device symbol names that will be relocated to the corresponding host addresses stored in ::CU_JIT_GLOBAL_SYMBOL_ADDRESSES.\n Must contain ::CU_JIT_GLOBAL_SYMBOL_COUNT entries.\n When loading a device module, driver will relocate all encountered unresolved symbols to the host addresses.\n It is only allowed to register symbols that correspond to unresolved global variables.\n It is illegal to register the same device symbol at multiple addresses.\n Option type: const char **\n Applies to: dynamic linker only*/ pub const CU_JIT_GLOBAL_SYMBOL_NAMES: CUjit_option_enum = CUjit_option_enum(17); } impl CUjit_option_enum { /** Array of host addresses that will be used to relocate corresponding device symbols stored in ::CU_JIT_GLOBAL_SYMBOL_NAMES.\n Must contain ::CU_JIT_GLOBAL_SYMBOL_COUNT entries.\n Option type: void **\n Applies to: dynamic linker only*/ pub const CU_JIT_GLOBAL_SYMBOL_ADDRESSES: CUjit_option_enum = CUjit_option_enum(18); } impl CUjit_option_enum { /** Number of entries in ::CU_JIT_GLOBAL_SYMBOL_NAMES and ::CU_JIT_GLOBAL_SYMBOL_ADDRESSES arrays.\n Option type: unsigned int\n Applies to: dynamic linker only*/ pub const CU_JIT_GLOBAL_SYMBOL_COUNT: CUjit_option_enum = CUjit_option_enum(19); } impl CUjit_option_enum { /** \deprecated Enable link-time optimization (-dlto) for device code (Disabled by default).\n This option is not supported on 32-bit platforms.\n Option type: int\n Applies to: compiler and linker Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0*/ pub const CU_JIT_LTO: CUjit_option_enum = CUjit_option_enum(20); } impl CUjit_option_enum { /** \deprecated Control single-precision denormals (-ftz) support (0: false, default). 1 : flushes denormal values to zero 0 : preserves denormal values Option type: int\n Applies to: link-time optimization specified with CU_JIT_LTO Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0*/ pub const CU_JIT_FTZ: CUjit_option_enum = CUjit_option_enum(21); } impl CUjit_option_enum { /** \deprecated Control single-precision floating-point division and reciprocals (-prec-div) support (1: true, default). 1 : Enables the IEEE round-to-nearest mode 0 : Enables the fast approximation mode Option type: int\n Applies to: link-time optimization specified with CU_JIT_LTO Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0*/ pub const CU_JIT_PREC_DIV: CUjit_option_enum = CUjit_option_enum(22); } impl CUjit_option_enum { /** \deprecated Control single-precision floating-point square root (-prec-sqrt) support (1: true, default). 1 : Enables the IEEE round-to-nearest mode 0 : Enables the fast approximation mode Option type: int\n Applies to: link-time optimization specified with CU_JIT_LTO Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0*/ pub const CU_JIT_PREC_SQRT: CUjit_option_enum = CUjit_option_enum(23); } impl CUjit_option_enum { /** \deprecated Enable/Disable the contraction of floating-point multiplies and adds/subtracts into floating-point multiply-add (-fma) operations (1: Enable, default; 0: Disable). Option type: int\n Applies to: link-time optimization specified with CU_JIT_LTO Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0*/ pub const CU_JIT_FMA: CUjit_option_enum = CUjit_option_enum(24); } impl CUjit_option_enum { /** \deprecated Array of kernel names that should be preserved at link time while others can be removed.\n Must contain ::CU_JIT_REFERENCED_KERNEL_COUNT entries.\n Note that kernel names can be mangled by the compiler in which case the mangled name needs to be specified.\n Wildcard "*" can be used to represent zero or more characters instead of specifying the full or mangled name.\n It is important to note that the wildcard "*" is also added implicitly. For example, specifying "foo" will match "foobaz", "barfoo", "barfoobaz" and thus preserve all kernels with those names. This can be avoided by providing a more specific name like "barfoobaz".\n Option type: const char **\n Applies to: dynamic linker only Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0*/ pub const CU_JIT_REFERENCED_KERNEL_NAMES: CUjit_option_enum = CUjit_option_enum(25); } impl CUjit_option_enum { /** \deprecated Number of entries in ::CU_JIT_REFERENCED_KERNEL_NAMES array.\n Option type: unsigned int\n Applies to: dynamic linker only Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0*/ pub const CU_JIT_REFERENCED_KERNEL_COUNT: CUjit_option_enum = CUjit_option_enum(26); } impl CUjit_option_enum { /** \deprecated Array of variable names (__device__ and/or __constant__) that should be preserved at link time while others can be removed.\n Must contain ::CU_JIT_REFERENCED_VARIABLE_COUNT entries.\n Note that variable names can be mangled by the compiler in which case the mangled name needs to be specified.\n Wildcard "*" can be used to represent zero or more characters instead of specifying the full or mangled name.\n It is important to note that the wildcard "*" is also added implicitly. For example, specifying "foo" will match "foobaz", "barfoo", "barfoobaz" and thus preserve all variables with those names. This can be avoided by providing a more specific name like "barfoobaz".\n Option type: const char **\n Applies to: link-time optimization specified with CU_JIT_LTO Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0*/ pub const CU_JIT_REFERENCED_VARIABLE_NAMES: CUjit_option_enum = CUjit_option_enum( 27, ); } impl CUjit_option_enum { /** \deprecated Number of entries in ::CU_JIT_REFERENCED_VARIABLE_NAMES array.\n Option type: unsigned int\n Applies to: link-time optimization specified with CU_JIT_LTO Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0*/ pub const CU_JIT_REFERENCED_VARIABLE_COUNT: CUjit_option_enum = CUjit_option_enum( 28, ); } impl CUjit_option_enum { /** \deprecated This option serves as a hint to enable the JIT compiler/linker to remove constant (__constant__) and device (__device__) variables unreferenced in device code (Disabled by default).\n Note that host references to constant and device variables using APIs like ::cuModuleGetGlobal() with this option specified may result in undefined behavior unless the variables are explicitly specified using ::CU_JIT_REFERENCED_VARIABLE_NAMES.\n Option type: int\n Applies to: link-time optimization specified with CU_JIT_LTO Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0*/ pub const CU_JIT_OPTIMIZE_UNUSED_DEVICE_VARIABLES: CUjit_option_enum = CUjit_option_enum( 29, ); } impl CUjit_option_enum { /** Generate position independent code (0: false)\n Option type: int\n Applies to: compiler only*/ pub const CU_JIT_POSITION_INDEPENDENT_CODE: CUjit_option_enum = CUjit_option_enum( 30, ); } impl CUjit_option_enum { /** This option hints to the JIT compiler the minimum number of CTAs from the kernel’s grid to be mapped to a SM. This option is ignored when used together with ::CU_JIT_MAX_REGISTERS or ::CU_JIT_THREADS_PER_BLOCK. Optimizations based on this option need ::CU_JIT_MAX_THREADS_PER_BLOCK to be specified as well. For kernels already using PTX directive .minnctapersm, this option will be ignored by default. Use ::CU_JIT_OVERRIDE_DIRECTIVE_VALUES to let this option take precedence over the PTX directive. Option type: unsigned int\n Applies to: compiler only*/ pub const CU_JIT_MIN_CTA_PER_SM: CUjit_option_enum = CUjit_option_enum(31); } impl CUjit_option_enum { /** Maximum number threads in a thread block, computed as the product of the maximum extent specifed for each dimension of the block. This limit is guaranteed not to be exeeded in any invocation of the kernel. Exceeding the the maximum number of threads results in runtime error or kernel launch failure. For kernels already using PTX directive .maxntid, this option will be ignored by default. Use ::CU_JIT_OVERRIDE_DIRECTIVE_VALUES to let this option take precedence over the PTX directive. Option type: int\n Applies to: compiler only*/ pub const CU_JIT_MAX_THREADS_PER_BLOCK: CUjit_option_enum = CUjit_option_enum(32); } impl CUjit_option_enum { /** This option lets the values specified using ::CU_JIT_MAX_REGISTERS, ::CU_JIT_THREADS_PER_BLOCK, ::CU_JIT_MAX_THREADS_PER_BLOCK and ::CU_JIT_MIN_CTA_PER_SM take precedence over any PTX directives. (0: Disable, default; 1: Enable) Option type: int\n Applies to: compiler only*/ pub const CU_JIT_OVERRIDE_DIRECTIVE_VALUES: CUjit_option_enum = CUjit_option_enum( 33, ); } impl CUjit_option_enum { /** This option specifies the maximum number of concurrent threads to use when running compiler optimizations. If the specified value is 1, the option will be ignored. If the specified value is 0, the number of threads will match the number of CPUs on the underlying machine. Otherwise, if the option is N, then up to N threads will be used. Option type: unsigned int\n Applies to: compiler only*/ pub const CU_JIT_SPLIT_COMPILE: CUjit_option_enum = CUjit_option_enum(34); } impl CUjit_option_enum { /** This option specifies the maximum number of concurrent threads to use when running compiler optimizations. If the specified value is 1, the option will be ignored. If the specified value is 0, the number of threads will match the number of CPUs on the underlying machine. Otherwise, if the option is N, then up to N threads will be used. Option type: unsigned int\n Applies to: compiler only*/ pub const CU_JIT_NUM_OPTIONS: CUjit_option_enum = CUjit_option_enum(35); } #[repr(transparent)] /// Online compiler and linker options #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUjit_option_enum(pub ::core::ffi::c_uint); /// Online compiler and linker options pub use self::CUjit_option_enum as CUjit_option; impl CUjit_target_enum { ///< Compute device class 3.0 pub const CU_TARGET_COMPUTE_30: CUjit_target_enum = CUjit_target_enum(30); } impl CUjit_target_enum { ///< Compute device class 3.2 pub const CU_TARGET_COMPUTE_32: CUjit_target_enum = CUjit_target_enum(32); } impl CUjit_target_enum { ///< Compute device class 3.5 pub const CU_TARGET_COMPUTE_35: CUjit_target_enum = CUjit_target_enum(35); } impl CUjit_target_enum { ///< Compute device class 3.7 pub const CU_TARGET_COMPUTE_37: CUjit_target_enum = CUjit_target_enum(37); } impl CUjit_target_enum { ///< Compute device class 5.0 pub const CU_TARGET_COMPUTE_50: CUjit_target_enum = CUjit_target_enum(50); } impl CUjit_target_enum { ///< Compute device class 5.2 pub const CU_TARGET_COMPUTE_52: CUjit_target_enum = CUjit_target_enum(52); } impl CUjit_target_enum { ///< Compute device class 5.3 pub const CU_TARGET_COMPUTE_53: CUjit_target_enum = CUjit_target_enum(53); } impl CUjit_target_enum { ///< Compute device class 6.0. pub const CU_TARGET_COMPUTE_60: CUjit_target_enum = CUjit_target_enum(60); } impl CUjit_target_enum { ///< Compute device class 6.1. pub const CU_TARGET_COMPUTE_61: CUjit_target_enum = CUjit_target_enum(61); } impl CUjit_target_enum { ///< Compute device class 6.2. pub const CU_TARGET_COMPUTE_62: CUjit_target_enum = CUjit_target_enum(62); } impl CUjit_target_enum { ///< Compute device class 7.0. pub const CU_TARGET_COMPUTE_70: CUjit_target_enum = CUjit_target_enum(70); } impl CUjit_target_enum { ///< Compute device class 7.2. pub const CU_TARGET_COMPUTE_72: CUjit_target_enum = CUjit_target_enum(72); } impl CUjit_target_enum { ///< Compute device class 7.5. pub const CU_TARGET_COMPUTE_75: CUjit_target_enum = CUjit_target_enum(75); } impl CUjit_target_enum { ///< Compute device class 8.0. pub const CU_TARGET_COMPUTE_80: CUjit_target_enum = CUjit_target_enum(80); } impl CUjit_target_enum { ///< Compute device class 8.6. pub const CU_TARGET_COMPUTE_86: CUjit_target_enum = CUjit_target_enum(86); } impl CUjit_target_enum { ///< Compute device class 8.7. pub const CU_TARGET_COMPUTE_87: CUjit_target_enum = CUjit_target_enum(87); } impl CUjit_target_enum { ///< Compute device class 8.9. pub const CU_TARGET_COMPUTE_89: CUjit_target_enum = CUjit_target_enum(89); } impl CUjit_target_enum { ///< Compute device class 9.0. pub const CU_TARGET_COMPUTE_90: CUjit_target_enum = CUjit_target_enum(90); } impl CUjit_target_enum { ///< Compute device class 10.0. pub const CU_TARGET_COMPUTE_100: CUjit_target_enum = CUjit_target_enum(100); } impl CUjit_target_enum { ///< Compute device class 11.0. pub const CU_TARGET_COMPUTE_110: CUjit_target_enum = CUjit_target_enum(110); } impl CUjit_target_enum { ///< Compute device class 10.3. pub const CU_TARGET_COMPUTE_103: CUjit_target_enum = CUjit_target_enum(103); } impl CUjit_target_enum { ///< Compute device class 12.0. pub const CU_TARGET_COMPUTE_120: CUjit_target_enum = CUjit_target_enum(120); } impl CUjit_target_enum { ///< Compute device class 12.1. pub const CU_TARGET_COMPUTE_121: CUjit_target_enum = CUjit_target_enum(121); } impl CUjit_target_enum { pub const CU_TARGET_COMPUTE_90A: CUjit_target_enum = CUjit_target_enum(65626); } impl CUjit_target_enum { pub const CU_TARGET_COMPUTE_100A: CUjit_target_enum = CUjit_target_enum(65636); } impl CUjit_target_enum { pub const CU_TARGET_COMPUTE_110A: CUjit_target_enum = CUjit_target_enum(65646); } impl CUjit_target_enum { pub const CU_TARGET_COMPUTE_103A: CUjit_target_enum = CUjit_target_enum(65639); } impl CUjit_target_enum { pub const CU_TARGET_COMPUTE_120A: CUjit_target_enum = CUjit_target_enum(65656); } impl CUjit_target_enum { pub const CU_TARGET_COMPUTE_121A: CUjit_target_enum = CUjit_target_enum(65657); } impl CUjit_target_enum { pub const CU_TARGET_COMPUTE_100F: CUjit_target_enum = CUjit_target_enum(131172); } impl CUjit_target_enum { pub const CU_TARGET_COMPUTE_110F: CUjit_target_enum = CUjit_target_enum(131182); } impl CUjit_target_enum { pub const CU_TARGET_COMPUTE_103F: CUjit_target_enum = CUjit_target_enum(131175); } impl CUjit_target_enum { pub const CU_TARGET_COMPUTE_120F: CUjit_target_enum = CUjit_target_enum(131192); } impl CUjit_target_enum { pub const CU_TARGET_COMPUTE_121F: CUjit_target_enum = CUjit_target_enum(131193); } #[repr(transparent)] /// Online compilation targets #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUjit_target_enum(pub ::core::ffi::c_uint); /// Online compilation targets pub use self::CUjit_target_enum as CUjit_target; impl CUjit_fallback_enum { ///< Prefer to compile ptx if exact binary match not found pub const CU_PREFER_PTX: CUjit_fallback_enum = CUjit_fallback_enum(0); } impl CUjit_fallback_enum { ///< Prefer to fall back to compatible binary code if exact match not found pub const CU_PREFER_BINARY: CUjit_fallback_enum = CUjit_fallback_enum(1); } #[repr(transparent)] /// Cubin matching fallback strategies #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUjit_fallback_enum(pub ::core::ffi::c_uint); /// Cubin matching fallback strategies pub use self::CUjit_fallback_enum as CUjit_fallback; impl CUjit_cacheMode_enum { ///< Compile with no -dlcm flag specified pub const CU_JIT_CACHE_OPTION_NONE: CUjit_cacheMode_enum = CUjit_cacheMode_enum(0); } impl CUjit_cacheMode_enum { ///< Compile with L1 cache disabled pub const CU_JIT_CACHE_OPTION_CG: CUjit_cacheMode_enum = CUjit_cacheMode_enum(1); } impl CUjit_cacheMode_enum { ///< Compile with L1 cache enabled pub const CU_JIT_CACHE_OPTION_CA: CUjit_cacheMode_enum = CUjit_cacheMode_enum(2); } #[repr(transparent)] /// Caching modes for dlcm #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUjit_cacheMode_enum(pub ::core::ffi::c_uint); /// Caching modes for dlcm pub use self::CUjit_cacheMode_enum as CUjit_cacheMode; impl CUjitInputType_enum { /** Compiled device-class-specific device code\n Applicable options: none*/ pub const CU_JIT_INPUT_CUBIN: CUjitInputType_enum = CUjitInputType_enum(0); } impl CUjitInputType_enum { /** PTX source code\n Applicable options: PTX compiler options*/ pub const CU_JIT_INPUT_PTX: CUjitInputType_enum = CUjitInputType_enum(1); } impl CUjitInputType_enum { /** Bundle of multiple cubins and/or PTX of some device code\n Applicable options: PTX compiler options, ::CU_JIT_FALLBACK_STRATEGY*/ pub const CU_JIT_INPUT_FATBINARY: CUjitInputType_enum = CUjitInputType_enum(2); } impl CUjitInputType_enum { /** Host object with embedded device code\n Applicable options: PTX compiler options, ::CU_JIT_FALLBACK_STRATEGY*/ pub const CU_JIT_INPUT_OBJECT: CUjitInputType_enum = CUjitInputType_enum(3); } impl CUjitInputType_enum { /** Archive of host objects with embedded device code\n Applicable options: PTX compiler options, ::CU_JIT_FALLBACK_STRATEGY*/ pub const CU_JIT_INPUT_LIBRARY: CUjitInputType_enum = CUjitInputType_enum(4); } impl CUjitInputType_enum { /** \deprecated High-level intermediate code for link-time optimization\n Applicable options: NVVM compiler options, PTX compiler options Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0*/ pub const CU_JIT_INPUT_NVVM: CUjitInputType_enum = CUjitInputType_enum(5); } impl CUjitInputType_enum { /** \deprecated High-level intermediate code for link-time optimization\n Applicable options: NVVM compiler options, PTX compiler options Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0*/ pub const CU_JIT_NUM_INPUT_TYPES: CUjitInputType_enum = CUjitInputType_enum(6); } #[repr(transparent)] /// Device code formats #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUjitInputType_enum(pub ::core::ffi::c_uint); /// Device code formats pub use self::CUjitInputType_enum as CUjitInputType; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct CUlinkState_st { _unused: [u8; 0], } pub type CUlinkState = *mut CUlinkState_st; impl CUgraphicsRegisterFlags_enum { pub const CU_GRAPHICS_REGISTER_FLAGS_NONE: CUgraphicsRegisterFlags_enum = CUgraphicsRegisterFlags_enum( 0, ); } impl CUgraphicsRegisterFlags_enum { pub const CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY: CUgraphicsRegisterFlags_enum = CUgraphicsRegisterFlags_enum( 1, ); } impl CUgraphicsRegisterFlags_enum { pub const CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD: CUgraphicsRegisterFlags_enum = CUgraphicsRegisterFlags_enum( 2, ); } impl CUgraphicsRegisterFlags_enum { pub const CU_GRAPHICS_REGISTER_FLAGS_SURFACE_LDST: CUgraphicsRegisterFlags_enum = CUgraphicsRegisterFlags_enum( 4, ); } impl CUgraphicsRegisterFlags_enum { pub const CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER: CUgraphicsRegisterFlags_enum = CUgraphicsRegisterFlags_enum( 8, ); } #[repr(transparent)] /// Flags to register a graphics resource #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUgraphicsRegisterFlags_enum(pub ::core::ffi::c_uint); /// Flags to register a graphics resource pub use self::CUgraphicsRegisterFlags_enum as CUgraphicsRegisterFlags; impl CUgraphicsMapResourceFlags_enum { pub const CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE: CUgraphicsMapResourceFlags_enum = CUgraphicsMapResourceFlags_enum( 0, ); } impl CUgraphicsMapResourceFlags_enum { pub const CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY: CUgraphicsMapResourceFlags_enum = CUgraphicsMapResourceFlags_enum( 1, ); } impl CUgraphicsMapResourceFlags_enum { pub const CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD: CUgraphicsMapResourceFlags_enum = CUgraphicsMapResourceFlags_enum( 2, ); } #[repr(transparent)] /// Flags for mapping and unmapping interop resources #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUgraphicsMapResourceFlags_enum(pub ::core::ffi::c_uint); /// Flags for mapping and unmapping interop resources pub use self::CUgraphicsMapResourceFlags_enum as CUgraphicsMapResourceFlags; impl CUarray_cubemap_face_enum { ///< Positive X face of cubemap pub const CU_CUBEMAP_FACE_POSITIVE_X: CUarray_cubemap_face_enum = CUarray_cubemap_face_enum( 0, ); } impl CUarray_cubemap_face_enum { ///< Negative X face of cubemap pub const CU_CUBEMAP_FACE_NEGATIVE_X: CUarray_cubemap_face_enum = CUarray_cubemap_face_enum( 1, ); } impl CUarray_cubemap_face_enum { ///< Positive Y face of cubemap pub const CU_CUBEMAP_FACE_POSITIVE_Y: CUarray_cubemap_face_enum = CUarray_cubemap_face_enum( 2, ); } impl CUarray_cubemap_face_enum { ///< Negative Y face of cubemap pub const CU_CUBEMAP_FACE_NEGATIVE_Y: CUarray_cubemap_face_enum = CUarray_cubemap_face_enum( 3, ); } impl CUarray_cubemap_face_enum { ///< Positive Z face of cubemap pub const CU_CUBEMAP_FACE_POSITIVE_Z: CUarray_cubemap_face_enum = CUarray_cubemap_face_enum( 4, ); } impl CUarray_cubemap_face_enum { ///< Negative Z face of cubemap pub const CU_CUBEMAP_FACE_NEGATIVE_Z: CUarray_cubemap_face_enum = CUarray_cubemap_face_enum( 5, ); } #[repr(transparent)] /// Array indices for cube faces #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUarray_cubemap_face_enum(pub ::core::ffi::c_uint); /// Array indices for cube faces pub use self::CUarray_cubemap_face_enum as CUarray_cubemap_face; impl CUlimit_enum { ///< GPU thread stack size pub const CU_LIMIT_STACK_SIZE: CUlimit_enum = CUlimit_enum(0); } impl CUlimit_enum { ///< GPU printf FIFO size pub const CU_LIMIT_PRINTF_FIFO_SIZE: CUlimit_enum = CUlimit_enum(1); } impl CUlimit_enum { ///< GPU malloc heap size pub const CU_LIMIT_MALLOC_HEAP_SIZE: CUlimit_enum = CUlimit_enum(2); } impl CUlimit_enum { ///< GPU device runtime launch synchronize depth pub const CU_LIMIT_DEV_RUNTIME_SYNC_DEPTH: CUlimit_enum = CUlimit_enum(3); } impl CUlimit_enum { ///< GPU device runtime pending launch count pub const CU_LIMIT_DEV_RUNTIME_PENDING_LAUNCH_COUNT: CUlimit_enum = CUlimit_enum(4); } impl CUlimit_enum { ///< A value between 0 and 128 that indicates the maximum fetch granularity of L2 (in Bytes). This is a hint pub const CU_LIMIT_MAX_L2_FETCH_GRANULARITY: CUlimit_enum = CUlimit_enum(5); } impl CUlimit_enum { ///< A size in bytes for L2 persisting lines cache size pub const CU_LIMIT_PERSISTING_L2_CACHE_SIZE: CUlimit_enum = CUlimit_enum(6); } impl CUlimit_enum { ///< A maximum size in bytes of shared memory available to CUDA kernels on a CIG context. Can only be queried, cannot be set pub const CU_LIMIT_SHMEM_SIZE: CUlimit_enum = CUlimit_enum(7); } impl CUlimit_enum { ///< A non-zero value indicates this CUDA context is a CIG-enabled context. Can only be queried, cannot be set pub const CU_LIMIT_CIG_ENABLED: CUlimit_enum = CUlimit_enum(8); } impl CUlimit_enum { ///< When set to zero, CUDA will fail to launch a kernel on a CIG context, instead of using the fallback path, if the kernel uses more shared memory than available pub const CU_LIMIT_CIG_SHMEM_FALLBACK_ENABLED: CUlimit_enum = CUlimit_enum(9); } impl CUlimit_enum { pub const CU_LIMIT_MAX: CUlimit_enum = CUlimit_enum(10); } #[repr(transparent)] /// Limits #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUlimit_enum(pub ::core::ffi::c_uint); /// Limits pub use self::CUlimit_enum as CUlimit; impl CUresourcetype_enum { ///< Array resource pub const CU_RESOURCE_TYPE_ARRAY: CUresourcetype_enum = CUresourcetype_enum(0); } impl CUresourcetype_enum { ///< Mipmapped array resource pub const CU_RESOURCE_TYPE_MIPMAPPED_ARRAY: CUresourcetype_enum = CUresourcetype_enum( 1, ); } impl CUresourcetype_enum { ///< Linear resource pub const CU_RESOURCE_TYPE_LINEAR: CUresourcetype_enum = CUresourcetype_enum(2); } impl CUresourcetype_enum { ///< Pitch 2D resource pub const CU_RESOURCE_TYPE_PITCH2D: CUresourcetype_enum = CUresourcetype_enum(3); } #[repr(transparent)] /// Resource types #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUresourcetype_enum(pub ::core::ffi::c_uint); /// Resource types pub use self::CUresourcetype_enum as CUresourcetype; /** CUDA host function \param userData Argument value passed to the function*/ pub type CUhostFn = ::core::option::Option< unsafe extern "system" fn(userData: *mut ::core::ffi::c_void), >; impl CUaccessProperty_enum { ///< Normal cache persistence. pub const CU_ACCESS_PROPERTY_NORMAL: CUaccessProperty_enum = CUaccessProperty_enum( 0, ); } impl CUaccessProperty_enum { ///< Streaming access is less likely to persit from cache. pub const CU_ACCESS_PROPERTY_STREAMING: CUaccessProperty_enum = CUaccessProperty_enum( 1, ); } impl CUaccessProperty_enum { ///< Persisting access is more likely to persist in cache. pub const CU_ACCESS_PROPERTY_PERSISTING: CUaccessProperty_enum = CUaccessProperty_enum( 2, ); } #[repr(transparent)] /// Specifies performance hint with ::CUaccessPolicyWindow for hitProp and missProp members. #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUaccessProperty_enum(pub ::core::ffi::c_uint); /// Specifies performance hint with ::CUaccessPolicyWindow for hitProp and missProp members. pub use self::CUaccessProperty_enum as CUaccessProperty; /** Specifies an access policy for a window, a contiguous extent of memory beginning at base_ptr and ending at base_ptr + num_bytes. num_bytes is limited by CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE. Partition into many segments and assign segments such that: sum of "hit segments" / window == approx. ratio. sum of "miss segments" / window == approx 1-ratio. Segments and ratio specifications are fitted to the capabilities of the architecture. Accesses in a hit segment apply the hitProp access policy. Accesses in a miss segment apply the missProp access policy.*/ #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct CUaccessPolicyWindow_st { ///< Starting address of the access policy window. CUDA driver may align it. pub base_ptr: *mut ::core::ffi::c_void, ///< Size in bytes of the window policy. CUDA driver may restrict the maximum size and alignment. pub num_bytes: usize, ///< hitRatio specifies percentage of lines assigned hitProp, rest are assigned missProp. pub hitRatio: f32, ///< ::CUaccessProperty set for hit. pub hitProp: CUaccessProperty, ///< ::CUaccessProperty set for miss. Must be either NORMAL or STREAMING pub missProp: CUaccessProperty, } /** Specifies an access policy for a window, a contiguous extent of memory beginning at base_ptr and ending at base_ptr + num_bytes. num_bytes is limited by CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE. Partition into many segments and assign segments such that: sum of "hit segments" / window == approx. ratio. sum of "miss segments" / window == approx 1-ratio. Segments and ratio specifications are fitted to the capabilities of the architecture. Accesses in a hit segment apply the hitProp access policy. Accesses in a miss segment apply the missProp access policy.*/ pub type CUaccessPolicyWindow_v1 = CUaccessPolicyWindow_st; /// Access policy window pub type CUaccessPolicyWindow = CUaccessPolicyWindow_v1; /// GPU kernel node parameters #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_KERNEL_NODE_PARAMS_st { ///< Kernel to launch pub func: CUfunction, ///< Width of grid in blocks pub gridDimX: ::core::ffi::c_uint, ///< Height of grid in blocks pub gridDimY: ::core::ffi::c_uint, ///< Depth of grid in blocks pub gridDimZ: ::core::ffi::c_uint, ///< X dimension of each thread block pub blockDimX: ::core::ffi::c_uint, ///< Y dimension of each thread block pub blockDimY: ::core::ffi::c_uint, ///< Z dimension of each thread block pub blockDimZ: ::core::ffi::c_uint, ///< Dynamic shared-memory size per thread block in bytes pub sharedMemBytes: ::core::ffi::c_uint, ///< Array of pointers to kernel parameters pub kernelParams: *mut *mut ::core::ffi::c_void, ///< Extra options pub extra: *mut *mut ::core::ffi::c_void, } /// GPU kernel node parameters pub type CUDA_KERNEL_NODE_PARAMS_v1 = CUDA_KERNEL_NODE_PARAMS_st; /// GPU kernel node parameters #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_KERNEL_NODE_PARAMS_v2_st { ///< Kernel to launch pub func: CUfunction, ///< Width of grid in blocks pub gridDimX: ::core::ffi::c_uint, ///< Height of grid in blocks pub gridDimY: ::core::ffi::c_uint, ///< Depth of grid in blocks pub gridDimZ: ::core::ffi::c_uint, ///< X dimension of each thread block pub blockDimX: ::core::ffi::c_uint, ///< Y dimension of each thread block pub blockDimY: ::core::ffi::c_uint, ///< Z dimension of each thread block pub blockDimZ: ::core::ffi::c_uint, ///< Dynamic shared-memory size per thread block in bytes pub sharedMemBytes: ::core::ffi::c_uint, ///< Array of pointers to kernel parameters pub kernelParams: *mut *mut ::core::ffi::c_void, ///< Extra options pub extra: *mut *mut ::core::ffi::c_void, ///< Kernel to launch, will only be referenced if func is NULL pub kern: CUkernel, ///< Context for the kernel task to run in. The value NULL will indicate the current context should be used by the api. This field is ignored if func is set. pub ctx: CUcontext, } /// GPU kernel node parameters pub type CUDA_KERNEL_NODE_PARAMS_v2 = CUDA_KERNEL_NODE_PARAMS_v2_st; /// GPU kernel node parameters pub type CUDA_KERNEL_NODE_PARAMS = CUDA_KERNEL_NODE_PARAMS_v2; /// GPU kernel node parameters #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_KERNEL_NODE_PARAMS_v3_st { ///< Kernel to launch pub func: CUfunction, ///< Width of grid in blocks pub gridDimX: ::core::ffi::c_uint, ///< Height of grid in blocks pub gridDimY: ::core::ffi::c_uint, ///< Depth of grid in blocks pub gridDimZ: ::core::ffi::c_uint, ///< X dimension of each thread block pub blockDimX: ::core::ffi::c_uint, ///< Y dimension of each thread block pub blockDimY: ::core::ffi::c_uint, ///< Z dimension of each thread block pub blockDimZ: ::core::ffi::c_uint, ///< Dynamic shared-memory size per thread block in bytes pub sharedMemBytes: ::core::ffi::c_uint, ///< Array of pointers to kernel parameters pub kernelParams: *mut *mut ::core::ffi::c_void, ///< Extra options pub extra: *mut *mut ::core::ffi::c_void, ///< Kernel to launch, will only be referenced if func is NULL pub kern: CUkernel, ///< Context for the kernel task to run in. The value NULL will indicate the current context should be used by the api. This field is ignored if func is set. pub ctx: CUcontext, } /// GPU kernel node parameters pub type CUDA_KERNEL_NODE_PARAMS_v3 = CUDA_KERNEL_NODE_PARAMS_v3_st; /// Memset node parameters #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_MEMSET_NODE_PARAMS_st { ///< Destination device pointer pub dst: CUdeviceptr, ///< Pitch of destination device pointer. Unused if height is 1 pub pitch: usize, ///< Value to be set pub value: ::core::ffi::c_uint, ///< Size of each element in bytes. Must be 1, 2, or 4. pub elementSize: ::core::ffi::c_uint, ///< Width of the row in elements pub width: usize, ///< Number of rows pub height: usize, } /// Memset node parameters pub type CUDA_MEMSET_NODE_PARAMS_v1 = CUDA_MEMSET_NODE_PARAMS_st; /// Memset node parameters pub type CUDA_MEMSET_NODE_PARAMS = CUDA_MEMSET_NODE_PARAMS_v1; /// Memset node parameters #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_MEMSET_NODE_PARAMS_v2_st { ///< Destination device pointer pub dst: CUdeviceptr, ///< Pitch of destination device pointer. Unused if height is 1 pub pitch: usize, ///< Value to be set pub value: ::core::ffi::c_uint, ///< Size of each element in bytes. Must be 1, 2, or 4. pub elementSize: ::core::ffi::c_uint, ///< Width of the row in elements pub width: usize, ///< Number of rows pub height: usize, ///< Context on which to run the node pub ctx: CUcontext, } /// Memset node parameters pub type CUDA_MEMSET_NODE_PARAMS_v2 = CUDA_MEMSET_NODE_PARAMS_v2_st; /// Host node parameters #[repr(C)] #[derive(Debug, Copy, Clone, Hash)] pub struct CUDA_HOST_NODE_PARAMS_st { ///< The function to call when the node executes pub fn_: CUhostFn, ///< Argument to pass to the function pub userData: *mut ::core::ffi::c_void, } /// Host node parameters pub type CUDA_HOST_NODE_PARAMS_v1 = CUDA_HOST_NODE_PARAMS_st; /// Host node parameters pub type CUDA_HOST_NODE_PARAMS = CUDA_HOST_NODE_PARAMS_v1; /// Host node parameters #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_HOST_NODE_PARAMS_v2_st { ///< The function to call when the node executes pub fn_: CUhostFn, ///< Argument to pass to the function pub userData: *mut ::core::ffi::c_void, } /// Host node parameters pub type CUDA_HOST_NODE_PARAMS_v2 = CUDA_HOST_NODE_PARAMS_v2_st; impl CUgraphConditionalNodeType_enum { ///< Conditional 'if/else' Node. Body[0] executed if condition is non-zero. If \p size == 2, an optional ELSE graph is created and this is executed if the condition is zero. pub const CU_GRAPH_COND_TYPE_IF: CUgraphConditionalNodeType_enum = CUgraphConditionalNodeType_enum( 0, ); } impl CUgraphConditionalNodeType_enum { ///< Conditional 'while' Node. Body executed repeatedly while condition value is non-zero. pub const CU_GRAPH_COND_TYPE_WHILE: CUgraphConditionalNodeType_enum = CUgraphConditionalNodeType_enum( 1, ); } impl CUgraphConditionalNodeType_enum { ///< Conditional 'switch' Node. Body[n] is executed once, where 'n' is the value of the condition. If the condition does not match a body index, no body is launched. pub const CU_GRAPH_COND_TYPE_SWITCH: CUgraphConditionalNodeType_enum = CUgraphConditionalNodeType_enum( 2, ); } #[repr(transparent)] /// Conditional node types #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUgraphConditionalNodeType_enum(pub ::core::ffi::c_uint); /// Conditional node types pub use self::CUgraphConditionalNodeType_enum as CUgraphConditionalNodeType; /// Conditional node parameters #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_CONDITIONAL_NODE_PARAMS { /**< Conditional node handle. Handles must be created in advance of creating the node using ::cuGraphConditionalHandleCreate.*/ pub handle: CUgraphConditionalHandle, ///< Type of conditional node. pub type_: CUgraphConditionalNodeType, /**< Size of graph output array. Allowed values are 1 for CU_GRAPH_COND_TYPE_WHILE, 1 or 2 for CU_GRAPH_COND_TYPE_IF, or any value greater than zero for CU_GRAPH_COND_TYPE_SWITCH.*/ pub size: ::core::ffi::c_uint, /**< CUDA-owned array populated with conditional node child graphs during creation of the node. Valid for the lifetime of the conditional node. The contents of the graph(s) are subject to the following constraints: - Allowed node types are kernel nodes, empty nodes, child graphs, memsets, memcopies, and conditionals. This applies recursively to child graphs and conditional bodies. - All kernels, including kernels in nested conditionals or child graphs at any level, must belong to the same CUDA context. These graphs may be populated using graph node creation APIs or ::cuStreamBeginCaptureToGraph. CU_GRAPH_COND_TYPE_IF: phGraph_out[0] is executed when the condition is non-zero. If \p size == 2, phGraph_out[1] will be executed when the condition is zero. CU_GRAPH_COND_TYPE_WHILE: phGraph_out[0] is executed as long as the condition is non-zero. CU_GRAPH_COND_TYPE_SWITCH: phGraph_out[n] is executed when the condition is equal to n. If the condition >= \p size, no body graph is executed.*/ pub phGraph_out: *mut CUgraph, ///< Context on which to run the node. Must match context used to create the handle and all body nodes. pub ctx: CUcontext, } impl CUgraphNodeType_enum { ///< GPU kernel node pub const CU_GRAPH_NODE_TYPE_KERNEL: CUgraphNodeType_enum = CUgraphNodeType_enum(0); } impl CUgraphNodeType_enum { ///< Memcpy node pub const CU_GRAPH_NODE_TYPE_MEMCPY: CUgraphNodeType_enum = CUgraphNodeType_enum(1); } impl CUgraphNodeType_enum { ///< Memset node pub const CU_GRAPH_NODE_TYPE_MEMSET: CUgraphNodeType_enum = CUgraphNodeType_enum(2); } impl CUgraphNodeType_enum { ///< Host (executable) node pub const CU_GRAPH_NODE_TYPE_HOST: CUgraphNodeType_enum = CUgraphNodeType_enum(3); } impl CUgraphNodeType_enum { ///< Node which executes an embedded graph pub const CU_GRAPH_NODE_TYPE_GRAPH: CUgraphNodeType_enum = CUgraphNodeType_enum(4); } impl CUgraphNodeType_enum { ///< Empty (no-op) node pub const CU_GRAPH_NODE_TYPE_EMPTY: CUgraphNodeType_enum = CUgraphNodeType_enum(5); } impl CUgraphNodeType_enum { ///< External event wait node pub const CU_GRAPH_NODE_TYPE_WAIT_EVENT: CUgraphNodeType_enum = CUgraphNodeType_enum( 6, ); } impl CUgraphNodeType_enum { ///< External event record node pub const CU_GRAPH_NODE_TYPE_EVENT_RECORD: CUgraphNodeType_enum = CUgraphNodeType_enum( 7, ); } impl CUgraphNodeType_enum { ///< External semaphore signal node pub const CU_GRAPH_NODE_TYPE_EXT_SEMAS_SIGNAL: CUgraphNodeType_enum = CUgraphNodeType_enum( 8, ); } impl CUgraphNodeType_enum { ///< External semaphore wait node pub const CU_GRAPH_NODE_TYPE_EXT_SEMAS_WAIT: CUgraphNodeType_enum = CUgraphNodeType_enum( 9, ); } impl CUgraphNodeType_enum { ///< Memory Allocation Node pub const CU_GRAPH_NODE_TYPE_MEM_ALLOC: CUgraphNodeType_enum = CUgraphNodeType_enum( 10, ); } impl CUgraphNodeType_enum { ///< Memory Free Node pub const CU_GRAPH_NODE_TYPE_MEM_FREE: CUgraphNodeType_enum = CUgraphNodeType_enum( 11, ); } impl CUgraphNodeType_enum { /**< Batch MemOp Node See ::cuStreamBatchMemOp and ::CUstreamBatchMemOpType for what these nodes can do.*/ pub const CU_GRAPH_NODE_TYPE_BATCH_MEM_OP: CUgraphNodeType_enum = CUgraphNodeType_enum( 12, ); } impl CUgraphNodeType_enum { /**< Conditional Node May be used to implement a conditional execution path or loop inside of a graph. The graph(s) contained within the body of the conditional node can be selectively executed or iterated upon based on the value of a conditional variable. Handles must be created in advance of creating the node using ::cuGraphConditionalHandleCreate. The following restrictions apply to graphs which contain conditional nodes: The graph cannot be used in a child node. Only one instantiation of the graph may exist at any point in time. The graph cannot be cloned. To set the control value, supply a default value when creating the handle and/or call ::cudaGraphSetConditional from device code.*/ pub const CU_GRAPH_NODE_TYPE_CONDITIONAL: CUgraphNodeType_enum = CUgraphNodeType_enum( 13, ); } #[repr(transparent)] /// Graph node types #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUgraphNodeType_enum(pub ::core::ffi::c_uint); /// Graph node types pub use self::CUgraphNodeType_enum as CUgraphNodeType; impl CUgraphDependencyType_enum { ///< This is an ordinary dependency. pub const CU_GRAPH_DEPENDENCY_TYPE_DEFAULT: CUgraphDependencyType_enum = CUgraphDependencyType_enum( 0, ); } impl CUgraphDependencyType_enum { /**< This dependency type allows the downstream node to use \c cudaGridDependencySynchronize(). It may only be used between kernel nodes, and must be used with either the ::CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC or ::CU_GRAPH_KERNEL_NODE_PORT_LAUNCH_ORDER outgoing port.*/ pub const CU_GRAPH_DEPENDENCY_TYPE_PROGRAMMATIC: CUgraphDependencyType_enum = CUgraphDependencyType_enum( 1, ); } #[repr(transparent)] /// Type annotations that can be applied to graph edges as part of ::CUgraphEdgeData. #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUgraphDependencyType_enum(pub ::core::ffi::c_uint); /// Type annotations that can be applied to graph edges as part of ::CUgraphEdgeData. pub use self::CUgraphDependencyType_enum as CUgraphDependencyType; /** Optional annotation for edges in a CUDA graph. Note, all edges implicitly have annotations and default to a zero-initialized value if not specified. A zero-initialized struct indicates a standard full serialization of two nodes with memory visibility.*/ #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUgraphEdgeData_st { /**< This indicates when the dependency is triggered from the upstream node on the edge. The meaning is specfic to the node type. A value of 0 in all cases means full completion of the upstream node, with memory visibility to the downstream node or portion thereof (indicated by \c to_port).
Only kernel nodes define non-zero ports. A kernel node can use the following output port types: ::CU_GRAPH_KERNEL_NODE_PORT_DEFAULT, ::CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC, or ::CU_GRAPH_KERNEL_NODE_PORT_LAUNCH_ORDER.*/ pub from_port: ::core::ffi::c_uchar, /**< This indicates what portion of the downstream node is dependent on the upstream node or portion thereof (indicated by \c from_port). The meaning is specific to the node type. A value of 0 in all cases means the entirety of the downstream node is dependent on the upstream work.
Currently no node types define non-zero ports. Accordingly, this field must be set to zero.*/ pub to_port: ::core::ffi::c_uchar, /**< This should be populated with a value from ::CUgraphDependencyType. (It is typed as char due to compiler-specific layout of bitfields.) See ::CUgraphDependencyType.*/ pub type_: ::core::ffi::c_uchar, /**< These bytes are unused and must be zeroed. This ensures compatibility if additional fields are added in the future.*/ pub reserved: [::core::ffi::c_uchar; 5usize], } /** Optional annotation for edges in a CUDA graph. Note, all edges implicitly have annotations and default to a zero-initialized value if not specified. A zero-initialized struct indicates a standard full serialization of two nodes with memory visibility.*/ pub type CUgraphEdgeData = CUgraphEdgeData_st; impl CUgraphInstantiateResult_enum { ///< Instantiation succeeded pub const CUDA_GRAPH_INSTANTIATE_SUCCESS: CUgraphInstantiateResult_enum = CUgraphInstantiateResult_enum( 0, ); } impl CUgraphInstantiateResult_enum { ///< Instantiation failed for an unexpected reason which is described in the return value of the function pub const CUDA_GRAPH_INSTANTIATE_ERROR: CUgraphInstantiateResult_enum = CUgraphInstantiateResult_enum( 1, ); } impl CUgraphInstantiateResult_enum { ///< Instantiation failed due to invalid structure, such as cycles pub const CUDA_GRAPH_INSTANTIATE_INVALID_STRUCTURE: CUgraphInstantiateResult_enum = CUgraphInstantiateResult_enum( 2, ); } impl CUgraphInstantiateResult_enum { ///< Instantiation for device launch failed because the graph contained an unsupported operation pub const CUDA_GRAPH_INSTANTIATE_NODE_OPERATION_NOT_SUPPORTED: CUgraphInstantiateResult_enum = CUgraphInstantiateResult_enum( 3, ); } impl CUgraphInstantiateResult_enum { ///< Instantiation for device launch failed due to the nodes belonging to different contexts pub const CUDA_GRAPH_INSTANTIATE_MULTIPLE_CTXS_NOT_SUPPORTED: CUgraphInstantiateResult_enum = CUgraphInstantiateResult_enum( 4, ); } impl CUgraphInstantiateResult_enum { ///< One or more conditional handles are not associated with conditional nodes pub const CUDA_GRAPH_INSTANTIATE_CONDITIONAL_HANDLE_UNUSED: CUgraphInstantiateResult_enum = CUgraphInstantiateResult_enum( 5, ); } #[repr(transparent)] /// Graph instantiation results #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUgraphInstantiateResult_enum(pub ::core::ffi::c_uint); /// Graph instantiation results pub use self::CUgraphInstantiateResult_enum as CUgraphInstantiateResult; /// Graph instantiation parameters #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_GRAPH_INSTANTIATE_PARAMS_st { ///< Instantiation flags pub flags: cuuint64_t, ///< Upload stream pub hUploadStream: CUstream, ///< The node which caused instantiation to fail, if any pub hErrNode_out: CUgraphNode, ///< Whether instantiation was successful. If it failed, the reason why pub result_out: CUgraphInstantiateResult, } /// Graph instantiation parameters pub type CUDA_GRAPH_INSTANTIATE_PARAMS = CUDA_GRAPH_INSTANTIATE_PARAMS_st; impl CUsynchronizationPolicy_enum { pub const CU_SYNC_POLICY_AUTO: CUsynchronizationPolicy_enum = CUsynchronizationPolicy_enum( 1, ); } impl CUsynchronizationPolicy_enum { pub const CU_SYNC_POLICY_SPIN: CUsynchronizationPolicy_enum = CUsynchronizationPolicy_enum( 2, ); } impl CUsynchronizationPolicy_enum { pub const CU_SYNC_POLICY_YIELD: CUsynchronizationPolicy_enum = CUsynchronizationPolicy_enum( 3, ); } impl CUsynchronizationPolicy_enum { pub const CU_SYNC_POLICY_BLOCKING_SYNC: CUsynchronizationPolicy_enum = CUsynchronizationPolicy_enum( 4, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUsynchronizationPolicy_enum(pub ::core::ffi::c_uint); pub use self::CUsynchronizationPolicy_enum as CUsynchronizationPolicy; impl CUclusterSchedulingPolicy_enum { ///< the default policy pub const CU_CLUSTER_SCHEDULING_POLICY_DEFAULT: CUclusterSchedulingPolicy_enum = CUclusterSchedulingPolicy_enum( 0, ); } impl CUclusterSchedulingPolicy_enum { ///< spread the blocks within a cluster to the SMs pub const CU_CLUSTER_SCHEDULING_POLICY_SPREAD: CUclusterSchedulingPolicy_enum = CUclusterSchedulingPolicy_enum( 1, ); } impl CUclusterSchedulingPolicy_enum { ///< allow the hardware to load-balance the blocks in a cluster to the SMs pub const CU_CLUSTER_SCHEDULING_POLICY_LOAD_BALANCING: CUclusterSchedulingPolicy_enum = CUclusterSchedulingPolicy_enum( 2, ); } #[repr(transparent)] /// Cluster scheduling policies. These may be passed to ::cuFuncSetAttribute or ::cuKernelSetAttribute #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUclusterSchedulingPolicy_enum(pub ::core::ffi::c_uint); /// Cluster scheduling policies. These may be passed to ::cuFuncSetAttribute or ::cuKernelSetAttribute pub use self::CUclusterSchedulingPolicy_enum as CUclusterSchedulingPolicy; impl CUlaunchMemSyncDomain_enum { ///< Launch kernels in the default domain pub const CU_LAUNCH_MEM_SYNC_DOMAIN_DEFAULT: CUlaunchMemSyncDomain_enum = CUlaunchMemSyncDomain_enum( 0, ); } impl CUlaunchMemSyncDomain_enum { ///< Launch kernels in the remote domain pub const CU_LAUNCH_MEM_SYNC_DOMAIN_REMOTE: CUlaunchMemSyncDomain_enum = CUlaunchMemSyncDomain_enum( 1, ); } #[repr(transparent)] /** Memory Synchronization Domain A kernel can be launched in a specified memory synchronization domain that affects all memory operations issued by that kernel. A memory barrier issued in one domain will only order memory operations in that domain, thus eliminating latency increase from memory barriers ordering unrelated traffic. By default, kernels are launched in domain 0. Kernel launched with ::CU_LAUNCH_MEM_SYNC_DOMAIN_REMOTE will have a different domain ID. User may also alter the domain ID with ::CUlaunchMemSyncDomainMap for a specific stream / graph node / kernel launch. See ::CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN, ::cuStreamSetAttribute, ::cuLaunchKernelEx, ::cuGraphKernelNodeSetAttribute. Memory operations done in kernels launched in different domains are considered system-scope distanced. In other words, a GPU scoped memory synchronization is not sufficient for memory order to be observed by kernels in another memory synchronization domain even if they are on the same GPU.*/ #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUlaunchMemSyncDomain_enum(pub ::core::ffi::c_uint); /** Memory Synchronization Domain A kernel can be launched in a specified memory synchronization domain that affects all memory operations issued by that kernel. A memory barrier issued in one domain will only order memory operations in that domain, thus eliminating latency increase from memory barriers ordering unrelated traffic. By default, kernels are launched in domain 0. Kernel launched with ::CU_LAUNCH_MEM_SYNC_DOMAIN_REMOTE will have a different domain ID. User may also alter the domain ID with ::CUlaunchMemSyncDomainMap for a specific stream / graph node / kernel launch. See ::CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN, ::cuStreamSetAttribute, ::cuLaunchKernelEx, ::cuGraphKernelNodeSetAttribute. Memory operations done in kernels launched in different domains are considered system-scope distanced. In other words, a GPU scoped memory synchronization is not sufficient for memory order to be observed by kernels in another memory synchronization domain even if they are on the same GPU.*/ pub use self::CUlaunchMemSyncDomain_enum as CUlaunchMemSyncDomain; /** Memory Synchronization Domain map See ::cudaLaunchMemSyncDomain. By default, kernels are launched in domain 0. Kernel launched with ::CU_LAUNCH_MEM_SYNC_DOMAIN_REMOTE will have a different domain ID. User may also alter the domain ID with ::CUlaunchMemSyncDomainMap for a specific stream / graph node / kernel launch. See ::CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP. Domain ID range is available through ::CU_DEVICE_ATTRIBUTE_MEM_SYNC_DOMAIN_COUNT.*/ #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUlaunchMemSyncDomainMap_st { ///< The default domain ID to use for designated kernels pub default_: ::core::ffi::c_uchar, ///< The remote domain ID to use for designated kernels pub remote: ::core::ffi::c_uchar, } /** Memory Synchronization Domain map See ::cudaLaunchMemSyncDomain. By default, kernels are launched in domain 0. Kernel launched with ::CU_LAUNCH_MEM_SYNC_DOMAIN_REMOTE will have a different domain ID. User may also alter the domain ID with ::CUlaunchMemSyncDomainMap for a specific stream / graph node / kernel launch. See ::CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP. Domain ID range is available through ::CU_DEVICE_ATTRIBUTE_MEM_SYNC_DOMAIN_COUNT.*/ pub type CUlaunchMemSyncDomainMap = CUlaunchMemSyncDomainMap_st; impl CUlaunchAttributeID_enum { ///< Ignored entry, for convenient composition pub const CU_LAUNCH_ATTRIBUTE_IGNORE: CUlaunchAttributeID_enum = CUlaunchAttributeID_enum( 0, ); } impl CUlaunchAttributeID_enum { /**< Valid for streams, graph nodes, launches. See ::CUlaunchAttributeValue::accessPolicyWindow.*/ pub const CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW: CUlaunchAttributeID_enum = CUlaunchAttributeID_enum( 1, ); } impl CUlaunchAttributeID_enum { /**< Valid for graph nodes, launches. See ::CUlaunchAttributeValue::cooperative.*/ pub const CU_LAUNCH_ATTRIBUTE_COOPERATIVE: CUlaunchAttributeID_enum = CUlaunchAttributeID_enum( 2, ); } impl CUlaunchAttributeID_enum { /**< Valid for streams. See ::CUlaunchAttributeValue::syncPolicy.*/ pub const CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY: CUlaunchAttributeID_enum = CUlaunchAttributeID_enum( 3, ); } impl CUlaunchAttributeID_enum { ///< Valid for graph nodes, launches. See ::CUlaunchAttributeValue::clusterDim. pub const CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION: CUlaunchAttributeID_enum = CUlaunchAttributeID_enum( 4, ); } impl CUlaunchAttributeID_enum { ///< Valid for graph nodes, launches. See ::CUlaunchAttributeValue::clusterSchedulingPolicyPreference. pub const CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE: CUlaunchAttributeID_enum = CUlaunchAttributeID_enum( 5, ); } impl CUlaunchAttributeID_enum { /**< Valid for launches. Setting ::CUlaunchAttributeValue::programmaticStreamSerializationAllowed to non-0 signals that the kernel will use programmatic means to resolve its stream dependency, so that the CUDA runtime should opportunistically allow the grid's execution to overlap with the previous kernel in the stream, if that kernel requests the overlap. The dependent launches can choose to wait on the dependency using the programmatic sync (cudaGridDependencySynchronize() or equivalent PTX instructions).*/ pub const CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION: CUlaunchAttributeID_enum = CUlaunchAttributeID_enum( 6, ); } impl CUlaunchAttributeID_enum { /**< Valid for launches. Set ::CUlaunchAttributeValue::programmaticEvent to record the event. Event recorded through this launch attribute is guaranteed to only trigger after all block in the associated kernel trigger the event. A block can trigger the event through PTX launchdep.release or CUDA builtin function cudaTriggerProgrammaticLaunchCompletion(). A trigger can also be inserted at the beginning of each block's execution if triggerAtBlockStart is set to non-0. The dependent launches can choose to wait on the dependency using the programmatic sync (cudaGridDependencySynchronize() or equivalent PTX instructions). Note that dependents (including the CPU thread calling cuEventSynchronize()) are not guaranteed to observe the release precisely when it is released. For example, cuEventSynchronize() may only observe the event trigger long after the associated kernel has completed. This recording type is primarily meant for establishing programmatic dependency between device tasks. Note also this type of dependency allows, but does not guarantee, concurrent execution of tasks.
The event supplied must not be an interprocess or interop event. The event must disable timing (i.e. must be created with the ::CU_EVENT_DISABLE_TIMING flag set).*/ pub const CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT: CUlaunchAttributeID_enum = CUlaunchAttributeID_enum( 7, ); } impl CUlaunchAttributeID_enum { /**< Valid for streams, graph nodes, launches. See ::CUlaunchAttributeValue::priority.*/ pub const CU_LAUNCH_ATTRIBUTE_PRIORITY: CUlaunchAttributeID_enum = CUlaunchAttributeID_enum( 8, ); } impl CUlaunchAttributeID_enum { /**< Valid for streams, graph nodes, launches. See ::CUlaunchAttributeValue::memSyncDomainMap.*/ pub const CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP: CUlaunchAttributeID_enum = CUlaunchAttributeID_enum( 9, ); } impl CUlaunchAttributeID_enum { /**< Valid for streams, graph nodes, launches. See ::CUlaunchAttributeValue::memSyncDomain.*/ pub const CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN: CUlaunchAttributeID_enum = CUlaunchAttributeID_enum( 10, ); } impl CUlaunchAttributeID_enum { /**< Valid for graph nodes, launches. Set ::CUlaunchAttributeValue::preferredClusterDim to allow the kernel launch to specify a preferred substitute cluster dimension. Blocks may be grouped according to either the dimensions specified with this attribute (grouped into a "preferred substitute cluster"), or the one specified with ::CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION attribute (grouped into a "regular cluster"). The cluster dimensions of a "preferred substitute cluster" shall be an integer multiple greater than zero of the regular cluster dimensions. The device will attempt - on a best-effort basis - to group thread blocks into preferred clusters over grouping them into regular clusters. When it deems necessary (primarily when the device temporarily runs out of physical resources to launch the larger preferred clusters), the device may switch to launch the regular clusters instead to attempt to utilize as much of the physical device resources as possible.
Each type of cluster will have its enumeration / coordinate setup as if the grid consists solely of its type of cluster. For example, if the preferred substitute cluster dimensions double the regular cluster dimensions, there might be simultaneously a regular cluster indexed at (1,0,0), and a preferred cluster indexed at (1,0,0). In this example, the preferred substitute cluster (1,0,0) replaces regular clusters (2,0,0) and (3,0,0) and groups their blocks.
This attribute will only take effect when a regular cluster dimension has been specified. The preferred substitute cluster dimension must be an integer multiple greater than zero of the regular cluster dimension and must divide the grid. It must also be no more than `maxBlocksPerCluster`, if it is set in the kernel's `__launch_bounds__`. Otherwise it must be less than the maximum value the driver can support. Otherwise, setting this attribute to a value physically unable to fit on any particular device is permitted.*/ pub const CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION: CUlaunchAttributeID_enum = CUlaunchAttributeID_enum( 11, ); } impl CUlaunchAttributeID_enum { /**< Valid for launches. Set ::CUlaunchAttributeValue::launchCompletionEvent to record the event.
Nominally, the event is triggered once all blocks of the kernel have begun execution. Currently this is a best effort. If a kernel B has a launch completion dependency on a kernel A, B may wait until A is complete. Alternatively, blocks of B may begin before all blocks of A have begun, for example if B can claim execution resources unavailable to A (e.g. they run on different GPUs) or if B is a higher priority than A. Exercise caution if such an ordering inversion could lead to deadlock.
A launch completion event is nominally similar to a programmatic event with \c triggerAtBlockStart set except that it is not visible to \c cudaGridDependencySynchronize() and can be used with compute capability less than 9.0.
The event supplied must not be an interprocess or interop event. The event must disable timing (i.e. must be created with the ::CU_EVENT_DISABLE_TIMING flag set).*/ pub const CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT: CUlaunchAttributeID_enum = CUlaunchAttributeID_enum( 12, ); } impl CUlaunchAttributeID_enum { /**< Valid for graph nodes, launches. This attribute is graphs-only, and passing it to a launch in a non-capturing stream will result in an error.
::CUlaunchAttributeValue::deviceUpdatableKernelNode::deviceUpdatable can only be set to 0 or 1. Setting the field to 1 indicates that the corresponding kernel node should be device-updatable. On success, a handle will be returned via ::CUlaunchAttributeValue::deviceUpdatableKernelNode::devNode which can be passed to the various device-side update functions to update the node's kernel parameters from within another kernel. For more information on the types of device updates that can be made, as well as the relevant limitations thereof, see ::cudaGraphKernelNodeUpdatesApply.
Nodes which are device-updatable have additional restrictions compared to regular kernel nodes. Firstly, device-updatable nodes cannot be removed from their graph via ::cuGraphDestroyNode. Additionally, once opted-in to this functionality, a node cannot opt out, and any attempt to set the deviceUpdatable attribute to 0 will result in an error. Device-updatable kernel nodes also cannot have their attributes copied to/from another kernel node via ::cuGraphKernelNodeCopyAttributes. Graphs containing one or more device-updatable nodes also do not allow multiple instantiation, and neither the graph nor its instantiated version can be passed to ::cuGraphExecUpdate.
If a graph contains device-updatable nodes and updates those nodes from the device from within the graph, the graph must be uploaded with ::cuGraphUpload before it is launched. For such a graph, if host-side executable graph updates are made to the device-updatable nodes, the graph must be uploaded before it is launched again.*/ pub const CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE: CUlaunchAttributeID_enum = CUlaunchAttributeID_enum( 13, ); } impl CUlaunchAttributeID_enum { /**< Valid for launches. On devices where the L1 cache and shared memory use the same hardware resources, setting ::CUlaunchAttributeValue::sharedMemCarveout to a percentage between 0-100 signals the CUDA driver to set the shared memory carveout preference, in percent of the total shared memory for that kernel launch. This attribute takes precedence over ::CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT. This is only a hint, and the CUDA driver can choose a different configuration if required for the launch.*/ pub const CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT: CUlaunchAttributeID_enum = CUlaunchAttributeID_enum( 14, ); } impl CUlaunchAttributeID_enum { /**< Valid for streams, graph nodes, launches. This attribute is a hint to the CUDA runtime that the launch should attempt to make the kernel maximize its NVLINK utilization.
When possible to honor this hint, CUDA will assume each block in the grid launch will carry out an even amount of NVLINK traffic, and make a best-effort attempt to adjust the kernel launch based on that assumption.
This attribute is a hint only. CUDA makes no functional or performance guarantee. Its applicability can be affected by many different factors, including driver version (i.e. CUDA doesn't guarantee the performance characteristics will be maintained between driver versions or a driver update could alter or regress previously observed perf characteristics.) It also doesn't guarantee a successful result, i.e. applying the attribute may not improve the performance of either the targeted kernel or the encapsulating application.
Valid values for ::CUlaunchAttributeValue::nvlinkUtilCentricScheduling are 0 (disabled) and 1 (enabled).*/ pub const CU_LAUNCH_ATTRIBUTE_NVLINK_UTIL_CENTRIC_SCHEDULING: CUlaunchAttributeID_enum = CUlaunchAttributeID_enum( 16, ); } impl CUlaunchAttributeID_enum { pub const CU_LAUNCH_ATTRIBUTE_MAX: CUlaunchAttributeID_enum = CUlaunchAttributeID_enum( 17, ); } #[repr(transparent)] /// Launch attributes enum; used as id field of ::CUlaunchAttribute #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUlaunchAttributeID_enum(pub ::core::ffi::c_uint); /// Launch attributes enum; used as id field of ::CUlaunchAttribute pub use self::CUlaunchAttributeID_enum as CUlaunchAttributeID; /// Launch attributes union; used as value field of ::CUlaunchAttribute #[repr(C)] #[derive(Copy, Clone)] pub union CUlaunchAttributeValue_union { pub pad: [::core::ffi::c_char; 64usize], ///< Value of launch attribute ::CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW. pub accessPolicyWindow: CUaccessPolicyWindow, /**< Value of launch attribute ::CU_LAUNCH_ATTRIBUTE_COOPERATIVE. Nonzero indicates a cooperative kernel (see ::cuLaunchCooperativeKernel).*/ pub cooperative: ::core::ffi::c_int, /**< Value of launch attribute ::CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY. ::CUsynchronizationPolicy for work queued up in this stream*/ pub syncPolicy: CUsynchronizationPolicy, pub clusterDim: CUlaunchAttributeValue_union__bindgen_ty_1, /**< Value of launch attribute ::CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE. Cluster scheduling policy preference for the kernel.*/ pub clusterSchedulingPolicyPreference: CUclusterSchedulingPolicy, /**< Value of launch attribute ::CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION.*/ pub programmaticStreamSerializationAllowed: ::core::ffi::c_int, pub programmaticEvent: CUlaunchAttributeValue_union__bindgen_ty_2, pub launchCompletionEvent: CUlaunchAttributeValue_union__bindgen_ty_3, ///< Value of launch attribute ::CU_LAUNCH_ATTRIBUTE_PRIORITY. Execution priority of the kernel. pub priority: ::core::ffi::c_int, /**< Value of launch attribute ::CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP. See ::CUlaunchMemSyncDomainMap.*/ pub memSyncDomainMap: CUlaunchMemSyncDomainMap, /**< Value of launch attribute ::CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN. See::CUlaunchMemSyncDomain*/ pub memSyncDomain: CUlaunchMemSyncDomain, pub preferredClusterDim: CUlaunchAttributeValue_union__bindgen_ty_4, pub deviceUpdatableKernelNode: CUlaunchAttributeValue_union__bindgen_ty_5, ///< Value of launch attribute ::CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT. pub sharedMemCarveout: ::core::ffi::c_uint, pub nvlinkUtilCentricScheduling: ::core::ffi::c_uint, } /** Value of launch attribute ::CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION that represents the desired cluster dimensions for the kernel. Opaque type with the following fields: - \p x - The X dimension of the cluster, in blocks. Must be a divisor of the grid X dimension. - \p y - The Y dimension of the cluster, in blocks. Must be a divisor of the grid Y dimension. - \p z - The Z dimension of the cluster, in blocks. Must be a divisor of the grid Z dimension.*/ #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUlaunchAttributeValue_union__bindgen_ty_1 { pub x: ::core::ffi::c_uint, pub y: ::core::ffi::c_uint, pub z: ::core::ffi::c_uint, } /** Value of launch attribute ::CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT with the following fields: - \p CUevent event - Event to fire when all blocks trigger it. - \p Event record flags, see ::cuEventRecordWithFlags. Does not accept :CU_EVENT_RECORD_EXTERNAL. - \p triggerAtBlockStart - If this is set to non-0, each block launch will automatically trigger the event.*/ #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUlaunchAttributeValue_union__bindgen_ty_2 { pub event: CUevent, pub flags: ::core::ffi::c_int, pub triggerAtBlockStart: ::core::ffi::c_int, } /** Value of launch attribute ::CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT with the following fields: - \p CUevent event - Event to fire when the last block launches - \p int flags; - Event record flags, see ::cuEventRecordWithFlags. Does not accept ::CU_EVENT_RECORD_EXTERNAL.*/ #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUlaunchAttributeValue_union__bindgen_ty_3 { pub event: CUevent, pub flags: ::core::ffi::c_int, } /** Value of launch attribute ::CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION that represents the desired preferred cluster dimensions for the kernel. Opaque type with the following fields: - \p x - The X dimension of the preferred cluster, in blocks. Must be a divisor of the grid X dimension, and must be a multiple of the \p x field of ::CUlaunchAttributeValue::clusterDim. - \p y - The Y dimension of the preferred cluster, in blocks. Must be a divisor of the grid Y dimension, and must be a multiple of the \p y field of ::CUlaunchAttributeValue::clusterDim. - \p z - The Z dimension of the preferred cluster, in blocks. Must be equal to the \p z field of ::CUlaunchAttributeValue::clusterDim.*/ #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUlaunchAttributeValue_union__bindgen_ty_4 { pub x: ::core::ffi::c_uint, pub y: ::core::ffi::c_uint, pub z: ::core::ffi::c_uint, } /** Value of launch attribute ::CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE. with the following fields: - \p int deviceUpdatable - Whether or not the resulting kernel node should be device-updatable. - \p CUgraphDeviceNode devNode - Returns a handle to pass to the various device-side update functions.*/ #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUlaunchAttributeValue_union__bindgen_ty_5 { pub deviceUpdatable: ::core::ffi::c_int, pub devNode: CUgraphDeviceNode, } /// Launch attributes union; used as value field of ::CUlaunchAttribute pub type CUlaunchAttributeValue = CUlaunchAttributeValue_union; /// Launch attribute #[repr(C)] #[derive(Copy, Clone)] pub struct CUlaunchAttribute_st { ///< Attribute to set pub id: CUlaunchAttributeID, pub pad: [::core::ffi::c_char; 4usize], ///< Value of the attribute pub value: CUlaunchAttributeValue, } /// Launch attribute pub type CUlaunchAttribute = CUlaunchAttribute_st; /// CUDA extensible launch configuration #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUlaunchConfig_st { ///< Width of grid in blocks pub gridDimX: ::core::ffi::c_uint, ///< Height of grid in blocks pub gridDimY: ::core::ffi::c_uint, ///< Depth of grid in blocks pub gridDimZ: ::core::ffi::c_uint, ///< X dimension of each thread block pub blockDimX: ::core::ffi::c_uint, ///< Y dimension of each thread block pub blockDimY: ::core::ffi::c_uint, ///< Z dimension of each thread block pub blockDimZ: ::core::ffi::c_uint, ///< Dynamic shared-memory size per thread block in bytes pub sharedMemBytes: ::core::ffi::c_uint, ///< Stream identifier pub hStream: CUstream, ///< List of attributes; nullable if ::CUlaunchConfig::numAttrs == 0 pub attrs: *mut CUlaunchAttribute, ///< Number of attributes populated in ::CUlaunchConfig::attrs pub numAttrs: ::core::ffi::c_uint, } /// CUDA extensible launch configuration pub type CUlaunchConfig = CUlaunchConfig_st; /// Launch attributes enum; used as id field of ::CUlaunchAttribute pub use self::CUlaunchAttributeID as CUkernelNodeAttrID; /// Launch attributes union; used as value field of ::CUlaunchAttribute pub type CUkernelNodeAttrValue_v1 = CUlaunchAttributeValue; /// Launch attributes union; used as value field of ::CUlaunchAttribute pub type CUkernelNodeAttrValue = CUkernelNodeAttrValue_v1; impl CUstreamCaptureStatus_enum { ///< Stream is not capturing pub const CU_STREAM_CAPTURE_STATUS_NONE: CUstreamCaptureStatus_enum = CUstreamCaptureStatus_enum( 0, ); } impl CUstreamCaptureStatus_enum { ///< Stream is actively capturing pub const CU_STREAM_CAPTURE_STATUS_ACTIVE: CUstreamCaptureStatus_enum = CUstreamCaptureStatus_enum( 1, ); } impl CUstreamCaptureStatus_enum { /**< Stream is part of a capture sequence that has been invalidated, but not terminated*/ pub const CU_STREAM_CAPTURE_STATUS_INVALIDATED: CUstreamCaptureStatus_enum = CUstreamCaptureStatus_enum( 2, ); } #[repr(transparent)] /// Possible stream capture statuses returned by ::cuStreamIsCapturing #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUstreamCaptureStatus_enum(pub ::core::ffi::c_uint); /// Possible stream capture statuses returned by ::cuStreamIsCapturing pub use self::CUstreamCaptureStatus_enum as CUstreamCaptureStatus; impl CUstreamCaptureMode_enum { pub const CU_STREAM_CAPTURE_MODE_GLOBAL: CUstreamCaptureMode_enum = CUstreamCaptureMode_enum( 0, ); } impl CUstreamCaptureMode_enum { pub const CU_STREAM_CAPTURE_MODE_THREAD_LOCAL: CUstreamCaptureMode_enum = CUstreamCaptureMode_enum( 1, ); } impl CUstreamCaptureMode_enum { pub const CU_STREAM_CAPTURE_MODE_RELAXED: CUstreamCaptureMode_enum = CUstreamCaptureMode_enum( 2, ); } #[repr(transparent)] /** Possible modes for stream capture thread interactions. For more details see ::cuStreamBeginCapture and ::cuThreadExchangeStreamCaptureMode*/ #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUstreamCaptureMode_enum(pub ::core::ffi::c_uint); /// Launch attributes enum; used as id field of ::CUlaunchAttribute pub use self::CUlaunchAttributeID as CUstreamAttrID; /** Possible modes for stream capture thread interactions. For more details see ::cuStreamBeginCapture and ::cuThreadExchangeStreamCaptureMode*/ pub use self::CUstreamCaptureMode_enum as CUstreamCaptureMode; /// Launch attributes union; used as value field of ::CUlaunchAttribute pub type CUstreamAttrValue_v1 = CUlaunchAttributeValue; /// Launch attributes union; used as value field of ::CUlaunchAttribute pub type CUstreamAttrValue = CUstreamAttrValue_v1; impl CUdriverProcAddress_flags_enum { ///< Default search mode for driver symbols. pub const CU_GET_PROC_ADDRESS_DEFAULT: CUdriverProcAddress_flags_enum = CUdriverProcAddress_flags_enum( 0, ); } impl CUdriverProcAddress_flags_enum { ///< Search for legacy versions of driver symbols. pub const CU_GET_PROC_ADDRESS_LEGACY_STREAM: CUdriverProcAddress_flags_enum = CUdriverProcAddress_flags_enum( 1, ); } impl CUdriverProcAddress_flags_enum { ///< Search for per-thread versions of driver symbols. pub const CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM: CUdriverProcAddress_flags_enum = CUdriverProcAddress_flags_enum( 2, ); } #[repr(transparent)] /// Flags to specify search options. For more details see ::cuGetProcAddress #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUdriverProcAddress_flags_enum(pub ::core::ffi::c_uint); /// Flags to specify search options. For more details see ::cuGetProcAddress pub use self::CUdriverProcAddress_flags_enum as CUdriverProcAddress_flags; impl CUdriverProcAddressQueryResult_enum { ///< Symbol was succesfully found pub const CU_GET_PROC_ADDRESS_SUCCESS: CUdriverProcAddressQueryResult_enum = CUdriverProcAddressQueryResult_enum( 0, ); } impl CUdriverProcAddressQueryResult_enum { ///< Symbol was not found in search pub const CU_GET_PROC_ADDRESS_SYMBOL_NOT_FOUND: CUdriverProcAddressQueryResult_enum = CUdriverProcAddressQueryResult_enum( 1, ); } impl CUdriverProcAddressQueryResult_enum { ///< Symbol was found but version supplied was not sufficient pub const CU_GET_PROC_ADDRESS_VERSION_NOT_SUFFICIENT: CUdriverProcAddressQueryResult_enum = CUdriverProcAddressQueryResult_enum( 2, ); } #[repr(transparent)] /// Flags to indicate search status. For more details see ::cuGetProcAddress #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUdriverProcAddressQueryResult_enum(pub ::core::ffi::c_uint); /// Flags to indicate search status. For more details see ::cuGetProcAddress pub use self::CUdriverProcAddressQueryResult_enum as CUdriverProcAddressQueryResult; impl CUexecAffinityType_enum { ///< Create a context with limited SMs. pub const CU_EXEC_AFFINITY_TYPE_SM_COUNT: CUexecAffinityType_enum = CUexecAffinityType_enum( 0, ); } impl CUexecAffinityType_enum { pub const CU_EXEC_AFFINITY_TYPE_MAX: CUexecAffinityType_enum = CUexecAffinityType_enum( 1, ); } #[repr(transparent)] /// Execution Affinity Types #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUexecAffinityType_enum(pub ::core::ffi::c_uint); /// Execution Affinity Types pub use self::CUexecAffinityType_enum as CUexecAffinityType; /// Value for ::CU_EXEC_AFFINITY_TYPE_SM_COUNT #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUexecAffinitySmCount_st { ///< The number of SMs the context is limited to use. pub val: ::core::ffi::c_uint, } /// Value for ::CU_EXEC_AFFINITY_TYPE_SM_COUNT pub type CUexecAffinitySmCount_v1 = CUexecAffinitySmCount_st; /// Value for ::CU_EXEC_AFFINITY_TYPE_SM_COUNT pub type CUexecAffinitySmCount = CUexecAffinitySmCount_v1; /// Execution Affinity Parameters #[repr(C)] #[derive(Copy, Clone)] pub struct CUexecAffinityParam_st { pub type_: CUexecAffinityType, pub param: CUexecAffinityParam_st__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] pub union CUexecAffinityParam_st__bindgen_ty_1 { pub smCount: CUexecAffinitySmCount, } /// Execution Affinity Parameters pub type CUexecAffinityParam_v1 = CUexecAffinityParam_st; /// Execution Affinity Parameters pub type CUexecAffinityParam = CUexecAffinityParam_v1; impl CUcigDataType_enum { pub const CIG_DATA_TYPE_D3D12_COMMAND_QUEUE: CUcigDataType_enum = CUcigDataType_enum( 1, ); } impl CUcigDataType_enum { /// D3D12 Command Queue Handle pub const CIG_DATA_TYPE_NV_BLOB: CUcigDataType_enum = CUcigDataType_enum(2); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUcigDataType_enum(pub ::core::ffi::c_uint); pub use self::CUcigDataType_enum as CUcigDataType; /// CIG Context Create Params #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUctxCigParam_st { pub sharedDataType: CUcigDataType, pub sharedData: *mut ::core::ffi::c_void, } /// CIG Context Create Params pub type CUctxCigParam = CUctxCigParam_st; /** Params for creating CUDA context Exactly one of execAffinityParams and cigParams must be non-NULL.*/ #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUctxCreateParams_st { pub execAffinityParams: *mut CUexecAffinityParam, pub numExecAffinityParams: ::core::ffi::c_int, pub cigParams: *mut CUctxCigParam, } /** Params for creating CUDA context Exactly one of execAffinityParams and cigParams must be non-NULL.*/ pub type CUctxCreateParams = CUctxCreateParams_st; impl CUlibraryOption_enum { pub const CU_LIBRARY_HOST_UNIVERSAL_FUNCTION_AND_DATA_TABLE: CUlibraryOption_enum = CUlibraryOption_enum( 0, ); } impl CUlibraryOption_enum { /** Specifes that the argument \p code passed to ::cuLibraryLoadData() will be preserved. Specifying this option will let the driver know that \p code can be accessed at any point until ::cuLibraryUnload(). The default behavior is for the driver to allocate and maintain its own copy of \p code. Note that this is only a memory usage optimization hint and the driver can choose to ignore it if required. Specifying this option with ::cuLibraryLoadFromFile() is invalid and will return ::CUDA_ERROR_INVALID_VALUE.*/ pub const CU_LIBRARY_BINARY_IS_PRESERVED: CUlibraryOption_enum = CUlibraryOption_enum( 1, ); } impl CUlibraryOption_enum { /** Specifes that the argument \p code passed to ::cuLibraryLoadData() will be preserved. Specifying this option will let the driver know that \p code can be accessed at any point until ::cuLibraryUnload(). The default behavior is for the driver to allocate and maintain its own copy of \p code. Note that this is only a memory usage optimization hint and the driver can choose to ignore it if required. Specifying this option with ::cuLibraryLoadFromFile() is invalid and will return ::CUDA_ERROR_INVALID_VALUE.*/ pub const CU_LIBRARY_NUM_OPTIONS: CUlibraryOption_enum = CUlibraryOption_enum(2); } #[repr(transparent)] /// Library options to be specified with ::cuLibraryLoadData() or ::cuLibraryLoadFromFile() #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUlibraryOption_enum(pub ::core::ffi::c_uint); /// Library options to be specified with ::cuLibraryLoadData() or ::cuLibraryLoadFromFile() pub use self::CUlibraryOption_enum as CUlibraryOption; #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUlibraryHostUniversalFunctionAndDataTable_st { pub functionTable: *mut ::core::ffi::c_void, pub functionWindowSize: usize, pub dataTable: *mut ::core::ffi::c_void, pub dataWindowSize: usize, } pub type CUlibraryHostUniversalFunctionAndDataTable = CUlibraryHostUniversalFunctionAndDataTable_st; impl CUdevice_P2PAttribute_enum { ///< A relative value indicating the performance of the link between two devices pub const CU_DEVICE_P2P_ATTRIBUTE_PERFORMANCE_RANK: CUdevice_P2PAttribute_enum = CUdevice_P2PAttribute_enum( 1, ); } impl CUdevice_P2PAttribute_enum { ///< P2P Access is enable pub const CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED: CUdevice_P2PAttribute_enum = CUdevice_P2PAttribute_enum( 2, ); } impl CUdevice_P2PAttribute_enum { ///< All CUDA-valid atomic operation over the link are supported pub const CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED: CUdevice_P2PAttribute_enum = CUdevice_P2PAttribute_enum( 3, ); } impl CUdevice_P2PAttribute_enum { ///< \deprecated use CU_DEVICE_P2P_ATTRIBUTE_CUDA_ARRAY_ACCESS_SUPPORTED instead pub const CU_DEVICE_P2P_ATTRIBUTE_ACCESS_ACCESS_SUPPORTED: CUdevice_P2PAttribute_enum = CUdevice_P2PAttribute_enum( 4, ); } impl CUdevice_P2PAttribute_enum { ///< Accessing CUDA arrays over the link supported pub const CU_DEVICE_P2P_ATTRIBUTE_CUDA_ARRAY_ACCESS_SUPPORTED: CUdevice_P2PAttribute_enum = CUdevice_P2PAttribute_enum( 4, ); } impl CUdevice_P2PAttribute_enum { ///< Only some CUDA-valid atomic operations over the link are supported. pub const CU_DEVICE_P2P_ATTRIBUTE_ONLY_PARTIAL_NATIVE_ATOMIC_SUPPORTED: CUdevice_P2PAttribute_enum = CUdevice_P2PAttribute_enum( 5, ); } #[repr(transparent)] /// P2P Attributes #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUdevice_P2PAttribute_enum(pub ::core::ffi::c_uint); /// P2P Attributes pub use self::CUdevice_P2PAttribute_enum as CUdevice_P2PAttribute; impl CUatomicOperation_enum { pub const CU_ATOMIC_OPERATION_INTEGER_ADD: CUatomicOperation_enum = CUatomicOperation_enum( 0, ); } impl CUatomicOperation_enum { pub const CU_ATOMIC_OPERATION_INTEGER_MIN: CUatomicOperation_enum = CUatomicOperation_enum( 1, ); } impl CUatomicOperation_enum { pub const CU_ATOMIC_OPERATION_INTEGER_MAX: CUatomicOperation_enum = CUatomicOperation_enum( 2, ); } impl CUatomicOperation_enum { pub const CU_ATOMIC_OPERATION_INTEGER_INCREMENT: CUatomicOperation_enum = CUatomicOperation_enum( 3, ); } impl CUatomicOperation_enum { pub const CU_ATOMIC_OPERATION_INTEGER_DECREMENT: CUatomicOperation_enum = CUatomicOperation_enum( 4, ); } impl CUatomicOperation_enum { pub const CU_ATOMIC_OPERATION_AND: CUatomicOperation_enum = CUatomicOperation_enum( 5, ); } impl CUatomicOperation_enum { pub const CU_ATOMIC_OPERATION_OR: CUatomicOperation_enum = CUatomicOperation_enum(6); } impl CUatomicOperation_enum { pub const CU_ATOMIC_OPERATION_XOR: CUatomicOperation_enum = CUatomicOperation_enum( 7, ); } impl CUatomicOperation_enum { pub const CU_ATOMIC_OPERATION_EXCHANGE: CUatomicOperation_enum = CUatomicOperation_enum( 8, ); } impl CUatomicOperation_enum { pub const CU_ATOMIC_OPERATION_CAS: CUatomicOperation_enum = CUatomicOperation_enum( 9, ); } impl CUatomicOperation_enum { pub const CU_ATOMIC_OPERATION_FLOAT_ADD: CUatomicOperation_enum = CUatomicOperation_enum( 10, ); } impl CUatomicOperation_enum { pub const CU_ATOMIC_OPERATION_FLOAT_MIN: CUatomicOperation_enum = CUatomicOperation_enum( 11, ); } impl CUatomicOperation_enum { pub const CU_ATOMIC_OPERATION_FLOAT_MAX: CUatomicOperation_enum = CUatomicOperation_enum( 12, ); } impl CUatomicOperation_enum { pub const CU_ATOMIC_OPERATION_MAX: CUatomicOperation_enum = CUatomicOperation_enum( 13, ); } #[repr(transparent)] /// CUDA-valid Atomic Operations #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUatomicOperation_enum(pub ::core::ffi::c_uint); /// CUDA-valid Atomic Operations pub use self::CUatomicOperation_enum as CUatomicOperation; impl CUatomicOperationCapability_enum { pub const CU_ATOMIC_CAPABILITY_SIGNED: CUatomicOperationCapability_enum = CUatomicOperationCapability_enum( 1, ); } impl CUatomicOperationCapability_enum { pub const CU_ATOMIC_CAPABILITY_UNSIGNED: CUatomicOperationCapability_enum = CUatomicOperationCapability_enum( 2, ); } impl CUatomicOperationCapability_enum { pub const CU_ATOMIC_CAPABILITY_REDUCTION: CUatomicOperationCapability_enum = CUatomicOperationCapability_enum( 4, ); } impl CUatomicOperationCapability_enum { pub const CU_ATOMIC_CAPABILITY_SCALAR_32: CUatomicOperationCapability_enum = CUatomicOperationCapability_enum( 8, ); } impl CUatomicOperationCapability_enum { pub const CU_ATOMIC_CAPABILITY_SCALAR_64: CUatomicOperationCapability_enum = CUatomicOperationCapability_enum( 16, ); } impl CUatomicOperationCapability_enum { pub const CU_ATOMIC_CAPABILITY_SCALAR_128: CUatomicOperationCapability_enum = CUatomicOperationCapability_enum( 32, ); } impl CUatomicOperationCapability_enum { pub const CU_ATOMIC_CAPABILITY_VECTOR_32x4: CUatomicOperationCapability_enum = CUatomicOperationCapability_enum( 64, ); } #[repr(transparent)] /// CUDA-valid Atomic Operation capabilities #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUatomicOperationCapability_enum(pub ::core::ffi::c_uint); /// CUDA-valid Atomic Operation capabilities pub use self::CUatomicOperationCapability_enum as CUatomicOperationCapability; /** CUDA stream callback \param hStream The stream the callback was added to, as passed to ::cuStreamAddCallback. May be NULL. \param status ::CUDA_SUCCESS or any persistent error on the stream. \param userData User parameter provided at registration.*/ pub type CUstreamCallback = ::core::option::Option< unsafe extern "system" fn( hStream: CUstream, status: CUresult, userData: *mut ::core::ffi::c_void, ), >; /** Block size to per-block dynamic shared memory mapping for a certain kernel \param blockSize Block size of the kernel. \return The dynamic shared memory needed by a block.*/ pub type CUoccupancyB2DSize = ::core::option::Option< unsafe extern "system" fn(blockSize: ::core::ffi::c_int) -> usize, >; /// 2D memory copy parameters #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_MEMCPY2D_st { ///< Source X in bytes pub srcXInBytes: usize, ///< Source Y pub srcY: usize, ///< Source memory type (host, device, array) pub srcMemoryType: CUmemorytype, ///< Source host pointer pub srcHost: *const ::core::ffi::c_void, ///< Source device pointer pub srcDevice: CUdeviceptr, ///< Source array reference pub srcArray: CUarray, ///< Source pitch (ignored when src is array) pub srcPitch: usize, ///< Destination X in bytes pub dstXInBytes: usize, ///< Destination Y pub dstY: usize, ///< Destination memory type (host, device, array) pub dstMemoryType: CUmemorytype, ///< Destination host pointer pub dstHost: *mut ::core::ffi::c_void, ///< Destination device pointer pub dstDevice: CUdeviceptr, ///< Destination array reference pub dstArray: CUarray, ///< Destination pitch (ignored when dst is array) pub dstPitch: usize, ///< Width of 2D memory copy in bytes pub WidthInBytes: usize, ///< Height of 2D memory copy pub Height: usize, } /// 2D memory copy parameters pub type CUDA_MEMCPY2D_v2 = CUDA_MEMCPY2D_st; /// 2D memory copy parameters pub type CUDA_MEMCPY2D = CUDA_MEMCPY2D_v2; /// 3D memory copy parameters #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_MEMCPY3D_st { ///< Source X in bytes pub srcXInBytes: usize, ///< Source Y pub srcY: usize, ///< Source Z pub srcZ: usize, ///< Source LOD pub srcLOD: usize, ///< Source memory type (host, device, array) pub srcMemoryType: CUmemorytype, ///< Source host pointer pub srcHost: *const ::core::ffi::c_void, ///< Source device pointer pub srcDevice: CUdeviceptr, ///< Source array reference pub srcArray: CUarray, ///< Must be NULL pub reserved0: *mut ::core::ffi::c_void, ///< Source pitch (ignored when src is array) pub srcPitch: usize, ///< Source height (ignored when src is array; may be 0 if Depth==1) pub srcHeight: usize, ///< Destination X in bytes pub dstXInBytes: usize, ///< Destination Y pub dstY: usize, ///< Destination Z pub dstZ: usize, ///< Destination LOD pub dstLOD: usize, ///< Destination memory type (host, device, array) pub dstMemoryType: CUmemorytype, ///< Destination host pointer pub dstHost: *mut ::core::ffi::c_void, ///< Destination device pointer pub dstDevice: CUdeviceptr, ///< Destination array reference pub dstArray: CUarray, ///< Must be NULL pub reserved1: *mut ::core::ffi::c_void, ///< Destination pitch (ignored when dst is array) pub dstPitch: usize, ///< Destination height (ignored when dst is array; may be 0 if Depth==1) pub dstHeight: usize, ///< Width of 3D memory copy in bytes pub WidthInBytes: usize, ///< Height of 3D memory copy pub Height: usize, ///< Depth of 3D memory copy pub Depth: usize, } /// 3D memory copy parameters pub type CUDA_MEMCPY3D_v2 = CUDA_MEMCPY3D_st; /// 3D memory copy parameters pub type CUDA_MEMCPY3D = CUDA_MEMCPY3D_v2; /// 3D memory cross-context copy parameters #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_MEMCPY3D_PEER_st { ///< Source X in bytes pub srcXInBytes: usize, ///< Source Y pub srcY: usize, ///< Source Z pub srcZ: usize, ///< Source LOD pub srcLOD: usize, ///< Source memory type (host, device, array) pub srcMemoryType: CUmemorytype, ///< Source host pointer pub srcHost: *const ::core::ffi::c_void, ///< Source device pointer pub srcDevice: CUdeviceptr, ///< Source array reference pub srcArray: CUarray, ///< Source context (ignored with srcMemoryType is ::CU_MEMORYTYPE_ARRAY) pub srcContext: CUcontext, ///< Source pitch (ignored when src is array) pub srcPitch: usize, ///< Source height (ignored when src is array; may be 0 if Depth==1) pub srcHeight: usize, ///< Destination X in bytes pub dstXInBytes: usize, ///< Destination Y pub dstY: usize, ///< Destination Z pub dstZ: usize, ///< Destination LOD pub dstLOD: usize, ///< Destination memory type (host, device, array) pub dstMemoryType: CUmemorytype, ///< Destination host pointer pub dstHost: *mut ::core::ffi::c_void, ///< Destination device pointer pub dstDevice: CUdeviceptr, ///< Destination array reference pub dstArray: CUarray, ///< Destination context (ignored with dstMemoryType is ::CU_MEMORYTYPE_ARRAY) pub dstContext: CUcontext, ///< Destination pitch (ignored when dst is array) pub dstPitch: usize, ///< Destination height (ignored when dst is array; may be 0 if Depth==1) pub dstHeight: usize, ///< Width of 3D memory copy in bytes pub WidthInBytes: usize, ///< Height of 3D memory copy pub Height: usize, ///< Depth of 3D memory copy pub Depth: usize, } /// 3D memory cross-context copy parameters pub type CUDA_MEMCPY3D_PEER_v1 = CUDA_MEMCPY3D_PEER_st; /// 3D memory cross-context copy parameters pub type CUDA_MEMCPY3D_PEER = CUDA_MEMCPY3D_PEER_v1; /// Memcpy node parameters #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_MEMCPY_NODE_PARAMS_st { ///< Must be zero pub flags: ::core::ffi::c_int, ///< Must be zero pub reserved: ::core::ffi::c_int, ///< Context on which to run the node pub copyCtx: CUcontext, ///< Parameters for the memory copy pub copyParams: CUDA_MEMCPY3D, } /// Memcpy node parameters pub type CUDA_MEMCPY_NODE_PARAMS = CUDA_MEMCPY_NODE_PARAMS_st; /// Array descriptor #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_ARRAY_DESCRIPTOR_st { ///< Width of array pub Width: usize, ///< Height of array pub Height: usize, ///< Array format pub Format: CUarray_format, ///< Channels per array element pub NumChannels: ::core::ffi::c_uint, } /// Array descriptor pub type CUDA_ARRAY_DESCRIPTOR_v2 = CUDA_ARRAY_DESCRIPTOR_st; /// Array descriptor pub type CUDA_ARRAY_DESCRIPTOR = CUDA_ARRAY_DESCRIPTOR_v2; /// 3D array descriptor #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_ARRAY3D_DESCRIPTOR_st { ///< Width of 3D array pub Width: usize, ///< Height of 3D array pub Height: usize, ///< Depth of 3D array pub Depth: usize, ///< Array format pub Format: CUarray_format, ///< Channels per array element pub NumChannels: ::core::ffi::c_uint, ///< Flags pub Flags: ::core::ffi::c_uint, } /// 3D array descriptor pub type CUDA_ARRAY3D_DESCRIPTOR_v2 = CUDA_ARRAY3D_DESCRIPTOR_st; /// 3D array descriptor pub type CUDA_ARRAY3D_DESCRIPTOR = CUDA_ARRAY3D_DESCRIPTOR_v2; /// CUDA array sparse properties #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_ARRAY_SPARSE_PROPERTIES_st { pub tileExtent: CUDA_ARRAY_SPARSE_PROPERTIES_st__bindgen_ty_1, /// First mip level at which the mip tail begins. pub miptailFirstLevel: ::core::ffi::c_uint, /// Total size of the mip tail. pub miptailSize: ::core::ffi::c_ulonglong, /// Flags will either be zero or ::CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL pub flags: ::core::ffi::c_uint, pub reserved: [::core::ffi::c_uint; 4usize], } #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_ARRAY_SPARSE_PROPERTIES_st__bindgen_ty_1 { ///< Width of sparse tile in elements pub width: ::core::ffi::c_uint, ///< Height of sparse tile in elements pub height: ::core::ffi::c_uint, ///< Depth of sparse tile in elements pub depth: ::core::ffi::c_uint, } /// CUDA array sparse properties pub type CUDA_ARRAY_SPARSE_PROPERTIES_v1 = CUDA_ARRAY_SPARSE_PROPERTIES_st; /// CUDA array sparse properties pub type CUDA_ARRAY_SPARSE_PROPERTIES = CUDA_ARRAY_SPARSE_PROPERTIES_v1; /// CUDA array memory requirements #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_ARRAY_MEMORY_REQUIREMENTS_st { ///< Total required memory size pub size: usize, ///< alignment requirement pub alignment: usize, pub reserved: [::core::ffi::c_uint; 4usize], } /// CUDA array memory requirements pub type CUDA_ARRAY_MEMORY_REQUIREMENTS_v1 = CUDA_ARRAY_MEMORY_REQUIREMENTS_st; /// CUDA array memory requirements pub type CUDA_ARRAY_MEMORY_REQUIREMENTS = CUDA_ARRAY_MEMORY_REQUIREMENTS_v1; /// CUDA Resource descriptor #[repr(C)] #[derive(Copy, Clone)] pub struct CUDA_RESOURCE_DESC_st { ///< Resource type pub resType: CUresourcetype, pub res: CUDA_RESOURCE_DESC_st__bindgen_ty_1, ///< Flags (must be zero) pub flags: ::core::ffi::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, } #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_1 { ///< CUDA array pub hArray: CUarray, } #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_2 { ///< CUDA mipmapped array pub hMipmappedArray: CUmipmappedArray, } #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_3 { ///< Device pointer pub devPtr: CUdeviceptr, ///< Array format pub format: CUarray_format, ///< Channels per array element pub numChannels: ::core::ffi::c_uint, ///< Size in bytes pub sizeInBytes: usize, } #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_4 { ///< Device pointer pub devPtr: CUdeviceptr, ///< Array format pub format: CUarray_format, ///< Channels per array element pub numChannels: ::core::ffi::c_uint, ///< Width of the array in elements pub width: usize, ///< Height of the array in elements pub height: usize, ///< Pitch between two rows in bytes pub pitchInBytes: usize, } #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_5 { pub reserved: [::core::ffi::c_int; 32usize], } /// CUDA Resource descriptor pub type CUDA_RESOURCE_DESC_v1 = CUDA_RESOURCE_DESC_st; /// CUDA Resource descriptor pub type CUDA_RESOURCE_DESC = CUDA_RESOURCE_DESC_v1; /// Texture descriptor #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct CUDA_TEXTURE_DESC_st { ///< Address modes pub addressMode: [CUaddress_mode; 3usize], ///< Filter mode pub filterMode: CUfilter_mode, ///< Flags pub flags: ::core::ffi::c_uint, ///< Maximum anisotropy ratio pub maxAnisotropy: ::core::ffi::c_uint, ///< Mipmap filter mode pub mipmapFilterMode: CUfilter_mode, ///< Mipmap level bias pub mipmapLevelBias: f32, ///< Mipmap minimum level clamp pub minMipmapLevelClamp: f32, ///< Mipmap maximum level clamp pub maxMipmapLevelClamp: f32, ///< Border Color pub borderColor: [f32; 4usize], pub reserved: [::core::ffi::c_int; 12usize], } /// Texture descriptor pub type CUDA_TEXTURE_DESC_v1 = CUDA_TEXTURE_DESC_st; /// Texture descriptor pub type CUDA_TEXTURE_DESC = CUDA_TEXTURE_DESC_v1; impl CUresourceViewFormat_enum { ///< No resource view format (use underlying resource format) pub const CU_RES_VIEW_FORMAT_NONE: CUresourceViewFormat_enum = CUresourceViewFormat_enum( 0, ); } impl CUresourceViewFormat_enum { ///< 1 channel unsigned 8-bit integers pub const CU_RES_VIEW_FORMAT_UINT_1X8: CUresourceViewFormat_enum = CUresourceViewFormat_enum( 1, ); } impl CUresourceViewFormat_enum { ///< 2 channel unsigned 8-bit integers pub const CU_RES_VIEW_FORMAT_UINT_2X8: CUresourceViewFormat_enum = CUresourceViewFormat_enum( 2, ); } impl CUresourceViewFormat_enum { ///< 4 channel unsigned 8-bit integers pub const CU_RES_VIEW_FORMAT_UINT_4X8: CUresourceViewFormat_enum = CUresourceViewFormat_enum( 3, ); } impl CUresourceViewFormat_enum { ///< 1 channel signed 8-bit integers pub const CU_RES_VIEW_FORMAT_SINT_1X8: CUresourceViewFormat_enum = CUresourceViewFormat_enum( 4, ); } impl CUresourceViewFormat_enum { ///< 2 channel signed 8-bit integers pub const CU_RES_VIEW_FORMAT_SINT_2X8: CUresourceViewFormat_enum = CUresourceViewFormat_enum( 5, ); } impl CUresourceViewFormat_enum { ///< 4 channel signed 8-bit integers pub const CU_RES_VIEW_FORMAT_SINT_4X8: CUresourceViewFormat_enum = CUresourceViewFormat_enum( 6, ); } impl CUresourceViewFormat_enum { ///< 1 channel unsigned 16-bit integers pub const CU_RES_VIEW_FORMAT_UINT_1X16: CUresourceViewFormat_enum = CUresourceViewFormat_enum( 7, ); } impl CUresourceViewFormat_enum { ///< 2 channel unsigned 16-bit integers pub const CU_RES_VIEW_FORMAT_UINT_2X16: CUresourceViewFormat_enum = CUresourceViewFormat_enum( 8, ); } impl CUresourceViewFormat_enum { ///< 4 channel unsigned 16-bit integers pub const CU_RES_VIEW_FORMAT_UINT_4X16: CUresourceViewFormat_enum = CUresourceViewFormat_enum( 9, ); } impl CUresourceViewFormat_enum { ///< 1 channel signed 16-bit integers pub const CU_RES_VIEW_FORMAT_SINT_1X16: CUresourceViewFormat_enum = CUresourceViewFormat_enum( 10, ); } impl CUresourceViewFormat_enum { ///< 2 channel signed 16-bit integers pub const CU_RES_VIEW_FORMAT_SINT_2X16: CUresourceViewFormat_enum = CUresourceViewFormat_enum( 11, ); } impl CUresourceViewFormat_enum { ///< 4 channel signed 16-bit integers pub const CU_RES_VIEW_FORMAT_SINT_4X16: CUresourceViewFormat_enum = CUresourceViewFormat_enum( 12, ); } impl CUresourceViewFormat_enum { ///< 1 channel unsigned 32-bit integers pub const CU_RES_VIEW_FORMAT_UINT_1X32: CUresourceViewFormat_enum = CUresourceViewFormat_enum( 13, ); } impl CUresourceViewFormat_enum { ///< 2 channel unsigned 32-bit integers pub const CU_RES_VIEW_FORMAT_UINT_2X32: CUresourceViewFormat_enum = CUresourceViewFormat_enum( 14, ); } impl CUresourceViewFormat_enum { ///< 4 channel unsigned 32-bit integers pub const CU_RES_VIEW_FORMAT_UINT_4X32: CUresourceViewFormat_enum = CUresourceViewFormat_enum( 15, ); } impl CUresourceViewFormat_enum { ///< 1 channel signed 32-bit integers pub const CU_RES_VIEW_FORMAT_SINT_1X32: CUresourceViewFormat_enum = CUresourceViewFormat_enum( 16, ); } impl CUresourceViewFormat_enum { ///< 2 channel signed 32-bit integers pub const CU_RES_VIEW_FORMAT_SINT_2X32: CUresourceViewFormat_enum = CUresourceViewFormat_enum( 17, ); } impl CUresourceViewFormat_enum { ///< 4 channel signed 32-bit integers pub const CU_RES_VIEW_FORMAT_SINT_4X32: CUresourceViewFormat_enum = CUresourceViewFormat_enum( 18, ); } impl CUresourceViewFormat_enum { ///< 1 channel 16-bit floating point pub const CU_RES_VIEW_FORMAT_FLOAT_1X16: CUresourceViewFormat_enum = CUresourceViewFormat_enum( 19, ); } impl CUresourceViewFormat_enum { ///< 2 channel 16-bit floating point pub const CU_RES_VIEW_FORMAT_FLOAT_2X16: CUresourceViewFormat_enum = CUresourceViewFormat_enum( 20, ); } impl CUresourceViewFormat_enum { ///< 4 channel 16-bit floating point pub const CU_RES_VIEW_FORMAT_FLOAT_4X16: CUresourceViewFormat_enum = CUresourceViewFormat_enum( 21, ); } impl CUresourceViewFormat_enum { ///< 1 channel 32-bit floating point pub const CU_RES_VIEW_FORMAT_FLOAT_1X32: CUresourceViewFormat_enum = CUresourceViewFormat_enum( 22, ); } impl CUresourceViewFormat_enum { ///< 2 channel 32-bit floating point pub const CU_RES_VIEW_FORMAT_FLOAT_2X32: CUresourceViewFormat_enum = CUresourceViewFormat_enum( 23, ); } impl CUresourceViewFormat_enum { ///< 4 channel 32-bit floating point pub const CU_RES_VIEW_FORMAT_FLOAT_4X32: CUresourceViewFormat_enum = CUresourceViewFormat_enum( 24, ); } impl CUresourceViewFormat_enum { ///< Block compressed 1 pub const CU_RES_VIEW_FORMAT_UNSIGNED_BC1: CUresourceViewFormat_enum = CUresourceViewFormat_enum( 25, ); } impl CUresourceViewFormat_enum { ///< Block compressed 2 pub const CU_RES_VIEW_FORMAT_UNSIGNED_BC2: CUresourceViewFormat_enum = CUresourceViewFormat_enum( 26, ); } impl CUresourceViewFormat_enum { ///< Block compressed 3 pub const CU_RES_VIEW_FORMAT_UNSIGNED_BC3: CUresourceViewFormat_enum = CUresourceViewFormat_enum( 27, ); } impl CUresourceViewFormat_enum { ///< Block compressed 4 unsigned pub const CU_RES_VIEW_FORMAT_UNSIGNED_BC4: CUresourceViewFormat_enum = CUresourceViewFormat_enum( 28, ); } impl CUresourceViewFormat_enum { ///< Block compressed 4 signed pub const CU_RES_VIEW_FORMAT_SIGNED_BC4: CUresourceViewFormat_enum = CUresourceViewFormat_enum( 29, ); } impl CUresourceViewFormat_enum { ///< Block compressed 5 unsigned pub const CU_RES_VIEW_FORMAT_UNSIGNED_BC5: CUresourceViewFormat_enum = CUresourceViewFormat_enum( 30, ); } impl CUresourceViewFormat_enum { ///< Block compressed 5 signed pub const CU_RES_VIEW_FORMAT_SIGNED_BC5: CUresourceViewFormat_enum = CUresourceViewFormat_enum( 31, ); } impl CUresourceViewFormat_enum { ///< Block compressed 6 unsigned half-float pub const CU_RES_VIEW_FORMAT_UNSIGNED_BC6H: CUresourceViewFormat_enum = CUresourceViewFormat_enum( 32, ); } impl CUresourceViewFormat_enum { ///< Block compressed 6 signed half-float pub const CU_RES_VIEW_FORMAT_SIGNED_BC6H: CUresourceViewFormat_enum = CUresourceViewFormat_enum( 33, ); } impl CUresourceViewFormat_enum { ///< Block compressed 7 pub const CU_RES_VIEW_FORMAT_UNSIGNED_BC7: CUresourceViewFormat_enum = CUresourceViewFormat_enum( 34, ); } #[repr(transparent)] /// Resource view format #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUresourceViewFormat_enum(pub ::core::ffi::c_uint); /// Resource view format pub use self::CUresourceViewFormat_enum as CUresourceViewFormat; /// Resource view descriptor #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_RESOURCE_VIEW_DESC_st { ///< Resource view format pub format: CUresourceViewFormat, ///< Width of the resource view pub width: usize, ///< Height of the resource view pub height: usize, ///< Depth of the resource view pub depth: usize, ///< First defined mipmap level pub firstMipmapLevel: ::core::ffi::c_uint, ///< Last defined mipmap level pub lastMipmapLevel: ::core::ffi::c_uint, ///< First layer index pub firstLayer: ::core::ffi::c_uint, ///< Last layer index pub lastLayer: ::core::ffi::c_uint, pub reserved: [::core::ffi::c_uint; 16usize], } /// Resource view descriptor pub type CUDA_RESOURCE_VIEW_DESC_v1 = CUDA_RESOURCE_VIEW_DESC_st; /// Resource view descriptor pub type CUDA_RESOURCE_VIEW_DESC = CUDA_RESOURCE_VIEW_DESC_v1; /// Tensor map descriptor. Requires compiler support for aligning to 128 bytes. #[repr(C)] #[repr(align(128))] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUtensorMap_st { pub opaque: [cuuint64_t; 16usize], } /// Tensor map descriptor. Requires compiler support for aligning to 128 bytes. pub type CUtensorMap = CUtensorMap_st; impl CUtensorMapDataType_enum { pub const CU_TENSOR_MAP_DATA_TYPE_UINT8: CUtensorMapDataType_enum = CUtensorMapDataType_enum( 0, ); } impl CUtensorMapDataType_enum { pub const CU_TENSOR_MAP_DATA_TYPE_UINT16: CUtensorMapDataType_enum = CUtensorMapDataType_enum( 1, ); } impl CUtensorMapDataType_enum { pub const CU_TENSOR_MAP_DATA_TYPE_UINT32: CUtensorMapDataType_enum = CUtensorMapDataType_enum( 2, ); } impl CUtensorMapDataType_enum { pub const CU_TENSOR_MAP_DATA_TYPE_INT32: CUtensorMapDataType_enum = CUtensorMapDataType_enum( 3, ); } impl CUtensorMapDataType_enum { pub const CU_TENSOR_MAP_DATA_TYPE_UINT64: CUtensorMapDataType_enum = CUtensorMapDataType_enum( 4, ); } impl CUtensorMapDataType_enum { pub const CU_TENSOR_MAP_DATA_TYPE_INT64: CUtensorMapDataType_enum = CUtensorMapDataType_enum( 5, ); } impl CUtensorMapDataType_enum { pub const CU_TENSOR_MAP_DATA_TYPE_FLOAT16: CUtensorMapDataType_enum = CUtensorMapDataType_enum( 6, ); } impl CUtensorMapDataType_enum { pub const CU_TENSOR_MAP_DATA_TYPE_FLOAT32: CUtensorMapDataType_enum = CUtensorMapDataType_enum( 7, ); } impl CUtensorMapDataType_enum { pub const CU_TENSOR_MAP_DATA_TYPE_FLOAT64: CUtensorMapDataType_enum = CUtensorMapDataType_enum( 8, ); } impl CUtensorMapDataType_enum { pub const CU_TENSOR_MAP_DATA_TYPE_BFLOAT16: CUtensorMapDataType_enum = CUtensorMapDataType_enum( 9, ); } impl CUtensorMapDataType_enum { pub const CU_TENSOR_MAP_DATA_TYPE_FLOAT32_FTZ: CUtensorMapDataType_enum = CUtensorMapDataType_enum( 10, ); } impl CUtensorMapDataType_enum { pub const CU_TENSOR_MAP_DATA_TYPE_TFLOAT32: CUtensorMapDataType_enum = CUtensorMapDataType_enum( 11, ); } impl CUtensorMapDataType_enum { pub const CU_TENSOR_MAP_DATA_TYPE_TFLOAT32_FTZ: CUtensorMapDataType_enum = CUtensorMapDataType_enum( 12, ); } impl CUtensorMapDataType_enum { pub const CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B: CUtensorMapDataType_enum = CUtensorMapDataType_enum( 13, ); } impl CUtensorMapDataType_enum { pub const CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B: CUtensorMapDataType_enum = CUtensorMapDataType_enum( 14, ); } impl CUtensorMapDataType_enum { pub const CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B: CUtensorMapDataType_enum = CUtensorMapDataType_enum( 15, ); } #[repr(transparent)] /// Tensor map data type #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUtensorMapDataType_enum(pub ::core::ffi::c_uint); /// Tensor map data type pub use self::CUtensorMapDataType_enum as CUtensorMapDataType; impl CUtensorMapInterleave_enum { pub const CU_TENSOR_MAP_INTERLEAVE_NONE: CUtensorMapInterleave_enum = CUtensorMapInterleave_enum( 0, ); } impl CUtensorMapInterleave_enum { pub const CU_TENSOR_MAP_INTERLEAVE_16B: CUtensorMapInterleave_enum = CUtensorMapInterleave_enum( 1, ); } impl CUtensorMapInterleave_enum { pub const CU_TENSOR_MAP_INTERLEAVE_32B: CUtensorMapInterleave_enum = CUtensorMapInterleave_enum( 2, ); } #[repr(transparent)] /// Tensor map interleave layout type #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUtensorMapInterleave_enum(pub ::core::ffi::c_uint); /// Tensor map interleave layout type pub use self::CUtensorMapInterleave_enum as CUtensorMapInterleave; impl CUtensorMapSwizzle_enum { pub const CU_TENSOR_MAP_SWIZZLE_NONE: CUtensorMapSwizzle_enum = CUtensorMapSwizzle_enum( 0, ); } impl CUtensorMapSwizzle_enum { pub const CU_TENSOR_MAP_SWIZZLE_32B: CUtensorMapSwizzle_enum = CUtensorMapSwizzle_enum( 1, ); } impl CUtensorMapSwizzle_enum { pub const CU_TENSOR_MAP_SWIZZLE_64B: CUtensorMapSwizzle_enum = CUtensorMapSwizzle_enum( 2, ); } impl CUtensorMapSwizzle_enum { pub const CU_TENSOR_MAP_SWIZZLE_128B: CUtensorMapSwizzle_enum = CUtensorMapSwizzle_enum( 3, ); } impl CUtensorMapSwizzle_enum { pub const CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B: CUtensorMapSwizzle_enum = CUtensorMapSwizzle_enum( 4, ); } impl CUtensorMapSwizzle_enum { pub const CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B_FLIP_8B: CUtensorMapSwizzle_enum = CUtensorMapSwizzle_enum( 5, ); } impl CUtensorMapSwizzle_enum { pub const CU_TENSOR_MAP_SWIZZLE_128B_ATOM_64B: CUtensorMapSwizzle_enum = CUtensorMapSwizzle_enum( 6, ); } #[repr(transparent)] /// Tensor map swizzling mode of shared memory banks #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUtensorMapSwizzle_enum(pub ::core::ffi::c_uint); /// Tensor map swizzling mode of shared memory banks pub use self::CUtensorMapSwizzle_enum as CUtensorMapSwizzle; impl CUtensorMapL2promotion_enum { pub const CU_TENSOR_MAP_L2_PROMOTION_NONE: CUtensorMapL2promotion_enum = CUtensorMapL2promotion_enum( 0, ); } impl CUtensorMapL2promotion_enum { pub const CU_TENSOR_MAP_L2_PROMOTION_L2_64B: CUtensorMapL2promotion_enum = CUtensorMapL2promotion_enum( 1, ); } impl CUtensorMapL2promotion_enum { pub const CU_TENSOR_MAP_L2_PROMOTION_L2_128B: CUtensorMapL2promotion_enum = CUtensorMapL2promotion_enum( 2, ); } impl CUtensorMapL2promotion_enum { pub const CU_TENSOR_MAP_L2_PROMOTION_L2_256B: CUtensorMapL2promotion_enum = CUtensorMapL2promotion_enum( 3, ); } #[repr(transparent)] /// Tensor map L2 promotion type #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUtensorMapL2promotion_enum(pub ::core::ffi::c_uint); /// Tensor map L2 promotion type pub use self::CUtensorMapL2promotion_enum as CUtensorMapL2promotion; impl CUtensorMapFloatOOBfill_enum { pub const CU_TENSOR_MAP_FLOAT_OOB_FILL_NONE: CUtensorMapFloatOOBfill_enum = CUtensorMapFloatOOBfill_enum( 0, ); } impl CUtensorMapFloatOOBfill_enum { pub const CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA: CUtensorMapFloatOOBfill_enum = CUtensorMapFloatOOBfill_enum( 1, ); } #[repr(transparent)] /// Tensor map out-of-bounds fill type #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUtensorMapFloatOOBfill_enum(pub ::core::ffi::c_uint); /// Tensor map out-of-bounds fill type pub use self::CUtensorMapFloatOOBfill_enum as CUtensorMapFloatOOBfill; impl CUtensorMapIm2ColWideMode_enum { pub const CU_TENSOR_MAP_IM2COL_WIDE_MODE_W: CUtensorMapIm2ColWideMode_enum = CUtensorMapIm2ColWideMode_enum( 0, ); } impl CUtensorMapIm2ColWideMode_enum { pub const CU_TENSOR_MAP_IM2COL_WIDE_MODE_W128: CUtensorMapIm2ColWideMode_enum = CUtensorMapIm2ColWideMode_enum( 1, ); } #[repr(transparent)] /// Tensor map Im2Col wide mode #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUtensorMapIm2ColWideMode_enum(pub ::core::ffi::c_uint); /// Tensor map Im2Col wide mode pub use self::CUtensorMapIm2ColWideMode_enum as CUtensorMapIm2ColWideMode; /// GPU Direct v3 tokens #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st { pub p2pToken: ::core::ffi::c_ulonglong, pub vaSpaceToken: ::core::ffi::c_uint, } /// GPU Direct v3 tokens pub type CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1 = CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st; /// GPU Direct v3 tokens pub type CUDA_POINTER_ATTRIBUTE_P2P_TOKENS = CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1; impl CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum { ///< No access, meaning the device cannot access this memory at all, thus must be staged through accessible memory in order to complete certain operations pub const CU_POINTER_ATTRIBUTE_ACCESS_FLAG_NONE: CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum = CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum( 0, ); } impl CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum { ///< Read-only access, meaning writes to this memory are considered invalid accesses and thus return error in that case. pub const CU_POINTER_ATTRIBUTE_ACCESS_FLAG_READ: CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum = CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum( 1, ); } impl CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum { ///< Read-write access, the device has full read-write access to the memory pub const CU_POINTER_ATTRIBUTE_ACCESS_FLAG_READWRITE: CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum = CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum( 3, ); } #[repr(transparent)] /** Access flags that specify the level of access the current context's device has on the memory referenced.*/ #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum(pub ::core::ffi::c_uint); /** Access flags that specify the level of access the current context's device has on the memory referenced.*/ pub use self::CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum as CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS; /// Kernel launch parameters #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_LAUNCH_PARAMS_st { ///< Kernel to launch pub function: CUfunction, ///< Width of grid in blocks pub gridDimX: ::core::ffi::c_uint, ///< Height of grid in blocks pub gridDimY: ::core::ffi::c_uint, ///< Depth of grid in blocks pub gridDimZ: ::core::ffi::c_uint, ///< X dimension of each thread block pub blockDimX: ::core::ffi::c_uint, ///< Y dimension of each thread block pub blockDimY: ::core::ffi::c_uint, ///< Z dimension of each thread block pub blockDimZ: ::core::ffi::c_uint, ///< Dynamic shared-memory size per thread block in bytes pub sharedMemBytes: ::core::ffi::c_uint, ///< Stream identifier pub hStream: CUstream, ///< Array of pointers to kernel parameters pub kernelParams: *mut *mut ::core::ffi::c_void, } /// Kernel launch parameters pub type CUDA_LAUNCH_PARAMS_v1 = CUDA_LAUNCH_PARAMS_st; /// Kernel launch parameters pub type CUDA_LAUNCH_PARAMS = CUDA_LAUNCH_PARAMS_v1; impl CUexternalMemoryHandleType_enum { /// Handle is an opaque file descriptor pub const CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD: CUexternalMemoryHandleType_enum = CUexternalMemoryHandleType_enum( 1, ); } impl CUexternalMemoryHandleType_enum { /// Handle is an opaque shared NT handle pub const CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32: CUexternalMemoryHandleType_enum = CUexternalMemoryHandleType_enum( 2, ); } impl CUexternalMemoryHandleType_enum { /// Handle is an opaque, globally shared handle pub const CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT: CUexternalMemoryHandleType_enum = CUexternalMemoryHandleType_enum( 3, ); } impl CUexternalMemoryHandleType_enum { /// Handle is a D3D12 heap object pub const CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP: CUexternalMemoryHandleType_enum = CUexternalMemoryHandleType_enum( 4, ); } impl CUexternalMemoryHandleType_enum { /// Handle is a D3D12 committed resource pub const CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE: CUexternalMemoryHandleType_enum = CUexternalMemoryHandleType_enum( 5, ); } impl CUexternalMemoryHandleType_enum { /// Handle is a shared NT handle to a D3D11 resource pub const CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE: CUexternalMemoryHandleType_enum = CUexternalMemoryHandleType_enum( 6, ); } impl CUexternalMemoryHandleType_enum { /// Handle is a globally shared handle to a D3D11 resource pub const CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT: CUexternalMemoryHandleType_enum = CUexternalMemoryHandleType_enum( 7, ); } impl CUexternalMemoryHandleType_enum { /// Handle is an NvSciBuf object pub const CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF: CUexternalMemoryHandleType_enum = CUexternalMemoryHandleType_enum( 8, ); } impl CUexternalMemoryHandleType_enum { /// Handle is a dma_buf file descriptor pub const CU_EXTERNAL_MEMORY_HANDLE_TYPE_DMABUF_FD: CUexternalMemoryHandleType_enum = CUexternalMemoryHandleType_enum( 9, ); } #[repr(transparent)] /// External memory handle types #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUexternalMemoryHandleType_enum(pub ::core::ffi::c_uint); /// External memory handle types pub use self::CUexternalMemoryHandleType_enum as CUexternalMemoryHandleType; /// External memory handle descriptor #[repr(C)] #[derive(Copy, Clone)] pub struct CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st { /// Type of the handle pub type_: CUexternalMemoryHandleType, pub handle: CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st__bindgen_ty_1, /// Size of the memory allocation pub size: ::core::ffi::c_ulonglong, /// Flags must either be zero or ::CUDA_EXTERNAL_MEMORY_DEDICATED pub flags: ::core::ffi::c_uint, pub reserved: [::core::ffi::c_uint; 16usize], } #[repr(C)] #[derive(Copy, Clone)] pub union CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st__bindgen_ty_1 { /** File descriptor referencing the memory object. Valid when type is ::CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD*/ pub fd: ::core::ffi::c_int, pub win32: CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st__bindgen_ty_1__bindgen_ty_1, /** A handle representing an NvSciBuf Object. Valid when type is ::CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF*/ pub nvSciBufObject: *const ::core::ffi::c_void, } /** Win32 handle referencing the semaphore object. Valid when type is one of the following: - ::CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32 - ::CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT - ::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP - ::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE - ::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE - ::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT Exactly one of 'handle' and 'name' must be non-NULL. If type is one of the following: ::CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT ::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT then 'name' must be NULL.*/ #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st__bindgen_ty_1__bindgen_ty_1 { /// Valid NT handle. Must be NULL if 'name' is non-NULL pub handle: *mut ::core::ffi::c_void, /** Name of a valid memory object. Must be NULL if 'handle' is non-NULL.*/ pub name: *const ::core::ffi::c_void, } /// External memory handle descriptor pub type CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1 = CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st; /// External memory handle descriptor pub type CUDA_EXTERNAL_MEMORY_HANDLE_DESC = CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1; /// External memory buffer descriptor #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st { /// Offset into the memory object where the buffer's base is pub offset: ::core::ffi::c_ulonglong, /// Size of the buffer pub size: ::core::ffi::c_ulonglong, /// Flags reserved for future use. Must be zero. pub flags: ::core::ffi::c_uint, pub reserved: [::core::ffi::c_uint; 16usize], } /// External memory buffer descriptor pub type CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1 = CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st; /// External memory buffer descriptor pub type CUDA_EXTERNAL_MEMORY_BUFFER_DESC = CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1; /// External memory mipmap descriptor #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st { /** Offset into the memory object where the base level of the mipmap chain is.*/ pub offset: ::core::ffi::c_ulonglong, /// Format, dimension and type of base level of the mipmap chain pub arrayDesc: CUDA_ARRAY3D_DESCRIPTOR, /// Total number of levels in the mipmap chain pub numLevels: ::core::ffi::c_uint, pub reserved: [::core::ffi::c_uint; 16usize], } /// External memory mipmap descriptor pub type CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1 = CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st; /// External memory mipmap descriptor pub type CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC = CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1; impl CUexternalSemaphoreHandleType_enum { /// Handle is an opaque file descriptor pub const CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD: CUexternalSemaphoreHandleType_enum = CUexternalSemaphoreHandleType_enum( 1, ); } impl CUexternalSemaphoreHandleType_enum { /// Handle is an opaque shared NT handle pub const CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32: CUexternalSemaphoreHandleType_enum = CUexternalSemaphoreHandleType_enum( 2, ); } impl CUexternalSemaphoreHandleType_enum { /// Handle is an opaque, globally shared handle pub const CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT: CUexternalSemaphoreHandleType_enum = CUexternalSemaphoreHandleType_enum( 3, ); } impl CUexternalSemaphoreHandleType_enum { /// Handle is a shared NT handle referencing a D3D12 fence object pub const CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE: CUexternalSemaphoreHandleType_enum = CUexternalSemaphoreHandleType_enum( 4, ); } impl CUexternalSemaphoreHandleType_enum { /// Handle is a shared NT handle referencing a D3D11 fence object pub const CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE: CUexternalSemaphoreHandleType_enum = CUexternalSemaphoreHandleType_enum( 5, ); } impl CUexternalSemaphoreHandleType_enum { /// Opaque handle to NvSciSync Object pub const CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC: CUexternalSemaphoreHandleType_enum = CUexternalSemaphoreHandleType_enum( 6, ); } impl CUexternalSemaphoreHandleType_enum { /// Handle is a shared NT handle referencing a D3D11 keyed mutex object pub const CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX: CUexternalSemaphoreHandleType_enum = CUexternalSemaphoreHandleType_enum( 7, ); } impl CUexternalSemaphoreHandleType_enum { /// Handle is a globally shared handle referencing a D3D11 keyed mutex object pub const CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT: CUexternalSemaphoreHandleType_enum = CUexternalSemaphoreHandleType_enum( 8, ); } impl CUexternalSemaphoreHandleType_enum { /// Handle is an opaque file descriptor referencing a timeline semaphore pub const CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD: CUexternalSemaphoreHandleType_enum = CUexternalSemaphoreHandleType_enum( 9, ); } impl CUexternalSemaphoreHandleType_enum { /// Handle is an opaque shared NT handle referencing a timeline semaphore pub const CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32: CUexternalSemaphoreHandleType_enum = CUexternalSemaphoreHandleType_enum( 10, ); } #[repr(transparent)] /// External semaphore handle types #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUexternalSemaphoreHandleType_enum(pub ::core::ffi::c_uint); /// External semaphore handle types pub use self::CUexternalSemaphoreHandleType_enum as CUexternalSemaphoreHandleType; /// External semaphore handle descriptor #[repr(C)] #[derive(Copy, Clone)] pub struct CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st { /// Type of the handle pub type_: CUexternalSemaphoreHandleType, pub handle: CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st__bindgen_ty_1, /// Flags reserved for the future. Must be zero. pub flags: ::core::ffi::c_uint, pub reserved: [::core::ffi::c_uint; 16usize], } #[repr(C)] #[derive(Copy, Clone)] pub union CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st__bindgen_ty_1 { /** File descriptor referencing the semaphore object. Valid when type is one of the following: - ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD - ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD*/ pub fd: ::core::ffi::c_int, pub win32: CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st__bindgen_ty_1__bindgen_ty_1, /// Valid NvSciSyncObj. Must be non NULL pub nvSciSyncObj: *const ::core::ffi::c_void, } /** Win32 handle referencing the semaphore object. Valid when type is one of the following: - ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32 - ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT - ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE - ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE - ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX - ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32 Exactly one of 'handle' and 'name' must be non-NULL. If type is one of the following: - ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT - ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT then 'name' must be NULL.*/ #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st__bindgen_ty_1__bindgen_ty_1 { /// Valid NT handle. Must be NULL if 'name' is non-NULL pub handle: *mut ::core::ffi::c_void, /** Name of a valid synchronization primitive. Must be NULL if 'handle' is non-NULL.*/ pub name: *const ::core::ffi::c_void, } /// External semaphore handle descriptor pub type CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1 = CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st; /// External semaphore handle descriptor pub type CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC = CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1; /// External semaphore signal parameters #[repr(C)] #[derive(Copy, Clone)] pub struct CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st { pub params: CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st__bindgen_ty_1, /** Only when ::CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS is used to signal a ::CUexternalSemaphore of type ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC, the valid flag is ::CUDA_EXTERNAL_SEMAPHORE_SIGNAL_SKIP_NVSCIBUF_MEMSYNC which indicates that while signaling the ::CUexternalSemaphore, no memory synchronization operations should be performed for any external memory object imported as ::CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF. For all other types of ::CUexternalSemaphore, flags must be zero.*/ pub flags: ::core::ffi::c_uint, pub reserved: [::core::ffi::c_uint; 16usize], } #[repr(C)] #[derive(Copy, Clone)] pub struct CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st__bindgen_ty_1 { pub fence: CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st__bindgen_ty_1__bindgen_ty_1, pub nvSciSync: CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st__bindgen_ty_1__bindgen_ty_2, pub keyedMutex: CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st__bindgen_ty_1__bindgen_ty_3, pub reserved: [::core::ffi::c_uint; 12usize], } /// Parameters for fence objects #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st__bindgen_ty_1__bindgen_ty_1 { /// Value of fence to be signaled pub value: ::core::ffi::c_ulonglong, } #[repr(C)] #[derive(Copy, Clone)] pub union CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st__bindgen_ty_1__bindgen_ty_2 { /** Pointer to NvSciSyncFence. Valid if ::CUexternalSemaphoreHandleType is of type ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC.*/ pub fence: *mut ::core::ffi::c_void, pub reserved: ::core::ffi::c_ulonglong, } /// Parameters for keyed mutex objects #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st__bindgen_ty_1__bindgen_ty_3 { /// Value of key to release the mutex with pub key: ::core::ffi::c_ulonglong, } /// External semaphore signal parameters pub type CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1 = CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st; /// External semaphore signal parameters pub type CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS = CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1; /// External semaphore wait parameters #[repr(C)] #[derive(Copy, Clone)] pub struct CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st { pub params: CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st__bindgen_ty_1, /** Only when ::CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS is used to wait on a ::CUexternalSemaphore of type ::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC, the valid flag is ::CUDA_EXTERNAL_SEMAPHORE_WAIT_SKIP_NVSCIBUF_MEMSYNC which indicates that while waiting for the ::CUexternalSemaphore, no memory synchronization operations should be performed for any external memory object imported as ::CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF. For all other types of ::CUexternalSemaphore, flags must be zero.*/ pub flags: ::core::ffi::c_uint, pub reserved: [::core::ffi::c_uint; 16usize], } #[repr(C)] #[derive(Copy, Clone)] pub struct CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st__bindgen_ty_1 { pub fence: CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st__bindgen_ty_1__bindgen_ty_1, pub nvSciSync: CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st__bindgen_ty_1__bindgen_ty_2, pub keyedMutex: CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st__bindgen_ty_1__bindgen_ty_3, pub reserved: [::core::ffi::c_uint; 10usize], } /// Parameters for fence objects #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st__bindgen_ty_1__bindgen_ty_1 { /// Value of fence to be waited on pub value: ::core::ffi::c_ulonglong, } /** Pointer to NvSciSyncFence. Valid if CUexternalSemaphoreHandleType is of type CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC.*/ #[repr(C)] #[derive(Copy, Clone)] pub union CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st__bindgen_ty_1__bindgen_ty_2 { pub fence: *mut ::core::ffi::c_void, pub reserved: ::core::ffi::c_ulonglong, } /// Parameters for keyed mutex objects #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st__bindgen_ty_1__bindgen_ty_3 { /// Value of key to acquire the mutex with pub key: ::core::ffi::c_ulonglong, /// Timeout in milliseconds to wait to acquire the mutex pub timeoutMs: ::core::ffi::c_uint, } /// External semaphore wait parameters pub type CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1 = CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st; /// External semaphore wait parameters pub type CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS = CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1; /// Semaphore signal node parameters #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st { ///< Array of external semaphore handles. pub extSemArray: *mut CUexternalSemaphore, ///< Array of external semaphore signal parameters. pub paramsArray: *const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS, ///< Number of handles and parameters supplied in extSemArray and paramsArray. pub numExtSems: ::core::ffi::c_uint, } /// Semaphore signal node parameters pub type CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1 = CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st; /// Semaphore signal node parameters pub type CUDA_EXT_SEM_SIGNAL_NODE_PARAMS = CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1; /// Semaphore signal node parameters #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st { ///< Array of external semaphore handles. pub extSemArray: *mut CUexternalSemaphore, ///< Array of external semaphore signal parameters. pub paramsArray: *const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS, ///< Number of handles and parameters supplied in extSemArray and paramsArray. pub numExtSems: ::core::ffi::c_uint, } /// Semaphore signal node parameters pub type CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2 = CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st; /// Semaphore wait node parameters #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_EXT_SEM_WAIT_NODE_PARAMS_st { ///< Array of external semaphore handles. pub extSemArray: *mut CUexternalSemaphore, ///< Array of external semaphore wait parameters. pub paramsArray: *const CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS, ///< Number of handles and parameters supplied in extSemArray and paramsArray. pub numExtSems: ::core::ffi::c_uint, } /// Semaphore wait node parameters pub type CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1 = CUDA_EXT_SEM_WAIT_NODE_PARAMS_st; /// Semaphore wait node parameters pub type CUDA_EXT_SEM_WAIT_NODE_PARAMS = CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1; /// Semaphore wait node parameters #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st { ///< Array of external semaphore handles. pub extSemArray: *mut CUexternalSemaphore, ///< Array of external semaphore wait parameters. pub paramsArray: *const CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS, ///< Number of handles and parameters supplied in extSemArray and paramsArray. pub numExtSems: ::core::ffi::c_uint, } /// Semaphore wait node parameters pub type CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2 = CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st; pub type CUmemGenericAllocationHandle_v1 = ::core::ffi::c_ulonglong; pub type CUmemGenericAllocationHandle = CUmemGenericAllocationHandle_v1; impl CUmemAllocationHandleType_enum { ///< Does not allow any export mechanism. > pub const CU_MEM_HANDLE_TYPE_NONE: CUmemAllocationHandleType_enum = CUmemAllocationHandleType_enum( 0, ); } impl CUmemAllocationHandleType_enum { ///< Allows a file descriptor to be used for exporting. Permitted only on POSIX systems. (int) pub const CU_MEM_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR: CUmemAllocationHandleType_enum = CUmemAllocationHandleType_enum( 1, ); } impl CUmemAllocationHandleType_enum { ///< Allows a Win32 NT handle to be used for exporting. (HANDLE) pub const CU_MEM_HANDLE_TYPE_WIN32: CUmemAllocationHandleType_enum = CUmemAllocationHandleType_enum( 2, ); } impl CUmemAllocationHandleType_enum { ///< Allows a Win32 KMT handle to be used for exporting. (D3DKMT_HANDLE) pub const CU_MEM_HANDLE_TYPE_WIN32_KMT: CUmemAllocationHandleType_enum = CUmemAllocationHandleType_enum( 4, ); } impl CUmemAllocationHandleType_enum { ///< Allows a fabric handle to be used for exporting. (CUmemFabricHandle) pub const CU_MEM_HANDLE_TYPE_FABRIC: CUmemAllocationHandleType_enum = CUmemAllocationHandleType_enum( 8, ); } impl CUmemAllocationHandleType_enum { pub const CU_MEM_HANDLE_TYPE_MAX: CUmemAllocationHandleType_enum = CUmemAllocationHandleType_enum( 2147483647, ); } #[repr(transparent)] /// Flags for specifying particular handle types #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUmemAllocationHandleType_enum(pub ::core::ffi::c_uint); /// Flags for specifying particular handle types pub use self::CUmemAllocationHandleType_enum as CUmemAllocationHandleType; impl CUmemAccess_flags_enum { ///< Default, make the address range not accessible pub const CU_MEM_ACCESS_FLAGS_PROT_NONE: CUmemAccess_flags_enum = CUmemAccess_flags_enum( 0, ); } impl CUmemAccess_flags_enum { ///< Make the address range read accessible pub const CU_MEM_ACCESS_FLAGS_PROT_READ: CUmemAccess_flags_enum = CUmemAccess_flags_enum( 1, ); } impl CUmemAccess_flags_enum { ///< Make the address range read-write accessible pub const CU_MEM_ACCESS_FLAGS_PROT_READWRITE: CUmemAccess_flags_enum = CUmemAccess_flags_enum( 3, ); } impl CUmemAccess_flags_enum { pub const CU_MEM_ACCESS_FLAGS_PROT_MAX: CUmemAccess_flags_enum = CUmemAccess_flags_enum( 2147483647, ); } #[repr(transparent)] /// Specifies the memory protection flags for mapping. #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUmemAccess_flags_enum(pub ::core::ffi::c_uint); /// Specifies the memory protection flags for mapping. pub use self::CUmemAccess_flags_enum as CUmemAccess_flags; impl CUmemLocationType_enum { pub const CU_MEM_LOCATION_TYPE_INVALID: CUmemLocationType_enum = CUmemLocationType_enum( 0, ); } impl CUmemLocationType_enum { ///< Location is unspecified. This is used when creating a managed memory pool to indicate no preferred location for the pool pub const CU_MEM_LOCATION_TYPE_NONE: CUmemLocationType_enum = CUmemLocationType_enum( 0, ); } impl CUmemLocationType_enum { ///< Location is a device location, thus id is a device ordinal pub const CU_MEM_LOCATION_TYPE_DEVICE: CUmemLocationType_enum = CUmemLocationType_enum( 1, ); } impl CUmemLocationType_enum { ///< Location is host, id is ignored pub const CU_MEM_LOCATION_TYPE_HOST: CUmemLocationType_enum = CUmemLocationType_enum( 2, ); } impl CUmemLocationType_enum { ///< Location is a host NUMA node, thus id is a host NUMA node id pub const CU_MEM_LOCATION_TYPE_HOST_NUMA: CUmemLocationType_enum = CUmemLocationType_enum( 3, ); } impl CUmemLocationType_enum { ///< Location is a host NUMA node of the current thread, id is ignored pub const CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT: CUmemLocationType_enum = CUmemLocationType_enum( 4, ); } impl CUmemLocationType_enum { pub const CU_MEM_LOCATION_TYPE_MAX: CUmemLocationType_enum = CUmemLocationType_enum( 2147483647, ); } #[repr(transparent)] /// Specifies the type of location #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUmemLocationType_enum(pub ::core::ffi::c_uint); /// Specifies the type of location pub use self::CUmemLocationType_enum as CUmemLocationType; impl CUmemAllocationType_enum { pub const CU_MEM_ALLOCATION_TYPE_INVALID: CUmemAllocationType_enum = CUmemAllocationType_enum( 0, ); } impl CUmemAllocationType_enum { /** This allocation type is 'pinned', i.e. cannot migrate from its current location while the application is actively using it*/ pub const CU_MEM_ALLOCATION_TYPE_PINNED: CUmemAllocationType_enum = CUmemAllocationType_enum( 1, ); } impl CUmemAllocationType_enum { /// This allocation type is managed memory pub const CU_MEM_ALLOCATION_TYPE_MANAGED: CUmemAllocationType_enum = CUmemAllocationType_enum( 2, ); } impl CUmemAllocationType_enum { /// This allocation type is managed memory pub const CU_MEM_ALLOCATION_TYPE_MAX: CUmemAllocationType_enum = CUmemAllocationType_enum( 2147483647, ); } #[repr(transparent)] /// Defines the allocation types available #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUmemAllocationType_enum(pub ::core::ffi::c_uint); /// Defines the allocation types available pub use self::CUmemAllocationType_enum as CUmemAllocationType; impl CUmemAllocationGranularity_flags_enum { ///< Minimum required granularity for allocation pub const CU_MEM_ALLOC_GRANULARITY_MINIMUM: CUmemAllocationGranularity_flags_enum = CUmemAllocationGranularity_flags_enum( 0, ); } impl CUmemAllocationGranularity_flags_enum { ///< Recommended granularity for allocation for best performance pub const CU_MEM_ALLOC_GRANULARITY_RECOMMENDED: CUmemAllocationGranularity_flags_enum = CUmemAllocationGranularity_flags_enum( 1, ); } #[repr(transparent)] /// Flag for requesting different optimal and required granularities for an allocation. #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUmemAllocationGranularity_flags_enum(pub ::core::ffi::c_uint); /// Flag for requesting different optimal and required granularities for an allocation. pub use self::CUmemAllocationGranularity_flags_enum as CUmemAllocationGranularity_flags; impl CUmemRangeHandleType_enum { pub const CU_MEM_RANGE_HANDLE_TYPE_DMA_BUF_FD: CUmemRangeHandleType_enum = CUmemRangeHandleType_enum( 1, ); } impl CUmemRangeHandleType_enum { pub const CU_MEM_RANGE_HANDLE_TYPE_MAX: CUmemRangeHandleType_enum = CUmemRangeHandleType_enum( 2147483647, ); } #[repr(transparent)] /// Specifies the handle type for address range #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUmemRangeHandleType_enum(pub ::core::ffi::c_uint); /// Specifies the handle type for address range pub use self::CUmemRangeHandleType_enum as CUmemRangeHandleType; impl CUmemRangeFlags_enum { ///< Indicates that DMA_BUF handle should be mapped via PCIe BAR1 pub const CU_MEM_RANGE_FLAG_DMA_BUF_MAPPING_TYPE_PCIE: CUmemRangeFlags_enum = CUmemRangeFlags_enum( 1, ); } #[repr(transparent)] /// Flag for requesting handle type for address range. #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUmemRangeFlags_enum(pub ::core::ffi::c_uint); /// Flag for requesting handle type for address range. pub use self::CUmemRangeFlags_enum as CUmemRangeFlags; impl CUarraySparseSubresourceType_enum { pub const CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_SPARSE_LEVEL: CUarraySparseSubresourceType_enum = CUarraySparseSubresourceType_enum( 0, ); } impl CUarraySparseSubresourceType_enum { pub const CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_MIPTAIL: CUarraySparseSubresourceType_enum = CUarraySparseSubresourceType_enum( 1, ); } #[repr(transparent)] /// Sparse subresource types #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUarraySparseSubresourceType_enum(pub ::core::ffi::c_uint); /// Sparse subresource types pub use self::CUarraySparseSubresourceType_enum as CUarraySparseSubresourceType; impl CUmemOperationType_enum { pub const CU_MEM_OPERATION_TYPE_MAP: CUmemOperationType_enum = CUmemOperationType_enum( 1, ); } impl CUmemOperationType_enum { pub const CU_MEM_OPERATION_TYPE_UNMAP: CUmemOperationType_enum = CUmemOperationType_enum( 2, ); } #[repr(transparent)] /// Memory operation types #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUmemOperationType_enum(pub ::core::ffi::c_uint); /// Memory operation types pub use self::CUmemOperationType_enum as CUmemOperationType; impl CUmemHandleType_enum { pub const CU_MEM_HANDLE_TYPE_GENERIC: CUmemHandleType_enum = CUmemHandleType_enum(0); } #[repr(transparent)] /// Memory handle types #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUmemHandleType_enum(pub ::core::ffi::c_uint); /// Memory handle types pub use self::CUmemHandleType_enum as CUmemHandleType; /// Specifies the CUDA array or CUDA mipmapped array memory mapping information #[repr(C)] #[derive(Copy, Clone)] pub struct CUarrayMapInfo_st { ///< Resource type pub resourceType: CUresourcetype, pub resource: CUarrayMapInfo_st__bindgen_ty_1, ///< Sparse subresource type pub subresourceType: CUarraySparseSubresourceType, pub subresource: CUarrayMapInfo_st__bindgen_ty_2, ///< Memory operation type pub memOperationType: CUmemOperationType, ///< Memory handle type pub memHandleType: CUmemHandleType, pub memHandle: CUarrayMapInfo_st__bindgen_ty_3, ///< Offset within the memory pub offset: ::core::ffi::c_ulonglong, ///< Device ordinal bit mask pub deviceBitMask: ::core::ffi::c_uint, ///< flags for future use, must be zero now. pub flags: ::core::ffi::c_uint, ///< Reserved for future use, must be zero now. pub reserved: [::core::ffi::c_uint; 2usize], } #[repr(C)] #[derive(Copy, Clone)] pub union CUarrayMapInfo_st__bindgen_ty_1 { pub mipmap: CUmipmappedArray, pub array: CUarray, } #[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, } #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUarrayMapInfo_st__bindgen_ty_2__bindgen_ty_1 { ///< For CUDA mipmapped arrays must a valid mipmap level. For CUDA arrays must be zero pub level: ::core::ffi::c_uint, ///< For CUDA layered arrays must be a valid layer index. Otherwise, must be zero pub layer: ::core::ffi::c_uint, ///< Starting X offset in elements pub offsetX: ::core::ffi::c_uint, ///< Starting Y offset in elements pub offsetY: ::core::ffi::c_uint, ///< Starting Z offset in elements pub offsetZ: ::core::ffi::c_uint, ///< Width in elements pub extentWidth: ::core::ffi::c_uint, ///< Height in elements pub extentHeight: ::core::ffi::c_uint, ///< Depth in elements pub extentDepth: ::core::ffi::c_uint, } #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUarrayMapInfo_st__bindgen_ty_2__bindgen_ty_2 { ///< For CUDA layered arrays must be a valid layer index. Otherwise, must be zero pub layer: ::core::ffi::c_uint, ///< Offset within mip tail pub offset: ::core::ffi::c_ulonglong, ///< Extent in bytes pub size: ::core::ffi::c_ulonglong, } #[repr(C)] #[derive(Copy, Clone)] pub union CUarrayMapInfo_st__bindgen_ty_3 { pub memHandle: CUmemGenericAllocationHandle, } /// Specifies the CUDA array or CUDA mipmapped array memory mapping information pub type CUarrayMapInfo_v1 = CUarrayMapInfo_st; /// Specifies the CUDA array or CUDA mipmapped array memory mapping information pub type CUarrayMapInfo = CUarrayMapInfo_v1; /// Specifies a memory location. #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUmemLocation_st { ///< Specifies the location type, which modifies the meaning of id. pub type_: CUmemLocationType, ///< identifier for a given this location's ::CUmemLocationType. pub id: ::core::ffi::c_int, } /// Specifies a memory location. pub type CUmemLocation_v1 = CUmemLocation_st; /// Specifies a memory location. pub type CUmemLocation = CUmemLocation_v1; impl CUmemAllocationCompType_enum { ///< Allocating non-compressible memory pub const CU_MEM_ALLOCATION_COMP_NONE: CUmemAllocationCompType_enum = CUmemAllocationCompType_enum( 0, ); } impl CUmemAllocationCompType_enum { ///< Allocating compressible memory pub const CU_MEM_ALLOCATION_COMP_GENERIC: CUmemAllocationCompType_enum = CUmemAllocationCompType_enum( 1, ); } #[repr(transparent)] /// Specifies compression attribute for an allocation. #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUmemAllocationCompType_enum(pub ::core::ffi::c_uint); /// Specifies compression attribute for an allocation. pub use self::CUmemAllocationCompType_enum as CUmemAllocationCompType; /// Specifies the allocation properties for a allocation. #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUmemAllocationProp_st { /// Allocation type pub type_: CUmemAllocationType, /// requested ::CUmemAllocationHandleType pub requestedHandleTypes: CUmemAllocationHandleType, /// Location of allocation pub location: CUmemLocation, /** Windows-specific POBJECT_ATTRIBUTES required when ::CU_MEM_HANDLE_TYPE_WIN32 is specified. This object attributes structure includes security attributes that define the scope of which exported allocations may be transferred to other processes. In all other cases, this field is required to be zero.*/ pub win32HandleMetaData: *mut ::core::ffi::c_void, pub allocFlags: CUmemAllocationProp_st__bindgen_ty_1, } #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUmemAllocationProp_st__bindgen_ty_1 { /** Allocation hint for requesting compressible memory. On devices that support Compute Data Compression, compressible memory can be used to accelerate accesses to data with unstructured sparsity and other compressible data patterns. Applications are expected to query allocation property of the handle obtained with ::cuMemCreate using ::cuMemGetAllocationPropertiesFromHandle to validate if the obtained allocation is compressible or not. Note that compressed memory may not be mappable on all devices.*/ pub compressionType: ::core::ffi::c_uchar, pub gpuDirectRDMACapable: ::core::ffi::c_uchar, /// Bitmask indicating intended usage for this allocation pub usage: ::core::ffi::c_ushort, pub reserved: [::core::ffi::c_uchar; 4usize], } /// Specifies the allocation properties for a allocation. pub type CUmemAllocationProp_v1 = CUmemAllocationProp_st; /// Specifies the allocation properties for a allocation. pub type CUmemAllocationProp = CUmemAllocationProp_v1; impl CUmulticastGranularity_flags_enum { ///< Minimum required granularity pub const CU_MULTICAST_GRANULARITY_MINIMUM: CUmulticastGranularity_flags_enum = CUmulticastGranularity_flags_enum( 0, ); } impl CUmulticastGranularity_flags_enum { ///< Recommended granularity for best performance pub const CU_MULTICAST_GRANULARITY_RECOMMENDED: CUmulticastGranularity_flags_enum = CUmulticastGranularity_flags_enum( 1, ); } #[repr(transparent)] /// Flags for querying different granularities for a multicast object #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUmulticastGranularity_flags_enum(pub ::core::ffi::c_uint); /// Flags for querying different granularities for a multicast object pub use self::CUmulticastGranularity_flags_enum as CUmulticastGranularity_flags; /// Specifies the properties for a multicast object. #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUmulticastObjectProp_st { /** The number of devices in the multicast team that will bind memory to this object*/ pub numDevices: ::core::ffi::c_uint, /** The maximum amount of memory that can be bound to this multicast object per device*/ pub size: usize, /** Bitmask of exportable handle types (see ::CUmemAllocationHandleType) for this object*/ pub handleTypes: ::core::ffi::c_ulonglong, /// Flags for future use, must be zero now pub flags: ::core::ffi::c_ulonglong, } /// Specifies the properties for a multicast object. pub type CUmulticastObjectProp_v1 = CUmulticastObjectProp_st; /// Specifies the properties for a multicast object. pub type CUmulticastObjectProp = CUmulticastObjectProp_v1; /// Memory access descriptor #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUmemAccessDesc_st { ///< Location on which the request is to change it's accessibility pub location: CUmemLocation, ///< ::CUmemProt accessibility flags to set on the request pub flags: CUmemAccess_flags, } /// Memory access descriptor pub type CUmemAccessDesc_v1 = CUmemAccessDesc_st; /// Memory access descriptor pub type CUmemAccessDesc = CUmemAccessDesc_v1; impl CUgraphExecUpdateResult_enum { ///< The update succeeded pub const CU_GRAPH_EXEC_UPDATE_SUCCESS: CUgraphExecUpdateResult_enum = CUgraphExecUpdateResult_enum( 0, ); } impl CUgraphExecUpdateResult_enum { ///< The update failed for an unexpected reason which is described in the return value of the function pub const CU_GRAPH_EXEC_UPDATE_ERROR: CUgraphExecUpdateResult_enum = CUgraphExecUpdateResult_enum( 1, ); } impl CUgraphExecUpdateResult_enum { ///< The update failed because the topology changed pub const CU_GRAPH_EXEC_UPDATE_ERROR_TOPOLOGY_CHANGED: CUgraphExecUpdateResult_enum = CUgraphExecUpdateResult_enum( 2, ); } impl CUgraphExecUpdateResult_enum { ///< The update failed because a node type changed pub const CU_GRAPH_EXEC_UPDATE_ERROR_NODE_TYPE_CHANGED: CUgraphExecUpdateResult_enum = CUgraphExecUpdateResult_enum( 3, ); } impl CUgraphExecUpdateResult_enum { ///< The update failed because the function of a kernel node changed (CUDA driver < 11.2) pub const CU_GRAPH_EXEC_UPDATE_ERROR_FUNCTION_CHANGED: CUgraphExecUpdateResult_enum = CUgraphExecUpdateResult_enum( 4, ); } impl CUgraphExecUpdateResult_enum { ///< The update failed because the parameters changed in a way that is not supported pub const CU_GRAPH_EXEC_UPDATE_ERROR_PARAMETERS_CHANGED: CUgraphExecUpdateResult_enum = CUgraphExecUpdateResult_enum( 5, ); } impl CUgraphExecUpdateResult_enum { ///< The update failed because something about the node is not supported pub const CU_GRAPH_EXEC_UPDATE_ERROR_NOT_SUPPORTED: CUgraphExecUpdateResult_enum = CUgraphExecUpdateResult_enum( 6, ); } impl CUgraphExecUpdateResult_enum { ///< The update failed because the function of a kernel node changed in an unsupported way pub const CU_GRAPH_EXEC_UPDATE_ERROR_UNSUPPORTED_FUNCTION_CHANGE: CUgraphExecUpdateResult_enum = CUgraphExecUpdateResult_enum( 7, ); } impl CUgraphExecUpdateResult_enum { ///< The update failed because the node attributes changed in a way that is not supported pub const CU_GRAPH_EXEC_UPDATE_ERROR_ATTRIBUTES_CHANGED: CUgraphExecUpdateResult_enum = CUgraphExecUpdateResult_enum( 8, ); } #[repr(transparent)] /// CUDA Graph Update error types #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUgraphExecUpdateResult_enum(pub ::core::ffi::c_uint); /// CUDA Graph Update error types pub use self::CUgraphExecUpdateResult_enum as CUgraphExecUpdateResult; /// Result information returned by cuGraphExecUpdate #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUgraphExecUpdateResultInfo_st { /// Gives more specific detail when a cuda graph update fails. pub result: CUgraphExecUpdateResult, /** The "to node" of the error edge when the topologies do not match. The error node when the error is associated with a specific node. NULL when the error is generic.*/ pub errorNode: CUgraphNode, /// The from node of error edge when the topologies do not match. Otherwise NULL. pub errorFromNode: CUgraphNode, } /// Result information returned by cuGraphExecUpdate pub type CUgraphExecUpdateResultInfo_v1 = CUgraphExecUpdateResultInfo_st; /// Result information returned by cuGraphExecUpdate pub type CUgraphExecUpdateResultInfo = CUgraphExecUpdateResultInfo_v1; impl CUmemPool_attribute_enum { /** (value type = int) Allow cuMemAllocAsync to use memory asynchronously freed in another streams as long as a stream ordering dependency of the allocating stream on the free action exists. Cuda events and null stream interactions can create the required stream ordered dependencies. (default enabled)*/ pub const CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES: CUmemPool_attribute_enum = CUmemPool_attribute_enum( 1, ); } impl CUmemPool_attribute_enum { /** (value type = int) Allow reuse of already completed frees when there is no dependency between the free and allocation. (default enabled)*/ pub const CU_MEMPOOL_ATTR_REUSE_ALLOW_OPPORTUNISTIC: CUmemPool_attribute_enum = CUmemPool_attribute_enum( 2, ); } impl CUmemPool_attribute_enum { /** (value type = int) Allow cuMemAllocAsync to insert new stream dependencies in order to establish the stream ordering required to reuse a piece of memory released by cuMemFreeAsync (default enabled).*/ pub const CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES: CUmemPool_attribute_enum = CUmemPool_attribute_enum( 3, ); } impl CUmemPool_attribute_enum { /** (value type = cuuint64_t) Amount of reserved memory in bytes to hold onto before trying to release memory back to the OS. When more than the release threshold bytes of memory are held by the memory pool, the allocator will try to release memory back to the OS on the next call to stream, event or context synchronize. (default 0)*/ pub const CU_MEMPOOL_ATTR_RELEASE_THRESHOLD: CUmemPool_attribute_enum = CUmemPool_attribute_enum( 4, ); } impl CUmemPool_attribute_enum { /** (value type = cuuint64_t) Amount of backing memory currently allocated for the mempool.*/ pub const CU_MEMPOOL_ATTR_RESERVED_MEM_CURRENT: CUmemPool_attribute_enum = CUmemPool_attribute_enum( 5, ); } impl CUmemPool_attribute_enum { /** (value type = cuuint64_t) High watermark of backing memory allocated for the mempool since the last time it was reset. High watermark can only be reset to zero.*/ pub const CU_MEMPOOL_ATTR_RESERVED_MEM_HIGH: CUmemPool_attribute_enum = CUmemPool_attribute_enum( 6, ); } impl CUmemPool_attribute_enum { /** (value type = cuuint64_t) Amount of memory from the pool that is currently in use by the application.*/ pub const CU_MEMPOOL_ATTR_USED_MEM_CURRENT: CUmemPool_attribute_enum = CUmemPool_attribute_enum( 7, ); } impl CUmemPool_attribute_enum { /** (value type = cuuint64_t) High watermark of the amount of memory from the pool that was in use by the application since the last time it was reset. High watermark can only be reset to zero.*/ pub const CU_MEMPOOL_ATTR_USED_MEM_HIGH: CUmemPool_attribute_enum = CUmemPool_attribute_enum( 8, ); } #[repr(transparent)] /// CUDA memory pool attributes #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUmemPool_attribute_enum(pub ::core::ffi::c_uint); /// CUDA memory pool attributes pub use self::CUmemPool_attribute_enum as CUmemPool_attribute; /// Specifies the properties of allocations made from the pool. #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUmemPoolProps_st { ///< Allocation type. Currently must be specified as CU_MEM_ALLOCATION_TYPE_PINNED pub allocType: CUmemAllocationType, ///< Handle types that will be supported by allocations from the pool. pub handleTypes: CUmemAllocationHandleType, ///< Location where allocations should reside. pub location: CUmemLocation, /** Windows-specific LPSECURITYATTRIBUTES required when ::CU_MEM_HANDLE_TYPE_WIN32 is specified. This security attribute defines the scope of which exported allocations may be transferred to other processes. In all other cases, this field is required to be zero.*/ pub win32SecurityAttributes: *mut ::core::ffi::c_void, ///< Maximum pool size. When set to 0, defaults to a system dependent value. pub maxSize: usize, ///< Bitmask indicating intended usage for the pool. pub usage: ::core::ffi::c_ushort, ///< reserved for future use, must be 0 pub reserved: [::core::ffi::c_uchar; 54usize], } /// Specifies the properties of allocations made from the pool. pub type CUmemPoolProps_v1 = CUmemPoolProps_st; /// Specifies the properties of allocations made from the pool. pub type CUmemPoolProps = CUmemPoolProps_v1; /// Opaque data for exporting a pool allocation #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUmemPoolPtrExportData_st { pub reserved: [::core::ffi::c_uchar; 64usize], } /// Opaque data for exporting a pool allocation pub type CUmemPoolPtrExportData_v1 = CUmemPoolPtrExportData_st; /// Opaque data for exporting a pool allocation pub type CUmemPoolPtrExportData = CUmemPoolPtrExportData_v1; impl CUmemcpyFlags_enum { pub const CU_MEMCPY_FLAG_DEFAULT: CUmemcpyFlags_enum = CUmemcpyFlags_enum(0); } impl CUmemcpyFlags_enum { /// Hint to the driver to try and overlap the copy with compute work on the SMs. pub const CU_MEMCPY_FLAG_PREFER_OVERLAP_WITH_COMPUTE: CUmemcpyFlags_enum = CUmemcpyFlags_enum( 1, ); } #[repr(transparent)] /// Flags to specify for copies within a batch. For more details see ::cuMemcpyBatchAsync. #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUmemcpyFlags_enum(pub ::core::ffi::c_uint); /// Flags to specify for copies within a batch. For more details see ::cuMemcpyBatchAsync. pub use self::CUmemcpyFlags_enum as CUmemcpyFlags; impl CUmemcpySrcAccessOrder_enum { /// Default invalid. pub const CU_MEMCPY_SRC_ACCESS_ORDER_INVALID: CUmemcpySrcAccessOrder_enum = CUmemcpySrcAccessOrder_enum( 0, ); } impl CUmemcpySrcAccessOrder_enum { /// Indicates that access to the source pointer must be in stream order. pub const CU_MEMCPY_SRC_ACCESS_ORDER_STREAM: CUmemcpySrcAccessOrder_enum = CUmemcpySrcAccessOrder_enum( 1, ); } impl CUmemcpySrcAccessOrder_enum { /** Indicates that access to the source pointer can be out of stream order and all accesses must be complete before the API call returns. This flag is suited for ephemeral sources (ex., stack variables) when it's known that no prior operations in the stream can be accessing the memory and also that the lifetime of the memory is limited to the scope that the source variable was declared in. Specifying this flag allows the driver to optimize the copy and removes the need for the user to synchronize the stream after the API call.*/ pub const CU_MEMCPY_SRC_ACCESS_ORDER_DURING_API_CALL: CUmemcpySrcAccessOrder_enum = CUmemcpySrcAccessOrder_enum( 2, ); } impl CUmemcpySrcAccessOrder_enum { /** Indicates that access to the source pointer can be out of stream order and the accesses can happen even after the API call returns. This flag is suited for host pointers allocated outside CUDA (ex., via malloc) when it's known that no prior operations in the stream can be accessing the memory. Specifying this flag allows the driver to optimize the copy on certain platforms.*/ pub const CU_MEMCPY_SRC_ACCESS_ORDER_ANY: CUmemcpySrcAccessOrder_enum = CUmemcpySrcAccessOrder_enum( 3, ); } impl CUmemcpySrcAccessOrder_enum { /** Indicates that access to the source pointer can be out of stream order and the accesses can happen even after the API call returns. This flag is suited for host pointers allocated outside CUDA (ex., via malloc) when it's known that no prior operations in the stream can be accessing the memory. Specifying this flag allows the driver to optimize the copy on certain platforms.*/ pub const CU_MEMCPY_SRC_ACCESS_ORDER_MAX: CUmemcpySrcAccessOrder_enum = CUmemcpySrcAccessOrder_enum( 2147483647, ); } #[repr(transparent)] /** These flags allow applications to convey the source access ordering CUDA must maintain. The destination will always be accessed in stream order.*/ #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUmemcpySrcAccessOrder_enum(pub ::core::ffi::c_uint); /** These flags allow applications to convey the source access ordering CUDA must maintain. The destination will always be accessed in stream order.*/ pub use self::CUmemcpySrcAccessOrder_enum as CUmemcpySrcAccessOrder; /// Attributes specific to copies within a batch. For more details on usage see ::cuMemcpyBatchAsync. #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUmemcpyAttributes_st { ///< Source access ordering to be observed for copies with this attribute. pub srcAccessOrder: CUmemcpySrcAccessOrder, ///< Hint location for the source operand. Ignored when the pointers are not managed memory or memory allocated outside CUDA. pub srcLocHint: CUmemLocation, ///< Hint location for the destination operand. Ignored when the pointers are not managed memory or memory allocated outside CUDA. pub dstLocHint: CUmemLocation, ///< Additional flags for copies with this attribute. See ::CUmemcpyFlags pub flags: ::core::ffi::c_uint, } /// Attributes specific to copies within a batch. For more details on usage see ::cuMemcpyBatchAsync. pub type CUmemcpyAttributes_v1 = CUmemcpyAttributes_st; /// Attributes specific to copies within a batch. For more details on usage see ::cuMemcpyBatchAsync. pub type CUmemcpyAttributes = CUmemcpyAttributes_v1; impl CUmemcpy3DOperandType_enum { ///< Memcpy operand is a valid pointer. pub const CU_MEMCPY_OPERAND_TYPE_POINTER: CUmemcpy3DOperandType_enum = CUmemcpy3DOperandType_enum( 1, ); } impl CUmemcpy3DOperandType_enum { ///< Memcpy operand is a CUarray. pub const CU_MEMCPY_OPERAND_TYPE_ARRAY: CUmemcpy3DOperandType_enum = CUmemcpy3DOperandType_enum( 2, ); } impl CUmemcpy3DOperandType_enum { pub const CU_MEMCPY_OPERAND_TYPE_MAX: CUmemcpy3DOperandType_enum = CUmemcpy3DOperandType_enum( 2147483647, ); } #[repr(transparent)] /// These flags allow applications to convey the operand type for individual copies specified in ::cuMemcpy3DBatchAsync. #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUmemcpy3DOperandType_enum(pub ::core::ffi::c_uint); /// These flags allow applications to convey the operand type for individual copies specified in ::cuMemcpy3DBatchAsync. pub use self::CUmemcpy3DOperandType_enum as CUmemcpy3DOperandType; /// Struct representing offset into a CUarray in elements #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUoffset3D_st { pub x: usize, pub y: usize, pub z: usize, } /// Struct representing offset into a CUarray in elements pub type CUoffset3D_v1 = CUoffset3D_st; /// Struct representing offset into a CUarray in elements pub type CUoffset3D = CUoffset3D_v1; /// Struct representing width/height/depth of a CUarray in elements #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUextent3D_st { pub width: usize, pub height: usize, pub depth: usize, } /// Struct representing width/height/depth of a CUarray in elements pub type CUextent3D_v1 = CUextent3D_st; /// Struct representing width/height/depth of a CUarray in elements pub type CUextent3D = CUextent3D_v1; /// Struct representing an operand for copy with ::cuMemcpy3DBatchAsync #[repr(C)] #[derive(Copy, Clone)] pub struct CUmemcpy3DOperand_st { pub type_: CUmemcpy3DOperandType, pub op: CUmemcpy3DOperand_st__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] pub union CUmemcpy3DOperand_st__bindgen_ty_1 { pub ptr: CUmemcpy3DOperand_st__bindgen_ty_1__bindgen_ty_1, pub array: CUmemcpy3DOperand_st__bindgen_ty_1__bindgen_ty_2, } /// Struct representing an operand when ::CUmemcpy3DOperand::type is ::CU_MEMCPY_OPERAND_TYPE_POINTER #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUmemcpy3DOperand_st__bindgen_ty_1__bindgen_ty_1 { pub ptr: CUdeviceptr, ///< Length of each row in elements. pub rowLength: usize, ///< Height of each layer in elements. pub layerHeight: usize, ///< Hint location for the operand. Ignored when the pointers are not managed memory or memory allocated outside CUDA. pub locHint: CUmemLocation, } /// Struct representing an operand when ::CUmemcpy3DOperand::type is ::CU_MEMCPY_OPERAND_TYPE_ARRAY #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUmemcpy3DOperand_st__bindgen_ty_1__bindgen_ty_2 { pub array: CUarray, pub offset: CUoffset3D, } /// Struct representing an operand for copy with ::cuMemcpy3DBatchAsync pub type CUmemcpy3DOperand_v1 = CUmemcpy3DOperand_st; /// Struct representing an operand for copy with ::cuMemcpy3DBatchAsync pub type CUmemcpy3DOperand = CUmemcpy3DOperand_v1; #[repr(C)] #[derive(Copy, Clone)] pub struct CUDA_MEMCPY3D_BATCH_OP_st { ///< Source memcpy operand. pub src: CUmemcpy3DOperand, ///< Destination memcpy operand. pub dst: CUmemcpy3DOperand, ///< Extents of the memcpy between src and dst. The width, height and depth components must not be 0. pub extent: CUextent3D, ///< Source access ordering to be observed for copy from src to dst. pub srcAccessOrder: CUmemcpySrcAccessOrder, ///< Additional flags for copies with this attribute. See ::CUmemcpyFlags pub flags: ::core::ffi::c_uint, } pub type CUDA_MEMCPY3D_BATCH_OP_v1 = CUDA_MEMCPY3D_BATCH_OP_st; pub type CUDA_MEMCPY3D_BATCH_OP = CUDA_MEMCPY3D_BATCH_OP_v1; /// Memory allocation node parameters #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_MEM_ALLOC_NODE_PARAMS_v1_st { /** in: location where the allocation should reside (specified in ::location). ::handleTypes must be ::CU_MEM_HANDLE_TYPE_NONE. IPC is not supported.*/ pub poolProps: CUmemPoolProps, ///< in: array of memory access descriptors. Used to describe peer GPU access pub accessDescs: *const CUmemAccessDesc, ///< in: number of memory access descriptors. Must not exceed the number of GPUs. pub accessDescCount: usize, ///< in: size in bytes of the requested allocation pub bytesize: usize, ///< out: address of the allocation returned by CUDA pub dptr: CUdeviceptr, } /// Memory allocation node parameters pub type CUDA_MEM_ALLOC_NODE_PARAMS_v1 = CUDA_MEM_ALLOC_NODE_PARAMS_v1_st; /// Memory allocation node parameters pub type CUDA_MEM_ALLOC_NODE_PARAMS = CUDA_MEM_ALLOC_NODE_PARAMS_v1; /// Memory allocation node parameters #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_MEM_ALLOC_NODE_PARAMS_v2_st { /** in: location where the allocation should reside (specified in ::location). ::handleTypes must be ::CU_MEM_HANDLE_TYPE_NONE. IPC is not supported.*/ pub poolProps: CUmemPoolProps, ///< in: array of memory access descriptors. Used to describe peer GPU access pub accessDescs: *const CUmemAccessDesc, ///< in: number of memory access descriptors. Must not exceed the number of GPUs. pub accessDescCount: usize, ///< in: size in bytes of the requested allocation pub bytesize: usize, ///< out: address of the allocation returned by CUDA pub dptr: CUdeviceptr, } /// Memory allocation node parameters pub type CUDA_MEM_ALLOC_NODE_PARAMS_v2 = CUDA_MEM_ALLOC_NODE_PARAMS_v2_st; /// Memory free node parameters #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_MEM_FREE_NODE_PARAMS_st { ///< in: the pointer to free pub dptr: CUdeviceptr, } /// Memory free node parameters pub type CUDA_MEM_FREE_NODE_PARAMS = CUDA_MEM_FREE_NODE_PARAMS_st; impl CUgraphMem_attribute_enum { /** (value type = cuuint64_t) Amount of memory, in bytes, currently associated with graphs*/ pub const CU_GRAPH_MEM_ATTR_USED_MEM_CURRENT: CUgraphMem_attribute_enum = CUgraphMem_attribute_enum( 0, ); } impl CUgraphMem_attribute_enum { /** (value type = cuuint64_t) High watermark of memory, in bytes, associated with graphs since the last time it was reset. High watermark can only be reset to zero.*/ pub const CU_GRAPH_MEM_ATTR_USED_MEM_HIGH: CUgraphMem_attribute_enum = CUgraphMem_attribute_enum( 1, ); } impl CUgraphMem_attribute_enum { /** (value type = cuuint64_t) Amount of memory, in bytes, currently allocated for use by the CUDA graphs asynchronous allocator.*/ pub const CU_GRAPH_MEM_ATTR_RESERVED_MEM_CURRENT: CUgraphMem_attribute_enum = CUgraphMem_attribute_enum( 2, ); } impl CUgraphMem_attribute_enum { /** (value type = cuuint64_t) High watermark of memory, in bytes, currently allocated for use by the CUDA graphs asynchronous allocator.*/ pub const CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH: CUgraphMem_attribute_enum = CUgraphMem_attribute_enum( 3, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUgraphMem_attribute_enum(pub ::core::ffi::c_uint); pub use self::CUgraphMem_attribute_enum as CUgraphMem_attribute; impl CUgraphChildGraphNodeOwnership_enum { /**< Default behavior for a child graph node. Child graph is cloned into the parent and memory allocation/free nodes can't be present in the child graph.*/ pub const CU_GRAPH_CHILD_GRAPH_OWNERSHIP_CLONE: CUgraphChildGraphNodeOwnership_enum = CUgraphChildGraphNodeOwnership_enum( 0, ); } impl CUgraphChildGraphNodeOwnership_enum { /**< The child graph is moved to the parent. The handle to the child graph is owned by the parent and will be destroyed when the parent is destroyed. The following restrictions apply to child graphs after they have been moved: Cannot be independently instantiated or destroyed; Cannot be added as a child graph of a separate parent graph; Cannot be used as an argument to cuGraphExecUpdate; Cannot have additional memory allocation or free nodes added.*/ pub const CU_GRAPH_CHILD_GRAPH_OWNERSHIP_MOVE: CUgraphChildGraphNodeOwnership_enum = CUgraphChildGraphNodeOwnership_enum( 1, ); } #[repr(transparent)] /// Child graph node ownership #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUgraphChildGraphNodeOwnership_enum(pub ::core::ffi::c_uint); /// Child graph node ownership pub use self::CUgraphChildGraphNodeOwnership_enum as CUgraphChildGraphNodeOwnership; /// Child graph node parameters #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_CHILD_GRAPH_NODE_PARAMS_st { /**< The child graph to clone into the node for node creation, or a handle to the graph owned by the node for node query. The graph must not contain conditional nodes. Graphs containing memory allocation or memory free nodes must set the ownership to be moved to the parent.*/ pub graph: CUgraph, ///< The ownership relationship of the child graph node. pub ownership: CUgraphChildGraphNodeOwnership, } /// Child graph node parameters pub type CUDA_CHILD_GRAPH_NODE_PARAMS = CUDA_CHILD_GRAPH_NODE_PARAMS_st; /// Event record node parameters #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_EVENT_RECORD_NODE_PARAMS_st { ///< The event to record when the node executes pub event: CUevent, } /// Event record node parameters pub type CUDA_EVENT_RECORD_NODE_PARAMS = CUDA_EVENT_RECORD_NODE_PARAMS_st; /// Event wait node parameters #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_EVENT_WAIT_NODE_PARAMS_st { ///< The event to wait on from the node pub event: CUevent, } /// Event wait node parameters pub type CUDA_EVENT_WAIT_NODE_PARAMS = CUDA_EVENT_WAIT_NODE_PARAMS_st; /// Graph node parameters. See ::cuGraphAddNode. #[repr(C)] #[derive(Copy, Clone)] pub struct CUgraphNodeParams_st { ///< Type of the node pub type_: CUgraphNodeType, ///< Reserved. Must be zero. pub reserved0: [::core::ffi::c_int; 3usize], pub __bindgen_anon_1: CUgraphNodeParams_st__bindgen_ty_1, ///< Reserved bytes. Must be zero. pub reserved2: ::core::ffi::c_longlong, } #[repr(C)] #[derive(Copy, Clone)] pub union CUgraphNodeParams_st__bindgen_ty_1 { ///< Padding. Unused bytes must be zero. pub reserved1: [::core::ffi::c_longlong; 29usize], ///< Kernel node parameters. pub kernel: CUDA_KERNEL_NODE_PARAMS_v3, ///< Memcpy node parameters. pub memcpy: CUDA_MEMCPY_NODE_PARAMS, ///< Memset node parameters. pub memset: CUDA_MEMSET_NODE_PARAMS_v2, ///< Host node parameters. pub host: CUDA_HOST_NODE_PARAMS_v2, ///< Child graph node parameters. pub graph: CUDA_CHILD_GRAPH_NODE_PARAMS, ///< Event wait node parameters. pub eventWait: CUDA_EVENT_WAIT_NODE_PARAMS, ///< Event record node parameters. pub eventRecord: CUDA_EVENT_RECORD_NODE_PARAMS, ///< External semaphore signal node parameters. pub extSemSignal: CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2, ///< External semaphore wait node parameters. pub extSemWait: CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2, ///< Memory allocation node parameters. pub alloc: CUDA_MEM_ALLOC_NODE_PARAMS_v2, ///< Memory free node parameters. pub free: CUDA_MEM_FREE_NODE_PARAMS, ///< MemOp node parameters. pub memOp: CUDA_BATCH_MEM_OP_NODE_PARAMS_v2, ///< Conditional node parameters. pub conditional: CUDA_CONDITIONAL_NODE_PARAMS, } /// Graph node parameters. See ::cuGraphAddNode. pub type CUgraphNodeParams = CUgraphNodeParams_st; impl CUflushGPUDirectRDMAWritesOptions_enum { ///< ::cuFlushGPUDirectRDMAWrites() and its CUDA Runtime API counterpart are supported on the device. pub const CU_FLUSH_GPU_DIRECT_RDMA_WRITES_OPTION_HOST: CUflushGPUDirectRDMAWritesOptions_enum = CUflushGPUDirectRDMAWritesOptions_enum( 1, ); } impl CUflushGPUDirectRDMAWritesOptions_enum { ///< The ::CU_STREAM_WAIT_VALUE_FLUSH flag and the ::CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES MemOp are supported on the device. pub const CU_FLUSH_GPU_DIRECT_RDMA_WRITES_OPTION_MEMOPS: CUflushGPUDirectRDMAWritesOptions_enum = CUflushGPUDirectRDMAWritesOptions_enum( 2, ); } #[repr(transparent)] /// Bitmasks for ::CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_FLUSH_WRITES_OPTIONS #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUflushGPUDirectRDMAWritesOptions_enum(pub ::core::ffi::c_uint); /// Bitmasks for ::CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_FLUSH_WRITES_OPTIONS pub use self::CUflushGPUDirectRDMAWritesOptions_enum as CUflushGPUDirectRDMAWritesOptions; impl CUGPUDirectRDMAWritesOrdering_enum { ///< The device does not natively support ordering of remote writes. ::cuFlushGPUDirectRDMAWrites() can be leveraged if supported. pub const CU_GPU_DIRECT_RDMA_WRITES_ORDERING_NONE: CUGPUDirectRDMAWritesOrdering_enum = CUGPUDirectRDMAWritesOrdering_enum( 0, ); } impl CUGPUDirectRDMAWritesOrdering_enum { ///< Natively, the device can consistently consume remote writes, although other CUDA devices may not. pub const CU_GPU_DIRECT_RDMA_WRITES_ORDERING_OWNER: CUGPUDirectRDMAWritesOrdering_enum = CUGPUDirectRDMAWritesOrdering_enum( 100, ); } impl CUGPUDirectRDMAWritesOrdering_enum { ///< Any CUDA device in the system can consistently consume remote writes to this device. pub const CU_GPU_DIRECT_RDMA_WRITES_ORDERING_ALL_DEVICES: CUGPUDirectRDMAWritesOrdering_enum = CUGPUDirectRDMAWritesOrdering_enum( 200, ); } #[repr(transparent)] /// Platform native ordering for GPUDirect RDMA writes #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUGPUDirectRDMAWritesOrdering_enum(pub ::core::ffi::c_uint); /// Platform native ordering for GPUDirect RDMA writes pub use self::CUGPUDirectRDMAWritesOrdering_enum as CUGPUDirectRDMAWritesOrdering; impl CUflushGPUDirectRDMAWritesScope_enum { ///< Blocks until remote writes are visible to the CUDA device context owning the data. pub const CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TO_OWNER: CUflushGPUDirectRDMAWritesScope_enum = CUflushGPUDirectRDMAWritesScope_enum( 100, ); } impl CUflushGPUDirectRDMAWritesScope_enum { ///< Blocks until remote writes are visible to all CUDA device contexts. pub const CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TO_ALL_DEVICES: CUflushGPUDirectRDMAWritesScope_enum = CUflushGPUDirectRDMAWritesScope_enum( 200, ); } #[repr(transparent)] /// The scopes for ::cuFlushGPUDirectRDMAWrites #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUflushGPUDirectRDMAWritesScope_enum(pub ::core::ffi::c_uint); /// The scopes for ::cuFlushGPUDirectRDMAWrites pub use self::CUflushGPUDirectRDMAWritesScope_enum as CUflushGPUDirectRDMAWritesScope; impl CUflushGPUDirectRDMAWritesTarget_enum { ///< Sets the target for ::cuFlushGPUDirectRDMAWrites() to the currently active CUDA device context. pub const CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TARGET_CURRENT_CTX: CUflushGPUDirectRDMAWritesTarget_enum = CUflushGPUDirectRDMAWritesTarget_enum( 0, ); } #[repr(transparent)] /// The targets for ::cuFlushGPUDirectRDMAWrites #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUflushGPUDirectRDMAWritesTarget_enum(pub ::core::ffi::c_uint); /// The targets for ::cuFlushGPUDirectRDMAWrites pub use self::CUflushGPUDirectRDMAWritesTarget_enum as CUflushGPUDirectRDMAWritesTarget; impl CUgraphDebugDot_flags_enum { ///< Output all debug data as if every debug flag is enabled pub const CU_GRAPH_DEBUG_DOT_FLAGS_VERBOSE: CUgraphDebugDot_flags_enum = CUgraphDebugDot_flags_enum( 1, ); } impl CUgraphDebugDot_flags_enum { ///< Use CUDA Runtime structures for output pub const CU_GRAPH_DEBUG_DOT_FLAGS_RUNTIME_TYPES: CUgraphDebugDot_flags_enum = CUgraphDebugDot_flags_enum( 2, ); } impl CUgraphDebugDot_flags_enum { ///< Adds CUDA_KERNEL_NODE_PARAMS values to output pub const CU_GRAPH_DEBUG_DOT_FLAGS_KERNEL_NODE_PARAMS: CUgraphDebugDot_flags_enum = CUgraphDebugDot_flags_enum( 4, ); } impl CUgraphDebugDot_flags_enum { ///< Adds CUDA_MEMCPY3D values to output pub const CU_GRAPH_DEBUG_DOT_FLAGS_MEMCPY_NODE_PARAMS: CUgraphDebugDot_flags_enum = CUgraphDebugDot_flags_enum( 8, ); } impl CUgraphDebugDot_flags_enum { ///< Adds CUDA_MEMSET_NODE_PARAMS values to output pub const CU_GRAPH_DEBUG_DOT_FLAGS_MEMSET_NODE_PARAMS: CUgraphDebugDot_flags_enum = CUgraphDebugDot_flags_enum( 16, ); } impl CUgraphDebugDot_flags_enum { ///< Adds CUDA_HOST_NODE_PARAMS values to output pub const CU_GRAPH_DEBUG_DOT_FLAGS_HOST_NODE_PARAMS: CUgraphDebugDot_flags_enum = CUgraphDebugDot_flags_enum( 32, ); } impl CUgraphDebugDot_flags_enum { ///< Adds CUevent handle from record and wait nodes to output pub const CU_GRAPH_DEBUG_DOT_FLAGS_EVENT_NODE_PARAMS: CUgraphDebugDot_flags_enum = CUgraphDebugDot_flags_enum( 64, ); } impl CUgraphDebugDot_flags_enum { ///< Adds CUDA_EXT_SEM_SIGNAL_NODE_PARAMS values to output pub const CU_GRAPH_DEBUG_DOT_FLAGS_EXT_SEMAS_SIGNAL_NODE_PARAMS: CUgraphDebugDot_flags_enum = CUgraphDebugDot_flags_enum( 128, ); } impl CUgraphDebugDot_flags_enum { ///< Adds CUDA_EXT_SEM_WAIT_NODE_PARAMS values to output pub const CU_GRAPH_DEBUG_DOT_FLAGS_EXT_SEMAS_WAIT_NODE_PARAMS: CUgraphDebugDot_flags_enum = CUgraphDebugDot_flags_enum( 256, ); } impl CUgraphDebugDot_flags_enum { ///< Adds CUkernelNodeAttrValue values to output pub const CU_GRAPH_DEBUG_DOT_FLAGS_KERNEL_NODE_ATTRIBUTES: CUgraphDebugDot_flags_enum = CUgraphDebugDot_flags_enum( 512, ); } impl CUgraphDebugDot_flags_enum { ///< Adds node handles and every kernel function handle to output pub const CU_GRAPH_DEBUG_DOT_FLAGS_HANDLES: CUgraphDebugDot_flags_enum = CUgraphDebugDot_flags_enum( 1024, ); } impl CUgraphDebugDot_flags_enum { ///< Adds memory alloc node parameters to output pub const CU_GRAPH_DEBUG_DOT_FLAGS_MEM_ALLOC_NODE_PARAMS: CUgraphDebugDot_flags_enum = CUgraphDebugDot_flags_enum( 2048, ); } impl CUgraphDebugDot_flags_enum { ///< Adds memory free node parameters to output pub const CU_GRAPH_DEBUG_DOT_FLAGS_MEM_FREE_NODE_PARAMS: CUgraphDebugDot_flags_enum = CUgraphDebugDot_flags_enum( 4096, ); } impl CUgraphDebugDot_flags_enum { ///< Adds batch mem op node parameters to output pub const CU_GRAPH_DEBUG_DOT_FLAGS_BATCH_MEM_OP_NODE_PARAMS: CUgraphDebugDot_flags_enum = CUgraphDebugDot_flags_enum( 8192, ); } impl CUgraphDebugDot_flags_enum { ///< Adds edge numbering information pub const CU_GRAPH_DEBUG_DOT_FLAGS_EXTRA_TOPO_INFO: CUgraphDebugDot_flags_enum = CUgraphDebugDot_flags_enum( 16384, ); } impl CUgraphDebugDot_flags_enum { ///< Adds conditional node parameters to output pub const CU_GRAPH_DEBUG_DOT_FLAGS_CONDITIONAL_NODE_PARAMS: CUgraphDebugDot_flags_enum = CUgraphDebugDot_flags_enum( 32768, ); } #[repr(transparent)] /// The additional write options for ::cuGraphDebugDotPrint #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUgraphDebugDot_flags_enum(pub ::core::ffi::c_uint); /// The additional write options for ::cuGraphDebugDotPrint pub use self::CUgraphDebugDot_flags_enum as CUgraphDebugDot_flags; impl CUuserObject_flags_enum { ///< Indicates the destructor execution is not synchronized by any CUDA handle. pub const CU_USER_OBJECT_NO_DESTRUCTOR_SYNC: CUuserObject_flags_enum = CUuserObject_flags_enum( 1, ); } #[repr(transparent)] /// Flags for user objects for graphs #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUuserObject_flags_enum(pub ::core::ffi::c_uint); /// Flags for user objects for graphs pub use self::CUuserObject_flags_enum as CUuserObject_flags; impl CUuserObjectRetain_flags_enum { ///< Transfer references from the caller rather than creating new references. pub const CU_GRAPH_USER_OBJECT_MOVE: CUuserObjectRetain_flags_enum = CUuserObjectRetain_flags_enum( 1, ); } #[repr(transparent)] /// Flags for retaining user object references for graphs #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUuserObjectRetain_flags_enum(pub ::core::ffi::c_uint); /// Flags for retaining user object references for graphs pub use self::CUuserObjectRetain_flags_enum as CUuserObjectRetain_flags; impl CUgraphInstantiate_flags_enum { ///< Automatically free memory allocated in a graph before relaunching. pub const CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH: CUgraphInstantiate_flags_enum = CUgraphInstantiate_flags_enum( 1, ); } impl CUgraphInstantiate_flags_enum { /**< Automatically upload the graph after instantiation. Only supported by ::cuGraphInstantiateWithParams. The upload will be performed using the stream provided in \p instantiateParams.*/ pub const CUDA_GRAPH_INSTANTIATE_FLAG_UPLOAD: CUgraphInstantiate_flags_enum = CUgraphInstantiate_flags_enum( 2, ); } impl CUgraphInstantiate_flags_enum { /**< Instantiate the graph to be launchable from the device. This flag can only be used on platforms which support unified addressing. This flag cannot be used in conjunction with CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH.*/ pub const CUDA_GRAPH_INSTANTIATE_FLAG_DEVICE_LAUNCH: CUgraphInstantiate_flags_enum = CUgraphInstantiate_flags_enum( 4, ); } impl CUgraphInstantiate_flags_enum { /**< Run the graph using the per-node priority attributes rather than the priority of the stream it is launched into.*/ pub const CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY: CUgraphInstantiate_flags_enum = CUgraphInstantiate_flags_enum( 8, ); } #[repr(transparent)] /// Flags for instantiating a graph #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUgraphInstantiate_flags_enum(pub ::core::ffi::c_uint); /// Flags for instantiating a graph pub use self::CUgraphInstantiate_flags_enum as CUgraphInstantiate_flags; impl CUdeviceNumaConfig_enum { ///< The GPU is not a NUMA node pub const CU_DEVICE_NUMA_CONFIG_NONE: CUdeviceNumaConfig_enum = CUdeviceNumaConfig_enum( 0, ); } impl CUdeviceNumaConfig_enum { ///< The GPU is a NUMA node, CU_DEVICE_ATTRIBUTE_NUMA_ID contains its NUMA ID pub const CU_DEVICE_NUMA_CONFIG_NUMA_NODE: CUdeviceNumaConfig_enum = CUdeviceNumaConfig_enum( 1, ); } #[repr(transparent)] /// CUDA device NUMA configuration #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUdeviceNumaConfig_enum(pub ::core::ffi::c_uint); /// CUDA device NUMA configuration pub use self::CUdeviceNumaConfig_enum as CUdeviceNumaConfig; impl CUprocessState_enum { ///< Default process state pub const CU_PROCESS_STATE_RUNNING: CUprocessState_enum = CUprocessState_enum(0); } impl CUprocessState_enum { ///< CUDA API locks are taken so further CUDA API calls will block pub const CU_PROCESS_STATE_LOCKED: CUprocessState_enum = CUprocessState_enum(1); } impl CUprocessState_enum { ///< Application memory contents have been checkpointed and underlying allocations and device handles have been released pub const CU_PROCESS_STATE_CHECKPOINTED: CUprocessState_enum = CUprocessState_enum( 2, ); } impl CUprocessState_enum { ///< Application entered an uncorrectable error during the checkpoint/restore process pub const CU_PROCESS_STATE_FAILED: CUprocessState_enum = CUprocessState_enum(3); } #[repr(transparent)] /// CUDA Process States #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUprocessState_enum(pub ::core::ffi::c_uint); /// CUDA Process States pub use self::CUprocessState_enum as CUprocessState; /// CUDA checkpoint optional lock arguments #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUcheckpointLockArgs_st { ///< Timeout in milliseconds to attempt to lock the process, 0 indicates no timeout pub timeoutMs: ::core::ffi::c_uint, ///< Reserved for future use, must be zero pub reserved0: ::core::ffi::c_uint, ///< Reserved for future use, must be zeroed pub reserved1: [cuuint64_t; 7usize], } /// CUDA checkpoint optional lock arguments pub type CUcheckpointLockArgs = CUcheckpointLockArgs_st; /// CUDA checkpoint optional checkpoint arguments #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUcheckpointCheckpointArgs_st { ///< Reserved for future use, must be zeroed pub reserved: [cuuint64_t; 8usize], } /// CUDA checkpoint optional checkpoint arguments pub type CUcheckpointCheckpointArgs = CUcheckpointCheckpointArgs_st; /// CUDA checkpoint GPU UUID pairs for device remapping during restore #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUcheckpointGpuPair_st { ///< UUID of the GPU that was checkpointed pub oldUuid: CUuuid, ///< UUID of the GPU to restore onto pub newUuid: CUuuid, } /// CUDA checkpoint GPU UUID pairs for device remapping during restore pub type CUcheckpointGpuPair = CUcheckpointGpuPair_st; /// CUDA checkpoint optional restore arguments #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUcheckpointRestoreArgs_st { ///< Pointer to array of gpu pairs that indicate how to remap GPUs during restore pub gpuPairs: *mut CUcheckpointGpuPair, ///< Number of gpu pairs to remap pub gpuPairsCount: ::core::ffi::c_uint, ///< Reserved for future use, must be zeroed pub reserved: [::core::ffi::c_char; 44usize], ///< Reserved for future use, must be zeroed pub reserved1: cuuint64_t, } /// CUDA checkpoint optional restore arguments pub type CUcheckpointRestoreArgs = CUcheckpointRestoreArgs_st; /// CUDA checkpoint optional unlock arguments #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUcheckpointUnlockArgs_st { ///< Reserved for future use, must be zeroed pub reserved: [cuuint64_t; 8usize], } /// CUDA checkpoint optional unlock arguments pub type CUcheckpointUnlockArgs = CUcheckpointUnlockArgs_st; impl CUmoduleLoadingMode_enum { ///< Lazy Kernel Loading is not enabled pub const CU_MODULE_EAGER_LOADING: CUmoduleLoadingMode_enum = CUmoduleLoadingMode_enum( 1, ); } impl CUmoduleLoadingMode_enum { ///< Lazy Kernel Loading is enabled pub const CU_MODULE_LAZY_LOADING: CUmoduleLoadingMode_enum = CUmoduleLoadingMode_enum( 2, ); } #[repr(transparent)] /// CUDA Lazy Loading status #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUmoduleLoadingMode_enum(pub ::core::ffi::c_uint); /// CUDA Lazy Loading status pub use self::CUmoduleLoadingMode_enum as CUmoduleLoadingMode; impl CUmemDecompressAlgorithm_enum { ///< Decompression is unsupported. pub const CU_MEM_DECOMPRESS_UNSUPPORTED: CUmemDecompressAlgorithm_enum = CUmemDecompressAlgorithm_enum( 0, ); } impl CUmemDecompressAlgorithm_enum { ///< Deflate is supported. pub const CU_MEM_DECOMPRESS_ALGORITHM_DEFLATE: CUmemDecompressAlgorithm_enum = CUmemDecompressAlgorithm_enum( 1, ); } impl CUmemDecompressAlgorithm_enum { ///< Snappy is supported. pub const CU_MEM_DECOMPRESS_ALGORITHM_SNAPPY: CUmemDecompressAlgorithm_enum = CUmemDecompressAlgorithm_enum( 2, ); } impl CUmemDecompressAlgorithm_enum { ///< LZ4 is supported. pub const CU_MEM_DECOMPRESS_ALGORITHM_LZ4: CUmemDecompressAlgorithm_enum = CUmemDecompressAlgorithm_enum( 4, ); } #[repr(transparent)] /// \brief Bitmasks for CU_DEVICE_ATTRIBUTE_MEM_DECOMPRESS_ALGORITHM_MASK. #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUmemDecompressAlgorithm_enum(pub ::core::ffi::c_uint); /// \brief Bitmasks for CU_DEVICE_ATTRIBUTE_MEM_DECOMPRESS_ALGORITHM_MASK. pub use self::CUmemDecompressAlgorithm_enum as CUmemDecompressAlgorithm; /** \brief Structure describing the parameters that compose a single decompression operation.*/ #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUmemDecompressParams_st { /** The number of bytes to be read and decompressed from ::CUmemDecompressParams_st.src.*/ pub srcNumBytes: usize, /** The number of bytes that the decompression operation will be expected to write to ::CUmemDecompressParams_st.dst. This value is optional; if present, it may be used by the CUDA driver as a heuristic for scheduling the individual decompression operations.*/ pub dstNumBytes: usize, /** After the decompression operation has completed, the actual number of bytes written to ::CUmemDecompressParams.dst will be recorded as a 32-bit unsigned integer in the memory at this address.*/ pub dstActBytes: *mut cuuint32_t, /** Pointer to a buffer of at least ::CUmemDecompressParams_st.srcNumBytes compressed bytes.*/ pub src: *const ::core::ffi::c_void, /** Pointer to a buffer where the decompressed data will be written. The number of bytes written to this location will be recorded in the memory pointed to by ::CUmemDecompressParams_st.dstActBytes*/ pub dst: *mut ::core::ffi::c_void, /// The decompression algorithm to use. pub algo: CUmemDecompressAlgorithm, pub padding: [::core::ffi::c_uchar; 20usize], } /** \brief Structure describing the parameters that compose a single decompression operation.*/ pub type CUmemDecompressParams = CUmemDecompressParams_st; impl CUfunctionLoadingState_enum { pub const CU_FUNCTION_LOADING_STATE_UNLOADED: CUfunctionLoadingState_enum = CUfunctionLoadingState_enum( 0, ); } impl CUfunctionLoadingState_enum { pub const CU_FUNCTION_LOADING_STATE_LOADED: CUfunctionLoadingState_enum = CUfunctionLoadingState_enum( 1, ); } impl CUfunctionLoadingState_enum { pub const CU_FUNCTION_LOADING_STATE_MAX: CUfunctionLoadingState_enum = CUfunctionLoadingState_enum( 2, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUfunctionLoadingState_enum(pub ::core::ffi::c_uint); pub use self::CUfunctionLoadingState_enum as CUfunctionLoadingState; impl CUcoredumpSettings_enum { pub const CU_COREDUMP_ENABLE_ON_EXCEPTION: CUcoredumpSettings_enum = CUcoredumpSettings_enum( 1, ); } impl CUcoredumpSettings_enum { pub const CU_COREDUMP_TRIGGER_HOST: CUcoredumpSettings_enum = CUcoredumpSettings_enum( 2, ); } impl CUcoredumpSettings_enum { pub const CU_COREDUMP_LIGHTWEIGHT: CUcoredumpSettings_enum = CUcoredumpSettings_enum( 3, ); } impl CUcoredumpSettings_enum { pub const CU_COREDUMP_ENABLE_USER_TRIGGER: CUcoredumpSettings_enum = CUcoredumpSettings_enum( 4, ); } impl CUcoredumpSettings_enum { pub const CU_COREDUMP_FILE: CUcoredumpSettings_enum = CUcoredumpSettings_enum(5); } impl CUcoredumpSettings_enum { pub const CU_COREDUMP_PIPE: CUcoredumpSettings_enum = CUcoredumpSettings_enum(6); } impl CUcoredumpSettings_enum { pub const CU_COREDUMP_GENERATION_FLAGS: CUcoredumpSettings_enum = CUcoredumpSettings_enum( 7, ); } impl CUcoredumpSettings_enum { pub const CU_COREDUMP_MAX: CUcoredumpSettings_enum = CUcoredumpSettings_enum(8); } #[repr(transparent)] /// Flags for choosing a coredump attribute to get/set #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUcoredumpSettings_enum(pub ::core::ffi::c_uint); /// Flags for choosing a coredump attribute to get/set pub use self::CUcoredumpSettings_enum as CUcoredumpSettings; impl CUCoredumpGenerationFlags { pub const CU_COREDUMP_DEFAULT_FLAGS: CUCoredumpGenerationFlags = CUCoredumpGenerationFlags( 0, ); } impl CUCoredumpGenerationFlags { pub const CU_COREDUMP_SKIP_NONRELOCATED_ELF_IMAGES: CUCoredumpGenerationFlags = CUCoredumpGenerationFlags( 1, ); } impl CUCoredumpGenerationFlags { pub const CU_COREDUMP_SKIP_GLOBAL_MEMORY: CUCoredumpGenerationFlags = CUCoredumpGenerationFlags( 2, ); } impl CUCoredumpGenerationFlags { pub const CU_COREDUMP_SKIP_SHARED_MEMORY: CUCoredumpGenerationFlags = CUCoredumpGenerationFlags( 4, ); } impl CUCoredumpGenerationFlags { pub const CU_COREDUMP_SKIP_LOCAL_MEMORY: CUCoredumpGenerationFlags = CUCoredumpGenerationFlags( 8, ); } impl CUCoredumpGenerationFlags { pub const CU_COREDUMP_SKIP_ABORT: CUCoredumpGenerationFlags = CUCoredumpGenerationFlags( 16, ); } impl CUCoredumpGenerationFlags { pub const CU_COREDUMP_SKIP_CONSTBANK_MEMORY: CUCoredumpGenerationFlags = CUCoredumpGenerationFlags( 32, ); } impl CUCoredumpGenerationFlags { pub const CU_COREDUMP_LIGHTWEIGHT_FLAGS: CUCoredumpGenerationFlags = CUCoredumpGenerationFlags( 47, ); } #[repr(transparent)] /// Flags for controlling coredump contents #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUCoredumpGenerationFlags(pub ::core::ffi::c_uint); #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct CUdevResourceDesc_st { _unused: [u8; 0], } /** \typedef struct CUdevResourceDesc_st* CUdevResourceDesc; An opaque descriptor handle. The descriptor encapsulates multiple created and configured resources. Created via ::cuDevResourceGenerateDesc*/ pub type CUdevResourceDesc = *mut CUdevResourceDesc_st; impl CUgreenCtxCreate_flags { ///< Required. Creates a default stream to use inside the green context pub const CU_GREEN_CTX_DEFAULT_STREAM: CUgreenCtxCreate_flags = CUgreenCtxCreate_flags( 1, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUgreenCtxCreate_flags(pub ::core::ffi::c_uint); impl CUdevSmResourceSplit_flags { pub const CU_DEV_SM_RESOURCE_SPLIT_IGNORE_SM_COSCHEDULING: CUdevSmResourceSplit_flags = CUdevSmResourceSplit_flags( 1, ); } impl CUdevSmResourceSplit_flags { pub const CU_DEV_SM_RESOURCE_SPLIT_MAX_POTENTIAL_CLUSTER_SIZE: CUdevSmResourceSplit_flags = CUdevSmResourceSplit_flags( 2, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUdevSmResourceSplit_flags(pub ::core::ffi::c_uint); impl CUdevResourceType { pub const CU_DEV_RESOURCE_TYPE_INVALID: CUdevResourceType = CUdevResourceType(0); } impl CUdevResourceType { ///< Streaming multiprocessors related information pub const CU_DEV_RESOURCE_TYPE_SM: CUdevResourceType = CUdevResourceType(1); } impl CUdevResourceType { pub const CU_DEV_RESOURCE_TYPE_MAX: CUdevResourceType = CUdevResourceType(2); } #[repr(transparent)] /** \typedef enum CUdevResourceType Type of resource*/ #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUdevResourceType(pub ::core::ffi::c_uint); /** \struct CUdevSmResource Data for SM-related resources*/ #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUdevSmResource_st { ///< The amount of streaming multiprocessors available in this resource. This is an output parameter only, do not write to this field. pub smCount: ::core::ffi::c_uint, /**< The minimum number of streaming multiprocessors required to partition this resource. This is an output parameter only, do not write to this field.*/ pub minSmPartitionSize: ::core::ffi::c_uint, /**< The number of streaming multiprocessors in this resource that are guaranteed to be co-scheduled on the same GPU processing cluster. smCount is a multiple of this value. This is an output parameter only, do not write to this field.*/ pub smCoscheduledAlignment: ::core::ffi::c_uint, } /** \struct CUdevSmResource Data for SM-related resources*/ pub type CUdevSmResource = CUdevSmResource_st; /** \struct CUdevResource A tagged union describing different resources identified by the type field. This structure should not be directly modified outside of the API that created it. \code struct { CUdevResourceType type; union { CUdevSmResource sm; }; }; \endcode - If \p type is \p CU_DEV_RESOURCE_TYPE_INVALID, this resoure is not valid and cannot be further accessed. - If \p type is \p CU_DEV_RESOURCE_TYPE_SM, the ::CUdevSmResource structure \p sm is filled in. For example, \p sm.smCount will reflect the amount of streaming multiprocessors available in this resource.*/ #[repr(C)] #[derive(Copy, Clone)] pub struct CUdevResource_st { ///< Type of resource, dictates which union field was last set pub type_: CUdevResourceType, pub _internal_padding: [::core::ffi::c_uchar; 92usize], pub __bindgen_anon_1: CUdevResource_st__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] pub union CUdevResource_st__bindgen_ty_1 { ///< Resource corresponding to CU_DEV_RESOURCE_TYPE_SM \p type. pub sm: CUdevSmResource, pub _oversize: [::core::ffi::c_uchar; 48usize], } /** \struct CUdevResource A tagged union describing different resources identified by the type field. This structure should not be directly modified outside of the API that created it. \code struct { CUdevResourceType type; union { CUdevSmResource sm; }; }; \endcode - If \p type is \p CU_DEV_RESOURCE_TYPE_INVALID, this resoure is not valid and cannot be further accessed. - If \p type is \p CU_DEV_RESOURCE_TYPE_SM, the ::CUdevSmResource structure \p sm is filled in. For example, \p sm.smCount will reflect the amount of streaming multiprocessors available in this resource.*/ pub type CUdevResource_v1 = CUdevResource_st; /** \struct CUdevResource A tagged union describing different resources identified by the type field. This structure should not be directly modified outside of the API that created it. \code struct { CUdevResourceType type; union { CUdevSmResource sm; }; }; \endcode - If \p type is \p CU_DEV_RESOURCE_TYPE_INVALID, this resoure is not valid and cannot be further accessed. - If \p type is \p CU_DEV_RESOURCE_TYPE_SM, the ::CUdevSmResource structure \p sm is filled in. For example, \p sm.smCount will reflect the amount of streaming multiprocessors available in this resource.*/ pub type CUdevResource = CUdevResource_v1; impl CUlogLevel_enum { pub const CU_LOG_LEVEL_ERROR: CUlogLevel_enum = CUlogLevel_enum(0); } impl CUlogLevel_enum { pub const CU_LOG_LEVEL_WARNING: CUlogLevel_enum = CUlogLevel_enum(1); } #[repr(transparent)] /** \defgroup CUDA_LOGS Error Log Management Functions ___MANBRIEF___ error log management functions for the low-level CUDA API (___CURRENT_FILE___) ___ENDMANBRIEF___ This section describes the error log management functions of the low-level CUDA driver application programming interface. @{*/ #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUlogLevel_enum(pub ::core::ffi::c_uint); /** \defgroup CUDA_LOGS Error Log Management Functions ___MANBRIEF___ error log management functions for the low-level CUDA API (___CURRENT_FILE___) ___ENDMANBRIEF___ This section describes the error log management functions of the low-level CUDA driver application programming interface. @{*/ pub use self::CUlogLevel_enum as CUlogLevel; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct CUlogsCallbackEntry_st { _unused: [u8; 0], } pub type CUlogsCallbackHandle = *mut CUlogsCallbackEntry_st; pub type CUlogsCallback = ::core::option::Option< unsafe extern "system" fn( data: *mut ::core::ffi::c_void, logLevel: CUlogLevel, message: *mut ::core::ffi::c_char, length: usize, ), >; pub type CUlogIterator = ::core::ffi::c_uint; #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUdeviceptr_v1(pub ::core::ffi::c_uint); #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_MEMCPY2D_v1_st { ///< Source X in bytes pub srcXInBytes: ::core::ffi::c_uint, ///< Source Y pub srcY: ::core::ffi::c_uint, ///< Source memory type (host, device, array) pub srcMemoryType: CUmemorytype, ///< Source host pointer pub srcHost: *const ::core::ffi::c_void, ///< Source device pointer pub srcDevice: CUdeviceptr_v1, ///< Source array reference pub srcArray: CUarray, ///< Source pitch (ignored when src is array) pub srcPitch: ::core::ffi::c_uint, ///< Destination X in bytes pub dstXInBytes: ::core::ffi::c_uint, ///< Destination Y pub dstY: ::core::ffi::c_uint, ///< Destination memory type (host, device, array) pub dstMemoryType: CUmemorytype, ///< Destination host pointer pub dstHost: *mut ::core::ffi::c_void, ///< Destination device pointer pub dstDevice: CUdeviceptr_v1, ///< Destination array reference pub dstArray: CUarray, ///< Destination pitch (ignored when dst is array) pub dstPitch: ::core::ffi::c_uint, ///< Width of 2D memory copy in bytes pub WidthInBytes: ::core::ffi::c_uint, ///< Height of 2D memory copy pub Height: ::core::ffi::c_uint, } pub type CUDA_MEMCPY2D_v1 = CUDA_MEMCPY2D_v1_st; #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_MEMCPY3D_v1_st { ///< Source X in bytes pub srcXInBytes: ::core::ffi::c_uint, ///< Source Y pub srcY: ::core::ffi::c_uint, ///< Source Z pub srcZ: ::core::ffi::c_uint, ///< Source LOD pub srcLOD: ::core::ffi::c_uint, ///< Source memory type (host, device, array) pub srcMemoryType: CUmemorytype, ///< Source host pointer pub srcHost: *const ::core::ffi::c_void, ///< Source device pointer pub srcDevice: CUdeviceptr_v1, ///< Source array reference pub srcArray: CUarray, ///< Must be NULL pub reserved0: *mut ::core::ffi::c_void, ///< Source pitch (ignored when src is array) pub srcPitch: ::core::ffi::c_uint, ///< Source height (ignored when src is array; may be 0 if Depth==1) pub srcHeight: ::core::ffi::c_uint, ///< Destination X in bytes pub dstXInBytes: ::core::ffi::c_uint, ///< Destination Y pub dstY: ::core::ffi::c_uint, ///< Destination Z pub dstZ: ::core::ffi::c_uint, ///< Destination LOD pub dstLOD: ::core::ffi::c_uint, ///< Destination memory type (host, device, array) pub dstMemoryType: CUmemorytype, ///< Destination host pointer pub dstHost: *mut ::core::ffi::c_void, ///< Destination device pointer pub dstDevice: CUdeviceptr_v1, ///< Destination array reference pub dstArray: CUarray, ///< Must be NULL pub reserved1: *mut ::core::ffi::c_void, ///< Destination pitch (ignored when dst is array) pub dstPitch: ::core::ffi::c_uint, ///< Destination height (ignored when dst is array; may be 0 if Depth==1) pub dstHeight: ::core::ffi::c_uint, ///< Width of 3D memory copy in bytes pub WidthInBytes: ::core::ffi::c_uint, ///< Height of 3D memory copy pub Height: ::core::ffi::c_uint, ///< Depth of 3D memory copy pub Depth: ::core::ffi::c_uint, } pub type CUDA_MEMCPY3D_v1 = CUDA_MEMCPY3D_v1_st; #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_ARRAY_DESCRIPTOR_v1_st { ///< Width of array pub Width: ::core::ffi::c_uint, ///< Height of array pub Height: ::core::ffi::c_uint, ///< Array format pub Format: CUarray_format, ///< Channels per array element pub NumChannels: ::core::ffi::c_uint, } pub type CUDA_ARRAY_DESCRIPTOR_v1 = CUDA_ARRAY_DESCRIPTOR_v1_st; #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUDA_ARRAY3D_DESCRIPTOR_v1_st { ///< Width of 3D array pub Width: ::core::ffi::c_uint, ///< Height of 3D array pub Height: ::core::ffi::c_uint, ///< Depth of 3D array pub Depth: ::core::ffi::c_uint, ///< Array format pub Format: CUarray_format, ///< Channels per array element pub NumChannels: ::core::ffi::c_uint, ///< Flags pub Flags: ::core::ffi::c_uint, } pub type CUDA_ARRAY3D_DESCRIPTOR_v1 = CUDA_ARRAY3D_DESCRIPTOR_v1_st; impl CUoutput_mode_enum { ///< Output mode Key-Value pair format. pub const CU_OUT_KEY_VALUE_PAIR: CUoutput_mode_enum = CUoutput_mode_enum(0); } impl CUoutput_mode_enum { ///< Output mode Comma separated values format. pub const CU_OUT_CSV: CUoutput_mode_enum = CUoutput_mode_enum(1); } #[repr(transparent)] /// Profiler Output Modes #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUoutput_mode_enum(pub ::core::ffi::c_uint); /// Profiler Output Modes pub use self::CUoutput_mode_enum as CUoutput_mode; pub type GLenum = ::core::ffi::c_uint; pub type GLuint = ::core::ffi::c_uint; pub type khronos_int32_t = i32; impl CUGLDeviceList_enum { ///< The CUDA devices for all GPUs used by the current OpenGL context pub const CU_GL_DEVICE_LIST_ALL: CUGLDeviceList_enum = CUGLDeviceList_enum(1); } impl CUGLDeviceList_enum { ///< The CUDA devices for the GPUs used by the current OpenGL context in its currently rendering frame pub const CU_GL_DEVICE_LIST_CURRENT_FRAME: CUGLDeviceList_enum = CUGLDeviceList_enum( 2, ); } impl CUGLDeviceList_enum { ///< The CUDA devices for the GPUs to be used by the current OpenGL context in the next frame pub const CU_GL_DEVICE_LIST_NEXT_FRAME: CUGLDeviceList_enum = CUGLDeviceList_enum(3); } #[repr(transparent)] /// CUDA devices corresponding to an OpenGL device #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUGLDeviceList_enum(pub ::core::ffi::c_uint); /// CUDA devices corresponding to an OpenGL device pub use self::CUGLDeviceList_enum as CUGLDeviceList; impl CUGLmap_flags_enum { pub const CU_GL_MAP_RESOURCE_FLAGS_NONE: CUGLmap_flags_enum = CUGLmap_flags_enum(0); } impl CUGLmap_flags_enum { pub const CU_GL_MAP_RESOURCE_FLAGS_READ_ONLY: CUGLmap_flags_enum = CUGLmap_flags_enum( 1, ); } impl CUGLmap_flags_enum { pub const CU_GL_MAP_RESOURCE_FLAGS_WRITE_DISCARD: CUGLmap_flags_enum = CUGLmap_flags_enum( 2, ); } #[repr(transparent)] /// Flags to map or unmap a resource #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUGLmap_flags_enum(pub ::core::ffi::c_uint); /// Flags to map or unmap a resource pub use self::CUGLmap_flags_enum as CUGLmap_flags; pub type EGLint = khronos_int32_t; pub type EGLSyncKHR = *mut ::core::ffi::c_void; pub type EGLImageKHR = *mut ::core::ffi::c_void; pub type EGLStreamKHR = *mut ::core::ffi::c_void; impl CUeglFrameType_enum { ///< Frame type CUDA array pub const CU_EGL_FRAME_TYPE_ARRAY: CUeglFrameType_enum = CUeglFrameType_enum(0); } impl CUeglFrameType_enum { ///< Frame type pointer pub const CU_EGL_FRAME_TYPE_PITCH: CUeglFrameType_enum = CUeglFrameType_enum(1); } #[repr(transparent)] /// CUDA EglFrame type - array or pointer #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUeglFrameType_enum(pub ::core::ffi::c_uint); /// CUDA EglFrame type - array or pointer pub use self::CUeglFrameType_enum as CUeglFrameType; impl CUeglResourceLocationFlags_enum { ///< Resource location sysmem pub const CU_EGL_RESOURCE_LOCATION_SYSMEM: CUeglResourceLocationFlags_enum = CUeglResourceLocationFlags_enum( 0, ); } impl CUeglResourceLocationFlags_enum { ///< Resource location vidmem pub const CU_EGL_RESOURCE_LOCATION_VIDMEM: CUeglResourceLocationFlags_enum = CUeglResourceLocationFlags_enum( 1, ); } #[repr(transparent)] /** Resource location flags- sysmem or vidmem For CUDA context on iGPU, since video and system memory are equivalent - these flags will not have an effect on the execution. For CUDA context on dGPU, applications can use the flag ::CUeglResourceLocationFlags to give a hint about the desired location. ::CU_EGL_RESOURCE_LOCATION_SYSMEM - the frame data is made resident on the system memory to be accessed by CUDA. ::CU_EGL_RESOURCE_LOCATION_VIDMEM - the frame data is made resident on the dedicated video memory to be accessed by CUDA. There may be an additional latency due to new allocation and data migration, if the frame is produced on a different memory. */ #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUeglResourceLocationFlags_enum(pub ::core::ffi::c_uint); /** Resource location flags- sysmem or vidmem For CUDA context on iGPU, since video and system memory are equivalent - these flags will not have an effect on the execution. For CUDA context on dGPU, applications can use the flag ::CUeglResourceLocationFlags to give a hint about the desired location. ::CU_EGL_RESOURCE_LOCATION_SYSMEM - the frame data is made resident on the system memory to be accessed by CUDA. ::CU_EGL_RESOURCE_LOCATION_VIDMEM - the frame data is made resident on the dedicated video memory to be accessed by CUDA. There may be an additional latency due to new allocation and data migration, if the frame is produced on a different memory. */ pub use self::CUeglResourceLocationFlags_enum as CUeglResourceLocationFlags; impl CUeglColorFormat_enum { ///< Y, U, V in three surfaces, each in a separate surface, U/V width = 1/2 Y width, U/V height = 1/2 Y height. pub const CU_EGL_COLOR_FORMAT_YUV420_PLANAR: CUeglColorFormat_enum = CUeglColorFormat_enum( 0, ); } impl CUeglColorFormat_enum { ///< Y, UV in two surfaces (UV as one surface) with VU byte ordering, width, height ratio same as YUV420Planar. pub const CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR: CUeglColorFormat_enum = CUeglColorFormat_enum( 1, ); } impl CUeglColorFormat_enum { ///< Y, U, V each in a separate surface, U/V width = 1/2 Y width, U/V height = Y height. pub const CU_EGL_COLOR_FORMAT_YUV422_PLANAR: CUeglColorFormat_enum = CUeglColorFormat_enum( 2, ); } impl CUeglColorFormat_enum { ///< Y, UV in two surfaces with VU byte ordering, width, height ratio same as YUV422Planar. pub const CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR: CUeglColorFormat_enum = CUeglColorFormat_enum( 3, ); } impl CUeglColorFormat_enum { ///< R/G/B three channels in one surface with BGR byte ordering. Only pitch linear format supported. pub const CU_EGL_COLOR_FORMAT_RGB: CUeglColorFormat_enum = CUeglColorFormat_enum(4); } impl CUeglColorFormat_enum { ///< R/G/B three channels in one surface with RGB byte ordering. Only pitch linear format supported. pub const CU_EGL_COLOR_FORMAT_BGR: CUeglColorFormat_enum = CUeglColorFormat_enum(5); } impl CUeglColorFormat_enum { ///< R/G/B/A four channels in one surface with BGRA byte ordering. pub const CU_EGL_COLOR_FORMAT_ARGB: CUeglColorFormat_enum = CUeglColorFormat_enum(6); } impl CUeglColorFormat_enum { ///< R/G/B/A four channels in one surface with ABGR byte ordering. pub const CU_EGL_COLOR_FORMAT_RGBA: CUeglColorFormat_enum = CUeglColorFormat_enum(7); } impl CUeglColorFormat_enum { ///< single luminance channel in one surface. pub const CU_EGL_COLOR_FORMAT_L: CUeglColorFormat_enum = CUeglColorFormat_enum(8); } impl CUeglColorFormat_enum { ///< single color channel in one surface. pub const CU_EGL_COLOR_FORMAT_R: CUeglColorFormat_enum = CUeglColorFormat_enum(9); } impl CUeglColorFormat_enum { ///< Y, U, V in three surfaces, each in a separate surface, U/V width = Y width, U/V height = Y height. pub const CU_EGL_COLOR_FORMAT_YUV444_PLANAR: CUeglColorFormat_enum = CUeglColorFormat_enum( 10, ); } impl CUeglColorFormat_enum { ///< Y, UV in two surfaces (UV as one surface) with VU byte ordering, width, height ratio same as YUV444Planar. pub const CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR: CUeglColorFormat_enum = CUeglColorFormat_enum( 11, ); } impl CUeglColorFormat_enum { ///< Y, U, V in one surface, interleaved as UYVY in one channel. pub const CU_EGL_COLOR_FORMAT_YUYV_422: CUeglColorFormat_enum = CUeglColorFormat_enum( 12, ); } impl CUeglColorFormat_enum { ///< Y, U, V in one surface, interleaved as YUYV in one channel. pub const CU_EGL_COLOR_FORMAT_UYVY_422: CUeglColorFormat_enum = CUeglColorFormat_enum( 13, ); } impl CUeglColorFormat_enum { ///< R/G/B/A four channels in one surface with RGBA byte ordering. pub const CU_EGL_COLOR_FORMAT_ABGR: CUeglColorFormat_enum = CUeglColorFormat_enum( 14, ); } impl CUeglColorFormat_enum { ///< R/G/B/A four channels in one surface with ARGB byte ordering. pub const CU_EGL_COLOR_FORMAT_BGRA: CUeglColorFormat_enum = CUeglColorFormat_enum( 15, ); } impl CUeglColorFormat_enum { ///< Alpha color format - one channel in one surface. pub const CU_EGL_COLOR_FORMAT_A: CUeglColorFormat_enum = CUeglColorFormat_enum(16); } impl CUeglColorFormat_enum { ///< R/G color format - two channels in one surface with GR byte ordering pub const CU_EGL_COLOR_FORMAT_RG: CUeglColorFormat_enum = CUeglColorFormat_enum(17); } impl CUeglColorFormat_enum { ///< Y, U, V, A four channels in one surface, interleaved as VUYA. pub const CU_EGL_COLOR_FORMAT_AYUV: CUeglColorFormat_enum = CUeglColorFormat_enum( 18, ); } impl CUeglColorFormat_enum { ///< Y, VU in two surfaces (VU as one surface) with UV byte ordering, U/V width = Y width, U/V height = Y height. pub const CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR: CUeglColorFormat_enum = CUeglColorFormat_enum( 19, ); } impl CUeglColorFormat_enum { ///< Y, VU in two surfaces (VU as one surface) with UV byte ordering, U/V width = 1/2 Y width, U/V height = Y height. pub const CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR: CUeglColorFormat_enum = CUeglColorFormat_enum( 20, ); } impl CUeglColorFormat_enum { ///< Y, VU in two surfaces (VU as one surface) with UV byte ordering, U/V width = 1/2 Y width, U/V height = 1/2 Y height. pub const CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR: CUeglColorFormat_enum = CUeglColorFormat_enum( 21, ); } impl CUeglColorFormat_enum { ///< Y10, V10U10 in two surfaces (VU as one surface) with UV byte ordering, U/V width = Y width, U/V height = Y height. pub const CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR: CUeglColorFormat_enum = CUeglColorFormat_enum( 22, ); } impl CUeglColorFormat_enum { ///< Y10, V10U10 in two surfaces (VU as one surface) with UV byte ordering, U/V width = 1/2 Y width, U/V height = 1/2 Y height. pub const CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR: CUeglColorFormat_enum = CUeglColorFormat_enum( 23, ); } impl CUeglColorFormat_enum { ///< Y12, V12U12 in two surfaces (VU as one surface) with UV byte ordering, U/V width = Y width, U/V height = Y height. pub const CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR: CUeglColorFormat_enum = CUeglColorFormat_enum( 24, ); } impl CUeglColorFormat_enum { ///< Y12, V12U12 in two surfaces (VU as one surface) with UV byte ordering, U/V width = 1/2 Y width, U/V height = 1/2 Y height. pub const CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR: CUeglColorFormat_enum = CUeglColorFormat_enum( 25, ); } impl CUeglColorFormat_enum { ///< Extended Range Y, U, V in one surface, interleaved as YVYU in one channel. pub const CU_EGL_COLOR_FORMAT_VYUY_ER: CUeglColorFormat_enum = CUeglColorFormat_enum( 26, ); } impl CUeglColorFormat_enum { ///< Extended Range Y, U, V in one surface, interleaved as YUYV in one channel. pub const CU_EGL_COLOR_FORMAT_UYVY_ER: CUeglColorFormat_enum = CUeglColorFormat_enum( 27, ); } impl CUeglColorFormat_enum { ///< Extended Range Y, U, V in one surface, interleaved as UYVY in one channel. pub const CU_EGL_COLOR_FORMAT_YUYV_ER: CUeglColorFormat_enum = CUeglColorFormat_enum( 28, ); } impl CUeglColorFormat_enum { ///< Extended Range Y, U, V in one surface, interleaved as VYUY in one channel. pub const CU_EGL_COLOR_FORMAT_YVYU_ER: CUeglColorFormat_enum = CUeglColorFormat_enum( 29, ); } impl CUeglColorFormat_enum { ///< Extended Range Y, U, V three channels in one surface, interleaved as VUY. Only pitch linear format supported. pub const CU_EGL_COLOR_FORMAT_YUV_ER: CUeglColorFormat_enum = CUeglColorFormat_enum( 30, ); } impl CUeglColorFormat_enum { ///< Extended Range Y, U, V, A four channels in one surface, interleaved as AVUY. pub const CU_EGL_COLOR_FORMAT_YUVA_ER: CUeglColorFormat_enum = CUeglColorFormat_enum( 31, ); } impl CUeglColorFormat_enum { ///< Extended Range Y, U, V, A four channels in one surface, interleaved as VUYA. pub const CU_EGL_COLOR_FORMAT_AYUV_ER: CUeglColorFormat_enum = CUeglColorFormat_enum( 32, ); } impl CUeglColorFormat_enum { ///< Extended Range Y, U, V in three surfaces, U/V width = Y width, U/V height = Y height. pub const CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER: CUeglColorFormat_enum = CUeglColorFormat_enum( 33, ); } impl CUeglColorFormat_enum { ///< Extended Range Y, U, V in three surfaces, U/V width = 1/2 Y width, U/V height = Y height. pub const CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER: CUeglColorFormat_enum = CUeglColorFormat_enum( 34, ); } impl CUeglColorFormat_enum { ///< Extended Range Y, U, V in three surfaces, U/V width = 1/2 Y width, U/V height = 1/2 Y height. pub const CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER: CUeglColorFormat_enum = CUeglColorFormat_enum( 35, ); } impl CUeglColorFormat_enum { ///< Extended Range Y, UV in two surfaces (UV as one surface) with VU byte ordering, U/V width = Y width, U/V height = Y height. pub const CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER: CUeglColorFormat_enum = CUeglColorFormat_enum( 36, ); } impl CUeglColorFormat_enum { ///< Extended Range Y, UV in two surfaces (UV as one surface) with VU byte ordering, U/V width = 1/2 Y width, U/V height = Y height. pub const CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER: CUeglColorFormat_enum = CUeglColorFormat_enum( 37, ); } impl CUeglColorFormat_enum { ///< Extended Range Y, UV in two surfaces (UV as one surface) with VU byte ordering, U/V width = 1/2 Y width, U/V height = 1/2 Y height. pub const CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER: CUeglColorFormat_enum = CUeglColorFormat_enum( 38, ); } impl CUeglColorFormat_enum { ///< Extended Range Y, V, U in three surfaces, U/V width = Y width, U/V height = Y height. pub const CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER: CUeglColorFormat_enum = CUeglColorFormat_enum( 39, ); } impl CUeglColorFormat_enum { ///< Extended Range Y, V, U in three surfaces, U/V width = 1/2 Y width, U/V height = Y height. pub const CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER: CUeglColorFormat_enum = CUeglColorFormat_enum( 40, ); } impl CUeglColorFormat_enum { ///< Extended Range Y, V, U in three surfaces, U/V width = 1/2 Y width, U/V height = 1/2 Y height. pub const CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER: CUeglColorFormat_enum = CUeglColorFormat_enum( 41, ); } impl CUeglColorFormat_enum { ///< Extended Range Y, VU in two surfaces (VU as one surface) with UV byte ordering, U/V width = Y width, U/V height = Y height. pub const CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER: CUeglColorFormat_enum = CUeglColorFormat_enum( 42, ); } impl CUeglColorFormat_enum { ///< Extended Range Y, VU in two surfaces (VU as one surface) with UV byte ordering, U/V width = 1/2 Y width, U/V height = Y height. pub const CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER: CUeglColorFormat_enum = CUeglColorFormat_enum( 43, ); } impl CUeglColorFormat_enum { ///< Extended Range Y, VU in two surfaces (VU as one surface) with UV byte ordering, U/V width = 1/2 Y width, U/V height = 1/2 Y height. pub const CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER: CUeglColorFormat_enum = CUeglColorFormat_enum( 44, ); } impl CUeglColorFormat_enum { ///< Bayer format - one channel in one surface with interleaved RGGB ordering. pub const CU_EGL_COLOR_FORMAT_BAYER_RGGB: CUeglColorFormat_enum = CUeglColorFormat_enum( 45, ); } impl CUeglColorFormat_enum { ///< Bayer format - one channel in one surface with interleaved BGGR ordering. pub const CU_EGL_COLOR_FORMAT_BAYER_BGGR: CUeglColorFormat_enum = CUeglColorFormat_enum( 46, ); } impl CUeglColorFormat_enum { ///< Bayer format - one channel in one surface with interleaved GRBG ordering. pub const CU_EGL_COLOR_FORMAT_BAYER_GRBG: CUeglColorFormat_enum = CUeglColorFormat_enum( 47, ); } impl CUeglColorFormat_enum { ///< Bayer format - one channel in one surface with interleaved GBRG ordering. pub const CU_EGL_COLOR_FORMAT_BAYER_GBRG: CUeglColorFormat_enum = CUeglColorFormat_enum( 48, ); } impl CUeglColorFormat_enum { ///< Bayer10 format - one channel in one surface with interleaved RGGB ordering. Out of 16 bits, 10 bits used 6 bits No-op. pub const CU_EGL_COLOR_FORMAT_BAYER10_RGGB: CUeglColorFormat_enum = CUeglColorFormat_enum( 49, ); } impl CUeglColorFormat_enum { ///< Bayer10 format - one channel in one surface with interleaved BGGR ordering. Out of 16 bits, 10 bits used 6 bits No-op. pub const CU_EGL_COLOR_FORMAT_BAYER10_BGGR: CUeglColorFormat_enum = CUeglColorFormat_enum( 50, ); } impl CUeglColorFormat_enum { ///< Bayer10 format - one channel in one surface with interleaved GRBG ordering. Out of 16 bits, 10 bits used 6 bits No-op. pub const CU_EGL_COLOR_FORMAT_BAYER10_GRBG: CUeglColorFormat_enum = CUeglColorFormat_enum( 51, ); } impl CUeglColorFormat_enum { ///< Bayer10 format - one channel in one surface with interleaved GBRG ordering. Out of 16 bits, 10 bits used 6 bits No-op. pub const CU_EGL_COLOR_FORMAT_BAYER10_GBRG: CUeglColorFormat_enum = CUeglColorFormat_enum( 52, ); } impl CUeglColorFormat_enum { ///< Bayer12 format - one channel in one surface with interleaved RGGB ordering. Out of 16 bits, 12 bits used 4 bits No-op. pub const CU_EGL_COLOR_FORMAT_BAYER12_RGGB: CUeglColorFormat_enum = CUeglColorFormat_enum( 53, ); } impl CUeglColorFormat_enum { ///< Bayer12 format - one channel in one surface with interleaved BGGR ordering. Out of 16 bits, 12 bits used 4 bits No-op. pub const CU_EGL_COLOR_FORMAT_BAYER12_BGGR: CUeglColorFormat_enum = CUeglColorFormat_enum( 54, ); } impl CUeglColorFormat_enum { ///< Bayer12 format - one channel in one surface with interleaved GRBG ordering. Out of 16 bits, 12 bits used 4 bits No-op. pub const CU_EGL_COLOR_FORMAT_BAYER12_GRBG: CUeglColorFormat_enum = CUeglColorFormat_enum( 55, ); } impl CUeglColorFormat_enum { ///< Bayer12 format - one channel in one surface with interleaved GBRG ordering. Out of 16 bits, 12 bits used 4 bits No-op. pub const CU_EGL_COLOR_FORMAT_BAYER12_GBRG: CUeglColorFormat_enum = CUeglColorFormat_enum( 56, ); } impl CUeglColorFormat_enum { ///< Bayer14 format - one channel in one surface with interleaved RGGB ordering. Out of 16 bits, 14 bits used 2 bits No-op. pub const CU_EGL_COLOR_FORMAT_BAYER14_RGGB: CUeglColorFormat_enum = CUeglColorFormat_enum( 57, ); } impl CUeglColorFormat_enum { ///< Bayer14 format - one channel in one surface with interleaved BGGR ordering. Out of 16 bits, 14 bits used 2 bits No-op. pub const CU_EGL_COLOR_FORMAT_BAYER14_BGGR: CUeglColorFormat_enum = CUeglColorFormat_enum( 58, ); } impl CUeglColorFormat_enum { ///< Bayer14 format - one channel in one surface with interleaved GRBG ordering. Out of 16 bits, 14 bits used 2 bits No-op. pub const CU_EGL_COLOR_FORMAT_BAYER14_GRBG: CUeglColorFormat_enum = CUeglColorFormat_enum( 59, ); } impl CUeglColorFormat_enum { ///< Bayer14 format - one channel in one surface with interleaved GBRG ordering. Out of 16 bits, 14 bits used 2 bits No-op. pub const CU_EGL_COLOR_FORMAT_BAYER14_GBRG: CUeglColorFormat_enum = CUeglColorFormat_enum( 60, ); } impl CUeglColorFormat_enum { ///< Bayer20 format - one channel in one surface with interleaved RGGB ordering. Out of 32 bits, 20 bits used 12 bits No-op. pub const CU_EGL_COLOR_FORMAT_BAYER20_RGGB: CUeglColorFormat_enum = CUeglColorFormat_enum( 61, ); } impl CUeglColorFormat_enum { ///< Bayer20 format - one channel in one surface with interleaved BGGR ordering. Out of 32 bits, 20 bits used 12 bits No-op. pub const CU_EGL_COLOR_FORMAT_BAYER20_BGGR: CUeglColorFormat_enum = CUeglColorFormat_enum( 62, ); } impl CUeglColorFormat_enum { ///< Bayer20 format - one channel in one surface with interleaved GRBG ordering. Out of 32 bits, 20 bits used 12 bits No-op. pub const CU_EGL_COLOR_FORMAT_BAYER20_GRBG: CUeglColorFormat_enum = CUeglColorFormat_enum( 63, ); } impl CUeglColorFormat_enum { ///< Bayer20 format - one channel in one surface with interleaved GBRG ordering. Out of 32 bits, 20 bits used 12 bits No-op. pub const CU_EGL_COLOR_FORMAT_BAYER20_GBRG: CUeglColorFormat_enum = CUeglColorFormat_enum( 64, ); } impl CUeglColorFormat_enum { ///< Y, V, U in three surfaces, each in a separate surface, U/V width = Y width, U/V height = Y height. pub const CU_EGL_COLOR_FORMAT_YVU444_PLANAR: CUeglColorFormat_enum = CUeglColorFormat_enum( 65, ); } impl CUeglColorFormat_enum { ///< Y, V, U in three surfaces, each in a separate surface, U/V width = 1/2 Y width, U/V height = Y height. pub const CU_EGL_COLOR_FORMAT_YVU422_PLANAR: CUeglColorFormat_enum = CUeglColorFormat_enum( 66, ); } impl CUeglColorFormat_enum { ///< Y, V, U in three surfaces, each in a separate surface, U/V width = 1/2 Y width, U/V height = 1/2 Y height. pub const CU_EGL_COLOR_FORMAT_YVU420_PLANAR: CUeglColorFormat_enum = CUeglColorFormat_enum( 67, ); } impl CUeglColorFormat_enum { ///< Nvidia proprietary Bayer ISP format - one channel in one surface with interleaved RGGB ordering and mapped to opaque integer datatype. pub const CU_EGL_COLOR_FORMAT_BAYER_ISP_RGGB: CUeglColorFormat_enum = CUeglColorFormat_enum( 68, ); } impl CUeglColorFormat_enum { ///< Nvidia proprietary Bayer ISP format - one channel in one surface with interleaved BGGR ordering and mapped to opaque integer datatype. pub const CU_EGL_COLOR_FORMAT_BAYER_ISP_BGGR: CUeglColorFormat_enum = CUeglColorFormat_enum( 69, ); } impl CUeglColorFormat_enum { ///< Nvidia proprietary Bayer ISP format - one channel in one surface with interleaved GRBG ordering and mapped to opaque integer datatype. pub const CU_EGL_COLOR_FORMAT_BAYER_ISP_GRBG: CUeglColorFormat_enum = CUeglColorFormat_enum( 70, ); } impl CUeglColorFormat_enum { ///< Nvidia proprietary Bayer ISP format - one channel in one surface with interleaved GBRG ordering and mapped to opaque integer datatype. pub const CU_EGL_COLOR_FORMAT_BAYER_ISP_GBRG: CUeglColorFormat_enum = CUeglColorFormat_enum( 71, ); } impl CUeglColorFormat_enum { ///< Bayer format - one channel in one surface with interleaved BCCR ordering. pub const CU_EGL_COLOR_FORMAT_BAYER_BCCR: CUeglColorFormat_enum = CUeglColorFormat_enum( 72, ); } impl CUeglColorFormat_enum { ///< Bayer format - one channel in one surface with interleaved RCCB ordering. pub const CU_EGL_COLOR_FORMAT_BAYER_RCCB: CUeglColorFormat_enum = CUeglColorFormat_enum( 73, ); } impl CUeglColorFormat_enum { ///< Bayer format - one channel in one surface with interleaved CRBC ordering. pub const CU_EGL_COLOR_FORMAT_BAYER_CRBC: CUeglColorFormat_enum = CUeglColorFormat_enum( 74, ); } impl CUeglColorFormat_enum { ///< Bayer format - one channel in one surface with interleaved CBRC ordering. pub const CU_EGL_COLOR_FORMAT_BAYER_CBRC: CUeglColorFormat_enum = CUeglColorFormat_enum( 75, ); } impl CUeglColorFormat_enum { ///< Bayer10 format - one channel in one surface with interleaved CCCC ordering. Out of 16 bits, 10 bits used 6 bits No-op. pub const CU_EGL_COLOR_FORMAT_BAYER10_CCCC: CUeglColorFormat_enum = CUeglColorFormat_enum( 76, ); } impl CUeglColorFormat_enum { ///< Bayer12 format - one channel in one surface with interleaved BCCR ordering. Out of 16 bits, 12 bits used 4 bits No-op. pub const CU_EGL_COLOR_FORMAT_BAYER12_BCCR: CUeglColorFormat_enum = CUeglColorFormat_enum( 77, ); } impl CUeglColorFormat_enum { ///< Bayer12 format - one channel in one surface with interleaved RCCB ordering. Out of 16 bits, 12 bits used 4 bits No-op. pub const CU_EGL_COLOR_FORMAT_BAYER12_RCCB: CUeglColorFormat_enum = CUeglColorFormat_enum( 78, ); } impl CUeglColorFormat_enum { ///< Bayer12 format - one channel in one surface with interleaved CRBC ordering. Out of 16 bits, 12 bits used 4 bits No-op. pub const CU_EGL_COLOR_FORMAT_BAYER12_CRBC: CUeglColorFormat_enum = CUeglColorFormat_enum( 79, ); } impl CUeglColorFormat_enum { ///< Bayer12 format - one channel in one surface with interleaved CBRC ordering. Out of 16 bits, 12 bits used 4 bits No-op. pub const CU_EGL_COLOR_FORMAT_BAYER12_CBRC: CUeglColorFormat_enum = CUeglColorFormat_enum( 80, ); } impl CUeglColorFormat_enum { ///< Bayer12 format - one channel in one surface with interleaved CCCC ordering. Out of 16 bits, 12 bits used 4 bits No-op. pub const CU_EGL_COLOR_FORMAT_BAYER12_CCCC: CUeglColorFormat_enum = CUeglColorFormat_enum( 81, ); } impl CUeglColorFormat_enum { ///< Color format for single Y plane. pub const CU_EGL_COLOR_FORMAT_Y: CUeglColorFormat_enum = CUeglColorFormat_enum(82); } impl CUeglColorFormat_enum { ///< Y, UV in two surfaces (UV as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. pub const CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020: CUeglColorFormat_enum = CUeglColorFormat_enum( 83, ); } impl CUeglColorFormat_enum { ///< Y, VU in two surfaces (VU as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. pub const CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020: CUeglColorFormat_enum = CUeglColorFormat_enum( 84, ); } impl CUeglColorFormat_enum { ///< Y, U, V each in a separate surface, U/V width = 1/2 Y width, U/V height= 1/2 Y height. pub const CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020: CUeglColorFormat_enum = CUeglColorFormat_enum( 85, ); } impl CUeglColorFormat_enum { /**< Y, V, U each in a separate surface, U/V width = 1/2 Y width, U/V height = 1/2 Y height.*/ pub const CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020: CUeglColorFormat_enum = CUeglColorFormat_enum( 86, ); } impl CUeglColorFormat_enum { ///< Y, UV in two surfaces (UV as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. pub const CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709: CUeglColorFormat_enum = CUeglColorFormat_enum( 87, ); } impl CUeglColorFormat_enum { ///< Y, VU in two surfaces (VU as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. pub const CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709: CUeglColorFormat_enum = CUeglColorFormat_enum( 88, ); } impl CUeglColorFormat_enum { /**< Y, U, V each in a separate surface, U/V width = 1/2 Y width, U/V height = 1/2 Y height.*/ pub const CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709: CUeglColorFormat_enum = CUeglColorFormat_enum( 89, ); } impl CUeglColorFormat_enum { ///< Y, V, U each in a separate surface, U/V width = 1/2 Y width, U/V height = 1/2 Y height. pub const CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709: CUeglColorFormat_enum = CUeglColorFormat_enum( 90, ); } impl CUeglColorFormat_enum { ///< Y10, V10U10 in two surfaces (VU as one surface), U/V width = 1/2 Y width, U/V height = 1/2 Y height. pub const CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709: CUeglColorFormat_enum = CUeglColorFormat_enum( 91, ); } impl CUeglColorFormat_enum { ///< Y10, V10U10 in two surfaces (VU as one surface), U/V width = 1/2 Y width, U/V height = 1/2 Y height. pub const CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020: CUeglColorFormat_enum = CUeglColorFormat_enum( 92, ); } impl CUeglColorFormat_enum { ///< Y10, V10U10 in two surfaces(VU as one surface) U/V width = 1/2 Y width, U/V height = Y height. pub const CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020: CUeglColorFormat_enum = CUeglColorFormat_enum( 93, ); } impl CUeglColorFormat_enum { ///< Y10, V10U10 in two surfaces(VU as one surface) U/V width = 1/2 Y width, U/V height = Y height. pub const CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR: CUeglColorFormat_enum = CUeglColorFormat_enum( 94, ); } impl CUeglColorFormat_enum { ///< Y10, V10U10 in two surfaces(VU as one surface) U/V width = 1/2 Y width, U/V height = Y height. pub const CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709: CUeglColorFormat_enum = CUeglColorFormat_enum( 95, ); } impl CUeglColorFormat_enum { ///< Extended Range Color format for single Y plane. pub const CU_EGL_COLOR_FORMAT_Y_ER: CUeglColorFormat_enum = CUeglColorFormat_enum( 96, ); } impl CUeglColorFormat_enum { ///< Extended Range Color format for single Y plane. pub const CU_EGL_COLOR_FORMAT_Y_709_ER: CUeglColorFormat_enum = CUeglColorFormat_enum( 97, ); } impl CUeglColorFormat_enum { ///< Extended Range Color format for single Y10 plane. pub const CU_EGL_COLOR_FORMAT_Y10_ER: CUeglColorFormat_enum = CUeglColorFormat_enum( 98, ); } impl CUeglColorFormat_enum { ///< Extended Range Color format for single Y10 plane. pub const CU_EGL_COLOR_FORMAT_Y10_709_ER: CUeglColorFormat_enum = CUeglColorFormat_enum( 99, ); } impl CUeglColorFormat_enum { ///< Extended Range Color format for single Y12 plane. pub const CU_EGL_COLOR_FORMAT_Y12_ER: CUeglColorFormat_enum = CUeglColorFormat_enum( 100, ); } impl CUeglColorFormat_enum { ///< Extended Range Color format for single Y12 plane. pub const CU_EGL_COLOR_FORMAT_Y12_709_ER: CUeglColorFormat_enum = CUeglColorFormat_enum( 101, ); } impl CUeglColorFormat_enum { ///< Y, U, V, A four channels in one surface, interleaved as AVUY. pub const CU_EGL_COLOR_FORMAT_YUVA: CUeglColorFormat_enum = CUeglColorFormat_enum( 102, ); } impl CUeglColorFormat_enum { ///< Y, U, V three channels in one surface, interleaved as VUY. Only pitch linear format supported. pub const CU_EGL_COLOR_FORMAT_YUV: CUeglColorFormat_enum = CUeglColorFormat_enum( 103, ); } impl CUeglColorFormat_enum { ///< Y, U, V in one surface, interleaved as YVYU in one channel. pub const CU_EGL_COLOR_FORMAT_YVYU: CUeglColorFormat_enum = CUeglColorFormat_enum( 104, ); } impl CUeglColorFormat_enum { ///< Y, U, V in one surface, interleaved as VYUY in one channel. pub const CU_EGL_COLOR_FORMAT_VYUY: CUeglColorFormat_enum = CUeglColorFormat_enum( 105, ); } impl CUeglColorFormat_enum { ///< Extended Range Y10, V10U10 in two surfaces(VU as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. pub const CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER: CUeglColorFormat_enum = CUeglColorFormat_enum( 106, ); } impl CUeglColorFormat_enum { ///< Extended Range Y10, V10U10 in two surfaces(VU as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. pub const CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER: CUeglColorFormat_enum = CUeglColorFormat_enum( 107, ); } impl CUeglColorFormat_enum { ///< Extended Range Y10, V10U10 in two surfaces (VU as one surface) U/V width = Y width, U/V height = Y height. pub const CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER: CUeglColorFormat_enum = CUeglColorFormat_enum( 108, ); } impl CUeglColorFormat_enum { ///< Extended Range Y10, V10U10 in two surfaces (VU as one surface) U/V width = Y width, U/V height = Y height. pub const CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER: CUeglColorFormat_enum = CUeglColorFormat_enum( 109, ); } impl CUeglColorFormat_enum { ///< Extended Range Y12, V12U12 in two surfaces (VU as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. pub const CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER: CUeglColorFormat_enum = CUeglColorFormat_enum( 110, ); } impl CUeglColorFormat_enum { ///< Extended Range Y12, V12U12 in two surfaces (VU as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. pub const CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER: CUeglColorFormat_enum = CUeglColorFormat_enum( 111, ); } impl CUeglColorFormat_enum { ///< Extended Range Y12, V12U12 in two surfaces (VU as one surface) U/V width = Y width, U/V height = Y height. pub const CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER: CUeglColorFormat_enum = CUeglColorFormat_enum( 112, ); } impl CUeglColorFormat_enum { ///< Extended Range Y12, V12U12 in two surfaces (VU as one surface) U/V width = Y width, U/V height = Y height. pub const CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER: CUeglColorFormat_enum = CUeglColorFormat_enum( 113, ); } impl CUeglColorFormat_enum { ///< Y, U, V in one surface, interleaved as UYVY in one channel. pub const CU_EGL_COLOR_FORMAT_UYVY_709: CUeglColorFormat_enum = CUeglColorFormat_enum( 114, ); } impl CUeglColorFormat_enum { ///< Extended Range Y, U, V in one surface, interleaved as UYVY in one channel. pub const CU_EGL_COLOR_FORMAT_UYVY_709_ER: CUeglColorFormat_enum = CUeglColorFormat_enum( 115, ); } impl CUeglColorFormat_enum { ///< Y, U, V in one surface, interleaved as UYVY in one channel. pub const CU_EGL_COLOR_FORMAT_UYVY_2020: CUeglColorFormat_enum = CUeglColorFormat_enum( 116, ); } impl CUeglColorFormat_enum { pub const CU_EGL_COLOR_FORMAT_MAX: CUeglColorFormat_enum = CUeglColorFormat_enum( 117, ); } #[repr(transparent)] /** CUDA EGL Color Format - The different planar and multiplanar formats currently supported for CUDA_EGL interops. Three channel formats are currently not supported for ::CU_EGL_FRAME_TYPE_ARRAY*/ #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct CUeglColorFormat_enum(pub ::core::ffi::c_uint); /** CUDA EGL Color Format - The different planar and multiplanar formats currently supported for CUDA_EGL interops. Three channel formats are currently not supported for ::CU_EGL_FRAME_TYPE_ARRAY*/ pub use self::CUeglColorFormat_enum as CUeglColorFormat; /** CUDA EGLFrame structure Descriptor - structure defining one frame of EGL. Each frame may contain one or more planes depending on whether the surface * is Multiplanar or not.*/ #[repr(C)] #[derive(Copy, Clone)] pub struct CUeglFrame_st { pub frame: CUeglFrame_st__bindgen_ty_1, ///< Width of first plane pub width: ::core::ffi::c_uint, ///< Height of first plane pub height: ::core::ffi::c_uint, ///< Depth of first plane pub depth: ::core::ffi::c_uint, ///< Pitch of first plane pub pitch: ::core::ffi::c_uint, ///< Number of planes pub planeCount: ::core::ffi::c_uint, ///< Number of channels for the plane pub numChannels: ::core::ffi::c_uint, ///< Array or Pitch pub frameType: CUeglFrameType, ///< CUDA EGL Color Format pub eglColorFormat: CUeglColorFormat, ///< CUDA Array Format pub cuFormat: CUarray_format, } #[repr(C)] #[derive(Copy, Clone)] pub union CUeglFrame_st__bindgen_ty_1 { ///< Array of CUarray corresponding to each plane pub pArray: [CUarray; 3usize], ///< Array of Pointers corresponding to each plane pub pPitch: [*mut ::core::ffi::c_void; 3usize], } /** CUDA EGLFrame structure Descriptor - structure defining one frame of EGL. Each frame may contain one or more planes depending on whether the surface * is Multiplanar or not.*/ pub type CUeglFrame_v1 = CUeglFrame_st; /** CUDA EGLFrame structure Descriptor - structure defining one frame of EGL. Each frame may contain one or more planes depending on whether the surface * is Multiplanar or not.*/ pub type CUeglFrame = CUeglFrame_v1; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct CUeglStreamConnection_st { _unused: [u8; 0], } /// CUDA EGLSream Connection pub type CUeglStreamConnection = *mut CUeglStreamConnection_st; impl VdpStatus { pub const VDP_STATUS_OK: VdpStatus = VdpStatus(0); } impl VdpStatus { pub const VDP_STATUS_NO_IMPLEMENTATION: VdpStatus = VdpStatus(1); } impl VdpStatus { pub const VDP_STATUS_DISPLAY_PREEMPTED: VdpStatus = VdpStatus(2); } impl VdpStatus { pub const VDP_STATUS_INVALID_HANDLE: VdpStatus = VdpStatus(3); } impl VdpStatus { pub const VDP_STATUS_INVALID_POINTER: VdpStatus = VdpStatus(4); } impl VdpStatus { pub const VDP_STATUS_INVALID_CHROMA_TYPE: VdpStatus = VdpStatus(5); } impl VdpStatus { pub const VDP_STATUS_INVALID_Y_CB_CR_FORMAT: VdpStatus = VdpStatus(6); } impl VdpStatus { pub const VDP_STATUS_INVALID_RGBA_FORMAT: VdpStatus = VdpStatus(7); } impl VdpStatus { pub const VDP_STATUS_INVALID_INDEXED_FORMAT: VdpStatus = VdpStatus(8); } impl VdpStatus { pub const VDP_STATUS_INVALID_COLOR_STANDARD: VdpStatus = VdpStatus(9); } impl VdpStatus { pub const VDP_STATUS_INVALID_COLOR_TABLE_FORMAT: VdpStatus = VdpStatus(10); } impl VdpStatus { pub const VDP_STATUS_INVALID_BLEND_FACTOR: VdpStatus = VdpStatus(11); } impl VdpStatus { pub const VDP_STATUS_INVALID_BLEND_EQUATION: VdpStatus = VdpStatus(12); } impl VdpStatus { pub const VDP_STATUS_INVALID_FLAG: VdpStatus = VdpStatus(13); } impl VdpStatus { pub const VDP_STATUS_INVALID_DECODER_PROFILE: VdpStatus = VdpStatus(14); } impl VdpStatus { pub const VDP_STATUS_INVALID_VIDEO_MIXER_FEATURE: VdpStatus = VdpStatus(15); } impl VdpStatus { pub const VDP_STATUS_INVALID_VIDEO_MIXER_PARAMETER: VdpStatus = VdpStatus(16); } impl VdpStatus { pub const VDP_STATUS_INVALID_VIDEO_MIXER_ATTRIBUTE: VdpStatus = VdpStatus(17); } impl VdpStatus { pub const VDP_STATUS_INVALID_VIDEO_MIXER_PICTURE_STRUCTURE: VdpStatus = VdpStatus( 18, ); } impl VdpStatus { pub const VDP_STATUS_INVALID_FUNC_ID: VdpStatus = VdpStatus(19); } impl VdpStatus { pub const VDP_STATUS_INVALID_SIZE: VdpStatus = VdpStatus(20); } impl VdpStatus { pub const VDP_STATUS_INVALID_VALUE: VdpStatus = VdpStatus(21); } impl VdpStatus { pub const VDP_STATUS_INVALID_STRUCT_VERSION: VdpStatus = VdpStatus(22); } impl VdpStatus { pub const VDP_STATUS_RESOURCES: VdpStatus = VdpStatus(23); } impl VdpStatus { pub const VDP_STATUS_HANDLE_DEVICE_MISMATCH: VdpStatus = VdpStatus(24); } impl VdpStatus { pub const VDP_STATUS_ERROR: VdpStatus = VdpStatus(25); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct VdpStatus(pub ::core::ffi::c_uint); pub type VdpDevice = u32; pub type VdpVideoSurface = u32; pub type VdpOutputSurface = u32; pub type VdpFuncId = u32; pub type VdpGetProcAddress = ::core::option::Option< unsafe extern "system" fn( device: VdpDevice, function_id: VdpFuncId, function_pointer: *mut *mut ::core::ffi::c_void, ) -> VdpStatus, >; impl cudaDataType_t { pub const CUDA_R_16F: cudaDataType_t = cudaDataType_t(2); } impl cudaDataType_t { pub const CUDA_C_16F: cudaDataType_t = cudaDataType_t(6); } impl cudaDataType_t { pub const CUDA_R_16BF: cudaDataType_t = cudaDataType_t(14); } impl cudaDataType_t { pub const CUDA_C_16BF: cudaDataType_t = cudaDataType_t(15); } impl cudaDataType_t { pub const CUDA_R_32F: cudaDataType_t = cudaDataType_t(0); } impl cudaDataType_t { pub const CUDA_C_32F: cudaDataType_t = cudaDataType_t(4); } impl cudaDataType_t { pub const CUDA_R_64F: cudaDataType_t = cudaDataType_t(1); } impl cudaDataType_t { pub const CUDA_C_64F: cudaDataType_t = cudaDataType_t(5); } impl cudaDataType_t { pub const CUDA_R_4I: cudaDataType_t = cudaDataType_t(16); } impl cudaDataType_t { pub const CUDA_C_4I: cudaDataType_t = cudaDataType_t(17); } impl cudaDataType_t { pub const CUDA_R_4U: cudaDataType_t = cudaDataType_t(18); } impl cudaDataType_t { pub const CUDA_C_4U: cudaDataType_t = cudaDataType_t(19); } impl cudaDataType_t { pub const CUDA_R_8I: cudaDataType_t = cudaDataType_t(3); } impl cudaDataType_t { pub const CUDA_C_8I: cudaDataType_t = cudaDataType_t(7); } impl cudaDataType_t { pub const CUDA_R_8U: cudaDataType_t = cudaDataType_t(8); } impl cudaDataType_t { pub const CUDA_C_8U: cudaDataType_t = cudaDataType_t(9); } impl cudaDataType_t { pub const CUDA_R_16I: cudaDataType_t = cudaDataType_t(20); } impl cudaDataType_t { pub const CUDA_C_16I: cudaDataType_t = cudaDataType_t(21); } impl cudaDataType_t { pub const CUDA_R_16U: cudaDataType_t = cudaDataType_t(22); } impl cudaDataType_t { pub const CUDA_C_16U: cudaDataType_t = cudaDataType_t(23); } impl cudaDataType_t { pub const CUDA_R_32I: cudaDataType_t = cudaDataType_t(10); } impl cudaDataType_t { pub const CUDA_C_32I: cudaDataType_t = cudaDataType_t(11); } impl cudaDataType_t { pub const CUDA_R_32U: cudaDataType_t = cudaDataType_t(12); } impl cudaDataType_t { pub const CUDA_C_32U: cudaDataType_t = cudaDataType_t(13); } impl cudaDataType_t { pub const CUDA_R_64I: cudaDataType_t = cudaDataType_t(24); } impl cudaDataType_t { pub const CUDA_C_64I: cudaDataType_t = cudaDataType_t(25); } impl cudaDataType_t { pub const CUDA_R_64U: cudaDataType_t = cudaDataType_t(26); } impl cudaDataType_t { pub const CUDA_C_64U: cudaDataType_t = cudaDataType_t(27); } impl cudaDataType_t { pub const CUDA_R_8F_E4M3: cudaDataType_t = cudaDataType_t(28); } impl cudaDataType_t { pub const CUDA_R_8F_UE4M3: cudaDataType_t = cudaDataType_t(28); } impl cudaDataType_t { pub const CUDA_R_8F_E5M2: cudaDataType_t = cudaDataType_t(29); } impl cudaDataType_t { pub const CUDA_R_8F_UE8M0: cudaDataType_t = cudaDataType_t(30); } impl cudaDataType_t { pub const CUDA_R_6F_E2M3: cudaDataType_t = cudaDataType_t(31); } impl cudaDataType_t { pub const CUDA_R_6F_E3M2: cudaDataType_t = cudaDataType_t(32); } impl cudaDataType_t { pub const CUDA_R_4F_E2M1: cudaDataType_t = cudaDataType_t(33); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudaDataType_t(pub ::core::ffi::c_uint); pub use self::cudaDataType_t as cudaDataType; impl cudaEmulationStrategy_t { /** The default emulation strategy. For emulated computations, this is equivalent to CUDA_EMULATION_STRATEGY_PERFORMANT, unless a library dependent environment variable is set*/ pub const CUDA_EMULATION_STRATEGY_DEFAULT: cudaEmulationStrategy_t = cudaEmulationStrategy_t( 0, ); } impl cudaEmulationStrategy_t { /** An emulation strategy which configures libraries to use emulation when it provides a performance benefit*/ pub const CUDA_EMULATION_STRATEGY_PERFORMANT: cudaEmulationStrategy_t = cudaEmulationStrategy_t( 1, ); } impl cudaEmulationStrategy_t { /** An emulation strategy which configures libraries to use emulation whenever possible*/ pub const CUDA_EMULATION_STRATEGY_EAGER: cudaEmulationStrategy_t = cudaEmulationStrategy_t( 2, ); } #[repr(transparent)] /// Enum for specifying how to leverage floating-point emulation algorithms #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudaEmulationStrategy_t(pub ::core::ffi::c_uint); /// Enum for specifying how to leverage floating-point emulation algorithms pub use self::cudaEmulationStrategy_t as cudaEmulationStrategy; impl libraryPropertyType_t { pub const MAJOR_VERSION: libraryPropertyType_t = libraryPropertyType_t(0); } impl libraryPropertyType_t { pub const MINOR_VERSION: libraryPropertyType_t = libraryPropertyType_t(1); } impl libraryPropertyType_t { pub const PATCH_LEVEL: libraryPropertyType_t = libraryPropertyType_t(2); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct libraryPropertyType_t(pub ::core::ffi::c_uint); pub use self::libraryPropertyType_t as libraryPropertyType; #[repr(C)] #[repr(align(8))] #[derive(Debug, Copy, Clone, PartialEq)] pub struct float2 { pub x: f32, pub y: f32, } #[repr(C)] #[repr(align(16))] #[derive(Debug, Copy, Clone, PartialEq)] pub struct double2 { pub x: f64, pub y: f64, } pub type cuFloatComplex = float2; pub type cuDoubleComplex = double2; pub type cuComplex = cuFloatComplex; impl CUerror { pub const r#INVALID_VALUE: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(1) }); pub const r#OUT_OF_MEMORY: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(2) }); pub const r#NOT_INITIALIZED: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(3) }); pub const r#DEINITIALIZED: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(4) }); pub const r#PROFILER_DISABLED: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(5) }); pub const r#PROFILER_NOT_INITIALIZED: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(6) }); pub const r#PROFILER_ALREADY_STARTED: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(7) }); pub const r#PROFILER_ALREADY_STOPPED: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(8) }); pub const r#STUB_LIBRARY: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(34) }); pub const r#CALL_REQUIRES_NEWER_DRIVER: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(36) }); pub const r#DEVICE_UNAVAILABLE: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(46) }); pub const r#NO_DEVICE: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(100) }); pub const r#INVALID_DEVICE: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(101) }); pub const r#DEVICE_NOT_LICENSED: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(102) }); pub const r#INVALID_IMAGE: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(200) }); pub const r#INVALID_CONTEXT: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(201) }); pub const r#CONTEXT_ALREADY_CURRENT: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(202) }); pub const r#MAP_FAILED: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(205) }); pub const r#UNMAP_FAILED: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(206) }); pub const r#ARRAY_IS_MAPPED: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(207) }); pub const r#ALREADY_MAPPED: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(208) }); pub const r#NO_BINARY_FOR_GPU: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(209) }); pub const r#ALREADY_ACQUIRED: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(210) }); pub const r#NOT_MAPPED: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(211) }); pub const r#NOT_MAPPED_AS_ARRAY: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(212) }); pub const r#NOT_MAPPED_AS_POINTER: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(213) }); pub const r#ECC_UNCORRECTABLE: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(214) }); pub const r#UNSUPPORTED_LIMIT: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(215) }); pub const r#CONTEXT_ALREADY_IN_USE: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(216) }); pub const r#PEER_ACCESS_UNSUPPORTED: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(217) }); pub const r#INVALID_PTX: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(218) }); pub const r#INVALID_GRAPHICS_CONTEXT: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(219) }); pub const r#NVLINK_UNCORRECTABLE: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(220) }); pub const r#JIT_COMPILER_NOT_FOUND: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(221) }); pub const r#UNSUPPORTED_PTX_VERSION: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(222) }); pub const r#JIT_COMPILATION_DISABLED: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(223) }); pub const r#UNSUPPORTED_EXEC_AFFINITY: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(224) }); pub const r#UNSUPPORTED_DEVSIDE_SYNC: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(225) }); pub const r#CONTAINED: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(226) }); pub const r#INVALID_SOURCE: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(300) }); pub const r#FILE_NOT_FOUND: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(301) }); pub const r#SHARED_OBJECT_SYMBOL_NOT_FOUND: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(302) }); pub const r#SHARED_OBJECT_INIT_FAILED: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(303) }); pub const r#OPERATING_SYSTEM: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(304) }); pub const r#INVALID_HANDLE: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(400) }); pub const r#ILLEGAL_STATE: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(401) }); pub const r#LOSSY_QUERY: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(402) }); pub const r#NOT_FOUND: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(500) }); pub const r#NOT_READY: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(600) }); pub const r#ILLEGAL_ADDRESS: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(700) }); pub const r#LAUNCH_OUT_OF_RESOURCES: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(701) }); pub const r#LAUNCH_TIMEOUT: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(702) }); pub const r#LAUNCH_INCOMPATIBLE_TEXTURING: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(703) }); pub const r#PEER_ACCESS_ALREADY_ENABLED: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(704) }); pub const r#PEER_ACCESS_NOT_ENABLED: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(705) }); pub const r#PRIMARY_CONTEXT_ACTIVE: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(708) }); pub const r#CONTEXT_IS_DESTROYED: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(709) }); pub const r#ASSERT: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(710) }); pub const r#TOO_MANY_PEERS: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(711) }); pub const r#HOST_MEMORY_ALREADY_REGISTERED: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(712) }); pub const r#HOST_MEMORY_NOT_REGISTERED: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(713) }); pub const r#HARDWARE_STACK_ERROR: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(714) }); pub const r#ILLEGAL_INSTRUCTION: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(715) }); pub const r#MISALIGNED_ADDRESS: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(716) }); pub const r#INVALID_ADDRESS_SPACE: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(717) }); pub const r#INVALID_PC: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(718) }); pub const r#LAUNCH_FAILED: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(719) }); pub const r#COOPERATIVE_LAUNCH_TOO_LARGE: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(720) }); pub const r#TENSOR_MEMORY_LEAK: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(721) }); pub const r#NOT_PERMITTED: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(800) }); pub const r#NOT_SUPPORTED: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(801) }); pub const r#SYSTEM_NOT_READY: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(802) }); pub const r#SYSTEM_DRIVER_MISMATCH: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(803) }); pub const r#COMPAT_NOT_SUPPORTED_ON_DEVICE: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(804) }); pub const r#MPS_CONNECTION_FAILED: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(805) }); pub const r#MPS_RPC_FAILURE: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(806) }); pub const r#MPS_SERVER_NOT_READY: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(807) }); pub const r#MPS_MAX_CLIENTS_REACHED: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(808) }); pub const r#MPS_MAX_CONNECTIONS_REACHED: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(809) }); pub const r#MPS_CLIENT_TERMINATED: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(810) }); pub const r#CDP_NOT_SUPPORTED: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(811) }); pub const r#CDP_VERSION_MISMATCH: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(812) }); pub const r#STREAM_CAPTURE_UNSUPPORTED: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(900) }); pub const r#STREAM_CAPTURE_INVALIDATED: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(901) }); pub const r#STREAM_CAPTURE_MERGE: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(902) }); pub const r#STREAM_CAPTURE_UNMATCHED: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(903) }); pub const r#STREAM_CAPTURE_UNJOINED: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(904) }); pub const r#STREAM_CAPTURE_ISOLATION: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(905) }); pub const r#STREAM_CAPTURE_IMPLICIT: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(906) }); pub const r#CAPTURED_EVENT: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(907) }); pub const r#STREAM_CAPTURE_WRONG_THREAD: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(908) }); pub const r#TIMEOUT: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(909) }); pub const r#GRAPH_EXEC_UPDATE_FAILURE: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(910) }); pub const r#EXTERNAL_DEVICE: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(911) }); pub const r#INVALID_CLUSTER_SIZE: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(912) }); pub const r#FUNCTION_NOT_LOADED: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(913) }); pub const r#INVALID_RESOURCE_TYPE: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(914) }); pub const r#INVALID_RESOURCE_CONFIGURATION: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(915) }); pub const r#KEY_ROTATION: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(916) }); pub const r#UNKNOWN: CUerror = CUerror(unsafe { ::core::num::NonZeroU32::new_unchecked(999) }); } #[repr(transparent)] #[derive(Debug, Hash, Copy, Clone, PartialEq, Eq)] pub struct CUerror(pub ::core::num::NonZeroU32); pub trait CUresultConsts { const SUCCESS: CUresult = CUresult::Ok(()); const ERROR_INVALID_VALUE: CUresult = CUresult::Err(CUerror::r#INVALID_VALUE); const ERROR_OUT_OF_MEMORY: CUresult = CUresult::Err(CUerror::r#OUT_OF_MEMORY); const ERROR_NOT_INITIALIZED: CUresult = CUresult::Err(CUerror::r#NOT_INITIALIZED); const ERROR_DEINITIALIZED: CUresult = CUresult::Err(CUerror::r#DEINITIALIZED); const ERROR_PROFILER_DISABLED: CUresult = CUresult::Err( CUerror::r#PROFILER_DISABLED, ); const ERROR_PROFILER_NOT_INITIALIZED: CUresult = CUresult::Err( CUerror::r#PROFILER_NOT_INITIALIZED, ); const ERROR_PROFILER_ALREADY_STARTED: CUresult = CUresult::Err( CUerror::r#PROFILER_ALREADY_STARTED, ); const ERROR_PROFILER_ALREADY_STOPPED: CUresult = CUresult::Err( CUerror::r#PROFILER_ALREADY_STOPPED, ); const ERROR_STUB_LIBRARY: CUresult = CUresult::Err(CUerror::r#STUB_LIBRARY); const ERROR_CALL_REQUIRES_NEWER_DRIVER: CUresult = CUresult::Err( CUerror::r#CALL_REQUIRES_NEWER_DRIVER, ); const ERROR_DEVICE_UNAVAILABLE: CUresult = CUresult::Err( CUerror::r#DEVICE_UNAVAILABLE, ); const ERROR_NO_DEVICE: CUresult = CUresult::Err(CUerror::r#NO_DEVICE); const ERROR_INVALID_DEVICE: CUresult = CUresult::Err(CUerror::r#INVALID_DEVICE); const ERROR_DEVICE_NOT_LICENSED: CUresult = CUresult::Err( CUerror::r#DEVICE_NOT_LICENSED, ); const ERROR_INVALID_IMAGE: CUresult = CUresult::Err(CUerror::r#INVALID_IMAGE); const ERROR_INVALID_CONTEXT: CUresult = CUresult::Err(CUerror::r#INVALID_CONTEXT); const ERROR_CONTEXT_ALREADY_CURRENT: CUresult = CUresult::Err( CUerror::r#CONTEXT_ALREADY_CURRENT, ); const ERROR_MAP_FAILED: CUresult = CUresult::Err(CUerror::r#MAP_FAILED); const ERROR_UNMAP_FAILED: CUresult = CUresult::Err(CUerror::r#UNMAP_FAILED); const ERROR_ARRAY_IS_MAPPED: CUresult = CUresult::Err(CUerror::r#ARRAY_IS_MAPPED); const ERROR_ALREADY_MAPPED: CUresult = CUresult::Err(CUerror::r#ALREADY_MAPPED); const ERROR_NO_BINARY_FOR_GPU: CUresult = CUresult::Err( CUerror::r#NO_BINARY_FOR_GPU, ); const ERROR_ALREADY_ACQUIRED: CUresult = CUresult::Err(CUerror::r#ALREADY_ACQUIRED); const ERROR_NOT_MAPPED: CUresult = CUresult::Err(CUerror::r#NOT_MAPPED); const ERROR_NOT_MAPPED_AS_ARRAY: CUresult = CUresult::Err( CUerror::r#NOT_MAPPED_AS_ARRAY, ); const ERROR_NOT_MAPPED_AS_POINTER: CUresult = CUresult::Err( CUerror::r#NOT_MAPPED_AS_POINTER, ); const ERROR_ECC_UNCORRECTABLE: CUresult = CUresult::Err( CUerror::r#ECC_UNCORRECTABLE, ); const ERROR_UNSUPPORTED_LIMIT: CUresult = CUresult::Err( CUerror::r#UNSUPPORTED_LIMIT, ); const ERROR_CONTEXT_ALREADY_IN_USE: CUresult = CUresult::Err( CUerror::r#CONTEXT_ALREADY_IN_USE, ); const ERROR_PEER_ACCESS_UNSUPPORTED: CUresult = CUresult::Err( CUerror::r#PEER_ACCESS_UNSUPPORTED, ); const ERROR_INVALID_PTX: CUresult = CUresult::Err(CUerror::r#INVALID_PTX); const ERROR_INVALID_GRAPHICS_CONTEXT: CUresult = CUresult::Err( CUerror::r#INVALID_GRAPHICS_CONTEXT, ); const ERROR_NVLINK_UNCORRECTABLE: CUresult = CUresult::Err( CUerror::r#NVLINK_UNCORRECTABLE, ); const ERROR_JIT_COMPILER_NOT_FOUND: CUresult = CUresult::Err( CUerror::r#JIT_COMPILER_NOT_FOUND, ); const ERROR_UNSUPPORTED_PTX_VERSION: CUresult = CUresult::Err( CUerror::r#UNSUPPORTED_PTX_VERSION, ); const ERROR_JIT_COMPILATION_DISABLED: CUresult = CUresult::Err( CUerror::r#JIT_COMPILATION_DISABLED, ); const ERROR_UNSUPPORTED_EXEC_AFFINITY: CUresult = CUresult::Err( CUerror::r#UNSUPPORTED_EXEC_AFFINITY, ); const ERROR_UNSUPPORTED_DEVSIDE_SYNC: CUresult = CUresult::Err( CUerror::r#UNSUPPORTED_DEVSIDE_SYNC, ); const ERROR_CONTAINED: CUresult = CUresult::Err(CUerror::r#CONTAINED); const ERROR_INVALID_SOURCE: CUresult = CUresult::Err(CUerror::r#INVALID_SOURCE); const ERROR_FILE_NOT_FOUND: CUresult = CUresult::Err(CUerror::r#FILE_NOT_FOUND); const ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND: CUresult = CUresult::Err( CUerror::r#SHARED_OBJECT_SYMBOL_NOT_FOUND, ); const ERROR_SHARED_OBJECT_INIT_FAILED: CUresult = CUresult::Err( CUerror::r#SHARED_OBJECT_INIT_FAILED, ); const ERROR_OPERATING_SYSTEM: CUresult = CUresult::Err(CUerror::r#OPERATING_SYSTEM); const ERROR_INVALID_HANDLE: CUresult = CUresult::Err(CUerror::r#INVALID_HANDLE); const ERROR_ILLEGAL_STATE: CUresult = CUresult::Err(CUerror::r#ILLEGAL_STATE); const ERROR_LOSSY_QUERY: CUresult = CUresult::Err(CUerror::r#LOSSY_QUERY); const ERROR_NOT_FOUND: CUresult = CUresult::Err(CUerror::r#NOT_FOUND); const ERROR_NOT_READY: CUresult = CUresult::Err(CUerror::r#NOT_READY); const ERROR_ILLEGAL_ADDRESS: CUresult = CUresult::Err(CUerror::r#ILLEGAL_ADDRESS); const ERROR_LAUNCH_OUT_OF_RESOURCES: CUresult = CUresult::Err( CUerror::r#LAUNCH_OUT_OF_RESOURCES, ); const ERROR_LAUNCH_TIMEOUT: CUresult = CUresult::Err(CUerror::r#LAUNCH_TIMEOUT); const ERROR_LAUNCH_INCOMPATIBLE_TEXTURING: CUresult = CUresult::Err( CUerror::r#LAUNCH_INCOMPATIBLE_TEXTURING, ); const ERROR_PEER_ACCESS_ALREADY_ENABLED: CUresult = CUresult::Err( CUerror::r#PEER_ACCESS_ALREADY_ENABLED, ); const ERROR_PEER_ACCESS_NOT_ENABLED: CUresult = CUresult::Err( CUerror::r#PEER_ACCESS_NOT_ENABLED, ); const ERROR_PRIMARY_CONTEXT_ACTIVE: CUresult = CUresult::Err( CUerror::r#PRIMARY_CONTEXT_ACTIVE, ); const ERROR_CONTEXT_IS_DESTROYED: CUresult = CUresult::Err( CUerror::r#CONTEXT_IS_DESTROYED, ); const ERROR_ASSERT: CUresult = CUresult::Err(CUerror::r#ASSERT); const ERROR_TOO_MANY_PEERS: CUresult = CUresult::Err(CUerror::r#TOO_MANY_PEERS); const ERROR_HOST_MEMORY_ALREADY_REGISTERED: CUresult = CUresult::Err( CUerror::r#HOST_MEMORY_ALREADY_REGISTERED, ); const ERROR_HOST_MEMORY_NOT_REGISTERED: CUresult = CUresult::Err( CUerror::r#HOST_MEMORY_NOT_REGISTERED, ); const ERROR_HARDWARE_STACK_ERROR: CUresult = CUresult::Err( CUerror::r#HARDWARE_STACK_ERROR, ); const ERROR_ILLEGAL_INSTRUCTION: CUresult = CUresult::Err( CUerror::r#ILLEGAL_INSTRUCTION, ); const ERROR_MISALIGNED_ADDRESS: CUresult = CUresult::Err( CUerror::r#MISALIGNED_ADDRESS, ); const ERROR_INVALID_ADDRESS_SPACE: CUresult = CUresult::Err( CUerror::r#INVALID_ADDRESS_SPACE, ); const ERROR_INVALID_PC: CUresult = CUresult::Err(CUerror::r#INVALID_PC); const ERROR_LAUNCH_FAILED: CUresult = CUresult::Err(CUerror::r#LAUNCH_FAILED); const ERROR_COOPERATIVE_LAUNCH_TOO_LARGE: CUresult = CUresult::Err( CUerror::r#COOPERATIVE_LAUNCH_TOO_LARGE, ); const ERROR_TENSOR_MEMORY_LEAK: CUresult = CUresult::Err( CUerror::r#TENSOR_MEMORY_LEAK, ); const ERROR_NOT_PERMITTED: CUresult = CUresult::Err(CUerror::r#NOT_PERMITTED); const ERROR_NOT_SUPPORTED: CUresult = CUresult::Err(CUerror::r#NOT_SUPPORTED); const ERROR_SYSTEM_NOT_READY: CUresult = CUresult::Err(CUerror::r#SYSTEM_NOT_READY); const ERROR_SYSTEM_DRIVER_MISMATCH: CUresult = CUresult::Err( CUerror::r#SYSTEM_DRIVER_MISMATCH, ); const ERROR_COMPAT_NOT_SUPPORTED_ON_DEVICE: CUresult = CUresult::Err( CUerror::r#COMPAT_NOT_SUPPORTED_ON_DEVICE, ); const ERROR_MPS_CONNECTION_FAILED: CUresult = CUresult::Err( CUerror::r#MPS_CONNECTION_FAILED, ); const ERROR_MPS_RPC_FAILURE: CUresult = CUresult::Err(CUerror::r#MPS_RPC_FAILURE); const ERROR_MPS_SERVER_NOT_READY: CUresult = CUresult::Err( CUerror::r#MPS_SERVER_NOT_READY, ); const ERROR_MPS_MAX_CLIENTS_REACHED: CUresult = CUresult::Err( CUerror::r#MPS_MAX_CLIENTS_REACHED, ); const ERROR_MPS_MAX_CONNECTIONS_REACHED: CUresult = CUresult::Err( CUerror::r#MPS_MAX_CONNECTIONS_REACHED, ); const ERROR_MPS_CLIENT_TERMINATED: CUresult = CUresult::Err( CUerror::r#MPS_CLIENT_TERMINATED, ); const ERROR_CDP_NOT_SUPPORTED: CUresult = CUresult::Err( CUerror::r#CDP_NOT_SUPPORTED, ); const ERROR_CDP_VERSION_MISMATCH: CUresult = CUresult::Err( CUerror::r#CDP_VERSION_MISMATCH, ); const ERROR_STREAM_CAPTURE_UNSUPPORTED: CUresult = CUresult::Err( CUerror::r#STREAM_CAPTURE_UNSUPPORTED, ); const ERROR_STREAM_CAPTURE_INVALIDATED: CUresult = CUresult::Err( CUerror::r#STREAM_CAPTURE_INVALIDATED, ); const ERROR_STREAM_CAPTURE_MERGE: CUresult = CUresult::Err( CUerror::r#STREAM_CAPTURE_MERGE, ); const ERROR_STREAM_CAPTURE_UNMATCHED: CUresult = CUresult::Err( CUerror::r#STREAM_CAPTURE_UNMATCHED, ); const ERROR_STREAM_CAPTURE_UNJOINED: CUresult = CUresult::Err( CUerror::r#STREAM_CAPTURE_UNJOINED, ); const ERROR_STREAM_CAPTURE_ISOLATION: CUresult = CUresult::Err( CUerror::r#STREAM_CAPTURE_ISOLATION, ); const ERROR_STREAM_CAPTURE_IMPLICIT: CUresult = CUresult::Err( CUerror::r#STREAM_CAPTURE_IMPLICIT, ); const ERROR_CAPTURED_EVENT: CUresult = CUresult::Err(CUerror::r#CAPTURED_EVENT); const ERROR_STREAM_CAPTURE_WRONG_THREAD: CUresult = CUresult::Err( CUerror::r#STREAM_CAPTURE_WRONG_THREAD, ); const ERROR_TIMEOUT: CUresult = CUresult::Err(CUerror::r#TIMEOUT); const ERROR_GRAPH_EXEC_UPDATE_FAILURE: CUresult = CUresult::Err( CUerror::r#GRAPH_EXEC_UPDATE_FAILURE, ); const ERROR_EXTERNAL_DEVICE: CUresult = CUresult::Err(CUerror::r#EXTERNAL_DEVICE); const ERROR_INVALID_CLUSTER_SIZE: CUresult = CUresult::Err( CUerror::r#INVALID_CLUSTER_SIZE, ); const ERROR_FUNCTION_NOT_LOADED: CUresult = CUresult::Err( CUerror::r#FUNCTION_NOT_LOADED, ); const ERROR_INVALID_RESOURCE_TYPE: CUresult = CUresult::Err( CUerror::r#INVALID_RESOURCE_TYPE, ); const ERROR_INVALID_RESOURCE_CONFIGURATION: CUresult = CUresult::Err( CUerror::r#INVALID_RESOURCE_CONFIGURATION, ); const ERROR_KEY_ROTATION: CUresult = CUresult::Err(CUerror::r#KEY_ROTATION); const ERROR_UNKNOWN: CUresult = CUresult::Err(CUerror::r#UNKNOWN); } impl CUresultConsts for CUresult {} #[must_use] pub type CUresult = ::core::result::Result<(), CUerror>; const _: fn() = || { let _ = std::mem::transmute::; }; impl From for CUerror { fn from(error: hip_runtime_sys::hipErrorCode_t) -> Self { Self(error.0) } } unsafe impl Send for CUdeviceptr {} unsafe impl Sync for CUdeviceptr {} unsafe impl Send for CUcontext {} unsafe impl Sync for CUcontext {} unsafe impl Send for CUstream {} unsafe impl Sync for CUstream {} unsafe impl Send for CUmodule {} unsafe impl Sync for CUmodule {} unsafe impl Send for CUfunction {} unsafe impl Sync for CUfunction {} unsafe impl Send for CUlibrary {} unsafe impl Sync for CUlibrary {} ================================================ FILE: cuda_types/src/cudnn.rs ================================================ // Generated automatically by zluda_bindgen // DO NOT EDIT MANUALLY #![allow(warnings)] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cudnnContext { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cudnnRuntimeTag_t { _unused: [u8; 0], } impl cudnnErrQueryMode_t { pub const CUDNN_ERRQUERY_RAWCODE: cudnnErrQueryMode_t = cudnnErrQueryMode_t(0); } impl cudnnErrQueryMode_t { pub const CUDNN_ERRQUERY_NONBLOCKING: cudnnErrQueryMode_t = cudnnErrQueryMode_t(1); } impl cudnnErrQueryMode_t { pub const CUDNN_ERRQUERY_BLOCKING: cudnnErrQueryMode_t = cudnnErrQueryMode_t(2); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnErrQueryMode_t(pub ::core::ffi::c_uint); impl cudnnMathType_t { pub const CUDNN_DEFAULT_MATH: cudnnMathType_t = cudnnMathType_t(0); } impl cudnnMathType_t { pub const CUDNN_TENSOR_OP_MATH: cudnnMathType_t = cudnnMathType_t(1); } impl cudnnMathType_t { pub const CUDNN_TENSOR_OP_MATH_ALLOW_CONVERSION: cudnnMathType_t = cudnnMathType_t( 2, ); } impl cudnnMathType_t { pub const CUDNN_FMA_MATH: cudnnMathType_t = cudnnMathType_t(3); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnMathType_t(pub ::core::ffi::c_uint); impl cudnnNanPropagation_t { pub const CUDNN_NOT_PROPAGATE_NAN: cudnnNanPropagation_t = cudnnNanPropagation_t(0); } impl cudnnNanPropagation_t { pub const CUDNN_PROPAGATE_NAN: cudnnNanPropagation_t = cudnnNanPropagation_t(1); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnNanPropagation_t(pub ::core::ffi::c_uint); impl cudnnTensorFormat_t { pub const CUDNN_TENSOR_NCHW: cudnnTensorFormat_t = cudnnTensorFormat_t(0); } impl cudnnTensorFormat_t { pub const CUDNN_TENSOR_NHWC: cudnnTensorFormat_t = cudnnTensorFormat_t(1); } impl cudnnTensorFormat_t { pub const CUDNN_TENSOR_NCHW_VECT_C: cudnnTensorFormat_t = cudnnTensorFormat_t(2); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnTensorFormat_t(pub ::core::ffi::c_uint); impl cudnnReduceTensorOp_t { pub const CUDNN_REDUCE_TENSOR_ADD: cudnnReduceTensorOp_t = cudnnReduceTensorOp_t(0); } impl cudnnReduceTensorOp_t { pub const CUDNN_REDUCE_TENSOR_MUL: cudnnReduceTensorOp_t = cudnnReduceTensorOp_t(1); } impl cudnnReduceTensorOp_t { pub const CUDNN_REDUCE_TENSOR_MIN: cudnnReduceTensorOp_t = cudnnReduceTensorOp_t(2); } impl cudnnReduceTensorOp_t { pub const CUDNN_REDUCE_TENSOR_MAX: cudnnReduceTensorOp_t = cudnnReduceTensorOp_t(3); } impl cudnnReduceTensorOp_t { pub const CUDNN_REDUCE_TENSOR_AMAX: cudnnReduceTensorOp_t = cudnnReduceTensorOp_t(4); } impl cudnnReduceTensorOp_t { pub const CUDNN_REDUCE_TENSOR_AVG: cudnnReduceTensorOp_t = cudnnReduceTensorOp_t(5); } impl cudnnReduceTensorOp_t { pub const CUDNN_REDUCE_TENSOR_NORM1: cudnnReduceTensorOp_t = cudnnReduceTensorOp_t( 6, ); } impl cudnnReduceTensorOp_t { pub const CUDNN_REDUCE_TENSOR_NORM2: cudnnReduceTensorOp_t = cudnnReduceTensorOp_t( 7, ); } impl cudnnReduceTensorOp_t { pub const CUDNN_REDUCE_TENSOR_MUL_NO_ZEROS: cudnnReduceTensorOp_t = cudnnReduceTensorOp_t( 8, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnReduceTensorOp_t(pub ::core::ffi::c_uint); impl cudnnActivationMode_t { pub const CUDNN_ACTIVATION_SIGMOID: cudnnActivationMode_t = cudnnActivationMode_t(0); } impl cudnnActivationMode_t { pub const CUDNN_ACTIVATION_RELU: cudnnActivationMode_t = cudnnActivationMode_t(1); } impl cudnnActivationMode_t { pub const CUDNN_ACTIVATION_TANH: cudnnActivationMode_t = cudnnActivationMode_t(2); } impl cudnnActivationMode_t { pub const CUDNN_ACTIVATION_CLIPPED_RELU: cudnnActivationMode_t = cudnnActivationMode_t( 3, ); } impl cudnnActivationMode_t { pub const CUDNN_ACTIVATION_ELU: cudnnActivationMode_t = cudnnActivationMode_t(4); } impl cudnnActivationMode_t { pub const CUDNN_ACTIVATION_IDENTITY: cudnnActivationMode_t = cudnnActivationMode_t( 5, ); } impl cudnnActivationMode_t { pub const CUDNN_ACTIVATION_SWISH: cudnnActivationMode_t = cudnnActivationMode_t(6); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnActivationMode_t(pub ::core::ffi::c_uint); impl cudnnSeverity_t { pub const CUDNN_SEV_FATAL: cudnnSeverity_t = cudnnSeverity_t(0); } impl cudnnSeverity_t { pub const CUDNN_SEV_ERROR: cudnnSeverity_t = cudnnSeverity_t(1); } impl cudnnSeverity_t { pub const CUDNN_SEV_WARNING: cudnnSeverity_t = cudnnSeverity_t(2); } impl cudnnSeverity_t { pub const CUDNN_SEV_INFO: cudnnSeverity_t = cudnnSeverity_t(3); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnSeverity_t(pub ::core::ffi::c_uint); impl cudnnConvolutionMode_t { pub const CUDNN_CONVOLUTION: cudnnConvolutionMode_t = cudnnConvolutionMode_t(0); } impl cudnnConvolutionMode_t { pub const CUDNN_CROSS_CORRELATION: cudnnConvolutionMode_t = cudnnConvolutionMode_t( 1, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnConvolutionMode_t(pub ::core::ffi::c_uint); impl cudnnReorderType_t { pub const CUDNN_DEFAULT_REORDER: cudnnReorderType_t = cudnnReorderType_t(0); } impl cudnnReorderType_t { pub const CUDNN_NO_REORDER: cudnnReorderType_t = cudnnReorderType_t(1); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnReorderType_t(pub ::core::ffi::c_uint); #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnFractionStruct { pub numerator: i64, pub denominator: i64, } impl cudnnResampleMode_t { pub const CUDNN_RESAMPLE_NEAREST: cudnnResampleMode_t = cudnnResampleMode_t(0); } impl cudnnResampleMode_t { pub const CUDNN_RESAMPLE_BILINEAR: cudnnResampleMode_t = cudnnResampleMode_t(1); } impl cudnnResampleMode_t { pub const CUDNN_RESAMPLE_AVGPOOL: cudnnResampleMode_t = cudnnResampleMode_t(2); } impl cudnnResampleMode_t { pub const CUDNN_RESAMPLE_AVGPOOL_INCLUDE_PADDING: cudnnResampleMode_t = cudnnResampleMode_t( 2, ); } impl cudnnResampleMode_t { pub const CUDNN_RESAMPLE_AVGPOOL_EXCLUDE_PADDING: cudnnResampleMode_t = cudnnResampleMode_t( 4, ); } impl cudnnResampleMode_t { pub const CUDNN_RESAMPLE_MAXPOOL: cudnnResampleMode_t = cudnnResampleMode_t(3); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnResampleMode_t(pub ::core::ffi::c_uint); impl cudnnSignalMode_t { pub const CUDNN_SIGNAL_SET: cudnnSignalMode_t = cudnnSignalMode_t(0); } impl cudnnSignalMode_t { pub const CUDNN_SIGNAL_WAIT: cudnnSignalMode_t = cudnnSignalMode_t(1); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnSignalMode_t(pub ::core::ffi::c_uint); impl cudnnGenStatsMode_t { pub const CUDNN_GENSTATS_SUM_SQSUM: cudnnGenStatsMode_t = cudnnGenStatsMode_t(0); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnGenStatsMode_t(pub ::core::ffi::c_uint); impl cudnnBnFinalizeStatsMode_t { pub const CUDNN_BN_FINALIZE_STATISTICS_TRAINING: cudnnBnFinalizeStatsMode_t = cudnnBnFinalizeStatsMode_t( 0, ); } impl cudnnBnFinalizeStatsMode_t { pub const CUDNN_BN_FINALIZE_STATISTICS_INFERENCE: cudnnBnFinalizeStatsMode_t = cudnnBnFinalizeStatsMode_t( 1, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnBnFinalizeStatsMode_t(pub ::core::ffi::c_uint); impl cudnnRngDistribution_t { pub const CUDNN_RNG_DISTRIBUTION_BERNOULLI: cudnnRngDistribution_t = cudnnRngDistribution_t( 0, ); } impl cudnnRngDistribution_t { pub const CUDNN_RNG_DISTRIBUTION_UNIFORM: cudnnRngDistribution_t = cudnnRngDistribution_t( 1, ); } impl cudnnRngDistribution_t { pub const CUDNN_RNG_DISTRIBUTION_NORMAL: cudnnRngDistribution_t = cudnnRngDistribution_t( 2, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnRngDistribution_t(pub ::core::ffi::c_uint); impl cudnnBackendAttributeType_t { pub const CUDNN_TYPE_HANDLE: cudnnBackendAttributeType_t = cudnnBackendAttributeType_t( 0, ); } impl cudnnBackendAttributeType_t { pub const CUDNN_TYPE_DATA_TYPE: cudnnBackendAttributeType_t = cudnnBackendAttributeType_t( 1, ); } impl cudnnBackendAttributeType_t { pub const CUDNN_TYPE_BOOLEAN: cudnnBackendAttributeType_t = cudnnBackendAttributeType_t( 2, ); } impl cudnnBackendAttributeType_t { pub const CUDNN_TYPE_INT64: cudnnBackendAttributeType_t = cudnnBackendAttributeType_t( 3, ); } impl cudnnBackendAttributeType_t { pub const CUDNN_TYPE_FLOAT: cudnnBackendAttributeType_t = cudnnBackendAttributeType_t( 4, ); } impl cudnnBackendAttributeType_t { pub const CUDNN_TYPE_DOUBLE: cudnnBackendAttributeType_t = cudnnBackendAttributeType_t( 5, ); } impl cudnnBackendAttributeType_t { pub const CUDNN_TYPE_VOID_PTR: cudnnBackendAttributeType_t = cudnnBackendAttributeType_t( 6, ); } impl cudnnBackendAttributeType_t { pub const CUDNN_TYPE_CONVOLUTION_MODE: cudnnBackendAttributeType_t = cudnnBackendAttributeType_t( 7, ); } impl cudnnBackendAttributeType_t { pub const CUDNN_TYPE_HEUR_MODE: cudnnBackendAttributeType_t = cudnnBackendAttributeType_t( 8, ); } impl cudnnBackendAttributeType_t { pub const CUDNN_TYPE_KNOB_TYPE: cudnnBackendAttributeType_t = cudnnBackendAttributeType_t( 9, ); } impl cudnnBackendAttributeType_t { pub const CUDNN_TYPE_NAN_PROPOGATION: cudnnBackendAttributeType_t = cudnnBackendAttributeType_t( 10, ); } impl cudnnBackendAttributeType_t { pub const CUDNN_TYPE_NUMERICAL_NOTE: cudnnBackendAttributeType_t = cudnnBackendAttributeType_t( 11, ); } impl cudnnBackendAttributeType_t { pub const CUDNN_TYPE_LAYOUT_TYPE: cudnnBackendAttributeType_t = cudnnBackendAttributeType_t( 12, ); } impl cudnnBackendAttributeType_t { pub const CUDNN_TYPE_ATTRIB_NAME: cudnnBackendAttributeType_t = cudnnBackendAttributeType_t( 13, ); } impl cudnnBackendAttributeType_t { pub const CUDNN_TYPE_POINTWISE_MODE: cudnnBackendAttributeType_t = cudnnBackendAttributeType_t( 14, ); } impl cudnnBackendAttributeType_t { pub const CUDNN_TYPE_BACKEND_DESCRIPTOR: cudnnBackendAttributeType_t = cudnnBackendAttributeType_t( 15, ); } impl cudnnBackendAttributeType_t { pub const CUDNN_TYPE_GENSTATS_MODE: cudnnBackendAttributeType_t = cudnnBackendAttributeType_t( 16, ); } impl cudnnBackendAttributeType_t { pub const CUDNN_TYPE_BN_FINALIZE_STATS_MODE: cudnnBackendAttributeType_t = cudnnBackendAttributeType_t( 17, ); } impl cudnnBackendAttributeType_t { pub const CUDNN_TYPE_REDUCTION_OPERATOR_TYPE: cudnnBackendAttributeType_t = cudnnBackendAttributeType_t( 18, ); } impl cudnnBackendAttributeType_t { pub const CUDNN_TYPE_BEHAVIOR_NOTE: cudnnBackendAttributeType_t = cudnnBackendAttributeType_t( 19, ); } impl cudnnBackendAttributeType_t { pub const CUDNN_TYPE_TENSOR_REORDERING_MODE: cudnnBackendAttributeType_t = cudnnBackendAttributeType_t( 20, ); } impl cudnnBackendAttributeType_t { pub const CUDNN_TYPE_RESAMPLE_MODE: cudnnBackendAttributeType_t = cudnnBackendAttributeType_t( 21, ); } impl cudnnBackendAttributeType_t { pub const CUDNN_TYPE_PADDING_MODE: cudnnBackendAttributeType_t = cudnnBackendAttributeType_t( 22, ); } impl cudnnBackendAttributeType_t { pub const CUDNN_TYPE_INT32: cudnnBackendAttributeType_t = cudnnBackendAttributeType_t( 23, ); } impl cudnnBackendAttributeType_t { pub const CUDNN_TYPE_CHAR: cudnnBackendAttributeType_t = cudnnBackendAttributeType_t( 24, ); } impl cudnnBackendAttributeType_t { pub const CUDNN_TYPE_SIGNAL_MODE: cudnnBackendAttributeType_t = cudnnBackendAttributeType_t( 25, ); } impl cudnnBackendAttributeType_t { pub const CUDNN_TYPE_FRACTION: cudnnBackendAttributeType_t = cudnnBackendAttributeType_t( 26, ); } impl cudnnBackendAttributeType_t { pub const CUDNN_TYPE_NORM_MODE: cudnnBackendAttributeType_t = cudnnBackendAttributeType_t( 27, ); } impl cudnnBackendAttributeType_t { pub const CUDNN_TYPE_NORM_FWD_PHASE: cudnnBackendAttributeType_t = cudnnBackendAttributeType_t( 28, ); } impl cudnnBackendAttributeType_t { pub const CUDNN_TYPE_RNG_DISTRIBUTION: cudnnBackendAttributeType_t = cudnnBackendAttributeType_t( 29, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnBackendAttributeType_t(pub ::core::ffi::c_uint); impl cudnnBackendLayoutType_t { pub const CUDNN_LAYOUT_TYPE_PREFERRED_NCHW: cudnnBackendLayoutType_t = cudnnBackendLayoutType_t( 0, ); } impl cudnnBackendLayoutType_t { pub const CUDNN_LAYOUT_TYPE_PREFERRED_NHWC: cudnnBackendLayoutType_t = cudnnBackendLayoutType_t( 1, ); } impl cudnnBackendLayoutType_t { pub const CUDNN_LAYOUT_TYPE_PREFERRED_PAD4CK: cudnnBackendLayoutType_t = cudnnBackendLayoutType_t( 2, ); } impl cudnnBackendLayoutType_t { pub const CUDNN_LAYOUT_TYPE_PREFERRED_PAD8CK: cudnnBackendLayoutType_t = cudnnBackendLayoutType_t( 3, ); } impl cudnnBackendLayoutType_t { pub const CUDNN_LAYOUT_TYPE_COUNT: cudnnBackendLayoutType_t = cudnnBackendLayoutType_t( 4, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnBackendLayoutType_t(pub ::core::ffi::c_uint); impl cudnnBackendHeurMode_t { pub const CUDNN_HEUR_MODE_INSTANT: cudnnBackendHeurMode_t = cudnnBackendHeurMode_t( 0, ); } impl cudnnBackendHeurMode_t { pub const CUDNN_HEUR_MODE_B: cudnnBackendHeurMode_t = cudnnBackendHeurMode_t(1); } impl cudnnBackendHeurMode_t { pub const CUDNN_HEUR_MODE_FALLBACK: cudnnBackendHeurMode_t = cudnnBackendHeurMode_t( 2, ); } impl cudnnBackendHeurMode_t { pub const CUDNN_HEUR_MODE_A: cudnnBackendHeurMode_t = cudnnBackendHeurMode_t(3); } impl cudnnBackendHeurMode_t { pub const CUDNN_HEUR_MODES_COUNT: cudnnBackendHeurMode_t = cudnnBackendHeurMode_t(4); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnBackendHeurMode_t(pub ::core::ffi::c_uint); impl cudnnPaddingMode_t { pub const CUDNN_ZERO_PAD: cudnnPaddingMode_t = cudnnPaddingMode_t(0); } impl cudnnPaddingMode_t { pub const CUDNN_NEG_INF_PAD: cudnnPaddingMode_t = cudnnPaddingMode_t(1); } impl cudnnPaddingMode_t { pub const CUDNN_EDGE_VAL_PAD: cudnnPaddingMode_t = cudnnPaddingMode_t(2); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnPaddingMode_t(pub ::core::ffi::c_uint); impl cudnnBackendNormFwdPhase_t { pub const CUDNN_NORM_FWD_INFERENCE: cudnnBackendNormFwdPhase_t = cudnnBackendNormFwdPhase_t( 0, ); } impl cudnnBackendNormFwdPhase_t { pub const CUDNN_NORM_FWD_TRAINING: cudnnBackendNormFwdPhase_t = cudnnBackendNormFwdPhase_t( 1, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnBackendNormFwdPhase_t(pub ::core::ffi::c_uint); #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cudnnTensorStruct { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cudnnPoolingStruct { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cudnnFilterStruct { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cudnnLRNStruct { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cudnnActivationStruct { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cudnnSpatialTransformerStruct { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cudnnOpTensorStruct { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cudnnReduceTensorStruct { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cudnnCTCLossStruct { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cudnnTensorTransformStruct { _unused: [u8; 0], } impl cudnnDeterminism_t { pub const CUDNN_NON_DETERMINISTIC: cudnnDeterminism_t = cudnnDeterminism_t(0); } impl cudnnDeterminism_t { pub const CUDNN_DETERMINISTIC: cudnnDeterminism_t = cudnnDeterminism_t(1); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnDeterminism_t(pub ::core::ffi::c_uint); impl cudnnFoldingDirection_t { pub const CUDNN_TRANSFORM_FOLD: cudnnFoldingDirection_t = cudnnFoldingDirection_t(0); } impl cudnnFoldingDirection_t { pub const CUDNN_TRANSFORM_UNFOLD: cudnnFoldingDirection_t = cudnnFoldingDirection_t( 1, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnFoldingDirection_t(pub ::core::ffi::c_uint); impl cudnnOpTensorOp_t { pub const CUDNN_OP_TENSOR_ADD: cudnnOpTensorOp_t = cudnnOpTensorOp_t(0); } impl cudnnOpTensorOp_t { pub const CUDNN_OP_TENSOR_MUL: cudnnOpTensorOp_t = cudnnOpTensorOp_t(1); } impl cudnnOpTensorOp_t { pub const CUDNN_OP_TENSOR_MIN: cudnnOpTensorOp_t = cudnnOpTensorOp_t(2); } impl cudnnOpTensorOp_t { pub const CUDNN_OP_TENSOR_MAX: cudnnOpTensorOp_t = cudnnOpTensorOp_t(3); } impl cudnnOpTensorOp_t { pub const CUDNN_OP_TENSOR_SQRT: cudnnOpTensorOp_t = cudnnOpTensorOp_t(4); } impl cudnnOpTensorOp_t { pub const CUDNN_OP_TENSOR_NOT: cudnnOpTensorOp_t = cudnnOpTensorOp_t(5); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnOpTensorOp_t(pub ::core::ffi::c_uint); impl cudnnReduceTensorIndices_t { pub const CUDNN_REDUCE_TENSOR_NO_INDICES: cudnnReduceTensorIndices_t = cudnnReduceTensorIndices_t( 0, ); } impl cudnnReduceTensorIndices_t { pub const CUDNN_REDUCE_TENSOR_FLATTENED_INDICES: cudnnReduceTensorIndices_t = cudnnReduceTensorIndices_t( 1, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnReduceTensorIndices_t(pub ::core::ffi::c_uint); impl cudnnIndicesType_t { pub const CUDNN_32BIT_INDICES: cudnnIndicesType_t = cudnnIndicesType_t(0); } impl cudnnIndicesType_t { pub const CUDNN_64BIT_INDICES: cudnnIndicesType_t = cudnnIndicesType_t(1); } impl cudnnIndicesType_t { pub const CUDNN_16BIT_INDICES: cudnnIndicesType_t = cudnnIndicesType_t(2); } impl cudnnIndicesType_t { pub const CUDNN_8BIT_INDICES: cudnnIndicesType_t = cudnnIndicesType_t(3); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnIndicesType_t(pub ::core::ffi::c_uint); impl cudnnSoftmaxAlgorithm_t { pub const CUDNN_SOFTMAX_FAST: cudnnSoftmaxAlgorithm_t = cudnnSoftmaxAlgorithm_t(0); } impl cudnnSoftmaxAlgorithm_t { pub const CUDNN_SOFTMAX_ACCURATE: cudnnSoftmaxAlgorithm_t = cudnnSoftmaxAlgorithm_t( 1, ); } impl cudnnSoftmaxAlgorithm_t { pub const CUDNN_SOFTMAX_LOG: cudnnSoftmaxAlgorithm_t = cudnnSoftmaxAlgorithm_t(2); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnSoftmaxAlgorithm_t(pub ::core::ffi::c_uint); impl cudnnSoftmaxMode_t { pub const CUDNN_SOFTMAX_MODE_INSTANCE: cudnnSoftmaxMode_t = cudnnSoftmaxMode_t(0); } impl cudnnSoftmaxMode_t { pub const CUDNN_SOFTMAX_MODE_CHANNEL: cudnnSoftmaxMode_t = cudnnSoftmaxMode_t(1); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnSoftmaxMode_t(pub ::core::ffi::c_uint); impl cudnnPoolingMode_t { pub const CUDNN_POOLING_MAX: cudnnPoolingMode_t = cudnnPoolingMode_t(0); } impl cudnnPoolingMode_t { pub const CUDNN_POOLING_AVERAGE_COUNT_INCLUDE_PADDING: cudnnPoolingMode_t = cudnnPoolingMode_t( 1, ); } impl cudnnPoolingMode_t { pub const CUDNN_POOLING_AVERAGE_COUNT_EXCLUDE_PADDING: cudnnPoolingMode_t = cudnnPoolingMode_t( 2, ); } impl cudnnPoolingMode_t { pub const CUDNN_POOLING_MAX_DETERMINISTIC: cudnnPoolingMode_t = cudnnPoolingMode_t( 3, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnPoolingMode_t(pub ::core::ffi::c_uint); impl cudnnLRNMode_t { pub const CUDNN_LRN_CROSS_CHANNEL_DIM1: cudnnLRNMode_t = cudnnLRNMode_t(0); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnLRNMode_t(pub ::core::ffi::c_uint); impl cudnnDivNormMode_t { pub const CUDNN_DIVNORM_PRECOMPUTED_MEANS: cudnnDivNormMode_t = cudnnDivNormMode_t( 0, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnDivNormMode_t(pub ::core::ffi::c_uint); impl cudnnBatchNormMode_t { pub const CUDNN_BATCHNORM_PER_ACTIVATION: cudnnBatchNormMode_t = cudnnBatchNormMode_t( 0, ); } impl cudnnBatchNormMode_t { pub const CUDNN_BATCHNORM_SPATIAL: cudnnBatchNormMode_t = cudnnBatchNormMode_t(1); } impl cudnnBatchNormMode_t { pub const CUDNN_BATCHNORM_SPATIAL_PERSISTENT: cudnnBatchNormMode_t = cudnnBatchNormMode_t( 2, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnBatchNormMode_t(pub ::core::ffi::c_uint); impl cudnnBatchNormOps_t { pub const CUDNN_BATCHNORM_OPS_BN: cudnnBatchNormOps_t = cudnnBatchNormOps_t(0); } impl cudnnBatchNormOps_t { pub const CUDNN_BATCHNORM_OPS_BN_ACTIVATION: cudnnBatchNormOps_t = cudnnBatchNormOps_t( 1, ); } impl cudnnBatchNormOps_t { pub const CUDNN_BATCHNORM_OPS_BN_ADD_ACTIVATION: cudnnBatchNormOps_t = cudnnBatchNormOps_t( 2, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnBatchNormOps_t(pub ::core::ffi::c_uint); impl cudnnNormMode_t { pub const CUDNN_NORM_PER_ACTIVATION: cudnnNormMode_t = cudnnNormMode_t(0); } impl cudnnNormMode_t { pub const CUDNN_NORM_PER_CHANNEL: cudnnNormMode_t = cudnnNormMode_t(1); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnNormMode_t(pub ::core::ffi::c_uint); impl cudnnNormAlgo_t { pub const CUDNN_NORM_ALGO_STANDARD: cudnnNormAlgo_t = cudnnNormAlgo_t(0); } impl cudnnNormAlgo_t { pub const CUDNN_NORM_ALGO_PERSIST: cudnnNormAlgo_t = cudnnNormAlgo_t(1); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnNormAlgo_t(pub ::core::ffi::c_uint); impl cudnnNormOps_t { pub const CUDNN_NORM_OPS_NORM: cudnnNormOps_t = cudnnNormOps_t(0); } impl cudnnNormOps_t { pub const CUDNN_NORM_OPS_NORM_ACTIVATION: cudnnNormOps_t = cudnnNormOps_t(1); } impl cudnnNormOps_t { pub const CUDNN_NORM_OPS_NORM_ADD_ACTIVATION: cudnnNormOps_t = cudnnNormOps_t(2); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnNormOps_t(pub ::core::ffi::c_uint); impl cudnnSamplerType_t { pub const CUDNN_SAMPLER_BILINEAR: cudnnSamplerType_t = cudnnSamplerType_t(0); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnSamplerType_t(pub ::core::ffi::c_uint); #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cudnnDropoutStruct { _unused: [u8; 0], } impl cudnnConvolutionFwdAlgo_t { pub const CUDNN_CONVOLUTION_FWD_ALGO_IMPLICIT_GEMM: cudnnConvolutionFwdAlgo_t = cudnnConvolutionFwdAlgo_t( 0, ); } impl cudnnConvolutionFwdAlgo_t { pub const CUDNN_CONVOLUTION_FWD_ALGO_IMPLICIT_PRECOMP_GEMM: cudnnConvolutionFwdAlgo_t = cudnnConvolutionFwdAlgo_t( 1, ); } impl cudnnConvolutionFwdAlgo_t { pub const CUDNN_CONVOLUTION_FWD_ALGO_GEMM: cudnnConvolutionFwdAlgo_t = cudnnConvolutionFwdAlgo_t( 2, ); } impl cudnnConvolutionFwdAlgo_t { pub const CUDNN_CONVOLUTION_FWD_ALGO_DIRECT: cudnnConvolutionFwdAlgo_t = cudnnConvolutionFwdAlgo_t( 3, ); } impl cudnnConvolutionFwdAlgo_t { pub const CUDNN_CONVOLUTION_FWD_ALGO_FFT: cudnnConvolutionFwdAlgo_t = cudnnConvolutionFwdAlgo_t( 4, ); } impl cudnnConvolutionFwdAlgo_t { pub const CUDNN_CONVOLUTION_FWD_ALGO_FFT_TILING: cudnnConvolutionFwdAlgo_t = cudnnConvolutionFwdAlgo_t( 5, ); } impl cudnnConvolutionFwdAlgo_t { pub const CUDNN_CONVOLUTION_FWD_ALGO_WINOGRAD: cudnnConvolutionFwdAlgo_t = cudnnConvolutionFwdAlgo_t( 6, ); } impl cudnnConvolutionFwdAlgo_t { pub const CUDNN_CONVOLUTION_FWD_ALGO_WINOGRAD_NONFUSED: cudnnConvolutionFwdAlgo_t = cudnnConvolutionFwdAlgo_t( 7, ); } impl cudnnConvolutionFwdAlgo_t { pub const CUDNN_CONVOLUTION_FWD_ALGO_COUNT: cudnnConvolutionFwdAlgo_t = cudnnConvolutionFwdAlgo_t( 8, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnConvolutionFwdAlgo_t(pub ::core::ffi::c_uint); impl cudnnConvolutionBwdFilterAlgo_t { pub const CUDNN_CONVOLUTION_BWD_FILTER_ALGO_0: cudnnConvolutionBwdFilterAlgo_t = cudnnConvolutionBwdFilterAlgo_t( 0, ); } impl cudnnConvolutionBwdFilterAlgo_t { pub const CUDNN_CONVOLUTION_BWD_FILTER_ALGO_1: cudnnConvolutionBwdFilterAlgo_t = cudnnConvolutionBwdFilterAlgo_t( 1, ); } impl cudnnConvolutionBwdFilterAlgo_t { pub const CUDNN_CONVOLUTION_BWD_FILTER_ALGO_FFT: cudnnConvolutionBwdFilterAlgo_t = cudnnConvolutionBwdFilterAlgo_t( 2, ); } impl cudnnConvolutionBwdFilterAlgo_t { pub const CUDNN_CONVOLUTION_BWD_FILTER_ALGO_3: cudnnConvolutionBwdFilterAlgo_t = cudnnConvolutionBwdFilterAlgo_t( 3, ); } impl cudnnConvolutionBwdFilterAlgo_t { pub const CUDNN_CONVOLUTION_BWD_FILTER_ALGO_WINOGRAD: cudnnConvolutionBwdFilterAlgo_t = cudnnConvolutionBwdFilterAlgo_t( 4, ); } impl cudnnConvolutionBwdFilterAlgo_t { pub const CUDNN_CONVOLUTION_BWD_FILTER_ALGO_WINOGRAD_NONFUSED: cudnnConvolutionBwdFilterAlgo_t = cudnnConvolutionBwdFilterAlgo_t( 5, ); } impl cudnnConvolutionBwdFilterAlgo_t { pub const CUDNN_CONVOLUTION_BWD_FILTER_ALGO_FFT_TILING: cudnnConvolutionBwdFilterAlgo_t = cudnnConvolutionBwdFilterAlgo_t( 6, ); } impl cudnnConvolutionBwdFilterAlgo_t { pub const CUDNN_CONVOLUTION_BWD_FILTER_ALGO_COUNT: cudnnConvolutionBwdFilterAlgo_t = cudnnConvolutionBwdFilterAlgo_t( 7, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnConvolutionBwdFilterAlgo_t(pub ::core::ffi::c_uint); impl cudnnConvolutionBwdDataAlgo_t { pub const CUDNN_CONVOLUTION_BWD_DATA_ALGO_0: cudnnConvolutionBwdDataAlgo_t = cudnnConvolutionBwdDataAlgo_t( 0, ); } impl cudnnConvolutionBwdDataAlgo_t { pub const CUDNN_CONVOLUTION_BWD_DATA_ALGO_1: cudnnConvolutionBwdDataAlgo_t = cudnnConvolutionBwdDataAlgo_t( 1, ); } impl cudnnConvolutionBwdDataAlgo_t { pub const CUDNN_CONVOLUTION_BWD_DATA_ALGO_FFT: cudnnConvolutionBwdDataAlgo_t = cudnnConvolutionBwdDataAlgo_t( 2, ); } impl cudnnConvolutionBwdDataAlgo_t { pub const CUDNN_CONVOLUTION_BWD_DATA_ALGO_FFT_TILING: cudnnConvolutionBwdDataAlgo_t = cudnnConvolutionBwdDataAlgo_t( 3, ); } impl cudnnConvolutionBwdDataAlgo_t { pub const CUDNN_CONVOLUTION_BWD_DATA_ALGO_WINOGRAD: cudnnConvolutionBwdDataAlgo_t = cudnnConvolutionBwdDataAlgo_t( 4, ); } impl cudnnConvolutionBwdDataAlgo_t { pub const CUDNN_CONVOLUTION_BWD_DATA_ALGO_WINOGRAD_NONFUSED: cudnnConvolutionBwdDataAlgo_t = cudnnConvolutionBwdDataAlgo_t( 5, ); } impl cudnnConvolutionBwdDataAlgo_t { pub const CUDNN_CONVOLUTION_BWD_DATA_ALGO_COUNT: cudnnConvolutionBwdDataAlgo_t = cudnnConvolutionBwdDataAlgo_t( 6, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnConvolutionBwdDataAlgo_t(pub ::core::ffi::c_uint); impl cudnnCTCLossAlgo_t { pub const CUDNN_CTC_LOSS_ALGO_DETERMINISTIC: cudnnCTCLossAlgo_t = cudnnCTCLossAlgo_t( 0, ); } impl cudnnCTCLossAlgo_t { pub const CUDNN_CTC_LOSS_ALGO_NON_DETERMINISTIC: cudnnCTCLossAlgo_t = cudnnCTCLossAlgo_t( 1, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnCTCLossAlgo_t(pub ::core::ffi::c_uint); impl cudnnRNNAlgo_t { pub const CUDNN_RNN_ALGO_STANDARD: cudnnRNNAlgo_t = cudnnRNNAlgo_t(0); } impl cudnnRNNAlgo_t { pub const CUDNN_RNN_ALGO_PERSIST_STATIC: cudnnRNNAlgo_t = cudnnRNNAlgo_t(1); } impl cudnnRNNAlgo_t { pub const CUDNN_RNN_ALGO_PERSIST_DYNAMIC: cudnnRNNAlgo_t = cudnnRNNAlgo_t(2); } impl cudnnRNNAlgo_t { pub const CUDNN_RNN_ALGO_PERSIST_STATIC_SMALL_H: cudnnRNNAlgo_t = cudnnRNNAlgo_t(3); } impl cudnnRNNAlgo_t { pub const CUDNN_RNN_ALGO_COUNT: cudnnRNNAlgo_t = cudnnRNNAlgo_t(4); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnRNNAlgo_t(pub ::core::ffi::c_uint); impl cudnnForwardMode_t { pub const CUDNN_FWD_MODE_INFERENCE: cudnnForwardMode_t = cudnnForwardMode_t(0); } impl cudnnForwardMode_t { pub const CUDNN_FWD_MODE_TRAINING: cudnnForwardMode_t = cudnnForwardMode_t(1); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnForwardMode_t(pub ::core::ffi::c_uint); impl cudnnRNNMode_t { pub const CUDNN_RNN_RELU: cudnnRNNMode_t = cudnnRNNMode_t(0); } impl cudnnRNNMode_t { pub const CUDNN_RNN_TANH: cudnnRNNMode_t = cudnnRNNMode_t(1); } impl cudnnRNNMode_t { pub const CUDNN_LSTM: cudnnRNNMode_t = cudnnRNNMode_t(2); } impl cudnnRNNMode_t { pub const CUDNN_GRU: cudnnRNNMode_t = cudnnRNNMode_t(3); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnRNNMode_t(pub ::core::ffi::c_uint); impl cudnnRNNBiasMode_t { pub const CUDNN_RNN_NO_BIAS: cudnnRNNBiasMode_t = cudnnRNNBiasMode_t(0); } impl cudnnRNNBiasMode_t { pub const CUDNN_RNN_SINGLE_INP_BIAS: cudnnRNNBiasMode_t = cudnnRNNBiasMode_t(1); } impl cudnnRNNBiasMode_t { pub const CUDNN_RNN_DOUBLE_BIAS: cudnnRNNBiasMode_t = cudnnRNNBiasMode_t(2); } impl cudnnRNNBiasMode_t { pub const CUDNN_RNN_SINGLE_REC_BIAS: cudnnRNNBiasMode_t = cudnnRNNBiasMode_t(3); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnRNNBiasMode_t(pub ::core::ffi::c_uint); impl cudnnDirectionMode_t { pub const CUDNN_UNIDIRECTIONAL: cudnnDirectionMode_t = cudnnDirectionMode_t(0); } impl cudnnDirectionMode_t { pub const CUDNN_BIDIRECTIONAL: cudnnDirectionMode_t = cudnnDirectionMode_t(1); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnDirectionMode_t(pub ::core::ffi::c_uint); impl cudnnRNNInputMode_t { pub const CUDNN_LINEAR_INPUT: cudnnRNNInputMode_t = cudnnRNNInputMode_t(0); } impl cudnnRNNInputMode_t { pub const CUDNN_SKIP_INPUT: cudnnRNNInputMode_t = cudnnRNNInputMode_t(1); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnRNNInputMode_t(pub ::core::ffi::c_uint); impl cudnnRNNClipMode_t { pub const CUDNN_RNN_CLIP_NONE: cudnnRNNClipMode_t = cudnnRNNClipMode_t(0); } impl cudnnRNNClipMode_t { pub const CUDNN_RNN_CLIP_MINMAX: cudnnRNNClipMode_t = cudnnRNNClipMode_t(1); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnRNNClipMode_t(pub ::core::ffi::c_uint); impl cudnnRNNDataLayout_t { pub const CUDNN_RNN_DATA_LAYOUT_SEQ_MAJOR_UNPACKED: cudnnRNNDataLayout_t = cudnnRNNDataLayout_t( 0, ); } impl cudnnRNNDataLayout_t { pub const CUDNN_RNN_DATA_LAYOUT_SEQ_MAJOR_PACKED: cudnnRNNDataLayout_t = cudnnRNNDataLayout_t( 1, ); } impl cudnnRNNDataLayout_t { pub const CUDNN_RNN_DATA_LAYOUT_BATCH_MAJOR_UNPACKED: cudnnRNNDataLayout_t = cudnnRNNDataLayout_t( 2, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnRNNDataLayout_t(pub ::core::ffi::c_uint); #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cudnnRNNStruct { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cudnnRNNDataStruct { _unused: [u8; 0], } impl cudnnSeqDataAxis_t { pub const CUDNN_SEQDATA_TIME_DIM: cudnnSeqDataAxis_t = cudnnSeqDataAxis_t(0); } impl cudnnSeqDataAxis_t { pub const CUDNN_SEQDATA_BATCH_DIM: cudnnSeqDataAxis_t = cudnnSeqDataAxis_t(1); } impl cudnnSeqDataAxis_t { pub const CUDNN_SEQDATA_BEAM_DIM: cudnnSeqDataAxis_t = cudnnSeqDataAxis_t(2); } impl cudnnSeqDataAxis_t { pub const CUDNN_SEQDATA_VECT_DIM: cudnnSeqDataAxis_t = cudnnSeqDataAxis_t(3); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnSeqDataAxis_t(pub ::core::ffi::c_uint); #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cudnnSeqDataStruct { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cudnnAttnStruct { _unused: [u8; 0], } impl cudnnMultiHeadAttnWeightKind_t { pub const CUDNN_MH_ATTN_Q_WEIGHTS: cudnnMultiHeadAttnWeightKind_t = cudnnMultiHeadAttnWeightKind_t( 0, ); } impl cudnnMultiHeadAttnWeightKind_t { pub const CUDNN_MH_ATTN_K_WEIGHTS: cudnnMultiHeadAttnWeightKind_t = cudnnMultiHeadAttnWeightKind_t( 1, ); } impl cudnnMultiHeadAttnWeightKind_t { pub const CUDNN_MH_ATTN_V_WEIGHTS: cudnnMultiHeadAttnWeightKind_t = cudnnMultiHeadAttnWeightKind_t( 2, ); } impl cudnnMultiHeadAttnWeightKind_t { pub const CUDNN_MH_ATTN_O_WEIGHTS: cudnnMultiHeadAttnWeightKind_t = cudnnMultiHeadAttnWeightKind_t( 3, ); } impl cudnnMultiHeadAttnWeightKind_t { pub const CUDNN_MH_ATTN_Q_BIASES: cudnnMultiHeadAttnWeightKind_t = cudnnMultiHeadAttnWeightKind_t( 4, ); } impl cudnnMultiHeadAttnWeightKind_t { pub const CUDNN_MH_ATTN_K_BIASES: cudnnMultiHeadAttnWeightKind_t = cudnnMultiHeadAttnWeightKind_t( 5, ); } impl cudnnMultiHeadAttnWeightKind_t { pub const CUDNN_MH_ATTN_V_BIASES: cudnnMultiHeadAttnWeightKind_t = cudnnMultiHeadAttnWeightKind_t( 6, ); } impl cudnnMultiHeadAttnWeightKind_t { pub const CUDNN_MH_ATTN_O_BIASES: cudnnMultiHeadAttnWeightKind_t = cudnnMultiHeadAttnWeightKind_t( 7, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnMultiHeadAttnWeightKind_t(pub ::core::ffi::c_uint); impl cudnnWgradMode_t { pub const CUDNN_WGRAD_MODE_ADD: cudnnWgradMode_t = cudnnWgradMode_t(0); } impl cudnnWgradMode_t { pub const CUDNN_WGRAD_MODE_SET: cudnnWgradMode_t = cudnnWgradMode_t(1); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnWgradMode_t(pub ::core::ffi::c_uint); impl cudnnLossNormalizationMode_t { pub const CUDNN_LOSS_NORMALIZATION_NONE: cudnnLossNormalizationMode_t = cudnnLossNormalizationMode_t( 0, ); } impl cudnnLossNormalizationMode_t { pub const CUDNN_LOSS_NORMALIZATION_SOFTMAX: cudnnLossNormalizationMode_t = cudnnLossNormalizationMode_t( 1, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnLossNormalizationMode_t(pub ::core::ffi::c_uint); #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cudnnConvolutionStruct { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cudnnFusedOpsConstParamStruct { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cudnnFusedOpsVariantParamStruct { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cudnnFusedOpsPlanStruct { _unused: [u8; 0], } impl cudnnFusedOps_t { pub const CUDNN_FUSED_SCALE_BIAS_ACTIVATION_CONV_BNSTATS: cudnnFusedOps_t = cudnnFusedOps_t( 0, ); } impl cudnnFusedOps_t { pub const CUDNN_FUSED_SCALE_BIAS_ACTIVATION_WGRAD: cudnnFusedOps_t = cudnnFusedOps_t( 1, ); } impl cudnnFusedOps_t { pub const CUDNN_FUSED_BN_FINALIZE_STATISTICS_TRAINING: cudnnFusedOps_t = cudnnFusedOps_t( 2, ); } impl cudnnFusedOps_t { pub const CUDNN_FUSED_BN_FINALIZE_STATISTICS_INFERENCE: cudnnFusedOps_t = cudnnFusedOps_t( 3, ); } impl cudnnFusedOps_t { pub const CUDNN_FUSED_CONV_SCALE_BIAS_ADD_ACTIVATION: cudnnFusedOps_t = cudnnFusedOps_t( 4, ); } impl cudnnFusedOps_t { pub const CUDNN_FUSED_SCALE_BIAS_ADD_ACTIVATION_GEN_BITMASK: cudnnFusedOps_t = cudnnFusedOps_t( 5, ); } impl cudnnFusedOps_t { pub const CUDNN_FUSED_DACTIVATION_FORK_DBATCHNORM: cudnnFusedOps_t = cudnnFusedOps_t( 6, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnFusedOps_t(pub ::core::ffi::c_uint); impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_XDESC: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 0, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_XDATA_PLACEHOLDER: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 1, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_BN_MODE: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 2, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_BN_EQSCALEBIAS_DESC: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 3, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_BN_EQSCALE_PLACEHOLDER: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 4, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_BN_EQBIAS_PLACEHOLDER: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 5, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_ACTIVATION_DESC: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 6, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_CONV_DESC: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 7, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_WDESC: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 8, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_WDATA_PLACEHOLDER: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 9, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_DWDESC: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 10, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_DWDATA_PLACEHOLDER: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 11, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_YDESC: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 12, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_YDATA_PLACEHOLDER: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 13, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_DYDESC: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 14, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_DYDATA_PLACEHOLDER: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 15, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_YSTATS_DESC: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 16, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_YSUM_PLACEHOLDER: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 17, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_YSQSUM_PLACEHOLDER: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 18, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_BN_SCALEBIAS_MEANVAR_DESC: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 19, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_BN_SCALE_PLACEHOLDER: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 20, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_BN_BIAS_PLACEHOLDER: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 21, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_BN_SAVED_MEAN_PLACEHOLDER: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 22, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_BN_SAVED_INVSTD_PLACEHOLDER: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 23, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_BN_RUNNING_MEAN_PLACEHOLDER: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 24, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_BN_RUNNING_VAR_PLACEHOLDER: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 25, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_ZDESC: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 26, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_ZDATA_PLACEHOLDER: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 27, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_BN_Z_EQSCALEBIAS_DESC: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 28, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_BN_Z_EQSCALE_PLACEHOLDER: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 29, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_BN_Z_EQBIAS_PLACEHOLDER: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 30, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_ACTIVATION_BITMASK_DESC: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 31, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_ACTIVATION_BITMASK_PLACEHOLDER: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 32, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_DXDESC: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 33, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_DXDATA_PLACEHOLDER: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 34, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_DZDESC: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 35, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_DZDATA_PLACEHOLDER: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 36, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_BN_DSCALE_PLACEHOLDER: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 37, ); } impl cudnnFusedOpsConstParamLabel_t { pub const CUDNN_PARAM_BN_DBIAS_PLACEHOLDER: cudnnFusedOpsConstParamLabel_t = cudnnFusedOpsConstParamLabel_t( 38, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnFusedOpsConstParamLabel_t(pub ::core::ffi::c_uint); impl cudnnFusedOpsPointerPlaceHolder_t { pub const CUDNN_PTR_NULL: cudnnFusedOpsPointerPlaceHolder_t = cudnnFusedOpsPointerPlaceHolder_t( 0, ); } impl cudnnFusedOpsPointerPlaceHolder_t { pub const CUDNN_PTR_ELEM_ALIGNED: cudnnFusedOpsPointerPlaceHolder_t = cudnnFusedOpsPointerPlaceHolder_t( 1, ); } impl cudnnFusedOpsPointerPlaceHolder_t { pub const CUDNN_PTR_16B_ALIGNED: cudnnFusedOpsPointerPlaceHolder_t = cudnnFusedOpsPointerPlaceHolder_t( 2, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnFusedOpsPointerPlaceHolder_t(pub ::core::ffi::c_uint); impl cudnnFusedOpsVariantParamLabel_t { pub const CUDNN_PTR_XDATA: cudnnFusedOpsVariantParamLabel_t = cudnnFusedOpsVariantParamLabel_t( 0, ); } impl cudnnFusedOpsVariantParamLabel_t { pub const CUDNN_PTR_BN_EQSCALE: cudnnFusedOpsVariantParamLabel_t = cudnnFusedOpsVariantParamLabel_t( 1, ); } impl cudnnFusedOpsVariantParamLabel_t { pub const CUDNN_PTR_BN_EQBIAS: cudnnFusedOpsVariantParamLabel_t = cudnnFusedOpsVariantParamLabel_t( 2, ); } impl cudnnFusedOpsVariantParamLabel_t { pub const CUDNN_PTR_WDATA: cudnnFusedOpsVariantParamLabel_t = cudnnFusedOpsVariantParamLabel_t( 3, ); } impl cudnnFusedOpsVariantParamLabel_t { pub const CUDNN_PTR_DWDATA: cudnnFusedOpsVariantParamLabel_t = cudnnFusedOpsVariantParamLabel_t( 4, ); } impl cudnnFusedOpsVariantParamLabel_t { pub const CUDNN_PTR_YDATA: cudnnFusedOpsVariantParamLabel_t = cudnnFusedOpsVariantParamLabel_t( 5, ); } impl cudnnFusedOpsVariantParamLabel_t { pub const CUDNN_PTR_DYDATA: cudnnFusedOpsVariantParamLabel_t = cudnnFusedOpsVariantParamLabel_t( 6, ); } impl cudnnFusedOpsVariantParamLabel_t { pub const CUDNN_PTR_YSUM: cudnnFusedOpsVariantParamLabel_t = cudnnFusedOpsVariantParamLabel_t( 7, ); } impl cudnnFusedOpsVariantParamLabel_t { pub const CUDNN_PTR_YSQSUM: cudnnFusedOpsVariantParamLabel_t = cudnnFusedOpsVariantParamLabel_t( 8, ); } impl cudnnFusedOpsVariantParamLabel_t { pub const CUDNN_PTR_WORKSPACE: cudnnFusedOpsVariantParamLabel_t = cudnnFusedOpsVariantParamLabel_t( 9, ); } impl cudnnFusedOpsVariantParamLabel_t { pub const CUDNN_PTR_BN_SCALE: cudnnFusedOpsVariantParamLabel_t = cudnnFusedOpsVariantParamLabel_t( 10, ); } impl cudnnFusedOpsVariantParamLabel_t { pub const CUDNN_PTR_BN_BIAS: cudnnFusedOpsVariantParamLabel_t = cudnnFusedOpsVariantParamLabel_t( 11, ); } impl cudnnFusedOpsVariantParamLabel_t { pub const CUDNN_PTR_BN_SAVED_MEAN: cudnnFusedOpsVariantParamLabel_t = cudnnFusedOpsVariantParamLabel_t( 12, ); } impl cudnnFusedOpsVariantParamLabel_t { pub const CUDNN_PTR_BN_SAVED_INVSTD: cudnnFusedOpsVariantParamLabel_t = cudnnFusedOpsVariantParamLabel_t( 13, ); } impl cudnnFusedOpsVariantParamLabel_t { pub const CUDNN_PTR_BN_RUNNING_MEAN: cudnnFusedOpsVariantParamLabel_t = cudnnFusedOpsVariantParamLabel_t( 14, ); } impl cudnnFusedOpsVariantParamLabel_t { pub const CUDNN_PTR_BN_RUNNING_VAR: cudnnFusedOpsVariantParamLabel_t = cudnnFusedOpsVariantParamLabel_t( 15, ); } impl cudnnFusedOpsVariantParamLabel_t { pub const CUDNN_PTR_ZDATA: cudnnFusedOpsVariantParamLabel_t = cudnnFusedOpsVariantParamLabel_t( 16, ); } impl cudnnFusedOpsVariantParamLabel_t { pub const CUDNN_PTR_BN_Z_EQSCALE: cudnnFusedOpsVariantParamLabel_t = cudnnFusedOpsVariantParamLabel_t( 17, ); } impl cudnnFusedOpsVariantParamLabel_t { pub const CUDNN_PTR_BN_Z_EQBIAS: cudnnFusedOpsVariantParamLabel_t = cudnnFusedOpsVariantParamLabel_t( 18, ); } impl cudnnFusedOpsVariantParamLabel_t { pub const CUDNN_PTR_ACTIVATION_BITMASK: cudnnFusedOpsVariantParamLabel_t = cudnnFusedOpsVariantParamLabel_t( 19, ); } impl cudnnFusedOpsVariantParamLabel_t { pub const CUDNN_PTR_DXDATA: cudnnFusedOpsVariantParamLabel_t = cudnnFusedOpsVariantParamLabel_t( 20, ); } impl cudnnFusedOpsVariantParamLabel_t { pub const CUDNN_PTR_DZDATA: cudnnFusedOpsVariantParamLabel_t = cudnnFusedOpsVariantParamLabel_t( 21, ); } impl cudnnFusedOpsVariantParamLabel_t { pub const CUDNN_PTR_BN_DSCALE: cudnnFusedOpsVariantParamLabel_t = cudnnFusedOpsVariantParamLabel_t( 22, ); } impl cudnnFusedOpsVariantParamLabel_t { pub const CUDNN_PTR_BN_DBIAS: cudnnFusedOpsVariantParamLabel_t = cudnnFusedOpsVariantParamLabel_t( 23, ); } impl cudnnFusedOpsVariantParamLabel_t { pub const CUDNN_SCALAR_SIZE_T_WORKSPACE_SIZE_IN_BYTES: cudnnFusedOpsVariantParamLabel_t = cudnnFusedOpsVariantParamLabel_t( 100, ); } impl cudnnFusedOpsVariantParamLabel_t { pub const CUDNN_SCALAR_INT64_T_BN_ACCUMULATION_COUNT: cudnnFusedOpsVariantParamLabel_t = cudnnFusedOpsVariantParamLabel_t( 101, ); } impl cudnnFusedOpsVariantParamLabel_t { pub const CUDNN_SCALAR_DOUBLE_BN_EXP_AVG_FACTOR: cudnnFusedOpsVariantParamLabel_t = cudnnFusedOpsVariantParamLabel_t( 102, ); } impl cudnnFusedOpsVariantParamLabel_t { pub const CUDNN_SCALAR_DOUBLE_BN_EPSILON: cudnnFusedOpsVariantParamLabel_t = cudnnFusedOpsVariantParamLabel_t( 103, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnFusedOpsVariantParamLabel_t(pub ::core::ffi::c_uint); ================================================ FILE: cuda_types/src/cudnn8.rs ================================================ // Generated automatically by zluda_bindgen // DO NOT EDIT MANUALLY #![allow(warnings)] pub type __half = u16; pub type __nv_bfloat16 = u16; pub use super::cuda::cuComplex; pub use super::cuda::cuDoubleComplex; pub use super::cuda::cudaDataType; pub use super::cuda::cudaDataType_t; pub type cudaStream_t = super::cuda::CUstream; pub use super::cuda::libraryPropertyType; pub type cudaGraphExecUpdateResultInfo_st = super::cuda::CUgraphExecUpdateResultInfo_st; pub type cudaAsyncNotificationType = super::cuda::CUasyncNotificationType_enum; pub type cudaGraph_t = super::cuda::CUgraph; pub const CUDNN_MAJOR: u32 = 8; pub const CUDNN_MINOR: u32 = 9; pub const CUDNN_PATCHLEVEL: u32 = 7; pub const CUDNN_VERSION: u32 = 8907; pub const CUDNN_MAX_SM_MAJOR_NUMBER: u32 = 9; pub const CUDNN_MAX_SM_MINOR_NUMBER: u32 = 0; pub const CUDNN_MAX_DEVICE_VERSION: u32 = 900; pub const CUDNN_SM_50: u32 = 500; pub const CUDNN_SM_52: u32 = 520; pub const CUDNN_SM_53: u32 = 530; pub const CUDNN_SM_60: u32 = 600; pub const CUDNN_SM_61: u32 = 610; pub const CUDNN_SM_62: u32 = 620; pub const CUDNN_SM_70: u32 = 700; pub const CUDNN_SM_72: u32 = 720; pub const CUDNN_SM_75: u32 = 750; pub const CUDNN_SM_80: u32 = 800; pub const CUDNN_SM_86: u32 = 860; pub const CUDNN_SM_87: u32 = 870; pub const CUDNN_SM_89: u32 = 890; pub const CUDNN_SM_90: u32 = 900; pub const CUDNN_SM_9X_END: u32 = 999; pub const CUDNN_MIN_DEVICE_VERSION: u32 = 500; pub const CUDNN_OPS_INFER_MAJOR: u32 = 8; pub const CUDNN_OPS_INFER_MINOR: u32 = 9; pub const CUDNN_OPS_INFER_PATCH: u32 = 7; pub const CUDNN_DIM_MAX: u32 = 8; pub const CUDNN_LRN_MIN_N: u32 = 1; pub const CUDNN_LRN_MAX_N: u32 = 16; pub const CUDNN_LRN_MIN_K: f64 = 0.00001; pub const CUDNN_LRN_MIN_BETA: f64 = 0.01; pub const CUDNN_BN_MIN_EPSILON: f64 = 0.0; pub const CUDNN_OPS_TRAIN_MAJOR: u32 = 8; pub const CUDNN_OPS_TRAIN_MINOR: u32 = 9; pub const CUDNN_OPS_TRAIN_PATCH: u32 = 7; pub const CUDNN_ADV_INFER_MAJOR: u32 = 8; pub const CUDNN_ADV_INFER_MINOR: u32 = 9; pub const CUDNN_ADV_INFER_PATCH: u32 = 7; pub const CUDNN_RNN_PADDED_IO_DISABLED: u32 = 0; pub const CUDNN_RNN_PADDED_IO_ENABLED: u32 = 1; pub const CUDNN_SEQDATA_DIM_COUNT: u32 = 4; pub const CUDNN_ATTN_QUERYMAP_ALL_TO_ONE: u32 = 0; pub const CUDNN_ATTN_QUERYMAP_ONE_TO_ONE: u32 = 1; pub const CUDNN_ATTN_DISABLE_PROJ_BIASES: u32 = 0; pub const CUDNN_ATTN_ENABLE_PROJ_BIASES: u32 = 2; pub const CUDNN_ATTN_WKIND_COUNT: u32 = 8; pub const CUDNN_ADV_TRAIN_MAJOR: u32 = 8; pub const CUDNN_ADV_TRAIN_MINOR: u32 = 9; pub const CUDNN_ADV_TRAIN_PATCH: u32 = 7; pub const CUDNN_CNN_INFER_MAJOR: u32 = 8; pub const CUDNN_CNN_INFER_MINOR: u32 = 9; pub const CUDNN_CNN_INFER_PATCH: u32 = 7; pub const CUDNN_CNN_TRAIN_MAJOR: u32 = 8; pub const CUDNN_CNN_TRAIN_MINOR: u32 = 9; pub const CUDNN_CNN_TRAIN_PATCH: u32 = 7; pub use super::cudnn::cudnnContext; pub type cudnnHandle_t = *mut cudnnContext; pub use super::cudnn::cudnnRuntimeTag_t; pub use super::cudnn::cudnnErrQueryMode_t; pub use super::cudnn::cudnnTensorStruct; pub type cudnnTensorDescriptor_t = *mut cudnnTensorStruct; pub use super::cudnn::cudnnPoolingStruct; pub type cudnnPoolingDescriptor_t = *mut cudnnPoolingStruct; pub use super::cudnn::cudnnFilterStruct; pub type cudnnFilterDescriptor_t = *mut cudnnFilterStruct; pub use super::cudnn::cudnnLRNStruct; pub type cudnnLRNDescriptor_t = *mut cudnnLRNStruct; pub use super::cudnn::cudnnActivationStruct; pub type cudnnActivationDescriptor_t = *mut cudnnActivationStruct; pub use super::cudnn::cudnnSpatialTransformerStruct; pub type cudnnSpatialTransformerDescriptor_t = *mut cudnnSpatialTransformerStruct; pub use super::cudnn::cudnnOpTensorStruct; pub type cudnnOpTensorDescriptor_t = *mut cudnnOpTensorStruct; pub use super::cudnn::cudnnReduceTensorStruct; pub type cudnnReduceTensorDescriptor_t = *mut cudnnReduceTensorStruct; pub use super::cudnn::cudnnCTCLossStruct; pub type cudnnCTCLossDescriptor_t = *mut cudnnCTCLossStruct; pub use super::cudnn::cudnnTensorTransformStruct; pub type cudnnTensorTransformDescriptor_t = *mut cudnnTensorTransformStruct; pub use super::cudnn9::cudnnDataType_t; pub use super::cudnn::cudnnMathType_t; pub use super::cudnn::cudnnNanPropagation_t; pub use super::cudnn::cudnnDeterminism_t; pub use super::cudnn::cudnnTensorFormat_t; pub use super::cudnn::cudnnFoldingDirection_t; pub use super::cudnn::cudnnOpTensorOp_t; pub use super::cudnn::cudnnReduceTensorOp_t; pub use super::cudnn::cudnnReduceTensorIndices_t; pub use super::cudnn::cudnnIndicesType_t; pub use super::cudnn::cudnnSoftmaxAlgorithm_t; pub use super::cudnn::cudnnSoftmaxMode_t; pub use super::cudnn::cudnnPoolingMode_t; pub use super::cudnn::cudnnActivationMode_t; pub use super::cudnn::cudnnLRNMode_t; pub use super::cudnn::cudnnDivNormMode_t; pub use super::cudnn::cudnnBatchNormMode_t; pub use super::cudnn::cudnnBatchNormOps_t; pub use super::cudnn::cudnnNormMode_t; pub use super::cudnn::cudnnNormAlgo_t; pub use super::cudnn::cudnnNormOps_t; pub use super::cudnn::cudnnSamplerType_t; pub use super::cudnn::cudnnDropoutStruct; pub type cudnnDropoutDescriptor_t = *mut cudnnDropoutStruct; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cudnnAlgorithmStruct { _unused: [u8; 0], } pub type cudnnAlgorithmDescriptor_t = *mut cudnnAlgorithmStruct; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cudnnAlgorithmPerformanceStruct { _unused: [u8; 0], } pub type cudnnAlgorithmPerformance_t = *mut cudnnAlgorithmPerformanceStruct; pub use super::cudnn::cudnnConvolutionFwdAlgo_t; pub use super::cudnn::cudnnConvolutionBwdFilterAlgo_t; pub use super::cudnn::cudnnConvolutionBwdDataAlgo_t; pub use super::cudnn::cudnnRNNAlgo_t; pub use super::cudnn::cudnnCTCLossAlgo_t; #[repr(C)] #[derive(Copy, Clone)] pub struct cudnnAlgorithmUnionStruct { pub algo: cudnnAlgorithmUnionStruct_Algorithm, } #[repr(C)] #[derive(Copy, Clone)] pub union cudnnAlgorithmUnionStruct_Algorithm { pub convFwdAlgo: cudnnConvolutionFwdAlgo_t, pub convBwdFilterAlgo: cudnnConvolutionBwdFilterAlgo_t, pub convBwdDataAlgo: cudnnConvolutionBwdDataAlgo_t, pub RNNAlgo: cudnnRNNAlgo_t, pub CTCLossAlgo: cudnnCTCLossAlgo_t, } pub type cudnnAlgorithm_t = cudnnAlgorithmUnionStruct; pub use super::cudnn::cudnnSeverity_t; #[repr(C)] pub struct cudnnDebugStruct { pub cudnn_version: ::core::ffi::c_uint, pub cudnnStatus: cudnnStatus_t, pub time_sec: ::core::ffi::c_uint, pub time_usec: ::core::ffi::c_uint, pub time_delta: ::core::ffi::c_uint, pub handle: cudnnHandle_t, pub stream: cudaStream_t, pub pid: ::core::ffi::c_ulonglong, pub tid: ::core::ffi::c_ulonglong, pub cudaDeviceId: ::core::ffi::c_int, pub reserved: [::core::ffi::c_int; 15usize], } pub type cudnnDebug_t = cudnnDebugStruct; pub type cudnnCallback_t = ::core::option::Option< unsafe extern "C" fn( sev: cudnnSeverity_t, udata: *mut ::core::ffi::c_void, dbg: *const cudnnDebug_t, msg: *const ::core::ffi::c_char, ), >; pub use super::cudnn::cudnnForwardMode_t; pub use super::cudnn::cudnnRNNMode_t; pub use super::cudnn::cudnnRNNBiasMode_t; pub use super::cudnn::cudnnDirectionMode_t; pub use super::cudnn::cudnnRNNInputMode_t; pub use super::cudnn::cudnnRNNClipMode_t; pub use super::cudnn::cudnnRNNDataLayout_t; pub type cudnnRNNPaddingMode_t = ::core::ffi::c_uint; pub use super::cudnn::cudnnRNNStruct; pub type cudnnRNNDescriptor_t = *mut cudnnRNNStruct; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cudnnPersistentRNNPlan { _unused: [u8; 0], } pub type cudnnPersistentRNNPlan_t = *mut cudnnPersistentRNNPlan; pub use super::cudnn::cudnnRNNDataStruct; pub type cudnnRNNDataDescriptor_t = *mut cudnnRNNDataStruct; pub use super::cudnn::cudnnSeqDataAxis_t; pub use super::cudnn::cudnnSeqDataStruct; pub type cudnnSeqDataDescriptor_t = *mut cudnnSeqDataStruct; pub type cudnnAttnQueryMap_t = ::core::ffi::c_uint; pub use super::cudnn::cudnnAttnStruct; pub type cudnnAttnDescriptor_t = *mut cudnnAttnStruct; pub use super::cudnn::cudnnMultiHeadAttnWeightKind_t; pub use super::cudnn::cudnnWgradMode_t; pub use super::cudnn::cudnnLossNormalizationMode_t; pub use super::cudnn::cudnnConvolutionStruct; pub type cudnnConvolutionDescriptor_t = *mut cudnnConvolutionStruct; pub use super::cudnn::cudnnConvolutionMode_t; pub use super::cudnn::cudnnReorderType_t; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct cudnnConvolutionFwdAlgoPerfStruct { pub algo: cudnnConvolutionFwdAlgo_t, pub status: cudnnStatus_t, pub time: f32, pub memory: usize, pub determinism: cudnnDeterminism_t, pub mathType: cudnnMathType_t, pub reserved: [::core::ffi::c_int; 3usize], } pub type cudnnConvolutionFwdAlgoPerf_t = cudnnConvolutionFwdAlgoPerfStruct; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct cudnnConvolutionBwdDataAlgoPerfStruct { pub algo: cudnnConvolutionBwdDataAlgo_t, pub status: cudnnStatus_t, pub time: f32, pub memory: usize, pub determinism: cudnnDeterminism_t, pub mathType: cudnnMathType_t, pub reserved: [::core::ffi::c_int; 3usize], } pub type cudnnConvolutionBwdDataAlgoPerf_t = cudnnConvolutionBwdDataAlgoPerfStruct; pub use super::cudnn::cudnnFusedOpsConstParamStruct; pub type cudnnFusedOpsConstParamPack_t = *mut cudnnFusedOpsConstParamStruct; pub use super::cudnn::cudnnFusedOpsVariantParamStruct; pub type cudnnFusedOpsVariantParamPack_t = *mut cudnnFusedOpsVariantParamStruct; pub use super::cudnn::cudnnFusedOpsPlanStruct; pub type cudnnFusedOpsPlan_t = *mut cudnnFusedOpsPlanStruct; pub use super::cudnn::cudnnFusedOps_t; pub use super::cudnn::cudnnFusedOpsConstParamLabel_t; pub use super::cudnn::cudnnFusedOpsPointerPlaceHolder_t; pub use super::cudnn::cudnnFusedOpsVariantParamLabel_t; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct cudnnConvolutionBwdFilterAlgoPerfStruct { pub algo: cudnnConvolutionBwdFilterAlgo_t, pub status: cudnnStatus_t, pub time: f32, pub memory: usize, pub determinism: cudnnDeterminism_t, pub mathType: cudnnMathType_t, pub reserved: [::core::ffi::c_int; 3usize], } pub type cudnnConvolutionBwdFilterAlgoPerf_t = cudnnConvolutionBwdFilterAlgoPerfStruct; pub type cudnnBackendDescriptor_t = *mut ::core::ffi::c_void; pub use super::cudnn::cudnnFractionStruct; pub type cudnnFraction_t = cudnnFractionStruct; pub use super::cudnn9::cudnnPointwiseMode_t; pub use super::cudnn::cudnnResampleMode_t; pub use super::cudnn::cudnnSignalMode_t; pub use super::cudnn::cudnnGenStatsMode_t; pub use super::cudnn::cudnnBnFinalizeStatsMode_t; pub use super::cudnn::cudnnRngDistribution_t; pub use super::cudnn9::cudnnBackendAttributeName_t; pub use super::cudnn::cudnnBackendAttributeType_t; pub use super::cudnn9::cudnnBackendDescriptorType_t; impl cudnnBackendNumericalNote_t { pub const CUDNN_NUMERICAL_NOTE_TENSOR_CORE: cudnnBackendNumericalNote_t = cudnnBackendNumericalNote_t( 0, ); } impl cudnnBackendNumericalNote_t { pub const CUDNN_NUMERICAL_NOTE_DOWN_CONVERT_INPUTS: cudnnBackendNumericalNote_t = cudnnBackendNumericalNote_t( 1, ); } impl cudnnBackendNumericalNote_t { pub const CUDNN_NUMERICAL_NOTE_REDUCED_PRECISION_REDUCTION: cudnnBackendNumericalNote_t = cudnnBackendNumericalNote_t( 2, ); } impl cudnnBackendNumericalNote_t { pub const CUDNN_NUMERICAL_NOTE_FFT: cudnnBackendNumericalNote_t = cudnnBackendNumericalNote_t( 3, ); } impl cudnnBackendNumericalNote_t { pub const CUDNN_NUMERICAL_NOTE_NONDETERMINISTIC: cudnnBackendNumericalNote_t = cudnnBackendNumericalNote_t( 4, ); } impl cudnnBackendNumericalNote_t { pub const CUDNN_NUMERICAL_NOTE_WINOGRAD: cudnnBackendNumericalNote_t = cudnnBackendNumericalNote_t( 5, ); } impl cudnnBackendNumericalNote_t { pub const CUDNN_NUMERICAL_NOTE_WINOGRAD_TILE_4x4: cudnnBackendNumericalNote_t = cudnnBackendNumericalNote_t( 6, ); } impl cudnnBackendNumericalNote_t { pub const CUDNN_NUMERICAL_NOTE_WINOGRAD_TILE_6x6: cudnnBackendNumericalNote_t = cudnnBackendNumericalNote_t( 7, ); } impl cudnnBackendNumericalNote_t { pub const CUDNN_NUMERICAL_NOTE_WINOGRAD_TILE_13x13: cudnnBackendNumericalNote_t = cudnnBackendNumericalNote_t( 8, ); } impl cudnnBackendNumericalNote_t { pub const CUDNN_NUMERICAL_NOTE_TYPE_COUNT: cudnnBackendNumericalNote_t = cudnnBackendNumericalNote_t( 9, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnBackendNumericalNote_t(pub ::core::ffi::c_uint); impl cudnnBackendBehaviorNote_t { pub const CUDNN_BEHAVIOR_NOTE_RUNTIME_COMPILATION: cudnnBackendBehaviorNote_t = cudnnBackendBehaviorNote_t( 0, ); } impl cudnnBackendBehaviorNote_t { pub const CUDNN_BEHAVIOR_NOTE_REQUIRES_FILTER_INT8x32_REORDER: cudnnBackendBehaviorNote_t = cudnnBackendBehaviorNote_t( 1, ); } impl cudnnBackendBehaviorNote_t { pub const CUDNN_BEHAVIOR_NOTE_REQUIRES_BIAS_INT8x32_REORDER: cudnnBackendBehaviorNote_t = cudnnBackendBehaviorNote_t( 2, ); } impl cudnnBackendBehaviorNote_t { pub const CUDNN_BEHAVIOR_NOTE_TYPE_COUNT: cudnnBackendBehaviorNote_t = cudnnBackendBehaviorNote_t( 3, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnBackendBehaviorNote_t(pub ::core::ffi::c_uint); impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_SPLIT_K: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 0, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_SWIZZLE: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 1, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_TILE_SIZE: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 2, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_USE_TEX: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 3, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_EDGE: cudnnBackendKnobType_t = cudnnBackendKnobType_t(4); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_KBLOCK: cudnnBackendKnobType_t = cudnnBackendKnobType_t(5); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_LDGA: cudnnBackendKnobType_t = cudnnBackendKnobType_t(6); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_LDGB: cudnnBackendKnobType_t = cudnnBackendKnobType_t(7); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_CHUNK_K: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 8, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_SPLIT_H: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 9, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_WINO_TILE: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 10, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_MULTIPLY: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 11, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_SPLIT_K_BUF: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 12, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_TILEK: cudnnBackendKnobType_t = cudnnBackendKnobType_t(13); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_STAGES: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 14, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_REDUCTION_MODE: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 15, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_CTA_SPLIT_K_MODE: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 16, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_SPLIT_K_SLC: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 17, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_IDX_MODE: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 18, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_SLICED: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 19, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_SPLIT_RS: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 20, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_SINGLEBUFFER: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 21, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_LDGC: cudnnBackendKnobType_t = cudnnBackendKnobType_t(22); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_SPECFILT: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 23, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_KERNEL_CFG: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 24, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_WORKSPACE: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 25, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_TILE_CGA: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 26, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_TILE_CGA_M: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 27, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_TILE_CGA_N: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 28, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_BLOCK_SIZE: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 29, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_OCCUPANCY: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 30, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_ARRAY_SIZE_PER_THREAD: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 31, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_NUM_C_PER_BLOCK: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 32, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_SPLIT_COLS: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 33, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_TILE_ROWS: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 34, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_TILE_COLS: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 35, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_LOAD_SIZE: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 36, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_COUNTS: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 37, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnBackendKnobType_t(pub ::core::ffi::c_uint); pub use super::cudnn::cudnnBackendLayoutType_t; pub use super::cudnn::cudnnBackendHeurMode_t; pub use super::cudnn9::cudnnBackendTensorReordering_t; pub use super::cudnn::cudnnPaddingMode_t; pub use super::cudnn9::cudnnBackendNormMode_t; pub use super::cudnn::cudnnBackendNormFwdPhase_t; impl cudnnError_t { pub const r#NOT_INITIALIZED: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(1) }); pub const r#ALLOC_FAILED: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(2) }); pub const r#BAD_PARAM: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(3) }); pub const r#INTERNAL_ERROR: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(4) }); pub const r#INVALID_VALUE: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(5) }); pub const r#ARCH_MISMATCH: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(6) }); pub const r#MAPPING_ERROR: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(7) }); pub const r#EXECUTION_FAILED: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(8) }); pub const r#NOT_SUPPORTED: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(9) }); pub const r#LICENSE_ERROR: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(10) }); pub const r#RUNTIME_PREREQUISITE_MISSING: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(11) }); pub const r#RUNTIME_IN_PROGRESS: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(12) }); pub const r#RUNTIME_FP_OVERFLOW: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(13) }); pub const r#VERSION_MISMATCH: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(14) }); } #[repr(transparent)] #[derive(Debug, Hash, Copy, Clone, PartialEq, Eq)] pub struct cudnnError_t(pub ::core::num::NonZeroU32); pub trait cudnnStatus_tConsts { const SUCCESS: cudnnStatus_t = cudnnStatus_t::Ok(()); const ERROR_NOT_INITIALIZED: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#NOT_INITIALIZED, ); const ERROR_ALLOC_FAILED: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#ALLOC_FAILED, ); const ERROR_BAD_PARAM: cudnnStatus_t = cudnnStatus_t::Err(cudnnError_t::r#BAD_PARAM); const ERROR_INTERNAL_ERROR: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#INTERNAL_ERROR, ); const ERROR_INVALID_VALUE: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#INVALID_VALUE, ); const ERROR_ARCH_MISMATCH: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#ARCH_MISMATCH, ); const ERROR_MAPPING_ERROR: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#MAPPING_ERROR, ); const ERROR_EXECUTION_FAILED: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#EXECUTION_FAILED, ); const ERROR_NOT_SUPPORTED: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#NOT_SUPPORTED, ); const ERROR_LICENSE_ERROR: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#LICENSE_ERROR, ); const ERROR_RUNTIME_PREREQUISITE_MISSING: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#RUNTIME_PREREQUISITE_MISSING, ); const ERROR_RUNTIME_IN_PROGRESS: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#RUNTIME_IN_PROGRESS, ); const ERROR_RUNTIME_FP_OVERFLOW: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#RUNTIME_FP_OVERFLOW, ); const ERROR_VERSION_MISMATCH: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#VERSION_MISMATCH, ); } impl cudnnStatus_tConsts for cudnnStatus_t {} #[must_use] pub type cudnnStatus_t = ::core::result::Result<(), cudnnError_t>; const _: fn() = || { let _ = std::mem::transmute::; }; impl From for cudnnError_t { fn from(err: crate::cudnn9::cudnnError_t) -> Self { match err { crate::cudnn9::cudnnError_t::NOT_INITIALIZED => { crate::cudnn8::cudnnError_t::NOT_INITIALIZED } crate::cudnn9::cudnnError_t::ALLOC_FAILED => { crate::cudnn8::cudnnError_t::ALLOC_FAILED } crate::cudnn9::cudnnError_t::BAD_PARAM => { crate::cudnn8::cudnnError_t::BAD_PARAM } crate::cudnn9::cudnnError_t::INTERNAL_ERROR => { crate::cudnn8::cudnnError_t::INTERNAL_ERROR } crate::cudnn9::cudnnError_t::INVALID_VALUE => { crate::cudnn8::cudnnError_t::INVALID_VALUE } crate::cudnn9::cudnnError_t::ARCH_MISMATCH => { crate::cudnn8::cudnnError_t::ARCH_MISMATCH } crate::cudnn9::cudnnError_t::MAPPING_ERROR => { crate::cudnn8::cudnnError_t::MAPPING_ERROR } crate::cudnn9::cudnnError_t::EXECUTION_FAILED => { crate::cudnn8::cudnnError_t::EXECUTION_FAILED } crate::cudnn9::cudnnError_t::NOT_SUPPORTED => { crate::cudnn8::cudnnError_t::NOT_SUPPORTED } crate::cudnn9::cudnnError_t::LICENSE_ERROR => { crate::cudnn8::cudnnError_t::LICENSE_ERROR } crate::cudnn9::cudnnError_t::RUNTIME_PREREQUISITE_MISSING => { crate::cudnn8::cudnnError_t::RUNTIME_PREREQUISITE_MISSING } crate::cudnn9::cudnnError_t::RUNTIME_IN_PROGRESS => { crate::cudnn8::cudnnError_t::RUNTIME_IN_PROGRESS } crate::cudnn9::cudnnError_t::RUNTIME_FP_OVERFLOW => { crate::cudnn8::cudnnError_t::RUNTIME_FP_OVERFLOW } crate::cudnn9::cudnnError_t::VERSION_MISMATCH => { crate::cudnn8::cudnnError_t::VERSION_MISMATCH } _ => crate::cudnn8::cudnnError_t::INTERNAL_ERROR, } } } impl From for cudnnError_t { fn from(error: miopen_sys::miopenError_t) -> Self { match error { miopen_sys::miopenError_t::NotInitialized => cudnnError_t::NOT_INITIALIZED, miopen_sys::miopenError_t::InvalidValue => cudnnError_t::INVALID_VALUE, miopen_sys::miopenError_t::BadParm => cudnnError_t::BAD_PARAM, miopen_sys::miopenError_t::AllocFailed => cudnnError_t::ALLOC_FAILED, miopen_sys::miopenError_t::InternalError => cudnnError_t::INTERNAL_ERROR, miopen_sys::miopenError_t::NotImplemented | miopen_sys::miopenError_t::UnsupportedOp => cudnnError_t::NOT_SUPPORTED, miopen_sys::miopenError_t::VersionMismatch => cudnnError_t::VERSION_MISMATCH, _ => cudnnError_t::INTERNAL_ERROR, } } } ================================================ FILE: cuda_types/src/cudnn9.rs ================================================ // Generated automatically by zluda_bindgen // DO NOT EDIT MANUALLY #![allow(warnings)] pub type __half = u16; pub type __nv_bfloat16 = u16; pub use super::cuda::cuComplex; pub use super::cuda::cuDoubleComplex; pub use super::cuda::cudaDataType; pub use super::cuda::cudaDataType_t; pub type cudaStream_t = super::cuda::CUstream; pub use super::cuda::libraryPropertyType; pub type cudaGraphExecUpdateResultInfo_st = super::cuda::CUgraphExecUpdateResultInfo_st; pub type cudaAsyncNotificationType = super::cuda::CUasyncNotificationType_enum; pub type cudaGraph_t = super::cuda::CUgraph; pub const CUDNN_MAJOR: u32 = 9; pub const CUDNN_MINOR: u32 = 13; pub const CUDNN_PATCHLEVEL: u32 = 1; pub const CUDNN_VERSION: u32 = 91301; pub const CUDNN_MAX_SM_MAJOR_NUMBER: u32 = 12; pub const CUDNN_MAX_SM_MINOR_NUMBER: u32 = 1; pub const CUDNN_MAX_DEVICE_VERSION: u32 = 1210; pub const CUDNN_GRAPH_MAJOR: u32 = 9; pub const CUDNN_GRAPH_MINOR: u32 = 13; pub const CUDNN_GRAPH_PATCH: u32 = 1; pub const CUDNN_DIM_MAX: u32 = 8; pub const CUDNN_OPS_MAJOR: u32 = 9; pub const CUDNN_OPS_MINOR: u32 = 13; pub const CUDNN_OPS_PATCH: u32 = 1; pub const CUDNN_LRN_MIN_N: u32 = 1; pub const CUDNN_LRN_MAX_N: u32 = 16; pub const CUDNN_LRN_MIN_K: f64 = 0.00001; pub const CUDNN_LRN_MIN_BETA: f64 = 0.01; pub const CUDNN_BN_MIN_EPSILON: f64 = 0.0; pub const CUDNN_ADV_MAJOR: u32 = 9; pub const CUDNN_ADV_MINOR: u32 = 13; pub const CUDNN_ADV_PATCH: u32 = 1; pub const CUDNN_RNN_PADDED_IO_DISABLED: u32 = 0; pub const CUDNN_RNN_PADDED_IO_ENABLED: u32 = 1; pub const CUDNN_SEQDATA_DIM_COUNT: u32 = 4; pub const CUDNN_ATTN_QUERYMAP_ALL_TO_ONE: u32 = 0; pub const CUDNN_ATTN_QUERYMAP_ONE_TO_ONE: u32 = 1; pub const CUDNN_ATTN_DISABLE_PROJ_BIASES: u32 = 0; pub const CUDNN_ATTN_ENABLE_PROJ_BIASES: u32 = 2; pub const CUDNN_ATTN_WKIND_COUNT: u32 = 8; pub const CUDNN_CNN_MAJOR: u32 = 9; pub const CUDNN_CNN_MINOR: u32 = 13; pub const CUDNN_CNN_PATCH: u32 = 1; pub use super::cudnn::cudnnContext; pub type cudnnHandle_t = *mut cudnnContext; pub use super::cudnn::cudnnRuntimeTag_t; pub use super::cudnn::cudnnErrQueryMode_t; impl cudnnDataType_t { pub const CUDNN_DATA_FLOAT: cudnnDataType_t = cudnnDataType_t(0); } impl cudnnDataType_t { pub const CUDNN_DATA_DOUBLE: cudnnDataType_t = cudnnDataType_t(1); } impl cudnnDataType_t { pub const CUDNN_DATA_HALF: cudnnDataType_t = cudnnDataType_t(2); } impl cudnnDataType_t { pub const CUDNN_DATA_INT8: cudnnDataType_t = cudnnDataType_t(3); } impl cudnnDataType_t { pub const CUDNN_DATA_INT32: cudnnDataType_t = cudnnDataType_t(4); } impl cudnnDataType_t { pub const CUDNN_DATA_INT8x4: cudnnDataType_t = cudnnDataType_t(5); } impl cudnnDataType_t { pub const CUDNN_DATA_UINT8: cudnnDataType_t = cudnnDataType_t(6); } impl cudnnDataType_t { pub const CUDNN_DATA_UINT8x4: cudnnDataType_t = cudnnDataType_t(7); } impl cudnnDataType_t { pub const CUDNN_DATA_INT8x32: cudnnDataType_t = cudnnDataType_t(8); } impl cudnnDataType_t { pub const CUDNN_DATA_BFLOAT16: cudnnDataType_t = cudnnDataType_t(9); } impl cudnnDataType_t { pub const CUDNN_DATA_INT64: cudnnDataType_t = cudnnDataType_t(10); } impl cudnnDataType_t { pub const CUDNN_DATA_BOOLEAN: cudnnDataType_t = cudnnDataType_t(11); } impl cudnnDataType_t { pub const CUDNN_DATA_FP8_E4M3: cudnnDataType_t = cudnnDataType_t(12); } impl cudnnDataType_t { pub const CUDNN_DATA_FP8_E5M2: cudnnDataType_t = cudnnDataType_t(13); } impl cudnnDataType_t { pub const CUDNN_DATA_FAST_FLOAT_FOR_FP8: cudnnDataType_t = cudnnDataType_t(14); } impl cudnnDataType_t { pub const CUDNN_DATA_FP8_E8M0: cudnnDataType_t = cudnnDataType_t(15); } impl cudnnDataType_t { pub const CUDNN_DATA_FP4_E2M1: cudnnDataType_t = cudnnDataType_t(16); } impl cudnnDataType_t { pub const CUDNN_DATA_INT4: cudnnDataType_t = cudnnDataType_t(17); } impl cudnnDataType_t { pub const CUDNN_DATA_UINT4: cudnnDataType_t = cudnnDataType_t(18); } impl cudnnDataType_t { pub const CUDNN_DATA_UINT32: cudnnDataType_t = cudnnDataType_t(19); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnDataType_t(pub ::core::ffi::c_uint); pub use super::cudnn::cudnnMathType_t; pub use super::cudnn::cudnnNanPropagation_t; impl cudnnCTCGradMode_t { pub const CUDNN_CTC_ZERO_OOB_GRADIENTS: cudnnCTCGradMode_t = cudnnCTCGradMode_t(0); } impl cudnnCTCGradMode_t { pub const CUDNN_CTC_SKIP_OOB_GRADIENTS: cudnnCTCGradMode_t = cudnnCTCGradMode_t(1); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnCTCGradMode_t(pub ::core::ffi::c_uint); pub use super::cudnn::cudnnTensorFormat_t; pub use super::cudnn::cudnnReduceTensorOp_t; pub use super::cudnn::cudnnActivationMode_t; pub use super::cudnn::cudnnSeverity_t; #[repr(C)] pub struct cudnnDebugStruct { pub cudnn_version: ::core::ffi::c_uint, pub cudnnStatus: cudnnStatus_t, pub time_sec: ::core::ffi::c_uint, pub time_usec: ::core::ffi::c_uint, pub time_delta: ::core::ffi::c_uint, pub handle: cudnnHandle_t, pub stream: cudaStream_t, pub pid: ::core::ffi::c_ulonglong, pub tid: ::core::ffi::c_ulonglong, pub cudaDeviceId: ::core::ffi::c_int, pub reserved: [::core::ffi::c_int; 15usize], } pub type cudnnDebug_t = cudnnDebugStruct; pub type cudnnCallback_t = ::core::option::Option< unsafe extern "C" fn( sev: cudnnSeverity_t, udata: *mut ::core::ffi::c_void, dbg: *const cudnnDebug_t, msg: *const ::core::ffi::c_char, ), >; pub use super::cudnn::cudnnConvolutionMode_t; pub use super::cudnn::cudnnReorderType_t; pub type cudnnBackendDescriptor_t = *mut ::core::ffi::c_void; pub use super::cudnn::cudnnFractionStruct; pub type cudnnFraction_t = cudnnFractionStruct; impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_ADD: cudnnPointwiseMode_t = cudnnPointwiseMode_t(0); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_ADD_SQUARE: cudnnPointwiseMode_t = cudnnPointwiseMode_t(5); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_DIV: cudnnPointwiseMode_t = cudnnPointwiseMode_t(6); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_MAX: cudnnPointwiseMode_t = cudnnPointwiseMode_t(3); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_MIN: cudnnPointwiseMode_t = cudnnPointwiseMode_t(2); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_MOD: cudnnPointwiseMode_t = cudnnPointwiseMode_t(7); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_MUL: cudnnPointwiseMode_t = cudnnPointwiseMode_t(1); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_POW: cudnnPointwiseMode_t = cudnnPointwiseMode_t(8); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_SUB: cudnnPointwiseMode_t = cudnnPointwiseMode_t(9); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_ABS: cudnnPointwiseMode_t = cudnnPointwiseMode_t(10); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_CEIL: cudnnPointwiseMode_t = cudnnPointwiseMode_t(11); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_COS: cudnnPointwiseMode_t = cudnnPointwiseMode_t(12); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_EXP: cudnnPointwiseMode_t = cudnnPointwiseMode_t(13); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_FLOOR: cudnnPointwiseMode_t = cudnnPointwiseMode_t(14); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_LOG: cudnnPointwiseMode_t = cudnnPointwiseMode_t(15); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_NEG: cudnnPointwiseMode_t = cudnnPointwiseMode_t(16); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_RSQRT: cudnnPointwiseMode_t = cudnnPointwiseMode_t(17); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_SIN: cudnnPointwiseMode_t = cudnnPointwiseMode_t(18); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_SQRT: cudnnPointwiseMode_t = cudnnPointwiseMode_t(4); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_TAN: cudnnPointwiseMode_t = cudnnPointwiseMode_t(19); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_ERF: cudnnPointwiseMode_t = cudnnPointwiseMode_t(20); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_IDENTITY: cudnnPointwiseMode_t = cudnnPointwiseMode_t(21); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_RECIPROCAL: cudnnPointwiseMode_t = cudnnPointwiseMode_t( 22, ); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_ATAN2: cudnnPointwiseMode_t = cudnnPointwiseMode_t(23); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_RELU_FWD: cudnnPointwiseMode_t = cudnnPointwiseMode_t(100); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_TANH_FWD: cudnnPointwiseMode_t = cudnnPointwiseMode_t(101); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_SIGMOID_FWD: cudnnPointwiseMode_t = cudnnPointwiseMode_t( 102, ); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_ELU_FWD: cudnnPointwiseMode_t = cudnnPointwiseMode_t(103); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_GELU_FWD: cudnnPointwiseMode_t = cudnnPointwiseMode_t(104); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_SOFTPLUS_FWD: cudnnPointwiseMode_t = cudnnPointwiseMode_t( 105, ); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_SWISH_FWD: cudnnPointwiseMode_t = cudnnPointwiseMode_t( 106, ); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_GELU_APPROX_TANH_FWD: cudnnPointwiseMode_t = cudnnPointwiseMode_t( 107, ); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_RELU_BWD: cudnnPointwiseMode_t = cudnnPointwiseMode_t(200); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_TANH_BWD: cudnnPointwiseMode_t = cudnnPointwiseMode_t(201); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_SIGMOID_BWD: cudnnPointwiseMode_t = cudnnPointwiseMode_t( 202, ); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_ELU_BWD: cudnnPointwiseMode_t = cudnnPointwiseMode_t(203); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_GELU_BWD: cudnnPointwiseMode_t = cudnnPointwiseMode_t(204); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_SOFTPLUS_BWD: cudnnPointwiseMode_t = cudnnPointwiseMode_t( 205, ); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_SWISH_BWD: cudnnPointwiseMode_t = cudnnPointwiseMode_t( 206, ); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_GELU_APPROX_TANH_BWD: cudnnPointwiseMode_t = cudnnPointwiseMode_t( 207, ); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_CMP_EQ: cudnnPointwiseMode_t = cudnnPointwiseMode_t(300); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_CMP_NEQ: cudnnPointwiseMode_t = cudnnPointwiseMode_t(301); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_CMP_GT: cudnnPointwiseMode_t = cudnnPointwiseMode_t(302); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_CMP_GE: cudnnPointwiseMode_t = cudnnPointwiseMode_t(303); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_CMP_LT: cudnnPointwiseMode_t = cudnnPointwiseMode_t(304); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_CMP_LE: cudnnPointwiseMode_t = cudnnPointwiseMode_t(305); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_LOGICAL_AND: cudnnPointwiseMode_t = cudnnPointwiseMode_t( 400, ); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_LOGICAL_OR: cudnnPointwiseMode_t = cudnnPointwiseMode_t( 401, ); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_LOGICAL_NOT: cudnnPointwiseMode_t = cudnnPointwiseMode_t( 402, ); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_GEN_INDEX: cudnnPointwiseMode_t = cudnnPointwiseMode_t( 501, ); } impl cudnnPointwiseMode_t { pub const CUDNN_POINTWISE_BINARY_SELECT: cudnnPointwiseMode_t = cudnnPointwiseMode_t( 601, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnPointwiseMode_t(pub ::core::ffi::c_uint); pub use super::cudnn::cudnnResampleMode_t; pub use super::cudnn::cudnnSignalMode_t; pub use super::cudnn::cudnnGenStatsMode_t; pub use super::cudnn::cudnnBnFinalizeStatsMode_t; pub use super::cudnn::cudnnRngDistribution_t; impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_POINTWISE_MODE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 0, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_POINTWISE_MATH_PREC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_POINTWISE_NAN_PROPAGATION: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_POINTWISE_RELU_LOWER_CLIP: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 3, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_POINTWISE_RELU_UPPER_CLIP: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 4, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_POINTWISE_RELU_LOWER_CLIP_SLOPE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 5, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_POINTWISE_ELU_ALPHA: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 6, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_POINTWISE_SOFTPLUS_BETA: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 7, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_POINTWISE_SWISH_BETA: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 8, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_POINTWISE_AXIS: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 9, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_CONVOLUTION_COMP_TYPE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 100, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_CONVOLUTION_CONV_MODE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 101, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_CONVOLUTION_DILATIONS: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 102, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_CONVOLUTION_FILTER_STRIDES: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 103, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_CONVOLUTION_POST_PADDINGS: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 104, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_CONVOLUTION_PRE_PADDINGS: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 105, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_CONVOLUTION_SPATIAL_DIMS: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 106, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_ENGINEHEUR_MODE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 200, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_ENGINEHEUR_OPERATION_GRAPH: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 201, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_ENGINEHEUR_RESULTS: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 202, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_ENGINEHEUR_SM_COUNT_TARGET: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 203, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_ENGINEHEUR_DEVICEPROP: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 204, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_ENGINECFG_ENGINE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 300, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_ENGINECFG_INTERMEDIATE_INFO: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 301, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_ENGINECFG_KNOB_CHOICES: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 302, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_ENGINECFG_WORKSPACE_SIZE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 303, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_ENGINECFG_SHARED_MEMORY_USED: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 304, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_EXECUTION_PLAN_HANDLE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 400, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_EXECUTION_PLAN_ENGINE_CONFIG: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 401, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_EXECUTION_PLAN_WORKSPACE_SIZE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 402, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_EXECUTION_PLAN_COMPUTED_INTERMEDIATE_UIDS: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 403, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_EXECUTION_PLAN_RUN_ONLY_INTERMEDIATE_UIDS: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 404, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_EXECUTION_PLAN_JSON_REPRESENTATION: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 405, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_EXECUTION_PLAN_KERNEL_CACHE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 406, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_EXECUTION_PLAN_DEVICEPROP: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 407, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_INTERMEDIATE_INFO_UNIQUE_ID: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 500, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_INTERMEDIATE_INFO_SIZE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 501, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_INTERMEDIATE_INFO_DEPENDENT_DATA_UIDS: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 502, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_INTERMEDIATE_INFO_DEPENDENT_ATTRIBUTES: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 503, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_KNOB_CHOICE_KNOB_TYPE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 600, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_KNOB_CHOICE_KNOB_VALUE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 601, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_CONVOLUTION_FORWARD_ALPHA: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 700, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_CONVOLUTION_FORWARD_BETA: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 701, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_CONVOLUTION_FORWARD_CONV_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 702, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_CONVOLUTION_FORWARD_W: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 703, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_CONVOLUTION_FORWARD_X: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 704, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_CONVOLUTION_FORWARD_Y: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 705, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_DATA_ALPHA: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 706, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_DATA_BETA: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 707, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_DATA_CONV_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 708, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_DATA_W: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 709, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_DATA_DX: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 710, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_DATA_DY: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 711, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_FILTER_ALPHA: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 712, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_FILTER_BETA: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 713, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_FILTER_CONV_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 714, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_FILTER_DW: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 715, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_FILTER_X: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 716, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_FILTER_DY: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 717, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_POINTWISE_PW_DESCRIPTOR: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 750, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_POINTWISE_XDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 751, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_POINTWISE_BDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 752, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_POINTWISE_YDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 753, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_POINTWISE_ALPHA1: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 754, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_POINTWISE_ALPHA2: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 755, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_POINTWISE_DXDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 756, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_POINTWISE_DYDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 757, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_POINTWISE_TDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 758, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_GENSTATS_MODE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 770, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_GENSTATS_MATH_PREC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 771, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_GENSTATS_XDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 772, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_GENSTATS_SUMDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 773, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_GENSTATS_SQSUMDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 774, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BN_FINALIZE_STATS_MODE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 780, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BN_FINALIZE_MATH_PREC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 781, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BN_FINALIZE_Y_SUM_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 782, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BN_FINALIZE_Y_SQ_SUM_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 783, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BN_FINALIZE_SCALE_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 784, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BN_FINALIZE_BIAS_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 785, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BN_FINALIZE_PREV_RUNNING_MEAN_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 786, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BN_FINALIZE_PREV_RUNNING_VAR_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 787, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BN_FINALIZE_UPDATED_RUNNING_MEAN_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 788, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BN_FINALIZE_UPDATED_RUNNING_VAR_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 789, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BN_FINALIZE_SAVED_MEAN_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 790, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BN_FINALIZE_SAVED_INV_STD_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 791, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BN_FINALIZE_EQ_SCALE_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 792, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BN_FINALIZE_EQ_BIAS_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 793, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BN_FINALIZE_ACCUM_COUNT_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 794, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BN_FINALIZE_EPSILON_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 795, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BN_FINALIZE_EXP_AVERATE_FACTOR_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 796, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATIONGRAPH_HANDLE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 800, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATIONGRAPH_OPS: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 801, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATIONGRAPH_ENGINE_GLOBAL_COUNT: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 802, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATIONGRAPH_IS_DYNAMIC_SHAPE_ENABLED: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 803, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATIONGRAPH_IS_SAME_TOPOLOGY: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 804, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_TENSOR_BYTE_ALIGNMENT: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 900, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_TENSOR_DATA_TYPE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 901, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_TENSOR_DIMENSIONS: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 902, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_TENSOR_STRIDES: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 903, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_TENSOR_VECTOR_COUNT: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 904, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_TENSOR_VECTORIZED_DIMENSION: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 905, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_TENSOR_UNIQUE_ID: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 906, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_TENSOR_IS_VIRTUAL: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 907, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_TENSOR_IS_BY_VALUE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 908, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_TENSOR_REORDERING_MODE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 909, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_TENSOR_RAGGED_OFFSET_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 913, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_VARIANT_PACK_UNIQUE_IDS: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1000, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_VARIANT_PACK_DATA_POINTERS: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1001, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_VARIANT_PACK_INTERMEDIATES: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1002, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_VARIANT_PACK_WORKSPACE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1003, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_LAYOUT_INFO_TENSOR_UID: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1100, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_LAYOUT_INFO_TYPES: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1101, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_KNOB_INFO_TYPE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1200, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_KNOB_INFO_MAXIMUM_VALUE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1201, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_KNOB_INFO_MINIMUM_VALUE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1202, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_KNOB_INFO_STRIDE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1203, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_ENGINE_OPERATION_GRAPH: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1300, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_ENGINE_GLOBAL_INDEX: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1301, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_ENGINE_KNOB_INFO: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1302, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_ENGINE_NUMERICAL_NOTE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1303, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_ENGINE_LAYOUT_INFO: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1304, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_ENGINE_BEHAVIOR_NOTE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1305, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_ENGINE_SM_COUNT_TARGET: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1306, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_ENGINE_DEVICEPROP: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1307, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_MATMUL_COMP_TYPE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1500, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_MATMUL_PADDING_VALUE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1503, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_MATMUL_ADESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1520, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_MATMUL_BDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1521, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_MATMUL_CDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1522, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_MATMUL_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1523, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_MATMUL_IRREGULARLY_STRIDED_BATCH_COUNT: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1524, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_MATMUL_GEMM_M_OVERRIDE_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1525, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_MATMUL_GEMM_N_OVERRIDE_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1526, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_MATMUL_GEMM_K_OVERRIDE_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1527, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_REDUCTION_OPERATOR: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1600, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_REDUCTION_COMP_TYPE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1601, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_REDUCTION_IS_DETERMINISTIC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1602, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_REDUCTION_XDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1610, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_REDUCTION_YDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1611, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_REDUCTION_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1612, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BN_BWD_WEIGHTS_MATH_PREC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1620, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BN_BWD_WEIGHTS_MEAN_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1621, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BN_BWD_WEIGHTS_INVSTD_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1622, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BN_BWD_WEIGHTS_BN_SCALE_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1623, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BN_BWD_WEIGHTS_X_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1624, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BN_BWD_WEIGHTS_DY_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1625, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BN_BWD_WEIGHTS_DBN_SCALE_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1626, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BN_BWD_WEIGHTS_DBN_BIAS_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1627, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BN_BWD_WEIGHTS_EQ_DY_SCALE_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1628, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BN_BWD_WEIGHTS_EQ_X_SCALE_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1629, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BN_BWD_WEIGHTS_EQ_BIAS: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1630, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_RESAMPLE_MODE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1700, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_RESAMPLE_COMP_TYPE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1701, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_RESAMPLE_SPATIAL_DIMS: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1702, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_RESAMPLE_POST_PADDINGS: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1703, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_RESAMPLE_PRE_PADDINGS: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1704, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_RESAMPLE_STRIDES: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1705, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_RESAMPLE_WINDOW_DIMS: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1706, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_RESAMPLE_NAN_PROPAGATION: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1707, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_RESAMPLE_PADDING_MODE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1708, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_RESAMPLE_FWD_XDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1710, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_RESAMPLE_FWD_YDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1711, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_RESAMPLE_FWD_IDXDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1712, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_RESAMPLE_FWD_ALPHA: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1713, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_RESAMPLE_FWD_BETA: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1714, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_RESAMPLE_FWD_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1716, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_RESAMPLE_BWD_DXDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1720, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_RESAMPLE_BWD_DYDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1721, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_RESAMPLE_BWD_IDXDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1722, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_RESAMPLE_BWD_ALPHA: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1723, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_RESAMPLE_BWD_BETA: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1724, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_RESAMPLE_BWD_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1725, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_RESAMPLE_BWD_XDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1726, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_RESAMPLE_BWD_YDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1727, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_CONCAT_AXIS: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1800, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_CONCAT_INPUT_DESCS: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1801, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_CONCAT_INPLACE_INDEX: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1802, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_CONCAT_OUTPUT_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1803, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_SIGNAL_MODE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1900, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_SIGNAL_FLAGDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1901, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_SIGNAL_VALUE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1902, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_SIGNAL_XDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1903, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_SIGNAL_YDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1904, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_PAGED_CACHE_LOAD_CONTAINER_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1950, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_PAGED_CACHE_LOAD_YDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1951, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_PAGED_CACHE_LOAD_SEQUENCE_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1952, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_PAGED_CACHE_LOAD_PAGE_TABLE_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 1953, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_NORM_FWD_MODE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2000, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_NORM_FWD_PHASE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2001, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_NORM_FWD_XDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2002, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_NORM_FWD_MEAN_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2003, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_NORM_FWD_INV_VARIANCE_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2004, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_NORM_FWD_SCALE_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2005, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_NORM_FWD_BIAS_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2006, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_NORM_FWD_EPSILON_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2007, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_NORM_FWD_EXP_AVG_FACTOR_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2008, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_NORM_FWD_INPUT_RUNNING_MEAN_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2009, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_NORM_FWD_INPUT_RUNNING_VAR_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2010, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_NORM_FWD_OUTPUT_RUNNING_MEAN_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2011, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_NORM_FWD_OUTPUT_RUNNING_VAR_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2012, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_NORM_FWD_YDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2013, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_NORM_FWD_PEER_STAT_DESCS: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2014, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_NORM_BWD_MODE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2100, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_NORM_BWD_XDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2101, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_NORM_BWD_MEAN_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2102, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_NORM_BWD_INV_VARIANCE_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2103, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_NORM_BWD_DYDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2104, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_NORM_BWD_SCALE_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2105, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_NORM_BWD_EPSILON_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2106, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_NORM_BWD_DSCALE_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2107, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_NORM_BWD_DBIAS_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2108, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_NORM_BWD_DXDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2109, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_NORM_BWD_PEER_STAT_DESCS: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2110, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_RESHAPE_XDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2200, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_RESHAPE_YDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2201, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_EXPAND_BAND_MATRIX_XDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2250, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_EXPAND_BAND_MATRIX_YDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2251, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_EXPAND_BAND_MATRIX_LOWER_BANDWIDTH: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2252, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_EXPAND_BAND_MATRIX_UPPER_BANDWIDTH: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2253, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_EXPAND_BAND_MATRIX_AXIS: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2254, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_EXPAND_BAND_MATRIX_PAD_VALUE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2255, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_EXPAND_BAND_MATRIX_KV_TOKEN_OFFSET_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2256, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_EXPAND_BAND_MATRIX_SPECULATIVE_MASK_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2257, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_CONTRACT_BAND_MATRIX_XDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2270, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_CONTRACT_BAND_MATRIX_YDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2271, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_CONTRACT_BAND_MATRIX_LOWER_BANDWIDTH: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2272, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_CONTRACT_BAND_MATRIX_UPPER_BANDWIDTH: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2273, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_CONTRACT_BAND_MATRIX_AXIS: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2274, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_CONTRACT_BAND_MATRIX_PAD_VALUE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2275, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_CONTRACT_BAND_MAX_TOKEN_VALUE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2276, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_RNG_DISTRIBUTION: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2300, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_RNG_NORMAL_DIST_MEAN: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2301, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_RNG_NORMAL_DIST_STANDARD_DEVIATION: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2302, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_RNG_UNIFORM_DIST_MAXIMUM: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2303, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_RNG_UNIFORM_DIST_MINIMUM: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2304, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_RNG_BERNOULLI_DIST_PROBABILITY: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2305, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_RNG_YDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2310, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_RNG_SEED: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2311, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_RNG_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2312, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_RNG_OFFSET_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2313, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_KERNEL_CACHE_OPERATION_GRAPH: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2400, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_KERNEL_CACHE_IS_ENGINECFG_KERNEL_CACHED: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2401, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_KERNEL_CACHE_JSON_REPRESENTATION: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2402, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BLOCK_SCALE_QUANTIZE_XDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2500, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BLOCK_SCALE_QUANTIZE_YDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2501, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BLOCK_SCALE_QUANTIZE_SCALE_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2502, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BLOCK_SCALE_QUANTIZE_MATH_PREC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2503, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BLOCK_SCALE_QUANTIZE_BLOCK_SIZE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2504, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BLOCK_SCALE_DEQUANTIZE_XDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2600, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BLOCK_SCALE_DEQUANTIZE_SCALE_DESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2601, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BLOCK_SCALE_DEQUANTIZE_YDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2602, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BLOCK_SCALE_DEQUANTIZE_MATH_PREC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2603, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BLOCK_SCALE_DEQUANTIZE_BLOCK_SIZE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2604, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_BLOCK_SCALE_DEQUANTIZE_NEG_SCALE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2605, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_DEVICEPROP_DEVICE_ID: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2700, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_DEVICEPROP_HANDLE: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2701, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_DEVICEPROP_JSON_REPRESENTATION: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2702, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_SDPA_FWD_QDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2800, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_SDPA_FWD_KDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2801, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_SDPA_FWD_VDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2802, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_SDPA_FWD_ODESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2803, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_SDPA_FWD_STATSDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2804, ); } impl cudnnBackendAttributeName_t { pub const CUDNN_ATTR_OPERATION_SDPA_FWD_SCALEDESC: cudnnBackendAttributeName_t = cudnnBackendAttributeName_t( 2805, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnBackendAttributeName_t(pub ::core::ffi::c_uint); pub use super::cudnn::cudnnBackendAttributeType_t; impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_POINTWISE_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 0, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_CONVOLUTION_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 1, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_ENGINE_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 2, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_ENGINECFG_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 3, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_ENGINEHEUR_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 4, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_EXECUTION_PLAN_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 5, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_INTERMEDIATE_INFO_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 6, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_KNOB_CHOICE_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 7, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_KNOB_INFO_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 8, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_LAYOUT_INFO_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 9, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_OPERATION_CONVOLUTION_FORWARD_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 10, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_OPERATION_CONVOLUTION_BACKWARD_FILTER_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 11, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_OPERATION_CONVOLUTION_BACKWARD_DATA_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 12, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_OPERATION_POINTWISE_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 13, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_OPERATION_GEN_STATS_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 14, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_OPERATIONGRAPH_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 15, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_VARIANT_PACK_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 16, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_TENSOR_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 17, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_MATMUL_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 18, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_OPERATION_MATMUL_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 19, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_OPERATION_BN_FINALIZE_STATISTICS_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 20, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_REDUCTION_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 21, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_OPERATION_REDUCTION_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 22, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_OPERATION_BN_BWD_WEIGHTS_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 23, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_RESAMPLE_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 24, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_OPERATION_RESAMPLE_FWD_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 25, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_OPERATION_RESAMPLE_BWD_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 26, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_OPERATION_CONCAT_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 27, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_OPERATION_SIGNAL_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 28, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_OPERATION_NORM_FORWARD_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 29, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_OPERATION_NORM_BACKWARD_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 30, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_OPERATION_RESHAPE_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 31, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_RNG_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 32, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_OPERATION_RNG_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 33, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_KERNEL_CACHE_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 34, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_OPERATION_PAGED_CACHE_LOAD_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 35, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_OPERATION_BLOCK_SCALE_QUANTIZE_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 36, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_OPERATION_BLOCK_SCALE_DEQUANTIZE_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 37, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_DEVICEPROP_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 38, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_OPERATION_EXPAND_BAND_MATRIX_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 39, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_OPERATION_CONTRACT_BAND_MATRIX_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 40, ); } impl cudnnBackendDescriptorType_t { pub const CUDNN_BACKEND_OPERATION_SDPA_FWD_DESCRIPTOR: cudnnBackendDescriptorType_t = cudnnBackendDescriptorType_t( 41, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnBackendDescriptorType_t(pub ::core::ffi::c_uint); impl cudnnBackendNumericalNote_t { pub const CUDNN_NUMERICAL_NOTE_TENSOR_CORE: cudnnBackendNumericalNote_t = cudnnBackendNumericalNote_t( 0, ); } impl cudnnBackendNumericalNote_t { pub const CUDNN_NUMERICAL_NOTE_DOWN_CONVERT_INPUTS: cudnnBackendNumericalNote_t = cudnnBackendNumericalNote_t( 1, ); } impl cudnnBackendNumericalNote_t { pub const CUDNN_NUMERICAL_NOTE_REDUCED_PRECISION_REDUCTION: cudnnBackendNumericalNote_t = cudnnBackendNumericalNote_t( 2, ); } impl cudnnBackendNumericalNote_t { pub const CUDNN_NUMERICAL_NOTE_FFT: cudnnBackendNumericalNote_t = cudnnBackendNumericalNote_t( 3, ); } impl cudnnBackendNumericalNote_t { pub const CUDNN_NUMERICAL_NOTE_NONDETERMINISTIC: cudnnBackendNumericalNote_t = cudnnBackendNumericalNote_t( 4, ); } impl cudnnBackendNumericalNote_t { pub const CUDNN_NUMERICAL_NOTE_WINOGRAD: cudnnBackendNumericalNote_t = cudnnBackendNumericalNote_t( 5, ); } impl cudnnBackendNumericalNote_t { pub const CUDNN_NUMERICAL_NOTE_WINOGRAD_TILE_4x4: cudnnBackendNumericalNote_t = cudnnBackendNumericalNote_t( 6, ); } impl cudnnBackendNumericalNote_t { pub const CUDNN_NUMERICAL_NOTE_WINOGRAD_TILE_6x6: cudnnBackendNumericalNote_t = cudnnBackendNumericalNote_t( 7, ); } impl cudnnBackendNumericalNote_t { pub const CUDNN_NUMERICAL_NOTE_WINOGRAD_TILE_13x13: cudnnBackendNumericalNote_t = cudnnBackendNumericalNote_t( 8, ); } impl cudnnBackendNumericalNote_t { pub const CUDNN_NUMERICAL_NOTE_STRICT_NAN_PROP: cudnnBackendNumericalNote_t = cudnnBackendNumericalNote_t( 9, ); } impl cudnnBackendNumericalNote_t { pub const CUDNN_NUMERICAL_NOTE_TYPE_COUNT: cudnnBackendNumericalNote_t = cudnnBackendNumericalNote_t( 10, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnBackendNumericalNote_t(pub ::core::ffi::c_uint); impl cudnnBackendBehaviorNote_t { pub const CUDNN_BEHAVIOR_NOTE_RUNTIME_COMPILATION: cudnnBackendBehaviorNote_t = cudnnBackendBehaviorNote_t( 0, ); } impl cudnnBackendBehaviorNote_t { pub const CUDNN_BEHAVIOR_NOTE_REQUIRES_FILTER_INT8x32_REORDER: cudnnBackendBehaviorNote_t = cudnnBackendBehaviorNote_t( 1, ); } impl cudnnBackendBehaviorNote_t { pub const CUDNN_BEHAVIOR_NOTE_REQUIRES_BIAS_INT8x32_REORDER: cudnnBackendBehaviorNote_t = cudnnBackendBehaviorNote_t( 2, ); } impl cudnnBackendBehaviorNote_t { pub const CUDNN_BEHAVIOR_NOTE_SUPPORTS_CUDA_GRAPH_NATIVE_API: cudnnBackendBehaviorNote_t = cudnnBackendBehaviorNote_t( 3, ); } impl cudnnBackendBehaviorNote_t { pub const CUDNN_BEHAVIOR_NOTE_TYPE_COUNT: cudnnBackendBehaviorNote_t = cudnnBackendBehaviorNote_t( 4, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnBackendBehaviorNote_t(pub ::core::ffi::c_uint); impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_SPLIT_K: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 0, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_SWIZZLE: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 1, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_TILE_SIZE: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 2, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_USE_TEX: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 3, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_EDGE: cudnnBackendKnobType_t = cudnnBackendKnobType_t(4); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_KBLOCK: cudnnBackendKnobType_t = cudnnBackendKnobType_t(5); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_LDGA: cudnnBackendKnobType_t = cudnnBackendKnobType_t(6); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_LDGB: cudnnBackendKnobType_t = cudnnBackendKnobType_t(7); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_CHUNK_K: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 8, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_SPLIT_H: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 9, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_WINO_TILE: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 10, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_MULTIPLY: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 11, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_SPLIT_K_BUF: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 12, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_TILEK: cudnnBackendKnobType_t = cudnnBackendKnobType_t(13); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_STAGES: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 14, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_REDUCTION_MODE: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 15, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_CTA_SPLIT_K_MODE: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 16, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_SPLIT_K_SLC: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 17, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_IDX_MODE: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 18, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_SLICED: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 19, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_SPLIT_RS: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 20, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_SINGLEBUFFER: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 21, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_LDGC: cudnnBackendKnobType_t = cudnnBackendKnobType_t(22); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_SPECFILT: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 23, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_KERNEL_CFG: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 24, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_WORKSPACE: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 25, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_TILE_CGA: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 26, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_TILE_CGA_M: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 27, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_TILE_CGA_N: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 28, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_BLOCK_SIZE: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 29, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_OCCUPANCY: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 30, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_ARRAY_SIZE_PER_THREAD: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 31, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_NUM_C_PER_BLOCK: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 32, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_SPLIT_COLS: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 33, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_TILE_ROWS: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 34, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_TILE_COLS: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 35, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_LOAD_SIZE: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 36, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_CTA_COUNT: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 37, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_STREAM_K: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 38, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_SPLIT_P_SLC: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 39, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_TILE_M: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 40, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_TILE_N: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 41, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_WARP_SPEC_CFG: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 42, ); } impl cudnnBackendKnobType_t { pub const CUDNN_KNOB_TYPE_COUNTS: cudnnBackendKnobType_t = cudnnBackendKnobType_t( 43, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnBackendKnobType_t(pub ::core::ffi::c_uint); pub use super::cudnn::cudnnBackendLayoutType_t; pub use super::cudnn::cudnnBackendHeurMode_t; impl cudnnBackendTensorReordering_t { pub const CUDNN_TENSOR_REORDERING_NONE: cudnnBackendTensorReordering_t = cudnnBackendTensorReordering_t( 0, ); } impl cudnnBackendTensorReordering_t { pub const CUDNN_TENSOR_REORDERING_INT8x32: cudnnBackendTensorReordering_t = cudnnBackendTensorReordering_t( 1, ); } impl cudnnBackendTensorReordering_t { pub const CUDNN_TENSOR_REORDERING_F16x16: cudnnBackendTensorReordering_t = cudnnBackendTensorReordering_t( 2, ); } impl cudnnBackendTensorReordering_t { pub const CUDNN_TENSOR_REORDERING_F8_128x4: cudnnBackendTensorReordering_t = cudnnBackendTensorReordering_t( 3, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnBackendTensorReordering_t(pub ::core::ffi::c_uint); pub use super::cudnn::cudnnPaddingMode_t; impl cudnnBackendNormMode_t { pub const CUDNN_LAYER_NORM: cudnnBackendNormMode_t = cudnnBackendNormMode_t(0); } impl cudnnBackendNormMode_t { pub const CUDNN_INSTANCE_NORM: cudnnBackendNormMode_t = cudnnBackendNormMode_t(1); } impl cudnnBackendNormMode_t { pub const CUDNN_BATCH_NORM: cudnnBackendNormMode_t = cudnnBackendNormMode_t(2); } impl cudnnBackendNormMode_t { pub const CUDNN_GROUP_NORM: cudnnBackendNormMode_t = cudnnBackendNormMode_t(3); } impl cudnnBackendNormMode_t { pub const CUDNN_RMS_NORM: cudnnBackendNormMode_t = cudnnBackendNormMode_t(4); } impl cudnnBackendNormMode_t { pub const CUDNN_ADA_LAYER_NORM: cudnnBackendNormMode_t = cudnnBackendNormMode_t(5); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudnnBackendNormMode_t(pub ::core::ffi::c_uint); pub use super::cudnn::cudnnBackendNormFwdPhase_t; pub use super::cudnn::cudnnTensorStruct; pub type cudnnTensorDescriptor_t = *mut cudnnTensorStruct; pub use super::cudnn::cudnnPoolingStruct; pub type cudnnPoolingDescriptor_t = *mut cudnnPoolingStruct; pub use super::cudnn::cudnnFilterStruct; pub type cudnnFilterDescriptor_t = *mut cudnnFilterStruct; pub use super::cudnn::cudnnLRNStruct; pub type cudnnLRNDescriptor_t = *mut cudnnLRNStruct; pub use super::cudnn::cudnnActivationStruct; pub type cudnnActivationDescriptor_t = *mut cudnnActivationStruct; pub use super::cudnn::cudnnSpatialTransformerStruct; pub type cudnnSpatialTransformerDescriptor_t = *mut cudnnSpatialTransformerStruct; pub use super::cudnn::cudnnOpTensorStruct; pub type cudnnOpTensorDescriptor_t = *mut cudnnOpTensorStruct; pub use super::cudnn::cudnnReduceTensorStruct; pub type cudnnReduceTensorDescriptor_t = *mut cudnnReduceTensorStruct; pub use super::cudnn::cudnnCTCLossStruct; pub type cudnnCTCLossDescriptor_t = *mut cudnnCTCLossStruct; pub use super::cudnn::cudnnTensorTransformStruct; pub type cudnnTensorTransformDescriptor_t = *mut cudnnTensorTransformStruct; pub use super::cudnn::cudnnDeterminism_t; pub use super::cudnn::cudnnFoldingDirection_t; pub use super::cudnn::cudnnOpTensorOp_t; pub use super::cudnn::cudnnReduceTensorIndices_t; pub use super::cudnn::cudnnIndicesType_t; pub use super::cudnn::cudnnSoftmaxAlgorithm_t; pub use super::cudnn::cudnnSoftmaxMode_t; pub use super::cudnn::cudnnPoolingMode_t; pub use super::cudnn::cudnnLRNMode_t; pub use super::cudnn::cudnnDivNormMode_t; pub use super::cudnn::cudnnBatchNormMode_t; pub use super::cudnn::cudnnBatchNormOps_t; pub use super::cudnn::cudnnNormMode_t; pub use super::cudnn::cudnnNormAlgo_t; pub use super::cudnn::cudnnNormOps_t; pub use super::cudnn::cudnnSamplerType_t; pub use super::cudnn::cudnnDropoutStruct; pub type cudnnDropoutDescriptor_t = *mut cudnnDropoutStruct; pub use super::cudnn::cudnnConvolutionFwdAlgo_t; pub use super::cudnn::cudnnConvolutionBwdFilterAlgo_t; pub use super::cudnn::cudnnConvolutionBwdDataAlgo_t; pub use super::cudnn::cudnnCTCLossAlgo_t; pub use super::cudnn::cudnnRNNAlgo_t; pub use super::cudnn::cudnnForwardMode_t; pub use super::cudnn::cudnnRNNMode_t; pub use super::cudnn::cudnnRNNBiasMode_t; pub use super::cudnn::cudnnDirectionMode_t; pub use super::cudnn::cudnnRNNInputMode_t; pub use super::cudnn::cudnnRNNClipMode_t; pub use super::cudnn::cudnnRNNDataLayout_t; pub use super::cudnn::cudnnRNNStruct; pub type cudnnRNNDescriptor_t = *mut cudnnRNNStruct; pub use super::cudnn::cudnnRNNDataStruct; pub type cudnnRNNDataDescriptor_t = *mut cudnnRNNDataStruct; pub use super::cudnn::cudnnSeqDataAxis_t; pub use super::cudnn::cudnnSeqDataStruct; pub type cudnnSeqDataDescriptor_t = *mut cudnnSeqDataStruct; pub use super::cudnn::cudnnAttnStruct; pub type cudnnAttnDescriptor_t = *mut cudnnAttnStruct; pub use super::cudnn::cudnnMultiHeadAttnWeightKind_t; pub use super::cudnn::cudnnWgradMode_t; pub use super::cudnn::cudnnLossNormalizationMode_t; pub use super::cudnn::cudnnConvolutionStruct; pub type cudnnConvolutionDescriptor_t = *mut cudnnConvolutionStruct; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct cudnnConvolutionFwdAlgoPerfStruct { pub algo: cudnnConvolutionFwdAlgo_t, pub status: cudnnStatus_t, pub time: f32, pub memory: usize, pub determinism: cudnnDeterminism_t, pub mathType: cudnnMathType_t, pub reserved: [::core::ffi::c_int; 3usize], } pub type cudnnConvolutionFwdAlgoPerf_t = cudnnConvolutionFwdAlgoPerfStruct; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct cudnnConvolutionBwdDataAlgoPerfStruct { pub algo: cudnnConvolutionBwdDataAlgo_t, pub status: cudnnStatus_t, pub time: f32, pub memory: usize, pub determinism: cudnnDeterminism_t, pub mathType: cudnnMathType_t, pub reserved: [::core::ffi::c_int; 3usize], } pub type cudnnConvolutionBwdDataAlgoPerf_t = cudnnConvolutionBwdDataAlgoPerfStruct; pub use super::cudnn::cudnnFusedOpsConstParamStruct; pub type cudnnFusedOpsConstParamPack_t = *mut cudnnFusedOpsConstParamStruct; pub use super::cudnn::cudnnFusedOpsVariantParamStruct; pub type cudnnFusedOpsVariantParamPack_t = *mut cudnnFusedOpsVariantParamStruct; pub use super::cudnn::cudnnFusedOpsPlanStruct; pub type cudnnFusedOpsPlan_t = *mut cudnnFusedOpsPlanStruct; pub use super::cudnn::cudnnFusedOps_t; pub use super::cudnn::cudnnFusedOpsConstParamLabel_t; pub use super::cudnn::cudnnFusedOpsPointerPlaceHolder_t; pub use super::cudnn::cudnnFusedOpsVariantParamLabel_t; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct cudnnConvolutionBwdFilterAlgoPerfStruct { pub algo: cudnnConvolutionBwdFilterAlgo_t, pub status: cudnnStatus_t, pub time: f32, pub memory: usize, pub determinism: cudnnDeterminism_t, pub mathType: cudnnMathType_t, pub reserved: [::core::ffi::c_int; 3usize], } pub type cudnnConvolutionBwdFilterAlgoPerf_t = cudnnConvolutionBwdFilterAlgoPerfStruct; impl cudnnError_t { pub const r#NOT_INITIALIZED: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(1001) }); pub const r#SUBLIBRARY_VERSION_MISMATCH: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(1002) }); pub const r#SERIALIZATION_VERSION_MISMATCH: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(1003) }); pub const r#DEPRECATED: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(1004) }); pub const r#LICENSE_ERROR: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(1005) }); pub const r#RUNTIME_IN_PROGRESS: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(1006) }); pub const r#RUNTIME_FP_OVERFLOW: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(1007) }); pub const r#SUBLIBRARY_LOADING_FAILED: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(1008) }); pub const r#BAD_PARAM: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(2000) }); pub const r#BAD_PARAM_NULL_POINTER: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(2002) }); pub const r#BAD_PARAM_MISALIGNED_POINTER: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(2003) }); pub const r#BAD_PARAM_NOT_FINALIZED: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(2004) }); pub const r#BAD_PARAM_OUT_OF_BOUND: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(2005) }); pub const r#BAD_PARAM_SIZE_INSUFFICIENT: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(2006) }); pub const r#BAD_PARAM_STREAM_MISMATCH: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(2007) }); pub const r#BAD_PARAM_SHAPE_MISMATCH: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(2008) }); pub const r#BAD_PARAM_DUPLICATED_ENTRIES: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(2009) }); pub const r#BAD_PARAM_ATTRIBUTE_TYPE: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(2010) }); pub const r#BAD_PARAM_CUDA_GRAPH_MISMATCH: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(2011) }); pub const r#BAD_PARAM_DESCRIPTOR_TYPE: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(2012) }); pub const r#NOT_SUPPORTED: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(3000) }); pub const r#NOT_SUPPORTED_GRAPH_PATTERN: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(3001) }); pub const r#NOT_SUPPORTED_SHAPE: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(3002) }); pub const r#NOT_SUPPORTED_DATA_TYPE: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(3003) }); pub const r#NOT_SUPPORTED_LAYOUT: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(3004) }); pub const r#NOT_SUPPORTED_INCOMPATIBLE_CUDA_DRIVER: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(3005) }); pub const r#NOT_SUPPORTED_INCOMPATIBLE_CUDART: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(3006) }); pub const r#NOT_SUPPORTED_ARCH_MISMATCH: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(3007) }); pub const r#NOT_SUPPORTED_RUNTIME_PREREQUISITE_MISSING: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(3008) }); pub const r#NOT_SUPPORTED_SUBLIBRARY_UNAVAILABLE: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(3009) }); pub const r#NOT_SUPPORTED_SHARED_MEMORY_INSUFFICIENT: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(3010) }); pub const r#NOT_SUPPORTED_PADDING: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(3011) }); pub const r#NOT_SUPPORTED_BAD_LAUNCH_PARAM: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(3012) }); pub const r#NOT_SUPPORTED_CUDA_GRAPH_NATIVE_API: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(3013) }); pub const r#INTERNAL_ERROR: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(4000) }); pub const r#INTERNAL_ERROR_COMPILATION_FAILED: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(4001) }); pub const r#INTERNAL_ERROR_UNEXPECTED_VALUE: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(4002) }); pub const r#INTERNAL_ERROR_HOST_ALLOCATION_FAILED: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(4003) }); pub const r#INTERNAL_ERROR_DEVICE_ALLOCATION_FAILED: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(4004) }); pub const r#INTERNAL_ERROR_BAD_LAUNCH_PARAM: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(4005) }); pub const r#INTERNAL_ERROR_TEXTURE_CREATION_FAILED: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(4006) }); pub const r#EXECUTION_FAILED: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(5000) }); pub const r#EXECUTION_FAILED_CUDA_DRIVER: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(5001) }); pub const r#EXECUTION_FAILED_CUBLAS: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(5002) }); pub const r#EXECUTION_FAILED_CUDART: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(5003) }); pub const r#EXECUTION_FAILED_CURAND: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(5004) }); pub const r#ALLOC_FAILED: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(4003) }); pub const r#INVALID_VALUE: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(2001) }); pub const r#ARCH_MISMATCH: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(3007) }); pub const r#MAPPING_ERROR: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(4006) }); pub const r#RUNTIME_PREREQUISITE_MISSING: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(3008) }); pub const r#VERSION_MISMATCH: cudnnError_t = cudnnError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(1002) }); } #[repr(transparent)] #[derive(Debug, Hash, Copy, Clone, PartialEq, Eq)] pub struct cudnnError_t(pub ::core::num::NonZeroU32); pub trait cudnnStatus_tConsts { const SUCCESS: cudnnStatus_t = cudnnStatus_t::Ok(()); const ERROR_NOT_INITIALIZED: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#NOT_INITIALIZED, ); const ERROR_SUBLIBRARY_VERSION_MISMATCH: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#SUBLIBRARY_VERSION_MISMATCH, ); const ERROR_SERIALIZATION_VERSION_MISMATCH: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#SERIALIZATION_VERSION_MISMATCH, ); const ERROR_DEPRECATED: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#DEPRECATED, ); const ERROR_LICENSE_ERROR: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#LICENSE_ERROR, ); const ERROR_RUNTIME_IN_PROGRESS: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#RUNTIME_IN_PROGRESS, ); const ERROR_RUNTIME_FP_OVERFLOW: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#RUNTIME_FP_OVERFLOW, ); const ERROR_SUBLIBRARY_LOADING_FAILED: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#SUBLIBRARY_LOADING_FAILED, ); const ERROR_BAD_PARAM: cudnnStatus_t = cudnnStatus_t::Err(cudnnError_t::r#BAD_PARAM); const ERROR_BAD_PARAM_NULL_POINTER: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#BAD_PARAM_NULL_POINTER, ); const ERROR_BAD_PARAM_MISALIGNED_POINTER: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#BAD_PARAM_MISALIGNED_POINTER, ); const ERROR_BAD_PARAM_NOT_FINALIZED: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#BAD_PARAM_NOT_FINALIZED, ); const ERROR_BAD_PARAM_OUT_OF_BOUND: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#BAD_PARAM_OUT_OF_BOUND, ); const ERROR_BAD_PARAM_SIZE_INSUFFICIENT: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#BAD_PARAM_SIZE_INSUFFICIENT, ); const ERROR_BAD_PARAM_STREAM_MISMATCH: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#BAD_PARAM_STREAM_MISMATCH, ); const ERROR_BAD_PARAM_SHAPE_MISMATCH: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#BAD_PARAM_SHAPE_MISMATCH, ); const ERROR_BAD_PARAM_DUPLICATED_ENTRIES: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#BAD_PARAM_DUPLICATED_ENTRIES, ); const ERROR_BAD_PARAM_ATTRIBUTE_TYPE: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#BAD_PARAM_ATTRIBUTE_TYPE, ); const ERROR_BAD_PARAM_CUDA_GRAPH_MISMATCH: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#BAD_PARAM_CUDA_GRAPH_MISMATCH, ); const ERROR_BAD_PARAM_DESCRIPTOR_TYPE: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#BAD_PARAM_DESCRIPTOR_TYPE, ); const ERROR_NOT_SUPPORTED: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#NOT_SUPPORTED, ); const ERROR_NOT_SUPPORTED_GRAPH_PATTERN: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#NOT_SUPPORTED_GRAPH_PATTERN, ); const ERROR_NOT_SUPPORTED_SHAPE: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#NOT_SUPPORTED_SHAPE, ); const ERROR_NOT_SUPPORTED_DATA_TYPE: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#NOT_SUPPORTED_DATA_TYPE, ); const ERROR_NOT_SUPPORTED_LAYOUT: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#NOT_SUPPORTED_LAYOUT, ); const ERROR_NOT_SUPPORTED_INCOMPATIBLE_CUDA_DRIVER: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#NOT_SUPPORTED_INCOMPATIBLE_CUDA_DRIVER, ); const ERROR_NOT_SUPPORTED_INCOMPATIBLE_CUDART: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#NOT_SUPPORTED_INCOMPATIBLE_CUDART, ); const ERROR_NOT_SUPPORTED_ARCH_MISMATCH: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#NOT_SUPPORTED_ARCH_MISMATCH, ); const ERROR_NOT_SUPPORTED_RUNTIME_PREREQUISITE_MISSING: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#NOT_SUPPORTED_RUNTIME_PREREQUISITE_MISSING, ); const ERROR_NOT_SUPPORTED_SUBLIBRARY_UNAVAILABLE: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#NOT_SUPPORTED_SUBLIBRARY_UNAVAILABLE, ); const ERROR_NOT_SUPPORTED_SHARED_MEMORY_INSUFFICIENT: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#NOT_SUPPORTED_SHARED_MEMORY_INSUFFICIENT, ); const ERROR_NOT_SUPPORTED_PADDING: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#NOT_SUPPORTED_PADDING, ); const ERROR_NOT_SUPPORTED_BAD_LAUNCH_PARAM: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#NOT_SUPPORTED_BAD_LAUNCH_PARAM, ); const ERROR_NOT_SUPPORTED_CUDA_GRAPH_NATIVE_API: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#NOT_SUPPORTED_CUDA_GRAPH_NATIVE_API, ); const ERROR_INTERNAL_ERROR: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#INTERNAL_ERROR, ); const ERROR_INTERNAL_ERROR_COMPILATION_FAILED: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#INTERNAL_ERROR_COMPILATION_FAILED, ); const ERROR_INTERNAL_ERROR_UNEXPECTED_VALUE: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#INTERNAL_ERROR_UNEXPECTED_VALUE, ); const ERROR_INTERNAL_ERROR_HOST_ALLOCATION_FAILED: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#INTERNAL_ERROR_HOST_ALLOCATION_FAILED, ); const ERROR_INTERNAL_ERROR_DEVICE_ALLOCATION_FAILED: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#INTERNAL_ERROR_DEVICE_ALLOCATION_FAILED, ); const ERROR_INTERNAL_ERROR_BAD_LAUNCH_PARAM: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#INTERNAL_ERROR_BAD_LAUNCH_PARAM, ); const ERROR_INTERNAL_ERROR_TEXTURE_CREATION_FAILED: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#INTERNAL_ERROR_TEXTURE_CREATION_FAILED, ); const ERROR_EXECUTION_FAILED: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#EXECUTION_FAILED, ); const ERROR_EXECUTION_FAILED_CUDA_DRIVER: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#EXECUTION_FAILED_CUDA_DRIVER, ); const ERROR_EXECUTION_FAILED_CUBLAS: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#EXECUTION_FAILED_CUBLAS, ); const ERROR_EXECUTION_FAILED_CUDART: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#EXECUTION_FAILED_CUDART, ); const ERROR_EXECUTION_FAILED_CURAND: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#EXECUTION_FAILED_CURAND, ); const ERROR_ALLOC_FAILED: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#ALLOC_FAILED, ); const ERROR_INVALID_VALUE: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#INVALID_VALUE, ); const ERROR_ARCH_MISMATCH: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#ARCH_MISMATCH, ); const ERROR_MAPPING_ERROR: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#MAPPING_ERROR, ); const ERROR_RUNTIME_PREREQUISITE_MISSING: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#RUNTIME_PREREQUISITE_MISSING, ); const ERROR_VERSION_MISMATCH: cudnnStatus_t = cudnnStatus_t::Err( cudnnError_t::r#VERSION_MISMATCH, ); } impl cudnnStatus_tConsts for cudnnStatus_t {} #[must_use] pub type cudnnStatus_t = ::core::result::Result<(), cudnnError_t>; const _: fn() = || { let _ = std::mem::transmute::; }; impl From for cudnnError_t { fn from(error: miopen_sys::miopenError_t) -> Self { match error { miopen_sys::miopenError_t::NotInitialized => cudnnError_t::NOT_INITIALIZED, miopen_sys::miopenError_t::InvalidValue => cudnnError_t::INVALID_VALUE, miopen_sys::miopenError_t::BadParm => cudnnError_t::BAD_PARAM, miopen_sys::miopenError_t::AllocFailed => cudnnError_t::ALLOC_FAILED, miopen_sys::miopenError_t::InternalError => cudnnError_t::INTERNAL_ERROR, miopen_sys::miopenError_t::NotImplemented | miopen_sys::miopenError_t::UnsupportedOp => cudnnError_t::NOT_SUPPORTED, miopen_sys::miopenError_t::VersionMismatch => cudnnError_t::VERSION_MISMATCH, _ => cudnnError_t::INTERNAL_ERROR, } } } ================================================ FILE: cuda_types/src/cufft.rs ================================================ // Generated automatically by zluda_bindgen // DO NOT EDIT MANUALLY #![allow(warnings)] pub type __half = u16; pub type __nv_bfloat16 = u16; pub use super::cuda::cuComplex; pub use super::cuda::cuDoubleComplex; pub use super::cuda::cudaDataType; pub use super::cuda::cudaDataType_t; pub type cudaStream_t = super::cuda::CUstream; pub use super::cuda::libraryPropertyType; pub type cudaGraphExecUpdateResultInfo_st = super::cuda::CUgraphExecUpdateResultInfo_st; pub type cudaAsyncNotificationType = super::cuda::CUasyncNotificationType_enum; pub type cudaGraph_t = super::cuda::CUgraph; pub const CUFFT_VER_MAJOR: u32 = 12; pub const CUFFT_VER_MINOR: u32 = 1; pub const CUFFT_VER_PATCH: u32 = 0; pub const CUFFT_VER_BUILD: u32 = 31; pub const CUFFT_VERSION: u32 = 12100; pub const CUFFT_FORWARD: i32 = -1; pub const CUFFT_INVERSE: u32 = 1; pub const CUFFT_PLAN_NULL: i32 = -1; impl libFormat_t { pub const LIB_FORMAT_CUFFT: libFormat_t = libFormat_t(0); } impl libFormat_t { pub const LIB_FORMAT_UNDEFINED: libFormat_t = libFormat_t(1); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct libFormat_t(pub ::core::ffi::c_uint); pub use self::libFormat_t as libFormat; #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudaXtDesc_t { pub version: ::core::ffi::c_int, pub nGPUs: ::core::ffi::c_int, pub GPUs: [::core::ffi::c_int; 64usize], pub data: [*mut ::core::ffi::c_void; 64usize], pub size: [usize; 64usize], pub cudaXtState: *mut ::core::ffi::c_void, } pub type cudaXtDesc = cudaXtDesc_t; #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudaLibXtDesc_t { pub version: ::core::ffi::c_int, pub descriptor: *mut cudaXtDesc, pub library: libFormat, pub subFormat: ::core::ffi::c_int, pub libDescriptor: *mut ::core::ffi::c_void, } pub type cudaLibXtDesc = cudaLibXtDesc_t; pub type cufftReal = f32; pub type cufftDoubleReal = f64; pub type cufftComplex = super::cuda::cuComplex; pub type cufftDoubleComplex = super::cuda::cuDoubleComplex; impl cufftType_t { pub const CUFFT_R2C: cufftType_t = cufftType_t(42); } impl cufftType_t { pub const CUFFT_C2R: cufftType_t = cufftType_t(44); } impl cufftType_t { pub const CUFFT_C2C: cufftType_t = cufftType_t(41); } impl cufftType_t { pub const CUFFT_D2Z: cufftType_t = cufftType_t(106); } impl cufftType_t { pub const CUFFT_Z2D: cufftType_t = cufftType_t(108); } impl cufftType_t { pub const CUFFT_Z2Z: cufftType_t = cufftType_t(105); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cufftType_t(pub ::core::ffi::c_uint); pub use self::cufftType_t as cufftType; impl cufftCompatibility_t { pub const CUFFT_COMPATIBILITY_FFTW_PADDING: cufftCompatibility_t = cufftCompatibility_t( 1, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cufftCompatibility_t(pub ::core::ffi::c_uint); pub use self::cufftCompatibility_t as cufftCompatibility; pub type cufftHandle = ::core::ffi::c_int; impl cufftProperty_t { pub const NVFFT_PLAN_PROPERTY_INT64_PATIENT_JIT: cufftProperty_t = cufftProperty_t( 1, ); } impl cufftProperty_t { pub const NVFFT_PLAN_PROPERTY_INT64_MAX_NUM_HOST_THREADS: cufftProperty_t = cufftProperty_t( 2, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cufftProperty_t(pub ::core::ffi::c_uint); pub use self::cufftProperty_t as cufftProperty; impl cufftXtSubFormat_t { pub const CUFFT_XT_FORMAT_INPUT: cufftXtSubFormat_t = cufftXtSubFormat_t(0); } impl cufftXtSubFormat_t { pub const CUFFT_XT_FORMAT_OUTPUT: cufftXtSubFormat_t = cufftXtSubFormat_t(1); } impl cufftXtSubFormat_t { pub const CUFFT_XT_FORMAT_INPLACE: cufftXtSubFormat_t = cufftXtSubFormat_t(2); } impl cufftXtSubFormat_t { pub const CUFFT_XT_FORMAT_INPLACE_SHUFFLED: cufftXtSubFormat_t = cufftXtSubFormat_t( 3, ); } impl cufftXtSubFormat_t { pub const CUFFT_XT_FORMAT_1D_INPUT_SHUFFLED: cufftXtSubFormat_t = cufftXtSubFormat_t( 4, ); } impl cufftXtSubFormat_t { pub const CUFFT_XT_FORMAT_DISTRIBUTED_INPUT: cufftXtSubFormat_t = cufftXtSubFormat_t( 5, ); } impl cufftXtSubFormat_t { pub const CUFFT_XT_FORMAT_DISTRIBUTED_OUTPUT: cufftXtSubFormat_t = cufftXtSubFormat_t( 6, ); } impl cufftXtSubFormat_t { pub const CUFFT_FORMAT_UNDEFINED: cufftXtSubFormat_t = cufftXtSubFormat_t(7); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cufftXtSubFormat_t(pub ::core::ffi::c_uint); pub use self::cufftXtSubFormat_t as cufftXtSubFormat; impl cufftXtCopyType_t { pub const CUFFT_COPY_HOST_TO_DEVICE: cufftXtCopyType_t = cufftXtCopyType_t(0); } impl cufftXtCopyType_t { pub const CUFFT_COPY_DEVICE_TO_HOST: cufftXtCopyType_t = cufftXtCopyType_t(1); } impl cufftXtCopyType_t { pub const CUFFT_COPY_DEVICE_TO_DEVICE: cufftXtCopyType_t = cufftXtCopyType_t(2); } impl cufftXtCopyType_t { pub const CUFFT_COPY_UNDEFINED: cufftXtCopyType_t = cufftXtCopyType_t(3); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cufftXtCopyType_t(pub ::core::ffi::c_uint); pub use self::cufftXtCopyType_t as cufftXtCopyType; impl cufftXtQueryType_t { pub const CUFFT_QUERY_1D_FACTORS: cufftXtQueryType_t = cufftXtQueryType_t(0); } impl cufftXtQueryType_t { pub const CUFFT_QUERY_UNDEFINED: cufftXtQueryType_t = cufftXtQueryType_t(1); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cufftXtQueryType_t(pub ::core::ffi::c_uint); pub use self::cufftXtQueryType_t as cufftXtQueryType; #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cufftXt1dFactors_t { pub size: ::core::ffi::c_longlong, pub stringCount: ::core::ffi::c_longlong, pub stringLength: ::core::ffi::c_longlong, pub substringLength: ::core::ffi::c_longlong, pub factor1: ::core::ffi::c_longlong, pub factor2: ::core::ffi::c_longlong, pub stringMask: ::core::ffi::c_longlong, pub substringMask: ::core::ffi::c_longlong, pub factor1Mask: ::core::ffi::c_longlong, pub factor2Mask: ::core::ffi::c_longlong, pub stringShift: ::core::ffi::c_int, pub substringShift: ::core::ffi::c_int, pub factor1Shift: ::core::ffi::c_int, pub factor2Shift: ::core::ffi::c_int, } pub type cufftXt1dFactors = cufftXt1dFactors_t; impl cufftXtWorkAreaPolicy_t { pub const CUFFT_WORKAREA_MINIMAL: cufftXtWorkAreaPolicy_t = cufftXtWorkAreaPolicy_t( 0, ); } impl cufftXtWorkAreaPolicy_t { pub const CUFFT_WORKAREA_USER: cufftXtWorkAreaPolicy_t = cufftXtWorkAreaPolicy_t(1); } impl cufftXtWorkAreaPolicy_t { pub const CUFFT_WORKAREA_PERFORMANCE: cufftXtWorkAreaPolicy_t = cufftXtWorkAreaPolicy_t( 2, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cufftXtWorkAreaPolicy_t(pub ::core::ffi::c_uint); pub use self::cufftXtWorkAreaPolicy_t as cufftXtWorkAreaPolicy; impl cufftXtCallbackType_t { pub const CUFFT_CB_LD_COMPLEX: cufftXtCallbackType_t = cufftXtCallbackType_t(0); } impl cufftXtCallbackType_t { pub const CUFFT_CB_LD_COMPLEX_DOUBLE: cufftXtCallbackType_t = cufftXtCallbackType_t( 1, ); } impl cufftXtCallbackType_t { pub const CUFFT_CB_LD_REAL: cufftXtCallbackType_t = cufftXtCallbackType_t(2); } impl cufftXtCallbackType_t { pub const CUFFT_CB_LD_REAL_DOUBLE: cufftXtCallbackType_t = cufftXtCallbackType_t(3); } impl cufftXtCallbackType_t { pub const CUFFT_CB_ST_COMPLEX: cufftXtCallbackType_t = cufftXtCallbackType_t(4); } impl cufftXtCallbackType_t { pub const CUFFT_CB_ST_COMPLEX_DOUBLE: cufftXtCallbackType_t = cufftXtCallbackType_t( 5, ); } impl cufftXtCallbackType_t { pub const CUFFT_CB_ST_REAL: cufftXtCallbackType_t = cufftXtCallbackType_t(6); } impl cufftXtCallbackType_t { pub const CUFFT_CB_ST_REAL_DOUBLE: cufftXtCallbackType_t = cufftXtCallbackType_t(7); } impl cufftXtCallbackType_t { pub const CUFFT_CB_UNDEFINED: cufftXtCallbackType_t = cufftXtCallbackType_t(8); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cufftXtCallbackType_t(pub ::core::ffi::c_uint); pub use self::cufftXtCallbackType_t as cufftXtCallbackType; pub type cufftCallbackLoadC = ::core::option::Option< unsafe extern "C" fn( dataIn: *mut ::core::ffi::c_void, offset: usize, callerInfo: *mut ::core::ffi::c_void, sharedPointer: *mut ::core::ffi::c_void, ) -> cufftComplex, >; pub type cufftCallbackLoadZ = ::core::option::Option< unsafe extern "C" fn( dataIn: *mut ::core::ffi::c_void, offset: usize, callerInfo: *mut ::core::ffi::c_void, sharedPointer: *mut ::core::ffi::c_void, ) -> cufftDoubleComplex, >; pub type cufftCallbackLoadR = ::core::option::Option< unsafe extern "C" fn( dataIn: *mut ::core::ffi::c_void, offset: usize, callerInfo: *mut ::core::ffi::c_void, sharedPointer: *mut ::core::ffi::c_void, ) -> cufftReal, >; pub type cufftCallbackLoadD = ::core::option::Option< unsafe extern "C" fn( dataIn: *mut ::core::ffi::c_void, offset: usize, callerInfo: *mut ::core::ffi::c_void, sharedPointer: *mut ::core::ffi::c_void, ) -> cufftDoubleReal, >; pub type cufftCallbackStoreC = ::core::option::Option< unsafe extern "C" fn( dataOut: *mut ::core::ffi::c_void, offset: usize, element: cufftComplex, callerInfo: *mut ::core::ffi::c_void, sharedPointer: *mut ::core::ffi::c_void, ), >; pub type cufftCallbackStoreZ = ::core::option::Option< unsafe extern "C" fn( dataOut: *mut ::core::ffi::c_void, offset: usize, element: cufftDoubleComplex, callerInfo: *mut ::core::ffi::c_void, sharedPointer: *mut ::core::ffi::c_void, ), >; pub type cufftCallbackStoreR = ::core::option::Option< unsafe extern "C" fn( dataOut: *mut ::core::ffi::c_void, offset: usize, element: cufftReal, callerInfo: *mut ::core::ffi::c_void, sharedPointer: *mut ::core::ffi::c_void, ), >; pub type cufftCallbackStoreD = ::core::option::Option< unsafe extern "C" fn( dataOut: *mut ::core::ffi::c_void, offset: usize, element: cufftDoubleReal, callerInfo: *mut ::core::ffi::c_void, sharedPointer: *mut ::core::ffi::c_void, ), >; pub type cufftJITCallbackLoadC = ::core::option::Option< unsafe extern "C" fn( dataIn: *mut ::core::ffi::c_void, offset: ::core::ffi::c_ulonglong, callerInfo: *mut ::core::ffi::c_void, sharedPointer: *mut ::core::ffi::c_void, ) -> cufftComplex, >; pub type cufftJITCallbackLoadZ = ::core::option::Option< unsafe extern "C" fn( dataIn: *mut ::core::ffi::c_void, offset: ::core::ffi::c_ulonglong, callerInfo: *mut ::core::ffi::c_void, sharedPointer: *mut ::core::ffi::c_void, ) -> cufftDoubleComplex, >; pub type cufftJITCallbackLoadR = ::core::option::Option< unsafe extern "C" fn( dataIn: *mut ::core::ffi::c_void, offset: ::core::ffi::c_ulonglong, callerInfo: *mut ::core::ffi::c_void, sharedPointer: *mut ::core::ffi::c_void, ) -> cufftReal, >; pub type cufftJITCallbackLoadD = ::core::option::Option< unsafe extern "C" fn( dataIn: *mut ::core::ffi::c_void, offset: ::core::ffi::c_ulonglong, callerInfo: *mut ::core::ffi::c_void, sharedPointer: *mut ::core::ffi::c_void, ) -> cufftDoubleReal, >; pub type cufftJITCallbackStoreC = ::core::option::Option< unsafe extern "C" fn( dataOut: *mut ::core::ffi::c_void, offset: ::core::ffi::c_ulonglong, element: cufftComplex, callerInfo: *mut ::core::ffi::c_void, sharedPointer: *mut ::core::ffi::c_void, ), >; pub type cufftJITCallbackStoreZ = ::core::option::Option< unsafe extern "C" fn( dataOut: *mut ::core::ffi::c_void, offset: ::core::ffi::c_ulonglong, element: cufftDoubleComplex, callerInfo: *mut ::core::ffi::c_void, sharedPointer: *mut ::core::ffi::c_void, ), >; pub type cufftJITCallbackStoreR = ::core::option::Option< unsafe extern "C" fn( dataOut: *mut ::core::ffi::c_void, offset: ::core::ffi::c_ulonglong, element: cufftReal, callerInfo: *mut ::core::ffi::c_void, sharedPointer: *mut ::core::ffi::c_void, ), >; pub type cufftJITCallbackStoreD = ::core::option::Option< unsafe extern "C" fn( dataOut: *mut ::core::ffi::c_void, offset: ::core::ffi::c_ulonglong, element: cufftDoubleReal, callerInfo: *mut ::core::ffi::c_void, sharedPointer: *mut ::core::ffi::c_void, ), >; impl cufftError_t { pub const r#INVALID_PLAN: cufftError_t = cufftError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(1) }); pub const r#ALLOC_FAILED: cufftError_t = cufftError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(2) }); pub const r#INVALID_TYPE: cufftError_t = cufftError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(3) }); pub const r#INVALID_VALUE: cufftError_t = cufftError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(4) }); pub const r#INTERNAL_ERROR: cufftError_t = cufftError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(5) }); pub const r#EXEC_FAILED: cufftError_t = cufftError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(6) }); pub const r#SETUP_FAILED: cufftError_t = cufftError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(7) }); pub const r#INVALID_SIZE: cufftError_t = cufftError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(8) }); pub const r#UNALIGNED_DATA: cufftError_t = cufftError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(9) }); pub const r#INVALID_DEVICE: cufftError_t = cufftError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(11) }); pub const r#NO_WORKSPACE: cufftError_t = cufftError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(13) }); pub const r#NOT_IMPLEMENTED: cufftError_t = cufftError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(14) }); pub const r#NOT_SUPPORTED: cufftError_t = cufftError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(16) }); pub const r#MISSING_DEPENDENCY: cufftError_t = cufftError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(17) }); pub const r#NVRTC_FAILURE: cufftError_t = cufftError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(18) }); pub const r#NVJITLINK_FAILURE: cufftError_t = cufftError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(19) }); pub const r#NVSHMEM_FAILURE: cufftError_t = cufftError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(20) }); } #[repr(transparent)] #[derive(Debug, Hash, Copy, Clone, PartialEq, Eq)] pub struct cufftError_t(pub ::core::num::NonZeroU32); pub trait cufftResultConsts { const SUCCESS: cufftResult = cufftResult::Ok(()); const ERROR_INVALID_PLAN: cufftResult = cufftResult::Err( cufftError_t::r#INVALID_PLAN, ); const ERROR_ALLOC_FAILED: cufftResult = cufftResult::Err( cufftError_t::r#ALLOC_FAILED, ); const ERROR_INVALID_TYPE: cufftResult = cufftResult::Err( cufftError_t::r#INVALID_TYPE, ); const ERROR_INVALID_VALUE: cufftResult = cufftResult::Err( cufftError_t::r#INVALID_VALUE, ); const ERROR_INTERNAL_ERROR: cufftResult = cufftResult::Err( cufftError_t::r#INTERNAL_ERROR, ); const ERROR_EXEC_FAILED: cufftResult = cufftResult::Err(cufftError_t::r#EXEC_FAILED); const ERROR_SETUP_FAILED: cufftResult = cufftResult::Err( cufftError_t::r#SETUP_FAILED, ); const ERROR_INVALID_SIZE: cufftResult = cufftResult::Err( cufftError_t::r#INVALID_SIZE, ); const ERROR_UNALIGNED_DATA: cufftResult = cufftResult::Err( cufftError_t::r#UNALIGNED_DATA, ); const ERROR_INVALID_DEVICE: cufftResult = cufftResult::Err( cufftError_t::r#INVALID_DEVICE, ); const ERROR_NO_WORKSPACE: cufftResult = cufftResult::Err( cufftError_t::r#NO_WORKSPACE, ); const ERROR_NOT_IMPLEMENTED: cufftResult = cufftResult::Err( cufftError_t::r#NOT_IMPLEMENTED, ); const ERROR_NOT_SUPPORTED: cufftResult = cufftResult::Err( cufftError_t::r#NOT_SUPPORTED, ); const ERROR_MISSING_DEPENDENCY: cufftResult = cufftResult::Err( cufftError_t::r#MISSING_DEPENDENCY, ); const ERROR_NVRTC_FAILURE: cufftResult = cufftResult::Err( cufftError_t::r#NVRTC_FAILURE, ); const ERROR_NVJITLINK_FAILURE: cufftResult = cufftResult::Err( cufftError_t::r#NVJITLINK_FAILURE, ); const ERROR_NVSHMEM_FAILURE: cufftResult = cufftResult::Err( cufftError_t::r#NVSHMEM_FAILURE, ); } impl cufftResultConsts for cufftResult {} #[must_use] pub type cufftResult = ::core::result::Result<(), cufftError_t>; const _: fn() = || { let _ = std::mem::transmute::; }; ================================================ FILE: cuda_types/src/cusparse.rs ================================================ // Generated automatically by zluda_bindgen // DO NOT EDIT MANUALLY #![allow(warnings)] pub type __half = u16; pub type __nv_bfloat16 = u16; pub use super::cuda::cuComplex; pub use super::cuda::cuDoubleComplex; pub use super::cuda::cudaDataType; pub use super::cuda::cudaDataType_t; pub type cudaStream_t = super::cuda::CUstream; pub use super::cuda::libraryPropertyType; pub type cudaGraphExecUpdateResultInfo_st = super::cuda::CUgraphExecUpdateResultInfo_st; pub type cudaAsyncNotificationType = super::cuda::CUasyncNotificationType_enum; pub type cudaGraph_t = super::cuda::CUgraph; pub const CUSPARSE_VER_MAJOR: u32 = 12; pub const CUSPARSE_VER_MINOR: u32 = 6; pub const CUSPARSE_VER_PATCH: u32 = 3; pub const CUSPARSE_VER_BUILD: u32 = 3; pub const CUSPARSE_VERSION: u32 = 12603; /// Result information returned by cudaGraphExecUpdate pub type cudaGraphExecUpdateResultInfo = cudaGraphExecUpdateResultInfo_st; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cusparseContext { _unused: [u8; 0], } pub type cusparseHandle_t = *mut cusparseContext; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cusparseMatDescr { _unused: [u8; 0], } pub type cusparseMatDescr_t = *mut cusparseMatDescr; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct bsrsv2Info { _unused: [u8; 0], } pub type bsrsv2Info_t = *mut bsrsv2Info; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct bsrsm2Info { _unused: [u8; 0], } pub type bsrsm2Info_t = *mut bsrsm2Info; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct csric02Info { _unused: [u8; 0], } pub type csric02Info_t = *mut csric02Info; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct bsric02Info { _unused: [u8; 0], } pub type bsric02Info_t = *mut bsric02Info; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct csrilu02Info { _unused: [u8; 0], } pub type csrilu02Info_t = *mut csrilu02Info; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct bsrilu02Info { _unused: [u8; 0], } pub type bsrilu02Info_t = *mut bsrilu02Info; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct csru2csrInfo { _unused: [u8; 0], } pub type csru2csrInfo_t = *mut csru2csrInfo; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cusparseColorInfo { _unused: [u8; 0], } pub type cusparseColorInfo_t = *mut cusparseColorInfo; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct pruneInfo { _unused: [u8; 0], } pub type pruneInfo_t = *mut pruneInfo; impl cusparsePointerMode_t { pub const CUSPARSE_POINTER_MODE_HOST: cusparsePointerMode_t = cusparsePointerMode_t( 0, ); } impl cusparsePointerMode_t { pub const CUSPARSE_POINTER_MODE_DEVICE: cusparsePointerMode_t = cusparsePointerMode_t( 1, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cusparsePointerMode_t(pub ::core::ffi::c_uint); impl cusparseAction_t { pub const CUSPARSE_ACTION_SYMBOLIC: cusparseAction_t = cusparseAction_t(0); } impl cusparseAction_t { pub const CUSPARSE_ACTION_NUMERIC: cusparseAction_t = cusparseAction_t(1); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cusparseAction_t(pub ::core::ffi::c_uint); impl cusparseMatrixType_t { pub const CUSPARSE_MATRIX_TYPE_GENERAL: cusparseMatrixType_t = cusparseMatrixType_t( 0, ); } impl cusparseMatrixType_t { pub const CUSPARSE_MATRIX_TYPE_SYMMETRIC: cusparseMatrixType_t = cusparseMatrixType_t( 1, ); } impl cusparseMatrixType_t { pub const CUSPARSE_MATRIX_TYPE_HERMITIAN: cusparseMatrixType_t = cusparseMatrixType_t( 2, ); } impl cusparseMatrixType_t { pub const CUSPARSE_MATRIX_TYPE_TRIANGULAR: cusparseMatrixType_t = cusparseMatrixType_t( 3, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cusparseMatrixType_t(pub ::core::ffi::c_uint); impl cusparseFillMode_t { pub const CUSPARSE_FILL_MODE_LOWER: cusparseFillMode_t = cusparseFillMode_t(0); } impl cusparseFillMode_t { pub const CUSPARSE_FILL_MODE_UPPER: cusparseFillMode_t = cusparseFillMode_t(1); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cusparseFillMode_t(pub ::core::ffi::c_uint); impl cusparseDiagType_t { pub const CUSPARSE_DIAG_TYPE_NON_UNIT: cusparseDiagType_t = cusparseDiagType_t(0); } impl cusparseDiagType_t { pub const CUSPARSE_DIAG_TYPE_UNIT: cusparseDiagType_t = cusparseDiagType_t(1); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cusparseDiagType_t(pub ::core::ffi::c_uint); impl cusparseIndexBase_t { pub const CUSPARSE_INDEX_BASE_ZERO: cusparseIndexBase_t = cusparseIndexBase_t(0); } impl cusparseIndexBase_t { pub const CUSPARSE_INDEX_BASE_ONE: cusparseIndexBase_t = cusparseIndexBase_t(1); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cusparseIndexBase_t(pub ::core::ffi::c_uint); impl cusparseOperation_t { pub const CUSPARSE_OPERATION_NON_TRANSPOSE: cusparseOperation_t = cusparseOperation_t( 0, ); } impl cusparseOperation_t { pub const CUSPARSE_OPERATION_TRANSPOSE: cusparseOperation_t = cusparseOperation_t(1); } impl cusparseOperation_t { pub const CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE: cusparseOperation_t = cusparseOperation_t( 2, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cusparseOperation_t(pub ::core::ffi::c_uint); impl cusparseDirection_t { pub const CUSPARSE_DIRECTION_ROW: cusparseDirection_t = cusparseDirection_t(0); } impl cusparseDirection_t { pub const CUSPARSE_DIRECTION_COLUMN: cusparseDirection_t = cusparseDirection_t(1); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cusparseDirection_t(pub ::core::ffi::c_uint); impl cusparseSolvePolicy_t { pub const CUSPARSE_SOLVE_POLICY_NO_LEVEL: cusparseSolvePolicy_t = cusparseSolvePolicy_t( 0, ); } impl cusparseSolvePolicy_t { pub const CUSPARSE_SOLVE_POLICY_USE_LEVEL: cusparseSolvePolicy_t = cusparseSolvePolicy_t( 1, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cusparseSolvePolicy_t(pub ::core::ffi::c_uint); impl cusparseColorAlg_t { pub const CUSPARSE_COLOR_ALG0: cusparseColorAlg_t = cusparseColorAlg_t(0); } impl cusparseColorAlg_t { pub const CUSPARSE_COLOR_ALG1: cusparseColorAlg_t = cusparseColorAlg_t(1); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cusparseColorAlg_t(pub ::core::ffi::c_uint); pub type cusparseLoggerCallback_t = ::core::option::Option< unsafe extern "C" fn( logLevel: ::core::ffi::c_int, functionName: *const ::core::ffi::c_char, message: *const ::core::ffi::c_char, ), >; impl cusparseCsr2CscAlg_t { pub const CUSPARSE_CSR2CSC_ALG_DEFAULT: cusparseCsr2CscAlg_t = cusparseCsr2CscAlg_t( 1, ); } impl cusparseCsr2CscAlg_t { pub const CUSPARSE_CSR2CSC_ALG1: cusparseCsr2CscAlg_t = cusparseCsr2CscAlg_t(1); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cusparseCsr2CscAlg_t(pub ::core::ffi::c_uint); impl cusparseFormat_t { ///< Compressed Sparse Row (CSR) pub const CUSPARSE_FORMAT_CSR: cusparseFormat_t = cusparseFormat_t(1); } impl cusparseFormat_t { ///< Compressed Sparse Column (CSC) pub const CUSPARSE_FORMAT_CSC: cusparseFormat_t = cusparseFormat_t(2); } impl cusparseFormat_t { ///< Coordinate (COO) - Structure of Arrays pub const CUSPARSE_FORMAT_COO: cusparseFormat_t = cusparseFormat_t(3); } impl cusparseFormat_t { ///< Blocked ELL pub const CUSPARSE_FORMAT_BLOCKED_ELL: cusparseFormat_t = cusparseFormat_t(5); } impl cusparseFormat_t { ///< Blocked Compressed Sparse Row (BSR) pub const CUSPARSE_FORMAT_BSR: cusparseFormat_t = cusparseFormat_t(6); } impl cusparseFormat_t { ///< Sliced ELL pub const CUSPARSE_FORMAT_SLICED_ELLPACK: cusparseFormat_t = cusparseFormat_t(7); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cusparseFormat_t(pub ::core::ffi::c_uint); impl cusparseOrder_t { ///< Column-Major Order - Matrix memory layout pub const CUSPARSE_ORDER_COL: cusparseOrder_t = cusparseOrder_t(1); } impl cusparseOrder_t { ///< Row-Major Order - Matrix memory layout pub const CUSPARSE_ORDER_ROW: cusparseOrder_t = cusparseOrder_t(2); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cusparseOrder_t(pub ::core::ffi::c_uint); impl cusparseIndexType_t { /**< 16-bit unsigned integer for matrix/vector < indices*/ pub const CUSPARSE_INDEX_16U: cusparseIndexType_t = cusparseIndexType_t(1); } impl cusparseIndexType_t { ///< 32-bit signed integer for matrix/vector indices pub const CUSPARSE_INDEX_32I: cusparseIndexType_t = cusparseIndexType_t(2); } impl cusparseIndexType_t { ///< 64-bit signed integer for matrix/vector indices pub const CUSPARSE_INDEX_64I: cusparseIndexType_t = cusparseIndexType_t(3); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cusparseIndexType_t(pub ::core::ffi::c_uint); #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cusparseSpVecDescr { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cusparseDnVecDescr { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cusparseSpMatDescr { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cusparseDnMatDescr { _unused: [u8; 0], } pub type cusparseSpVecDescr_t = *mut cusparseSpVecDescr; pub type cusparseDnVecDescr_t = *mut cusparseDnVecDescr; pub type cusparseSpMatDescr_t = *mut cusparseSpMatDescr; pub type cusparseDnMatDescr_t = *mut cusparseDnMatDescr; pub type cusparseConstSpVecDescr_t = *const cusparseSpVecDescr; pub type cusparseConstDnVecDescr_t = *const cusparseDnVecDescr; pub type cusparseConstSpMatDescr_t = *const cusparseSpMatDescr; pub type cusparseConstDnMatDescr_t = *const cusparseDnMatDescr; impl cusparseSpMatAttribute_t { pub const CUSPARSE_SPMAT_FILL_MODE: cusparseSpMatAttribute_t = cusparseSpMatAttribute_t( 0, ); } impl cusparseSpMatAttribute_t { pub const CUSPARSE_SPMAT_DIAG_TYPE: cusparseSpMatAttribute_t = cusparseSpMatAttribute_t( 1, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cusparseSpMatAttribute_t(pub ::core::ffi::c_uint); impl cusparseSparseToDenseAlg_t { pub const CUSPARSE_SPARSETODENSE_ALG_DEFAULT: cusparseSparseToDenseAlg_t = cusparseSparseToDenseAlg_t( 0, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cusparseSparseToDenseAlg_t(pub ::core::ffi::c_uint); impl cusparseDenseToSparseAlg_t { pub const CUSPARSE_DENSETOSPARSE_ALG_DEFAULT: cusparseDenseToSparseAlg_t = cusparseDenseToSparseAlg_t( 0, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cusparseDenseToSparseAlg_t(pub ::core::ffi::c_uint); impl cusparseSpMVAlg_t { pub const CUSPARSE_SPMV_ALG_DEFAULT: cusparseSpMVAlg_t = cusparseSpMVAlg_t(0); } impl cusparseSpMVAlg_t { pub const CUSPARSE_SPMV_CSR_ALG1: cusparseSpMVAlg_t = cusparseSpMVAlg_t(2); } impl cusparseSpMVAlg_t { pub const CUSPARSE_SPMV_CSR_ALG2: cusparseSpMVAlg_t = cusparseSpMVAlg_t(3); } impl cusparseSpMVAlg_t { pub const CUSPARSE_SPMV_COO_ALG1: cusparseSpMVAlg_t = cusparseSpMVAlg_t(1); } impl cusparseSpMVAlg_t { pub const CUSPARSE_SPMV_COO_ALG2: cusparseSpMVAlg_t = cusparseSpMVAlg_t(4); } impl cusparseSpMVAlg_t { pub const CUSPARSE_SPMV_SELL_ALG1: cusparseSpMVAlg_t = cusparseSpMVAlg_t(5); } impl cusparseSpMVAlg_t { pub const CUSPARSE_SPMV_BSR_ALG1: cusparseSpMVAlg_t = cusparseSpMVAlg_t(6); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cusparseSpMVAlg_t(pub ::core::ffi::c_uint); impl cusparseSpSVAlg_t { pub const CUSPARSE_SPSV_ALG_DEFAULT: cusparseSpSVAlg_t = cusparseSpSVAlg_t(0); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cusparseSpSVAlg_t(pub ::core::ffi::c_uint); impl cusparseSpSVUpdate_t { pub const CUSPARSE_SPSV_UPDATE_GENERAL: cusparseSpSVUpdate_t = cusparseSpSVUpdate_t( 0, ); } impl cusparseSpSVUpdate_t { pub const CUSPARSE_SPSV_UPDATE_DIAGONAL: cusparseSpSVUpdate_t = cusparseSpSVUpdate_t( 1, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cusparseSpSVUpdate_t(pub ::core::ffi::c_uint); #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cusparseSpSVDescr { _unused: [u8; 0], } pub type cusparseSpSVDescr_t = *mut cusparseSpSVDescr; impl cusparseSpSMAlg_t { pub const CUSPARSE_SPSM_ALG_DEFAULT: cusparseSpSMAlg_t = cusparseSpSMAlg_t(0); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cusparseSpSMAlg_t(pub ::core::ffi::c_uint); impl cusparseSpSMUpdate_t { pub const CUSPARSE_SPSM_UPDATE_GENERAL: cusparseSpSMUpdate_t = cusparseSpSMUpdate_t( 0, ); } impl cusparseSpSMUpdate_t { pub const CUSPARSE_SPSM_UPDATE_DIAGONAL: cusparseSpSMUpdate_t = cusparseSpSMUpdate_t( 1, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cusparseSpSMUpdate_t(pub ::core::ffi::c_uint); #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cusparseSpSMDescr { _unused: [u8; 0], } pub type cusparseSpSMDescr_t = *mut cusparseSpSMDescr; impl cusparseSpMMAlg_t { pub const CUSPARSE_SPMM_ALG_DEFAULT: cusparseSpMMAlg_t = cusparseSpMMAlg_t(0); } impl cusparseSpMMAlg_t { pub const CUSPARSE_SPMM_COO_ALG1: cusparseSpMMAlg_t = cusparseSpMMAlg_t(1); } impl cusparseSpMMAlg_t { pub const CUSPARSE_SPMM_COO_ALG2: cusparseSpMMAlg_t = cusparseSpMMAlg_t(2); } impl cusparseSpMMAlg_t { pub const CUSPARSE_SPMM_COO_ALG3: cusparseSpMMAlg_t = cusparseSpMMAlg_t(3); } impl cusparseSpMMAlg_t { pub const CUSPARSE_SPMM_COO_ALG4: cusparseSpMMAlg_t = cusparseSpMMAlg_t(5); } impl cusparseSpMMAlg_t { pub const CUSPARSE_SPMM_CSR_ALG1: cusparseSpMMAlg_t = cusparseSpMMAlg_t(4); } impl cusparseSpMMAlg_t { pub const CUSPARSE_SPMM_CSR_ALG2: cusparseSpMMAlg_t = cusparseSpMMAlg_t(6); } impl cusparseSpMMAlg_t { pub const CUSPARSE_SPMM_CSR_ALG3: cusparseSpMMAlg_t = cusparseSpMMAlg_t(12); } impl cusparseSpMMAlg_t { pub const CUSPARSE_SPMM_BLOCKED_ELL_ALG1: cusparseSpMMAlg_t = cusparseSpMMAlg_t(13); } impl cusparseSpMMAlg_t { pub const CUSPARSE_SPMM_BSR_ALG1: cusparseSpMMAlg_t = cusparseSpMMAlg_t(14); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cusparseSpMMAlg_t(pub ::core::ffi::c_uint); impl cusparseSpGEMMAlg_t { pub const CUSPARSE_SPGEMM_DEFAULT: cusparseSpGEMMAlg_t = cusparseSpGEMMAlg_t(0); } impl cusparseSpGEMMAlg_t { pub const CUSPARSE_SPGEMM_CSR_ALG_DETERMINITIC: cusparseSpGEMMAlg_t = cusparseSpGEMMAlg_t( 1, ); } impl cusparseSpGEMMAlg_t { pub const CUSPARSE_SPGEMM_CSR_ALG_NONDETERMINITIC: cusparseSpGEMMAlg_t = cusparseSpGEMMAlg_t( 2, ); } impl cusparseSpGEMMAlg_t { pub const CUSPARSE_SPGEMM_ALG1: cusparseSpGEMMAlg_t = cusparseSpGEMMAlg_t(3); } impl cusparseSpGEMMAlg_t { pub const CUSPARSE_SPGEMM_ALG2: cusparseSpGEMMAlg_t = cusparseSpGEMMAlg_t(4); } impl cusparseSpGEMMAlg_t { pub const CUSPARSE_SPGEMM_ALG3: cusparseSpGEMMAlg_t = cusparseSpGEMMAlg_t(5); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cusparseSpGEMMAlg_t(pub ::core::ffi::c_uint); #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cusparseSpGEMMDescr { _unused: [u8; 0], } pub type cusparseSpGEMMDescr_t = *mut cusparseSpGEMMDescr; impl cusparseSDDMMAlg_t { pub const CUSPARSE_SDDMM_ALG_DEFAULT: cusparseSDDMMAlg_t = cusparseSDDMMAlg_t(0); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cusparseSDDMMAlg_t(pub ::core::ffi::c_uint); #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cusparseSpMMOpPlan { _unused: [u8; 0], } pub type cusparseSpMMOpPlan_t = *mut cusparseSpMMOpPlan; impl cusparseSpMMOpAlg_t { pub const CUSPARSE_SPMM_OP_ALG_DEFAULT: cusparseSpMMOpAlg_t = cusparseSpMMOpAlg_t(0); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cusparseSpMMOpAlg_t(pub ::core::ffi::c_uint); impl cusparseError_t { pub const r#NOT_INITIALIZED: cusparseError_t = cusparseError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(1) }); pub const r#ALLOC_FAILED: cusparseError_t = cusparseError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(2) }); pub const r#INVALID_VALUE: cusparseError_t = cusparseError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(3) }); pub const r#ARCH_MISMATCH: cusparseError_t = cusparseError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(4) }); pub const r#MAPPING_ERROR: cusparseError_t = cusparseError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(5) }); pub const r#EXECUTION_FAILED: cusparseError_t = cusparseError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(6) }); pub const r#INTERNAL_ERROR: cusparseError_t = cusparseError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(7) }); pub const r#MATRIX_TYPE_NOT_SUPPORTED: cusparseError_t = cusparseError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(8) }); pub const r#ZERO_PIVOT: cusparseError_t = cusparseError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(9) }); pub const r#NOT_SUPPORTED: cusparseError_t = cusparseError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(10) }); pub const r#INSUFFICIENT_RESOURCES: cusparseError_t = cusparseError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(11) }); } #[repr(transparent)] #[derive(Debug, Hash, Copy, Clone, PartialEq, Eq)] pub struct cusparseError_t(pub ::core::num::NonZeroU32); pub trait cusparseStatus_tConsts { const SUCCESS: cusparseStatus_t = cusparseStatus_t::Ok(()); const ERROR_NOT_INITIALIZED: cusparseStatus_t = cusparseStatus_t::Err( cusparseError_t::r#NOT_INITIALIZED, ); const ERROR_ALLOC_FAILED: cusparseStatus_t = cusparseStatus_t::Err( cusparseError_t::r#ALLOC_FAILED, ); const ERROR_INVALID_VALUE: cusparseStatus_t = cusparseStatus_t::Err( cusparseError_t::r#INVALID_VALUE, ); const ERROR_ARCH_MISMATCH: cusparseStatus_t = cusparseStatus_t::Err( cusparseError_t::r#ARCH_MISMATCH, ); const ERROR_MAPPING_ERROR: cusparseStatus_t = cusparseStatus_t::Err( cusparseError_t::r#MAPPING_ERROR, ); const ERROR_EXECUTION_FAILED: cusparseStatus_t = cusparseStatus_t::Err( cusparseError_t::r#EXECUTION_FAILED, ); const ERROR_INTERNAL_ERROR: cusparseStatus_t = cusparseStatus_t::Err( cusparseError_t::r#INTERNAL_ERROR, ); const ERROR_MATRIX_TYPE_NOT_SUPPORTED: cusparseStatus_t = cusparseStatus_t::Err( cusparseError_t::r#MATRIX_TYPE_NOT_SUPPORTED, ); const ERROR_ZERO_PIVOT: cusparseStatus_t = cusparseStatus_t::Err( cusparseError_t::r#ZERO_PIVOT, ); const ERROR_NOT_SUPPORTED: cusparseStatus_t = cusparseStatus_t::Err( cusparseError_t::r#NOT_SUPPORTED, ); const ERROR_INSUFFICIENT_RESOURCES: cusparseStatus_t = cusparseStatus_t::Err( cusparseError_t::r#INSUFFICIENT_RESOURCES, ); } impl cusparseStatus_tConsts for cusparseStatus_t {} #[must_use] pub type cusparseStatus_t = ::core::result::Result<(), cusparseError_t>; const _: fn() = || { let _ = std::mem::transmute::; }; impl From for cusparseError_t { fn from(error: rocsparse_sys::rocsparse_error) -> Self { match error { rocsparse_sys::rocsparse_error::invalid_handle => cusparseError_t::INVALID_VALUE, rocsparse_sys::rocsparse_error::not_implemented => cusparseError_t::NOT_SUPPORTED, rocsparse_sys::rocsparse_error::invalid_pointer => cusparseError_t::INVALID_VALUE, rocsparse_sys::rocsparse_error::invalid_size => cusparseError_t::INVALID_VALUE, rocsparse_sys::rocsparse_error::memory_error => cusparseError_t::ALLOC_FAILED, rocsparse_sys::rocsparse_error::internal_error => cusparseError_t::INTERNAL_ERROR, rocsparse_sys::rocsparse_error::invalid_value => cusparseError_t::INVALID_VALUE, rocsparse_sys::rocsparse_error::arch_mismatch => cusparseError_t::ARCH_MISMATCH, rocsparse_sys::rocsparse_error::zero_pivot => cusparseError_t::ZERO_PIVOT, rocsparse_sys::rocsparse_error::not_initialized => cusparseError_t::NOT_INITIALIZED, rocsparse_sys::rocsparse_error::type_mismatch => cusparseError_t::INVALID_VALUE, rocsparse_sys::rocsparse_error::requires_sorted_storage => cusparseError_t::INTERNAL_ERROR, rocsparse_sys::rocsparse_error::thrown_exception => cusparseError_t::INTERNAL_ERROR, rocsparse_sys::rocsparse_error::r#continue => cusparseError_t::INTERNAL_ERROR, _ => cusparseError_t::INTERNAL_ERROR } } } ================================================ FILE: cuda_types/src/dark_api.rs ================================================ use bitflags::bitflags; use std::ffi::{c_uint, c_ulonglong, c_ushort, c_void}; /* fat_cubin: typedef struct { int magic; int version; const unsigned long long* data; void *filename_or_fatbins; /* version 1: offline filename, * version 2: array of prelinked fatbins */ } __fatBinC_Wrapper_t; data start with this header: #define FATBIN_MAGIC 0xBA55ED50U #define OLD_STYLE_FATBIN_MAGIC 0x1EE55A01U #define FATBIN_VERSION 0x0001U struct fatbinary_ALIGN_(8) fatBinaryHeader { unsigned int magic; // FATBIN_MAGIC unsigned short version; // FATBIN_VERSION unsigned short headerSize; unsigned long long int fatSize; // size of the entire fat binary excluding this header }; there's binary data after header */ #[repr(C)] pub struct FatbincWrapper { pub magic: c_uint, pub version: c_uint, pub data: *const FatbinHeader, pub filename_or_fatbins: *const c_void, } #[repr(C, align(8))] pub struct FatbinHeader { pub magic: c_uint, pub version: c_ushort, pub header_size: c_ushort, pub files_size: c_ulonglong, // excluding frame header, size of all blocks framed by this frame } #[repr(C)] #[derive(Debug)] pub struct FatbinFileHeader { pub kind: c_ushort, pub version: c_ushort, pub header_size: c_uint, pub payload_size: c_uint, pub unknown0: c_uint, // check if it's written into separately pub compressed_size: c_uint, pub unknown1: c_uint, pub unknown2: c_uint, pub sm_version: c_uint, pub bit_width: c_uint, pub unknown3: c_uint, pub flags: FatbinFileHeaderFlags, pub unknown5: c_ulonglong, pub uncompressed_payload: c_ulonglong, } bitflags! { #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct FatbinFileHeaderFlags: u64 { const Is64Bit = 0x0000000000000001; const Debug = 0x0000000000000002; const Linux = 0x0000000000000010; const Mac = 0x0000000000000020; const Windows = 0x0000000000000040; const CompressedLz4 = 0x0000000000002000; const CompressedZstd = 0x0000000000008000; const _ = !0; } } impl FatbincWrapper { pub const MAGIC: [u8; 4] = 0x466243B1u32.to_le_bytes(); pub const VERSION_V1: c_uint = 0x1; pub const VERSION_V2: c_uint = 0x2; } impl FatbinHeader { pub const MAGIC: [u8; 4] = 0xBA55ED50u32.to_le_bytes(); pub const VERSION: c_ushort = 0x01; } impl FatbinFileHeader { pub const HEADER_KIND_PTX: c_ushort = 0x01; pub const HEADER_KIND_ELF: c_ushort = 0x02; pub const HEADER_VERSION_CURRENT: c_ushort = 0x101; } ================================================ FILE: cuda_types/src/lib.rs ================================================ pub enum FILE {} pub mod cublas; pub mod cublaslt; pub mod cuda; pub mod cudnn; pub mod cudnn8; pub mod cudnn9; pub mod cufft; pub mod cusparse; pub mod nvml; pub mod dark_api; ================================================ FILE: cuda_types/src/nvml.rs ================================================ // Generated automatically by zluda_bindgen // DO NOT EDIT MANUALLY #![allow(warnings)] pub type __half = u16; pub type __nv_bfloat16 = u16; pub use super::cuda::cuComplex; pub use super::cuda::cuDoubleComplex; pub use super::cuda::cudaDataType; pub use super::cuda::cudaDataType_t; pub type cudaStream_t = super::cuda::CUstream; pub use super::cuda::libraryPropertyType; pub type cudaGraphExecUpdateResultInfo_st = super::cuda::CUgraphExecUpdateResultInfo_st; pub type cudaAsyncNotificationType = super::cuda::CUasyncNotificationType_enum; pub type cudaGraph_t = super::cuda::CUgraph; pub const NVML_API_VERSION: u32 = 13; pub const NVML_API_VERSION_STR: &[u8; 3] = b"13\0"; pub const NVML_VALUE_NOT_AVAILABLE: i32 = -1; pub const NVML_DEVICE_PCI_BUS_ID_BUFFER_SIZE: u32 = 32; pub const NVML_DEVICE_PCI_BUS_ID_BUFFER_V2_SIZE: u32 = 16; pub const NVML_DEVICE_PCI_BUS_ID_LEGACY_FMT: &[u8; 17] = b"%04X:%02X:%02X.0\0"; pub const NVML_DEVICE_PCI_BUS_ID_FMT: &[u8; 17] = b"%08X:%02X:%02X.0\0"; pub const NVML_NVLINK_MAX_LINKS: u32 = 18; pub const NVML_MAX_PHYSICAL_BRIDGE: u32 = 128; pub const NVML_MAX_THERMAL_SENSORS_PER_GPU: u32 = 3; pub const NVML_DEVICE_UUID_ASCII_LEN: u32 = 41; pub const NVML_DEVICE_UUID_BINARY_LEN: u32 = 16; pub const NVML_MAX_GPU_PERF_PSTATES: u32 = 16; pub const NVML_PERF_MODES_BUFFER_SIZE: u32 = 2048; pub const NVML_POWER_MIZER_MODE_ADAPTIVE: u32 = 0; pub const NVML_POWER_MIZER_MODE_PREFER_MAXIMUM_PERFORMANCE: u32 = 1; pub const NVML_POWER_MIZER_MODE_AUTO: u32 = 2; pub const NVML_POWER_MIZER_MODE_PREFER_CONSISTENT_PERFORMANCE: u32 = 3; pub const NVML_DEVICE_HOSTNAME_BUFFER_SIZE: u32 = 64; pub const NVML_GSP_FIRMWARE_VERSION_BUF_SIZE: u32 = 64; pub const NVML_DEVICE_ARCH_KEPLER: u32 = 2; pub const NVML_DEVICE_ARCH_MAXWELL: u32 = 3; pub const NVML_DEVICE_ARCH_PASCAL: u32 = 4; pub const NVML_DEVICE_ARCH_VOLTA: u32 = 5; pub const NVML_DEVICE_ARCH_TURING: u32 = 6; pub const NVML_DEVICE_ARCH_AMPERE: u32 = 7; pub const NVML_DEVICE_ARCH_ADA: u32 = 8; pub const NVML_DEVICE_ARCH_HOPPER: u32 = 9; pub const NVML_DEVICE_ARCH_BLACKWELL: u32 = 10; pub const NVML_DEVICE_ARCH_UNKNOWN: u32 = 4294967295; pub const NVML_BUS_TYPE_UNKNOWN: u32 = 0; pub const NVML_BUS_TYPE_PCI: u32 = 1; pub const NVML_BUS_TYPE_PCIE: u32 = 2; pub const NVML_BUS_TYPE_FPCI: u32 = 3; pub const NVML_BUS_TYPE_AGP: u32 = 4; pub const NVML_FAN_POLICY_TEMPERATURE_CONTINOUS_SW: u32 = 0; pub const NVML_FAN_POLICY_MANUAL: u32 = 1; pub const NVML_POWER_SOURCE_AC: u32 = 0; pub const NVML_POWER_SOURCE_BATTERY: u32 = 1; pub const NVML_POWER_SOURCE_UNDERSIZED: u32 = 2; pub const NVML_PCIE_LINK_MAX_SPEED_INVALID: u32 = 0; pub const NVML_PCIE_LINK_MAX_SPEED_2500MBPS: u32 = 1; pub const NVML_PCIE_LINK_MAX_SPEED_5000MBPS: u32 = 2; pub const NVML_PCIE_LINK_MAX_SPEED_8000MBPS: u32 = 3; pub const NVML_PCIE_LINK_MAX_SPEED_16000MBPS: u32 = 4; pub const NVML_PCIE_LINK_MAX_SPEED_32000MBPS: u32 = 5; pub const NVML_PCIE_LINK_MAX_SPEED_64000MBPS: u32 = 6; pub const NVML_ADAPTIVE_CLOCKING_INFO_STATUS_DISABLED: u32 = 0; pub const NVML_ADAPTIVE_CLOCKING_INFO_STATUS_ENABLED: u32 = 1; pub const NVML_MAX_GPU_UTILIZATIONS: u32 = 8; pub const NVML_PCIE_ATOMICS_CAP_FETCHADD32: u32 = 1; pub const NVML_PCIE_ATOMICS_CAP_FETCHADD64: u32 = 2; pub const NVML_PCIE_ATOMICS_CAP_SWAP32: u32 = 4; pub const NVML_PCIE_ATOMICS_CAP_SWAP64: u32 = 8; pub const NVML_PCIE_ATOMICS_CAP_CAS32: u32 = 16; pub const NVML_PCIE_ATOMICS_CAP_CAS64: u32 = 32; pub const NVML_PCIE_ATOMICS_CAP_CAS128: u32 = 64; pub const NVML_PCIE_ATOMICS_OPS_MAX: u32 = 7; pub const NVML_POWER_SCOPE_GPU: u32 = 0; pub const NVML_POWER_SCOPE_MODULE: u32 = 1; pub const NVML_POWER_SCOPE_MEMORY: u32 = 2; pub const NVML_GRID_LICENSE_EXPIRY_NOT_AVAILABLE: u32 = 0; pub const NVML_GRID_LICENSE_EXPIRY_INVALID: u32 = 1; pub const NVML_GRID_LICENSE_EXPIRY_VALID: u32 = 2; pub const NVML_GRID_LICENSE_EXPIRY_NOT_APPLICABLE: u32 = 3; pub const NVML_GRID_LICENSE_EXPIRY_PERMANENT: u32 = 4; pub const NVML_GRID_LICENSE_BUFFER_SIZE: u32 = 128; pub const NVML_VGPU_NAME_BUFFER_SIZE: u32 = 64; pub const NVML_GRID_LICENSE_FEATURE_MAX_COUNT: u32 = 3; pub const NVML_INVALID_VGPU_PLACEMENT_ID: u32 = 65535; pub const NVML_VGPU_VIRTUALIZATION_CAP_MIGRATION_NO: u32 = 0; pub const NVML_VGPU_VIRTUALIZATION_CAP_MIGRATION_YES: u32 = 1; pub const NVML_VGPU_PGPU_VIRTUALIZATION_CAP_MIGRATION_NO: u32 = 0; pub const NVML_VGPU_PGPU_VIRTUALIZATION_CAP_MIGRATION_YES: u32 = 1; pub const NVML_VGPU_PGPU_HETEROGENEOUS_MODE: u32 = 0; pub const NVML_VGPU_PGPU_HOMOGENEOUS_MODE: u32 = 1; pub const NVML_VGPU_SCHEDULER_POLICY_UNKNOWN: u32 = 0; pub const NVML_VGPU_SCHEDULER_POLICY_BEST_EFFORT: u32 = 1; pub const NVML_VGPU_SCHEDULER_POLICY_EQUAL_SHARE: u32 = 2; pub const NVML_VGPU_SCHEDULER_POLICY_FIXED_SHARE: u32 = 3; pub const NVML_SUPPORTED_VGPU_SCHEDULER_POLICY_COUNT: u32 = 3; pub const NVML_SCHEDULER_SW_MAX_LOG_ENTRIES: u32 = 200; pub const NVML_VGPU_SCHEDULER_ARR_DEFAULT: u32 = 0; pub const NVML_VGPU_SCHEDULER_ARR_DISABLE: u32 = 1; pub const NVML_VGPU_SCHEDULER_ARR_ENABLE: u32 = 2; pub const NVML_VGPU_SCHEDULER_ENGINE_TYPE_GRAPHICS: u32 = 1; pub const NVML_GRID_LICENSE_STATE_UNKNOWN: u32 = 0; pub const NVML_GRID_LICENSE_STATE_UNINITIALIZED: u32 = 1; pub const NVML_GRID_LICENSE_STATE_UNLICENSED_UNRESTRICTED: u32 = 2; pub const NVML_GRID_LICENSE_STATE_UNLICENSED_RESTRICTED: u32 = 3; pub const NVML_GRID_LICENSE_STATE_UNLICENSED: u32 = 4; pub const NVML_GRID_LICENSE_STATE_LICENSED: u32 = 5; pub const NVML_FI_DEV_ECC_CURRENT: u32 = 1; pub const NVML_FI_DEV_ECC_PENDING: u32 = 2; pub const NVML_FI_DEV_ECC_SBE_VOL_TOTAL: u32 = 3; pub const NVML_FI_DEV_ECC_DBE_VOL_TOTAL: u32 = 4; pub const NVML_FI_DEV_ECC_SBE_AGG_TOTAL: u32 = 5; pub const NVML_FI_DEV_ECC_DBE_AGG_TOTAL: u32 = 6; pub const NVML_FI_DEV_ECC_SBE_VOL_L1: u32 = 7; pub const NVML_FI_DEV_ECC_DBE_VOL_L1: u32 = 8; pub const NVML_FI_DEV_ECC_SBE_VOL_L2: u32 = 9; pub const NVML_FI_DEV_ECC_DBE_VOL_L2: u32 = 10; pub const NVML_FI_DEV_ECC_SBE_VOL_DEV: u32 = 11; pub const NVML_FI_DEV_ECC_DBE_VOL_DEV: u32 = 12; pub const NVML_FI_DEV_ECC_SBE_VOL_REG: u32 = 13; pub const NVML_FI_DEV_ECC_DBE_VOL_REG: u32 = 14; pub const NVML_FI_DEV_ECC_SBE_VOL_TEX: u32 = 15; pub const NVML_FI_DEV_ECC_DBE_VOL_TEX: u32 = 16; pub const NVML_FI_DEV_ECC_DBE_VOL_CBU: u32 = 17; pub const NVML_FI_DEV_ECC_SBE_AGG_L1: u32 = 18; pub const NVML_FI_DEV_ECC_DBE_AGG_L1: u32 = 19; pub const NVML_FI_DEV_ECC_SBE_AGG_L2: u32 = 20; pub const NVML_FI_DEV_ECC_DBE_AGG_L2: u32 = 21; pub const NVML_FI_DEV_ECC_SBE_AGG_DEV: u32 = 22; pub const NVML_FI_DEV_ECC_DBE_AGG_DEV: u32 = 23; pub const NVML_FI_DEV_ECC_SBE_AGG_REG: u32 = 24; pub const NVML_FI_DEV_ECC_DBE_AGG_REG: u32 = 25; pub const NVML_FI_DEV_ECC_SBE_AGG_TEX: u32 = 26; pub const NVML_FI_DEV_ECC_DBE_AGG_TEX: u32 = 27; pub const NVML_FI_DEV_ECC_DBE_AGG_CBU: u32 = 28; pub const NVML_FI_DEV_RETIRED_SBE: u32 = 29; pub const NVML_FI_DEV_RETIRED_DBE: u32 = 30; pub const NVML_FI_DEV_RETIRED_PENDING: u32 = 31; pub const NVML_FI_DEV_NVLINK_CRC_FLIT_ERROR_COUNT_L0: u32 = 32; pub const NVML_FI_DEV_NVLINK_CRC_FLIT_ERROR_COUNT_L1: u32 = 33; pub const NVML_FI_DEV_NVLINK_CRC_FLIT_ERROR_COUNT_L2: u32 = 34; pub const NVML_FI_DEV_NVLINK_CRC_FLIT_ERROR_COUNT_L3: u32 = 35; pub const NVML_FI_DEV_NVLINK_CRC_FLIT_ERROR_COUNT_L4: u32 = 36; pub const NVML_FI_DEV_NVLINK_CRC_FLIT_ERROR_COUNT_L5: u32 = 37; pub const NVML_FI_DEV_NVLINK_CRC_FLIT_ERROR_COUNT_TOTAL: u32 = 38; pub const NVML_FI_DEV_NVLINK_CRC_DATA_ERROR_COUNT_L0: u32 = 39; pub const NVML_FI_DEV_NVLINK_CRC_DATA_ERROR_COUNT_L1: u32 = 40; pub const NVML_FI_DEV_NVLINK_CRC_DATA_ERROR_COUNT_L2: u32 = 41; pub const NVML_FI_DEV_NVLINK_CRC_DATA_ERROR_COUNT_L3: u32 = 42; pub const NVML_FI_DEV_NVLINK_CRC_DATA_ERROR_COUNT_L4: u32 = 43; pub const NVML_FI_DEV_NVLINK_CRC_DATA_ERROR_COUNT_L5: u32 = 44; pub const NVML_FI_DEV_NVLINK_CRC_DATA_ERROR_COUNT_TOTAL: u32 = 45; pub const NVML_FI_DEV_NVLINK_REPLAY_ERROR_COUNT_L0: u32 = 46; pub const NVML_FI_DEV_NVLINK_REPLAY_ERROR_COUNT_L1: u32 = 47; pub const NVML_FI_DEV_NVLINK_REPLAY_ERROR_COUNT_L2: u32 = 48; pub const NVML_FI_DEV_NVLINK_REPLAY_ERROR_COUNT_L3: u32 = 49; pub const NVML_FI_DEV_NVLINK_REPLAY_ERROR_COUNT_L4: u32 = 50; pub const NVML_FI_DEV_NVLINK_REPLAY_ERROR_COUNT_L5: u32 = 51; pub const NVML_FI_DEV_NVLINK_REPLAY_ERROR_COUNT_TOTAL: u32 = 52; pub const NVML_FI_DEV_NVLINK_RECOVERY_ERROR_COUNT_L0: u32 = 53; pub const NVML_FI_DEV_NVLINK_RECOVERY_ERROR_COUNT_L1: u32 = 54; pub const NVML_FI_DEV_NVLINK_RECOVERY_ERROR_COUNT_L2: u32 = 55; pub const NVML_FI_DEV_NVLINK_RECOVERY_ERROR_COUNT_L3: u32 = 56; pub const NVML_FI_DEV_NVLINK_RECOVERY_ERROR_COUNT_L4: u32 = 57; pub const NVML_FI_DEV_NVLINK_RECOVERY_ERROR_COUNT_L5: u32 = 58; pub const NVML_FI_DEV_NVLINK_RECOVERY_ERROR_COUNT_TOTAL: u32 = 59; pub const NVML_FI_DEV_NVLINK_BANDWIDTH_C0_L0: u32 = 60; pub const NVML_FI_DEV_NVLINK_BANDWIDTH_C0_L1: u32 = 61; pub const NVML_FI_DEV_NVLINK_BANDWIDTH_C0_L2: u32 = 62; pub const NVML_FI_DEV_NVLINK_BANDWIDTH_C0_L3: u32 = 63; pub const NVML_FI_DEV_NVLINK_BANDWIDTH_C0_L4: u32 = 64; pub const NVML_FI_DEV_NVLINK_BANDWIDTH_C0_L5: u32 = 65; pub const NVML_FI_DEV_NVLINK_BANDWIDTH_C0_TOTAL: u32 = 66; pub const NVML_FI_DEV_NVLINK_BANDWIDTH_C1_L0: u32 = 67; pub const NVML_FI_DEV_NVLINK_BANDWIDTH_C1_L1: u32 = 68; pub const NVML_FI_DEV_NVLINK_BANDWIDTH_C1_L2: u32 = 69; pub const NVML_FI_DEV_NVLINK_BANDWIDTH_C1_L3: u32 = 70; pub const NVML_FI_DEV_NVLINK_BANDWIDTH_C1_L4: u32 = 71; pub const NVML_FI_DEV_NVLINK_BANDWIDTH_C1_L5: u32 = 72; pub const NVML_FI_DEV_NVLINK_BANDWIDTH_C1_TOTAL: u32 = 73; pub const NVML_FI_DEV_PERF_POLICY_POWER: u32 = 74; pub const NVML_FI_DEV_PERF_POLICY_THERMAL: u32 = 75; pub const NVML_FI_DEV_PERF_POLICY_SYNC_BOOST: u32 = 76; pub const NVML_FI_DEV_PERF_POLICY_BOARD_LIMIT: u32 = 77; pub const NVML_FI_DEV_PERF_POLICY_LOW_UTILIZATION: u32 = 78; pub const NVML_FI_DEV_PERF_POLICY_RELIABILITY: u32 = 79; pub const NVML_FI_DEV_PERF_POLICY_TOTAL_APP_CLOCKS: u32 = 80; pub const NVML_FI_DEV_PERF_POLICY_TOTAL_BASE_CLOCKS: u32 = 81; pub const NVML_FI_DEV_MEMORY_TEMP: u32 = 82; pub const NVML_FI_DEV_TOTAL_ENERGY_CONSUMPTION: u32 = 83; pub const NVML_FI_DEV_NVLINK_SPEED_MBPS_L0: u32 = 84; pub const NVML_FI_DEV_NVLINK_SPEED_MBPS_L1: u32 = 85; pub const NVML_FI_DEV_NVLINK_SPEED_MBPS_L2: u32 = 86; pub const NVML_FI_DEV_NVLINK_SPEED_MBPS_L3: u32 = 87; pub const NVML_FI_DEV_NVLINK_SPEED_MBPS_L4: u32 = 88; pub const NVML_FI_DEV_NVLINK_SPEED_MBPS_L5: u32 = 89; pub const NVML_FI_DEV_NVLINK_SPEED_MBPS_COMMON: u32 = 90; pub const NVML_FI_DEV_NVLINK_LINK_COUNT: u32 = 91; pub const NVML_FI_DEV_RETIRED_PENDING_SBE: u32 = 92; pub const NVML_FI_DEV_RETIRED_PENDING_DBE: u32 = 93; pub const NVML_FI_DEV_PCIE_REPLAY_COUNTER: u32 = 94; pub const NVML_FI_DEV_PCIE_REPLAY_ROLLOVER_COUNTER: u32 = 95; pub const NVML_FI_DEV_NVLINK_CRC_FLIT_ERROR_COUNT_L6: u32 = 96; pub const NVML_FI_DEV_NVLINK_CRC_FLIT_ERROR_COUNT_L7: u32 = 97; pub const NVML_FI_DEV_NVLINK_CRC_FLIT_ERROR_COUNT_L8: u32 = 98; pub const NVML_FI_DEV_NVLINK_CRC_FLIT_ERROR_COUNT_L9: u32 = 99; pub const NVML_FI_DEV_NVLINK_CRC_FLIT_ERROR_COUNT_L10: u32 = 100; pub const NVML_FI_DEV_NVLINK_CRC_FLIT_ERROR_COUNT_L11: u32 = 101; pub const NVML_FI_DEV_NVLINK_CRC_DATA_ERROR_COUNT_L6: u32 = 102; pub const NVML_FI_DEV_NVLINK_CRC_DATA_ERROR_COUNT_L7: u32 = 103; pub const NVML_FI_DEV_NVLINK_CRC_DATA_ERROR_COUNT_L8: u32 = 104; pub const NVML_FI_DEV_NVLINK_CRC_DATA_ERROR_COUNT_L9: u32 = 105; pub const NVML_FI_DEV_NVLINK_CRC_DATA_ERROR_COUNT_L10: u32 = 106; pub const NVML_FI_DEV_NVLINK_CRC_DATA_ERROR_COUNT_L11: u32 = 107; pub const NVML_FI_DEV_NVLINK_REPLAY_ERROR_COUNT_L6: u32 = 108; pub const NVML_FI_DEV_NVLINK_REPLAY_ERROR_COUNT_L7: u32 = 109; pub const NVML_FI_DEV_NVLINK_REPLAY_ERROR_COUNT_L8: u32 = 110; pub const NVML_FI_DEV_NVLINK_REPLAY_ERROR_COUNT_L9: u32 = 111; pub const NVML_FI_DEV_NVLINK_REPLAY_ERROR_COUNT_L10: u32 = 112; pub const NVML_FI_DEV_NVLINK_REPLAY_ERROR_COUNT_L11: u32 = 113; pub const NVML_FI_DEV_NVLINK_RECOVERY_ERROR_COUNT_L6: u32 = 114; pub const NVML_FI_DEV_NVLINK_RECOVERY_ERROR_COUNT_L7: u32 = 115; pub const NVML_FI_DEV_NVLINK_RECOVERY_ERROR_COUNT_L8: u32 = 116; pub const NVML_FI_DEV_NVLINK_RECOVERY_ERROR_COUNT_L9: u32 = 117; pub const NVML_FI_DEV_NVLINK_RECOVERY_ERROR_COUNT_L10: u32 = 118; pub const NVML_FI_DEV_NVLINK_RECOVERY_ERROR_COUNT_L11: u32 = 119; pub const NVML_FI_DEV_NVLINK_BANDWIDTH_C0_L6: u32 = 120; pub const NVML_FI_DEV_NVLINK_BANDWIDTH_C0_L7: u32 = 121; pub const NVML_FI_DEV_NVLINK_BANDWIDTH_C0_L8: u32 = 122; pub const NVML_FI_DEV_NVLINK_BANDWIDTH_C0_L9: u32 = 123; pub const NVML_FI_DEV_NVLINK_BANDWIDTH_C0_L10: u32 = 124; pub const NVML_FI_DEV_NVLINK_BANDWIDTH_C0_L11: u32 = 125; pub const NVML_FI_DEV_NVLINK_BANDWIDTH_C1_L6: u32 = 126; pub const NVML_FI_DEV_NVLINK_BANDWIDTH_C1_L7: u32 = 127; pub const NVML_FI_DEV_NVLINK_BANDWIDTH_C1_L8: u32 = 128; pub const NVML_FI_DEV_NVLINK_BANDWIDTH_C1_L9: u32 = 129; pub const NVML_FI_DEV_NVLINK_BANDWIDTH_C1_L10: u32 = 130; pub const NVML_FI_DEV_NVLINK_BANDWIDTH_C1_L11: u32 = 131; pub const NVML_FI_DEV_NVLINK_SPEED_MBPS_L6: u32 = 132; pub const NVML_FI_DEV_NVLINK_SPEED_MBPS_L7: u32 = 133; pub const NVML_FI_DEV_NVLINK_SPEED_MBPS_L8: u32 = 134; pub const NVML_FI_DEV_NVLINK_SPEED_MBPS_L9: u32 = 135; pub const NVML_FI_DEV_NVLINK_SPEED_MBPS_L10: u32 = 136; pub const NVML_FI_DEV_NVLINK_SPEED_MBPS_L11: u32 = 137; pub const NVML_FI_DEV_NVLINK_THROUGHPUT_DATA_TX: u32 = 138; pub const NVML_FI_DEV_NVLINK_THROUGHPUT_DATA_RX: u32 = 139; pub const NVML_FI_DEV_NVLINK_THROUGHPUT_RAW_TX: u32 = 140; pub const NVML_FI_DEV_NVLINK_THROUGHPUT_RAW_RX: u32 = 141; pub const NVML_FI_DEV_REMAPPED_COR: u32 = 142; pub const NVML_FI_DEV_REMAPPED_UNC: u32 = 143; pub const NVML_FI_DEV_REMAPPED_PENDING: u32 = 144; pub const NVML_FI_DEV_REMAPPED_FAILURE: u32 = 145; pub const NVML_FI_DEV_NVLINK_REMOTE_NVLINK_ID: u32 = 146; pub const NVML_FI_DEV_NVSWITCH_CONNECTED_LINK_COUNT: u32 = 147; pub const NVML_FI_DEV_NVLINK_ECC_DATA_ERROR_COUNT_L0: u32 = 148; pub const NVML_FI_DEV_NVLINK_ECC_DATA_ERROR_COUNT_L1: u32 = 149; pub const NVML_FI_DEV_NVLINK_ECC_DATA_ERROR_COUNT_L2: u32 = 150; pub const NVML_FI_DEV_NVLINK_ECC_DATA_ERROR_COUNT_L3: u32 = 151; pub const NVML_FI_DEV_NVLINK_ECC_DATA_ERROR_COUNT_L4: u32 = 152; pub const NVML_FI_DEV_NVLINK_ECC_DATA_ERROR_COUNT_L5: u32 = 153; pub const NVML_FI_DEV_NVLINK_ECC_DATA_ERROR_COUNT_L6: u32 = 154; pub const NVML_FI_DEV_NVLINK_ECC_DATA_ERROR_COUNT_L7: u32 = 155; pub const NVML_FI_DEV_NVLINK_ECC_DATA_ERROR_COUNT_L8: u32 = 156; pub const NVML_FI_DEV_NVLINK_ECC_DATA_ERROR_COUNT_L9: u32 = 157; pub const NVML_FI_DEV_NVLINK_ECC_DATA_ERROR_COUNT_L10: u32 = 158; pub const NVML_FI_DEV_NVLINK_ECC_DATA_ERROR_COUNT_L11: u32 = 159; pub const NVML_FI_DEV_NVLINK_ECC_DATA_ERROR_COUNT_TOTAL: u32 = 160; pub const NVML_FI_DEV_NVLINK_ERROR_DL_REPLAY: u32 = 161; pub const NVML_FI_DEV_NVLINK_ERROR_DL_RECOVERY: u32 = 162; pub const NVML_FI_DEV_NVLINK_ERROR_DL_CRC: u32 = 163; pub const NVML_FI_DEV_NVLINK_GET_SPEED: u32 = 164; pub const NVML_FI_DEV_NVLINK_GET_STATE: u32 = 165; pub const NVML_FI_DEV_NVLINK_GET_VERSION: u32 = 166; pub const NVML_FI_DEV_NVLINK_GET_POWER_STATE: u32 = 167; pub const NVML_FI_DEV_NVLINK_GET_POWER_THRESHOLD: u32 = 168; pub const NVML_FI_DEV_PCIE_L0_TO_RECOVERY_COUNTER: u32 = 169; pub const NVML_FI_DEV_C2C_LINK_COUNT: u32 = 170; pub const NVML_FI_DEV_C2C_LINK_GET_STATUS: u32 = 171; pub const NVML_FI_DEV_C2C_LINK_GET_MAX_BW: u32 = 172; pub const NVML_FI_DEV_PCIE_COUNT_CORRECTABLE_ERRORS: u32 = 173; pub const NVML_FI_DEV_PCIE_COUNT_NAKS_RECEIVED: u32 = 174; pub const NVML_FI_DEV_PCIE_COUNT_RECEIVER_ERROR: u32 = 175; pub const NVML_FI_DEV_PCIE_COUNT_BAD_TLP: u32 = 176; pub const NVML_FI_DEV_PCIE_COUNT_NAKS_SENT: u32 = 177; pub const NVML_FI_DEV_PCIE_COUNT_BAD_DLLP: u32 = 178; pub const NVML_FI_DEV_PCIE_COUNT_NON_FATAL_ERROR: u32 = 179; pub const NVML_FI_DEV_PCIE_COUNT_FATAL_ERROR: u32 = 180; pub const NVML_FI_DEV_PCIE_COUNT_UNSUPPORTED_REQ: u32 = 181; pub const NVML_FI_DEV_PCIE_COUNT_LCRC_ERROR: u32 = 182; pub const NVML_FI_DEV_PCIE_COUNT_LANE_ERROR: u32 = 183; pub const NVML_FI_DEV_IS_RESETLESS_MIG_SUPPORTED: u32 = 184; pub const NVML_FI_DEV_POWER_AVERAGE: u32 = 185; pub const NVML_FI_DEV_POWER_INSTANT: u32 = 186; pub const NVML_FI_DEV_POWER_MIN_LIMIT: u32 = 187; pub const NVML_FI_DEV_POWER_MAX_LIMIT: u32 = 188; pub const NVML_FI_DEV_POWER_DEFAULT_LIMIT: u32 = 189; pub const NVML_FI_DEV_POWER_CURRENT_LIMIT: u32 = 190; pub const NVML_FI_DEV_ENERGY: u32 = 191; pub const NVML_FI_DEV_POWER_REQUESTED_LIMIT: u32 = 192; pub const NVML_FI_DEV_TEMPERATURE_SHUTDOWN_TLIMIT: u32 = 193; pub const NVML_FI_DEV_TEMPERATURE_SLOWDOWN_TLIMIT: u32 = 194; pub const NVML_FI_DEV_TEMPERATURE_MEM_MAX_TLIMIT: u32 = 195; pub const NVML_FI_DEV_TEMPERATURE_GPU_MAX_TLIMIT: u32 = 196; pub const NVML_FI_DEV_PCIE_COUNT_TX_BYTES: u32 = 197; pub const NVML_FI_DEV_PCIE_COUNT_RX_BYTES: u32 = 198; pub const NVML_FI_DEV_IS_MIG_MODE_INDEPENDENT_MIG_QUERY_CAPABLE: u32 = 199; pub const NVML_FI_DEV_NVLINK_GET_POWER_THRESHOLD_MAX: u32 = 200; pub const NVML_FI_DEV_NVLINK_COUNT_XMIT_PACKETS: u32 = 201; pub const NVML_FI_DEV_NVLINK_COUNT_XMIT_BYTES: u32 = 202; pub const NVML_FI_DEV_NVLINK_COUNT_RCV_PACKETS: u32 = 203; pub const NVML_FI_DEV_NVLINK_COUNT_RCV_BYTES: u32 = 204; pub const NVML_FI_DEV_NVLINK_COUNT_VL15_DROPPED: u32 = 205; pub const NVML_FI_DEV_NVLINK_COUNT_MALFORMED_PACKET_ERRORS: u32 = 206; pub const NVML_FI_DEV_NVLINK_COUNT_BUFFER_OVERRUN_ERRORS: u32 = 207; pub const NVML_FI_DEV_NVLINK_COUNT_RCV_ERRORS: u32 = 208; pub const NVML_FI_DEV_NVLINK_COUNT_RCV_REMOTE_ERRORS: u32 = 209; pub const NVML_FI_DEV_NVLINK_COUNT_RCV_GENERAL_ERRORS: u32 = 210; pub const NVML_FI_DEV_NVLINK_COUNT_LOCAL_LINK_INTEGRITY_ERRORS: u32 = 211; pub const NVML_FI_DEV_NVLINK_COUNT_XMIT_DISCARDS: u32 = 212; pub const NVML_FI_DEV_NVLINK_COUNT_LINK_RECOVERY_SUCCESSFUL_EVENTS: u32 = 213; pub const NVML_FI_DEV_NVLINK_COUNT_LINK_RECOVERY_FAILED_EVENTS: u32 = 214; pub const NVML_FI_DEV_NVLINK_COUNT_LINK_RECOVERY_EVENTS: u32 = 215; pub const NVML_FI_DEV_NVLINK_COUNT_RAW_BER_LANE0: u32 = 216; pub const NVML_FI_DEV_NVLINK_COUNT_RAW_BER_LANE1: u32 = 217; pub const NVML_FI_DEV_NVLINK_COUNT_RAW_BER: u32 = 218; pub const NVML_FI_DEV_NVLINK_COUNT_EFFECTIVE_ERRORS: u32 = 219; pub const NVML_FI_DEV_NVLINK_COUNT_EFFECTIVE_BER: u32 = 220; pub const NVML_FI_DEV_NVLINK_COUNT_SYMBOL_ERRORS: u32 = 221; pub const NVML_FI_DEV_NVLINK_COUNT_SYMBOL_BER: u32 = 222; pub const NVML_FI_DEV_NVLINK_GET_POWER_THRESHOLD_MIN: u32 = 223; pub const NVML_FI_DEV_NVLINK_GET_POWER_THRESHOLD_UNITS: u32 = 224; pub const NVML_FI_DEV_NVLINK_GET_POWER_THRESHOLD_SUPPORTED: u32 = 225; pub const NVML_FI_DEV_RESET_STATUS: u32 = 226; pub const NVML_FI_DEV_DRAIN_AND_RESET_STATUS: u32 = 227; pub const NVML_FI_DEV_PCIE_OUTBOUND_ATOMICS_MASK: u32 = 228; pub const NVML_FI_DEV_PCIE_INBOUND_ATOMICS_MASK: u32 = 229; pub const NVML_FI_DEV_GET_GPU_RECOVERY_ACTION: u32 = 230; pub const NVML_FI_DEV_C2C_LINK_ERROR_INTR: u32 = 231; pub const NVML_FI_DEV_C2C_LINK_ERROR_REPLAY: u32 = 232; pub const NVML_FI_DEV_C2C_LINK_ERROR_REPLAY_B2B: u32 = 233; pub const NVML_FI_DEV_C2C_LINK_POWER_STATE: u32 = 234; pub const NVML_FI_DEV_NVLINK_COUNT_FEC_HISTORY_0: u32 = 235; pub const NVML_FI_DEV_NVLINK_COUNT_FEC_HISTORY_1: u32 = 236; pub const NVML_FI_DEV_NVLINK_COUNT_FEC_HISTORY_2: u32 = 237; pub const NVML_FI_DEV_NVLINK_COUNT_FEC_HISTORY_3: u32 = 238; pub const NVML_FI_DEV_NVLINK_COUNT_FEC_HISTORY_4: u32 = 239; pub const NVML_FI_DEV_NVLINK_COUNT_FEC_HISTORY_5: u32 = 240; pub const NVML_FI_DEV_NVLINK_COUNT_FEC_HISTORY_6: u32 = 241; pub const NVML_FI_DEV_NVLINK_COUNT_FEC_HISTORY_7: u32 = 242; pub const NVML_FI_DEV_NVLINK_COUNT_FEC_HISTORY_8: u32 = 243; pub const NVML_FI_DEV_NVLINK_COUNT_FEC_HISTORY_9: u32 = 244; pub const NVML_FI_DEV_NVLINK_COUNT_FEC_HISTORY_10: u32 = 245; pub const NVML_FI_DEV_NVLINK_COUNT_FEC_HISTORY_11: u32 = 246; pub const NVML_FI_DEV_NVLINK_COUNT_FEC_HISTORY_12: u32 = 247; pub const NVML_FI_DEV_NVLINK_COUNT_FEC_HISTORY_13: u32 = 248; pub const NVML_FI_DEV_NVLINK_COUNT_FEC_HISTORY_14: u32 = 249; pub const NVML_FI_DEV_NVLINK_COUNT_FEC_HISTORY_15: u32 = 250; pub const NVML_FI_PWR_SMOOTHING_ENABLED: u32 = 251; pub const NVML_FI_PWR_SMOOTHING_PRIV_LVL: u32 = 252; pub const NVML_FI_PWR_SMOOTHING_IMM_RAMP_DOWN_ENABLED: u32 = 253; pub const NVML_FI_PWR_SMOOTHING_APPLIED_TMP_CEIL: u32 = 254; pub const NVML_FI_PWR_SMOOTHING_APPLIED_TMP_FLOOR: u32 = 255; pub const NVML_FI_PWR_SMOOTHING_MAX_PERCENT_TMP_FLOOR_SETTING: u32 = 256; pub const NVML_FI_PWR_SMOOTHING_MIN_PERCENT_TMP_FLOOR_SETTING: u32 = 257; pub const NVML_FI_PWR_SMOOTHING_HW_CIRCUITRY_PERCENT_LIFETIME_REMAINING: u32 = 258; pub const NVML_FI_PWR_SMOOTHING_MAX_NUM_PRESET_PROFILES: u32 = 259; pub const NVML_FI_PWR_SMOOTHING_PROFILE_PERCENT_TMP_FLOOR: u32 = 260; pub const NVML_FI_PWR_SMOOTHING_PROFILE_RAMP_UP_RATE: u32 = 261; pub const NVML_FI_PWR_SMOOTHING_PROFILE_RAMP_DOWN_RATE: u32 = 262; pub const NVML_FI_PWR_SMOOTHING_PROFILE_RAMP_DOWN_HYST_VAL: u32 = 263; pub const NVML_FI_PWR_SMOOTHING_ACTIVE_PRESET_PROFILE: u32 = 264; pub const NVML_FI_PWR_SMOOTHING_ADMIN_OVERRIDE_PERCENT_TMP_FLOOR: u32 = 265; pub const NVML_FI_PWR_SMOOTHING_ADMIN_OVERRIDE_RAMP_UP_RATE: u32 = 266; pub const NVML_FI_PWR_SMOOTHING_ADMIN_OVERRIDE_RAMP_DOWN_RATE: u32 = 267; pub const NVML_FI_PWR_SMOOTHING_ADMIN_OVERRIDE_RAMP_DOWN_HYST_VAL: u32 = 268; pub const NVML_FI_DEV_CLOCKS_EVENT_REASON_SW_POWER_CAP: u32 = 74; pub const NVML_FI_DEV_CLOCKS_EVENT_REASON_SYNC_BOOST: u32 = 76; pub const NVML_FI_DEV_CLOCKS_EVENT_REASON_SW_THERM_SLOWDOWN: u32 = 269; pub const NVML_FI_DEV_CLOCKS_EVENT_REASON_HW_THERM_SLOWDOWN: u32 = 270; pub const NVML_FI_DEV_CLOCKS_EVENT_REASON_HW_POWER_BRAKE_SLOWDOWN: u32 = 271; pub const NVML_FI_DEV_POWER_SYNC_BALANCING_FREQ: u32 = 272; pub const NVML_FI_DEV_POWER_SYNC_BALANCING_AF: u32 = 273; pub const NVML_FI_MAX: u32 = 274; pub const NVML_NVLINK_LOW_POWER_THRESHOLD_UNIT_100US: u32 = 0; pub const NVML_NVLINK_LOW_POWER_THRESHOLD_UNIT_50US: u32 = 1; pub const NVML_NVLINK_POWER_STATE_HIGH_SPEED: u32 = 0; pub const NVML_NVLINK_POWER_STATE_LOW: u32 = 1; pub const NVML_NVLINK_LOW_POWER_THRESHOLD_MIN: u32 = 1; pub const NVML_NVLINK_LOW_POWER_THRESHOLD_MAX: u32 = 8191; pub const NVML_NVLINK_LOW_POWER_THRESHOLD_RESET: u32 = 4294967295; pub const NVML_NVLINK_LOW_POWER_THRESHOLD_DEFAULT: u32 = 4294967295; pub const NVML_C2C_POWER_STATE_FULL_POWER: u32 = 0; pub const NVML_C2C_POWER_STATE_LOW_POWER: u32 = 1; pub const NVML_NVFBC_SESSION_FLAG_DIFFMAP_ENABLED: u32 = 1; pub const NVML_NVFBC_SESSION_FLAG_CLASSIFICATIONMAP_ENABLED: u32 = 2; pub const NVML_NVFBC_SESSION_FLAG_CAPTURE_WITH_WAIT_NO_WAIT: u32 = 4; pub const NVML_NVFBC_SESSION_FLAG_CAPTURE_WITH_WAIT_INFINITE: u32 = 8; pub const NVML_NVFBC_SESSION_FLAG_CAPTURE_WITH_WAIT_TIMEOUT: u32 = 16; pub const NVML_CC_SYSTEM_CPU_CAPS_NONE: u32 = 0; pub const NVML_CC_SYSTEM_CPU_CAPS_AMD_SEV: u32 = 1; pub const NVML_CC_SYSTEM_CPU_CAPS_INTEL_TDX: u32 = 2; pub const NVML_CC_SYSTEM_CPU_CAPS_AMD_SEV_SNP: u32 = 3; pub const NVML_CC_SYSTEM_CPU_CAPS_AMD_SNP_VTOM: u32 = 4; pub const NVML_CC_SYSTEM_GPUS_CC_NOT_CAPABLE: u32 = 0; pub const NVML_CC_SYSTEM_GPUS_CC_CAPABLE: u32 = 1; pub const NVML_CC_SYSTEM_DEVTOOLS_MODE_OFF: u32 = 0; pub const NVML_CC_SYSTEM_DEVTOOLS_MODE_ON: u32 = 1; pub const NVML_CC_SYSTEM_ENVIRONMENT_UNAVAILABLE: u32 = 0; pub const NVML_CC_SYSTEM_ENVIRONMENT_SIM: u32 = 1; pub const NVML_CC_SYSTEM_ENVIRONMENT_PROD: u32 = 2; pub const NVML_CC_SYSTEM_FEATURE_DISABLED: u32 = 0; pub const NVML_CC_SYSTEM_FEATURE_ENABLED: u32 = 1; pub const NVML_CC_SYSTEM_MULTIGPU_NONE: u32 = 0; pub const NVML_CC_SYSTEM_MULTIGPU_PROTECTED_PCIE: u32 = 1; pub const NVML_CC_SYSTEM_MULTIGPU_NVLE: u32 = 2; pub const NVML_CC_ACCEPTING_CLIENT_REQUESTS_FALSE: u32 = 0; pub const NVML_CC_ACCEPTING_CLIENT_REQUESTS_TRUE: u32 = 1; pub const NVML_GPU_CERT_CHAIN_SIZE: u32 = 4096; pub const NVML_GPU_ATTESTATION_CERT_CHAIN_SIZE: u32 = 5120; pub const NVML_CC_GPU_CEC_NONCE_SIZE: u32 = 32; pub const NVML_CC_GPU_ATTESTATION_REPORT_SIZE: u32 = 8192; pub const NVML_CC_GPU_CEC_ATTESTATION_REPORT_SIZE: u32 = 4096; pub const NVML_CC_CEC_ATTESTATION_REPORT_NOT_PRESENT: u32 = 0; pub const NVML_CC_CEC_ATTESTATION_REPORT_PRESENT: u32 = 1; pub const NVML_CC_KEY_ROTATION_THRESHOLD_ATTACKER_ADVANTAGE_MIN: u32 = 50; pub const NVML_CC_KEY_ROTATION_THRESHOLD_ATTACKER_ADVANTAGE_MAX: u32 = 65; pub const NVML_GPU_FABRIC_UUID_LEN: u32 = 16; pub const NVML_GPU_FABRIC_STATE_NOT_SUPPORTED: u32 = 0; pub const NVML_GPU_FABRIC_STATE_NOT_STARTED: u32 = 1; pub const NVML_GPU_FABRIC_STATE_IN_PROGRESS: u32 = 2; pub const NVML_GPU_FABRIC_STATE_COMPLETED: u32 = 3; pub const NVML_GPU_FABRIC_HEALTH_MASK_DEGRADED_BW_NOT_SUPPORTED: u32 = 0; pub const NVML_GPU_FABRIC_HEALTH_MASK_DEGRADED_BW_TRUE: u32 = 1; pub const NVML_GPU_FABRIC_HEALTH_MASK_DEGRADED_BW_FALSE: u32 = 2; pub const NVML_GPU_FABRIC_HEALTH_MASK_SHIFT_DEGRADED_BW: u32 = 0; pub const NVML_GPU_FABRIC_HEALTH_MASK_WIDTH_DEGRADED_BW: u32 = 3; pub const NVML_GPU_FABRIC_HEALTH_MASK_ROUTE_RECOVERY_NOT_SUPPORTED: u32 = 0; pub const NVML_GPU_FABRIC_HEALTH_MASK_ROUTE_RECOVERY_TRUE: u32 = 1; pub const NVML_GPU_FABRIC_HEALTH_MASK_ROUTE_RECOVERY_FALSE: u32 = 2; pub const NVML_GPU_FABRIC_HEALTH_MASK_SHIFT_ROUTE_RECOVERY: u32 = 2; pub const NVML_GPU_FABRIC_HEALTH_MASK_WIDTH_ROUTE_RECOVERY: u32 = 3; pub const NVML_GPU_FABRIC_HEALTH_MASK_ROUTE_UNHEALTHY_NOT_SUPPORTED: u32 = 0; pub const NVML_GPU_FABRIC_HEALTH_MASK_ROUTE_UNHEALTHY_TRUE: u32 = 1; pub const NVML_GPU_FABRIC_HEALTH_MASK_ROUTE_UNHEALTHY_FALSE: u32 = 2; pub const NVML_GPU_FABRIC_HEALTH_MASK_SHIFT_ROUTE_UNHEALTHY: u32 = 4; pub const NVML_GPU_FABRIC_HEALTH_MASK_WIDTH_ROUTE_UNHEALTHY: u32 = 3; pub const NVML_GPU_FABRIC_HEALTH_MASK_ACCESS_TIMEOUT_RECOVERY_NOT_SUPPORTED: u32 = 0; pub const NVML_GPU_FABRIC_HEALTH_MASK_ACCESS_TIMEOUT_RECOVERY_TRUE: u32 = 1; pub const NVML_GPU_FABRIC_HEALTH_MASK_ACCESS_TIMEOUT_RECOVERY_FALSE: u32 = 2; pub const NVML_GPU_FABRIC_HEALTH_MASK_SHIFT_ACCESS_TIMEOUT_RECOVERY: u32 = 6; pub const NVML_GPU_FABRIC_HEALTH_MASK_WIDTH_ACCESS_TIMEOUT_RECOVERY: u32 = 3; pub const NVML_GPU_FABRIC_HEALTH_MASK_INCORRECT_CONFIGURATION_NOT_SUPPORTED: u32 = 0; pub const NVML_GPU_FABRIC_HEALTH_MASK_INCORRECT_CONFIGURATION_NONE: u32 = 1; pub const NVML_GPU_FABRIC_HEALTH_MASK_INCORRECT_CONFIGURATION_INCORRECT_SYSGUID: u32 = 2; pub const NVML_GPU_FABRIC_HEALTH_MASK_INCORRECT_CONFIGURATION_INCORRECT_CHASSIS_SN: u32 = 3; pub const NVML_GPU_FABRIC_HEALTH_MASK_INCORRECT_CONFIGURATION_NO_PARTITION: u32 = 4; pub const NVML_GPU_FABRIC_HEALTH_MASK_INCORRECT_CONFIGURATION_INSUFFICIENT_NVLINKS: u32 = 5; pub const NVML_GPU_FABRIC_HEALTH_MASK_INCORRECT_CONFIGURATION_INCOMPATIBLE_GPU_FW: u32 = 6; pub const NVML_GPU_FABRIC_HEALTH_MASK_INCORRECT_CONFIGURATION_INVALID_LOCATION: u32 = 7; pub const NVML_GPU_FABRIC_HEALTH_MASK_SHIFT_INCORRECT_CONFIGURATION: u32 = 8; pub const NVML_GPU_FABRIC_HEALTH_MASK_WIDTH_INCORRECT_CONFIGURATION: u32 = 15; pub const NVML_GPU_FABRIC_HEALTH_SUMMARY_NOT_SUPPORTED: u32 = 0; pub const NVML_GPU_FABRIC_HEALTH_SUMMARY_HEALTHY: u32 = 1; pub const NVML_GPU_FABRIC_HEALTH_SUMMARY_UNHEALTHY: u32 = 2; pub const NVML_GPU_FABRIC_HEALTH_SUMMARY_LIMITED_CAPACITY: u32 = 3; pub const NVML_INIT_FLAG_NO_GPUS: u32 = 1; pub const NVML_INIT_FLAG_NO_ATTACH: u32 = 2; pub const NVML_DEVICE_INFOROM_VERSION_BUFFER_SIZE: u32 = 16; pub const NVML_DEVICE_UUID_BUFFER_SIZE: u32 = 80; pub const NVML_DEVICE_UUID_V2_BUFFER_SIZE: u32 = 96; pub const NVML_DEVICE_PART_NUMBER_BUFFER_SIZE: u32 = 80; pub const NVML_SYSTEM_DRIVER_VERSION_BUFFER_SIZE: u32 = 80; pub const NVML_SYSTEM_NVML_VERSION_BUFFER_SIZE: u32 = 80; pub const NVML_DEVICE_NAME_BUFFER_SIZE: u32 = 64; pub const NVML_DEVICE_NAME_V2_BUFFER_SIZE: u32 = 96; pub const NVML_DEVICE_SERIAL_BUFFER_SIZE: u32 = 30; pub const NVML_DEVICE_VBIOS_VERSION_BUFFER_SIZE: u32 = 32; pub const NVML_AFFINITY_SCOPE_NODE: u32 = 0; pub const NVML_AFFINITY_SCOPE_SOCKET: u32 = 1; pub const NVML_NVLINK_BER_MANTISSA_SHIFT: u32 = 8; pub const NVML_NVLINK_BER_MANTISSA_WIDTH: u32 = 15; pub const NVML_NVLINK_BER_EXP_SHIFT: u32 = 0; pub const NVML_NVLINK_BER_EXP_WIDTH: u32 = 255; pub const NVML_NVLINK_STATE_INACTIVE: u32 = 0; pub const NVML_NVLINK_STATE_ACTIVE: u32 = 1; pub const NVML_NVLINK_STATE_SLEEP: u32 = 2; pub const NVML_NVLINK_TOTAL_SUPPORTED_BW_MODES: u32 = 23; pub const NVML_NVLINK_FIRMWARE_UCODE_TYPE_MSE: u32 = 1; pub const NVML_NVLINK_FIRMWARE_UCODE_TYPE_NETIR: u32 = 2; pub const NVML_NVLINK_FIRMWARE_UCODE_TYPE_NETIR_UPHY: u32 = 3; pub const NVML_NVLINK_FIRMWARE_UCODE_TYPE_NETIR_CLN: u32 = 4; pub const NVML_NVLINK_FIRMWARE_UCODE_TYPE_NETIR_DLN: u32 = 5; pub const NVML_NVLINK_FIRMWARE_VERSION_LENGTH: u32 = 100; pub const NVML_PRM_DATA_MAX_SIZE: u32 = 496; pub const NVML_DEVICE_MIG_DISABLE: u32 = 0; pub const NVML_DEVICE_MIG_ENABLE: u32 = 1; pub const NVML_GPU_INSTANCE_PROFILE_1_SLICE: u32 = 0; pub const NVML_GPU_INSTANCE_PROFILE_2_SLICE: u32 = 1; pub const NVML_GPU_INSTANCE_PROFILE_3_SLICE: u32 = 2; pub const NVML_GPU_INSTANCE_PROFILE_4_SLICE: u32 = 3; pub const NVML_GPU_INSTANCE_PROFILE_7_SLICE: u32 = 4; pub const NVML_GPU_INSTANCE_PROFILE_8_SLICE: u32 = 5; pub const NVML_GPU_INSTANCE_PROFILE_6_SLICE: u32 = 6; pub const NVML_GPU_INSTANCE_PROFILE_1_SLICE_REV1: u32 = 7; pub const NVML_GPU_INSTANCE_PROFILE_2_SLICE_REV1: u32 = 8; pub const NVML_GPU_INSTANCE_PROFILE_1_SLICE_REV2: u32 = 9; pub const NVML_GPU_INSTANCE_PROFILE_1_SLICE_GFX: u32 = 10; pub const NVML_GPU_INSTANCE_PROFILE_2_SLICE_GFX: u32 = 11; pub const NVML_GPU_INSTANCE_PROFILE_4_SLICE_GFX: u32 = 12; pub const NVML_GPU_INSTANCE_PROFILE_1_SLICE_NO_ME: u32 = 13; pub const NVML_GPU_INSTANCE_PROFILE_2_SLICE_NO_ME: u32 = 14; pub const NVML_GPU_INSTANCE_PROFILE_1_SLICE_ALL_ME: u32 = 15; pub const NVML_GPU_INSTANCE_PROFILE_2_SLICE_ALL_ME: u32 = 16; pub const NVML_GPU_INSTANCE_PROFILE_COUNT: u32 = 17; pub const NVML_GPU_INSTANCE_PROFILE_CAPS_P2P: u32 = 1; pub const NVML_GPU_INTSTANCE_PROFILE_CAPS_P2P: u32 = 1; pub const NVML_GPU_INSTANCE_PROFILE_CAPS_GFX: u32 = 2; pub const NVML_COMPUTE_INSTANCE_PROFILE_CAPS_GFX: u32 = 1; pub const NVML_COMPUTE_INSTANCE_PROFILE_1_SLICE: u32 = 0; pub const NVML_COMPUTE_INSTANCE_PROFILE_2_SLICE: u32 = 1; pub const NVML_COMPUTE_INSTANCE_PROFILE_3_SLICE: u32 = 2; pub const NVML_COMPUTE_INSTANCE_PROFILE_4_SLICE: u32 = 3; pub const NVML_COMPUTE_INSTANCE_PROFILE_7_SLICE: u32 = 4; pub const NVML_COMPUTE_INSTANCE_PROFILE_8_SLICE: u32 = 5; pub const NVML_COMPUTE_INSTANCE_PROFILE_6_SLICE: u32 = 6; pub const NVML_COMPUTE_INSTANCE_PROFILE_1_SLICE_REV1: u32 = 7; pub const NVML_COMPUTE_INSTANCE_PROFILE_COUNT: u32 = 8; pub const NVML_COMPUTE_INSTANCE_ENGINE_PROFILE_SHARED: u32 = 0; pub const NVML_COMPUTE_INSTANCE_ENGINE_PROFILE_COUNT: u32 = 1; pub const NVML_GPM_METRICS_GET_VERSION: u32 = 1; pub const NVML_GPM_SUPPORT_VERSION: u32 = 1; pub const NVML_DEV_CAP_EGM: u32 = 1; pub const NVML_255_MASK_BITS_PER_ELEM: u32 = 32; pub const NVML_255_MASK_NUM_ELEMS: u32 = 8; pub const NVML_WORKLOAD_POWER_MAX_PROFILES: u32 = 255; pub const NVML_POWER_SMOOTHING_MAX_NUM_PROFILES: u32 = 5; pub const NVML_POWER_SMOOTHING_NUM_PROFILE_PARAMS: u32 = 4; pub const NVML_POWER_SMOOTHING_ADMIN_OVERRIDE_NOT_SET: u32 = 4294967295; pub const NVML_POWER_SMOOTHING_PROFILE_PARAM_PERCENT_TMP_FLOOR: u32 = 0; pub const NVML_POWER_SMOOTHING_PROFILE_PARAM_RAMP_UP_RATE: u32 = 1; pub const NVML_POWER_SMOOTHING_PROFILE_PARAM_RAMP_DOWN_RATE: u32 = 2; pub const NVML_POWER_SMOOTHING_PROFILE_PARAM_RAMP_DOWN_HYSTERESIS: u32 = 3; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct nvmlDevice_st { _unused: [u8; 0], } pub type nvmlDevice_t = *mut nvmlDevice_st; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct nvmlGpuInstance_st { _unused: [u8; 0], } pub type nvmlGpuInstance_t = *mut nvmlGpuInstance_st; /// PCI information about a GPU device. #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlPciInfoExt_v1_t { ///!< The version number of this struct pub version: ::core::ffi::c_uint, ///!< The PCI domain on which the device's bus resides, 0 to 0xffffffff pub domain: ::core::ffi::c_uint, ///!< The bus on which the device resides, 0 to 0xff pub bus: ::core::ffi::c_uint, ///!< The device's id on the bus, 0 to 31 pub device: ::core::ffi::c_uint, ///!< The combined 16-bit device id and 16-bit vendor id pub pciDeviceId: ::core::ffi::c_uint, ///!< The 32-bit Sub System Device ID pub pciSubSystemId: ::core::ffi::c_uint, ///!< The 8-bit PCI base class code pub baseClass: ::core::ffi::c_uint, ///!< The 8-bit PCI sub class code pub subClass: ::core::ffi::c_uint, ///!< The tuple domain:bus:device.function PCI identifier (& NULL terminator) pub busId: [::core::ffi::c_char; 32usize], } /// PCI information about a GPU device. pub type nvmlPciInfoExt_t = nvmlPciInfoExt_v1_t; /// PCI information about a GPU device. #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlPciInfo_st { ///!< The legacy tuple domain:bus:device.function PCI identifier (& NULL terminator) pub busIdLegacy: [::core::ffi::c_char; 16usize], ///!< The PCI domain on which the device's bus resides, 0 to 0xffffffff pub domain: ::core::ffi::c_uint, ///!< The bus on which the device resides, 0 to 0xff pub bus: ::core::ffi::c_uint, ///!< The device's id on the bus, 0 to 31 pub device: ::core::ffi::c_uint, ///!< The combined 16-bit device id and 16-bit vendor id pub pciDeviceId: ::core::ffi::c_uint, ///!< The 32-bit Sub System Device ID pub pciSubSystemId: ::core::ffi::c_uint, ///!< The tuple domain:bus:device.function PCI identifier (& NULL terminator) pub busId: [::core::ffi::c_char; 32usize], } /// PCI information about a GPU device. pub type nvmlPciInfo_t = nvmlPciInfo_st; /** Detailed ECC error counts for a device. @deprecated Different GPU families can have different memory error counters See \ref nvmlDeviceGetMemoryErrorCounter*/ #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlEccErrorCounts_st { ///!< L1 cache errors pub l1Cache: ::core::ffi::c_ulonglong, ///!< L2 cache errors pub l2Cache: ::core::ffi::c_ulonglong, ///!< Device memory errors pub deviceMemory: ::core::ffi::c_ulonglong, ///!< Register file errors pub registerFile: ::core::ffi::c_ulonglong, } /** Detailed ECC error counts for a device. @deprecated Different GPU families can have different memory error counters See \ref nvmlDeviceGetMemoryErrorCounter*/ pub type nvmlEccErrorCounts_t = nvmlEccErrorCounts_st; /** Utilization information for a device. Each sample period may be between 1 second and 1/6 second, depending on the product being queried.*/ #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlUtilization_st { ///!< Percent of time over the past sample period during which one or more kernels was executing on the GPU pub gpu: ::core::ffi::c_uint, ///!< Percent of time over the past sample period during which global (device) memory was being read or written pub memory: ::core::ffi::c_uint, } /** Utilization information for a device. Each sample period may be between 1 second and 1/6 second, depending on the product being queried.*/ pub type nvmlUtilization_t = nvmlUtilization_st; /** Memory allocation information for a device (v1). The total amount is equal to the sum of the amounts of free and used memory.*/ #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlMemory_st { ///!< Total physical device memory (in bytes) pub total: ::core::ffi::c_ulonglong, ///!< Unallocated device memory (in bytes) pub free: ::core::ffi::c_ulonglong, /**!< Sum of Reserved and Allocated device memory (in bytes). !< Note that the driver/GPU always sets aside a small amount of memory for bookkeeping*/ pub used: ::core::ffi::c_ulonglong, } /** Memory allocation information for a device (v1). The total amount is equal to the sum of the amounts of free and used memory.*/ pub type nvmlMemory_t = nvmlMemory_st; /** Memory allocation information for a device (v2). Version 2 adds versioning for the struct and the amount of system-reserved memory as an output.*/ #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlMemory_v2_st { ///!< Structure format version (must be 2) pub version: ::core::ffi::c_uint, ///!< Total physical device memory (in bytes) pub total: ::core::ffi::c_ulonglong, ///!< Device memory (in bytes) reserved for system use (driver or firmware) pub reserved: ::core::ffi::c_ulonglong, ///!< Unallocated device memory (in bytes) pub free: ::core::ffi::c_ulonglong, ///!< Allocated device memory (in bytes). pub used: ::core::ffi::c_ulonglong, } /** Memory allocation information for a device (v2). Version 2 adds versioning for the struct and the amount of system-reserved memory as an output.*/ pub type nvmlMemory_v2_t = nvmlMemory_v2_st; /// BAR1 Memory allocation Information for a device #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlBAR1Memory_st { ///!< Total BAR1 Memory (in bytes) pub bar1Total: ::core::ffi::c_ulonglong, ///!< Unallocated BAR1 Memory (in bytes) pub bar1Free: ::core::ffi::c_ulonglong, ///!< Allocated Used Memory (in bytes) pub bar1Used: ::core::ffi::c_ulonglong, } /// BAR1 Memory allocation Information for a device pub type nvmlBAR1Memory_t = nvmlBAR1Memory_st; /** Information about running compute processes on the GPU, legacy version for older versions of the API.*/ #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlProcessInfo_v1_st { ///!< Process ID pub pid: ::core::ffi::c_uint, ///!< Amount of used GPU memory in bytes. pub usedGpuMemory: ::core::ffi::c_ulonglong, } /** Information about running compute processes on the GPU, legacy version for older versions of the API.*/ pub type nvmlProcessInfo_v1_t = nvmlProcessInfo_v1_st; /// Information about running compute processes on the GPU #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlProcessInfo_v2_st { ///!< Process ID pub pid: ::core::ffi::c_uint, ///!< Amount of used GPU memory in bytes. pub usedGpuMemory: ::core::ffi::c_ulonglong, ///!< If MIG is enabled, stores a valid GPU instance ID. gpuInstanceId is set to pub gpuInstanceId: ::core::ffi::c_uint, ///!< If MIG is enabled, stores a valid compute instance ID. computeInstanceId is set to pub computeInstanceId: ::core::ffi::c_uint, } /// Information about running compute processes on the GPU pub type nvmlProcessInfo_v2_t = nvmlProcessInfo_v2_st; /// Information about running compute processes on the GPU pub type nvmlProcessInfo_t = nvmlProcessInfo_v2_st; /// Information about running process on the GPU with protected memory #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlProcessDetail_v1_t { ///!< Process ID pub pid: ::core::ffi::c_uint, ///!< Amount of used GPU memory in bytes. pub usedGpuMemory: ::core::ffi::c_ulonglong, ///!< If MIG is enabled, stores a valid GPU instance ID. gpuInstanceId is pub gpuInstanceId: ::core::ffi::c_uint, ///!< If MIG is enabled, stores a valid compute instance ID. computeInstanceId pub computeInstanceId: ::core::ffi::c_uint, ///!< Amount of used GPU conf compute protected memory in bytes. pub usedGpuCcProtectedMemory: ::core::ffi::c_ulonglong, } /// Information about all running processes on the GPU for the given mode #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlProcessDetailList_v1_t { ///!< Struct version, MUST be nvmlProcessDetailList_v1 pub version: ::core::ffi::c_uint, ///!< Process mode(Compute/Graphics/MPSCompute) pub mode: ::core::ffi::c_uint, ///!< Number of process entries in procArray pub numProcArrayEntries: ::core::ffi::c_uint, ///!< Process array pub procArray: *mut nvmlProcessDetail_v1_t, } /// Information about all running processes on the GPU for the given mode pub type nvmlProcessDetailList_t = nvmlProcessDetailList_v1_t; #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlDeviceAttributes_st { ///!< Streaming Multiprocessor count pub multiprocessorCount: ::core::ffi::c_uint, ///!< Shared Copy Engine count pub sharedCopyEngineCount: ::core::ffi::c_uint, ///!< Shared Decoder Engine count pub sharedDecoderCount: ::core::ffi::c_uint, ///!< Shared Encoder Engine count pub sharedEncoderCount: ::core::ffi::c_uint, ///!< Shared JPEG Engine count pub sharedJpegCount: ::core::ffi::c_uint, ///!< Shared OFA Engine count pub sharedOfaCount: ::core::ffi::c_uint, ///!< GPU instance slice count pub gpuInstanceSliceCount: ::core::ffi::c_uint, ///!< Compute instance slice count pub computeInstanceSliceCount: ::core::ffi::c_uint, ///!< Device memory size (in MiB) pub memorySizeMB: ::core::ffi::c_ulonglong, } pub type nvmlDeviceAttributes_t = nvmlDeviceAttributes_st; /// C2C Mode information for a device #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlC2cModeInfo_v1_t { pub isC2cEnabled: ::core::ffi::c_uint, } impl nvmlDeviceAddressingModeType_t { ///!< No active mode pub const NVML_DEVICE_ADDRESSING_MODE_NONE: nvmlDeviceAddressingModeType_t = nvmlDeviceAddressingModeType_t( 0, ); } impl nvmlDeviceAddressingModeType_t { ///!< Heterogeneous Memory Management mode pub const NVML_DEVICE_ADDRESSING_MODE_HMM: nvmlDeviceAddressingModeType_t = nvmlDeviceAddressingModeType_t( 1, ); } impl nvmlDeviceAddressingModeType_t { ///!< Address Translation Services mode pub const NVML_DEVICE_ADDRESSING_MODE_ATS: nvmlDeviceAddressingModeType_t = nvmlDeviceAddressingModeType_t( 2, ); } #[repr(transparent)] /// Enum to represent device addressing mode values #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlDeviceAddressingModeType_t(pub ::core::ffi::c_uint); /// Struct to represent device addressing mode information #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlDeviceAddressingMode_v1_t { ///!< API version pub version: ::core::ffi::c_uint, ///!< One of \ref nvmlDeviceAddressingModeType_t pub value: ::core::ffi::c_uint, } /// Struct to represent device addressing mode information pub type nvmlDeviceAddressingMode_t = nvmlDeviceAddressingMode_v1_t; /// Struct to represent the NVML repair status #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlRepairStatus_v1_t { ///!< API version number pub version: ::core::ffi::c_uint, ///!< Reference to \a unsigned int pub bChannelRepairPending: ::core::ffi::c_uint, ///!< Reference to \a unsigned int pub bTpcRepairPending: ::core::ffi::c_uint, } /// Struct to represent the NVML repair status pub type nvmlRepairStatus_t = nvmlRepairStatus_v1_t; /** Possible values that classify the remap availability for each bank. The max field will contain the number of banks that have maximum remap availability (all reserved rows are available). None means that there are no reserved rows available.*/ #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlRowRemapperHistogramValues_st { pub max: ::core::ffi::c_uint, pub high: ::core::ffi::c_uint, pub partial: ::core::ffi::c_uint, pub low: ::core::ffi::c_uint, pub none: ::core::ffi::c_uint, } /** Possible values that classify the remap availability for each bank. The max field will contain the number of banks that have maximum remap availability (all reserved rows are available). None means that there are no reserved rows available.*/ pub type nvmlRowRemapperHistogramValues_t = nvmlRowRemapperHistogramValues_st; impl nvmlBridgeChipType_enum { pub const NVML_BRIDGE_CHIP_PLX: nvmlBridgeChipType_enum = nvmlBridgeChipType_enum(0); } impl nvmlBridgeChipType_enum { pub const NVML_BRIDGE_CHIP_BRO4: nvmlBridgeChipType_enum = nvmlBridgeChipType_enum( 1, ); } #[repr(transparent)] /// Enum to represent type of bridge chip #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlBridgeChipType_enum(pub ::core::ffi::c_uint); /// Enum to represent type of bridge chip pub use self::nvmlBridgeChipType_enum as nvmlBridgeChipType_t; impl nvmlNvLinkUtilizationCountUnits_enum { pub const NVML_NVLINK_COUNTER_UNIT_CYCLES: nvmlNvLinkUtilizationCountUnits_enum = nvmlNvLinkUtilizationCountUnits_enum( 0, ); } impl nvmlNvLinkUtilizationCountUnits_enum { pub const NVML_NVLINK_COUNTER_UNIT_PACKETS: nvmlNvLinkUtilizationCountUnits_enum = nvmlNvLinkUtilizationCountUnits_enum( 1, ); } impl nvmlNvLinkUtilizationCountUnits_enum { pub const NVML_NVLINK_COUNTER_UNIT_BYTES: nvmlNvLinkUtilizationCountUnits_enum = nvmlNvLinkUtilizationCountUnits_enum( 2, ); } impl nvmlNvLinkUtilizationCountUnits_enum { pub const NVML_NVLINK_COUNTER_UNIT_RESERVED: nvmlNvLinkUtilizationCountUnits_enum = nvmlNvLinkUtilizationCountUnits_enum( 3, ); } impl nvmlNvLinkUtilizationCountUnits_enum { pub const NVML_NVLINK_COUNTER_UNIT_COUNT: nvmlNvLinkUtilizationCountUnits_enum = nvmlNvLinkUtilizationCountUnits_enum( 4, ); } #[repr(transparent)] /// Enum to represent the NvLink utilization counter packet units #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlNvLinkUtilizationCountUnits_enum(pub ::core::ffi::c_uint); /// Enum to represent the NvLink utilization counter packet units pub use self::nvmlNvLinkUtilizationCountUnits_enum as nvmlNvLinkUtilizationCountUnits_t; impl nvmlNvLinkUtilizationCountPktTypes_enum { pub const NVML_NVLINK_COUNTER_PKTFILTER_NOP: nvmlNvLinkUtilizationCountPktTypes_enum = nvmlNvLinkUtilizationCountPktTypes_enum( 1, ); } impl nvmlNvLinkUtilizationCountPktTypes_enum { pub const NVML_NVLINK_COUNTER_PKTFILTER_READ: nvmlNvLinkUtilizationCountPktTypes_enum = nvmlNvLinkUtilizationCountPktTypes_enum( 2, ); } impl nvmlNvLinkUtilizationCountPktTypes_enum { pub const NVML_NVLINK_COUNTER_PKTFILTER_WRITE: nvmlNvLinkUtilizationCountPktTypes_enum = nvmlNvLinkUtilizationCountPktTypes_enum( 4, ); } impl nvmlNvLinkUtilizationCountPktTypes_enum { pub const NVML_NVLINK_COUNTER_PKTFILTER_RATOM: nvmlNvLinkUtilizationCountPktTypes_enum = nvmlNvLinkUtilizationCountPktTypes_enum( 8, ); } impl nvmlNvLinkUtilizationCountPktTypes_enum { pub const NVML_NVLINK_COUNTER_PKTFILTER_NRATOM: nvmlNvLinkUtilizationCountPktTypes_enum = nvmlNvLinkUtilizationCountPktTypes_enum( 16, ); } impl nvmlNvLinkUtilizationCountPktTypes_enum { pub const NVML_NVLINK_COUNTER_PKTFILTER_FLUSH: nvmlNvLinkUtilizationCountPktTypes_enum = nvmlNvLinkUtilizationCountPktTypes_enum( 32, ); } impl nvmlNvLinkUtilizationCountPktTypes_enum { pub const NVML_NVLINK_COUNTER_PKTFILTER_RESPDATA: nvmlNvLinkUtilizationCountPktTypes_enum = nvmlNvLinkUtilizationCountPktTypes_enum( 64, ); } impl nvmlNvLinkUtilizationCountPktTypes_enum { pub const NVML_NVLINK_COUNTER_PKTFILTER_RESPNODATA: nvmlNvLinkUtilizationCountPktTypes_enum = nvmlNvLinkUtilizationCountPktTypes_enum( 128, ); } impl nvmlNvLinkUtilizationCountPktTypes_enum { pub const NVML_NVLINK_COUNTER_PKTFILTER_ALL: nvmlNvLinkUtilizationCountPktTypes_enum = nvmlNvLinkUtilizationCountPktTypes_enum( 255, ); } #[repr(transparent)] /** Enum to represent the NvLink utilization counter packet types to count ** this is ONLY applicable with the units as packets or bytes ** as specified in \a nvmlNvLinkUtilizationCountUnits_t ** all packet filter descriptions are target GPU centric ** these can be "OR'd" together*/ #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlNvLinkUtilizationCountPktTypes_enum(pub ::core::ffi::c_uint); /** Enum to represent the NvLink utilization counter packet types to count ** this is ONLY applicable with the units as packets or bytes ** as specified in \a nvmlNvLinkUtilizationCountUnits_t ** all packet filter descriptions are target GPU centric ** these can be "OR'd" together*/ pub use self::nvmlNvLinkUtilizationCountPktTypes_enum as nvmlNvLinkUtilizationCountPktTypes_t; /// Struct to define the NVLINK counter controls #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlNvLinkUtilizationControl_st { pub units: nvmlNvLinkUtilizationCountUnits_t, pub pktfilter: nvmlNvLinkUtilizationCountPktTypes_t, } /// Struct to define the NVLINK counter controls pub type nvmlNvLinkUtilizationControl_t = nvmlNvLinkUtilizationControl_st; impl nvmlNvLinkCapability_enum { pub const NVML_NVLINK_CAP_P2P_SUPPORTED: nvmlNvLinkCapability_enum = nvmlNvLinkCapability_enum( 0, ); } impl nvmlNvLinkCapability_enum { pub const NVML_NVLINK_CAP_SYSMEM_ACCESS: nvmlNvLinkCapability_enum = nvmlNvLinkCapability_enum( 1, ); } impl nvmlNvLinkCapability_enum { pub const NVML_NVLINK_CAP_P2P_ATOMICS: nvmlNvLinkCapability_enum = nvmlNvLinkCapability_enum( 2, ); } impl nvmlNvLinkCapability_enum { pub const NVML_NVLINK_CAP_SYSMEM_ATOMICS: nvmlNvLinkCapability_enum = nvmlNvLinkCapability_enum( 3, ); } impl nvmlNvLinkCapability_enum { pub const NVML_NVLINK_CAP_SLI_BRIDGE: nvmlNvLinkCapability_enum = nvmlNvLinkCapability_enum( 4, ); } impl nvmlNvLinkCapability_enum { pub const NVML_NVLINK_CAP_VALID: nvmlNvLinkCapability_enum = nvmlNvLinkCapability_enum( 5, ); } impl nvmlNvLinkCapability_enum { pub const NVML_NVLINK_CAP_COUNT: nvmlNvLinkCapability_enum = nvmlNvLinkCapability_enum( 6, ); } #[repr(transparent)] /// Enum to represent NvLink queryable capabilities #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlNvLinkCapability_enum(pub ::core::ffi::c_uint); /// Enum to represent NvLink queryable capabilities pub use self::nvmlNvLinkCapability_enum as nvmlNvLinkCapability_t; impl nvmlNvLinkErrorCounter_enum { pub const NVML_NVLINK_ERROR_DL_REPLAY: nvmlNvLinkErrorCounter_enum = nvmlNvLinkErrorCounter_enum( 0, ); } impl nvmlNvLinkErrorCounter_enum { pub const NVML_NVLINK_ERROR_DL_RECOVERY: nvmlNvLinkErrorCounter_enum = nvmlNvLinkErrorCounter_enum( 1, ); } impl nvmlNvLinkErrorCounter_enum { pub const NVML_NVLINK_ERROR_DL_CRC_FLIT: nvmlNvLinkErrorCounter_enum = nvmlNvLinkErrorCounter_enum( 2, ); } impl nvmlNvLinkErrorCounter_enum { pub const NVML_NVLINK_ERROR_DL_CRC_DATA: nvmlNvLinkErrorCounter_enum = nvmlNvLinkErrorCounter_enum( 3, ); } impl nvmlNvLinkErrorCounter_enum { pub const NVML_NVLINK_ERROR_DL_ECC_DATA: nvmlNvLinkErrorCounter_enum = nvmlNvLinkErrorCounter_enum( 4, ); } impl nvmlNvLinkErrorCounter_enum { pub const NVML_NVLINK_ERROR_COUNT: nvmlNvLinkErrorCounter_enum = nvmlNvLinkErrorCounter_enum( 5, ); } #[repr(transparent)] /// Enum to represent NvLink queryable error counters #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlNvLinkErrorCounter_enum(pub ::core::ffi::c_uint); /// Enum to represent NvLink queryable error counters pub use self::nvmlNvLinkErrorCounter_enum as nvmlNvLinkErrorCounter_t; impl nvmlIntNvLinkDeviceType_enum { pub const NVML_NVLINK_DEVICE_TYPE_GPU: nvmlIntNvLinkDeviceType_enum = nvmlIntNvLinkDeviceType_enum( 0, ); } impl nvmlIntNvLinkDeviceType_enum { pub const NVML_NVLINK_DEVICE_TYPE_IBMNPU: nvmlIntNvLinkDeviceType_enum = nvmlIntNvLinkDeviceType_enum( 1, ); } impl nvmlIntNvLinkDeviceType_enum { pub const NVML_NVLINK_DEVICE_TYPE_SWITCH: nvmlIntNvLinkDeviceType_enum = nvmlIntNvLinkDeviceType_enum( 2, ); } impl nvmlIntNvLinkDeviceType_enum { pub const NVML_NVLINK_DEVICE_TYPE_UNKNOWN: nvmlIntNvLinkDeviceType_enum = nvmlIntNvLinkDeviceType_enum( 255, ); } #[repr(transparent)] /// Enum to represent NvLink's remote device type #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlIntNvLinkDeviceType_enum(pub ::core::ffi::c_uint); /// Enum to represent NvLink's remote device type pub use self::nvmlIntNvLinkDeviceType_enum as nvmlIntNvLinkDeviceType_t; impl nvmlGpuLevel_enum { pub const NVML_TOPOLOGY_INTERNAL: nvmlGpuLevel_enum = nvmlGpuLevel_enum(0); } impl nvmlGpuLevel_enum { pub const NVML_TOPOLOGY_SINGLE: nvmlGpuLevel_enum = nvmlGpuLevel_enum(10); } impl nvmlGpuLevel_enum { pub const NVML_TOPOLOGY_MULTIPLE: nvmlGpuLevel_enum = nvmlGpuLevel_enum(20); } impl nvmlGpuLevel_enum { pub const NVML_TOPOLOGY_HOSTBRIDGE: nvmlGpuLevel_enum = nvmlGpuLevel_enum(30); } impl nvmlGpuLevel_enum { pub const NVML_TOPOLOGY_NODE: nvmlGpuLevel_enum = nvmlGpuLevel_enum(40); } impl nvmlGpuLevel_enum { pub const NVML_TOPOLOGY_SYSTEM: nvmlGpuLevel_enum = nvmlGpuLevel_enum(50); } #[repr(transparent)] /** Represents level relationships within a system between two GPUs The enums are spaced to allow for future relationships*/ #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlGpuLevel_enum(pub ::core::ffi::c_uint); /** Represents level relationships within a system between two GPUs The enums are spaced to allow for future relationships*/ pub use self::nvmlGpuLevel_enum as nvmlGpuTopologyLevel_t; impl nvmlGpuP2PStatus_enum { pub const NVML_P2P_STATUS_OK: nvmlGpuP2PStatus_enum = nvmlGpuP2PStatus_enum(0); } impl nvmlGpuP2PStatus_enum { pub const NVML_P2P_STATUS_CHIPSET_NOT_SUPPORED: nvmlGpuP2PStatus_enum = nvmlGpuP2PStatus_enum( 1, ); } impl nvmlGpuP2PStatus_enum { pub const NVML_P2P_STATUS_CHIPSET_NOT_SUPPORTED: nvmlGpuP2PStatus_enum = nvmlGpuP2PStatus_enum( 1, ); } impl nvmlGpuP2PStatus_enum { pub const NVML_P2P_STATUS_GPU_NOT_SUPPORTED: nvmlGpuP2PStatus_enum = nvmlGpuP2PStatus_enum( 2, ); } impl nvmlGpuP2PStatus_enum { pub const NVML_P2P_STATUS_IOH_TOPOLOGY_NOT_SUPPORTED: nvmlGpuP2PStatus_enum = nvmlGpuP2PStatus_enum( 3, ); } impl nvmlGpuP2PStatus_enum { pub const NVML_P2P_STATUS_DISABLED_BY_REGKEY: nvmlGpuP2PStatus_enum = nvmlGpuP2PStatus_enum( 4, ); } impl nvmlGpuP2PStatus_enum { pub const NVML_P2P_STATUS_NOT_SUPPORTED: nvmlGpuP2PStatus_enum = nvmlGpuP2PStatus_enum( 5, ); } impl nvmlGpuP2PStatus_enum { pub const NVML_P2P_STATUS_UNKNOWN: nvmlGpuP2PStatus_enum = nvmlGpuP2PStatus_enum(6); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlGpuP2PStatus_enum(pub ::core::ffi::c_uint); pub use self::nvmlGpuP2PStatus_enum as nvmlGpuP2PStatus_t; impl nvmlGpuP2PCapsIndex_enum { pub const NVML_P2P_CAPS_INDEX_READ: nvmlGpuP2PCapsIndex_enum = nvmlGpuP2PCapsIndex_enum( 0, ); } impl nvmlGpuP2PCapsIndex_enum { pub const NVML_P2P_CAPS_INDEX_WRITE: nvmlGpuP2PCapsIndex_enum = nvmlGpuP2PCapsIndex_enum( 1, ); } impl nvmlGpuP2PCapsIndex_enum { pub const NVML_P2P_CAPS_INDEX_NVLINK: nvmlGpuP2PCapsIndex_enum = nvmlGpuP2PCapsIndex_enum( 2, ); } impl nvmlGpuP2PCapsIndex_enum { pub const NVML_P2P_CAPS_INDEX_ATOMICS: nvmlGpuP2PCapsIndex_enum = nvmlGpuP2PCapsIndex_enum( 3, ); } impl nvmlGpuP2PCapsIndex_enum { pub const NVML_P2P_CAPS_INDEX_PCI: nvmlGpuP2PCapsIndex_enum = nvmlGpuP2PCapsIndex_enum( 4, ); } impl nvmlGpuP2PCapsIndex_enum { pub const NVML_P2P_CAPS_INDEX_PROP: nvmlGpuP2PCapsIndex_enum = nvmlGpuP2PCapsIndex_enum( 4, ); } impl nvmlGpuP2PCapsIndex_enum { pub const NVML_P2P_CAPS_INDEX_UNKNOWN: nvmlGpuP2PCapsIndex_enum = nvmlGpuP2PCapsIndex_enum( 5, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlGpuP2PCapsIndex_enum(pub ::core::ffi::c_uint); pub use self::nvmlGpuP2PCapsIndex_enum as nvmlGpuP2PCapsIndex_t; /// Information about the Bridge Chip Firmware #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlBridgeChipInfo_st { ///!< Type of Bridge Chip pub type_: nvmlBridgeChipType_t, ///!< Firmware Version. 0=Version is unavailable pub fwVersion: ::core::ffi::c_uint, } /// Information about the Bridge Chip Firmware pub type nvmlBridgeChipInfo_t = nvmlBridgeChipInfo_st; /** This structure stores the complete Hierarchy of the Bridge Chip within the board. The immediate bridge is stored at index 0 of bridgeInfoList, parent to immediate bridge is at index 1 and so forth.*/ #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlBridgeChipHierarchy_st { ///!< Number of Bridge Chips on the Board pub bridgeCount: ::core::ffi::c_uchar, ///!< Hierarchy of Bridge Chips on the board pub bridgeChipInfo: [nvmlBridgeChipInfo_t; 128usize], } /** This structure stores the complete Hierarchy of the Bridge Chip within the board. The immediate bridge is stored at index 0 of bridgeInfoList, parent to immediate bridge is at index 1 and so forth.*/ pub type nvmlBridgeChipHierarchy_t = nvmlBridgeChipHierarchy_st; impl nvmlSamplingType_enum { ///!< To represent total power drawn by GPU pub const NVML_TOTAL_POWER_SAMPLES: nvmlSamplingType_enum = nvmlSamplingType_enum(0); } impl nvmlSamplingType_enum { ///!< To represent percent of time during which one or more kernels was executing on the GPU pub const NVML_GPU_UTILIZATION_SAMPLES: nvmlSamplingType_enum = nvmlSamplingType_enum( 1, ); } impl nvmlSamplingType_enum { ///!< To represent percent of time during which global (device) memory was being read or written pub const NVML_MEMORY_UTILIZATION_SAMPLES: nvmlSamplingType_enum = nvmlSamplingType_enum( 2, ); } impl nvmlSamplingType_enum { ///!< To represent percent of time during which NVENC remains busy pub const NVML_ENC_UTILIZATION_SAMPLES: nvmlSamplingType_enum = nvmlSamplingType_enum( 3, ); } impl nvmlSamplingType_enum { ///!< To represent percent of time during which NVDEC remains busy pub const NVML_DEC_UTILIZATION_SAMPLES: nvmlSamplingType_enum = nvmlSamplingType_enum( 4, ); } impl nvmlSamplingType_enum { ///!< To represent processor clock samples pub const NVML_PROCESSOR_CLK_SAMPLES: nvmlSamplingType_enum = nvmlSamplingType_enum( 5, ); } impl nvmlSamplingType_enum { ///!< To represent memory clock samples pub const NVML_MEMORY_CLK_SAMPLES: nvmlSamplingType_enum = nvmlSamplingType_enum(6); } impl nvmlSamplingType_enum { ///!< To represent module power samples for total module starting Grace Hopper pub const NVML_MODULE_POWER_SAMPLES: nvmlSamplingType_enum = nvmlSamplingType_enum( 7, ); } impl nvmlSamplingType_enum { ///!< To represent percent of time during which NVJPG remains busy pub const NVML_JPG_UTILIZATION_SAMPLES: nvmlSamplingType_enum = nvmlSamplingType_enum( 8, ); } impl nvmlSamplingType_enum { ///!< To represent percent of time during which NVOFA remains busy pub const NVML_OFA_UTILIZATION_SAMPLES: nvmlSamplingType_enum = nvmlSamplingType_enum( 9, ); } impl nvmlSamplingType_enum { pub const NVML_SAMPLINGTYPE_COUNT: nvmlSamplingType_enum = nvmlSamplingType_enum(10); } #[repr(transparent)] /// Represents Type of Sampling Event #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlSamplingType_enum(pub ::core::ffi::c_uint); /// Represents Type of Sampling Event pub use self::nvmlSamplingType_enum as nvmlSamplingType_t; impl nvmlPcieUtilCounter_enum { pub const NVML_PCIE_UTIL_TX_BYTES: nvmlPcieUtilCounter_enum = nvmlPcieUtilCounter_enum( 0, ); } impl nvmlPcieUtilCounter_enum { pub const NVML_PCIE_UTIL_RX_BYTES: nvmlPcieUtilCounter_enum = nvmlPcieUtilCounter_enum( 1, ); } impl nvmlPcieUtilCounter_enum { pub const NVML_PCIE_UTIL_COUNT: nvmlPcieUtilCounter_enum = nvmlPcieUtilCounter_enum( 2, ); } #[repr(transparent)] /// Represents the queryable PCIe utilization counters #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlPcieUtilCounter_enum(pub ::core::ffi::c_uint); /// Represents the queryable PCIe utilization counters pub use self::nvmlPcieUtilCounter_enum as nvmlPcieUtilCounter_t; impl nvmlValueType_enum { pub const NVML_VALUE_TYPE_DOUBLE: nvmlValueType_enum = nvmlValueType_enum(0); } impl nvmlValueType_enum { pub const NVML_VALUE_TYPE_UNSIGNED_INT: nvmlValueType_enum = nvmlValueType_enum(1); } impl nvmlValueType_enum { pub const NVML_VALUE_TYPE_UNSIGNED_LONG: nvmlValueType_enum = nvmlValueType_enum(2); } impl nvmlValueType_enum { pub const NVML_VALUE_TYPE_UNSIGNED_LONG_LONG: nvmlValueType_enum = nvmlValueType_enum( 3, ); } impl nvmlValueType_enum { pub const NVML_VALUE_TYPE_SIGNED_LONG_LONG: nvmlValueType_enum = nvmlValueType_enum( 4, ); } impl nvmlValueType_enum { pub const NVML_VALUE_TYPE_SIGNED_INT: nvmlValueType_enum = nvmlValueType_enum(5); } impl nvmlValueType_enum { pub const NVML_VALUE_TYPE_UNSIGNED_SHORT: nvmlValueType_enum = nvmlValueType_enum(6); } impl nvmlValueType_enum { pub const NVML_VALUE_TYPE_COUNT: nvmlValueType_enum = nvmlValueType_enum(7); } #[repr(transparent)] /// Represents the type for sample value returned #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlValueType_enum(pub ::core::ffi::c_uint); /// Represents the type for sample value returned pub use self::nvmlValueType_enum as nvmlValueType_t; /// Union to represent different types of Value #[repr(C)] #[derive(Copy, Clone)] pub union nvmlValue_st { ///!< If the value is double pub dVal: f64, ///!< If the value is signed int pub siVal: ::core::ffi::c_int, ///!< If the value is unsigned int pub uiVal: ::core::ffi::c_uint, ///!< If the value is unsigned long pub ulVal: ::core::ffi::c_ulong, ///!< If the value is unsigned long long pub ullVal: ::core::ffi::c_ulonglong, ///!< If the value is signed long long pub sllVal: ::core::ffi::c_longlong, ///!< If the value is unsigned short pub usVal: ::core::ffi::c_ushort, } /// Union to represent different types of Value pub type nvmlValue_t = nvmlValue_st; /// Information for Sample #[repr(C)] #[derive(Copy, Clone)] pub struct nvmlSample_st { ///!< CPU Timestamp in microseconds pub timeStamp: ::core::ffi::c_ulonglong, ///!< Sample Value pub sampleValue: nvmlValue_t, } /// Information for Sample pub type nvmlSample_t = nvmlSample_st; impl nvmlPerfPolicyType_enum { ///!< How long did power violations cause the GPU to be below application clocks pub const NVML_PERF_POLICY_POWER: nvmlPerfPolicyType_enum = nvmlPerfPolicyType_enum( 0, ); } impl nvmlPerfPolicyType_enum { ///!< How long did thermal violations cause the GPU to be below application clocks pub const NVML_PERF_POLICY_THERMAL: nvmlPerfPolicyType_enum = nvmlPerfPolicyType_enum( 1, ); } impl nvmlPerfPolicyType_enum { ///!< How long did sync boost cause the GPU to be below application clocks pub const NVML_PERF_POLICY_SYNC_BOOST: nvmlPerfPolicyType_enum = nvmlPerfPolicyType_enum( 2, ); } impl nvmlPerfPolicyType_enum { ///!< How long did the board limit cause the GPU to be below application clocks pub const NVML_PERF_POLICY_BOARD_LIMIT: nvmlPerfPolicyType_enum = nvmlPerfPolicyType_enum( 3, ); } impl nvmlPerfPolicyType_enum { ///!< How long did low utilization cause the GPU to be below application clocks pub const NVML_PERF_POLICY_LOW_UTILIZATION: nvmlPerfPolicyType_enum = nvmlPerfPolicyType_enum( 4, ); } impl nvmlPerfPolicyType_enum { ///!< How long did the board reliability limit cause the GPU to be below application clocks pub const NVML_PERF_POLICY_RELIABILITY: nvmlPerfPolicyType_enum = nvmlPerfPolicyType_enum( 5, ); } impl nvmlPerfPolicyType_enum { ///!< Total time the GPU was held below application clocks by any limiter (0 - 5 above) pub const NVML_PERF_POLICY_TOTAL_APP_CLOCKS: nvmlPerfPolicyType_enum = nvmlPerfPolicyType_enum( 10, ); } impl nvmlPerfPolicyType_enum { ///!< Total time the GPU was held below base clocks pub const NVML_PERF_POLICY_TOTAL_BASE_CLOCKS: nvmlPerfPolicyType_enum = nvmlPerfPolicyType_enum( 11, ); } impl nvmlPerfPolicyType_enum { pub const NVML_PERF_POLICY_COUNT: nvmlPerfPolicyType_enum = nvmlPerfPolicyType_enum( 12, ); } #[repr(transparent)] /// Represents type of perf policy for which violation times can be queried #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlPerfPolicyType_enum(pub ::core::ffi::c_uint); /// Represents type of perf policy for which violation times can be queried pub use self::nvmlPerfPolicyType_enum as nvmlPerfPolicyType_t; /// Struct to hold perf policy violation status data #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlViolationTime_st { ///!< referenceTime represents CPU timestamp in microseconds pub referenceTime: ::core::ffi::c_ulonglong, ///!< violationTime in Nanoseconds pub violationTime: ::core::ffi::c_ulonglong, } /// Struct to hold perf policy violation status data pub type nvmlViolationTime_t = nvmlViolationTime_st; impl nvmlThermalTarget_t { pub const NVML_THERMAL_TARGET_NONE: nvmlThermalTarget_t = nvmlThermalTarget_t(0); } impl nvmlThermalTarget_t { ///!< GPU core temperature requires NvPhysicalGpuHandle pub const NVML_THERMAL_TARGET_GPU: nvmlThermalTarget_t = nvmlThermalTarget_t(1); } impl nvmlThermalTarget_t { ///!< GPU memory temperature requires NvPhysicalGpuHandle pub const NVML_THERMAL_TARGET_MEMORY: nvmlThermalTarget_t = nvmlThermalTarget_t(2); } impl nvmlThermalTarget_t { ///!< GPU power supply temperature requires NvPhysicalGpuHandle pub const NVML_THERMAL_TARGET_POWER_SUPPLY: nvmlThermalTarget_t = nvmlThermalTarget_t( 4, ); } impl nvmlThermalTarget_t { ///!< GPU board ambient temperature requires NvPhysicalGpuHandle pub const NVML_THERMAL_TARGET_BOARD: nvmlThermalTarget_t = nvmlThermalTarget_t(8); } impl nvmlThermalTarget_t { ///!< Visual Computing Device Board temperature requires NvVisualComputingDeviceHandle pub const NVML_THERMAL_TARGET_VCD_BOARD: nvmlThermalTarget_t = nvmlThermalTarget_t( 9, ); } impl nvmlThermalTarget_t { ///!< Visual Computing Device Inlet temperature requires NvVisualComputingDeviceHandle pub const NVML_THERMAL_TARGET_VCD_INLET: nvmlThermalTarget_t = nvmlThermalTarget_t( 10, ); } impl nvmlThermalTarget_t { ///!< Visual Computing Device Outlet temperature requires NvVisualComputingDeviceHandle pub const NVML_THERMAL_TARGET_VCD_OUTLET: nvmlThermalTarget_t = nvmlThermalTarget_t( 11, ); } impl nvmlThermalTarget_t { pub const NVML_THERMAL_TARGET_ALL: nvmlThermalTarget_t = nvmlThermalTarget_t(15); } impl nvmlThermalTarget_t { pub const NVML_THERMAL_TARGET_UNKNOWN: nvmlThermalTarget_t = nvmlThermalTarget_t(-1); } #[repr(transparent)] /// Represents the thermal sensor targets #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlThermalTarget_t(pub ::core::ffi::c_int); impl nvmlThermalController_t { pub const NVML_THERMAL_CONTROLLER_NONE: nvmlThermalController_t = nvmlThermalController_t( 0, ); } impl nvmlThermalController_t { pub const NVML_THERMAL_CONTROLLER_GPU_INTERNAL: nvmlThermalController_t = nvmlThermalController_t( 1, ); } impl nvmlThermalController_t { pub const NVML_THERMAL_CONTROLLER_ADM1032: nvmlThermalController_t = nvmlThermalController_t( 2, ); } impl nvmlThermalController_t { pub const NVML_THERMAL_CONTROLLER_ADT7461: nvmlThermalController_t = nvmlThermalController_t( 3, ); } impl nvmlThermalController_t { pub const NVML_THERMAL_CONTROLLER_MAX6649: nvmlThermalController_t = nvmlThermalController_t( 4, ); } impl nvmlThermalController_t { pub const NVML_THERMAL_CONTROLLER_MAX1617: nvmlThermalController_t = nvmlThermalController_t( 5, ); } impl nvmlThermalController_t { pub const NVML_THERMAL_CONTROLLER_LM99: nvmlThermalController_t = nvmlThermalController_t( 6, ); } impl nvmlThermalController_t { pub const NVML_THERMAL_CONTROLLER_LM89: nvmlThermalController_t = nvmlThermalController_t( 7, ); } impl nvmlThermalController_t { pub const NVML_THERMAL_CONTROLLER_LM64: nvmlThermalController_t = nvmlThermalController_t( 8, ); } impl nvmlThermalController_t { pub const NVML_THERMAL_CONTROLLER_G781: nvmlThermalController_t = nvmlThermalController_t( 9, ); } impl nvmlThermalController_t { pub const NVML_THERMAL_CONTROLLER_ADT7473: nvmlThermalController_t = nvmlThermalController_t( 10, ); } impl nvmlThermalController_t { pub const NVML_THERMAL_CONTROLLER_SBMAX6649: nvmlThermalController_t = nvmlThermalController_t( 11, ); } impl nvmlThermalController_t { pub const NVML_THERMAL_CONTROLLER_VBIOSEVT: nvmlThermalController_t = nvmlThermalController_t( 12, ); } impl nvmlThermalController_t { pub const NVML_THERMAL_CONTROLLER_OS: nvmlThermalController_t = nvmlThermalController_t( 13, ); } impl nvmlThermalController_t { pub const NVML_THERMAL_CONTROLLER_NVSYSCON_CANOAS: nvmlThermalController_t = nvmlThermalController_t( 14, ); } impl nvmlThermalController_t { pub const NVML_THERMAL_CONTROLLER_NVSYSCON_E551: nvmlThermalController_t = nvmlThermalController_t( 15, ); } impl nvmlThermalController_t { pub const NVML_THERMAL_CONTROLLER_MAX6649R: nvmlThermalController_t = nvmlThermalController_t( 16, ); } impl nvmlThermalController_t { pub const NVML_THERMAL_CONTROLLER_ADT7473S: nvmlThermalController_t = nvmlThermalController_t( 17, ); } impl nvmlThermalController_t { pub const NVML_THERMAL_CONTROLLER_UNKNOWN: nvmlThermalController_t = nvmlThermalController_t( -1, ); } #[repr(transparent)] /// Represents the thermal sensor controllers #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlThermalController_t(pub ::core::ffi::c_int); /// Struct to hold the thermal sensor settings #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlGpuThermalSettings_t { pub count: ::core::ffi::c_uint, pub sensor: [nvmlGpuThermalSettings_t__bindgen_ty_1; 3usize], } #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlGpuThermalSettings_t__bindgen_ty_1 { pub controller: nvmlThermalController_t, pub defaultMinTemp: ::core::ffi::c_int, pub defaultMaxTemp: ::core::ffi::c_int, pub currentTemp: ::core::ffi::c_int, pub target: nvmlThermalTarget_t, } impl nvmlCoolerControl_enum { ///!< This cooler has no control signal. pub const NVML_THERMAL_COOLER_SIGNAL_NONE: nvmlCoolerControl_enum = nvmlCoolerControl_enum( 0, ); } impl nvmlCoolerControl_enum { ///!< This cooler can only be toggled either ON or OFF (eg a switch). pub const NVML_THERMAL_COOLER_SIGNAL_TOGGLE: nvmlCoolerControl_enum = nvmlCoolerControl_enum( 1, ); } impl nvmlCoolerControl_enum { ///!< This cooler's level can be adjusted from some minimum to some maximum (eg a knob). pub const NVML_THERMAL_COOLER_SIGNAL_VARIABLE: nvmlCoolerControl_enum = nvmlCoolerControl_enum( 2, ); } impl nvmlCoolerControl_enum { pub const NVML_THERMAL_COOLER_SIGNAL_COUNT: nvmlCoolerControl_enum = nvmlCoolerControl_enum( 3, ); } #[repr(transparent)] /// Cooler control type #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlCoolerControl_enum(pub ::core::ffi::c_uint); /// Cooler control type pub use self::nvmlCoolerControl_enum as nvmlCoolerControl_t; impl nvmlCoolerTarget_enum { ///!< This cooler cools nothing. pub const NVML_THERMAL_COOLER_TARGET_NONE: nvmlCoolerTarget_enum = nvmlCoolerTarget_enum( 1, ); } impl nvmlCoolerTarget_enum { ///!< This cooler can cool the GPU. pub const NVML_THERMAL_COOLER_TARGET_GPU: nvmlCoolerTarget_enum = nvmlCoolerTarget_enum( 2, ); } impl nvmlCoolerTarget_enum { ///!< This cooler can cool the memory. pub const NVML_THERMAL_COOLER_TARGET_MEMORY: nvmlCoolerTarget_enum = nvmlCoolerTarget_enum( 4, ); } impl nvmlCoolerTarget_enum { ///!< This cooler can cool the power supply. pub const NVML_THERMAL_COOLER_TARGET_POWER_SUPPLY: nvmlCoolerTarget_enum = nvmlCoolerTarget_enum( 8, ); } impl nvmlCoolerTarget_enum { ///!< This cooler cools all of the components related to its target gpu. GPU_RELATED = GPU | MEMORY | POWER_SUPPLY pub const NVML_THERMAL_COOLER_TARGET_GPU_RELATED: nvmlCoolerTarget_enum = nvmlCoolerTarget_enum( 14, ); } #[repr(transparent)] /// Cooler's target #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlCoolerTarget_enum(pub ::core::ffi::c_uint); /// Cooler's target pub use self::nvmlCoolerTarget_enum as nvmlCoolerTarget_t; #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlCoolerInfo_v1_t { ///!< the API version number pub version: ::core::ffi::c_uint, ///!< the cooler index pub index: ::core::ffi::c_uint, ///!< OUT: the cooler's control signal characteristics pub signalType: nvmlCoolerControl_t, ///!< OUT: the target that cooler cools pub target: nvmlCoolerTarget_t, } pub type nvmlCoolerInfo_t = nvmlCoolerInfo_v1_t; impl nvmlUUIDType_t { ///!< Undefined type pub const NVML_UUID_TYPE_NONE: nvmlUUIDType_t = nvmlUUIDType_t(0); } impl nvmlUUIDType_t { ///!< ASCII format type pub const NVML_UUID_TYPE_ASCII: nvmlUUIDType_t = nvmlUUIDType_t(1); } impl nvmlUUIDType_t { ///!< Binary format type pub const NVML_UUID_TYPE_BINARY: nvmlUUIDType_t = nvmlUUIDType_t(2); } #[repr(transparent)] /// Enum to represent different UUID types #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlUUIDType_t(pub ::core::ffi::c_uint); /// Union to represent different UUID values #[repr(C)] #[derive(Copy, Clone)] pub union nvmlUUIDValue_t { ///!< ASCII format value pub str_: [::core::ffi::c_char; 41usize], ///!< Binary format value pub bytes: [::core::ffi::c_uchar; 16usize], } /// Struct to represent NVML UUID information #[repr(C)] #[derive(Copy, Clone)] pub struct nvmlUUID_v1_t { ///!< API version number pub version: ::core::ffi::c_uint, ///!< One of \p nvmlUUIDType_t pub type_: ::core::ffi::c_uint, ///!< One of \p nvmlUUIDValue_t, to be set based on the UUID format pub value: nvmlUUIDValue_t, } /// Struct to represent NVML UUID information pub type nvmlUUID_t = nvmlUUID_v1_t; /// Struct to represent the NVML PDI information #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlPdi_v1_t { ///!< API version number pub version: ::core::ffi::c_uint, ///!< 64-bit PDI value pub value: ::core::ffi::c_ulonglong, } /// Struct to represent the NVML PDI information pub type nvmlPdi_t = nvmlPdi_v1_t; impl nvmlEnableState_enum { ///!< Feature disabled pub const NVML_FEATURE_DISABLED: nvmlEnableState_enum = nvmlEnableState_enum(0); } impl nvmlEnableState_enum { ///!< Feature enabled pub const NVML_FEATURE_ENABLED: nvmlEnableState_enum = nvmlEnableState_enum(1); } #[repr(transparent)] /// Generic enable/disable enum. #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlEnableState_enum(pub ::core::ffi::c_uint); /// Generic enable/disable enum. pub use self::nvmlEnableState_enum as nvmlEnableState_t; /// DRAM Encryption Info #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlDramEncryptionInfo_v1_t { ///!< IN - the API version number pub version: ::core::ffi::c_uint, ///!< IN/OUT - DRAM Encryption state pub encryptionState: nvmlEnableState_t, } /// DRAM Encryption Info pub type nvmlDramEncryptionInfo_t = nvmlDramEncryptionInfo_v1_t; impl nvmlBrandType_enum { pub const NVML_BRAND_UNKNOWN: nvmlBrandType_enum = nvmlBrandType_enum(0); } impl nvmlBrandType_enum { pub const NVML_BRAND_QUADRO: nvmlBrandType_enum = nvmlBrandType_enum(1); } impl nvmlBrandType_enum { pub const NVML_BRAND_TESLA: nvmlBrandType_enum = nvmlBrandType_enum(2); } impl nvmlBrandType_enum { pub const NVML_BRAND_NVS: nvmlBrandType_enum = nvmlBrandType_enum(3); } impl nvmlBrandType_enum { pub const NVML_BRAND_GRID: nvmlBrandType_enum = nvmlBrandType_enum(4); } impl nvmlBrandType_enum { pub const NVML_BRAND_GEFORCE: nvmlBrandType_enum = nvmlBrandType_enum(5); } impl nvmlBrandType_enum { pub const NVML_BRAND_TITAN: nvmlBrandType_enum = nvmlBrandType_enum(6); } impl nvmlBrandType_enum { pub const NVML_BRAND_NVIDIA_VAPPS: nvmlBrandType_enum = nvmlBrandType_enum(7); } impl nvmlBrandType_enum { pub const NVML_BRAND_NVIDIA_VPC: nvmlBrandType_enum = nvmlBrandType_enum(8); } impl nvmlBrandType_enum { pub const NVML_BRAND_NVIDIA_VCS: nvmlBrandType_enum = nvmlBrandType_enum(9); } impl nvmlBrandType_enum { pub const NVML_BRAND_NVIDIA_VWS: nvmlBrandType_enum = nvmlBrandType_enum(10); } impl nvmlBrandType_enum { pub const NVML_BRAND_NVIDIA_CLOUD_GAMING: nvmlBrandType_enum = nvmlBrandType_enum( 11, ); } impl nvmlBrandType_enum { pub const NVML_BRAND_NVIDIA_VGAMING: nvmlBrandType_enum = nvmlBrandType_enum(11); } impl nvmlBrandType_enum { pub const NVML_BRAND_QUADRO_RTX: nvmlBrandType_enum = nvmlBrandType_enum(12); } impl nvmlBrandType_enum { pub const NVML_BRAND_NVIDIA_RTX: nvmlBrandType_enum = nvmlBrandType_enum(13); } impl nvmlBrandType_enum { pub const NVML_BRAND_NVIDIA: nvmlBrandType_enum = nvmlBrandType_enum(14); } impl nvmlBrandType_enum { pub const NVML_BRAND_GEFORCE_RTX: nvmlBrandType_enum = nvmlBrandType_enum(15); } impl nvmlBrandType_enum { pub const NVML_BRAND_TITAN_RTX: nvmlBrandType_enum = nvmlBrandType_enum(16); } impl nvmlBrandType_enum { pub const NVML_BRAND_COUNT: nvmlBrandType_enum = nvmlBrandType_enum(18); } #[repr(transparent)] /// * The Brand of the GPU #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlBrandType_enum(pub ::core::ffi::c_uint); /// * The Brand of the GPU pub use self::nvmlBrandType_enum as nvmlBrandType_t; impl nvmlTemperatureThresholds_enum { pub const NVML_TEMPERATURE_THRESHOLD_SHUTDOWN: nvmlTemperatureThresholds_enum = nvmlTemperatureThresholds_enum( 0, ); } impl nvmlTemperatureThresholds_enum { pub const NVML_TEMPERATURE_THRESHOLD_SLOWDOWN: nvmlTemperatureThresholds_enum = nvmlTemperatureThresholds_enum( 1, ); } impl nvmlTemperatureThresholds_enum { pub const NVML_TEMPERATURE_THRESHOLD_MEM_MAX: nvmlTemperatureThresholds_enum = nvmlTemperatureThresholds_enum( 2, ); } impl nvmlTemperatureThresholds_enum { pub const NVML_TEMPERATURE_THRESHOLD_GPU_MAX: nvmlTemperatureThresholds_enum = nvmlTemperatureThresholds_enum( 3, ); } impl nvmlTemperatureThresholds_enum { pub const NVML_TEMPERATURE_THRESHOLD_ACOUSTIC_MIN: nvmlTemperatureThresholds_enum = nvmlTemperatureThresholds_enum( 4, ); } impl nvmlTemperatureThresholds_enum { pub const NVML_TEMPERATURE_THRESHOLD_ACOUSTIC_CURR: nvmlTemperatureThresholds_enum = nvmlTemperatureThresholds_enum( 5, ); } impl nvmlTemperatureThresholds_enum { pub const NVML_TEMPERATURE_THRESHOLD_ACOUSTIC_MAX: nvmlTemperatureThresholds_enum = nvmlTemperatureThresholds_enum( 6, ); } impl nvmlTemperatureThresholds_enum { pub const NVML_TEMPERATURE_THRESHOLD_GPS_CURR: nvmlTemperatureThresholds_enum = nvmlTemperatureThresholds_enum( 7, ); } impl nvmlTemperatureThresholds_enum { pub const NVML_TEMPERATURE_THRESHOLD_COUNT: nvmlTemperatureThresholds_enum = nvmlTemperatureThresholds_enum( 8, ); } #[repr(transparent)] /// Temperature thresholds. #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlTemperatureThresholds_enum(pub ::core::ffi::c_uint); /// Temperature thresholds. pub use self::nvmlTemperatureThresholds_enum as nvmlTemperatureThresholds_t; impl nvmlTemperatureSensors_enum { ///!< Temperature sensor for the GPU die pub const NVML_TEMPERATURE_GPU: nvmlTemperatureSensors_enum = nvmlTemperatureSensors_enum( 0, ); } impl nvmlTemperatureSensors_enum { pub const NVML_TEMPERATURE_COUNT: nvmlTemperatureSensors_enum = nvmlTemperatureSensors_enum( 1, ); } #[repr(transparent)] /// Temperature sensors. #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlTemperatureSensors_enum(pub ::core::ffi::c_uint); /// Temperature sensors. pub use self::nvmlTemperatureSensors_enum as nvmlTemperatureSensors_t; /// Margin temperature values #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlMarginTemperature_v1_t { ///!< The version number of this struct pub version: ::core::ffi::c_uint, ///!< The margin temperature value pub marginTemperature: ::core::ffi::c_int, } /// Margin temperature values pub type nvmlMarginTemperature_t = nvmlMarginTemperature_v1_t; impl nvmlComputeMode_enum { ///!< Default compute mode -- multiple contexts per device pub const NVML_COMPUTEMODE_DEFAULT: nvmlComputeMode_enum = nvmlComputeMode_enum(0); } impl nvmlComputeMode_enum { ///!< Support Removed pub const NVML_COMPUTEMODE_EXCLUSIVE_THREAD: nvmlComputeMode_enum = nvmlComputeMode_enum( 1, ); } impl nvmlComputeMode_enum { ///!< Compute-prohibited mode -- no contexts per device pub const NVML_COMPUTEMODE_PROHIBITED: nvmlComputeMode_enum = nvmlComputeMode_enum( 2, ); } impl nvmlComputeMode_enum { ///!< Compute-exclusive-process mode -- only one context per device, usable from multiple threads at a time pub const NVML_COMPUTEMODE_EXCLUSIVE_PROCESS: nvmlComputeMode_enum = nvmlComputeMode_enum( 3, ); } impl nvmlComputeMode_enum { pub const NVML_COMPUTEMODE_COUNT: nvmlComputeMode_enum = nvmlComputeMode_enum(4); } #[repr(transparent)] /** Compute mode. NVML_COMPUTEMODE_EXCLUSIVE_PROCESS was added in CUDA 4.0. Earlier CUDA versions supported a single exclusive mode, which is equivalent to NVML_COMPUTEMODE_EXCLUSIVE_THREAD in CUDA 4.0 and beyond.*/ #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlComputeMode_enum(pub ::core::ffi::c_uint); /** Compute mode. NVML_COMPUTEMODE_EXCLUSIVE_PROCESS was added in CUDA 4.0. Earlier CUDA versions supported a single exclusive mode, which is equivalent to NVML_COMPUTEMODE_EXCLUSIVE_THREAD in CUDA 4.0 and beyond.*/ pub use self::nvmlComputeMode_enum as nvmlComputeMode_t; /// Clock Monitor error types #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlClkMonFaultInfo_struct { /// The Domain which faulted pub clkApiDomain: ::core::ffi::c_uint, /// Faults Information pub clkDomainFaultMask: ::core::ffi::c_uint, } /// Clock Monitor error types pub type nvmlClkMonFaultInfo_t = nvmlClkMonFaultInfo_struct; /// Clock Monitor Status #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlClkMonStatus_status { /// Fault status Indicator pub bGlobalStatus: ::core::ffi::c_uint, /// Total faulted domain numbers pub clkMonListSize: ::core::ffi::c_uint, /// The fault Information structure pub clkMonList: [nvmlClkMonFaultInfo_t; 32usize], } /// Clock Monitor Status pub type nvmlClkMonStatus_t = nvmlClkMonStatus_status; impl nvmlMemoryErrorType_enum { /** A memory error that was corrected For ECC errors, these are single bit errors For Texture memory, these are errors fixed by resend*/ pub const NVML_MEMORY_ERROR_TYPE_CORRECTED: nvmlMemoryErrorType_enum = nvmlMemoryErrorType_enum( 0, ); } impl nvmlMemoryErrorType_enum { /** A memory error that was not corrected For ECC errors, these are double bit errors For Texture memory, these are errors where the resend fails*/ pub const NVML_MEMORY_ERROR_TYPE_UNCORRECTED: nvmlMemoryErrorType_enum = nvmlMemoryErrorType_enum( 1, ); } impl nvmlMemoryErrorType_enum { ///!< Count of memory error types pub const NVML_MEMORY_ERROR_TYPE_COUNT: nvmlMemoryErrorType_enum = nvmlMemoryErrorType_enum( 2, ); } #[repr(transparent)] /// Memory error types #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlMemoryErrorType_enum(pub ::core::ffi::c_uint); /// Memory error types pub use self::nvmlMemoryErrorType_enum as nvmlMemoryErrorType_t; impl nvmlNvlinkVersion_enum { pub const NVML_NVLINK_VERSION_INVALID: nvmlNvlinkVersion_enum = nvmlNvlinkVersion_enum( 0, ); } impl nvmlNvlinkVersion_enum { pub const NVML_NVLINK_VERSION_1_0: nvmlNvlinkVersion_enum = nvmlNvlinkVersion_enum( 1, ); } impl nvmlNvlinkVersion_enum { pub const NVML_NVLINK_VERSION_2_0: nvmlNvlinkVersion_enum = nvmlNvlinkVersion_enum( 2, ); } impl nvmlNvlinkVersion_enum { pub const NVML_NVLINK_VERSION_2_2: nvmlNvlinkVersion_enum = nvmlNvlinkVersion_enum( 3, ); } impl nvmlNvlinkVersion_enum { pub const NVML_NVLINK_VERSION_3_0: nvmlNvlinkVersion_enum = nvmlNvlinkVersion_enum( 4, ); } impl nvmlNvlinkVersion_enum { pub const NVML_NVLINK_VERSION_3_1: nvmlNvlinkVersion_enum = nvmlNvlinkVersion_enum( 5, ); } impl nvmlNvlinkVersion_enum { pub const NVML_NVLINK_VERSION_4_0: nvmlNvlinkVersion_enum = nvmlNvlinkVersion_enum( 6, ); } impl nvmlNvlinkVersion_enum { pub const NVML_NVLINK_VERSION_5_0: nvmlNvlinkVersion_enum = nvmlNvlinkVersion_enum( 7, ); } #[repr(transparent)] /// Represents Nvlink Version #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlNvlinkVersion_enum(pub ::core::ffi::c_uint); /// Represents Nvlink Version pub use self::nvmlNvlinkVersion_enum as nvmlNvlinkVersion_t; impl nvmlEccCounterType_enum { ///!< Volatile counts are reset each time the driver loads. pub const NVML_VOLATILE_ECC: nvmlEccCounterType_enum = nvmlEccCounterType_enum(0); } impl nvmlEccCounterType_enum { ///!< Aggregate counts persist across reboots (i.e. for the lifetime of the device) pub const NVML_AGGREGATE_ECC: nvmlEccCounterType_enum = nvmlEccCounterType_enum(1); } impl nvmlEccCounterType_enum { ///!< Count of memory counter types pub const NVML_ECC_COUNTER_TYPE_COUNT: nvmlEccCounterType_enum = nvmlEccCounterType_enum( 2, ); } #[repr(transparent)] /** ECC counter types. Note: Volatile counts are reset each time the driver loads. On Windows this is once per boot. On Linux this can be more frequent. On Linux the driver unloads when no active clients exist. If persistence mode is enabled or there is always a driver client active (e.g. X11), then Linux also sees per-boot behavior. If not, volatile counts are reset each time a compute app is run.*/ #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlEccCounterType_enum(pub ::core::ffi::c_uint); /** ECC counter types. Note: Volatile counts are reset each time the driver loads. On Windows this is once per boot. On Linux this can be more frequent. On Linux the driver unloads when no active clients exist. If persistence mode is enabled or there is always a driver client active (e.g. X11), then Linux also sees per-boot behavior. If not, volatile counts are reset each time a compute app is run.*/ pub use self::nvmlEccCounterType_enum as nvmlEccCounterType_t; impl nvmlClockType_enum { ///!< Graphics clock domain pub const NVML_CLOCK_GRAPHICS: nvmlClockType_enum = nvmlClockType_enum(0); } impl nvmlClockType_enum { ///!< SM clock domain pub const NVML_CLOCK_SM: nvmlClockType_enum = nvmlClockType_enum(1); } impl nvmlClockType_enum { ///!< Memory clock domain pub const NVML_CLOCK_MEM: nvmlClockType_enum = nvmlClockType_enum(2); } impl nvmlClockType_enum { ///!< Video encoder/decoder clock domain pub const NVML_CLOCK_VIDEO: nvmlClockType_enum = nvmlClockType_enum(3); } impl nvmlClockType_enum { ///!< Count of clock types pub const NVML_CLOCK_COUNT: nvmlClockType_enum = nvmlClockType_enum(4); } #[repr(transparent)] /** Clock types. All speeds are in Mhz.*/ #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlClockType_enum(pub ::core::ffi::c_uint); /** Clock types. All speeds are in Mhz.*/ pub use self::nvmlClockType_enum as nvmlClockType_t; impl nvmlClockId_enum { ///!< Current actual clock value pub const NVML_CLOCK_ID_CURRENT: nvmlClockId_enum = nvmlClockId_enum(0); } impl nvmlClockId_enum { /**!< Target application clock. !< Deprecated, do not use.*/ pub const NVML_CLOCK_ID_APP_CLOCK_TARGET: nvmlClockId_enum = nvmlClockId_enum(1); } impl nvmlClockId_enum { /**!< Default application clock target !< Deprecated, do not use.*/ pub const NVML_CLOCK_ID_APP_CLOCK_DEFAULT: nvmlClockId_enum = nvmlClockId_enum(2); } impl nvmlClockId_enum { ///!< OEM-defined maximum clock rate pub const NVML_CLOCK_ID_CUSTOMER_BOOST_MAX: nvmlClockId_enum = nvmlClockId_enum(3); } impl nvmlClockId_enum { ///!< Count of Clock Ids. pub const NVML_CLOCK_ID_COUNT: nvmlClockId_enum = nvmlClockId_enum(4); } #[repr(transparent)] /** Clock Ids. These are used in combination with nvmlClockType_t to specify a single clock value.*/ #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlClockId_enum(pub ::core::ffi::c_uint); /** Clock Ids. These are used in combination with nvmlClockType_t to specify a single clock value.*/ pub use self::nvmlClockId_enum as nvmlClockId_t; impl nvmlDriverModel_enum { ///!< WDDM driver model -- GPU treated as a display device pub const NVML_DRIVER_WDDM: nvmlDriverModel_enum = nvmlDriverModel_enum(0); } impl nvmlDriverModel_enum { ///!< WDM (TCC) model (deprecated) -- GPU treated as a generic compute device pub const NVML_DRIVER_WDM: nvmlDriverModel_enum = nvmlDriverModel_enum(1); } impl nvmlDriverModel_enum { ///!< MCDM driver model -- GPU treated as a Microsoft compute device pub const NVML_DRIVER_MCDM: nvmlDriverModel_enum = nvmlDriverModel_enum(2); } #[repr(transparent)] /** Driver models. Windows only.*/ #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlDriverModel_enum(pub ::core::ffi::c_uint); /** Driver models. Windows only.*/ pub use self::nvmlDriverModel_enum as nvmlDriverModel_t; impl nvmlPStates_enum { ///!< Performance state 0 -- Maximum Performance pub const NVML_PSTATE_0: nvmlPStates_enum = nvmlPStates_enum(0); } impl nvmlPStates_enum { ///!< Performance state 1 pub const NVML_PSTATE_1: nvmlPStates_enum = nvmlPStates_enum(1); } impl nvmlPStates_enum { ///!< Performance state 2 pub const NVML_PSTATE_2: nvmlPStates_enum = nvmlPStates_enum(2); } impl nvmlPStates_enum { ///!< Performance state 3 pub const NVML_PSTATE_3: nvmlPStates_enum = nvmlPStates_enum(3); } impl nvmlPStates_enum { ///!< Performance state 4 pub const NVML_PSTATE_4: nvmlPStates_enum = nvmlPStates_enum(4); } impl nvmlPStates_enum { ///!< Performance state 5 pub const NVML_PSTATE_5: nvmlPStates_enum = nvmlPStates_enum(5); } impl nvmlPStates_enum { ///!< Performance state 6 pub const NVML_PSTATE_6: nvmlPStates_enum = nvmlPStates_enum(6); } impl nvmlPStates_enum { ///!< Performance state 7 pub const NVML_PSTATE_7: nvmlPStates_enum = nvmlPStates_enum(7); } impl nvmlPStates_enum { ///!< Performance state 8 pub const NVML_PSTATE_8: nvmlPStates_enum = nvmlPStates_enum(8); } impl nvmlPStates_enum { ///!< Performance state 9 pub const NVML_PSTATE_9: nvmlPStates_enum = nvmlPStates_enum(9); } impl nvmlPStates_enum { ///!< Performance state 10 pub const NVML_PSTATE_10: nvmlPStates_enum = nvmlPStates_enum(10); } impl nvmlPStates_enum { ///!< Performance state 11 pub const NVML_PSTATE_11: nvmlPStates_enum = nvmlPStates_enum(11); } impl nvmlPStates_enum { ///!< Performance state 12 pub const NVML_PSTATE_12: nvmlPStates_enum = nvmlPStates_enum(12); } impl nvmlPStates_enum { ///!< Performance state 13 pub const NVML_PSTATE_13: nvmlPStates_enum = nvmlPStates_enum(13); } impl nvmlPStates_enum { ///!< Performance state 14 pub const NVML_PSTATE_14: nvmlPStates_enum = nvmlPStates_enum(14); } impl nvmlPStates_enum { ///!< Performance state 15 -- Minimum Performance pub const NVML_PSTATE_15: nvmlPStates_enum = nvmlPStates_enum(15); } impl nvmlPStates_enum { ///!< Unknown performance state pub const NVML_PSTATE_UNKNOWN: nvmlPStates_enum = nvmlPStates_enum(32); } #[repr(transparent)] /// Allowed PStates. #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlPStates_enum(pub ::core::ffi::c_uint); /// Allowed PStates. pub use self::nvmlPStates_enum as nvmlPstates_t; /// Clock offset info. #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlClockOffset_v1_t { ///!< The version number of this struct pub version: ::core::ffi::c_uint, pub type_: nvmlClockType_t, pub pstate: nvmlPstates_t, pub clockOffsetMHz: ::core::ffi::c_int, pub minClockOffsetMHz: ::core::ffi::c_int, pub maxClockOffsetMHz: ::core::ffi::c_int, } /// Clock offset info. pub type nvmlClockOffset_t = nvmlClockOffset_v1_t; /// Fan speed info. #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlFanSpeedInfo_v1_t { ///!< the API version number pub version: ::core::ffi::c_uint, ///!< the fan index pub fan: ::core::ffi::c_uint, ///!< OUT: the fan speed in RPM pub speed: ::core::ffi::c_uint, } /// Fan speed info. pub type nvmlFanSpeedInfo_t = nvmlFanSpeedInfo_v1_t; /// Device performance modes string #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlDevicePerfModes_v1_t { ///!< the API version number pub version: ::core::ffi::c_uint, ///!< OUT: the performance modes string. pub str_: [::core::ffi::c_char; 2048usize], } /// Device performance modes string pub type nvmlDevicePerfModes_t = nvmlDevicePerfModes_v1_t; /// Device current clocks string #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlDeviceCurrentClockFreqs_v1_t { ///!< the API version number pub version: ::core::ffi::c_uint, ///!< OUT: the current clock frequency string. pub str_: [::core::ffi::c_char; 2048usize], } /// Device current clocks string pub type nvmlDeviceCurrentClockFreqs_t = nvmlDeviceCurrentClockFreqs_v1_t; #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlDevicePowerMizerModes_v1_t { ///!< OUT: the current powermizer mode pub currentMode: ::core::ffi::c_uint, ///!< IN: the powermizer mode to set pub mode: ::core::ffi::c_uint, ///!< OUT: Bitmask of supported powermizer modes pub supportedPowerMizerModes: ::core::ffi::c_uint, } impl nvmlGom_enum { ///!< Everything is enabled and running at full speed pub const NVML_GOM_ALL_ON: nvmlGom_enum = nvmlGom_enum(0); } impl nvmlGom_enum { /**!< Designed for running only compute tasks. Graphics operations !< are not allowed*/ pub const NVML_GOM_COMPUTE: nvmlGom_enum = nvmlGom_enum(1); } impl nvmlGom_enum { /**!< Designed for running graphics applications that don't require !< high bandwidth double precision*/ pub const NVML_GOM_LOW_DP: nvmlGom_enum = nvmlGom_enum(2); } #[repr(transparent)] /** GPU Operation Mode GOM allows to reduce power usage and optimize GPU throughput by disabling GPU features. Each GOM is designed to meet specific user needs.*/ #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlGom_enum(pub ::core::ffi::c_uint); /** GPU Operation Mode GOM allows to reduce power usage and optimize GPU throughput by disabling GPU features. Each GOM is designed to meet specific user needs.*/ pub use self::nvmlGom_enum as nvmlGpuOperationMode_t; impl nvmlInforomObject_enum { ///!< An object defined by OEM pub const NVML_INFOROM_OEM: nvmlInforomObject_enum = nvmlInforomObject_enum(0); } impl nvmlInforomObject_enum { ///!< The ECC object determining the level of ECC support pub const NVML_INFOROM_ECC: nvmlInforomObject_enum = nvmlInforomObject_enum(1); } impl nvmlInforomObject_enum { ///!< The power management object pub const NVML_INFOROM_POWER: nvmlInforomObject_enum = nvmlInforomObject_enum(2); } impl nvmlInforomObject_enum { ///!< DRAM Encryption object pub const NVML_INFOROM_DEN: nvmlInforomObject_enum = nvmlInforomObject_enum(3); } impl nvmlInforomObject_enum { ///!< This counts the number of infoROM objects the driver knows about pub const NVML_INFOROM_COUNT: nvmlInforomObject_enum = nvmlInforomObject_enum(4); } #[repr(transparent)] /// Available infoROM objects. #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlInforomObject_enum(pub ::core::ffi::c_uint); /// Available infoROM objects. pub use self::nvmlInforomObject_enum as nvmlInforomObject_t; impl nvmlMemoryLocation_enum { ///!< GPU L1 Cache pub const NVML_MEMORY_LOCATION_L1_CACHE: nvmlMemoryLocation_enum = nvmlMemoryLocation_enum( 0, ); } impl nvmlMemoryLocation_enum { ///!< GPU L2 Cache pub const NVML_MEMORY_LOCATION_L2_CACHE: nvmlMemoryLocation_enum = nvmlMemoryLocation_enum( 1, ); } impl nvmlMemoryLocation_enum { ///!< Turing+ DRAM pub const NVML_MEMORY_LOCATION_DRAM: nvmlMemoryLocation_enum = nvmlMemoryLocation_enum( 2, ); } impl nvmlMemoryLocation_enum { ///!< GPU Device Memory pub const NVML_MEMORY_LOCATION_DEVICE_MEMORY: nvmlMemoryLocation_enum = nvmlMemoryLocation_enum( 2, ); } impl nvmlMemoryLocation_enum { ///!< GPU Register File pub const NVML_MEMORY_LOCATION_REGISTER_FILE: nvmlMemoryLocation_enum = nvmlMemoryLocation_enum( 3, ); } impl nvmlMemoryLocation_enum { ///!< GPU Texture Memory pub const NVML_MEMORY_LOCATION_TEXTURE_MEMORY: nvmlMemoryLocation_enum = nvmlMemoryLocation_enum( 4, ); } impl nvmlMemoryLocation_enum { ///!< Shared memory pub const NVML_MEMORY_LOCATION_TEXTURE_SHM: nvmlMemoryLocation_enum = nvmlMemoryLocation_enum( 5, ); } impl nvmlMemoryLocation_enum { ///!< CBU pub const NVML_MEMORY_LOCATION_CBU: nvmlMemoryLocation_enum = nvmlMemoryLocation_enum( 6, ); } impl nvmlMemoryLocation_enum { ///!< Turing+ SRAM pub const NVML_MEMORY_LOCATION_SRAM: nvmlMemoryLocation_enum = nvmlMemoryLocation_enum( 7, ); } impl nvmlMemoryLocation_enum { ///!< This counts the number of memory locations the driver knows about pub const NVML_MEMORY_LOCATION_COUNT: nvmlMemoryLocation_enum = nvmlMemoryLocation_enum( 8, ); } #[repr(transparent)] /// See \ref nvmlDeviceGetMemoryErrorCounter #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlMemoryLocation_enum(pub ::core::ffi::c_uint); /// See \ref nvmlDeviceGetMemoryErrorCounter pub use self::nvmlMemoryLocation_enum as nvmlMemoryLocation_t; impl nvmlPageRetirementCause_enum { ///!< Page was retired due to multiple single bit ECC error pub const NVML_PAGE_RETIREMENT_CAUSE_MULTIPLE_SINGLE_BIT_ECC_ERRORS: nvmlPageRetirementCause_enum = nvmlPageRetirementCause_enum( 0, ); } impl nvmlPageRetirementCause_enum { ///!< Page was retired due to double bit ECC error pub const NVML_PAGE_RETIREMENT_CAUSE_DOUBLE_BIT_ECC_ERROR: nvmlPageRetirementCause_enum = nvmlPageRetirementCause_enum( 1, ); } impl nvmlPageRetirementCause_enum { pub const NVML_PAGE_RETIREMENT_CAUSE_COUNT: nvmlPageRetirementCause_enum = nvmlPageRetirementCause_enum( 2, ); } #[repr(transparent)] /// Causes for page retirement #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlPageRetirementCause_enum(pub ::core::ffi::c_uint); /// Causes for page retirement pub use self::nvmlPageRetirementCause_enum as nvmlPageRetirementCause_t; impl nvmlRestrictedAPI_enum { /**!< APIs that change application clocks, see nvmlDeviceSetApplicationsClocks !< and see nvmlDeviceResetApplicationsClocks. !< Deprecated, keeping definition for backward compatibility.*/ pub const NVML_RESTRICTED_API_SET_APPLICATION_CLOCKS: nvmlRestrictedAPI_enum = nvmlRestrictedAPI_enum( 0, ); } impl nvmlRestrictedAPI_enum { /**!< APIs that enable/disable Auto Boosted clocks !< see nvmlDeviceSetAutoBoostedClocksEnabled*/ pub const NVML_RESTRICTED_API_SET_AUTO_BOOSTED_CLOCKS: nvmlRestrictedAPI_enum = nvmlRestrictedAPI_enum( 1, ); } impl nvmlRestrictedAPI_enum { pub const NVML_RESTRICTED_API_COUNT: nvmlRestrictedAPI_enum = nvmlRestrictedAPI_enum( 2, ); } #[repr(transparent)] /// API types that allow changes to default permission restrictions #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlRestrictedAPI_enum(pub ::core::ffi::c_uint); /// API types that allow changes to default permission restrictions pub use self::nvmlRestrictedAPI_enum as nvmlRestrictedAPI_t; /// Structure to store utilization value and process Id #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlProcessUtilizationSample_st { ///!< PID of process pub pid: ::core::ffi::c_uint, ///!< CPU Timestamp in microseconds pub timeStamp: ::core::ffi::c_ulonglong, ///!< SM (3D/Compute) Util Value pub smUtil: ::core::ffi::c_uint, ///!< Frame Buffer Memory Util Value pub memUtil: ::core::ffi::c_uint, ///!< Encoder Util Value pub encUtil: ::core::ffi::c_uint, ///!< Decoder Util Value pub decUtil: ::core::ffi::c_uint, } /// Structure to store utilization value and process Id pub type nvmlProcessUtilizationSample_t = nvmlProcessUtilizationSample_st; /// Structure to store utilization value and process Id -- version 1 #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlProcessUtilizationInfo_v1_t { ///!< CPU Timestamp in microseconds pub timeStamp: ::core::ffi::c_ulonglong, ///!< PID of process pub pid: ::core::ffi::c_uint, ///!< SM (3D/Compute) Util Value pub smUtil: ::core::ffi::c_uint, ///!< Frame Buffer Memory Util Value pub memUtil: ::core::ffi::c_uint, ///!< Encoder Util Value pub encUtil: ::core::ffi::c_uint, ///!< Decoder Util Value pub decUtil: ::core::ffi::c_uint, ///!< Jpeg Util Value pub jpgUtil: ::core::ffi::c_uint, ///!< Ofa Util Value pub ofaUtil: ::core::ffi::c_uint, } /// Structure to store utilization and process ID for each running process -- version 1 #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlProcessesUtilizationInfo_v1_t { ///!< The version number of this struct pub version: ::core::ffi::c_uint, ///!< Caller-supplied array size, and returns number of processes running pub processSamplesCount: ::core::ffi::c_uint, ///!< Return only samples with timestamp greater than lastSeenTimeStamp pub lastSeenTimeStamp: ::core::ffi::c_ulonglong, ///!< The array (allocated by caller) of the utilization of GPU SM, framebuffer, video encoder, video decoder, JPEG, and OFA pub procUtilArray: *mut nvmlProcessUtilizationInfo_v1_t, } /// Structure to store utilization and process ID for each running process -- version 1 pub type nvmlProcessesUtilizationInfo_t = nvmlProcessesUtilizationInfo_v1_t; /// Structure to store SRAM uncorrectable error counters #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlEccSramErrorStatus_v1_t { ///!< the API version number pub version: ::core::ffi::c_uint, ///!< aggregate uncorrectable parity error count pub aggregateUncParity: ::core::ffi::c_ulonglong, ///!< aggregate uncorrectable SEC-DED error count pub aggregateUncSecDed: ::core::ffi::c_ulonglong, ///!< aggregate correctable error count pub aggregateCor: ::core::ffi::c_ulonglong, ///!< volatile uncorrectable parity error count pub volatileUncParity: ::core::ffi::c_ulonglong, ///!< volatile uncorrectable SEC-DED error count pub volatileUncSecDed: ::core::ffi::c_ulonglong, ///!< volatile correctable error count pub volatileCor: ::core::ffi::c_ulonglong, ///!< aggregate uncorrectable error count for L2 cache bucket pub aggregateUncBucketL2: ::core::ffi::c_ulonglong, ///!< aggregate uncorrectable error count for SM bucket pub aggregateUncBucketSm: ::core::ffi::c_ulonglong, ///!< aggregate uncorrectable error count for PCIE bucket pub aggregateUncBucketPcie: ::core::ffi::c_ulonglong, ///!< aggregate uncorrectable error count for Microcontroller bucket pub aggregateUncBucketMcu: ::core::ffi::c_ulonglong, ///!< aggregate uncorrectable error count for Other bucket pub aggregateUncBucketOther: ::core::ffi::c_ulonglong, ///!< if the error threshold of field diag is exceeded pub bThresholdExceeded: ::core::ffi::c_uint, } /// Structure to store SRAM uncorrectable error counters pub type nvmlEccSramErrorStatus_t = nvmlEccSramErrorStatus_v1_t; /** Structure to store platform information @deprecated The nvmlPlatformInfo_v1_t will be deprecated in the subsequent releases. Use nvmlPlatformInfo_v2_t*/ #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlPlatformInfo_v1_t { ///!< the API version number pub version: ::core::ffi::c_uint, ///!< Infiniband GUID reported by platform (for Blackwell, ibGuid is 8 bytes so indices 8-15 are zero) pub ibGuid: [::core::ffi::c_uchar; 16usize], ///!< GUID of the rack containing this GPU (for Blackwell rackGuid is 13 bytes so indices 13-15 are zero) pub rackGuid: [::core::ffi::c_uchar; 16usize], ///!< The slot number in the rack containing this GPU (includes switches) pub chassisPhysicalSlotNumber: ::core::ffi::c_uchar, ///!< The index within the compute slots in the rack containing this GPU (does not include switches) pub computeSlotIndex: ::core::ffi::c_uchar, ///!< Index of the node within the slot containing this GPU pub nodeIndex: ::core::ffi::c_uchar, ///!< Platform indicated NVLink-peer type (e.g. switch present or not) pub peerType: ::core::ffi::c_uchar, ///!< ID of this GPU within the node pub moduleId: ::core::ffi::c_uchar, } /// Structure to store platform information (v2) #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlPlatformInfo_v2_t { ///!< the API version number pub version: ::core::ffi::c_uint, ///!< Infiniband GUID reported by platform (for Blackwell, ibGuid is 8 bytes so indices 8-15 are zero) pub ibGuid: [::core::ffi::c_uchar; 16usize], ///!< Serial number of the chassis containing this GPU (for Blackwell it is 13 bytes so indices 13-15 are zero) pub chassisSerialNumber: [::core::ffi::c_uchar; 16usize], ///!< The slot number in the chassis containing this GPU (includes switches) pub slotNumber: ::core::ffi::c_uchar, ///!< The tray index within the compute slots in the chassis containing this GPU (does not include switches) pub trayIndex: ::core::ffi::c_uchar, ///!< Index of the node within the slot containing this GPU pub hostId: ::core::ffi::c_uchar, ///!< Platform indicated NVLink-peer type (e.g. switch present or not) pub peerType: ::core::ffi::c_uchar, ///!< ID of this GPU within the node pub moduleId: ::core::ffi::c_uchar, } /// Structure to store platform information (v2) pub type nvmlPlatformInfo_t = nvmlPlatformInfo_v2_t; #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlHostname_v1_t { ///!< null-terminated hostname string pub value: [::core::ffi::c_char; 64usize], } #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlEccSramUniqueUncorrectedErrorEntry_v1_t { ///!< the SRAM unit index pub unit: ::core::ffi::c_uint, ///!< the error location within the SRAM unit pub location: ::core::ffi::c_uint, ///!< the error sublocation within the SRAM unit pub sublocation: ::core::ffi::c_uint, ///!< the error extlocation within the SRAM unit pub extlocation: ::core::ffi::c_uint, ///!< the error address within the SRAM unit pub address: ::core::ffi::c_uint, ///!< if the SRAM error is parity or not pub isParity: ::core::ffi::c_uint, ///!< the error count at the same SRAM address pub count: ::core::ffi::c_uint, } #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlEccSramUniqueUncorrectedErrorCounts_v1_t { ///!< the API version number pub version: ::core::ffi::c_uint, ///!< the number of error count entries pub entryCount: ::core::ffi::c_uint, ///!< pointer to caller-supplied buffer to return the SRAM unique uncorrected ECC error count entries pub entries: *mut nvmlEccSramUniqueUncorrectedErrorEntry_v1_t, } pub type nvmlEccSramUniqueUncorrectedErrorCounts_t = nvmlEccSramUniqueUncorrectedErrorCounts_v1_t; pub type nvmlDeviceArchitecture_t = ::core::ffi::c_uint; pub type nvmlBusType_t = ::core::ffi::c_uint; pub type nvmlFanControlPolicy_t = ::core::ffi::c_uint; pub type nvmlPowerSource_t = ::core::ffi::c_uint; impl nvmlGpuUtilizationDomainId_t { ///!< Graphics engine domain pub const NVML_GPU_UTILIZATION_DOMAIN_GPU: nvmlGpuUtilizationDomainId_t = nvmlGpuUtilizationDomainId_t( 0, ); } impl nvmlGpuUtilizationDomainId_t { ///!< Frame buffer domain pub const NVML_GPU_UTILIZATION_DOMAIN_FB: nvmlGpuUtilizationDomainId_t = nvmlGpuUtilizationDomainId_t( 1, ); } impl nvmlGpuUtilizationDomainId_t { ///!< Video engine domain pub const NVML_GPU_UTILIZATION_DOMAIN_VID: nvmlGpuUtilizationDomainId_t = nvmlGpuUtilizationDomainId_t( 2, ); } impl nvmlGpuUtilizationDomainId_t { ///!< Bus interface domain pub const NVML_GPU_UTILIZATION_DOMAIN_BUS: nvmlGpuUtilizationDomainId_t = nvmlGpuUtilizationDomainId_t( 3, ); } #[repr(transparent)] /// Represents the GPU utilization domains #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlGpuUtilizationDomainId_t(pub ::core::ffi::c_uint); #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlGpuDynamicPstatesInfo_st { ///!< Reserved for future use pub flags: ::core::ffi::c_uint, pub utilization: [nvmlGpuDynamicPstatesInfo_st__bindgen_ty_1; 8usize], } #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlGpuDynamicPstatesInfo_st__bindgen_ty_1 { ///!< Set if this utilization domain is present on this GPU pub bIsPresent: ::core::ffi::c_uint, ///!< Percentage of time where the domain is considered busy in the last 1-second interval pub percentage: ::core::ffi::c_uint, ///!< Utilization threshold that can trigger a perf-increasing P-State change when crossed pub incThreshold: ::core::ffi::c_uint, ///!< Utilization threshold that can trigger a perf-decreasing P-State change when crossed pub decThreshold: ::core::ffi::c_uint, } pub type nvmlGpuDynamicPstatesInfo_t = nvmlGpuDynamicPstatesInfo_st; pub type nvmlPowerScopeType_t = ::core::ffi::c_uchar; /// Contains the power management limit #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlPowerValue_v2_t { ///!< Structure format version (must be 1) pub version: ::core::ffi::c_uint, ///!< [in] Device type: GPU or Total Module pub powerScope: nvmlPowerScopeType_t, ///!< [out] Power value to retrieve or set in milliwatts pub powerValueMw: ::core::ffi::c_uint, } impl nvmlGpuVirtualizationMode { ///!< Represents Bare Metal GPU pub const NVML_GPU_VIRTUALIZATION_MODE_NONE: nvmlGpuVirtualizationMode = nvmlGpuVirtualizationMode( 0, ); } impl nvmlGpuVirtualizationMode { ///!< Device is associated with GPU-Passthorugh pub const NVML_GPU_VIRTUALIZATION_MODE_PASSTHROUGH: nvmlGpuVirtualizationMode = nvmlGpuVirtualizationMode( 1, ); } impl nvmlGpuVirtualizationMode { ///!< Device is associated with vGPU inside virtual machine. pub const NVML_GPU_VIRTUALIZATION_MODE_VGPU: nvmlGpuVirtualizationMode = nvmlGpuVirtualizationMode( 2, ); } impl nvmlGpuVirtualizationMode { ///!< Device is associated with VGX hypervisor in vGPU mode pub const NVML_GPU_VIRTUALIZATION_MODE_HOST_VGPU: nvmlGpuVirtualizationMode = nvmlGpuVirtualizationMode( 3, ); } impl nvmlGpuVirtualizationMode { ///!< Device is associated with VGX hypervisor in vSGA mode pub const NVML_GPU_VIRTUALIZATION_MODE_HOST_VSGA: nvmlGpuVirtualizationMode = nvmlGpuVirtualizationMode( 4, ); } #[repr(transparent)] /// GPU virtualization mode types. #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlGpuVirtualizationMode(pub ::core::ffi::c_uint); /// GPU virtualization mode types. pub use self::nvmlGpuVirtualizationMode as nvmlGpuVirtualizationMode_t; impl nvmlHostVgpuMode_enum { ///!< Non SR-IOV mode pub const NVML_HOST_VGPU_MODE_NON_SRIOV: nvmlHostVgpuMode_enum = nvmlHostVgpuMode_enum( 0, ); } impl nvmlHostVgpuMode_enum { ///!< SR-IOV mode pub const NVML_HOST_VGPU_MODE_SRIOV: nvmlHostVgpuMode_enum = nvmlHostVgpuMode_enum( 1, ); } #[repr(transparent)] /// Host vGPU modes #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlHostVgpuMode_enum(pub ::core::ffi::c_uint); /// Host vGPU modes pub use self::nvmlHostVgpuMode_enum as nvmlHostVgpuMode_t; impl nvmlVgpuVmIdType { ///!< VM ID represents DOMAIN ID pub const NVML_VGPU_VM_ID_DOMAIN_ID: nvmlVgpuVmIdType = nvmlVgpuVmIdType(0); } impl nvmlVgpuVmIdType { ///!< VM ID represents UUID pub const NVML_VGPU_VM_ID_UUID: nvmlVgpuVmIdType = nvmlVgpuVmIdType(1); } #[repr(transparent)] /// Types of VM identifiers #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlVgpuVmIdType(pub ::core::ffi::c_uint); /// Types of VM identifiers pub use self::nvmlVgpuVmIdType as nvmlVgpuVmIdType_t; impl nvmlVgpuGuestInfoState_enum { ///!< Guest-dependent fields uninitialized pub const NVML_VGPU_INSTANCE_GUEST_INFO_STATE_UNINITIALIZED: nvmlVgpuGuestInfoState_enum = nvmlVgpuGuestInfoState_enum( 0, ); } impl nvmlVgpuGuestInfoState_enum { ///!< Guest-dependent fields initialized pub const NVML_VGPU_INSTANCE_GUEST_INFO_STATE_INITIALIZED: nvmlVgpuGuestInfoState_enum = nvmlVgpuGuestInfoState_enum( 1, ); } #[repr(transparent)] /// vGPU GUEST info state #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlVgpuGuestInfoState_enum(pub ::core::ffi::c_uint); /// vGPU GUEST info state pub use self::nvmlVgpuGuestInfoState_enum as nvmlVgpuGuestInfoState_t; impl nvmlGridLicenseFeatureCode_t { ///!< Unknown pub const NVML_GRID_LICENSE_FEATURE_CODE_UNKNOWN: nvmlGridLicenseFeatureCode_t = nvmlGridLicenseFeatureCode_t( 0, ); } impl nvmlGridLicenseFeatureCode_t { ///!< Virtual GPU pub const NVML_GRID_LICENSE_FEATURE_CODE_VGPU: nvmlGridLicenseFeatureCode_t = nvmlGridLicenseFeatureCode_t( 1, ); } impl nvmlGridLicenseFeatureCode_t { ///!< Nvidia RTX pub const NVML_GRID_LICENSE_FEATURE_CODE_NVIDIA_RTX: nvmlGridLicenseFeatureCode_t = nvmlGridLicenseFeatureCode_t( 2, ); } impl nvmlGridLicenseFeatureCode_t { ///!< Deprecated, do not use. pub const NVML_GRID_LICENSE_FEATURE_CODE_VWORKSTATION: nvmlGridLicenseFeatureCode_t = nvmlGridLicenseFeatureCode_t( 2, ); } impl nvmlGridLicenseFeatureCode_t { ///!< Gaming pub const NVML_GRID_LICENSE_FEATURE_CODE_GAMING: nvmlGridLicenseFeatureCode_t = nvmlGridLicenseFeatureCode_t( 3, ); } impl nvmlGridLicenseFeatureCode_t { ///!< Compute pub const NVML_GRID_LICENSE_FEATURE_CODE_COMPUTE: nvmlGridLicenseFeatureCode_t = nvmlGridLicenseFeatureCode_t( 4, ); } #[repr(transparent)] /// vGPU software licensable features #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlGridLicenseFeatureCode_t(pub ::core::ffi::c_uint); impl nvmlVgpuCapability_enum { ///!< P2P over NVLink is supported pub const NVML_VGPU_CAP_NVLINK_P2P: nvmlVgpuCapability_enum = nvmlVgpuCapability_enum( 0, ); } impl nvmlVgpuCapability_enum { ///!< GPUDirect capability is supported pub const NVML_VGPU_CAP_GPUDIRECT: nvmlVgpuCapability_enum = nvmlVgpuCapability_enum( 1, ); } impl nvmlVgpuCapability_enum { ///!< vGPU profile cannot be mixed with other vGPU profiles in same VM pub const NVML_VGPU_CAP_MULTI_VGPU_EXCLUSIVE: nvmlVgpuCapability_enum = nvmlVgpuCapability_enum( 2, ); } impl nvmlVgpuCapability_enum { ///!< vGPU profile cannot run on a GPU alongside other profiles of different type pub const NVML_VGPU_CAP_EXCLUSIVE_TYPE: nvmlVgpuCapability_enum = nvmlVgpuCapability_enum( 3, ); } impl nvmlVgpuCapability_enum { ///!< vGPU profile cannot run on a GPU alongside other profiles of different size pub const NVML_VGPU_CAP_EXCLUSIVE_SIZE: nvmlVgpuCapability_enum = nvmlVgpuCapability_enum( 4, ); } impl nvmlVgpuCapability_enum { pub const NVML_VGPU_CAP_COUNT: nvmlVgpuCapability_enum = nvmlVgpuCapability_enum(5); } #[repr(transparent)] /// vGPU queryable capabilities #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlVgpuCapability_enum(pub ::core::ffi::c_uint); /// vGPU queryable capabilities pub use self::nvmlVgpuCapability_enum as nvmlVgpuCapability_t; impl nvmlVgpuDriverCapability_enum { ///!< Supports mixing of different vGPU profiles within one guest VM pub const NVML_VGPU_DRIVER_CAP_HETEROGENEOUS_MULTI_VGPU: nvmlVgpuDriverCapability_enum = nvmlVgpuDriverCapability_enum( 0, ); } impl nvmlVgpuDriverCapability_enum { ///!< Supports FSR and warm update of vGPU host driver without terminating the running guest VM pub const NVML_VGPU_DRIVER_CAP_WARM_UPDATE: nvmlVgpuDriverCapability_enum = nvmlVgpuDriverCapability_enum( 1, ); } impl nvmlVgpuDriverCapability_enum { pub const NVML_VGPU_DRIVER_CAP_COUNT: nvmlVgpuDriverCapability_enum = nvmlVgpuDriverCapability_enum( 2, ); } #[repr(transparent)] /// vGPU driver queryable capabilities #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlVgpuDriverCapability_enum(pub ::core::ffi::c_uint); /// vGPU driver queryable capabilities pub use self::nvmlVgpuDriverCapability_enum as nvmlVgpuDriverCapability_t; impl nvmlDeviceVgpuCapability_enum { ///!< Query whether the fractional vGPU profiles on this GPU can be used in multi-vGPU configurations pub const NVML_DEVICE_VGPU_CAP_FRACTIONAL_MULTI_VGPU: nvmlDeviceVgpuCapability_enum = nvmlDeviceVgpuCapability_enum( 0, ); } impl nvmlDeviceVgpuCapability_enum { ///!< Query whether the GPU support concurrent execution of timesliced vGPU profiles of differing types pub const NVML_DEVICE_VGPU_CAP_HETEROGENEOUS_TIMESLICE_PROFILES: nvmlDeviceVgpuCapability_enum = nvmlDeviceVgpuCapability_enum( 1, ); } impl nvmlDeviceVgpuCapability_enum { ///!< Query whether the GPU support concurrent execution of timesliced vGPU profiles of differing framebuffer sizes pub const NVML_DEVICE_VGPU_CAP_HETEROGENEOUS_TIMESLICE_SIZES: nvmlDeviceVgpuCapability_enum = nvmlDeviceVgpuCapability_enum( 2, ); } impl nvmlDeviceVgpuCapability_enum { ///!< Query the GPU's read_device_buffer expected bandwidth capacity in megabytes per second pub const NVML_DEVICE_VGPU_CAP_READ_DEVICE_BUFFER_BW: nvmlDeviceVgpuCapability_enum = nvmlDeviceVgpuCapability_enum( 3, ); } impl nvmlDeviceVgpuCapability_enum { ///!< Query the GPU's write_device_buffer expected bandwidth capacity in megabytes per second pub const NVML_DEVICE_VGPU_CAP_WRITE_DEVICE_BUFFER_BW: nvmlDeviceVgpuCapability_enum = nvmlDeviceVgpuCapability_enum( 4, ); } impl nvmlDeviceVgpuCapability_enum { ///!< Query whether the vGPU profiles on the GPU supports migration data streaming pub const NVML_DEVICE_VGPU_CAP_DEVICE_STREAMING: nvmlDeviceVgpuCapability_enum = nvmlDeviceVgpuCapability_enum( 5, ); } impl nvmlDeviceVgpuCapability_enum { ///!< Set/Get support for mini-quarter vGPU profiles pub const NVML_DEVICE_VGPU_CAP_MINI_QUARTER_GPU: nvmlDeviceVgpuCapability_enum = nvmlDeviceVgpuCapability_enum( 6, ); } impl nvmlDeviceVgpuCapability_enum { ///!< Set/Get support for compute media engine vGPU profiles pub const NVML_DEVICE_VGPU_CAP_COMPUTE_MEDIA_ENGINE_GPU: nvmlDeviceVgpuCapability_enum = nvmlDeviceVgpuCapability_enum( 7, ); } impl nvmlDeviceVgpuCapability_enum { ///!< Query whether the GPU supports FSR and warm update pub const NVML_DEVICE_VGPU_CAP_WARM_UPDATE: nvmlDeviceVgpuCapability_enum = nvmlDeviceVgpuCapability_enum( 8, ); } impl nvmlDeviceVgpuCapability_enum { ///!< Query whether the GPU supports reporting of placements of timesliced vGPU profiles with identical framebuffer sizes pub const NVML_DEVICE_VGPU_CAP_HOMOGENEOUS_PLACEMENTS: nvmlDeviceVgpuCapability_enum = nvmlDeviceVgpuCapability_enum( 9, ); } impl nvmlDeviceVgpuCapability_enum { ///!< Query whether the GPU supports timesliced vGPU on MIG pub const NVML_DEVICE_VGPU_CAP_MIG_TIMESLICING_SUPPORTED: nvmlDeviceVgpuCapability_enum = nvmlDeviceVgpuCapability_enum( 10, ); } impl nvmlDeviceVgpuCapability_enum { ///!< Set/Get MIG timesliced mode reporting, without impacting the underlying functionality pub const NVML_DEVICE_VGPU_CAP_MIG_TIMESLICING_ENABLED: nvmlDeviceVgpuCapability_enum = nvmlDeviceVgpuCapability_enum( 11, ); } impl nvmlDeviceVgpuCapability_enum { pub const NVML_DEVICE_VGPU_CAP_COUNT: nvmlDeviceVgpuCapability_enum = nvmlDeviceVgpuCapability_enum( 12, ); } #[repr(transparent)] /// Device vGPU queryable capabilities #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlDeviceVgpuCapability_enum(pub ::core::ffi::c_uint); /// Device vGPU queryable capabilities pub use self::nvmlDeviceVgpuCapability_enum as nvmlDeviceVgpuCapability_t; #[doc = "/\n/** @defgroup nvmlVgpuStructs vGPU Structs\n @{\n/\n/"] pub type nvmlVgpuTypeId_t = ::core::ffi::c_uint; pub type nvmlVgpuInstance_t = ::core::ffi::c_uint; /// Structure to store the vGPU heterogeneous mode of device -- version 1 #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlVgpuHeterogeneousMode_v1_t { ///!< The version number of this struct pub version: ::core::ffi::c_uint, ///!< The vGPU heterogeneous mode pub mode: ::core::ffi::c_uint, } /// Structure to store the vGPU heterogeneous mode of device -- version 1 pub type nvmlVgpuHeterogeneousMode_t = nvmlVgpuHeterogeneousMode_v1_t; /// Structure to store the placement ID of vGPU instance -- version 1 #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlVgpuPlacementId_v1_t { ///!< The version number of this struct pub version: ::core::ffi::c_uint, ///!< Placement ID of the active vGPU instance pub placementId: ::core::ffi::c_uint, } /// Structure to store the placement ID of vGPU instance -- version 1 pub type nvmlVgpuPlacementId_t = nvmlVgpuPlacementId_v1_t; /// Structure to store the list of vGPU placements -- version 1 #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlVgpuPlacementList_v1_t { ///!< The version number of this struct pub version: ::core::ffi::c_uint, ///!< The number of slots occupied by the vGPU type pub placementSize: ::core::ffi::c_uint, ///!< Count of placement IDs fetched pub count: ::core::ffi::c_uint, ///!< Placement IDs for the vGPU type pub placementIds: *mut ::core::ffi::c_uint, } /// Structure to store the list of vGPU placements -- version 2 #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlVgpuPlacementList_v2_t { ///!< IN: The version number of this struct pub version: ::core::ffi::c_uint, ///!< OUT: The number of slots occupied by the vGPU type pub placementSize: ::core::ffi::c_uint, ///!< IN/OUT: Count of the placement IDs pub count: ::core::ffi::c_uint, ///!< IN/OUT: Placement IDs for the vGPU type pub placementIds: *mut ::core::ffi::c_uint, ///!< IN: The vGPU mode. Either NVML_VGPU_PGPU_HETEROGENEOUS_MODE or NVML_VGPU_PGPU_HOMOGENEOUS_MODE pub mode: ::core::ffi::c_uint, } /// Structure to store the list of vGPU placements -- version 2 pub type nvmlVgpuPlacementList_t = nvmlVgpuPlacementList_v2_t; /// Structure to store BAR1 size information of vGPU type -- Version 1 #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlVgpuTypeBar1Info_v1_t { ///!< The version number of this struct pub version: ::core::ffi::c_uint, ///!< BAR1 size in megabytes pub bar1Size: ::core::ffi::c_ulonglong, } /// Structure to store BAR1 size information of vGPU type -- Version 1 pub type nvmlVgpuTypeBar1Info_t = nvmlVgpuTypeBar1Info_v1_t; /// Structure to store Utilization Value and vgpuInstance #[repr(C)] #[derive(Copy, Clone)] pub struct nvmlVgpuInstanceUtilizationSample_st { ///!< vGPU Instance pub vgpuInstance: nvmlVgpuInstance_t, ///!< CPU Timestamp in microseconds pub timeStamp: ::core::ffi::c_ulonglong, ///!< SM (3D/Compute) Util Value pub smUtil: nvmlValue_t, ///!< Frame Buffer Memory Util Value pub memUtil: nvmlValue_t, ///!< Encoder Util Value pub encUtil: nvmlValue_t, ///!< Decoder Util Value pub decUtil: nvmlValue_t, } /// Structure to store Utilization Value and vgpuInstance pub type nvmlVgpuInstanceUtilizationSample_t = nvmlVgpuInstanceUtilizationSample_st; /// Structure to store Utilization Value and vgpuInstance Info -- Version 1 #[repr(C)] #[derive(Copy, Clone)] pub struct nvmlVgpuInstanceUtilizationInfo_v1_t { ///!< CPU Timestamp in microseconds pub timeStamp: ::core::ffi::c_ulonglong, ///!< vGPU Instance pub vgpuInstance: nvmlVgpuInstance_t, ///!< SM (3D/Compute) Util Value pub smUtil: nvmlValue_t, ///!< Frame Buffer Memory Util Value pub memUtil: nvmlValue_t, ///!< Encoder Util Value pub encUtil: nvmlValue_t, ///!< Decoder Util Value pub decUtil: nvmlValue_t, ///!< Jpeg Util Value pub jpgUtil: nvmlValue_t, ///!< Ofa Util Value pub ofaUtil: nvmlValue_t, } /// Structure to store recent utilization for vGPU instances running on a device -- version 1 #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlVgpuInstancesUtilizationInfo_v1_t { ///!< The version number of this struct pub version: ::core::ffi::c_uint, ///!< Hold the type of returned sample values pub sampleValType: nvmlValueType_t, ///!< Hold the number of vGPU instances pub vgpuInstanceCount: ::core::ffi::c_uint, ///!< Return only samples with timestamp greater than lastSeenTimeStamp pub lastSeenTimeStamp: ::core::ffi::c_ulonglong, ///!< The array (allocated by caller) in which vGPU utilization are returned pub vgpuUtilArray: *mut nvmlVgpuInstanceUtilizationInfo_v1_t, } /// Structure to store recent utilization for vGPU instances running on a device -- version 1 pub type nvmlVgpuInstancesUtilizationInfo_t = nvmlVgpuInstancesUtilizationInfo_v1_t; /// Structure to store Utilization Value, vgpuInstance and subprocess information #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlVgpuProcessUtilizationSample_st { ///!< vGPU Instance pub vgpuInstance: nvmlVgpuInstance_t, ///!< PID of process running within the vGPU VM pub pid: ::core::ffi::c_uint, ///!< Name of process running within the vGPU VM pub processName: [::core::ffi::c_char; 64usize], ///!< CPU Timestamp in microseconds pub timeStamp: ::core::ffi::c_ulonglong, ///!< SM (3D/Compute) Util Value pub smUtil: ::core::ffi::c_uint, ///!< Frame Buffer Memory Util Value pub memUtil: ::core::ffi::c_uint, ///!< Encoder Util Value pub encUtil: ::core::ffi::c_uint, ///!< Decoder Util Value pub decUtil: ::core::ffi::c_uint, } /// Structure to store Utilization Value, vgpuInstance and subprocess information pub type nvmlVgpuProcessUtilizationSample_t = nvmlVgpuProcessUtilizationSample_st; /// Structure to store Utilization Value, vgpuInstance and subprocess information for process running on vGPU instance -- version 1 #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlVgpuProcessUtilizationInfo_v1_t { ///!< Name of process running within the vGPU VM pub processName: [::core::ffi::c_char; 64usize], ///!< CPU Timestamp in microseconds pub timeStamp: ::core::ffi::c_ulonglong, ///!< vGPU Instance pub vgpuInstance: nvmlVgpuInstance_t, ///!< PID of process running within the vGPU VM pub pid: ::core::ffi::c_uint, ///!< SM (3D/Compute) Util Value pub smUtil: ::core::ffi::c_uint, ///!< Frame Buffer Memory Util Value pub memUtil: ::core::ffi::c_uint, ///!< Encoder Util Value pub encUtil: ::core::ffi::c_uint, ///!< Decoder Util Value pub decUtil: ::core::ffi::c_uint, ///!< Jpeg Util Value pub jpgUtil: ::core::ffi::c_uint, ///!< Ofa Util Value pub ofaUtil: ::core::ffi::c_uint, } /// Structure to store recent utilization, vgpuInstance and subprocess information for processes running on vGPU instances active on a device -- version 1 #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlVgpuProcessesUtilizationInfo_v1_t { ///!< The version number of this struct pub version: ::core::ffi::c_uint, ///!< Hold the number of processes running on vGPU instances pub vgpuProcessCount: ::core::ffi::c_uint, ///!< Return only samples with timestamp greater than lastSeenTimeStamp pub lastSeenTimeStamp: ::core::ffi::c_ulonglong, ///!< The array (allocated by caller) in which utilization of processes running on vGPU instances are returned pub vgpuProcUtilArray: *mut nvmlVgpuProcessUtilizationInfo_v1_t, } /// Structure to store recent utilization, vgpuInstance and subprocess information for processes running on vGPU instances active on a device -- version 1 pub type nvmlVgpuProcessesUtilizationInfo_t = nvmlVgpuProcessesUtilizationInfo_v1_t; /// Structure to store the information of vGPU runtime state -- version 1 #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlVgpuRuntimeState_v1_t { ///!< IN: The version number of this struct pub version: ::core::ffi::c_uint, ///!< OUT: The runtime state size of the vGPU instance pub size: ::core::ffi::c_ulonglong, } /// Structure to store the information of vGPU runtime state -- version 1 pub type nvmlVgpuRuntimeState_t = nvmlVgpuRuntimeState_v1_t; /// Union to represent the vGPU Scheduler Parameters #[repr(C)] #[derive(Copy, Clone)] pub union nvmlVgpuSchedulerParams_t { pub vgpuSchedDataWithARR: nvmlVgpuSchedulerParams_t__bindgen_ty_1, pub vgpuSchedData: nvmlVgpuSchedulerParams_t__bindgen_ty_2, } #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlVgpuSchedulerParams_t__bindgen_ty_1 { ///!< Average factor in compensating the timeslice for Adaptive Round Robin mode pub avgFactor: ::core::ffi::c_uint, ///!< The timeslice in ns for each software run list as configured, or the default value otherwise pub timeslice: ::core::ffi::c_uint, } #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlVgpuSchedulerParams_t__bindgen_ty_2 { ///!< The timeslice in ns for each software run list as configured, or the default value otherwise pub timeslice: ::core::ffi::c_uint, } /// Structure to store the state and logs of a software runlist #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlVgpuSchedulerLogEntries_st { ///!< Timestamp in ns when this software runlist was preeempted pub timestamp: ::core::ffi::c_ulonglong, ///!< Total time in ns this software runlist has run pub timeRunTotal: ::core::ffi::c_ulonglong, ///!< Time in ns this software runlist ran before preemption pub timeRun: ::core::ffi::c_ulonglong, ///!< Software runlist Id pub swRunlistId: ::core::ffi::c_uint, ///!< The actual timeslice after deduction pub targetTimeSlice: ::core::ffi::c_ulonglong, ///!< Preemption time in ns for this SW runlist pub cumulativePreemptionTime: ::core::ffi::c_ulonglong, } /// Structure to store the state and logs of a software runlist pub type nvmlVgpuSchedulerLogEntry_t = nvmlVgpuSchedulerLogEntries_st; /// Structure to store a vGPU software scheduler log #[repr(C)] #[derive(Copy, Clone)] pub struct nvmlVgpuSchedulerLog_st { ///!< Engine whose software runlist log entries are fetched pub engineId: ::core::ffi::c_uint, ///!< Scheduler policy pub schedulerPolicy: ::core::ffi::c_uint, ///!< Adaptive Round Robin scheduler mode. One of the NVML_VGPU_SCHEDULER_ARR_*. pub arrMode: ::core::ffi::c_uint, pub schedulerParams: nvmlVgpuSchedulerParams_t, ///!< Count of log entries fetched pub entriesCount: ::core::ffi::c_uint, pub logEntries: [nvmlVgpuSchedulerLogEntry_t; 200usize], } /// Structure to store a vGPU software scheduler log pub type nvmlVgpuSchedulerLog_t = nvmlVgpuSchedulerLog_st; /// Structure to store the vGPU scheduler state #[repr(C)] #[derive(Copy, Clone)] pub struct nvmlVgpuSchedulerGetState_st { ///!< Scheduler policy pub schedulerPolicy: ::core::ffi::c_uint, ///!< Adaptive Round Robin scheduler mode. One of the NVML_VGPU_SCHEDULER_ARR_*. pub arrMode: ::core::ffi::c_uint, pub schedulerParams: nvmlVgpuSchedulerParams_t, } /// Structure to store the vGPU scheduler state pub type nvmlVgpuSchedulerGetState_t = nvmlVgpuSchedulerGetState_st; /// Union to represent the vGPU Scheduler set Parameters #[repr(C)] #[derive(Copy, Clone)] pub union nvmlVgpuSchedulerSetParams_t { pub vgpuSchedDataWithARR: nvmlVgpuSchedulerSetParams_t__bindgen_ty_1, pub vgpuSchedData: nvmlVgpuSchedulerSetParams_t__bindgen_ty_2, } #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlVgpuSchedulerSetParams_t__bindgen_ty_1 { ///!< Average factor in compensating the timeslice for Adaptive Round Robin mode pub avgFactor: ::core::ffi::c_uint, ///!< Frequency for Adaptive Round Robin mode pub frequency: ::core::ffi::c_uint, } #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlVgpuSchedulerSetParams_t__bindgen_ty_2 { ///!< The timeslice in ns(Nanoseconds) for each software run list as configured, or the default value otherwise pub timeslice: ::core::ffi::c_uint, } /// Structure to set the vGPU scheduler state #[repr(C)] #[derive(Copy, Clone)] pub struct nvmlVgpuSchedulerSetState_st { ///!< Scheduler policy pub schedulerPolicy: ::core::ffi::c_uint, ///!< Adaptive Round Robin scheduler pub enableARRMode: ::core::ffi::c_uint, pub schedulerParams: nvmlVgpuSchedulerSetParams_t, } /// Structure to set the vGPU scheduler state pub type nvmlVgpuSchedulerSetState_t = nvmlVgpuSchedulerSetState_st; /// Structure to store the vGPU scheduler capabilities #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlVgpuSchedulerCapabilities_st { ///!< List the supported vGPU schedulers on the device pub supportedSchedulers: [::core::ffi::c_uint; 3usize], ///!< Maximum timeslice value in ns pub maxTimeslice: ::core::ffi::c_uint, ///!< Minimum timeslice value in ns pub minTimeslice: ::core::ffi::c_uint, ///!< Flag to check Adaptive Round Robin mode enabled/disabled. pub isArrModeSupported: ::core::ffi::c_uint, ///!< Maximum frequency for Adaptive Round Robin mode pub maxFrequencyForARR: ::core::ffi::c_uint, ///!< Minimum frequency for Adaptive Round Robin mode pub minFrequencyForARR: ::core::ffi::c_uint, ///!< Maximum averaging factor for Adaptive Round Robin mode pub maxAvgFactorForARR: ::core::ffi::c_uint, ///!< Minimum averaging factor for Adaptive Round Robin mode pub minAvgFactorForARR: ::core::ffi::c_uint, } /// Structure to store the vGPU scheduler capabilities pub type nvmlVgpuSchedulerCapabilities_t = nvmlVgpuSchedulerCapabilities_st; /// Structure to store the vGPU license expiry details #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlVgpuLicenseExpiry_st { ///!< Year of license expiry pub year: ::core::ffi::c_uint, ///!< Month of license expiry pub month: ::core::ffi::c_ushort, ///!< Day of license expiry pub day: ::core::ffi::c_ushort, ///!< Hour of license expiry pub hour: ::core::ffi::c_ushort, ///!< Minutes of license expiry pub min: ::core::ffi::c_ushort, ///!< Seconds of license expiry pub sec: ::core::ffi::c_ushort, ///!< License expiry status pub status: ::core::ffi::c_uchar, } /// Structure to store the vGPU license expiry details pub type nvmlVgpuLicenseExpiry_t = nvmlVgpuLicenseExpiry_st; #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlVgpuLicenseInfo_st { ///!< License status pub isLicensed: ::core::ffi::c_uchar, ///!< License expiry information pub licenseExpiry: nvmlVgpuLicenseExpiry_t, ///!< Current license state pub currentState: ::core::ffi::c_uint, } pub type nvmlVgpuLicenseInfo_t = nvmlVgpuLicenseInfo_st; /// Structure to store license expiry date and time values #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlGridLicenseExpiry_st { ///!< Year value of license expiry pub year: ::core::ffi::c_uint, ///!< Month value of license expiry pub month: ::core::ffi::c_ushort, ///!< Day value of license expiry pub day: ::core::ffi::c_ushort, ///!< Hour value of license expiry pub hour: ::core::ffi::c_ushort, ///!< Minutes value of license expiry pub min: ::core::ffi::c_ushort, ///!< Seconds value of license expiry pub sec: ::core::ffi::c_ushort, ///!< License expiry status pub status: ::core::ffi::c_uchar, } /// Structure to store license expiry date and time values pub type nvmlGridLicenseExpiry_t = nvmlGridLicenseExpiry_st; /// Structure containing vGPU software licensable feature information #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlGridLicensableFeature_st { ///!< Licensed feature code pub featureCode: nvmlGridLicenseFeatureCode_t, ///!< Non-zero if feature is currently licensed, otherwise zero pub featureState: ::core::ffi::c_uint, ///!< Deprecated. pub licenseInfo: [::core::ffi::c_char; 128usize], ///!< Product name of feature pub productName: [::core::ffi::c_char; 128usize], ///!< Non-zero if feature is enabled, otherwise zero pub featureEnabled: ::core::ffi::c_uint, ///!< License expiry structure containing date and time pub licenseExpiry: nvmlGridLicenseExpiry_t, } /// Structure containing vGPU software licensable feature information pub type nvmlGridLicensableFeature_t = nvmlGridLicensableFeature_st; /// Structure to store vGPU software licensable features #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlGridLicensableFeatures_st { ///!< Non-zero if vGPU Software Licensing is supported on the system, otherwise zero pub isGridLicenseSupported: ::core::ffi::c_int, ///!< Entries returned in \a gridLicensableFeatures array pub licensableFeaturesCount: ::core::ffi::c_uint, ///!< Array of vGPU software licensable features. pub gridLicensableFeatures: [nvmlGridLicensableFeature_t; 3usize], } /// Structure to store vGPU software licensable features pub type nvmlGridLicensableFeatures_t = nvmlGridLicensableFeatures_st; impl nvmlDeviceGpuRecoveryAction_s { pub const NVML_GPU_RECOVERY_ACTION_NONE: nvmlDeviceGpuRecoveryAction_s = nvmlDeviceGpuRecoveryAction_s( 0, ); } impl nvmlDeviceGpuRecoveryAction_s { pub const NVML_GPU_RECOVERY_ACTION_GPU_RESET: nvmlDeviceGpuRecoveryAction_s = nvmlDeviceGpuRecoveryAction_s( 1, ); } impl nvmlDeviceGpuRecoveryAction_s { pub const NVML_GPU_RECOVERY_ACTION_NODE_REBOOT: nvmlDeviceGpuRecoveryAction_s = nvmlDeviceGpuRecoveryAction_s( 2, ); } impl nvmlDeviceGpuRecoveryAction_s { pub const NVML_GPU_RECOVERY_ACTION_DRAIN_P2P: nvmlDeviceGpuRecoveryAction_s = nvmlDeviceGpuRecoveryAction_s( 3, ); } impl nvmlDeviceGpuRecoveryAction_s { pub const NVML_GPU_RECOVERY_ACTION_DRAIN_AND_RESET: nvmlDeviceGpuRecoveryAction_s = nvmlDeviceGpuRecoveryAction_s( 4, ); } #[repr(transparent)] /// Enum describing the GPU Recovery Action #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlDeviceGpuRecoveryAction_s(pub ::core::ffi::c_uint); /// Enum describing the GPU Recovery Action pub use self::nvmlDeviceGpuRecoveryAction_s as nvmlDeviceGpuRecoveryAction_t; /// Structure to store the vGPU type IDs -- version 1 #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlVgpuTypeIdInfo_v1_t { ///!< IN: The version number of this struct pub version: ::core::ffi::c_uint, ///!< IN/OUT: Number of vGPU types pub vgpuCount: ::core::ffi::c_uint, ///!< OUT: List of vGPU type IDs pub vgpuTypeIds: *mut nvmlVgpuTypeId_t, } /// Structure to store the vGPU type IDs -- version 1 pub type nvmlVgpuTypeIdInfo_t = nvmlVgpuTypeIdInfo_v1_t; /// Structure to store the maximum number of possible vGPU type IDs -- version 1 #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlVgpuTypeMaxInstance_v1_t { ///!< IN: The version number of this struct pub version: ::core::ffi::c_uint, ///!< IN: Handle to vGPU type pub vgpuTypeId: nvmlVgpuTypeId_t, ///!< OUT: Maximum number of vGPU instances per GPU instance pub maxInstancePerGI: ::core::ffi::c_uint, } /// Structure to store the maximum number of possible vGPU type IDs -- version 1 pub type nvmlVgpuTypeMaxInstance_t = nvmlVgpuTypeMaxInstance_v1_t; /// Structure to store active vGPU instance information -- Version 1 #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlActiveVgpuInstanceInfo_v1_t { ///!< IN: The version number of this struct pub version: ::core::ffi::c_uint, ///!< IN/OUT: Count of the active vGPU instances pub vgpuCount: ::core::ffi::c_uint, ///!< IN/OUT: list of active vGPU instances pub vgpuInstances: *mut nvmlVgpuInstance_t, } /// Structure to store active vGPU instance information -- Version 1 pub type nvmlActiveVgpuInstanceInfo_t = nvmlActiveVgpuInstanceInfo_v1_t; /// Structure to set vGPU scheduler state information -- version 1 #[repr(C)] #[derive(Copy, Clone)] pub struct nvmlVgpuSchedulerState_v1_t { ///!< IN: The version number of this struct pub version: ::core::ffi::c_uint, ///!< IN: One of NVML_VGPU_SCHEDULER_ENGINE_TYPE_*. pub engineId: ::core::ffi::c_uint, ///!< IN: Scheduler policy pub schedulerPolicy: ::core::ffi::c_uint, ///!< IN: Adaptive Round Robin scheduler pub enableARRMode: ::core::ffi::c_uint, ///!< IN: vGPU Scheduler Parameters pub schedulerParams: nvmlVgpuSchedulerSetParams_t, } /// Structure to set vGPU scheduler state information -- version 1 pub type nvmlVgpuSchedulerState_t = nvmlVgpuSchedulerState_v1_t; /// Structure to store vGPU scheduler state information -- Version 1 #[repr(C)] #[derive(Copy, Clone)] pub struct nvmlVgpuSchedulerStateInfo_v1_t { ///!< IN: The version number of this struct pub version: ::core::ffi::c_uint, ///!< IN: Engine whose software scheduler state info is fetched. One of NVML_VGPU_SCHEDULER_ENGINE_TYPE_*. pub engineId: ::core::ffi::c_uint, ///!< OUT: Scheduler policy pub schedulerPolicy: ::core::ffi::c_uint, ///!< OUT: Adaptive Round Robin scheduler mode. One of the NVML_VGPU_SCHEDULER_ARR_*. pub arrMode: ::core::ffi::c_uint, ///!< OUT: vGPU Scheduler Parameters pub schedulerParams: nvmlVgpuSchedulerParams_t, } /// Structure to store vGPU scheduler state information -- Version 1 pub type nvmlVgpuSchedulerStateInfo_t = nvmlVgpuSchedulerStateInfo_v1_t; /// Structure to store vGPU scheduler log information -- Version 1 #[repr(C)] #[derive(Copy, Clone)] pub struct nvmlVgpuSchedulerLogInfo_v1_t { ///!< IN: The version number of this struct pub version: ::core::ffi::c_uint, ///!< IN: Engine whose software runlist log entries are fetched. One of One of NVML_VGPU_SCHEDULER_ENGINE_TYPE_*. pub engineId: ::core::ffi::c_uint, ///!< OUT: Scheduler policy pub schedulerPolicy: ::core::ffi::c_uint, ///!< OUT: Adaptive Round Robin scheduler mode. One of the NVML_VGPU_SCHEDULER_ARR_*. pub arrMode: ::core::ffi::c_uint, ///!< OUT: vGPU Scheduler Parameters pub schedulerParams: nvmlVgpuSchedulerParams_t, ///!< OUT: Count of log entries fetched pub entriesCount: ::core::ffi::c_uint, ///!< OUT: Structure to store the state and logs of a software runlist pub logEntries: [nvmlVgpuSchedulerLogEntry_t; 200usize], } /// Structure to store vGPU scheduler log information -- Version 1 pub type nvmlVgpuSchedulerLogInfo_t = nvmlVgpuSchedulerLogInfo_v1_t; /// Structure to store creatable vGPU placement information -- version 1 #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlVgpuCreatablePlacementInfo_v1_t { ///!< IN: The version number of this struct pub version: ::core::ffi::c_uint, ///!< IN: Handle to vGPU type pub vgpuTypeId: nvmlVgpuTypeId_t, ///!< IN/OUT: Count of the placement IDs pub count: ::core::ffi::c_uint, ///!< IN/OUT: Placement IDs for the vGPU type pub placementIds: *mut ::core::ffi::c_uint, ///!< OUT: The number of slots occupied by the vGPU type pub placementSize: ::core::ffi::c_uint, } /// Structure to store creatable vGPU placement information -- version 1 pub type nvmlVgpuCreatablePlacementInfo_t = nvmlVgpuCreatablePlacementInfo_v1_t; #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlNvLinkPowerThres_st { ///!< Low power threshold pub lowPwrThreshold: ::core::ffi::c_uint, } pub type nvmlNvLinkPowerThres_t = nvmlNvLinkPowerThres_st; /// Information for a Field Value Sample #[repr(C)] #[derive(Copy, Clone)] pub struct nvmlFieldValue_st { ///!< ID of the NVML field to retrieve. This must be set before any call that uses this struct. See the constants starting with NVML_FI_ above. pub fieldId: ::core::ffi::c_uint, ///!< Scope ID can represent data used by NVML depending on fieldId's context. For example, for NVLink throughput counter data, scopeId can represent linkId. pub scopeId: ::core::ffi::c_uint, ///!< CPU Timestamp of this value in microseconds since 1970 pub timestamp: ::core::ffi::c_longlong, ///!< How long this field value took to update (in usec) within NVML. This may be averaged across several fields that are serviced by the same driver call. pub latencyUsec: ::core::ffi::c_longlong, ///!< Type of the value stored in value pub valueType: nvmlValueType_t, ///!< Return code for retrieving this value. This must be checked before looking at value, as value is undefined if nvmlReturn != NVML_SUCCESS pub nvmlReturn: nvmlReturn_t, ///!< Value for this field. This is only valid if nvmlReturn == NVML_SUCCESS pub value: nvmlValue_t, } /// Information for a Field Value Sample pub type nvmlFieldValue_t = nvmlFieldValue_st; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct nvmlUnit_st { _unused: [u8; 0], } #[doc = "/\n/** @defgroup nvmlUnitStructs Unit Structs\n @{\n/\n/"] pub type nvmlUnit_t = *mut nvmlUnit_st; /// Description of HWBC entry #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlHwbcEntry_st { pub hwbcId: ::core::ffi::c_uint, pub firmwareVersion: [::core::ffi::c_char; 32usize], } /// Description of HWBC entry pub type nvmlHwbcEntry_t = nvmlHwbcEntry_st; impl nvmlFanState_enum { ///!< Fan is working properly pub const NVML_FAN_NORMAL: nvmlFanState_enum = nvmlFanState_enum(0); } impl nvmlFanState_enum { ///!< Fan has failed pub const NVML_FAN_FAILED: nvmlFanState_enum = nvmlFanState_enum(1); } #[repr(transparent)] /// Fan state enum. #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlFanState_enum(pub ::core::ffi::c_uint); /// Fan state enum. pub use self::nvmlFanState_enum as nvmlFanState_t; impl nvmlLedColor_enum { ///!< GREEN, indicates good health pub const NVML_LED_COLOR_GREEN: nvmlLedColor_enum = nvmlLedColor_enum(0); } impl nvmlLedColor_enum { ///!< AMBER, indicates problem pub const NVML_LED_COLOR_AMBER: nvmlLedColor_enum = nvmlLedColor_enum(1); } #[repr(transparent)] /// Led color enum. #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlLedColor_enum(pub ::core::ffi::c_uint); /// Led color enum. pub use self::nvmlLedColor_enum as nvmlLedColor_t; /// LED states for an S-class unit. #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlLedState_st { ///!< If amber, a text description of the cause pub cause: [::core::ffi::c_char; 256usize], ///!< GREEN or AMBER pub color: nvmlLedColor_t, } /// LED states for an S-class unit. pub type nvmlLedState_t = nvmlLedState_st; /// Static S-class unit info. #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlUnitInfo_st { ///!< Product name pub name: [::core::ffi::c_char; 96usize], ///!< Product identifier pub id: [::core::ffi::c_char; 96usize], ///!< Product serial number pub serial: [::core::ffi::c_char; 96usize], ///!< Firmware version pub firmwareVersion: [::core::ffi::c_char; 96usize], } /// Static S-class unit info. pub type nvmlUnitInfo_t = nvmlUnitInfo_st; /** Power usage information for an S-class unit. The power supply state is a human readable string that equals "Normal" or contains a combination of "Abnormal" plus one or more of the following: - High voltage - Fan failure - Heatsink temperature - Current limit - Voltage below UV alarm threshold - Low-voltage - SI2C remote off command - MOD_DISABLE input - Short pin transition*/ #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlPSUInfo_st { ///!< The power supply state pub state: [::core::ffi::c_char; 256usize], ///!< PSU current (A) pub current: ::core::ffi::c_uint, ///!< PSU voltage (V) pub voltage: ::core::ffi::c_uint, ///!< PSU power draw (W) pub power: ::core::ffi::c_uint, } /** Power usage information for an S-class unit. The power supply state is a human readable string that equals "Normal" or contains a combination of "Abnormal" plus one or more of the following: - High voltage - Fan failure - Heatsink temperature - Current limit - Voltage below UV alarm threshold - Low-voltage - SI2C remote off command - MOD_DISABLE input - Short pin transition*/ pub type nvmlPSUInfo_t = nvmlPSUInfo_st; /// Fan speed reading for a single fan in an S-class unit. #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlUnitFanInfo_st { ///!< Fan speed (RPM) pub speed: ::core::ffi::c_uint, ///!< Flag that indicates whether fan is working properly pub state: nvmlFanState_t, } /// Fan speed reading for a single fan in an S-class unit. pub type nvmlUnitFanInfo_t = nvmlUnitFanInfo_st; /// Fan speed readings for an entire S-class unit. #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlUnitFanSpeeds_st { ///!< Fan speed data for each fan pub fans: [nvmlUnitFanInfo_t; 24usize], ///!< Number of fans in unit pub count: ::core::ffi::c_uint, } /// Fan speed readings for an entire S-class unit. pub type nvmlUnitFanSpeeds_t = nvmlUnitFanSpeeds_st; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct nvmlEventSet_st { _unused: [u8; 0], } /// Handle to an event set pub type nvmlEventSet_t = *mut nvmlEventSet_st; /// Information about occurred event #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlEventData_st { ///!< Specific device where the event occurred pub device: nvmlDevice_t, ///!< Information about what specific event occurred pub eventType: ::core::ffi::c_ulonglong, ///!< Stores Xid error for the device in the event of nvmlEventTypeXidCriticalError, pub eventData: ::core::ffi::c_ulonglong, ///!< If MIG is enabled and nvmlEventTypeXidCriticalError event is attributable to a GPU pub gpuInstanceId: ::core::ffi::c_uint, ///!< If MIG is enabled and nvmlEventTypeXidCriticalError event is attributable to a pub computeInstanceId: ::core::ffi::c_uint, } /// Information about occurred event pub type nvmlEventData_t = nvmlEventData_st; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct nvmlSystemEventSet_st { _unused: [u8; 0], } /// System Event Set pub type nvmlSystemEventSet_t = *mut nvmlSystemEventSet_st; /// nvmlSystemEventSetCreateRequest #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlSystemEventSetCreateRequest_v1_t { ///!< the API version number pub version: ::core::ffi::c_uint, ///!< system event set pub set: nvmlSystemEventSet_t, } /// nvmlSystemEventSetCreateRequest pub type nvmlSystemEventSetCreateRequest_t = nvmlSystemEventSetCreateRequest_v1_t; /// nvmlSystemEventSetFreeRequest #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlSystemEventSetFreeRequest_v1_t { ///!< the API version number pub version: ::core::ffi::c_uint, ///!< system event set pub set: nvmlSystemEventSet_t, } /// nvmlSystemEventSetFreeRequest pub type nvmlSystemEventSetFreeRequest_t = nvmlSystemEventSetFreeRequest_v1_t; /// nvmlSystemRegisterEventRequest #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlSystemRegisterEventRequest_v1_t { ///!< the API version number pub version: ::core::ffi::c_uint, /**!< Bitmask of \ref nvmlEventType to record !< For example eventTypes = (nvmlEventTypeBind | nvmlEventTypeUnbind) !< to listen to both Bind and Unbind events.*/ pub eventTypes: ::core::ffi::c_ulonglong, ///!< Set to which add new event types pub set: nvmlSystemEventSet_t, } /// nvmlSystemRegisterEventRequest pub type nvmlSystemRegisterEventRequest_t = nvmlSystemRegisterEventRequest_v1_t; /// nvmlSystemEventData_v1_t #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlSystemEventData_v1_t { ///!< Information about what specific system event occurred pub eventType: ::core::ffi::c_ulonglong, ///!< gpuId in PCI format pub gpuId: ::core::ffi::c_uint, } /// nvmlSystemEventSetWait #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlSystemEventSetWaitRequest_v1_t { ///!< input/output: the API version number pub version: ::core::ffi::c_uint, /**!< input: time to sleep waiting for event. !< If timeoutms is zero, skip waiting for event.*/ pub timeoutms: ::core::ffi::c_uint, ///!< input: system event set pub set: nvmlSystemEventSet_t, ///!< input/output: array of event data, owned by caller pub data: *mut nvmlSystemEventData_v1_t, ///!< input: the size of data array pub dataSize: ::core::ffi::c_uint, ///!< output: number of event collected. pub numEvent: ::core::ffi::c_uint, } /// nvmlSystemEventSetWait pub type nvmlSystemEventSetWaitRequest_t = nvmlSystemEventSetWaitRequest_v1_t; /// Describes accounting statistics of a process. #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlAccountingStats_st { ///!< Percent of time over the process's lifetime during which one or more kernels was executing on the GPU. pub gpuUtilization: ::core::ffi::c_uint, ///!< Percent of time over the process's lifetime during which global (device) memory was being read or written. pub memoryUtilization: ::core::ffi::c_uint, ///!< Maximum total memory in bytes that was ever allocated by the process. pub maxMemoryUsage: ::core::ffi::c_ulonglong, /**!< Amount of time in ms during which the compute context was active. The time is reported as 0 if !< the process is not terminated*/ pub time: ::core::ffi::c_ulonglong, ///!< CPU Timestamp in usec representing start time for the process pub startTime: ::core::ffi::c_ulonglong, ///!< Flag to represent if the process is running (1 for running, 0 for terminated) pub isRunning: ::core::ffi::c_uint, ///!< Reserved for future use pub reserved: [::core::ffi::c_uint; 5usize], } /// Describes accounting statistics of a process. pub type nvmlAccountingStats_t = nvmlAccountingStats_st; impl nvmlEncoderQueryType_enum { ///!< H264 encoder pub const NVML_ENCODER_QUERY_H264: nvmlEncoderQueryType_enum = nvmlEncoderQueryType_enum( 0, ); } impl nvmlEncoderQueryType_enum { ///!< HEVC encoder pub const NVML_ENCODER_QUERY_HEVC: nvmlEncoderQueryType_enum = nvmlEncoderQueryType_enum( 1, ); } impl nvmlEncoderQueryType_enum { ///!< AV1 encoder pub const NVML_ENCODER_QUERY_AV1: nvmlEncoderQueryType_enum = nvmlEncoderQueryType_enum( 2, ); } impl nvmlEncoderQueryType_enum { ///!< Unknown encoder pub const NVML_ENCODER_QUERY_UNKNOWN: nvmlEncoderQueryType_enum = nvmlEncoderQueryType_enum( 255, ); } #[repr(transparent)] /// Represents type of encoder for capacity can be queried #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlEncoderQueryType_enum(pub ::core::ffi::c_uint); /// Represents type of encoder for capacity can be queried pub use self::nvmlEncoderQueryType_enum as nvmlEncoderType_t; /// Structure to hold encoder session data #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlEncoderSessionInfo_st { ///!< Unique session ID pub sessionId: ::core::ffi::c_uint, ///!< Owning process ID pub pid: ::core::ffi::c_uint, ///!< Owning vGPU instance ID (only valid on vGPU hosts, otherwise zero) pub vgpuInstance: nvmlVgpuInstance_t, ///!< Video encoder type pub codecType: nvmlEncoderType_t, ///!< Current encode horizontal resolution pub hResolution: ::core::ffi::c_uint, ///!< Current encode vertical resolution pub vResolution: ::core::ffi::c_uint, ///!< Moving average encode frames per second pub averageFps: ::core::ffi::c_uint, ///!< Moving average encode latency in microseconds pub averageLatency: ::core::ffi::c_uint, } /// Structure to hold encoder session data pub type nvmlEncoderSessionInfo_t = nvmlEncoderSessionInfo_st; impl nvmlFBCSessionType_enum { ///!< Unknown pub const NVML_FBC_SESSION_TYPE_UNKNOWN: nvmlFBCSessionType_enum = nvmlFBCSessionType_enum( 0, ); } impl nvmlFBCSessionType_enum { ///!< ToSys pub const NVML_FBC_SESSION_TYPE_TOSYS: nvmlFBCSessionType_enum = nvmlFBCSessionType_enum( 1, ); } impl nvmlFBCSessionType_enum { ///!< Cuda pub const NVML_FBC_SESSION_TYPE_CUDA: nvmlFBCSessionType_enum = nvmlFBCSessionType_enum( 2, ); } impl nvmlFBCSessionType_enum { ///!< Vid pub const NVML_FBC_SESSION_TYPE_VID: nvmlFBCSessionType_enum = nvmlFBCSessionType_enum( 3, ); } impl nvmlFBCSessionType_enum { ///!< HEnc pub const NVML_FBC_SESSION_TYPE_HWENC: nvmlFBCSessionType_enum = nvmlFBCSessionType_enum( 4, ); } #[repr(transparent)] /// Represents frame buffer capture session type #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlFBCSessionType_enum(pub ::core::ffi::c_uint); /// Represents frame buffer capture session type pub use self::nvmlFBCSessionType_enum as nvmlFBCSessionType_t; /// Structure to hold frame buffer capture sessions stats #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlFBCStats_st { ///!< Total no of sessions pub sessionsCount: ::core::ffi::c_uint, ///!< Moving average new frames captured per second pub averageFPS: ::core::ffi::c_uint, ///!< Moving average new frame capture latency in microseconds pub averageLatency: ::core::ffi::c_uint, } /// Structure to hold frame buffer capture sessions stats pub type nvmlFBCStats_t = nvmlFBCStats_st; /// Structure to hold FBC session data #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlFBCSessionInfo_st { ///!< Unique session ID pub sessionId: ::core::ffi::c_uint, ///!< Owning process ID pub pid: ::core::ffi::c_uint, ///!< Owning vGPU instance ID (only valid on vGPU hosts, otherwise zero) pub vgpuInstance: nvmlVgpuInstance_t, ///!< Display identifier pub displayOrdinal: ::core::ffi::c_uint, ///!< Type of frame buffer capture session pub sessionType: nvmlFBCSessionType_t, ///!< Session flags (one or more of NVML_NVFBC_SESSION_FLAG_XXX). pub sessionFlags: ::core::ffi::c_uint, ///!< Max horizontal resolution supported by the capture session pub hMaxResolution: ::core::ffi::c_uint, ///!< Max vertical resolution supported by the capture session pub vMaxResolution: ::core::ffi::c_uint, ///!< Horizontal resolution requested by caller in capture call pub hResolution: ::core::ffi::c_uint, ///!< Vertical resolution requested by caller in capture call pub vResolution: ::core::ffi::c_uint, ///!< Moving average new frames captured per second pub averageFPS: ::core::ffi::c_uint, ///!< Moving average new frame capture latency in microseconds pub averageLatency: ::core::ffi::c_uint, } /// Structure to hold FBC session data pub type nvmlFBCSessionInfo_t = nvmlFBCSessionInfo_st; impl nvmlDetachGpuState_enum { pub const NVML_DETACH_GPU_KEEP: nvmlDetachGpuState_enum = nvmlDetachGpuState_enum(0); } impl nvmlDetachGpuState_enum { pub const NVML_DETACH_GPU_REMOVE: nvmlDetachGpuState_enum = nvmlDetachGpuState_enum( 1, ); } #[repr(transparent)] /// Is the GPU device to be removed from the kernel by nvmlDeviceRemoveGpu() #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlDetachGpuState_enum(pub ::core::ffi::c_uint); /// Is the GPU device to be removed from the kernel by nvmlDeviceRemoveGpu() pub use self::nvmlDetachGpuState_enum as nvmlDetachGpuState_t; impl nvmlPcieLinkState_enum { pub const NVML_PCIE_LINK_KEEP: nvmlPcieLinkState_enum = nvmlPcieLinkState_enum(0); } impl nvmlPcieLinkState_enum { pub const NVML_PCIE_LINK_SHUT_DOWN: nvmlPcieLinkState_enum = nvmlPcieLinkState_enum( 1, ); } #[repr(transparent)] /// Parent bridge PCIe link state requested by nvmlDeviceRemoveGpu() #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlPcieLinkState_enum(pub ::core::ffi::c_uint); /// Parent bridge PCIe link state requested by nvmlDeviceRemoveGpu() pub use self::nvmlPcieLinkState_enum as nvmlPcieLinkState_t; #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlConfComputeSystemCaps_st { pub cpuCaps: ::core::ffi::c_uint, pub gpusCaps: ::core::ffi::c_uint, } pub type nvmlConfComputeSystemCaps_t = nvmlConfComputeSystemCaps_st; #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlConfComputeSystemState_st { pub environment: ::core::ffi::c_uint, pub ccFeature: ::core::ffi::c_uint, pub devToolsMode: ::core::ffi::c_uint, } pub type nvmlConfComputeSystemState_t = nvmlConfComputeSystemState_st; /// Confidential Compute System settings #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlSystemConfComputeSettings_v1_t { pub version: ::core::ffi::c_uint, pub environment: ::core::ffi::c_uint, pub ccFeature: ::core::ffi::c_uint, pub devToolsMode: ::core::ffi::c_uint, pub multiGpuMode: ::core::ffi::c_uint, } /// Confidential Compute System settings pub type nvmlSystemConfComputeSettings_t = nvmlSystemConfComputeSettings_v1_t; /// Protected memory size #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlConfComputeMemSizeInfo_st { pub protectedMemSizeKib: ::core::ffi::c_ulonglong, pub unprotectedMemSizeKib: ::core::ffi::c_ulonglong, } /// Protected memory size pub type nvmlConfComputeMemSizeInfo_t = nvmlConfComputeMemSizeInfo_st; #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlConfComputeGpuCertificate_st { pub certChainSize: ::core::ffi::c_uint, pub attestationCertChainSize: ::core::ffi::c_uint, pub certChain: [::core::ffi::c_uchar; 4096usize], pub attestationCertChain: [::core::ffi::c_uchar; 5120usize], } pub type nvmlConfComputeGpuCertificate_t = nvmlConfComputeGpuCertificate_st; #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlConfComputeGpuAttestationReport_st { ///!< output pub isCecAttestationReportPresent: ::core::ffi::c_uint, ///!< output pub attestationReportSize: ::core::ffi::c_uint, ///!< output pub cecAttestationReportSize: ::core::ffi::c_uint, ///!< input: spdm supports 32 bytes on nonce pub nonce: [::core::ffi::c_uchar; 32usize], ///!< output pub attestationReport: [::core::ffi::c_uchar; 8192usize], ///!< output pub cecAttestationReport: [::core::ffi::c_uchar; 4096usize], } pub type nvmlConfComputeGpuAttestationReport_t = nvmlConfComputeGpuAttestationReport_st; #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlConfComputeSetKeyRotationThresholdInfo_st { pub version: ::core::ffi::c_uint, pub maxAttackerAdvantage: ::core::ffi::c_ulonglong, } pub type nvmlConfComputeSetKeyRotationThresholdInfo_v1_t = nvmlConfComputeSetKeyRotationThresholdInfo_st; pub type nvmlConfComputeSetKeyRotationThresholdInfo_t = nvmlConfComputeSetKeyRotationThresholdInfo_v1_t; #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlConfComputeGetKeyRotationThresholdInfo_st { pub version: ::core::ffi::c_uint, pub attackerAdvantage: ::core::ffi::c_ulonglong, } pub type nvmlConfComputeGetKeyRotationThresholdInfo_v1_t = nvmlConfComputeGetKeyRotationThresholdInfo_st; pub type nvmlConfComputeGetKeyRotationThresholdInfo_t = nvmlConfComputeGetKeyRotationThresholdInfo_v1_t; /// Probe State of GPU registration process pub type nvmlGpuFabricState_t = ::core::ffi::c_uchar; /// Contains the device fabric information #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlGpuFabricInfo_t { ///!< Uuid of the cluster to which this GPU belongs pub clusterUuid: [::core::ffi::c_uchar; 16usize], ///!< Error status, if any. Must be checked only if state returns "complete". pub status: nvmlReturn_t, ///!< ID of the fabric clique to which this GPU belongs pub cliqueId: ::core::ffi::c_uint, ///!< Current state of GPU registration process. See NVML_GPU_FABRIC_STATE_* pub state: nvmlGpuFabricState_t, } /** GPU Fabric information (v2). @deprecated nvmlGpuFabricInfo_v2_t is deprecated and will be removed in a future release. Use nvmlGpuFabricInfo_v3_t instead Version 2 adds the \ref nvmlGpuFabricInfo_v2_t.version field to the start of the structure, and the \ref nvmlGpuFabricInfo_v2_t.healthMask field to the end. This structure is not backwards-compatible with \ref nvmlGpuFabricInfo_t.*/ #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlGpuFabricInfo_v2_t { ///!< Structure version identifier (set to nvmlGpuFabricInfo_v2) pub version: ::core::ffi::c_uint, ///!< Uuid of the cluster to which this GPU belongs pub clusterUuid: [::core::ffi::c_uchar; 16usize], ///!< Probe Error status, if any. Must be checked only if Probe state returns "complete". pub status: nvmlReturn_t, ///!< ID of the fabric clique to which this GPU belongs pub cliqueId: ::core::ffi::c_uint, ///!< Current Probe State of GPU registration process. See NVML_GPU_FABRIC_STATE_* pub state: nvmlGpuFabricState_t, ///!< GPU Fabric health Status Mask. See NVML_GPU_FABRIC_HEALTH_MASK_* pub healthMask: ::core::ffi::c_uint, } /// GPU Fabric information (v3). #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlGpuFabricInfo_v3_t { ///!< Structure version identifier (set to nvmlGpuFabricInfo_v2) pub version: ::core::ffi::c_uint, ///!< Uuid of the cluster to which this GPU belongs pub clusterUuid: [::core::ffi::c_uchar; 16usize], ///!< Probe Error status, if any. Must be checked only if Probe state returns "complete". pub status: nvmlReturn_t, ///!< ID of the fabric clique to which this GPU belongs pub cliqueId: ::core::ffi::c_uint, ///!< Current Probe State of GPU registration process. See NVML_GPU_FABRIC_STATE_* pub state: nvmlGpuFabricState_t, ///!< GPU Fabric health Status Mask. See NVML_GPU_FABRIC_HEALTH_MASK_* pub healthMask: ::core::ffi::c_uint, ///!< GPU Fabric health summary. See NVML_GPU_FABRIC_HEALTH_SUMMARY_* pub healthSummary: ::core::ffi::c_uchar, } /// GPU Fabric information (v3). pub type nvmlGpuFabricInfoV_t = nvmlGpuFabricInfo_v3_t; /// Structure to store Driver branch information #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlSystemDriverBranchInfo_v1_t { ///!< The version number of this struct pub version: ::core::ffi::c_uint, ///!< driver branch pub branch: [::core::ffi::c_char; 80usize], } /// Structure to store Driver branch information pub type nvmlSystemDriverBranchInfo_t = nvmlSystemDriverBranchInfo_v1_t; pub type nvmlAffinityScope_t = ::core::ffi::c_uint; /// Structure used to encapsulate temperature info #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlTemperature_v1_t { pub version: ::core::ffi::c_uint, pub sensorType: nvmlTemperatureSensors_t, pub temperature: ::core::ffi::c_int, } /// Structure used to encapsulate temperature info pub type nvmlTemperature_t = nvmlTemperature_v1_t; impl nvmlClockLimitId_enum { pub const NVML_CLOCK_LIMIT_ID_RANGE_START: nvmlClockLimitId_enum = nvmlClockLimitId_enum( 4294967040, ); } impl nvmlClockLimitId_enum { pub const NVML_CLOCK_LIMIT_ID_TDP: nvmlClockLimitId_enum = nvmlClockLimitId_enum( 4294967041, ); } impl nvmlClockLimitId_enum { pub const NVML_CLOCK_LIMIT_ID_UNLIMITED: nvmlClockLimitId_enum = nvmlClockLimitId_enum( 4294967042, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlClockLimitId_enum(pub ::core::ffi::c_uint); pub use self::nvmlClockLimitId_enum as nvmlClockLimitId_t; #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlNvlinkSupportedBwModes_v1_t { pub version: ::core::ffi::c_uint, pub bwModes: [::core::ffi::c_uchar; 23usize], pub totalBwModes: ::core::ffi::c_uchar, } pub type nvmlNvlinkSupportedBwModes_t = nvmlNvlinkSupportedBwModes_v1_t; #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlNvlinkGetBwMode_v1_t { pub version: ::core::ffi::c_uint, pub bIsBest: ::core::ffi::c_uint, pub bwMode: ::core::ffi::c_uchar, } pub type nvmlNvlinkGetBwMode_t = nvmlNvlinkGetBwMode_v1_t; #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlNvlinkSetBwMode_v1_t { pub version: ::core::ffi::c_uint, pub bSetBest: ::core::ffi::c_uint, pub bwMode: ::core::ffi::c_uchar, } pub type nvmlNvlinkSetBwMode_t = nvmlNvlinkSetBwMode_v1_t; /// Struct to represent per device NVLINK information v1 #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlNvLinkInfo_v1_t { ///!< IN - the API version number pub version: ::core::ffi::c_uint, ///!< OUT - NVLINK encryption enablement pub isNvleEnabled: ::core::ffi::c_uint, } /// Struct to represent NVLINK firmware Semantic versioning and ucode type #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlNvlinkFirmwareVersion_t { pub ucodeType: ::core::ffi::c_uchar, pub major: ::core::ffi::c_uint, pub minor: ::core::ffi::c_uint, pub subMinor: ::core::ffi::c_uint, } /// Struct to represent NVLINK firmware information #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlNvlinkFirmwareInfo_t { ///!< OUT - NVLINK firmware version pub firmwareVersion: [nvmlNvlinkFirmwareVersion_t; 100usize], ///!< OUT - Number of valid firmware entries pub numValidEntries: ::core::ffi::c_uint, } /// Struct to represent per device NVLINK information v2 #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlNvLinkInfo_v2_t { ///!< IN - the API version number pub version: ::core::ffi::c_uint, ///!< OUT - NVLINK encryption enablement pub isNvleEnabled: ::core::ffi::c_uint, ///!< OUT - NVLINK Firmware info pub firmwareInfo: nvmlNvlinkFirmwareInfo_t, } /// Struct to represent per device NVLINK information v2 pub type nvmlNvLinkInfo_t = nvmlNvLinkInfo_v2_t; /// Structure representing range of vGPU versions. #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlVgpuVersion_st { ///!< Minimum vGPU version. pub minVersion: ::core::ffi::c_uint, ///!< Maximum vGPU version. pub maxVersion: ::core::ffi::c_uint, } /// Structure representing range of vGPU versions. pub type nvmlVgpuVersion_t = nvmlVgpuVersion_st; /// vGPU metadata structure. #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlVgpuMetadata_st { ///!< Current version of the structure pub version: ::core::ffi::c_uint, ///!< Current revision of the structure pub revision: ::core::ffi::c_uint, ///!< Current state of Guest-dependent fields pub guestInfoState: nvmlVgpuGuestInfoState_t, ///!< Version of driver installed in guest pub guestDriverVersion: [::core::ffi::c_char; 80usize], ///!< Version of driver installed in host pub hostDriverVersion: [::core::ffi::c_char; 80usize], ///!< Reserved for internal use pub reserved: [::core::ffi::c_uint; 6usize], ///!< vGPU virtualization capabilities bitfield pub vgpuVirtualizationCaps: ::core::ffi::c_uint, ///!< vGPU version of guest driver pub guestVgpuVersion: ::core::ffi::c_uint, ///!< Size of opaque data field in bytes pub opaqueDataSize: ::core::ffi::c_uint, ///!< Opaque data pub opaqueData: [::core::ffi::c_char; 4usize], } /// vGPU metadata structure. pub type nvmlVgpuMetadata_t = nvmlVgpuMetadata_st; /// Physical GPU metadata structure #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlVgpuPgpuMetadata_st { ///!< Current version of the structure pub version: ::core::ffi::c_uint, ///!< Current revision of the structure pub revision: ::core::ffi::c_uint, ///!< Host driver version pub hostDriverVersion: [::core::ffi::c_char; 80usize], ///!< Pgpu virtualization capabilities bitfield pub pgpuVirtualizationCaps: ::core::ffi::c_uint, ///!< Reserved for internal use pub reserved: [::core::ffi::c_uint; 5usize], ///!< vGPU version range supported by host driver pub hostSupportedVgpuRange: nvmlVgpuVersion_t, ///!< Size of opaque data field in bytes pub opaqueDataSize: ::core::ffi::c_uint, ///!< Opaque data pub opaqueData: [::core::ffi::c_char; 4usize], } /// Physical GPU metadata structure pub type nvmlVgpuPgpuMetadata_t = nvmlVgpuPgpuMetadata_st; impl nvmlVgpuVmCompatibility_enum { ///!< vGPU is not runnable pub const NVML_VGPU_VM_COMPATIBILITY_NONE: nvmlVgpuVmCompatibility_enum = nvmlVgpuVmCompatibility_enum( 0, ); } impl nvmlVgpuVmCompatibility_enum { ///!< vGPU is runnable from a cold / powered-off state (ACPI S5) pub const NVML_VGPU_VM_COMPATIBILITY_COLD: nvmlVgpuVmCompatibility_enum = nvmlVgpuVmCompatibility_enum( 1, ); } impl nvmlVgpuVmCompatibility_enum { ///!< vGPU is runnable from a hibernated state (ACPI S4) pub const NVML_VGPU_VM_COMPATIBILITY_HIBERNATE: nvmlVgpuVmCompatibility_enum = nvmlVgpuVmCompatibility_enum( 2, ); } impl nvmlVgpuVmCompatibility_enum { ///!< vGPU is runnable from a sleeped state (ACPI S3) pub const NVML_VGPU_VM_COMPATIBILITY_SLEEP: nvmlVgpuVmCompatibility_enum = nvmlVgpuVmCompatibility_enum( 4, ); } impl nvmlVgpuVmCompatibility_enum { ///!< vGPU is runnable from a live/paused (ACPI S0) pub const NVML_VGPU_VM_COMPATIBILITY_LIVE: nvmlVgpuVmCompatibility_enum = nvmlVgpuVmCompatibility_enum( 8, ); } #[repr(transparent)] /// vGPU VM compatibility codes #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlVgpuVmCompatibility_enum(pub ::core::ffi::c_uint); /// vGPU VM compatibility codes pub use self::nvmlVgpuVmCompatibility_enum as nvmlVgpuVmCompatibility_t; impl nvmlVgpuPgpuCompatibilityLimitCode_enum { ///!< Compatibility is not limited. pub const NVML_VGPU_COMPATIBILITY_LIMIT_NONE: nvmlVgpuPgpuCompatibilityLimitCode_enum = nvmlVgpuPgpuCompatibilityLimitCode_enum( 0, ); } impl nvmlVgpuPgpuCompatibilityLimitCode_enum { ///!< ompatibility is limited by host driver version. pub const NVML_VGPU_COMPATIBILITY_LIMIT_HOST_DRIVER: nvmlVgpuPgpuCompatibilityLimitCode_enum = nvmlVgpuPgpuCompatibilityLimitCode_enum( 1, ); } impl nvmlVgpuPgpuCompatibilityLimitCode_enum { ///!< Compatibility is limited by guest driver version. pub const NVML_VGPU_COMPATIBILITY_LIMIT_GUEST_DRIVER: nvmlVgpuPgpuCompatibilityLimitCode_enum = nvmlVgpuPgpuCompatibilityLimitCode_enum( 2, ); } impl nvmlVgpuPgpuCompatibilityLimitCode_enum { ///!< Compatibility is limited by GPU hardware. pub const NVML_VGPU_COMPATIBILITY_LIMIT_GPU: nvmlVgpuPgpuCompatibilityLimitCode_enum = nvmlVgpuPgpuCompatibilityLimitCode_enum( 4, ); } impl nvmlVgpuPgpuCompatibilityLimitCode_enum { ///!< Compatibility is limited by an undefined factor. pub const NVML_VGPU_COMPATIBILITY_LIMIT_OTHER: nvmlVgpuPgpuCompatibilityLimitCode_enum = nvmlVgpuPgpuCompatibilityLimitCode_enum( 2147483648, ); } #[repr(transparent)] /// vGPU-pGPU compatibility limit codes #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlVgpuPgpuCompatibilityLimitCode_enum(pub ::core::ffi::c_uint); /// vGPU-pGPU compatibility limit codes pub use self::nvmlVgpuPgpuCompatibilityLimitCode_enum as nvmlVgpuPgpuCompatibilityLimitCode_t; /// vGPU-pGPU compatibility structure #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlVgpuPgpuCompatibility_st { ///!< Compatibility of vGPU VM. See \ref nvmlVgpuVmCompatibility_t pub vgpuVmCompatibility: nvmlVgpuVmCompatibility_t, ///!< Limiting factor for vGPU-pGPU compatibility. See \ref nvmlVgpuPgpuCompatibilityLimitCode_t pub compatibilityLimitCode: nvmlVgpuPgpuCompatibilityLimitCode_t, } /// vGPU-pGPU compatibility structure pub type nvmlVgpuPgpuCompatibility_t = nvmlVgpuPgpuCompatibility_st; /// Excluded GPU device information #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlExcludedDeviceInfo_st { ///!< The PCI information for the excluded GPU pub pciInfo: nvmlPciInfo_t, ///!< The ASCII string UUID for the excluded GPU pub uuid: [::core::ffi::c_char; 80usize], } /// Excluded GPU device information pub type nvmlExcludedDeviceInfo_t = nvmlExcludedDeviceInfo_st; /// Main PRM input structure #[repr(C)] #[derive(Copy, Clone)] pub struct nvmlPRMTLV_v1_t { ///!< Size of the input TLV data. pub dataSize: ::core::ffi::c_uint, ///!< OUT: status of the PRM command pub status: ::core::ffi::c_uint, pub __bindgen_anon_1: nvmlPRMTLV_v1_t__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] pub union nvmlPRMTLV_v1_t__bindgen_ty_1 { ///!< IN: Input data in TLV format pub inData: [::core::ffi::c_uchar; 496usize], ///!< OUT: Output PRM data in TLV format pub outData: [::core::ffi::c_uchar; 496usize], } #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlGpuInstancePlacement_st { ///!< Index of first occupied memory slice pub start: ::core::ffi::c_uint, ///!< Number of memory slices occupied pub size: ::core::ffi::c_uint, } pub type nvmlGpuInstancePlacement_t = nvmlGpuInstancePlacement_st; /// GPU instance profile information. #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlGpuInstanceProfileInfo_st { ///!< Unique profile ID within the device pub id: ::core::ffi::c_uint, ///!< Peer-to-Peer support pub isP2pSupported: ::core::ffi::c_uint, ///!< GPU Slice count pub sliceCount: ::core::ffi::c_uint, ///!< GPU instance count pub instanceCount: ::core::ffi::c_uint, ///!< Streaming Multiprocessor count pub multiprocessorCount: ::core::ffi::c_uint, ///!< Copy Engine count pub copyEngineCount: ::core::ffi::c_uint, ///!< Decoder Engine count pub decoderCount: ::core::ffi::c_uint, ///!< Encoder Engine count pub encoderCount: ::core::ffi::c_uint, ///!< JPEG Engine count pub jpegCount: ::core::ffi::c_uint, ///!< OFA Engine count pub ofaCount: ::core::ffi::c_uint, ///!< Memory size in MBytes pub memorySizeMB: ::core::ffi::c_ulonglong, } /// GPU instance profile information. pub type nvmlGpuInstanceProfileInfo_t = nvmlGpuInstanceProfileInfo_st; /** GPU instance profile information (v2). Version 2 adds the \ref nvmlGpuInstanceProfileInfo_v2_t.version field to the start of the structure, and the \ref nvmlGpuInstanceProfileInfo_v2_t.name field to the end. This structure is not backwards-compatible with \ref nvmlGpuInstanceProfileInfo_t.*/ #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlGpuInstanceProfileInfo_v2_st { ///!< Structure version identifier (set to \ref nvmlGpuInstanceProfileInfo_v2) pub version: ::core::ffi::c_uint, ///!< Unique profile ID within the device pub id: ::core::ffi::c_uint, ///!< Peer-to-Peer support pub isP2pSupported: ::core::ffi::c_uint, ///!< GPU Slice count pub sliceCount: ::core::ffi::c_uint, ///!< GPU instance count pub instanceCount: ::core::ffi::c_uint, ///!< Streaming Multiprocessor count pub multiprocessorCount: ::core::ffi::c_uint, ///!< Copy Engine count pub copyEngineCount: ::core::ffi::c_uint, ///!< Decoder Engine count pub decoderCount: ::core::ffi::c_uint, ///!< Encoder Engine count pub encoderCount: ::core::ffi::c_uint, ///!< JPEG Engine count pub jpegCount: ::core::ffi::c_uint, ///!< OFA Engine count pub ofaCount: ::core::ffi::c_uint, ///!< Memory size in MBytes pub memorySizeMB: ::core::ffi::c_ulonglong, ///!< Profile name pub name: [::core::ffi::c_char; 96usize], } /** GPU instance profile information (v2). Version 2 adds the \ref nvmlGpuInstanceProfileInfo_v2_t.version field to the start of the structure, and the \ref nvmlGpuInstanceProfileInfo_v2_t.name field to the end. This structure is not backwards-compatible with \ref nvmlGpuInstanceProfileInfo_t.*/ pub type nvmlGpuInstanceProfileInfo_v2_t = nvmlGpuInstanceProfileInfo_v2_st; /** GPU instance profile information (v3). Version 3 removes isP2pSupported field and adds the \ref nvmlGpuInstanceProfileInfo_v3_t.capabilities field \ref nvmlGpuInstanceProfileInfo_t.*/ #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlGpuInstanceProfileInfo_v3_st { ///!< Structure version identifier (set to \ref nvmlGpuInstanceProfileInfo_v3) pub version: ::core::ffi::c_uint, ///!< Unique profile ID within the device pub id: ::core::ffi::c_uint, ///!< GPU Slice count pub sliceCount: ::core::ffi::c_uint, ///!< GPU instance count pub instanceCount: ::core::ffi::c_uint, ///!< Streaming Multiprocessor count pub multiprocessorCount: ::core::ffi::c_uint, ///!< Copy Engine count pub copyEngineCount: ::core::ffi::c_uint, ///!< Decoder Engine count pub decoderCount: ::core::ffi::c_uint, ///!< Encoder Engine count pub encoderCount: ::core::ffi::c_uint, ///!< JPEG Engine count pub jpegCount: ::core::ffi::c_uint, ///!< OFA Engine count pub ofaCount: ::core::ffi::c_uint, ///!< Memory size in MBytes pub memorySizeMB: ::core::ffi::c_ulonglong, ///!< Profile name pub name: [::core::ffi::c_char; 96usize], ///!< Additional capabilities pub capabilities: ::core::ffi::c_uint, } /** GPU instance profile information (v3). Version 3 removes isP2pSupported field and adds the \ref nvmlGpuInstanceProfileInfo_v3_t.capabilities field \ref nvmlGpuInstanceProfileInfo_t.*/ pub type nvmlGpuInstanceProfileInfo_v3_t = nvmlGpuInstanceProfileInfo_v3_st; #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlGpuInstanceInfo_st { ///!< Parent device pub device: nvmlDevice_t, ///!< Unique instance ID within the device pub id: ::core::ffi::c_uint, ///!< Unique profile ID within the device pub profileId: ::core::ffi::c_uint, ///!< Placement for this instance pub placement: nvmlGpuInstancePlacement_t, } pub type nvmlGpuInstanceInfo_t = nvmlGpuInstanceInfo_st; #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlComputeInstancePlacement_st { ///!< Index of first occupied compute slice pub start: ::core::ffi::c_uint, ///!< Number of compute slices occupied pub size: ::core::ffi::c_uint, } pub type nvmlComputeInstancePlacement_t = nvmlComputeInstancePlacement_st; /// Compute instance profile information. #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlComputeInstanceProfileInfo_st { ///!< Unique profile ID within the GPU instance pub id: ::core::ffi::c_uint, ///!< GPU Slice count pub sliceCount: ::core::ffi::c_uint, ///!< Compute instance count pub instanceCount: ::core::ffi::c_uint, ///!< Streaming Multiprocessor count pub multiprocessorCount: ::core::ffi::c_uint, ///!< Shared Copy Engine count pub sharedCopyEngineCount: ::core::ffi::c_uint, ///!< Shared Decoder Engine count pub sharedDecoderCount: ::core::ffi::c_uint, ///!< Shared Encoder Engine count pub sharedEncoderCount: ::core::ffi::c_uint, ///!< Shared JPEG Engine count pub sharedJpegCount: ::core::ffi::c_uint, ///!< Shared OFA Engine count pub sharedOfaCount: ::core::ffi::c_uint, } /// Compute instance profile information. pub type nvmlComputeInstanceProfileInfo_t = nvmlComputeInstanceProfileInfo_st; /** Compute instance profile information (v2). Version 2 adds the \ref nvmlComputeInstanceProfileInfo_v2_t.version field to the start of the structure, and the \ref nvmlComputeInstanceProfileInfo_v2_t.name field to the end. This structure is not backwards-compatible with \ref nvmlComputeInstanceProfileInfo_t.*/ #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlComputeInstanceProfileInfo_v2_st { ///!< Structure version identifier (set to \ref nvmlComputeInstanceProfileInfo_v2) pub version: ::core::ffi::c_uint, ///!< Unique profile ID within the GPU instance pub id: ::core::ffi::c_uint, ///!< GPU Slice count pub sliceCount: ::core::ffi::c_uint, ///!< Compute instance count pub instanceCount: ::core::ffi::c_uint, ///!< Streaming Multiprocessor count pub multiprocessorCount: ::core::ffi::c_uint, ///!< Shared Copy Engine count pub sharedCopyEngineCount: ::core::ffi::c_uint, ///!< Shared Decoder Engine count pub sharedDecoderCount: ::core::ffi::c_uint, ///!< Shared Encoder Engine count pub sharedEncoderCount: ::core::ffi::c_uint, ///!< Shared JPEG Engine count pub sharedJpegCount: ::core::ffi::c_uint, ///!< Shared OFA Engine count pub sharedOfaCount: ::core::ffi::c_uint, ///!< Profile name pub name: [::core::ffi::c_char; 96usize], } /** Compute instance profile information (v2). Version 2 adds the \ref nvmlComputeInstanceProfileInfo_v2_t.version field to the start of the structure, and the \ref nvmlComputeInstanceProfileInfo_v2_t.name field to the end. This structure is not backwards-compatible with \ref nvmlComputeInstanceProfileInfo_t.*/ pub type nvmlComputeInstanceProfileInfo_v2_t = nvmlComputeInstanceProfileInfo_v2_st; /** Compute instance profile information (v3). Version 3 adds the \ref nvmlComputeInstanceProfileInfo_v3_t.capabilities field \ref nvmlComputeInstanceProfileInfo_t.*/ #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlComputeInstanceProfileInfo_v3_st { ///!< Structure version identifier (set to \ref nvmlComputeInstanceProfileInfo_v3) pub version: ::core::ffi::c_uint, ///!< Unique profile ID within the GPU instance pub id: ::core::ffi::c_uint, ///!< GPU Slice count pub sliceCount: ::core::ffi::c_uint, ///!< Compute instance count pub instanceCount: ::core::ffi::c_uint, ///!< Streaming Multiprocessor count pub multiprocessorCount: ::core::ffi::c_uint, ///!< Shared Copy Engine count pub sharedCopyEngineCount: ::core::ffi::c_uint, ///!< Shared Decoder Engine count pub sharedDecoderCount: ::core::ffi::c_uint, ///!< Shared Encoder Engine count pub sharedEncoderCount: ::core::ffi::c_uint, ///!< Shared JPEG Engine count pub sharedJpegCount: ::core::ffi::c_uint, ///!< Shared OFA Engine count pub sharedOfaCount: ::core::ffi::c_uint, ///!< Profile name pub name: [::core::ffi::c_char; 96usize], ///!< Additional capabilities pub capabilities: ::core::ffi::c_uint, } /** Compute instance profile information (v3). Version 3 adds the \ref nvmlComputeInstanceProfileInfo_v3_t.capabilities field \ref nvmlComputeInstanceProfileInfo_t.*/ pub type nvmlComputeInstanceProfileInfo_v3_t = nvmlComputeInstanceProfileInfo_v3_st; #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlComputeInstanceInfo_st { ///!< Parent device pub device: nvmlDevice_t, ///!< Parent GPU instance pub gpuInstance: nvmlGpuInstance_t, ///!< Unique instance ID within the GPU instance pub id: ::core::ffi::c_uint, ///!< Unique profile ID within the GPU instance pub profileId: ::core::ffi::c_uint, ///!< Placement for this instance within the GPU instance's compute slice range {0, sliceCount} pub placement: nvmlComputeInstancePlacement_t, } pub type nvmlComputeInstanceInfo_t = nvmlComputeInstanceInfo_st; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct nvmlComputeInstance_st { _unused: [u8; 0], } pub type nvmlComputeInstance_t = *mut nvmlComputeInstance_st; impl nvmlGpmMetricId_t { ///!< Percentage of time any compute/graphics app was active on the GPU. 0.0 - 100.0 pub const NVML_GPM_METRIC_GRAPHICS_UTIL: nvmlGpmMetricId_t = nvmlGpmMetricId_t(1); } impl nvmlGpmMetricId_t { ///!< Percentage of SMs that were busy. 0.0 - 100.0 pub const NVML_GPM_METRIC_SM_UTIL: nvmlGpmMetricId_t = nvmlGpmMetricId_t(2); } impl nvmlGpmMetricId_t { ///!< Percentage of warps that were active vs theoretical maximum. 0.0 - 100.0 pub const NVML_GPM_METRIC_SM_OCCUPANCY: nvmlGpmMetricId_t = nvmlGpmMetricId_t(3); } impl nvmlGpmMetricId_t { ///!< Percentage of time the GPU's SMs were doing integer operations. 0.0 - 100.0 pub const NVML_GPM_METRIC_INTEGER_UTIL: nvmlGpmMetricId_t = nvmlGpmMetricId_t(4); } impl nvmlGpmMetricId_t { ///!< Percentage of time the GPU's SMs were doing ANY tensor operations. 0.0 - 100.0 pub const NVML_GPM_METRIC_ANY_TENSOR_UTIL: nvmlGpmMetricId_t = nvmlGpmMetricId_t(5); } impl nvmlGpmMetricId_t { ///!< Percentage of time the GPU's SMs were doing DFMA tensor operations. 0.0 - 100.0 pub const NVML_GPM_METRIC_DFMA_TENSOR_UTIL: nvmlGpmMetricId_t = nvmlGpmMetricId_t(6); } impl nvmlGpmMetricId_t { ///!< Percentage of time the GPU's SMs were doing HMMA tensor operations. 0.0 - 100.0 pub const NVML_GPM_METRIC_HMMA_TENSOR_UTIL: nvmlGpmMetricId_t = nvmlGpmMetricId_t(7); } impl nvmlGpmMetricId_t { ///!< Percentage of time the GPU's SMs were doing IMMA tensor operations. 0.0 - 100.0 pub const NVML_GPM_METRIC_IMMA_TENSOR_UTIL: nvmlGpmMetricId_t = nvmlGpmMetricId_t(9); } impl nvmlGpmMetricId_t { ///!< Percentage of DRAM bw used vs theoretical maximum. 0.0 - 100.0 */ pub const NVML_GPM_METRIC_DRAM_BW_UTIL: nvmlGpmMetricId_t = nvmlGpmMetricId_t(10); } impl nvmlGpmMetricId_t { ///!< Percentage of time the GPU's SMs were doing non-tensor FP64 math. 0.0 - 100.0 pub const NVML_GPM_METRIC_FP64_UTIL: nvmlGpmMetricId_t = nvmlGpmMetricId_t(11); } impl nvmlGpmMetricId_t { ///!< Percentage of time the GPU's SMs were doing non-tensor FP32 math. 0.0 - 100.0 pub const NVML_GPM_METRIC_FP32_UTIL: nvmlGpmMetricId_t = nvmlGpmMetricId_t(12); } impl nvmlGpmMetricId_t { ///!< Percentage of time the GPU's SMs were doing non-tensor FP16 math. 0.0 - 100.0 pub const NVML_GPM_METRIC_FP16_UTIL: nvmlGpmMetricId_t = nvmlGpmMetricId_t(13); } impl nvmlGpmMetricId_t { ///!< PCIe traffic from this GPU in MiB/sec pub const NVML_GPM_METRIC_PCIE_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t(20); } impl nvmlGpmMetricId_t { ///!< PCIe traffic to this GPU in MiB/sec pub const NVML_GPM_METRIC_PCIE_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t(21); } impl nvmlGpmMetricId_t { ///!< Percent utilization of NVDEC 0. 0.0 - 100.0 pub const NVML_GPM_METRIC_NVDEC_0_UTIL: nvmlGpmMetricId_t = nvmlGpmMetricId_t(30); } impl nvmlGpmMetricId_t { ///!< Percent utilization of NVDEC 1. 0.0 - 100.0 pub const NVML_GPM_METRIC_NVDEC_1_UTIL: nvmlGpmMetricId_t = nvmlGpmMetricId_t(31); } impl nvmlGpmMetricId_t { ///!< Percent utilization of NVDEC 2. 0.0 - 100.0 pub const NVML_GPM_METRIC_NVDEC_2_UTIL: nvmlGpmMetricId_t = nvmlGpmMetricId_t(32); } impl nvmlGpmMetricId_t { ///!< Percent utilization of NVDEC 3. 0.0 - 100.0 pub const NVML_GPM_METRIC_NVDEC_3_UTIL: nvmlGpmMetricId_t = nvmlGpmMetricId_t(33); } impl nvmlGpmMetricId_t { ///!< Percent utilization of NVDEC 4. 0.0 - 100.0 pub const NVML_GPM_METRIC_NVDEC_4_UTIL: nvmlGpmMetricId_t = nvmlGpmMetricId_t(34); } impl nvmlGpmMetricId_t { ///!< Percent utilization of NVDEC 5. 0.0 - 100.0 pub const NVML_GPM_METRIC_NVDEC_5_UTIL: nvmlGpmMetricId_t = nvmlGpmMetricId_t(35); } impl nvmlGpmMetricId_t { ///!< Percent utilization of NVDEC 6. 0.0 - 100.0 pub const NVML_GPM_METRIC_NVDEC_6_UTIL: nvmlGpmMetricId_t = nvmlGpmMetricId_t(36); } impl nvmlGpmMetricId_t { ///!< Percent utilization of NVDEC 7. 0.0 - 100.0 pub const NVML_GPM_METRIC_NVDEC_7_UTIL: nvmlGpmMetricId_t = nvmlGpmMetricId_t(37); } impl nvmlGpmMetricId_t { ///!< Percent utilization of NVJPG 0. 0.0 - 100.0 pub const NVML_GPM_METRIC_NVJPG_0_UTIL: nvmlGpmMetricId_t = nvmlGpmMetricId_t(40); } impl nvmlGpmMetricId_t { ///!< Percent utilization of NVJPG 1. 0.0 - 100.0 pub const NVML_GPM_METRIC_NVJPG_1_UTIL: nvmlGpmMetricId_t = nvmlGpmMetricId_t(41); } impl nvmlGpmMetricId_t { ///!< Percent utilization of NVJPG 2. 0.0 - 100.0 pub const NVML_GPM_METRIC_NVJPG_2_UTIL: nvmlGpmMetricId_t = nvmlGpmMetricId_t(42); } impl nvmlGpmMetricId_t { ///!< Percent utilization of NVJPG 3. 0.0 - 100.0 pub const NVML_GPM_METRIC_NVJPG_3_UTIL: nvmlGpmMetricId_t = nvmlGpmMetricId_t(43); } impl nvmlGpmMetricId_t { ///!< Percent utilization of NVJPG 4. 0.0 - 100.0 pub const NVML_GPM_METRIC_NVJPG_4_UTIL: nvmlGpmMetricId_t = nvmlGpmMetricId_t(44); } impl nvmlGpmMetricId_t { ///!< Percent utilization of NVJPG 5. 0.0 - 100.0 pub const NVML_GPM_METRIC_NVJPG_5_UTIL: nvmlGpmMetricId_t = nvmlGpmMetricId_t(45); } impl nvmlGpmMetricId_t { ///!< Percent utilization of NVJPG 6. 0.0 - 100.0 pub const NVML_GPM_METRIC_NVJPG_6_UTIL: nvmlGpmMetricId_t = nvmlGpmMetricId_t(46); } impl nvmlGpmMetricId_t { ///!< Percent utilization of NVJPG 7. 0.0 - 100.0 pub const NVML_GPM_METRIC_NVJPG_7_UTIL: nvmlGpmMetricId_t = nvmlGpmMetricId_t(47); } impl nvmlGpmMetricId_t { ///!< Percent utilization of NVOFA 0. 0.0 - 100.0 pub const NVML_GPM_METRIC_NVOFA_0_UTIL: nvmlGpmMetricId_t = nvmlGpmMetricId_t(50); } impl nvmlGpmMetricId_t { ///!< Percent utilization of NVOFA 1. 0.0 - 100.0 pub const NVML_GPM_METRIC_NVOFA_1_UTIL: nvmlGpmMetricId_t = nvmlGpmMetricId_t(51); } impl nvmlGpmMetricId_t { ///!< NvLink read bandwidth for all links in MiB/sec pub const NVML_GPM_METRIC_NVLINK_TOTAL_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 60, ); } impl nvmlGpmMetricId_t { ///!< NvLink write bandwidth for all links in MiB/sec pub const NVML_GPM_METRIC_NVLINK_TOTAL_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 61, ); } impl nvmlGpmMetricId_t { ///!< NvLink read bandwidth for link 0 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L0_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 62, ); } impl nvmlGpmMetricId_t { ///!< NvLink write bandwidth for link 0 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L0_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 63, ); } impl nvmlGpmMetricId_t { ///!< NvLink read bandwidth for link 1 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L1_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 64, ); } impl nvmlGpmMetricId_t { ///!< NvLink write bandwidth for link 1 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L1_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 65, ); } impl nvmlGpmMetricId_t { ///!< NvLink read bandwidth for link 2 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L2_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 66, ); } impl nvmlGpmMetricId_t { ///!< NvLink write bandwidth for link 2 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L2_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 67, ); } impl nvmlGpmMetricId_t { ///!< NvLink read bandwidth for link 3 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L3_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 68, ); } impl nvmlGpmMetricId_t { ///!< NvLink write bandwidth for link 3 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L3_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 69, ); } impl nvmlGpmMetricId_t { ///!< NvLink read bandwidth for link 4 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L4_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 70, ); } impl nvmlGpmMetricId_t { ///!< NvLink write bandwidth for link 4 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L4_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 71, ); } impl nvmlGpmMetricId_t { ///!< NvLink read bandwidth for link 5 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L5_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 72, ); } impl nvmlGpmMetricId_t { ///!< NvLink write bandwidth for link 5 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L5_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 73, ); } impl nvmlGpmMetricId_t { ///!< NvLink read bandwidth for link 6 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L6_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 74, ); } impl nvmlGpmMetricId_t { ///!< NvLink write bandwidth for link 6 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L6_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 75, ); } impl nvmlGpmMetricId_t { ///!< NvLink read bandwidth for link 7 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L7_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 76, ); } impl nvmlGpmMetricId_t { ///!< NvLink write bandwidth for link 7 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L7_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 77, ); } impl nvmlGpmMetricId_t { ///!< NvLink read bandwidth for link 8 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L8_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 78, ); } impl nvmlGpmMetricId_t { ///!< NvLink write bandwidth for link 8 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L8_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 79, ); } impl nvmlGpmMetricId_t { ///!< NvLink read bandwidth for link 9 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L9_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 80, ); } impl nvmlGpmMetricId_t { ///!< NvLink write bandwidth for link 9 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L9_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 81, ); } impl nvmlGpmMetricId_t { ///!< NvLink read bandwidth for link 10 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L10_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 82, ); } impl nvmlGpmMetricId_t { ///!< NvLink write bandwidth for link 10 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L10_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 83, ); } impl nvmlGpmMetricId_t { ///!< NvLink read bandwidth for link 11 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L11_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 84, ); } impl nvmlGpmMetricId_t { ///!< NvLink write bandwidth for link 11 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L11_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 85, ); } impl nvmlGpmMetricId_t { ///!< NvLink read bandwidth for link 12 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L12_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 86, ); } impl nvmlGpmMetricId_t { ///!< NvLink write bandwidth for link 12 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L12_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 87, ); } impl nvmlGpmMetricId_t { ///!< NvLink read bandwidth for link 13 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L13_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 88, ); } impl nvmlGpmMetricId_t { ///!< NvLink write bandwidth for link 13 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L13_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 89, ); } impl nvmlGpmMetricId_t { ///!< NvLink read bandwidth for link 14 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L14_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 90, ); } impl nvmlGpmMetricId_t { ///!< NvLink write bandwidth for link 14 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L14_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 91, ); } impl nvmlGpmMetricId_t { ///!< NvLink read bandwidth for link 15 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L15_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 92, ); } impl nvmlGpmMetricId_t { ///!< NvLink write bandwidth for link 15 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L15_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 93, ); } impl nvmlGpmMetricId_t { ///!< NvLink read bandwidth for link 16 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L16_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 94, ); } impl nvmlGpmMetricId_t { ///!< NvLink write bandwidth for link 16 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L16_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 95, ); } impl nvmlGpmMetricId_t { ///!< NvLink read bandwidth for link 17 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L17_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 96, ); } impl nvmlGpmMetricId_t { ///!< NvLink write bandwidth for link 17 in MiB/sec pub const NVML_GPM_METRIC_NVLINK_L17_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 97, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_TOTAL_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 100, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_TOTAL_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 101, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_DATA_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 102, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_DATA_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 103, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK0_TOTAL_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 104, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK0_TOTAL_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 105, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK0_DATA_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 106, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK0_DATA_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 107, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK1_TOTAL_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 108, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK1_TOTAL_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 109, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK1_DATA_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 110, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK1_DATA_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 111, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK2_TOTAL_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 112, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK2_TOTAL_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 113, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK2_DATA_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 114, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK2_DATA_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 115, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK3_TOTAL_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 116, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK3_TOTAL_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 117, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK3_DATA_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 118, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK3_DATA_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 119, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK4_TOTAL_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 120, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK4_TOTAL_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 121, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK4_DATA_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 122, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK4_DATA_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 123, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK5_TOTAL_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 124, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK5_TOTAL_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 125, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK5_DATA_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 126, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK5_DATA_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 127, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK6_TOTAL_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 128, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK6_TOTAL_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 129, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK6_DATA_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 130, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK6_DATA_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 131, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK7_TOTAL_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 132, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK7_TOTAL_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 133, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK7_DATA_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 134, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK7_DATA_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 135, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK8_TOTAL_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 136, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK8_TOTAL_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 137, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK8_DATA_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 138, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK8_DATA_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 139, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK9_TOTAL_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 140, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK9_TOTAL_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 141, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK9_DATA_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 142, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK9_DATA_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 143, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK10_TOTAL_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 144, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK10_TOTAL_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 145, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK10_DATA_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 146, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK10_DATA_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 147, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK11_TOTAL_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 148, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK11_TOTAL_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 149, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK11_DATA_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 150, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK11_DATA_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 151, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK12_TOTAL_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 152, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK12_TOTAL_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 153, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK12_DATA_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 154, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK12_DATA_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 155, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK13_TOTAL_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 156, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK13_TOTAL_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 157, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK13_DATA_TX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 158, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_C2C_LINK13_DATA_RX_PER_SEC: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 159, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_HOSTMEM_CACHE_HIT: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 160, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_HOSTMEM_CACHE_MISS: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 161, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_PEERMEM_CACHE_HIT: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 162, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_PEERMEM_CACHE_MISS: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 163, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_DRAM_CACHE_HIT: nvmlGpmMetricId_t = nvmlGpmMetricId_t(164); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_DRAM_CACHE_MISS: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 165, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_NVENC_0_UTIL: nvmlGpmMetricId_t = nvmlGpmMetricId_t(166); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_NVENC_1_UTIL: nvmlGpmMetricId_t = nvmlGpmMetricId_t(167); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_NVENC_2_UTIL: nvmlGpmMetricId_t = nvmlGpmMetricId_t(168); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_NVENC_3_UTIL: nvmlGpmMetricId_t = nvmlGpmMetricId_t(169); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR0_CTXSW_CYCLES_ELAPSED: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 170, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR0_CTXSW_CYCLES_ACTIVE: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 171, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR0_CTXSW_REQUESTS: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 172, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR0_CTXSW_CYCLES_PER_REQ: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 173, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR0_CTXSW_ACTIVE_PCT: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 174, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR1_CTXSW_CYCLES_ELAPSED: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 175, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR1_CTXSW_CYCLES_ACTIVE: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 176, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR1_CTXSW_REQUESTS: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 177, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR1_CTXSW_CYCLES_PER_REQ: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 178, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR1_CTXSW_ACTIVE_PCT: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 179, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR2_CTXSW_CYCLES_ELAPSED: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 180, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR2_CTXSW_CYCLES_ACTIVE: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 181, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR2_CTXSW_REQUESTS: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 182, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR2_CTXSW_CYCLES_PER_REQ: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 183, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR2_CTXSW_ACTIVE_PCT: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 184, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR3_CTXSW_CYCLES_ELAPSED: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 185, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR3_CTXSW_CYCLES_ACTIVE: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 186, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR3_CTXSW_REQUESTS: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 187, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR3_CTXSW_CYCLES_PER_REQ: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 188, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR3_CTXSW_ACTIVE_PCT: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 189, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR4_CTXSW_CYCLES_ELAPSED: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 190, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR4_CTXSW_CYCLES_ACTIVE: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 191, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR4_CTXSW_REQUESTS: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 192, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR4_CTXSW_CYCLES_PER_REQ: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 193, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR4_CTXSW_ACTIVE_PCT: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 194, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR5_CTXSW_CYCLES_ELAPSED: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 195, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR5_CTXSW_CYCLES_ACTIVE: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 196, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR5_CTXSW_REQUESTS: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 197, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR5_CTXSW_CYCLES_PER_REQ: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 198, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR5_CTXSW_ACTIVE_PCT: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 199, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR6_CTXSW_CYCLES_ELAPSED: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 200, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR6_CTXSW_CYCLES_ACTIVE: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 201, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR6_CTXSW_REQUESTS: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 202, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR6_CTXSW_CYCLES_PER_REQ: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 203, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR6_CTXSW_ACTIVE_PCT: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 204, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR7_CTXSW_CYCLES_ELAPSED: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 205, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR7_CTXSW_CYCLES_ACTIVE: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 206, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR7_CTXSW_REQUESTS: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 207, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR7_CTXSW_CYCLES_PER_REQ: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 208, ); } impl nvmlGpmMetricId_t { pub const NVML_GPM_METRIC_GR7_CTXSW_ACTIVE_PCT: nvmlGpmMetricId_t = nvmlGpmMetricId_t( 209, ); } impl nvmlGpmMetricId_t { ///!< Maximum value above +1. Note that changing this should also change NVML_GPM_METRICS_GET_VERSION due to struct size change pub const NVML_GPM_METRIC_MAX: nvmlGpmMetricId_t = nvmlGpmMetricId_t(210); } #[repr(transparent)] /// GPM Metric Identifiers #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlGpmMetricId_t(pub ::core::ffi::c_uint); #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct nvmlGpmSample_st { _unused: [u8; 0], } /// Handle to an allocated GPM sample allocated with nvmlGpmSampleAlloc(). Free this with nvmlGpmSampleFree(). pub type nvmlGpmSample_t = *mut nvmlGpmSample_st; /// GPM metric information. #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct nvmlGpmMetric_t { ///!< IN: NVML_GPM_METRIC_? define of which metric to retrieve pub metricId: ::core::ffi::c_uint, ///!< OUT: Status of this metric. If this is nonzero, then value is not valid pub nvmlReturn: nvmlReturn_t, ///!< OUT: Value of this metric. Is only valid if nvmlReturn is 0 (NVML_SUCCESS) pub value: f64, ///!< OUT: Metric name and unit. Those can be NULL if not defined pub metricInfo: nvmlGpmMetric_t__bindgen_ty_1, } #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlGpmMetric_t__bindgen_ty_1 { pub shortName: *mut ::core::ffi::c_char, pub longName: *mut ::core::ffi::c_char, pub unit: *mut ::core::ffi::c_char, } /// GPM buffer information. #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct nvmlGpmMetricsGet_t { ///!< IN: Set to NVML_GPM_METRICS_GET_VERSION pub version: ::core::ffi::c_uint, ///!< IN: How many metrics to retrieve in metrics[] pub numMetrics: ::core::ffi::c_uint, ///!< IN: Sample buffer pub sample1: nvmlGpmSample_t, ///!< IN: Sample buffer pub sample2: nvmlGpmSample_t, ///!< IN/OUT: Array of metrics. Set metricId on call. See nvmlReturn and value on return pub metrics: [nvmlGpmMetric_t; 210usize], } /// GPM device information. #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlGpmSupport_t { ///!< IN: Set to NVML_GPM_SUPPORT_VERSION pub version: ::core::ffi::c_uint, ///!< OUT: Indicates device support pub isSupportedDevice: ::core::ffi::c_uint, } /// Device capabilities #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlDeviceCapabilities_v1_t { ///!< the API version number pub version: ::core::ffi::c_uint, ///!< OUT: Bit mask of capabilities. pub capMask: ::core::ffi::c_uint, } /// Device capabilities pub type nvmlDeviceCapabilities_t = nvmlDeviceCapabilities_v1_t; #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlMask255_t { pub mask: [::core::ffi::c_uint; 8usize], } impl nvmlPowerProfileType_t { pub const NVML_POWER_PROFILE_MAX_P: nvmlPowerProfileType_t = nvmlPowerProfileType_t( 0, ); } impl nvmlPowerProfileType_t { pub const NVML_POWER_PROFILE_MAX_Q: nvmlPowerProfileType_t = nvmlPowerProfileType_t( 1, ); } impl nvmlPowerProfileType_t { pub const NVML_POWER_PROFILE_COMPUTE: nvmlPowerProfileType_t = nvmlPowerProfileType_t( 2, ); } impl nvmlPowerProfileType_t { pub const NVML_POWER_PROFILE_MEMORY_BOUND: nvmlPowerProfileType_t = nvmlPowerProfileType_t( 3, ); } impl nvmlPowerProfileType_t { pub const NVML_POWER_PROFILE_NETWORK: nvmlPowerProfileType_t = nvmlPowerProfileType_t( 4, ); } impl nvmlPowerProfileType_t { pub const NVML_POWER_PROFILE_BALANCED: nvmlPowerProfileType_t = nvmlPowerProfileType_t( 5, ); } impl nvmlPowerProfileType_t { pub const NVML_POWER_PROFILE_LLM_INFERENCE: nvmlPowerProfileType_t = nvmlPowerProfileType_t( 6, ); } impl nvmlPowerProfileType_t { pub const NVML_POWER_PROFILE_LLM_TRAINING: nvmlPowerProfileType_t = nvmlPowerProfileType_t( 7, ); } impl nvmlPowerProfileType_t { pub const NVML_POWER_PROFILE_RBM: nvmlPowerProfileType_t = nvmlPowerProfileType_t(8); } impl nvmlPowerProfileType_t { pub const NVML_POWER_PROFILE_DCPCIE: nvmlPowerProfileType_t = nvmlPowerProfileType_t( 9, ); } impl nvmlPowerProfileType_t { pub const NVML_POWER_PROFILE_HMMA_SPARSE: nvmlPowerProfileType_t = nvmlPowerProfileType_t( 10, ); } impl nvmlPowerProfileType_t { pub const NVML_POWER_PROFILE_HMMA_DENSE: nvmlPowerProfileType_t = nvmlPowerProfileType_t( 11, ); } impl nvmlPowerProfileType_t { pub const NVML_POWER_PROFILE_SYNC_BALANCED: nvmlPowerProfileType_t = nvmlPowerProfileType_t( 12, ); } impl nvmlPowerProfileType_t { pub const NVML_POWER_PROFILE_HPC: nvmlPowerProfileType_t = nvmlPowerProfileType_t( 13, ); } impl nvmlPowerProfileType_t { pub const NVML_POWER_PROFILE_MIG: nvmlPowerProfileType_t = nvmlPowerProfileType_t( 14, ); } impl nvmlPowerProfileType_t { pub const NVML_POWER_PROFILE_MAX: nvmlPowerProfileType_t = nvmlPowerProfileType_t( 15, ); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlPowerProfileType_t(pub ::core::ffi::c_uint); /// Profile Metadata #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlWorkloadPowerProfileInfo_v1_t { ///!< the API version number pub version: ::core::ffi::c_uint, ///!< Performance Profile Id to provide semantic name such as compute, Memory, Max-Q... pub profileId: ::core::ffi::c_uint, ///!< Priority of the profile pub priority: ::core::ffi::c_uint, ///!< Mask of conflicting performance profiles pub conflictingMask: nvmlMask255_t, } /// Profile Metadata pub type nvmlWorkloadPowerProfileInfo_t = nvmlWorkloadPowerProfileInfo_v1_t; /// Profiles Info #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlWorkloadPowerProfileProfilesInfo_v1_t { ///!< the API version number pub version: ::core::ffi::c_uint, ///!< Mask bit set to true for each valid performance profile pub perfProfilesMask: nvmlMask255_t, ///!< Array of performance profile info parameters pub perfProfile: [nvmlWorkloadPowerProfileInfo_t; 255usize], } /// Profiles Info pub type nvmlWorkloadPowerProfileProfilesInfo_t = nvmlWorkloadPowerProfileProfilesInfo_v1_t; /// Current Profiles #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlWorkloadPowerProfileCurrentProfiles_v1_t { pub version: ::core::ffi::c_uint, ///!< Mask bit set to true for each valid performance profile pub perfProfilesMask: nvmlMask255_t, ///!< Mask of currently requested performance profiles pub requestedProfilesMask: nvmlMask255_t, ///!< Mask of currently enforced performance profiles post all arbitrations among the requested profiles. pub enforcedProfilesMask: nvmlMask255_t, } /// Current Profiles pub type nvmlWorkloadPowerProfileCurrentProfiles_t = nvmlWorkloadPowerProfileCurrentProfiles_v1_t; /// Requested Profiles #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlWorkloadPowerProfileRequestedProfiles_v1_t { ///!< the API version number pub version: ::core::ffi::c_uint, ///!< Mask of 255 bits, each bit representing index of respective perf profile pub requestedProfilesMask: nvmlMask255_t, } /// Requested Profiles pub type nvmlWorkloadPowerProfileRequestedProfiles_t = nvmlWorkloadPowerProfileRequestedProfiles_v1_t; /// Power Smoothing Structure for Profile information #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct nvmlPowerSmoothingProfile_v1_t { ///!< the API version number pub version: ::core::ffi::c_uint, ///!< The requested profile ID pub profileId: ::core::ffi::c_uint, ///!< The requested paramater ID pub paramId: ::core::ffi::c_uint, ///!< The requested value for the given parameter pub value: f64, } /// Power Smoothing Structure for Profile information pub type nvmlPowerSmoothingProfile_t = nvmlPowerSmoothingProfile_v1_t; /// Power Smoothing Structure for Feature Enablement #[repr(C)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct nvmlPowerSmoothingState_v1_t { ///!< the API version number pub version: ::core::ffi::c_uint, ///!< 0/Disabled or 1/Enabled pub state: nvmlEnableState_t, } /// Power Smoothing Structure for Feature Enablement pub type nvmlPowerSmoothingState_t = nvmlPowerSmoothingState_v1_t; impl nvmlError_t { pub const r#UNINITIALIZED: nvmlError_t = nvmlError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(1) }); pub const r#INVALID_ARGUMENT: nvmlError_t = nvmlError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(2) }); pub const r#NOT_SUPPORTED: nvmlError_t = nvmlError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(3) }); pub const r#NO_PERMISSION: nvmlError_t = nvmlError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(4) }); pub const r#ALREADY_INITIALIZED: nvmlError_t = nvmlError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(5) }); pub const r#NOT_FOUND: nvmlError_t = nvmlError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(6) }); pub const r#INSUFFICIENT_SIZE: nvmlError_t = nvmlError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(7) }); pub const r#INSUFFICIENT_POWER: nvmlError_t = nvmlError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(8) }); pub const r#DRIVER_NOT_LOADED: nvmlError_t = nvmlError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(9) }); pub const r#TIMEOUT: nvmlError_t = nvmlError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(10) }); pub const r#IRQ_ISSUE: nvmlError_t = nvmlError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(11) }); pub const r#LIBRARY_NOT_FOUND: nvmlError_t = nvmlError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(12) }); pub const r#FUNCTION_NOT_FOUND: nvmlError_t = nvmlError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(13) }); pub const r#CORRUPTED_INFOROM: nvmlError_t = nvmlError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(14) }); pub const r#GPU_IS_LOST: nvmlError_t = nvmlError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(15) }); pub const r#RESET_REQUIRED: nvmlError_t = nvmlError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(16) }); pub const r#OPERATING_SYSTEM: nvmlError_t = nvmlError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(17) }); pub const r#LIB_RM_VERSION_MISMATCH: nvmlError_t = nvmlError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(18) }); pub const r#IN_USE: nvmlError_t = nvmlError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(19) }); pub const r#MEMORY: nvmlError_t = nvmlError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(20) }); pub const r#NO_DATA: nvmlError_t = nvmlError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(21) }); pub const r#VGPU_ECC_NOT_SUPPORTED: nvmlError_t = nvmlError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(22) }); pub const r#INSUFFICIENT_RESOURCES: nvmlError_t = nvmlError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(23) }); pub const r#FREQ_NOT_SUPPORTED: nvmlError_t = nvmlError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(24) }); pub const r#ARGUMENT_VERSION_MISMATCH: nvmlError_t = nvmlError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(25) }); pub const r#DEPRECATED: nvmlError_t = nvmlError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(26) }); pub const r#NOT_READY: nvmlError_t = nvmlError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(27) }); pub const r#GPU_NOT_FOUND: nvmlError_t = nvmlError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(28) }); pub const r#INVALID_STATE: nvmlError_t = nvmlError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(29) }); pub const r#RESET_TYPE_NOT_SUPPORTED: nvmlError_t = nvmlError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(30) }); pub const r#UNKNOWN: nvmlError_t = nvmlError_t(unsafe { ::core::num::NonZeroU32::new_unchecked(999) }); } #[repr(transparent)] #[derive(Debug, Hash, Copy, Clone, PartialEq, Eq)] pub struct nvmlError_t(pub ::core::num::NonZeroU32); pub trait nvmlReturn_tConsts { const SUCCESS: nvmlReturn_t = nvmlReturn_t::Ok(()); const ERROR_UNINITIALIZED: nvmlReturn_t = nvmlReturn_t::Err( nvmlError_t::r#UNINITIALIZED, ); const ERROR_INVALID_ARGUMENT: nvmlReturn_t = nvmlReturn_t::Err( nvmlError_t::r#INVALID_ARGUMENT, ); const ERROR_NOT_SUPPORTED: nvmlReturn_t = nvmlReturn_t::Err( nvmlError_t::r#NOT_SUPPORTED, ); const ERROR_NO_PERMISSION: nvmlReturn_t = nvmlReturn_t::Err( nvmlError_t::r#NO_PERMISSION, ); const ERROR_ALREADY_INITIALIZED: nvmlReturn_t = nvmlReturn_t::Err( nvmlError_t::r#ALREADY_INITIALIZED, ); const ERROR_NOT_FOUND: nvmlReturn_t = nvmlReturn_t::Err(nvmlError_t::r#NOT_FOUND); const ERROR_INSUFFICIENT_SIZE: nvmlReturn_t = nvmlReturn_t::Err( nvmlError_t::r#INSUFFICIENT_SIZE, ); const ERROR_INSUFFICIENT_POWER: nvmlReturn_t = nvmlReturn_t::Err( nvmlError_t::r#INSUFFICIENT_POWER, ); const ERROR_DRIVER_NOT_LOADED: nvmlReturn_t = nvmlReturn_t::Err( nvmlError_t::r#DRIVER_NOT_LOADED, ); const ERROR_TIMEOUT: nvmlReturn_t = nvmlReturn_t::Err(nvmlError_t::r#TIMEOUT); const ERROR_IRQ_ISSUE: nvmlReturn_t = nvmlReturn_t::Err(nvmlError_t::r#IRQ_ISSUE); const ERROR_LIBRARY_NOT_FOUND: nvmlReturn_t = nvmlReturn_t::Err( nvmlError_t::r#LIBRARY_NOT_FOUND, ); const ERROR_FUNCTION_NOT_FOUND: nvmlReturn_t = nvmlReturn_t::Err( nvmlError_t::r#FUNCTION_NOT_FOUND, ); const ERROR_CORRUPTED_INFOROM: nvmlReturn_t = nvmlReturn_t::Err( nvmlError_t::r#CORRUPTED_INFOROM, ); const ERROR_GPU_IS_LOST: nvmlReturn_t = nvmlReturn_t::Err( nvmlError_t::r#GPU_IS_LOST, ); const ERROR_RESET_REQUIRED: nvmlReturn_t = nvmlReturn_t::Err( nvmlError_t::r#RESET_REQUIRED, ); const ERROR_OPERATING_SYSTEM: nvmlReturn_t = nvmlReturn_t::Err( nvmlError_t::r#OPERATING_SYSTEM, ); const ERROR_LIB_RM_VERSION_MISMATCH: nvmlReturn_t = nvmlReturn_t::Err( nvmlError_t::r#LIB_RM_VERSION_MISMATCH, ); const ERROR_IN_USE: nvmlReturn_t = nvmlReturn_t::Err(nvmlError_t::r#IN_USE); const ERROR_MEMORY: nvmlReturn_t = nvmlReturn_t::Err(nvmlError_t::r#MEMORY); const ERROR_NO_DATA: nvmlReturn_t = nvmlReturn_t::Err(nvmlError_t::r#NO_DATA); const ERROR_VGPU_ECC_NOT_SUPPORTED: nvmlReturn_t = nvmlReturn_t::Err( nvmlError_t::r#VGPU_ECC_NOT_SUPPORTED, ); const ERROR_INSUFFICIENT_RESOURCES: nvmlReturn_t = nvmlReturn_t::Err( nvmlError_t::r#INSUFFICIENT_RESOURCES, ); const ERROR_FREQ_NOT_SUPPORTED: nvmlReturn_t = nvmlReturn_t::Err( nvmlError_t::r#FREQ_NOT_SUPPORTED, ); const ERROR_ARGUMENT_VERSION_MISMATCH: nvmlReturn_t = nvmlReturn_t::Err( nvmlError_t::r#ARGUMENT_VERSION_MISMATCH, ); const ERROR_DEPRECATED: nvmlReturn_t = nvmlReturn_t::Err(nvmlError_t::r#DEPRECATED); const ERROR_NOT_READY: nvmlReturn_t = nvmlReturn_t::Err(nvmlError_t::r#NOT_READY); const ERROR_GPU_NOT_FOUND: nvmlReturn_t = nvmlReturn_t::Err( nvmlError_t::r#GPU_NOT_FOUND, ); const ERROR_INVALID_STATE: nvmlReturn_t = nvmlReturn_t::Err( nvmlError_t::r#INVALID_STATE, ); const ERROR_RESET_TYPE_NOT_SUPPORTED: nvmlReturn_t = nvmlReturn_t::Err( nvmlError_t::r#RESET_TYPE_NOT_SUPPORTED, ); const ERROR_UNKNOWN: nvmlReturn_t = nvmlReturn_t::Err(nvmlError_t::r#UNKNOWN); } impl nvmlReturn_tConsts for nvmlReturn_t {} #[must_use] pub type nvmlReturn_t = ::core::result::Result<(), nvmlError_t>; const _: fn() = || { let _ = std::mem::transmute::; }; #[cfg(unix)] impl From for nvmlError_t { fn from(error: rocm_smi_sys::rsmi_error) -> Self { match error { rocm_smi_sys::rsmi_error::INVALID_ARGS => nvmlError_t::from(nvmlError_t::INVALID_ARGUMENT), rocm_smi_sys::rsmi_error::NOT_SUPPORTED => nvmlError_t::from(nvmlError_t::NOT_SUPPORTED), rocm_smi_sys::rsmi_error::PERMISSION => nvmlError_t::from(nvmlError_t::NO_PERMISSION), rocm_smi_sys::rsmi_error::INPUT_OUT_OF_BOUNDS => nvmlError_t::from(nvmlError_t::INVALID_ARGUMENT), rocm_smi_sys::rsmi_error::INIT_ERROR => nvmlError_t::from(nvmlError_t::UNINITIALIZED), rocm_smi_sys::rsmi_error::NOT_FOUND => nvmlError_t::from(nvmlError_t::GPU_NOT_FOUND), rocm_smi_sys::rsmi_error::INSUFFICIENT_SIZE => nvmlError_t::from(nvmlError_t::INSUFFICIENT_SIZE), rocm_smi_sys::rsmi_error::INTERRUPT => nvmlError_t::from(nvmlError_t::IRQ_ISSUE), rocm_smi_sys::rsmi_error::NO_DATA => nvmlError_t::from(nvmlError_t::NO_DATA), _ => nvmlError_t::from(nvmlError_t::UNKNOWN), } } } ================================================ FILE: dark_api/Cargo.toml ================================================ [package] name = "dark_api" version = "0.0.0" edition = "2021" [dependencies] cuda_types = { path = "../cuda_types" } format = { path = "../format" } uuid = "1.16" paste = "1.0" bit-vec = "0.8.0" cglue = "0.3.5" lz4-sys = "1.9" zstd-safe = { version = "7.2.4", features = ["std"] } ================================================ FILE: dark_api/src/fatbin.rs ================================================ // This file contains a higher-level interface for parsing fatbins use std::{borrow::Cow, ptr}; use cuda_types::dark_api::*; pub enum ParseError { NullPointer(&'static str), UnexpectedBinaryField { field_name: &'static str, observed: u32, expected: Vec, }, } impl ParseError { pub(crate) fn check_fields + Eq + Copy>( name: &'static str, observed: T, expected: [T; N], ) -> Result<(), Self> { if expected.contains(&observed) { Ok(()) } else { let observed = observed.into(); let expected = expected.into_iter().map(Into::into).collect(); Err(ParseError::UnexpectedBinaryField { field_name: name, expected, observed, }) } } } pub enum FatbinError { ParseFailure(ParseError), Lz4DecompressionFailure, ZstdDecompressionFailure(usize), } pub fn parse_fatbinc_wrapper(ptr: &*const T) -> Result<&FatbincWrapper, ParseError> { unsafe { ptr.cast::().as_ref() } .ok_or(ParseError::NullPointer("FatbincWrapper")) .and_then(|ptr| { ParseError::check_fields( "FATBINC_MAGIC", ptr.magic, [u32::from_ne_bytes(FatbincWrapper::MAGIC)], )?; ParseError::check_fields( "FATBINC_VERSION", ptr.version, [FatbincWrapper::VERSION_V1, FatbincWrapper::VERSION_V2], )?; Ok(ptr) }) } fn parse_fatbin_header(ptr: &*const T) -> Result<&FatbinHeader, ParseError> { unsafe { ptr.cast::().as_ref() } .ok_or(ParseError::NullPointer("FatbinHeader")) .and_then(|ptr| { ParseError::check_fields( "FATBIN_MAGIC", ptr.magic, [u32::from_ne_bytes(FatbinHeader::MAGIC)], )?; ParseError::check_fields("FATBIN_VERSION", ptr.version, [FatbinHeader::VERSION])?; Ok(ptr) }) } #[derive(Clone, Copy)] pub struct Fatbin<'a> { pub wrapper: &'a FatbincWrapper, } impl<'a> Fatbin<'a> { pub fn new(ptr: &'a *const T) -> Result { let wrapper: &FatbincWrapper = parse_fatbinc_wrapper(ptr).map_err(|e| FatbinError::ParseFailure(e))?; Ok(Fatbin { wrapper }) } pub fn get_submodules(self) -> Result, FatbinError> { match self.wrapper.version { FatbincWrapper::VERSION_V2 => Ok(FatbinIter::V2(FatbinSubmoduleIterator { fatbins: self.wrapper.filename_or_fatbins as *const *const std::ffi::c_void, _phantom: std::marker::PhantomData, })), FatbincWrapper::VERSION_V1 => { let header = parse_fatbin_header(&self.wrapper.data).map_err(FatbinError::ParseFailure)?; Ok(FatbinIter::V1(Some(FatbinSubmodule::new(header)))) } version => Err(FatbinError::ParseFailure( ParseError::UnexpectedBinaryField { field_name: "FATBINC_VERSION", observed: version, expected: [FatbincWrapper::VERSION_V1, FatbincWrapper::VERSION_V2].into(), }, )), } } } unsafe impl Send for Fatbin<'static> {} unsafe impl Sync for Fatbin<'static> {} #[derive(Clone, Copy)] pub struct FatbinSubmodule<'a> { pub header: &'a FatbinHeader, // TODO: maybe make private } impl<'a> FatbinSubmodule<'a> { pub fn new(header: &'a FatbinHeader) -> Self { FatbinSubmodule { header } } pub fn get_files(&self) -> FatbinFileIterator<'a> { unsafe { FatbinFileIterator::new(self.header) } } } pub enum FatbinIter<'a> { V1(Option>), V2(FatbinSubmoduleIterator<'a>), } impl<'a> FatbinIter<'a> { pub fn multi_module(&self) -> bool { matches!(self, FatbinIter::V2(_)) } pub fn next(&mut self) -> Option, ParseError>> { match self { FatbinIter::V1(opt) => Ok(opt.take()).transpose(), FatbinIter::V2(iter) => unsafe { iter.next() }, } } } pub struct FatbinSubmoduleIterator<'a> { fatbins: *const *const std::ffi::c_void, _phantom: std::marker::PhantomData<&'a FatbinHeader>, } impl<'a> FatbinSubmoduleIterator<'a> { pub unsafe fn next(&mut self) -> Option, ParseError>> { if *self.fatbins != ptr::null() { let header = *self.fatbins as *const FatbinHeader; self.fatbins = self.fatbins.add(1); Some( header .as_ref() .ok_or(ParseError::NullPointer("FatbinSubmoduleIterator")) .map(FatbinSubmodule::new), ) } else { None } } } #[derive(Clone, Copy)] pub struct FatbinFile<'a> { pub header: &'a FatbinFileHeader, } impl<'a> FatbinFile<'a> { pub fn new(header: &'a FatbinFileHeader) -> Self { Self { header } } pub fn kind(&self) -> &'static str { match self.header.kind { FatbinFileHeader::HEADER_KIND_PTX => "ptx", FatbinFileHeader::HEADER_KIND_ELF => "elf", _ => "bin", } } pub unsafe fn get_non_compressed_payload(self) -> &'a [u8] { let start = std::ptr::from_ref(self.header) .cast::() .add(self.header.header_size as usize); std::slice::from_raw_parts(start, self.header.payload_size as usize) } pub unsafe fn get_compressed_payload(self) -> &'a [u8] { let start = std::ptr::from_ref(self.header) .cast::() .add(self.header.header_size as usize); std::slice::from_raw_parts(start, self.header.compressed_size as usize) } pub unsafe fn get_or_decompress_content(self) -> Result, FatbinError> { let mut payload = if self .header .flags .contains(FatbinFileHeaderFlags::CompressedLz4) { Cow::Owned(unsafe { decompress_lz4(self) }?) } else if self .header .flags .contains(FatbinFileHeaderFlags::CompressedZstd) { Cow::Owned(unsafe { decompress_zstd(self) }?) } else { Cow::Borrowed(unsafe { self.get_non_compressed_payload() }) }; // Remove trailing zeros if self.header.kind == FatbinFileHeader::HEADER_KIND_PTX { match payload { Cow::Borrowed(ref mut slice) => { while slice.last() == Some(&0) { *slice = &slice[..slice.len() - 1]; } } Cow::Owned(ref mut vec) => { while vec.last() == Some(&0) { vec.pop(); } } } } Ok(payload) } } pub struct FatbinFileIterator<'a> { file_buffer: &'a [u8], } impl<'a> FatbinFileIterator<'a> { pub unsafe fn new(header: &'a FatbinHeader) -> Self { let start = std::ptr::from_ref(header) .cast::() .add(header.header_size as usize); let file_buffer = std::slice::from_raw_parts(start, header.files_size as usize); Self { file_buffer } } pub unsafe fn next(&mut self) -> Option, ParseError>> { if self.file_buffer.len() < std::mem::size_of::() { return None; } let this = &*self.file_buffer.as_ptr().cast::(); let next_element = self .file_buffer .split_at_checked( this.header_size as usize + u32::max(this.payload_size, this.compressed_size) as usize, ) .map(|(_, next)| next); self.file_buffer = next_element.unwrap_or(&[]); Some( ParseError::check_fields( "FATBIN_FILE_HEADER_VERSION_CURRENT", this.version, [FatbinFileHeader::HEADER_VERSION_CURRENT], ) .map(|_| FatbinFile::new(this)), ) } } const MAX_MODULE_DECOMPRESSION_BOUND: usize = 64 * 1024 * 1024; pub unsafe fn decompress_lz4(file: FatbinFile) -> Result, FatbinError> { let decompressed_size = usize::max(1024, file.header.uncompressed_payload as usize); let mut decompressed_vec = vec![0u8; decompressed_size]; loop { match lz4_sys::LZ4_decompress_safe( file.get_compressed_payload().as_ptr() as *const _, decompressed_vec.as_mut_ptr() as *mut _, file.header.compressed_size as _, decompressed_vec.len() as _, ) { error if error < 0 => { let new_size = decompressed_vec.len() * 2; if new_size > MAX_MODULE_DECOMPRESSION_BOUND { return Err(FatbinError::Lz4DecompressionFailure); } decompressed_vec.resize(decompressed_vec.len() * 2, 0); } real_decompressed_size => { decompressed_vec.truncate(real_decompressed_size as usize); return Ok(decompressed_vec); } } } } pub unsafe fn decompress_zstd(file: FatbinFile) -> Result, FatbinError> { let mut result = Vec::with_capacity(file.header.uncompressed_payload as usize); let payload = file.get_compressed_payload(); match zstd_safe::decompress(&mut result, payload) { Ok(actual_size) => { result.truncate(actual_size); Ok(result) } Err(err) => Err(FatbinError::ZstdDecompressionFailure(err)), } } ================================================ FILE: dark_api/src/lib.rs ================================================ use std::ffi::c_void; use cuda_types::cuda::CUuuid; pub mod fatbin; macro_rules! dark_api_init { (SIZE_OF, $table_len:literal, $type_:ty) => { (std::mem::size_of::() * $table_len) as *const std::ffi::c_void }; (NULL, $table_len:literal, $type_:ty) => { std::ptr::null() }; ($fn_:ident, $table_len:literal, $type_:ty) => { <$type_>::$fn_ as *const std::ffi::c_void }; } macro_rules! dark_api_fn { (SIZE_OF) => { }; (NULL) => { }; ($fn_:ident ( $($arg_id:ident: $arg_type:ty),* ) -> $ret_type:ty) => { unsafe extern "system" fn $fn_( $($arg_id : $arg_type,)* ) -> $ret_type; } } macro_rules! dark_api_entry { ($idx:literal, SIZE_OF) => { }; ($idx:literal, NULL) => { }; ($idx:literal, $fn_:ident ( $($arg_id:ident: $arg_type:ty),* ) -> $ret_type:ty) => { #[allow(non_snake_case)] pub unsafe fn $fn_( &self, $($arg_id : $arg_type,)* ) -> $ret_type { let ptr = self.ptr as *const *const std::ffi::c_void; let ptr = ptr.add($idx); let fn_ = std::mem::transmute::<_, unsafe extern "system" fn( $($arg_type,)* ) -> $ret_type >(*ptr); (fn_)( $($arg_id,)* ) } } } macro_rules! dark_api_format_args { ($writer:ident; $arg_idx:ident; $first_arg:ident $(, $arg_id:ident)*) => { $writer.write_all(concat!(stringify!($first_arg), ": ").as_bytes())?; format::CudaDisplay::write(& $first_arg, "", $arg_idx, $writer)?; $( $arg_idx += 1; $writer.write_all(concat!(", ", stringify!($arg_id), ": ").as_bytes())?; format::CudaDisplay::write(& $arg_id, "", $arg_idx, $writer)?; )* }; ($writer:ident; $arg_idx:ident; ) => { }; } macro_rules! dark_api_is_fn { (SIZE_OF) => { false }; (NULL) => { false }; ($fn_:ident) => { true }; } macro_rules! dark_api_format_fn { (SIZE_OF) => { }; (NULL) => { }; (#[noformat] $fn_:ident ( $($arg_id:ident: $arg_type:ty),* ) -> $ret_type:ty) => { }; ($fn_:ident ( $($arg_id:ident: $arg_type:ty),* ) -> $ret_type:ty) => { pub fn $fn_ ( writer: &mut (impl std::io::Write + ?Sized), $($arg_id: $arg_type,)* ) -> std::io::Result<()> { #[allow(unused)] let mut arg_idx = 0usize; writer.write_all(b"(")?; dark_api_format_args!(writer; arg_idx; $($arg_id),*); writer.write_all(b")") } } } macro_rules! dark_api { ( $mod_name: ident; $( $guid:expr => $name:ident [$len:literal] { $( $(#[$attr:ident])? [$index:literal] = $fn_:ident $( ( $($arg_id:ident : $arg_type:ty),* ) -> $ret_type:ty )? ),* } ),+ ) => { pub mod $mod_name { #[allow(non_snake_case)] pub struct CudaDarkApiGlobalTable { $(pub $name: [*const std::ffi::c_void; $len],)+ } impl CudaDarkApiGlobalTable { $(const $name: cuda_types::cuda::CUuuid = cuda_types::cuda::CUuuid { bytes: *uuid::uuid!($guid).as_bytes() };)+ } unsafe impl Sync for CudaDarkApiGlobalTable {} impl CudaDarkApiGlobalTable { pub const fn new() -> Self { let mut result = Self { $( $name: [std::ptr::null(); $len], )+ }; $( $( result.$name[$index] = dark_api_init!($fn_, $len, T); )* )+ result } pub fn get(&self, key: &cuda_types::cuda::CUuuid) -> Option> { match key { $( &Self::$name => { let fns = &self.$name[..]; let mut valid_fns = bit_vec::BitVec::from_elem($len, false); $( valid_fns.set($index, dark_api_is_fn!($fn_) ); )* Some(crate::DarkApiTable { fns, valid_fns }) } )+ _ => None } } } pub trait CudaDarkApi { $($( dark_api_fn!($fn_ $( ( $($arg_id: $arg_type),* ) -> $ret_type )?); )*)+ } pub fn guid_to_name(guid: &cuda_types::cuda::CUuuid, index: usize) -> Option<(&'static str, Option<&'static str>)> { let guid = uuid::Uuid::from_bytes(guid.bytes); $( if guid == uuid::uuid!($guid) { let guid = stringify!($name); $( if index == $index { return Some((guid, Some(stringify!($fn_)))); } )* return Some((guid, None)); } )+ None } $( paste::paste! { pub struct [<$name:camel>] { #[allow(dead_code)] ptr: *const std::ffi::c_void } impl [<$name:camel>] { pub const GUID: cuda_types::cuda::CUuuid = CudaDarkApiGlobalTable::$name; pub unsafe fn new(ptr: *const std::ffi::c_void) -> Self { Self { ptr } } $( dark_api_entry!($index, $fn_ $( ( $($arg_id: $arg_type),* ) -> $ret_type )?); )* } } )+ pub mod format { $($( dark_api_format_fn!($(#[$attr])? $fn_ $( ( $($arg_id: $arg_type),* ) -> $ret_type )? ); )*)+ } } }; } pub struct DarkApiTable<'a> { fns: &'a [*const std::ffi::c_void], valid_fns: bit_vec::BitVec, } impl<'a> DarkApiTable<'a> { pub fn len(&self) -> usize { self.fns.len() } pub fn get_fn(&self, idx: usize) -> Option<*const std::ffi::c_void> { if self.valid_fns.get(idx).unwrap_or(false) { Some(self.fns[idx]) } else { None } } pub fn start(&self) -> *const std::ffi::c_void { self.fns.as_ptr().cast() } } dark_api! { cuda; "{6BD5FB6C-5BF4-E74A-8987-D93912FD9DF9}" => CUDART_INTERFACE[13] { [0] = SIZE_OF, [1] = get_module_from_cubin( module: *mut cuda_types::cuda::CUmodule, fatbinc_wrapper: *const cuda_types::dark_api::FatbincWrapper ) -> cuda_types::cuda::CUresult, [2] = cudart_interface_fn2( pctx: *mut cuda_types::cuda::CUcontext, dev: cuda_types::cuda::CUdevice ) -> cuda_types::cuda::CUresult, [6] = get_module_from_cubin_ext1( result: *mut cuda_types::cuda::CUmodule, fatbinc_wrapper: *const cuda_types::dark_api::FatbincWrapper, arg3: *mut std::ffi::c_void, arg4: *mut std::ffi::c_void, arg5: u32 ) -> cuda_types::cuda::CUresult, [7] = cudart_interface_fn7(arg1: usize) -> (), [8] = get_module_from_cubin_ext2( fatbin_header: *const cuda_types::dark_api::FatbinHeader, result: *mut cuda_types::cuda::CUmodule, arg3: *mut std::ffi::c_void, arg4: *mut std::ffi::c_void, arg5: u32 ) -> cuda_types::cuda::CUresult, // In original CUDA it loads PTX compiler, libnvvm, tileir [12] = load_compilers() -> cuda_types::cuda::CUresult }, "{42D85A81-23F6-CB47-8298-F6E78A3AECDC}" => TOOLS_TLS[4] { [0] = SIZE_OF }, "{A094798C-2E74-2E74-93F2-0800200C0A66}" => TOOLS_RUNTIME_CALLBACK_HOOKS[7] { [0] = SIZE_OF, [2] = get_unknown_buffer1(ptr: *mut *mut std::ffi::c_void, size: *mut usize) -> (), [6] = get_unknown_buffer2(ptr: *mut *mut std::ffi::c_void, size: *mut usize) -> () }, "{C693336E-1121-DF11-A8C3-68F355D89593}" => CONTEXT_LOCAL_STORAGE_INTERFACE_V0301[4] { [0] = context_local_storage_put( context: cuda_types::cuda::CUcontext, key: *mut std::ffi::c_void, value: *mut std::ffi::c_void, // clsContextDestroyCallback, have to be called on cuDevicePrimaryCtxReset dtor_cb: Option ) -> cuda_types::cuda::CUresult, [1] = context_local_storage_delete( context: cuda_types::cuda::CUcontext, key: *mut std::ffi::c_void ) -> cuda_types::cuda::CUresult, [2] = context_local_storage_get( value: *mut *mut std::ffi::c_void, cu_ctx: cuda_types::cuda::CUcontext, key: *mut std::ffi::c_void ) -> cuda_types::cuda::CUresult }, "{0CA50B8C-1004-929A-89A7-D0DF10E77286}" => CTX_CREATE_BYPASS[2] { [0] = SIZE_OF, [1] = ctx_create_v2_bypass( pctx: *mut cuda_types::cuda::CUcontext, flags: ::std::os::raw::c_uint, dev: cuda_types::cuda::CUdevice ) -> cuda_types::cuda::CUresult }, "{195BCBF4-D67D-024A-ACC5-1D29CEA631AE}" => HEAP_ACCESS[3] { [0] = SIZE_OF, [1] = heap_alloc( heap_alloc_record_ptr: *mut *const std::ffi::c_void, // HeapAllocRecord arg2: usize, arg3: usize ) -> cuda_types::cuda::CUresult, [2] = heap_free( heap_alloc_record_ptr: *const std::ffi::c_void, // HeapAllocRecord arg2: *mut usize ) -> cuda_types::cuda::CUresult }, "{B10541E1-F7C7-C74A-9F64-F223BE99F1E2}" => DEVICE_EXTENDED_RT[26] { [0] = SIZE_OF, [5] = device_get_attribute_ext( dev: cuda_types::cuda::CUdevice, attribute: std::ffi::c_uint, unknown: std::ffi::c_int, result: *mut [usize; 2] ) -> cuda_types::cuda::CUresult, // I don't know is this function return, but on my GTX 1060 it returns 0 [13] = device_get_something( result: *mut std::ffi::c_uchar, dev: cuda_types::cuda::CUdevice ) -> cuda_types::cuda::CUresult }, "{D4082055-BDE6-704B-8D34-BA123C66E1F2}" => INTEGRITY_CHECK[3] { [0] = SIZE_OF, [1] = integrity_check( version: u32, unix_seconds: u64, result: *mut [u64;2] ) -> cuda_types::cuda::CUresult }, // This functions check for some bits that are never observably set "{263E8860-7CD2-6143-92F6-BBD5006DFA7E}" => CONTEXT_CHECKS[4] { [0] = SIZE_OF, [2] = context_check( ctx_in: cuda_types::cuda::CUcontext, result1: *mut u32, // seems to be always 0 result2: *mut *const std::ffi::c_void ) -> cuda_types::cuda::CUresult, [3] = check_fn3() -> u32 // seeems to always return 0 }, // On Windows, applications linking to CUDART rely on loading // `nvcudart_hybrid64.dll` and getting `__cudaGetProcAddress` "{DD9E98A4-F410-4844-99B0-E2AEB7B432B5}" => HYBRID_CUDART[3] { [0] = SIZE_OF, [1] = hybrid_runtime_load_get_proc_address( name: *const std::ffi::c_char, fn_ptr: *mut *const std::ffi::c_void, token: *mut usize ) -> cuda_types::cuda::CUresult, [2] = hybrid_runtime_free( token: usize ) -> cuda_types::cuda::CUresult } } // Purely for internal use by ZLUDA trace dark_api! { zluda_trace; "{0B7A5827-AF98-46AB-A951-22D19BDF5C08}" => ZLUDA_TRACE_INTERNAL[1] { #[noformat] [0] = logged_call( fn_name: cglue::slice::CSliceRef<'static, u8>, args: crate::FnFfiRef, fn_: crate::FnFfiRef, internal_error: usize, format_status: extern "C" fn(usize) -> crate::ByteVecFfi ) -> usize } } #[repr(C)] pub struct ByteVecFfi { ptr: *mut u8, len: usize, capacity: usize, } impl ByteVecFfi { pub fn new(mut v: Vec) -> Self { let (ptr, len, capacity) = (v.as_mut_ptr(), v.len(), v.capacity()); std::mem::forget(v); Self { ptr, len, capacity } } pub fn to_vec(self) -> Vec { let vec = unsafe { Vec::from_raw_parts(self.ptr, self.len, self.capacity) }; std::mem::forget(self); vec } } impl Drop for ByteVecFfi { fn drop(&mut self) { // SAFETY: We are dropping the Vec that we created in `from` // and we know that the pointer is valid. unsafe { let _ = Vec::from_raw_parts(self.ptr, self.len, self.capacity); } } } #[cglue::cglue_trait] pub trait FnFfi { type Output; fn call(&self) -> Self::Output; } // We use this wrapper instead of implementing `FnFfi` for all T that implement `Fn() -> Output` // because cglue machinery already provided blanket implementation of `FnFfi` for its own needs // `cglue_trait_ext` does not work with `Fn` traits because they are special #[repr(transparent)] pub struct FnFfiWrapper Output>(pub T); impl Output> FnFfi for FnFfiWrapper { type Output = Output; fn call(&self) -> Output { (self.0)() } } pub fn integrity_check( version: u32, unix_seconds: u64, driver_version: u32, current_process: u32, current_thread: u32, integrity_check_table: *const c_void, cudart_table: *const c_void, fn_address: *const c_void, devices: u32, get_device: impl FnMut(u32) -> DeviceHashinfo, ) -> [u64; 2] { match version % 10 { 0 => return [0x3341181C03CB675C, 0x8ED383AA1F4CD1E8], 1 => return [0x1841181C03CB675C, 0x8ED383AA1F4CD1E8], _ => {} } // There's first computation pass, but it does not use any input and effectively computes this let pass1_result = [ 0x14u8, 0x6A, 0xDD, 0xAE, 0x53, 0xA9, 0xA7, 0x52, 0xAA, 0x08, 0x41, 0x36, 0x0B, 0xF5, 0x5A, 0x9F, ]; let mut result = [0u8; 66]; pass2(&mut result, &pass1_result); let pass3_input = Pass3Input { driver_version, version, current_process, current_thread, cudart_table, integrity_check_table, fn_address, unix_seconds, }; pass3(&mut result, &pass3_input); pass4(&mut result, devices, get_device); let pass5_1 = pass5(&mut result); zero_result(&mut result); pass6(&mut result, &pass1_result); pass7(&mut result, &pass5_1); pass5(&mut result) } fn pass7(accumulator: &mut [u8; 66], pass5_1: &[u64; 2]) { hash_pass(accumulator, pass5_1, 0); } fn pass6(accumulator: &mut [u8; 66], pass1_result: &[u8; 16]) { hash_pass(accumulator, pass1_result, 0x5c); } fn zero_result(result: &mut [u8; 66]) { for i in 0..16 { result[i] = 0; } for i in 48..66 { result[i] = 0; } } fn pass5(result: &mut [u8; 66]) -> [u64; 2] { let temp = 16u8.wrapping_sub(result[64]); for _ in 0..temp { integrity_check_single_pass(result, temp); } let mut temp_ptr = unsafe { result.as_mut_ptr().add(0x30) }; loop { let temp = unsafe { *temp_ptr }; temp_ptr = unsafe { temp_ptr.add(1) }; integrity_check_single_pass(result, temp); if temp_ptr == unsafe { result.as_mut_ptr().add(0x40) } { break; } } [ u64::from_ne_bytes(result[0..8].try_into().unwrap()), u64::from_ne_bytes(result[8..16].try_into().unwrap()), ] } #[repr(C)] struct Pass3Input { driver_version: u32, version: u32, current_process: u32, current_thread: u32, cudart_table: *const c_void, integrity_check_table: *const c_void, fn_address: *const c_void, unix_seconds: u64, } #[repr(C)] #[derive(Clone, Copy)] pub struct DeviceHashinfo { pub guid: CUuuid, pub pci_domain: i32, pub pci_bus: i32, pub pci_device: i32, } fn pass2(accumulator: &mut [u8; 66], pass1_result: &[u8; 16]) { hash_pass(accumulator, pass1_result, 0x36) } fn pass3(accumulator: &mut [u8; 66], mixin: &Pass3Input) { hash_pass(accumulator, mixin, 0) } fn pass4( accumulator: &mut [u8; 66], devices: u32, mut get_device: impl FnMut(u32) -> DeviceHashinfo, ) { for dev in 0..devices { hash_pass(accumulator, &(get_device)(dev), 0) } } fn hash_pass(accumulator: &mut [u8; 66], mixin: &T, xor_mask: u8) { for i in 0..std::mem::size_of_val(mixin) { integrity_check_single_pass( accumulator, unsafe { *std::ptr::from_ref(mixin).cast::().add(i) } ^ xor_mask, ); } } fn integrity_check_single_pass(arg1: &mut [u8; 66], arg2: u8) { const MIXING_TABLE: [u8; 256] = [ 0x29, 0x2E, 0x43, 0xC9, 0xA2, 0xD8, 0x7C, 0x01, 0x3D, 0x36, 0x54, 0xA1, 0xEC, 0xF0, 0x06, 0x13, 0x62, 0xA7, 0x05, 0xF3, 0xC0, 0xC7, 0x73, 0x8C, 0x98, 0x93, 0x2B, 0xD9, 0xBC, 0x4C, 0x82, 0xCA, 0x1E, 0x9B, 0x57, 0x3C, 0xFD, 0xD4, 0xE0, 0x16, 0x67, 0x42, 0x6F, 0x18, 0x8A, 0x17, 0xE5, 0x12, 0xBE, 0x4E, 0xC4, 0xD6, 0xDA, 0x9E, 0xDE, 0x49, 0xA0, 0xFB, 0xF5, 0x8E, 0xBB, 0x2F, 0xEE, 0x7A, 0xA9, 0x68, 0x79, 0x91, 0x15, 0xB2, 0x07, 0x3F, 0x94, 0xC2, 0x10, 0x89, 0x0B, 0x22, 0x5F, 0x21, 0x80, 0x7F, 0x5D, 0x9A, 0x5A, 0x90, 0x32, 0x27, 0x35, 0x3E, 0xCC, 0xE7, 0xBF, 0xF7, 0x97, 0x03, 0xFF, 0x19, 0x30, 0xB3, 0x48, 0xA5, 0xB5, 0xD1, 0xD7, 0x5E, 0x92, 0x2A, 0xAC, 0x56, 0xAA, 0xC6, 0x4F, 0xB8, 0x38, 0xD2, 0x96, 0xA4, 0x7D, 0xB6, 0x76, 0xFC, 0x6B, 0xE2, 0x9C, 0x74, 0x04, 0xF1, 0x45, 0x9D, 0x70, 0x59, 0x64, 0x71, 0x87, 0x20, 0x86, 0x5B, 0xCF, 0x65, 0xE6, 0x2D, 0xA8, 0x02, 0x1B, 0x60, 0x25, 0xAD, 0xAE, 0xB0, 0xB9, 0xF6, 0x1C, 0x46, 0x61, 0x69, 0x34, 0x40, 0x7E, 0x0F, 0x55, 0x47, 0xA3, 0x23, 0xDD, 0x51, 0xAF, 0x3A, 0xC3, 0x5C, 0xF9, 0xCE, 0xBA, 0xC5, 0xEA, 0x26, 0x2C, 0x53, 0x0D, 0x6E, 0x85, 0x28, 0x84, 0x09, 0xD3, 0xDF, 0xCD, 0xF4, 0x41, 0x81, 0x4D, 0x52, 0x6A, 0xDC, 0x37, 0xC8, 0x6C, 0xC1, 0xAB, 0xFA, 0x24, 0xE1, 0x7B, 0x08, 0x0C, 0xBD, 0xB1, 0x4A, 0x78, 0x88, 0x95, 0x8B, 0xE3, 0x63, 0xE8, 0x6D, 0xE9, 0xCB, 0xD5, 0xFE, 0x3B, 0x00, 0x1D, 0x39, 0xF2, 0xEF, 0xB7, 0x0E, 0x66, 0x58, 0xD0, 0xE4, 0xA6, 0x77, 0x72, 0xF8, 0xEB, 0x75, 0x4B, 0x0A, 0x31, 0x44, 0x50, 0xB4, 0x8F, 0xED, 0x1F, 0x1A, 0xDB, 0x99, 0x8D, 0x33, 0x9F, 0x11, 0x83, 0x14, ]; let temp1 = arg1[0x40]; arg1[temp1 as usize + 0x10] = arg2; let temp2 = temp1 as usize; let temp3 = (temp1 + 1) & 0xf; arg1[temp1 as usize + 0x20] = arg1[temp2] ^ arg2; let temp4 = MIXING_TABLE[(arg2 ^ arg1[0x41]) as usize]; let temp1 = arg1[temp2 + 0x30]; arg1[temp2 + 0x30] = temp4 ^ temp1; arg1[0x41] = temp4 ^ temp1; arg1[0x40] = temp3; if temp3 != 0 { return; } let mut temp1 = 0x29; let mut temp5 = 0x0; unsafe { loop { temp1 = temp1 ^ arg1[0]; arg1[0] = temp1; let mut temp6 = arg1.as_mut_ptr().add(1); loop { let temp7 = temp6.add(1); temp1 = *temp6 ^ MIXING_TABLE[temp1 as usize]; *temp6 = temp1; temp6 = temp7; if temp7 == arg1.as_mut_ptr().add(0x30) { break; } } temp1 = temp1.wrapping_add(temp5); temp5 = temp5.wrapping_add(0x01); if temp5 == 0x12 { break; } temp1 = MIXING_TABLE[temp1 as usize]; } } } #[cfg(test)] mod tests { use std::mem; #[test] fn integrity_check_single_pass() { let mut input = [ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0xc0, 0x9b, 0xf7, 0xff, 0x7f, 0x00, 0x00, 0xa3, 0x61, 0xe4, 0x42, 0xf6, 0x67, 0x94, 0xff, 0x18, 0xc0, 0x9b, 0xf7, 0xff, 0x7f, 0x00, 0x00, 0xa4, 0x57, 0x72, 0xf7, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ]; super::integrity_check_single_pass(&mut input, 34); let expected = [ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0xc0, 0x9b, 0xf7, 0xff, 0x7f, 0x00, 0x00, 0xa3, 0x61, 0xe4, 0x42, 0xf6, 0x67, 0x94, 0xff, 0x22, 0xc0, 0x9b, 0xf7, 0xff, 0x7f, 0x00, 0x00, 0xa4, 0x57, 0x72, 0xf7, 0xff, 0x7f, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x57, ]; assert_eq!(input, expected); } #[test] fn integrity_check_pass2() { let pass1_result = [ 0x14u8, 0x6A, 0xDD, 0xAE, 0x53, 0xA9, 0xA7, 0x52, 0xAA, 0x08, 0x41, 0x36, 0x0B, 0xF5, 0x5A, 0x9F, ]; let mut result = [0u8; 66]; super::pass2(&mut result, &pass1_result); let expected = [ 0x8b, 0x21, 0x9a, 0x49, 0xe8, 0x6d, 0x1a, 0xee, 0xf2, 0x37, 0xf9, 0xb5, 0x4a, 0x8c, 0x3c, 0x75, 0xc7, 0x1e, 0xee, 0x21, 0xcf, 0x29, 0x8a, 0xe5, 0x13, 0x83, 0xf4, 0xec, 0x33, 0x04, 0xe2, 0xfd, 0xb0, 0x2f, 0x09, 0x01, 0x4f, 0xf7, 0x68, 0x6d, 0x69, 0x46, 0x43, 0x7e, 0xb6, 0x2b, 0x21, 0xed, 0x57, 0xa1, 0x10, 0x86, 0x0e, 0x60, 0x44, 0x1e, 0x70, 0x5f, 0x67, 0xd1, 0xeb, 0x67, 0xa1, 0x3d, 0x00, 0x3d, ]; assert_eq!(result, expected); } #[test] fn integrity_check_pass3() { let mut result = [ 0x8b, 0x21, 0x9a, 0x49, 0xe8, 0x6d, 0x1a, 0xee, 0xf2, 0x37, 0xf9, 0xb5, 0x4a, 0x8c, 0x3c, 0x75, 0xc7, 0x1e, 0xee, 0x21, 0xcf, 0x29, 0x8a, 0xe5, 0x13, 0x83, 0xf4, 0xec, 0x33, 0x04, 0xe2, 0xfd, 0xb0, 0x2f, 0x09, 0x01, 0x4f, 0xf7, 0x68, 0x6d, 0x69, 0x46, 0x43, 0x7e, 0xb6, 0x2b, 0x21, 0xed, 0x57, 0xa1, 0x10, 0x86, 0x0e, 0x60, 0x44, 0x1e, 0x70, 0x5f, 0x67, 0xd1, 0xeb, 0x67, 0xa1, 0x3d, 0x00, 0x3d, ]; let input = super::Pass3Input { driver_version: 0x2f30, version: 12082, current_process: 0x002fa423, current_thread: 0xf79c1000, cudart_table: 0x00007ffff6958240 as *const _, integrity_check_table: 0x00007ffff6958220 as *const _, fn_address: 0x00007ffff2aaf4a0 as *const _, unix_seconds: 0x682b9cee, }; super::pass3(&mut result, &input); let expected = [ 0x0a, 0xfd, 0xab, 0xc9, 0xff, 0x9b, 0xa0, 0xbe, 0x4d, 0x30, 0x32, 0x82, 0x74, 0x4f, 0xa7, 0x48, 0x9d, 0x23, 0x82, 0xa3, 0x87, 0xfa, 0x6c, 0xdb, 0x92, 0x49, 0xd9, 0xb5, 0x4b, 0x2b, 0x5e, 0x51, 0x6e, 0xf7, 0xf9, 0x4d, 0x28, 0x8a, 0x64, 0x06, 0x19, 0xb3, 0xe6, 0xbe, 0xa4, 0xec, 0x7e, 0x54, 0x64, 0x28, 0xd9, 0xe1, 0xd4, 0x34, 0xc0, 0xa9, 0x49, 0x88, 0xc9, 0x61, 0x58, 0xdd, 0x66, 0x74, 0x00, 0x74, ]; assert_eq!(result, expected); } #[test] fn integrity_check_pass4() { let mut result = [ 0x84, 0xfd, 0x93, 0x10, 0xc6, 0xdb, 0xb3, 0xbc, 0x49, 0xc2, 0x25, 0xe7, 0xda, 0x6e, 0x22, 0x6f, 0x9b, 0xbd, 0x81, 0x59, 0xc3, 0x01, 0x9a, 0x7a, 0x26, 0x34, 0x39, 0x0f, 0x2a, 0x56, 0x13, 0xb1, 0xf6, 0xbc, 0x7f, 0xa1, 0x8f, 0x04, 0xa5, 0x4d, 0x0d, 0x78, 0xab, 0x20, 0xf8, 0x23, 0x20, 0xa5, 0x3f, 0x67, 0x36, 0xe2, 0xde, 0x8a, 0xe5, 0xdf, 0xe1, 0xf2, 0x03, 0x94, 0xad, 0xdc, 0x9a, 0xda, 0x00, 0xda, ]; super::pass4(&mut result, 1, |_| super::DeviceHashinfo { guid: super::CUuuid { bytes: unsafe { std::mem::transmute([0x8a2bfe9au32, 0x382d25ac, 0xc5ae37ea, 0x5f32716d]) }, }, pci_domain: 0, pci_bus: 2, pci_device: 0, }); let expected = [ 0x1f, 0xd8, 0x25, 0xd2, 0xdf, 0xfa, 0x64, 0xc7, 0xb6, 0x1a, 0xaf, 0x22, 0xb8, 0x79, 0xfb, 0x96, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x9d, 0x46, 0xd2, 0x1f, 0xd8, 0x25, 0xd2, 0xdd, 0xfa, 0x64, 0xc7, 0xb6, 0x1a, 0xaf, 0x22, 0xe6, 0x17, 0xbd, 0x3a, 0xd7, 0xdd, 0x5f, 0x82, 0x8c, 0x87, 0xce, 0x86, 0x66, 0xaf, 0xa0, 0x50, 0x7a, 0x7d, 0xbb, 0xbc, 0x0c, 0x50, ]; assert_eq!(result, expected); } #[test] fn integrity_check_pass5() { let mut result = [ 0x3e, 0x4b, 0xf2, 0x95, 0x71, 0xf5, 0x6b, 0x51, 0x07, 0xbf, 0x4b, 0xf1, 0x04, 0x0e, 0x8e, 0x0b, 0x5f, 0x4d, 0x30, 0x0c, 0x0f, 0x0c, 0xae, 0xfb, 0x48, 0xaf, 0x23, 0xb5, 0xea, 0x4c, 0xc2, 0xdb, 0xd7, 0xdf, 0x88, 0x74, 0x39, 0x58, 0x16, 0x3a, 0x1f, 0x7c, 0x9b, 0x20, 0x7e, 0x7e, 0x94, 0xc8, 0x8b, 0xc6, 0xb2, 0x38, 0x0d, 0x07, 0x7d, 0xbd, 0x90, 0xd5, 0x39, 0x63, 0xeb, 0x1d, 0x4f, 0x40, 0x00, 0x40, ]; let output = super::pass5(&mut result); let expected_result = [ 0x00, 0x23, 0x53, 0x06, 0x5e, 0x96, 0xf6, 0x9c, 0x61, 0xaa, 0x96, 0x2d, 0x2e, 0xcd, 0xa8, 0x58, 0xe9, 0xca, 0xc0, 0x2e, 0x35, 0xed, 0x5f, 0xca, 0xe1, 0x0e, 0xcd, 0x1f, 0xd0, 0x8e, 0x8b, 0x9c, 0x29, 0x4d, 0x1c, 0x94, 0x6b, 0xf7, 0x10, 0xb0, 0x07, 0x08, 0x91, 0xd6, 0x14, 0x06, 0xc0, 0xec, 0xe1, 0x9c, 0x8e, 0x33, 0xd4, 0xe9, 0x43, 0x5c, 0x86, 0x0c, 0x72, 0x4d, 0x27, 0x98, 0x91, 0x7f, 0x00, 0x7f, ]; assert_eq!(result, expected_result); let output = unsafe { mem::transmute::<_, [u8; 16]>(output) }; let expected = [ 0x00, 0x23, 0x53, 0x06, 0x5e, 0x96, 0xf6, 0x9c, 0x61, 0xaa, 0x96, 0x2d, 0x2e, 0xcd, 0xa8, 0x58, ]; assert_eq!(output, expected); } } ================================================ FILE: detours-sys/Cargo.toml ================================================ [package] name = "detours-sys" version = "0.1.2" authors = ["Diana <5275194+DianaNites@users.noreply.github.com>"] edition = "2021" links = "detours" # Package stuff description = "Rust bindings to Microsoft Detours" documentation = "https://github.com/microsoft/Detours/wiki/Reference" homepage = "https://github.com/DianaNites/detours" repository = "https://github.com/DianaNites/detours" readme = "README.md" keywords = [ "detours", "hooking", "injection", ] categories = [ "external-ffi-bindings", "os::windows-apis", ] license = "MIT OR Apache-2.0" exclude = [ "/.vscode/**" ] [badges] maintenance = { status = "as-is" } [dev-dependencies.winapi] version = "0.3" features = [ "synchapi", "processthreadsapi", "sysinfoapi", ] [build-dependencies] cc = "1.0" ================================================ FILE: detours-sys/LICENSE-APACHE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: detours-sys/LICENSE-MIT ================================================ Copyright 2019 Diana Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: detours-sys/README.md ================================================ # Detours-sys [![Crates.io](https://img.shields.io/crates/v/detours-sys.svg)](https://crates.io/crates/detours-sys) ![maintenance-as-is](https://img.shields.io/badge/maintenance-as--is-yellow.svg) Rust bindings to [Microsoft Detours](https://github.com/Microsoft/Detours) ## Usage See the [Detours Documentation](https://github.com/Microsoft/Detours/wiki) for details. ## Details Use the `buildtime_generation` feature to generate bindings at build time, otherwise use pregenerated bindings. Note that this will require a relatively recent version of Clang be installed. ## License Licensed under either of * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or ) * MIT license ([LICENSE-MIT](LICENSE-MIT) or ) at your option. ## Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. ================================================ FILE: detours-sys/build/wrapper.h ================================================ #include #include ================================================ FILE: detours-sys/build.rs ================================================ #[cfg(not(target_os = "windows"))] fn main() {} #[cfg(target_os = "windows")] fn main() -> Result<(), Box> { windows::main_impl() } #[cfg(target_os = "windows")] mod windows { use std::error::Error; const CPP_FILES: [&'static str; 5] = [ "../ext/detours/src/creatwth.cpp", "../ext/detours/src/detours.cpp", "../ext/detours/src/disasm.cpp", "../ext/detours/src/image.cpp", "../ext/detours/src/modules.cpp", ]; pub fn main_impl() -> Result<(), Box> { println!("cargo:rerun-if-changed=build/wrapper.h"); for f in &CPP_FILES { println!("cargo:rerun-if-changed={}", f); } build_detours() } fn build_detours() -> Result<(), Box> { add_target_options( cc::Build::new() .include("../ext/detours/src") .files(&CPP_FILES), ) .try_compile("detours")?; Ok(()) } fn add_target_options(build: &mut cc::Build) -> &mut cc::Build { if std::env::var("CARGO_CFG_TARGET_ENV").unwrap() != "msvc" { build .compiler("clang") .cpp(true) .flag("-fms-extensions") .flag("-Wno-everything") } else { build } } } ================================================ FILE: detours-sys/src/bundled_bindings.rs ================================================ /* automatically generated by rust-bindgen 0.56.0 */ pub type wchar_t = ::std::os::raw::c_ushort; pub type ULONG = ::std::os::raw::c_ulong; pub type DWORD = ::std::os::raw::c_ulong; pub type BOOL = ::std::os::raw::c_int; pub type BYTE = ::std::os::raw::c_uchar; pub type WORD = ::std::os::raw::c_ushort; pub type LPBYTE = *mut BYTE; pub type PDWORD = *mut DWORD; pub type LPVOID = *mut ::std::os::raw::c_void; pub type LPCVOID = *const ::std::os::raw::c_void; pub type INT = ::std::os::raw::c_int; pub type PVOID = *mut ::std::os::raw::c_void; pub type CHAR = ::std::os::raw::c_char; pub type LONG = ::std::os::raw::c_long; pub type WCHAR = wchar_t; pub type LPWSTR = *mut WCHAR; pub type LPCWSTR = *const WCHAR; pub type LPSTR = *mut CHAR; pub type LPCSTR = *const CHAR; pub type HANDLE = *mut ::std::os::raw::c_void; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _GUID { pub Data1: ::std::os::raw::c_ulong, pub Data2: ::std::os::raw::c_ushort, pub Data3: ::std::os::raw::c_ushort, pub Data4: [::std::os::raw::c_uchar; 8usize], } #[test] fn bindgen_test_layout__GUID() { assert_eq!( ::std::mem::size_of::<_GUID>(), 16usize, concat!("Size of: ", stringify!(_GUID)) ); assert_eq!( ::std::mem::align_of::<_GUID>(), 4usize, concat!("Alignment of ", stringify!(_GUID)) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_GUID>())).Data1 as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(_GUID), "::", stringify!(Data1) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_GUID>())).Data2 as *const _ as usize }, 4usize, concat!( "Offset of field: ", stringify!(_GUID), "::", stringify!(Data2) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_GUID>())).Data3 as *const _ as usize }, 6usize, concat!( "Offset of field: ", stringify!(_GUID), "::", stringify!(Data3) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_GUID>())).Data4 as *const _ as usize }, 8usize, concat!( "Offset of field: ", stringify!(_GUID), "::", stringify!(Data4) ) ); } pub type GUID = _GUID; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct HINSTANCE__ { pub unused: ::std::os::raw::c_int, } #[test] fn bindgen_test_layout_HINSTANCE__() { assert_eq!( ::std::mem::size_of::(), 4usize, concat!("Size of: ", stringify!(HINSTANCE__)) ); assert_eq!( ::std::mem::align_of::(), 4usize, concat!("Alignment of ", stringify!(HINSTANCE__)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).unused as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(HINSTANCE__), "::", stringify!(unused) ) ); } pub type HINSTANCE = *mut HINSTANCE__; pub type HMODULE = HINSTANCE; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct HWND__ { pub unused: ::std::os::raw::c_int, } #[test] fn bindgen_test_layout_HWND__() { assert_eq!( ::std::mem::size_of::(), 4usize, concat!("Size of: ", stringify!(HWND__)) ); assert_eq!( ::std::mem::align_of::(), 4usize, concat!("Alignment of ", stringify!(HWND__)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).unused as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(HWND__), "::", stringify!(unused) ) ); } pub type HWND = *mut HWND__; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _SECURITY_ATTRIBUTES { pub nLength: DWORD, pub lpSecurityDescriptor: LPVOID, pub bInheritHandle: BOOL, } #[test] fn bindgen_test_layout__SECURITY_ATTRIBUTES() { assert_eq!( ::std::mem::size_of::<_SECURITY_ATTRIBUTES>(), 24usize, concat!("Size of: ", stringify!(_SECURITY_ATTRIBUTES)) ); assert_eq!( ::std::mem::align_of::<_SECURITY_ATTRIBUTES>(), 8usize, concat!("Alignment of ", stringify!(_SECURITY_ATTRIBUTES)) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_SECURITY_ATTRIBUTES>())).nLength as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(_SECURITY_ATTRIBUTES), "::", stringify!(nLength) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_SECURITY_ATTRIBUTES>())).lpSecurityDescriptor as *const _ as usize }, 8usize, concat!( "Offset of field: ", stringify!(_SECURITY_ATTRIBUTES), "::", stringify!(lpSecurityDescriptor) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_SECURITY_ATTRIBUTES>())).bInheritHandle as *const _ as usize }, 16usize, concat!( "Offset of field: ", stringify!(_SECURITY_ATTRIBUTES), "::", stringify!(bInheritHandle) ) ); } pub type LPSECURITY_ATTRIBUTES = *mut _SECURITY_ATTRIBUTES; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _PROCESS_INFORMATION { pub hProcess: HANDLE, pub hThread: HANDLE, pub dwProcessId: DWORD, pub dwThreadId: DWORD, } #[test] fn bindgen_test_layout__PROCESS_INFORMATION() { assert_eq!( ::std::mem::size_of::<_PROCESS_INFORMATION>(), 24usize, concat!("Size of: ", stringify!(_PROCESS_INFORMATION)) ); assert_eq!( ::std::mem::align_of::<_PROCESS_INFORMATION>(), 8usize, concat!("Alignment of ", stringify!(_PROCESS_INFORMATION)) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_PROCESS_INFORMATION>())).hProcess as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(_PROCESS_INFORMATION), "::", stringify!(hProcess) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_PROCESS_INFORMATION>())).hThread as *const _ as usize }, 8usize, concat!( "Offset of field: ", stringify!(_PROCESS_INFORMATION), "::", stringify!(hThread) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_PROCESS_INFORMATION>())).dwProcessId as *const _ as usize }, 16usize, concat!( "Offset of field: ", stringify!(_PROCESS_INFORMATION), "::", stringify!(dwProcessId) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_PROCESS_INFORMATION>())).dwThreadId as *const _ as usize }, 20usize, concat!( "Offset of field: ", stringify!(_PROCESS_INFORMATION), "::", stringify!(dwThreadId) ) ); } pub type LPPROCESS_INFORMATION = *mut _PROCESS_INFORMATION; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _STARTUPINFOA { pub cb: DWORD, pub lpReserved: LPSTR, pub lpDesktop: LPSTR, pub lpTitle: LPSTR, pub dwX: DWORD, pub dwY: DWORD, pub dwXSize: DWORD, pub dwYSize: DWORD, pub dwXCountChars: DWORD, pub dwYCountChars: DWORD, pub dwFillAttribute: DWORD, pub dwFlags: DWORD, pub wShowWindow: WORD, pub cbReserved2: WORD, pub lpReserved2: LPBYTE, pub hStdInput: HANDLE, pub hStdOutput: HANDLE, pub hStdError: HANDLE, } #[test] fn bindgen_test_layout__STARTUPINFOA() { assert_eq!( ::std::mem::size_of::<_STARTUPINFOA>(), 104usize, concat!("Size of: ", stringify!(_STARTUPINFOA)) ); assert_eq!( ::std::mem::align_of::<_STARTUPINFOA>(), 8usize, concat!("Alignment of ", stringify!(_STARTUPINFOA)) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOA>())).cb as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOA), "::", stringify!(cb) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOA>())).lpReserved as *const _ as usize }, 8usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOA), "::", stringify!(lpReserved) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOA>())).lpDesktop as *const _ as usize }, 16usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOA), "::", stringify!(lpDesktop) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOA>())).lpTitle as *const _ as usize }, 24usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOA), "::", stringify!(lpTitle) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOA>())).dwX as *const _ as usize }, 32usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOA), "::", stringify!(dwX) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOA>())).dwY as *const _ as usize }, 36usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOA), "::", stringify!(dwY) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOA>())).dwXSize as *const _ as usize }, 40usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOA), "::", stringify!(dwXSize) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOA>())).dwYSize as *const _ as usize }, 44usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOA), "::", stringify!(dwYSize) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOA>())).dwXCountChars as *const _ as usize }, 48usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOA), "::", stringify!(dwXCountChars) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOA>())).dwYCountChars as *const _ as usize }, 52usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOA), "::", stringify!(dwYCountChars) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOA>())).dwFillAttribute as *const _ as usize }, 56usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOA), "::", stringify!(dwFillAttribute) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOA>())).dwFlags as *const _ as usize }, 60usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOA), "::", stringify!(dwFlags) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOA>())).wShowWindow as *const _ as usize }, 64usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOA), "::", stringify!(wShowWindow) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOA>())).cbReserved2 as *const _ as usize }, 66usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOA), "::", stringify!(cbReserved2) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOA>())).lpReserved2 as *const _ as usize }, 72usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOA), "::", stringify!(lpReserved2) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOA>())).hStdInput as *const _ as usize }, 80usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOA), "::", stringify!(hStdInput) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOA>())).hStdOutput as *const _ as usize }, 88usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOA), "::", stringify!(hStdOutput) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOA>())).hStdError as *const _ as usize }, 96usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOA), "::", stringify!(hStdError) ) ); } pub type LPSTARTUPINFOA = *mut _STARTUPINFOA; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _STARTUPINFOW { pub cb: DWORD, pub lpReserved: LPWSTR, pub lpDesktop: LPWSTR, pub lpTitle: LPWSTR, pub dwX: DWORD, pub dwY: DWORD, pub dwXSize: DWORD, pub dwYSize: DWORD, pub dwXCountChars: DWORD, pub dwYCountChars: DWORD, pub dwFillAttribute: DWORD, pub dwFlags: DWORD, pub wShowWindow: WORD, pub cbReserved2: WORD, pub lpReserved2: LPBYTE, pub hStdInput: HANDLE, pub hStdOutput: HANDLE, pub hStdError: HANDLE, } #[test] fn bindgen_test_layout__STARTUPINFOW() { assert_eq!( ::std::mem::size_of::<_STARTUPINFOW>(), 104usize, concat!("Size of: ", stringify!(_STARTUPINFOW)) ); assert_eq!( ::std::mem::align_of::<_STARTUPINFOW>(), 8usize, concat!("Alignment of ", stringify!(_STARTUPINFOW)) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOW>())).cb as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOW), "::", stringify!(cb) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOW>())).lpReserved as *const _ as usize }, 8usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOW), "::", stringify!(lpReserved) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOW>())).lpDesktop as *const _ as usize }, 16usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOW), "::", stringify!(lpDesktop) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOW>())).lpTitle as *const _ as usize }, 24usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOW), "::", stringify!(lpTitle) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOW>())).dwX as *const _ as usize }, 32usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOW), "::", stringify!(dwX) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOW>())).dwY as *const _ as usize }, 36usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOW), "::", stringify!(dwY) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOW>())).dwXSize as *const _ as usize }, 40usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOW), "::", stringify!(dwXSize) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOW>())).dwYSize as *const _ as usize }, 44usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOW), "::", stringify!(dwYSize) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOW>())).dwXCountChars as *const _ as usize }, 48usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOW), "::", stringify!(dwXCountChars) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOW>())).dwYCountChars as *const _ as usize }, 52usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOW), "::", stringify!(dwYCountChars) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOW>())).dwFillAttribute as *const _ as usize }, 56usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOW), "::", stringify!(dwFillAttribute) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOW>())).dwFlags as *const _ as usize }, 60usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOW), "::", stringify!(dwFlags) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOW>())).wShowWindow as *const _ as usize }, 64usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOW), "::", stringify!(wShowWindow) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOW>())).cbReserved2 as *const _ as usize }, 66usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOW), "::", stringify!(cbReserved2) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOW>())).lpReserved2 as *const _ as usize }, 72usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOW), "::", stringify!(lpReserved2) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOW>())).hStdInput as *const _ as usize }, 80usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOW), "::", stringify!(hStdInput) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOW>())).hStdOutput as *const _ as usize }, 88usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOW), "::", stringify!(hStdOutput) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_STARTUPINFOW>())).hStdError as *const _ as usize }, 96usize, concat!( "Offset of field: ", stringify!(_STARTUPINFOW), "::", stringify!(hStdError) ) ); } pub type LPSTARTUPINFOW = *mut _STARTUPINFOW; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _DETOUR_TRAMPOLINE { _unused: [u8; 0], } pub type PDETOUR_TRAMPOLINE = *mut _DETOUR_TRAMPOLINE; #[doc = " Binary Typedefs."] pub type PF_DETOUR_BINARY_BYWAY_CALLBACK = ::std::option::Option< unsafe extern "system" fn(pContext: PVOID, pszFile: LPCSTR, ppszOutFile: *mut LPCSTR) -> BOOL, >; pub type PF_DETOUR_BINARY_FILE_CALLBACK = ::std::option::Option< unsafe extern "system" fn( pContext: PVOID, pszOrigFile: LPCSTR, pszFile: LPCSTR, ppszOutFile: *mut LPCSTR, ) -> BOOL, >; pub type PF_DETOUR_BINARY_SYMBOL_CALLBACK = ::std::option::Option< unsafe extern "system" fn( pContext: PVOID, nOrigOrdinal: ULONG, nOrdinal: ULONG, pnOutOrdinal: *mut ULONG, pszOrigSymbol: LPCSTR, pszSymbol: LPCSTR, ppszOutSymbol: *mut LPCSTR, ) -> BOOL, >; pub type PF_DETOUR_BINARY_COMMIT_CALLBACK = ::std::option::Option BOOL>; pub type PF_DETOUR_ENUMERATE_EXPORT_CALLBACK = ::std::option::Option< unsafe extern "system" fn(pContext: PVOID, nOrdinal: ULONG, pszName: LPCSTR, pCode: PVOID) -> BOOL, >; pub type PF_DETOUR_IMPORT_FILE_CALLBACK = ::std::option::Option< unsafe extern "system" fn(pContext: PVOID, hModule: HMODULE, pszFile: LPCSTR) -> BOOL, >; pub type PF_DETOUR_IMPORT_FUNC_CALLBACK = ::std::option::Option< unsafe extern "system" fn(pContext: PVOID, nOrdinal: DWORD, pszFunc: LPCSTR, pvFunc: PVOID) -> BOOL, >; pub type PF_DETOUR_IMPORT_FUNC_CALLBACK_EX = ::std::option::Option< unsafe extern "system" fn( pContext: PVOID, nOrdinal: DWORD, pszFunc: LPCSTR, ppvFunc: *mut PVOID, ) -> BOOL, >; pub type PDETOUR_BINARY = *mut ::std::os::raw::c_void; extern "system" { #[doc = " Transaction APIs."] pub fn DetourTransactionBegin() -> LONG; } extern "system" { pub fn DetourTransactionAbort() -> LONG; } extern "system" { pub fn DetourTransactionCommit() -> LONG; } extern "system" { pub fn DetourTransactionCommitEx(pppFailedPointer: *mut *mut PVOID) -> LONG; } extern "system" { pub fn DetourUpdateThread(hThread: HANDLE) -> LONG; } extern "system" { pub fn DetourAttach(ppPointer: *mut PVOID, pDetour: PVOID) -> LONG; } extern "system" { pub fn DetourAttachEx( ppPointer: *mut PVOID, pDetour: PVOID, ppRealTrampoline: *mut PDETOUR_TRAMPOLINE, ppRealTarget: *mut PVOID, ppRealDetour: *mut PVOID, ) -> LONG; } extern "system" { pub fn DetourDetach(ppPointer: *mut PVOID, pDetour: PVOID) -> LONG; } extern "system" { pub fn DetourSetIgnoreTooSmall(fIgnore: BOOL) -> BOOL; } extern "system" { pub fn DetourSetRetainRegions(fRetain: BOOL) -> BOOL; } extern "system" { pub fn DetourSetSystemRegionLowerBound(pSystemRegionLowerBound: PVOID) -> PVOID; } extern "system" { pub fn DetourSetSystemRegionUpperBound(pSystemRegionUpperBound: PVOID) -> PVOID; } extern "system" { #[doc = " Code Functions."] pub fn DetourFindFunction(pszModule: LPCSTR, pszFunction: LPCSTR) -> PVOID; } extern "system" { pub fn DetourCodeFromPointer(pPointer: PVOID, ppGlobals: *mut PVOID) -> PVOID; } extern "system" { pub fn DetourCopyInstruction( pDst: PVOID, ppDstPool: *mut PVOID, pSrc: PVOID, ppTarget: *mut PVOID, plExtra: *mut LONG, ) -> PVOID; } extern "system" { pub fn DetourSetCodeModule(hModule: HMODULE, fLimitReferencesToModule: BOOL) -> BOOL; } extern "system" { pub fn DetourAllocateRegionWithinJumpBounds( pbTarget: LPCVOID, pcbAllocatedSize: PDWORD, ) -> PVOID; } extern "system" { #[doc = " Loaded Binary Functions."] pub fn DetourGetContainingModule(pvAddr: PVOID) -> HMODULE; } extern "system" { pub fn DetourEnumerateModules(hModuleLast: HMODULE) -> HMODULE; } extern "system" { pub fn DetourGetEntryPoint(hModule: HMODULE) -> PVOID; } extern "system" { pub fn DetourGetModuleSize(hModule: HMODULE) -> ULONG; } extern "system" { pub fn DetourEnumerateExports( hModule: HMODULE, pContext: PVOID, pfExport: PF_DETOUR_ENUMERATE_EXPORT_CALLBACK, ) -> BOOL; } extern "system" { pub fn DetourEnumerateImports( hModule: HMODULE, pContext: PVOID, pfImportFile: PF_DETOUR_IMPORT_FILE_CALLBACK, pfImportFunc: PF_DETOUR_IMPORT_FUNC_CALLBACK, ) -> BOOL; } extern "system" { pub fn DetourEnumerateImportsEx( hModule: HMODULE, pContext: PVOID, pfImportFile: PF_DETOUR_IMPORT_FILE_CALLBACK, pfImportFuncEx: PF_DETOUR_IMPORT_FUNC_CALLBACK_EX, ) -> BOOL; } extern "system" { pub fn DetourFindPayload(hModule: HMODULE, rguid: *const GUID, pcbData: *mut DWORD) -> PVOID; } extern "system" { pub fn DetourFindPayloadEx(rguid: *const GUID, pcbData: *mut DWORD) -> PVOID; } extern "system" { pub fn DetourGetSizeOfPayloads(hModule: HMODULE) -> DWORD; } extern "system" { #[doc = " Persistent Binary Functions."] pub fn DetourBinaryOpen(hFile: HANDLE) -> PDETOUR_BINARY; } extern "system" { pub fn DetourBinaryEnumeratePayloads( pBinary: PDETOUR_BINARY, pGuid: *mut GUID, pcbData: *mut DWORD, pnIterator: *mut DWORD, ) -> PVOID; } extern "system" { pub fn DetourBinaryFindPayload( pBinary: PDETOUR_BINARY, rguid: *const GUID, pcbData: *mut DWORD, ) -> PVOID; } extern "system" { pub fn DetourBinarySetPayload( pBinary: PDETOUR_BINARY, rguid: *const GUID, pData: PVOID, cbData: DWORD, ) -> PVOID; } extern "system" { pub fn DetourBinaryDeletePayload(pBinary: PDETOUR_BINARY, rguid: *const GUID) -> BOOL; } extern "system" { pub fn DetourBinaryPurgePayloads(pBinary: PDETOUR_BINARY) -> BOOL; } extern "system" { pub fn DetourBinaryResetImports(pBinary: PDETOUR_BINARY) -> BOOL; } extern "system" { pub fn DetourBinaryEditImports( pBinary: PDETOUR_BINARY, pContext: PVOID, pfByway: PF_DETOUR_BINARY_BYWAY_CALLBACK, pfFile: PF_DETOUR_BINARY_FILE_CALLBACK, pfSymbol: PF_DETOUR_BINARY_SYMBOL_CALLBACK, pfCommit: PF_DETOUR_BINARY_COMMIT_CALLBACK, ) -> BOOL; } extern "system" { pub fn DetourBinaryWrite(pBinary: PDETOUR_BINARY, hFile: HANDLE) -> BOOL; } extern "system" { pub fn DetourBinaryClose(pBinary: PDETOUR_BINARY) -> BOOL; } #[doc = " Create Process & Load Dll."] pub type PDETOUR_CREATE_PROCESS_ROUTINEA = ::std::option::Option< unsafe extern "system" fn( lpApplicationName: LPCSTR, lpCommandLine: LPSTR, lpProcessAttributes: LPSECURITY_ATTRIBUTES, lpThreadAttributes: LPSECURITY_ATTRIBUTES, bInheritHandles: BOOL, dwCreationFlags: DWORD, lpEnvironment: LPVOID, lpCurrentDirectory: LPCSTR, lpStartupInfo: LPSTARTUPINFOA, lpProcessInformation: LPPROCESS_INFORMATION, ) -> BOOL, >; pub type PDETOUR_CREATE_PROCESS_ROUTINEW = ::std::option::Option< unsafe extern "system" fn( lpApplicationName: LPCWSTR, lpCommandLine: LPWSTR, lpProcessAttributes: LPSECURITY_ATTRIBUTES, lpThreadAttributes: LPSECURITY_ATTRIBUTES, bInheritHandles: BOOL, dwCreationFlags: DWORD, lpEnvironment: LPVOID, lpCurrentDirectory: LPCWSTR, lpStartupInfo: LPSTARTUPINFOW, lpProcessInformation: LPPROCESS_INFORMATION, ) -> BOOL, >; extern "system" { pub fn DetourCreateProcessWithDllA( lpApplicationName: LPCSTR, lpCommandLine: LPSTR, lpProcessAttributes: LPSECURITY_ATTRIBUTES, lpThreadAttributes: LPSECURITY_ATTRIBUTES, bInheritHandles: BOOL, dwCreationFlags: DWORD, lpEnvironment: LPVOID, lpCurrentDirectory: LPCSTR, lpStartupInfo: LPSTARTUPINFOA, lpProcessInformation: LPPROCESS_INFORMATION, lpDllName: LPCSTR, pfCreateProcessA: PDETOUR_CREATE_PROCESS_ROUTINEA, ) -> BOOL; } extern "system" { pub fn DetourCreateProcessWithDllW( lpApplicationName: LPCWSTR, lpCommandLine: LPWSTR, lpProcessAttributes: LPSECURITY_ATTRIBUTES, lpThreadAttributes: LPSECURITY_ATTRIBUTES, bInheritHandles: BOOL, dwCreationFlags: DWORD, lpEnvironment: LPVOID, lpCurrentDirectory: LPCWSTR, lpStartupInfo: LPSTARTUPINFOW, lpProcessInformation: LPPROCESS_INFORMATION, lpDllName: LPCSTR, pfCreateProcessW: PDETOUR_CREATE_PROCESS_ROUTINEW, ) -> BOOL; } extern "system" { pub fn DetourCreateProcessWithDllExA( lpApplicationName: LPCSTR, lpCommandLine: LPSTR, lpProcessAttributes: LPSECURITY_ATTRIBUTES, lpThreadAttributes: LPSECURITY_ATTRIBUTES, bInheritHandles: BOOL, dwCreationFlags: DWORD, lpEnvironment: LPVOID, lpCurrentDirectory: LPCSTR, lpStartupInfo: LPSTARTUPINFOA, lpProcessInformation: LPPROCESS_INFORMATION, lpDllName: LPCSTR, pfCreateProcessA: PDETOUR_CREATE_PROCESS_ROUTINEA, ) -> BOOL; } extern "system" { pub fn DetourCreateProcessWithDllExW( lpApplicationName: LPCWSTR, lpCommandLine: LPWSTR, lpProcessAttributes: LPSECURITY_ATTRIBUTES, lpThreadAttributes: LPSECURITY_ATTRIBUTES, bInheritHandles: BOOL, dwCreationFlags: DWORD, lpEnvironment: LPVOID, lpCurrentDirectory: LPCWSTR, lpStartupInfo: LPSTARTUPINFOW, lpProcessInformation: LPPROCESS_INFORMATION, lpDllName: LPCSTR, pfCreateProcessW: PDETOUR_CREATE_PROCESS_ROUTINEW, ) -> BOOL; } extern "system" { pub fn DetourCreateProcessWithDllsA( lpApplicationName: LPCSTR, lpCommandLine: LPSTR, lpProcessAttributes: LPSECURITY_ATTRIBUTES, lpThreadAttributes: LPSECURITY_ATTRIBUTES, bInheritHandles: BOOL, dwCreationFlags: DWORD, lpEnvironment: LPVOID, lpCurrentDirectory: LPCSTR, lpStartupInfo: LPSTARTUPINFOA, lpProcessInformation: LPPROCESS_INFORMATION, nDlls: DWORD, rlpDlls: *mut LPCSTR, pfCreateProcessA: PDETOUR_CREATE_PROCESS_ROUTINEA, ) -> BOOL; } extern "system" { pub fn DetourCreateProcessWithDllsW( lpApplicationName: LPCWSTR, lpCommandLine: LPWSTR, lpProcessAttributes: LPSECURITY_ATTRIBUTES, lpThreadAttributes: LPSECURITY_ATTRIBUTES, bInheritHandles: BOOL, dwCreationFlags: DWORD, lpEnvironment: LPVOID, lpCurrentDirectory: LPCWSTR, lpStartupInfo: LPSTARTUPINFOW, lpProcessInformation: LPPROCESS_INFORMATION, nDlls: DWORD, rlpDlls: *mut LPCSTR, pfCreateProcessW: PDETOUR_CREATE_PROCESS_ROUTINEW, ) -> BOOL; } extern "system" { pub fn DetourProcessViaHelperA( dwTargetPid: DWORD, lpDllName: LPCSTR, pfCreateProcessA: PDETOUR_CREATE_PROCESS_ROUTINEA, ) -> BOOL; } extern "system" { pub fn DetourProcessViaHelperW( dwTargetPid: DWORD, lpDllName: LPCSTR, pfCreateProcessW: PDETOUR_CREATE_PROCESS_ROUTINEW, ) -> BOOL; } extern "system" { pub fn DetourProcessViaHelperDllsA( dwTargetPid: DWORD, nDlls: DWORD, rlpDlls: *mut LPCSTR, pfCreateProcessA: PDETOUR_CREATE_PROCESS_ROUTINEA, ) -> BOOL; } extern "system" { pub fn DetourProcessViaHelperDllsW( dwTargetPid: DWORD, nDlls: DWORD, rlpDlls: *mut LPCSTR, pfCreateProcessW: PDETOUR_CREATE_PROCESS_ROUTINEW, ) -> BOOL; } extern "system" { pub fn DetourUpdateProcessWithDll(hProcess: HANDLE, rlpDlls: *mut LPCSTR, nDlls: DWORD) -> BOOL; } extern "system" { pub fn DetourUpdateProcessWithDllEx( hProcess: HANDLE, hImage: HMODULE, bIs32Bit: BOOL, rlpDlls: *mut LPCSTR, nDlls: DWORD, ) -> BOOL; } extern "system" { pub fn DetourCopyPayloadToProcess( hProcess: HANDLE, rguid: *const GUID, pvData: PVOID, cbData: DWORD, ) -> BOOL; } extern "system" { pub fn DetourRestoreAfterWith() -> BOOL; } extern "system" { pub fn DetourRestoreAfterWithEx(pvData: PVOID, cbData: DWORD) -> BOOL; } extern "system" { pub fn DetourIsHelperProcess() -> BOOL; } extern "system" { pub fn DetourFinishHelperProcess(arg1: HWND, arg2: HINSTANCE, arg3: LPSTR, arg4: INT); } ================================================ FILE: detours-sys/src/lib.rs ================================================ #![cfg(target_os = "windows")] //! Bindings to the Microsoft Detours API. #![allow(non_camel_case_types)] #![allow(non_snake_case)] // Rebuild with: // bindgen ..\build\wrapper.h --whitelist-function "Detour.*" -o bundled_bindings.rs -- "-fms-compatibility" "-fms-extensions" --target=x86_64-pc-windows-msvc -I ..\..\ext\detours\src\ include!("bundled_bindings.rs"); #[cfg(test)] mod tests { use super::*; use std::{ffi, ptr}; use winapi::{ shared::minwindef::LPVOID, um::{processthreadsapi::GetCurrentThread, synchapi::Sleep, sysinfoapi::GetTickCount}, }; static mut TRUE_SLEEP: unsafe extern "system" fn(DWORD) = Sleep; static mut SLEPT: LONG = 0; // Detour function that replaces the Sleep API. unsafe extern "system" fn TimedSleep(dwMilliseconds: DWORD) { // Save the before and after times around calling the Sleep API. let dwBeg: DWORD = GetTickCount(); TRUE_SLEEP(dwMilliseconds); let dwEnd: DWORD = GetTickCount(); SLEPT = (dwEnd - dwBeg) as i32; } extern "system" fn DllMain(_: HINSTANCE, reason: DWORD, _: LPVOID) -> BOOL { if unsafe { DetourIsHelperProcess() } == 1 { return 1; } let tru = unsafe { &mut TRUE_SLEEP as *mut _ as *mut *mut ffi::c_void }; let new = TimedSleep as *mut ffi::c_void; match reason { // DLL_PROCESS_ATTACH 1 => unsafe { DetourRestoreAfterWith(); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread() as _); DetourAttach(tru, new); DetourTransactionCommit(); }, // DLL_PROCESS_DETACH 0 => unsafe { DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread() as _); DetourDetach(tru, new); DetourTransactionCommit(); }, _ => (), } 1 } #[test] fn hook_self() { unsafe { DllMain(ptr::null_mut(), 1, ptr::null_mut()); let slept; Sleep(500); slept = SLEPT; assert_ne!(SLEPT, 0); DllMain(ptr::null_mut(), 0, ptr::null_mut()); Sleep(500); assert_eq!(slept, SLEPT); } } } ================================================ FILE: docs/.gitignore ================================================ book ================================================ FILE: docs/.readthedocs.yaml ================================================ version: 2 build: os: ubuntu-lts-latest tools: rust: latest jobs: install: - cargo install mdbook@0.5.2 --root . build: html: - PATH=$PATH:./bin mdbook build docs --dest-dir $READTHEDOCS_OUTPUT/html ================================================ FILE: docs/book.toml ================================================ [book] authors = ["Andrzej Janik"] language = "en" src = "src" title = "ZLUDA" ================================================ FILE: docs/src/SUMMARY.md ================================================ # Summary # General - [Quick start](./quick_start.md) - [Installing HIP SDK](./hip_sdk.md) - [FAQ](./faq.md) # Troubleshooting - [Logging (general issues)](./troubleshooting.md) - [Precompiling (slow start)](./precompiling.md) # Applications - [llama.cpp](./llama_cpp.md) # For developers - [Building from source](./building.md) ================================================ FILE: docs/src/building.md ================================================ # Building ## Dependencies * Git * CMake * Python 3 * Rust compiler (recent version) * C++ compiler * (Linux only) HIP ([instructions here](https://rocm.docs.amd.com/projects/HIP/en/latest/install/install.html)) * (Optional, but recommended) [Ninja build system](https://ninja-build.org/) ## Build steps * Git clone the repo (make sure to use `--recursive` option to fetch submodules):\ `git clone --recursive https://github.com/vosen/ZLUDA.git` * Enter freshly cloned `ZLUDA` directory and build with cargo (this takes a while): * `cargo xtask --release` for Release build * `cargo xtask` for Debug build ================================================ FILE: docs/src/faq.md ================================================ # FAQ > [!WARNING] > For legal reasons we can't help you with the pre-rollback versions (older than 4). See more here: [https://www.theregister.com/2024/08/09/amd_zluda_take_down](https://www.theregister.com/2024/08/09/amd_zluda_take_down/) ## General 1. How I can donate to ZLUDA development? The ZLUDA project is fully funded and only accepts donations of labor. 1. What organization is funding ZLUDA development? This will be revealed in due time. 1. How can I follow ZLUDA's progress * Join our [Discord](https://discord.gg/sg6BNzXuc7) * Every quarter we publish a progress report on [ZLUDA's blog](https://vosen.github.io/ZLUDA/) ## Hardware 1. AMD GPU support? ZLUDA supports AMD Radeon RX 5000 series and newer GPUs (both desktop and integrated). Older consumer GPUs (Polaris, Vega, etc.) and server‑class GPUs are not supported; these architectures differ significantly from recent desktop GPUs and would require substantial engineering effort. We expect that the near-future unified GPU architecture (UDNA) will be more similar to desktop GPUs. 1. Intel GPU support? ZLUDA previously supported Intel GPUs, but not currently. It is possible to revive the Intel backend. The development team is focusing on high‑quality AMD GPU support and welcomes contributions. 1. NVIDIA GPU support? Unlikely to ever be on the roadmap, because NVIDIA users can use the original CUDA. That said, if someone wants to add support we are open to contributions. 1. Qualcomm GPU support? It would be interesting to have Qualcomm GPU support, but the development team is focusing on high‑quality AMD GPU support. We welcome contributions. 1. macOS support? Unlikely to ever happen. There is very little non‑deprecated CUDA software for macOS, and what remains will soon be unsupported. 1. ZLUDA on top of OpenCL or Vulkan? ZLUDA could be ported to OpenCL or Vulkan, but with significantly reduced functionality. This might be acceptable for a narrow use case, but it would not be as general‑purpose as using the native backend. Examples of features available with the current compilation path that are not exposed by either Vulkan or OpenCL: * Disabling FP contraction * Explicit alignment * Some subgroup and group operations * Bindless images * Pointer casts * Arbitrary virtual calls * Inline assembly * Rounding modes * Denormal modes Additionally, performance libraries (cuBLAS, cuDNN, etc.) cannot be easily mapped through Vulkan or OpenCL. # Software 1. PyTorch support? PyTorch support is currently our top priority. We expect to have initial support fourth quarter of 2025. 1. Tensorflow support? Tensorflow support is currently a top priority for ZLUDA and will follow PyTorch support. 1. Blender support Blender is not on the roadmap, but it's often requested. Support might be added at certain point, but it's a low priority. If ZLUDA supports Blender, it will not support hardware ray-tracing (see _Hardware ray-tracing (OptiX) support?_ section below). 1. Hardware ray-tracing (OptiX) support? OptiX support is exceedingly complex. While it's built on top of CUDA, it uses its own dialect of PTX, uses its own host code and requires its own specific optimizations. It's unlikely that ZLUDA will ever support OptiX again. OptiX would require a very dedicated contributor (or team of contributors) to step in. 1. Support for games using 32 bit PhysX? We are convinced that it's possible (both for AMD GPUs and NVIDIA GPUs). Necessary groundwork has been done (log collection) and there is a plan how to implement the feature. It's not on the roadmap and we are hoping for outside contributors to step in. 1. Support for games using 64 bit PhysX (GameWorks)? It is definitely possible, pre-rollback ZLUDA had this capability. It's not on the roadmap and would require outside contributions. 1. DLSS support? Previously DLSS support was blocked by a missing functionality in AMD's Direct3D driver: ability to enqueue HIP kernels into Direct3D command list. This functionality now ships in the newest driver and DLSS support should be possible. It's not on our roadmap, but if someone steps in to implement it, we'd be happy to merge. ================================================ FILE: docs/src/hip_sdk.md ================================================ # Installing HIP SDK On Windows, in addition to installing the GPU driver, you need to install the HIP SDK. Choose one of the two options below:
Official HIP SDK Unofficial HIP SDK builds
✅ Automatic installation\ ✅ Stable and supported by AMD\ ❌ Older code\ ❌ No Machine Learning support (PyTorch and TensorFlow will not work) ### Installation 1. Visit the [AMD HIP SDK for Windows](https://www.amd.com/en/developer/resources/rocm-hub/hip-sdk.html) website 2. Download the latest version for your OS 3. Run the installer and follow the on-screen instructions ❌ Manual installation\ ❌ Unstable and unsupported by AMD\ ✅ Newer code\ ✅ Machine Learning support (required for PyTorch, TensorFlow, etc.) ### Installation 1. Visit the [ROCm SDK nightly tarballs](https://therock-nightly-tarball.s3.amazonaws.com/index.html) website 2. Download a recent `therock-dist-windows-gfx...tar.gz` file: - If you don't know your ``, check the TechPowerUp GPU database. Example: for [AMD Radeon RX 9070](https://www.techpowerup.com/gpu-specs/radeon-rx-9070.c4250), the `` (Shader ISA) is 1201 - Alternatively, download any `tar.gz` file, unpack it and run the included `hipInfo.exe` to determine your `` (gcnArchName) 3. Extract the `.tar.gz` file to a directory of your choice (you can use [7-Zip](https://www.7-zip.org/)) - Note: You may need to extract twice (first the `.tar.gz`, then the `.tar` file) 4. Set the `HIP_PATH` environment variable to the extracted directory path ([instructions here](https://www.tenforums.com/tutorials/121855-edit-user-system-environment-variables-windows.html)) - The directory must contain a `bin` subdirectory - The `bin` directory must contain various `.dll` files, including `rocblas.dll`
## Verification ZLUDA includes a small CUDA application that tests the loading and initialization of all performance libraries. Run it using: ``` zluda.exe -- cuda_check.exe ``` The output should look like this: ``` nvcuda : OK (C:\hip_sdk\bin\amdhip64_7.dll) nvml : OK cufft11 : OK cudnn9 : OK (C:\hip_sdk\bin\MIOpen.dll) cudnn8 : OK (C:\hip_sdk\bin\MIOpen.dll) cublaslt13: OK (C:\hip_sdk\bin\libhipblaslt.dll) cusparse12: OK cufft12 : OK cublas13 : OK (C:\hip_sdk\bin\rocblas.dll) cublaslt12: OK (C:\hip_sdk\bin\libhipblaslt.dll) cublas12 : OK (C:\hip_sdk\bin\rocblas.dll) cusparse11: OK ``` The path in parentheses is the path to the underlying HIP SDK library. **Caveats and Known Issues:** - The path shown in parentheses indicates the underlying HIP SDK library, but is not guaranteed to be used. If an application loads the library from a different path before loading ZLUDA, ZLUDA will use the already-loaded library instead - `cuda_check.exe` may sometimes hang and not close due to a bug in MIOpen - When using the official HIP SDK, `cuda_check.exe` will fail to load `cudnn8` and `cudnn9` because the official SDK does not include MIOpen ================================================ FILE: docs/src/llama_cpp.md ================================================ # llama.cpp llama.cpp runs at native speed when compiled for CUDA architecture 86 and with cuBLAS enabled: ``` cmake -B build -DGGML_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES="86" -DGGML_CUDA_FORCE_CUBLAS=true ``` Compiling for multiple CUDA architectures should be fine as long as one of the architectures is 80, 86 or 89. Compiling with cuBLAS disabled might lead to performance degradation. ## Windows You need to install [HIP SDK](hip_sdk.html) to have access to rocBLAS ================================================ FILE: docs/src/precompiling.md ================================================ # Precompiling Consider precompiling the GPU code with `zluda_precompile` if you are trying to run a large application. `zluda_precompile` scans the location, extracts all the GPU code, compiles it, and saves it to the cache. This way, the GPU code is already in the cache when the application is launched for the first time. This process uses all the threads on the machine (making it faster than leaving it to the application) and may compile more code than is necessary for your application (making it potentially slower than leaving it to the application). Your mileage might vary. ## Usage: Windows: ``` zluda_precompile.exe ``` Linux: ``` zluda_precompile ``` where `` is the path to the directory or file. ================================================ FILE: docs/src/quick_start.md ================================================ # Quick start > [!WARNING] > This version of ZLUDA is under heavy development and will likely not work with your application yet. In the meantime, you are encouraged to try it and report results. ## How to get it ZLUDA evolves quickly, we recommend downloading the [most recent pre-release version](https://github.com/vosen/ZLUDA/releases). Periodically, we mark a pre-release version as stable, you can download it from the "Releases" section on our [Github page](https://github.com/vosen/ZLUDA). ## Usage ### Windows You should have a recent AMD GPU driver ("AMD Software: Adrenalin Edition") and [HIP SDK](hip_sdk.html) installed.\ To run your application either: * (_Recommended_) Use ZLUDA launcher: ``` \zluda.exe -- ``` * Copy all ZLUDA files (including `nvcuda.dll`) from `zluda` (if you downloaded a zip package) or `target\release` (if you built from sources) into a path which your application uses to load CUDA. Paths vary application to application, but usually it's the directory where the .exe file is located ### Linux Run your application like this: * Recommended method ``` LD_LIBRARY_PATH=":$LD_LIBRARY_PATH" ``` where `` is the directory which contains ZLUDA-provided `libcuda.so`: `zluda` if you downloaded a prebuilt package or `target/release` if you built from sources. * Alternative method ``` LD_AUDIT="/zluda_ld:$LD_AUDIT" ``` where `` is the directory which contains ZLUDA-provided `libcuda.so`: `zluda` if you downloaded a prebuilt package or `target/release` if you built from sources. ### macOS Not supported ================================================ FILE: docs/src/troubleshooting.md ================================================ # Logging ## Introduction zluda_trace is a [shim](https://en.wikipedia.org/wiki/Shim_(computing)) for the CUDA API which traces application's CUDA usage. If your application is encountering issues with ZLUDA, you should use zluda_trace to find out where and why ZLUDA fails. ## Quick Start ### Linux Run your application like this: #### AMD GPU: ```bash ZLUDA_CUDA_LIB=/libcuda.so LD_LIBRARY_PATH=/trace/ \ ZLUDA_LOG_DIR= ``` #### NVIDIA GPU: ```bash LD_LIBRARY_PATH=/trace/ \ ZLUDA_LOG_DIR= ``` If you're [filing a GitHub issue](https://github.com/vosen/ZLUDA/issues/new/choose), please create an archive with your logs from `` and attach it to the issue: ```bash tar -cvf logs.tar.gz -C . ``` ### Windows Run your application like this: #### AMD GPU: ```bash zluda.exe --zluda-trace -- ``` #### NVIDIA GPU: ```bash zluda.exe --nvidia-trace -- ``` This will create a new directory with executable name with the log output in `C:\Users\%USERNAME%\AppData\Local\Temp\zluda` (`%TEMP%\zluda`). If you're [filing a GitHub issue](https://github.com/vosen/ZLUDA/issues/new/choose), please create a .zip file with your logs from `C:\Users\%USERNAME%\AppData\Local\Temp\zluda` to attach to the issue. In Windows Explorer, right click on the directory and select "Send to"/"Compressed (zipped) folder". Exact steps may vary between Windows versions. ### Explanation #### `LD_LIBRARY_PATH=/trace/` `` is the directory that contains the ZLUDA driver (`libcuda.so` and various other libraries). It will be `target/release` if you built from source, or `zluda` if you downloaded one of the release packages. `/trace` contains tracing shims for `libcuda.so` (zluda_trace) and other CUDA libraries. > [!NOTE] > `LD_LIBRARY_PATH` is an environment variable used by `ld`, Linux's dynamic linker. It tells `ld` that when it's looking for a shared library – for example, `libcuda.so` – it should first look in a specific list of directories, before system paths. It's just like `PATH`, but for shared libraries instead of executables. #### `ZLUDA_CUDA_LIB=/libcuda.so` By default, zluda_trace will log all calls and then redirect them to an actual CUDA driver (`libcuda.so`). In order to use ZLUDA, `ZLUDA_CUDA_LIB` must be set to the `libcuda.so` provided by ZLUDA. If `ZLUDA_CUDA_LIB` is not set, zluda_trace will use NVIDIA’s `libcuda.so`. #### `ZLUDA_LOG_DIR=` By default, zluda_trace prints logs to stderr. In order to save them to a file, as well as save other useful information, you must provide a directory that they should be saved in – for example, `/tmp/zluda`. ## Understanding the zluda_trace output Let's look at the zluda_trace output for a simple application. Here's a CUDA program that adds two numbers on the GPU: ```cpp,linenos #include __global__ void add(int a, int b, int *out) { *out = a + b; } int main() { int *result; cudaMallocManaged(&result, sizeof(int)); add<<<1, 1>>>(1, 2, result); cudaDeviceSynchronize(); std::cout << "result: " << *result << std::endl; cudaFree(result); return 0; } ``` I've saved this file as `add.cu`. ZLUDA doesn't successfully run this application yet, so I'll compile it and run it using zluda_trace and CUDA in order to demonstrate all of zluda_trace's features. ```bash nvcc add.cu -o add -arch sm_80 LD_LIBRARY_PATH=~/ZLUDA/target/release/trace/ ZLUDA_LOG_DIR=/tmp/zluda ./add ``` The last few lines should look something like: ``` [ZLUDA_TRACE] cuCtxSynchronize() -> CUDA_SUCCESS result: 3 [ZLUDA_TRACE] {CONTEXT_LOCAL_STORAGE_INTERFACE_V0301}::context_local_storage_get(value: 0x562c764a73c0, cu_ctx: 0x0, key: 0x562c764ba130) -> CUDA_SUCCESS [ZLUDA_TRACE] cuMemFree_v2(dptr: 0x7f3ca2000000) -> CUDA_SUCCESS [ZLUDA_TRACE] {CONTEXT_LOCAL_STORAGE_INTERFACE_V0301}::context_local_storage_delete(context: 0x562c764ba760, key: 0x562c764ba130) -> CUDA_ERROR_DEINITIALIZED [ZLUDA_TRACE] cuLibraryUnload(library: 0x562c773ffb10) -> CUDA_ERROR_DEINITIALIZED [ZLUDA_TRACE] cuDevicePrimaryCtxRelease(dev: 0) -> CUDA_ERROR_DEINITIALIZED ``` Now, let's take a look at our log directory: ```bash ls /tmp/zluda add ``` zluda_trace creates a new directory for each run, based on the name of the command. If the `add` directory already existed, it'd create an `add_1` directory, and so on. Next, let's look at that newly-created directory: ```bash ls /tmp/zluda/add/ log.txt module_0001_01.elf module_0001_02.ptx ``` Let's take a look at each of these files. ### log.txt ```bash #no_wrap cat /tmp/zluda/add/log.txt # ... # cuModuleGetFunction(hfunc: 0x55ee94d645d0, hmod: 0x55ee94d63c40, name: "_Z3addiiPi") -> CUDA_SUCCESS # cuLaunchKernel(f: 0x55ee94d645d0, gridDimX: 1, gridDimY: 1, gridDimZ: 1, blockDimX: 1, blockDimY: 1, blockDimZ: 1, sharedMemBytes: 0, hStream: 0x0, kernelParams: 0x7fffe0fa193c, extra: NULL) -> CUDA_SUCCESS # {CONTEXT_LOCAL_STORAGE_INTERFACE_V0301}::context_local_storage_get(value: 0x55ee93e083c0, cu_ctx: 0x0, key: 0x55ee93e1b130) -> CUDA_SUCCESS # cuCtxSynchronize() -> CUDA_SUCCESS # {CONTEXT_LOCAL_STORAGE_INTERFACE_V0301}::context_local_storage_get(value: 0x55ee93e083c0, cu_ctx: 0x0, key: 0x55ee93e1b130) -> CUDA_SUCCESS # cuMemFree_v2(dptr: 0x7fbde6000000) -> CUDA_SUCCESS # {CONTEXT_LOCAL_STORAGE_INTERFACE_V0301}::context_local_storage_delete(context: 0x55ee93e1b760, key: 0x55ee93e1b130) -> CUDA_ERROR_DEINITIALIZED # cuLibraryUnload(library: 0x55ee94d60ae0) -> CUDA_ERROR_DEINITIALIZED # cuDevicePrimaryCtxRelease(dev: 0) -> CUDA_ERROR_DEINITIALIZED ``` As you can see, this is the same log that was written to stderr. It records each call made to a CUDA library, the arguments it was passed, and the status code returned. Most of these will be calls that you can find in the NVIDIA documentation – for example, [`cuModuleGetFunction`](https://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__MODULE.html#group__CUDA__MODULE_1ga52be009b0d4045811b30c965e1cb2cf) – but some of them aren't publicly documented. For example, look at the calls to `{CONTEXT_LOCAL_STORAGE_INTERFACE_V0301}​::​context_local_storage_get`. Calls with this format are to what we call NVIDIA's Dark API. We'll write more documentation for this later, but for now all you need to know are that these are from function pointer tables returned by `cuGetExportTable`. We're looking at a very simple example, so it doesn't use any performance libraries. If you use zluda_trace for code calling one of NVIDIA's performance libraries, zluda_trace will log both the call to that library, and then all of the calls made by that library call. That looks like: ``` cublasCreate_v2(handle: 0x55e502373120) -> CUBLAS_STATUS_SUCCESS cuGetProcAddress_v2(symbol: "", pfn: 0x0, cudaVersion: 0, flags: 0, symbolStatus: NULL) -> CUDA_ERROR_NOT_FOUND ``` The call to `cublasCreate_v2` is making a call to `cuGetProcAddress_v2`. ### module_0001_01.elf This is precompiled SASS assembly for a single GPU architecture. ### module_0001_02.ptx This is PTX assembly that is portable across many NVIDIA GPUs. ```bash cat /tmp/zluda/add/module_0001_02.ptx # // # // # // # // # // # // # # .version 8.7 # .target sm_80 # .address_size 64 # # // # # .visible .entry _Z3addiiPi( # .param .u32 _Z3addiiPi_param_0, # .param .u32 _Z3addiiPi_param_1, # .param .u64 _Z3addiiPi_param_2 # ) # { # .reg .b32 %r<4>; # .reg .b64 %rd<3>; # # # ld.param.u32 %r1, [_Z3addiiPi_param_0]; # ld.param.u32 %r2, [_Z3addiiPi_param_1]; # ld.param.u64 %rd1, [_Z3addiiPi_param_2]; # cvta.to.global.u64 %rd2, %rd1; # add.s32 %r3, %r2, %r1; # st.global.u32 [%rd2], %r3; # ret; # # } ``` This is the `add` function from `add.cu`. `_Z3addiiPi` is the `add(int, int, int*)` after [C++ name mangling](https://en.wikipedia.org/wiki/Name_mangling). ### Compiler logs There's one more kind of file zluda_trace might produce: a compiler error log file. When zluda_trace encounters a PTX module, it tries to compile it with ZLUDA's PTX compiler. Any errors produced will be saved into a `module_NNNN_NN.log` file. For example, it might look like ``` Unrecognized statement "nanosleep.u32 %r101;" ``` We use this information to discover which PTX instructions are used by the application and not supported by ZLUDA. ================================================ FILE: ext/detours/.github/ISSUE_TEMPLATE/bug-report.md ================================================ --- name: Bug Report about: Report a bug in Detours title: "
: Problem" labels: 'bug' assignees: '' --- **Describe the bug** A clear and concise description of what the bug is. Please check that you've read the guidelines for submitting a bug report in the [Bug Reports](https://github.com/microsoft/Detours/wiki/FAQ#bug-reports) section of the FAQ. **Command-line test case** ``` C:\Temp>type repro.cpp #include #include #include void main() { // Replace this program with one demonstrating your actual bug report, // along with the following compilation command. Please leave compiler // version banners in the output (don't use /nologo), and include output // of your test program, if any. std::cout << "Test Case Result: "; if (DetourIsHelperProcess()) { std::cout << "Fail\n"; } else { std::cout << "Pass\n"; } } C:\Temp>cl.exe /EHsc /W4 /WX .\repro.cpp -I. ..\lib.X64\detours.lib Microsoft (R) C/C++ Optimizing Compiler Version 19.27.29111 for x64 Copyright (C) Microsoft Corporation. All rights reserved. repro.cpp Microsoft (R) Incremental Linker Version 14.27.29111.0 Copyright (C) Microsoft Corporation. All rights reserved. /out:repro.exe repro.obj ..\lib.X64\detours.lib C:\Temp>.\repro.exe Test Case Result: Pass ``` **Expected behavior** A clear and concise description of what you expected to happen. Alternatively, include `static_assert` or `assert` lines in your test case above whose failure clearly indicates the problem. **Detours version** * Option 1: Release version * Displayed on the releases page: https://github.com/microsoft/Detours/releases/ * Example: ``` Version 4.0.1 of Detours ``` * Option 2: git commit hash * Example: ``` https://github.com/microsoft/Detours/commit/2195148 ``` **Additional context** Add any other context about the problem here. ================================================ FILE: ext/detours/.github/ISSUE_TEMPLATE/question.md ================================================ --- name: Question about: Ask a question about Detours title: "" labels: question assignees: '' --- Instructions ============ Here, you can ask a question about Detours, and a maintainer or someone from the community will answer. Please read the examples below, then delete all of this text and replace it with your question. If you aren't sure whether a question is on-topic, just go ahead and ask it! :-) Please make sure to check the Wiki, esspecially the FAQ, to make sure your question hasn't been answered there already: https://github.com/microsoft/Detours/wiki/FAQ On-Topic Examples ----------------- * What is this code in the Detours doing? You can link to the relevant code: https://help.github.com/en/github/managing-your-work-on-github/creating-a-permanent-link-to-a-code-snippet * What are the preferred conventions for writing something? * What are the maintainers planning to do in the future? * Would the maintainers be interested in specific enhancements? Off-Topic Examples ------------------ * Questions about non-Detours components, such as the compiler, the Windows API, the Visual Studio IDE, etc. * Questions about whether you've encountered a bug in Detours. Instead of this Question template, please use the Bug Report template, because we'll need a command-line test case and the other information requested there. ================================================ FILE: ext/detours/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md ================================================ ================================================ FILE: ext/detours/.github/codeql/codeql-config.yml ================================================ --- name: "Detours CodeQL Config" queries: - uses: security-and-quality - uses: security-extended ================================================ FILE: ext/detours/.github/workflows/main.yml ================================================ name: CI-Build env: # Turn on msvc analysis during build, enable once warnings are clean. DETOURS_ANALYZE: true # Compile in parallel where possible. CL: /MP # Triggers the workflow on push or pull request events for the master branch. on: push: branches: [ master ] pull_request: branches: [ master ] jobs: build: runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [windows-2019, windows-2016] arch: [x86, x64, x64_arm, x64_arm64] steps: - name: Clone Repository uses: actions/checkout@v2 with: # Must fetch at least the immediate parents so that if this is # a pull request then we can checkout the head of the pull request. # Only include this option if you are running this workflow on pull requests. fetch-depth: 2 # If this run was triggered by a pull request event then checkout # the head of the pull request instead of the merge commit. # Only include this step if you are running this workflow on pull requests. - name: Checkout head of the pull request run: git checkout HEAD^2 if: ${{ github.event_name == 'pull_request' }} # Setup build environment variables using vcvarsall.bat. - name: Configure MSCV Compiler for ${{ matrix.arch }} uses: ilammy/msvc-dev-cmd@v1.4.1 with: arch: ${{ matrix.arch }} - name: Initialize CodeQL for C++ uses: github/codeql-action/init@v1 if: ${{ matrix.os == 'windows-2019' }} with: languages: cpp config-file: ./.github/codeql/codeql-config.yml - name: Build Detours for ${{ matrix.arch }} on ${{ matrix.os }} env: # Tell detours what process to target DETOURS_TARGET_PROCESSOR: ${{ env.VSCMD_ARG_TGT_ARCH }} run: nmake - name: Run unit tests for ${{ matrix.arch }} on ${{ matrix.os }} id: run-unit-tests run: cd tests && nmake test if: ${{ matrix.arch == 'x86' || matrix.arch == 'x64' }} - name: Upload artifacts for ${{ matrix.arch }} on ${{ matrix.os }} uses: actions/upload-artifact@v2 with: name: artifacts-${{ matrix.os }} path: | lib.*/ bin.*/ include/ - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v1 if: ${{ matrix.os == 'windows-2019' }} ================================================ FILE: ext/detours/.gitignore ================================================ # C extensions *.so # Unit test / coverage reports .coverage .tox nosetests.xml # Translations *.mo # Mr Developer .mr.developer.cfg .project .pydevproject # vim *~ *.swp # Visual Studio build *.ipch .vs/ output/ include/ *.exp *.pdb *.lib *.dll *.exe obj.* *.ipdb *.iobj *.tlog *.log *.obj *.user *.recipe /bin.* *.vcxproj.FileListAbsolute.txt *.vcxprojAssemblyReference.cache ================================================ FILE: ext/detours/CREDITS.TXT ================================================ ============================================================================== The following individuals have helped identify specific bugs and improvements in Detours. The entire Detours community has benefited from their help. ============================================================================== * Jay Krell: Identified error in DetourFindPayload that caused a incorrect failure when pcbData is NULL. (Build_342) * Jay Krell: Identified issue with VirtualSize == 0 files created in NT 3.1 images. (Build_339) * Igor Odnovorov: Identified an issue with the placement of the trampoline region when a function is detoured twice and the second trampoline region is outside of the +/- 2GB range of the target. (Build_337) * Jay Krell: Identified need for some programs to enumerate the address of IAT entries. (Build_336) * Calvin Hsia: Identified need for some program to change the excluded system region. (Build_336) * Adam Smith: Identified error in failure handling when VirtualProect cannot make pages executable because the Prohibit Dynamic Code Generation mitigation policy has been applied to a process. (Build_335) * Ben Faull: Identified fix to detour_alloc_region_from_lo and detour_alloc_region_from_hi that preserves ASLR entropy. (Build_334) * Shaoxiang Su: Reported errors building with Visual Studio 2015. (Build_332) * Jay Krell: Identified and resolved significant gaps in the X86, X64 and IA64 disassemblers for instruction found in code, but seldom found in function prologues. (Build_331) * Allan Murphy: Identify error in rep and jmp ds: encodings. (Build_331) * Philip Bacon: Identified incorrect entry point return for pure resource-only binaries. (Build_330) * Jay Krell: Identified failure in DetourAttachEx to update nAlign. (Build_330) * Sumit Sarin: Helped debug error with packed binaries. (Build_329) * Nitya Kumar Sharma: Reported bug in DetourAfterWithDll for 32/64 agnostic EXEs. (Build_327) * Richard Black: Identified a large number of typos in documentation. (Build_326) * Michael Bilodeau: Identified bug in DetourUpdateProcessWithDll when the target process contains a Detours payload *after* all valid PE binaries. (Build_324) * Meera Jindal: Reported bug in identification of target address in DetourCopyInstruction for jmp[] and call[] on x86 & x64, the ff15 and ff25 opcodes. (Build_323) * Ken Johnson: Assistance with SAL 2.0 annotations. (Build_319) * Nick Wood: Identified bug in DetourFindFunction on ARM. (Build_314) * Mark Russinovich: Helped debug DetourCreateProcessWithDllEx. (Build_314) * John Lin: Implementation idea for DetoursCreateProcessWithDllEx. (Build_314) * Andrew Zawadowskiy Reported an improper memory page permissions vulnerability in Detours 2.1. (Vulnerability does not exist in versions later than Detours 2.1.) (Build_223) * Nightxie: Identified bug in detour_alloc_round_up_to_region. (Build_310) * Diana Milirud: Identified bug in B* instructions on ARM. (Build_309) * Juan Carlos Identified correct MSIL entry point for unsigned MSIL. Luciani: (Build_308) * Lee Hunt Suggested improvements in algorithm for allocation of Lawrence Landauer trampoline regions on x64 to avoid collisions with Joe Laughlin: system DLLs. (Build_307) * Tyler Sims Identified bug in handling of "anycpu" MSIL binaries Darren Kennedy: on x64. (Build_307) * Andre Vachon: Help with optimized binaries. (Build 301) * Chris Mann: Identified fix not forward ported from 2.2 to 3.0. (Build_301) * Mark Irving: Identified bug with EXEs missing second import table. (Build_300) * Ben Schwarz: Identified bug in handling of multi-byte NOPs. (Build_300) * Aaron Giles Coded initial ARM/Thumb2 disassembler. Jared Henderson: (Build_300) * Doug Brubacher: Coded initial x86 disassembler. (Build_100) ================================================ FILE: ext/detours/LICENSE.md ================================================ # Copyright (c) Microsoft Corporation All rights reserved. # MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: ext/detours/Makefile ================================================ ############################################################################## ## ## Makefile for Detours. ## ## Microsoft Research Detours Package ## ## Copyright (c) Microsoft Corporation. All rights reserved. ## ROOT = . !include "$(ROOT)\system.mak" all: cd "$(MAKEDIR)" @if exist "$(MAKEDIR)\core\makefile" cd "$(MAKEDIR)\core" && $(MAKE) /NOLOGO /$(MAKEFLAGS) cd "$(MAKEDIR)\src" @$(MAKE) /NOLOGO /$(MAKEFLAGS) cd "$(MAKEDIR)\samples" @$(MAKE) /NOLOGO /$(MAKEFLAGS) cd "$(MAKEDIR)\tests" @$(MAKE) /NOLOGO /$(MAKEFLAGS) @if exist "$(MAKEDIR)\bugs\makefile" cd "$(MAKEDIR)\bugs" && $(MAKE) /NOLOGO /$(MAKEFLAGS) cd "$(MAKEDIR)" clean: cd "$(MAKEDIR)" @if exist "$(MAKEDIR)\core\makefile" cd "$(MAKEDIR)\core" && $(MAKE) /NOLOGO /$(MAKEFLAGS) clean cd "$(MAKEDIR)\src" @$(MAKE) /NOLOGO /$(MAKEFLAGS) clean cd "$(MAKEDIR)\samples" @$(MAKE) /NOLOGO /$(MAKEFLAGS) clean cd "$(MAKEDIR)\tests" @$(MAKE) /NOLOGO /$(MAKEFLAGS) clean @if exist "$(MAKEDIR)\bugs\makefile" cd "$(MAKEDIR)\bugs" && $(MAKE) /NOLOGO /$(MAKEFLAGS) clean cd "$(MAKEDIR)" realclean: clean cd "$(MAKEDIR)" @if exist "$(MAKEDIR)\core\makefile" cd "$(MAKEDIR)\core" && $(MAKE) /NOLOGO /$(MAKEFLAGS) realclean cd "$(MAKEDIR)\src" @$(MAKE) /NOLOGO /$(MAKEFLAGS) realclean cd "$(MAKEDIR)\samples" @$(MAKE) /NOLOGO /$(MAKEFLAGS) realclean cd "$(MAKEDIR)\tests" @$(MAKE) /NOLOGO /$(MAKEFLAGS) realclean @if exist "$(MAKEDIR)\bugs\makefile" cd "$(MAKEDIR)\bugs" && $(MAKE) /NOLOGO /$(MAKEFLAGS) realclean cd "$(MAKEDIR)" -rmdir /q /s $(INCDS) 2> nul -rmdir /q /s $(LIBDS) 2> nul -rmdir /q /s $(BINDS) 2> nul -rmdir /q /s dist 2> nul -del docsrc\detours.chm 2> nul -del /q *.msi 2>nul -del /q /f /s *~ 2>nul test: cd "$(MAKEDIR)\samples" @$(MAKE) /NOLOGO /$(MAKEFLAGS) test cd "$(MAKEDIR)\tests" @$(MAKE) /NOLOGO /$(MAKEFLAGS) test cd "$(MAKEDIR)" ################################################################# End of File. ================================================ FILE: ext/detours/README.md ================================================ # Microsoft Research Detours Package Detours is a software package for monitoring and instrumenting API calls on Windows. Detours has been used by many ISVs and is also used by product teams at Microsoft. Detours is now available under a standard open source license ([MIT](https://github.com/microsoft/Detours/blob/master/LICENSE.md)). This simplifies licensing for programmers using Detours and allows the community to support Detours using open source tools and processes. Detours is compatible with the Windows NT family of operating systems: Windows NT, Windows XP, Windows Server 2003, Windows 7, Windows 8, and Windows 10. It cannot be used by Windows Store apps because Detours requires APIs not available to those applications. This repo contains the source code for version 4.0.1 of Detours. For technical documentation on Detours, see the [Detours Wiki](https://github.com/microsoft/Detours/wiki). For directions on how to build and run samples, see the samples [README.txt](https://github.com/Microsoft/Detours/blob/master/samples/README.TXT) file. ## Contributing The [`Detours`](https://github.com/microsoft/detours) repository is where development is done. Here are some ways you can participate in the project: * [Answer questions](https://github.com/microsoft/detours/issues) about using Detours. * [Improve the Wiki](https://github.com/microsoft/detours/wiki). * [Submit bugs](https://github.com/microsoft/detours/issues) and help us verify fixes and changes as they are checked in. * Review [source code changes](https://github.com/microsoft/detours/pulls). Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com. When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. ## Issues, questions, and feedback * Open an issue on [GitHub Issues](https://github.com/Microsoft/detours/issues). ## Mailing list for announcements The detours-announce mailing list is a low-traffic email list for important announcements about the project, such as the availability of new versions of Detours. To join it, send an email to listserv@lists.research.microsoft.com with a message body containing only the text SUBSCRIBE DETOURS-ANNOUNCE. To leave it, send an email to listserv@lists.research.microsoft.com with a message body containing only the text UNSUBSCRIBE DETOURS-ANNOUNCE. ## License Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the [MIT](LICENSE.md) License. ================================================ FILE: ext/detours/samples/Makefile ================================================ ############################################################################## ## ## Makefile for Detours Test Programs. ## ## Microsoft Research Detours Package ## ## Copyright (c) Microsoft Corporation. All rights reserved. ## ## Note: ## syelog, setdll, and withdll must be built first because a number of the ## other samples depend on them. ## ROOT=.. !include .\common.mak ############################################################################## all: cd "$(MAKEDIR)\syelog" @$(MAKE) /NOLOGO /$(MAKEFLAGS) cd "$(MAKEDIR)\simple" @$(MAKE) /NOLOGO /$(MAKEFLAGS) cd "$(MAKEDIR)\slept" @$(MAKE) /NOLOGO /$(MAKEFLAGS) cd "$(MAKEDIR)\setdll" @$(MAKE) /NOLOGO /$(MAKEFLAGS) cd "$(MAKEDIR)\withdll" @$(MAKE) /NOLOGO /$(MAKEFLAGS) cd "$(MAKEDIR)\cping" @$(MAKE) /NOLOGO /$(MAKEFLAGS) cd "$(MAKEDIR)\disas" @$(MAKE) /NOLOGO /$(MAKEFLAGS) cd "$(MAKEDIR)\dtest" @$(MAKE) /NOLOGO /$(MAKEFLAGS) cd "$(MAKEDIR)\dumpe" @$(MAKE) /NOLOGO /$(MAKEFLAGS) cd "$(MAKEDIR)\dumpi" @$(MAKE) /NOLOGO /$(MAKEFLAGS) cd "$(MAKEDIR)\echo" @$(MAKE) /NOLOGO /$(MAKEFLAGS) !IF "$(DETOURS_TARGET_PROCESSOR)" != "ARM64" cd "$(MAKEDIR)\einst" @$(MAKE) /NOLOGO /$(MAKEFLAGS) !ENDIF !IF "$(DETOURS_TARGET_PROCESSOR)" == "X86" cd "$(MAKEDIR)\excep" @$(MAKE) /NOLOGO /$(MAKEFLAGS) !ENDIF cd "$(MAKEDIR)\comeasy" @$(MAKE) /NOLOGO /$(MAKEFLAGS) cd "$(MAKEDIR)\commem" @$(MAKE) /NOLOGO /$(MAKEFLAGS) !IF "$(DETOURS_TARGET_PROCESSOR)" != "ARM64" cd "$(MAKEDIR)\findfunc" @$(MAKE) /NOLOGO /$(MAKEFLAGS) !ENDIF !IF "$(DETOURS_TARGET_PROCESSOR)" != "ARM" && "$(DETOURS_TARGET_PROCESSOR)" != "ARM64" cd "$(MAKEDIR)\member" @$(MAKE) /NOLOGO /$(MAKEFLAGS) !ENDIF cd "$(MAKEDIR)\region" @$(MAKE) /NOLOGO /$(MAKEFLAGS) !IF "$(DETOURS_TARGET_PROCESSOR)" == "X64" || "$(DETOURS_TARGET_PROCESSOR)" == "IA64" cd "$(MAKEDIR)\talloc" @$(MAKE) /NOLOGO /$(MAKEFLAGS) !ENDIF cd "$(MAKEDIR)\traceapi" @$(MAKE) /NOLOGO /$(MAKEFLAGS) cd "$(MAKEDIR)\tracebld" @$(MAKE) /NOLOGO /$(MAKEFLAGS) cd "$(MAKEDIR)\tracemem" @$(MAKE) /NOLOGO /$(MAKEFLAGS) cd "$(MAKEDIR)\tracereg" @$(MAKE) /NOLOGO /$(MAKEFLAGS) cd "$(MAKEDIR)\traceser" @$(MAKE) /NOLOGO /$(MAKEFLAGS) cd "$(MAKEDIR)\tracessl" @$(MAKE) /NOLOGO /$(MAKEFLAGS) cd "$(MAKEDIR)\tracetcp" @$(MAKE) /NOLOGO /$(MAKEFLAGS) cd "$(MAKEDIR)\tracelnk" @$(MAKE) /NOLOGO /$(MAKEFLAGS) !IF "$(DETOURS_TARGET_PROCESSOR)" != "ARM" && "$(DETOURS_TARGET_PROCESSOR)" != "ARM64" cd "$(MAKEDIR)\tryman" @$(MAKE) /NOLOGO /$(MAKEFLAGS) !ENDIF cd "$(MAKEDIR)\impmunge" @$(MAKE) /NOLOGO /$(MAKEFLAGS) cd "$(MAKEDIR)\dynamic_alloc" @$(MAKE) /NOLOGO /$(MAKEFLAGS) cd "$(MAKEDIR)" clean: cd "$(MAKEDIR)\syelog" @$(MAKE) /NOLOGO /$(MAKEFLAGS) clean cd "$(MAKEDIR)\simple" @$(MAKE) /NOLOGO /$(MAKEFLAGS) clean cd "$(MAKEDIR)\slept" @$(MAKE) /NOLOGO /$(MAKEFLAGS) clean cd "$(MAKEDIR)\setdll" @$(MAKE) /NOLOGO /$(MAKEFLAGS) clean cd "$(MAKEDIR)\withdll" @$(MAKE) /NOLOGO /$(MAKEFLAGS) clean cd "$(MAKEDIR)\cping" @$(MAKE) /NOLOGO /$(MAKEFLAGS) clean cd "$(MAKEDIR)\disas" @$(MAKE) /NOLOGO /$(MAKEFLAGS) clean cd "$(MAKEDIR)\dtest" @$(MAKE) /NOLOGO /$(MAKEFLAGS) clean cd "$(MAKEDIR)\dumpe" @$(MAKE) /NOLOGO /$(MAKEFLAGS) clean cd "$(MAKEDIR)\dumpi" @$(MAKE) /NOLOGO /$(MAKEFLAGS) clean cd "$(MAKEDIR)\echo" @$(MAKE) /NOLOGO /$(MAKEFLAGS) clean cd "$(MAKEDIR)\einst" @$(MAKE) /NOLOGO /$(MAKEFLAGS) clean cd "$(MAKEDIR)\excep" @$(MAKE) /NOLOGO /$(MAKEFLAGS) clean cd "$(MAKEDIR)\comeasy" @$(MAKE) /NOLOGO /$(MAKEFLAGS) clean cd "$(MAKEDIR)\commem" @$(MAKE) /NOLOGO /$(MAKEFLAGS) clean cd "$(MAKEDIR)\findfunc" @$(MAKE) /NOLOGO /$(MAKEFLAGS) clean cd "$(MAKEDIR)\member" @$(MAKE) /NOLOGO /$(MAKEFLAGS) clean cd "$(MAKEDIR)\region" @$(MAKE) /NOLOGO /$(MAKEFLAGS) clean cd "$(MAKEDIR)\talloc" @$(MAKE) /NOLOGO /$(MAKEFLAGS) clean cd "$(MAKEDIR)\traceapi" @$(MAKE) /NOLOGO /$(MAKEFLAGS) clean cd "$(MAKEDIR)\tracebld" @$(MAKE) /NOLOGO /$(MAKEFLAGS) clean cd "$(MAKEDIR)\tracemem" @$(MAKE) /NOLOGO /$(MAKEFLAGS) clean cd "$(MAKEDIR)\tracereg" @$(MAKE) /NOLOGO /$(MAKEFLAGS) clean cd "$(MAKEDIR)\traceser" @$(MAKE) /NOLOGO /$(MAKEFLAGS) clean cd "$(MAKEDIR)\tracessl" @$(MAKE) /NOLOGO /$(MAKEFLAGS) clean cd "$(MAKEDIR)\tracetcp" @$(MAKE) /NOLOGO /$(MAKEFLAGS) clean cd "$(MAKEDIR)\tracelnk" @$(MAKE) /NOLOGO /$(MAKEFLAGS) clean cd "$(MAKEDIR)\tryman" @$(MAKE) /NOLOGO /$(MAKEFLAGS) clean cd "$(MAKEDIR)\impmunge" @$(MAKE) /NOLOGO /$(MAKEFLAGS) clean cd "$(MAKEDIR)\dynamic_alloc" @$(MAKE) /NOLOGO /$(MAKEFLAGS) clean cd "$(MAKEDIR)" -rmdir lib32 2>nul -rmdir lib64 2>nul -rmdir include 2>nul realclean: cd "$(MAKEDIR)\syelog" @$(MAKE) /NOLOGO /$(MAKEFLAGS) realclean cd "$(MAKEDIR)\simple" @$(MAKE) /NOLOGO /$(MAKEFLAGS) realclean cd "$(MAKEDIR)\slept" @$(MAKE) /NOLOGO /$(MAKEFLAGS) realclean cd "$(MAKEDIR)\setdll" @$(MAKE) /NOLOGO /$(MAKEFLAGS) realclean cd "$(MAKEDIR)\withdll" @$(MAKE) /NOLOGO /$(MAKEFLAGS) realclean cd "$(MAKEDIR)\cping" @$(MAKE) /NOLOGO /$(MAKEFLAGS) realclean cd "$(MAKEDIR)\disas" @$(MAKE) /NOLOGO /$(MAKEFLAGS) realclean cd "$(MAKEDIR)\dtest" @$(MAKE) /NOLOGO /$(MAKEFLAGS) realclean cd "$(MAKEDIR)\dumpe" @$(MAKE) /NOLOGO /$(MAKEFLAGS) realclean cd "$(MAKEDIR)\dumpi" @$(MAKE) /NOLOGO /$(MAKEFLAGS) realclean cd "$(MAKEDIR)\echo" @$(MAKE) /NOLOGO /$(MAKEFLAGS) realclean cd "$(MAKEDIR)\einst" @$(MAKE) /NOLOGO /$(MAKEFLAGS) realclean cd "$(MAKEDIR)\excep" @$(MAKE) /NOLOGO /$(MAKEFLAGS) realclean cd "$(MAKEDIR)\comeasy" @$(MAKE) /NOLOGO /$(MAKEFLAGS) realclean cd "$(MAKEDIR)\commem" @$(MAKE) /NOLOGO /$(MAKEFLAGS) realclean cd "$(MAKEDIR)\findfunc" @$(MAKE) /NOLOGO /$(MAKEFLAGS) realclean cd "$(MAKEDIR)\member" @$(MAKE) /NOLOGO /$(MAKEFLAGS) realclean cd "$(MAKEDIR)\region" @$(MAKE) /NOLOGO /$(MAKEFLAGS) realclean cd "$(MAKEDIR)\talloc" @$(MAKE) /NOLOGO /$(MAKEFLAGS) realclean cd "$(MAKEDIR)\traceapi" @$(MAKE) /NOLOGO /$(MAKEFLAGS) realclean cd "$(MAKEDIR)\tracebld" @$(MAKE) /NOLOGO /$(MAKEFLAGS) realclean cd "$(MAKEDIR)\tracemem" @$(MAKE) /NOLOGO /$(MAKEFLAGS) realclean cd "$(MAKEDIR)\tracereg" @$(MAKE) /NOLOGO /$(MAKEFLAGS) realclean cd "$(MAKEDIR)\traceser" @$(MAKE) /NOLOGO /$(MAKEFLAGS) realclean cd "$(MAKEDIR)\tracessl" @$(MAKE) /NOLOGO /$(MAKEFLAGS) realclean cd "$(MAKEDIR)\tracetcp" @$(MAKE) /NOLOGO /$(MAKEFLAGS) realclean cd "$(MAKEDIR)\tracelnk" @$(MAKE) /NOLOGO /$(MAKEFLAGS) realclean cd "$(MAKEDIR)\tryman" @$(MAKE) /NOLOGO /$(MAKEFLAGS) realclean cd "$(MAKEDIR)\impmunge" @$(MAKE) /NOLOGO /$(MAKEFLAGS) realclean cd "$(MAKEDIR)\dynamic_alloc" @$(MAKE) /NOLOGO /$(MAKEFLAGS) realclean cd "$(MAKEDIR)" -rmdir lib32 2>nul -rmdir lib64 2>nul -rmdir include 2>nul test: cd "$(MAKEDIR)\syelog" @$(MAKE) /NOLOGO /$(MAKEFLAGS) test cd "$(MAKEDIR)\simple" @$(MAKE) /NOLOGO /$(MAKEFLAGS) test !IF "$(DETOURS_TARGET_PROCESSOR)" != "ARM64" cd "$(MAKEDIR)\slept" @$(MAKE) /NOLOGO /$(MAKEFLAGS) test cd "$(MAKEDIR)\setdll" @$(MAKE) /NOLOGO /$(MAKEFLAGS) test cd "$(MAKEDIR)\withdll" @$(MAKE) /NOLOGO /$(MAKEFLAGS) test !ENDIF !IF "$(DETOURS_TARGET_PROCESSOR)" == "X86" cd "$(MAKEDIR)\cping" # @$(MAKE) /NOLOGO /$(MAKEFLAGS) test !ENDIF cd "$(MAKEDIR)\disas" @$(MAKE) /NOLOGO /$(MAKEFLAGS) test !IF "$(DETOURS_TARGET_PROCESSOR)" != "ARM64" cd "$(MAKEDIR)\dtest" @$(MAKE) /NOLOGO /$(MAKEFLAGS) test !ENDIF cd "$(MAKEDIR)\dumpe" @$(MAKE) /NOLOGO /$(MAKEFLAGS) test cd "$(MAKEDIR)\dumpi" @$(MAKE) /NOLOGO /$(MAKEFLAGS) test cd "$(MAKEDIR)\echo" @$(MAKE) /NOLOGO /$(MAKEFLAGS) test !IF "$(DETOURS_TARGET_PROCESSOR)" != "ARM64" cd "$(MAKEDIR)\einst" @$(MAKE) /NOLOGO /$(MAKEFLAGS) test !ENDIF !IF "$(DETOURS_TARGET_PROCESSOR)" == "X86" cd "$(MAKEDIR)\excep" # @$(MAKE) /NOLOGO /$(MAKEFLAGS) test !ENDIF !IF "$(DETOURS_TARGET_PROCESSOR)" != "ARM64" cd "$(MAKEDIR)\comeasy" @$(MAKE) /NOLOGO /$(MAKEFLAGS) test cd "$(MAKEDIR)\commem" @$(MAKE) /NOLOGO /$(MAKEFLAGS) test cd "$(MAKEDIR)\findfunc" @$(MAKE) /NOLOGO /$(MAKEFLAGS) test cd "$(MAKEDIR)\member" @$(MAKE) /NOLOGO /$(MAKEFLAGS) test cd "$(MAKEDIR)\region" @$(MAKE) /NOLOGO /$(MAKEFLAGS) test !ENDIF !IF "$(DETOURS_TARGET_PROCESSOR)" == "X64" || "$(DETOURS_TARGET_PROCESSOR)" == "IA64" cd "$(MAKEDIR)\talloc" @$(MAKE) /NOLOGO /$(MAKEFLAGS) test !ENDIF !IF "$(DETOURS_TARGET_PROCESSOR)" != "ARM64" cd "$(MAKEDIR)\traceapi" @$(MAKE) /NOLOGO /$(MAKEFLAGS) test cd "$(MAKEDIR)\tracebld" @$(MAKE) /NOLOGO /$(MAKEFLAGS) test cd "$(MAKEDIR)\tracemem" @$(MAKE) /NOLOGO /$(MAKEFLAGS) test cd "$(MAKEDIR)\tracereg" @$(MAKE) /NOLOGO /$(MAKEFLAGS) test cd "$(MAKEDIR)\traceser" @$(MAKE) /NOLOGO /$(MAKEFLAGS) test !ENDIF # cd "$(MAKEDIR)\tracessl" # @$(MAKE) /NOLOGO /$(MAKEFLAGS) test # cd "$(MAKEDIR)\tracetcp" # @$(MAKE) /NOLOGO /$(MAKEFLAGS) test !IF "$(DETOURS_TARGET_PROCESSOR)" != "ARM64" cd "$(MAKEDIR)\tracelnk" @$(MAKE) /NOLOGO /$(MAKEFLAGS) test !ENDIF cd "$(MAKEDIR)\impmunge" @$(MAKE) /NOLOGO /$(MAKEFLAGS) test cd "$(MAKEDIR)\dynamic_alloc" @$(MAKE) /NOLOGO /$(MAKEFLAGS) test cd "$(MAKEDIR)" ## ################################################################# End of File. ================================================ FILE: ext/detours/samples/README.TXT ================================================ ############################################################################## ## ## Samples README File ## ## Microsoft Research Detours Package ## ## Copyright (c) Microsoft Corporation. All rights reserved. ## This README file describes how to set up your build environment, build samples, and run tests. BUILD ENVIRONMENT: ================== We assume that you have a version of the Visual Studio IDE installed. You can download a free copy of the Visual Studio IDE from https://visualstudio.microsoft.com. During Visual Studio installation, make sure that C/C++ tools are installed and that the Windows SDK is installed. Clone the Detours git repo to a directory on your machine. Choose a directory that does not have spaces in the full path name. BUILDING: ========= Open a Developer Command Prompt for VS. Note there are several different flavors of the command prompt for different target architectures. The default Visual Studio Command prompt targets x86. To target x64, choose the "X64 Native Tools Command Prompt for VS" Change directory to the samples directory for your git repo. To build the samples, type "nmake". Note that you must build setdll and syslog in order to use many of the other sample programs. INSTALLING AND BUILDING VIA VCPKG: ================================== You can download and install detours using the vcpkg(https://github.com/Microsoft/vcpkg) dependency manager: git clone https://github.com/Microsoft/vcpkg.git cd vcpkg ./bootstrap-vcpkg.sh ./vcpkg integrate install vcpkg install detours The detours port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request(https://github.com/Microsoft/vcpkg) on the vcpkg repository. TESTING: ======== Each of the sample directories has a test, which can be invoked by typing "nmake test", to demonstrate the usage of the sample. With very few exceptions, all of the executables also accept a "/?" command to display a usage message. To run all sample tests, change directory to the samples directory and type "nmake test". Note that some samples are architecture-specific. Tests for those samples be run only on supported architectures and will be skipped on other architectures. COMMENTS: ========= The trace* samples log their output through the syelogd.exe daemon and hook CreateProcessW to load themselves into any child processes. For example, typing "withdll -d:traceapi.dll cmd.exe" will create a command shell under which all processes log their API calls through traceapi.dll. ================================================ FILE: ext/detours/samples/comeasy/Makefile ================================================ ############################################################################## ## ## API Extension to Measure time slept. ## ## Microsoft Research Detours Package ## ## Copyright (c) Microsoft Corporation. All rights reserved. ## !include ..\common.mak LIBS=$(LIBS) kernel32.lib ############################################################################## all: dirs \ $(BIND)\wrotei$(DETOURS_BITS).dll \ $(BIND)\comeasy.exe \ !IF $(DETOURS_SOURCE_BROWSING)==1 $(OBJD)\wrotei$(DETOURS_BITS).bsc \ $(OBJD)\comeasy.bsc \ !ENDIF option ############################################################################## clean: -del $(BIND)\wrotei*.* 2>nul -del $(BIND)\comeasy.* 2>nul -del $(BIND)\wrotei.* *~ 2>nul -rmdir /q /s $(OBJD) 2>nul realclean: clean -rmdir /q /s $(OBJDS) 2>nul dirs: @if not exist $(BIND) mkdir $(BIND) && echo. Created $(BIND) @if not exist $(OBJD) mkdir $(OBJD) && echo. Created $(OBJD) ############################################################################## $(OBJD)\wrotei.obj : wrotei.cpp $(OBJD)\wrotei.res : wrotei.rc $(BIND)\wrotei$(DETOURS_BITS).dll $(BIND)\wrotei$(DETOURS_BITS).lib: \ $(OBJD)\wrotei.obj $(OBJD)\wrotei.res $(DEPS) cl /LD $(CFLAGS) /Fe$(@R).dll /Fd$(@R).pdb \ $(OBJD)\wrotei.obj $(OBJD)\wrotei.res \ /link $(LINKFLAGS) /subsystem:console \ /export:DetourFinishHelperProcess,@1,NONAME \ $(LIBS) ole32.lib $(OBJD)\wrotei$(DETOURS_BITS).bsc : $(OBJD)\wrotei.obj bscmake /v /n /o $@ $(OBJD)\wrotei.sbr $(OBJD)\comeasy.obj : comeasy.cpp $(BIND)\comeasy.exe : $(OBJD)\comeasy.obj $(DEPS) cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb \ $(OBJD)\comeasy.obj \ /link $(LINKFLAGS) $(LIBS) ole32.lib \ /subsystem:console /fixed:no $(OBJD)\comeasy.bsc : $(OBJD)\comeasy.obj bscmake /v /n /o $@ $(OBJD)\comeasy.sbr ############################################### Install non-bit-size binaries. !IF "$(DETOURS_OPTION_PROCESSOR)" != "" $(OPTD)\wrotei$(DETOURS_OPTION_BITS).dll: $(OPTD)\wrotei$(DETOURS_OPTION_BITS).pdb: $(BIND)\wrotei$(DETOURS_OPTION_BITS).dll : $(OPTD)\wrotei$(DETOURS_OPTION_BITS).dll @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\wrotei$(DETOURS_OPTION_BITS).pdb : $(OPTD)\wrotei$(DETOURS_OPTION_BITS).pdb @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). option: \ $(BIND)\wrotei$(DETOURS_OPTION_BITS).dll \ $(BIND)\wrotei$(DETOURS_OPTION_BITS).pdb \ !ELSE option: !ENDIF ############################################################################## test: all @echo -------- Reseting test binaries to initial state. ----------------------- $(BIND)\setdll.exe -r $(BIND)\comeasy.exe @echo. @echo -------- Should not load slept$(DETOURS_BITS).dll -------------------------------------- $(BIND)\comeasy.exe @echo. @echo -------- Adding wrotei$(DETOURS_BITS).dll to comeasy.exe ------------------------------ $(BIND)\setdll.exe -d:$(BIND)\wrotei$(DETOURS_BITS).dll $(BIND)\comeasy.exe @echo. @echo -------- Should load wrotei$(DETOURS_BITS).dll ---------------------------------------- $(BIND)\comeasy.exe @echo. @echo -------- Removing wrotei$(DETOURS_BITS).dll from comeasy.exe -------------------------- $(BIND)\setdll.exe -r $(BIND)\comeasy.exe @echo. @echo -------- Should not load wrotei$(DETOURS_BITS).dll ------------------------------------ $(BIND)\comeasy.exe @echo. @echo -------- Should load wrotei$(DETOURS_BITS).dll dynamically using withdll.exe ---------- $(BIND)\withdll.exe -d:$(BIND)\wrotei$(DETOURS_BITS).dll $(BIND)\comeasy.exe @echo. @echo -------- Test completed. ------------------------------------------------ ################################################################# End of File. ================================================ FILE: ext/detours/samples/comeasy/comeasy.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detour Test Program (comeasy.cpp of comeasy.exe) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include #include #include ////////////////////////////////////////////////////////////////////////////// // int __cdecl main(int argc, char **argv) { HRESULT hr; (void)argc; (void)argv; LPSTREAM pStream = NULL; ULARGE_INTEGER ul; LARGE_INTEGER li; printf("comeasy.exe: Starting (at %p).\n", main); CoInitialize(NULL); hr = CreateStreamOnHGlobal(NULL, TRUE, &pStream); ul.QuadPart = 512; hr = pStream->SetSize(ul); li.QuadPart = 0; hr = pStream->Seek(li, STREAM_SEEK_SET, NULL); printf("comeasy.exe: First write.\n"); fflush(stdout); li.QuadPart = 0; hr = pStream->Write(&ul, sizeof(ul), NULL); printf("comeasy.exe: Second write.\n"); fflush(stdout); li.QuadPart = 1; hr = pStream->Write(&li, sizeof(li), NULL); printf("comeasy.exe: Third write.\n"); fflush(stdout); li.QuadPart = 2; hr = pStream->Write(&li, sizeof(li), NULL); pStream->Release(); pStream = NULL; CoUninitialize(); printf("comeasy.exe: Exiting.\n\n"); fflush(stdout); return 0; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/comeasy/wrotei.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detour Test Program (wrotei.cpp of wrotei.dll) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // // An example dynamically detouring a function. // #include ////////////////////////////////////////////////////////////////////////////// // // WARNING: // // CINTERFACE must be defined so that the lpVtbl pointer is visible // on COM interfaces. However, once we've defined it, we must use // coding conventions when accessing interface members, for example: // i->lpVtbl->Write // instead of the C++ syntax: // i->Write. // We must also pass the implicit "this" parameter explicitly: // i->lpVtbl->Write(i, pb, 0, NULL) // instead of the C++ syntax: // i->Write(pb, 0, NULL) // #define CINTERFACE #include #include #include ////////////////////////////////////////////////////////////////////////////// // LONG dwWrote = 0; static int (WINAPI * TrueEntryPoint)(VOID) = NULL; static int (WINAPI * RawEntryPoint)(VOID) = NULL; ////////////////////////////////////////////////////////////////////////////// // HRESULT (STDMETHODCALLTYPE *RealIStreamWrite)(IStream * This, const void *pv, ULONG cb, ULONG *pcbWritten) = NULL; HRESULT STDMETHODCALLTYPE MineIStreamWrite(IStream * This, const void *pv, ULONG cb, ULONG *pcbWritten) { HRESULT hr; ULONG cbWritten = 0; if (pcbWritten == NULL) { pcbWritten = &cbWritten; } hr = RealIStreamWrite(This, pv, cb, pcbWritten); for (;;) { LONG dwOld = dwWrote; LONG dwNew = dwOld + *pcbWritten; if (InterlockedCompareExchange(&dwWrote, dwNew, dwOld) == dwOld) { break; } } return hr; } ////////////////////////////////////////////////////////////////////////////// // int WINAPI TimedEntryPoint(VOID) { // We couldn't call CoInitializeEx in DllMain, // so we detour the vtable entries here... LONG error; LPSTREAM pStream = NULL; // Create a temporary object so we can get a vtable. CreateStreamOnHGlobal(NULL, TRUE, &pStream); // Apply the detour to the vtable. DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); if (pStream != NULL) { RealIStreamWrite = pStream->lpVtbl->Write; DetourAttach(&(PVOID&)RealIStreamWrite, MineIStreamWrite); } error = DetourTransactionCommit(); if (pStream != NULL) { pStream->lpVtbl->Release(pStream); pStream = NULL; } if (error == NO_ERROR) { printf("wrotei" DETOURS_STRINGIFY(DETOURS_BITS) ".dll:" " Detoured IStream::Wrote() from OnHGlobal.\n"); } else { printf("wrotei" DETOURS_STRINGIFY(DETOURS_BITS) ".dll:" " Error detouring IStram::Wrote(): %ld\n", error); } printf("wrotei" DETOURS_STRINGIFY(DETOURS_BITS) ".dll:" " Calling EntryPoint\n\n"); fflush(stdout); return TrueEntryPoint(); } BOOL WINAPI DllMain(HINSTANCE hinst, DWORD dwReason, LPVOID reserved) { LONG error; (void)hinst; (void)reserved; if (DetourIsHelperProcess()) { return TRUE; } if (dwReason == DLL_PROCESS_ATTACH) { DetourRestoreAfterWith(); printf("wrotei" DETOURS_STRINGIFY(DETOURS_BITS) ".dll:" " Starting.\n"); fflush(stdout); // NB: DllMain can't call LoadLibrary, so we hook the app entry point. TrueEntryPoint = (int (WINAPI *)(VOID))DetourGetEntryPoint(NULL); RawEntryPoint = TrueEntryPoint; DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)TrueEntryPoint, TimedEntryPoint); error = DetourTransactionCommit(); if (error == NO_ERROR) { printf("wrotei" DETOURS_STRINGIFY(DETOURS_BITS) ".dll:" " Detoured EntryPoint().\n"); } else { printf("wrotei" DETOURS_STRINGIFY(DETOURS_BITS) ".dll:" " Error detouring EntryPoint(): %ld\n", error); } } else if (dwReason == DLL_PROCESS_DETACH) { DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); if (RealIStreamWrite != NULL) { DetourDetach(&(PVOID&)RealIStreamWrite, (PVOID)MineIStreamWrite); } DetourDetach(&(PVOID&)TrueEntryPoint, TimedEntryPoint); error = DetourTransactionCommit(); printf("wrotei" DETOURS_STRINGIFY(DETOURS_BITS) ".dll:" " Removed IStream::Wrote() detours (%ld), wrote %ld bytes.\n", error, dwWrote); fflush(stdout); } return TRUE; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/comeasy/wrotei.rc ================================================ ////////////////////////////////////////////////////////////////////////////// // // Version information for wrotei.rc. // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include "detver.h" #define VER_INTERNALNAME_STR "wrotei" DETOURS_STRINGIFY(DETOURS_BITS) #define VER_ORIGINALFILENAME_STR "wrotei" DETOURS_STRINGIFY(DETOURS_BITS) ".dll" #define VER_FILEDESCRIPTION_STR "Detours COM Easy Sample" #define VER_COMPANYNAME_STR "Microsoft Corporation" #include "common.ver" ================================================ FILE: ext/detours/samples/commem/Makefile ================================================ ############################################################################## ## ## Makefile for Detours Test Programs. ## ## Microsoft Research Detours Package ## ## Copyright (c) Microsoft Corporation. All rights reserved. ## !include ..\common.mak LIBS=$(LIBS) kernel32.lib all: dirs \ $(BIND)\commem.exe \ !IF $(DETOURS_SOURCE_BROWSING)==1 $(OBJD)\commem.bsc !ENDIF clean: -del *~ *.obj *.sbr 2> nul -del $(BIND)\commem.* 2> nul -rmdir /q /s $(OBJD) 2>nul realclean: clean -rmdir /q /s $(OBJDS) 2>nul dirs: @if not exist $(BIND) mkdir $(BIND) && echo. Created $(BIND) @if not exist $(OBJD) mkdir $(OBJD) && echo. Created $(OBJD) $(BIND)\commem.obj : commem.cpp $(BIND)\commem.exe : $(OBJD)\commem.obj $(DEPS) cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb $(OBJD)\commem.obj \ /link $(LINKFLAGS) $(LIBS) ole32.lib /subsystem:console $(OBJD)\commem.bsc : $(OBJD)\commem.obj bscmake /v /n /o $@ $(OBJD)\commem.sbr ############################################################################## test: $(BIND)\commem.exe @echo. $(BIND)\commem.exe @echo. ################################################################# End of File. ================================================ FILE: ext/detours/samples/commem/commem.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detour functions of a COM interface (commem.cpp of commem.exe) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // // // #include ////////////////////////////////////////////////////////////////////////////// // // WARNING: // // CINTERFACE must be defined so that the lpVtbl pointer is visible // on COM interfaces. However, once we've defined it, we must use // coding conventions when accessing interface members, for example: // i->lpVtbl->Write // instead of the C++ syntax: // i->Write. // We must also pass the implicit "this" parameter explicitly: // i->lpVtbl->Write(i, pb, 0, NULL) // instead of the C++ syntax: // i->Write(pb, 0, NULL) // #define CINTERFACE #include #include #include ////////////////////////////////////////////////////////////////////////////// // HRESULT (STDMETHODCALLTYPE *RealIStreamWrite)(IStream * This, const void *pv, ULONG cb, ULONG *pcbWritten) = NULL; HRESULT STDMETHODCALLTYPE MineIStreamWrite(IStream * This, const void *pv, ULONG cb, ULONG *pcbWritten) { HRESULT hr; ULONG cbWritten = 0; if (pcbWritten == NULL) { pcbWritten = &cbWritten; } printf("commem: %p->IStreamWrite(pv=%p, cb=%ld)\n", This, pv, cb); hr = RealIStreamWrite(This, pv, cb, pcbWritten); printf("commem: %p->IStreamWrite -> %08lx (pcbWritten=%ld)\n", This, hr, *pcbWritten); return hr; } ////////////////////////////////////////////////////////////////////////////// // int main(int argc, char **argv) { HRESULT hr; (void)argc; (void)argv; LPSTREAM pStream = NULL; ULARGE_INTEGER ul; LARGE_INTEGER li; CoInitialize(NULL); hr = CreateStreamOnHGlobal(NULL, TRUE, &pStream); RealIStreamWrite = pStream->lpVtbl->Write; ul.QuadPart = 512; hr = pStream->lpVtbl->SetSize(pStream, ul); li.QuadPart = 0; hr = pStream->lpVtbl->Seek(pStream, li, STREAM_SEEK_SET, NULL); printf("commem: Calling Write w/o before attach.\n"); li.QuadPart = 0; hr = pStream->lpVtbl->Write(pStream, &ul, sizeof(ul), NULL); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)RealIStreamWrite, MineIStreamWrite); DetourTransactionCommit(); printf("commem: Calling Write w/o after attach.\n"); li.QuadPart = 1; hr = pStream->lpVtbl->Write(pStream, &li, sizeof(li), NULL); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourDetach(&(PVOID&)RealIStreamWrite, MineIStreamWrite); DetourTransactionCommit(); printf("commem: Calling Write w/o after detach.\n"); li.QuadPart = 2; hr = pStream->lpVtbl->Write(pStream, &li, sizeof(li), NULL); hr = pStream->lpVtbl->Release(pStream); pStream = NULL; CoUninitialize(); return 0; } ================================================ FILE: ext/detours/samples/common.mak ================================================ ############################################################################## ## ## Common makefile for Detours test programs. ## ## Microsoft Research Detours Package ## ## Copyright (c) Microsoft Corporation. All rights reserved. ## !IF "$(ROOT)" == "" ROOT = ..\.. !ENDIF !include "$(ROOT)\system.mak" !IF "$(DETOURS_SOURCE_BROWSING)" == "" DETOURS_SOURCE_BROWSING=0 !ENDIF ############################################################################## !IFNDEF CLIB CLIB=/MT !ENDIF AFLAGS=/nologo /Zi /c /Fl CFLAGS=/nologo /Zi $(CLIB) /Gm- /W4 /WX /we4777 /we4800 /Od !IF $(DETOURS_SOURCE_BROWSING)==1 CFLAGS=$(CFLAGS) /FR !ELSE CFLAGS=$(CFLAGS) /I$(INCD) !ENDIF LIBFLAGS=/nologo LINKFLAGS=/release /incremental:no /profile /nodefaultlib:oldnames.lib !if defined(DETOURS_WIN_7) && defined(DETOURS_CL_17_OR_NEWER) CFLAGS=$(CFLAGS) /D_USING_V110_SDK71_ !endif !IF "$(DETOURS_TARGET_PROCESSOR)" == "X86" ASM=ml !ELSEIF "$(DETOURS_TARGET_PROCESSOR)" == "X64" ASM=ml64 !ELSEIF "$(DETOURS_TARGET_PROCESSOR)" == "IA64" ASM=ias AFLAGS=-F COFF32_PLUS CFLAGS=$(CFLAGS) /wd4163 # intrinsic rdtebex not available; using newer Windows headers with older compiler #CFLAGS=$(CFLAGS) /wd4996 /wd4068 !ELSEIF "$(DETOURS_TARGET_PROCESSOR)" == "ARM" ASM=armasm AFLAGS=-coff_thumb2_only CFLAGS=$(CFLAGS) /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE CFLAGS=$(CFLAGS) /D_$(DETOURS_TARGET_PROCESSOR:X64=AMD64)_ # redundant with windows.h except for midl proxies !ENDIF DEPS = $(LIBD)\syelog.lib $(LIBD)\detours.lib LIBS = $(DEPS) ############################################################################## ## .SUFFIXES: .cpp .h .obj .rc .res !ifdef DETOURS_ANALYZE .cpp{$(OBJD)}.obj: $(CC) $(CFLAGS) /Fd$(OBJD)\vc.pdb /Fo$(OBJD)\ /c $< !else .cpp{$(OBJD)}.obj:: $(CC) $(CFLAGS) /Fd$(OBJD)\vc.pdb /Fo$(OBJD)\ /c $< !endif .rc{$(OBJD)}.res: rc /nologo /DDETOURS_BITS=$(DETOURS_BITS) /fo$(@) /i$(INCD) $(*B).rc ## ################################################################# End of File. ================================================ FILE: ext/detours/samples/cping/Makefile ================================================ ############################################################################## ## ## Makefile for Detours Test Programs. ## ## Microsoft Research Detours Package ## ## Copyright (c) Microsoft Corporation. All rights reserved. ## !include ..\common.mak LIBS=$(LIBS) \ kernel32.lib \ user32.lib \ shell32.lib \ uuid.lib \ ole32.lib \ rpcrt4.lib \ advapi32.lib \ wsock32.lib \ # RpcProxy.h uses #ifdef WIN32. !if "$(DETOURS_TARGET_PROCESSOR)" == "ARM" CFLAGS = $(CFLAGS) /D_WIN32_WINNT=0x0500 !else CFLAGS = $(CFLAGS) /D_WIN32_WINNT=0x0400 !endif CFLAGS = $(CFLAGS) /Fd$(OBJD)\vc.pdb \ /DCONST_VTABLE \ /DCOBJMACROS -DWIN32 -DNT C__FLAGS=-DENTRY_PREFIX=iping_ -DREGISTER_PROXY_DLL CPPFLAGS= ############################################################################## .SUFFIXES: .c .cpp .h .idl .obj .res .rc {$(OBJD)}.c{$(OBJD)}.obj: $(CC) $(CFLAGS:/W4=/W3) $(C__FLAGS) /I$(OBJD) /Fo$(OBJD)\ /c $< !ifdef DETOURS_ANALYZE .cpp{$(OBJD)}.obj: $(CC) $(CFLAGS) $(CPPFLAGS) /I$(OBJD) /Fo$(OBJD)\ /c $< !else .cpp{$(OBJD)}.obj:: $(CC) $(CFLAGS) $(CPPFLAGS) /I$(OBJD) /Fo$(OBJD)\ /c $< !endif .rc{$(OBJD)}.res: rc /nologo /Fo$@ .\$(*B).rc ############################################################################## ## C__FLAGS=-DENTRY_PREFIX=iping_ -DREGISTER_PROXY_DLL CPPFLAGS= MIDLFLAGS=/nologo /Oif /no_format_opt !IF "$(DETOURS_TARGET_PROCESSOR)" == "X86" MIDLFLAGS=$(MIDLFLAGS) /no_robust /win32 !ELSEIF "$(DETOURS_TARGET_PROCESSOR)" == "IA64" MIDLFLAGS=$(MIDLFLAGS) /ia64 !ELSEIF "$(DETOURS_TARGET_PROCESSOR)" == "X64" MIDLFLAGS=$(MIDLFLAGS) /x64 !ELSEIF "$(DETOURS_TARGET_PROCESSOR)" == "ARM" MIDLFLAGS=$(MIDLFLAGS) /arm32 !ELSEIF "$(DETOURS_TARGET_PROCESSOR)" == "ARM64" MIDLFLAGS=$(MIDLFLAGS) /arm64 !ENDIF OBJS = \ $(OBJD)\cping.obj \ \ $(OBJD)\iping_i.obj \ $(OBJD)\iping_p.obj \ $(OBJD)\iping_d.obj \ ############################################################################## all: dirs \ $(BIND)\cping.exe \ !IF $(DETOURS_SOURCE_BROWSING)==1 $(OBJD)\cping.bsc !ENDIF ############################################################################## clean: -del iping.h *.c *.obj *.sbr *~ 2>nul -del $(BIND)\cping.* 2>nul -rmdir /q /s $(OBJD) 2>nul realclean: clean -rmdir /q /s $(OBJDS) 2>nul ############################################################################## dirs: @if not exist $(BIND) mkdir $(BIND) && echo. Created $(BIND) @if not exist $(OBJD) mkdir $(OBJD) && echo. Created $(OBJD) $(OBJD)\cping.bsc : $(OBJS) bscmake /v /n /o $@ $(OBJS:.obj=.sbr) $(BIND)\cping.exe : $(OBJS) $(DEPS) cl $(CFLAGS) /Fe$@ $(OBJS) /link $(LINKFLAGS) \ /subsystem:console $(LIBS) $(OBJD)\cping.obj: cping.cpp $(OBJD)\iping.h ############################################################################## ## $(OBJD)\iping.h $(OBJD)\iping_d.c $(OBJD)\iping_i.c $(OBJD)\iping_p.c : iping.idl midl $(MIDLFLAGS) /out $(OBJD) /prefix all iping_ /dlldata iping_d.c iping.idl $(OBJD)\iping_i.obj: $(OBJD)\iping_i.c $(OBJD)\iping_p.obj: $(OBJD)\iping_p.c $(OBJD)\iping.h $(OBJD)\iping_d.obj: $(OBJD)\iping_d.c ############################################################################## test: $(BIND)\cping.exe start $(BIND)\cping.exe /s $(BIND)\cping.exe /p localhost ################################################################# End of File. ================================================ FILE: ext/detours/samples/cping/ReadMe.Txt ================================================ Microsoft Research Detours Package ============================================================================== 4/2/98 * Instrumentation: Read Pentium cycle counter * PC configuration: DCOM/TCP, Windows NT Server 4.0, between two 300MHz Pentium boxes, Ethernet connecction * Client test program: HRESULT get(SHORT, SHORT, LONG*) average over 1,000 calls midl /Oicf * Results: get() { <-- (1) IRpcChannelBuffer::SendReceive()) { <-- (2) I_RpcSendReceive() { <-- (3) send(soc, ) <-- (4) NtWaitForSingleObject(soc, ) <-- (5) } // end of RPC layer <-- (6) } // end of channel object <-- (7) } // end of client call Average number of Pentium cycles (1) NDR marshaling overhead (2 SHORTs) 13 K (No! of which 11K from GetBuffer, of which 6.2K from I_RpcGetBuffer()!) (2) Channel object one-way (send) overhead 1.0 K (3) RPC layer one-way (send) overhead 5.3 K (4) TCP + all server work 200 K (5) RPC layer one-way (recv) overhead 5.1 K (6) Channel object one-way (recv) overhead 2.2 K (7) NDR unmarshaling overhead (2 LONGs) 4.2 K (*) send() only 17 K TOTAL CYCLES for client get(): 230 K ================================================ FILE: ext/detours/samples/cping/cping.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Module: cping.cpp (cping.exe) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // // COM Ping text program. // #define _RPCRT4_ #define INITGUID #include #include #include #include #include #include #include #include #pragma warning(push) #if _MSC_VER > 1400 #pragma warning(disable:6102 6103) // /analyze warnings #endif #include #pragma warning(pop) #include #include #include #include #include "iping.h" // ARM64 ReadTimeStampCounter is a function. // ARM ReadTimeStampCounter is a declared function but not implemented. // old IA64: ReadTimeStampCounter nonexisant. // new IA64: ReadTimeStampCounter is a macro. // old x86; ReadTimeStampCounter is a function. // new x86: ReadTimeStampCounter is a macro. // AMD64: ReadTimeStampCounter is a macro. #if defined(_ARM64_) || defined(ReadTimeStampCounter) #define GetTimeStamp() ReadTimeStampCounter() #elif defined(_X86_) || defined(_AMD64_) extern "C" DWORD64 __rdtsc ( VOID ); #pragma intrinsic(__rdtsc) #define GetTimeStamp() __rdtsc() #else UINT64 GetTimeStamp(void) { LARGE_INTEGER a = { 0 }; QueryPerformanceCounter(&a); return a.QuadPart; } #endif #define BE_VERBOSE ////////////////////////////////////////////////////////// Assertion Handling. // #pragma warning(disable:4127) // Many of our asserts are constants. #ifndef NODEBUG #undef ASSERT VOID PingAssertMessage(CONST PCHAR szMsg, CONST PCHAR szFile, ULONG nLine); #define ASSERT(x) \ do { if (!((int)(x))) { PingAssertMessage(#x, __FILE__, __LINE__); DebugBreak(); }} while (0) ; #else // NODEBUG #undef ASSERT #define ASSERT(x) #endif // NODEBUG ////////////////////////////////////////////////////////////////////////////// #define wcssize(x) ((wcslen(x) + 1) * sizeof(WCHAR)) #define strsize(x) ((strlen(x) + 1) * sizeof(CHAR)) extern "C" { ULONG WINAPI iping_DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved); HRESULT STDAPICALLTYPE iping_DllRegisterServer(void); HRESULT STDAPICALLTYPE iping_DllUnregisterServer(void); HRESULT STDAPICALLTYPE iping_DllGetClassObject(REFCLSID rclsid, REFIID riid, PVOID *ppv); HRESULT STDAPICALLTYPE iping_DllCanUnloadNow(void); } STDAPI PingMessage(PCSTR msg, ...); ///////////////////////////////////////////////////////////////////// Globals. void * g_pBuffer = NULL; WCHAR g_wzServerName[128]; WCHAR g_wzClientName[128]; ULONG g_cbBufferMax = 262144; double g_dCyclesPerSecond = 0.0; double g_dMsPerCycle = 0.0; double g_dLatency = 0.0; BOOL g_fSummarize = TRUE; ULONG g_nFixedToClient = 0; ULONG g_nFixedToServer = 0; ////////////////////////////////////////////////////////////////////////////// // static CHAR s_szMessageBuf[2048]; STDAPI PingMessage(PCSTR msg, ...) { HRESULT hr; double d = 0.0; // Required for FP support (void)d; va_list args; va_start(args, msg); hr = StringCchVPrintfA(s_szMessageBuf, ARRAYSIZE(s_szMessageBuf), msg, args); va_end(args); if (FAILED(hr)) { return hr; } // OutputDebugStringA(s_szMessageBuf); printf("%s", s_szMessageBuf); return S_FALSE; } VOID PingAssertMessage(CONST PCHAR szMsg, CONST PCHAR szFile, ULONG nLine) { PingMessage("%08lx ASSERT(%s) failed in %s, line %d.\n", GetCurrentThreadId(), szMsg, szFile, nLine); printf("ASSERT(%s) failed in %s, line %ld.\n", szMsg, szFile, nLine); } BOOLEAN CheckResult(HRESULT hr, PCSTR pszMsg, ...) { if (FAILED(hr)) { HRESULT ihr; va_list args; va_start(args, pszMsg); ihr = StringCchVPrintfA(s_szMessageBuf, ARRAYSIZE(s_szMessageBuf), pszMsg, args); va_end(args); if (FAILED(ihr)) { return FALSE; } printf(" %-57.57s -> %08lx\n", s_szMessageBuf, hr); return FALSE; } return TRUE; } ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// // #define NTSYSAPI DECLSPEC_IMPORT #define NTAPI __stdcall #define NTSTATUS LONG #define PIO_APC_ROUTINE PVOID typedef struct { NTSTATUS Status; LONG Information; } *PIO_STATUS_BLOCK; NTSTATUS (NTAPI *Real_NtWaitForSingleObject)(HANDLE Handle, BOOLEAN Alertable, PLARGE_INTEGER Timeout) = NULL; NTSTATUS (NTAPI *Real_NtDeviceIoControlFile)(HANDLE FileHandle, HANDLE Event, PIO_APC_ROUTINE ApcRoutine, PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, ULONG IoControlCode, PVOID InputBuffer, ULONG InputBufferLength, PVOID OutputBuffer, ULONG OutputBufferLength) = NULL; ////////////////////////////////////////////////////////////////////////////// // static LONG s_nInCall = 0; static ULONG s_nThread = 0; enum { E_MinValue = 0, E_SleepEx = 1, E_Proxy, E_I_RpcGetBuffer, E_I_RpcSendReceive, E_I_RpcFreeBuffer, E_I_RpcSend, E_I_RpcReceive, E_I_RpcFreePipeBuffer, E_I_RpcReallocPipeBuffer, E_I_RpcRequestMutex, E_I_RpcClearMutex, E_I_RpcAllocate, E_I_RpcFree, E_I_RpcPauseExecution, E_I_RpcMonitorAssociation, E_I_RpcStopMonitorAssociation, E_Recv, E_RecvFrom, E_NtWaitForSingleObject, E_NtDeviceIoControlFileRecv, E_NtDeviceIoControlFile, E_Send, E_SendTo, E_NtDeviceIoControlFileSend, E_DCOM, E_RPC, E_UDP, E_NET, E_MaxValue, E_DcomBeg = E_Proxy, E_DcomEnd = E_Proxy, E_RpcBeg = E_I_RpcGetBuffer, E_RpcEnd = E_I_RpcStopMonitorAssociation, E_UdpBeg = E_Send, E_UdpEnd = E_NtDeviceIoControlFileSend, E_NetBeg = E_Recv, E_NetEnd = E_NtDeviceIoControlFile, }; PCHAR s_rszRouteNames[E_MaxValue] = { "", "SleepEx", "Proxy", "I_RpcGetBuffer", "I_RpcSendReceive", "I_RpcFreeBuffer", "I_RpcSend", "I_RpcReceive", "I_RpcFreePipeBuffer", "I_RpcReallocPipeBuffer", "I_RpcRequestMutex", "I_RpcClearMutex", "I_RpcAllocate", "I_RpcFree", "I_RpcPauseExecution", "I_RpcMonitorAssociation", "I_RpcStopMonitorAssociation", "Recv", "RecvFrom", "NtWaitForSingleObject", "NtDeviceIoControlRecv", "NtDeviceIoControlFile", "Send", "SendTo", "NtDeviceIoControlSend", "DCOM", "RPC", "UDP/TCP (Send Only)", "NET", }; LONGLONG s_rllCycles[E_MaxValue]; LONGLONG s_rllTotals[E_MaxValue]; LONG s_rllCounts[E_MaxValue]; class CRouteTime { public: inline CRouteTime(LONG nRoute) { if (s_nInCall && GetCurrentThreadId() == s_nThread) { LONGLONG llBeg; m_nOldRoute = s_nRoute; m_llOldMinus = s_llMinus; s_nRoute = m_nRoute = nRoute; s_rllCounts[m_nRoute]++; s_llMinus = 0; ASSERT(m_nRoute != m_nOldRoute); llBeg = GetTimeStamp(); m_llBeg = llBeg; } else { m_nRoute = 0; } } inline ~CRouteTime() { if (m_nRoute) { LONGLONG llEnd = GetTimeStamp(); llEnd -= m_llBeg; s_rllTotals[m_nRoute] += llEnd; s_rllCycles[m_nRoute] += llEnd - s_llMinus; s_nRoute = m_nOldRoute; s_llMinus = m_llOldMinus + llEnd; } } inline BOOL Routed() { return m_nRoute; } public: ULONG m_nRoute; ULONG m_nOldRoute; LONGLONG m_llBeg; LONGLONG m_llOldMinus; static ULONG s_nRoute; static LONGLONG s_llMinus; }; ULONG CRouteTime::s_nRoute = 0; LONGLONG CRouteTime::s_llMinus = 0; VOID ZeroCycles(VOID) { for (ULONG n = 0; n < E_MaxValue; n++) { s_rllCycles[n] = 0; s_rllTotals[n] = 0; s_rllCounts[n] = 0; } } VOID DumpCycles(LONG nRoute) { if (s_rllCycles[nRoute] != 0 || s_rllTotals[nRoute] != 0) { printf(";; %-21.21s %10I64d %8.3fms %10I64d %8.3fms :%6ld\n", s_rszRouteNames[nRoute], s_rllCycles[nRoute], (double)s_rllCycles[nRoute] * g_dMsPerCycle, s_rllTotals[nRoute], (double)s_rllTotals[nRoute] * g_dMsPerCycle, s_rllCounts[nRoute]); } } VOID SummarizeCycles(VOID) { ULONG n; for (n = E_DCOM; n <= E_NET; n++) { s_rllCycles[n] = 0; s_rllTotals[n] = 0; s_rllCounts[n] = 0; } for (n = E_DcomBeg; n <= E_DcomEnd; n++) { s_rllCycles[E_DCOM] += s_rllCycles[n]; s_rllTotals[E_DCOM] += s_rllTotals[n]; } for (n = E_RpcBeg; n <= E_RpcEnd; n++) { s_rllCycles[E_RPC] += s_rllCycles[n]; s_rllTotals[E_RPC] += s_rllTotals[n]; } for (n = E_UdpBeg; n <= E_UdpEnd; n++) { s_rllCycles[E_UDP] += s_rllCycles[n]; s_rllTotals[E_UDP] += s_rllTotals[n]; } for (n = E_NetBeg; n <= E_NetEnd; n++) { s_rllCycles[E_NET] += s_rllCycles[n]; s_rllTotals[E_NET] += s_rllTotals[n]; } #ifdef BE_VERBOSE printf("::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::" "::::::::::::::::::\n"); printf(":: Protocol Cycles:\n"); DumpCycles(E_DCOM); DumpCycles(E_RPC); DumpCycles(E_UDP); DumpCycles(E_NET); #endif s_rllCycles[E_DCOM] /= s_rllCounts[E_DCOM]; s_rllCycles[E_RPC] /= s_rllCounts[E_DCOM]; s_rllCycles[E_UDP] /= s_rllCounts[E_DCOM]; s_rllCycles[E_NET] /= s_rllCounts[E_DCOM]; s_rllTotals[E_DCOM] /= s_rllCounts[E_DCOM]; s_rllTotals[E_RPC] /= s_rllCounts[E_DCOM]; s_rllTotals[E_UDP] /= s_rllCounts[E_DCOM]; s_rllTotals[E_NET] /= s_rllCounts[E_DCOM]; #ifdef BE_VERBOSE printf("::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::" "::::::::::::::::::\n"); printf(":: Protocol Cycles Per DCOM Call:\n"); DumpCycles(E_DCOM); DumpCycles(E_RPC); DumpCycles(E_UDP); DumpCycles(E_NET); #endif for (n = 0; n < E_DCOM; n++) { s_rllCycles[n] = 0; s_rllTotals[n] = 0; s_rllCounts[n] = 0; } } ////////////////////////////////////////////////////////////////////////////// // DWORD (WINAPI * Real_SleepEx)(DWORD dwMilliseconds, BOOL bAlertable) = SleepEx; int (WSAAPI * Real_send)(SOCKET s, const char * buf, int len, int flags) = send; int (WSAAPI * Real_sendto)(SOCKET s, const char * buf, int len, int flags, const struct sockaddr * to, int tolen) = sendto; int (WSAAPI * Real_recv)(SOCKET s, char * buf, int len, int flags) = recv; int (WSAAPI * Real_recvfrom)(SOCKET s,char * buf, int len, int flags, struct sockaddr * from, int * fromlen) = recvfrom; RPC_STATUS (RPC_ENTRY * Real_I_RpcGetBuffer)(RPC_MESSAGE * Message) = I_RpcGetBuffer; RPC_STATUS (RPC_ENTRY * Real_I_RpcSendReceive)(RPC_MESSAGE * Message) = I_RpcSendReceive; RPC_STATUS (RPC_ENTRY * Real_I_RpcFreeBuffer)(RPC_MESSAGE * Message) = I_RpcFreeBuffer; RPC_STATUS (RPC_ENTRY * Real_I_RpcSend)(PRPC_MESSAGE Message) = I_RpcSend; RPC_STATUS (RPC_ENTRY * Real_I_RpcReceive)(PRPC_MESSAGE Message, unsigned int Size) = I_RpcReceive; RPC_STATUS (RPC_ENTRY * Real_I_RpcFreePipeBuffer)(RPC_MESSAGE * Message) = I_RpcFreePipeBuffer; RPC_STATUS (RPC_ENTRY * Real_I_RpcReallocPipeBuffer)(PRPC_MESSAGE Msg, unsigned int Size) = I_RpcReallocPipeBuffer; void (RPC_ENTRY * Real_I_RpcRequestMutex)(I_RPC_MUTEX * Mutex) = I_RpcRequestMutex; void (RPC_ENTRY * Real_I_RpcClearMutex)(I_RPC_MUTEX Mutex) = I_RpcClearMutex; void * (RPC_ENTRY * Real_I_RpcAllocate)(unsigned int Size) = I_RpcAllocate; void (RPC_ENTRY * Real_I_RpcFree)(void * Object) = I_RpcFree; void (RPC_ENTRY * Real_I_RpcPauseExecution)(unsigned long Milliseconds) = I_RpcPauseExecution; #if _MSC_VER < 1300 RPC_STATUS (RPC_ENTRY * Real_I_RpcMonitorAssociation)(RPC_BINDING_HANDLE Handle, PRPC_RUNDOWN RundownRoutine, void * Context) = I_RpcMonitorAssociation; RPC_STATUS (RPC_ENTRY * Real_I_RpcStopMonitorAssociation)(RPC_BINDING_HANDLE Handle) = I_RpcStopMonitorAssociation; #endif ////////////////////////////////////////////////////////////////////////////// // static DWORD WINAPI Catch_SleepEx(DWORD dwMilliseconds, BOOL bAlertable) { CRouteTime rt(E_SleepEx); return Real_SleepEx(dwMilliseconds, bAlertable); } static int WSAAPI Catch_send(SOCKET s, const char * buf, int len, int flags) { CRouteTime rt(E_Send); return Real_send(s, buf, len, flags); } static NTSTATUS NTAPI Catch_NtWaitForSingleObject(HANDLE Handle, BOOLEAN Alertable, PLARGE_INTEGER Timeout) { CRouteTime rt(E_NtWaitForSingleObject); if (rt.Routed()) { //printf("WaitForSingle(%d, %I64d)\n", Alertable, Timeout->QuadPart); } return Real_NtWaitForSingleObject(Handle, Alertable, Timeout); } #define IO_CONTROL_AFD_SEND_DATAGRAM 0x12023 #define IO_CONTROL_AFD_SEND 0x1201f #define IO_CONTROL_AFD_RECV_DATAGRAM 0x1201b #define IO_CONTROL_AFD_RECV 0x12017 static NTSTATUS NTAPI Catch_NtDeviceIoControlFile(HANDLE FileHandle, HANDLE Event, PIO_APC_ROUTINE ApcRoutine, PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, ULONG IoControlCode, PVOID InputBuffer, ULONG InputBufferLength, PVOID OutputBuffer, ULONG OutputBufferLength) { if (IoControlCode == IO_CONTROL_AFD_SEND_DATAGRAM || IoControlCode == IO_CONTROL_AFD_SEND) { CRouteTime rt(E_NtDeviceIoControlFileSend); NTSTATUS NtStatus = Real_NtDeviceIoControlFile(FileHandle, Event, ApcRoutine, ApcContext, IoStatusBlock, IoControlCode, InputBuffer, InputBufferLength, OutputBuffer, OutputBufferLength); if (NtStatus == STATUS_PENDING) { LARGE_INTEGER li; li.QuadPart = INFINITE; Real_NtWaitForSingleObject(Event, FALSE, &li); NtStatus = IoStatusBlock->Status; } return NtStatus; } else if (IoControlCode == IO_CONTROL_AFD_RECV_DATAGRAM || IoControlCode == IO_CONTROL_AFD_RECV) { CRouteTime rt(E_NtDeviceIoControlFileRecv); return Real_NtDeviceIoControlFile(FileHandle, Event, ApcRoutine, ApcContext, IoStatusBlock, IoControlCode, InputBuffer, InputBufferLength, OutputBuffer, OutputBufferLength); } else { CRouteTime rt(E_NtDeviceIoControlFile); if (rt.Routed()) { printf("IoControlCode: %08lx\n", IoControlCode); __debugbreak(); } return Real_NtDeviceIoControlFile(FileHandle, Event, ApcRoutine, ApcContext, IoStatusBlock, IoControlCode, InputBuffer, InputBufferLength, OutputBuffer, OutputBufferLength); } } static RPC_STATUS RPC_ENTRY Catch_I_RpcGetBuffer(RPC_MESSAGE * Message) { CRouteTime rt(E_I_RpcGetBuffer); return Real_I_RpcGetBuffer(Message); } static RPC_STATUS RPC_ENTRY Catch_I_RpcSendReceive(RPC_MESSAGE * Message) { CRouteTime rt(E_I_RpcSendReceive); return Real_I_RpcSendReceive(Message); } static RPC_STATUS RPC_ENTRY Catch_I_RpcFreeBuffer(RPC_MESSAGE * Message) { CRouteTime rt(E_I_RpcFreeBuffer); return Real_I_RpcFreeBuffer(Message); } static RPC_STATUS RPC_ENTRY Catch_I_RpcSend(PRPC_MESSAGE Message) { CRouteTime rt(E_I_RpcSend); return Real_I_RpcSend(Message); } static RPC_STATUS RPC_ENTRY Catch_I_RpcReceive(PRPC_MESSAGE Message, unsigned int Size) { CRouteTime rt(E_I_RpcReceive); return Real_I_RpcReceive(Message, Size); } static RPC_STATUS RPC_ENTRY Catch_I_RpcFreePipeBuffer(RPC_MESSAGE * Message) { CRouteTime rt(E_I_RpcFreePipeBuffer); return Real_I_RpcFreePipeBuffer(Message); } static RPC_STATUS RPC_ENTRY Catch_I_RpcReallocPipeBuffer(PRPC_MESSAGE Message, unsigned int NewSize) { CRouteTime rt(E_I_RpcReallocPipeBuffer); return Real_I_RpcReallocPipeBuffer(Message, NewSize); } static void RPC_ENTRY Catch_I_RpcRequestMutex(I_RPC_MUTEX * Mutex) { CRouteTime rt(E_I_RpcRequestMutex); Real_I_RpcRequestMutex(Mutex); } static void RPC_ENTRY Catch_I_RpcClearMutex(I_RPC_MUTEX Mutex) { CRouteTime rt(E_I_RpcClearMutex); Real_I_RpcClearMutex(Mutex); } static void * RPC_ENTRY Catch_I_RpcAllocate(unsigned int Size) { CRouteTime rt(E_I_RpcAllocate); return Real_I_RpcAllocate(Size); } static void RPC_ENTRY Catch_I_RpcFree(void * Object) { CRouteTime rt(E_I_RpcFree); Real_I_RpcFree(Object); } static void RPC_ENTRY Catch_I_RpcPauseExecution(unsigned long Milliseconds) { CRouteTime rt(E_I_RpcPauseExecution); Real_I_RpcPauseExecution(Milliseconds); } #if _MSC_VER < 1300 static RPC_STATUS RPC_ENTRY Catch_I_RpcMonitorAssociation(RPC_BINDING_HANDLE Handle, PRPC_RUNDOWN RundownRoutine, void * Context) { CRouteTime rt(E_I_RpcMonitorAssociation); return Real_I_RpcMonitorAssociation(Handle, RundownRoutine, Context); } static RPC_STATUS RPC_ENTRY Catch_I_RpcStopMonitorAssociation(RPC_BINDING_HANDLE Handle) { CRouteTime rt(E_I_RpcStopMonitorAssociation); return Real_I_RpcStopMonitorAssociation(Handle); } #endif static STDMETHODIMP Catch_IPing_Ping(IPing *pip) { HRESULT hr; InterlockedIncrement(&s_nInCall); { CRouteTime rt(E_Proxy); hr = pip->Ping(); } InterlockedDecrement(&s_nInCall); return hr; } static STDMETHODIMP Catch_IPing_PingToServer(IPing *pip, LPSTR pszString) { HRESULT hr; InterlockedIncrement(&s_nInCall); { CRouteTime rt(E_Proxy); hr = pip->PingToServer(pszString); } InterlockedDecrement(&s_nInCall); return hr; } static STDMETHODIMP Catch_IPing_PingToClient(IPing *pip, LPSTR *ppszString) { HRESULT hr; InterlockedIncrement(&s_nInCall); { CRouteTime rt(E_Proxy); hr = pip->PingToClient(ppszString); } InterlockedDecrement(&s_nInCall); return hr; } ////////////////////////////////////////////////////////////////////////////// // LONG RerouteEntryPoints(VOID) { Real_NtWaitForSingleObject = ((NTSTATUS (NTAPI *)(HANDLE, BOOLEAN, PLARGE_INTEGER)) DetourFindFunction("ntdll.dll", "NtWaitForSingleObject")); Real_NtDeviceIoControlFile = ((NTSTATUS (NTAPI *)(HANDLE, HANDLE, PIO_APC_ROUTINE, PVOID, PIO_STATUS_BLOCK, ULONG, PVOID, ULONG, PVOID, ULONG)) DetourFindFunction("ntdll.dll", "NtDeviceIoControlFile")); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)Real_NtWaitForSingleObject, Catch_NtWaitForSingleObject); DetourAttach(&(PVOID&)Real_NtDeviceIoControlFile, Catch_NtDeviceIoControlFile); DetourAttach(&(PVOID&)Real_SleepEx, Catch_SleepEx); DetourAttach(&(PVOID&)Real_send, Catch_send); DetourAttach(&(PVOID&)Real_I_RpcGetBuffer, Catch_I_RpcGetBuffer); DetourAttach(&(PVOID&)Real_I_RpcSendReceive, Catch_I_RpcSendReceive); DetourAttach(&(PVOID&)Real_I_RpcFreeBuffer, Catch_I_RpcFreeBuffer); DetourAttach(&(PVOID&)Real_I_RpcSend, Catch_I_RpcSend); DetourAttach(&(PVOID&)Real_I_RpcReceive, Catch_I_RpcReceive); DetourAttach(&(PVOID&)Real_I_RpcFreePipeBuffer, Catch_I_RpcFreePipeBuffer); DetourAttach(&(PVOID&)Real_I_RpcReallocPipeBuffer, Catch_I_RpcReallocPipeBuffer); DetourAttach(&(PVOID&)Real_I_RpcRequestMutex, Catch_I_RpcRequestMutex); DetourAttach(&(PVOID&)Real_I_RpcClearMutex, Catch_I_RpcClearMutex); DetourAttach(&(PVOID&)Real_I_RpcAllocate, Catch_I_RpcAllocate); DetourAttach(&(PVOID&)Real_I_RpcFree, Catch_I_RpcFree); DetourAttach(&(PVOID&)Real_I_RpcPauseExecution, Catch_I_RpcPauseExecution); #if _MSC_VER < 1300 DetourAttach(&(PVOID&)Real_I_RpcMonitorAssociation, Catch_I_RpcMonitorAssociation); DetourAttach(&(PVOID&)Real_I_RpcStopMonitorAssociation, Catch_I_RpcStopMonitorAssociation); #endif return DetourTransactionCommit(); } ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// Classes. class CNetPingFactory : public IClassFactory { public: CNetPingFactory(); ~CNetPingFactory(); // IUnknown STDMETHODIMP QueryInterface(REFIID riid, void** ppv); STDMETHODIMP_(ULONG) AddRef(void); STDMETHODIMP_(ULONG) Release(void); // IClassFactory STDMETHODIMP CreateInstance(LPUNKNOWN punkOuter, REFIID iid, void **ppv); STDMETHODIMP LockServer(BOOL fLock); public: static HRESULT InitSystem(VOID); static HRESULT FiniSystem(VOID); static HRESULT InitObject(VOID); static HRESULT FiniObject(VOID); static HRESULT Lock(BOOL fLock); static HRESULT Wait(VOID); private: LONG m_cRef; static HANDLE s_hevtDone; static LONG s_nObjects; static LONG s_nLocks; }; class CNetPingObject : public IPing { public: CNetPingObject(); ~CNetPingObject(); // IUnknown STDMETHODIMP QueryInterface(REFIID iid, void **ppv); STDMETHODIMP_(ULONG) AddRef(void); STDMETHODIMP_(ULONG) Release(void); // IPing STDMETHODIMP Ping(); STDMETHODIMP PingToServer(LPSTR pszString); STDMETHODIMP PingToClient(LPSTR *ppszString); STDMETHODIMP PingToClientSize(ULONG cbOut); private: LONG m_cRef; ULONG m_cbLast; ULONG m_cbOut; }; /////////////////////////////////////////////////////////////////////// GUIDs. DEFINE_GUID(CLSID_NetPingObject, 0xdecdbeed, 0xd1ac, 0x11d1, 0x96, 0xbc, 0x00, 0xaa, 0x00, 0x57, 0x3f, 0xb0); /////////////////////////////////////////////////////////// Initialize String. // void InitializeString(LPSTR pszString, LONG cbSize) { ASSERT(cbSize >= 1); while (cbSize-- > 1) { *pszString++ = '+'; } *pszString = '\0'; } BOOL GetKeyValue(HKEY hRootKey, PWCHAR pwzKey, PWCHAR pwzValueName, PWCHAR pwzValue, DWORD cbValue) { HKEY hKey; WCHAR wzKey[256]; HRESULT hr; hr = StringCchCopyW(wzKey, ARRAYSIZE(wzKey), pwzKey); if (FAILED(hr)) { return FALSE; } if (RegOpenKeyExW(hRootKey, wzKey, 0, KEY_READ, &hKey) != NO_ERROR) { abort: pwzValue[0] = '\0'; return FALSE; } DWORD nType = 0; cbValue -= sizeof(WCHAR); if (RegQueryValueExW(hKey, pwzValueName, 0, &nType, (PBYTE)pwzValue, &cbValue) != NO_ERROR || nType != REG_SZ) { RegCloseKey(hKey); goto abort; } RegCloseKey(hKey); cbValue /= sizeof(WCHAR); pwzValue[cbValue] = L'\0'; return TRUE; } static BOOLEAN SetKeyAndValue(HKEY hRootKey, PWCHAR pwzKey, PWCHAR pwzSubkey, PWCHAR pwzValueName, PWCHAR pwzValue) { HKEY hKey; WCHAR wzKey[256]; HRESULT hr; hr = StringCchCopyW(wzKey, ARRAYSIZE(wzKey), pwzKey); if (FAILED(hr)) { return FALSE; } if (pwzSubkey != NULL) { hr = StringCchCatW(wzKey, ARRAYSIZE(wzKey), L"\\"); if (FAILED(hr)) { return FALSE; } hr = StringCchCatW(wzKey, ARRAYSIZE(wzKey), pwzSubkey); if (FAILED(hr)) { return FALSE; } } if (RegCreateKeyExW(hRootKey, wzKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, NULL) != ERROR_SUCCESS) { return FALSE; } if (pwzValue != NULL) { RegSetValueExW(hKey, pwzValueName, 0, REG_SZ, (BYTE *)pwzValue, (DWORD)wcssize(pwzValue)); } RegCloseKey(hKey); return TRUE; } static BOOLEAN SetKeyAndValue(HKEY hRootKey, PWCHAR pwzKey, PWCHAR pwzSubkey, PWCHAR pwzValueName, PBYTE pbData, ULONG cbData) { HKEY hKey; WCHAR wzKey[256]; HRESULT hr; hr = StringCchCopyW(wzKey, ARRAYSIZE(wzKey), pwzKey); if (FAILED(hr)) { return FALSE; } if (pwzSubkey != NULL) { hr = StringCchCatW(wzKey, ARRAYSIZE(wzKey), L"\\"); if (FAILED(hr)) { return FALSE; } hr = StringCchCatW(wzKey, ARRAYSIZE(wzKey), pwzSubkey); if (FAILED(hr)) { return FALSE; } } if (RegCreateKeyExW(hRootKey, wzKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, NULL) != ERROR_SUCCESS) { return FALSE; } if (pbData != NULL) { RegSetValueExW(hKey, pwzValueName, 0, REG_BINARY, pbData, cbData); } RegCloseKey(hKey); return TRUE; } static void Register(void) { WCHAR wzModule[256]; WCHAR wzName[256]; WCHAR wzValue[256]; WCHAR wzClass[48]; WCHAR wzKey[256]; PWCHAR pwz; HRESULT hr; BYTE rgEveryone[] = { 0x01,0x00,0x04,0x80,0x34,0x00,0x00,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x14,0x00,0x00,0x00,0x02,0x00,0x20,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x18,0x00, 0x01,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x01,0x05,0x00,0x00,0x00,0x00,0x00,0x05,0x15,0x00,0x00,0x00, 0xa0,0x65,0xcf,0x7e,0x78,0x4b,0x9b,0x5f,0xe7,0x7c,0x87,0x70,0x32,0x7f,0x00,0x00, 0x01,0x05,0x00,0x00,0x00,0x00,0x00,0x05,0x15,0x00,0x00,0x00,0xa0,0x65,0xcf,0x7e, 0x78,0x4b,0x9b,0x5f,0xe7,0x7c,0x87,0x70,0x32,0x7f,0x00,0x00 }; GetModuleFileNameW(NULL, wzModule, sizeof(wzModule)/sizeof(WCHAR)); if ((pwz = wcsrchr(wzModule, '\\')) != NULL) { hr = StringCchCopyW(wzName, ARRAYSIZE(wzName), pwz + 1); } else if ((pwz = wcsrchr(wzModule, ':')) != NULL) { hr = StringCchCopyW(wzName, ARRAYSIZE(wzName), pwz + 1); } else { hr = StringCchCopyW(wzName, ARRAYSIZE(wzName), wzModule); } CheckResult(hr, "IPing_DllRegisterServer"); // printf("Server: %ls / %ls\n", wzModule, wzName); StringFromGUID2(CLSID_NetPingObject, wzClass, ARRAYSIZE(wzClass)); // printf(" Class: %ls\n", wzClass); hr = StringCchCopyW(wzKey, ARRAYSIZE(wzKey), L"CLSID\\"); CheckResult(hr, "IPing_DllRegisterServer"); hr = StringCchCatW(wzKey, ARRAYSIZE(wzKey), wzClass); CheckResult(hr, "IPing_DllRegisterServer"); SetKeyAndValue(HKEY_CLASSES_ROOT, wzKey, NULL, NULL, L"COM Ping Network Server"); hr = StringCchPrintfW(wzValue, ARRAYSIZE(wzValue), L"%ls /s", wzModule); CheckResult(hr, "IPing_DllRegisterServer"); SetKeyAndValue(HKEY_CLASSES_ROOT, wzKey, L"LocalServer32", NULL, wzValue); SetKeyAndValue(HKEY_CLASSES_ROOT, wzKey, L"LaunchPermission", NULL, L"Y"); SetKeyAndValue(HKEY_CLASSES_ROOT, wzKey, NULL, L"AppID", wzClass); hr = StringCchCopyW(wzKey, ARRAYSIZE(wzKey), L"AppID\\"); CheckResult(hr, "IPing_DllRegisterServer"); hr = StringCchCatW(wzKey, ARRAYSIZE(wzKey), wzClass); CheckResult(hr, "IPing_DllRegisterServer"); SetKeyAndValue(HKEY_CLASSES_ROOT, wzKey, NULL, NULL, L"COM Ping Network Server"); SetKeyAndValue(HKEY_CLASSES_ROOT, wzKey, NULL, L"RunAs", L"Interactive User"); SetKeyAndValue(HKEY_CLASSES_ROOT, wzKey, NULL, L"AccessPermission", rgEveryone, sizeof(rgEveryone)); hr = StringCchCopyW(wzKey, ARRAYSIZE(wzKey), L"AppID\\"); CheckResult(hr, "IPing_DllRegisterServer"); hr = StringCchCatW(wzKey, ARRAYSIZE(wzKey), wzName); CheckResult(hr, "IPing_DllRegisterServer"); SetKeyAndValue(HKEY_CLASSES_ROOT, wzKey, NULL, L"AppID", wzClass); /////////////////////////////////////////////////// Register Proxy & Stub. // iping_DllRegisterServer(); CheckResult(hr, "IPing_DllRegisterServer"); //////////////////////////////////////////////// Register Processor Speed. // DWORD cycles = 0; hr = StringCchCopyW(wzKey, ARRAYSIZE(wzKey), L"Software\\Microsoft\\Detours\\ProcessorCycles"); CheckResult(hr, "IPing_DllRegisterServer"); if (GetKeyValue(HKEY_LOCAL_MACHINE, wzKey, NULL, wzValue, sizeof(wzValue))) { cycles = _wtoi(wzValue); printf("[Recorded Cycles/Second: %ld]\n", cycles); } if (cycles < 10000) { LONGLONG llBeg; LONGLONG llEnd; printf("[Calibrating Processors...]\r"); LARGE_INTEGER liBeg; LARGE_INTEGER liEnd; LARGE_INTEGER liBrk; LARGE_INTEGER liFrq; QueryPerformanceFrequency(&liFrq); QueryPerformanceCounter(&liBeg); llBeg = GetTimeStamp(); liBrk.QuadPart = liBeg.QuadPart + liFrq.QuadPart * 5; do { QueryPerformanceCounter(&liEnd); llEnd = GetTimeStamp(); } while (liEnd.QuadPart < liBrk.QuadPart); double secs = (double)(liEnd.QuadPart - liBeg.QuadPart) / (double)liFrq.QuadPart; double clks = (double)(llEnd - llBeg); double cycs = clks / secs; cycles = (DWORD)cycs; printf("[Measured Cycles/Second: %ld] \n", cycles); hr = StringCchPrintfW(wzValue, ARRAYSIZE(wzValue), L"%d", cycles); CheckResult(hr, "IPing_DllRegisterServer"); SetKeyAndValue(HKEY_LOCAL_MACHINE, wzKey, NULL, NULL, wzValue); } } void Unregister(void) { ///////////////////////////////////////////////// Unregister Proxy & Stub. // HRESULT hr = iping_DllUnregisterServer(); if (FAILED(hr)) { CheckResult(hr, "IPing_DllUnregisterServer"); } } ////////////////////////////////////////////////////////////////////////////// // HRESULT GetClockInfo(LONGLONG *pllCyclesPerSecond) { WCHAR wzKey[512]; WCHAR wzValue[128]; LONG cbValue; HRESULT hr; ////////////////////////////////////////////////////////// Check Registry. cbValue = sizeof(wzValue); hr = StringCchCopyW(wzKey, ARRAYSIZE(wzKey), L"Software\\Microsoft\\Detours\\ProcessorCycles"); CheckResult(hr, "GetClockInfo"); if (RegQueryValueW(HKEY_LOCAL_MACHINE, wzKey, wzValue, &cbValue) == NO_ERROR) { *pllCyclesPerSecond = _wtoi(wzValue); return S_OK; } *pllCyclesPerSecond = 1000000; return E_FAIL; } ///////////////////////////////////////////////////////// CNetPingFactory. // LONG CNetPingFactory::s_nObjects = 0; LONG CNetPingFactory::s_nLocks = 0; HANDLE CNetPingFactory::s_hevtDone = NULL; CNetPingFactory::CNetPingFactory() { m_cRef = 1; } CNetPingFactory::~CNetPingFactory() { m_cRef = 0; } ULONG CNetPingFactory::AddRef(void) { return InterlockedIncrement(&m_cRef); } ULONG CNetPingFactory::Release(void) { if (InterlockedDecrement(&m_cRef) == 0) { delete this; return 0; } return 1; } HRESULT CNetPingFactory::InitSystem(VOID) { s_nObjects = 0; s_nLocks = 0; s_hevtDone = CreateEvent(NULL, FALSE, FALSE, NULL); if (s_hevtDone == NULL) { HRESULT hr = HRESULT_FROM_WIN32(GetLastError()); CheckResult(hr, "Server: CreateEvent"); exit(hr); } return S_OK; } HRESULT CNetPingFactory::FiniSystem(VOID) { if (s_hevtDone != NULL) { CloseHandle(s_hevtDone); s_hevtDone = NULL; } return S_OK; } HRESULT CNetPingFactory::InitObject(VOID) { InterlockedIncrement(&s_nObjects); return S_OK; } HRESULT CNetPingFactory::FiniObject(VOID) { if (InterlockedDecrement(&s_nObjects) == 0 && s_nLocks == 0) SetEvent(s_hevtDone); return S_OK; } HRESULT CNetPingFactory::Lock(BOOL fLock) { if (fLock) { InterlockedIncrement(&s_nLocks); } else { if (InterlockedDecrement(&s_nLocks) == 0 && s_nObjects == 0) SetEvent(s_hevtDone); } return S_OK; } HRESULT CNetPingFactory::Wait(VOID) { DWORD dwWaitResult; MSG msg; for (;;) { dwWaitResult = MsgWaitForMultipleObjects(1, &s_hevtDone, FALSE, INFINITE, QS_ALLINPUT); if (dwWaitResult == WAIT_OBJECT_0) { ResetEvent(s_hevtDone); break; } while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { TranslateMessage(&msg); DispatchMessage(&msg); } } return S_OK; } STDMETHODIMP CNetPingFactory::QueryInterface(REFIID riid, void** ppv) { if (ppv == NULL) { return E_INVALIDARG; } if (riid == IID_IClassFactory || riid == IID_IUnknown) { *ppv = (IClassFactory *) this; AddRef(); return S_OK; } *ppv = NULL; return E_NOINTERFACE; } HRESULT CNetPingFactory::LockServer (BOOL fLock) { return Lock(fLock); } STDMETHODIMP CNetPingFactory::CreateInstance(LPUNKNOWN punkOuter, REFIID riid, void** ppv) { LPUNKNOWN punk; HRESULT hr; *ppv = NULL; if (punkOuter != NULL) { return CLASS_E_NOAGGREGATION; } printf(" Server: IClassFactory:CreateInstance\n"); punk = new CNetPingObject; if (punk == NULL) { return E_OUTOFMEMORY; } hr = punk->QueryInterface(riid, ppv); punk->Release(); return hr; } /////////////////////////////////////////////////////////////// CNetPingObject. // CNetPingObject::CNetPingObject() { m_cRef = 1; m_cbLast = ~0u; m_cbOut = 2; CNetPingFactory::InitObject(); } CNetPingObject::~CNetPingObject() { CNetPingFactory::FiniObject(); } STDMETHODIMP CNetPingObject::QueryInterface(REFIID riid, void** ppv) { if (ppv == NULL) { return E_INVALIDARG; } if (riid == IID_IUnknown || riid == IID_IPing) { *ppv = (IPing *) this; AddRef(); return S_OK; } *ppv = NULL; return E_NOINTERFACE; } STDMETHODIMP_(ULONG) CNetPingObject::AddRef(void) { return InterlockedIncrement(&m_cRef); } STDMETHODIMP_(ULONG) CNetPingObject::Release(void) { if (InterlockedDecrement(&m_cRef) == 0) { delete this; return 0; } return 1; } STDMETHODIMP CNetPingObject::Ping() { return S_OK; } STDMETHODIMP CNetPingObject::PingToServer(LPSTR pszString) { (void)pszString; return S_OK; } STDMETHODIMP CNetPingObject::PingToClient(LPSTR *ppszString) { LPSTR pszString = (LPSTR)CoTaskMemAlloc(m_cbOut); if (pszString == NULL) { return E_OUTOFMEMORY; } CopyMemory(pszString, g_pBuffer, m_cbOut); *ppszString = pszString; return S_OK; } STDMETHODIMP CNetPingObject::PingToClientSize(ULONG cbOut) { if (cbOut < 1) { return E_INVALIDARG; } InitializeString((LPSTR)g_pBuffer, cbOut); m_cbOut = cbOut; return S_OK; } ////////////////////////////////////////////////////////////////////////////// // class CSampleRecord { public: DOUBLE m_dTime; FILETIME m_nWhen; LONG m_cbToClient; LONG m_cbToServer; DOUBLE m_dDcom; DOUBLE m_dRpc; DOUBLE m_dUdp; DOUBLE m_dNet; protected: static LONG s_cbToClient; static LONG s_cbToServer; public: CSampleRecord(); CSampleRecord(IPing *pIPing, LONG cbToClient, LONG cbToServer); HRESULT Measure(IPing *pIPing, LONG cbToClient, LONG cbToServer); HRESULT Write(); double GetTime() { return m_dTime; } FILETIME GetWhen() { return m_nWhen; } LONG GetToClient() { return m_cbToClient; } LONG GetToServer() { return m_cbToServer; } }; ////////////////////////////////////////////////////////////////////////////// // LONG CSampleRecord::s_cbToClient = 0; LONG CSampleRecord::s_cbToServer = 0; ////////////////////////////////////////////////////////////////////////////// // CSampleRecord::CSampleRecord() { m_dTime = 0; m_dDcom = 0; m_dRpc = 0; m_dUdp = 0; m_dNet = 0; } CSampleRecord::CSampleRecord(IPing *pIPing, LONG cbToClient, LONG cbToServer) { Measure(pIPing, cbToClient, cbToServer); } HRESULT CSampleRecord::Measure(IPing *pIPing, LONG cbToClient, LONG cbToServer) { HRESULT hr; LONGLONG llBeg; LONGLONG llEnd; GetSystemTimeAsFileTime(&m_nWhen); m_cbToClient = cbToClient; m_cbToServer = cbToServer; if (cbToClient == 0 && cbToServer == 0) { llBeg = GetTimeStamp(); hr = Catch_IPing_Ping(pIPing); llEnd = GetTimeStamp(); } else if (cbToClient) { if (s_cbToClient != cbToClient) { hr = pIPing->PingToClientSize(cbToClient); s_cbToClient = cbToClient; } LPSTR pszString = NULL; llBeg = GetTimeStamp(); hr = Catch_IPing_PingToClient(pIPing, &pszString); llEnd = GetTimeStamp(); if (pszString) { LONG cb = (LONG)strlen(pszString) + 1; ASSERT(cb == cbToClient); CoTaskMemFree(pszString); pszString = NULL; } } else { if (s_cbToServer != cbToServer) { InitializeString((LPSTR)g_pBuffer, cbToServer); s_cbToServer = cbToServer; } llBeg = GetTimeStamp(); hr = Catch_IPing_PingToServer(pIPing, (LPSTR)g_pBuffer); llEnd = GetTimeStamp(); } if (FAILED(hr)) { printf(";; Operation failed: %08lx\n", hr); exit(999); } if (g_fSummarize) { SummarizeCycles(); m_dDcom = (double)s_rllCycles[E_DCOM] * g_dMsPerCycle; m_dRpc = (double)s_rllCycles[E_RPC] * g_dMsPerCycle; m_dUdp = (double)s_rllCycles[E_UDP] * g_dMsPerCycle; m_dNet = (double)s_rllCycles[E_NET] * g_dMsPerCycle; } m_dTime = (double)(llEnd - llBeg) * g_dMsPerCycle; return S_OK; } HRESULT CSampleRecord::Write() { SYSTEMTIME st; FILETIME ft; FileTimeToLocalFileTime(&m_nWhen, &ft); FileTimeToSystemTime(&ft, &st); printf("%02d/%02d %2d:%02d:%02d %6ld %ld %6.3f [ %6.3f %6.3f %6.3f %6.3f ]\n", st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond, m_cbToClient, m_cbToServer, m_dTime, m_dDcom, m_dRpc, m_dUdp, m_dNet); return S_OK; } ////////////////////////////////////////////////////////////////////////////// // double NetTest(HKEY hNetwork, IPing *pIPing, BOOLEAN fToClient, LONG cbPacket, LONG nCount) { //////////////////////////////////////////////////////////////////// ToClient. // HRESULT hr; double msAvg = 0.0; double msMin = 1.0e12; double msMax = 0.0; ULONG nMax = 999; ULONG nMin = 999; if (fToClient) { printf(">Client %6ld %6ld ", cbPacket, nCount); } else { printf(">Server %6ld %6ld ", cbPacket, nCount); } for (LONG n = 0; n < nCount; n++) { double ms; if (fToClient) { ms = CSampleRecord(pIPing, cbPacket, 0).GetTime(); } else { ms = CSampleRecord(pIPing, 0, cbPacket).GetTime(); } if (ms < 0) { break; } if (msMin > ms) { msMin = ms; nMin = n; } if (msMax < ms) { msMax = ms; nMax = n; } msAvg += ms; } if (nCount) { msAvg /= nCount; } if (cbPacket == 0) { g_dLatency = msMin; } double mbps = (double)cbPacket / msMin; mbps *= 8.0 * 1000.0 / 1024.0 / 1024.0; double mbps2 = (double)cbPacket / (msMin - g_dLatency); mbps2 *= 8.0 * 1000.0 / 1024.0 / 1024.0; if (cbPacket == 0) { mbps2 = 0; } if (hNetwork != NULL) { WCHAR wzKey[64]; WCHAR wzLatency[64]; if (fToClient) { hr = StringCchPrintfW(wzKey, ARRAYSIZE(wzKey), L"ToClient\\%d", cbPacket); CheckResult(hr, "NetTest"); } else { hr = StringCchPrintfW(wzKey, ARRAYSIZE(wzKey), L"ToServer\\%d", cbPacket); CheckResult(hr, "NetTest"); } hr = StringCchPrintfW(wzLatency, ARRAYSIZE(wzLatency), L"%I64d", msAvg); CheckResult(hr, "NetTest"); RegSetValueW(hNetwork, wzKey, REG_SZ, wzLatency, (DWORD)wcssize(wzLatency)); } printf("%8.3f %8.3f %8.3f %9.4f %8.3f %9.4f%3ld\n", msMin, msAvg, msMax, mbps, msMin - g_dLatency, mbps2, nMax); return mbps; } //////////////////////////////////////////////////////////////////////// main. static WCHAR wzServers[32][64]; static int nServers = 0; void Sample_Fixed(IPing *pIPing) { CSampleRecord csrRecords[512]; LONG nRecords = 0; HRESULT hr; double dAvg = 0; double dMin = 500000.0; double dMax = 0.0; double dMinDcom = dMin; double dMinRpc = dMin; double dMinUdp = dMin; double dMinNet = dMin; for (int i = 0; i < 512; i++) { CSampleRecord& csr = csrRecords[nRecords++]; hr = csr.Measure(pIPing, g_nFixedToClient, g_nFixedToServer); double d = csr.GetTime(); if (dMin > d) { dMin = d; } if (dMax < d) { dMax = d; } if (dMinDcom > csr.m_dDcom) { dMinDcom = csr.m_dDcom; } if (dMinRpc > csr.m_dRpc) { dMinRpc = csr.m_dRpc; } if (dMinUdp > csr.m_dUdp) { dMinUdp = csr.m_dUdp; } if (dMinNet > csr.m_dNet) { dMinNet = csr.m_dNet; } dAvg += d; } dAvg /= 512; printf("size: %ld, min: %.3f, max: %.3f avg: %.3f [ %8.3f %8.3f %8.3f %8.3f ]\n", g_nFixedToClient, dMin, dMax, dAvg, dMinDcom, dMinRpc, dMinUdp, dMinNet); for (int n = 0; n < nRecords; n++) { csrRecords[n].Write(); } } void Sample_Simple(IPing *pIPing) { CSampleRecord csrRecords[512]; LONG nRecords = 0; HRESULT hr; for (int cb = 0; cb < 64000; cb = cb ? cb << 1 : 32) { double n[5]; int i = 0; for (; i < 5; i++) { CSampleRecord& csr = csrRecords[nRecords++]; hr = csr.Measure(pIPing, cb, 0); n[i] = csr.GetTime(); } double nAvg = 0; double nApx = 0; double nMin = n[0]; double nMax = n[0]; for (i = 0; i < 5; i++) { if (nMin > n[i]) { nMin = n[i]; } if (nMax < n[i]) { nMax = n[i]; } nAvg += n[i]; } nApx = nAvg - nMax; nAvg /= 5; nApx /= 4; printf("min: %8.3f ms (%6d) %7.3f%7.3f%7.3f%7.3f%7.3f:%8.3f%8.3f\n", nMin, cb, n[0], n[1], n[2], n[3], n[4], nAvg, nApx); } for (int n = 0; n < nRecords; n++) { csrRecords[n].Write(); } } void Sample_More(IPing *pIPing) { CSampleRecord csrRecords[64]; LONG nRecords = 0; for (int cb = 0; cb < 64000; cb = cb ? cb << 1 : 32) { int i = 0; for (; i < 64; i++) { CSampleRecord& csr = csrRecords[nRecords++]; csr.Measure(pIPing, cb, 0); } double nAvg = 0; double nMin = csrRecords[0].GetTime(); double nMax = csrRecords[0].GetTime(); for (i = 0; i < 64; i++) { double n = csrRecords[i].GetTime(); if (nMin > n) { nMin = n; } if (nMax < n) { nMax = n; } nAvg += n; } nAvg /= i; printf("min: %8.3f ms (%6d) : %8.3f %8.3f\n", nMin, cb, nMax, nAvg); for (int n = 0; n < nRecords; n++) { csrRecords[n].Write(); } nRecords = 0; } } void Sample_Less(IPing *pIPing) { CSampleRecord csrRecords[16]; LONG nRecords = 0; for (int cb = 0; cb < 64000; cb = cb ? cb << 1 : 16) { int i = 0; for (; i < 16; i++) { CSampleRecord& csr = csrRecords[nRecords++]; csr.Measure(pIPing, cb, 0); } double nAvg = 0; double nMin = csrRecords[0].GetTime(); double nMax = csrRecords[0].GetTime(); for (i = 0; i < 16; i++) { double n = csrRecords[i].GetTime(); if (nMin > n) { nMin = n; } if (nMax < n) { nMax = n; } nAvg += n; } nAvg /= i; printf("min: %8.3f ms (%6d) : %8.3f %8.3f\n", nMin, cb, nMax, nAvg); for (int n = 0; n < nRecords; n++) { csrRecords[n].Write(); } nRecords = 0; } } void Sample_Profile(IPing *pIPing) { CSampleRecord csrRecords[64]; double dbZero = 0; printf("\nPacket_Size_ Min_Latency Max_Latency Avg_Latency " "Relative_Bnd ___Bandwidth\n"); for (int cb = 0; cb < 256 * 1024;) { int n = 0; for (; n < 64; n++) { CSampleRecord& csr = csrRecords[n]; csr.Measure(pIPing, cb, 0); } double dbAvg = 0; double dbMin = csrRecords[0].GetTime(); double dbMax = csrRecords[0].GetTime(); LONG nMin = 0; LONG nMax = 0; for (n = 0; n < 64; n++) { double db = csrRecords[n].GetTime(); if (dbMin > db) { dbMin = db; nMin = n; } if (dbMax < db) { dbMax = db; nMax = n; } dbAvg += db; } dbAvg /= n; if (cb == 0) { dbZero = dbMin; } double dbBnd = 0; if (dbMin > dbZero) { dbBnd = ((8 * cb) * 1000.0) / (1024 * 1024); dbBnd /= dbMin - dbZero; } double dbReal = ((8 * cb) * 1000.0) / (1024 * 1024) / dbMin; printf("%6d bytes %9.3fms %9.3fms %9.3fms %8.3fMbps %8.3fMbps\r", cb, dbMin, dbMax, dbAvg, dbBnd, dbReal); csrRecords[nMin].Write(); if (cb < 2048) { cb++; } else if (cb < 4096) { cb += 2; } else if (cb < 8192) { cb += 8; } else if (cb < 16384) { cb += 32; } else { cb += 128; } } } ////////////////////////////////////////////////////////////////////////////// // class CInit { public: CInit(HINSTANCE hinst) { m_hinst = hinst; AllocConsole(); // initialize COM for free-threading HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED); if (FAILED(hr)) { CheckResult(hr, "CoInitializeEx"); exit(hr); } ULONG ul = iping_DllMain(m_hinst, DLL_PROCESS_ATTACH, NULL); ASSERT(ul); } ~CInit() { ULONG ul = iping_DllMain(m_hinst, DLL_PROCESS_DETACH, NULL); ASSERT(ul); CoUninitialize(); } private: HINSTANCE m_hinst; }; class CInitStub { public: CInitStub() { m_dwRegister = ~0u; IClassFactory *pClassFactory = NULL; HRESULT hr = iping_DllGetClassObject(IID_IPing, IID_IUnknown, (void **)&pClassFactory); if (FAILED(hr)) { CheckResult(hr, "IPing_DllGetClassObject"); ASSERT(SUCCEEDED(hr)); } if (pClassFactory) { hr = CoRegisterClassObject(IID_IPing, pClassFactory, CLSCTX_SERVER, REGCLS_MULTIPLEUSE, &m_dwRegister); if (FAILED(hr)) { ASSERT(SUCCEEDED(hr)); CheckResult(hr, "CoRegisterClassObject(IID_IPing)\n"); } pClassFactory->Release(); pClassFactory = NULL; } } ~CInitStub() { if (m_dwRegister != ~0u) { CoRevokeClassObject(m_dwRegister); m_dwRegister = ~0u; } } private: DWORD m_dwRegister; }; /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// // int __cdecl main(void) { CInit cinit(GetModuleHandle(NULL)); int argc; WCHAR **argv = CommandLineToArgvW(GetCommandLineW(), &argc); HRESULT hr; BOOLEAN fUnreg = FALSE; BOOLEAN fNeedHelp = FALSE; BOOLEAN fServer = FALSE; BOOLEAN fLong = FALSE; BOOLEAN fProfile = FALSE; BOOLEAN fInstrument = TRUE; BOOLEAN fFixed = FALSE; s_nThread = GetCurrentThreadId(); printf("Ping Network Server: [" __DATE__ " " __TIME__ "]\n"); int arg = 1; for (; arg < argc; arg++) { if (argv[arg][0] == '-' || argv[arg][0] == '/') { WCHAR *argn = argv[arg] + 1; WCHAR *argp = argn; while (*argp && *argp != ':') { argp++; } if (*argp == ':') { *argp++ = '\0'; } switch (argn[0]) { case 'f': // Fixed case 'F': fFixed = TRUE; g_nFixedToClient = _wtoi(argp); g_nFixedToServer = 0; break; case 'i': case 'I': // Instrument fInstrument = !fInstrument; break; case 'n': // Null case 'N': fFixed = TRUE; g_nFixedToClient = g_nFixedToServer = 0; break; case 'l': // Long-term loop case 'L': fLong = !fLong; break; case 'p': // Profile Network case 'P': fProfile = !fProfile; break; case 's': // Server case 'S': fServer = !fServer; break; case 'u': // Unregister case 'U': fUnreg = !fUnreg; break; case 'x': // Xtract Data case 'X': g_fSummarize = !g_fSummarize; break; case '?': // Help fNeedHelp = TRUE; break; case '\0': // Local Host hr = StringCchCopyW(wzServers[nServers++], ARRAYSIZE(wzServers[nServers++]), L"localhost"); if (FAILED(hr)) { return 900; } ASSERT(nServers <= 32); break; default: fNeedHelp = TRUE; printf("Bad argument: %ls\n", argv[arg]); break; } } else { hr = StringCchCopyW(wzServers[nServers++], ARRAYSIZE(wzServers[nServers++]), argv[arg]); if (FAILED(hr)) { return 900; } ASSERT(nServers <= 32); } } if (argc == 1 || (nServers == 0 && !fUnreg && !fServer)) { fNeedHelp = TRUE; } if (fNeedHelp) { printf("Usage:\n" " cping [options] [hosts] ..or.. cping [options] /s\n" "Options:\n" " /u : Unregister.\n" " /s : Act as a server, waiting for clients.\n" " /? : Display this help screen.\n" "Client Options:\n" " /l : Long-term loop test. (Default: %3s)\n" " /p : Profile test. (Default: %3s)\n" " /n : Null (0 length) test. (Default: Off)\n" " /f:size : Fixed sized packets. (Default: %3s)\n" " /x : Xtract detailed DCOM/RPC/NET data. (Default: %3s)\n" " /i : Toggle instrumentation. (Default: %3s)\n", fLong ? "On" : "Off", fProfile ? "On" : "Off", fFixed ? "On" : "Off", g_fSummarize ? "Off" : "Off", fInstrument ? "On" : "Off"); exit(1); } ////////////////////////////////////////////////////////////////////////// if (fUnreg) { Unregister(); } else { ////////////////////////////////////////////////////////////////////////////// // CInitStub cinitstub; // Register in the registry. Register(); if (fInstrument) { RerouteEntryPoints(); } LONGLONG llCycles; hr = GetClockInfo(&llCycles); ASSERT(SUCCEEDED(hr)); g_dCyclesPerSecond = (double)llCycles; g_dMsPerCycle = (double)1000.0 / (double)llCycles; g_pBuffer = CoTaskMemAlloc(g_cbBufferMax); ASSERT(g_pBuffer != NULL); if (fServer) { // register the class-object with OLE CNetPingFactory::InitSystem(); CNetPingFactory *pClassFactory = new CNetPingFactory; printf("Registering.\n"); DWORD dwRegister; hr = CoRegisterClassObject(CLSID_NetPingObject, pClassFactory, CLSCTX_SERVER, REGCLS_MULTIPLEUSE, &dwRegister); printf("Releasing Registered.\n"); pClassFactory->Release(); if (FAILED(hr)) { CheckResult(hr, "Server: CoRegisterClassObject"); ASSERT(SUCCEEDED(hr)); } printf(" Server: Waiting <<>>\n"); while (fServer) { CNetPingFactory::Wait(); } hr = CoRevokeClassObject(dwRegister); if (FAILED(hr)) { CheckResult(hr, "Server: CoRevokeClassObject"); ASSERT(SUCCEEDED(hr)); } CNetPingFactory::FiniSystem(); } else if (nServers) { LONGLONG llBeg; LONGLONG llEnd; COSERVERINFO csi; MULTI_QI mq; ////////////////////////////////////////////////////////////////// // printf("Processor Speed: %.0f MHz\n", g_dCyclesPerSecond / 1000000.0); DWORD dwSize = ARRAYSIZE(g_wzClientName); GetComputerNameW(g_wzClientName, &dwSize); printf(";;; %ls - %.0f MHz\n", g_wzClientName, g_dCyclesPerSecond / 1000000.0); for (int n = 0; n < nServers; n++) { if (g_wzServerName[0] == '\\' && g_wzServerName[1] == '\\') { hr = StringCchCopyW(g_wzServerName, ARRAYSIZE(g_wzServerName), wzServers[n] + 2); } else { hr = StringCchCopyW(g_wzServerName, ARRAYSIZE(g_wzServerName), wzServers[n]); } CheckResult(hr, "Main"); printf("Server: %ls->%ls\n", g_wzClientName, g_wzServerName); printf(";; %ls %ls\n", g_wzClientName, g_wzServerName); ZeroMemory(&csi, sizeof(csi)); csi.pwszName = wzServers[n]; // create a remote instance of the object on the argv[1] machine mq.pIID = &IID_IPing; mq.pItf = NULL; mq.hr = S_OK; llBeg = GetTimeStamp(); hr = CoCreateInstanceEx(CLSID_NetPingObject, NULL, CLSCTX_SERVER, &csi, 1, &mq); llEnd = GetTimeStamp(); printf(" CoCreateInstanceEx: %0.4f seconds (%lu ticks)\n", (double)(llEnd - llBeg)/(double)llCycles, (ULONG)(llEnd - llBeg)); CheckResult(mq.hr, "CoCreateInstanceEx [mq]"); CheckResult(hr, "CoCreateInstanceEx"); if (FAILED(hr)) { CheckResult(hr, "CoCreateInstanceEx"); continue; } ////////////////////////////////////////////////////////////////// // IPing *pIPing = (IPing *)mq.pItf; hr = pIPing->Ping(); if (FAILED(hr)) { CheckResult(hr, "Ping"); } ASSERT(SUCCEEDED(hr)); hr = Catch_IPing_Ping(pIPing); if (FAILED(hr)) { CheckResult(hr, "Ping"); } ASSERT(SUCCEEDED(hr)); ZeroCycles(); if (fFixed) { Sample_Fixed(pIPing); } else if (fProfile) { Sample_Profile(pIPing); } else { Sample_Simple(pIPing); if (fLong) { for (;;) { Sample_More(pIPing); for (int j = 0; j < 5; j++) { Sleep(20000); Sample_Simple(pIPing); } Sleep(20000); for (int i = 0; i < 18; i++) { Sample_Less(pIPing); for (int j = 0; j < 3; j++) { Sleep(20000); Sample_Simple(pIPing); } Sleep(20000); } } } } pIPing->Release(); } } if (g_pBuffer) { CoTaskMemFree(g_pBuffer); g_pBuffer = NULL; } Sleep(2); if (fInstrument && !g_fSummarize && s_rllCounts[E_Proxy]) { printf("::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::" "::::::::::::::::::\n"); printf(":: Instrumented Cycles: _____Function Time__ " "________Total Time__ : Count\n"); LONG n = E_DCOM; for (; n < E_MaxValue; n++) { s_rllCycles[n] = 0; s_rllTotals[n] = 0; s_rllCounts[n] = 0; } for (n = E_MinValue + 1; n < E_MaxValue; n++) { DumpCycles(n); } printf("::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::" "::::::::::::::::::\n"); printf(":: Protocol Cycles:\n"); for (n = E_DcomBeg; n <= E_DcomEnd; n++) { s_rllCycles[E_DCOM] += s_rllCycles[n]; s_rllTotals[E_DCOM] += s_rllTotals[n]; s_rllCounts[E_DCOM] += s_rllCounts[n]; } for (n = E_RpcBeg; n <= E_RpcEnd; n++) { s_rllCycles[E_RPC] += s_rllCycles[n]; s_rllTotals[E_RPC] += s_rllTotals[n]; s_rllCounts[E_RPC] += s_rllCounts[n]; } for (n = E_UdpBeg; n <= E_UdpEnd; n++) { s_rllCycles[E_UDP] += s_rllCycles[n]; s_rllTotals[E_UDP] += s_rllTotals[n]; s_rllCounts[E_UDP] += s_rllCounts[n]; } for (n = E_NetBeg; n <= E_NetEnd; n++) { s_rllTotals[E_NET] += s_rllCycles[n]; s_rllCycles[E_NET] += s_rllTotals[n]; s_rllCounts[E_NET] += s_rllCounts[n]; } DumpCycles(E_DCOM); DumpCycles(E_RPC); DumpCycles(E_UDP); DumpCycles(E_NET); printf("::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::" "::::::::::::::::::\n"); printf(":: Protocol Cycles Per DCOM Call:\n"); s_rllCycles[E_DCOM] /= s_rllCounts[E_DCOM]; s_rllCycles[E_RPC] /= s_rllCounts[E_DCOM]; s_rllCycles[E_UDP] /= s_rllCounts[E_DCOM]; s_rllCycles[E_NET] /= s_rllCounts[E_DCOM]; s_rllTotals[E_DCOM] /= s_rllCounts[E_DCOM]; s_rllTotals[E_RPC] /= s_rllCounts[E_DCOM]; s_rllTotals[E_UDP] /= s_rllCounts[E_DCOM]; s_rllTotals[E_NET] /= s_rllCounts[E_DCOM]; DumpCycles(E_DCOM); DumpCycles(E_RPC); DumpCycles(E_UDP); DumpCycles(E_NET); } } return 0; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/cping/iping.idl ================================================ ////////////////////////////////////////////////////////////////////////////// // // Module: iping.idl (cping.exe - COM Ping) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // import "objidl.idl"; import "oaidl.idl"; import "oleidl.idl"; [object, uuid(decdbeef-d1ac-11d1-96bc-00aa00573fb0), pointer_default(unique)] interface IPing : IUnknown { HRESULT Ping(void); HRESULT PingToServer([in] LPSTR pszString); HRESULT PingToClient([out] LPSTR *ppszString); HRESULT PingToClientSize([in] ULONG cbOut); }; // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/disas/Makefile ================================================ ############################################################################## ## ## Makefile for Detours Test Programs. ## ## Microsoft Research Detours Package ## ## Copyright (c) Microsoft Corporation. All rights reserved. ## !include ..\common.mak # temporarily disable this test for ARM64 !if "$(DETOURS_TARGET_PROCESSOR)" != "ARM64" LIBS=$(LIBS) kernel32.lib all: dirs \ $(BIND)\disas.exe \ !IF $(DETOURS_SOURCE_BROWSING)==1 $(OBJD)\disas.bsc !ENDIF clean: -del *~ *.obj *.sbr *.lst 2>nul -del $(BIND)\disas.* 2> nul -rmdir /q /s $(OBJD) 2>nul realclean: clean -rmdir /q /s $(OBJDS) 2>nul dirs: @if not exist $(BIND) mkdir $(BIND) && echo. Created $(BIND) @if not exist $(OBJD) mkdir $(OBJD) && echo. Created $(OBJD) !IF "$(DETOURS_TARGET_PROCESSOR)" == "X86" $(OBJD)\disasm.obj : x86.cpp cl $(CFLAGS) /Fe$@ /FAcs /Fa$(OBJD)\x86.lst \ /Fd$(@R).pdb /Fo$(OBJD)\disasm.obj /c x86.cpp !ELSEIF "$(DETOURS_TARGET_PROCESSOR)" == "X64" $(OBJD)\disasm.obj : x64.asm $(ASM) $(AFLAGS) /Fo$(OBJD)\disasm.obj /Fl$(OBJD)\x64.lst x64.asm !ELSEIF "$(DETOURS_TARGET_PROCESSOR)" == "IA64" $(OBJD)\disasm.obj : ia64.asm $(ASM) $(AFLAGS) -o $(OBJD)\disasm.obj ia64.asm !ELSEIF "$(DETOURS_TARGET_PROCESSOR)" == "ARM" $(OBJD)\disasm.obj : arm.asm $(ASM) $(AFLAGS) -list $(OBJD)\arm.lst -o $(OBJD)\disasm.obj arm.asm !ENDIF $(BIND)\disas.obj : disas.cpp $(BIND)\disas.exe : $(OBJD)\disas.obj $(OBJD)\disasm.obj $(DEPS) cl $(CFLAGS) /Fe$@ /FAcs /Fa$(OBJD)\disas.lst /Fd$(@R).pdb \ $(OBJD)\disas.obj $(OBJD)\disasm.obj \ /link $(LINKFLAGS) $(LIBS) /subsystem:console /entry:WinMainCRTStartup $(OBJD)\disas.bsc : $(OBJD)\disas.obj bscmake /v /n /o $@ $(OBJD)\disas.sbr ############################################################################## test: $(BIND)\disas.exe $(BIND)\disas.exe ############################################################################## !else all: test: clean: realclean: !endif ################################################################# End of File. ================================================ FILE: ext/detours/samples/disas/arm.asm ================================================ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Detours Test Program (rlo.asm/disas.exe) ;; ;; Microsoft Research Detours Package ;; ;; Copyright (c) Microsoft Corporation. All rights reserved. ;; MACRO BREAK DCW 0xdefe MEND AREA |.text|,ALIGN=2,CODE,READONLY AREA |.text|,CODE,READONLY ALIGN 0x1000 EXPORT |TestCodes| |TestCodes| ; dcw 0xf8df,0xe00e ; 94 = -16 = -12 ; 94 ; 98 + e = a6 ; BREAK ; 98 = -14 = -10 ; 98 ; 9c ; dcw 0xf8df,0xe00a ; 9a = -12 = -8 ; 98 ; 9c + a = a6 ; BREAK ; 9e = -8 = -4 ; 9c ; a0 ; dcw 0xf8df,0xe002 ; a0 = -6 = -2 ; a0 ; a4 + 2 = a6 ; BREAK ; a4 = -2 ; a4 ; a8 ; movs r2, r0 ; a6 <=== ; movs r3, r0 ; ; BREAK ; BREAK ; ; ldr lr,=0xa98765 ; ldr pc,=0xa98765 ; ldr pc,=0xa98765 ; ldr pc,=0xa98765 ; BREAK ; BREAK BREAK ldr lr, =0xa98765 BREAK blx lr BREAK pop pc BREAK pop {r11,pc} BREAK pop {r10,r11,pc} BREAK pop {r9,r10,r11,pc} BREAK pop {r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,pc} BREAK ldr.w r0,=0xa98765 BREAK nop ldr.w r0,=0xa98765 BREAK nop nop ldr.w r0,=0xa98765 BREAK ldr r0,=0xa98765 BREAK ldr.w r0,=0xa98765 BREAK ldr.w r0,=0xa98765 BREAK ldr r0,=0xa98765 BREAK ldr.w r0,=0xa98765 BREAK ldr.w r0,=0xa98765 BREAK ldr r0,=0xa98765 BREAK ldr.w r0,=0xa98765 BREAK ldr.w r0,=0xa98765 BREAK ldr r0,=0xa98765 BREAK nop ldr r0,=0xa98765 BREAK nop nop ldr r0,=0xa98765 BREAK nop ldr r0,=0xa BREAK ldr r0,=0xa9 BREAK ldr r0,=0xa98 BREAK ldr r0,=0xa987 BREAK ldr r0,=0xa9876 BREAK ldr r0,=0xa98765 BREAK ldr r0,=0xa987654 BREAK ldr r0,=0xa9876543 ;; Simple instructions. BREAK adds r0,r0, #5 ; 1d40 BREAK movs r2, #0 ; 2200 BREAK movs r3, #0 ; 2300 BREAK bx lr ; 4770 [FFFFFFFF] ;; Known 16-bit instructions BREAK mov r11, sp ; 46eb BREAK movs r2, r0 ; 0002 BREAK push r0, r1 ; b403 BREAK str r3,[r7,#0x28] ; 62bb BREAK bx r5 ; 4728 [FFFFFFFF] BREAK blx r5 ; 47a8 BREAK DCW 0x4878 ; ldr r0, [PC + 0x1E0] ; 4878 BREAK str r3,[r7,#0x1C] ; 61fb BREAK ldr r3,[r7,#0x38] ; 6bbb BREAK add r3,sp,#0xCC ; ab33 BREAK cbz r2,+0x56 ; b34a [00xx1510] BREAK cbnz r2,+0x56 ; bb4a [00xx1514] BREAK push {r0,r2,r4,r6,lr} ; b555 BREAK nop ; bf00 ;; Placeholder for IT instruction BREAK bne +0x6E ; d135 [00xx1538] -??? d137 BREAK svc #0x24 ; df24 BREAK b +0x7FE ; e3fd [00xx1cd0] -??? e3ff ;; 32 bit test codes BREAK adds r0,r7,#8 ; f1170008 BREAK str r3,[r5,#0x677] ; f8c53677 BREAK ldrsh r10,[r5,#0x5A5] ; f9b5a5a5 BREAK DCW 0xf89f,0x55a5 ;ldrb r5, [+0x5A5] ; f89f55a5 BREAK bls.w +0x86; 0xf240; 0x8043; // ; f2408041 [00xx157A] BREAK bl +0xFE; 0xf7ff; 0xff80; // BREAK bl +0xFFE; 0xf7ff; 0xff80; // BREAK bl +0xFFFE; 0xf7ff; 0xff80; // BREAK bl +0xFFFFE; 0xf7ff; 0xff80; // BREAK bl +0xFFFFFE; 0xf7ff; 0xff80; // BREAK bl +0xF0; 0xf7ff; 0xff80; // BREAK bl +0xFF0; 0xf7ff; 0xff80; // BREAK bl +0xFFF0; 0xf7ff; 0xff80; // BREAK bl +0xFFFF0; 0xf7ff; 0xff80; // BREAK bl +0xFFFFF0; 0xf7ff; 0xff80; // BREAK bl +0xF00; 0xf7ff; 0xff80; // BREAK bl +0xFF00; 0xf7ff; 0xff80; // BREAK bl +0xFFF00; 0xf7ff; 0xff80; // BREAK bl +0xFFFF00; 0xf7ff; 0xff80; // BREAK DCW 0xf7ff,0xff80 ;bl +0xFFFFFF00; 0xf7ff; 0xff80; // BREAK DCW 0xf7ff,0xbe02 ; b.w ; 0xf7ff; 0xbe02; // (10053528) BREAK push {r7,r11,lr}; 0xe92d; 0x4880; // ;; 32 bit expected results BREAK adds r0,r7,#8 ; 0xf1170008 BREAK str r3,[r5,#0x677] ; 0xf8c53677 BREAK ldrsh r10,[r5,#0x5A5] ; 0xf9b5a5a5 BREAK DCW 0xf6af,0xfbd2 ; bl (0008ef3c); ResultCode(4, 0xf6af, 0xfbd2, Target(ADDRESS(&g_pTestCodes32[i*2], 0xFFFFFF00))); // 0xf7ff, 0xff80: -> 0xf6affbd2 BREAK bl (00090300); ResultCode(4, 0xf6af, 0xba54, Target(ADDRESS(&g_pTestCodes32[i*2], 0xFFFFFC04))); // 0xf7ff, 0xff80: -> f6afba54 bl (00090300) BREAK push {r7,r11,lr}; ResultCode(4, 0xe92d, 0x4880); // 0xe92d, 0x4880: // BREAK BREAK |TestCodes_end| END ================================================ FILE: ext/detours/samples/disas/disas.cpp ================================================ ///////////////////////////////////////////////////////////////////////////// // // Module: disas.cpp (disas.exe - Detours Test Program) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #define DETOURS_INTERNAL #include #include #include ///////////////////////////////////////////////////////////////////////// ARM. // #ifdef DETOURS_ARM extern "C" BYTE TestCodes[]; void DumpMemoryFragment(PBYTE pbData, ULONG cbData, ULONG cbSpace) { ULONG n = 0; if (cbData >= 4) { printf("%04x%04x ", ((PUSHORT)pbData)[0], ((PUSHORT)pbData)[1]); n += 4; } else if (cbData >= 2) { printf("%04x ", *((PUSHORT)pbData)); n += 2; } for (; n < cbSpace; n++) { if (n < cbData) { printf("%02x", pbData[n]); } else { printf(" "); } } if (n < cbData) { printf("."); } else { printf(" "); } } inline ULONG fetch_thumb_opcode(PBYTE pbCode) { ULONG Opcode = *(UINT16 *)&pbCode[0]; if (Opcode >= 0xe800) { Opcode = (Opcode << 16) | *(UINT16 *)&pbCode[2]; } return Opcode; } BOOL IsTerminate(PBYTE pbSrc) { ULONG opcode = fetch_thumb_opcode(pbSrc); if ((opcode & 0xff87) == 0x4700) { // bx r return TRUE; } #if 0 if ((opcode & 0xfbf08f00) == 0xf2400c00) { // movw r12,#xxxx return TRUE; } if ((opcode == 0xf8dcf000) { // ldr pc,[r12] ULONG Immediate = ((opcode2 << 12) & 0xf7000000) | ((opcode2 << 1) & 0x08000000) | ((opcode2 << 16) & 0x00ff0000) | ((opcode >> 4) & 0x0000f700) | ((opcode >> 15) & 0x00000800) | ((opcode >> 0) & 0x000000ff); PBYTE pbTarget = *(PBYTE *)Immediate; if (detour_is_imported(pbCode, pbTarget)) { PBYTE pbNew = *(PBYTE *)pbTarget; DETOUR_TRACE(("%p->%p: skipped over import table.\n", pbCode, pbNew)); return pbNew; } } } } #endif return FALSE; } #endif // DETOURS_ARM ///////////////////////////////////////////////////////////////// X86 and X64. // #if defined(DETOURS_X86) || defined(DETOURS_X64) extern "C" BYTE TestCodes[]; void DumpMemoryFragment(PBYTE pbData, ULONG cbData, ULONG cbSpace) { ULONG n = 0; for (; n < cbSpace; n++) { if (n < cbData) { printf("%02x", pbData[n]); } else { printf(" "); } } if (n < cbData) { printf("."); } else { printf(" "); } } BOOL IsTerminate(PBYTE pbSrc) { if ((0xC3 == pbSrc[0] && 0x00 == pbSrc[1]) || // bx lr 0xCB == pbSrc[0] || // RETF 0xC2 == pbSrc[0] || // RET dw 0xCA == pbSrc[0] || // RETF dw 0xEB == pbSrc[0] || // JMP ob 0xE9 == pbSrc[0] || // JMP ol 0xEA == pbSrc[0]) { // JMP ol return TRUE; } if (0xff == pbSrc[0] && 0x25 == pbSrc[1]) // JMP [addr] return TRUE; return FALSE; } #endif // DETOURS_X86 || DETOURS_X64 /////////////////////////////////////////////////////////// X86, X64, and ARM. // #if defined(DETOURS_X86) || defined(DETOURS_X64) || defined(DETOURS_ARM) struct BasicBlockLink { public: BasicBlockLink * m_pNext; PBYTE m_pbEntry; PCHAR m_pszName; public: BasicBlockLink(PBYTE pbEntry, PCHAR pszName = NULL) { m_pNext = NULL; m_pbEntry = pbEntry; m_pszName = pszName; *s_ppTail = this; s_ppTail = &m_pNext; } BasicBlockLink * Next() { return m_pNext; } static BasicBlockLink * GetListHead() { return s_pHead; } protected: static BasicBlockLink * s_pHead; static BasicBlockLink ** s_ppTail; }; BasicBlockLink * BasicBlockLink::s_pHead = NULL; BasicBlockLink ** BasicBlockLink::s_ppTail = &BasicBlockLink::s_pHead; static PBYTE s_pbBegin = NULL; static PBYTE s_pbLimit = NULL; int TestDetourCopyInstruction(PBYTE pbSrcInstruction, PCHAR pszFunction) { PBYTE pbSrc = pbSrcInstruction; ULONG nIns = 0; if (pszFunction) { printf("%s:\n", pszFunction); } for (; nIns < 4096; nIns++) { BYTE rbDst[128]; PVOID pbDstPool = (PVOID)(rbDst + sizeof(rbDst)); LONG lExtra = 0; PVOID pbTarget = NULL; ULONG cbStep = (ULONG)((PBYTE)DetourCopyInstruction(rbDst, &pbDstPool, pbSrc, &pbTarget, &lExtra) - pbSrc); printf(" %p:", pbSrc); DumpMemoryFragment(rbDst, cbStep, 10); printf(" "); DumpMemoryFragment(rbDst, cbStep, 10); if (pbTarget) { if (pbTarget == DETOUR_INSTRUCTION_TARGET_DYNAMIC) { printf(" Dynamic\n"); } else { printf(" %p%c\n", pbTarget, (pbTarget >= s_pbBegin && pbTarget < s_pbLimit) ? ' ' : '!'); } } else { printf("\n"); } if (pbTarget && pbTarget != DETOUR_INSTRUCTION_TARGET_DYNAMIC) { if (pbTarget > pbSrc && pbTarget >= s_pbBegin && pbTarget < s_pbLimit ) { (void) new BasicBlockLink((PBYTE)pbTarget, NULL); } } if (IsTerminate(pbSrc)) { break; } pbSrc += cbStep; } return nIns; } BOOL CALLBACK ExportCallback(_In_opt_ PVOID pContext, _In_ ULONG nOrdinal, _In_opt_ LPCSTR pszName, _In_opt_ PVOID pCode) { (void)pContext; (void)nOrdinal; (void)pCode; (VOID) new BasicBlockLink((PBYTE)pCode, pszName ? pszName : "[NO NAME]"); return TRUE; } #endif // DETOURS_X86 || DETOURS_X64 //////////////////////////////////////////////////////////////////////// IA64. // #ifdef DETOURS_IA64 #pragma warning(disable: 4201) // ignore warning about unnamed sturcture in union. void DumpHi(PBYTE pbData, ULONG cbData, ULONG cbSpace) { ULONG n = 0; for (; n < cbSpace; n++) { if (n < cbData) { printf("%02x", pbData[(cbData - 1) - n]); } else { printf(" "); } } printf("\n"); } struct DETOUR_IA64_BUNDLE_DISASSEMBLE : public DETOUR_IA64_BUNDLE { public: void SetBrx(UINT64 raw) { SetBrl(); SetBrlImm(raw); } void Dis() { const char szUnitNames[17] = "?aimbflx?AIMBFLX"; printf("%p: ", data); BYTE nTemplate = GetTemplate(); BYTE nInst0 = GetInst0(); BYTE nInst1 = GetInst1(); BYTE nInst2 = GetInst2(); BYTE nUnit0 = GetUnit0(); BYTE nUnit1 = GetUnit1(); BYTE nUnit2 = GetUnit2(); if (nUnit1 == L_UNIT) { // MLX instruction UINT64 d2 = ( // 0x0000000000fffff0 ((wide[1] & 0x00fffff000000000) >> 32) | // 0x000000ffff000000 ((wide[0] & 0xffff000000000000) >> 24) | // 0x7fffff0000000000 ((wide[1] & 0x00000000007fffff) << 40) | // 0x8000000000000000 ((wide[1] & 0x0800000000000000) << 4) ); printf("%02x %c%01x %010I64lx %c%01x %016I64lx", nTemplate, szUnitNames[nUnit0], nInst0, GetData0(), szUnitNames[nUnit2], nInst2, d2); } else { printf("%02x %c%01x %010I64lx %c%01x %010I64lx %c%01x %010I64lx", nTemplate, szUnitNames[nUnit0], nInst0, GetData0(), szUnitNames[nUnit1], nInst1, GetData1(), szUnitNames[nUnit2], nInst2, GetData2()); } if (IsBrl()) { printf(" brl %p", GetBrlTarget()); } else if (IsMovlGp()) { printf(" movl gp=%p", GetMovlGp()); } if ((wide[0] & 0xfffffc000603ffff) == 0x002024000200100b && wide[1] == 0x0004000000203008) { ULONG64 offset = ((wide[0] & 0x0000000001fc0000) >> 18) | // imm7b ((wide[0] & 0x000001ff00000000) >> 25) | // imm9d ((wide[0] & 0x00000000f8000000) >> 11); // imm5c if (wide[0] & 0x0000020000000000) { offset |= 0xffffffffffe00000; } printf(" imm=%016I64lx", offset); } printf("\n"); } }; ////////////////////////////////////////////////////////////////////////////// // BOOL CALLBACK ExportCallbackIA64(_In_opt_ PVOID pContext, _In_ ULONG nOrdinal, _In_opt_ LPCSTR pszName, _In_opt_ PVOID pCode) { (void)pContext; (void)nOrdinal; DETOUR_IA64_BUNDLE_DISASSEMBLE *pb = *(DETOUR_IA64_BUNDLE_DISASSEMBLE **)pCode; DETOUR_IA64_BUNDLE temp; if (!pb[0].Copy(&temp)) { printf("%s:\n ", pszName ? pszName : "[NO NAME]"); pb[0].Dis(); } return TRUE; } #if 0 void TestBoth() { LPVOID pvBase = VirtualAlloc((PBYTE)0x800000000, 0x10000, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE); DETOUR_IA64_BUNDLE *pbBase = (DETOUR_IA64_BUNDLE *)pvBase; DETOUR_IA64_BUNDLE *pb = pbBase; printf("TestBoth:\n"); for (UINT64 i = 0x10; i < 0x8000000000000000; i <<= 1) { pb->SetMovlGp(i); if (pb->GetMovlGp() != i) { printf("Error in MovlGp!\n"); return; } pb++; pb->SetBrl(i); if (pb->GetBrlEip() != i) { printf("Error in Brl!\n"); return; } pb++; } for (UINT64 i = (UINT64)(INT64)-0x10; i > 0; i <<= 1) { pb->SetMovlGp(i); if (pb->GetMovlGp() != i) { printf("Error in MovlGp!\n"); return; } pb++; pb->SetBrl(i); if (pb->GetBrlEip() != i) { printf("Error in Brl!\n"); return; } pb++; } printf("u %p %p\n", pbBase, pb); } #endif #endif // DETOURS_IA64 int WINAPI WinMain(HINSTANCE hinst, HINSTANCE hprev, LPSTR lpszCmdLine, int nCmdShow) { (void)hprev; (void)hinst; (void)lpszCmdLine; (void)nCmdShow; // Bug report, but it works here. // 07ff8`4b783054 49ba 70b3d93a d40fb998 mov r10,98B90FD43AD9B370h // { static const UCHAR mov_r10_imm64[] = {0x49, 0xba, 1, 2, 3, 4, 5, 6, 7, 8 }; PVOID const after = DetourCopyInstructionX64(0, 0, const_cast(mov_r10_imm64), 0, 0); if (after != &mov_r10_imm64 + 1) { printf("mov_r10_imm64 failed, expected:%p vs. got:%p\n", &mov_r10_imm64 + 1, after); if (IsDebuggerPresent()) { __debugbreak(); DetourCopyInstructionX64(0, 0, const_cast(mov_r10_imm64), 0, 0); } return 1; } } #ifdef DETOURS_IA64 // First we check the pre-canned TestCodes from disasm.asm // PBYTE pbTest = *(PBYTE*)WinMain; for (;; pbTest += 16) { DETOUR_IA64_BUNDLE_DISASSEMBLE *pb = (DETOUR_IA64_BUNDLE_DISASSEMBLE *)pbTest; pb->Dis(); if (pbTest[0] == 0xff) { break; } DumpHi(pbTest, 16, 16); } #if 0 printf("\n\n"); DETOUR_IA64_BUNDLE_DISASSEMBLE *pb = (DETOUR_IA64_BUNDLE_DISASSEMBLE *)pbTest; DETOUR_IA64_BUNDLE_DISASSEMBLE *pbBeg = pb; DWORD dwOld; VirtualProtect(pb, 0x2000, PAGE_EXECUTE_READWRITE, &dwOld); printf("%p: (%d)\n", pb, sizeof(pb)); pb++; printf("%p: (%d)\n", pb, sizeof(pb)); pb++; pb->SetBrx(0); pb++; pb->SetBrx(0); pb++; pb->SetBrx(0); pb++; pb->SetBrx(0xffffffffffffffff); pb++; pb->SetBrx(0x0fffffffffffffff); pb++; pb->SetBrx(0x00ffffffffffffff); pb++; pb->SetBrx(0x000fffffffffffff); pb++; pb->SetBrx(0x0000ffffffffffff); pb++; pb->SetBrx(0x00000fffffffffff); pb++; pb->SetBrx(0x000000ffffffffff); pb++; pb->SetBrx(0x0000000fffffffff); pb++; pb->SetBrx(0x00000000ffffffff); pb++; pb->SetBrx(0x000000000fffffff); pb++; pb->SetBrx(0x0000000000ffffff); pb++; pb->SetBrx(0x00000000000fffff); pb++; pb->SetBrx(0x000000000000ffff); pb++; pb->SetBrx(0x0000000000000fff); pb++; pb->SetBrx(0x00000000000000ff); pb++; pb->SetBrx(0x000000000000000f); pb++; pb->SetBrx(0x0000000000000000); pb++; pb->SetBrx(0xffffffffffffffff); pb++; pb->SetBrx(0xffffffffffffffff); pb->SetInst0(0xff); pb->SetData0(0xffffffffffffffff); printf("%p:\n", pb); DETOUR_IA64_BUNDLE_DISASSEMBLE *pbEnd = pb; for (pb = pbBeg; pb < pbEnd; pb++) { printf(" %p: ", pb); DumpHi((BYTE*)pb, 16, 16); } #endif #if 1 { // Then we check all of the code we can find in user32.dll // printf("\n"); HINSTANCE hInst = LoadLibraryA("user32.dll"); printf("Loaded: user32.dll: %p\n", hInst); PBYTE pbEntry = (PBYTE)DetourGetEntryPoint(hInst); printf("Entry: %p\n", pbEntry); ExportCallbackIA64(NULL, 0, "[Entry]", pbEntry); DetourEnumerateExports(hInst, NULL, ExportCallbackIA64); } { // Then we check all of the code we can find in opengl32.dll // printf("\n"); HINSTANCE hInst = LoadLibraryA("opengl32.dll"); printf("Loaded: opengl32.dll: %p\n", hInst); PBYTE pbEntry = (PBYTE)DetourGetEntryPoint(hInst); printf("Entry: %p\n", pbEntry); ExportCallbackIA64(NULL, 0, "[Entry]", pbEntry); DetourEnumerateExports(hInst, NULL, ExportCallbackIA64); } printf("\n"); for (HINSTANCE hInst = NULL; (hInst = DetourEnumerateModules(hInst)) != NULL;) { CHAR szModuleName[512]; GetModuleFileNameA(hInst, szModuleName, sizeof(szModuleName)/sizeof(szModuleName[0])); printf("%p : %s\n", hInst, szModuleName); DetourEnumerateExports(hInst, NULL, ExportCallbackIA64); } printf("\n"); #endif #if 0 TestBoth(); #endif #endif // DETOURS_IA64 #if defined(DETOURS_X64) || defined(DETOURS_X86) // First we check the pre-canned TestCodes from disasm.asm // PBYTE pbBegin = (PBYTE)DetourCodeFromPointer(TestCodes, NULL); printf("%p:\n", pbBegin); for (PBYTE pbTest = pbBegin;;) { if (pbTest[0] != 0xcc) { // int 3 printf("%08lx ", (ULONG)(pbTest - pbBegin)); DumpMemoryFragment(pbTest, 8, 8); printf("\n"); printf("failed on last.\n"); return 1; } pbTest++; if (pbTest[0] == 0x70 || pbTest[0] == 0x71) { printf("[%p]:\n", pbTest); } BYTE rbDst[128]; PVOID pbDstPool = (PVOID)(rbDst + sizeof(rbDst)); LONG lExtra = 0; PVOID pbTarget = NULL; PBYTE pbNext = (PBYTE)DetourCopyInstruction(rbDst, &pbDstPool, pbTest, &pbTarget, &lExtra); LONG cbTest = (LONG)(pbNext - pbTest); printf("%08lx ", (ULONG)(pbTest - pbBegin)); DumpMemoryFragment(pbTest, cbTest, 12); printf("[%16p] ", pbTarget); DumpMemoryFragment(rbDst, cbTest + lExtra, 11); printf("\n"); if (pbTest[cbTest] != 0xcc) { printf("failed!\n"); return 1; } pbTest += cbTest; if (pbTest[0] == 0xcc && pbTest[1] == 0xcc) { break; } } #if 0 // Then we check all of the code we can find in user32.dll // HINSTANCE hInst = LoadLibraryA("user32.dll"); printf("Loaded: user32.dll: %p\n", hInst); s_pbBegin = (PBYTE)hInst; s_pbLimit = s_pbBegin + DetourGetModuleSize(hInst); PBYTE pbEntry = DetourGetEntryPoint(hInst); (VOID) new BasicBlockLink(pbEntry, "user32.dll"); DetourEnumerateExports(hInst, NULL, ExportCallback); ULONG nIns = 0; for (BasicBlockLink *pLink = BasicBlockLink::GetListHead(); pLink; pLink = pLink->Next()) { nIns += TestDetourCopyInstruction(pLink->m_pbEntry, pLink->m_pszName); if (nIns > 100000) { break; } } printf("Disassembled %d instructions.\n", nIns); #endif #endif // DETOURS_X86 || DETOURS_X64 #ifdef DETOURS_ARM // Create an output buffer and fill it with debugbreaks. // PBYTE pbBuffer = (PBYTE)VirtualAlloc(NULL, 0x400, MEM_COMMIT|MEM_RESERVE, PAGE_EXECUTE_READWRITE); for (PBYTE pbOut = pbBuffer; pbOut < pbBuffer + 0x400;) { *pbOut++ = 0xfe; *pbOut++ = 0xde; } PBYTE pbDst = pbBuffer; PVOID pvDstPool = (PVOID)(pbBuffer + 0x400); // First we check the pre-canned TestCodes from disasm.asm // PBYTE pbBegin = (PBYTE)DetourCodeFromPointer(TestCodes, NULL); printf("%p: (TestCodes %p) => %p\n", pbBegin, TestCodes, pbBuffer); for (PBYTE pbSrc = pbBegin;;) { if (pbSrc[0] != 0xfe && pbSrc[1] != 0xde) { // BREAK printf("%08x ", pbSrc - pbBegin); DumpMemoryFragment(pbSrc, 8, 8); printf("\n"); printf("failed on last.\n"); return 1; } pbSrc += 2; *pbDst++ = 0xfe; *pbDst++ = 0xde; if ((pbSrc[0] == 0x00 && pbSrc[1] == 0xbf) && // NOP (pbSrc[2] != 0xfe && pbSrc[3] != 0xde)) { // BREAK // Skip over a single NOP so we can test alignment. pbSrc += 2; } if ((pbSrc[0] == 0x00 && pbSrc[1] == 0xbf) && // NOP (pbSrc[2] != 0xfe && pbSrc[3] != 0xde)) { // BREAK // If there is a second NOP, then we insert alignment. pbSrc += 2; *pbDst++ = 0x00; *pbDst++ = 0xbf; } LONG lExtra = 0; PVOID pbTarget = NULL; PBYTE pbNext = (PBYTE)DetourCopyInstruction(pbDst, &pvDstPool, pbSrc, &pbTarget, &lExtra); LONG cbTest = (LONG)(pbNext - pbSrc); printf("%08x ", pbSrc - pbBegin); DumpMemoryFragment(pbSrc, cbTest, 4); printf("[%8p] ", pbTarget); DumpMemoryFragment(pbDst, cbTest + lExtra, 16); printf("\n"); if (pbSrc[cbTest] != 0xfe || pbSrc[cbTest+1] != 0xde) { printf("%p: failed! (pbSrc[n]=%02x, pbSrc[n+1]=%02x\n", pbSrc, pbSrc[cbTest], pbSrc[cbTest+1]); __debugbreak(); pbNext = (PBYTE)DetourCopyInstruction(pbDst, &pvDstPool, pbSrc, &pbTarget, &lExtra); cbTest = (LONG)(pbNext - pbSrc); return 1; } pbDst += cbTest + lExtra; pbSrc += cbTest; if (pbSrc[0] == 0xfe && pbSrc[1] == 0xde && pbSrc[2] == 0xfe && pbSrc[3] == 0xde) { break; } } #if 0 // Then we check all of the code we can find in user32.dll // HINSTANCE hInst = LoadLibraryA("user32.dll"); printf("Loaded: user32.dll: %p\n", hInst); s_pbBegin = (PBYTE)hInst; s_pbLimit = s_pbBegin + DetourGetModuleSize(hInst); PBYTE pbEntry = DetourGetEntryPoint(hInst); (VOID) new BasicBlockLink(pbEntry, "user32.dll"); DetourEnumerateExports(hInst, NULL, ExportCallback); ULONG nIns = 0; for (BasicBlockLink *pLink = BasicBlockLink::GetListHead(); pLink; pLink = pLink->Next()) { nIns += TestDetourCopyInstruction(pLink->m_pbEntry, pLink->m_pszName); if (nIns > 100000) { break; } } printf("Disassembled %d instructions.\n", nIns); #endif #endif // DETOURS_ARM return 0; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/disas/ia64.asm ================================================ ///////////////////////////////////////////////////////////////////////////// // // Detours Test Program (ia64.asm/disas.exe) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // .section .text .proc TestCodes# .global TestCodes# .align 64 TestCodes: { .mii and r21 = 7, r32 mux1 r25 = r33, @brcst add r16 = r32, r34 } { .mmb cmp.ge p9 = 0, r34 mov r8 = r32 (p9) br.ret.spnt b0 ;; } // align on an 8-byte boundary { .mmi cmp.ne p15 = 0, r21 //Low 3 bits zero? cmp.gt p10 = 0x30, r34 cmp.eq p6, p7 = 0, r33 } { .mmb nop.m 0 nop.m 0 (p15) br.cond.dpnt Align_Loop ;; } { .mmi (p7) mov r27 = 0x88 (p6) mov r27 = 0x90 tbit.nz p14,p13 = r32, 3 // is aligned on 8-bytes (to align on 16 before FP loop)? } { .mbb nop.m 0 (p10) br.cond.dpnt Aligned_Short // blocks < 48 bytes (p7) br.cond.dpnt Aligned_Long; // do 8-byte stores for non-zero fills, 16-byte f0 for zero-fills ;; } // zero-fills >= 48 bytes goes through an f0 16-byte store loop Aligned_FP_Long: { .mmi add r28 = 0x80, r27 add r29 = 0x100, r27 add r30 = 0x180, r27 } { .mmi (p14) add r14 = 0x88, r32 (p14) st8 [r32] = r0, 8 (p14) add r34 = -0x8, r34 ;; } { .mmi (p13) add r14 = 0x80, r32 cmp.ge p7 = r34, r27 add r27 = 0x200, r27 } { .mmi add r15 = 0x180, r32 add r17 = 0x200, r32 nop.i 0 ;; } { .mmi add r26 = 0x280, r32 cmp.ge p8 = r34, r28 cmp.ge p9 = r34, r29 } { .mmi stf.spill [r32] = f0 // Line 0 (p7) stf.spill [r14] = f0,0x80 // Line +1 0x80 add r28 = 0x200, r28 ;; } { .mmi (p8) stf.spill [r14] = f0 // Line +2 0x100 (p9) stf.spill [r15] = f0 // Line +3 0x180 cmp.ge p10 = r34, r28 } { .mmi cmp.ge p11 = r34, r30 cmp.ge p12 = r34, r27 nop.i 0 ;; } { .mmi (p11) stf.spill [r17] = f0 // Line +4 0x200 (p12) stf.spill [r26] = f0, 0x80 // Line +5 0x280 add r31 = 0x10, r32 ;; } .align 32 Long_FP_loop: { .mmi (p10) stf.spill [r26] = f0, 0x80 // Line +6 stf.spill [r31] = f0, 0x20 cmp.le p15,p12 = 0x40, r34 } { .mmb add r32 = 0x20, r32 add r34 = -0x20, r34 (p12) br.cond.dpnt Aligned_Short ;; } { .mmi (p15) stf.spill [r32] = f0, 0x20 (p15) stf.spill [r31] = f0, 0x20 cmp.le p15,p12 = 0x40, r34 } { .mmb add r21 = -0x60, r34 add r34 = -0x20, r34 (p12) br.cond.dpnt Aligned_Short ;; } { .mmi (p15) stf.spill [r32] = f0, 0x20 (p15) stf.spill [r31] = f0, 0x20 cmp.le p15,p12 = 0x40, r34 } { .mmb cmp.ge p10 = r21, r28 add r34 = -0x20, r34 (p12) br.cond.dpnt Aligned_Short ;; } { .mmi (p15) stf.spill [r32] = f0, 0x20 (p15) stf.spill [r31] = f0, 0x20 cmp.le p15,p12 = 0x40, r34 } { .mbb add r34 = -0x20, r34 (p15) br.cond.sptk.many Long_FP_loop br.cond.dpnt.many Aligned_Short ;; } .align 32 // >= 48 bytes non-zero fills go through a 8-byte store based loop Aligned_Long: { .mmi add r28 = 0x80, r27 add r29 = 0x100, r27 add r30 = 0x180, r27 } { .mmi add r14 = 0x80, r32 cmp.ge p7 = r34, r27 nop.i 0 ;; } { .mmi add r26 = 0x180, r32 cmp.ge p8 = r34, r28 add r31 = 8, r32 } { .mmi st8 [r32] = r25 (p7) st8 [r14] = r25, 0x80 cmp.ge p9 = r34, r29 ;; } { .mmi (p8) st8 [r14] = r25 (p9) st8 [r26] = r25, 0x80 cmp.ge p10 = r34, r30 ;; } .align 32 Long_loop: { .mmi (p10) st8 [r26] = r25, 0x80 st8 [r31] = r25, 0x10 cmp.le p15,p12 = 0x20, r34 } { .mmb add r32 = 0x10, r32 add r34 = -0x10, r34 (p12) br.cond.dpnt Aligned_Short ;; } { .mmi (p15) st8 [r32] = r25, 0x10 (p15) st8 [r31] = r25, 0x10 cmp.le p15,p12 = 0x20, r34 } { .mmb nop.m 0 add r34 = -0x10, r34 (p12) br.cond.dpnt Aligned_Short ;; } { .mmi (p15) st8 [r32] = r25, 0x10 (p15) st8 [r31] = r25, 0x10 cmp.le p15,p12 = 0x20, r34 } { .mmb nop.m 0 add r34 = -0x10, r34 (p12) br.cond.dpnt Aligned_Short ;; } { .mmi (p15) st8 [r32] = r25, 0x10 (p15) st8 [r31] = r25, 0x10 cmp.le p15,p12 = 0x20, r34 } { .mmb nop.m 0 add r34 = -0x10, r34 (p12) br.cond.dpnt Aligned_Short ;; } { .mmi (p15) st8 [r32] = r25, 0x10 (p15) st8 [r31] = r25, 0x10 cmp.le p15,p12 = 0x20, r34 } { .mmb nop.m 0 add r34 = -0x10, r34 (p12) br.cond.dpnt Aligned_Short ;; } { .mmi (p15) st8 [r32] = r25, 0x10 (p15) st8 [r31] = r25, 0x10 cmp.le p15,p12 = 0x20, r34 } { .mmb add r21 = -0x30, r34 add r34 = -0x10, r34 (p12) br.cond.dpnt Aligned_Short ;; } { .mmi (p15) st8 [r32] = r25, 0x10 (p15) st8 [r31] = r25, 0x10 cmp.le p15,p12 = 0x20, r34 } { .mmb cmp.ge p10 = r21, r30 add r34 = -0x10, r34 (p12) br.cond.dpnt Aligned_Short ;; } { .mmi (p15) st8 [r32] = r25, 0x10 (p15) st8 [r31] = r25, 0x10 cmp.le p15,p12 = 0x20, r34 } { .mmb add r34 = -0x10, r34 nop.m 0 (p15) br.cond.sptk.many Long_loop ;; } // // Do partial word stores // .align 32 Aligned_Short: { .mmi and r27 = 2, r34 add r31 = 8, r32 tbit.nz p6 = r34, 0 //bit 0 on? } { .mmb cmp.le p11 = 0x10, r34 cmp.eq p10 = 0, r34 (p10) br.ret.dpnt b0 ;; } { .mmi (p11) st8 [r32] = r25, 0x10 (p11) st8 [r31] = r25, 0x10 cmp.le p12 = 0x20, r34 } { .mmi add r17 = -2, r16 add r18 = -4, r16 tbit.nz p9 = r34, 3 //odd number of st8s? ;; } { .mmi (p12) st8 [r32] = r25, 0x10 (p12) st8 [r31] = r25, 0x10 nop.i 0 } { .mmi (p6) add r18 = -1, r18 (p6) add r16 = -1, r16 cmp.ne p7 = 0, r27 ;; } { .mmi (p9) st8 [r32] = r25 (p6) st1 [r16] = r25 tbit.nz p8 = r34, 2 //bit 2 on? } { .mmi (p7) add r18 = -2, r18 (p6) add r17 = -1, r17 nop.i 0 ;; } { .mmb (p8) st4 [r18] = r25 (p7) st2 [r17] = r25 br.ret.sptk.many b0 ;; } .align 32 // Align the input pointer to an 8-byte boundary Align_Loop: { .mmi st1 [r32] = r33,1 add r21 = 1, r21 cmp.eq p15 = 1, r34 } { .mmb cmp.ge p11 = 0x30, r34 add r34 = -1, r34 (p15) br.ret.dpnt b0 ;; } { .mmb cmp.gt p10 = 8, r21 cmp.eq p6, p7 = 0, r33 (p10) br.cond.sptk Align_Loop ;; } { .mmi (p7) mov r27 = 0x88 (p6) mov r27 = 0x90 tbit.nz p14,p13 = r32, 3 // is aligned on 8-bytes (to align on 16 before FP loop)? } { .bbb (p11) br.cond.dpnt Aligned_Short // blocks < 48 bytes (p7) br.cond.dpnt Aligned_Long; // non-zero fills br.cond.dptk Aligned_FP_Long; // zero fills ;; } .endp TestCodes# .proc Again# Again: brl TestCodes brl TestCodes brl TestCodes brl TestCodes brl TestCodes brl TestCodes brl TestCodes brl TestCodes brl TestCodes brl TestCodes brl Fore1 brl Fore2 brl Fore3 brl Fore4 brl Fore5 brl Fore6 brl Fore7 .endp Again# data4 0xffffff00 data4 0xffffffff data4 0xffffffff data4 0xffffffff .align 64 data4 0xffffff00 data4 0xffffffff data4 0xffffffff data4 0xffffffff { addl r2=0xffffffffffffffff, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0xfffffffffffffff0, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0xffffffffffffff00, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0xfffffffffffff000, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0xfffffffffffff000, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0xffffffffffff0000, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0xfffffffffff00000, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0xffffffffffe00000, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0x00000000001fffff, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0x00000000000fffff, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0x000000000000ffff, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0x0000000000000fff, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0x00000000000000ff, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0x000000000000000f, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0x0000000000000000, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0x0000000000000001, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0x0000000000000002, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0x0000000000000004, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0x0000000000000008, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0x0000000000000010, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0x0000000000000020, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0x0000000000000040, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0x0000000000000080, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0x0000000000000100, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0x0000000000000200, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0x0000000000000400, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0x0000000000000800, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0x0000000000001000, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0x0000000000002000, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0x0000000000004000, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0x0000000000008000, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0x0000000000010000, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0x0000000000020000, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0x0000000000040000, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0x0000000000080000, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0x0000000000100000, gp ;; ld8 r2=[r2] nop.i 0 ;; } { addl r2=0xffffffffffe00000, gp ;; ld8 r2=[r2] nop.i 0 ;; } data4 0 .align 64 .align 64 ; .proc Fore1# Fore1: brl Fore2 .endp Fore1# data4 0 .align 64 .proc Fore2# Fore2: brl Fore3 .endp Fore2# data4 0 .align 64 .proc Fore3# Fore3: brl Fore3 movl gp = 0xffffffffffffffff brl Fore4 movl gp = 0x0000000000000000 movl gp = 0x0000000000000001 movl gp = 0x0000000000000002 movl gp = 0x0000000000000004 movl gp = 0x0000000000000008 movl gp = 0x0000000000000010 movl gp = 0x0000000000000020 movl gp = 0x0000000000000040 movl gp = 0x0000000000000080 movl gp = 0x0000000000000100 movl gp = 0x0000000000000200 movl gp = 0x0000000000000400 movl gp = 0x0000000000000800 movl gp = 0x0000000000001000 movl gp = 0x0000000000002000 movl gp = 0x0000000000004000 brl Fore4 movl gp = 0x0000000000000000 brl Fore4 movl gp = 0x0000000000000001 brl Fore4 movl gp = 0x0000000000000002 brl Fore4 movl gp = 0x0000000000000004 brl Fore4 movl gp = 0x0000000000000008 brl Fore4 movl gp = 0x0000000000000010 brl Fore4 movl gp = 0x0000000000000020 brl Fore4 movl gp = 0x0000000000000040 brl Fore4 movl gp = 0x0000000000000080 brl Fore4 movl gp = 0x0000000000000100 brl Fore4 movl gp = 0x0000000000000200 brl Fore4 movl gp = 0x0000000000000400 brl Fore4 movl gp = 0x0000000000000800 brl Fore4 movl gp = 0x0000000000001000 brl Fore4 movl gp = 0x0000000000002000 brl Fore4 movl gp = 0x0000000000004000 brl Fore4 movl gp = 0x0000000000008000 brl Fore4 movl gp = 0x0000000000010000 brl Fore4 movl gp = 0x0000000000020000 brl Fore4 movl gp = 0x0000000000040000 brl Fore4 movl gp = 0x0000000000080000 brl Fore4 movl gp = 0x0000000000100000 brl Fore4 movl gp = 0x0000000000200000 brl Fore4 movl gp = 0x0000000000400000 brl Fore4 movl gp = 0x0000000000800000 brl Fore4 movl gp = 0x0000000001000000 brl Fore4 movl gp = 0x0000000002000000 brl Fore4 movl gp = 0x0000000004000000 brl Fore4 movl gp = 0x0000000008000000 brl Fore4 movl gp = 0x0000000010000000 brl Fore4 movl gp = 0x0000000020000000 brl Fore4 movl gp = 0x0000000040000000 brl Fore4 movl gp = 0x0000000080000000 brl Fore4 movl gp = 0x0000000100000000 brl Fore4 movl gp = 0x0000000200000000 brl Fore4 movl gp = 0x0000000400000000 brl Fore4 movl gp = 0x0000000800000000 brl Fore4 movl gp = 0x0000001000000000 brl Fore4 movl gp = 0x0000002000000000 brl Fore4 movl gp = 0x0000004000000000 brl Fore4 movl gp = 0x0000008000000000 brl Fore4 movl gp = 0x0000010000000000 brl Fore4 movl gp = 0x0000020000000000 brl Fore4 movl gp = 0x0000040000000000 brl Fore4 movl gp = 0x0000080000000000 brl Fore4 movl gp = 0x0000100000000000 brl Fore4 movl gp = 0x0000200000000000 brl Fore4 movl gp = 0x0000400000000000 brl Fore4 movl gp = 0x0000800000000000 brl Fore4 movl gp = 0x0001000000000000 brl Fore4 movl gp = 0x0002000000000000 brl Fore4 movl gp = 0x0004000000000000 brl Fore4 movl gp = 0x0008000000000000 brl Fore4 movl gp = 0x0010000000000000 brl Fore4 movl gp = 0x0020000000000000 brl Fore4 movl gp = 0x0040000000000000 brl Fore4 movl gp = 0x0080000000000000 brl Fore4 movl gp = 0x0100000000000000 brl Fore4 movl gp = 0x0200000000000000 brl Fore4 movl gp = 0x0400000000000000 brl Fore4 movl gp = 0x0800000000000000 brl Fore4 movl gp = 0x1000000000000000 brl Fore4 movl gp = 0x2000000000000000 brl Fore4 movl gp = 0x4000000000000000 brl Fore4 movl gp = 0x8000000000000000 brl Fore4 movl gp = 0xffffffffffffffff brl Fore4 movl gp = 0x0000000000000000 brl Fore4 movl gp = 0xfffffffffffffffe brl Fore4 movl gp = 0xfffffffffffffffc brl Fore4 movl gp = 0xfffffffffffffff8 brl Fore4 movl gp = 0xfffffffffffffff0 brl Fore4 movl gp = 0xffffffffffffffe0 brl Fore4 movl gp = 0xffffffffffffffc0 brl Fore4 movl gp = 0xffffffffffffff80 brl Fore4 movl gp = 0xffffffffffffff00 brl Fore4 movl gp = 0xfffffffffffffe00 brl Fore4 movl gp = 0xfffffffffffffc00 brl Fore4 movl gp = 0xfffffffffffff800 brl Fore4 movl gp = 0xfffffffffffff000 brl Fore4 movl gp = 0xffffffffffffe000 brl Fore4 movl gp = 0xffffffffffffc000 brl Fore4 movl gp = 0xffffffffffff8000 brl Fore4 movl gp = 0xffffffffffff0000 brl Fore4 movl gp = 0xfffffffffffe0000 brl Fore4 movl gp = 0xfffffffffffc0000 brl Fore4 movl gp = 0xfffffffffff80000 brl Fore4 movl gp = 0xfffffffffff00000 brl Fore4 movl gp = 0xffffffffffe00000 brl Fore4 movl gp = 0xffffffffffc00000 brl Fore4 movl gp = 0xffffffffff800000 brl Fore4 movl gp = 0xffffffffff000000 brl Fore4 movl gp = 0xfffffffffe000000 brl Fore4 movl gp = 0xfffffffffc000000 brl Fore4 movl gp = 0xfffffffff8000000 brl Fore4 movl gp = 0xfffffffff0000000 brl Fore4 movl gp = 0xffffffffe0000000 brl Fore4 movl gp = 0xffffffffc0000000 brl Fore4 movl gp = 0xffffffff80000000 brl Fore4 movl gp = 0xffffffff00000000 brl Fore4 movl gp = 0xfffffffe00000000 brl Fore4 movl gp = 0xfffffffc00000000 brl Fore4 movl gp = 0xfffffff800000000 brl Fore4 movl gp = 0xfffffff000000000 brl Fore4 movl gp = 0xffffffe000000000 brl Fore4 movl gp = 0xffffffc000000000 brl Fore4 movl gp = 0xffffff8000000000 brl Fore4 movl gp = 0xffffff0000000000 brl Fore4 movl gp = 0xfffffe0000000000 brl Fore4 movl gp = 0xfffffc0000000000 brl Fore4 movl gp = 0xfffff80000000000 brl Fore4 movl gp = 0xfffff00000000000 brl Fore4 movl gp = 0xffffe00000000000 brl Fore4 movl gp = 0xffffc00000000000 brl Fore4 movl gp = 0xffff800000000000 brl Fore4 movl gp = 0xffff000000000000 brl Fore4 movl gp = 0xfffe000000000000 brl Fore4 movl gp = 0xfffc000000000000 brl Fore4 movl gp = 0xfff8000000000000 brl Fore4 movl gp = 0xfff0000000000000 brl Fore4 movl gp = 0xffe0000000000000 brl Fore4 movl gp = 0xffc0000000000000 brl Fore4 movl gp = 0xff80000000000000 brl Fore4 movl gp = 0xff00000000000000 brl Fore4 movl gp = 0xfe00000000000000 brl Fore4 movl gp = 0xfc00000000000000 brl Fore4 movl gp = 0xf800000000000000 brl Fore4 movl gp = 0xf000000000000000 brl Fore4 movl gp = 0xe000000000000000 brl Fore4 movl gp = 0xc000000000000000 brl Fore4 movl gp = 0x8000000000000000 brl Fore4 movl gp = 0x0000000000000000 brl Fore4 movl gp = 0x0000000000000000 brl Fore4 brl.sptk.many Fore4 brl.sptk.many Fore4 brl.sptk.many Fore4 brl.sptk.many Fore4 movl gp = 0xf0f0f0f0f0f0f0f0 brl.sptk.many Fore9 Fore9: brl.sptk.few Fore8 Fore8: brl.sptk.few Fore8 brl.sptk.few Fore8 brl.sptk.few Fore8 data1 0x05,0x00,0x00,0x00,0x01,0x00,0xff,0xff,0xff,0xff,0x7f,0x00,0xf0,0xff,0xff,0xc8 data1 0x05,0x00,0x00,0x00,0x01,0x00,0xff,0xff,0xff,0xff,0x7f,0x00,0xf0,0xff,0xff,0xc0 data1 0x05,0x00,0x00,0x00,0x01,0x00,0xff,0xff,0xff,0xff,0x7f,0x00,0xf0,0xff,0xff,0xc8 data1 0x05,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x04,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x25,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x45,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x85,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x01,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x02,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x04,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x08,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x10,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x20,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x40,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x80,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x00,0x02,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x00,0x04,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x00,0x08,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x00,0x10,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x00,0x20,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x00,0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x00,0x80,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x00,0x00,0x02,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x00,0x00,0x04,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x00,0x00,0x08,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x00,0x00,0x10,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x00,0x00,0x20,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x00,0x00,0x40,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x00,0x00,0x80,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x00,0x00,0x00,0x21,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x00,0x00,0x00,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x00,0x00,0x00,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x00,0x00,0x00,0x01,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x00,0x00,0x00,0x01,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x00,0x00,0x00,0x01,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x00,0x00,0x00,0x01,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x00,0x00,0x00,0x01,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x00,0x00,0x00,0x01,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data1 0x05,0x00,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0 data4 0xffffffff data4 0xffffffff data4 0xffffffff data4 0xffffffff movl gp = 0xf0f0f0f0f0f0f0f0 { .mii nop.m 0 nop.i 0 nop.i 0 } { .mmi nop.m 0 nop.m 0 nop.i 0 } { .mmb nop.m 0 nop.m 0 nop.b 0 } { .mmf nop.m 0 nop.m 0 nop.f 0 } { .mbb nop.m 0 nop.b 0 nop.b 0 } movl gp = 0x0000000000000000 { .mlx flushrs movl gp = 0x0000000000000000 } movl gp = 0x0000000000000000 .endp Fore3# data4 0 .align 64 .proc Fore4# Fore4: movl gp = 0x0000000000000000 brl Fore5 .endp Fore4# data4 0 .align 64 data4 0 .align 64 .proc Fore5# Fore5: movl gp = 0xffffffffffffffff brl Fore6 .endp Fore5# data4 0 .align 64 .proc Fore6# Fore6: movl gp = 0x0000000000000000 brl Fore7 .endp Fore6# data4 0 .align 64 .proc Fore7# Fore7: movl gp = 0xffffffffffffffff brl Fore6 brl.call.dptk.many b0=Fore6 br.call.dptk.many b0=Fore6 br.ret.dpnt.many b0 br.ret.dptk.many b0 br.ret.spnt.many b0 br.ret.sptk.many b0 .endp Fore7# data4 0 .align 64 .proc Call8# Call8: { alloc r41=ar.pfs, 10, 0, 8, 0 adds r49=0, r39 mov r40=rp } { adds r48=0, r38 adds r47=0, r37 adds r46=0, r36 ;; } { adds r45=0, r35 adds r44=0, r34 adds r43=0, r33 } { movl gp = 0xffffffffffffffff ;; } { adds r42=0, r32 brl.call.sptk.few rp=Call8Real ;; } Call8Real: { movl gp = 0xffffffffffffffff ;; } { nop.m 0 mov rp=r40, +0 ;; mov.i ar.pfs=r41 } { nop.m 0 nop.m 0 br.ret.sptk.many rp ;; } .endp Call8# data4 0 .align 64 .proc Pass8# Pass8: { alloc r41=ar.pfs, 11, 0, 8, 0 mov r40=rp } { adds r50=0, r39 adds r49=0, r38 adds r48=0, r37 ;; } { adds r47=0, r36 adds r46=0, r35 adds r45=0, r34 } { adds r44=0, r33 adds r43=0, r32 adds r42=0, gp ;; } { movl gp = 0xffffffffffffffff ;; } { brl.call.sptk.few rp=Pass8Real ;; } Pass8Real: { adds gp=0, r42 mov rp=r40, +0 ;; mov.i ar.pfs=r41 } { nop.m 0 nop.m 0 br.ret.sptk.many rp ;; } .endp Pass8# data4 0 .align 64 .proc Last# Last: data4 0xffffffff data4 0xffffffff data4 0xffffffff data4 0xffffffff .skip 0x1000 data4 0xffffffff data4 0xffffffff data4 0xffffffff data4 0xffffffff .endp Last# // End ================================================ FILE: ext/detours/samples/disas/unk.cpp ================================================ ///////////////////////////////////////////////////////////////////////////// // // Detours Test Program (x86.asm of disas.exe) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // static int value = 0; extern "C" void TestCodes() { value++; } ================================================ FILE: ext/detours/samples/disas/x64.asm ================================================ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Detours Test Program (x64.asm/disas.exe) ;; ;; Microsoft Research Detours Package ;; ;; Copyright (c) Microsoft Corporation. All rights reserved. ;; .xlist .list .code PUBLIC TestCodes _TEXT SEGMENT TestCodes PROC begin: faraway: int 3 nop int 3 db 066h,090h ; // 2-byte NOP. int 3 db 00fh, 01fh, 000h ; // 3-byte NOP. int 3 db 00fh, 01fh, 040h, 000h ; // 4-byte NOP. int 3 db 00fh, 01fh, 044h, 000h, 000h ; // 5-byte NOP. int 3 db 066h, 00fh, 01fh, 044h, 000h, 000h ; // 6-byte NOP. int 3 db 00fh, 01fh, 080h, 000h, 000h, 000h, 000h ; // 7-byte NOP. int 3 db 00fh, 01fh, 084h, 000h, 000h, 000h, 000h, 000h ; // 8-byte NOP. int 3 db 066h, 00fh, 01fh, 084h, 000h, 000h, 000h, 000h, 000h ; // 9-byte NOP. int 3 mov rax, cr8 int 3 mov rcx, cr8 int 3 mov rdx, cr8 int 3 mov rbx, cr8 int 3 mov rsp, cr8 int 3 mov rbp, cr8 int 3 mov rsi, cr8 int 3 mov rdi, cr8 int 3 mov r8, cr8 int 3 mov r9, cr8 int 3 mov r10, cr8 int 3 mov r11, cr8 int 3 mov r12, cr8 int 3 mov r13, cr8 int 3 mov r14, cr8 int 3 mov r15, cr8 int 3 mov cr8, rax int 3 mov cr8, rcx int 3 mov cr8, rdx int 3 mov cr8, rbx int 3 mov cr8, rsp int 3 mov cr8, rbp int 3 mov cr8, rsi int 3 mov cr8, rdi int 3 mov cr8, r8 int 3 mov cr8, r9 int 3 mov cr8, r10 int 3 mov cr8, r11 int 3 mov cr8, r12 int 3 mov cr8, r13 int 3 mov cr8, r14 int 3 mov cr8, r15 int 3 xor rax, rax int 3 xor rcx, rcx int 3 xor rdx, rdx int 3 xor rbx, rbx int 3 xor rsp, rsp int 3 xor rbp, rbp int 3 xor rsi, rsi int 3 xor rdi, rdi int 3 xor r8, r8 int 3 xor r9, r9 int 3 xor r10, r10 int 3 xor r11, r11 int 3 xor r12, r12 int 3 xor r13, r13 int 3 xor r14, r14 int 3 xor r15, r15 int 3 jmp rax int 3 jmp rbx int 3 jmp rcx int 3 jmp rdx int 3 push rax int 3 push rbx int 3 push rcx int 3 push rdx int 3 push 0 int 3 pop rax int 3 pop rbx int 3 pop rcx int 3 pop rdx int 3 mov rax,[value] int 3 sub rsp,0418h int 3 mov [rsp+0410h],rbx int 3 mov [rsp+0408h],rsi int 3 mov [rsp+0400h],rdi int 3 mov [rsp+03f8h],r12 int 3 mov [rsp+03f0h],r13 int 3 mov [rsp+03e8h],r14 int 3 mov [rsp+03e0h],r15 int 3 add [rax],al ; 0000 int 3 add [rcx],al ; 0001 int 3 add [rbx],al ; 0003 int 3 add [rax+rax],al ; 000400 int 3 add [rdi],al ; 0007 int 3 add [rax],cl ; 0008 int 3 add [rdi],cl ; 000f int 3 add [rax],dl ; 0010 int 3 add [rdi],bl ; 001f int 3 add [rax],ah ; 0020 int 3 add [rdi],bh ; 003f int 3 add [rax+03bh],cl ; 00483b int 3 add [rdi],bh ; 007f00 int 3 add [rax+040000000h],al ; 008000000040 int 3 add bh,bh ; 00ff int 3 add [rax],eax ; 0100 int 3 add al,[rax] ; 0200 int 3 add eax,06603ebc3h ; 05c3eb0366 int 3 syscall ; 0f05 int 3 prefetchw byte ptr [rcx] ; 0f0d09 int 3 prefetchnta byte ptr [rcx] ; 0f1801 int 3 prefetchnta byte ptr [rax+rdx] ; 0f180410 int 3 jb again ; 0f8247070000 int 3 jnb again ; 0f8306050000 int 3 je again ; 0f8432010000 int 3 jne again ; 0f8508010000 int 3 jnbe again ; 0f878a000000 int 3 ldmxcsr dword ptr [rcx+034h] ; 0fae5134 int 3 stmxcsr dword ptr [rcx+034h] ; 0fae5934 int 3 and ecx,[rdx+rbx*4] ; 230c9a int 3 xor eax,eax ; 33c0 int 3 xor ecx,ecx ; 33c9 int 3 xor edx,ecx ; 33d1 int 3 xor edx,edx ; 33d2 int 3 add r10d,010001h ; 4181c201000100 int 3 and r11d,0ffffh ; 4181e3ffff0000 int 3 mov eax,r8d ; 418bc0 int 3 mov byte ptr [r11],00h ; 41c60300 int 3 call qword ptr [r9+030h] ; 41ff5130 int 3 call qword ptr [r9+r8*8] ; 43ff14c1 int 3 mov [rcx+034h],r8d ; 44894134 int 3 mov [rsp+030h],r9d ; 44894c2430 int 3 mov r8d,[rcx] ; 448b01 int 3 mov r9d,[rcx] ; 448b09 int 3 mov r8d,[rax+058h] ; 448b4058 int 3 mov r8d,[rsp+02ch] ; 448b44242c int 3 mov r8d,eax ; 448bc0 int 3 mov r8d,edx ; 448bc2 int 3 xor r8b,r8b ; 4532c0 int 3 mov r9d,r8d ; 458bc8 int 3 lea r11d,[r9+rax] ; 458d1c01 int 3 add rdx,rcx ; 4803d1 int 3 or rsi,rdx ; 480bf2 int 3 movnti [rcx],rax ; 480fc301 int 3 and rax,0fe000000h ; 4825000000fe int 3 sub rax,rcx ; 482bc1 int 3 sub rdx,rcx ; 482bd1 int 3 cmp rdi,rbp ; 483bfd int 3 push rbp ; 4855 int 3 add rcx,03d0h ; 4881c1d0030000 int 3 add rsp,0c8h ; 4881c4c8000000 int 3 and rdx,0fe000000h ; 4881e2000000fe int 3 sub rsp,0c8h ; 4881ecc8000000 int 3 sub rsp,03d0h ; 4881ecd0030000 int 3 add rax,040h ; 4883c040 int 3 add rcx,08h ; 4883c108 int 3 add rcx,040h ; 4883c140 int 3 add rsp,08h ; 4883c408 int 3 add rsi,09h ; 4883c609 int 3 add rdi,01h ; 4883c701 int 3 and rcx,0f8h ; 4883e1f8 int 3 sub rax,040h ; 4883e840 int 3 sub rdx,08h ; 4883ea08 int 3 sub rdx,040h ; 4883ea40 int 3 sub rsp,08h ; 4883ec08 int 3 sub rsi,08h ; 4883ee08 int 3 sub rdi,01h ; 4883ef01 int 3 test rax,rax ; 4885c0 int 3 test rdx,rdx ; 4885d2 int 3 mov [rsp],rax ; 48890424 int 3 mov [rsp],rbp ; 48892c24 int 3 mov [rsp],rsi ; 48893424 int 3 mov [rsp],rdi ; 48893c24 int 3 mov [rcx+08h],rax ; 48894108 int 3 mov [rcx+078h],rax ; 48894178 int 3 mov [rcx-08h],rax ; 488941f8 int 3 mov [rsp+018h],rax ; 4889442418 int 3 mov [rcx+010h],rdx ; 48895110 int 3 mov [rsp+08h],rbx ; 48895c2408 int 3 mov [rsp+018h],rsi ; 4889742418 int 3 mov [rsp+08h],rdi ; 48897c2408 int 3 mov [rsp+010h],rdi ; 48897c2410 int 3 mov [rcx+098h],rax ; 48898198000000 int 3 mov [rcx+080h],rcx ; 48898980000000 int 3 mov [rcx+088h],rdx ; 48899188000000 int 3 mov [rcx+090h],rbx ; 48899990000000 int 3 mov [rcx+0a0h],rbp ; 4889a9a0000000 int 3 mov [rcx+0a8h],rsi ; 4889b1a8000000 int 3 mov [rcx+0b0h],rdi ; 4889b9b0000000 int 3 mov rax,[rcx] ; 488b01 int 3 mov rax,[rcx+rdx] ; 488b0411 int 3 mov rax,[value] ; 488b05318c0100 int 3 mov rcx,[rsp] ; 488b0c24 int 3 mov rsi,[rsp] ; 488b3424 int 3 mov rdi,[rsp] ; 488b3c24 int 3 mov rax,[rax+018h] ; 488b4018 int 3 mov rax,[rcx+078h] ; 488b4178 int 3 mov rax,[rdx+020h] ; 488b4220 int 3 mov rax,[rsp+08h] ; 488b442408 int 3 mov rcx,[rcx+08h] ; 488b4908 int 3 mov rcx,[rsp+020h] ; 488b4c2420 int 3 mov rdx,[rsp+08h] ; 488b542408 int 3 mov rdi,[rsp+08h] ; 488b7c2408 int 3 mov rax,[rcx+098h] ; 488b8198000000 int 3 mov rax,[rcx+0f8h] ; 488b81f8000000 int 3 cmp ebx,0 ; int 3 cmp rbx,0 ; int 3 cmp byte ptr [value],77h ; 803d........77 int 3 cmp dword ptr [value],77h ; 833d........77 int 3 cmp qword ptr [value],77h ; 48833d........77 int 3 cmp dword ptr [value],77777777h ; 813d........77777777 int 3 cmp qword ptr [value],77777777h ; 48813d........77777777 int 3 nearby: jo nearby ; 70xx int 3 jno nearby ; 71xx int 3 jb nearby ; 72xx int 3 jae nearby ; 73xx int 3 je nearby ; 74xx int 3 jne nearby ; 75xx int 3 jbe nearby ; 76xx int 3 ja nearby ; 77xx int 3 js nearby ; 78xx int 3 jns nearby ; 79xx int 3 jp nearby ; 7axx int 3 jnp nearby ; 7bxx int 3 jl nearby ; 7cxx int 3 jge nearby ; 7dxx int 3 jle nearby ; 7exx int 3 jg nearby ; 7fxx int 3 jmp nearby ; ebxx int 3 jo faraway ; 0f80xxxxxxxx int 3 jno faraway ; 0f81xxxxxxxx int 3 jb faraway ; 0f82xxxxxxxx int 3 jae faraway ; 0f83xxxxxxxx int 3 je faraway ; 0f84xxxxxxxx int 3 jne faraway ; 0f85xxxxxxxx int 3 jbe faraway ; 0f86xxxxxxxx int 3 ja faraway ; 0f87xxxxxxxx int 3 js faraway ; 0f88xxxxxxxx int 3 jns faraway ; 0f89xxxxxxxx int 3 jp faraway ; 0f8axxxxxxxx int 3 jnp faraway ; 0f8bxxxxxxxx int 3 jl faraway ; 0f8cxxxxxxxx int 3 jge faraway ; 0f8dxxxxxxxx int 3 jle faraway ; 0f8exxxxxxxx int 3 jg faraway ; 0f8fxxxxxxxx int 3 jmp faraway ; e9xxxxxxxx int 3 lea rax,[rsp] ; 488d0424 int 3 mov rcx,0BADC0DEBA5Eh ; 48b95ebadec0ad0b0000 int 3 cmp rax,rcx ; 483bc1 int 3 sub rsp, 28h int 3 add rsp,28h int 3 ret int 3 ;; The list is terminated by two "int 3" in a row. again: int 3 int 3 TestCodes ENDP value QWORD 0 _TEXT ENDS END ================================================ FILE: ext/detours/samples/disas/x86.cpp ================================================ ///////////////////////////////////////////////////////////////////////////// // // Detours Test Program (x86.asm of disas.exe) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // static int value = 0; extern "C" void __declspec(naked) TestCodes() { __asm { // Each instruction is proceeded by an "int 3". faraway: int 3; nop; // 1-byte NOP. int 3; _emit 0x66; // 2-byte NOP. _emit 0x90; int 3; _emit 0x0f; // 3-byte NOP. _emit 0x1f; _emit 0x00; int 3; _emit 0x0f; // 4-byte NOP. _emit 0x1f; _emit 0x40; _emit 0x00; int 3; _emit 0x0f; // 5-byte NOP. _emit 0x1f; _emit 0x44; _emit 0x00; _emit 0x00; int 3; _emit 0x66; // 6-byte NOP. _emit 0x0f; _emit 0x1f; _emit 0x44; _emit 0x00; _emit 0x00; int 3; _emit 0x0f; // 7-byte NOP. _emit 0x1f; _emit 0x80; _emit 0x00; _emit 0x00; _emit 0x00; _emit 0x00; int 3; _emit 0x0f; // 8-byte NOP. _emit 0x1f; _emit 0x84; _emit 0x00; _emit 0x00; _emit 0x00; _emit 0x00; _emit 0x00; int 3; _emit 0x66; // 9-byte NOP. _emit 0x0f; _emit 0x1f; _emit 0x84; _emit 0x00; _emit 0x00; _emit 0x00; _emit 0x00; _emit 0x00; int 3; mov ecx, eax; int 3; mov ebx, 0ffff000eh; int 3; call ebx; int 3; call dword ptr [eax]; int 3; call dword ptr [ebx]; int 3; call dword ptr [ecx]; int 3; call dword ptr [edx]; int 3; jmp dword ptr [eax]; int 3; jmp dword ptr [ebx]; int 3; jmp dword ptr [ecx]; int 3; jmp dword ptr [edx]; int 3; call ecx; int 3; call eax; int 3; mov ebx, 0ffff000eh; int 3; push eax; int 3; call ebx; int 3; cmp ebx, 0; int 3; cmp byte ptr [value], 77h; int 3; cmp dword ptr [value], 77h; int 3; cmp dword ptr [value], 77777777h; nearby: int 3 jo nearby ; 70xx int 3 jno nearby ; 71xx int 3 jb nearby ; 72xx int 3 jae nearby ; 73xx int 3 je nearby ; 74xx int 3 jne nearby ; 75xx int 3 jbe nearby ; 76xx int 3 ja nearby ; 77xx int 3 js nearby ; 78xx int 3 jns nearby ; 79xx int 3 jp nearby ; 7axx int 3 jnp nearby ; 7bxx int 3 jl nearby ; 7cxx int 3 jge nearby ; 7dxx int 3 jle nearby ; 7exx int 3 jg nearby ; 7fxx int 3 jo faraway ; 0f80xx int 3 jno faraway ; 0f81xx int 3 jb faraway ; 0f82xx int 3 jae faraway ; 0f83xx int 3 je faraway ; 0f84xx int 3 jne faraway ; 0f85xx int 3 jbe faraway ; 0f86xx int 3 ja faraway ; 0f87xx int 3 js faraway ; 0f88xx int 3 jns faraway ; 0f89xx int 3 jp faraway ; 0f8axx int 3 jnp faraway ; 0f8bxx int 3 jl faraway ; 0f8cxx int 3 jge faraway ; 0f8dxx int 3 jle faraway ; 0f8exx int 3 jg faraway ; 0f8fxx // The list is terminated by two "int 3" in a row. int 3; int 3; ret; } } ================================================ FILE: ext/detours/samples/dtest/Makefile ================================================ ############################################################################## ## ## Makefile for Detours Test Programs. ## ## Microsoft Research Detours Package ## ## Copyright (c) Microsoft Corporation. All rights reserved. ## !include ..\common.mak LIBS=$(LIBS) kernel32.lib all: dirs \ $(BIND)\dtarge$(DETOURS_BITS).dll \ $(BIND)\dtest.exe \ !IF $(DETOURS_SOURCE_BROWSING)==1 $(OBJD)\dtarge$(DETOURS_BITS).bsc \ $(OBJD)\dtest.bsc \ !ENDIF option clean: -del *~ *.obj *.sbr 2> nul -del $(BIND)\dtest.* $(BIND)\dtarge*.* 2> nul -rmdir /q /s $(OBJD) 2>nul realclean: clean -rmdir /q /s $(OBJDS) 2>nul dirs: @if not exist $(BIND) mkdir $(BIND) && echo. Created $(BIND) @if not exist $(OBJD) mkdir $(OBJD) && echo. Created $(OBJD) $(OBJD)\dtarge.obj : dtarge.cpp $(OBJD)\dtarge.res : dtarge.rc $(BIND)\dtarge$(DETOURS_BITS).dll $(BIND)\dtarge$(DETOURS_BITS).lib: \ $(OBJD)\dtarge.obj $(OBJD)\dtarge.res $(DEPS) cl /LD $(CFLAGS) \ /Fe$(@R).dll \ /Fd$(@R).pdb \ $(OBJD)\dtarge.obj $(OBJD)\dtarge.res \ /link $(LINKFLAGS) /subsystem:console \ /export:Target0 \ /export:Target1 \ /export:Target2 \ /export:Target3 \ /export:Target4 \ /export:Target5 \ /export:Target6 \ /export:Target7 \ /export:Target8 \ /export:Target9 \ /export:Target10 \ /export:Target11 \ /export:Target12 \ /export:Target13 \ /export:Target14 \ /export:Target15 \ /export:Target16 \ /export:TargetV \ /export:TargetR \ $(LIBS) $(OBJD)\dtarge$(DETOURS_BITS).bsc : $(OBJD)\dtarge.obj bscmake /v /n /o $@ $(OBJD)\dtarge.sbr $(OBJD)\dtest.obj : dtest.cpp $(BIND)\dtest.exe : $(OBJD)\dtest.obj $(BIND)\dtarge$(DETOURS_BITS).lib $(DEPS) cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb $(OBJD)\dtest.obj \ /link $(LINKFLAGS) $(LIBS) $(BIND)\dtarge$(DETOURS_BITS).lib \ /subsystem:console /entry:WinMainCRTStartup $(OBJD)\dtest.bsc : $(OBJD)\dtest.obj bscmake /v /n /o $@ $(OBJD)\dtest.sbr ############################################### Install non-bit-size binaries. !IF "$(DETOURS_OPTION_PROCESSOR)" != "" $(OPTD)\dtarge$(DETOURS_OPTION_BITS).dll: $(OPTD)\dtarge$(DETOURS_OPTION_BITS).pdb: $(BIND)\dtarge$(DETOURS_OPTION_BITS).dll : $(OPTD)\dtarge$(DETOURS_OPTION_BITS).dll @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\dtarge$(DETOURS_OPTION_BITS).pdb : $(OPTD)\dtarge$(DETOURS_OPTION_BITS).pdb @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). option: \ $(BIND)\dtarge$(DETOURS_OPTION_BITS).dll \ $(BIND)\dtarge$(DETOURS_OPTION_BITS).pdb \ !ELSE option: !ENDIF ############################################################################## test: all $(BIND)\dtest.exe ################################################################# End of File. ================================================ FILE: ext/detours/samples/dtest/NORMAL_IA64.TXT ================================================ ..\..\bin.IA64\dtest.exe Calling LocalTarget1 w/o detour LocalTarget1 (1) Calling LocalTarget1 w/ detour MyLocalTarget1 (2) LocalTarget1 (2) Calling Target0 function. MyTarget0 () Calling TargetN functions. MyLocalTarget1 (1) LocalTarget1 (1) MyTarget0 () MyTarget1 (1) MyTarget2 (1,2) MyTarget3 (1,2,3) MyTarget4 (1,2,3,4) MyTarget5 (1,2,3,4,5) MyTarget6 (1,2,3,4,5,6) MyTarget7 (1,2,3,4,5,6,7) MyTarget8 (1,2,3,4,5,6,7,8) MyTarget9 (1,2,3,4,5,6,7,8,9) MyTarget10(1,2,3,4,5,6,7,8,9,10) MyTarget11(1,2,3,4,5,6,7,8,9,10,11) MyTarget12(1,2,3,4,5,6,7,8,9,10,11,12) MyTarget13(1,2,3,4,5,6,7,8,9,10,11,12,13) MyTarget14(1,2,3,4,5,6,7,8,9,10,11,12,13,14) MyTarget15(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) MyTarget16(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16) MyTargetV (0) MyTargetV (0,1) MyTargetV (0,1,2) MyTargetV (0,1,2,3) MyTargetV (0,1,2,3,4) MyTargetV (0,1,2,3,4,5) MyTargetV (0,1,2,3,4,5,6) MyTargetV (0,1,2,3,4,5,6,7) MyTargetV (0,1,2,3,4,5,6,7,8) MyTargetV (0,1,2,3,4,5,6,7,8,9) MyTargetV (0,1,2,3,4,5,6,7,8,9,10) MyTargetV (0,1,2,3,4,5,6,7,8,9,10,11) MyTargetV (0,1,2,3,4,5,6,7,8,9,10,11,12) MyTargetV (0,1,2,3,4,5,6,7,8,9,10,11,12,13) MyTargetV (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14) MyTargetV (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) MyTargetV (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16) MyTargetR (0,1,2,3,4) MyTargetR (0,1,2,3,3) MyTargetR (0,1,2,3,2) MyTargetR (0,1,2,3,1) .................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... MyTargetR (0,1,2,3,4,5,6,7,8,9,10,4) MyTargetR (0,1,2,3,4,5,6,7,8,9,10,3) MyTargetR (0,1,2,3,4,5,6,7,8,9,10,2) MyTargetR (0,1,2,3,4,5,6,7,8,9,10,1) => 3011 Calling Target0 again with 1 detour. MyTarget0 () Calling Target0 again with 2 detours. Starting Target0_1. MyTarget0 () End Target0_1. Calling Target0 again with 3 detours. Starting Target0_2. Starting Target0_1. MyTarget0 () End Target0_1. End Target0_2. Calling Target0 again with 4 detours. Starting Target0_3. Starting Target0_2. Starting Target0_1. MyTarget0 () End Target0_1. End Target0_2. End Target0_3. Done. Target0 () Target0 () Target1 (1) Target2 (1,2) Target3 (1,2,3) Target4 (1,2,3,4) Target5 (1,2,3,4,5) Target6 (1,2,3,4,5,6) Target7 (1,2,3,4,5,6,7) Target8 (1,2,3,4,5,6,7,8) Target9 (1,2,3,4,5,6,7,8,9) Target10(1,2,3,4,5,6,7,8,9,10) Target11(1,2,3,4,5,6,7,8,9,10,11) Target12(1,2,3,4,5,6,7,8,9,10,11,12) Target13(1,2,3,4,5,6,7,8,9,10,11,12,13) Target14(1,2,3,4,5,6,7,8,9,10,11,12,13,14) Target15(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) Target16(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16) TargetV (0) TargetV (0,1) TargetV (0,1,2) TargetV (0,1,2,3) TargetV (0,1,2,3,4) TargetV (0,1,2,3,4,5) TargetV (0,1,2,3,4,5,6) TargetV (0,1,2,3,4,5,6,7) TargetV (0,1,2,3,4,5,6,7,8) TargetV (0,1,2,3,4,5,6,7,8,9) TargetV (0,1,2,3,4,5,6,7,8,9,10) TargetV (0,1,2,3,4,5,6,7,8,9,10,11) TargetV (0,1,2,3,4,5,6,7,8,9,10,11,12) TargetV (0,1,2,3,4,5,6,7,8,9,10,11,12,13) TargetV (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14) TargetV (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) TargetV (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16) ::: TargetR (0,1,2,3,1) ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: TargetR (0,1,2,3,4,5,6,7,8,9,10,1) Target0 () Target0 () Target0 () Target0 () ================================================ FILE: ext/detours/samples/dtest/NORMAL_X64.TXT ================================================ ..\..\bin.X64\dtest.exe Calling LocalTarget1 w/o detour LocalTarget1 (1) Calling LocalTarget1 w/ detour MyLocalTarget1 (2) LocalTarget1 (2) Calling Target0 function. MyTarget0 () Calling TargetN functions. MyLocalTarget1 (1) LocalTarget1 (1) MyTarget0 () MyTarget1 (1) MyTarget2 (1,2) MyTarget3 (1,2,3) MyTarget4 (1,2,3,4) MyTarget5 (1,2,3,4,5) MyTarget6 (1,2,3,4,5,6) MyTarget7 (1,2,3,4,5,6,7) MyTarget8 (1,2,3,4,5,6,7,8) MyTarget9 (1,2,3,4,5,6,7,8,9) MyTarget10(1,2,3,4,5,6,7,8,9,10) MyTarget11(1,2,3,4,5,6,7,8,9,10,11) MyTarget12(1,2,3,4,5,6,7,8,9,10,11,12) MyTarget13(1,2,3,4,5,6,7,8,9,10,11,12,13) MyTarget14(1,2,3,4,5,6,7,8,9,10,11,12,13,14) MyTarget15(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) MyTarget16(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16) MyTargetV (0) MyTargetV (0,1) MyTargetV (0,1,2) MyTargetV (0,1,2,3) MyTargetV (0,1,2,3,4) MyTargetV (0,1,2,3,4,5) MyTargetV (0,1,2,3,4,5,6) MyTargetV (0,1,2,3,4,5,6,7) MyTargetV (0,1,2,3,4,5,6,7,8) MyTargetV (0,1,2,3,4,5,6,7,8,9) MyTargetV (0,1,2,3,4,5,6,7,8,9,10) MyTargetV (0,1,2,3,4,5,6,7,8,9,10,11) MyTargetV (0,1,2,3,4,5,6,7,8,9,10,11,12) MyTargetV (0,1,2,3,4,5,6,7,8,9,10,11,12,13) MyTargetV (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14) MyTargetV (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) MyTargetV (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16) MyTargetR (0,1,2,3,4) MyTargetR (0,1,2,3,3) MyTargetR (0,1,2,3,2) MyTargetR (0,1,2,3,1) .................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... MyTargetR (0,1,2,3,4,5,6,7,8,9,10,4) MyTargetR (0,1,2,3,4,5,6,7,8,9,10,3) MyTargetR (0,1,2,3,4,5,6,7,8,9,10,2) MyTargetR (0,1,2,3,4,5,6,7,8,9,10,1) => 3011 Calling Target0 again with 1 detour. MyTarget0 () Calling Target0 again with 2 detours. Starting Target0_1. MyTarget0 () End Target0_1. Calling Target0 again with 3 detours. Starting Target0_2. Starting Target0_1. MyTarget0 () End Target0_1. End Target0_2. Calling Target0 again with 4 detours. Starting Target0_3. Starting Target0_2. Starting Target0_1. MyTarget0 () End Target0_1. End Target0_2. End Target0_3. Done. Target0 () Target0 () Target1 (1) Target2 (1,2) Target3 (1,2,3) Target4 (1,2,3,4) Target5 (1,2,3,4,5) Target6 (1,2,3,4,5,6) Target7 (1,2,3,4,5,6,7) Target8 (1,2,3,4,5,6,7,8) Target9 (1,2,3,4,5,6,7,8,9) Target10(1,2,3,4,5,6,7,8,9,10) Target11(1,2,3,4,5,6,7,8,9,10,11) Target12(1,2,3,4,5,6,7,8,9,10,11,12) Target13(1,2,3,4,5,6,7,8,9,10,11,12,13) Target14(1,2,3,4,5,6,7,8,9,10,11,12,13,14) Target15(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) Target16(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16) TargetV (0) TargetV (0,1) TargetV (0,1,2) TargetV (0,1,2,3) TargetV (0,1,2,3,4) TargetV (0,1,2,3,4,5) TargetV (0,1,2,3,4,5,6) TargetV (0,1,2,3,4,5,6,7) TargetV (0,1,2,3,4,5,6,7,8) TargetV (0,1,2,3,4,5,6,7,8,9) TargetV (0,1,2,3,4,5,6,7,8,9,10) TargetV (0,1,2,3,4,5,6,7,8,9,10,11) TargetV (0,1,2,3,4,5,6,7,8,9,10,11,12) TargetV (0,1,2,3,4,5,6,7,8,9,10,11,12,13) TargetV (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14) TargetV (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) TargetV (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16) ::: TargetR (0,1,2,3,1) ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: TargetR (0,1,2,3,4,5,6,7,8,9,10,1) Target0 () Target0 () Target0 () Target0 () ================================================ FILE: ext/detours/samples/dtest/NORMAL_X86.TXT ================================================ ..\..\bin.X86\dtest.exe Calling LocalTarget1 w/o detour LocalTarget1 (1) Calling LocalTarget1 w/ detour MyLocalTarget1 (2) LocalTarget1 (2) Calling Target0 function. MyTarget0 () Calling TargetN functions. MyLocalTarget1 (1) LocalTarget1 (1) MyTarget0 () MyTarget1 (1) MyTarget2 (1,2) MyTarget3 (1,2,3) MyTarget4 (1,2,3,4) MyTarget5 (1,2,3,4,5) MyTarget6 (1,2,3,4,5,6) MyTarget7 (1,2,3,4,5,6,7) MyTarget8 (1,2,3,4,5,6,7,8) MyTarget9 (1,2,3,4,5,6,7,8,9) MyTarget10(1,2,3,4,5,6,7,8,9,10) MyTarget11(1,2,3,4,5,6,7,8,9,10,11) MyTarget12(1,2,3,4,5,6,7,8,9,10,11,12) MyTarget13(1,2,3,4,5,6,7,8,9,10,11,12,13) MyTarget14(1,2,3,4,5,6,7,8,9,10,11,12,13,14) MyTarget15(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) MyTarget16(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16) MyTargetV (0) MyTargetV (0,1) MyTargetV (0,1,2) MyTargetV (0,1,2,3) MyTargetV (0,1,2,3,4) MyTargetV (0,1,2,3,4,5) MyTargetV (0,1,2,3,4,5,6) MyTargetV (0,1,2,3,4,5,6,7) MyTargetV (0,1,2,3,4,5,6,7,8) MyTargetV (0,1,2,3,4,5,6,7,8,9) MyTargetV (0,1,2,3,4,5,6,7,8,9,10) MyTargetV (0,1,2,3,4,5,6,7,8,9,10,11) MyTargetV (0,1,2,3,4,5,6,7,8,9,10,11,12) MyTargetV (0,1,2,3,4,5,6,7,8,9,10,11,12,13) MyTargetV (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14) MyTargetV (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) MyTargetV (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16) MyTargetR (0,1,2,3,4) MyTargetR (0,1,2,3,3) MyTargetR (0,1,2,3,2) MyTargetR (0,1,2,3,1) .................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... MyTargetR (0,1,2,3,4,5,6,7,8,9,10,4) MyTargetR (0,1,2,3,4,5,6,7,8,9,10,3) MyTargetR (0,1,2,3,4,5,6,7,8,9,10,2) MyTargetR (0,1,2,3,4,5,6,7,8,9,10,1) => 3011 Calling Target0 again with 1 detour. MyTarget0 () Calling Target0 again with 2 detours. Starting Target0_1. MyTarget0 () End Target0_1. Calling Target0 again with 3 detours. Starting Target0_2. Starting Target0_1. MyTarget0 () End Target0_1. End Target0_2. Calling Target0 again with 4 detours. Starting Target0_3. Starting Target0_2. Starting Target0_1. MyTarget0 () End Target0_1. End Target0_2. End Target0_3. Done. Target0 () Target0 () Target1 (1) Target2 (1,2) Target3 (1,2,3) Target4 (1,2,3,4) Target5 (1,2,3,4,5) Target6 (1,2,3,4,5,6) Target7 (1,2,3,4,5,6,7) Target8 (1,2,3,4,5,6,7,8) Target9 (1,2,3,4,5,6,7,8,9) Target10(1,2,3,4,5,6,7,8,9,10) Target11(1,2,3,4,5,6,7,8,9,10,11) Target12(1,2,3,4,5,6,7,8,9,10,11,12) Target13(1,2,3,4,5,6,7,8,9,10,11,12,13) Target14(1,2,3,4,5,6,7,8,9,10,11,12,13,14) Target15(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) Target16(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16) TargetV (0) TargetV (0,1) TargetV (0,1,2) TargetV (0,1,2,3) TargetV (0,1,2,3,4) TargetV (0,1,2,3,4,5) TargetV (0,1,2,3,4,5,6) TargetV (0,1,2,3,4,5,6,7) TargetV (0,1,2,3,4,5,6,7,8) TargetV (0,1,2,3,4,5,6,7,8,9) TargetV (0,1,2,3,4,5,6,7,8,9,10) TargetV (0,1,2,3,4,5,6,7,8,9,10,11) TargetV (0,1,2,3,4,5,6,7,8,9,10,11,12) TargetV (0,1,2,3,4,5,6,7,8,9,10,11,12,13) TargetV (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14) TargetV (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) TargetV (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16) ::: TargetR (0,1,2,3,1) ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: TargetR (0,1,2,3,4,5,6,7,8,9,10,1) Target0 () Target0 () Target0 () Target0 () ================================================ FILE: ext/detours/samples/dtest/dtarge.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (dtarge.dll) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include #include #include "dtarge.h" DWORD_PTR WINAPI Target0() { printf(" Target0 ()\n"); return 1000; } DWORD_PTR WINAPI Target1(DWORD_PTR v1) { printf(" Target1 (%ld)\n", (DWORD)v1); return 1001; } DWORD_PTR WINAPI Target2(DWORD_PTR v1, DWORD_PTR v2) { printf(" Target2 (%ld,%ld)\n", (DWORD)v1, (DWORD)v2); return 1002; } DWORD_PTR WINAPI Target3(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3) { printf(" Target3 (%ld,%ld,%ld)\n", (DWORD)v1, (DWORD)v2, (DWORD)v3); return 1003; } DWORD_PTR WINAPI Target4(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4) { printf(" Target4 (%ld,%ld,%ld,%ld)\n", (DWORD)v1, (DWORD)v2, (DWORD)v3, (DWORD)v4); return 1004; } DWORD_PTR WINAPI Target5(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5) { printf(" Target5 (%ld,%ld,%ld,%ld,%ld)\n", (DWORD)v1, (DWORD)v2, (DWORD)v3, (DWORD)v4, (DWORD)v5); return 1005; } DWORD_PTR WINAPI Target6(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6) { printf(" Target6 (%ld,%ld,%ld,%ld,%ld,%ld)\n", (DWORD)v1, (DWORD)v2, (DWORD)v3, (DWORD)v4, (DWORD)v5, (DWORD)v6); return 1006; } DWORD_PTR WINAPI Target7(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7) { printf(" Target7 (%ld,%ld,%ld,%ld,%ld,%ld,%ld)\n", (DWORD)v1, (DWORD)v2, (DWORD)v3, (DWORD)v4, (DWORD)v5, (DWORD)v6, (DWORD)v7); return 1007; } DWORD_PTR WINAPI Target8(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8) { printf(" Target8 (%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)\n", (DWORD)v1, (DWORD)v2, (DWORD)v3, (DWORD)v4, (DWORD)v5, (DWORD)v6, (DWORD)v7, (DWORD)v8); return 1008; } DWORD_PTR WINAPI Target9(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8, DWORD_PTR v9) { printf(" Target9 (%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)\n", (DWORD)v1, (DWORD)v2, (DWORD)v3, (DWORD)v4, (DWORD)v5, (DWORD)v6, (DWORD)v7, (DWORD)v8, (DWORD)v9); return 1009; } DWORD_PTR WINAPI Target10(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8, DWORD_PTR v9, DWORD_PTR v10) { printf(" Target10(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)\n", (DWORD)v1, (DWORD)v2, (DWORD)v3, (DWORD)v4, (DWORD)v5, (DWORD)v6, (DWORD)v7, (DWORD)v8, (DWORD)v9, (DWORD)v10); return 1010; } DWORD_PTR WINAPI Target11(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8, DWORD_PTR v9, DWORD_PTR v10, DWORD_PTR v11) { printf(" Target11(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)\n", (DWORD)v1, (DWORD)v2, (DWORD)v3, (DWORD)v4, (DWORD)v5, (DWORD)v6, (DWORD)v7, (DWORD)v8, (DWORD)v9, (DWORD)v10, (DWORD)v11); return 1011; } DWORD_PTR WINAPI Target12(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8, DWORD_PTR v9, DWORD_PTR v10, DWORD_PTR v11, DWORD_PTR v12) { printf(" Target12(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)\n", (DWORD)v1, (DWORD)v2, (DWORD)v3, (DWORD)v4, (DWORD)v5, (DWORD)v6, (DWORD)v7, (DWORD)v8, (DWORD)v9, (DWORD)v10, (DWORD)v11, (DWORD)v12); return 1012; } DWORD_PTR WINAPI Target13(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8, DWORD_PTR v9, DWORD_PTR v10, DWORD_PTR v11, DWORD_PTR v12, DWORD_PTR v13) { printf(" Target13(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)\n", (DWORD)v1, (DWORD)v2, (DWORD)v3, (DWORD)v4, (DWORD)v5, (DWORD)v6, (DWORD)v7, (DWORD)v8, (DWORD)v9, (DWORD)v10, (DWORD)v11, (DWORD)v12, (DWORD)v13); return 1013; } DWORD_PTR WINAPI Target14(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8, DWORD_PTR v9, DWORD_PTR v10, DWORD_PTR v11, DWORD_PTR v12, DWORD_PTR v13, DWORD_PTR v14) { printf(" Target14(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)\n", (DWORD)v1, (DWORD)v2, (DWORD)v3, (DWORD)v4, (DWORD)v5, (DWORD)v6, (DWORD)v7, (DWORD)v8, (DWORD)v9, (DWORD)v10, (DWORD)v11, (DWORD)v12, (DWORD)v13, (DWORD)v14); return 1014; } DWORD_PTR WINAPI Target15(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8, DWORD_PTR v9, DWORD_PTR v10, DWORD_PTR v11, DWORD_PTR v12, DWORD_PTR v13, DWORD_PTR v14, DWORD_PTR v15) { printf(" Target15(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)\n", (DWORD)v1, (DWORD)v2, (DWORD)v3, (DWORD)v4, (DWORD)v5, (DWORD)v6, (DWORD)v7, (DWORD)v8, (DWORD)v9, (DWORD)v10, (DWORD)v11, (DWORD)v12, (DWORD)v13, (DWORD)v14, (DWORD)v15); return 1015; } DWORD_PTR WINAPI Target16(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8, DWORD_PTR v9, DWORD_PTR v10, DWORD_PTR v11, DWORD_PTR v12, DWORD_PTR v13, DWORD_PTR v14, DWORD_PTR v15, DWORD_PTR v16) { printf(" Target16(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)\n", (DWORD)v1, (DWORD)v2, (DWORD)v3, (DWORD)v4, (DWORD)v5, (DWORD)v6, (DWORD)v7, (DWORD)v8, (DWORD)v9, (DWORD)v10, (DWORD)v11, (DWORD)v12, (DWORD)v13, (DWORD)v14, (DWORD)v15, (DWORD)v16); return 1016; } DWORD_PTR WINAPI TargetV(DWORD_PTR v1, ...) { DWORD_PTR args[32]; va_list va; va_start(va, v1); int argc = 0; for (args[argc++] = v1; args[argc-1] != 0;) { args[argc++] = va_arg(va, DWORD_PTR); } va_end(va); printf(" TargetV ("); int i = argc - 1; for (; i > 0; i--) { printf("%ld,", (DWORD)args[i]); } printf("%ld)\n", (DWORD)args[0]); return 1000 + argc; } DWORD_PTR WINAPI TargetR(DWORD_PTR v1, ...) { DWORD_PTR args[32]; va_list va; va_start(va, v1); int argc = 0; for (args[argc++] = v1; args[argc-1] != 0;) { args[argc++] = va_arg(va, DWORD_PTR); } va_end(va); if (v1 > 1) { printf(":"); switch (argc) { default: return TargetR(0) + 1; case 1: return TargetR(args[0] - 1) + 1; case 2: return TargetR(args[0] - 1, args[1]) + 1; case 3: return TargetR(args[0] - 1, args[1], args[2]) + 1; case 4: return TargetR(args[0] - 1, args[1], args[2], args[3]) + 1; case 5: return TargetR(args[0] - 1, args[1], args[2], args[3], args[4]) + 1; case 6: return TargetR(args[0] - 1, args[1], args[2], args[3], args[4], args[5]) + 1; case 7: return TargetR(args[0] - 1, args[1], args[2], args[3], args[4], args[5], args[6]) + 1; case 8: return TargetR(args[0] - 1, args[1], args[2], args[3], args[4], args[5], args[6], args[7]) + 1; case 9: return TargetR(args[0] - 1, args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8]) + 1; case 10: return TargetR(args[0] - 1, args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9]) + 1; case 11: return TargetR(args[0] - 1, args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10]) + 1; case 12: return TargetR(args[0] - 1, args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11]) + 1; case 13: return TargetR(args[0] - 1, args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11], args[12]) + 1; case 14: return TargetR(args[0] - 1, args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11], args[12], args[13]) + 1; case 15: return TargetR(args[0] - 1, args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11], args[12], args[13], args[14]) + 1; case 16: return TargetR(args[0] - 1, args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11], args[12], args[13], args[14], args[15]) + 1; case 17: return TargetR(args[0] - 1, args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11], args[12], args[13], args[14], args[15], args[16]) + 1; } } printf(" TargetR ("); int i = argc - 1; for (; i > 0; i--) { printf("%ld,", (DWORD)args[i]); } printf("%ld)\n", (DWORD)args[0]); return 2000 + argc; } BOOL WINAPI DllMain(HINSTANCE hinst, DWORD dwReason, LPVOID reserved) { (void)hinst; (void)dwReason; (void)reserved; return TRUE; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/dtest/dtarge.h ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (dtarge.h of dtarge.dll) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #pragma once #if (_MSC_VER < 1299) typedef DWORD DWORD_PTR; #endif DWORD_PTR WINAPI Target0(); DWORD_PTR WINAPI Target1(DWORD_PTR v1); DWORD_PTR WINAPI Target2(DWORD_PTR v1, DWORD_PTR v2); DWORD_PTR WINAPI Target3(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3); DWORD_PTR WINAPI Target4(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4); DWORD_PTR WINAPI Target5(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5); DWORD_PTR WINAPI Target6(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6); DWORD_PTR WINAPI Target7(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7); DWORD_PTR WINAPI Target8(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8); DWORD_PTR WINAPI Target9(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8, DWORD_PTR v9); DWORD_PTR WINAPI Target10(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8, DWORD_PTR v9, DWORD_PTR v10); DWORD_PTR WINAPI Target11(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8, DWORD_PTR v9, DWORD_PTR v10, DWORD_PTR v11); DWORD_PTR WINAPI Target12(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8, DWORD_PTR v9, DWORD_PTR v10, DWORD_PTR v11, DWORD_PTR v12); DWORD_PTR WINAPI Target13(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8, DWORD_PTR v9, DWORD_PTR v10, DWORD_PTR v11, DWORD_PTR v12, DWORD_PTR v13); DWORD_PTR WINAPI Target14(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8, DWORD_PTR v9, DWORD_PTR v10, DWORD_PTR v11, DWORD_PTR v12, DWORD_PTR v13, DWORD_PTR v14); DWORD_PTR WINAPI Target15(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8, DWORD_PTR v9, DWORD_PTR v10, DWORD_PTR v11, DWORD_PTR v12, DWORD_PTR v13, DWORD_PTR v14, DWORD_PTR v15); DWORD_PTR WINAPI Target16(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8, DWORD_PTR v9, DWORD_PTR v10, DWORD_PTR v11, DWORD_PTR v12, DWORD_PTR v13, DWORD_PTR v14, DWORD_PTR v15, DWORD_PTR v16); DWORD_PTR WINAPI TargetV(DWORD_PTR v1, ...); DWORD_PTR WINAPI TargetR(DWORD_PTR v1, ...); // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/dtest/dtarge.rc ================================================ ////////////////////////////////////////////////////////////////////////////// // // Version information for dtarge.rc. // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include "detver.h" #define VER_INTERNALNAME_STR "dtarge" DETOURS_STRINGIFY(DETOURS_BITS) #define VER_ORIGINALFILENAME_STR "dtarge" DETOURS_STRINGIFY(DETOURS_BITS) ".dll" #define VER_FILEDESCRIPTION_STR "Detours Test Module" #define VER_COMPANYNAME_STR "Microsoft Corporation" #include "common.ver" ================================================ FILE: ext/detours/samples/dtest/dtest.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (dtest.cpp of dtest.exe) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include #include #include #pragma warning(push) #if _MSC_VER > 1400 #pragma warning(disable:6102 6103) // /analyze warnings #endif #include #pragma warning(pop) #include #include "dtarge.h" DWORD_PTR WINAPI LocalTarget1(DWORD_PTR v1); ////////////////////////////////////////////////////// Multi-Argument Detours. // DWORD_PTR (WINAPI * Trampoline_LocalTarget1)(DWORD_PTR v1) = LocalTarget1; DWORD_PTR (WINAPI * Trampoline_Target0)() = Target0; DWORD_PTR (WINAPI * Trampoline_Target1)(DWORD_PTR v1) = Target1; DWORD_PTR (WINAPI * Trampoline_Target2)(DWORD_PTR v1, DWORD_PTR v2) = Target2; DWORD_PTR (WINAPI * Trampoline_Target3) (DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3) = Target3; DWORD_PTR (WINAPI * Trampoline_Target4) (DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4) = Target4; DWORD_PTR (WINAPI * Trampoline_Target5) (DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5) = Target5; DWORD_PTR (WINAPI * Trampoline_Target6) (DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6) = Target6; DWORD_PTR (WINAPI * Trampoline_Target7) (DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7) = Target7; DWORD_PTR (WINAPI * Trampoline_Target8) (DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8) = Target8; DWORD_PTR (WINAPI * Trampoline_Target9) (DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8, DWORD_PTR v9) = Target9; DWORD_PTR (WINAPI * Trampoline_Target10) (DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8, DWORD_PTR v9, DWORD_PTR v10) = Target10; DWORD_PTR (WINAPI * Trampoline_Target11) (DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8, DWORD_PTR v9, DWORD_PTR v10, DWORD_PTR v11) = Target11; DWORD_PTR (WINAPI * Trampoline_Target12) (DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8, DWORD_PTR v9, DWORD_PTR v10, DWORD_PTR v11, DWORD_PTR v12) = Target12; DWORD_PTR (WINAPI * Trampoline_Target13) (DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8, DWORD_PTR v9, DWORD_PTR v10, DWORD_PTR v11, DWORD_PTR v12, DWORD_PTR v13) = Target13; DWORD_PTR (WINAPI * Trampoline_Target14) (DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8, DWORD_PTR v9, DWORD_PTR v10, DWORD_PTR v11, DWORD_PTR v12, DWORD_PTR v13, DWORD_PTR v14) = Target14; DWORD_PTR (WINAPI * Trampoline_Target15) (DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8, DWORD_PTR v9, DWORD_PTR v10, DWORD_PTR v11, DWORD_PTR v12, DWORD_PTR v13, DWORD_PTR v14, DWORD_PTR v15) = Target15; DWORD_PTR (WINAPI * Trampoline_Target16) (DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8, DWORD_PTR v9, DWORD_PTR v10, DWORD_PTR v11, DWORD_PTR v12, DWORD_PTR v13, DWORD_PTR v14, DWORD_PTR v15, DWORD_PTR v16) = Target16; DWORD_PTR (WINAPI * Trampoline_TargetV)(DWORD_PTR v1, ...) = TargetV; DWORD_PTR (WINAPI * Trampoline_TargetR)(DWORD_PTR v1, ...) = TargetR; ////////////////////////////////////////////////////////////////////////////// // VOID dprintf(const char * fmt, ...) { CHAR szBuf[1024]; va_list args; va_start(args, fmt); StringCchPrintfA(szBuf, sizeof(szBuf), fmt, args); va_end(args); OutputDebugStringA(szBuf); } ////////////////////////////////////////////////////////////////////////////// // DWORD_PTR WINAPI LocalTarget1(DWORD_PTR v1) { printf(" LocalTarget1 (%ld)\n", (DWORD)v1); // dprintf("LocalTarget1\n"); // __debugbreak(); return 9000; } ////////////////////////////////////////////////////////////////////////////// // DWORD_PTR WINAPI MyLocalTarget1(DWORD_PTR v1) { printf(" MyLocalTarget1 (%ld)\n", (DWORD)v1); // dprintf("LocalTarget1, Trampoline_LocalTarget1=%p\n", Trampoline_LocalTarget1); return Trampoline_LocalTarget1(v1); } DWORD_PTR WINAPI MyTarget0() { printf(" MyTarget0 ()\n"); return Trampoline_Target0(); } DWORD_PTR WINAPI MyTarget1(DWORD_PTR v1) { printf(" MyTarget1 (%ld)\n", (DWORD)v1); return Trampoline_Target1(v1); } DWORD_PTR WINAPI MyTarget2(DWORD_PTR v1, DWORD_PTR v2) { printf(" MyTarget2 (%ld,%ld)\n", (DWORD)v1, (DWORD)v2); return Trampoline_Target2(v1,v2); } DWORD_PTR WINAPI MyTarget3(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3) { printf(" MyTarget3 (%ld,%ld,%ld)\n", (DWORD)v1, (DWORD)v2, (DWORD)v3); return Trampoline_Target3(v1,v2,v3); } DWORD_PTR WINAPI MyTarget4(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4) { printf(" MyTarget4 (%ld,%ld,%ld,%ld)\n", (DWORD)v1, (DWORD)v2, (DWORD)v3, (DWORD)v4); return Trampoline_Target4(v1,v2,v3,v4); } DWORD_PTR WINAPI MyTarget5(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5) { printf(" MyTarget5 (%ld,%ld,%ld,%ld,%ld)\n", (DWORD)v1, (DWORD)v2, (DWORD)v3, (DWORD)v4, (DWORD)v5); return Trampoline_Target5(v1,v2,v3,v4,v5); } DWORD_PTR WINAPI MyTarget6(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6) { printf(" MyTarget6 (%ld,%ld,%ld,%ld,%ld,%ld)\n", (DWORD)v1, (DWORD)v2, (DWORD)v3, (DWORD)v4, (DWORD)v5, (DWORD)v6); return Trampoline_Target6(v1,v2,v3,v4,v5,v6); } DWORD_PTR WINAPI MyTarget7(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7) { printf(" MyTarget7 (%ld,%ld,%ld,%ld,%ld,%ld,%ld)\n", (DWORD)v1, (DWORD)v2, (DWORD)v3, (DWORD)v4, (DWORD)v5, (DWORD)v6, (DWORD)v7); return Trampoline_Target7(v1,v2,v3,v4,v5,v6,v7); } DWORD_PTR WINAPI MyTarget8(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8) { printf(" MyTarget8 (%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)\n", (DWORD)v1, (DWORD)v2, (DWORD)v3, (DWORD)v4, (DWORD)v5, (DWORD)v6, (DWORD)v7, (DWORD)v8); return Trampoline_Target8(v1,v2,v3,v4,v5,v6,v7,v8); } DWORD_PTR WINAPI MyTarget9(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8, DWORD_PTR v9) { printf(" MyTarget9 (%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)\n", (DWORD)v1, (DWORD)v2, (DWORD)v3, (DWORD)v4, (DWORD)v5, (DWORD)v6, (DWORD)v7, (DWORD)v8, (DWORD)v9); return Trampoline_Target9(v1,v2,v3,v4,v5,v6,v7,v8,v9); } DWORD_PTR WINAPI MyTarget10(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8, DWORD_PTR v9, DWORD_PTR v10) { printf(" MyTarget10(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)\n", (DWORD)v1, (DWORD)v2, (DWORD)v3, (DWORD)v4, (DWORD)v5, (DWORD)v6, (DWORD)v7, (DWORD)v8, (DWORD)v9, (DWORD)v10); return Trampoline_Target10(v1,v2,v3,v4,v5,v6,v7,v8,v9,v10); } DWORD_PTR WINAPI MyTarget11(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8, DWORD_PTR v9, DWORD_PTR v10, DWORD_PTR v11) { printf(" MyTarget11(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)\n", (DWORD)v1, (DWORD)v2, (DWORD)v3, (DWORD)v4, (DWORD)v5, (DWORD)v6, (DWORD)v7, (DWORD)v8, (DWORD)v9, (DWORD)v10, (DWORD)v11); return Trampoline_Target11(v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11); } DWORD_PTR WINAPI MyTarget12(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8, DWORD_PTR v9, DWORD_PTR v10, DWORD_PTR v11, DWORD_PTR v12) { printf(" MyTarget12(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)\n", (DWORD)v1, (DWORD)v2, (DWORD)v3, (DWORD)v4, (DWORD)v5, (DWORD)v6, (DWORD)v7, (DWORD)v8, (DWORD)v9, (DWORD)v10, (DWORD)v11, (DWORD)v12); return Trampoline_Target12(v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12); } DWORD_PTR WINAPI MyTarget13(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8, DWORD_PTR v9, DWORD_PTR v10, DWORD_PTR v11, DWORD_PTR v12, DWORD_PTR v13) { printf(" MyTarget13(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)\n", (DWORD)v1, (DWORD)v2, (DWORD)v3, (DWORD)v4, (DWORD)v5, (DWORD)v6, (DWORD)v7, (DWORD)v8, (DWORD)v9, (DWORD)v10, (DWORD)v11, (DWORD)v12, (DWORD)v13); return Trampoline_Target13(v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13); } DWORD_PTR WINAPI MyTarget14(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8, DWORD_PTR v9, DWORD_PTR v10, DWORD_PTR v11, DWORD_PTR v12, DWORD_PTR v13, DWORD_PTR v14) { printf(" MyTarget14(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)\n", (DWORD)v1, (DWORD)v2, (DWORD)v3, (DWORD)v4, (DWORD)v5, (DWORD)v6, (DWORD)v7, (DWORD)v8, (DWORD)v9, (DWORD)v10, (DWORD)v11, (DWORD)v12, (DWORD)v13, (DWORD)v14); return Trampoline_Target14(v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14); } DWORD_PTR WINAPI MyTarget15(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8, DWORD_PTR v9, DWORD_PTR v10, DWORD_PTR v11, DWORD_PTR v12, DWORD_PTR v13, DWORD_PTR v14, DWORD_PTR v15) { printf(" MyTarget15(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)\n", (DWORD)v1, (DWORD)v2, (DWORD)v3, (DWORD)v4, (DWORD)v5, (DWORD)v6, (DWORD)v7, (DWORD)v8, (DWORD)v9, (DWORD)v10, (DWORD)v11, (DWORD)v12, (DWORD)v13, (DWORD)v14, (DWORD)v15); return Trampoline_Target15(v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14,v15); } DWORD_PTR WINAPI MyTarget16(DWORD_PTR v1, DWORD_PTR v2, DWORD_PTR v3, DWORD_PTR v4, DWORD_PTR v5, DWORD_PTR v6, DWORD_PTR v7, DWORD_PTR v8, DWORD_PTR v9, DWORD_PTR v10, DWORD_PTR v11, DWORD_PTR v12, DWORD_PTR v13, DWORD_PTR v14, DWORD_PTR v15, DWORD_PTR v16) { printf(" MyTarget16(%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld)\n", (DWORD)v1, (DWORD)v2, (DWORD)v3, (DWORD)v4, (DWORD)v5, (DWORD)v6, (DWORD)v7, (DWORD)v8, (DWORD)v9, (DWORD)v10, (DWORD)v11, (DWORD)v12, (DWORD)v13, (DWORD)v14, (DWORD)v15, (DWORD)v16); return Trampoline_Target16(v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14,v15,v16); } DWORD_PTR WINAPI MyTargetV(DWORD_PTR v1, ...) { DWORD_PTR args[32]; va_list va; va_start(va, v1); int argc = 0; for (args[argc++] = v1; args[argc-1] != 0;) { args[argc++] = va_arg(va, DWORD_PTR); } va_end(va); printf(" MyTargetV ("); int i = argc - 1; for (; i > 0; i--) { printf("%ld,", (DWORD)args[i]); } printf("%ld)\n", (DWORD)args[0]); switch (argc) { default: return Trampoline_TargetV(0); case 1: return Trampoline_TargetV(args[0]); case 2: return Trampoline_TargetV(args[0], args[1]); case 3: return Trampoline_TargetV(args[0], args[1], args[2]); case 4: return Trampoline_TargetV(args[0], args[1], args[2], args[3]); case 5: return Trampoline_TargetV(args[0], args[1], args[2], args[3], args[4]); case 6: return Trampoline_TargetV(args[0], args[1], args[2], args[3], args[4], args[5]); case 7: return Trampoline_TargetV(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); case 8: return Trampoline_TargetV(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]); case 9: return Trampoline_TargetV(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8]); case 10: return Trampoline_TargetV(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9]); case 11: return Trampoline_TargetV(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10]); case 12: return Trampoline_TargetV(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11]); case 13: return Trampoline_TargetV(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11], args[12]); case 14: return Trampoline_TargetV(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11], args[12], args[13]); case 15: return Trampoline_TargetV(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11], args[12], args[13], args[14]); case 16: return Trampoline_TargetV(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11], args[12], args[13], args[14], args[15]); case 17: return Trampoline_TargetV(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11], args[12], args[13], args[14], args[15], args[16]); } } DWORD_PTR WINAPI MyTargetR(DWORD_PTR v1, ...) { DWORD_PTR args[32]; va_list va; va_start(va, v1); int argc = 0; for (args[argc++] = v1; args[argc-1] != 0;) { args[argc++] = va_arg(va, DWORD_PTR); } va_end(va); if (v1 < 5) { printf(" MyTargetR ("); int i = argc - 1; for (; i > 0; i--) { printf("%ld,", (DWORD)args[i]); } printf("%ld)\n", (DWORD)args[0]); } else { printf("."); } switch (argc) { default: return Trampoline_TargetR(0); case 1: return Trampoline_TargetR(args[0]); case 2: return Trampoline_TargetR(args[0], args[1]); case 3: return Trampoline_TargetR(args[0], args[1], args[2]); case 4: return Trampoline_TargetR(args[0], args[1], args[2], args[3]); case 5: return Trampoline_TargetR(args[0], args[1], args[2], args[3], args[4]); case 6: return Trampoline_TargetR(args[0], args[1], args[2], args[3], args[4], args[5]); case 7: return Trampoline_TargetR(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); case 8: return Trampoline_TargetR(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]); case 9: return Trampoline_TargetR(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8]); case 10: return Trampoline_TargetR(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9]); case 11: return Trampoline_TargetR(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10]); case 12: return Trampoline_TargetR(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11]); case 13: return Trampoline_TargetR(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11], args[12]); case 14: return Trampoline_TargetR(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11], args[12], args[13]); case 15: return Trampoline_TargetR(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11], args[12], args[13], args[14]); case 16: return Trampoline_TargetR(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11], args[12], args[13], args[14], args[15]); case 17: return Trampoline_TargetR(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11], args[12], args[13], args[14], args[15], args[16]); } } /////////////////////////////////////////////////////////// Recursive Detours. // DWORD_PTR (WINAPI * Trampoline_Target0_1)() = NULL; DWORD_PTR (WINAPI * Trampoline_Target0_2)() = NULL; DWORD_PTR (WINAPI * Trampoline_Target0_3)() = NULL; static DWORD_PTR WINAPI MyTarget0_1() { printf(" Starting Target0_1.\n"); DWORD_PTR rv = Trampoline_Target0_1(); printf(" End Target0_1.\n"); return rv; } static DWORD_PTR WINAPI MyTarget0_2() { printf(" Starting Target0_2.\n"); DWORD_PTR rv = Trampoline_Target0_2(); printf(" End Target0_2.\n"); return rv; } static DWORD_PTR WINAPI MyTarget0_3() { printf(" Starting Target0_3.\n"); DWORD_PTR rv = Trampoline_Target0_3(); printf(" End Target0_3.\n"); return rv; } ////////////////////////////////////////////////////////////////////////////// // int WINAPI WinMain(HINSTANCE hinst, HINSTANCE hprev, LPSTR lpszCmdLine, int nCmdShow) { (void)hinst; (void)hprev; (void)lpszCmdLine; (void)nCmdShow; printf("Calling LocalTarget1 w/o detour\n"); LocalTarget1(1); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)Trampoline_LocalTarget1, MyLocalTarget1); DetourTransactionCommit(); printf("Calling LocalTarget1 w/ detour\n"); LocalTarget1(2); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)Trampoline_Target0, MyTarget0); DetourTransactionCommit(); printf("Calling Target0 function.\n"); //dprintf("- Trampoline_Target0:: %p\n", Trampoline_Target0); //dprintf("- Target0 :: %p\n", Target0); Target0(); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)Trampoline_Target1, MyTarget1); DetourAttach(&(PVOID&)Trampoline_Target2, MyTarget2); DetourAttach(&(PVOID&)Trampoline_Target3, MyTarget3); DetourAttach(&(PVOID&)Trampoline_Target4, MyTarget4); DetourAttach(&(PVOID&)Trampoline_Target5, MyTarget5); DetourAttach(&(PVOID&)Trampoline_Target6, MyTarget6); DetourAttach(&(PVOID&)Trampoline_Target7, MyTarget7); DetourAttach(&(PVOID&)Trampoline_Target8, MyTarget8); DetourAttach(&(PVOID&)Trampoline_Target9, MyTarget9); DetourAttach(&(PVOID&)Trampoline_Target10, MyTarget10); DetourAttach(&(PVOID&)Trampoline_Target11, MyTarget11); DetourAttach(&(PVOID&)Trampoline_Target12, MyTarget12); DetourAttach(&(PVOID&)Trampoline_Target13, MyTarget13); DetourAttach(&(PVOID&)Trampoline_Target14, MyTarget14); DetourAttach(&(PVOID&)Trampoline_Target15, MyTarget15); DetourAttach(&(PVOID&)Trampoline_Target16, MyTarget16); DetourAttach(&(PVOID&)Trampoline_TargetV, MyTargetV); DetourAttach(&(PVOID&)Trampoline_TargetR, MyTargetR); DetourTransactionCommit(); printf("Calling TargetN functions.\n"); LocalTarget1(1); Target0(); Target1(1); Target2(1,2); Target3(1,2,3); Target4(1,2,3,4); Target5(1,2,3,4,5); Target6(1,2,3,4,5,6); Target7(1,2,3,4,5,6,7); Target8(1,2,3,4,5,6,7,8); Target9(1,2,3,4,5,6,7,8,9); Target10(1,2,3,4,5,6,7,8,9,10); Target11(1,2,3,4,5,6,7,8,9,10,11); Target12(1,2,3,4,5,6,7,8,9,10,11,12); Target13(1,2,3,4,5,6,7,8,9,10,11,12,13); Target14(1,2,3,4,5,6,7,8,9,10,11,12,13,14); Target15(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15); Target16(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16); TargetV(0); TargetV(1,0); TargetV(2,1,0); TargetV(3,2,1,0); TargetV(4,3,2,1,0); TargetV(5,4,3,2,1,0); TargetV(6,5,4,3,2,1,0); TargetV(7,6,5,4,3,2,1,0); TargetV(8,7,6,5,4,3,2,1,0); TargetV(9,8,7,6,5,4,3,2,1,0); TargetV(10,9,8,7,6,5,4,3,2,1,0); TargetV(11,10,9,8,7,6,5,4,3,2,1,0); TargetV(12,11,10,9,8,7,6,5,4,3,2,1,0); TargetV(13,12,11,10,9,8,7,6,5,4,3,2,1,0); TargetV(14,13,12,11,10,9,8,7,6,5,4,3,2,1,0); TargetV(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0); TargetV(16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0); TargetR(4,3,2,1,0); DWORD_PTR rv = TargetR(100,10,9,8,7,6,5,4,3,2,1,0); printf(" => %ld\n", (DWORD)rv); Trampoline_Target0_1 = Target0; Trampoline_Target0_2 = Target0; Trampoline_Target0_3 = Target0; //dprintf("Trampoline_Target0_1 = %p\n", DetourCodeFromPointer(Trampoline_Target0_1, NULL)); //__debugbreak(); printf("Calling Target0 again with 1 detour.\n"); Target0(); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)Trampoline_Target0_1, MyTarget0_1); DetourTransactionCommit(); //dprintf("Trampoline_Target0_2 = %p\n", DetourCodeFromPointer(Trampoline_Target0_2, NULL)); //__debugbreak(); printf("Calling Target0 again with 2 detours.\n"); Target0(); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)Trampoline_Target0_2, MyTarget0_2); DetourTransactionCommit(); //dprintf("Trampoline_Target0_3 = %p\n", DetourCodeFromPointer(Trampoline_Target0_3, NULL)); //__debugbreak(); printf("Calling Target0 again with 3 detours.\n"); Target0(); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)Trampoline_Target0_3, MyTarget0_3); DetourTransactionCommit(); //dprintf("Trampoline_Target0_3 = %p\n", DetourCodeFromPointer(Trampoline_Target0_3, NULL)); //__debugbreak(); printf("Calling Target0 again with 4 detours.\n"); Target0(); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourDetach(&(PVOID&)Trampoline_Target0, MyTarget0); DetourDetach(&(PVOID&)Trampoline_Target1, MyTarget1); DetourDetach(&(PVOID&)Trampoline_Target2, MyTarget2); DetourDetach(&(PVOID&)Trampoline_Target3, MyTarget3); DetourDetach(&(PVOID&)Trampoline_Target4, MyTarget4); DetourDetach(&(PVOID&)Trampoline_Target5, MyTarget5); DetourDetach(&(PVOID&)Trampoline_Target6, MyTarget6); DetourDetach(&(PVOID&)Trampoline_Target7, MyTarget7); DetourDetach(&(PVOID&)Trampoline_Target8, MyTarget8); DetourDetach(&(PVOID&)Trampoline_Target9, MyTarget9); DetourDetach(&(PVOID&)Trampoline_Target10, MyTarget10); DetourDetach(&(PVOID&)Trampoline_Target11, MyTarget11); DetourDetach(&(PVOID&)Trampoline_Target12, MyTarget12); DetourDetach(&(PVOID&)Trampoline_Target13, MyTarget13); DetourDetach(&(PVOID&)Trampoline_Target14, MyTarget14); DetourDetach(&(PVOID&)Trampoline_Target15, MyTarget15); DetourDetach(&(PVOID&)Trampoline_Target16, MyTarget16); DetourDetach(&(PVOID&)Trampoline_TargetV, MyTargetV); DetourDetach(&(PVOID&)Trampoline_TargetR, MyTargetR); DetourTransactionCommit(); printf("Done.\n"); return 0; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/dumpe/Makefile ================================================ ############################################################################## ## ## Makefile for Detours Test Programs. ## ## Microsoft Research Detours Package ## ## Copyright (c) Microsoft Corporation. All rights reserved. ## !include ..\common.mak LIBS=$(LIBS) kernel32.lib all: dirs \ $(BIND)\dumpe.exe \ !IF $(DETOURS_SOURCE_BROWSING)==1 $(OBJD)\dumpe.bsc !ENDIF clean: -del *~ 2>nul -del $(BIND)\dumpe.* 2>nul -rmdir /q /s $(OBJD) 2>nul realclean: clean -rmdir /q /s $(OBJDS) 2>nul dirs: @if not exist $(BIND) mkdir $(BIND) && echo. Created $(BIND) @if not exist $(OBJD) mkdir $(OBJD) && echo. Created $(OBJD) $(OBJD)\dumpe.obj : dumpe.cpp $(BIND)\dumpe.exe : $(OBJD)\dumpe.obj $(DEPS) cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb $(OBJD)\dumpe.obj \ /link $(LINKFLAGS) $(LIBS) \ /subsystem:console $(OBJD)\dumpe.bsc : $(OBJD)\dumpe.obj bscmake /v /n /o $@ $(OBJD)\dumpe.sbr ############################################################################## test: $(BIND)\dumpe.exe $(BIND)\dumpe.exe $(BIND)\slept.dll testx: $(BIND)\dumpe.exe cd $(MAKEDIR)\..\..\src nmake cd $(MAKEDIR) if exist $(SYSTEMROOT)\system32\browseui.dll $(BIND)\dumpe.exe browseui.dll ################################################################# End of File. ================================================ FILE: ext/detours/samples/dumpe/dumpe.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (dumpe.cpp of dumpe.exe) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include #include #include #include #include #include "detours.h" ////////////////////////////////////////////////////////////////////////////// // #ifndef NODEBUG #undef ASSERT VOID DetourAssertMessage(CONST PCHAR szMsg, CONST PCHAR szFile, DWORD nLine); #define ASSERT(x) \ do { if (!(x)) { DetourAssertMessage(#x, __FILE__, __LINE__); DebugBreak(); }} while (0) ; #undef ASSERTX #define ASSERTX(x) \ do { if (!(x)) { DetourAssertMessage(#x, __FILE__, __LINE__); PCHAR p=(PCHAR)(x); *p = 1; }} while (0) ; #else // NODEBUG #undef ASSERT #define ASSERT(x) #undef ASSERTX #define ASSERTX(x) #endif // NODEBUG // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////// Error Messages. // VOID DetourAssertMessage(CONST PCHAR szMsg, CONST PCHAR szFile, DWORD nLine) { printf("ASSERT(%s) failed in %s, line %ld.", szMsg, szFile, nLine); } static BOOL CALLBACK ExportCallback(PVOID pContext, ULONG nOrdinal, LPCSTR pszSymbol, PVOID pbTarget) { (void)pContext; printf(" %7ld %p %-30s\n", (ULONG)nOrdinal, pbTarget, pszSymbol ? pszSymbol : "[NONAME]"); return TRUE; } BOOL DumpFile(PCHAR pszPath) { HINSTANCE hInst = LoadLibraryA(pszPath); if (hInst == NULL) { printf("Unable to load %s: Error %ld\n", pszPath, GetLastError()); return FALSE; } printf("%s @ %p\n", pszPath, hInst); PVOID pbEntry = DetourGetEntryPoint(hInst); printf(" EntryPoint: %p\n", pbEntry); printf(" Ordinal RVA Name\n"); DetourEnumerateExports(hInst, NULL, ExportCallback); return TRUE; } ////////////////////////////////////////////////////////////////////////////// // void PrintUsage(void) { printf("Usage:\n" " dumpe [.dll files]\n" "Misc. Options:\n" " /? : Help screen.\n"); } //////////////////////////////////////////////////////////////////////// main. // int CDECL main(int argc, char **argv) { BOOL fNeedHelp = FALSE; int arg = 1; for (; arg < argc; arg++) { if (argv[arg][0] == '-' || argv[arg][0] == '/') { CHAR *argn = argv[arg] + 1; CHAR *argp = argn; while (*argp && *argp != ':') argp++; if (*argp == ':') *argp++ = '\0'; switch (argn[0]) { case '?': // Help. fNeedHelp = TRUE; break; default: fNeedHelp = TRUE; printf("Bad argument: %s:%s\n", argn, argp); break; } } else { DumpFile(argv[arg]); } } if (fNeedHelp || argc == 1) { PrintUsage(); return 1; } return 0; } // End of File ================================================ FILE: ext/detours/samples/dumpi/Makefile ================================================ ############################################################################## ## ## Makefile for Detours Test Programs - Dump Imports ## ## Microsoft Research Detours Package ## ## Copyright (c) Microsoft Corporation. All rights reserved. ## !include ..\common.mak LIBS=$(LIBS) kernel32.lib all: dirs \ $(BIND)\dumpi.exe \ !IF $(DETOURS_SOURCE_BROWSING)==1 $(OBJD)\dumpi.bsc \ !ENDIF clean: -del *~ 2>nul -del $(BIND)\dumpi.* 2>nul -rmdir /q /s $(OBJD) 2>nul realclean: clean -rmdir /q /s $(OBJDS) 2>nul dirs: @if not exist $(BIND) mkdir $(BIND) && echo. Created $(BIND) @if not exist $(OBJD) mkdir $(OBJD) && echo. Created $(OBJD) $(OBJD)\dumpi.obj : dumpi.cpp $(BIND)\dumpi.exe : $(OBJD)\dumpi.obj $(DEPS) cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb $(OBJD)\dumpi.obj \ /link $(LINKFLAGS) $(LIBS) \ /subsystem:console $(OBJD)\dumpi.bsc : $(OBJD)\dumpi.obj bscmake /v /n /o $@ $(OBJD)\dumpi.sbr ############################################################################## test: $(BIND)\dumpi.exe $(BIND)\dumpi.exe $(BIND)\slept.dll $(BIND)\sleepold.exe ################################################################# End of File. ================================================ FILE: ext/detours/samples/dumpi/dumpi.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (dumpi.cpp of dumpi.exe) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include #include #include #include #pragma warning(push) #if _MSC_VER > 1400 #pragma warning(disable:6102 6103) // /analyze warnings #endif #include #pragma warning(pop) #include ////////////////////////////////////////////////////////////// Error Messages. // VOID AssertMessage(PCSTR szMsg, PCSTR szFile, DWORD nLine) { printf("ASSERT(%s) failed in %s, line %ld.", szMsg, szFile, nLine); } #define ASSERT(x) \ do { if (!(x)) { AssertMessage(#x, __FILE__, __LINE__); DebugBreak(); }} while (0) ; ////////////////////////////////////////////////////////////////////////////// // static CHAR s_szFile[MAX_PATH] = "\0"; static BOOL CALLBACK ListFileCallback(_In_opt_ PVOID pContext, _In_z_ LPCSTR pszOrigFile, _In_z_ LPCSTR pszFile, _Outptr_result_maybenull_ LPCSTR *ppszOutFile) { (void)pContext; (void)pszFile; *ppszOutFile = NULL; StringCchCopyA(s_szFile, sizeof(s_szFile), pszOrigFile); PCHAR psz; if ((psz = strchr(s_szFile, '.')) != NULL) { *psz = '\0'; } return TRUE; } BOOL CALLBACK ListSymbolCallback(_In_opt_ PVOID pContext, _In_ ULONG nOrigOrdinal, _In_ ULONG nOrdinal, _Out_ ULONG *pnOutOrdinal, _In_opt_z_ LPCSTR pszOrigSymbol, _In_opt_z_ LPCSTR pszSymbol, _Outptr_result_maybenull_ LPCSTR *ppszOutSymbol) { (void)pContext; (void)nOrdinal; (void)pszSymbol; *ppszOutSymbol = NULL; *pnOutOrdinal = 0; if (nOrigOrdinal != 0) { printf(" %s::#%ld\n", s_szFile, nOrigOrdinal); } else { printf(" %s::%s\n", s_szFile, pszOrigSymbol); } return TRUE; } BOOL DimpFile(PCHAR pszPath) { BOOL bGood = TRUE; HANDLE hOld = INVALID_HANDLE_VALUE; PDETOUR_BINARY pBinary = NULL; hOld = CreateFileA(pszPath, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (hOld == INVALID_HANDLE_VALUE) { printf("%s: Failed to open input file with error: %ld\n", pszPath, GetLastError()); bGood = FALSE; goto end; } if ((pBinary = DetourBinaryOpen(hOld)) == NULL) { printf("%s: DetourBinaryOpen failed: %ld\n", pszPath, GetLastError()); goto end; } if (hOld != INVALID_HANDLE_VALUE) { CloseHandle(hOld); hOld = INVALID_HANDLE_VALUE; } printf("%s:\n", pszPath); if (!DetourBinaryEditImports(pBinary, NULL, NULL, ListFileCallback, ListSymbolCallback, NULL)) { printf("%s: DetourBinaryEditImports failed: %ld\n", pszPath, GetLastError()); } DetourBinaryClose(pBinary); pBinary = NULL; end: if (pBinary) { DetourBinaryClose(pBinary); pBinary = NULL; } if (hOld != INVALID_HANDLE_VALUE) { CloseHandle(hOld); hOld = INVALID_HANDLE_VALUE; } return bGood; } ////////////////////////////////////////////////////////////////////////////// int DimpArgument(char *dir, char *argp, int fDoSubs) { ////////////////////////////////////////////////////////////////////////// WIN32_FIND_DATAA wfd; HANDLE hFind = NULL; char name[1024]; int nFound = 0; StringCchCopyA(name, sizeof(name), dir ? dir : ""); StringCchCatA(name, sizeof(name), argp); hFind = FindFirstFileA(name, &wfd); if (hFind != INVALID_HANDLE_VALUE) { do { if (!(wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { StringCchCopyA(name, sizeof(name), dir ? dir : ""); StringCchCatA(name, sizeof(name), wfd.cFileName); nFound += DimpFile(name); } } while (FindNextFileA(hFind, &wfd)); FindClose(hFind); } if (fDoSubs) { StringCchCopyA(name, sizeof(name), dir ? dir : ""); StringCchCatA(name, sizeof(name), "*"); hFind = FindFirstFileA(name, &wfd); if (hFind == INVALID_HANDLE_VALUE) return nFound; do { if ((wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && wfd.cFileName[0] != '.') { StringCchCopyA(name, sizeof(name), dir ? dir : ""); StringCchCatA(name, sizeof(name), wfd.cFileName); StringCchCatA(name, sizeof(name), "\\"); nFound += DimpArgument(name, argp, fDoSubs); } } while (FindNextFileA(hFind, &wfd)); FindClose(hFind); } return nFound; } ////////////////////////////////////////////////////////////////////////////// // void PrintUsage(void) { printf("Usage:\n" " dimp [options] binary_files\n" "Options:\n" " /s : Recurse through subdirectories.\n" " /? : This help screen.\n" "Examples:\n" " dimp /s *.exe\n" ""); } //////////////////////////////////////////////////////////////////////// main. // int CDECL main(int argc, char **argv) { BOOL fNeedHelp = FALSE; BOOL fSubdirs = FALSE; int arg = 1; for (; arg < argc; arg++) { if (argv[arg][0] == '-' || argv[arg][0] == '/') { CHAR *argn = argv[arg] + 1; CHAR *argp = argn; while (*argp && *argp != ':') argp++; if (*argp == ':') *argp++ = '\0'; switch (argn[0]) { case 's': // Do Subdirectories. case 'S': fSubdirs = TRUE; break; case '?': // Help. fNeedHelp = TRUE; break; default: fNeedHelp = TRUE; printf("Bad argument: %s:%s\n", argn, argp); break; } } else { CHAR szDir[MAX_PATH] = ""; CHAR szArg[MAX_PATH] = ""; PCHAR pszDir; if ((pszDir = strrchr(argv[arg], '\\')) != NULL) { *pszDir++ = '\0'; StringCchCopyA(szArg, sizeof(szArg), pszDir); StringCchCopyA(szDir, sizeof(szDir), argv[arg]); StringCchCatA(szDir, sizeof(szDir), "\\"); } else { if (GetCurrentDirectoryA(sizeof(szDir), szDir) > 3) { StringCchCatA(szDir, sizeof(szDir), "\\"); } StringCchCopyA(szArg, sizeof(szArg), argv[arg]); } DimpArgument(szDir, szArg, fSubdirs); } } if (argc == 1) { fNeedHelp = TRUE; } if (fNeedHelp) { PrintUsage(); return 1; } return 0; } // End of File ================================================ FILE: ext/detours/samples/dynamic_alloc/Makefile ================================================ ############################################################################## ## ## Makefile for Detours Test Programs. ## ## Microsoft Research Detours Package ## ## Copyright (c) Microsoft Corporation. All rights reserved. ## !include ..\common.mak # This test is x86 only !IF "$(DETOURS_TARGET_PROCESSOR)" == "X86" || "$(DETOURS_TARGET_PROCESSOR)" == "X64" TARGET_NAME=dalloc CFLAGS=\ $(CFLAGS)\ /EHsc\ LIBS=$(LIBS)\ user32.lib\ all: dirs $(BIND)\$(TARGET_NAME).exe ############################################################################## clean: -del $(BIND)\$(TARGET_NAME).* 2>nul -rmdir /q /s $(OBJD) 2>nul realclean: clean -rmdir /q /s $(OBJDS) 2>nul ############################################################################## dirs: @if not exist $(BIND) mkdir $(BIND) && echo. Created $(BIND) @if not exist $(OBJD) mkdir $(OBJD) && echo. Created $(OBJD) !IF "$(DETOURS_TARGET_PROCESSOR)" == "X64" $(OBJD)\asm.obj : x64.asm $(ASM) $(AFLAGS) /Fl$(OBJD)\x64.lst /Fo$(OBJD)\asm.obj x64.asm !ELSE $(OBJD)\asm.obj : x86.asm $(ASM) $(AFLAGS) /Fl$(OBJD)\x86.lst /Fo$(OBJD)\asm.obj x86.asm !ENDIF $(OBJD)\main.obj : main.cpp $(BIND)\$(TARGET_NAME).exe : $(OBJD)\main.obj $(OBJD)\asm.obj $(DEPS) link\ /SUBSYSTEM:CONSOLE\ $(LINKFLAGS)\ $(LIBS)\ /PDB:"$(@R).pdb"\ /OUT:"$@"\ $**\ ############################################################################## test: all $(BIND)\$(TARGET_NAME).exe ############################################################################## !ELSE all: @echo The platform `$(DETOURS_TARGET_PROCESSOR)` is not supported. Skipping. test: @echo The platform `$(DETOURS_TARGET_PROCESSOR)` is not supported. Skipping. clean: realclean: !ENDIF ################################################################# End of File. ================================================ FILE: ext/detours/samples/dynamic_alloc/main.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // // This is a test program to test the DetourAllocateRegionWithinJumpBounds // API, that dynamically allocates an executable region adjacent to a given // address so that we can use the region as a detour function. // // This test program detours the function `target_function`. Instead of // simply specifying a code segment as a detour function, we specify a // dynamically-allocated region into which we copy the code, altering the // return value, from the assembly function `CodeTemplate` as a template. // #define _CRT_SECURE_NO_WARNINGS #include #include #include #include #include extern "C" { void *CodeTemplate(); void *CodeTemplate_End(); } void Log(PCSTR format, ...) { char linebuf[1024]; va_list v; va_start(v, format); wvsprintfA(linebuf, format, v); va_end(v); OutputDebugStringA(linebuf); } // This is a target function to be detoured. When detoured, it's expected to // return a non-nullptr value. void *target_function() { std::cout << '+' << __FUNCTION__ << std::endl; return nullptr; } // Helper function to sandwich a given function between `DetourTransactionBegin` // and `DetourTransactionCommit`/`DetourTransactionAbort`. bool DetourTransaction(std::function callback) { LONG status = DetourTransactionBegin(); if (status != NO_ERROR) { Log("DetourTransactionBegin failed with %08x\n", status); return status == NO_ERROR; } if (callback()) { status = DetourTransactionCommit(); if (status != NO_ERROR) { Log("DetourTransactionCommit failed with %08x\n", status); } } else { status = DetourTransactionAbort(); if (status == NO_ERROR) { Log("Aborted transaction.\n"); } else { Log("DetourTransactionAbort failed with %08x\n", status); } } return status == NO_ERROR; } // This class manages one dynamically-allocated region that is allocated by // the Detours API `DetourAllocateRegionWithinJumpBounds`, to which we can // push binary data sequentially to use it as a detour function. class CodeRegionFactory final { template static const T *at(const void *base, uint32_t offset) { return reinterpret_cast( reinterpret_cast(base) + offset); } template static T *at(void *base, uint32_t offset) { return reinterpret_cast( reinterpret_cast(base) + offset); } void *region_ = nullptr; uint8_t *current_ = nullptr, *current_end_ = nullptr; public: CodeRegionFactory(const void *source) { DWORD new_region_size = 0; auto new_region_address = DetourAllocateRegionWithinJumpBounds(source, &new_region_size); if (new_region_address) { region_ = current_ = at(new_region_address, 0); current_end_ = current_ + new_region_size; } else { Log("Cannot find a region near %p\n", source); } } ~CodeRegionFactory() { if (region_ && !VirtualFree(region_, 0, MEM_RELEASE)) { Log("VirtualFree failed - %08x\n", GetLastError()); } } // Pushes binary data to the region if there is enough space, and returns // the start address of a copy in the region if succeeded. void *PushTemplate(const void *start, const void *end) { auto diff = at(end, 0) - at(start, 0); if (diff < 0 || current_ + diff > current_end_) return nullptr; auto start_pos = current_; memcpy(start_pos, start, diff); current_ += diff; return start_pos; } }; int main(int, char**) { std::cout << "1. target_function() without Detour" << std::endl; auto ret = target_function(); std::cout << ret << std::endl; assert(!ret); CodeRegionFactory factory(target_function); void *detour_destination, *detour_target = reinterpret_cast(target_function); // Fill the allocated page with as many instances as possible of the code // template, and pick the last instance while (auto p = factory.PushTemplate(CodeTemplate, CodeTemplate_End)) { detour_destination = p; } bool is_detoured = false; DetourTransaction([&]() { PDETOUR_TRAMPOLINE trampoline = nullptr; void *target = nullptr, *detour = nullptr; auto status = DetourAttachEx(&detour_target, detour_destination, &trampoline, &target, &detour); if (status != NO_ERROR) { Log("DetourAttachEx failed - %08x\n", status); return false; } is_detoured = true; std::cout << "detour: " << target << " --> " << detour << " (trampoline: " << trampoline << " )" << std::endl; return true; }); // Attach failed for some reason. Bail out. if (!is_detoured) return 1; std::cout << "2. target_function() with Detour" << std::endl; ret = target_function(); std::cout << ret << std::endl; assert(ret); // The return value is cracked by the detour function DetourTransaction([&]() { auto status = DetourDetach(&detour_target, detour_destination); if (status != NO_ERROR) { Log("DetourDetach failed - %08x\n", status); return false; } return true; }); std::cout << "3. target_function() without Detour" << std::endl; ret = target_function(); std::cout << ret << std::endl; assert(!ret); return 0; } ================================================ FILE: ext/detours/samples/dynamic_alloc/x64.asm ================================================ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Detours Test Program ;; ;; Microsoft Research Detours Package ;; ;; Copyright (c) Microsoft Corporation. All rights reserved. ;; PUBLIC CodeTemplate PUBLIC CodeTemplate_End _TEXT SEGMENT CodeTemplate PROC nop nop mov rax, 0deadbeef00000000h nop ret CodeTemplate_End:: CodeTemplate ENDP _TEXT ENDS END ================================================ FILE: ext/detours/samples/dynamic_alloc/x86.asm ================================================ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Detours Test Program ;; ;; Microsoft Research Detours Package ;; ;; Copyright (c) Microsoft Corporation. All rights reserved. ;; .386 .model flat,C PUBLIC CodeTemplate PUBLIC CodeTemplate_End _TEXT SEGMENT CodeTemplate PROC nop nop nop mov eax, 0deadbeefh nop nop nop ret CodeTemplate_End:: CodeTemplate ENDP _TEXT ENDS END ================================================ FILE: ext/detours/samples/echo/Makefile ================================================ ############################################################################## ## ## Detours Test Program ## ## Microsoft Research Detours Package ## ## Copyright (c) Microsoft Corporation. All rights reserved. ## !include ..\common.mak LIBS=$(LIBS) kernel32.lib ############################################################################## all: dirs \ $(BIND)\echofx$(DETOURS_BITS).dll \ $(BIND)\echonul.exe \ \ !IF $(DETOURS_SOURCE_BROWSING)==1 $(OBJD)\echofx$(DETOURS_BITS).bsc \ $(OBJD)\echonul.bsc \ !ENDIF option ############################################################################## dirs: @if not exist $(BIND) mkdir $(BIND) && echo. Created $(BIND) @if not exist $(OBJD) mkdir $(OBJD) && echo. Created $(OBJD) $(OBJD)\echofx.obj : echofx.cpp $(OBJD)\echofx.res : echofx.rc $(BIND)\echofx$(DETOURS_BITS).dll $(BIND)\echofx$(DETOURS_BITS).lib: \ $(OBJD)\echofx.obj $(OBJD)\echofx.res $(DEPS) $(BIND)\echonul.lib cl /LD $(CFLAGS) /Fe$@ /Fd$(@R).pdb \ $(OBJD)\echofx.obj $(OBJD)\echofx.res \ /link $(LINKFLAGS) /subsystem:console \ /export:DetourFinishHelperProcess,@1,NONAME \ /export:Mine_Echo \ $(LIBS) $(BIND)\echonul.lib $(OBJD)\echofx$(DETOURS_BITS).bsc : $(OBJD)\echofx.obj bscmake /v /n /o $@ $(OBJD)\echofx.sbr $(OBJD)\echonul.obj : echonul.cpp $(OBJD)\main.obj : main.cpp $(BIND)\echonul.exe $(BIND)\echonul.lib: $(OBJD)\main.obj $(OBJD)\echonul.obj cl $(CFLAGS) /Zl /Fe$(BIND)\echonul.exe /Fd$(@R).pdb \ $(OBJD)\main.obj $(OBJD)\echonul.obj \ /link $(LINKFLAGS) \ /export:Echo \ /subsystem:console $(OBJD)\echonul.bsc : echonul.obj bscmake /v /n /o $@ echonul.sbr ############################################################################## clean: -del *~ 2>nul -del $(BIND)\echofx*.* 2>nul -del $(BIND)\echonul.* 2>nul -rmdir /q /s $(OBJD) 2>nul realclean: clean -rmdir /q /s $(OBJDS) 2>nul ############################################### Install non-bit-size binaries. !IF "$(DETOURS_OPTION_PROCESSOR)" != "" $(OPTD)\echofx$(DETOURS_OPTION_BITS).dll: $(OPTD)\echofx$(DETOURS_OPTION_BITS).pdb: $(BIND)\echofx$(DETOURS_OPTION_BITS).dll : $(OPTD)\echofx$(DETOURS_OPTION_BITS).dll @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\echofx$(DETOURS_OPTION_BITS).pdb : $(OPTD)\echofx$(DETOURS_OPTION_BITS).pdb @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). option: \ $(BIND)\echofx$(DETOURS_OPTION_BITS).dll \ $(BIND)\echofx$(DETOURS_OPTION_BITS).pdb \ !ELSE option: !ENDIF ############################################################################## test: all @echo -------- Should echo nothing. -------------------------------------- -$(BIND)\echonul.exe @echo -------- Should echo Hello World. ---------------------------------- -$(BIND)\withdll.exe -d:$(BIND)\echofx$(DETOURS_BITS).dll $(BIND)\echonul.exe @echo. testd: all @echo. -windbg -o -g -G $(BIND)\withdll.exe -d:$(BIND)\echofx$(DETOURS_BITS).dll $(BIND)\echonul.exe @echo. ################################################################# End of File. ================================================ FILE: ext/detours/samples/echo/echofx.cpp ================================================ // // // #include #include #include int WINAPI Echo(PCSTR pszMsg); static int (WINAPI * Real_Echo)(PCSTR pszMsg) = Echo; int WINAPI Mine_Echo(PCSTR pszMsg) { printf("Echo(%s)\n", pszMsg); return Real_Echo(pszMsg); } BOOL WINAPI DllMain(HINSTANCE hinst, DWORD dwReason, LPVOID reserved) { LONG error; (void)hinst; (void)reserved; if (DetourIsHelperProcess()) { return TRUE; } if (dwReason == DLL_PROCESS_ATTACH) { DetourRestoreAfterWith(); printf("echofx" DETOURS_STRINGIFY(DETOURS_BITS) ".dll:" " Starting.\n"); fflush(stdout); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)Real_Echo, Mine_Echo); error = DetourTransactionCommit(); if (error == NO_ERROR) { printf("echofx" DETOURS_STRINGIFY(DETOURS_BITS) ".dll:" " Detoured Echo().\n"); } else { printf("echofx" DETOURS_STRINGIFY(DETOURS_BITS) ".dll:" " Error detouring Echo(): %ld\n", error); } } else if (dwReason == DLL_PROCESS_DETACH) { DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourDetach(&(PVOID&)Real_Echo, Mine_Echo); error = DetourTransactionCommit(); printf("echofx" DETOURS_STRINGIFY(DETOURS_BITS) ".dll:" " Removed Echo() (result=%ld)\n", error); fflush(stdout); } return TRUE; } ================================================ FILE: ext/detours/samples/echo/echofx.rc ================================================ ////////////////////////////////////////////////////////////////////////////// // // Version information for echofx.rc. // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include "detver.h" #define VER_INTERNALNAME_STR "echofx" DETOURS_STRINGIFY(DETOURS_BITS) #define VER_ORIGINALFILENAME_STR "echofx" DETOURS_STRINGIFY(DETOURS_BITS) ".dll" #define VER_FILEDESCRIPTION_STR "Detours Echo Interception Module" #define VER_COMPANYNAME_STR "Microsoft Corporation" #include "common.ver" ================================================ FILE: ext/detours/samples/echo/echonul.cpp ================================================ // // // #include int WINAPI Echo(PCSTR pszMsg) { int sum = 0; while (*pszMsg) { sum = sum + *pszMsg++; } return sum; } int main() { return 0; } ================================================ FILE: ext/detours/samples/echo/main.cpp ================================================ // // // #include int WINAPI Echo(PCSTR pszMsg); extern "C" int __stdcall mainCRTStartup(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow ) { (void)hInstance; (void)hPrevInstance; (void)lpCmdLine; (void)nCmdShow; Echo("Hello World"); Echo("Goodbye World"); return 0x99; } ================================================ FILE: ext/detours/samples/einst/Makefile ================================================ ############################################################################## ## ## Makefile for Detours Test Programs. ## ## Microsoft Research Detours Package ## ## Copyright (c) Microsoft Corporation. All rights reserved. ## !include ..\common.mak # ARM64 does not like base addresses below 4GB. # Append two extra zeros for it. # !if "$(DETOURS_TARGET_PROCESSOR)" == "ARM64" EDLL1X_BASE=0x710000000 EDLL2X_BASE=0x720000000 EDLL3X_BASE=0x730000000 !else EDLL1X_BASE=0x7100000 EDLL2X_BASE=0x7200000 EDLL3X_BASE=0x7300000 !endif LIBS=$(LIBS) kernel32.lib user32.lib all: dirs \ $(BIND)\edll1x$(DETOURS_BITS).dll \ $(BIND)\edll2x$(DETOURS_BITS).dll \ $(BIND)\edll3x$(DETOURS_BITS).dll \ $(BIND)\einst.exe \ \ !IF $(DETOURS_SOURCE_BROWSING)==1 $(OBJD)\edll1x$(DETOURS_BITS).bsc \ $(OBJD)\edll2x$(DETOURS_BITS).bsc \ $(OBJD)\edll3x$(DETOURS_BITS).bsc \ $(OBJD)\einst.bsc \ !ENDIF option clean: -del *~ 2>nul -del $(BIND)\edll1x*.* 2>nul -del $(BIND)\edll2x*.* 2>nul -del $(BIND)\edll3x*.* 2>nul -del $(BIND)\einst.* 2>nul -rmdir /q /s $(OBJD) 2>nul realclean: clean -rmdir /q /s $(OBJDS) 2>nul dirs: @if not exist $(BIND) mkdir $(BIND) && echo. Created $(BIND) @if not exist $(OBJD) mkdir $(OBJD) && echo. Created $(OBJD) ############################################################################## $(OBJD)\einst.obj : einst.cpp $(BIND)\einst.exe : $(OBJD)\einst.obj $(DEPS) cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb $(OBJD)\einst.obj \ /link $(LINKFLAGS) $(LIBS) \ $(BIND)\edll1x$(DETOURS_BITS).lib $(BIND)\edll2x$(DETOURS_BITS).lib $(BIND)\edll3x$(DETOURS_BITS).lib \ /subsystem:console /entry:WinMainCRTStartup $(OBJD)\einst.bsc : $(OBJD)\einst.obj bscmake /v /n /o $@ $(OBJD)\einst.sbr $(OBJD)\edll1x.obj : edll1x.cpp $(BIND)\edll1x$(DETOURS_BITS).dll : $(OBJD)\edll1x.obj $(DEPS) cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb \ $(OBJD)\edll1x.obj /LD \ /link $(LINKFLAGS) $(LIBS) \ /subsystem:windows \ /base:$(EDLL1X_BASE) $(OBJD)\edll1x$(DETOURS_BITS).bsc : $(OBJD)\edll1x.obj bscmake /v /n /o $@ $(OBJD)\edll1x.sbr $(OBJD)\edll2x.obj : edll2x.cpp $(BIND)\edll2x$(DETOURS_BITS).dll : $(OBJD)\edll2x.obj $(DEPS) cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb \ $(OBJD)\edll2x.obj /LD \ /link $(LINKFLAGS) $(LIBS) \ /subsystem:console \ /base:$(EDLL2X_BASE) $(OBJD)\edll2x$(DETOURS_BITS).bsc : $(OBJD)\edll2x.obj bscmake /v /n /o $@ $(OBJD)\edll2x.sbr $(OBJD)\edll3x.obj : edll3x.cpp $(BIND)\edll3x$(DETOURS_BITS).dll : $(OBJD)\edll3x.obj $(DEPS) cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb \ $(OBJD)\edll3x.obj /LD \ /link $(LINKFLAGS) $(LIBS) \ /subsystem:console \ /base:$(EDLL3X_BASE) $(OBJD)\edll3x$(DETOURS_BITS).bsc : $(OBJD)\edll3x.obj bscmake /v /n /o $@ $(OBJD)\edll3x.sbr ############################################### Install non-bit-size binaries. !IF "$(DETOURS_OPTION_PROCESSOR)" != "" $(OPTD)\edll1x$(DETOURS_OPTION_BITS).dll: $(OPTD)\edll1x$(DETOURS_OPTION_BITS).pdb: $(OPTD)\edll2x$(DETOURS_OPTION_BITS).dll: $(OPTD)\edll2x$(DETOURS_OPTION_BITS).pdb: $(OPTD)\edll3x$(DETOURS_OPTION_BITS).dll: $(OPTD)\edll3x$(DETOURS_OPTION_BITS).pdb: $(BIND)\edll1x$(DETOURS_OPTION_BITS).dll : $(OPTD)\edll1x$(DETOURS_OPTION_BITS).dll @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\edll1x$(DETOURS_OPTION_BITS).pdb : $(OPTD)\edll1x$(DETOURS_OPTION_BITS).pdb @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\edll2x$(DETOURS_OPTION_BITS).dll : $(OPTD)\edll2x$(DETOURS_OPTION_BITS).dll @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\edll2x$(DETOURS_OPTION_BITS).pdb : $(OPTD)\edll2x$(DETOURS_OPTION_BITS).pdb @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\edll3x$(DETOURS_OPTION_BITS).dll : $(OPTD)\edll3x$(DETOURS_OPTION_BITS).dll @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\edll3x$(DETOURS_OPTION_BITS).pdb : $(OPTD)\edll3x$(DETOURS_OPTION_BITS).pdb @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). option: \ $(BIND)\edll1x$(DETOURS_OPTION_BITS).dll \ $(BIND)\edll1x$(DETOURS_OPTION_BITS).pdb \ $(BIND)\edll2x$(DETOURS_OPTION_BITS).dll \ $(BIND)\edll2x$(DETOURS_OPTION_BITS).pdb \ $(BIND)\edll3x$(DETOURS_OPTION_BITS).dll \ $(BIND)\edll3x$(DETOURS_OPTION_BITS).pdb \ !ELSE option: !ENDIF ############################################################################## test: all $(BIND)\einst.exe ################################################################# End of File. ================================================ FILE: ext/detours/samples/einst/edll1x.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (edll1x.cpp of edll1x.dll) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include #include #include //////////////////////////////////////////////////////////////////// DLL Stuff // struct CPrivateStuff { DETOUR_SECTION_HEADER header; DETOUR_SECTION_RECORD record; CHAR szMessage[32]; }; #pragma data_seg(".detour") static CPrivateStuff private_stuff = { DETOUR_SECTION_HEADER_DECLARE(sizeof(CPrivateStuff)), { (sizeof(CPrivateStuff) - sizeof(DETOUR_SECTION_HEADER)), 0, { /* d9ab8a40-f4cc-11d1-b6d7-006097b010e3 */ 0xd9ab8a40, 0xf4cc, 0x11d1, {0xb6, 0xd7, 0x00, 0x60, 0x97, 0xb0, 0x10, 0xe3} } }, "The First Dll!" }; #pragma data_seg() __declspec(dllexport) VOID WINAPI EDll1Function(VOID) { return; } __declspec(dllexport) ULONG WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, PVOID lpReserved) { (void)hInstance; (void)dwReason; (void)lpReserved; return TRUE; } ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/einst/edll2x.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (edll2x.cpp of einst.exe/edll2x.dll) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include #include #include //////////////////////////////////////////////////////////////////// DLL Stuff // struct CPrivateStuff { DETOUR_SECTION_HEADER header; DETOUR_SECTION_RECORD record; CHAR szMessage[32]; }; #pragma data_seg(".detour") static CPrivateStuff private_stuff = { DETOUR_SECTION_HEADER_DECLARE(sizeof(CPrivateStuff)), { (sizeof(CPrivateStuff) - sizeof(DETOUR_SECTION_HEADER)), 0, { /* d9ab8a40-f4cc-11d1-b6d7-006097b010e3 */ 0xd9ab8a40, 0xf4cc, 0x11d1, {0xb6, 0xd7, 0x00, 0x60, 0x97, 0xb0, 0x10, 0xe3} } }, "The Second Dll!" }; #pragma data_seg() __declspec(dllexport) VOID WINAPI EDll2Function(VOID) { return; } __declspec(dllexport) ULONG WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, PVOID lpReserved) { (void)hInstance; (void)dwReason; (void)lpReserved; return TRUE; } ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/einst/edll3x.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (edll3x.cpp of einst.exe/edll3x.dll) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include #include #include //////////////////////////////////////////////////////////////////// DLL Stuff // struct CPrivateStuffPart1 { DETOUR_SECTION_RECORD header; CHAR szMessage[48]; }; struct CPrivateStuffPart2 { DETOUR_SECTION_RECORD header; CHAR szMessage[64]; }; struct CPrivateStuff { DETOUR_SECTION_HEADER header; CPrivateStuffPart1 record1; CPrivateStuffPart2 record2; }; #pragma data_seg(".detour") static CPrivateStuff private_stuff = { DETOUR_SECTION_HEADER_DECLARE(sizeof(CPrivateStuff)), { { sizeof(CPrivateStuffPart1), 0, { /* d9ab8a41-f4cc-11d1-b6d7-006097b010e3 */ 0xd9ab8a41, 0xf4cc, 0x11d1, {0xb6, 0xd7, 0x00, 0x60, 0x97, 0xb0, 0x10, 0xe3} } }, "The Third DLL Part One!" }, { { sizeof(CPrivateStuffPart2), 0, { /* d9ab8a40-f4cc-11d1-b6d7-006097b010e3 */ 0xd9ab8a40, 0xf4cc, 0x11d1, {0xb6, 0xd7, 0x00, 0x60, 0x97, 0xb0, 0x10, 0xe3} } }, "The Third DLL Part Two!" } }; #pragma data_seg() __declspec(dllexport) VOID WINAPI EDll3Function(VOID) { return; } __declspec(dllexport) ULONG WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, PVOID lpReserved) { (void)hInstance; (void)dwReason; (void)lpReserved; return TRUE; } ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/einst/einst.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (einst.cpp of einst.exe) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include #include #include struct CPrivateStuff { DETOUR_SECTION_HEADER header; DETOUR_SECTION_RECORD record; CHAR szMessage[32]; }; #ifdef INCLUDE_THIS #pragma data_seg(".detour") static CPrivateStuff private_stuff = { DETOUR_SECTION_HEADER_DECLARE(sizeof(CPrivateStuff)), { (sizeof(CPrivateStuff) - sizeof(DETOUR_SECTION_HEADER)), 0, { /* d9ab8a40-f4cc-11d1-b6d7-006097b010e3 */ 0xd9ab8a40, 0xf4cc, 0x11d1, {0xb6, 0xd7, 0x00, 0x60, 0x97, 0xb0, 0x10, 0xe3} } }, "The Application!" }; #pragma data_seg() #endif GUID my_guid = { /* d9ab8a40-f4cc-11d1-b6d7-006097b010e3 */ 0xd9ab8a40, 0xf4cc, 0x11d1, {0xb6, 0xd7, 0x00, 0x60, 0x97, 0xb0, 0x10, 0xe3} }; __declspec(dllimport) VOID WINAPI EDll1Function(VOID); __declspec(dllimport) VOID WINAPI EDll2Function(VOID); __declspec(dllimport) VOID WINAPI EDll3Function(VOID); void FindPayload(HINSTANCE hinst) { CHAR szModuleName[256]; GetModuleFileNameA(hinst, szModuleName, ARRAYSIZE(szModuleName)); printf(" %p : %s\n", hinst, szModuleName); ULONG cbData = 0; PBYTE pbData = (PBYTE)DetourFindPayload(hinst, my_guid, &cbData); if (pbData) { printf(" %08p..%08p : %50.50s\n", pbData, pbData + cbData, pbData); } } int WINAPI WinMain(HINSTANCE hinst, HINSTANCE hprev, LPSTR lpszCmdLine, int nCmdShow) { (void)hinst; (void)hprev; (void)lpszCmdLine; (void)nCmdShow; printf("Source .EXE:\n"); FindPayload(NULL); printf("\n"); printf("DLL and EXE binaries loaded:\n"); EDll1Function(); EDll2Function(); EDll3Function(); for (HINSTANCE hiter = NULL; (hiter = DetourEnumerateModules(hiter)) != NULL;) { FindPayload(hiter); } if ((PVOID)hinst == (PVOID)lpszCmdLine) { DispatchMessage(NULL); // Force load of gdi32.dll } return 0; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/excep/Makefile ================================================ ############################################################################## ## ## Makefile for Detours Test Programs. ## ## Microsoft Research Detours Package ## ## Copyright (c) Microsoft Corporation. All rights reserved. ## !include ..\common.mak LIBS=$(LIBS) kernel32.lib all: dirs \ $(BIND)\excep.exe \ !IF $(DETOURS_SOURCE_BROWSING)==1 $(OBJD)\excep.bsc !ENDIF clean: -del *~ 2>nul -del $(BIND)\excep.* 2>nul -rmdir /q /s $(OBJD) 2>nul realclean: clean -rmdir /q /s $(OBJDS) 2>nul dirs: @if not exist $(BIND) mkdir $(BIND) && echo. Created $(BIND) @if not exist $(OBJD) mkdir $(OBJD) && echo. Created $(OBJD) $(OBJD)\excep.obj : excep.cpp $(OBJD)\firstexc.obj : firstexc.cpp $(BIND)\excep.exe : $(OBJD)\excep.obj $(OBJD)\firstexc.obj $(DEPS) cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb $(OBJD)\excep.obj $(OBJD)\firstexc.obj \ /link $(LINKFLAGS) $(LIBS) /subsystem:console /entry:WinMainCRTStartup $(OBJD)\excep.bsc : $(OBJD)\excep.obj bscmake /v /n /o $@ $(OBJD)\excep.sbr ############################################################################## test: $(BIND)\excep.exe $(BIND)\excep.exe ################################################################# End of File. ================================================ FILE: ext/detours/samples/excep/excep.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // First Chance Exception Handling Test Program (excep.cpp of excep.exe) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // // For more information on exception handling, see "A Crash Course on the // Depths of Win32 Structured Exception Handling," by Matt Pietrek in the // January 1997 issue of Microsoft Systems Journal. // #include #include #include #include "firstexc.h" ////////////////////////////////////////////////////////////////////////////// // static LPVOID s_pvData = NULL; static DWORD s_dwDataPerm = 0; static LONG ExceptCatch(LONG nTry, DWORD dwException, LPEXCEPTION_POINTERS pinfo) { printf(" ExceptCatch(%ld, %08lx, %08lx)\n", nTry, dwException, (ULONG)pinfo); #ifdef INCLUDE_THIS if (nTry == 0) { return EXCEPTION_CONTINUE_EXECUTION; } #endif return EXCEPTION_EXECUTE_HANDLER; } static int BadCode(int nTry) { printf(" BadCode(Try:%d)\n", nTry); printf(" BadCode -> %ld\n", *(PULONG)s_pvData); ((PULONG)s_pvData)[0] = 0; printf(" BadCode -> %ld\n", *(PULONG)s_pvData); ((PULONG)s_pvData)[-1] = 0; printf(" BadCode -> %ld\n", *(PULONG)s_pvData); return 0; } void safe(int nTry) { __try { printf(" try(%d)\n", nTry); BadCode(nTry); printf(" good(%d)\n", nTry); } __except(ExceptCatch(nTry, GetExceptionCode(), GetExceptionInformation())) { DWORD dwExcept = GetExceptionCode(); printf(" handler(%d) : %08lx\n", nTry, dwExcept); } } void raw(int nTry) { BadCode(nTry); } LONG WINAPI MyVirtualFaultFilter(PEXCEPTION_POINTERS pException) { PEXCEPTION_RECORD pExceptRec = pException->ExceptionRecord; if (pExceptRec->ExceptionCode == 0xc0000005) { printf("-- Memory access exception.\n"); if (pExceptRec->NumberParameters >= 2 && pExceptRec->ExceptionInformation[1] >= (ULONG)s_pvData && pExceptRec->ExceptionInformation[1] <= (ULONG)s_pvData + sizeof(ULONG)) { VirtualProtect(s_pvData, sizeof(ULONG), PAGE_READWRITE, &s_dwDataPerm); printf("-- Changed permissions.\n"); return EXCEPTION_CONTINUE_EXECUTION; } } return EXCEPTION_CONTINUE_SEARCH; } int WINAPI WinMain(HINSTANCE hinst, HINSTANCE hprev, LPSTR lpszCmdLine, int nCmdShow) { (void)hinst; (void)hprev; (void)lpszCmdLine; (void)nCmdShow; s_pvData = VirtualAlloc(NULL, sizeof(ULONG), MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE); if (s_pvData == NULL) { printf("VirtualAlloc failed: %ld\n", GetLastError()); return 0; } *(PULONG)s_pvData = 1; VirtualProtect(s_pvData, sizeof(ULONG), PAGE_READONLY, &s_dwDataPerm); DetourFirstChanceExceptionFilter(MyVirtualFaultFilter); printf("main\n"); printf("--------------------------------------------------\n"); int nTry = 0; for (; nTry < 1; nTry++) { // safe(nTry); } printf("-- safe ------------------------------------------\n"); safe(nTry); VirtualProtect(s_pvData, sizeof(ULONG), PAGE_READWRITE, &s_dwDataPerm); *(PULONG)s_pvData = 1; VirtualProtect(s_pvData, sizeof(ULONG), PAGE_READONLY, &s_dwDataPerm); printf("-- raw -------------------------------------------\n"); printf("*\n"); printf("* NB: The second attempt to write will fail because it isn't handled.\n"); printf("*\n"); raw(nTry); printf("--------------------------------------------------\n"); printf("exit\n"); return 0; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/excep/firstexc.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (firstexc.cpp of firstexc.lib) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // // For more information on exception handling, see "A Crash Course on the // Depths of Win32 Structured Exception Handling," by Matt Pietrek in the // January 1997 issue of Microsoft Systems Journal. // #include #include #include "detours.h" #include "firstexc.h" #if _MSC_VER > 1000 #pragma warning(disable: 4740) #endif ////////////////////////////////////////////////////////////////////////////// // static BOOL s_bExceptionDetourInstalled = FALSE; static LPTOP_LEVEL_EXCEPTION_FILTER s_pFirstChanceFilter = NULL; ULONG (NTAPI *Real_NtContinue)(IN PCONTEXT ContextRecord, IN BOOLEAN TestAlerts) = NULL; VOID (NTAPI *Real_KiUserExceptionDispatcher)(IN PEXCEPTION_RECORD ExceptionRecord, IN PCONTEXT ContextFrame) = NULL; ////////////////////////////////////////////////////////////////////////////// // // This function effectively removes all try..catch frames for the current // stack. It forces all exceptions to be treated as unhandled exceptions. // #pragma warning(push) #pragma warning(disable: 4733) static VOID WINAPI RemoveAllExceptionHandlers(VOID) { // The basic, OS defined exception frame struct EXCEPTION_REGISTRATION { EXCEPTION_REGISTRATION* prev; FARPROC handler; }; EXCEPTION_REGISTRATION * pVCExcRec = NULL; EXCEPTION_REGISTRATION * pLastGood = NULL; __asm mov eax, FS:[0]; __asm mov [pVCExcRec], eax; for (pLastGood = pVCExcRec; (ULONG)pVCExcRec != ~0ul; ) { if ((ULONG)pVCExcRec >= 0x30000000) break; pLastGood = pVCExcRec; pVCExcRec = (EXCEPTION_REGISTRATION *)(pVCExcRec->prev); } __asm mov eax, [pLastGood]; __asm mov FS:[0], eax; } #pragma warning(pop) ////////////////////////////////////////////////////////////////////////////// // Routine Description: // // This routine is entered on return from kernel mode to dispatch a user // mode exception. If a frame based handler handles the exception, then // the execution is continued. Else last chance processing is performed. // // NOTE: This procedure is not called, but rather dispatched to. // It depends on there not being a return address on the stack // (assumption w.r.t. argument offsets.) // // Arguments: // ExceptionRecord (esp+0) - Supplies a pointer to an exception record. // ContextRecord (esp+4) - Supplies a pointer to a context frame. // // Return Value: // None. // static VOID __declspec(naked) NTAPI Detour_KiUserExceptionDispatcher(PEXCEPTION_RECORD pExceptRec, CONTEXT *pContext) { __asm { xor eax, eax ; // Create fake return address on stack. push eax ; // (Generally, we are called by the kernel.) push ebp ; // Prolog mov ebp, esp ; sub esp, __LOCAL_SIZE ; } LPTOP_LEVEL_EXCEPTION_FILTER pFirstChanceFilter; EXCEPTION_POINTERS ep; DWORD dwReturn; DWORD dwError; ep.ExceptionRecord = pExceptRec; ep.ContextRecord = pContext; pFirstChanceFilter = s_pFirstChanceFilter; dwReturn = EXCEPTION_CONTINUE_SEARCH; dwError = 0; if (s_pFirstChanceFilter) { dwReturn = pFirstChanceFilter(&ep); } if (dwReturn == EXCEPTION_CONTINUE_EXECUTION) { dwError = Real_NtContinue(pContext, 0); // This call should *NEVER* return. If it does, we want to fail to the debugger. RemoveAllExceptionHandlers(); } if (dwReturn == EXCEPTION_EXECUTE_HANDLER) { // Special: Call debugger. RemoveAllExceptionHandlers(); } __asm { mov ebx, pExceptRec ; mov ecx, pContext ; push ecx ; push ebx ; mov eax, [Real_KiUserExceptionDispatcher]; jmp eax ; ; ; The above code should never return. ; int 3 ; // Break! ; mov esp, ebp ; // Epilog pop ebp ; ret ; } } ////////////////////////////////////////////////////////////////////////////// // // Set the first-chance exception filter. // // Returns the pointer to the last first-chance exception filter if there // was one. If this is the first first-chance exception filter, installs // the necessary detour and acquires the appropriate function pointers. // If the parameter is NULL, first-chance exception filtering is disabled. // // A first-chance exception filter should always return one of three // possible codes: // // EXCEPTION_CONTINUE_SEARCH: // The exception was not handled by this filter; continue the // search for the appropriate exception handler. // // EXCEPTION_CONTINUE_EXECUTION: // The exception was handled by this filter; continue execution // at the point were the exception was thrown. // // EXCEPTION_EXECUTE_HANDLER: // Drastic failure in the exception filter. Process the // exception as if no exception handlers were installed. // (i.e. Give the user a chance to invoke the debugger.) // LPTOP_LEVEL_EXCEPTION_FILTER WINAPI DetourFirstChanceExceptionFilter(LPTOP_LEVEL_EXCEPTION_FILTER pNewFirstChanceFilter) { if (!s_bExceptionDetourInstalled) { s_bExceptionDetourInstalled = TRUE; Real_NtContinue = (ULONG (NTAPI *)(IN PCONTEXT, IN BOOLEAN)) DetourFindFunction("ntdll.dll", "NtContinue"); Real_KiUserExceptionDispatcher = (VOID (NTAPI *)(IN PEXCEPTION_RECORD, IN PCONTEXT)) DetourFindFunction("ntdll.dll", "KiUserExceptionDispatcher"); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)Real_KiUserExceptionDispatcher, Detour_KiUserExceptionDispatcher); DetourTransactionCommit(); } LPTOP_LEVEL_EXCEPTION_FILTER pOldFirstChanceFilter = s_pFirstChanceFilter; s_pFirstChanceFilter = pNewFirstChanceFilter; return pOldFirstChanceFilter; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/excep/firstexc.h ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (firstexc.h of firstexc.exe) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #pragma once #ifndef _FIRSTEXC_H_ #define _FIRSTEXC_H_ /////////////////////////////////////////////// First Chance Exception Filter. // LPTOP_LEVEL_EXCEPTION_FILTER WINAPI DetourFirstChanceExceptionFilter(LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelFilter); #endif // _FIRSTEXC_H_ // //////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/findfunc/Makefile ================================================ ############################################################################## ## ## Program to test DetourFindFunction. ## ## Microsoft Research Detours Package ## ## Copyright (c) Microsoft Corporation. All rights reserved. ## !include ..\common.mak # ARM64 does not like base addresses below 4GB. # Append two extra zeros for it. # !if "$(DETOURS_TARGET_PROCESSOR)" == "ARM64" TARGET_BASE=0x190000000 EXTEND_BASE=0x1a0000000 !else TARGET_BASE=0x1900000 EXTEND_BASE=0x1a00000 !endif LIBS=$(LIBS) kernel32.lib ############################################################################## all: dirs \ $(BIND)\target$(DETOURS_BITS).dll \ $(BIND)\extend$(DETOURS_BITS).dll \ $(BIND)\findfunc.exe \ $(BIND)\symtest.exe \ $(BIND)\dbghelp.dll \ \ !IF $(DETOURS_SOURCE_BROWSING)==1 $(OBJD)\target$(DETOURS_BITS).bsc \ $(OBJD)\extend$(DETOURS_BITS).bsc \ $(OBJD)\findfunc.bsc \ $(OBJD)\symtest.bsc \ !ENDIF option ############################################################################## dirs: @if not exist $(BIND) mkdir $(BIND) && echo. Created $(BIND) @if not exist $(OBJD) mkdir $(OBJD) && echo. Created $(OBJD) $(OBJD)\target.obj : target.cpp $(OBJD)\target.res : target.rc $(BIND)\target$(DETOURS_BITS).dll $(BIND)\target$(DETOURS_BITS).lib: \ $(OBJD)\target.obj $(OBJD)\target.res $(DEPS) cl /LD $(CFLAGS) /Fe$(@R).dll /Fd$(@R).pdb \ $(OBJD)\target.obj $(OBJD)\target.res \ /link $(LINKFLAGS) /subsystem:console \ /export:Target \ /base:$(TARGET_BASE) \ $(LIBS) $(OBJD)\target$(DETOURS_BITS).bsc : $(OBJD)\target.obj bscmake /v /n /o $@ $(OBJD)\target.sbr $(OBJD)\extend.obj : extend.cpp $(OBJD)\extend.res : extend.rc $(BIND)\extend$(DETOURS_BITS).dll $(BIND)\extend$(DETOURS_BITS).lib: \ $(OBJD)\extend.obj $(OBJD)\extend.res $(DEPS) cl /LD $(CFLAGS) /Fe$(@R).dll /Fd$(@R).pdb \ $(OBJD)\extend.obj $(OBJD)\extend.res \ /link $(LINKFLAGS) /subsystem:console \ /export:DetourFinishHelperProcess,@1,NONAME \ /base:$(EXTEND_BASE) \ $(LIBS) $(OBJD)\extend$(DETOURS_BITS).bsc : $(OBJD)\extend.obj bscmake /v /n /o $@ $(OBJD)\extend.sbr $(OBJD)\findfunc.obj : findfunc.cpp $(BIND)\findfunc.exe : $(OBJD)\findfunc.obj $(BIND)\target$(DETOURS_BITS).lib $(DEPS) cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb $(OBJD)\findfunc.obj \ /link $(LINKFLAGS) $(LIBS) \ /subsystem:console /fixed:no $(BIND)\target$(DETOURS_BITS).lib $(OBJD)\findfunc.bsc : $(OBJD)\findfunc.obj bscmake /v /n /o $@ $(OBJD)\findfunc.sbr $(OBJD)\symtest.obj : symtest.cpp $(BIND)\symtest.exe : $(OBJD)\symtest.obj $(BIND)\target$(DETOURS_BITS).lib $(DEPS) cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb $(OBJD)\symtest.obj \ /link $(LINKFLAGS) $(LIBS) \ /subsystem:console /fixed:no $(BIND)\target$(DETOURS_BITS).lib $(OBJD)\symtest.bsc : $(OBJD)\symtest.obj bscmake /v /n /o $@ $(OBJD)\symtest.sbr # We try to get the 64-bit dbghelp first because it is a lot more useful. $(BIND)\dbghelp.dll : {"$(PROGRAMFILES)\Debugging Tools for Windows 64-bit";$(PATH)}dbghelp.dll -copy $** $(BIND)\dbghelp.dll ############################################################################## clean: -del *~ 2>nul -del $(BIND)\target*.* $(BIND)\extend*.* 2>nul -del $(BIND)\findfunc.* $(BIND)\symtest.* $(BIND)\dbghelp.dll 2>nul -rmdir /q /s $(OBJD) 2>nul realclean: clean -rmdir /q /s $(OBJDS) 2>nul ############################################### Install non-bit-size binaries. !IF "$(DETOURS_OPTION_PROCESSOR)" != "" $(OPTD)\extend$(DETOURS_OPTION_BITS).dll: $(OPTD)\extend$(DETOURS_OPTION_BITS).pdb: $(OPTD)\target$(DETOURS_OPTION_BITS).dll: $(OPTD)\target$(DETOURS_OPTION_BITS).pdb: $(BIND)\extend$(DETOURS_OPTION_BITS).dll : $(OPTD)\extend$(DETOURS_OPTION_BITS).dll @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\extend$(DETOURS_OPTION_BITS).pdb : $(OPTD)\extend$(DETOURS_OPTION_BITS).pdb @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\target$(DETOURS_OPTION_BITS).dll : $(OPTD)\target$(DETOURS_OPTION_BITS).dll @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\target$(DETOURS_OPTION_BITS).pdb : $(OPTD)\target$(DETOURS_OPTION_BITS).pdb @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). option: \ $(BIND)\extend$(DETOURS_OPTION_BITS).dll \ $(BIND)\extend$(DETOURS_OPTION_BITS).pdb \ $(BIND)\target$(DETOURS_OPTION_BITS).dll \ $(BIND)\target$(DETOURS_OPTION_BITS).pdb \ !ELSE option: !ENDIF ############################################################################## verbose: all cls $(BIND)\symtest.exe test: all @echo -------- Reseting test binaries to initial state. ----------------------- $(BIND)\setdll.exe -r $(BIND)\findfunc.exe @echo. @echo -------- Should not load extend$(DETOURS_BITS).dll-------------------------------------- $(BIND)\findfunc.exe @echo. @echo -------- Adding extend$(DETOURS_BITS).dll to findfunc.exe ------------------------------ $(BIND)\setdll.exe -d:$(BIND)\extend$(DETOURS_BITS).dll $(BIND)\findfunc.exe @echo. @echo -------- Should load extend$(DETOURS_BITS).dll statically ------------------------------ $(BIND)\findfunc.exe @echo. @echo -------- Removing extend$(DETOURS_BITS).dll from findfunc.exe -------------------------- $(BIND)\setdll.exe -r $(BIND)\findfunc.exe @echo. @echo -------- Should not load extend$(DETOURS_BITS).dll ------------------------------------- $(BIND)\findfunc.exe @echo. @echo -------- Should load extend$(DETOURS_BITS).dll dynamically using withdll.exe ----------- $(BIND)\withdll.exe -d:$(BIND)\extend$(DETOURS_BITS).dll $(BIND)\findfunc.exe @echo. @echo -------- Should list symbols using symtest.exe ----------- $(BIND)\symtest.exe @echo. @echo -------- Test completed. ------------------------------------------------ ################################################################# End of File. ================================================ FILE: ext/detours/samples/findfunc/extend.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detour Test Program (extend.cpp of extend.dll) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // // An example dynamically detouring a function. // #include #include #include "detours.h" static LONG nExtends = 0; static LONG nInterns = 0; static DWORD (WINAPI * TrueTarget)(DWORD dwCount) = NULL; static DWORD (WINAPI * TrueHidden)(DWORD dwCount) = NULL; static int (WINAPI * TrueEntryPoint)(VOID) = NULL; // Extend is a detour for Target. static DWORD WINAPI Extend(DWORD dwCount) { InterlockedIncrement(&nExtends); printf("extend" DETOURS_STRINGIFY(DETOURS_BITS) ".dll: Extend (%ld) -> %ld.\n", dwCount, dwCount + 1000); dwCount = TrueTarget(dwCount + 1000); printf("extend" DETOURS_STRINGIFY(DETOURS_BITS) ".dll: Extend (.....) -> %ld.\n", dwCount); return dwCount; } // Intern is a detour for Hidden. static DWORD WINAPI Intern(DWORD dwCount) { InterlockedIncrement(&nInterns); printf("extend" DETOURS_STRINGIFY(DETOURS_BITS) ".dll: Intern (%ld) -> %ld.\n", dwCount, dwCount + 10); dwCount = TrueHidden(dwCount + 10); printf("extend" DETOURS_STRINGIFY(DETOURS_BITS) ".dll: Intern (.....) -> %ld.\n", dwCount); return dwCount; } static int WINAPI ExtendEntryPoint() { // We couldn't call LoadLibrary in DllMain, so our functions here. LONG error; // We separate out the functions in the export table (Target) // from the ones that require debug symbols (Hidden). TrueTarget = (DWORD (WINAPI *)(DWORD)) DetourFindFunction("target" DETOURS_STRINGIFY(DETOURS_BITS) ".dll", "Target"); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)TrueTarget, Extend); error = DetourTransactionCommit(); if (error == NO_ERROR) { printf("extend" DETOURS_STRINGIFY(DETOURS_BITS) ".dll: Detoured Target().\n"); } else { printf("extend" DETOURS_STRINGIFY(DETOURS_BITS) ".dll: Error detouring Target(): %ld\n", error); } // Now try to detour the functions requiring debug symbols. TrueHidden = (DWORD (WINAPI *)(DWORD)) DetourFindFunction("target" DETOURS_STRINGIFY(DETOURS_BITS) ".dll", "Hidden"); if (TrueHidden == NULL) { error = GetLastError(); printf("extend" DETOURS_STRINGIFY(DETOURS_BITS) ".dll: TrueHidden = %p (error = %ld)\n", TrueHidden, error); } DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)TrueHidden, Intern); error = DetourTransactionCommit(); if (error == NO_ERROR) { printf("extend" DETOURS_STRINGIFY(DETOURS_BITS) ".dll: Detoured Hidden().\n"); } else { printf("extend" DETOURS_STRINGIFY(DETOURS_BITS) ".dll: Error detouring Hidden(): %ld\n", error); } // Now let the application start executing. printf("extend" DETOURS_STRINGIFY(DETOURS_BITS) ".dll: Calling EntryPoint\n"); fflush(stdout); return TrueEntryPoint(); } BOOL WINAPI DllMain(HINSTANCE hinst, DWORD dwReason, LPVOID reserved) { LONG error; (void)hinst; (void)reserved; if (DetourIsHelperProcess()) { return TRUE; } if (dwReason == DLL_PROCESS_ATTACH) { DetourRestoreAfterWith(); printf("extend" DETOURS_STRINGIFY(DETOURS_BITS) ".dll: Starting.\n"); fflush(stdout); // NB: DllMain can't call LoadLibrary, so we hook the app entry point. TrueEntryPoint = (int (WINAPI *)())DetourGetEntryPoint(NULL); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)TrueEntryPoint, ExtendEntryPoint); error = DetourTransactionCommit(); if (error == NO_ERROR) { printf("extend" DETOURS_STRINGIFY(DETOURS_BITS) ".dll: Detoured EntryPoint().\n"); } else { printf("extend" DETOURS_STRINGIFY(DETOURS_BITS) ".dll: Error detouring EntryPoint(): %ld\n", error); } } else if (dwReason == DLL_PROCESS_DETACH) { DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); // Detach functions found from the export table. if (TrueTarget != NULL) { DetourDetach(&(PVOID&)TrueTarget, (PVOID)Extend); } // Detach functions found from debug symbols. if (TrueHidden != NULL) { DetourDetach(&(PVOID&)TrueHidden, (PVOID)Intern); } // Detach the entry point. DetourDetach(&(PVOID&)TrueEntryPoint, ExtendEntryPoint); error = DetourTransactionCommit(); printf("extend" DETOURS_STRINGIFY(DETOURS_BITS) ".dll: Removed Target() detours (%ld), %ld/%ld calls.\n", error, nExtends, nInterns); fflush(stdout); } return TRUE; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/findfunc/extend.rc ================================================ ////////////////////////////////////////////////////////////////////////////// // // Version information for extend.rc. // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include "detver.h" #define VER_INTERNALNAME_STR "extend" DETOURS_STRINGIFY(DETOURS_BITS) #define VER_ORIGINALFILENAME_STR "extend" DETOURS_STRINGIFY(DETOURS_BITS) ".dll" #define VER_FILEDESCRIPTION_STR "Detours Dyanmic Interception Test Module" #define VER_COMPANYNAME_STR "Microsoft Corporation" #include "common.ver" ================================================ FILE: ext/detours/samples/findfunc/findfunc.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detour Test Program (findfunc.cpp of findfunc.exe) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include #include #include #include "target.h" int __cdecl main(void) { printf("findfunc.exe: Starting.\n"); fflush(stdout); printf("DLLs:\n"); for (HMODULE hModule = NULL; (hModule = DetourEnumerateModules(hModule)) != NULL;) { CHAR szName[MAX_PATH] = { 0 }; GetModuleFileNameA(hModule, szName, sizeof(szName) - 1); printf(" %p: %s\n", hModule, szName); } DWORD dwCount = 10000; for (int i = 0; i < 3; i++) { printf("findfunc.exe: Calling (%ld).\n", dwCount); dwCount = Target(dwCount) + 10000; } return 0; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/findfunc/symtest.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detour Test Program (symtest.cpp of symtest.exe) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include #include #pragma warning(push) #if _MSC_VER > 1400 #pragma warning(disable:6102 6103) // /analyze warnings #endif #include #pragma warning(pop) #include #include "target.h" #if (_MSC_VER < 1299) #include typedef IMAGEHLP_MODULE IMAGEHLP_MODULE64; typedef PIMAGEHLP_MODULE PIMAGEHLP_MODULE64; typedef IMAGEHLP_SYMBOL SYMBOL_INFO; typedef PIMAGEHLP_SYMBOL PSYMBOL_INFO; #else #pragma warning(push) #pragma warning(disable:4091) // empty typedef #include #pragma warning(pop) #endif ////////////////////////////////////////////////////////////////////////////// // typedef LPAPI_VERSION (NTAPI *PF_ImagehlpApiVersionEx)(LPAPI_VERSION AppVersion); typedef BOOL (NTAPI *PF_SymInitialize)(IN HANDLE hProcess, IN LPCSTR UserSearchPath, IN BOOL fInvadeProcess); typedef DWORD (NTAPI *PF_SymSetOptions)(IN DWORD SymOptions); typedef DWORD (NTAPI *PF_SymGetOptions)(VOID); typedef DWORD64 (NTAPI *PF_SymLoadModule64)(IN HANDLE hProcess, IN HANDLE hFile, IN PSTR ImageName, IN PSTR ModuleName, IN DWORD64 BaseOfDll, IN DWORD SizeOfDll); typedef BOOL (NTAPI *PF_SymGetModuleInfo64)(IN HANDLE hProcess, IN DWORD64 qwAddr, OUT PIMAGEHLP_MODULE64 ModuleInfo); typedef BOOL (NTAPI *PF_SymFromName)(IN HANDLE hProcess, IN LPSTR Name, OUT PSYMBOL_INFO Symbol); #if (_MSC_VER < 1299) typedef BOOL (NTAPI *PF_SymRegisterCallback64)(); typedef BOOL (NTAPI *PF_SymEnumerateModules64)(); typedef BOOL (NTAPI *PF_SymEnumSymbols)(); #else typedef BOOL (NTAPI *PF_SymRegisterCallback64)(IN HANDLE hProcess, IN PSYMBOL_REGISTERED_CALLBACK64 CallbackFunction, IN ULONG64 UserContext); typedef BOOL (NTAPI *PF_SymEnumerateModules64)(IN HANDLE hProcess, IN PSYM_ENUMMODULES_CALLBACK64 EnumModulesCallback, IN PVOID UserContext); typedef BOOL (NTAPI *PF_SymEnumSymbols)(IN HANDLE hProcess, IN ULONG64 BaseOfDll, IN PCSTR Mask, IN PSYM_ENUMERATESYMBOLS_CALLBACK EnumSymbolsCallback, IN PVOID UserContext); #endif PF_ImagehlpApiVersionEx pfImagehlpApiVersionEx = NULL; PF_SymInitialize pfSymInitialize = NULL; PF_SymSetOptions pfSymSetOptions = NULL; PF_SymGetOptions pfSymGetOptions = NULL; PF_SymLoadModule64 pfSymLoadModule64 = NULL; PF_SymGetModuleInfo64 pfSymGetModuleInfo64 = NULL; PF_SymFromName pfSymFromName = NULL; PF_SymRegisterCallback64 pfSymRegisterCallback64 = NULL; PF_SymEnumerateModules64 pfSymEnumerateModules64 = NULL; PF_SymEnumSymbols pfSymEnumSymbols = NULL; ////////////////////////////////////////////////////////////////////////////// // #if (_MSC_VER > 1299) static BOOL WINAPI SymEnumerateCallback( PCSTR pszModule, DWORD64 base, PVOID pvUserContext) { (void)pvUserContext; printf(" %p: %s\n", (PVOID)base, pszModule); return TRUE; } static int nSymbolCount = 0; static BOOL WINAPI SymEnumerateSymbols(PSYMBOL_INFO pSym, ULONG size, PVOID pvUserContext) { (void)size; (void)pvUserContext; if (strstr(pSym->Name, "Target") != NULL || strstr(pSym->Name, "Hidden") != NULL) { printf(" %p: %s\n", (PVOID)pSym->Address, pSym->Name); nSymbolCount++; } else if (nSymbolCount < 5) { printf(" %p: %s\n", (PVOID)pSym->Address, pSym->Name); nSymbolCount++; } return TRUE; } static void truncate(PCHAR data) { size_t len = strlen(data); if (len > 0 && data[len-1] == '\r') { data[--len] = '\0'; } if (len > 0 && data[len-1] == '\n') { data[--len] = '\0'; } } BOOL WINAPI CallbackFunction(HANDLE hProcess, ULONG action, ULONG64 data, ULONG64 context) { (void)context; switch (action) { case CBA_DEBUG_INFO: truncate((PCHAR)data); printf("::> %s\n", (PCHAR)data); return TRUE; case CBA_DEFERRED_SYMBOL_LOAD_CANCEL: printf("::> proc=%p action=%08lx data=%p\n", (PVOID)hProcess, action, (PVOID)data); { PIMAGEHLP_DEFERRED_SYMBOL_LOAD64 pi = (PIMAGEHLP_DEFERRED_SYMBOL_LOAD64)data; printf("pi->SizeOfStruct = %ld\n", pi->SizeOfStruct); printf("pi->BaseOfImage = %p\n", (PVOID)(size_t)pi->BaseOfImage); printf("pi->CheckSum = %8lx\n", pi->CheckSum); printf("pi->FileName = %p [%s]\n", pi->FileName, pi->FileName); printf("pi->Reparse = %d\n", pi->Reparse); } return FALSE; default: printf("::> proc=%p action=%08lx data=%p\n", (PVOID)hProcess, action, (PVOID)data); return FALSE; } } #endif int __cdecl main(void) { printf("symtest.exe: Starting.\n"); fflush(stdout); //////////////////////////////////////////////////////// Get the functions. // HMODULE hDbgHelp = LoadLibraryA("dbghelp.dll"); if (hDbgHelp == NULL) { printf("Couldn't load dbghelp.dll"); return 1; } pfImagehlpApiVersionEx = (PF_ImagehlpApiVersionEx)GetProcAddress(hDbgHelp, "ImagehlpApiVersionEx"); pfSymInitialize = (PF_SymInitialize)GetProcAddress(hDbgHelp, "SymInitialize"); pfSymSetOptions = (PF_SymSetOptions)GetProcAddress(hDbgHelp, "SymSetOptions"); pfSymGetOptions = (PF_SymGetOptions)GetProcAddress(hDbgHelp, "SymGetOptions"); pfSymLoadModule64 = (PF_SymLoadModule64)GetProcAddress(hDbgHelp, "SymLoadModule64"); pfSymGetModuleInfo64 = (PF_SymGetModuleInfo64)GetProcAddress(hDbgHelp, "SymGetModuleInfo64"); pfSymFromName = (PF_SymFromName)GetProcAddress(hDbgHelp, "SymFromName"); pfSymRegisterCallback64 = (PF_SymRegisterCallback64)GetProcAddress(hDbgHelp, "SymRegisterCallback64"); pfSymEnumerateModules64 = (PF_SymEnumerateModules64)GetProcAddress(hDbgHelp, "SymEnumerateModules64"); pfSymEnumSymbols = (PF_SymEnumSymbols)GetProcAddress(hDbgHelp, "SymEnumSymbols"); ////////////////////////////////////////////////////////////////////////////// // HANDLE hProcess = GetCurrentProcess(); API_VERSION av; ZeroMemory(&av, sizeof(av)); av.MajorVersion = API_VERSION_NUMBER; pfImagehlpApiVersionEx(&av); printf(" Version: %d.%d (%d)\n", av.MajorVersion, av.MinorVersion, API_VERSION_NUMBER); if (!pfSymInitialize(hProcess, NULL, FALSE)) { printf("SymInitialize failed: %ld\n", GetLastError()); return 1; } #if (_MSC_VER > 1299) pfSymRegisterCallback64(hProcess, CallbackFunction, NULL); #endif DWORD dw = pfSymGetOptions(); printf("GetOptions = %08lx\n", dw); dw &= ~(SYMOPT_CASE_INSENSITIVE | SYMOPT_UNDNAME | SYMOPT_DEFERRED_LOADS | 0); dw |= ( #if defined(SYMOPT_EXACT_SYMBOLS) SYMOPT_EXACT_SYMBOLS | #endif #if defined(SYMOPT_DEBUG) SYMOPT_DEBUG | #endif #if defined(SYMOPT_NO_UNQUALIFIED_LOADS) SYMOPT_NO_UNQUALIFIED_LOADS | #endif #if defined(SYMOPT_FAIL_CRITICAL_ERRORS) SYMOPT_FAIL_CRITICAL_ERRORS | #endif #if defined(SYMOPT_INCLUDE_32BIT_MODULES) SYMOPT_INCLUDE_32BIT_MODULES | #endif 0); printf("SetOptions = %08lx\n", dw); pfSymSetOptions(dw); /////////////////////////////////////////////// First, try GetProcAddress. // PCHAR pszFile = "target" DETOURS_STRINGIFY(DETOURS_BITS) ".dll"; HMODULE hModule = LoadLibraryA(pszFile); if (hModule == NULL) { printf("LoadLibraryA(%s) failed: %ld\n", pszFile, GetLastError()); return 2; } ////////////////////////////////////////////////////// Then try ImageHelp. // #if (_MSC_VER > 1299) //CHAR szFull[MAX_PATH]; //GetModuleFileNameA(hModule, szFull, sizeof(szFull)); printf("SymLoadModule64(%s) will be called.\n", pszFile /*szFull*/); DWORD64 loaded = pfSymLoadModule64(hProcess, NULL, (PCHAR)pszFile/*szFull*/, NULL, (DWORD64)hModule, 0); if (loaded == 0) { printf("SymLoadModule64(%p) failed: %ld\n", hProcess, GetLastError()); printf("\n"); } else { printf("SymLoadModule64(%p) succeeded: 0x%p\n", hProcess, (PVOID)loaded); } CHAR szModName[512]; printf("Modules:\n"); // The first parameter of PSYM_ENUMMODULES_CALLBACK64 changed from PSTR to PCSTR // between Windows 2003 and Windows 7. Cast here to work with either. pfSymEnumerateModules64(hProcess, (PSYM_ENUMMODULES_CALLBACK64)SymEnumerateCallback, NULL); printf("\n"); IMAGEHLP_MODULE64 modinfo; ZeroMemory(&modinfo, sizeof(modinfo)); modinfo.SizeOfStruct = 512/*sizeof(modinfo)*/; if (!pfSymGetModuleInfo64(hProcess, (DWORD64)hModule, &modinfo)) { printf("SymGetModuleInfo64(%p, %p) [64] failed: %ld\n", hProcess, hModule, GetLastError()); } else { printf("SymGetModuleInfo64(%p, %p) [64] succeeded: %ld\n", hProcess, hModule, GetLastError()); StringCchCopyA(szModName, ARRAYSIZE(szModName), modinfo.ModuleName); StringCchCatA(szModName, ARRAYSIZE(szModName), "!"); printf("NumSyms: %ld\n", modinfo.NumSyms); printf("SymType: %d\n", modinfo.SymType); printf("ModuleName: %s\n", modinfo.ModuleName); printf("ImageName: %s\n", modinfo.ImageName); printf("LoadedImageName: %s\n", modinfo.LoadedImageName); } printf("\n"); fflush(stdout); printf("DLLs:\n"); for (hModule = NULL; (hModule = DetourEnumerateModules(hModule)) != NULL;) { CHAR szName[MAX_PATH]; GetModuleFileNameA(hModule, szName, sizeof(szName)); printf(" %p: %s\n", hModule, szName); } if (pfSymEnumSymbols == NULL) { printf("Couldn't find SymEnumSymbols.\n"); } else { printf("===Enum===\n"); SetLastError(0); nSymbolCount = 0; if (!pfSymEnumSymbols(hProcess, (DWORD64)hModule, NULL, SymEnumerateSymbols, NULL)) { printf("SymEnumSymbols() failed: %ld\n", GetLastError()); } } // Look for specific symbols. struct CFullSymbol : SYMBOL_INFO { CHAR szRestOfName[MAX_SYM_NAME]; } symbol; CHAR szFullName[512]; // Look for Target StringCchCopyA(szFullName, ARRAYSIZE(szFullName), szModName); StringCchCatA(szFullName, ARRAYSIZE(szFullName), "Target"); printf("Symbol: [%s]\n", szFullName); ZeroMemory(&symbol, sizeof(symbol)); symbol.SizeOfStruct = sizeof(SYMBOL_INFO); #ifdef DBHLPAPI symbol.MaxNameLen = MAX_SYM_NAME; #else symbol.MaxNameLength = MAX_SYM_NAME; #endif SetLastError(0); if (!pfSymFromName(hProcess, szFullName, &symbol)) { printf("--SymFromName(%s) failed: %ld\n", szFullName, GetLastError()); } if (symbol.Address != 0) { printf("--SymFromName(%s) succeeded\n", szFullName); } printf("%s => %p\n\n", szFullName, (PBYTE)symbol.Address); // Look for Hidden StringCchCopyA(szFullName, ARRAYSIZE(szFullName), szModName); StringCchCatA(szFullName, ARRAYSIZE(szFullName), "Hidden"); printf("Symbol: [%s]\n", szFullName); ZeroMemory(&symbol, sizeof(symbol)); symbol.SizeOfStruct = sizeof(SYMBOL_INFO); #ifdef DBHLPAPI symbol.MaxNameLen = MAX_SYM_NAME; #else symbol.MaxNameLength = MAX_SYM_NAME; #endif SetLastError(0); if (!pfSymFromName(hProcess, szFullName, &symbol)) { printf("--SymFromName(%s) failed: %ld\n", szFullName, GetLastError()); } if (symbol.Address != 0) { printf("--SymFromName(%s) succeeded\n", szFullName); } printf("%s => %p\n\n", szFullName, (PBYTE)symbol.Address); #endif // We call Target once to insure it is loaded. Target(0); return 0; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/findfunc/target.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detour Test Program (target.cpp of target.dll) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include #include #include "target.h" extern "C" DWORD WINAPI Hidden(DWORD dwCount) { printf("target.dll: Hidden(%ld) -> %ld.\n", dwCount, dwCount + 1); return dwCount + 1; } // We use this point to ensure Hidden isn't inlined. static DWORD (WINAPI * SelfHidden)(DWORD dwCount) = Hidden; DWORD WINAPI Target(DWORD dwCount) { printf("target.dll: Target (%ld) -> %ld.\n", dwCount, dwCount + 100); dwCount = SelfHidden(dwCount + 100); printf("target.dll: Target (.....) -> %ld.\n", dwCount); return dwCount; } BOOL WINAPI DllMain(HINSTANCE hinst, DWORD dwReason, LPVOID reserved) { (void)hinst; (void)dwReason; (void)reserved; return TRUE; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/findfunc/target.h ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detour Test Program (target.h of target.dll) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #pragma once DWORD WINAPI Target(DWORD dwCount); // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/findfunc/target.rc ================================================ ////////////////////////////////////////////////////////////////////////////// // // Version information for target.rc. // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include "detver.h" #define VER_INTERNALNAME_STR "target" DETOURS_STRINGIFY(DETOURS_BITS) #define VER_ORIGINALFILENAME_STR "target" DETOURS_STRINGIFY(DETOURS_BITS) ".dll" #define VER_FILEDESCRIPTION_STR "Detours Test Module" #define VER_COMPANYNAME_STR "Microsoft Corporation" #include "common.ver" ================================================ FILE: ext/detours/samples/impmunge/Makefile ================================================ ############################################################################## ## ## Makefile for Detours Test Programs. ## ## Microsoft Research Detours Package ## ## Copyright (c) Microsoft Corporation. All rights reserved. ## !include ..\common.mak LIBS=$(LIBS) kernel32.lib all: dirs \ $(BIND)\impmunge.exe \ !IF $(DETOURS_SOURCE_BROWSING)==1 $(OBJD)\impmunge.bsc !ENDIF ############################################################################## clean: -del *~ test.exe.* 2>nul -del $(BIND)\impmunge.* 2>nul -rmdir /q /s $(OBJD) 2>nul realclean: clean -rmdir /q /s $(OBJDS) 2>nul ############################################################################## dirs: @if not exist $(BIND) mkdir $(BIND) && echo. Created $(BIND) @if not exist $(OBJD) mkdir $(OBJD) && echo. Created $(OBJD) $(OBJD)\impmunge.obj : impmunge.cpp $(BIND)\impmunge.exe : $(OBJD)\impmunge.obj $(DEPS) cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb $(OBJD)\impmunge.obj \ /link $(LINKFLAGS) $(LIBS) imagehlp.lib /subsystem:console $(OBJD)\impmunge.bsc : $(OBJD)\impmunge.obj bscmake /v /n /o $@ $(OBJD)\impmunge.sbr ############################################################################## test: $(BIND)\impmunge.exe $(BIND)\impmunge.exe /m /o:test.exe.1 $(BIND)\impmunge.exe $(BIND)\impmunge.exe /m /l- /o:test.exe.2 test.exe.1 $(BIND)\impmunge.exe /m /l- /o:test.exe.3 test.exe.2 $(BIND)\impmunge.exe /m /l- /o:test.exe.4 test.exe.3 $(BIND)\impmunge.exe /l test.exe.4 $(BIND)\impmunge.exe /r /l- /o:test.exe.0 test.exe.4 $(BIND)\impmunge.exe /l test.exe.0 ################################################################# End of File. ================================================ FILE: ext/detours/samples/impmunge/impmunge.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (impmunge.cpp of impmunge.exe) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include #include #include #pragma warning(push) #if _MSC_VER > 1400 #pragma warning(disable:6102 6103) // /analyze warnings #endif #include #include #pragma warning(disable:4091) // empty typedef #include #pragma warning(pop) ////////////////////////////////////////////////////////////// Error Messages. // VOID AssertMessage(PCSTR szMsg, PCSTR szFile, DWORD nLine) { printf("ASSERT(%s) failed in %s, line %ld.", szMsg, szFile, nLine); } #define ASSERT(x) \ do { if (!(x)) { AssertMessage(#x, __FILE__, __LINE__); DebugBreak(); }} while (0) ; ////////////////////////////////////////////////////////////////////////////// // static BOOLEAN s_fRestore = FALSE; static BOOLEAN s_fList = TRUE; static BOOLEAN s_fMunge = FALSE; static BOOLEAN s_fToSymbols = FALSE; ////////////////////////////////////////////////////////////////////////////// // static BOOL CALLBACK ListByway(_In_opt_ PVOID pContext, _In_opt_ LPCSTR pszFile, _Outptr_result_maybenull_ LPCSTR *ppszOutFile) { (void)pContext; (void)ppszOutFile; printf(" byway -------------------------------- %s\n", pszFile ? pszFile : ""); return TRUE; } static BOOL CALLBACK ListFile(_In_opt_ PVOID pContext, _In_ LPCSTR pszOrigFile, _In_ LPCSTR pszFile, _Outptr_result_maybenull_ LPCSTR *ppszOutFile) { (void)pContext; (void)ppszOutFile; printf(" file %-32.32s %-32.32s\n", pszOrigFile ? pszOrigFile : "", pszFile ? pszFile : ""); return TRUE; } static BOOL CALLBACK ListSymbol(_In_opt_ PVOID pContext, _In_ ULONG nOrigOrdinal, _In_ ULONG nOrdinal, _Out_ ULONG *pnOutOrdinal, _In_opt_ LPCSTR pszOrigSymbol, _In_opt_ LPCSTR pszSymbol, _Outptr_result_maybenull_ LPCSTR *ppszOutSymbol) { (void)pContext; (void)pnOutOrdinal; (void)ppszOutSymbol; char szOrig[80]; char szLast[80]; if (pszOrigSymbol == NULL) { StringCchPrintfA(szOrig, sizeof(szOrig), "#%d", nOrigOrdinal); pszOrigSymbol = szOrig; } if (pszSymbol == NULL) { StringCchPrintfA(szLast, sizeof(szLast), "#%d", nOrdinal); pszSymbol = szLast; } printf(" symbol %-32.32s %-32.32s\n", pszOrigSymbol, pszSymbol); return TRUE; } static BOOL CALLBACK ListCommit(PVOID pContext) { (void)pContext; printf(" commit\n"); return TRUE; } ////////////////////////////////////////////////////////////////////////////// // struct MUNGE_STATE { BOOL fLastWasByway; LONG nBywayCount; CHAR szBuffer[512]; }; static BOOL CALLBACK MungeByway(_In_opt_ PVOID pContext, _In_opt_ LPCSTR pszFile, _Outptr_result_maybenull_ LPCSTR *ppszOutFile) { MUNGE_STATE *pState = (MUNGE_STATE *)pContext; printf("|"); if (pState->fLastWasByway) { return TRUE; } pState->fLastWasByway = TRUE; if (pszFile == NULL) { StringCchPrintfA(pState->szBuffer, sizeof(pState->szBuffer), "mb_munge_%d.dll", pState->nBywayCount++); *ppszOutFile = pState->szBuffer; } return TRUE; } static BOOL CALLBACK MungeFile(_In_opt_ PVOID pContext, _In_ LPCSTR pszOrigFile, _In_ LPCSTR pszFile, _Outptr_result_maybenull_ LPCSTR *ppszOutFile) { (void)pszOrigFile; MUNGE_STATE *pState = (MUNGE_STATE *)pContext; pState->fLastWasByway = FALSE; printf("*"); StringCchPrintfA(pState->szBuffer, sizeof(pState->szBuffer), "mf_%s", pszFile); *ppszOutFile = pState->szBuffer; return TRUE; } static BOOL CALLBACK MungeSymbol(_In_opt_ PVOID pContext, _In_ ULONG nOrigOrdinal, _In_ ULONG nOrdinal, _Out_ ULONG *pnOutOrdinal, _In_opt_ LPCSTR pszOrigSymbol, _In_opt_ LPCSTR pszSymbol, _Outptr_result_maybenull_ LPCSTR *ppszOutSymbol) { (void)nOrigOrdinal; (void)pszOrigSymbol; MUNGE_STATE *pState = (MUNGE_STATE *)pContext; pState->fLastWasByway = FALSE; printf("."); if (nOrdinal != 0) { if (s_fToSymbols) { StringCchPrintfA(pState->szBuffer, sizeof(pState->szBuffer), "mo_%d", (int)nOrdinal); *pnOutOrdinal = 0; *ppszOutSymbol = pState->szBuffer; } else { *pnOutOrdinal = 10000 + nOrdinal; *ppszOutSymbol = NULL; } } else { StringCchPrintfA(pState->szBuffer, sizeof(pState->szBuffer), "ms_%s", pszSymbol); *pnOutOrdinal = 0; *ppszOutSymbol = pState->szBuffer; } return TRUE; } static BOOL CALLBACK MungeCommit(PVOID pContext) { MUNGE_STATE *pState = (MUNGE_STATE *)pContext; pState->fLastWasByway = FALSE; printf("\n"); (void)pContext; return TRUE; } ////////////////////////////////////////////////////////////////////////////// // static BOOL CALLBACK RestoreByway(_In_opt_ PVOID pContext, _In_opt_ LPCSTR pszFile, _Outptr_result_maybenull_ LPCSTR *ppszOutFile) { (void)pContext; (void)pszFile; *ppszOutFile = NULL; return TRUE; } static BOOL CALLBACK RestoreFile(_In_opt_ PVOID pContext, _In_ LPCSTR pszOrigFile, _In_ LPCSTR pszFile, _Outptr_result_maybenull_ LPCSTR *ppszOutFile) { (void)pContext; (void)pszFile; *ppszOutFile = pszOrigFile; return TRUE; } static BOOL CALLBACK RestoreSymbol(_In_opt_ PVOID pContext, _In_ ULONG nOrigOrdinal, _In_ ULONG nOrdinal, _Out_ ULONG *pnOutOrdinal, _In_opt_ LPCSTR pszOrigSymbol, _In_opt_ LPCSTR pszSymbol, _Outptr_result_maybenull_ LPCSTR *ppszOutSymbol) { (void)pContext; (void)nOrdinal; (void)pszSymbol; *pnOutOrdinal = nOrigOrdinal; *ppszOutSymbol = pszOrigSymbol; return TRUE; } static BOOL CALLBACK RestoreCommit(PVOID pContext) { (void)pContext; return TRUE; } ////////////////////////////////////////////////////////////////////////////// // BOOL EditFile(PCHAR pszInput, PCHAR pszOutput) { BOOL fGood = TRUE; HANDLE hOld = INVALID_HANDLE_VALUE; HANDLE hNew = INVALID_HANDLE_VALUE; PDETOUR_BINARY pBinary = NULL; if (pszOutput != NULL) { printf("%s -> %s:\n", pszInput, pszOutput); } else { printf("%s:\n", pszInput); } hOld = CreateFileA(pszInput, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (hOld == INVALID_HANDLE_VALUE) { printf("Couldn't open input file: %s, error: %ld\n", pszInput, GetLastError()); fGood = FALSE; goto end; } if ((pBinary = DetourBinaryOpen(hOld)) == NULL) { printf("DetourBinaryOpen failed: %ld\n", GetLastError()); goto end; } if (hOld != INVALID_HANDLE_VALUE) { CloseHandle(hOld); hOld = INVALID_HANDLE_VALUE; } if (s_fRestore) { if (!DetourBinaryEditImports(pBinary, NULL, RestoreByway, RestoreFile, RestoreSymbol, RestoreCommit)) { printf("DetourBinaryEditImports for munge failed: %ld\n", GetLastError()); } } if (s_fMunge) { MUNGE_STATE state; state.fLastWasByway = FALSE; state.nBywayCount = 1; if (!DetourBinaryEditImports(pBinary, &state, MungeByway, MungeFile, MungeSymbol, MungeCommit)) { printf("DetourBinaryEditImports for munge failed: %ld\n", GetLastError()); } } if (s_fList) { if (!DetourBinaryEditImports(pBinary, NULL, ListByway, ListFile, ListSymbol, ListCommit)) { printf("DetourBinaryEditImports for list failed: %ld\n", GetLastError()); } } if (pszOutput != NULL) { hNew = CreateFileA(pszOutput, GENERIC_WRITE | GENERIC_READ, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL); if (hNew == INVALID_HANDLE_VALUE) { printf("Couldn't open output file: %s, error: %ld\n", pszOutput, GetLastError()); fGood = FALSE; goto end; } if (!DetourBinaryWrite(pBinary, hNew)) { printf("DetourBinaryWrite failed: %ld\n", GetLastError()); fGood = FALSE; } CloseHandle(hNew); hNew = INVALID_HANDLE_VALUE; } DetourBinaryClose(pBinary); pBinary = NULL; if (fGood && pszOutput != NULL) { if (!BindImageEx(BIND_NO_BOUND_IMPORTS, pszOutput, ".", ".", NULL)) { printf("Warning: Couldn't bind binary %s: %ld\n", pszOutput, GetLastError()); } } end: if (pBinary) { DetourBinaryClose(pBinary); pBinary = NULL; } if (hNew != INVALID_HANDLE_VALUE) { CloseHandle(hNew); hNew = INVALID_HANDLE_VALUE; } if (hOld != INVALID_HANDLE_VALUE) { CloseHandle(hOld); hOld = INVALID_HANDLE_VALUE; } return fGood; } ////////////////////////////////////////////////////////////////////////////// // void PrintUsage(void) { printf("Usage:\n" " impmunge [options] binary_files\n" "Options:\n" " /l : List imports.\n" " /l- : Don't list imports.\n" " /m : Munge imports.\n" " /r : Remove import munges.\n" " /o:file : Set name of output file; must be include with /m or /r.\n" " /? : This help screen.\n"); } //////////////////////////////////////////////////////////////////////// main. // int CDECL main(int argc, char **argv) { BOOL fNeedHelp = FALSE; PCHAR pszOutput = NULL; int arg = 1; for (; arg < argc && !fNeedHelp; arg++) { if (argv[arg][0] == '-' || argv[arg][0] == '/') { CHAR *argn = argv[arg] + 1; CHAR *argp = argn; while (*argp && *argp != ':') argp++; if (*argp == ':') *argp++ = '\0'; switch (argn[0]) { case 'l': // List contents of import table. case 'L': s_fList = (argn[1] != '-'); break; case 'm': // Munge import table. case 'M': s_fMunge = (argn[1] != '-'); break; case 'o': // Set output file name. case 'O': pszOutput = argp; break; case 'r': // Restore file to unmunged state. case 'R': s_fRestore = (argn[1] != '-'); break; case 's': // Munge ordinals to symbols case 'S': s_fToSymbols = true; break; case '?': // Help fNeedHelp = TRUE; break; default: fNeedHelp = TRUE; printf("Bad argument: %s:%s\n", argn, argp); break; } } else { if (!s_fList && !s_fMunge && !s_fRestore) { fNeedHelp = TRUE; break; } if (pszOutput == NULL && (s_fMunge || s_fRestore)) { fNeedHelp = TRUE; break; } EditFile(argv[arg], pszOutput); pszOutput = NULL; } } if (argc == 1) { fNeedHelp = TRUE; } if (fNeedHelp) { PrintUsage(); return 1; } return 0; } // End of File ================================================ FILE: ext/detours/samples/member/Makefile ================================================ ############################################################################## ## ## Makefile for Detours Test Programs. ## ## Microsoft Research Detours Package ## ## Copyright (c) Microsoft Corporation. All rights reserved. ## !include ..\common.mak LIBS=$(LIBS) kernel32.lib all: dirs \ $(BIND)\member.exe \ !IF $(DETOURS_SOURCE_BROWSING)==1 $(OBJD)\member.bsc !ENDIF clean: -del *~ 2> nul -del $(BIND)\member.* 2> nul -rmdir /q /s $(OBJD) 2>nul realclean: clean -rmdir /q /s $(OBJDS) 2>nul dirs: @if not exist $(BIND) mkdir $(BIND) && echo. Created $(BIND) @if not exist $(OBJD) mkdir $(OBJD) && echo. Created $(OBJD) $(OBJD)\member.obj : member.cpp $(BIND)\member.exe : $(OBJD)\member.obj $(DEPS) cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb $(OBJD)\member.obj \ /link $(LINKFLAGS) $(LIBS) /subsystem:console $(OBJD)\member.bsc : $(OBJD)\member.obj bscmake /v /n /o $@ $(OBJD)\member.sbr ############################################################################## test: $(BIND)\member.exe @echo. $(BIND)\member.exe @echo. ################################################################# End of File. ================================================ FILE: ext/detours/samples/member/member.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Test a detour of a member function (member.cpp of member.exe) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // // By default, C++ member functions use the __thiscall calling convention. // In order to Detour a member function, both the trampoline and the detour // must have exactly the same calling convention as the target function. // Unfortunately, the VC compiler does not support a __thiscall, so the only // way to create legal detour and trampoline functions is by making them // class members of a "detour" class. // // In addition, C++ does not support converting a pointer to a member // function to an arbitrary pointer. To get a raw pointer, the address of // the member function must be moved into a temporary member-function // pointer, then passed by taking it's address, then de-referencing it. // Fortunately, the compiler will optimize the code to remove the extra // pointer operations. // // If X::Target is a virtual function, the following code will *NOT* work // because &X::Target is the address of a thunk that does a virtual call, // not the real address of the X::Target. You can get the real address // of X::Target by looking directly in the VTBL for class X, but there // is no legal way to 1) get the address of X's VTBL or 2) get the offset // of ::Target within that VTBL. You can of course, figure these out for // a particular class and function, but there is no general way to do so. // #include #include #include #include "..\slept\verify.cpp" //////////////////////////////////////////////////////////////// Target Class. // class CMember { public: void Target(void); }; void CMember::Target(void) { printf(" CMember::Target! (this:%p)\n", this); } //////////////////////////////////////////////////////////////// Detour Class. // class CDetour /* add ": public CMember" to enable access to member variables... */ { public: void Mine_Target(void); static void (CDetour::* Real_Target)(void); // Class shouldn't have any member variables or virtual functions. }; void CDetour::Mine_Target(void) { printf(" CDetour::Mine_Target! (this:%p)\n", this); (this->*Real_Target)(); } void (CDetour::* CDetour::Real_Target)(void) = (void (CDetour::*)(void))&CMember::Target; ////////////////////////////////////////////////////////////////////////////// // int main(int argc, char **argv) { (void)argc; (void)argv; ////////////////////////////////////////////////////////////////////////// // void (CMember::* pfTarget)(void) = &CMember::Target; void (CDetour::* pfMine)(void) = &CDetour::Mine_Target; Verify("CMember::Target ", *(PBYTE*)&pfTarget); Verify("*CDetour::Real_Target", *(PBYTE*)&CDetour::Real_Target); Verify("CDetour::Mine_Target ", *(PBYTE*)&pfMine); printf("\n"); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)CDetour::Real_Target, *(PBYTE*)&pfMine); LONG l = DetourTransactionCommit(); printf("DetourTransactionCommit = %ld\n", l); printf("\n"); Verify("CMember::Target ", *(PBYTE*)&pfTarget); Verify("*CDetour::Real_Target", *(&(PBYTE&)CDetour::Real_Target)); Verify("CDetour::Mine_Target ", *(PBYTE*)&pfMine); printf("\n"); ////////////////////////////////////////////////////////////////////////// // CMember target; printf("Calling CMember (w/o Detour):\n"); (((CDetour*)&target)->*CDetour::Real_Target)(); printf("Calling CMember (will be detoured):\n"); target.Target(); return 0; } ================================================ FILE: ext/detours/samples/opengl/Makefile ================================================ ###################################################################### ## ## Hook test for glFinish ## !include ..\common.mak LIBS=$(LIBS) kernel32.lib gdi32.lib ############################################################################## all: dirs \ $(BIND)\ogldet$(DETOURS_BITS).dll \ $(BIND)\testogl.exe \ \ !IF $(DETOURS_SOURCE_BROWSING)==1 $(OBJD)\ogldet$(DETOURS_BITS).bsc \ $(OBJD)\testogl.bsc \ !ENDIF option ############################################################################## dirs: @if not exist $(BIND) mkdir $(BIND) && echo. Created $(BIND) @if not exist $(OBJD) mkdir $(OBJD) && echo. Created $(OBJD) $(OBJD)\ogldet.obj : ogldet.cpp $(OBJD)\ogldet.res : ogldet.rc $(BIND)\ogldet$(DETOURS_BITS).dll $(BIND)\ogldet$(DETOURS_BITS).lib: \ $(OBJD)\ogldet.obj $(OBJD)\ogldet.res $(DEPS) cl /LD $(CFLAGS) /Fe$(@R).dll /Fd$(@R).pdb \ $(OBJD)\ogldet.obj $(OBJD)\ogldet.res \ /link $(LINKFLAGS) /subsystem:console \ /export:DetourFinishHelperProcess,@1,NONAME \ /export:hookedGlFinish \ $(LIBS) opengl32.lib $(OBJD)\ogldet$(DETOURS_BITS).bsc : $(OBJD)\ogldet.obj bscmake /v /n /o $@ $(OBJD)\ogldet.sbr $(OBJD)\testogl.obj : testogl.cpp $(BIND)\testogl.exe : $(OBJD)\testogl.obj $(DEPS) cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb $(OBJD)\testogl.obj \ /link $(LINKFLAGS) $(LIBS) opengl32.lib \ /subsystem:console $(OBJD)\testogl.bsc : $(OBJD)\testogl.obj bscmake /v /n /o $@ $(OBJD)\testogl.sbr ############################################################################## clean: -del *~ 2>nul -del $(BIND)\ogldet*.* 2>nul -del $(BIND)\testogl.* 2>nul -rmdir /q /s $(OBJD) 2>nul realclean: clean -rmdir /q /s $(OBJDS) 2>nul ############################################### Install non-bit-size binaries. !IF "$(DETOURS_OPTION_PROCESSOR)" != "" $(OPTD)\olgdet$(DETOURS_OPTION_BITS).dll: $(OPTD)\olgdet$(DETOURS_OPTION_BITS).pdb: $(BIND)\olgdet$(DETOURS_OPTION_BITS).dll : $(OPTD)\olgdet$(DETOURS_OPTION_BITS).dll @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\olgdet$(DETOURS_OPTION_BITS).pdb : $(OPTD)\olgdet$(DETOURS_OPTION_BITS).pdb @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). option: \ $(BIND)\olgdet$(DETOURS_OPTION_BITS).dll \ $(BIND)\olgdet$(DETOURS_OPTION_BITS).pdb \ !ELSE option: !ENDIF ############################################################################## test: all @echo -------- Reseting test binaries to initial state. --------------------- $(BIND)\setdll.exe -r $(BIND)\testogl.exe @echo. @echo -------- Should not load ogldet$(DETOURS_BITS).dll ----------------------------------- $(BIND)\testogl.exe @echo. @echo -------- Adding ogldet$(DETOURS_BITS).dll to testogl.exe ------------------------------ $(BIND)\setdll.exe -d:$(BIND)\ogldet$(DETOURS_BITS).dll $(BIND)\testogl.exe @echo. @echo -------- Should load ogldet$(DETOURS_BITS).dll statically ---------------------------- $(BIND)\testogl.exe @echo. @echo -------- Removing ogldet$(DETOURS_BITS).dll from testogl.exe -------------------------- $(BIND)\setdll.exe -r $(BIND)\testogl.exe @echo. @echo -------- Should not load ogldet$(DETOURS_BITS).dll ----------------------------------- $(BIND)\testogl.exe @echo. @echo -------- Should load ogldet$(DETOURS_BITS).dll dynamically using withdll.exe---------- $(BIND)\withdll.exe -d:$(BIND)\ogldet$(DETOURS_BITS).dll $(BIND)\testogl.exe @echo. ################################################################# End of File. ================================================ FILE: ext/detours/samples/opengl/ogldet.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Module: ogldet.dll // // This DLL is based on the sample simple.dll. A detour is inserted for // the OpenGL glFinish function. // #include #include #include #include "detours.h" static void (WINAPI * trueGlFinish)(void) = glFinish; void WINAPI hookedGlFinish(void) { printf("ogldet" DETOURS_STRINGIFY(DETOURS_BITS) ".dll:" " hookedGlFinish Starting.\n"); fflush(stdout); trueGlFinish(); printf("ogldet" DETOURS_STRINGIFY(DETOURS_BITS) ".dll:" " hookedGlFinish done.\n"); fflush(stdout); } BOOL WINAPI DllMain(HINSTANCE hinst, DWORD dwReason, LPVOID reserved) { LONG error; (void)hinst; (void)reserved; if (DetourIsHelperProcess()) { return TRUE; } if (dwReason == DLL_PROCESS_ATTACH) { DetourRestoreAfterWith(); printf("ogldet" DETOURS_STRINGIFY(DETOURS_BITS) ".dll:" " Starting.\n"); fflush(stdout); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)trueGlFinish, hookedGlFinish); error = DetourTransactionCommit(); if (error == NO_ERROR) { printf("ogldet" DETOURS_STRINGIFY(DETOURS_BITS) ".dll:" " Detoured glFinish().\n"); } else { printf("ogldet" DETOURS_STRINGIFY(DETOURS_BITS) ".dll:" " Error detouring glFinish(): %d\n", error); } } else if (dwReason == DLL_PROCESS_DETACH) { DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourDetach(&(PVOID&)trueGlFinish, hookedGlFinish); error = DetourTransactionCommit(); printf("ogldet" DETOURS_STRINGIFY(DETOURS_BITS) ".dll:" " Removed detour glFinish() (result=%d)\n", error); fflush(stdout); } return TRUE; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/opengl/ogldet.rc ================================================ ////////////////////////////////////////////////////////////////////////////// // // Version information for ogldet.rc. // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include "detver.h" #define VER_INTERNALNAME_STR "ogldet" DETOURS_STRINGIFY(DETOURS_BITS) #define VER_ORIGINALFILENAME_STR "ogldet" DETOURS_STRINGIFY(DETOURS_BITS) ".dll" #define VER_FILEDESCRIPTION_STR "Detours Open GL Test Module" #define VER_COMPANYNAME_STR "Microsoft Corporation" #include "common.ver" ================================================ FILE: ext/detours/samples/opengl/testogl.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // File: testogl.cpp // Module: testogl.exe (oglsimple.dll) // #include #include #include int __cdecl main() { printf("testogl.exe: Starting\n"); fflush(stdout); glFinish(); printf("testogl.exe: done\n"); fflush(stdout); return 0; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/region/Makefile ================================================ ############################################################################## ## ## Makefile for Detours Test Programs. ## ## Microsoft Research Detours Package ## ## Copyright (c) Microsoft Corporation. All rights reserved. ## !include ..\common.mak LIBS=$(LIBS) kernel32.lib all: dirs \ $(BIND)\region.exe \ !IF $(DETOURS_SOURCE_BROWSING)==1 $(OBJD)\region.bsc !ENDIF clean: -del *~ 2> nul -del $(BIND)\region.* 2> nul -rmdir /q /s $(OBJD) 2>nul realclean: clean -rmdir /q /s $(OBJDS) 2>nul dirs: @if not exist $(BIND) mkdir $(BIND) && echo. Created $(BIND) @if not exist $(OBJD) mkdir $(OBJD) && echo. Created $(OBJD) $(OBJD)\region.obj : region.cpp $(BIND)\region.exe : $(OBJD)\region.obj $(DEPS) cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb $(OBJD)\region.obj \ /link $(LINKFLAGS) $(LIBS) /subsystem:console $(OBJD)\region.bsc : $(OBJD)\region.obj bscmake /v /n /o $@ $(OBJD)\region.sbr ############################################################################## test: $(BIND)\region.exe @echo. $(BIND)\region.exe @echo. ################################################################# End of File. ================================================ FILE: ext/detours/samples/region/region.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Test the different system region bounds (region.cpp of region.exe) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include #include #include ////////////////////////////////////////////////////////////////////////////// // static DWORD (WINAPI * TrueSleepEx)(DWORD dwMilliseconds, BOOL bAlertable) = SleepEx; DWORD WINAPI LoudSleepEx(DWORD dwMilliseconds, BOOL bAlertable) { DWORD dwBeg = GetTickCount(); DWORD ret = TrueSleepEx(dwMilliseconds, bAlertable); DWORD dwEnd = GetTickCount(); printf("Slept %lu ticks.\n", dwEnd - dwBeg); return ret; } ////////////////////////////////////////////////////////////////////////////// // PVOID AttachAndDetach(DWORD dwMilliseconds) { LONG error; PVOID trampoline; DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)TrueSleepEx, LoudSleepEx); error = DetourTransactionCommit(); printf("Attach: %ld, Trampoline: %p\n", error, TrueSleepEx); trampoline = TrueSleepEx; printf("\n"); printf("Sleep(%lu)\n", dwMilliseconds); Sleep(dwMilliseconds); printf("\n"); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourDetach(&(PVOID&)TrueSleepEx, LoudSleepEx); error = DetourTransactionCommit(); return trampoline; } int main(int argc, char **argv) { (void)argc; (void)argv; // First, save the default system region. PVOID pDefaultLower = DetourSetSystemRegionLowerBound(NULL); PVOID pDefaultUpper = DetourSetSystemRegionUpperBound(NULL); // Now attach the detour with the default system region. DetourSetSystemRegionLowerBound(pDefaultLower); DetourSetSystemRegionUpperBound(pDefaultUpper); printf("%p..%p: ", pDefaultLower, pDefaultUpper); PVOID pTramp1 = AttachAndDetach(10); printf("%p..%p: ", pDefaultLower, pDefaultUpper); PVOID pTramp2 = AttachAndDetach(10); // Now attach the detour with a smaller system region. PVOID pSmallerLower = (PVOID)( ((ULONG_PTR)pTramp1) & ~(ULONG_PTR)0x3fffffff ); PVOID pSmallerUpper = (PVOID)( ((ULONG_PTR)pTramp1 + 0x3fffffff) & ~(ULONG_PTR)0x3fffffff ); DetourSetSystemRegionLowerBound(pSmallerLower); DetourSetSystemRegionUpperBound(pSmallerUpper); printf("%p..%p: ", pSmallerLower, pSmallerUpper); PVOID pTramp3 = AttachAndDetach(20); printf("Sleep(30)\n"); Sleep(30); printf("\n"); if (pTramp1 != pTramp2) { printf("!!!!!! Trampoling allocation is not deterministic. %p != %p\n", pTramp1, pTramp2); return 1; } else if (pTramp2 == pTramp3) { printf("!!!!!! Trampoling allocation doesn't skip region. %p == %p\n", pTramp2, pTramp3); return 2; } return 0; } ================================================ FILE: ext/detours/samples/setdll/Makefile ================================================ ############################################################################## ## ## Makefile for Detours Test Programs. ## ## Microsoft Research Detours Package ## ## Copyright (c) Microsoft Corporation. All rights reserved. ## !include ..\common.mak LIBS=$(LIBS) kernel32.lib all: dirs \ $(BIND)\setdll.exe \ !IF $(DETOURS_SOURCE_BROWSING)==1 $(OBJD)\setdll.bsc \ !ENDIF option ############################################################################## clean: -del *~ 2>nul -del $(BIND)\setdll.* 2>nul -rmdir /q /s $(OBJD) 2>nul realclean: clean -rmdir /q /s $(OBJDS) 2>nul ############################################################################## dirs: @if not exist $(BIND) mkdir $(BIND) && echo. Created $(BIND) @if not exist $(OBJD) mkdir $(OBJD) && echo. Created $(OBJD) $(OBJD)\setdll.obj : setdll.cpp $(BIND)\setdll.exe : $(OBJD)\setdll.obj $(DEPS) cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb $(OBJD)\setdll.obj \ /link $(LINKFLAGS) $(LIBS) /subsystem:console $(OBJD)\setdll.bsc : $(OBJD)\setdll.obj bscmake /v /n /o $@ $(OBJD)\setdll.sbr ############################################### Install non-bit-size binaries. option: ############################################################################## test: all @echo -------- Reseting test binaries to initial state. ----------------------- $(BIND)\setdll.exe -d:$(BIND)\slept$(DETOURS_BITS).dll $(BIND)\sleepold.exe @echo -------- Should load slept$(DETOURS_BITS).dll statically ------------------------------- $(BIND)\sleepold.exe @echo -------- Reseting test binaries to initial state. ----------------------- $(BIND)\setdll.exe -r $(BIND)\sleepold.exe @echo -------- Should not load slept$(DETOURS_BITS).dll -------------------------------------- $(BIND)\sleepold.exe ################################################################# End of File. ================================================ FILE: ext/detours/samples/setdll/setdll.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (setdll.cpp of setdll.exe) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include #include #include #include #include #pragma warning(push) #if _MSC_VER > 1400 #pragma warning(disable:6102 6103) // /analyze warnings #endif #include #pragma warning(pop) ////////////////////////////////////////////////////////////// Error Messages. // VOID AssertMessage(PCSTR szMsg, PCSTR szFile, DWORD nLine) { printf("ASSERT(%s) failed in %s, line %ld.", szMsg, szFile, nLine); } #define ASSERT(x) \ do { if (!(x)) { AssertMessage(#x, __FILE__, __LINE__); DebugBreak(); }} while (0) ; ////////////////////////////////////////////////////////////////////////////// // static BOOLEAN s_fRemove = FALSE; static CHAR s_szDllPath[MAX_PATH] = ""; ////////////////////////////////////////////////////////////////////////////// // // This code verifies that the named DLL has been configured correctly // to be imported into the target process. DLLs must export a function with // ordinal #1 so that the import table touch-up magic works. // static BOOL CALLBACK ExportCallback(_In_opt_ PVOID pContext, _In_ ULONG nOrdinal, _In_opt_ LPCSTR pszName, _In_opt_ PVOID pCode) { (void)pContext; (void)pCode; (void)pszName; if (nOrdinal == 1) { *((BOOL *)pContext) = TRUE; } return TRUE; } BOOL DoesDllExportOrdinal1(PCHAR pszDllPath) { HMODULE hDll = LoadLibraryExA(pszDllPath, NULL, DONT_RESOLVE_DLL_REFERENCES); if (hDll == NULL) { printf("setdll.exe: LoadLibraryEx(%s) failed with error %ld.\n", pszDllPath, GetLastError()); return FALSE; } BOOL validFlag = FALSE; DetourEnumerateExports(hDll, &validFlag, ExportCallback); FreeLibrary(hDll); return validFlag; } ////////////////////////////////////////////////////////////////////////////// // static BOOL CALLBACK ListBywayCallback(_In_opt_ PVOID pContext, _In_opt_ LPCSTR pszFile, _Outptr_result_maybenull_ LPCSTR *ppszOutFile) { (void)pContext; *ppszOutFile = pszFile; if (pszFile) { printf(" %s\n", pszFile); } return TRUE; } static BOOL CALLBACK ListFileCallback(_In_opt_ PVOID pContext, _In_ LPCSTR pszOrigFile, _In_ LPCSTR pszFile, _Outptr_result_maybenull_ LPCSTR *ppszOutFile) { (void)pContext; *ppszOutFile = pszFile; printf(" %s -> %s\n", pszOrigFile, pszFile); return TRUE; } static BOOL CALLBACK AddBywayCallback(_In_opt_ PVOID pContext, _In_opt_ LPCSTR pszFile, _Outptr_result_maybenull_ LPCSTR *ppszOutFile) { PBOOL pbAddedDll = (PBOOL)pContext; if (!pszFile && !*pbAddedDll) { // Add new byway. *pbAddedDll = TRUE; *ppszOutFile = s_szDllPath; } return TRUE; } BOOL SetFile(PCHAR pszPath) { BOOL bGood = TRUE; HANDLE hOld = INVALID_HANDLE_VALUE; HANDLE hNew = INVALID_HANDLE_VALUE; PDETOUR_BINARY pBinary = NULL; CHAR szOrg[MAX_PATH]; CHAR szNew[MAX_PATH]; CHAR szOld[MAX_PATH]; szOld[0] = '\0'; szNew[0] = '\0'; StringCchCopyA(szOrg, sizeof(szOrg), pszPath); StringCchCopyA(szNew, sizeof(szNew), szOrg); StringCchCatA(szNew, sizeof(szNew), "#"); StringCchCopyA(szOld, sizeof(szOld), szOrg); StringCchCatA(szOld, sizeof(szOld), "~"); printf(" %s:\n", pszPath); hOld = CreateFileA(szOrg, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (hOld == INVALID_HANDLE_VALUE) { printf("Couldn't open input file: %s, error: %ld\n", szOrg, GetLastError()); bGood = FALSE; goto end; } hNew = CreateFileA(szNew, GENERIC_WRITE | GENERIC_READ, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL); if (hNew == INVALID_HANDLE_VALUE) { printf("Couldn't open output file: %s, error: %ld\n", szNew, GetLastError()); bGood = FALSE; goto end; } if ((pBinary = DetourBinaryOpen(hOld)) == NULL) { printf("DetourBinaryOpen failed: %ld\n", GetLastError()); goto end; } if (hOld != INVALID_HANDLE_VALUE) { CloseHandle(hOld); hOld = INVALID_HANDLE_VALUE; } { BOOL bAddedDll = FALSE; DetourBinaryResetImports(pBinary); if (!s_fRemove) { if (!DetourBinaryEditImports(pBinary, &bAddedDll, AddBywayCallback, NULL, NULL, NULL)) { printf("DetourBinaryEditImports failed: %ld\n", GetLastError()); } } if (!DetourBinaryEditImports(pBinary, NULL, ListBywayCallback, ListFileCallback, NULL, NULL)) { printf("DetourBinaryEditImports failed: %ld\n", GetLastError()); } if (!DetourBinaryWrite(pBinary, hNew)) { printf("DetourBinaryWrite failed: %ld\n", GetLastError()); bGood = FALSE; } DetourBinaryClose(pBinary); pBinary = NULL; if (hNew != INVALID_HANDLE_VALUE) { CloseHandle(hNew); hNew = INVALID_HANDLE_VALUE; } if (bGood) { if (!DeleteFileA(szOld)) { DWORD dwError = GetLastError(); if (dwError != ERROR_FILE_NOT_FOUND) { printf("Warning: Couldn't delete %s: %ld\n", szOld, dwError); bGood = FALSE; } } if (!MoveFileA(szOrg, szOld)) { printf("Error: Couldn't back up %s to %s: %ld\n", szOrg, szOld, GetLastError()); bGood = FALSE; } if (!MoveFileA(szNew, szOrg)) { printf("Error: Couldn't install %s as %s: %ld\n", szNew, szOrg, GetLastError()); bGood = FALSE; } } DeleteFileA(szNew); } end: if (pBinary) { DetourBinaryClose(pBinary); pBinary = NULL; } if (hNew != INVALID_HANDLE_VALUE) { CloseHandle(hNew); hNew = INVALID_HANDLE_VALUE; } if (hOld != INVALID_HANDLE_VALUE) { CloseHandle(hOld); hOld = INVALID_HANDLE_VALUE; } return bGood; } ////////////////////////////////////////////////////////////////////////////// // void PrintUsage(void) { printf("Usage:\n" " setdll [options] binary_files\n" "Options:\n" " /d:file.dll : Add file.dll binary files\n" " /r : Remove extra DLLs from binary files\n" " /? : This help screen.\n"); } //////////////////////////////////////////////////////////////////////// main. // int CDECL main(int argc, char **argv) { BOOL fNeedHelp = FALSE; PCHAR pszFilePart = NULL; int arg = 1; for (; arg < argc; arg++) { if (argv[arg][0] == '-' || argv[arg][0] == '/') { CHAR *argn = argv[arg] + 1; CHAR *argp = argn; while (*argp && *argp != ':' && *argp != '=') argp++; if (*argp == ':' || *argp == '=') *argp++ = '\0'; switch (argn[0]) { case 'd': // Set DLL case 'D': if ((strchr(argp, ':') != NULL || strchr(argp, '\\') != NULL) && GetFullPathNameA(argp, sizeof(s_szDllPath), s_szDllPath, &pszFilePart)) { } else { StringCchPrintfA(s_szDllPath, sizeof(s_szDllPath), "%s", argp); } break; case 'r': // Remove extra set DLLs. case 'R': s_fRemove = TRUE; break; case '?': // Help fNeedHelp = TRUE; break; default: fNeedHelp = TRUE; printf("Bad argument: %s:%s\n", argn, argp); break; } } } if (argc == 1) { fNeedHelp = TRUE; } if (!s_fRemove && s_szDllPath[0] == 0) { fNeedHelp = TRUE; } if (fNeedHelp) { PrintUsage(); return 1; } if (s_fRemove) { printf("Removing extra DLLs from binary files.\n"); } else { if (!DoesDllExportOrdinal1(s_szDllPath)) { printf("Error: %hs does not export function with ordinal #1.\n", s_szDllPath); return 2; } printf("Adding %hs to binary files.\n", s_szDllPath); } for (arg = 1; arg < argc; arg++) { if (argv[arg][0] != '-' && argv[arg][0] != '/') { SetFile(argv[arg]); } } return 0; } // End of File ================================================ FILE: ext/detours/samples/simple/Makefile ================================================ ############################################################################## ## ## API Extention to Measure time slept. ## ## Microsoft Research Detours Package ## ## Copyright (c) Microsoft Corporation. All rights reserved. ## !include ..\common.mak LIBS=$(LIBS) kernel32.lib ############################################################################## all: dirs \ $(BIND)\simple$(DETOURS_BITS).dll \ $(BIND)\sleep5.exe \ \ !IF $(DETOURS_SOURCE_BROWSING)==1 $(OBJD)\simple$(DETOURS_BITS).bsc \ $(OBJD)\sleep5.bsc \ !ENDIF option ############################################################################## dirs: @if not exist $(BIND) mkdir $(BIND) && echo. Created $(BIND) @if not exist $(OBJD) mkdir $(OBJD) && echo. Created $(OBJD) $(OBJD)\simple.obj : simple.cpp $(OBJD)\simple.res : simple.rc $(BIND)\simple$(DETOURS_BITS).dll $(BIND)\simple$(DETOURS_BITS).lib: \ $(OBJD)\simple.obj $(OBJD)\simple.res $(DEPS) cl /LD $(CFLAGS) /Fe$(@R).dll /Fd$(@R).pdb \ $(OBJD)\simple.obj $(OBJD)\simple.res \ /link $(LINKFLAGS) /subsystem:console \ /export:DetourFinishHelperProcess,@1,NONAME \ /export:TimedSleepEx \ $(LIBS) $(OBJD)\simple$(DETOURS_BITS).bsc : $(OBJD)\simple.obj bscmake /v /n /o $@ $(OBJD)\simple.sbr $(OBJD)\sleep5.obj : sleep5.cpp $(BIND)\sleep5.exe : $(OBJD)\sleep5.obj $(DEPS) cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb $(OBJD)\sleep5.obj \ /link $(LINKFLAGS) $(LIBS) \ /subsystem:console $(OBJD)\sleep5.bsc : $(OBJD)\sleep5.obj bscmake /v /n /o $@ $(OBJD)\sleep5.sbr ############################################################################## clean: -del *~ 2>nul -del $(BIND)\simple*.* 2>nul -del $(BIND)\sleep5.* 2>nul -rmdir /q /s $(OBJD) 2>nul realclean: clean -rmdir /q /s $(OBJDS) 2>nul ############################################### Install non-bit-size binaries. !IF "$(DETOURS_OPTION_PROCESSOR)" != "" $(OPTD)\simple$(DETOURS_OPTION_BITS).dll: $(OPTD)\simple$(DETOURS_OPTION_BITS).pdb: $(BIND)\simple$(DETOURS_OPTION_BITS).dll : $(OPTD)\simple$(DETOURS_OPTION_BITS).dll @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\simple$(DETOURS_OPTION_BITS).pdb : $(OPTD)\simple$(DETOURS_OPTION_BITS).pdb @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). option: \ $(BIND)\simple$(DETOURS_OPTION_BITS).dll \ $(BIND)\simple$(DETOURS_OPTION_BITS).pdb \ !ELSE option: !ENDIF ############################################################################## test: all @echo -------- Reseting test binaries to initial state. --------------------- $(BIND)\setdll.exe -r $(BIND)\sleep5.exe @echo. @echo -------- Should not load simple$(DETOURS_BITS).dll ----------------------------------- $(BIND)\sleep5.exe @echo. @echo -------- Adding simple$(DETOURS_BITS).dll to sleep5.exe ------------------------------ $(BIND)\setdll.exe -d:$(BIND)\simple$(DETOURS_BITS).dll $(BIND)\sleep5.exe @echo. @echo -------- Should load simple$(DETOURS_BITS).dll statically ---------------------------- $(BIND)\sleep5.exe @echo. @echo -------- Removing simple$(DETOURS_BITS).dll from sleep5.exe -------------------------- $(BIND)\setdll.exe -r $(BIND)\sleep5.exe @echo. @echo -------- Should not load simple$(DETOURS_BITS).dll ----------------------------------- $(BIND)\sleep5.exe @echo. @echo -------- Should load simple$(DETOURS_BITS).dll dynamically using withdll.exe---------- $(BIND)\withdll.exe -d:$(BIND)\simple$(DETOURS_BITS).dll $(BIND)\sleep5.exe @echo. debug: all windbg -o $(BIND)\withdll.exe -d:$(BIND)\simple$(DETOURS_BITS).dll $(BIND)\sleep5.exe ################################################################# End of File. ================================================ FILE: ext/detours/samples/simple/simple.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (simple.cpp of simple.dll) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // // This DLL will detour the Windows SleepEx API so that TimedSleep function // gets called instead. TimedSleepEx records the before and after times, and // calls the real SleepEx API through the TrueSleepEx function pointer. // #include #include #include "detours.h" static LONG dwSlept = 0; static DWORD (WINAPI * TrueSleepEx)(DWORD dwMilliseconds, BOOL bAlertable) = SleepEx; DWORD WINAPI TimedSleepEx(DWORD dwMilliseconds, BOOL bAlertable) { DWORD dwBeg = GetTickCount(); DWORD ret = TrueSleepEx(dwMilliseconds, bAlertable); DWORD dwEnd = GetTickCount(); InterlockedExchangeAdd(&dwSlept, dwEnd - dwBeg); return ret; } BOOL WINAPI DllMain(HINSTANCE hinst, DWORD dwReason, LPVOID reserved) { LONG error; (void)hinst; (void)reserved; if (DetourIsHelperProcess()) { return TRUE; } if (dwReason == DLL_PROCESS_ATTACH) { DetourRestoreAfterWith(); printf("simple" DETOURS_STRINGIFY(DETOURS_BITS) ".dll:" " Starting.\n"); fflush(stdout); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)TrueSleepEx, TimedSleepEx); error = DetourTransactionCommit(); if (error == NO_ERROR) { printf("simple" DETOURS_STRINGIFY(DETOURS_BITS) ".dll:" " Detoured SleepEx().\n"); } else { printf("simple" DETOURS_STRINGIFY(DETOURS_BITS) ".dll:" " Error detouring SleepEx(): %ld\n", error); } } else if (dwReason == DLL_PROCESS_DETACH) { DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourDetach(&(PVOID&)TrueSleepEx, TimedSleepEx); error = DetourTransactionCommit(); printf("simple" DETOURS_STRINGIFY(DETOURS_BITS) ".dll:" " Removed SleepEx() (result=%ld), slept %ld ticks.\n", error, dwSlept); fflush(stdout); } return TRUE; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/simple/simple.rc ================================================ ////////////////////////////////////////////////////////////////////////////// // // Version information for simple.rc. // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include "detver.h" #define VER_INTERNALNAME_STR "simple" DETOURS_STRINGIFY(DETOURS_BITS) #define VER_ORIGINALFILENAME_STR "simple" DETOURS_STRINGIFY(DETOURS_BITS) ".dll" #define VER_FILEDESCRIPTION_STR "Detours Test Module" #define VER_COMPANYNAME_STR "Microsoft Corporation" #include "common.ver" ================================================ FILE: ext/detours/samples/simple/sleep5.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (sleep5.cpp of sleep5.exe) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include #include #include int __cdecl main(int argc, char ** argv) { if (argc == 2) { Sleep(atoi(argv[1]) * 1000); } else { printf("sleep5.exe: Starting.\n"); Sleep(5000); printf("sleep5.exe: Done sleeping.\n"); } return 0; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/slept/Makefile ================================================ ############################################################################## ## ## API Extension to Measure time slept. ## ## Microsoft Research Detours Package ## ## Copyright (c) Microsoft Corporation. All rights reserved. ## !include ..\common.mak CFLAGS = $(CFLAGS:/Od=/O2) LIBS=$(LIBS) kernel32.lib ############################################################################## all: dirs \ $(BIND)\slept$(DETOURS_BITS).dll \ $(BIND)\dslept$(DETOURS_BITS).dll \ $(BIND)\sleepold.exe \ $(BIND)\sleepnew.exe \ $(BIND)\sleepbed.exe \ \ !IF $(DETOURS_SOURCE_BROWSING)==1 $(OBJD)\slept$(DETOURS_BITS).bsc \ $(OBJD)\dslept$(DETOURS_BITS).bsc \ $(OBJD)\sleepold.bsc \ $(OBJD)\sleepnew.bsc \ $(OBJD)\sleepbed.bsc \ !ENDIF option ############################################################################## dirs: @if not exist $(BIND) mkdir $(BIND) && echo. Created $(BIND) @if not exist $(OBJD) mkdir $(OBJD) && echo. Created $(OBJD) $(OBJD)\slept.obj : slept.cpp verify.cpp $(OBJD)\slept.res : slept.rc $(BIND)\slept$(DETOURS_BITS).dll $(BIND)\slept$(DETOURS_BITS).lib: \ $(OBJD)\slept.obj $(OBJD)\slept.res $(DEPS) cl /LD $(CFLAGS) /Fe$(@R).dll /Fd$(@R).pdb \ $(OBJD)\slept.obj $(OBJD)\slept.res\ /link $(LINKFLAGS) /subsystem:console \ /export:DetourFinishHelperProcess,@1,NONAME \ /export:TimedSleepEx \ /export:UntimedSleepEx \ /export:GetSleptTicks \ /export:TestTicks \ /export:TestTicksEx \ $(LIBS) $(OBJD)\slept$(DETOURS_BITS).bsc : $(OBJD)\slept.obj bscmake /v /n /o $@ $(OBJD)\slept.sbr $(OBJD)\dslept.obj : dslept.cpp verify.cpp $(OBJD)\dslept.res : dslept.rc $(BIND)\dslept$(DETOURS_BITS).dll $(BIND)\dslept$(DETOURS_BITS).lib: \ $(OBJD)\dslept.obj $(OBJD)\dslept.res $(DEPS) cl /LD $(CFLAGS) /Fe$(@R).dll /Fd$(@R).pdb \ $(OBJD)\dslept.obj $(OBJD)\dslept.res \ /link $(LINKFLAGS) /subsystem:console \ /export:DetourFinishHelperProcess,@1,NONAME \ /export:TimedSleepEx \ /export:UntimedSleepEx \ /export:GetSleptTicks \ $(LIBS) $(OBJD)\dslept$(DETOURS_BITS).bsc : $(OBJD)\dslept.obj bscmake /v /n /o $@ $(OBJD)\dslept.sbr $(OBJD)\sleepold.obj : sleepold.cpp verify.cpp $(BIND)\sleepold.exe : $(OBJD)\sleepold.obj $(DEPS) cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb $(OBJD)\sleepold.obj \ /link $(LINKFLAGS) $(LIBS) \ /subsystem:console /fixed:no $(OBJD)\sleepold.bsc : $(OBJD)\sleepold.obj bscmake /v /n /o $@ $(OBJD)\sleepold.sbr $(OBJD)\sleepnew.obj : sleepnew.cpp verify.cpp $(BIND)\sleepnew.exe : $(OBJD)\sleepnew.obj $(BIND)\slept$(DETOURS_BITS).lib $(DEPS) cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb $(OBJD)\sleepnew.obj \ /link $(LINKFLAGS) $(LIBS) \ /subsystem:console /fixed:no $(BIND)\slept$(DETOURS_BITS).lib $(OBJD)\sleepnew.bsc : $(OBJD)\sleepnew.obj bscmake /v /n /o $@ $(OBJD)\sleepnew.sbr $(OBJD)\sleepbed.obj : sleepbed.cpp verify.cpp $(BIND)\sleepbed.exe : $(OBJD)\sleepbed.obj $(DEPS) cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb $(OBJD)\sleepbed.obj \ /link $(LINKFLAGS) $(LIBS) \ /subsystem:console /fixed:no $(OBJD)\sleepbed.bsc : $(OBJD)\sleepbed.obj bscmake /v /n /o $@ $(OBJD)\sleepbed.sbr ############################################################################## clean: -del *~ 2>nul -del $(BIND)\slept*.* 2>nul -del $(BIND)\dslept*.* 2>nul -del $(BIND)\sleepold.* 2>nul -del $(BIND)\sleepnew.* 2>nul -del $(BIND)\sleepbed.* 2>nul -rmdir /q /s $(OBJD) 2>nul realclean: clean -rmdir /q /s $(OBJDS) 2>nul ############################################### Install non-bit-size binaries. !IF "$(DETOURS_OPTION_PROCESSOR)" != "" $(OPTD)\slept$(DETOURS_OPTION_BITS).dll: $(OPTD)\slept$(DETOURS_OPTION_BITS).pdb: $(OPTD)\dslept$(DETOURS_OPTION_BITS).dll: $(OPTD)\dslept$(DETOURS_OPTION_BITS).pdb: $(BIND)\slept$(DETOURS_OPTION_BITS).dll: $(OPTD)\slept$(DETOURS_OPTION_BITS).dll @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\slept$(DETOURS_OPTION_BITS).pdb: $(OPTD)\slept$(DETOURS_OPTION_BITS).pdb @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\dslept$(DETOURS_OPTION_BITS).dll: $(OPTD)\dslept$(DETOURS_OPTION_BITS).dll @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\dslept$(DETOURS_OPTION_BITS).pdb: $(OPTD)\dslept$(DETOURS_OPTION_BITS).pdb @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). option: \ $(BIND)\slept$(DETOURS_OPTION_BITS).dll \ $(BIND)\slept$(DETOURS_OPTION_BITS).pdb \ $(BIND)\dslept$(DETOURS_OPTION_BITS).dll \ $(BIND)\dslept$(DETOURS_OPTION_BITS).pdb \ !ELSE option: !ENDIF ############################################################################## skype: all start windbg -G -o $(BIND)\withdll.exe -d:$(BIND)\slept$(DETOURS_BITS).dll "C:\Program Files (x86)\Skype\Phone\Skype.exe" test: all @echo -------- Reseting test binaries to initial state. ----------------------- $(BIND)\setdll.exe -r $(BIND)\sleepold.exe @echo. @echo -------- Should load detour self ---------------------------------------- $(BIND)\sleepbed.exe @echo. @echo -------- Should load slept$(DETOURS_BITS).dll statically ------------------------------- $(BIND)\sleepnew.exe @echo. @echo -------- Should not load slept$(DETOURS_BITS).dll -------------------------------------- $(BIND)\sleepold.exe @echo. @echo -------- Adding slept$(DETOURS_BITS).dll to sleepold.exe ------------------------------- $(BIND)\setdll.exe -d:$(BIND)\slept$(DETOURS_BITS).dll $(BIND)\sleepold.exe @echo. @echo -------- Should load slept$(DETOURS_BITS).dll statically ------------------------------- $(BIND)\sleepold.exe @echo. @echo -------- Replacing slept$(DETOURS_BITS).dll with dslept$(DETOURS_BITS).dll in sleepold.exe ------------ $(BIND)\setdll.exe -r $(BIND)\sleepold.exe $(BIND)\setdll.exe -d:$(BIND)\dslept$(DETOURS_BITS).dll $(BIND)\sleepold.exe @echo. @echo -------- Should load dslept$(DETOURS_BITS).dll instead of slept$(DETOURS_BITS).dll -------------------- $(BIND)\sleepold.exe @echo. @echo -------- Removing dslept$(DETOURS_BITS).dll from sleepold.exe -------------------------- $(BIND)\setdll.exe -r $(BIND)\sleepold.exe @echo. @echo -------- Should not load dslept$(DETOURS_BITS).dll or slept$(DETOURS_BITS).dll ------------------------ $(BIND)\sleepold.exe @echo. @echo -------- Should load slept$(DETOURS_BITS).dll dynamically using withdll.exe ------------ $(BIND)\withdll.exe -d:$(BIND)\slept$(DETOURS_BITS).dll $(BIND)\sleepold.exe @echo. @echo -------- Test completed. ------------------------------------------------ ################################################################# End of File. ================================================ FILE: ext/detours/samples/slept/NORMAL_IA64.TXT ================================================ -------- Reseting test binaries to initial state. ----------------------- ..\..\bin.IA64\setdll.exe -r ..\..\bin.IA64\sleepold.exe Removing extra DLLs from binary files. ..\..\bin.IA64\sleepold.exe: KERNEL32.dll -> KERNEL32.dll -------- Should load detour self ---------------------------------------- ..\..\bin.IA64\sleepbed.exe sleepbed.exe: Starting. sleepbed.exe: ExeEntry=000000013F702DD0, DllEntry=0000000000000000 SleepEx = 0000000077898980 [0000000077845300] 0000000077898980: 08181d0a 80054002 04004240 0400c400 0000000077898990: 11300142 00215002 80004200 00000020 00000000778989A0: 13000000 01000000 00001000 80a50050 sleepbed.exe: Detoured SleepEx(). sleepbed.exe: After detour. SleepEx = 0000000077898980 [0000000077845300] 0000000077898980: 05000000 0100bfff ffff7f00 b879ffc8 [0000000037890330] 0000000077898990: 11300142 00215002 80004200 00000020 00000000778989A0: 13000000 01000000 00001000 80a50050 sleepbed.exe: Calling Sleep for 1 second. sleepbed.exe: Calling SleepEx for 1 second. sleepbed.exe: Calling Sleep again for 1 second. sleepbed.exe: Calling TimedSleepEx for 1 second. sleepbed.exe: Calling UntimedSleepEx for 1 second. sleepbed.exe: Done sleeping. sleepbed.exe: Removed SleepEx() detour (0), slept 2000 ticks. sleepbed.exe: GetSleptTicks() = 2000 -------- Should load slept64.dll statically ------------------------------- ..\..\bin.IA64\sleepnew.exe slept64.dll: Starting. slept64.dll: ExeEntry=000000013F18CA50, DllEntry=000006FAEE9F6D80 SleepEx = 0000000077898980 [0000000077845300] 0000000077898980: 08181d0a 80054002 04004240 0400c400 0000000077898990: 11300142 00215002 80004200 00000020 00000000778989A0: 13000000 01000000 00001000 80a50050 sleepnew.exe: Starting. SleepEx = 0000000077898980 [0000000077845300] 0000000077898980: 05000000 0100bfff ffff7f00 b879ffc8 [0000000037890330] 0000000077898990: 11300142 00215002 80004200 00000020 00000000778989A0: 13000000 01000000 00001000 80a50050 sleepnew.exe: Calling Sleep for 1 second. sleepnew.exe: Calling SleepEx for 1 second. sleepnew.exe: Calling Sleep again for 1 second. sleepnew.exe: Calling TimedSleep for 1 second. sleepnew.exe: Calling UntimedSleep for 1 second. sleepnew.exe: Done sleeping. sleepnew.exe: GetSleptTicks() = 2000 slept64.dll: Detoured SleepEx(). slept64.dll: Removed SleepEx() detour (0), slept 2000 ticks. -------- Should not load slept64.dll -------------------------------------- ..\..\bin.IA64\sleepold.exe sleepold.exe: Starting (at 000000013F80C288). SleepEx = 0000000077898980 [0000000077845300] 0000000077898980: 08181d0a 80054002 04004240 0400c400 0000000077898990: 11300142 00215002 80004200 00000020 00000000778989A0: 13000000 01000000 00001000 80a50050 sleepold.exe: Calling Sleep for 1 second. sleepold.exe: Calling SleepEx for 1 second. sleepold.exe: Calling Sleep again for 1 second. sleepold.exe: Done sleeping. -------- Adding slept64.dll to sleepold.exe ------------------------------- ..\..\bin.IA64\setdll.exe -d:..\..\bin.IA64\slept64.dll ..\..\bin.IA64\sleepold.exe Adding c:\Code\Detours\bin.IA64\slept64.dll to binary files. ..\..\bin.IA64\sleepold.exe: c:\Code\Detours\bin.IA64\slept64.dll KERNEL32.dll -> KERNEL32.dll -------- Should load slept64.dll statically ------------------------------- ..\..\bin.IA64\sleepold.exe slept64.dll: Starting. slept64.dll: ExeEntry=000000013F4FCAB0, DllEntry=000006FAEE9F6D80 SleepEx = 0000000077898980 [0000000077845300] 0000000077898980: 08181d0a 80054002 04004240 0400c400 0000000077898990: 11300142 00215002 80004200 00000020 00000000778989A0: 13000000 01000000 00001000 80a50050 sleepold.exe: Starting (at 000000013F4FC288). SleepEx = 0000000077898980 [0000000077845300] 0000000077898980: 05000000 0100bfff ffff7f00 b879ffc8 [0000000037890330] 0000000077898990: 11300142 00215002 80004200 00000020 00000000778989A0: 13000000 01000000 00001000 80a50050 sleepold.exe: Calling Sleep for 1 second. sleepold.exe: Calling SleepEx for 1 second. sleepold.exe: Calling Sleep again for 1 second. sleepold.exe: Done sleeping. slept64.dll: Detoured SleepEx(). slept64.dll: Removed SleepEx() detour (0), slept 1000 ticks. -------- Replacing slept64.dll with dslept64.dll in sleepold.exe ------------ ..\..\bin.IA64\setdll.exe -r ..\..\bin.IA64\sleepold.exe Removing extra DLLs from binary files. ..\..\bin.IA64\sleepold.exe: KERNEL32.dll -> KERNEL32.dll ..\..\bin.IA64\setdll.exe -d:..\..\bin.IA64\dslept64.dll ..\..\bin.IA64\sleepold.exe Adding c:\Code\Detours\bin.IA64\dslept64.dll to binary files. ..\..\bin.IA64\sleepold.exe: c:\Code\Detours\bin.IA64\dslept64.dll KERNEL32.dll -> KERNEL32.dll -------- Should load dslept64.dll instead of slept64.dll -------------------- ..\..\bin.IA64\sleepold.exe dslept64.dll: Starting. SleepEx = 0000000077898980 [0000000077845300] 0000000077898980: 08181d0a 80054002 04004240 0400c400 0000000077898990: 11300142 00215002 80004200 00000020 00000000778989A0: 13000000 01000000 00001000 80a50050 EntryPoint = 000000013F12D580 [000000013F16CAB0] 000000013F12D580: 01080d06 80050002 00620040 04080084 000000013F12D590: 13000000 01000000 00001000 90eb0050 000000013F12D5A0: 13080044 00210000 00001000 c0fcff58 EntryPoint after attach = 000000013F12D580 [000000013F16CAB0] 000000013F12D580: 05000000 0100bfff ffff7f00 b82dffc8 [00000000FF120330] 000000013F12D590: 13000000 01000000 00001000 90eb0050 000000013F12D5A0: 13080044 00210000 00001000 c0fcff58 EntryPoint trampoline = 00000000FF120300 [00000000FF1203B0] 00000000FF120300: 05000000 01003f01 00000020 00f00267 00000000FF120310: 01080d06 80050002 00620040 04080084 00000000FF120320: 05000000 01004000 00000000 78d200c0 [000000013F12D590] dslept64.dll: Detoured EntryPoint(). dslept64.dll: Detoured SleepEx(). SleepEx = 0000000077898980 [0000000077845300] 0000000077898980: 05000000 0100bfff ffff7f00 b879ffc8 [0000000037890330] 0000000077898990: 11300142 00215002 80004200 00000020 00000000778989A0: 13000000 01000000 00001000 80a50050 dslept64.dll: Calling EntryPoint sleepold.exe: Starting (at 000000013F16C288). SleepEx = 0000000077898980 [0000000077845300] 0000000077898980: 05000000 0100bfff ffff7f00 b879ffc8 [0000000037890330] 0000000077898990: 11300142 00215002 80004200 00000020 00000000778989A0: 13000000 01000000 00001000 80a50050 sleepold.exe: Calling Sleep for 1 second. sleepold.exe: Calling SleepEx for 1 second. sleepold.exe: Calling Sleep again for 1 second. sleepold.exe: Done sleeping. dslept64.dll: Removed Sleep() detours (0), slept 1000 ticks. -------- Removing dslept64.dll from sleepold.exe -------------------------- ..\..\bin.IA64\setdll.exe -r ..\..\bin.IA64\sleepold.exe Removing extra DLLs from binary files. ..\..\bin.IA64\sleepold.exe: KERNEL32.dll -> KERNEL32.dll -------- Should not load dslept64.dll or slept64.dll ------------------------ ..\..\bin.IA64\sleepold.exe sleepold.exe: Starting (at 000000013FCEC288). SleepEx = 0000000077898980 [0000000077845300] 0000000077898980: 08181d0a 80054002 04004240 0400c400 0000000077898990: 11300142 00215002 80004200 00000020 00000000778989A0: 13000000 01000000 00001000 80a50050 sleepold.exe: Calling Sleep for 1 second. sleepold.exe: Calling SleepEx for 1 second. sleepold.exe: Calling Sleep again for 1 second. sleepold.exe: Done sleeping. -------- Should load slept64.dll dynamically using withdll.exe ------------ ..\..\bin.IA64\withdll.exe -d:..\..\bin.IA64\slept64.dll ..\..\bin.IA64\sleepold.exe withdll.exe: Starting: `..\..\bin.IA64\sleepold.exe' withdll.exe: with `c:\Code\Detours\bin.IA64\slept64.dll' slept64.dll: Starting. slept64.dll: ExeEntry=000000013FBFCAB0, DllEntry=000006FAEE9F6D80 SleepEx = 0000000077898980 [0000000077845300] 0000000077898980: 08181d0a 80054002 04004240 0400c400 0000000077898990: 11300142 00215002 80004200 00000020 00000000778989A0: 13000000 01000000 00001000 80a50050 sleepold.exe: Starting (at 000000013FBFC288). SleepEx = 0000000077898980 [0000000077845300] 0000000077898980: 05000000 0100bfff ffff7f00 b879ffc8 [0000000037890330] 0000000077898990: 11300142 00215002 80004200 00000020 00000000778989A0: 13000000 01000000 00001000 80a50050 sleepold.exe: Calling Sleep for 1 second. sleepold.exe: Calling SleepEx for 1 second. sleepold.exe: Calling Sleep again for 1 second. sleepold.exe: Done sleeping. slept64.dll: Detoured SleepEx(). slept64.dll: Removed SleepEx() detour (0), slept 1030 ticks. -------- Test completed. ------------------------------------------------ ================================================ FILE: ext/detours/samples/slept/NORMAL_X64.TXT ================================================ -------- Reseting test binaries to initial state. ----------------------- ..\..\bin.X64\setdll.exe -r ..\..\bin.X64\sleepold.exe Removing extra DLLs from binary files. ..\..\bin.X64\sleepold.exe: KERNEL32.dll -> KERNEL32.dll -------- Should load detour self ---------------------------------------- ..\..\bin.X64\sleepbed.exe sleepbed.exe: Starting. sleepbed.exe: ExeEntry=000000013FE863E0, DllEntry=000000013FE9E610 SleepEx = 000007FEFD541150 [0000000076912B60] 000007FEFD541150: 4c8bdc 000007FEFD541153: 49895b08 000007FEFD541157: 89542410 sleepbed.exe: Detoured SleepEx(). sleepbed.exe: After detour. SleepEx = 000007FEFD541150 [0000000076912B60] 000007FEFD541150: e923f0ff bf [000007FEBD540178] 000007FEFD541155: cc [FFFFFFFFFFFFFFFF] 000007FEFD541156: cc [FFFFFFFFFFFFFFFF] sleepbed.exe: Calling Sleep for 1 second. sleepbed.exe: Calling SleepEx for 1 second. sleepbed.exe: Calling Sleep again for 1 second. sleepbed.exe: Calling TimedSleepEx for 1 second. sleepbed.exe: Calling UntimedSleepEx for 1 second. sleepbed.exe: Done sleeping. sleepbed.exe: Removed SleepEx() detour (0), slept 4056 ticks. sleepbed.exe: GetSleptTicks() = 4056 -------- Should load slept64.dll statically ------------------------------- ..\..\bin.X64\sleepnew.exe slept64.dll: Starting. slept64.dll: ExeEntry=000000013F56484C, DllEntry=000007FEF2E78B74 SleepEx = 000007FEFD541150 [0000000076912B60] 000007FEFD541150: 4c8bdc 000007FEFD541153: 49895b08 000007FEFD541157: 89542410 sleepnew.exe: Starting. SleepEx = 000007FEFD541150 [0000000076912B60] 000007FEFD541150: e923f0ff bf [000007FEBD540178] 000007FEFD541155: cc [FFFFFFFFFFFFFFFF] 000007FEFD541156: cc [FFFFFFFFFFFFFFFF] sleepnew.exe: Calling Sleep for 1 second. sleepnew.exe: Calling SleepEx for 1 second. sleepnew.exe: Calling Sleep again for 1 second. sleepnew.exe: Calling TimedSleep for 1 second. sleepnew.exe: Calling UntimedSleep for 1 second. sleepnew.exe: Done sleeping. sleepnew.exe: GetSleptTicks() = 4056 slept64.dll: Detoured SleepEx(). slept64.dll: Removed SleepEx() detour (0), slept 4056 ticks. -------- Should not load slept64.dll -------------------------------------- ..\..\bin.X64\sleepold.exe sleepold.exe: Starting (at 000000013FEF1350). SleepEx = 000007FEFD541150 [0000000076912B60] 000007FEFD541150: 4c8bdc 000007FEFD541153: 49895b08 000007FEFD541157: 89542410 sleepold.exe: Calling Sleep for 1 second. sleepold.exe: Calling SleepEx for 1 second. sleepold.exe: Calling Sleep again for 1 second. sleepold.exe: Done sleeping. -------- Adding slept64.dll to sleepold.exe ------------------------------- ..\..\bin.X64\setdll.exe -d:..\..\bin.X64\slept64.dll ..\..\bin.X64\sleepold.exe Adding c:\Code\detours\bin.X64\slept64.dll to binary files. ..\..\bin.X64\sleepold.exe: c:\Code\detours\bin.X64\slept64.dll KERNEL32.dll -> KERNEL32.dll -------- Should load slept64.dll statically ------------------------------- ..\..\bin.X64\sleepold.exe slept64.dll: Starting. slept64.dll: ExeEntry=000000013F554ADC, DllEntry=000007FEF2E78B74 SleepEx = 000007FEFD541150 [0000000076912B60] 000007FEFD541150: 4c8bdc 000007FEFD541153: 49895b08 000007FEFD541157: 89542410 sleepold.exe: Starting (at 000000013F551350). SleepEx = 000007FEFD541150 [0000000076912B60] 000007FEFD541150: e923f0ff bf [000007FEBD540178] 000007FEFD541155: cc [FFFFFFFFFFFFFFFF] 000007FEFD541156: cc [FFFFFFFFFFFFFFFF] sleepold.exe: Calling Sleep for 1 second. sleepold.exe: Calling SleepEx for 1 second. sleepold.exe: Calling Sleep again for 1 second. sleepold.exe: Done sleeping. slept64.dll: Detoured SleepEx(). slept64.dll: Removed SleepEx() detour (0), slept 3042 ticks. -------- Replacing slept64.dll with dslept64.dll in sleepold.exe ------------ ..\..\bin.X64\setdll.exe -r ..\..\bin.X64\sleepold.exe Removing extra DLLs from binary files. ..\..\bin.X64\sleepold.exe: KERNEL32.dll -> KERNEL32.dll ..\..\bin.X64\setdll.exe -d:..\..\bin.X64\dslept64.dll ..\..\bin.X64\sleepold.exe Adding c:\Code\detours\bin.X64\dslept64.dll to binary files. ..\..\bin.X64\sleepold.exe: c:\Code\detours\bin.X64\dslept64.dll KERNEL32.dll -> KERNEL32.dll -------- Should load dslept64.dll instead of slept64.dll -------------------- ..\..\bin.X64\sleepold.exe dslept64.dll: Starting. SleepEx = 000007FEFD541150 [0000000076912B60] 000007FEFD541150: 4c8bdc 000007FEFD541153: 49895b08 000007FEFD541157: 89542410 EntryPoint = 000000013FB24ADC 000000013FB24ADC: 4883ec28 000000013FB24AE0: e8875f00 00 [000000013FB2AA6C] 000000013FB24AE5: 4883c428 EntryPoint after attach = 000000013FB24ADC 000000013FB24ADC: e997b6ff bf [00000000FFB20178] 000000013FB24AE1: cc [FFFFFFFFFFFFFFFF] 000000013FB24AE2: cc [FFFFFFFFFFFFFFFF] EntryPoint trampoline = 00000000FFB20120 00000000FFB20120: 4883ec28 00000000FFB20124: e843a900 40 [000000013FB2AA6C] 00000000FFB20129: ff253900 0000 dslept64.dll: Detoured EntryPoint(). dslept64.dll: Detoured SleepEx(). SleepEx = 000007FEFD541150 [0000000076912B60] 000007FEFD541150: e923f0ff bf [000007FEBD540178] 000007FEFD541155: cc [FFFFFFFFFFFFFFFF] 000007FEFD541156: cc [FFFFFFFFFFFFFFFF] dslept64.dll: Calling EntryPoint sleepold.exe: Starting (at 000000013FB21350). SleepEx = 000007FEFD541150 [0000000076912B60] 000007FEFD541150: e923f0ff bf [000007FEBD540178] 000007FEFD541155: cc [FFFFFFFFFFFFFFFF] 000007FEFD541156: cc [FFFFFFFFFFFFFFFF] sleepold.exe: Calling Sleep for 1 second. sleepold.exe: Calling SleepEx for 1 second. sleepold.exe: Calling Sleep again for 1 second. sleepold.exe: Done sleeping. dslept64.dll: Removed Sleep() detours (0), slept 3042 ticks. -------- Removing dslept64.dll from sleepold.exe -------------------------- ..\..\bin.X64\setdll.exe -r ..\..\bin.X64\sleepold.exe Removing extra DLLs from binary files. ..\..\bin.X64\sleepold.exe: KERNEL32.dll -> KERNEL32.dll -------- Should not load dslept64.dll or slept64.dll ------------------------ ..\..\bin.X64\sleepold.exe sleepold.exe: Starting (at 000000013F551350). SleepEx = 000007FEFD541150 [0000000076912B60] 000007FEFD541150: 4c8bdc 000007FEFD541153: 49895b08 000007FEFD541157: 89542410 sleepold.exe: Calling Sleep for 1 second. sleepold.exe: Calling SleepEx for 1 second. sleepold.exe: Calling Sleep again for 1 second. sleepold.exe: Done sleeping. -------- Should load slept64.dll dynamically using withdll.exe ------------ ..\..\bin.X64\withdll.exe -d:..\..\bin.X64\slept64.dll ..\..\bin.X64\sleepold.exe withdll.exe: Starting: `..\..\bin.X64\sleepold.exe' withdll.exe: with `c:\Code\detours\bin.X64\slept64.dll' slept64.dll: Starting. slept64.dll: ExeEntry=000000013FE84ADC, DllEntry=000007FEF3108B74 SleepEx = 000007FEFD541150 [0000000076912B60] 000007FEFD541150: 4c8bdc 000007FEFD541153: 49895b08 000007FEFD541157: 89542410 sleepold.exe: Starting (at 000000013FE81350). SleepEx = 000007FEFD541150 [0000000076912B60] 000007FEFD541150: e923f0ff bf [000007FEBD540178] 000007FEFD541155: cc [FFFFFFFFFFFFFFFF] 000007FEFD541156: cc [FFFFFFFFFFFFFFFF] sleepold.exe: Calling Sleep for 1 second. sleepold.exe: Calling SleepEx for 1 second. sleepold.exe: Calling Sleep again for 1 second. sleepold.exe: Done sleeping. slept64.dll: Detoured SleepEx(). slept64.dll: Removed SleepEx() detour (0), slept 3042 ticks. -------- Test completed. ------------------------------------------------ ================================================ FILE: ext/detours/samples/slept/NORMAL_X86.TXT ================================================ -------- Reseting test binaries to initial state. ----------------------- ..\..\bin.X86\setdll.exe -r ..\..\bin.X86\sleepold.exe Removing extra DLLs from binary files. ..\..\bin.X86\sleepold.exe: KERNEL32.dll -> KERNEL32.dll -------- Should load detour self ---------------------------------------- ..\..\bin.X86\sleepbed.exe sleepbed.exe: Starting. sleepbed.exe: ExeEntry=00B1572E, DllEntry=00000000 SleepEx = 74F51215 74F51215: 8bff 74F51217: 55 74F51218: 8bec sleepbed.exe: Detoured SleepEx(). sleepbed.exe: After detour. SleepEx = 74F51215 74F51215: e95600bc 8b [00B11270] 74F5121A: 5d 74F5121B: ebed [74F5120A] sleepbed.exe: Calling Sleep for 1 second. sleepbed.exe: Calling SleepEx for 1 second. sleepbed.exe: Calling Sleep again for 1 second. sleepbed.exe: Calling TimedSleepEx for 1 second. sleepbed.exe: Calling UntimedSleepEx for 1 second. sleepbed.exe: Done sleeping. sleepbed.exe: Removed SleepEx() detour (0), slept 2028 ticks. sleepbed.exe: GetSleptTicks() = 2028 -------- Should load slept32.dll statically ------------------------------- ..\..\bin.X86\sleepnew.exe slept32.dll: Starting. slept32.dll: ExeEntry=012D3B1A, DllEntry=7248702E SleepEx = 74F51215 74F51215: 8bff 74F51217: 55 74F51218: 8bec sleepnew.exe: Starting. SleepEx = 74F51215 74F51215: e9560053 fd [72481270] 74F5121A: 5d 74F5121B: ebed [74F5120A] sleepnew.exe: Calling Sleep for 1 second. sleepnew.exe: Calling SleepEx for 1 second. sleepnew.exe: Calling Sleep again for 1 second. sleepnew.exe: Calling TimedSleep for 1 second. sleepnew.exe: Calling UntimedSleep for 1 second. sleepnew.exe: Done sleeping. sleepnew.exe: GetSleptTicks() = 2028 slept32.dll: Detoured SleepEx(). slept32.dll: Removed SleepEx() detour (0), slept 2028 ticks. -------- Should not load slept32.dll -------------------------------------- ..\..\bin.X86\sleepold.exe sleepold.exe: Starting (at 00971260). SleepEx = 74F51215 74F51215: 8bff 74F51217: 55 74F51218: 8bec sleepold.exe: Calling Sleep for 1 second. sleepold.exe: Calling SleepEx for 1 second. sleepold.exe: Calling Sleep again for 1 second. sleepold.exe: Done sleeping. -------- Adding slept32.dll to sleepold.exe ------------------------------- ..\..\bin.X86\setdll.exe -d:..\..\bin.X86\slept32.dll ..\..\bin.X86\sleepold.exe Adding c:\Code\detours\bin.X86\slept32.dll to binary files. ..\..\bin.X86\sleepold.exe: c:\Code\detours\bin.X86\slept32.dll KERNEL32.dll -> KERNEL32.dll -------- Should load slept32.dll statically ------------------------------- ..\..\bin.X86\sleepold.exe slept32.dll: Starting. slept32.dll: ExeEntry=00AF3D4C, DllEntry=7248702E SleepEx = 74F51215 74F51215: 8bff 74F51217: 55 74F51218: 8bec sleepold.exe: Starting (at 00AF1260). SleepEx = 74F51215 74F51215: e9560053 fd [72481270] 74F5121A: 5d 74F5121B: ebed [74F5120A] sleepold.exe: Calling Sleep for 1 second. sleepold.exe: Calling SleepEx for 1 second. sleepold.exe: Calling Sleep again for 1 second. sleepold.exe: Done sleeping. slept32.dll: Detoured SleepEx(). slept32.dll: Removed SleepEx() detour (0), slept 1014 ticks. -------- Replacing slept32.dll with dslept32.dll in sleepold.exe ------------ ..\..\bin.X86\setdll.exe -r ..\..\bin.X86\sleepold.exe Removing extra DLLs from binary files. ..\..\bin.X86\sleepold.exe: KERNEL32.dll -> KERNEL32.dll ..\..\bin.X86\setdll.exe -d:..\..\bin.X86\dslept32.dll ..\..\bin.X86\sleepold.exe Adding c:\Code\detours\bin.X86\dslept32.dll to binary files. ..\..\bin.X86\sleepold.exe: c:\Code\detours\bin.X86\dslept32.dll KERNEL32.dll -> KERNEL32.dll -------- Should load dslept32.dll instead of slept32.dll -------------------- ..\..\bin.X86\sleepold.exe dslept32.dll: Starting. SleepEx = 74F51215 74F51215: 8bff 74F51217: 55 74F51218: 8bec EntryPoint = 00263D4C 00263D4C: e8d75400 00 [00269228] 00263D51: e995feff ff [00263BEB] 00263D56: 3b0d8412 2800 EntryPoint after attach = 00263D4C 00263D4C: e96fd502 72 [722912C0] 00263D51: e995feff ff [00263BEB] 00263D56: 3b0d8412 2800 EntryPoint trampoline = 402500D8 402500D8: e84b9101 c0 [00269228] 402500DD: e96f3c01 c0 [00263D51] 402500E2: cc [FFFFFFFF] dslept32.dll: Detoured EntryPoint(). dslept32.dll: Detoured SleepEx(). SleepEx = 74F51215 74F51215: e9560034 fd [72291270] 74F5121A: 5d 74F5121B: ebed [74F5120A] dslept32.dll: Calling EntryPoint sleepold.exe: Starting (at 00261260). SleepEx = 74F51215 74F51215: e9560034 fd [72291270] 74F5121A: 5d 74F5121B: ebed [74F5120A] sleepold.exe: Calling Sleep for 1 second. sleepold.exe: Calling SleepEx for 1 second. sleepold.exe: Calling Sleep again for 1 second. sleepold.exe: Done sleeping. dslept32.dll: Removed Sleep() detours (0), slept 1014 ticks. -------- Removing dslept32.dll from sleepold.exe -------------------------- ..\..\bin.X86\setdll.exe -r ..\..\bin.X86\sleepold.exe Removing extra DLLs from binary files. ..\..\bin.X86\sleepold.exe: KERNEL32.dll -> KERNEL32.dll -------- Should not load dslept32.dll or slept32.dll ------------------------ ..\..\bin.X86\sleepold.exe sleepold.exe: Starting (at 00E01260). SleepEx = 74F51215 74F51215: 8bff 74F51217: 55 74F51218: 8bec sleepold.exe: Calling Sleep for 1 second. sleepold.exe: Calling SleepEx for 1 second. sleepold.exe: Calling Sleep again for 1 second. sleepold.exe: Done sleeping. -------- Should load slept32.dll dynamically using withdll.exe ------------ ..\..\bin.X86\withdll.exe -d:..\..\bin.X86\slept32.dll ..\..\bin.X86\sleepold.exe withdll.exe: Starting: `..\..\bin.X86\sleepold.exe' withdll.exe: with `c:\Code\detours\bin.X86\slept32.dll' slept32.dll: Starting. slept32.dll: ExeEntry=011A3D4C, DllEntry=7248702E SleepEx = 74F51215 74F51215: 8bff 74F51217: 55 74F51218: 8bec sleepold.exe: Starting (at 011A1260). SleepEx = 74F51215 74F51215: e9560053 fd [72481270] 74F5121A: 5d 74F5121B: ebed [74F5120A] sleepold.exe: Calling Sleep for 1 second. sleepold.exe: Calling SleepEx for 1 second. sleepold.exe: Calling Sleep again for 1 second. sleepold.exe: Done sleeping. slept32.dll: Detoured SleepEx(). slept32.dll: Removed SleepEx() detour (0), slept 1014 ticks. -------- Test completed. ------------------------------------------------ ================================================ FILE: ext/detours/samples/slept/dslept.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detour Test Program (dslept.cpp of dslept.dll) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // // An example dynamically detouring a function. // #include #include #include "detours.h" #include "slept.h" #include "verify.cpp" LONG dwSlept = 0; static DWORD (WINAPI * TrueSleepEx)(DWORD dwMilliseconds, BOOL bAlertable) = NULL; static int (WINAPI * TrueEntryPoint)(VOID) = NULL; static int (WINAPI * RawEntryPoint)(VOID) = NULL; DWORD WINAPI UntimedSleepEx(DWORD dwMilliseconds, BOOL bAlertable) { if (TrueSleepEx != NULL) { return TrueSleepEx(dwMilliseconds, bAlertable); } return 0; } DWORD WINAPI TimedSleepEx(DWORD dwMilliseconds, BOOL bAlertable) { DWORD dwBeg = GetTickCount(); DWORD ret = TrueSleepEx(dwMilliseconds, bAlertable); DWORD dwEnd = GetTickCount(); InterlockedExchangeAdd(&dwSlept, dwEnd - dwBeg); return ret; } DWORD WINAPI GetSleptTicks(VOID) { return dwSlept; } int WINAPI TimedEntryPoint(VOID) { // We couldn't call LoadLibrary in DllMain, // so we detour SleepEx here... LONG error; TrueSleepEx = (DWORD (WINAPI *)(DWORD, BOOL)) DetourFindFunction("kernel32.dll", "SleepEx"); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)TrueSleepEx, TimedSleepEx); error = DetourTransactionCommit(); if (error == NO_ERROR) { printf("dslept" DETOURS_STRINGIFY(DETOURS_BITS) ".dll: " " Detoured SleepEx().\n"); } else { printf("dslept" DETOURS_STRINGIFY(DETOURS_BITS) ".dll: " " Error detouring SleepEx(): %ld\n", error); } Verify("SleepEx", (PVOID)SleepEx); printf("\n"); fflush(stdout); printf("dslept" DETOURS_STRINGIFY(DETOURS_BITS) ".dll: " " Calling EntryPoint\n"); fflush(stdout); return TrueEntryPoint(); } BOOL WINAPI DllMain(HINSTANCE hinst, DWORD dwReason, LPVOID reserved) { LONG error; (void)hinst; (void)reserved; if (DetourIsHelperProcess()) { return TRUE; } if (dwReason == DLL_PROCESS_ATTACH) { DetourRestoreAfterWith(); printf("dslept" DETOURS_STRINGIFY(DETOURS_BITS) ".dll: " " Starting.\n"); Verify("SleepEx", (PVOID)SleepEx); printf("\n"); fflush(stdout); // NB: DllMain can't call LoadLibrary, so we hook the app entry point. TrueEntryPoint = (int (WINAPI *)(VOID))DetourGetEntryPoint(NULL); RawEntryPoint = TrueEntryPoint; Verify("EntryPoint", RawEntryPoint); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)TrueEntryPoint, TimedEntryPoint); error = DetourTransactionCommit(); Verify("EntryPoint after attach", RawEntryPoint); Verify("EntryPoint trampoline", TrueEntryPoint); if (error == NO_ERROR) { printf("dslept" DETOURS_STRINGIFY(DETOURS_BITS) ".dll: " " Detoured EntryPoint().\n"); } else { printf("dslept" DETOURS_STRINGIFY(DETOURS_BITS) ".dll: " " Error detouring EntryPoint(): %ld\n", error); } } else if (dwReason == DLL_PROCESS_DETACH) { DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); if (TrueSleepEx != NULL) { DetourDetach(&(PVOID&)TrueSleepEx, (PVOID)TimedSleepEx); } DetourDetach(&(PVOID&)TrueEntryPoint, TimedEntryPoint); error = DetourTransactionCommit(); printf("dslept" DETOURS_STRINGIFY(DETOURS_BITS) ".dll: " " Removed Sleep() detours (%ld), slept %ld ticks.\n", error, dwSlept); fflush(stdout); } return TRUE; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/slept/dslept.rc ================================================ ////////////////////////////////////////////////////////////////////////////// // // Version information for dslept.rc. // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include "detver.h" #define VER_INTERNALNAME_STR "dslept" DETOURS_STRINGIFY(DETOURS_BITS) #define VER_ORIGINALFILENAME_STR "dslept" DETOURS_STRINGIFY(DETOURS_BITS) ".dll" #define VER_FILEDESCRIPTION_STR "Detours Sleep Interception Module" #define VER_COMPANYNAME_STR "Microsoft Corporation" #include "common.ver" ================================================ FILE: ext/detours/samples/slept/sleepbed.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detour Test Program (sleepbed.cpp of sleepbed.exe) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include #include #include "verify.cpp" static BOOL fBroke = FALSE; static LONG dwSlept = 0; static DWORD (WINAPI * TrueSleepEx)(DWORD dwMilliseconds, BOOL bAlertable) = SleepEx; DWORD WINAPI UntimedSleepEx(DWORD dwMilliseconds, BOOL bAlertable) { return TrueSleepEx(dwMilliseconds, bAlertable); } DWORD WINAPI TimedSleepEx(DWORD dwMilliseconds, BOOL bAlertable) { DWORD dwBeg = GetTickCount(); DWORD ret = TrueSleepEx(dwMilliseconds, bAlertable); DWORD dwEnd = GetTickCount(); if (!fBroke) { fBroke = TRUE; // DebugBreak(); } InterlockedExchangeAdd(&dwSlept, dwEnd - dwBeg); return ret; } DWORD WINAPI GetSleptTicks(VOID) { return dwSlept; } // ///////////////////////////////////////////////////////////////// End of File. int __cdecl main(void) { int error = 0; printf("sleepbed.exe: Starting.\n"); PVOID pbExeEntry = DetourGetEntryPoint(NULL); printf("sleepbed.exe: ExeEntry=%p\n", pbExeEntry); Verify("SleepEx", (PVOID)SleepEx); printf("\n"); fflush(stdout); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)TrueSleepEx, TimedSleepEx); error = DetourTransactionCommit(); if (error == NO_ERROR) { printf("sleepbed.exe: Detoured SleepEx().\n"); } else { printf("sleepbed.exe: Error detouring SleepEx(): %d\n", error); return error; } fflush(stdout); printf("sleepbed.exe: After detour.\n"); Verify("SleepEx", (PBYTE)SleepEx); printf("\n"); fflush(stdout); printf("sleepbed.exe: Calling Sleep for 1 second.\n"); Sleep(1000); printf("sleepbed.exe: Calling SleepEx for 1 second.\n"); SleepEx(1000, true); printf("sleepbed.exe: Calling Sleep again for 1 second.\n"); Sleep(1000); printf("sleepbed.exe: Calling TimedSleepEx for 1 second.\n"); TimedSleepEx(1000, false); printf("sleepbed.exe: Calling UntimedSleepEx for 1 second.\n"); UntimedSleepEx(1000, false); printf("sleepbed.exe: Done sleeping.\n\n"); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourDetach(&(PVOID&)TrueSleepEx, TimedSleepEx); error = DetourTransactionCommit(); printf("sleepbed.exe: Removed SleepEx() detour (%d), slept %ld ticks.\n", error, dwSlept); fflush(stdout); printf("sleepbed.exe: GetSleptTicks() = %ld\n\n", GetSleptTicks()); return error; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/slept/sleepnew.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detour Test Program (sleepnew.cpp of sleepnew.exe) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include #include #include "slept.h" #include "verify.cpp" int __cdecl main(void) { printf("sleepnew.exe: Starting.\n"); Verify("SleepEx", (PBYTE)SleepEx); printf("\n"); fflush(stdout); printf("sleepnew.exe: Calling Sleep for 1 second.\n"); Sleep(1000); printf("sleepnew.exe: Calling SleepEx for 1 second.\n"); SleepEx(1000, true); printf("sleepnew.exe: Calling Sleep again for 1 second.\n"); Sleep(1000); printf("sleepnew.exe: Calling TimedSleep for 1 second.\n"); TimedSleepEx(1000, FALSE); printf("sleepnew.exe: Calling UntimedSleep for 1 second.\n"); UntimedSleepEx(1000, FALSE); printf("sleepnew.exe: Done sleeping.\n\n"); #if 0 // This code enumerates the virtual address space and attempts to reserve // all unused space below 8GB. // for (PBYTE pbTry = (PBYTE)0x10000; pbTry < (PBYTE)0x200000000;) { MEMORY_BASIC_INFORMATION mbi; if (!VirtualQuery(pbTry, &mbi, sizeof(mbi))) { break; } if (mbi.State == MEM_FREE && mbi.RegionSize > 0x10000) { PBYTE pbBase = (PBYTE)((((ULONG_PTR)pbTry) + 0xffff) & 0xffffffffffff0000); SIZE_T cbTry = mbi.RegionSize & 0xffffffffffff0000; if (cbTry > 0x40000000) { cbTry = 0x40000000; } PVOID pvRegion = VirtualAlloc(pbBase, cbTry, MEM_RESERVE, PAGE_NOACCESS); if (pvRegion == NULL) { printf("---%p..%p failed.\n", pbBase, mbi.RegionSize - 0x10000); } else { continue; } } printf(" %p..%p %6x [%p]\n", mbi.BaseAddress, (PBYTE)mbi.BaseAddress + mbi.RegionSize - 1, mbi.State, pbTry); pbTry = (PBYTE)mbi.BaseAddress + mbi.RegionSize; } #endif printf("sleepnew.exe: GetSleptTicks() = %ld\n\n", GetSleptTicks()); return 0; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/slept/sleepold.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detour Test Program (sleepold.cpp of sleepold.exe) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include #include #include "verify.cpp" int __cdecl main(int argc, char **argv) { BOOL fQuiet = FALSE; if (argc == 2 && _stricmp(argv[1], "-quiet") == 0) { fQuiet = TRUE; } // // Verify what the code looks like. // printf("sleepold.exe: Starting (at %p).\n", main); if (!fQuiet) { Verify("SleepEx", (PBYTE)SleepEx); printf("\n"); } fflush(stdout); // // See if another process wants us to wait on a shared event. // This helps in testing loading a DLL into a new process. if (argc == 2 && _stricmp(argv[1], "-wait") == 0) { HANDLE hEvent = OpenEventA(SYNCHRONIZE, FALSE, "detours_load_test_event"); if (hEvent) { printf("sleepold.exe: Waiting for detours_load_test_event to be set.\n"); fflush(stdout); WaitForSingleObject(hEvent, INFINITE); } else { printf("sleepold.exe: Couldn't open detours_load_test_event.\n"); } } // // Try out sleep (which may be detours). // printf("sleepold.exe: Calling Sleep for 1 second.\n"); Sleep(1000); printf("sleepold.exe: Calling SleepEx for 1 second.\n"); SleepEx(1000, false); printf("sleepold.exe: Calling Sleep again for 1 second.\n"); Sleep(1000); // DebugBreak(); printf("sleepold.exe: Done sleeping.\n\n"); fflush(stdout); return 0; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/slept/slept.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detour Test Program (slept.cpp of slept.dll) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include #include #include "detours.h" #include "slept.h" #include "verify.cpp" static BOOL fBroke = FALSE; static LONG dwSlept = 0; static DWORD (WINAPI * TrueSleepEx)(DWORD dwMilliseconds, BOOL bAlertable) = SleepEx; DWORD WINAPI UntimedSleepEx(DWORD dwMilliseconds, BOOL bAlertable) { return TrueSleepEx(dwMilliseconds, bAlertable); } DWORD WINAPI TimedSleepEx(DWORD dwMilliseconds, BOOL bAlertable) { DWORD dwBeg = GetTickCount(); DWORD ret = TrueSleepEx(dwMilliseconds, bAlertable); DWORD dwEnd = GetTickCount(); if (!fBroke) { fBroke = TRUE; // DebugBreak(); } InterlockedExchangeAdd(&dwSlept, dwEnd - dwBeg); return ret; } DWORD WINAPI GetSleptTicks(VOID) { return dwSlept; } DWORD WINAPI TestTicks(VOID) { return TestTicksEx(0); } DWORD WINAPI TestTicksEx(DWORD Add) { PDWORD pdw = new DWORD [Add + 1]; if (pdw != NULL) { pdw[0] = dwSlept; for (DWORD n = 1; n < Add + 1; n++) { pdw[n] = pdw[n-1] + 1; } for (DWORD n = 1; n < Add + 1; n++) { pdw[n-1] = pdw[n-1] - 1; } for (DWORD n = 1; n < Add + 1; n++) { pdw[n] = pdw[n-1] + 1; } Add = pdw[Add] - Add; delete [] pdw; } else { Add = dwSlept + Add; } return Add; } BOOL WINAPI DllMain(HINSTANCE hinst, DWORD dwReason, LPVOID reserved) { LONG error; (void)hinst; (void)reserved; if (DetourIsHelperProcess()) { return TRUE; } if (dwReason == DLL_PROCESS_ATTACH) { DetourRestoreAfterWith(); printf("slept" DETOURS_STRINGIFY(DETOURS_BITS) ".dll: " " Starting.\n"); PVOID pbExeEntry = DetourGetEntryPoint(NULL); PVOID pbDllEntry = DetourGetEntryPoint(hinst); printf("slept" DETOURS_STRINGIFY(DETOURS_BITS) ".dll: " " ExeEntry=%p, DllEntry=%p\n", pbExeEntry, pbDllEntry); Verify("SleepEx", (PVOID)SleepEx); printf("\n"); fflush(stdout); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)TrueSleepEx, TimedSleepEx); error = DetourTransactionCommit(); if (error == NO_ERROR) { printf("slept" DETOURS_STRINGIFY(DETOURS_BITS) ".dll: " " Detoured SleepEx() @ %p.\n", TrueSleepEx); } else { printf("slept" DETOURS_STRINGIFY(DETOURS_BITS) ".dll: " " Error detouring SleepEx(): %ld\n", error); } } else if (dwReason == DLL_PROCESS_DETACH) { DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourDetach(&(PVOID&)TrueSleepEx, TimedSleepEx); error = DetourTransactionCommit(); printf("slept" DETOURS_STRINGIFY(DETOURS_BITS) ".dll: " " Removed SleepEx() detour (%ld), slept %ld ticks.\n", error, dwSlept); fflush(stdout); } return TRUE; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/slept/slept.h ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detour Test Program (slept.h of slept.dll) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #pragma once DWORD WINAPI UntimedSleepEx(DWORD dwMilliseconds, BOOL bAlertable); DWORD WINAPI TimedSleepEx(DWORD dwMilliseconds, BOOL bAlertable); DWORD WINAPI GetSleptTicks(VOID); DWORD WINAPI TestTicks(VOID); DWORD WINAPI TestTicksEx(DWORD Add); // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/slept/slept.rc ================================================ ////////////////////////////////////////////////////////////////////////////// // // Version information for sleep.rc. // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include "detver.h" #define VER_INTERNALNAME_STR "sleep" DETOURS_STRINGIFY(DETOURS_BITS) #define VER_ORIGINALFILENAME_STR "sleep" DETOURS_STRINGIFY(DETOURS_BITS) ".dll" #define VER_FILEDESCRIPTION_STR "Detours Sleep Test Module" #define VER_COMPANYNAME_STR "Microsoft Corporation" #include "common.ver" ================================================ FILE: ext/detours/samples/slept/verify.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detour Test Program (verify.cpp) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include static VOID Dump(PBYTE pbBytes, LONG nBytes, PBYTE pbTarget) { for (LONG n = 0; n < nBytes; n += 16) { printf(" %p: ", pbBytes + n); for (LONG m = n; m < n + 16; m++) { if (m >= nBytes) { printf(" "); } else { printf("%02x", pbBytes[m]); } if (m % 4 == 3) { printf(" "); } } if (n == 0 && pbTarget != DETOUR_INSTRUCTION_TARGET_NONE) { printf(" [%p]", pbTarget); } printf("\n"); } } static VOID Decode(PCSTR pszDesc, PBYTE pbCode, PBYTE pbOther, PBYTE pbPointer, LONG nInst) { if (pbCode != pbPointer) { printf(" %s = %p [%p]\n", pszDesc, pbCode, pbPointer); } else { printf(" %s = %p\n", pszDesc, pbCode); } if (pbCode == pbOther) { printf(" ... unchanged ...\n"); return; } PBYTE pbSrc = pbCode; PBYTE pbEnd; PVOID pbTarget; for (LONG n = 0; n < nInst; n++) { pbEnd = (PBYTE)DetourCopyInstruction(NULL, NULL, pbSrc, &pbTarget, NULL); Dump(pbSrc, (int)(pbEnd - pbSrc), (PBYTE)pbTarget); pbSrc = pbEnd; } } VOID WINAPI Verify(PCHAR pszFunc, PVOID pvPointer) { PVOID pvCode = DetourCodeFromPointer(pvPointer, NULL); Decode(pszFunc, (PBYTE)pvCode, NULL, (PBYTE)pvPointer, 3); } VOID WINAPI VerifyEx(PCHAR pszFunc, PVOID pvPointer, LONG nInst) { PVOID pvCode = DetourCodeFromPointer(pvPointer, NULL); Decode(pszFunc, (PBYTE)pvCode, NULL, (PBYTE)pvPointer, nInst); } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/syelog/Makefile ================================================ ############################################################################## ## ## Makefile for Detours. ## ## Microsoft Research Detours Package ## ## Copyright (c) Microsoft Corporation. All rights reserved. ## ############################################################################## TARGETOS=WINNT !include ..\common.mak LIBS=$(LIBS) kernel32.lib ############################################################################## all: dirs \ $(INCD)\syelog.h \ $(LIBD)\syelog.lib \ $(BIND)\syelogd.exe \ \ $(BIND)\sltest.exe \ $(BIND)\sltestp.exe \ \ !IF $(DETOURS_SOURCE_BROWSING)==1 $(OBJD)\syelogd.bsc \ $(OBJD)\sltest.bsc \ $(OBJD)\sltestp.bsc \ !ENDIF ############################################################################## ## clean: -del *~ test.txt 2> nul -del $(INCD)\syelog.* 2>nul -del $(LIBD)\syelog.* 2>nul -del $(BIND)\syelogd.* 2>nul -del $(BIND)\sltest.* 2>nul -del $(BIND)\sltestp.* 2>nul -rmdir /q /s $(OBJD) 2>nul realclean: clean -rmdir /q /s $(OBJDS) 2>nul ############################################################################## dirs: @if not exist $(INCD) mkdir $(INCD) && echo. Created $(INCD) @if not exist $(LIBD) mkdir $(LIBD) && echo. Created $(LIBD) @if not exist $(BIND) mkdir $(BIND) && echo. Created $(BIND) @if not exist $(OBJD) mkdir $(OBJD) && echo. Created $(OBJD) $(OBJD)\syelog.obj : syelog.cpp syelog.h $(OBJD)\syelogd.obj: syelogd.cpp syelog.h $(OBJD)\sltest.obj: sltest.cpp syelog.h $(OBJD)\sltestp.obj: sltestp.cpp syelog.h $(INCD)\syelog.h : syelog.h copy syelog.h $@ $(LIBD)\syelog.lib : $(OBJD)\syelog.obj link /lib $(LIBFLAGS) /out:$@ $(OBJD)\syelog.obj $(BIND)\sltest.exe: $(OBJD)\sltest.obj $(OBJD)\syelog.obj $(DEPS) $(CC) $(CFLAGS) /Fe$@ /Fd$(@R).pdb $(OBJD)\sltest.obj \ /link $(LINKFLAGS) $(LIBS) $(OBJD)\sltest.bsc : $(OBJD)\sltest.obj bscmake /v /n /o $@ $(OBJD)\sltest.sbr $(BIND)\sltestp.exe: $(OBJD)\sltestp.obj $(DEPS) $(CC) $(CFLAGS) /Fe$@ /Fd$(@R).pdb $(OBJD)\sltestp.obj \ /link $(LINKFLAGS) $(LIBS) $(OBJD)\sltestp.bsc : $(OBJD)\sltestp.obj bscmake /v /n /o $@ $(OBJD)\sltestp.sbr $(LIBD)\detours.lib: cd $(ROOT)\src nmake /nologo cd $(MAKEDIR) $(BIND)\syelogd.exe: $(OBJD)\syelogd.obj $(DEPS) $(CC) $(CFLAGS) /Fe$@ /Fd$(@R).pdb $(OBJD)\syelogd.obj \ /link $(LINKFLAGS) ws2_32.lib mswsock.lib advapi32.lib $(OBJD)\syelogd.bsc : $(OBJD)\syelogd.obj bscmake /v /n /o $@ $(OBJD)\syelogd.sbr ############################################################################## test: $(BIND)\syelogd.exe $(BIND)\sltest.exe $(BIND)\sltestp.exe @echo -------- Logging output to test.txt ------------ start $(BIND)\syelogd.exe test.txt $(BIND)\sleep5.exe 1 $(BIND)\sltestp.exe $(BIND)\sltest.exe /x type test.txt ################################################################# End of File. ================================================ FILE: ext/detours/samples/syelog/sltest.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (sltest.cpp of sltest.exe) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // // Test the named-pipe-based connection with syelog.lib to the syelog // system-event logger. // #include #include #include #include #pragma warning(push) #if _MSC_VER > 1400 #pragma warning(disable:6102 6103) // /analyze warnings #endif #include #pragma warning(pop) #include "syelog.h" #include "detours.h" extern "C" { HANDLE ( WINAPI * Real_CreateFileW)(LPCWSTR a0, DWORD a1, DWORD a2, LPSECURITY_ATTRIBUTES a3, DWORD a4, DWORD a5, HANDLE a6) = CreateFileW; BOOL ( WINAPI * Real_WriteFile)(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped) = WriteFile; BOOL ( WINAPI * Real_FlushFileBuffers)(HANDLE hFile) = FlushFileBuffers; BOOL ( WINAPI * Real_CloseHandle)(HANDLE hObject) = CloseHandle; BOOL ( WINAPI * Real_WaitNamedPipeW)(LPCWSTR lpNamedPipeName, DWORD nTimeOut) = WaitNamedPipeW; BOOL ( WINAPI * Real_SetNamedPipeHandleState)(HANDLE hNamedPipe, LPDWORD lpMode, LPDWORD lpMaxCollectionCount, LPDWORD lpCollectDataTimeout) = SetNamedPipeHandleState; DWORD ( WINAPI * Real_GetCurrentProcessId)(VOID) = GetCurrentProcessId; VOID ( WINAPI * Real_GetSystemTimeAsFileTime)(LPFILETIME lpSystemTimeAsFileTime) = GetSystemTimeAsFileTime; VOID ( WINAPI * Real_InitializeCriticalSection)(LPCRITICAL_SECTION lpSection) = InitializeCriticalSection; VOID ( WINAPI * Real_EnterCriticalSection)(LPCRITICAL_SECTION lpSection) = EnterCriticalSection; VOID ( WINAPI * Real_LeaveCriticalSection)(LPCRITICAL_SECTION lpSection) = LeaveCriticalSection; } int main(int argc, char **argv) { BOOL fNeedHelp = FALSE; BOOL fRequestExitOnClose = FALSE; int arg = 1; for (; arg < argc && (argv[arg][0] == '-' || argv[arg][0] == '/'); arg++) { CHAR *argn = argv[arg] + 1; CHAR *argp = argn; while (*argp && *argp != ':') { argp++; } if (*argp == ':') { *argp++ = '\0'; } switch (argn[0]) { case 'x': // Request exit on close. case 'X': fRequestExitOnClose = TRUE; break; case '?': // Help. fNeedHelp = TRUE; break; default: fNeedHelp = TRUE; printf("SLTEST: Bad argument: %s:%s\n", argn, argp); break; } } if (fNeedHelp) { printf("Usage:\n" " sltest.exe [options] message\n" "Options:\n" " /x Ask syelogd.exe to terminate when this connect closes.\n" " /? Display this help message.\n" "\n"); exit(1); } SyelogOpen("sltest", SYELOG_FACILITY_APPLICATION); if (arg >= argc) { Syelog(SYELOG_SEVERITY_INFORMATION, "Hello World! [1 of 4]"); Syelog(SYELOG_SEVERITY_INFORMATION, "Hello World! [2 of 4]"); Syelog(SYELOG_SEVERITY_INFORMATION, "Hello World! [3 of 4]"); Syelog(SYELOG_SEVERITY_INFORMATION, "Hello World! [4 of 4]"); } else { CHAR Buffer[1024] = ""; for (; arg < argc; arg++) { StringCchCatA(Buffer, ARRAYSIZE(Buffer), argv[arg]); if (arg + 1 < argc) { StringCchCatA(Buffer, ARRAYSIZE(Buffer), " "); } } Syelog(SYELOG_SEVERITY_INFORMATION, Buffer); } SyelogClose(fRequestExitOnClose); return 0; } ================================================ FILE: ext/detours/samples/syelog/sltestp.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (sltestp.cpp of sltestp.exe) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // // Test the named-pipe-based connection to the syelog system-event logger. // #include #include #include #include #pragma warning(push) #if _MSC_VER > 1400 #pragma warning(disable:6102 6103) // /analyze warnings #endif #include #pragma warning(pop) #include "syelog.h" VOID MyErrExit(PCSTR pszMsg) { fprintf(stderr, "Error %s: %ld\n", pszMsg, GetLastError()); exit(1); } DWORD main(int argc, char *argv[]) { HANDLE hPipe; SYELOG_MESSAGE Message; BOOL fSuccess; DWORD cbWritten, dwMode; // Try to open a named pipe; wait for it, if necessary. TIME_ZONE_INFORMATION tzi; GetTimeZoneInformation(&tzi); for (;;) { hPipe = CreateFileW(SYELOG_PIPE_NAMEW, // pipe name GENERIC_WRITE, // write access only 0, // no sharing NULL, // no security attributes OPEN_EXISTING, // opens existing pipe 0, // default attributes NULL); // no template file // Break if the pipe handle is valid. if (hPipe != INVALID_HANDLE_VALUE) break; // Exit if an error other than ERROR_PIPE_BUSY occurs. if (GetLastError() != ERROR_PIPE_BUSY) MyErrExit("Could not open pipe"); // All pipe instances are busy, so wait for 1 seconds. if (!WaitNamedPipeW(SYELOG_PIPE_NAMEW, 1000)) MyErrExit("Could not open pipe"); } // The pipe connected; change to message-read mode. dwMode = PIPE_READMODE_MESSAGE; fSuccess = SetNamedPipeHandleState(hPipe, // pipe handle &dwMode, // new pipe mode NULL, // don't set maximum bytes NULL); // don't set maximum time if (!fSuccess) MyErrExit("SetNamedPipeHandleState"); // Send a message to the pipe server. memset(&Message, 0, sizeof(Message)); StringCchCopyA(Message.szMessage, ARRAYSIZE(Message.szMessage), (argc > 1) ? argv[1] : "sltestp: hello world!"); Message.nFacility = SYELOG_FACILITY_APPLICATION; Message.nSeverity = SYELOG_SEVERITY_INFORMATION; Message.nProcessId = GetCurrentProcessId(); GetSystemTimeAsFileTime(&Message.ftOccurance); PCSTR pszEnd = Message.szMessage; for (; *pszEnd; pszEnd++) { // no internal contents. } Message.nBytes = (USHORT)(pszEnd - ((PCSTR)&Message) + 1); fSuccess = WriteFile(hPipe, // pipe handle &Message, // message Message.nBytes, // message length &cbWritten, // bytes written NULL); // not overlapped if (! fSuccess) MyErrExit("WriteFile"); CloseHandle(hPipe); GetTimeZoneInformation(&tzi); return 0; } ================================================ FILE: ext/detours/samples/syelog/syelog.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (syelog.cpp of syelog.lib) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include #include #include #include #include "detours.h" #include "syelog.h" #include ////////////////////////////////////////////////////////////////////////////// extern "C" { extern HANDLE ( WINAPI * Real_CreateFileW)(LPCWSTR a0, DWORD a1, DWORD a2, LPSECURITY_ATTRIBUTES a3, DWORD a4, DWORD a5, HANDLE a6); extern BOOL ( WINAPI * Real_WriteFile)(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped); extern BOOL ( WINAPI * Real_FlushFileBuffers)(HANDLE hFile); extern BOOL ( WINAPI * Real_CloseHandle)(HANDLE hObject); extern BOOL ( WINAPI * Real_WaitNamedPipeW)(LPCWSTR lpNamedPipeName, DWORD nTimeOut); extern BOOL ( WINAPI * Real_SetNamedPipeHandleState)(HANDLE hNamedPipe, LPDWORD lpMode, LPDWORD lpMaxCollectionCount, LPDWORD lpCollectDataTimeout); extern DWORD ( WINAPI * Real_GetCurrentProcessId)(VOID); extern VOID ( WINAPI * Real_GetSystemTimeAsFileTime)(LPFILETIME lpSystemTimeAsFileTime); extern VOID ( WINAPI * Real_InitializeCriticalSection)(LPCRITICAL_SECTION lpSection); extern VOID ( WINAPI * Real_EnterCriticalSection)(LPCRITICAL_SECTION lpSection); extern VOID ( WINAPI * Real_LeaveCriticalSection)(LPCRITICAL_SECTION lpSection); } ///////////////////////////////////////////////////////////////////// VPrintf. // // Completely side-effect free printf replacement (but no FP numbers). // static PCHAR do_base(PCHAR pszOut, UINT64 nValue, UINT nBase, PCSTR pszDigits) { CHAR szTmp[96]; int nDigit = sizeof(szTmp)-2; for (; nDigit >= 0; nDigit--) { szTmp[nDigit] = pszDigits[nValue % nBase]; nValue /= nBase; } for (nDigit = 0; nDigit < sizeof(szTmp) - 2 && szTmp[nDigit] == '0'; nDigit++) { // skip leading zeros. } for (; nDigit < sizeof(szTmp) - 1; nDigit++) { *pszOut++ = szTmp[nDigit]; } *pszOut = '\0'; return pszOut; } static PCHAR do_str(PCHAR pszOut, PCHAR pszEnd, PCSTR pszIn) { while (*pszIn && pszOut < pszEnd) { *pszOut++ = *pszIn++; } *pszOut = '\0'; return pszOut; } static PCHAR do_wstr(PCHAR pszOut, PCHAR pszEnd, PCWSTR pszIn) { while (*pszIn && pszOut < pszEnd) { *pszOut++ = (CHAR)*pszIn++; } *pszOut = '\0'; return pszOut; } static PCHAR do_estr(PCHAR pszOut, PCHAR pszEnd, PCSTR pszIn) { while (*pszIn && pszOut < pszEnd) { if (*pszIn == '<') { if (pszOut + 4 > pszEnd) { break; } pszIn++; *pszOut++ = '&'; *pszOut++ = 'l'; *pszOut++ = 't'; *pszOut++ = ';'; } else if (*pszIn == '>') { if (pszOut + 4 > pszEnd) { break; } pszIn++; *pszOut++ = '&'; *pszOut++ = 'g'; *pszOut++ = 't'; *pszOut++ = ';'; } else if (*pszIn == '&') { if (pszOut + 5 > pszEnd) { break; } pszIn++; *pszOut++ = '&'; *pszOut++ = 'a'; *pszOut++ = 'm'; *pszOut++ = 'p'; *pszOut++ = ';'; } else if (*pszIn == '\"') { if (pszOut + 6 > pszEnd) { break; } pszIn++; *pszOut++ = '&'; *pszOut++ = 'q'; *pszOut++ = 'u'; *pszOut++ = 'o'; *pszOut++ = 't'; *pszOut++ = ';'; } else if (*pszIn == '\'') { if (pszOut + 6 > pszEnd) { break; } pszIn++; *pszOut++ = '&'; *pszOut++ = 'a'; *pszOut++ = 'p'; *pszOut++ = 'o'; *pszOut++ = 's'; *pszOut++ = ';'; } else if (*pszIn < ' ') { BYTE c = (BYTE)(*pszIn++); if (c < 10 && pszOut + 4 <= pszEnd) { *pszOut++ = '&'; *pszOut++ = '#'; *pszOut++ = '0' + (c % 10); *pszOut++ = ';'; } else if (c < 100 && pszOut + 5 <= pszEnd) { *pszOut++ = '&'; *pszOut++ = '#'; *pszOut++ = '0' + ((c / 10) % 10); *pszOut++ = '0' + (c % 10); *pszOut++ = ';'; } else if (c < 1000 && pszOut + 6 <= pszEnd) { *pszOut++ = '&'; *pszOut++ = '#'; *pszOut++ = '0' + ((c / 100) % 10); *pszOut++ = '0' + ((c / 10) % 10); *pszOut++ = '0' + (c % 10); *pszOut++ = ';'; } else { break; } } else { *pszOut++ = *pszIn++; } } *pszOut = '\0'; return pszOut; } static PCHAR do_ewstr(PCHAR pszOut, PCHAR pszEnd, PCWSTR pszIn) { while (*pszIn && pszOut < pszEnd) { if (*pszIn == '<') { if (pszOut + 4 > pszEnd) { break; } pszIn++; *pszOut++ = '&'; *pszOut++ = 'l'; *pszOut++ = 't'; *pszOut++ = ';'; } else if (*pszIn == '>') { if (pszOut + 4 > pszEnd) { break; } pszIn++; *pszOut++ = '&'; *pszOut++ = 'g'; *pszOut++ = 't'; *pszOut++ = ';'; } else if (*pszIn == '&') { if (pszOut + 5 > pszEnd) { break; } pszIn++; *pszOut++ = '&'; *pszOut++ = 'a'; *pszOut++ = 'm'; *pszOut++ = 'p'; *pszOut++ = ';'; } else if (*pszIn == '\"') { if (pszOut + 6 > pszEnd) { break; } pszIn++; *pszOut++ = '&'; *pszOut++ = 'q'; *pszOut++ = 'u'; *pszOut++ = 'o'; *pszOut++ = 't'; *pszOut++ = ';'; } else if (*pszIn == '\'') { if (pszOut + 6 > pszEnd) { break; } pszIn++; *pszOut++ = '&'; *pszOut++ = 'a'; *pszOut++ = 'p'; *pszOut++ = 'o'; *pszOut++ = 's'; *pszOut++ = ';'; } else if (*pszIn < ' ' || *pszIn > 127) { WCHAR c = *pszIn++; if (c < 10 && pszOut + 4 <= pszEnd) { *pszOut++ = '&'; *pszOut++ = '#'; *pszOut++ = '0' + (CHAR)(c % 10); *pszOut++ = ';'; } else if (c < 100 && pszOut + 5 <= pszEnd) { *pszOut++ = '&'; *pszOut++ = '#'; *pszOut++ = '0' + (CHAR)((c / 10) % 10); *pszOut++ = '0' + (CHAR)(c % 10); *pszOut++ = ';'; } else if (c < 1000 && pszOut + 6 <= pszEnd) { *pszOut++ = '&'; *pszOut++ = '#'; *pszOut++ = '0' + (CHAR)((c / 100) % 10); *pszOut++ = '0' + (CHAR)((c / 10) % 10); *pszOut++ = '0' + (CHAR)(c % 10); *pszOut++ = ';'; } else { break; } } else { *pszOut++ = (CHAR)*pszIn++; } } *pszOut = '\0'; return pszOut; } #if _MSC_VER >= 1900 #pragma warning(push) #pragma warning(disable:4456) // declaration hides previous local declaration #endif VOID VSafePrintf(PCSTR pszMsg, va_list args, PCHAR pszBuffer, LONG cbBuffer) { PCHAR pszOut = pszBuffer; PCHAR pszEnd = pszBuffer + cbBuffer - 1; pszBuffer[0] = '\0'; __try { while (*pszMsg && pszOut < pszEnd) { if (*pszMsg == '%') { CHAR szHead[4] = ""; INT nLen; INT nWidth = 0; INT nPrecision = 0; BOOL fLeft = FALSE; BOOL fPositive = FALSE; BOOL fPound = FALSE; BOOL fBlank = FALSE; BOOL fZero = FALSE; BOOL fDigit = FALSE; BOOL fSmall = FALSE; BOOL fLarge = FALSE; BOOL f64Bit = FALSE; PCSTR pszArg = pszMsg; pszMsg++; for (; (*pszMsg == '-' || *pszMsg == '+' || *pszMsg == '#' || *pszMsg == ' ' || *pszMsg == '0'); pszMsg++) { switch (*pszMsg) { case '-': fLeft = TRUE; break; case '+': fPositive = TRUE; break; case '#': fPound = TRUE; break; case ' ': fBlank = TRUE; break; case '0': fZero = TRUE; break; } } if (*pszMsg == '*') { nWidth = va_arg(args, INT); pszMsg++; } else { while (*pszMsg >= '0' && *pszMsg <= '9') { nWidth = nWidth * 10 + (*pszMsg++ - '0'); } } if (*pszMsg == '.') { pszMsg++; fDigit = TRUE; if (*pszMsg == '*') { nPrecision = va_arg(args, INT); pszMsg++; } else { while (*pszMsg >= '0' && *pszMsg <= '9') { nPrecision = nPrecision * 10 + (*pszMsg++ - '0'); } } } if (*pszMsg == 'h') { fSmall = TRUE; pszMsg++; } else if (*pszMsg == 'l') { fLarge = TRUE; pszMsg++; } else if (*pszMsg == 'I' && pszMsg[1] == '6' && pszMsg[2] == '4') { f64Bit = TRUE; pszMsg += 3; } if (*pszMsg == 's' || *pszMsg == 'e' || *pszMsg == 'c') { // We ignore the length, precision, and alignment // to avoid using a temporary buffer. if (*pszMsg == 's') { // [GalenH] need to not use temp. PVOID pvData = va_arg(args, PVOID); pszMsg++; if (fSmall) { fLarge = FALSE; } __try { if (pvData == NULL) { pszOut = do_str(pszOut, pszEnd, ""); } else if (pvData < (PVOID)0x10000) { pszOut = do_str(pszOut, pszEnd, "#"); pszOut = do_base(pszOut, (UINT64)pvData, 16, "0123456789ABCDEF"); pszOut = do_str(pszOut, pszEnd, "#"); } else if (fLarge) { pszOut = do_wstr(pszOut, pszEnd, (PWCHAR)pvData); } else { pszOut = do_str(pszOut, pszEnd, (PCHAR)pvData); } } __except(EXCEPTION_EXECUTE_HANDLER) { pszOut = do_str(pszOut, pszEnd, "-"); pszOut = do_base(pszOut, (UINT64)pvData, 16, "0123456789ABCDEF"); pszOut = do_str(pszOut, pszEnd, "-"); } } else if (*pszMsg == 'e') { // Escape the string. PVOID pvData = va_arg(args, PVOID); pszMsg++; if (fSmall) { fLarge = FALSE; } __try { if (pvData == NULL) { pszOut = do_str(pszOut, pszEnd, ""); } else if (pvData < (PVOID)0x10000) { pszOut = do_str(pszOut, pszEnd, ">"); pszOut = do_base(pszOut, (UINT64)pvData, 16, "0123456789ABCDEF"); pszOut = do_str(pszOut, pszEnd, ">"); } else if (fLarge) { pszOut = do_ewstr(pszOut, pszEnd, (PWCHAR)pvData); } else { pszOut = do_estr(pszOut, pszEnd, (PCHAR)pvData); } } __except(EXCEPTION_EXECUTE_HANDLER) { pszOut = do_str(pszOut, pszEnd, "-"); pszOut = do_base(pszOut, (UINT64)pvData, 16, "0123456789ABCDEF"); pszOut = do_str(pszOut, pszEnd, "-"); } } else { CHAR szTemp[2]; pszMsg++; szTemp[0] = (CHAR)va_arg(args, INT); szTemp[1] = '\0'; pszOut = do_str(pszOut, pszEnd, szTemp); } } else if (*pszMsg == 'd' || *pszMsg == 'i' || *pszMsg == 'o' || *pszMsg == 'x' || *pszMsg == 'X' || *pszMsg == 'b' || *pszMsg == 'u') { CHAR szTemp[128]; UINT64 value; if (f64Bit) { value = va_arg(args, UINT64); } else { value = va_arg(args, UINT); } if (*pszMsg == 'x') { pszMsg++; nLen = (int)(do_base(szTemp, value, 16, "0123456789abcdef") - szTemp); if (fPound && value) { do_str(szHead, szHead + sizeof(szHead) - 1, "0x"); } } else if (*pszMsg == 'X') { pszMsg++; nLen = (int)(do_base(szTemp, value, 16, "0123456789ABCDEF") - szTemp); if (fPound && value) { do_str(szHead, szHead + sizeof(szHead) - 1, "0X"); } } else if (*pszMsg == 'd') { pszMsg++; if ((INT64)value < 0) { value = -(INT64)value; do_str(szHead, szHead + sizeof(szHead) - 1, "-"); } else if (fPositive) { if (value > 0) { do_str(szHead, szHead + sizeof(szHead) - 1, "+"); } } else if (fBlank) { if (value > 0) { do_str(szHead, szHead + sizeof(szHead) - 1, " "); } } nLen = (int)(do_base(szTemp, value, 10, "0123456789") - szTemp); nPrecision = 0; } else if (*pszMsg == 'u') { pszMsg++; nLen = (int)(do_base(szTemp, value, 10, "0123456789") - szTemp); nPrecision = 0; } else if (*pszMsg == 'o') { pszMsg++; nLen = (int)(do_base(szTemp, value, 8, "01234567") - szTemp); nPrecision = 0; if (fPound && value) { do_str(szHead, szHead + sizeof(szHead) - 1, "0"); } } else if (*pszMsg == 'b') { pszMsg++; nLen = (int)(do_base(szTemp, value, 2, "01") - szTemp); nPrecision = 0; if (fPound && value) { do_str(szHead, szHead + sizeof(szHead) - 1, "0b"); } } else { pszMsg++; if ((INT64)value < 0) { value = -(INT64)value; do_str(szHead, szHead + sizeof(szHead) - 1, "-"); } else if (fPositive) { if (value > 0) { do_str(szHead, szHead + sizeof(szHead) - 1, "+"); } } else if (fBlank) { if (value > 0) { do_str(szHead, szHead + sizeof(szHead) - 1, " "); } } nLen = (int)(do_base(szTemp, value, 10, "0123456789") - szTemp); nPrecision = 0; } INT nHead = 0; for (; szHead[nHead]; nHead++) { // Count characters in head string. } if (fLeft) { if (nHead) { pszOut = do_str(pszOut, pszEnd, szHead); nLen += nHead; } pszOut = do_str(pszOut, pszEnd, szTemp); for (; nLen < nWidth && pszOut < pszEnd; nLen++) { *pszOut++ = ' '; } } else if (fZero) { if (nHead) { pszOut = do_str(pszOut, pszEnd, szHead); nLen += nHead; } for (; nLen < nWidth && pszOut < pszEnd; nLen++) { *pszOut++ = '0'; } pszOut = do_str(pszOut, pszEnd, szTemp); } else { if (nHead) { nLen += nHead; } for (; nLen < nWidth && pszOut < pszEnd; nLen++) { *pszOut++ = ' '; } if (nHead) { pszOut = do_str(pszOut, pszEnd, szHead); } pszOut = do_str(pszOut, pszEnd, szTemp); } } else if (*pszMsg == 'p') { CHAR szTemp[64]; ULONG_PTR value; value = va_arg(args, ULONG_PTR); if ((INT64)value == (INT64)-1 || (INT64)value == (INT64)-2) { if (*pszMsg == 'p') { pszMsg++; } szTemp[0] = '-'; szTemp[1] = ((INT64)value == (INT64)-1) ? '1' : '2'; szTemp[2] = '\0'; nLen = 2; } else { if (*pszMsg == 'p') { pszMsg++; nLen = (int)(do_base(szTemp, (UINT64)value, 16, "0123456789abcdef") - szTemp); if (fPound && value) { do_str(szHead, szHead + sizeof(szHead) - 1, "0x"); } } else { pszMsg++; nLen = (int)(do_base(szTemp, (UINT64)value, 16, "0123456789ABCDEF") - szTemp); if (fPound && value) { do_str(szHead, szHead + sizeof(szHead) - 1, "0x"); } } } INT nHead = 0; for (; szHead[nHead]; nHead++) { // Count characters in head string. } if (nHead) { pszOut = do_str(pszOut, pszEnd, szHead); nLen += nHead; } for (; nLen < nWidth && pszOut < pszEnd; nLen++) { *pszOut++ = '0'; } pszOut = do_str(pszOut, pszEnd, szTemp); } else { pszMsg++; while (pszArg < pszMsg && pszOut < pszEnd) { *pszOut++ = *pszArg++; } } } else { if (pszOut < pszEnd) { *pszOut++ = *pszMsg++; } } } *pszOut = '\0'; pszBuffer[cbBuffer - 1] = '\0'; } __except(EXCEPTION_EXECUTE_HANDLER) { PCHAR pszOut = pszBuffer; *pszOut = '\0'; pszOut = do_str(pszOut, pszEnd, "-exception:"); pszOut = do_base(pszOut, (UINT64)GetExceptionCode(), 10, "0123456789"); pszOut = do_str(pszOut, pszEnd, "-"); } } #if _MSC_VER >= 1900 #pragma warning(pop) #endif PCHAR SafePrintf(PCHAR pszBuffer, LONG cbBuffer, PCSTR pszMsg, ...) { va_list args; va_start(args, pszMsg); VSafePrintf(pszMsg, args, pszBuffer, cbBuffer); va_end(args); while (*pszBuffer) { pszBuffer++; } return pszBuffer; } ////////////////////////////////////////////////////////////////////////////// // static CRITICAL_SECTION s_csPipe; // Guards access to hPipe. static HANDLE s_hPipe = INVALID_HANDLE_VALUE; static DWORD s_nPipeError = 0; static FILETIME s_ftRetry = {0,0}; static BYTE s_nFacility = SYELOG_FACILITY_APPLICATION; static CHAR s_szIdent[256] = ""; static DWORD s_nProcessId = 0; static inline INT syelogCompareTimes(CONST PFILETIME pft1, CONST PFILETIME pft2) { INT64 ut1 = *(PINT64)pft1; INT64 ut2 = *(PINT64)pft2; if (ut1 < ut2) { return -1; } else if (ut1 > ut2) { return 1; } else { return 0; } } static inline VOID syelogAddMilliseconds(PFILETIME pft, DWORD nMilliseconds) { *(PINT64&)pft += ((INT64)nMilliseconds * 10000); } ////////////////////////////////////////////////////////////////////////////// // // Tries to insure that a named-pipe connection to the system log is open // If the pipe closes, the next call will immediately try to re-open the pipe. // If the pipe doesn't open again, we wait 5 minutes before trying again. // We wait 5 minutes, because each attempt may take up to a full second to // time out. // static BOOL syelogIsOpen(PFILETIME pftLog) { if (s_hPipe != INVALID_HANDLE_VALUE) { return TRUE; } if (syelogCompareTimes(pftLog, &s_ftRetry) < 0) { return FALSE; } s_hPipe = Real_CreateFileW(SYELOG_PIPE_NAMEW, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, SECURITY_ANONYMOUS, NULL); if (s_hPipe != INVALID_HANDLE_VALUE) { DWORD dwMode = PIPE_READMODE_MESSAGE; if (Real_SetNamedPipeHandleState(s_hPipe, &dwMode, NULL, NULL)) { return TRUE; } } if (Real_WaitNamedPipeW(SYELOG_PIPE_NAMEW, 2000)) { // Wait 2 seconds. // Pipe connected, change to message-read mode. // s_hPipe = Real_CreateFileW(SYELOG_PIPE_NAMEW, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, SECURITY_ANONYMOUS, NULL); if (s_hPipe != INVALID_HANDLE_VALUE) { DWORD dwMode = PIPE_READMODE_MESSAGE; if (Real_SetNamedPipeHandleState(s_hPipe, &dwMode, NULL, NULL)) { return TRUE; } } } // Couldn't open pipe. s_ftRetry = *pftLog; syelogAddMilliseconds(&s_ftRetry, 300000); // Wait 5 minute before retry. return FALSE; } VOID SyelogOpen(PCSTR pszIdentifier, BYTE nFacility) { Real_InitializeCriticalSection(&s_csPipe); if (pszIdentifier) { PCHAR pszOut = s_szIdent; PCHAR pszEnd = s_szIdent + ARRAYSIZE(s_szIdent) - 1; pszOut = do_str(pszOut, pszEnd, pszIdentifier); pszOut = do_str(pszOut, pszEnd, ": "); *pszEnd = '\0'; } else { s_szIdent[0] = '\0'; } s_nFacility = nFacility; s_nProcessId = Real_GetCurrentProcessId(); } VOID SyelogExV(BOOL fTerminate, BYTE nSeverity, PCSTR pszMsgf, va_list args) { SYELOG_MESSAGE Message; DWORD cbWritten = 0; Real_GetSystemTimeAsFileTime(&Message.ftOccurance); Message.fTerminate = fTerminate; Message.nFacility = s_nFacility; Message.nSeverity = nSeverity; Message.nProcessId = s_nProcessId; PCHAR pszBuf = Message.szMessage; PCHAR pszEnd = Message.szMessage + ARRAYSIZE(Message.szMessage) - 1; if (s_szIdent[0]) { pszBuf = do_str(pszBuf, pszEnd, s_szIdent); } *pszEnd = '\0'; VSafePrintf(pszMsgf, args, pszBuf, (int)(Message.szMessage + sizeof(Message.szMessage) - 1 - pszBuf)); pszEnd = Message.szMessage; for (; *pszEnd; pszEnd++) { // no internal contents. } // Insure that the message always ends with a '\n' // if (pszEnd > Message.szMessage) { if (pszEnd[-1] != '\n') { *pszEnd++ = '\n'; *pszEnd++ = '\0'; } else { *pszEnd++ = '\0'; } } else { *pszEnd++ = '\n'; *pszEnd++ = '\0'; } Message.nBytes = (USHORT)(pszEnd - ((PCSTR)&Message)); Real_EnterCriticalSection(&s_csPipe); if (syelogIsOpen(&Message.ftOccurance)) { if (!Real_WriteFile(s_hPipe, &Message, Message.nBytes, &cbWritten, NULL)) { s_nPipeError = GetLastError(); if (s_nPipeError == ERROR_BAD_IMPERSONATION_LEVEL) { // Don't close the file just for a temporary impersonation level. } else { if (s_hPipe != INVALID_HANDLE_VALUE) { Real_CloseHandle(s_hPipe); s_hPipe = INVALID_HANDLE_VALUE; } if (syelogIsOpen(&Message.ftOccurance)) { Real_WriteFile(s_hPipe, &Message, Message.nBytes, &cbWritten, NULL); } } } } Real_LeaveCriticalSection(&s_csPipe); } VOID SyelogV(BYTE nSeverity, PCSTR pszMsgf, va_list args) { SyelogExV(FALSE, nSeverity, pszMsgf, args); } VOID Syelog(BYTE nSeverity, PCSTR pszMsgf, ...) { va_list args; va_start(args, pszMsgf); SyelogExV(FALSE, nSeverity, pszMsgf, args); va_end(args); } VOID SyelogEx(BOOL fTerminate, BYTE nSeverity, PCSTR pszMsgf, ...) { va_list args; va_start(args, pszMsgf); SyelogExV(fTerminate, nSeverity, pszMsgf, args); va_end(args); } VOID SyelogClose(BOOL fTerminate) { if (fTerminate) { SyelogEx(TRUE, SYELOG_SEVERITY_NOTICE, "Requesting exit on close.\n"); } Real_EnterCriticalSection(&s_csPipe); if (s_hPipe != INVALID_HANDLE_VALUE) { Real_FlushFileBuffers(s_hPipe); Real_CloseHandle(s_hPipe); s_hPipe = INVALID_HANDLE_VALUE; } Real_LeaveCriticalSection(&s_csPipe); } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/syelog/syelog.h ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (syelog.h of syelog.lib) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #pragma once #ifndef _SYELOGD_H_ #define _SYELOGD_H_ #include #pragma pack(push, 1) #pragma warning(push) #pragma warning(disable: 4200) ////////////////////////////////////////////////////////////////////////////// // // #define SYELOG_PIPE_NAMEA "\\\\.\\pipe\\syelog" #define SYELOG_PIPE_NAMEW L"\\\\.\\pipe\\syelog" #ifdef UNICODE #define SYELOG_PIPE_NAME SYELOG_PIPE_NAMEW #else #define SYELOG_PIPE_NAME SYELOG_PIPE_NAMEA #endif ////////////////////////////////////////////////////////////////////////////// // #define SYELOG_MAXIMUM_MESSAGE 4086 // 4096 - sizeof(header stuff) typedef struct _SYELOG_MESSAGE { USHORT nBytes; BYTE nFacility; BYTE nSeverity; DWORD nProcessId; FILETIME ftOccurance; BOOL fTerminate; CHAR szMessage[SYELOG_MAXIMUM_MESSAGE]; } SYELOG_MESSAGE, *PSYELOG_MESSAGE; // Facility Codes. // #define SYELOG_FACILITY_KERNEL 0x10 // OS Kernel #define SYELOG_FACILITY_SECURITY 0x20 // OS Security #define SYELOG_FACILITY_LOGGING 0x30 // OS Logging-internal #define SYELOG_FACILITY_SERVICE 0x40 // User-mode system daemon #define SYELOG_FACILITY_APPLICATION 0x50 // User-mode application #define SYELOG_FACILITY_USER 0x60 // User self-generated. #define SYELOG_FACILITY_LOCAL0 0x70 // Locally defined. #define SYELOG_FACILITY_LOCAL1 0x71 // Locally defined. #define SYELOG_FACILITY_LOCAL2 0x72 // Locally defined. #define SYELOG_FACILITY_LOCAL3 0x73 // Locally defined. #define SYELOG_FACILITY_LOCAL4 0x74 // Locally defined. #define SYELOG_FACILITY_LOCAL5 0x75 // Locally defined. #define SYELOG_FACILITY_LOCAL6 0x76 // Locally defined. #define SYELOG_FACILITY_LOCAL7 0x77 // Locally defined. #define SYELOG_FACILITY_LOCAL8 0x78 // Locally defined. #define SYELOG_FACILITY_LOCAL9 0x79 // Locally defined. // Severity Codes. // #define SYELOG_SEVERITY_FATAL 0x00 // System is dead. #define SYELOG_SEVERITY_ALERT 0x10 // Take action immediately. #define SYELOG_SEVERITY_CRITICAL 0x20 // Critical condition. #define SYELOG_SEVERITY_ERROR 0x30 // Error #define SYELOG_SEVERITY_WARNING 0x40 // Warning #define SYELOG_SEVERITY_NOTICE 0x50 // Significant condition. #define SYELOG_SEVERITY_INFORMATION 0x60 // Informational #define SYELOG_SEVERITY_AUDIT_FAIL 0x66 // Audit Failed #define SYELOG_SEVERITY_AUDIT_PASS 0x67 // Audit Succeeeded #define SYELOG_SEVERITY_DEBUG 0x70 // Debugging // Logging Functions. // VOID SyelogOpen(PCSTR pszIdentifier, BYTE nFacility); VOID Syelog(BYTE nSeverity, PCSTR pszMsgf, ...); VOID SyelogV(BYTE nSeverity, PCSTR pszMsgf, va_list args); VOID SyelogClose(BOOL fTerminate); #pragma warning(pop) #pragma pack(pop) #endif // _SYELOGD_H_ // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/syelog/syelogd.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (syelogd.cpp of syelogd.exe) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include #include #include #include #pragma warning(push) #if _MSC_VER > 1400 #pragma warning(disable:6102 6103) // /analyze warnings #endif #include #pragma warning(pop) #include "syelog.h" #if (_MSC_VER < 1299) typedef ULONG * PULONG_PTR; typedef ULONG ULONG_PTR; typedef LONG * PLONG_PTR; typedef LONG LONG_PTR; #endif enum { CLIENT_AWAITING_PIPE_ACCEPT = 0x21, CLIENT_AWAITING_PIPE_DATA = 0x22, }; typedef struct _CLIENT : OVERLAPPED { HANDLE hPipe; BOOL fAwaitingAccept; PVOID Zero; SYELOG_MESSAGE Message; } CLIENT, *PCLIENT; ////////////////////////////////////////////////////////////////////////////// // BOOL s_fLogToScreen = TRUE; // Log output to screen. BOOL s_fExitAfterOne = FALSE; BOOL s_fDeltaTime = FALSE; HANDLE s_hOutFile = INVALID_HANDLE_VALUE; LONG s_nActiveClients = 0; LONGLONG s_llStartTime = 0; LONGLONG s_llLastTime = 0; BOOL LogMessageV(BYTE nSeverity, PCHAR pszMsg, ...); ////////////////////////////////////////////////////////////////////////////// // VOID MyErrExit(PCSTR pszMsg) { DWORD error = GetLastError(); LogMessageV(SYELOG_SEVERITY_FATAL, "Error %d in %s.", error, pszMsg); fprintf(stderr, "SYELOGD: Error %ld in %s.\n", error, pszMsg); fflush(stderr); exit(1); } ////////////////////////////////////////////////////////////////////////////// // static PCSTR FileTimeToString(PCHAR pszBuffer, DWORD cbBuffer, FILETIME ftTime) { (void)cbBuffer; static BOOL bGotTzi = FALSE; static DWORD dwTzi = TIME_ZONE_ID_UNKNOWN; static TIME_ZONE_INFORMATION tzi; if (!bGotTzi) { dwTzi = GetTimeZoneInformation(&tzi); if (dwTzi == TIME_ZONE_ID_UNKNOWN) { ZeroMemory(&tzi, sizeof(tzi)); } bGotTzi = TRUE; } SYSTEMTIME stUtc; SYSTEMTIME stLocal; pszBuffer[0] = '\0'; if (s_fDeltaTime) { if (s_llLastTime == 0) { s_llLastTime = s_llStartTime; } ULARGE_INTEGER ul; ul.LowPart = ftTime.dwLowDateTime; ul.HighPart = ftTime.dwHighDateTime; LONG64 delta = ul.QuadPart - s_llLastTime; s_llLastTime = ul.QuadPart; delta /= 10000; StringCchPrintfA(pszBuffer, cbBuffer, "%7I64d", delta); } else { if (!FileTimeToSystemTime(&ftTime, &stUtc)) { StringCchPrintfA(pszBuffer, cbBuffer, "ft:%16I64d", *(LONGLONG *)&ftTime); return pszBuffer; } else if (!SystemTimeToTzSpecificLocalTime(&tzi, &stUtc, &stLocal)) { CopyMemory(&stLocal, &stUtc, sizeof(stLocal)); } StringCchPrintfA(pszBuffer, cbBuffer, "%4d%02d%02d%02d%02d%02d%03d", stLocal.wYear, stLocal.wMonth, stLocal.wDay, stLocal.wHour, stLocal.wMinute, stLocal.wSecond, stLocal.wMilliseconds); } return pszBuffer; } BOOL CloseConnection(PCLIENT pClient) { LogMessageV(SYELOG_SEVERITY_INFORMATION, "Client closed pipe."); InterlockedDecrement(&s_nActiveClients); if (pClient != NULL) { if (pClient->hPipe != INVALID_HANDLE_VALUE) { FlushFileBuffers(pClient->hPipe); if (!DisconnectNamedPipe(pClient->hPipe)) { MyErrExit("DisconnectNamedPipe"); } CloseHandle(pClient->hPipe); pClient->hPipe = INVALID_HANDLE_VALUE; } GlobalFree(pClient); pClient = NULL; } if (s_fExitAfterOne) { ExitProcess(0); } return TRUE; } // Creates a pipe instance and initiate an accept request. // PCLIENT CreatePipeConnection(HANDLE hCompletionPort) { HANDLE hPipe = CreateNamedPipe(SYELOG_PIPE_NAME, // pipe name PIPE_ACCESS_INBOUND | // read-only access FILE_FLAG_OVERLAPPED, // overlapped mode PIPE_TYPE_MESSAGE | // message-type pipe PIPE_READMODE_MESSAGE | // message read mode PIPE_WAIT, // blocking mode PIPE_UNLIMITED_INSTANCES, // unlimited instances 0, // output buffer size 0, // input buffer size 20000, // client time-out NULL); // no security attributes if (hPipe == INVALID_HANDLE_VALUE) { MyErrExit("CreatePipe"); } // Allocate the client data structure. // PCLIENT pClient = (PCLIENT) GlobalAlloc(GPTR, sizeof(CLIENT)); if (pClient == NULL) { MyErrExit("GlobalAlloc pClient"); } ZeroMemory(pClient, sizeof(*pClient)); pClient->hPipe = hPipe; pClient->fAwaitingAccept = TRUE; // Associate file with our complietion port. // if (!CreateIoCompletionPort(pClient->hPipe, hCompletionPort, (ULONG_PTR)pClient, 0)) { MyErrExit("CreateIoComplietionPort pClient"); } if (!ConnectNamedPipe(hPipe, pClient)) { if (GetLastError() != ERROR_IO_PENDING && GetLastError() != ERROR_PIPE_LISTENING) { MyErrExit("ConnectNamedPipe"); } } else { LogMessageV(SYELOG_SEVERITY_INFORMATION, "ConnectNamedPipe accepted immediately."); } return pClient; } BOOL LogMessageV(BYTE nSeverity, PCHAR pszMsg, ...) { FILETIME ftOccurance; CHAR szTime[64]; GetSystemTimeAsFileTime(&ftOccurance); FileTimeToString(szTime, sizeof(szTime), ftOccurance); if (s_fLogToScreen) { printf(s_fDeltaTime ? "%-7.7s ---- --.%02x: " : "%-17.17s ---- --.%02x: " , szTime, nSeverity); va_list args; va_start(args, pszMsg); vprintf(pszMsg, args); va_end(args); printf("\n"); } if (s_hOutFile != INVALID_HANDLE_VALUE) { DWORD cbWritten = 0; CHAR szBuf[4096] = ""; PCHAR pcchEnd = szBuf + ARRAYSIZE(szBuf) - 2; PCHAR pcchCur = szBuf; HRESULT hr; hr = StringCchPrintfExA(pcchCur, pcchEnd - pcchCur, &pcchCur, NULL, STRSAFE_NULL_ON_FAILURE, s_fDeltaTime ? "%-7.7s ---- --.%02x: " : "%-17.17s ---- --.%02x: " , szTime, nSeverity); if (FAILED(hr)) { goto Cleanup; } va_list args; va_start(args, pszMsg); hr = StringCchPrintfExA(pcchCur, pcchEnd - pcchCur, &pcchCur, NULL, STRSAFE_NULL_ON_FAILURE, pszMsg, args); va_end(args); if (FAILED(hr)) { goto Cleanup; } hr = StringCchPrintfExA(pcchCur, (szBuf + ARRAYSIZE(szBuf)) - pcchCur, &pcchCur, NULL, STRSAFE_NULL_ON_FAILURE, "\n"); if (FAILED(hr)) { goto Cleanup; } Cleanup: WriteFile(s_hOutFile, szBuf, (DWORD)(pcchCur - szBuf), &cbWritten, NULL); } return TRUE; } BOOL LogMessage(PSYELOG_MESSAGE pMessage, DWORD nBytes) { // Sanity check the size of the message. // if (nBytes > pMessage->nBytes) { nBytes = pMessage->nBytes; } if (nBytes >= sizeof(*pMessage)) { nBytes = sizeof(*pMessage) - 1; } // Don't log message if there isn't and message text. // if (nBytes <= offsetof(SYELOG_MESSAGE, szMessage)) { return FALSE; } CHAR szTime[64]; FileTimeToString(szTime, sizeof(szTime), pMessage->ftOccurance); PCHAR pszMsg = pMessage->szMessage; while (*pszMsg) { pszMsg++; } while (pszMsg > pMessage->szMessage && isspace(pszMsg[-1])) { *--pszMsg = '\0'; } if (s_fLogToScreen) { printf(s_fDeltaTime ? "%-7.7s %4d %02x.%02x: %s\n" : "%-17.17s %4d %02x.%02x: %s\n", szTime, pMessage->nProcessId, pMessage->nFacility, pMessage->nSeverity, pMessage->szMessage); } if (s_hOutFile != INVALID_HANDLE_VALUE) { DWORD cbWritten = 0; CHAR szBuf[4096]; PCHAR pcchEnd = szBuf + ARRAYSIZE(szBuf); PCHAR pcchCur = szBuf; HRESULT hr; hr = StringCchPrintfExA(pcchCur, pcchEnd - pcchCur, &pcchCur, NULL, STRSAFE_NULL_ON_FAILURE, s_fDeltaTime ? "%-7.7s %4d %02x.%02x: %s\n" : "%-17.17s %4d %02x.%02x: %s\n", szTime, pMessage->nProcessId, pMessage->nFacility, pMessage->nSeverity, pMessage->szMessage); if (FAILED(hr)) { goto Cleanup; } Cleanup: WriteFile(s_hOutFile, szBuf, (DWORD)(pcchCur - szBuf), &cbWritten, NULL); } return TRUE; } DWORD WINAPI WorkerThread(LPVOID pvVoid) { PCLIENT pClient; BOOL b; LPOVERLAPPED lpo; DWORD nBytes; HANDLE hCompletionPort = (HANDLE)pvVoid; for (BOOL fKeepLooping = TRUE; fKeepLooping;) { pClient = NULL; lpo = NULL; nBytes = 0; b = GetQueuedCompletionStatus(hCompletionPort, &nBytes, (PULONG_PTR)&pClient, &lpo, INFINITE); if (!b || lpo == NULL) { fKeepLooping = FALSE; MyErrExit("GetQueuedCompletionState"); break; } else if (!b) { if (pClient) { if (GetLastError() == ERROR_BROKEN_PIPE) { LogMessageV(SYELOG_SEVERITY_INFORMATION, "Client closed pipe."); } else { LogMessageV(SYELOG_SEVERITY_ERROR, "GetQueuedCompletionStatus failed %d [%p]", GetLastError(), pClient); } CloseConnection(pClient); } continue; } if (pClient->fAwaitingAccept) { InterlockedIncrement(&s_nActiveClients); pClient->fAwaitingAccept = FALSE; b = ReadFile(pClient->hPipe, &pClient->Message, sizeof(pClient->Message), &nBytes, pClient); if (!b) { if (GetLastError() != ERROR_IO_PENDING) { LogMessageV(SYELOG_SEVERITY_ERROR, "ReadFile failed %d.", GetLastError()); continue; } } CreatePipeConnection(hCompletionPort); } else { if (nBytes < offsetof(SYELOG_MESSAGE, szMessage)) { CloseConnection(pClient); } if (pClient->Message.fTerminate) { LogMessageV(SYELOG_SEVERITY_NOTICE, "Client requested terminate on next connection close."); s_fExitAfterOne = TRUE; } LogMessage(&pClient->Message, nBytes); b = ReadFile(pClient->hPipe, &pClient->Message, sizeof(pClient->Message), &nBytes, pClient); if (!b && GetLastError() == ERROR_BROKEN_PIPE) { CloseConnection(pClient); } } } return 0; } BOOL CreateWorkers(HANDLE hCompletionPort) { DWORD dwThread; HANDLE hThread; DWORD i; SYSTEM_INFO SystemInfo; GetSystemInfo(&SystemInfo); for (i = 0; i < 2 * SystemInfo.dwNumberOfProcessors; i++) { hThread = CreateThread(NULL, 0, WorkerThread, hCompletionPort, 0, &dwThread); if (!hThread) { MyErrExit("CreateThread WorkerThread"); // Unreachable: return FALSE; } CloseHandle(hThread); } return TRUE; } ////////////////////////////////////////////////////////////////////////////// // BOOL WINAPI ControlHandler(DWORD dwCtrlType) { switch (dwCtrlType) { case CTRL_C_EVENT: case CTRL_BREAK_EVENT: case CTRL_CLOSE_EVENT: case CTRL_LOGOFF_EVENT: case CTRL_SHUTDOWN_EVENT: LogMessageV(SYELOG_SEVERITY_INFORMATION, "User requested stop."); printf("\nSYELOGD: Closing connections.\n"); if (s_hOutFile != INVALID_HANDLE_VALUE) { printf("Closing file.\n"); FlushFileBuffers(s_hOutFile); CloseHandle(s_hOutFile); s_hOutFile = INVALID_HANDLE_VALUE; } ExitProcess(0); } return FALSE; } DWORD main(int argc, char **argv) { HANDLE hCompletionPort; BOOL fNeedHelp = FALSE; GetSystemTimeAsFileTime((FILETIME *)&s_llStartTime); SetConsoleCtrlHandler(ControlHandler, TRUE); int arg = 1; for (; arg < argc; arg++) { if (argv[arg][0] == '-' || argv[arg][0] == '/') { CHAR *argn = argv[arg] + 1; CHAR *argp = argn; while (*argp && *argp != ':') { argp++; } if (*argp == ':') { *argp++ = '\0'; } switch (argn[0]) { case 'd': // Delta time. case 'D': s_fDeltaTime = TRUE; break; case 'o': // Only one. case 'O': s_fExitAfterOne = TRUE; break; case 'q': // Quiet. case 'Q': s_fLogToScreen = FALSE; break; case '?': // Help. fNeedHelp = TRUE; break; default: fNeedHelp = TRUE; printf("SYELOGD: Bad argument: %s:%s\n", argn, argp); break; } } else { if (s_hOutFile != INVALID_HANDLE_VALUE) { printf("SYELOGD: Error, more than one output file specified.\n\n"); fNeedHelp = TRUE; break; } s_hOutFile = CreateFileA(argv[arg], GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL); if (s_hOutFile == INVALID_HANDLE_VALUE) { printf("SYELOGD: Error opening output file: %s: %ld\n\n", argv[arg], GetLastError()); fNeedHelp = TRUE; break; } else { printf("SYELOGD: Logging to %s.\n", argv[arg]); } } } if (fNeedHelp) { printf("Usage:\n" " syelogd [options] {output_file}\n" "Options:\n" " /d List delta time in ms from previous event (not absolute time).\n" " /o Exit after one client disconnects.\n" " /q Disable event logging to screen (quiet mode).\n" " /? Display this help message.\n" "Summary:\n" " If given, all events will be logged to the output file.\n" "\n"); exit(1); } // Create the completion port. hCompletionPort = CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, NULL, 0); if (hCompletionPort == NULL) { MyErrExit("CreateIoCompletionPort"); } // Create completion port worker threads. // CreateWorkers(hCompletionPort); CreatePipeConnection(hCompletionPort); printf("SYELOGD: Ready for clients. Press Ctrl-C to stop.\n"); while (argc) { Sleep(10000); } SetConsoleCtrlHandler(ControlHandler, FALSE); if (s_hOutFile != INVALID_HANDLE_VALUE) { FlushFileBuffers(s_hOutFile); CloseHandle(s_hOutFile); s_hOutFile = INVALID_HANDLE_VALUE; } return 0; } // ////////////////////////////////////////////////////////////////////////////// ================================================ FILE: ext/detours/samples/talloc/Makefile ================================================ ############################################################################## ## ## Makefile for Detours Test Programs. ## ## Microsoft Research Detours Package ## ## Copyright (c) Microsoft Corporation. All rights reserved. ## !include ..\common.mak # This test tests the allocation algorithm. .dlls are carefully placed # immediately adjacent to each other to force the algorithm to look more places. # /noentry keeps the .dlls small, so they all fit at their bases !if "$(DETOURS_TARGET_PROCESSOR:64=)" == "$(DETOURS_TARGET_PROCESSOR)" # 32bit bases DETOURS_TALLOC1=0x28000000 DETOURS_TALLOC2=0x38000000 DETOURS_TALLOC3=0x48050000 DETOURS_TALLOC4=0x58000000 DETOURS_TALLOC5=0x68000000 DETOURS_TALLOC6=0x68010000 DETOURS_TALLOC7=0x68020000 DETOURS_TALLOC8=0x68030000 DETOURS_TALLOC9=0x68040000 !else # 64bit bases DETOURS_TALLOC1=0x280000000 DETOURS_TALLOC2=0x380000000 DETOURS_TALLOC3=0x480050000 DETOURS_TALLOC4=0x580000000 DETOURS_TALLOC5=0x680000000 DETOURS_TALLOC6=0x680010000 DETOURS_TALLOC7=0x680020000 DETOURS_TALLOC8=0x680030000 DETOURS_TALLOC9=0x680040000 !endif LIBS=$(LIBS) kernel32.lib psapi.lib all: dirs \ $(BIND)\tdll1x$(DETOURS_BITS).dll \ $(BIND)\tdll2x$(DETOURS_BITS).dll \ $(BIND)\tdll3x$(DETOURS_BITS).dll \ $(BIND)\tdll4x$(DETOURS_BITS).dll \ $(BIND)\tdll5x$(DETOURS_BITS).dll \ $(BIND)\tdll6x$(DETOURS_BITS).dll \ $(BIND)\tdll7x$(DETOURS_BITS).dll \ $(BIND)\tdll8x$(DETOURS_BITS).dll \ $(BIND)\tdll9x$(DETOURS_BITS).dll \ $(BIND)\talloc.exe \ \ !IF $(DETOURS_SOURCE_BROWSING)==1 $(OBJD)\tdll1x$(DETOURS_BITS).bsc \ $(OBJD)\tdll2x$(DETOURS_BITS).bsc \ $(OBJD)\tdll3x$(DETOURS_BITS).bsc \ $(OBJD)\tdll4x$(DETOURS_BITS).bsc \ $(OBJD)\tdll5x$(DETOURS_BITS).bsc \ $(OBJD)\tdll6x$(DETOURS_BITS).bsc \ $(OBJD)\tdll7x$(DETOURS_BITS).bsc \ $(OBJD)\tdll8x$(DETOURS_BITS).bsc \ $(OBJD)\tdll9x$(DETOURS_BITS).bsc \ $(OBJD)\talloc.bsc \ !ENDIF option clean: -del *~ 2>nul -del $(BIND)\tdll1x* 2>nul -del $(BIND)\tdll2x* 2>nul -del $(BIND)\tdll3x* 2>nul -del $(BIND)\tdll4x* 2>nul -del $(BIND)\tdll5x* 2>nul -del $(BIND)\tdll6x* 2>nul -del $(BIND)\tdll7x* 2>nul -del $(BIND)\tdll8x* 2>nul -del $(BIND)\tdll9x* 2>nul -del $(BIND)\talloc* 2>nul -rmdir /q /s $(OBJD) 2>nul realclean: clean -rmdir /q /s $(OBJDS) 2>nul dirs: @if not exist $(BIND) mkdir $(BIND) && echo. Created $(BIND) @if not exist $(OBJD) mkdir $(OBJD) && echo. Created $(OBJD) ############################################################################## $(OBJD)\talloc.obj : talloc.cpp $(BIND)\talloc.exe : $(OBJD)\talloc.obj $(DEPS) cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb $(OBJD)\talloc.obj \ /link $(LINKFLAGS) $(LIBS) \ $(BIND)\tdll1x$(DETOURS_BITS).lib \ $(BIND)\tdll2x$(DETOURS_BITS).lib \ $(BIND)\tdll3x$(DETOURS_BITS).lib \ $(BIND)\tdll4x$(DETOURS_BITS).lib \ $(BIND)\tdll5x$(DETOURS_BITS).lib \ $(BIND)\tdll6x$(DETOURS_BITS).lib \ $(BIND)\tdll7x$(DETOURS_BITS).lib \ $(BIND)\tdll8x$(DETOURS_BITS).lib \ $(BIND)\tdll9x$(DETOURS_BITS).lib \ /subsystem:console /entry:WinMainCRTStartup $(OBJD)\talloc.bsc : $(OBJD)\talloc.obj bscmake /v /n /o $@ $(OBJD)\talloc.sbr $(OBJD)\tdll1x.obj : tdll1x.cpp # /noentry keeps the .dlls small, so they all fit at their bases $(BIND)\tdll1x$(DETOURS_BITS).dll : $(OBJD)\tdll1x.obj $(DEPS) cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb \ $(OBJD)\tdll1x.obj /LD \ /link $(LINKFLAGS:/profile=/fixed) $(LIBS) \ /subsystem:windows \ /noentry \ /base:$(DETOURS_TALLOC1) $(OBJD)\tdll1x$(DETOURS_BITS).bsc : $(OBJD)\tdll1x.obj bscmake /v /n /o $@ $(OBJD)\tdll1x.sbr $(OBJD)\tdll2x.obj : tdll2x.cpp # /noentry keeps the .dlls small, so they all fit at their bases $(BIND)\tdll2x$(DETOURS_BITS).dll : $(OBJD)\tdll2x.obj $(DEPS) cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb \ $(OBJD)\tdll2x.obj /LD \ /link $(LINKFLAGS:/profile=/fixed) $(LIBS) \ /subsystem:console \ /noentry \ /base:$(DETOURS_TALLOC2) $(OBJD)\tdll2x$(DETOURS_BITS).bsc : $(OBJD)\tdll2x.obj bscmake /v /n /o $@ $(OBJD)\tdll2x.sbr $(OBJD)\tdll3x.obj : tdll3x.cpp # /noentry keeps the .dlls small, so they all fit at their bases $(BIND)\tdll3x$(DETOURS_BITS).dll : $(OBJD)\tdll3x.obj $(DEPS) cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb \ $(OBJD)\tdll3x.obj /LD \ /link $(LINKFLAGS:/profile=/fixed) $(LIBS) \ /subsystem:console \ /noentry \ /base:$(DETOURS_TALLOC3) $(OBJD)\tdll3x$(DETOURS_BITS).bsc : $(OBJD)\tdll3x.obj bscmake /v /n /o $@ $(OBJD)\tdll3x.sbr $(OBJD)\tdll4x.obj : tdll4x.cpp # /noentry keeps the .dlls small, so they all fit at their bases $(BIND)\tdll4x$(DETOURS_BITS).dll : $(OBJD)\tdll4x.obj $(DEPS) cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb \ $(OBJD)\tdll4x.obj /LD \ /link $(LINKFLAGS:/profile=/fixed) $(LIBS) \ /subsystem:console \ /noentry \ /base:$(DETOURS_TALLOC4) $(OBJD)\tdll4x$(DETOURS_BITS).bsc : $(OBJD)\tdll4x.obj bscmake /v /n /o $@ $(OBJD)\tdll4x.sbr $(OBJD)\tdll5x.obj : tdll5x.cpp # /noentry keeps the .dlls small, so they all fit at their bases $(BIND)\tdll5x$(DETOURS_BITS).dll : $(OBJD)\tdll5x.obj $(DEPS) cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb \ $(OBJD)\tdll5x.obj /LD \ /link $(LINKFLAGS:/profile=/fixed) $(LIBS) \ /subsystem:console \ /noentry \ /base:$(DETOURS_TALLOC5) $(OBJD)\tdll5x$(DETOURS_BITS).bsc : $(OBJD)\tdll5x.obj bscmake /v /n /o $@ $(OBJD)\tdll5x.sbr $(OBJD)\tdll6x.obj : tdll6x.cpp # /noentry keeps the .dlls small, so they all fit at their bases $(BIND)\tdll6x$(DETOURS_BITS).dll : $(OBJD)\tdll6x.obj $(DEPS) cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb \ $(OBJD)\tdll6x.obj /LD \ /link $(LINKFLAGS:/profile=/fixed) $(LIBS) \ /subsystem:console \ /noentry \ /base:$(DETOURS_TALLOC6) $(OBJD)\tdll6x$(DETOURS_BITS).bsc : $(OBJD)\tdll6x.obj bscmake /v /n /o $@ $(OBJD)\tdll6x.sbr $(OBJD)\tdll7x.obj : tdll7x.cpp # /noentry keeps the .dlls small, so they all fit at their bases $(BIND)\tdll7x$(DETOURS_BITS).dll : $(OBJD)\tdll7x.obj $(DEPS) cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb \ $(OBJD)\tdll7x.obj /LD \ /link $(LINKFLAGS:/profile=/fixed) $(LIBS) \ /subsystem:console \ /noentry \ /base:$(DETOURS_TALLOC7) $(OBJD)\tdll7x$(DETOURS_BITS).bsc : $(OBJD)\tdll7x.obj bscmake /v /n /o $@ $(OBJD)\tdll7x.sbr $(OBJD)\tdll8x.obj : tdll8x.cpp # /noentry keeps the .dlls small, so they all fit at their bases $(BIND)\tdll8x$(DETOURS_BITS).dll : $(OBJD)\tdll8x.obj $(DEPS) cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb \ $(OBJD)\tdll8x.obj /LD \ /link $(LINKFLAGS:/profile=/fixed) $(LIBS) \ /subsystem:console \ /noentry \ /base:$(DETOURS_TALLOC8) $(OBJD)\tdll8x$(DETOURS_BITS).bsc : $(OBJD)\tdll8x.obj bscmake /v /n /o $@ $(OBJD)\tdll8x.sbr $(OBJD)\tdll9x.obj : tdll9x.cpp # /noentry keeps the .dlls small, so they all fit at their bases $(BIND)\tdll9x$(DETOURS_BITS).dll : $(OBJD)\tdll9x.obj $(DEPS) cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb \ $(OBJD)\tdll9x.obj /LD \ /link $(LINKFLAGS:/profile=/fixed) $(LIBS) \ /subsystem:console \ /noentry \ /base:$(DETOURS_TALLOC9) $(OBJD)\tdll9x$(DETOURS_BITS).bsc : $(OBJD)\tdll9x.obj bscmake /v /n /o $@ $(OBJD)\tdll9x.sbr ############################################### Install non-bit-size binaries. !IF "$(DETOURS_OPTION_PROCESSOR)" != "" $(OPTD)\tdll1x$(DETOURS_OPTION_BITS).dll: $(OPTD)\tdll1x$(DETOURS_OPTION_BITS).pdb: $(OPTD)\tdll2x$(DETOURS_OPTION_BITS).dll: $(OPTD)\tdll2x$(DETOURS_OPTION_BITS).pdb: $(OPTD)\tdll3x$(DETOURS_OPTION_BITS).dll: $(OPTD)\tdll3x$(DETOURS_OPTION_BITS).pdb: $(OPTD)\tdll4x$(DETOURS_OPTION_BITS).dll: $(OPTD)\tdll4x$(DETOURS_OPTION_BITS).pdb: $(OPTD)\tdll5x$(DETOURS_OPTION_BITS).dll: $(OPTD)\tdll5x$(DETOURS_OPTION_BITS).pdb: $(OPTD)\tdll6x$(DETOURS_OPTION_BITS).dll: $(OPTD)\tdll6x$(DETOURS_OPTION_BITS).pdb: $(OPTD)\tdll7x$(DETOURS_OPTION_BITS).dll: $(OPTD)\tdll7x$(DETOURS_OPTION_BITS).pdb: $(OPTD)\tdll8x$(DETOURS_OPTION_BITS).dll: $(OPTD)\tdll8x$(DETOURS_OPTION_BITS).pdb: $(OPTD)\tdll9x$(DETOURS_OPTION_BITS).dll: $(OPTD)\tdll9x$(DETOURS_OPTION_BITS).pdb: $(BIND)\tdll1x$(DETOURS_OPTION_BITS).dll : $(OPTD)\tdll1x$(DETOURS_OPTION_BITS).dll @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\tdll1x$(DETOURS_OPTION_BITS).pdb : $(OPTD)\tdll1x$(DETOURS_OPTION_BITS).pdb @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\tdll2x$(DETOURS_OPTION_BITS).dll : $(OPTD)\tdll2x$(DETOURS_OPTION_BITS).dll @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\tdll2x$(DETOURS_OPTION_BITS).pdb : $(OPTD)\tdll2x$(DETOURS_OPTION_BITS).pdb @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\tdll3x$(DETOURS_OPTION_BITS).dll : $(OPTD)\tdll3x$(DETOURS_OPTION_BITS).dll @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\tdll3x$(DETOURS_OPTION_BITS).pdb : $(OPTD)\tdll3x$(DETOURS_OPTION_BITS).pdb @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\tdll4x$(DETOURS_OPTION_BITS).dll : $(OPTD)\tdll4x$(DETOURS_OPTION_BITS).dll @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\tdll4x$(DETOURS_OPTION_BITS).pdb : $(OPTD)\tdll4x$(DETOURS_OPTION_BITS).pdb @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\tdll5x$(DETOURS_OPTION_BITS).dll : $(OPTD)\tdll5x$(DETOURS_OPTION_BITS).dll @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\tdll5x$(DETOURS_OPTION_BITS).pdb : $(OPTD)\tdll5x$(DETOURS_OPTION_BITS).pdb @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\tdll6x$(DETOURS_OPTION_BITS).dll : $(OPTD)\tdll6x$(DETOURS_OPTION_BITS).dll @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\tdll6x$(DETOURS_OPTION_BITS).pdb : $(OPTD)\tdll6x$(DETOURS_OPTION_BITS).pdb @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\tdll7x$(DETOURS_OPTION_BITS).dll : $(OPTD)\tdll7x$(DETOURS_OPTION_BITS).dll @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\tdll7x$(DETOURS_OPTION_BITS).pdb : $(OPTD)\tdll7x$(DETOURS_OPTION_BITS).pdb @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\tdll8x$(DETOURS_OPTION_BITS).dll : $(OPTD)\tdll8x$(DETOURS_OPTION_BITS).dll @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\tdll8x$(DETOURS_OPTION_BITS).pdb : $(OPTD)\tdll8x$(DETOURS_OPTION_BITS).pdb @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\tdll9x$(DETOURS_OPTION_BITS).dll : $(OPTD)\tdll9x$(DETOURS_OPTION_BITS).dll @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\tdll9x$(DETOURS_OPTION_BITS).pdb : $(OPTD)\tdll9x$(DETOURS_OPTION_BITS).pdb @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). option: \ $(BIND)\tdll1x$(DETOURS_OPTION_BITS).dll \ $(BIND)\tdll1x$(DETOURS_OPTION_BITS).pdb \ $(BIND)\tdll2x$(DETOURS_OPTION_BITS).dll \ $(BIND)\tdll2x$(DETOURS_OPTION_BITS).pdb \ $(BIND)\tdll3x$(DETOURS_OPTION_BITS).dll \ $(BIND)\tdll3x$(DETOURS_OPTION_BITS).pdb \ $(BIND)\tdll4x$(DETOURS_OPTION_BITS).dll \ $(BIND)\tdll4x$(DETOURS_OPTION_BITS).pdb \ $(BIND)\tdll5x$(DETOURS_OPTION_BITS).dll \ $(BIND)\tdll5x$(DETOURS_OPTION_BITS).pdb \ $(BIND)\tdll6x$(DETOURS_OPTION_BITS).dll \ $(BIND)\tdll6x$(DETOURS_OPTION_BITS).pdb \ $(BIND)\tdll7x$(DETOURS_OPTION_BITS).dll \ $(BIND)\tdll7x$(DETOURS_OPTION_BITS).pdb \ $(BIND)\tdll8x$(DETOURS_OPTION_BITS).dll \ $(BIND)\tdll8x$(DETOURS_OPTION_BITS).pdb \ $(BIND)\tdll9x$(DETOURS_OPTION_BITS).dll \ $(BIND)\tdll9x$(DETOURS_OPTION_BITS).pdb \ !ELSE option: !ENDIF ############################################################################## test: all $(BIND)\talloc.exe ################################################################# End of File. ================================================ FILE: ext/detours/samples/talloc/NORMAL_IA64.TXT ================================================ talloc.exe: Detoured functions. Address Size: Typ Sta Prot Ini : Contents ------------ ------------: --- --- ---- --- : ----------------- Exe: 13f660000 100000000 3f660000: fre --- : 13f660000 2000: img com r-- rcx : TALLOC.EXE 13f6ce000 100802000: fre --- : Dll1: 280000000 200000000 3fed0000: fre --- : 23fed0000 10000: pri com r-x rwx : 23fee0000 2000: pri res --- : 23fee2000 e000: fre --- : 23fef0000 10000: pri res --- : 23ff00000 100000: pri res --- : 240000000 40000000: pri res --- : 280000000 2000: img com r-- rcx : TDLL1X64.DLL 280028000 8000: fre --- : 280030000 7ffd0000: pri res --- : Dll2: 380000000 300000000 80000000: pri res --- : 380000000 2000: img com r-- rcx : TDLL2X64.DLL 380028000 8000: fre --- : 380030000 40000000: pri res --- : 3c0030000 100000: pri res --- : 3c0130000 10000: pri res --- : 3c0140000 2000: pri res --- : 3c0142000 e000: fre --- : 3c0150000 10000: pri com r-x rwx : 3c0160000 3fea0000: fre --- : Dll3: 480000000 400000000 40000000: pri res --- : 440000000 100000: pri res --- : 440100000 10000: pri res --- : 440110000 2000: pri res --- : 440112000 e000: fre --- : 440120000 10000: pri com r-x rwx : 440130000 3fed0000: fre --- : 480000000 2000: img com r-- rcx : TDLL3X64.DLL 480028000 8000: fre --- : 480030000 7ffd0000: pri res --- : Dll4: 580000000 500000000 80000000: pri res --- : 580000000 2000: img com r-- rcx : TDLL4X64.DLL 580028000 3fea8000: fre --- : 5bfed0000 10000: pri com r-x rwx : 5bfee0000 2000: pri res --- : 5bfee2000 e000: fre --- : 5bfef0000 10000: pri res --- : 5bff00000 100000: pri res --- : 5c0000000 40000000: pri res --- : Dll5: 680000000 600000000 f0000: fre --- : 6000f0000 10000: pri com r-x rwx : 600100000 7ff00000: pri res --- : 680000000 2000: img com r-- rcx : TDLL5X64.DLL 680028000 18000: fre --- : 680040000 2000: img com r-- rcx : TDLL6X64.DLL 680068000 18000: fre --- : 680080000 2000: img com r-- rcx : TDLL7X64.DLL 6800a8000 18000: fre --- : 6800c0000 2000: img com r-- rcx : TDLL8X64.DLL 6800e8000 18000: fre --- : 680100000 2000: img com r-- rcx : TDLL9X64.DLL 680128000 8000: fre --- : 680130000 7fe00000: pri res --- : 6fff30000 10000: pri com r-x rwx : 6fff40000 6f3fbdd0000: fre --- : talloc.exe: 1 calls to Dll1Function ================================================ FILE: ext/detours/samples/talloc/NORMAL_X64.TXT ================================================ talloc.exe: Detoured functions. Address Size: Typ Sta Prot Ini : Contents ------------ ------------: --- --- ---- --- : ----------------- Exe: 13f7f0000 100000000 3f7f0000: fre --- : 13f7f0000 1000: img com r-- rcx : TALLOC.EXE 13f81e000 1006b2000: fre --- : Dll1: 280000000 200000000 3fed0000: fre --- : 23fed0000 10000: pri com r-x rwx : 23fee0000 1000: pri res --- : 23fee1000 f000: fre --- : 23fef0000 10000: pri res --- : 23ff00000 100000: pri res --- : 240000000 40000000: pri res --- : 280000000 1000: img com r-- rcx : TDLL1X64.DLL 280010000 7fff0000: pri res --- : Dll2: 380000000 300000000 80000000: pri res --- : 380000000 1000: img com r-- rcx : TDLL2X64.DLL 380010000 40000000: pri res --- : 3c0010000 100000: pri res --- : 3c0110000 10000: pri res --- : 3c0120000 1000: pri res --- : 3c0121000 f000: fre --- : 3c0130000 10000: pri com r-x rwx : 3c0140000 3fec0000: fre --- : Dll3: 480000000 400000000 40000000: pri res --- : 440000000 100000: pri res --- : 440100000 10000: pri res --- : 440110000 1000: pri res --- : 440111000 f000: fre --- : 440120000 10000: pri com r-x rwx : 440130000 3fed0000: fre --- : 480000000 1000: img com r-- rcx : TDLL3X64.DLL 480010000 7fff0000: pri res --- : Dll4: 580000000 500000000 80000000: pri res --- : 580000000 1000: img com r-- rcx : TDLL4X64.DLL 580010000 3fec0000: fre --- : 5bfed0000 10000: pri com r-x rwx : 5bfee0000 1000: pri res --- : 5bfee1000 f000: fre --- : 5bfef0000 10000: pri res --- : 5bff00000 100000: pri res --- : 5c0000000 40000000: pri res --- : Dll5: 680000000 600000000 f0000: fre --- : 6000f0000 10000: pri com r-x rwx : 600100000 7ff00000: pri res --- : 680000000 1000: img com r-- rcx : TDLL5X64.DLL 680010000 30000: fre --- : 680040000 1000: img com r-- rcx : TDLL6X64.DLL 680050000 30000: fre --- : 680080000 1000: img com r-- rcx : TDLL7X64.DLL 680090000 30000: fre --- : 6800c0000 1000: img com r-- rcx : TDLL8X64.DLL 6800d0000 30000: fre --- : 680100000 1000: img com r-- rcx : TDLL9X64.DLL 680110000 7fe00000: pri res --- : 6fff10000 10000: pri com r-x rwx : 6fff20000 7f7fdf70000: fre --- : talloc.exe: 1 calls to Dll1Function ================================================ FILE: ext/detours/samples/talloc/talloc.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (talloc.cpp of talloc.exe) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #define PSAPI_VERSION 2 #include #include #include #pragma warning(push) #if _MSC_VER > 1400 #pragma warning(disable:6102 6103) // /analyze warnings #endif #include #pragma warning(pop) #include #include ////////////////////////////////////////////////////////////////////////////// void TypeToString(DWORD Type, char *pszBuffer, size_t cBuffer) { if (Type == MEM_IMAGE) { StringCchPrintfA(pszBuffer, cBuffer, "img"); } else if (Type == MEM_MAPPED) { StringCchPrintfA(pszBuffer, cBuffer, "map"); } else if (Type == MEM_PRIVATE) { StringCchPrintfA(pszBuffer, cBuffer, "pri"); } else if (Type == 0) { StringCchPrintfA(pszBuffer, cBuffer, " "); } else { StringCchPrintfA(pszBuffer, cBuffer, "%x", Type); } } void StateToString(DWORD State, char *pszBuffer, size_t cBuffer) { if (State == MEM_COMMIT) { StringCchPrintfA(pszBuffer, cBuffer, "com"); } else if (State == MEM_FREE) { StringCchPrintfA(pszBuffer, cBuffer, "fre"); } else if (State == MEM_RESERVE) { StringCchPrintfA(pszBuffer, cBuffer, "res"); } else { StringCchPrintfA(pszBuffer, cBuffer, "%x", State); } } void ProtectToString(DWORD Protect, char *pszBuffer, size_t cBuffer) { if (Protect == 0) { StringCchPrintfA(pszBuffer, cBuffer, ""); } else if (Protect == PAGE_EXECUTE) { StringCchPrintfA(pszBuffer, cBuffer, "--x"); } else if (Protect == PAGE_EXECUTE_READ) { StringCchPrintfA(pszBuffer, cBuffer, "r-x"); } else if (Protect == PAGE_EXECUTE_READWRITE) { StringCchPrintfA(pszBuffer, cBuffer, "rwx"); } else if (Protect == PAGE_EXECUTE_WRITECOPY) { StringCchPrintfA(pszBuffer, cBuffer, "rcx"); } else if (Protect == PAGE_NOACCESS) { StringCchPrintfA(pszBuffer, cBuffer, "---"); } else if (Protect == PAGE_READONLY) { StringCchPrintfA(pszBuffer, cBuffer, "r--"); } else if (Protect == PAGE_READWRITE) { StringCchPrintfA(pszBuffer, cBuffer, "rw-"); } else if (Protect == PAGE_WRITECOPY) { StringCchPrintfA(pszBuffer, cBuffer, "rc-"); } else if (Protect == (PAGE_GUARD | PAGE_EXECUTE)) { StringCchPrintfA(pszBuffer, cBuffer, "g--x"); } else if (Protect == (PAGE_GUARD | PAGE_EXECUTE_READ)) { StringCchPrintfA(pszBuffer, cBuffer, "gr-x"); } else if (Protect == (PAGE_GUARD | PAGE_EXECUTE_READWRITE)) { StringCchPrintfA(pszBuffer, cBuffer, "grwx"); } else if (Protect == (PAGE_GUARD | PAGE_EXECUTE_WRITECOPY)) { StringCchPrintfA(pszBuffer, cBuffer, "grcx"); } else if (Protect == (PAGE_GUARD | PAGE_NOACCESS)) { StringCchPrintfA(pszBuffer, cBuffer, "g---"); } else if (Protect == (PAGE_GUARD | PAGE_READONLY)) { StringCchPrintfA(pszBuffer, cBuffer, "gr--"); } else if (Protect == (PAGE_GUARD | PAGE_READWRITE)) { StringCchPrintfA(pszBuffer, cBuffer, "grw-"); } else if (Protect == (PAGE_GUARD | PAGE_WRITECOPY)) { StringCchPrintfA(pszBuffer, cBuffer, "grc-"); } else { StringCchPrintfA(pszBuffer, cBuffer, "%x", Protect); } } ULONG PadToPage(ULONG Size) { return (Size & 0xfff) ? Size + 0x1000 - (Size & 0xfff) : Size; } size_t NextAt(size_t start) { size_t next = start; for (;;) { MEMORY_BASIC_INFORMATION mbi; ZeroMemory(&mbi, sizeof(mbi)); if (VirtualQuery((PVOID)next, &mbi, sizeof(mbi)) == 0) { break; } if ((mbi.RegionSize & 0xfff) == 0xfff) { break; } if ((size_t)mbi.AllocationBase != start) { break; } next = (size_t)mbi.BaseAddress + mbi.RegionSize; } return next; } size_t RoundUpRegion(size_t value) { size_t diff = value & 0xffff; return (diff != 0) ? value + 0x10000 - diff : value; } VOID DumpProcessHeaders() { printf(" %12s %12s: %3s %3s %4s %3s : %8s\n", "Address", "Size", "Typ", "Sta", "Prot", "Ini", "Contents"); printf(" %12s %12s: %3s %3s %4s %3s : %8s\n", "------------", "------------", "---", "---", "----", "---", "-----------------"); } BOOL DumpProcess(UINT64 lo64, UINT64 hi64) { #ifdef _WIN64 ULONG_PTR lo = lo64; ULONG_PTR hi = hi64; #else ULONG_PTR lo = (size_t)(lo64 >> 4); ULONG_PTR hi = (size_t)(hi64 >> 4); #endif size_t base; size_t next; MEMORY_BASIC_INFORMATION mbi; for (next = lo; next < hi;) { base = next; ZeroMemory(&mbi, sizeof(mbi)); if (VirtualQuery((PVOID)base, &mbi, sizeof(mbi)) == 0) { break; } if ((mbi.RegionSize & 0xfff) == 0xfff) { break; } if ((size_t)mbi.BaseAddress < lo) { base = (size_t)mbi.BaseAddress; } size_t size = ((size_t)mbi.BaseAddress + mbi.RegionSize) - base; next = (size_t)mbi.BaseAddress + mbi.RegionSize; CHAR szType[16]; TypeToString(mbi.Type, szType, ARRAYSIZE(szType)); CHAR szState[16]; StateToString(mbi.State, szState, ARRAYSIZE(szState)); CHAR szProtect[16]; ProtectToString(mbi.Protect, szProtect, ARRAYSIZE(szProtect)); CHAR szAllocProtect[16]; ProtectToString(mbi.AllocationProtect, szAllocProtect, ARRAYSIZE(szAllocProtect)); CHAR szFile[MAX_PATH]; szFile[0] = '\0'; DWORD cb = 0; PCHAR pszFile = szFile; if (base == (size_t)mbi.AllocationBase) { next = NextAt(base); cb = GetMappedFileNameA(GetCurrentProcess(), mbi.AllocationBase, szFile, ARRAYSIZE(szFile)); if (cb > 0) { for (DWORD c = 0; c < cb; c++) { szFile[c] = (char)toupper(szFile[c]); } szFile[cb] = '\0'; } else { szFile[0] = '\0'; } if ((pszFile = strrchr(szFile, '\\')) == NULL) { pszFile = szFile; } else { pszFile++; } } printf("%c %12zx %12zx: %3s %3s %4s %3s : %s\n", " *"[base == (size_t)mbi.AllocationBase], base, size, szType, szState, szProtect, szAllocProtect, pszFile); } return TRUE; } ////////////////////////////////////////////////////////////////////////////// __declspec(dllimport) DWORD WINAPI Dll1Function(DWORD Value); __declspec(dllimport) DWORD WINAPI Dll2Function(DWORD Value); __declspec(dllimport) DWORD WINAPI Dll3Function(DWORD Value); __declspec(dllimport) DWORD WINAPI Dll4Function(DWORD Value); __declspec(dllimport) DWORD WINAPI Dll5Function(DWORD Value); __declspec(dllimport) DWORD WINAPI Dll6Function(DWORD Value); __declspec(dllimport) DWORD WINAPI Dll7Function(DWORD Value); __declspec(dllimport) DWORD WINAPI Dll8Function(DWORD Value); __declspec(dllimport) DWORD WINAPI Dll9Function(DWORD Value); static LONG dwCountDll1 = 0; static LONG dwCountDll2 = 0; static LONG dwCountDll3 = 0; static LONG dwCountDll4 = 0; static LONG dwCountDll5 = 0; static LONG dwCountDll6 = 0; static LONG dwCountDll7 = 0; static LONG dwCountDll8 = 0; static LONG dwCountDll9 = 0; static DWORD (WINAPI * TrueDll1Function)(DWORD Value) = Dll1Function; static DWORD (WINAPI * TrueDll2Function)(DWORD Value) = Dll2Function; static DWORD (WINAPI * TrueDll3Function)(DWORD Value) = Dll3Function; static DWORD (WINAPI * TrueDll4Function)(DWORD Value) = Dll4Function; static DWORD (WINAPI * TrueDll5Function)(DWORD Value) = Dll5Function; static DWORD (WINAPI * TrueDll6Function)(DWORD Value) = Dll6Function; static DWORD (WINAPI * TrueDll7Function)(DWORD Value) = Dll7Function; static DWORD (WINAPI * TrueDll8Function)(DWORD Value) = Dll8Function; static DWORD (WINAPI * TrueDll9Function)(DWORD Value) = Dll9Function; DWORD WINAPI MineDll1Function(DWORD Value) { Value = TrueDll1Function(Value); InterlockedIncrement(&dwCountDll1); return Value; } DWORD WINAPI MineDll2Function(DWORD Value) { Value = TrueDll2Function(Value); InterlockedIncrement(&dwCountDll2); return Value; } DWORD WINAPI MineDll3Function(DWORD Value) { Value = TrueDll3Function(Value); InterlockedIncrement(&dwCountDll3); return Value; } DWORD WINAPI MineDll4Function(DWORD Value) { Value = TrueDll4Function(Value); InterlockedIncrement(&dwCountDll4); return Value; } DWORD WINAPI MineDll5Function(DWORD Value) { Value = TrueDll5Function(Value); InterlockedIncrement(&dwCountDll5); return Value; } DWORD WINAPI MineDll6Function(DWORD Value) { Value = TrueDll6Function(Value); InterlockedIncrement(&dwCountDll6); return Value; } DWORD WINAPI MineDll7Function(DWORD Value) { Value = TrueDll7Function(Value); InterlockedIncrement(&dwCountDll7); return Value; } DWORD WINAPI MineDll8Function(DWORD Value) { Value = TrueDll8Function(Value); InterlockedIncrement(&dwCountDll8); return Value; } DWORD WINAPI MineDll9Function(DWORD Value) { Value = TrueDll9Function(Value); InterlockedIncrement(&dwCountDll9); return Value; } void Reserve(ULONG_PTR addr, ULONG_PTR size) { PVOID mem = VirtualAlloc((PVOID)addr, size, MEM_RESERVE, PAGE_NOACCESS); if (mem != (PVOID)addr) { printf("*** Reservation failed: %p != %p\n", mem, (PVOID)addr); } } int WINAPI WinMain(HINSTANCE hinst, HINSTANCE hprev, LPSTR lpszCmdLine, int nCmdShow) { (void)hinst; (void)hprev; (void)lpszCmdLine; (void)nCmdShow; DWORD error = NO_ERROR; size_t Dll1 = (size_t)LoadLibraryA("tdll1x" DETOURS_STRINGIFY(DETOURS_BITS) ".dll"); size_t Dll2 = (size_t)LoadLibraryA("tdll2x" DETOURS_STRINGIFY(DETOURS_BITS) ".dll"); size_t Dll3 = (size_t)LoadLibraryA("tdll3x" DETOURS_STRINGIFY(DETOURS_BITS) ".dll"); size_t Dll4 = (size_t)LoadLibraryA("tdll4x" DETOURS_STRINGIFY(DETOURS_BITS) ".dll"); size_t Dll5 = (size_t)LoadLibraryA("tdll5x" DETOURS_STRINGIFY(DETOURS_BITS) ".dll"); size_t Dll6 = (size_t)LoadLibraryA("tdll6x" DETOURS_STRINGIFY(DETOURS_BITS) ".dll"); size_t Dll7 = (size_t)LoadLibraryA("tdll7x" DETOURS_STRINGIFY(DETOURS_BITS) ".dll"); size_t Dll8 = (size_t)LoadLibraryA("tdll8x" DETOURS_STRINGIFY(DETOURS_BITS) ".dll"); size_t Dll9 = (size_t)LoadLibraryA("tdll9x" DETOURS_STRINGIFY(DETOURS_BITS) ".dll"); size_t DllEnd = RoundUpRegion(NextAt(Dll1)); ULONG_PTR DllSize = (DllEnd - Dll1); (void)Dll6; (void)Dll7; (void)Dll8; // Force allocation below moving lower. Reserve(Dll1 - 0x40000000, 0x40000000); Reserve(Dll1 - 0x40100000, 0x00100000); Reserve(Dll1 - 0x40110000, 0x00010000); Reserve(Dll1 - 0x40120000, 0x00001000); Reserve(Dll1 + DllSize, 0x80000000 - DllSize); // Force allocation above moving higher. Reserve(Dll2 - 0x80000000, 0x80000000); Reserve(Dll2 + DllSize, 0x40000000); Reserve(Dll2 + 0x40000000 + DllSize, 0x00100000); Reserve(Dll2 + 0x40100000 + DllSize, 0x00010000); Reserve(Dll2 + 0x40110000 + DllSize, 0x00001000); // Force allocation below moving higher. Reserve(Dll3 - 0x80000000, 0x40000000); Reserve(Dll3 - 0x40000000, 0x00100000); Reserve(Dll3 - 0x3ff00000, 0x00010000); Reserve(Dll3 - 0x3fef0000, 0x00001000); Reserve(Dll3 + DllSize, 0x80000000 - DllSize); // Force allocation above moving lower. Reserve(Dll4 - 0x80000000, 0x80000000); Reserve(Dll4 + 0x40000000, 0x40000000); Reserve(Dll4 + 0x3ff00000, 0x00100000); Reserve(Dll4 + 0x3fef0000, 0x00010000); Reserve(Dll4 + 0x3fee0000, 0x00001000); // Force allocation above and below. Reserve(Dll5 - 0x7ff00000, 0x7ff00000); Reserve(Dll9 + DllSize, 0x7fe00000); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)TrueDll1Function, MineDll1Function); error = DetourTransactionCommit(); if (error != NO_ERROR) { failed: printf("talloc.exe: Error detouring functions: %ld\n", error); exit(1); } DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)TrueDll2Function, MineDll2Function); error = DetourTransactionCommit(); if (error != NO_ERROR) { goto failed; } DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)TrueDll3Function, MineDll3Function); error = DetourTransactionCommit(); if (error != NO_ERROR) { goto failed; } DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)TrueDll4Function, MineDll4Function); error = DetourTransactionCommit(); if (error != NO_ERROR) { goto failed; } DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)TrueDll5Function, MineDll5Function); error = DetourTransactionCommit(); if (error != NO_ERROR) { goto failed; } DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)TrueDll6Function, MineDll6Function); error = DetourTransactionCommit(); if (error != NO_ERROR) { goto failed; } DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)TrueDll7Function, MineDll7Function); error = DetourTransactionCommit(); if (error != NO_ERROR) { goto failed; } DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)TrueDll8Function, MineDll8Function); error = DetourTransactionCommit(); if (error != NO_ERROR) { goto failed; } DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)TrueDll9Function, MineDll9Function); error = DetourTransactionCommit(); if (error != NO_ERROR) { goto failed; } printf("talloc.exe: Detoured functions.\n"); printf("\n"); DumpProcessHeaders(); printf("%-47s %17zx\n", "Exe:", (size_t)GetModuleHandleW(NULL)); DumpProcess(0x100000000, 0x200000000); printf("%-47s %17zx\n", "Dll1:", Dll1); DumpProcess(0x200000000, 0x300000000); printf("%-47s %17zx\n", "Dll2:", Dll2); DumpProcess(0x300000000, 0x400000000); printf("%-47s %17zx\n", "Dll3:", Dll3); DumpProcess(0x400000000, 0x500000000); printf("%-47s %17zx\n", "Dll4:", Dll4); DumpProcess(0x500000000, 0x600000000); printf("%-47s %17zx\n", "Dll5:", Dll5); DumpProcess(0x600000000, 0x700000000); fflush(stdout); Dll1Function(1); Dll2Function(2); Dll2Function(3); Dll3Function(4); Dll3Function(5); Dll3Function(6); Dll4Function(7); Dll5Function(8); Dll6Function(9); Dll7Function(10); Dll8Function(10); Dll9Function(10); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourDetach(&(PVOID&)TrueDll1Function, MineDll1Function); DetourDetach(&(PVOID&)TrueDll2Function, MineDll2Function); DetourDetach(&(PVOID&)TrueDll3Function, MineDll3Function); DetourDetach(&(PVOID&)TrueDll4Function, MineDll4Function); DetourDetach(&(PVOID&)TrueDll5Function, MineDll5Function); DetourDetach(&(PVOID&)TrueDll6Function, MineDll6Function); DetourDetach(&(PVOID&)TrueDll7Function, MineDll7Function); DetourDetach(&(PVOID&)TrueDll8Function, MineDll8Function); DetourDetach(&(PVOID&)TrueDll9Function, MineDll9Function); error = DetourTransactionCommit(); if (error != NO_ERROR) { goto failed; } printf("\n"); printf("talloc.exe: %ld calls to Dll1Function\n", dwCountDll1); fflush(stdout); return 0; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/talloc/tdll1x.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (tdll1x.cpp of talloc.exe/tdll1x.dll) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // //////////////////////////////////////////////////////////////////// DLL Stuff // __declspec(dllexport) unsigned long __stdcall Dll1Function(unsigned long Value) { return Value + 1; } ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/talloc/tdll2x.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (tdll2x.cpp of talloc.exe/tdll2x.dll) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // //////////////////////////////////////////////////////////////////// DLL Stuff // __declspec(dllexport) unsigned long __stdcall Dll2Function(unsigned long Value) { return Value + 1; } ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/talloc/tdll3x.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (tdll3x.cpp of talloc.exe/tdll3x.dll) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // //////////////////////////////////////////////////////////////////// DLL Stuff // __declspec(dllexport) unsigned long __stdcall Dll3Function(unsigned long Value) { return Value + 1; } ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/talloc/tdll4x.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (tdll4x.cpp of talloc.exe/tdll4x.dll) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // //////////////////////////////////////////////////////////////////// DLL Stuff // __declspec(dllexport) unsigned long __stdcall Dll4Function(unsigned long Value) { return Value + 1; } ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/talloc/tdll5x.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (tdll5x.cpp of talloc.exe/tdll5x.dll) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // //////////////////////////////////////////////////////////////////// DLL Stuff // __declspec(dllexport) unsigned long __stdcall Dll5Function(unsigned long Value) { return Value + 1; } ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/talloc/tdll6x.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (tdll6x.cpp of talloc.exe/tdll6x.dll) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // //////////////////////////////////////////////////////////////////// DLL Stuff // __declspec(dllexport) unsigned long __stdcall Dll6Function(unsigned long Value) { return Value + 1; } ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/talloc/tdll7x.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (tdll7x.cpp of talloc.exe/tdll7x.dll) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // //////////////////////////////////////////////////////////////////// DLL Stuff // __declspec(dllexport) unsigned long __stdcall Dll7Function(unsigned long Value) { return Value + 1; } ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/talloc/tdll8x.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (tdll8x.cpp of talloc.exe/tdll8x.dll) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // //////////////////////////////////////////////////////////////////// DLL Stuff // __declspec(dllexport) unsigned long __stdcall Dll8Function(unsigned long Value) { return Value + 1; } ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/talloc/tdll9x.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (tdll9x.cpp of talloc.exe/tdll9x.dll) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // //////////////////////////////////////////////////////////////////// DLL Stuff // __declspec(dllexport) unsigned long __stdcall Dll9Function(unsigned long Value) { return Value + 1; } ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/traceapi/Makefile ================================================ ############################################################################## ## ## Utility to trace Win32 APIs. ## ## Microsoft Research Detours Package ## ## Copyright (c) Microsoft Corporation. All rights reserved. ## !include ..\common.mak LIBS=$(LIBS) kernel32.lib gdi32.lib user32.lib shell32.lib advapi32.lib ole32.lib ws2_32.lib ############################################################################## all: dirs \ $(BIND)\trcapi$(DETOURS_BITS).dll \ $(BIND)\testapi.exe \ !IF $(DETOURS_SOURCE_BROWSING)==1 $(OBJD)\trcapi$(DETOURS_BITS).bsc \ $(OBJD)\testapi.bsc \ !ENDIF option ############################################################################## clean: -del *~ test.txt 2>nul -del $(BIND)\trcapi*.* $(BIND)\testapi.* 2>nul -rmdir /q /s $(OBJD) 2>nul realclean: clean -rmdir /q /s $(OBJDS) 2>nul dirs: @if not exist $(BIND) mkdir $(BIND) && echo. Created $(BIND) @if not exist $(OBJD) mkdir $(OBJD) && echo. Created $(OBJD) $(OBJD)\trcapi.obj : trcapi.cpp _win32.cpp $(OBJD)\trcapi.res : trcapi.rc $(BIND)\trcapi$(DETOURS_BITS).dll: $(OBJD)\trcapi.obj $(OBJD)\trcapi.res $(DEPS) cl /LD $(CFLAGS) /Fe$@ /Fd$(@R).pdb \ $(OBJD)\trcapi.obj $(OBJD)\trcapi.res \ /link $(LINKFLAGS) /release /subsystem:console \ /export:DetourFinishHelperProcess,@1,NONAME \ $(LIBS) $(OBJD)\trcapi$(DETOURS_BITS).bsc : $(OBJD)\trcapi.obj bscmake /v /n /o $@ $(OBJD)\trcapi.sbr $(OBJD)\testapi.obj : testapi.cpp trcapi.cpp _win32.cpp $(BIND)\testapi.exe : $(OBJD)\testapi.obj $(DEPS) cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb $(OBJD)\testapi.obj \ /link $(LINKFLAGS) $(LIBS) \ /subsystem:console /fixed:no $(OBJD)\testapi.bsc : $(OBJD)\testapi.obj bscmake /v /n /o $@ $(OBJD)\testapi.sbr ############################################### Install non-bit-size binaries. !IF "$(DETOURS_OPTION_PROCESSOR)" != "" $(OPTD)\trcapi$(DETOURS_OPTION_BITS).dll: $(OPTD)\trcapi$(DETOURS_OPTION_BITS).pdb: $(BIND)\trcapi$(DETOURS_OPTION_BITS).dll : $(OPTD)\trcapi$(DETOURS_OPTION_BITS).dll @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\trcapi$(DETOURS_OPTION_BITS).pdb : $(OPTD)\trcapi$(DETOURS_OPTION_BITS).pdb @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). option: \ $(BIND)\trcapi$(DETOURS_OPTION_BITS).dll \ $(BIND)\trcapi$(DETOURS_OPTION_BITS).pdb \ !ELSE option: !ENDIF ############################################################################## test: all @echo -------- Logging output to test.txt ------------ start $(BIND)\syelogd.exe /o test.txt $(BIND)\sleep5.exe 1 @echo -------- Should load trcapi$(DETOURS_BITS).dll dynamically using withdll.exe ------------ $(BIND)\withdll -d:$(BIND)\trcapi$(DETOURS_BITS).dll $(BIND)\sleepold.exe @echo -------- Log from syelog ------------- type test.txt debug: all @echo -------- Logging output to test.txt ------------ start $(BIND)\syelogd.exe /o test.txt $(BIND)\sleep5.exe 1 @echo -------- Should load trcapi$(DETOURS_BITS).dll dynamically using withdll.exe ------------ windbg -o -g -G $(BIND)\withdll -d:$(BIND)\trcapi$(DETOURS_BITS).dll $(BIND)\sleepold.exe @echo -------- Log from syelog ------------- type test.txt calc: all @echo -------- Logging output to test.txt ------------ start $(BIND)\syelogd.exe /q /o test.txt $(BIND)\sleep5.exe 1 @echo -------- Should load trcapi$(DETOURS_BITS).dll dynamically using withdll.exe ------------ $(BIND)\withdll -d:$(BIND)\trcapi$(DETOURS_BITS).dll $(SYSTEMROOT)\System32\calc.exe @echo -------- Log from syelog ------------- wc test.txt explorer: all @echo -------- Logging output to test.txt ------------ start $(BIND)\syelogd.exe /q /o test.txt $(BIND)\sleep5.exe 1 @echo -------- Should load trcapi$(DETOURS_BITS).dll dynamically using withdll.exe ------------ $(BIND)\withdll -d:$(BIND)\trcapi$(DETOURS_BITS).dll $(SYSTEMROOT)\explorer.exe @echo -------- Log from syelog ------------- wc test.txt wordpad: all @echo -------- Logging output to test.txt ------------ start $(BIND)\syelogd.exe /q /o test.txt $(BIND)\sleep5.exe 1 @echo -------- Should load trcapi$(DETOURS_BITS).dll dynamically using withdll.exe ------------ $(BIND)\withdll -d:$(BIND)\trcapi$(DETOURS_BITS).dll $(PROGRAMFILES)\Windows NT\Accessories\wordpad.exe @echo -------- Log from syelog ------------- wc test.txt notepad: all @echo -------- Logging output to test.txt ------------ start $(BIND)\syelogd.exe /q /o test.txt $(BIND)\sleep5.exe 1 @echo -------- Should load trcapi$(DETOURS_BITS).dll dynamically using withdll.exe ------------ $(BIND)\withdll -d:$(BIND)\trcapi$(DETOURS_BITS).dll $(SYSTEMROOT)\notepad.exe @echo -------- Log from syelog ------------- wc test.txt ie: all @echo -------- Logging output to test.txt ------------ start $(BIND)\syelogd.exe /q /o test.txt $(BIND)\sleep5.exe 1 @echo -------- Should load trcapi$(DETOURS_BITS).dll dynamically using withdll.exe ------------ windbg -g -G -o $(BIND)\withdll -d:$(BIND)\trcapi$(DETOURS_BITS).dll "$(PROGRAMFILES)\Internet Explorer\iexplore.exe" @echo -------- Log from syelog ------------- wc test.txt ws: all $(BIND)\withdll -d:$(BIND)\trcapi$(DETOURS_BITS).dll $(BIND)\WebServiceTester.exe ################################################################# End of File. ================================================ FILE: ext/detours/samples/traceapi/_win32.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (_win32.cpp of traceapi.dll) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // ///////////////////////////////////////////////////////////////// Trampolines. // int (__stdcall * Real_AbortDoc)(HDC a0) = AbortDoc; BOOL (__stdcall * Real_AbortPath)(HDC a0) = AbortPath; HKL (__stdcall * Real_ActivateKeyboardLayout)(HKL a0, UINT a1) = ActivateKeyboardLayout; ATOM (__stdcall * Real_AddAtomA)(LPCSTR a0) = AddAtomA; ATOM (__stdcall * Real_AddAtomW)(LPCWSTR a0) = AddAtomW; int (__stdcall * Real_AddFontResourceA)(LPCSTR a0) = AddFontResourceA; int (__stdcall * Real_AddFontResourceW)(LPCWSTR a0) = AddFontResourceW; BOOL (__stdcall * Real_AdjustWindowRect)(LPRECT a0, DWORD a1, BOOL a2) = AdjustWindowRect; BOOL (__stdcall * Real_AdjustWindowRectEx)(LPRECT a0, DWORD a1, BOOL a2, DWORD a3) = AdjustWindowRectEx; BOOL (__stdcall * Real_AllocConsole)(void) = AllocConsole; BOOL (__stdcall * Real_AngleArc)(HDC a0, int a1, int a2, DWORD a3, FLOAT a4, FLOAT a5) = AngleArc; BOOL (__stdcall * Real_AnimatePalette)(HPALETTE a0, UINT a1, UINT a2, CONST PALETTEENTRY* a3) = AnimatePalette; BOOL (__stdcall * Real_AnyPopup)(void) = AnyPopup; BOOL (__stdcall * Real_AppendMenuA)(HMENU a0, UINT a1, UINT_PTR a2, LPCSTR a3) = AppendMenuA; BOOL (__stdcall * Real_AppendMenuW)(HMENU a0, UINT a1, UINT_PTR a2, LPCWSTR a3) = AppendMenuW; BOOL (__stdcall * Real_Arc)(HDC a0, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) = Arc; BOOL (__stdcall * Real_ArcTo)(HDC a0, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) = ArcTo; BOOL (__stdcall * Real_AreFileApisANSI)(void) = AreFileApisANSI; UINT (__stdcall * Real_ArrangeIconicWindows)(HWND a0) = ArrangeIconicWindows; BOOL (__stdcall * Real_AttachThreadInput)(DWORD a0, DWORD a1, BOOL a2) = AttachThreadInput; BOOL (__stdcall * Real_BackupRead)(HANDLE a0, LPBYTE a1, DWORD a2, LPDWORD a3, BOOL a4, BOOL a5, LPVOID* a6) = BackupRead; BOOL (__stdcall * Real_BackupSeek)(HANDLE a0, DWORD a1, DWORD a2, LPDWORD a3, LPDWORD a4, LPVOID* a5) = BackupSeek; BOOL (__stdcall * Real_BackupWrite)(HANDLE a0, LPBYTE a1, DWORD a2, LPDWORD a3, BOOL a4, BOOL a5, LPVOID* a6) = BackupWrite; BOOL (__stdcall * Real_Beep)(DWORD a0, DWORD a1) = Beep; HDWP (__stdcall * Real_BeginDeferWindowPos)(int a0) = BeginDeferWindowPos; HDC (__stdcall * Real_BeginPaint)(HWND a0, LPPAINTSTRUCT a1) = BeginPaint; BOOL (__stdcall * Real_BeginPath)(HDC a0) = BeginPath; HANDLE (__stdcall * Real_BeginUpdateResourceA)(LPCSTR a0, BOOL a1) = BeginUpdateResourceA; HANDLE (__stdcall * Real_BeginUpdateResourceW)(LPCWSTR a0, BOOL a1) = BeginUpdateResourceW; HRESULT (__stdcall * Real_BindMoniker)(IMoniker* a0, DWORD a1, CONST IID& a2, LPVOID* a3) = BindMoniker; BOOL (__stdcall * Real_BitBlt)(HDC a0, int a1, int a2, int a3, int a4, HDC a5, int a6, int a7, DWORD a8) = BitBlt; BOOL (__stdcall * Real_BringWindowToTop)(HWND a0) = BringWindowToTop; long (__stdcall * Real_BroadcastSystemMessageA)(DWORD a0, LPDWORD a1, UINT a2, WPARAM a3, LPARAM a4) = BroadcastSystemMessageA; long (__stdcall * Real_BroadcastSystemMessageW)(DWORD a0, LPDWORD a1, UINT a2, WPARAM a3, LPARAM a4) = BroadcastSystemMessageW; BOOL (__stdcall * Real_BuildCommDCBA)(LPCSTR a0, LPDCB a1) = BuildCommDCBA; BOOL (__stdcall * Real_BuildCommDCBAndTimeoutsA)(LPCSTR a0, LPDCB a1, LPCOMMTIMEOUTS a2) = BuildCommDCBAndTimeoutsA; BOOL (__stdcall * Real_BuildCommDCBAndTimeoutsW)(LPCWSTR a0, LPDCB a1, LPCOMMTIMEOUTS a2) = BuildCommDCBAndTimeoutsW; BOOL (__stdcall * Real_BuildCommDCBW)(LPCWSTR a0, LPDCB a1) = BuildCommDCBW; HRESULT (__stdcall * Real_CLSIDFromProgID)(LPCOLESTR a0, LPGUID a1) = CLSIDFromProgID; #ifdef _WIN32_WINNT_WIN7 HRESULT (__stdcall * Real_CLSIDFromString)(LPCOLESTR a0, LPGUID a1) = CLSIDFromString; #else HRESULT (__stdcall * Real_CLSIDFromString)(LPOLESTR a0, LPGUID a1) = CLSIDFromString; #endif BOOL (__stdcall * Real_CallMsgFilterA)(LPMSG a0, int a1) = CallMsgFilterA; BOOL (__stdcall * Real_CallMsgFilterW)(LPMSG a0, int a1) = CallMsgFilterW; BOOL (__stdcall * Real_CallNamedPipeA)(LPCSTR a0, LPVOID a1, DWORD a2, LPVOID a3, DWORD a4, LPDWORD a5, DWORD a6) = CallNamedPipeA; BOOL (__stdcall * Real_CallNamedPipeW)(LPCWSTR a0, LPVOID a1, DWORD a2, LPVOID a3, DWORD a4, LPDWORD a5, DWORD a6) = CallNamedPipeW; LRESULT (__stdcall * Real_CallNextHookEx)(HHOOK a0, int a1, WPARAM a2, LPARAM a3) = CallNextHookEx; LRESULT (__stdcall * Real_CallWindowProcA)(WNDPROC a0, HWND a1, UINT a2, WPARAM a3, LPARAM a4) = CallWindowProcA; LRESULT (__stdcall * Real_CallWindowProcW)(WNDPROC a0, HWND a1, UINT a2, WPARAM a3, LPARAM a4) = CallWindowProcW; BOOL (__stdcall * Real_CancelDC)(HDC a0) = CancelDC; BOOL (__stdcall * Real_CancelIo)(HANDLE a0) = CancelIo; BOOL (__stdcall * Real_CancelWaitableTimer)(HANDLE a0) = CancelWaitableTimer; WORD (__stdcall * Real_CascadeWindows)(HWND a0, UINT a1, CONST RECT* a2, UINT a3, CONST HWND * a4) = CascadeWindows; BOOL (__stdcall * Real_ChangeClipboardChain)(HWND a0, HWND a1) = ChangeClipboardChain; LONG (__stdcall * Real_ChangeDisplaySettingsA)(LPDEVMODEA a0, DWORD a1) = ChangeDisplaySettingsA; LONG (__stdcall * Real_ChangeDisplaySettingsExA)(LPCSTR a0, LPDEVMODEA a1, HWND a2, DWORD a3, LPVOID a4) = ChangeDisplaySettingsExA; LONG (__stdcall * Real_ChangeDisplaySettingsExW)(LPCWSTR a0, LPDEVMODEW a1, HWND a2, DWORD a3, LPVOID a4) = ChangeDisplaySettingsExW; LONG (__stdcall * Real_ChangeDisplaySettingsW)(LPDEVMODEW a0, DWORD a1) = ChangeDisplaySettingsW; BOOL (__stdcall * Real_ChangeMenuA)(HMENU a0, UINT a1, LPCSTR a2, UINT a3, UINT a4) = ChangeMenuA; BOOL (__stdcall * Real_ChangeMenuW)(HMENU a0, UINT a1, LPCWSTR a2, UINT a3, UINT a4) = ChangeMenuW; LPSTR (__stdcall * Real_CharLowerA)(LPSTR a0) = CharLowerA; DWORD (__stdcall * Real_CharLowerBuffA)(LPSTR a0, DWORD a1) = CharLowerBuffA; DWORD (__stdcall * Real_CharLowerBuffW)(LPWSTR a0, DWORD a1) = CharLowerBuffW; LPWSTR (__stdcall * Real_CharLowerW)(LPWSTR a0) = CharLowerW; LPSTR (__stdcall * Real_CharNextA)(LPCSTR a0) = CharNextA; LPSTR (__stdcall * Real_CharNextExA)(WORD a0, LPCSTR a1, DWORD a2) = CharNextExA; LPWSTR (__stdcall * Real_CharNextW)(LPCWSTR a0) = CharNextW; LPSTR (__stdcall * Real_CharPrevA)(LPCSTR a0, LPCSTR a1) = CharPrevA; LPSTR (__stdcall * Real_CharPrevExA)(WORD a0, LPCSTR a1, LPCSTR a2, DWORD a3) = CharPrevExA; LPWSTR (__stdcall * Real_CharPrevW)(LPCWSTR a0, LPCWSTR a1) = CharPrevW; BOOL (__stdcall * Real_CharToOemA)(LPCSTR a0, LPSTR a1) = CharToOemA; BOOL (__stdcall * Real_CharToOemBuffA)(LPCSTR a0, LPSTR a1, DWORD a2) = CharToOemBuffA; BOOL (__stdcall * Real_CharToOemBuffW)(LPCWSTR a0, LPSTR a1, DWORD a2) = CharToOemBuffW; BOOL (__stdcall * Real_CharToOemW)(LPCWSTR a0, LPSTR a1) = CharToOemW; LPSTR (__stdcall * Real_CharUpperA)(LPSTR a0) = CharUpperA; DWORD (__stdcall * Real_CharUpperBuffA)(LPSTR a0, DWORD a1) = CharUpperBuffA; DWORD (__stdcall * Real_CharUpperBuffW)(LPWSTR a0, DWORD a1) = CharUpperBuffW; LPWSTR (__stdcall * Real_CharUpperW)(LPWSTR a0) = CharUpperW; BOOL (__stdcall * Real_CheckColorsInGamut)( HDC a0, #ifdef GDIPLUS_TS_QUERYVER LPRGBTRIPLE a1, #else LPVOID a1, #endif LPVOID a2, DWORD a3 ) = CheckColorsInGamut; BOOL (__stdcall * Real_CheckDlgButton)(HWND a0, int a1, UINT a2) = CheckDlgButton; DWORD (__stdcall * Real_CheckMenuItem)(HMENU a0, UINT a1, UINT a2) = CheckMenuItem; BOOL (__stdcall * Real_CheckMenuRadioItem)(HMENU a0, UINT a1, UINT a2, UINT a3, UINT a4) = CheckMenuRadioItem; BOOL (__stdcall * Real_CheckRadioButton)(HWND a0, int a1, int a2, int a3) = CheckRadioButton; HWND (__stdcall * Real_ChildWindowFromPoint)(HWND a0, POINT a1) = ChildWindowFromPoint; HWND (__stdcall * Real_ChildWindowFromPointEx)(HWND a0, POINT a1, UINT a2) = ChildWindowFromPointEx; int (__stdcall * Real_ChoosePixelFormat)(HDC a0, CONST PIXELFORMATDESCRIPTOR* a1) = ChoosePixelFormat; BOOL (__stdcall * Real_Chord)(HDC a0, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) = Chord; BOOL (__stdcall * Real_ClearCommBreak)(HANDLE a0) = ClearCommBreak; BOOL (__stdcall * Real_ClearCommError)(HANDLE a0, LPDWORD a1, LPCOMSTAT a2) = ClearCommError; BOOL (__stdcall * Real_ClientToScreen)(HWND a0, LPPOINT a1) = ClientToScreen; BOOL (__stdcall * Real_ClipCursor)(CONST RECT* a0) = ClipCursor; BOOL (__stdcall * Real_CloseClipboard)(void) = CloseClipboard; BOOL (__stdcall * Real_CloseDesktop)(HDESK a0) = CloseDesktop; HENHMETAFILE (__stdcall * Real_CloseEnhMetaFile)(HDC a0) = CloseEnhMetaFile; BOOL (__stdcall * Real_CloseFigure)(HDC a0) = CloseFigure; BOOL (__stdcall * Real_CloseHandle)(HANDLE a0) = CloseHandle; HMETAFILE (__stdcall * Real_CloseMetaFile)(HDC a0) = CloseMetaFile; BOOL (__stdcall * Real_CloseWindow)(HWND a0) = CloseWindow; BOOL (__stdcall * Real_CloseWindowStation)(HWINSTA a0) = CloseWindowStation; ULONG (__stdcall * Real_CoAddRefServerProcess)(void) = CoAddRefServerProcess; DWORD (__stdcall * Real_CoBuildVersion)(void) = CoBuildVersion; HRESULT (__stdcall * Real_CoCopyProxy)(IUnknown* a0, IUnknown** a1) = CoCopyProxy; HRESULT (__stdcall * Real_CoCreateFreeThreadedMarshaler)(LPUNKNOWN a0, LPUNKNOWN* a1) = CoCreateFreeThreadedMarshaler; HRESULT (__stdcall * Real_CoCreateGuid)(GUID* a0) = CoCreateGuid; HRESULT (__stdcall * Real_CoCreateInstance)(CONST IID& a0, LPUNKNOWN a1, DWORD a2, CONST IID& a3, LPVOID* a4) = CoCreateInstance; HRESULT (__stdcall * Real_CoCreateInstanceEx)(CONST IID& a0, IUnknown* a1, DWORD a2, COSERVERINFO* a3, DWORD a4, MULTI_QI* a5) = CoCreateInstanceEx; HRESULT (__stdcall * Real_CoDisconnectObject)(LPUNKNOWN a0, DWORD a1) = CoDisconnectObject; BOOL (__stdcall * Real_CoDosDateTimeToFileTime)(WORD a0, WORD a1, FILETIME* a2) = CoDosDateTimeToFileTime; HRESULT (__stdcall * Real_CoFileTimeNow)(FILETIME* a0) = CoFileTimeNow; BOOL (__stdcall * Real_CoFileTimeToDosDateTime)(FILETIME* a0, LPWORD a1, LPWORD a2) = CoFileTimeToDosDateTime; void (__stdcall * Real_CoFreeAllLibraries)(void) = CoFreeAllLibraries; void (__stdcall * Real_CoFreeLibrary)(HINSTANCE a0) = CoFreeLibrary; void (__stdcall * Real_CoFreeUnusedLibraries)(void) = CoFreeUnusedLibraries; HRESULT (__stdcall * Real_CoGetCallContext)(CONST IID& a0, void** a1) = CoGetCallContext; HRESULT (__stdcall * Real_CoGetClassObject)(CONST IID& a0, DWORD a1, LPVOID a2, CONST IID& a3, LPVOID* a4) = CoGetClassObject; DWORD (__stdcall * Real_CoGetCurrentProcess)(void) = CoGetCurrentProcess; HRESULT (__stdcall * Real_CoGetInstanceFromFile)(COSERVERINFO* a0, CLSID* a1, IUnknown* a2, DWORD a3, DWORD a4, OLECHAR* a5, DWORD a6, MULTI_QI* a7) = CoGetInstanceFromFile; HRESULT (__stdcall * Real_CoGetInstanceFromIStorage)(COSERVERINFO* a0, CLSID* a1, IUnknown* a2, DWORD a3, IStorage* a4, DWORD a5, MULTI_QI* a6) = CoGetInstanceFromIStorage; HRESULT (__stdcall * Real_CoGetInterfaceAndReleaseStream)(LPSTREAM a0, CONST IID& a1, LPVOID* a2) = CoGetInterfaceAndReleaseStream; HRESULT (__stdcall * Real_CoGetMalloc)(DWORD a0, IMalloc** a1) = CoGetMalloc; HRESULT (__stdcall * Real_CoGetMarshalSizeMax)(ULONG* a0, CONST IID& a1, LPUNKNOWN a2, DWORD a3, LPVOID a4, DWORD a5) = CoGetMarshalSizeMax; HRESULT (__stdcall * Real_CoGetObject)(LPCWSTR a0, BIND_OPTS* a1, CONST IID& a2, void** a3) = CoGetObject; HRESULT (__stdcall * Real_CoGetPSClsid)(CONST IID& a0, CLSID* a1) = CoGetPSClsid; HRESULT (__stdcall * Real_CoGetStandardMarshal)(CONST IID& a0, LPUNKNOWN a1, DWORD a2, LPVOID a3, DWORD a4, IMarshal** a5) = CoGetStandardMarshal; HRESULT (__stdcall * Real_CoGetStdMarshalEx)(LPUNKNOWN a0, DWORD a1, LPUNKNOWN* a2) = CoGetStdMarshalEx; HRESULT (__stdcall * Real_CoGetTreatAsClass)(CONST IID& a0, LPGUID a1) = CoGetTreatAsClass; HRESULT (__stdcall * Real_CoImpersonateClient)(void) = CoImpersonateClient; HRESULT (__stdcall * Real_CoInitialize)(LPVOID a0) = CoInitialize; HRESULT (__stdcall * Real_CoInitializeEx)(LPVOID a0, DWORD a1) = CoInitializeEx; HRESULT (__stdcall * Real_CoInitializeSecurity)(PSECURITY_DESCRIPTOR a0, LONG a1, SOLE_AUTHENTICATION_SERVICE* a2, void* a3, DWORD a4, DWORD a5, void* a6, DWORD a7, void* a8) = CoInitializeSecurity; BOOL (__stdcall * Real_CoIsHandlerConnected)(LPUNKNOWN a0) = CoIsHandlerConnected; BOOL (__stdcall * Real_CoIsOle1Class)(CONST IID& a0) = CoIsOle1Class; HINSTANCE (__stdcall * Real_CoLoadLibrary)(LPOLESTR a0, BOOL a1) = CoLoadLibrary; HRESULT (__stdcall * Real_CoLockObjectExternal)(LPUNKNOWN a0, BOOL a1, BOOL a2) = CoLockObjectExternal; HRESULT (__stdcall * Real_CoMarshalHresult)(LPSTREAM a0, HRESULT a1) = CoMarshalHresult; HRESULT (__stdcall * Real_CoMarshalInterThreadInterfaceInStream)(CONST IID& a0, LPUNKNOWN a1, LPSTREAM* a2) = CoMarshalInterThreadInterfaceInStream; HRESULT (__stdcall * Real_CoMarshalInterface)(LPSTREAM a0, CONST IID& a1, LPUNKNOWN a2, DWORD a3, LPVOID a4, DWORD a5) = CoMarshalInterface; HRESULT (__stdcall * Real_CoQueryAuthenticationServices)(DWORD* a0, SOLE_AUTHENTICATION_SERVICE** a1) = CoQueryAuthenticationServices; HRESULT (__stdcall * Real_CoQueryClientBlanket)(DWORD* a0, DWORD* a1, OLECHAR** a2, DWORD* a3, DWORD* a4, RPC_AUTHZ_HANDLE* a5, DWORD* a6) = CoQueryClientBlanket; HRESULT (__stdcall * Real_CoQueryProxyBlanket)(IUnknown* a0, DWORD* a1, DWORD* a2, OLECHAR** a3, DWORD* a4, DWORD* a5, RPC_AUTH_IDENTITY_HANDLE* a6, DWORD* a7) = CoQueryProxyBlanket; HRESULT (__stdcall * Real_CoRegisterChannelHook)(CONST GUID& a0, IChannelHook* a1) = CoRegisterChannelHook; HRESULT (__stdcall * Real_CoRegisterClassObject)(CONST IID& a0, LPUNKNOWN a1, DWORD a2, DWORD a3, LPDWORD a4) = CoRegisterClassObject; HRESULT (__stdcall * Real_CoRegisterMallocSpy)(IMallocSpy* a0) = CoRegisterMallocSpy; HRESULT (__stdcall * Real_CoRegisterMessageFilter)(LPMESSAGEFILTER a0, LPMESSAGEFILTER* a1) = CoRegisterMessageFilter; HRESULT (__stdcall * Real_CoRegisterPSClsid)(CONST IID& a0, CONST IID& a1) = CoRegisterPSClsid; HRESULT (__stdcall * Real_CoRegisterSurrogate)(LPSURROGATE a0) = CoRegisterSurrogate; HRESULT (__stdcall * Real_CoReleaseMarshalData)(LPSTREAM a0) = CoReleaseMarshalData; ULONG (__stdcall * Real_CoReleaseServerProcess)(void) = CoReleaseServerProcess; HRESULT (__stdcall * Real_CoResumeClassObjects)(void) = CoResumeClassObjects; HRESULT (__stdcall * Real_CoRevertToSelf)(void) = CoRevertToSelf; HRESULT (__stdcall * Real_CoRevokeClassObject)(DWORD a0) = CoRevokeClassObject; HRESULT (__stdcall * Real_CoRevokeMallocSpy)(void) = CoRevokeMallocSpy; HRESULT (__stdcall * Real_CoSetProxyBlanket)(IUnknown* a0, DWORD a1, DWORD a2, OLECHAR* a3, DWORD a4, DWORD a5, RPC_AUTH_IDENTITY_HANDLE a6, DWORD a7) = CoSetProxyBlanket; HRESULT (__stdcall * Real_CoSuspendClassObjects)(void) = CoSuspendClassObjects; HRESULT (__stdcall * Real_CoSwitchCallContext)(IUnknown* a0, IUnknown** a1) = CoSwitchCallContext; LPVOID (__stdcall * Real_CoTaskMemAlloc)(SIZE_T a0) = CoTaskMemAlloc; void (__stdcall * Real_CoTaskMemFree)(LPVOID a0) = CoTaskMemFree; LPVOID (__stdcall * Real_CoTaskMemRealloc)(LPVOID a0, SIZE_T a1) = CoTaskMemRealloc; HRESULT (__stdcall * Real_CoTreatAsClass)(CONST IID& a0, CONST IID& a1) = CoTreatAsClass; void (__stdcall * Real_CoUninitialize)(void) = CoUninitialize; HRESULT (__stdcall * Real_CoUnmarshalHresult)(LPSTREAM a0, HRESULT* a1) = CoUnmarshalHresult; HRESULT (__stdcall * Real_CoUnmarshalInterface)(LPSTREAM a0, CONST IID& a1, LPVOID* a2) = CoUnmarshalInterface; BOOL (__stdcall * Real_ColorMatchToTarget)(HDC a0, HDC a1, DWORD a2) = ColorMatchToTarget; int (__stdcall * Real_CombineRgn)(HRGN a0, HRGN a1, HRGN a2, int a3) = CombineRgn; BOOL (__stdcall * Real_CombineTransform)(LPXFORM a0, CONST XFORM* a1, CONST XFORM* a2) = CombineTransform; BOOL (__stdcall * Real_CommConfigDialogA)(LPCSTR a0, HWND a1, LPCOMMCONFIG a2) = CommConfigDialogA; BOOL (__stdcall * Real_CommConfigDialogW)(LPCWSTR a0, HWND a1, LPCOMMCONFIG a2) = CommConfigDialogW; LONG (__stdcall * Real_CompareFileTime)(CONST FILETIME* a0, CONST FILETIME* a1) = CompareFileTime; int (__stdcall * Real_CompareStringA)(LCID a0, DWORD a1, LPCSTR a2, int a3, LPCSTR a4, int a5) = CompareStringA; int (__stdcall * Real_CompareStringW)(LCID a0, DWORD a1, LPCWSTR a2, int a3, LPCWSTR a4, int a5) = CompareStringW; BOOL (__stdcall * Real_ConnectNamedPipe)(HANDLE a0, LPOVERLAPPED a1) = ConnectNamedPipe; #if !defined(DETOURS_ARM) BOOL (__stdcall * Real_ContinueDebugEvent)(DWORD a0, DWORD a1, DWORD a2) = ContinueDebugEvent; #endif // !DETOURS_ARM LCID (__stdcall * Real_ConvertDefaultLocale)(LCID a0) = ConvertDefaultLocale; LPVOID (__stdcall * Real_ConvertThreadToFiber)(LPVOID a0) = ConvertThreadToFiber; int (__stdcall * Real_CopyAcceleratorTableA)(HACCEL a0, LPACCEL a1, int a2) = CopyAcceleratorTableA; int (__stdcall * Real_CopyAcceleratorTableW)(HACCEL a0, LPACCEL a1, int a2) = CopyAcceleratorTableW; HENHMETAFILE (__stdcall * Real_CopyEnhMetaFileA)(HENHMETAFILE a0, LPCSTR a1) = CopyEnhMetaFileA; HENHMETAFILE (__stdcall * Real_CopyEnhMetaFileW)(HENHMETAFILE a0, LPCWSTR a1) = CopyEnhMetaFileW; BOOL (__stdcall * Real_CopyFileA)(LPCSTR a0, LPCSTR a1, BOOL a2) = CopyFileA; BOOL (__stdcall * Real_CopyFileExA)(LPCSTR a0, LPCSTR a1, LPPROGRESS_ROUTINE a2, LPVOID a3, LPBOOL a4, DWORD a5) = CopyFileExA; BOOL (__stdcall * Real_CopyFileExW)(LPCWSTR a0, LPCWSTR a1, LPPROGRESS_ROUTINE a2, LPVOID a3, LPBOOL a4, DWORD a5) = CopyFileExW; BOOL (__stdcall * Real_CopyFileW)(LPCWSTR a0, LPCWSTR a1, BOOL a2) = CopyFileW; HICON (__stdcall * Real_CopyIcon)(HICON a0) = CopyIcon; HANDLE (__stdcall * Real_CopyImage)(HANDLE a0, UINT a1, int a2, int a3, UINT a4) = CopyImage; HMETAFILE (__stdcall * Real_CopyMetaFileA)(HMETAFILE a0, LPCSTR a1) = CopyMetaFileA; HMETAFILE (__stdcall * Real_CopyMetaFileW)(HMETAFILE a0, LPCWSTR a1) = CopyMetaFileW; BOOL (__stdcall * Real_CopyRect)(LPRECT a0, CONST RECT* a1) = CopyRect; int (__stdcall * Real_CountClipboardFormats)(void) = CountClipboardFormats; HACCEL (__stdcall * Real_CreateAcceleratorTableA)(LPACCEL a0, int a1) = CreateAcceleratorTableA; HACCEL (__stdcall * Real_CreateAcceleratorTableW)(LPACCEL a0, int a1) = CreateAcceleratorTableW; HRESULT (__stdcall * Real_CreateAntiMoniker)(IMoniker** a0) = CreateAntiMoniker; HRESULT (__stdcall * Real_CreateBindCtx)(DWORD a0, IBindCtx** a1) = CreateBindCtx; HBITMAP (__stdcall * Real_CreateBitmap)(int a0, int a1, UINT a2, UINT a3, CONST void* a4) = CreateBitmap; HBITMAP (__stdcall * Real_CreateBitmapIndirect)(CONST BITMAP* a0) = CreateBitmapIndirect; HBRUSH (__stdcall * Real_CreateBrushIndirect)(CONST LOGBRUSH* a0) = CreateBrushIndirect; BOOL (__stdcall * Real_CreateCaret)(HWND a0, HBITMAP a1, int a2, int a3) = CreateCaret; HRESULT (__stdcall * Real_CreateClassMoniker)(CONST IID& a0, IMoniker** a1) = CreateClassMoniker; HCOLORSPACE (__stdcall * Real_CreateColorSpaceA)(LPLOGCOLORSPACEA a0) = CreateColorSpaceA; HCOLORSPACE (__stdcall * Real_CreateColorSpaceW)(LPLOGCOLORSPACEW a0) = CreateColorSpaceW; HBITMAP (__stdcall * Real_CreateCompatibleBitmap)(HDC a0, int a1, int a2) = CreateCompatibleBitmap; HDC (__stdcall * Real_CreateCompatibleDC)(HDC a0) = CreateCompatibleDC; HANDLE (__stdcall * Real_CreateConsoleScreenBuffer)(DWORD a0, DWORD a1, CONST SECURITY_ATTRIBUTES* a2, DWORD a3, LPVOID a4) = CreateConsoleScreenBuffer; HCURSOR (__stdcall * Real_CreateCursor)(HINSTANCE a0, int a1, int a2, int a3, int a4, CONST void* a5, CONST void* a6) = CreateCursor; HDC (__stdcall * Real_CreateDCA)(LPCSTR a0, LPCSTR a1, LPCSTR a2, CONST DEVMODEA * a3) = CreateDCA; HDC (__stdcall * Real_CreateDCW)(LPCWSTR a0, LPCWSTR a1, LPCWSTR a2, CONST DEVMODEW * a3) = CreateDCW; HBRUSH (__stdcall * Real_CreateDIBPatternBrush)(HGLOBAL a0, UINT a1) = CreateDIBPatternBrush; HBRUSH (__stdcall * Real_CreateDIBPatternBrushPt)(CONST void* a0, UINT a1) = CreateDIBPatternBrushPt; HBITMAP (__stdcall * Real_CreateDIBSection)(HDC a0, CONST BITMAPINFO* a1, UINT a2, void** a3, HANDLE a4, DWORD a5) = CreateDIBSection; HBITMAP (__stdcall * Real_CreateDIBitmap)(HDC a0, CONST BITMAPINFOHEADER* a1, DWORD a2, CONST void* a3, CONST BITMAPINFO* a4, UINT a5) = CreateDIBitmap; HRESULT (__stdcall * Real_CreateDataAdviseHolder)(LPDATAADVISEHOLDER* a0) = CreateDataAdviseHolder; HRESULT (__stdcall * Real_CreateDataCache)(LPUNKNOWN a0, CONST IID& a1, CONST IID& a2, LPVOID* a3) = CreateDataCache; #if _MSC_VER < 1300 HDESK (__stdcall * Real_CreateDesktopA)(LPSTR a0, LPSTR a1, LPDEVMODEA a2, DWORD a3, ACCESS_MASK a4, LPSECURITY_ATTRIBUTES a5) = CreateDesktopA; #else HDESK (__stdcall * Real_CreateDesktopA)(LPCSTR a0, LPCSTR a1, LPDEVMODEA a2, DWORD a3, ACCESS_MASK a4, LPSECURITY_ATTRIBUTES a5) = CreateDesktopA; #endif #if _MSC_VER < 1300 HDESK (__stdcall * Real_CreateDesktopW)(LPWSTR a0, LPWSTR a1, LPDEVMODEW a2, DWORD a3, ACCESS_MASK a4, LPSECURITY_ATTRIBUTES a5) = CreateDesktopW; #else HDESK (__stdcall * Real_CreateDesktopW)(LPCWSTR a0, LPCWSTR a1, LPDEVMODEW a2, DWORD a3, ACCESS_MASK a4, LPSECURITY_ATTRIBUTES a5) = CreateDesktopW; #endif HWND (__stdcall * Real_CreateDialogIndirectParamA)(HINSTANCE a0, LPCDLGTEMPLATEA a1, HWND a2, DLGPROC a3, LPARAM a4) = CreateDialogIndirectParamA; HWND (__stdcall * Real_CreateDialogIndirectParamW)(HINSTANCE a0, LPCDLGTEMPLATEW a1, HWND a2, DLGPROC a3, LPARAM a4) = CreateDialogIndirectParamW; HWND (__stdcall * Real_CreateDialogParamA)(HINSTANCE a0, LPCSTR a1, HWND a2, DLGPROC a3, LPARAM a4) = CreateDialogParamA; HWND (__stdcall * Real_CreateDialogParamW)(HINSTANCE a0, LPCWSTR a1, HWND a2, DLGPROC a3, LPARAM a4) = CreateDialogParamW; BOOL (__stdcall * Real_CreateDirectoryA)(LPCSTR a0, LPSECURITY_ATTRIBUTES a1) = CreateDirectoryA; BOOL (__stdcall * Real_CreateDirectoryExA)(LPCSTR a0, LPCSTR a1, LPSECURITY_ATTRIBUTES a2) = CreateDirectoryExA; BOOL (__stdcall * Real_CreateDirectoryExW)(LPCWSTR a0, LPCWSTR a1, LPSECURITY_ATTRIBUTES a2) = CreateDirectoryExW; BOOL (__stdcall * Real_CreateDirectoryW)(LPCWSTR a0, LPSECURITY_ATTRIBUTES a1) = CreateDirectoryW; HBITMAP (__stdcall * Real_CreateDiscardableBitmap)(HDC a0, int a1, int a2) = CreateDiscardableBitmap; HRGN (__stdcall * Real_CreateEllipticRgn)(int a0, int a1, int a2, int a3) = CreateEllipticRgn; HRGN (__stdcall * Real_CreateEllipticRgnIndirect)(CONST RECT* a0) = CreateEllipticRgnIndirect; HDC (__stdcall * Real_CreateEnhMetaFileA)(HDC a0, LPCSTR a1, CONST RECT* a2, LPCSTR a3) = CreateEnhMetaFileA; HDC (__stdcall * Real_CreateEnhMetaFileW)(HDC a0, LPCWSTR a1, CONST RECT* a2, LPCWSTR a3) = CreateEnhMetaFileW; HANDLE (__stdcall * Real_CreateEventA)(LPSECURITY_ATTRIBUTES a0, BOOL a1, BOOL a2, LPCSTR a3) = CreateEventA; HANDLE (__stdcall * Real_CreateEventW)(LPSECURITY_ATTRIBUTES a0, BOOL a1, BOOL a2, LPCWSTR a3) = CreateEventW; LPVOID (__stdcall * Real_CreateFiber)(ULONG_PTR a0, LPFIBER_START_ROUTINE a1, LPVOID a2) = CreateFiber; HANDLE (__stdcall * Real_CreateFileA)(LPCSTR a0, DWORD a1, DWORD a2, LPSECURITY_ATTRIBUTES a3, DWORD a4, DWORD a5, HANDLE a6) = CreateFileA; HANDLE (__stdcall * Real_CreateFileMappingA)(HANDLE a0, LPSECURITY_ATTRIBUTES a1, DWORD a2, DWORD a3, DWORD a4, LPCSTR a5) = CreateFileMappingA; HANDLE (__stdcall * Real_CreateFileMappingW)(HANDLE a0, LPSECURITY_ATTRIBUTES a1, DWORD a2, DWORD a3, DWORD a4, LPCWSTR a5) = CreateFileMappingW; HRESULT (__stdcall * Real_CreateFileMoniker)(LPCOLESTR a0, IMoniker** a1) = CreateFileMoniker; HANDLE (__stdcall * Real_CreateFileW)(LPCWSTR a0, DWORD a1, DWORD a2, LPSECURITY_ATTRIBUTES a3, DWORD a4, DWORD a5, HANDLE a6) = CreateFileW; HFONT (__stdcall * Real_CreateFontA)(int a0, int a1, int a2, int a3, int a4, DWORD a5, DWORD a6, DWORD a7, DWORD a8, DWORD a9, DWORD a10, DWORD a11, DWORD a12, LPCSTR a13) = CreateFontA; HFONT (__stdcall * Real_CreateFontIndirectA)(CONST LOGFONTA* a0) = CreateFontIndirectA; HFONT (__stdcall * Real_CreateFontIndirectW)(CONST LOGFONTW* a0) = CreateFontIndirectW; HFONT (__stdcall * Real_CreateFontW)(int a0, int a1, int a2, int a3, int a4, DWORD a5, DWORD a6, DWORD a7, DWORD a8, DWORD a9, DWORD a10, DWORD a11, DWORD a12, LPCWSTR a13) = CreateFontW; HRESULT (__stdcall * Real_CreateGenericComposite)(IMoniker* a0, IMoniker* a1, IMoniker** a2) = CreateGenericComposite; HPALETTE (__stdcall * Real_CreateHalftonePalette)(HDC a0) = CreateHalftonePalette; HBRUSH (__stdcall * Real_CreateHatchBrush)(int a0, COLORREF a1) = CreateHatchBrush; HDC (__stdcall * Real_CreateICA)(LPCSTR a0, LPCSTR a1, LPCSTR a2, CONST DEVMODEA* a3) = CreateICA; HDC (__stdcall * Real_CreateICW)(LPCWSTR a0, LPCWSTR a1, LPCWSTR a2, CONST DEVMODEW* a3) = CreateICW; HRESULT (__stdcall * Real_CreateILockBytesOnHGlobal)(HGLOBAL a0, BOOL a1, ILockBytes** a2) = CreateILockBytesOnHGlobal; HICON (__stdcall * Real_CreateIcon)(HINSTANCE a0, int a1, int a2, BYTE a3, BYTE a4, CONST BYTE* a5, CONST BYTE* a6) = CreateIcon; HICON (__stdcall * Real_CreateIconFromResource)(PBYTE a0, DWORD a1, BOOL a2, DWORD a3) = CreateIconFromResource; HICON (__stdcall * Real_CreateIconFromResourceEx)(PBYTE a0, DWORD a1, BOOL a2, DWORD a3, int a4, int a5, UINT a6) = CreateIconFromResourceEx; HICON (__stdcall * Real_CreateIconIndirect)(PICONINFO a0) = CreateIconIndirect; HANDLE (__stdcall * Real_CreateIoCompletionPort)(HANDLE a0, HANDLE a1, ULONG_PTR a2, DWORD a3) = CreateIoCompletionPort; HRESULT (__stdcall * Real_CreateItemMoniker)(LPCOLESTR a0, LPCOLESTR a1, IMoniker** a2) = CreateItemMoniker; #if _MSC_VER < 1300 HWND (__stdcall * Real_CreateMDIWindowA)(LPSTR a0, LPSTR a1, DWORD a2, int a3, int a4, int a5, int a6, HWND a7, HINSTANCE a8, LPARAM a9) = CreateMDIWindowA; #else HWND (__stdcall * Real_CreateMDIWindowA)(LPCSTR a0, LPCSTR a1, DWORD a2, int a3, int a4, int a5, int a6, HWND a7, HINSTANCE a8, LPARAM a9) = CreateMDIWindowA; #endif #if _MSC_VER < 1300 HWND (__stdcall * Real_CreateMDIWindowW)(LPWSTR a0, LPWSTR a1, DWORD a2, int a3, int a4, int a5, int a6, HWND a7, HINSTANCE a8, LPARAM a9) = CreateMDIWindowW; #else HWND (__stdcall * Real_CreateMDIWindowW)(LPCWSTR a0, LPCWSTR a1, DWORD a2, int a3, int a4, int a5, int a6, HWND a7, HINSTANCE a8, LPARAM a9) = CreateMDIWindowW; #endif HANDLE (__stdcall * Real_CreateMailslotA)(LPCSTR a0, DWORD a1, DWORD a2, LPSECURITY_ATTRIBUTES a3) = CreateMailslotA; HANDLE (__stdcall * Real_CreateMailslotW)(LPCWSTR a0, DWORD a1, DWORD a2, LPSECURITY_ATTRIBUTES a3) = CreateMailslotW; HMENU (__stdcall * Real_CreateMenu)(void) = CreateMenu; HDC (__stdcall * Real_CreateMetaFileA)(LPCSTR a0) = CreateMetaFileA; HDC (__stdcall * Real_CreateMetaFileW)(LPCWSTR a0) = CreateMetaFileW; HANDLE (__stdcall * Real_CreateMutexA)(LPSECURITY_ATTRIBUTES a0, BOOL a1, LPCSTR a2) = CreateMutexA; HANDLE (__stdcall * Real_CreateMutexW)(LPSECURITY_ATTRIBUTES a0, BOOL a1, LPCWSTR a2) = CreateMutexW; HANDLE (__stdcall * Real_CreateNamedPipeA)(LPCSTR a0, DWORD a1, DWORD a2, DWORD a3, DWORD a4, DWORD a5, DWORD a6, LPSECURITY_ATTRIBUTES a7) = CreateNamedPipeA; HANDLE (__stdcall * Real_CreateNamedPipeW)(LPCWSTR a0, DWORD a1, DWORD a2, DWORD a3, DWORD a4, DWORD a5, DWORD a6, LPSECURITY_ATTRIBUTES a7) = CreateNamedPipeW; HRESULT (__stdcall * Real_CreateOleAdviseHolder)(LPOLEADVISEHOLDER* a0) = CreateOleAdviseHolder; HPALETTE (__stdcall * Real_CreatePalette)(CONST LOGPALETTE* a0) = CreatePalette; HBRUSH (__stdcall * Real_CreatePatternBrush)(HBITMAP a0) = CreatePatternBrush; HPEN (__stdcall * Real_CreatePen)(int a0, int a1, COLORREF a2) = CreatePen; HPEN (__stdcall * Real_CreatePenIndirect)(CONST LOGPEN* a0) = CreatePenIndirect; BOOL (__stdcall * Real_CreatePipe)(PHANDLE a0, PHANDLE a1, LPSECURITY_ATTRIBUTES a2, DWORD a3) = CreatePipe; HRESULT (__stdcall * Real_CreatePointerMoniker)(LPUNKNOWN a0, IMoniker** a1) = CreatePointerMoniker; HRGN (__stdcall * Real_CreatePolyPolygonRgn)(CONST POINT* a0, CONST INT* a1, int a2, int a3) = CreatePolyPolygonRgn; HRGN (__stdcall * Real_CreatePolygonRgn)(CONST POINT* a0, int a1, int a2) = CreatePolygonRgn; HMENU (__stdcall * Real_CreatePopupMenu)(void) = CreatePopupMenu; BOOL (__stdcall * Real_CreateProcessA)(LPCSTR a0, LPSTR a1, LPSECURITY_ATTRIBUTES a2, LPSECURITY_ATTRIBUTES a3, BOOL a4, DWORD a5, LPVOID a6, LPCSTR a7, LPSTARTUPINFOA a8, LPPROCESS_INFORMATION a9) = CreateProcessA; BOOL (__stdcall * Real_CreateProcessW)(LPCWSTR a0, LPWSTR a1, LPSECURITY_ATTRIBUTES a2, LPSECURITY_ATTRIBUTES a3, BOOL a4, DWORD a5, LPVOID a6, LPCWSTR a7, LPSTARTUPINFOW a8, LPPROCESS_INFORMATION a9) = CreateProcessW; BOOL (__stdcall * Real_CreateProcessAsUserA)( __in_opt HANDLE hToken, __in_opt LPCSTR lpApplicationName, __inout_opt LPSTR lpCommandLine, __in_opt LPSECURITY_ATTRIBUTES lpProcessAttributes, __in_opt LPSECURITY_ATTRIBUTES lpThreadAttributes, __in BOOL bInheritHandles, __in DWORD dwCreationFlags, __in_opt LPVOID lpEnvironment, __in_opt LPCSTR lpCurrentDirectory, __in LPSTARTUPINFOA lpStartupInfo, __out LPPROCESS_INFORMATION lpProcessInformation ) = CreateProcessAsUserA; BOOL (__stdcall * Real_CreateProcessAsUserW)( __in_opt HANDLE hToken, __in_opt LPCWSTR lpApplicationName, __inout_opt LPWSTR lpCommandLine, __in_opt LPSECURITY_ATTRIBUTES lpProcessAttributes, __in_opt LPSECURITY_ATTRIBUTES lpThreadAttributes, __in BOOL bInheritHandles, __in DWORD dwCreationFlags, __in_opt LPVOID lpEnvironment, __in_opt LPCWSTR lpCurrentDirectory, __in LPSTARTUPINFOW lpStartupInfo, __out LPPROCESS_INFORMATION lpProcessInformation ) = CreateProcessAsUserW; #if(_WIN32_WINNT >= 0x0500) BOOL (WINAPI * Real_CreateProcessWithLogonW)( __in LPCWSTR lpUsername, __in_opt LPCWSTR lpDomain, __in LPCWSTR lpPassword, __in DWORD dwLogonFlags, __in_opt LPCWSTR lpApplicationName, __inout_opt LPWSTR lpCommandLine, __in DWORD dwCreationFlags, __in_opt LPVOID lpEnvironment, __in_opt LPCWSTR lpCurrentDirectory, __in LPSTARTUPINFOW lpStartupInfo, __out LPPROCESS_INFORMATION lpProcessInfo ) = CreateProcessWithLogonW; BOOL (WINAPI * Real_CreateProcessWithTokenW)( __in HANDLE hToken, __in DWORD dwLogonFlags, __in_opt LPCWSTR lpApplicationName, __inout_opt LPWSTR lpCommandLine, __in DWORD dwCreationFlags, __in_opt LPVOID lpEnvironment, __in_opt LPCWSTR lpCurrentDirectory, __in LPSTARTUPINFOW lpStartupInfo, __out LPPROCESS_INFORMATION lpProcessInfo ) = CreateProcessWithTokenW; #endif HRGN (__stdcall * Real_CreateRectRgn)(int a0, int a1, int a2, int a3) = CreateRectRgn; HRGN (__stdcall * Real_CreateRectRgnIndirect)(CONST RECT* a0) = CreateRectRgnIndirect; HANDLE (__stdcall * Real_CreateRemoteThread)(HANDLE a0, LPSECURITY_ATTRIBUTES a1, ULONG_PTR a2, LPTHREAD_START_ROUTINE a3, LPVOID a4, DWORD a5, LPDWORD a6) = CreateRemoteThread; HRGN (__stdcall * Real_CreateRoundRectRgn)(int a0, int a1, int a2, int a3, int a4, int a5) = CreateRoundRectRgn; BOOL (__stdcall * Real_CreateScalableFontResourceA)(DWORD a0, LPCSTR a1, LPCSTR a2, LPCSTR a3) = CreateScalableFontResourceA; BOOL (__stdcall * Real_CreateScalableFontResourceW)(DWORD a0, LPCWSTR a1, LPCWSTR a2, LPCWSTR a3) = CreateScalableFontResourceW; HANDLE (__stdcall * Real_CreateSemaphoreA)(LPSECURITY_ATTRIBUTES a0, LONG a1, LONG a2, LPCSTR a3) = CreateSemaphoreA; HANDLE (__stdcall * Real_CreateSemaphoreW)(LPSECURITY_ATTRIBUTES a0, LONG a1, LONG a2, LPCWSTR a3) = CreateSemaphoreW; HBRUSH (__stdcall * Real_CreateSolidBrush)(COLORREF a0) = CreateSolidBrush; HRESULT (__stdcall * Real_CreateStdProgressIndicator)(HWND a0, LPCOLESTR a1, IBindStatusCallback* a2, IBindStatusCallback** a3) = CreateStdProgressIndicator; HRESULT (__stdcall * Real_CreateStreamOnHGlobal)(HGLOBAL a0, BOOL a1, LPSTREAM* a2) = CreateStreamOnHGlobal; DWORD (__stdcall * Real_CreateTapePartition)(HANDLE a0, DWORD a1, DWORD a2, DWORD a3) = CreateTapePartition; HANDLE (__stdcall * Real_CreateThread)(LPSECURITY_ATTRIBUTES a0, ULONG_PTR a1, LPTHREAD_START_ROUTINE a2, LPVOID a3, DWORD a4, LPDWORD a5) = CreateThread; HANDLE (__stdcall * Real_CreateWaitableTimerA)(LPSECURITY_ATTRIBUTES a0, BOOL a1, LPCSTR a2) = CreateWaitableTimerA; HANDLE (__stdcall * Real_CreateWaitableTimerW)(LPSECURITY_ATTRIBUTES a0, BOOL a1, LPCWSTR a2) = CreateWaitableTimerW; HWND (__stdcall * Real_CreateWindowExA)(DWORD a0, LPCSTR a1, LPCSTR a2, DWORD a3, int a4, int a5, int a6, int a7, HWND a8, HMENU a9, HINSTANCE a10, LPVOID a11) = CreateWindowExA; HWND (__stdcall * Real_CreateWindowExW)(DWORD a0, LPCWSTR a1, LPCWSTR a2, DWORD a3, int a4, int a5, int a6, int a7, HWND a8, HMENU a9, HINSTANCE a10, LPVOID a11) = CreateWindowExW; #if _MSC_VER < 1300 HWINSTA (__stdcall * Real_CreateWindowStationA)(LPSTR a0, DWORD a1, ACCESS_MASK a2, LPSECURITY_ATTRIBUTES a3) = CreateWindowStationA; #else HWINSTA (__stdcall * Real_CreateWindowStationA)(LPCSTR a0, DWORD a1, ACCESS_MASK a2, LPSECURITY_ATTRIBUTES a3) = CreateWindowStationA; #endif #if _MSC_VER < 1300 HWINSTA (__stdcall * Real_CreateWindowStationW)(LPWSTR a0, DWORD a1, ACCESS_MASK a2, LPSECURITY_ATTRIBUTES a3) = CreateWindowStationW; #else HWINSTA (__stdcall * Real_CreateWindowStationW)(LPCWSTR a0, DWORD a1, ACCESS_MASK a2, LPSECURITY_ATTRIBUTES a3) = CreateWindowStationW; #endif BOOL (__stdcall * Real_DPtoLP)(HDC a0, POINT* a1, int a2) = DPtoLP; BOOL (__stdcall * Real_DdeAbandonTransaction)(DWORD a0, HCONV a1, DWORD a2) = DdeAbandonTransaction; LPBYTE (__stdcall * Real_DdeAccessData)(HDDEDATA a0, LPDWORD a1) = DdeAccessData; HDDEDATA (__stdcall * Real_DdeAddData)(HDDEDATA a0, LPBYTE a1, DWORD a2, DWORD a3) = DdeAddData; HDDEDATA (__stdcall * Real_DdeClientTransaction)(LPBYTE a0, DWORD a1, HCONV a2, HSZ a3, UINT a4, UINT a5, DWORD a6, LPDWORD a7) = DdeClientTransaction; int (__stdcall * Real_DdeCmpStringHandles)(HSZ a0, HSZ a1) = DdeCmpStringHandles; HCONV (__stdcall * Real_DdeConnect)(DWORD a0, HSZ a1, HSZ a2, PCONVCONTEXT a3) = DdeConnect; HCONVLIST (__stdcall * Real_DdeConnectList)(DWORD a0, HSZ a1, HSZ a2, HCONVLIST a3, PCONVCONTEXT a4) = DdeConnectList; HDDEDATA (__stdcall * Real_DdeCreateDataHandle)(DWORD a0, LPBYTE a1, DWORD a2, DWORD a3, HSZ a4, UINT a5, UINT a6) = DdeCreateDataHandle; HSZ (__stdcall * Real_DdeCreateStringHandleA)(DWORD a0, LPCSTR a1, int a2) = DdeCreateStringHandleA; HSZ (__stdcall * Real_DdeCreateStringHandleW)(DWORD a0, LPCWSTR a1, int a2) = DdeCreateStringHandleW; BOOL (__stdcall * Real_DdeDisconnect)(HCONV a0) = DdeDisconnect; BOOL (__stdcall * Real_DdeDisconnectList)(HCONVLIST a0) = DdeDisconnectList; BOOL (__stdcall * Real_DdeEnableCallback)(DWORD a0, HCONV a1, UINT a2) = DdeEnableCallback; BOOL (__stdcall * Real_DdeFreeDataHandle)(HDDEDATA a0) = DdeFreeDataHandle; BOOL (__stdcall * Real_DdeFreeStringHandle)(DWORD a0, HSZ a1) = DdeFreeStringHandle; DWORD (__stdcall * Real_DdeGetData)(HDDEDATA a0, LPBYTE a1, DWORD a2, DWORD a3) = DdeGetData; UINT (__stdcall * Real_DdeGetLastError)(DWORD a0) = DdeGetLastError; BOOL (__stdcall * Real_DdeImpersonateClient)(HCONV a0) = DdeImpersonateClient; BOOL (__stdcall * Real_DdeKeepStringHandle)(DWORD a0, HSZ a1) = DdeKeepStringHandle; HDDEDATA (__stdcall * Real_DdeNameService)(DWORD a0, HSZ a1, HSZ a2, UINT a3) = DdeNameService; BOOL (__stdcall * Real_DdePostAdvise)(DWORD a0, HSZ a1, HSZ a2) = DdePostAdvise; UINT (__stdcall * Real_DdeQueryConvInfo)(HCONV a0, DWORD a1, CONVINFO* a2) = DdeQueryConvInfo; HCONV (__stdcall * Real_DdeQueryNextServer)(HCONVLIST a0, HCONV a1) = DdeQueryNextServer; DWORD (__stdcall * Real_DdeQueryStringA)(DWORD a0, HSZ a1, LPSTR a2, DWORD a3, int a4) = DdeQueryStringA; DWORD (__stdcall * Real_DdeQueryStringW)(DWORD a0, HSZ a1, LPWSTR a2, DWORD a3, int a4) = DdeQueryStringW; HCONV (__stdcall * Real_DdeReconnect)(HCONV a0) = DdeReconnect; BOOL (__stdcall * Real_DdeSetQualityOfService)(HWND a0, CONST SECURITY_QUALITY_OF_SERVICE* a1, PSECURITY_QUALITY_OF_SERVICE a2) = DdeSetQualityOfService; BOOL (__stdcall * Real_DdeSetUserHandle)(HCONV a0, DWORD a1, ULONG_PTR a2) = DdeSetUserHandle; BOOL (__stdcall * Real_DdeUnaccessData)(HDDEDATA a0) = DdeUnaccessData; BOOL (__stdcall * Real_DdeUninitialize)(DWORD a0) = DdeUninitialize; BOOL (__stdcall * Real_DebugActiveProcess)(DWORD a0) = DebugActiveProcess; BOOL (__stdcall * Real_DebugActiveProcessStop)(DWORD a0) = DebugActiveProcessStop; void (__stdcall * Real_DebugBreak)(void) = DebugBreak; LRESULT (__stdcall * Real_DefDlgProcA)(HWND a0, UINT a1, WPARAM a2, LPARAM a3) = DefDlgProcA; LRESULT (__stdcall * Real_DefDlgProcW)(HWND a0, UINT a1, WPARAM a2, LPARAM a3) = DefDlgProcW; LRESULT (__stdcall * Real_DefFrameProcA)(HWND a0, HWND a1, UINT a2, WPARAM a3, LPARAM a4) = DefFrameProcA; LRESULT (__stdcall * Real_DefFrameProcW)(HWND a0, HWND a1, UINT a2, WPARAM a3, LPARAM a4) = DefFrameProcW; LRESULT (__stdcall * Real_DefMDIChildProcA)(HWND a0, UINT a1, WPARAM a2, LPARAM a3) = DefMDIChildProcA; LRESULT (__stdcall * Real_DefMDIChildProcW)(HWND a0, UINT a1, WPARAM a2, LPARAM a3) = DefMDIChildProcW; LRESULT (__stdcall * Real_DefWindowProcA)(HWND a0, UINT a1, WPARAM a2, LPARAM a3) = DefWindowProcA; LRESULT (__stdcall * Real_DefWindowProcW)(HWND a0, UINT a1, WPARAM a2, LPARAM a3) = DefWindowProcW; HDWP (__stdcall * Real_DeferWindowPos)(HDWP a0, HWND a1, HWND a2, int a3, int a4, int a5, int a6, UINT a7) = DeferWindowPos; BOOL (__stdcall * Real_DefineDosDeviceA)(DWORD a0, LPCSTR a1, LPCSTR a2) = DefineDosDeviceA; BOOL (__stdcall * Real_DefineDosDeviceW)(DWORD a0, LPCWSTR a1, LPCWSTR a2) = DefineDosDeviceW; ATOM (__stdcall * Real_DeleteAtom)(ATOM a0) = DeleteAtom; BOOL (__stdcall * Real_DeleteColorSpace)(HCOLORSPACE a0) = DeleteColorSpace; BOOL (__stdcall * Real_DeleteDC)(HDC a0) = DeleteDC; BOOL (__stdcall * Real_DeleteEnhMetaFile)(HENHMETAFILE a0) = DeleteEnhMetaFile; void (__stdcall * Real_DeleteFiber)(LPVOID a0) = DeleteFiber; BOOL (__stdcall * Real_DeleteFileA)(LPCSTR a0) = DeleteFileA; BOOL (__stdcall * Real_DeleteFileW)(LPCWSTR a0) = DeleteFileW; BOOL (__stdcall * Real_DeleteMenu)(HMENU a0, UINT a1, UINT a2) = DeleteMenu; BOOL (__stdcall * Real_DeleteMetaFile)(HMETAFILE a0) = DeleteMetaFile; BOOL (__stdcall * Real_DeleteObject)(HGDIOBJ a0) = DeleteObject; int (__stdcall * Real_DescribePixelFormat)(HDC a0, int a1, UINT a2, PIXELFORMATDESCRIPTOR* a3) = DescribePixelFormat; BOOL (__stdcall * Real_DestroyAcceleratorTable)(HACCEL a0) = DestroyAcceleratorTable; BOOL (__stdcall * Real_DestroyCaret)(void) = DestroyCaret; BOOL (__stdcall * Real_DestroyCursor)(HCURSOR a0) = DestroyCursor; BOOL (__stdcall * Real_DestroyIcon)(HICON a0) = DestroyIcon; BOOL (__stdcall * Real_DestroyMenu)(HMENU a0) = DestroyMenu; BOOL (__stdcall * Real_DestroyWindow)(HWND a0) = DestroyWindow; BOOL (__stdcall * Real_DeviceIoControl)(HANDLE a0, DWORD a1, LPVOID a2, DWORD a3, LPVOID a4, DWORD a5, LPDWORD a6, LPOVERLAPPED a7) = DeviceIoControl; INT_PTR (__stdcall * Real_DialogBoxIndirectParamA)(HINSTANCE a0, LPCDLGTEMPLATEA a1, HWND a2, DLGPROC a3, LPARAM a4) = DialogBoxIndirectParamA; INT_PTR (__stdcall * Real_DialogBoxIndirectParamW)(HINSTANCE a0, LPCDLGTEMPLATEW a1, HWND a2, DLGPROC a3, LPARAM a4) = DialogBoxIndirectParamW; INT_PTR (__stdcall * Real_DialogBoxParamA)(HINSTANCE a0, LPCSTR a1, HWND a2, DLGPROC a3, LPARAM a4) = DialogBoxParamA; INT_PTR (__stdcall * Real_DialogBoxParamW)(HINSTANCE a0, LPCWSTR a1, HWND a2, DLGPROC a3, LPARAM a4) = DialogBoxParamW; BOOL (__stdcall * Real_DisableThreadLibraryCalls)(HMODULE a0) = DisableThreadLibraryCalls; BOOL (__stdcall * Real_DisconnectNamedPipe)(HANDLE a0) = DisconnectNamedPipe; LRESULT (__stdcall * Real_DispatchMessageA)(CONST MSG* a0) = DispatchMessageA; LRESULT (__stdcall * Real_DispatchMessageW)(CONST MSG* a0) = DispatchMessageW; int (__stdcall * Real_DlgDirListA)(HWND a0, LPSTR a1, int a2, int a3, UINT a4) = DlgDirListA; int (__stdcall * Real_DlgDirListComboBoxA)(HWND a0, LPSTR a1, int a2, int a3, UINT a4) = DlgDirListComboBoxA; int (__stdcall * Real_DlgDirListComboBoxW)(HWND a0, LPWSTR a1, int a2, int a3, UINT a4) = DlgDirListComboBoxW; int (__stdcall * Real_DlgDirListW)(HWND a0, LPWSTR a1, int a2, int a3, UINT a4) = DlgDirListW; BOOL (__stdcall * Real_DlgDirSelectComboBoxExA)(HWND a0, LPSTR a1, int a2, int a3) = DlgDirSelectComboBoxExA; BOOL (__stdcall * Real_DlgDirSelectComboBoxExW)(HWND a0, LPWSTR a1, int a2, int a3) = DlgDirSelectComboBoxExW; BOOL (__stdcall * Real_DlgDirSelectExA)(HWND a0, LPSTR a1, int a2, int a3) = DlgDirSelectExA; BOOL (__stdcall * Real_DlgDirSelectExW)(HWND a0, LPWSTR a1, int a2, int a3) = DlgDirSelectExW; HRESULT (__stdcall * Real_DoDragDrop)(IDataObject* a0, IDropSource* a1, DWORD a2, LPDWORD a3) = DoDragDrop; BOOL (__stdcall * Real_DosDateTimeToFileTime)(WORD a0, WORD a1, LPFILETIME a2) = DosDateTimeToFileTime; BOOL (__stdcall * Real_DragDetect)(HWND a0, POINT a1) = DragDetect; DWORD (__stdcall * Real_DragObject)(HWND a0, HWND a1, UINT a2, ULONG_PTR a3, HCURSOR a4) = DragObject; BOOL (__stdcall * Real_DrawAnimatedRects)(HWND a0, int a1, CONST RECT* a2, CONST RECT* a3) = DrawAnimatedRects; BOOL (__stdcall * Real_DrawCaption)(HWND a0, HDC a1, CONST RECT* a2, UINT a3) = DrawCaption; BOOL (__stdcall * Real_DrawEdge)(HDC a0, LPRECT a1, UINT a2, UINT a3) = DrawEdge; int (__stdcall * Real_DrawEscape)(HDC a0, int a1, int a2, LPCSTR a3) = DrawEscape; BOOL (__stdcall * Real_DrawFocusRect)(HDC a0, CONST RECT* a1) = DrawFocusRect; BOOL (__stdcall * Real_DrawFrameControl)(HDC a0, LPRECT a1, UINT a2, UINT a3) = DrawFrameControl; BOOL (__stdcall * Real_DrawIcon)(HDC a0, int a1, int a2, HICON a3) = DrawIcon; BOOL (__stdcall * Real_DrawIconEx)(HDC a0, int a1, int a2, HICON a3, int a4, int a5, UINT a6, HBRUSH a7, UINT a8) = DrawIconEx; BOOL (__stdcall * Real_DrawMenuBar)(HWND a0) = DrawMenuBar; BOOL (__stdcall * Real_DrawStateA)(HDC a0, HBRUSH a1, DRAWSTATEPROC a2, LPARAM a3, WPARAM a4, int a5, int a6, int a7, int a8, UINT a9) = DrawStateA; BOOL (__stdcall * Real_DrawStateW)(HDC a0, HBRUSH a1, DRAWSTATEPROC a2, LPARAM a3, WPARAM a4, int a5, int a6, int a7, int a8, UINT a9) = DrawStateW; int (__stdcall * Real_DrawTextA)(HDC a0, LPCSTR a1, int a2, LPRECT a3, UINT a4) = DrawTextA; int (__stdcall * Real_DrawTextExA)(HDC a0, LPSTR a1, int a2, LPRECT a3, UINT a4, LPDRAWTEXTPARAMS a5) = DrawTextExA; int (__stdcall * Real_DrawTextExW)(HDC a0, LPWSTR a1, int a2, LPRECT a3, UINT a4, LPDRAWTEXTPARAMS a5) = DrawTextExW; int (__stdcall * Real_DrawTextW)(HDC a0, LPCWSTR a1, int a2, LPRECT a3, UINT a4) = DrawTextW; BOOL (__stdcall * Real_DuplicateHandle)(HANDLE a0, HANDLE a1, HANDLE a2, LPHANDLE a3, DWORD a4, BOOL a5, DWORD a6) = DuplicateHandle; BOOL (__stdcall * Real_Ellipse)(HDC a0, int a1, int a2, int a3, int a4) = Ellipse; BOOL (__stdcall * Real_EmptyClipboard)(void) = EmptyClipboard; BOOL (__stdcall * Real_EnableMenuItem)(HMENU a0, UINT a1, UINT a2) = EnableMenuItem; BOOL (__stdcall * Real_EnableScrollBar)(HWND a0, UINT a1, UINT a2) = EnableScrollBar; BOOL (__stdcall * Real_EnableWindow)(HWND a0, BOOL a1) = EnableWindow; BOOL (__stdcall * Real_EndDeferWindowPos)(HDWP a0) = EndDeferWindowPos; BOOL (__stdcall * Real_EndDialog)(HWND a0, INT_PTR a1) = EndDialog; int (__stdcall * Real_EndDoc)(HDC a0) = EndDoc; int (__stdcall * Real_EndPage)(HDC a0) = EndPage; BOOL (__stdcall * Real_EndPaint)(HWND a0, CONST PAINTSTRUCT* a1) = EndPaint; BOOL (__stdcall * Real_EndPath)(HDC a0) = EndPath; BOOL (__stdcall * Real_EndUpdateResourceA)(HANDLE a0, BOOL a1) = EndUpdateResourceA; BOOL (__stdcall * Real_EndUpdateResourceW)(HANDLE a0, BOOL a1) = EndUpdateResourceW; BOOL (__stdcall * Real_EnumCalendarInfoA)(CALINFO_ENUMPROCA a0, LCID a1, CALID a2, CALTYPE a3) = EnumCalendarInfoA; BOOL (__stdcall * Real_EnumCalendarInfoW)(CALINFO_ENUMPROCW a0, LCID a1, CALID a2, CALTYPE a3) = EnumCalendarInfoW; BOOL (__stdcall * Real_EnumChildWindows)(HWND a0, WNDENUMPROC a1, LPARAM a2) = EnumChildWindows; UINT (__stdcall * Real_EnumClipboardFormats)(UINT a0) = EnumClipboardFormats; BOOL (__stdcall * Real_EnumDateFormatsA)(DATEFMT_ENUMPROCA a0, LCID a1, DWORD a2) = EnumDateFormatsA; BOOL (__stdcall * Real_EnumDateFormatsW)(DATEFMT_ENUMPROCW a0, LCID a1, DWORD a2) = EnumDateFormatsW; BOOL (__stdcall * Real_EnumDesktopWindows)(HDESK a0, WNDENUMPROC a1, LPARAM a2) = EnumDesktopWindows; BOOL (__stdcall * Real_EnumDesktopsA)(HWINSTA a0, DESKTOPENUMPROCA a1, LPARAM a2) = EnumDesktopsA; BOOL (__stdcall * Real_EnumDesktopsW)(HWINSTA a0, DESKTOPENUMPROCW a1, LPARAM a2) = EnumDesktopsW; BOOL (__stdcall * Real_EnumDisplaySettingsA)(LPCSTR a0, DWORD a1, LPDEVMODEA a2) = EnumDisplaySettingsA; BOOL (__stdcall * Real_EnumDisplaySettingsW)(LPCWSTR a0, DWORD a1, LPDEVMODEW a2) = EnumDisplaySettingsW; BOOL (__stdcall * Real_EnumEnhMetaFile)(HDC a0, HENHMETAFILE a1, ENHMFENUMPROC a2, LPVOID a3, CONST RECT* a4) = EnumEnhMetaFile; int (__stdcall * Real_EnumFontFamiliesA)(HDC a0, LPCSTR a1, FONTENUMPROCA a2, LPARAM a3) = EnumFontFamiliesA; int (__stdcall * Real_EnumFontFamiliesExA)(HDC a0, LPLOGFONTA a1, FONTENUMPROCA a2, LPARAM a3, DWORD a4) = EnumFontFamiliesExA; int (__stdcall * Real_EnumFontFamiliesExW)(HDC a0, LPLOGFONTW a1, FONTENUMPROCW a2, LPARAM a3, DWORD a4) = EnumFontFamiliesExW; int (__stdcall * Real_EnumFontFamiliesW)(HDC a0, LPCWSTR a1, FONTENUMPROCW a2, LPARAM a3) = EnumFontFamiliesW; int (__stdcall * Real_EnumFontsA)(HDC a0, LPCSTR a1, FONTENUMPROCA a2, LPARAM a3) = EnumFontsA; int (__stdcall * Real_EnumFontsW)(HDC a0, LPCWSTR a1, FONTENUMPROCW a2, LPARAM a3) = EnumFontsW; int (__stdcall * Real_EnumICMProfilesA)(HDC a0, ICMENUMPROCA a1, LPARAM a2) = EnumICMProfilesA; int (__stdcall * Real_EnumICMProfilesW)(HDC a0, ICMENUMPROCW a1, LPARAM a2) = EnumICMProfilesW; BOOL (__stdcall * Real_EnumMetaFile)(HDC a0, HMETAFILE a1, MFENUMPROC a2, LPARAM a3) = EnumMetaFile; int (__stdcall * Real_EnumObjects)(HDC a0, int a1, GOBJENUMPROC a2, LPARAM a3) = EnumObjects; int (__stdcall * Real_EnumPropsA)(HWND a0, PROPENUMPROCA a1) = EnumPropsA; int (__stdcall * Real_EnumPropsExA)(HWND a0, PROPENUMPROCEXA a1, LPARAM a2) = EnumPropsExA; int (__stdcall * Real_EnumPropsExW)(HWND a0, PROPENUMPROCEXW a1, LPARAM a2) = EnumPropsExW; int (__stdcall * Real_EnumPropsW)(HWND a0, PROPENUMPROCW a1) = EnumPropsW; #if _MSC_VER < 1300 BOOL (__stdcall * Real_EnumResourceLanguagesA)(HMODULE a0, LPCSTR a1, LPCSTR a2, ENUMRESLANGPROC a3, LONG a4) = EnumResourceLanguagesA; #else BOOL (__stdcall * Real_EnumResourceLanguagesA)(HMODULE a0, LPCSTR a1, LPCSTR a2, ENUMRESLANGPROCA a3, LONG_PTR a4) = EnumResourceLanguagesA; #endif #if _MSC_VER < 1300 BOOL (__stdcall * Real_EnumResourceLanguagesW)(HMODULE a0, LPCWSTR a1, LPCWSTR a2, ENUMRESLANGPROC a3, LONG a4) = EnumResourceLanguagesW; #else BOOL (__stdcall * Real_EnumResourceLanguagesW)(HMODULE a0, LPCWSTR a1, LPCWSTR a2, ENUMRESLANGPROCW a3, LONG_PTR a4) = EnumResourceLanguagesW; #endif #if _MSC_VER < 1300 BOOL (__stdcall * Real_EnumResourceNamesA)(HMODULE a0, LPCSTR a1, ENUMRESNAMEPROC a2, LONG a3) = EnumResourceNamesA; #else BOOL (__stdcall * Real_EnumResourceNamesA)(HMODULE a0, LPCSTR a1, ENUMRESNAMEPROCA a2, LONG_PTR a3) = EnumResourceNamesA; #endif #if _MSC_VER < 1300 BOOL (__stdcall * Real_EnumResourceNamesW)(HMODULE a0, LPCWSTR a1, ENUMRESNAMEPROC a2, LONG a3) = EnumResourceNamesW; #else BOOL (__stdcall * Real_EnumResourceNamesW)(HMODULE a0, LPCWSTR a1, ENUMRESNAMEPROCW a2, LONG_PTR a3) = EnumResourceNamesW; #endif #if _MSC_VER < 1300 BOOL (__stdcall * Real_EnumResourceTypesA)(HMODULE a0, ENUMRESTYPEPROC a1, LONG a2) = EnumResourceTypesA; #else BOOL (__stdcall * Real_EnumResourceTypesA)(HMODULE a0, ENUMRESTYPEPROCA a1, LONG_PTR a2) = EnumResourceTypesA; #endif #if _MSC_VER < 1300 BOOL (__stdcall * Real_EnumResourceTypesW)(HMODULE a0, ENUMRESTYPEPROC a1, LONG a2) = EnumResourceTypesW; #else BOOL (__stdcall * Real_EnumResourceTypesW)(HMODULE a0, ENUMRESTYPEPROCW a1, LONG_PTR a2) = EnumResourceTypesW; #endif BOOL (__stdcall * Real_EnumSystemCodePagesA)(CODEPAGE_ENUMPROCA a0, DWORD a1) = EnumSystemCodePagesA; BOOL (__stdcall * Real_EnumSystemCodePagesW)(CODEPAGE_ENUMPROCW a0, DWORD a1) = EnumSystemCodePagesW; #if(WINVER >= 0x0500) BOOL (__stdcall * Real_EnumSystemLocalesA)(LOCALE_ENUMPROCA a0, DWORD a1) = EnumSystemLocalesA; BOOL (__stdcall * Real_EnumSystemLocalesW)(LOCALE_ENUMPROCW a0, DWORD a1) = EnumSystemLocalesW; #endif // (WINVER >= 0x0500) BOOL (__stdcall * Real_EnumThreadWindows)(DWORD a0, WNDENUMPROC a1, LPARAM a2) = EnumThreadWindows; BOOL (__stdcall * Real_EnumTimeFormatsA)(TIMEFMT_ENUMPROCA a0, LCID a1, DWORD a2) = EnumTimeFormatsA; BOOL (__stdcall * Real_EnumTimeFormatsW)(TIMEFMT_ENUMPROCW a0, LCID a1, DWORD a2) = EnumTimeFormatsW; BOOL (__stdcall * Real_EnumWindowStationsA)(WINSTAENUMPROCA a0, LPARAM a1) = EnumWindowStationsA; BOOL (__stdcall * Real_EnumWindowStationsW)(WINSTAENUMPROCW a0, LPARAM a1) = EnumWindowStationsW; BOOL (__stdcall * Real_EnumWindows)(WNDENUMPROC a0, LPARAM a1) = EnumWindows; BOOL (__stdcall * Real_EqualRect)(CONST RECT* a0, CONST RECT* a1) = EqualRect; BOOL (__stdcall * Real_EqualRgn)(HRGN a0, HRGN a1) = EqualRgn; DWORD (__stdcall * Real_EraseTape)(HANDLE a0, DWORD a1, BOOL a2) = EraseTape; int (__stdcall * Real_Escape)(HDC a0, int a1, int a2, LPCSTR a3, LPVOID a4) = Escape; BOOL (__stdcall * Real_EscapeCommFunction)(HANDLE a0, DWORD a1) = EscapeCommFunction; int (__stdcall * Real_ExcludeClipRect)(HDC a0, int a1, int a2, int a3, int a4) = ExcludeClipRect; int (__stdcall * Real_ExcludeUpdateRgn)(HDC a0, HWND a1) = ExcludeUpdateRgn; void (__stdcall * Real_ExitProcess)(UINT a0) = ExitProcess; void (__stdcall * Real_ExitThread)(DWORD a0) = ExitThread; BOOL (__stdcall * Real_ExitWindowsEx)(UINT a0, DWORD a1) = ExitWindowsEx; DWORD (__stdcall * Real_ExpandEnvironmentStringsA)(LPCSTR a0, LPSTR a1, DWORD a2) = ExpandEnvironmentStringsA; DWORD (__stdcall * Real_ExpandEnvironmentStringsW)(LPCWSTR a0, LPWSTR a1, DWORD a2) = ExpandEnvironmentStringsW; HPEN (__stdcall * Real_ExtCreatePen)(DWORD a0, DWORD a1, CONST LOGBRUSH* a2, DWORD a3, CONST DWORD* a4) = ExtCreatePen; HRGN (__stdcall * Real_ExtCreateRegion)(CONST XFORM* a0, DWORD a1, CONST RGNDATA* a2) = ExtCreateRegion; int (__stdcall * Real_ExtEscape)(HDC a0, int a1, int a2, LPCSTR a3, int a4, LPSTR a5) = ExtEscape; BOOL (__stdcall * Real_ExtFloodFill)(HDC a0, int a1, int a2, COLORREF a3, UINT a4) = ExtFloodFill; int (__stdcall * Real_ExtSelectClipRgn)(HDC a0, HRGN a1, int a2) = ExtSelectClipRgn; BOOL (__stdcall * Real_ExtTextOutA)(HDC a0, int a1, int a2, UINT a3, CONST RECT* a4, LPCSTR a5, UINT a6, CONST INT* a7) = ExtTextOutA; BOOL (__stdcall * Real_ExtTextOutW)(HDC a0, int a1, int a2, UINT a3, CONST RECT* a4, LPCWSTR a5, UINT a6, CONST INT* a7) = ExtTextOutW; void (__stdcall * Real_FatalAppExitA)(UINT a0, LPCSTR a1) = FatalAppExitA; void (__stdcall * Real_FatalAppExitW)(UINT a0, LPCWSTR a1) = FatalAppExitW; void (__stdcall * Real_FatalExit)(int a0) = FatalExit; BOOL (__stdcall * Real_FileTimeToDosDateTime)(CONST FILETIME* a0, LPWORD a1, LPWORD a2) = FileTimeToDosDateTime; BOOL (__stdcall * Real_FileTimeToLocalFileTime)(CONST FILETIME* a0, LPFILETIME a1) = FileTimeToLocalFileTime; BOOL (__stdcall * Real_FileTimeToSystemTime)(CONST FILETIME* a0, LPSYSTEMTIME a1) = FileTimeToSystemTime; BOOL (__stdcall * Real_FillConsoleOutputAttribute)(HANDLE a0, WORD a1, DWORD a2, COORD a3, LPDWORD a4) = FillConsoleOutputAttribute; BOOL (__stdcall * Real_FillConsoleOutputCharacterA)(HANDLE a0, CHAR a1, DWORD a2, COORD a3, LPDWORD a4) = FillConsoleOutputCharacterA; BOOL (__stdcall * Real_FillConsoleOutputCharacterW)(HANDLE a0, WCHAR a1, DWORD a2, COORD a3, LPDWORD a4) = FillConsoleOutputCharacterW; BOOL (__stdcall * Real_FillPath)(HDC a0) = FillPath; int (__stdcall * Real_FillRect)(HDC a0, CONST RECT* a1, HBRUSH a2) = FillRect; BOOL (__stdcall * Real_FillRgn)(HDC a0, HRGN a1, HBRUSH a2) = FillRgn; ATOM (__stdcall * Real_FindAtomA)(LPCSTR a0) = FindAtomA; ATOM (__stdcall * Real_FindAtomW)(LPCWSTR a0) = FindAtomW; BOOL (__stdcall * Real_FindClose)(HANDLE a0) = FindClose; BOOL (__stdcall * Real_FindCloseChangeNotification)(HANDLE a0) = FindCloseChangeNotification; HANDLE (__stdcall * Real_FindFirstChangeNotificationA)(LPCSTR a0, BOOL a1, DWORD a2) = FindFirstChangeNotificationA; HANDLE (__stdcall * Real_FindFirstChangeNotificationW)(LPCWSTR a0, BOOL a1, DWORD a2) = FindFirstChangeNotificationW; HANDLE (__stdcall * Real_FindFirstFileA)(LPCSTR a0, LPWIN32_FIND_DATAA a1) = FindFirstFileA; HANDLE (__stdcall * Real_FindFirstFileExA)(LPCSTR a0, FINDEX_INFO_LEVELS a1, LPVOID a2, FINDEX_SEARCH_OPS a3, LPVOID a4, DWORD a5) = FindFirstFileExA; HANDLE (__stdcall * Real_FindFirstFileExW)(LPCWSTR a0, FINDEX_INFO_LEVELS a1, LPVOID a2, FINDEX_SEARCH_OPS a3, LPVOID a4, DWORD a5) = FindFirstFileExW; HANDLE (__stdcall * Real_FindFirstFileW)(LPCWSTR a0, LPWIN32_FIND_DATAW a1) = FindFirstFileW; BOOL (__stdcall * Real_FindNextChangeNotification)(HANDLE a0) = FindNextChangeNotification; BOOL (__stdcall * Real_FindNextFileA)(HANDLE a0, LPWIN32_FIND_DATAA a1) = FindNextFileA; BOOL (__stdcall * Real_FindNextFileW)(HANDLE a0, LPWIN32_FIND_DATAW a1) = FindNextFileW; HRSRC (__stdcall * Real_FindResourceA)(HMODULE a0, LPCSTR a1, LPCSTR a2) = FindResourceA; HRSRC (__stdcall * Real_FindResourceExA)(HMODULE a0, LPCSTR a1, LPCSTR a2, WORD a3) = FindResourceExA; HRSRC (__stdcall * Real_FindResourceExW)(HMODULE a0, LPCWSTR a1, LPCWSTR a2, WORD a3) = FindResourceExW; HRSRC (__stdcall * Real_FindResourceW)(HMODULE a0, LPCWSTR a1, LPCWSTR a2) = FindResourceW; HWND (__stdcall * Real_FindWindowA)(LPCSTR a0, LPCSTR a1) = FindWindowA; HWND (__stdcall * Real_FindWindowExA)(HWND a0, HWND a1, LPCSTR a2, LPCSTR a3) = FindWindowExA; HWND (__stdcall * Real_FindWindowExW)(HWND a0, HWND a1, LPCWSTR a2, LPCWSTR a3) = FindWindowExW; HWND (__stdcall * Real_FindWindowW)(LPCWSTR a0, LPCWSTR a1) = FindWindowW; BOOL (__stdcall * Real_FixBrushOrgEx)(HDC a0, int a1, int a2, POINT* a3) = FixBrushOrgEx; BOOL (__stdcall * Real_FlashWindow)(HWND a0, BOOL a1) = FlashWindow; BOOL (__stdcall * Real_FlattenPath)(HDC a0) = FlattenPath; BOOL (__stdcall * Real_FloodFill)(HDC a0, int a1, int a2, COLORREF a3) = FloodFill; BOOL (__stdcall * Real_FlushConsoleInputBuffer)(HANDLE a0) = FlushConsoleInputBuffer; BOOL (__stdcall * Real_FlushFileBuffers)(HANDLE a0) = FlushFileBuffers; BOOL (__stdcall * Real_FlushViewOfFile)(LPCVOID a0, SIZE_T a1) = FlushViewOfFile; HRESULT (__stdcall * Real_FmtIdToPropStgName)(CONST FMTID* a0, LPOLESTR a1) = FmtIdToPropStgName; int (__stdcall * Real_FoldStringA)(DWORD a0, LPCSTR a1, int a2, LPSTR a3, int a4) = FoldStringA; int (__stdcall * Real_FoldStringW)(DWORD a0, LPCWSTR a1, int a2, LPWSTR a3, int a4) = FoldStringW; DWORD (__stdcall * Real_FormatMessageA)(DWORD a0, LPCVOID a1, DWORD a2, DWORD a3, LPSTR a4, DWORD a5, va_list* a6) = FormatMessageA; DWORD (__stdcall * Real_FormatMessageW)(DWORD a0, LPCVOID a1, DWORD a2, DWORD a3, LPWSTR a4, DWORD a5, va_list* a6) = FormatMessageW; int (__stdcall * Real_FrameRect)(HDC a0, CONST RECT* a1, HBRUSH a2) = FrameRect; BOOL (__stdcall * Real_FrameRgn)(HDC a0, HRGN a1, HBRUSH a2, int a3, int a4) = FrameRgn; BOOL (__stdcall * Real_FreeConsole)(void) = FreeConsole; BOOL (__stdcall * Real_FreeDDElParam)(UINT a0, LPARAM a1) = FreeDDElParam; BOOL (__stdcall * Real_FreeEnvironmentStringsA)(LPSTR a0) = FreeEnvironmentStringsA; BOOL (__stdcall * Real_FreeEnvironmentStringsW)(LPWSTR a0) = FreeEnvironmentStringsW; BOOL (__stdcall * Real_FreeLibrary)(HMODULE a0) = FreeLibrary; void (__stdcall * Real_FreeLibraryAndExitThread)(HMODULE a0, DWORD a1) = FreeLibraryAndExitThread; HRESULT (__stdcall * Real_FreePropVariantArray)(ULONG a0, PROPVARIANT* a1) = FreePropVariantArray; BOOL (__stdcall * Real_FreeResource)(HGLOBAL a0) = FreeResource; BOOL (__stdcall * Real_GdiComment)(HDC a0, UINT a1, CONST BYTE* a2) = GdiComment; BOOL (__stdcall * Real_GdiFlush)(void) = GdiFlush; DWORD (__stdcall * Real_GdiGetBatchLimit)(void) = GdiGetBatchLimit; DWORD (__stdcall * Real_GdiSetBatchLimit)(DWORD a0) = GdiSetBatchLimit; BOOL (__stdcall * Real_GenerateConsoleCtrlEvent)(DWORD a0, DWORD a1) = GenerateConsoleCtrlEvent; UINT (__stdcall * Real_GetACP)(void) = GetACP; HWND (__stdcall * Real_GetActiveWindow)(void) = GetActiveWindow; int (__stdcall * Real_GetArcDirection)(HDC a0) = GetArcDirection; BOOL (__stdcall * Real_GetAspectRatioFilterEx)(HDC a0, SIZE* a1) = GetAspectRatioFilterEx; SHORT (__stdcall * Real_GetAsyncKeyState)(int a0) = GetAsyncKeyState; UINT (__stdcall * Real_GetAtomNameA)(ATOM a0, LPSTR a1, int a2) = GetAtomNameA; UINT (__stdcall * Real_GetAtomNameW)(ATOM a0, LPWSTR a1, int a2) = GetAtomNameW; BOOL (__stdcall * Real_GetBinaryTypeA)(LPCSTR a0, LPDWORD a1) = GetBinaryTypeA; BOOL (__stdcall * Real_GetBinaryTypeW)(LPCWSTR a0, LPDWORD a1) = GetBinaryTypeW; LONG (__stdcall * Real_GetBitmapBits)(HBITMAP a0, LONG a1, LPVOID a2) = GetBitmapBits; BOOL (__stdcall * Real_GetBitmapDimensionEx)(HBITMAP a0, SIZE* a1) = GetBitmapDimensionEx; COLORREF (__stdcall * Real_GetBkColor)(HDC a0) = GetBkColor; int (__stdcall * Real_GetBkMode)(HDC a0) = GetBkMode; UINT (__stdcall * Real_GetBoundsRect)(HDC a0, LPRECT a1, UINT a2) = GetBoundsRect; BOOL (__stdcall * Real_GetBrushOrgEx)(HDC a0, POINT* a1) = GetBrushOrgEx; BOOL (__stdcall * Real_GetCPInfo)(UINT a0, LPCPINFO a1) = GetCPInfo; HWND (__stdcall * Real_GetCapture)(void) = GetCapture; UINT (__stdcall * Real_GetCaretBlinkTime)(void) = GetCaretBlinkTime; BOOL (__stdcall * Real_GetCaretPos)(POINT* a0) = GetCaretPos; BOOL (__stdcall * Real_GetCharABCWidthsA)(HDC a0, UINT a1, UINT a2, LPABC a3) = GetCharABCWidthsA; BOOL (__stdcall * Real_GetCharABCWidthsFloatA)(HDC a0, UINT a1, UINT a2, LPABCFLOAT a3) = GetCharABCWidthsFloatA; BOOL (__stdcall * Real_GetCharABCWidthsFloatW)(HDC a0, UINT a1, UINT a2, LPABCFLOAT a3) = GetCharABCWidthsFloatW; BOOL (__stdcall * Real_GetCharABCWidthsW)(HDC a0, UINT a1, UINT a2, LPABC a3) = GetCharABCWidthsW; BOOL (__stdcall * Real_GetCharWidth32A)(HDC a0, UINT a1, UINT a2, LPINT a3) = GetCharWidth32A; BOOL (__stdcall * Real_GetCharWidth32W)(HDC a0, UINT a1, UINT a2, LPINT a3) = GetCharWidth32W; BOOL (__stdcall * Real_GetCharWidthA)(HDC a0, UINT a1, UINT a2, LPINT a3) = GetCharWidthA; BOOL (__stdcall * Real_GetCharWidthFloatA)(HDC a0, UINT a1, UINT a2, PFLOAT a3) = GetCharWidthFloatA; BOOL (__stdcall * Real_GetCharWidthFloatW)(HDC a0, UINT a1, UINT a2, PFLOAT a3) = GetCharWidthFloatW; BOOL (__stdcall * Real_GetCharWidthW)(HDC a0, UINT a1, UINT a2, LPINT a3) = GetCharWidthW; DWORD (__stdcall * Real_GetCharacterPlacementA)(HDC a0, LPCSTR a1, int a2, int a3, LPGCP_RESULTSA a4, DWORD a5) = GetCharacterPlacementA; DWORD (__stdcall * Real_GetCharacterPlacementW)(HDC a0, LPCWSTR a1, int a2, int a3, LPGCP_RESULTSW a4, DWORD a5) = GetCharacterPlacementW; HRESULT (__stdcall * Real_GetClassFile)(LPCOLESTR a0, CLSID* a1) = GetClassFile; BOOL (__stdcall * Real_GetClassInfoA)(HINSTANCE a0, LPCSTR a1, LPWNDCLASSA a2) = GetClassInfoA; BOOL (__stdcall * Real_GetClassInfoExA)(HINSTANCE a0, LPCSTR a1, LPWNDCLASSEXA a2) = GetClassInfoExA; BOOL (__stdcall * Real_GetClassInfoExW)(HINSTANCE a0, LPCWSTR a1, LPWNDCLASSEXW a2) = GetClassInfoExW; BOOL (__stdcall * Real_GetClassInfoW)(HINSTANCE a0, LPCWSTR a1, LPWNDCLASSW a2) = GetClassInfoW; DWORD (__stdcall * Real_GetClassLongA)(HWND a0, int a1) = GetClassLongA; DWORD (__stdcall * Real_GetClassLongW)(HWND a0, int a1) = GetClassLongW; int (__stdcall * Real_GetClassNameA)(HWND a0, LPSTR a1, int a2) = GetClassNameA; int (__stdcall * Real_GetClassNameW)(HWND a0, LPWSTR a1, int a2) = GetClassNameW; WORD (__stdcall * Real_GetClassWord)(HWND a0, int a1) = GetClassWord; BOOL (__stdcall * Real_GetClientRect)(HWND a0, LPRECT a1) = GetClientRect; int (__stdcall * Real_GetClipBox)(HDC a0, LPRECT a1) = GetClipBox; BOOL (__stdcall * Real_GetClipCursor)(LPRECT a0) = GetClipCursor; int (__stdcall * Real_GetClipRgn)(HDC a0, HRGN a1) = GetClipRgn; HANDLE (__stdcall * Real_GetClipboardData)(UINT a0) = GetClipboardData; int (__stdcall * Real_GetClipboardFormatNameA)(UINT a0, LPSTR a1, int a2) = GetClipboardFormatNameA; int (__stdcall * Real_GetClipboardFormatNameW)(UINT a0, LPWSTR a1, int a2) = GetClipboardFormatNameW; HWND (__stdcall * Real_GetClipboardOwner)(void) = GetClipboardOwner; HWND (__stdcall * Real_GetClipboardViewer)(void) = GetClipboardViewer; BOOL (__stdcall * Real_GetColorAdjustment)(HDC a0, LPCOLORADJUSTMENT a1) = GetColorAdjustment; HCOLORSPACE (__stdcall * Real_GetColorSpace)(HDC a0) = GetColorSpace; BOOL (__stdcall * Real_GetCommConfig)(HANDLE a0, LPCOMMCONFIG a1, LPDWORD a2) = GetCommConfig; BOOL (__stdcall * Real_GetCommMask)(HANDLE a0, LPDWORD a1) = GetCommMask; BOOL (__stdcall * Real_GetCommModemStatus)(HANDLE a0, LPDWORD a1) = GetCommModemStatus; BOOL (__stdcall * Real_GetCommProperties)(HANDLE a0, LPCOMMPROP a1) = GetCommProperties; BOOL (__stdcall * Real_GetCommState)(HANDLE a0, LPDCB a1) = GetCommState; BOOL (__stdcall * Real_GetCommTimeouts)(HANDLE a0, LPCOMMTIMEOUTS a1) = GetCommTimeouts; LPSTR (__stdcall * Real_GetCommandLineA)(void) = GetCommandLineA; LPWSTR (__stdcall * Real_GetCommandLineW)(void) = GetCommandLineW; BOOL (__stdcall * Real_GetComputerNameA)(LPSTR a0, LPDWORD a1) = GetComputerNameA; BOOL (__stdcall * Real_GetComputerNameW)(LPWSTR a0, LPDWORD a1) = GetComputerNameW; UINT (__stdcall * Real_GetConsoleCP)(void) = GetConsoleCP; BOOL (__stdcall * Real_GetConsoleCursorInfo)(HANDLE a0, PCONSOLE_CURSOR_INFO a1) = GetConsoleCursorInfo; BOOL (__stdcall * Real_GetConsoleMode)(HANDLE a0, LPDWORD a1) = GetConsoleMode; UINT (__stdcall * Real_GetConsoleOutputCP)(void) = GetConsoleOutputCP; BOOL (__stdcall * Real_GetConsoleScreenBufferInfo)(HANDLE a0, PCONSOLE_SCREEN_BUFFER_INFO a1) = GetConsoleScreenBufferInfo; DWORD (__stdcall * Real_GetConsoleTitleA)(LPSTR a0, DWORD a1) = GetConsoleTitleA; DWORD (__stdcall * Real_GetConsoleTitleW)(LPWSTR a0, DWORD a1) = GetConsoleTitleW; HRESULT (__stdcall * Real_GetConvertStg)(IStorage* a0) = GetConvertStg; int (__stdcall * Real_GetCurrencyFormatA)(LCID a0, DWORD a1, LPCSTR a2, CONST CURRENCYFMTA* a3, LPSTR a4, int a5) = GetCurrencyFormatA; int (__stdcall * Real_GetCurrencyFormatW)(LCID a0, DWORD a1, LPCWSTR a2, CONST CURRENCYFMTW* a3, LPWSTR a4, int a5) = GetCurrencyFormatW; DWORD (__stdcall * Real_GetCurrentDirectoryA)(DWORD a0, LPSTR a1) = GetCurrentDirectoryA; DWORD (__stdcall * Real_GetCurrentDirectoryW)(DWORD a0, LPWSTR a1) = GetCurrentDirectoryW; HGDIOBJ (__stdcall * Real_GetCurrentObject)(HDC a0, UINT a1) = GetCurrentObject; BOOL (__stdcall * Real_GetCurrentPositionEx)(HDC a0, POINT* a1) = GetCurrentPositionEx; HANDLE (__stdcall * Real_GetCurrentProcess)(void) = GetCurrentProcess; DWORD (__stdcall * Real_GetCurrentProcessId)(void) = GetCurrentProcessId; DWORD (__stdcall * Real_GetCurrentThreadId)(void) = GetCurrentThreadId; HCURSOR (__stdcall * Real_GetCursor)(void) = GetCursor; BOOL (__stdcall * Real_GetCursorPos)(POINT* a0) = GetCursorPos; HDC (__stdcall * Real_GetDC)(HWND a0) = GetDC; HDC (__stdcall * Real_GetDCEx)(HWND a0, HRGN a1, DWORD a2) = GetDCEx; BOOL (__stdcall * Real_GetDCOrgEx)(HDC a0, POINT* a1) = GetDCOrgEx; UINT (__stdcall * Real_GetDIBColorTable)(HDC a0, UINT a1, UINT a2, RGBQUAD* a3) = GetDIBColorTable; int (__stdcall * Real_GetDIBits)(HDC a0, HBITMAP a1, UINT a2, UINT a3, LPVOID a4, LPBITMAPINFO a5, UINT a6) = GetDIBits; int (__stdcall * Real_GetDateFormatA)(LCID a0, DWORD a1, CONST SYSTEMTIME* a2, LPCSTR a3, LPSTR a4, int a5) = GetDateFormatA; int (__stdcall * Real_GetDateFormatW)(LCID a0, DWORD a1, CONST SYSTEMTIME* a2, LPCWSTR a3, LPWSTR a4, int a5) = GetDateFormatW; BOOL (__stdcall * Real_GetDefaultCommConfigA)(LPCSTR a0, LPCOMMCONFIG a1, LPDWORD a2) = GetDefaultCommConfigA; BOOL (__stdcall * Real_GetDefaultCommConfigW)(LPCWSTR a0, LPCOMMCONFIG a1, LPDWORD a2) = GetDefaultCommConfigW; HWND (__stdcall * Real_GetDesktopWindow)(void) = GetDesktopWindow; int (__stdcall * Real_GetDeviceCaps)(HDC a0, int a1) = GetDeviceCaps; BOOL (__stdcall * Real_GetDeviceGammaRamp)(HDC a0, LPVOID a1) = GetDeviceGammaRamp; long (__stdcall * Real_GetDialogBaseUnits)(void) = GetDialogBaseUnits; BOOL (__stdcall * Real_GetDiskFreeSpaceA)(LPCSTR a0, LPDWORD a1, LPDWORD a2, LPDWORD a3, LPDWORD a4) = GetDiskFreeSpaceA; BOOL (__stdcall * Real_GetDiskFreeSpaceExA)(LPCSTR a0, union _ULARGE_INTEGER* a1, union _ULARGE_INTEGER* a2, union _ULARGE_INTEGER* a3) = GetDiskFreeSpaceExA; BOOL (__stdcall * Real_GetDiskFreeSpaceExW)(LPCWSTR a0, union _ULARGE_INTEGER* a1, union _ULARGE_INTEGER* a2, union _ULARGE_INTEGER* a3) = GetDiskFreeSpaceExW; BOOL (__stdcall * Real_GetDiskFreeSpaceW)(LPCWSTR a0, LPDWORD a1, LPDWORD a2, LPDWORD a3, LPDWORD a4) = GetDiskFreeSpaceW; int (__stdcall * Real_GetDlgCtrlID)(HWND a0) = GetDlgCtrlID; HWND (__stdcall * Real_GetDlgItem)(HWND a0, int a1) = GetDlgItem; UINT (__stdcall * Real_GetDlgItemInt)(HWND a0, int a1, BOOL* a2, BOOL a3) = GetDlgItemInt; UINT (__stdcall * Real_GetDlgItemTextA)(HWND a0, int a1, LPSTR a2, int a3) = GetDlgItemTextA; UINT (__stdcall * Real_GetDlgItemTextW)(HWND a0, int a1, LPWSTR a2, int a3) = GetDlgItemTextW; UINT (__stdcall * Real_GetDoubleClickTime)(void) = GetDoubleClickTime; UINT (__stdcall * Real_GetDriveTypeA)(LPCSTR a0) = GetDriveTypeA; UINT (__stdcall * Real_GetDriveTypeW)(LPCWSTR a0) = GetDriveTypeW; HENHMETAFILE (__stdcall * Real_GetEnhMetaFileA)(LPCSTR a0) = GetEnhMetaFileA; UINT (__stdcall * Real_GetEnhMetaFileBits)(HENHMETAFILE a0, UINT a1, LPBYTE a2) = GetEnhMetaFileBits; UINT (__stdcall * Real_GetEnhMetaFileDescriptionA)(HENHMETAFILE a0, UINT a1, LPSTR a2) = GetEnhMetaFileDescriptionA; UINT (__stdcall * Real_GetEnhMetaFileDescriptionW)(HENHMETAFILE a0, UINT a1, LPWSTR a2) = GetEnhMetaFileDescriptionW; UINT (__stdcall * Real_GetEnhMetaFileHeader)(HENHMETAFILE a0, UINT a1, ENHMETAHEADER* a2) = GetEnhMetaFileHeader; UINT (__stdcall * Real_GetEnhMetaFilePaletteEntries)(HENHMETAFILE a0, UINT a1, PALETTEENTRY* a2) = GetEnhMetaFilePaletteEntries; UINT (__stdcall * Real_GetEnhMetaFilePixelFormat)(HENHMETAFILE a0, UINT a1, PIXELFORMATDESCRIPTOR* a2) = GetEnhMetaFilePixelFormat; HENHMETAFILE (__stdcall * Real_GetEnhMetaFileW)(LPCWSTR a0) = GetEnhMetaFileW; #undef GetEnvironmentStrings LPSTR (__stdcall * Real_GetEnvironmentStrings)(void) = GetEnvironmentStrings; LPWSTR (__stdcall * Real_GetEnvironmentStringsW)(void) = GetEnvironmentStringsW; DWORD (__stdcall * Real_GetEnvironmentVariableA)(LPCSTR a0, LPSTR a1, DWORD a2) = GetEnvironmentVariableA; DWORD (__stdcall * Real_GetEnvironmentVariableW)(LPCWSTR a0, LPWSTR a1, DWORD a2) = GetEnvironmentVariableW; BOOL (__stdcall * Real_GetExitCodeProcess)(HANDLE a0, LPDWORD a1) = GetExitCodeProcess; BOOL (__stdcall * Real_GetExitCodeThread)(HANDLE a0, LPDWORD a1) = GetExitCodeThread; DWORD (__stdcall * Real_GetFileAttributesA)(LPCSTR a0) = GetFileAttributesA; BOOL (__stdcall * Real_GetFileAttributesExA)(LPCSTR a0, enum _GET_FILEEX_INFO_LEVELS a1, LPVOID a2) = GetFileAttributesExA; BOOL (__stdcall * Real_GetFileAttributesExW)(LPCWSTR a0, enum _GET_FILEEX_INFO_LEVELS a1, LPVOID a2) = GetFileAttributesExW; DWORD (__stdcall * Real_GetFileAttributesW)(LPCWSTR a0) = GetFileAttributesW; BOOL (__stdcall * Real_GetFileInformationByHandle)(HANDLE a0, LPBY_HANDLE_FILE_INFORMATION a1) = GetFileInformationByHandle; DWORD (__stdcall * Real_GetFileSize)(HANDLE a0, LPDWORD a1) = GetFileSize; BOOL (__stdcall * Real_GetFileTime)(HANDLE a0, LPFILETIME a1, LPFILETIME a2, LPFILETIME a3) = GetFileTime; DWORD (__stdcall * Real_GetFileType)(HANDLE a0) = GetFileType; HWND (__stdcall * Real_GetFocus)(void) = GetFocus; DWORD (__stdcall * Real_GetFontData)(HDC a0, DWORD a1, DWORD a2, LPVOID a3, DWORD a4) = GetFontData; DWORD (__stdcall * Real_GetFontLanguageInfo)(HDC a0) = GetFontLanguageInfo; HWND (__stdcall * Real_GetForegroundWindow)(void) = GetForegroundWindow; DWORD (__stdcall * Real_GetFullPathNameA)(LPCSTR a0, DWORD a1, LPSTR a2, LPSTR* a3) = GetFullPathNameA; DWORD (__stdcall * Real_GetFullPathNameW)(LPCWSTR a0, DWORD a1, LPWSTR a2, LPWSTR* a3) = GetFullPathNameW; DWORD (__stdcall * Real_GetGlyphOutlineA)(HDC a0, UINT a1, UINT a2, LPGLYPHMETRICS a3, DWORD a4, LPVOID a5, CONST MAT2* a6) = GetGlyphOutlineA; DWORD (__stdcall * Real_GetGlyphOutlineW)(HDC a0, UINT a1, UINT a2, LPGLYPHMETRICS a3, DWORD a4, LPVOID a5, CONST MAT2* a6) = GetGlyphOutlineW; int (__stdcall * Real_GetGraphicsMode)(HDC a0) = GetGraphicsMode; HRESULT (__stdcall * Real_GetHGlobalFromILockBytes)(ILockBytes* a0, HGLOBAL* a1) = GetHGlobalFromILockBytes; HRESULT (__stdcall * Real_GetHGlobalFromStream)(LPSTREAM a0, HGLOBAL* a1) = GetHGlobalFromStream; BOOL (__stdcall * Real_GetHandleInformation)(HANDLE a0, LPDWORD a1) = GetHandleInformation; BOOL (__stdcall * Real_GetICMProfileA)(HDC a0, LPDWORD a1, LPSTR a2) = GetICMProfileA; BOOL (__stdcall * Real_GetICMProfileW)(HDC a0, LPDWORD a1, LPWSTR a2) = GetICMProfileW; BOOL (__stdcall * Real_GetIconInfo)(HICON a0, PICONINFO a1) = GetIconInfo; BOOL (__stdcall * Real_GetInputState)(void) = GetInputState; UINT (__stdcall * Real_GetKBCodePage)(void) = GetKBCodePage; DWORD (__stdcall * Real_GetKerningPairsA)(HDC a0, DWORD a1, KERNINGPAIR* a2) = GetKerningPairsA; DWORD (__stdcall * Real_GetKerningPairsW)(HDC a0, DWORD a1, KERNINGPAIR* a2) = GetKerningPairsW; int (__stdcall * Real_GetKeyNameTextA)(LONG a0, LPSTR a1, int a2) = GetKeyNameTextA; int (__stdcall * Real_GetKeyNameTextW)(LONG a0, LPWSTR a1, int a2) = GetKeyNameTextW; SHORT (__stdcall * Real_GetKeyState)(int a0) = GetKeyState; HKL (__stdcall * Real_GetKeyboardLayout)(DWORD a0) = GetKeyboardLayout; int (__stdcall * Real_GetKeyboardLayoutList)(int a0, HKL* a1) = GetKeyboardLayoutList; BOOL (__stdcall * Real_GetKeyboardLayoutNameA)(LPSTR a0) = GetKeyboardLayoutNameA; BOOL (__stdcall * Real_GetKeyboardLayoutNameW)(LPWSTR a0) = GetKeyboardLayoutNameW; BOOL (__stdcall * Real_GetKeyboardState)(PBYTE a0) = GetKeyboardState; int (__stdcall * Real_GetKeyboardType)(int a0) = GetKeyboardType; HWND (__stdcall * Real_GetLastActivePopup)(HWND a0) = GetLastActivePopup; void (__stdcall * Real_GetLocalTime)(LPSYSTEMTIME a0) = GetLocalTime; int (__stdcall * Real_GetLocaleInfoA)(LCID a0, LCTYPE a1, LPSTR a2, int a3) = GetLocaleInfoA; int (__stdcall * Real_GetLocaleInfoW)(LCID a0, LCTYPE a1, LPWSTR a2, int a3) = GetLocaleInfoW; BOOL (__stdcall * Real_GetLogColorSpaceA)(HCOLORSPACE a0, LOGCOLORSPACEA* a1, DWORD a2) = GetLogColorSpaceA; BOOL (__stdcall * Real_GetLogColorSpaceW)(HCOLORSPACE a0, LOGCOLORSPACEW* a1, DWORD a2) = GetLogColorSpaceW; DWORD (__stdcall * Real_GetLogicalDriveStringsA)(DWORD a0, LPSTR a1) = GetLogicalDriveStringsA; DWORD (__stdcall * Real_GetLogicalDriveStringsW)(DWORD a0, LPWSTR a1) = GetLogicalDriveStringsW; DWORD (__stdcall * Real_GetLogicalDrives)(void) = GetLogicalDrives; BOOL (__stdcall * Real_GetMailslotInfo)(HANDLE a0, LPDWORD a1, LPDWORD a2, LPDWORD a3, LPDWORD a4) = GetMailslotInfo; int (__stdcall * Real_GetMapMode)(HDC a0) = GetMapMode; HMENU (__stdcall * Real_GetMenu)(HWND a0) = GetMenu; LONG (__stdcall * Real_GetMenuCheckMarkDimensions)(void) = GetMenuCheckMarkDimensions; DWORD (__stdcall * Real_GetMenuContextHelpId)(HMENU a0) = GetMenuContextHelpId; UINT (__stdcall * Real_GetMenuDefaultItem)(HMENU a0, UINT a1, UINT a2) = GetMenuDefaultItem; int (__stdcall * Real_GetMenuItemCount)(HMENU a0) = GetMenuItemCount; UINT (__stdcall * Real_GetMenuItemID)(HMENU a0, int a1) = GetMenuItemID; BOOL (__stdcall * Real_GetMenuItemInfoA)(HMENU a0, UINT a1, BOOL a2, LPMENUITEMINFOA a3) = GetMenuItemInfoA; BOOL (__stdcall * Real_GetMenuItemInfoW)(HMENU a0, UINT a1, BOOL a2, LPMENUITEMINFOW a3) = GetMenuItemInfoW; BOOL (__stdcall * Real_GetMenuItemRect)(HWND a0, HMENU a1, UINT a2, LPRECT a3) = GetMenuItemRect; UINT (__stdcall * Real_GetMenuState)(HMENU a0, UINT a1, UINT a2) = GetMenuState; int (__stdcall * Real_GetMenuStringA)(HMENU a0, UINT a1, LPSTR a2, int a3, UINT a4) = GetMenuStringA; int (__stdcall * Real_GetMenuStringW)(HMENU a0, UINT a1, LPWSTR a2, int a3, UINT a4) = GetMenuStringW; BOOL (__stdcall * Real_GetMessageA)(LPMSG a0, HWND a1, UINT a2, UINT a3) = GetMessageA; LPARAM (__stdcall * Real_GetMessageExtraInfo)(void) = GetMessageExtraInfo; DWORD (__stdcall * Real_GetMessagePos)(void) = GetMessagePos; LONG (__stdcall * Real_GetMessageTime)(void) = GetMessageTime; BOOL (__stdcall * Real_GetMessageW)(LPMSG a0, HWND a1, UINT a2, UINT a3) = GetMessageW; HMETAFILE (__stdcall * Real_GetMetaFileA)(LPCSTR a0) = GetMetaFileA; UINT (__stdcall * Real_GetMetaFileBitsEx)(HMETAFILE a0, UINT a1, LPVOID a2) = GetMetaFileBitsEx; HMETAFILE (__stdcall * Real_GetMetaFileW)(LPCWSTR a0) = GetMetaFileW; int (__stdcall * Real_GetMetaRgn)(HDC a0, HRGN a1) = GetMetaRgn; BOOL (__stdcall * Real_GetMiterLimit)(HDC a0, PFLOAT a1) = GetMiterLimit; DWORD (__stdcall * Real_GetModuleFileNameA)(HMODULE a0, LPSTR a1, DWORD a2) = GetModuleFileNameA; DWORD (__stdcall * Real_GetModuleFileNameW)(HMODULE a0, LPWSTR a1, DWORD a2) = GetModuleFileNameW; HMODULE (__stdcall * Real_GetModuleHandleA)(LPCSTR a0) = GetModuleHandleA; HMODULE (__stdcall * Real_GetModuleHandleW)(LPCWSTR a0) = GetModuleHandleW; BOOL (__stdcall * Real_GetNamedPipeHandleStateA)(HANDLE a0, LPDWORD a1, LPDWORD a2, LPDWORD a3, LPDWORD a4, LPSTR a5, DWORD a6) = GetNamedPipeHandleStateA; BOOL (__stdcall * Real_GetNamedPipeHandleStateW)(HANDLE a0, LPDWORD a1, LPDWORD a2, LPDWORD a3, LPDWORD a4, LPWSTR a5, DWORD a6) = GetNamedPipeHandleStateW; BOOL (__stdcall * Real_GetNamedPipeInfo)(HANDLE a0, LPDWORD a1, LPDWORD a2, LPDWORD a3, LPDWORD a4) = GetNamedPipeInfo; COLORREF (__stdcall * Real_GetNearestColor)(HDC a0, COLORREF a1) = GetNearestColor; UINT (__stdcall * Real_GetNearestPaletteIndex)(HPALETTE a0, COLORREF a1) = GetNearestPaletteIndex; HWND (__stdcall * Real_GetNextDlgGroupItem)(HWND a0, HWND a1, BOOL a2) = GetNextDlgGroupItem; HWND (__stdcall * Real_GetNextDlgTabItem)(HWND a0, HWND a1, BOOL a2) = GetNextDlgTabItem; int (__stdcall * Real_GetNumberFormatA)(LCID a0, DWORD a1, LPCSTR a2, CONST NUMBERFMTA* a3, LPSTR a4, int a5) = GetNumberFormatA; int (__stdcall * Real_GetNumberFormatW)(LCID a0, DWORD a1, LPCWSTR a2, CONST NUMBERFMTW* a3, LPWSTR a4, int a5) = GetNumberFormatW; BOOL (__stdcall * Real_GetNumberOfConsoleInputEvents)(HANDLE a0, LPDWORD a1) = GetNumberOfConsoleInputEvents; BOOL (__stdcall * Real_GetNumberOfConsoleMouseButtons)(LPDWORD a0) = GetNumberOfConsoleMouseButtons; UINT (__stdcall * Real_GetOEMCP)(void) = GetOEMCP; int (__stdcall * Real_GetObjectA)(HGDIOBJ a0, int a1, LPVOID a2) = GetObjectA; DWORD (__stdcall * Real_GetObjectType)(HGDIOBJ a0) = GetObjectType; int (__stdcall * Real_GetObjectW)(HGDIOBJ a0, int a1, LPVOID a2) = GetObjectW; HWND (__stdcall * Real_GetOpenClipboardWindow)(void) = GetOpenClipboardWindow; UINT (__stdcall * Real_GetOutlineTextMetricsA)(HDC a0, UINT a1, LPOUTLINETEXTMETRICA a2) = GetOutlineTextMetricsA; UINT (__stdcall * Real_GetOutlineTextMetricsW)(HDC a0, UINT a1, LPOUTLINETEXTMETRICW a2) = GetOutlineTextMetricsW; BOOL (__stdcall * Real_GetOverlappedResult)(HANDLE a0, LPOVERLAPPED a1, LPDWORD a2, BOOL a3) = GetOverlappedResult; UINT (__stdcall * Real_GetPaletteEntries)(HPALETTE a0, UINT a1, UINT a2, PALETTEENTRY* a3) = GetPaletteEntries; HWND (__stdcall * Real_GetParent)(HWND a0) = GetParent; int (__stdcall * Real_GetPath)(HDC a0, POINT* a1, LPBYTE a2, int a3) = GetPath; COLORREF (__stdcall * Real_GetPixel)(HDC a0, int a1, int a2) = GetPixel; int (__stdcall * Real_GetPixelFormat)(HDC a0) = GetPixelFormat; int (__stdcall * Real_GetPolyFillMode)(HDC a0) = GetPolyFillMode; DWORD (__stdcall * Real_GetPriorityClass)(HANDLE a0) = GetPriorityClass; int (__stdcall * Real_GetPriorityClipboardFormat)(UINT* a0, int a1) = GetPriorityClipboardFormat; UINT (__stdcall * Real_GetPrivateProfileIntA)(LPCSTR a0, LPCSTR a1, INT a2, LPCSTR a3) = GetPrivateProfileIntA; UINT (__stdcall * Real_GetPrivateProfileIntW)(LPCWSTR a0, LPCWSTR a1, INT a2, LPCWSTR a3) = GetPrivateProfileIntW; DWORD (__stdcall * Real_GetPrivateProfileSectionA)(LPCSTR a0, LPSTR a1, DWORD a2, LPCSTR a3) = GetPrivateProfileSectionA; DWORD (__stdcall * Real_GetPrivateProfileSectionNamesA)(LPSTR a0, DWORD a1, LPCSTR a2) = GetPrivateProfileSectionNamesA; DWORD (__stdcall * Real_GetPrivateProfileSectionNamesW)(LPWSTR a0, DWORD a1, LPCWSTR a2) = GetPrivateProfileSectionNamesW; DWORD (__stdcall * Real_GetPrivateProfileSectionW)(LPCWSTR a0, LPWSTR a1, DWORD a2, LPCWSTR a3) = GetPrivateProfileSectionW; DWORD (__stdcall * Real_GetPrivateProfileStringA)(LPCSTR a0, LPCSTR a1, LPCSTR a2, LPSTR a3, DWORD a4, LPCSTR a5) = GetPrivateProfileStringA; DWORD (__stdcall * Real_GetPrivateProfileStringW)(LPCWSTR a0, LPCWSTR a1, LPCWSTR a2, LPWSTR a3, DWORD a4, LPCWSTR a5) = GetPrivateProfileStringW; BOOL (__stdcall * Real_GetPrivateProfileStructA)(LPCSTR a0, LPCSTR a1, LPVOID a2, UINT a3, LPCSTR a4) = GetPrivateProfileStructA; BOOL (__stdcall * Real_GetPrivateProfileStructW)(LPCWSTR a0, LPCWSTR a1, LPVOID a2, UINT a3, LPCWSTR a4) = GetPrivateProfileStructW; FARPROC (__stdcall * Real_GetProcAddress)(HMODULE a0, LPCSTR a1) = GetProcAddress; BOOL (__stdcall * Real_GetProcessAffinityMask)(HANDLE a0, PDWORD_PTR a1, PDWORD_PTR a2) = GetProcessAffinityMask; DWORD (__stdcall * Real_GetProcessHeaps)(DWORD a0, PHANDLE a1) = GetProcessHeaps; BOOL (__stdcall * Real_GetProcessShutdownParameters)(LPDWORD a0, LPDWORD a1) = GetProcessShutdownParameters; BOOL (__stdcall * Real_GetProcessTimes)(HANDLE a0, LPFILETIME a1, LPFILETIME a2, LPFILETIME a3, LPFILETIME a4) = GetProcessTimes; DWORD (__stdcall * Real_GetProcessVersion)(DWORD a0) = GetProcessVersion; HWINSTA (__stdcall * Real_GetProcessWindowStation)(void) = GetProcessWindowStation; BOOL (__stdcall * Real_GetProcessWorkingSetSize)(HANDLE a0, PSIZE_T a1, PSIZE_T a2) = GetProcessWorkingSetSize; UINT (__stdcall * Real_GetProfileIntA)(LPCSTR a0, LPCSTR a1, INT a2) = GetProfileIntA; UINT (__stdcall * Real_GetProfileIntW)(LPCWSTR a0, LPCWSTR a1, INT a2) = GetProfileIntW; DWORD (__stdcall * Real_GetProfileSectionA)(LPCSTR a0, LPSTR a1, DWORD a2) = GetProfileSectionA; DWORD (__stdcall * Real_GetProfileSectionW)(LPCWSTR a0, LPWSTR a1, DWORD a2) = GetProfileSectionW; DWORD (__stdcall * Real_GetProfileStringA)(LPCSTR a0, LPCSTR a1, LPCSTR a2, LPSTR a3, DWORD a4) = GetProfileStringA; DWORD (__stdcall * Real_GetProfileStringW)(LPCWSTR a0, LPCWSTR a1, LPCWSTR a2, LPWSTR a3, DWORD a4) = GetProfileStringW; HANDLE (__stdcall * Real_GetPropA)(HWND a0, LPCSTR a1) = GetPropA; HANDLE (__stdcall * Real_GetPropW)(HWND a0, LPCWSTR a1) = GetPropW; DWORD (__stdcall * Real_GetQueueStatus)(UINT a0) = GetQueueStatus; BOOL (__stdcall * Real_GetQueuedCompletionStatus)(HANDLE a0, LPDWORD a1, PULONG_PTR a2, LPOVERLAPPED* a3, DWORD a4) = GetQueuedCompletionStatus; int (__stdcall * Real_GetROP2)(HDC a0) = GetROP2; BOOL (__stdcall * Real_GetRasterizerCaps)(LPRASTERIZER_STATUS a0, UINT a1) = GetRasterizerCaps; DWORD (__stdcall * Real_GetRegionData)(HRGN a0, DWORD a1, LPRGNDATA a2) = GetRegionData; int (__stdcall * Real_GetRgnBox)(HRGN a0, LPRECT a1) = GetRgnBox; HRESULT (__stdcall * Real_GetRunningObjectTable)(DWORD a0, LPRUNNINGOBJECTTABLE* a1) = GetRunningObjectTable; BOOL (__stdcall * Real_GetScrollInfo)(HWND a0, int a1, LPSCROLLINFO a2) = GetScrollInfo; int (__stdcall * Real_GetScrollPos)(HWND a0, int a1) = GetScrollPos; BOOL (__stdcall * Real_GetScrollRange)(HWND a0, int a1, LPINT a2, LPINT a3) = GetScrollRange; DWORD (__stdcall * Real_GetShortPathNameA)(LPCSTR a0, LPSTR a1, DWORD a2) = GetShortPathNameA; DWORD (__stdcall * Real_GetShortPathNameW)(LPCWSTR a0, LPWSTR a1, DWORD a2) = GetShortPathNameW; void (__stdcall * Real_GetStartupInfoA)(LPSTARTUPINFOA a0) = GetStartupInfoA; void (__stdcall * Real_GetStartupInfoW)(LPSTARTUPINFOW a0) = GetStartupInfoW; HANDLE (__stdcall * Real_GetStdHandle)(DWORD a0) = GetStdHandle; HGDIOBJ (__stdcall * Real_GetStockObject)(int a0) = GetStockObject; int (__stdcall * Real_GetStretchBltMode)(HDC a0) = GetStretchBltMode; HMENU (__stdcall * Real_GetSubMenu)(HMENU a0, int a1) = GetSubMenu; DWORD (__stdcall * Real_GetSysColor)(int a0) = GetSysColor; HBRUSH (__stdcall * Real_GetSysColorBrush)(int a0) = GetSysColorBrush; LCID (__stdcall * Real_GetSystemDefaultLCID)(void) = GetSystemDefaultLCID; LANGID (__stdcall * Real_GetSystemDefaultLangID)(void) = GetSystemDefaultLangID; UINT (__stdcall * Real_GetSystemDirectoryA)(LPSTR a0, UINT a1) = GetSystemDirectoryA; UINT (__stdcall * Real_GetSystemDirectoryW)(LPWSTR a0, UINT a1) = GetSystemDirectoryW; void (__stdcall * Real_GetSystemInfo)(LPSYSTEM_INFO a0) = GetSystemInfo; HMENU (__stdcall * Real_GetSystemMenu)(HWND a0, BOOL a1) = GetSystemMenu; int (__stdcall * Real_GetSystemMetrics)(int a0) = GetSystemMetrics; UINT (__stdcall * Real_GetSystemPaletteEntries)(HDC a0, UINT a1, UINT a2, PALETTEENTRY* a3) = GetSystemPaletteEntries; UINT (__stdcall * Real_GetSystemPaletteUse)(HDC a0) = GetSystemPaletteUse; BOOL (__stdcall * Real_GetSystemPowerStatus)(LPSYSTEM_POWER_STATUS a0) = GetSystemPowerStatus; void (__stdcall * Real_GetSystemTime)(LPSYSTEMTIME a0) = GetSystemTime; BOOL (__stdcall * Real_GetSystemTimeAdjustment)(PDWORD a0, PDWORD a1, PBOOL a2) = GetSystemTimeAdjustment; void (__stdcall * Real_GetSystemTimeAsFileTime)(LPFILETIME a0) = GetSystemTimeAsFileTime; #if _MSC_VER < 1300 DWORD (__stdcall * Real_GetTabbedTextExtentA)(HDC a0, LPCSTR a1, int a2, int a3, INT* a4) = GetTabbedTextExtentA; #else DWORD (__stdcall * Real_GetTabbedTextExtentA)(HDC a0, LPCSTR a1, int a2, int a3, CONST INT* a4) = GetTabbedTextExtentA; #endif #if _MSC_VER < 1300 DWORD (__stdcall * Real_GetTabbedTextExtentW)(HDC a0, LPCWSTR a1, int a2, int a3, INT* a4) = GetTabbedTextExtentW; #else DWORD (__stdcall * Real_GetTabbedTextExtentW)(HDC a0, LPCWSTR a1, int a2, int a3, CONST INT* a4) = GetTabbedTextExtentW; #endif DWORD (__stdcall * Real_GetTapeParameters)(HANDLE a0, DWORD a1, LPDWORD a2, LPVOID a3) = GetTapeParameters; DWORD (__stdcall * Real_GetTapePosition)(HANDLE a0, DWORD a1, LPDWORD a2, LPDWORD a3, LPDWORD a4) = GetTapePosition; DWORD (__stdcall * Real_GetTapeStatus)(HANDLE a0) = GetTapeStatus; UINT (__stdcall * Real_GetTempFileNameA)(LPCSTR a0, LPCSTR a1, UINT a2, LPSTR a3) = GetTempFileNameA; UINT (__stdcall * Real_GetTempFileNameW)(LPCWSTR a0, LPCWSTR a1, UINT a2, LPWSTR a3) = GetTempFileNameW; DWORD (__stdcall * Real_GetTempPathA)(DWORD a0, LPSTR a1) = GetTempPathA; DWORD (__stdcall * Real_GetTempPathW)(DWORD a0, LPWSTR a1) = GetTempPathW; UINT (__stdcall * Real_GetTextAlign)(HDC a0) = GetTextAlign; int (__stdcall * Real_GetTextCharacterExtra)(HDC a0) = GetTextCharacterExtra; int (__stdcall * Real_GetTextCharset)(HDC a0) = GetTextCharset; int (__stdcall * Real_GetTextCharsetInfo)(HDC a0, LPFONTSIGNATURE a1, DWORD a2) = GetTextCharsetInfo; COLORREF (__stdcall * Real_GetTextColor)(HDC a0) = GetTextColor; BOOL (__stdcall * Real_GetTextExtentExPointA)(HDC a0, LPCSTR a1, int a2, int a3, LPINT a4, LPINT a5, SIZE* a6) = GetTextExtentExPointA; BOOL (__stdcall * Real_GetTextExtentExPointW)(HDC a0, LPCWSTR a1, int a2, int a3, LPINT a4, LPINT a5, SIZE* a6) = GetTextExtentExPointW; BOOL (__stdcall * Real_GetTextExtentPoint32A)(HDC a0, LPCSTR a1, int a2, SIZE* a3) = GetTextExtentPoint32A; BOOL (__stdcall * Real_GetTextExtentPoint32W)(HDC a0, LPCWSTR a1, int a2, SIZE* a3) = GetTextExtentPoint32W; BOOL (__stdcall * Real_GetTextExtentPointA)(HDC a0, LPCSTR a1, int a2, SIZE* a3) = GetTextExtentPointA; BOOL (__stdcall * Real_GetTextExtentPointW)(HDC a0, LPCWSTR a1, int a2, SIZE* a3) = GetTextExtentPointW; int (__stdcall * Real_GetTextFaceA)(HDC a0, int a1, LPSTR a2) = GetTextFaceA; int (__stdcall * Real_GetTextFaceW)(HDC a0, int a1, LPWSTR a2) = GetTextFaceW; BOOL (__stdcall * Real_GetTextMetricsA)(HDC a0, LPTEXTMETRICA a1) = GetTextMetricsA; BOOL (__stdcall * Real_GetTextMetricsW)(HDC a0, LPTEXTMETRICW a1) = GetTextMetricsW; BOOL (__stdcall * Real_GetThreadContext)(HANDLE a0, LPCONTEXT a1) = GetThreadContext; HDESK (__stdcall * Real_GetThreadDesktop)(DWORD a0) = GetThreadDesktop; #if(WINVER >= 0x0500) LCID (__stdcall * Real_GetThreadLocale)(void) = GetThreadLocale; #endif // (WINVER >= 0x0500) int (__stdcall * Real_GetThreadPriority)(HANDLE a0) = GetThreadPriority; BOOL (__stdcall * Real_GetThreadPriorityBoost)(HANDLE a0, PBOOL a1) = GetThreadPriorityBoost; BOOL (__stdcall * Real_GetThreadSelectorEntry)(HANDLE a0, DWORD a1, LPLDT_ENTRY a2) = GetThreadSelectorEntry; BOOL (__stdcall * Real_GetThreadTimes)(HANDLE a0, LPFILETIME a1, LPFILETIME a2, LPFILETIME a3, LPFILETIME a4) = GetThreadTimes; DWORD (__stdcall * Real_GetTickCount)(void) = GetTickCount; int (__stdcall * Real_GetTimeFormatA)(LCID a0, DWORD a1, CONST SYSTEMTIME* a2, LPCSTR a3, LPSTR a4, int a5) = GetTimeFormatA; int (__stdcall * Real_GetTimeFormatW)(LCID a0, DWORD a1, CONST SYSTEMTIME* a2, LPCWSTR a3, LPWSTR a4, int a5) = GetTimeFormatW; DWORD (__stdcall * Real_GetTimeZoneInformation)(LPTIME_ZONE_INFORMATION a0) = GetTimeZoneInformation; HWND (__stdcall * Real_GetTopWindow)(HWND a0) = GetTopWindow; BOOL (__stdcall * Real_GetUpdateRect)(HWND a0, LPRECT a1, BOOL a2) = GetUpdateRect; int (__stdcall * Real_GetUpdateRgn)(HWND a0, HRGN a1, BOOL a2) = GetUpdateRgn; LCID (__stdcall * Real_GetUserDefaultLCID)(void) = GetUserDefaultLCID; LANGID (__stdcall * Real_GetUserDefaultLangID)(void) = GetUserDefaultLangID; BOOL (__stdcall * Real_GetUserObjectInformationA)(HANDLE a0, int a1, PVOID a2, DWORD a3, LPDWORD a4) = GetUserObjectInformationA; BOOL (__stdcall * Real_GetUserObjectInformationW)(HANDLE a0, int a1, PVOID a2, DWORD a3, LPDWORD a4) = GetUserObjectInformationW; BOOL (__stdcall * Real_GetUserObjectSecurity)(HANDLE a0, PSECURITY_INFORMATION a1, PSECURITY_DESCRIPTOR a2, DWORD a3, LPDWORD a4) = GetUserObjectSecurity; DWORD (__stdcall * Real_GetVersion)(void) = GetVersion; BOOL (__stdcall * Real_GetVersionExA)(LPOSVERSIONINFOA a0) = GetVersionExA; BOOL (__stdcall * Real_GetVersionExW)(LPOSVERSIONINFOW a0) = GetVersionExW; BOOL (__stdcall * Real_GetViewportExtEx)(HDC a0, SIZE* a1) = GetViewportExtEx; BOOL (__stdcall * Real_GetViewportOrgEx)(HDC a0, POINT* a1) = GetViewportOrgEx; BOOL (__stdcall * Real_GetVolumeInformationA)(LPCSTR a0, LPSTR a1, DWORD a2, LPDWORD a3, LPDWORD a4, LPDWORD a5, LPSTR a6, DWORD a7) = GetVolumeInformationA; BOOL (__stdcall * Real_GetVolumeInformationW)(LPCWSTR a0, LPWSTR a1, DWORD a2, LPDWORD a3, LPDWORD a4, LPDWORD a5, LPWSTR a6, DWORD a7) = GetVolumeInformationW; UINT (__stdcall * Real_GetWinMetaFileBits)(HENHMETAFILE a0, UINT a1, LPBYTE a2, INT a3, HDC a4) = GetWinMetaFileBits; HWND (__stdcall * Real_GetWindow)(HWND a0, UINT a1) = GetWindow; DWORD (__stdcall * Real_GetWindowContextHelpId)(HWND a0) = GetWindowContextHelpId; HDC (__stdcall * Real_GetWindowDC)(HWND a0) = GetWindowDC; BOOL (__stdcall * Real_GetWindowExtEx)(HDC a0, SIZE* a1) = GetWindowExtEx; LONG (__stdcall * Real_GetWindowLongA)(HWND a0, int a1) = GetWindowLongA; LONG (__stdcall * Real_GetWindowLongW)(HWND a0, int a1) = GetWindowLongW; BOOL (__stdcall * Real_GetWindowOrgEx)(HDC a0, POINT* a1) = GetWindowOrgEx; BOOL (__stdcall * Real_GetWindowPlacement)(HWND a0, WINDOWPLACEMENT* a1) = GetWindowPlacement; BOOL (__stdcall * Real_GetWindowRect)(HWND a0, LPRECT a1) = GetWindowRect; int (__stdcall * Real_GetWindowRgn)(HWND a0, HRGN a1) = GetWindowRgn; int (__stdcall * Real_GetWindowTextA)(HWND a0, LPSTR a1, int a2) = GetWindowTextA; int (__stdcall * Real_GetWindowTextLengthA)(HWND a0) = GetWindowTextLengthA; int (__stdcall * Real_GetWindowTextLengthW)(HWND a0) = GetWindowTextLengthW; int (__stdcall * Real_GetWindowTextW)(HWND a0, LPWSTR a1, int a2) = GetWindowTextW; DWORD (__stdcall * Real_GetWindowThreadProcessId)(HWND a0, LPDWORD a1) = GetWindowThreadProcessId; WORD (__stdcall * Real_GetWindowWord)(HWND a0, int a1) = GetWindowWord; UINT (__stdcall * Real_GetWindowsDirectoryA)(LPSTR a0, UINT a1) = GetWindowsDirectoryA; UINT (__stdcall * Real_GetWindowsDirectoryW)(LPWSTR a0, UINT a1) = GetWindowsDirectoryW; BOOL (__stdcall * Real_GetWorldTransform)(HDC a0, XFORM* a1) = GetWorldTransform; ATOM (__stdcall * Real_GlobalAddAtomA)(LPCSTR a0) = GlobalAddAtomA; ATOM (__stdcall * Real_GlobalAddAtomW)(LPCWSTR a0) = GlobalAddAtomW; HGLOBAL (__stdcall * Real_GlobalAlloc)(UINT a0, SIZE_T a1) = GlobalAlloc; #if _MSC_VER < 1300 UINT (__stdcall * Real_GlobalCompact)(DWORD a0) = GlobalCompact; #else SIZE_T (__stdcall * Real_GlobalCompact)(DWORD a0) = GlobalCompact; #endif ATOM (__stdcall * Real_GlobalDeleteAtom)(ATOM a0) = GlobalDeleteAtom; ATOM (__stdcall * Real_GlobalFindAtomA)(LPCSTR a0) = GlobalFindAtomA; ATOM (__stdcall * Real_GlobalFindAtomW)(LPCWSTR a0) = GlobalFindAtomW; void (__stdcall * Real_GlobalFix)(HGLOBAL a0) = GlobalFix; UINT (__stdcall * Real_GlobalFlags)(HGLOBAL a0) = GlobalFlags; HGLOBAL (__stdcall * Real_GlobalFree)(HGLOBAL a0) = GlobalFree; UINT (__stdcall * Real_GlobalGetAtomNameA)(ATOM a0, LPSTR a1, int a2) = GlobalGetAtomNameA; UINT (__stdcall * Real_GlobalGetAtomNameW)(ATOM a0, LPWSTR a1, int a2) = GlobalGetAtomNameW; HGLOBAL (__stdcall * Real_GlobalHandle)(LPCVOID a0) = GlobalHandle; LPVOID (__stdcall * Real_GlobalLock)(HGLOBAL a0) = GlobalLock; void (__stdcall * Real_GlobalMemoryStatus)(LPMEMORYSTATUS a0) = GlobalMemoryStatus; HGLOBAL (__stdcall * Real_GlobalReAlloc)(HGLOBAL a0, SIZE_T a1, UINT a2) = GlobalReAlloc; SIZE_T (__stdcall * Real_GlobalSize)(HGLOBAL a0) = GlobalSize; BOOL (__stdcall * Real_GlobalUnWire)(HGLOBAL a0) = GlobalUnWire; void (__stdcall * Real_GlobalUnfix)(HGLOBAL a0) = GlobalUnfix; BOOL (__stdcall * Real_GlobalUnlock)(HGLOBAL a0) = GlobalUnlock; LPVOID (__stdcall * Real_GlobalWire)(HGLOBAL a0) = GlobalWire; BOOL (__stdcall * Real_GrayStringA)(HDC a0, HBRUSH a1, GRAYSTRINGPROC a2, LPARAM a3, int a4, int a5, int a6, int a7, int a8) = GrayStringA; BOOL (__stdcall * Real_GrayStringW)(HDC a0, HBRUSH a1, GRAYSTRINGPROC a2, LPARAM a3, int a4, int a5, int a6, int a7, int a8) = GrayStringW; BOOL (__stdcall * Real_HeapLock)(HANDLE a0) = HeapLock; BOOL (__stdcall * Real_HeapUnlock)(HANDLE a0) = HeapUnlock; BOOL (__stdcall * Real_HideCaret)(HWND a0) = HideCaret; BOOL (__stdcall * Real_HiliteMenuItem)(HWND a0, HMENU a1, UINT a2, UINT a3) = HiliteMenuItem; #ifdef _WIN32_WINNT_WIN7 HRESULT (__stdcall * Real_IIDFromString)(LPCOLESTR a0, LPGUID a1) = IIDFromString; #else HRESULT (__stdcall * Real_IIDFromString)(LPOLESTR a0, LPGUID a1) = IIDFromString; #endif BOOL (__stdcall * Real_ImpersonateDdeClientWindow)(HWND a0, HWND a1) = ImpersonateDdeClientWindow; BOOL (__stdcall * Real_InSendMessage)(void) = InSendMessage; BOOL (__stdcall * Real_InflateRect)(LPRECT a0, int a1, int a2) = InflateRect; BOOL (__stdcall * Real_InitAtomTable)(DWORD a0) = InitAtomTable; BOOL (__stdcall * Real_InsertMenuA)(HMENU a0, UINT a1, UINT a2, UINT_PTR a3, LPCSTR a4) = InsertMenuA; BOOL (__stdcall * Real_InsertMenuW)(HMENU a0, UINT a1, UINT a2, UINT_PTR a3, LPCWSTR a4) = InsertMenuW; BOOL (__stdcall * Real_InsertMenuItemA)(HMENU a0, UINT a1, BOOL a2, LPCMENUITEMINFOA a3) = InsertMenuItemA; BOOL (__stdcall * Real_InsertMenuItemW)(HMENU a0, UINT a1, BOOL a2, LPCMENUITEMINFOW a3) = InsertMenuItemW; int (__stdcall * Real_IntersectClipRect)(HDC a0, int a1, int a2, int a3, int a4) = IntersectClipRect; BOOL (__stdcall * Real_IntersectRect)(LPRECT a0, CONST RECT* a1, CONST RECT* a2) = IntersectRect; BOOL (__stdcall * Real_InvalidateRect)(HWND a0, CONST RECT* a1, BOOL a2) = InvalidateRect; BOOL (__stdcall * Real_InvalidateRgn)(HWND a0, HRGN a1, BOOL a2) = InvalidateRgn; BOOL (__stdcall * Real_InvertRect)(HDC a0, CONST RECT* a1) = InvertRect; BOOL (__stdcall * Real_InvertRgn)(HDC a0, HRGN a1) = InvertRgn; BOOL (__stdcall * Real_IsAccelerator)(HACCEL a0, int a1, LPMSG a2, WORD* a3) = IsAccelerator; BOOL (__stdcall * Real_IsBadCodePtr)(FARPROC a0) = IsBadCodePtr; BOOL (__stdcall * Real_IsBadHugeReadPtr)(CONST void* a0, UINT_PTR a1) = IsBadHugeReadPtr; BOOL (__stdcall * Real_IsBadHugeWritePtr)(LPVOID a0, UINT_PTR a1) = IsBadHugeWritePtr; BOOL (__stdcall * Real_IsBadReadPtr)(CONST void* a0, UINT_PTR a1) = IsBadReadPtr; BOOL (__stdcall * Real_IsBadStringPtrA)(LPCSTR a0, UINT_PTR a1) = IsBadStringPtrA; BOOL (__stdcall * Real_IsBadStringPtrW)(LPCWSTR a0, UINT_PTR a1) = IsBadStringPtrW; BOOL (__stdcall * Real_IsBadWritePtr)(LPVOID a0, UINT_PTR a1) = IsBadWritePtr; BOOL (__stdcall * Real_IsCharAlphaA)(CHAR a0) = IsCharAlphaA; BOOL (__stdcall * Real_IsCharAlphaNumericA)(CHAR a0) = IsCharAlphaNumericA; BOOL (__stdcall * Real_IsCharAlphaNumericW)(WCHAR a0) = IsCharAlphaNumericW; BOOL (__stdcall * Real_IsCharAlphaW)(WCHAR a0) = IsCharAlphaW; BOOL (__stdcall * Real_IsCharLowerA)(CHAR a0) = IsCharLowerA; BOOL (__stdcall * Real_IsCharLowerW)(WCHAR a0) = IsCharLowerW; BOOL (__stdcall * Real_IsCharUpperA)(CHAR a0) = IsCharUpperA; BOOL (__stdcall * Real_IsCharUpperW)(WCHAR a0) = IsCharUpperW; BOOL (__stdcall * Real_IsChild)(HWND a0, HWND a1) = IsChild; BOOL (__stdcall * Real_IsClipboardFormatAvailable)(UINT a0) = IsClipboardFormatAvailable; BOOL (__stdcall * Real_IsDBCSLeadByte)(BYTE a0) = IsDBCSLeadByte; BOOL (__stdcall * Real_IsDBCSLeadByteEx)(UINT a0, BYTE a1) = IsDBCSLeadByteEx; BOOL (__stdcall * Real_IsDebuggerPresent)(void) = IsDebuggerPresent; BOOL (__stdcall * Real_IsDialogMessageA)(HWND a0, LPMSG a1) = IsDialogMessageA; BOOL (__stdcall * Real_IsDialogMessageW)(HWND a0, LPMSG a1) = IsDialogMessageW; UINT (__stdcall * Real_IsDlgButtonChecked)(HWND a0, int a1) = IsDlgButtonChecked; BOOL (__stdcall * Real_IsIconic)(HWND a0) = IsIconic; BOOL (__stdcall * Real_IsMenu)(HMENU a0) = IsMenu; #if !defined(DETOURS_ARM) BOOL (__stdcall * Real_IsProcessorFeaturePresent)(DWORD a0) = IsProcessorFeaturePresent; #endif // !DETOURS_ARM BOOL (__stdcall * Real_IsRectEmpty)(CONST RECT* a0) = IsRectEmpty; BOOL (__stdcall * Real_IsValidCodePage)(UINT a0) = IsValidCodePage; BOOL (__stdcall * Real_IsValidLocale)(LCID a0, DWORD a1) = IsValidLocale; BOOL (__stdcall * Real_IsWindow)(HWND a0) = IsWindow; BOOL (__stdcall * Real_IsWindowEnabled)(HWND a0) = IsWindowEnabled; BOOL (__stdcall * Real_IsWindowUnicode)(HWND a0) = IsWindowUnicode; BOOL (__stdcall * Real_IsWindowVisible)(HWND a0) = IsWindowVisible; BOOL (__stdcall * Real_IsZoomed)(HWND a0) = IsZoomed; BOOL (__stdcall * Real_KillTimer)(HWND a0, UINT_PTR a1) = KillTimer; BOOL (__stdcall * Real_LPtoDP)(HDC a0, POINT* a1, int a2) = LPtoDP; BOOL (__stdcall * Real_LineDDA)(int a0, int a1, int a2, int a3, LINEDDAPROC a4, LPARAM a5) = LineDDA; BOOL (__stdcall * Real_LineTo)(HDC a0, int a1, int a2) = LineTo; HACCEL (__stdcall * Real_LoadAcceleratorsA)(HINSTANCE a0, LPCSTR a1) = LoadAcceleratorsA; HACCEL (__stdcall * Real_LoadAcceleratorsW)(HINSTANCE a0, LPCWSTR a1) = LoadAcceleratorsW; HBITMAP (__stdcall * Real_LoadBitmapA)(HINSTANCE a0, LPCSTR a1) = LoadBitmapA; HBITMAP (__stdcall * Real_LoadBitmapW)(HINSTANCE a0, LPCWSTR a1) = LoadBitmapW; HCURSOR (__stdcall * Real_LoadCursorA)(HINSTANCE a0, LPCSTR a1) = LoadCursorA; HCURSOR (__stdcall * Real_LoadCursorFromFileA)(LPCSTR a0) = LoadCursorFromFileA; HCURSOR (__stdcall * Real_LoadCursorFromFileW)(LPCWSTR a0) = LoadCursorFromFileW; HCURSOR (__stdcall * Real_LoadCursorW)(HINSTANCE a0, LPCWSTR a1) = LoadCursorW; HICON (__stdcall * Real_LoadIconA)(HINSTANCE a0, LPCSTR a1) = LoadIconA; HICON (__stdcall * Real_LoadIconW)(HINSTANCE a0, LPCWSTR a1) = LoadIconW; HANDLE (__stdcall * Real_LoadImageA)(HINSTANCE a0, LPCSTR a1, UINT a2, int a3, int a4, UINT a5) = LoadImageA; HANDLE (__stdcall * Real_LoadImageW)(HINSTANCE a0, LPCWSTR a1, UINT a2, int a3, int a4, UINT a5) = LoadImageW; HKL (__stdcall * Real_LoadKeyboardLayoutA)(LPCSTR a0, UINT a1) = LoadKeyboardLayoutA; HKL (__stdcall * Real_LoadKeyboardLayoutW)(LPCWSTR a0, UINT a1) = LoadKeyboardLayoutW; HMODULE (__stdcall * Real_LoadLibraryA)(LPCSTR a0) = LoadLibraryA; HMODULE (__stdcall * Real_LoadLibraryExA)(LPCSTR a0, HANDLE a1, DWORD a2) = LoadLibraryExA; HMODULE (__stdcall * Real_LoadLibraryExW)(LPCWSTR a0, HANDLE a1, DWORD a2) = LoadLibraryExW; HMODULE (__stdcall * Real_LoadLibraryW)(LPCWSTR a0) = LoadLibraryW; HMENU (__stdcall * Real_LoadMenuA)(HINSTANCE a0, LPCSTR a1) = LoadMenuA; HMENU (__stdcall * Real_LoadMenuIndirectA)(CONST MENUTEMPLATEA* a0) = LoadMenuIndirectA; HMENU (__stdcall * Real_LoadMenuIndirectW)(CONST MENUTEMPLATEW* a0) = LoadMenuIndirectW; HMENU (__stdcall * Real_LoadMenuW)(HINSTANCE a0, LPCWSTR a1) = LoadMenuW; DWORD (__stdcall * Real_LoadModule)(LPCSTR a0, LPVOID a1) = LoadModule; HGLOBAL (__stdcall * Real_LoadResource)(HMODULE a0, HRSRC a1) = LoadResource; int (__stdcall * Real_LoadStringA)(HINSTANCE a0, UINT a1, LPSTR a2, int a3) = LoadStringA; int (__stdcall * Real_LoadStringW)(HINSTANCE a0, UINT a1, LPWSTR a2, int a3) = LoadStringW; #if _MSC_VER < 1300 HLOCAL (__stdcall * Real_LocalAlloc)(UINT a0, UINT a1) = LocalAlloc; #else HLOCAL (__stdcall * Real_LocalAlloc)(UINT a0, SIZE_T a1) = LocalAlloc; #endif #if _MSC_VER < 1300 UINT (__stdcall * Real_LocalCompact)(UINT a0) = LocalCompact; #else SIZE_T (__stdcall * Real_LocalCompact)(UINT a0) = LocalCompact; #endif BOOL (__stdcall * Real_LocalFileTimeToFileTime)(CONST FILETIME* a0, LPFILETIME a1) = LocalFileTimeToFileTime; UINT (__stdcall * Real_LocalFlags)(HLOCAL a0) = LocalFlags; HLOCAL (__stdcall * Real_LocalFree)(HLOCAL a0) = LocalFree; HLOCAL (__stdcall * Real_LocalHandle)(LPCVOID a0) = LocalHandle; LPVOID (__stdcall * Real_LocalLock)(HLOCAL a0) = LocalLock; #if _MSC_VER < 1300 HLOCAL (__stdcall * Real_LocalReAlloc)(HLOCAL a0, UINT a1, UINT a2) = LocalReAlloc; #else HLOCAL (__stdcall * Real_LocalReAlloc)(HLOCAL a0, SIZE_T a1, UINT a2) = LocalReAlloc; #endif #if _MSC_VER < 1300 UINT (__stdcall * Real_LocalShrink)(HLOCAL a0, UINT a1) = LocalShrink; #else SIZE_T (__stdcall * Real_LocalShrink)(HLOCAL a0, UINT a1) = LocalShrink; #endif #if _MSC_VER < 1300 UINT (__stdcall * Real_LocalSize)(HLOCAL a0) = LocalSize; #else SIZE_T (__stdcall * Real_LocalSize)(HLOCAL a0) = LocalSize; #endif BOOL (__stdcall * Real_LocalUnlock)(HLOCAL a0) = LocalUnlock; BOOL (__stdcall * Real_LockFile)(HANDLE a0, DWORD a1, DWORD a2, DWORD a3, DWORD a4) = LockFile; BOOL (__stdcall * Real_LockFileEx)(HANDLE a0, DWORD a1, DWORD a2, DWORD a3, DWORD a4, LPOVERLAPPED a5) = LockFileEx; LPVOID (__stdcall * Real_LockResource)(HGLOBAL a0) = LockResource; BOOL (__stdcall * Real_LockWindowUpdate)(HWND a0) = LockWindowUpdate; int (__stdcall * Real_LookupIconIdFromDirectory)(PBYTE a0, BOOL a1) = LookupIconIdFromDirectory; int (__stdcall * Real_LookupIconIdFromDirectoryEx)(PBYTE a0, BOOL a1, int a2, int a3, UINT a4) = LookupIconIdFromDirectoryEx; BOOL (__stdcall * Real_MapDialogRect)(HWND a0, LPRECT a1) = MapDialogRect; LPVOID (__stdcall * Real_MapViewOfFile)(HANDLE a0, DWORD a1, DWORD a2, DWORD a3, SIZE_T a4) = MapViewOfFile; LPVOID (__stdcall * Real_MapViewOfFileEx)(HANDLE a0, DWORD a1, DWORD a2, DWORD a3, SIZE_T a4, LPVOID a5) = MapViewOfFileEx; UINT (__stdcall * Real_MapVirtualKeyA)(UINT a0, UINT a1) = MapVirtualKeyA; UINT (__stdcall * Real_MapVirtualKeyExA)(UINT a0, UINT a1, HKL a2) = MapVirtualKeyExA; UINT (__stdcall * Real_MapVirtualKeyExW)(UINT a0, UINT a1, HKL a2) = MapVirtualKeyExW; UINT (__stdcall * Real_MapVirtualKeyW)(UINT a0, UINT a1) = MapVirtualKeyW; int (__stdcall * Real_MapWindowPoints)(HWND a0, HWND a1, POINT* a2, UINT a3) = MapWindowPoints; BOOL (__stdcall * Real_MaskBlt)(HDC a0, int a1, int a2, int a3, int a4, HDC a5, int a6, int a7, HBITMAP a8, int a9, int a10, DWORD a11) = MaskBlt; int (__stdcall * Real_MenuItemFromPoint)(HWND a0, HMENU a1, POINT a2) = MenuItemFromPoint; BOOL (__stdcall * Real_MessageBeep)(UINT a0) = MessageBeep; int (__stdcall * Real_MessageBoxA)(HWND a0, LPCSTR a1, LPCSTR a2, UINT a3) = MessageBoxA; int (__stdcall * Real_MessageBoxExA)(HWND a0, LPCSTR a1, LPCSTR a2, UINT a3, WORD a4) = MessageBoxExA; int (__stdcall * Real_MessageBoxExW)(HWND a0, LPCWSTR a1, LPCWSTR a2, UINT a3, WORD a4) = MessageBoxExW; #if _MSC_VER < 1300 int (__stdcall * Real_MessageBoxIndirectA)(MSGBOXPARAMSA* a0) = MessageBoxIndirectA; #else int (__stdcall * Real_MessageBoxIndirectA)(CONST MSGBOXPARAMSA* a0) = MessageBoxIndirectA; #endif #if _MSC_VER < 1300 int (__stdcall * Real_MessageBoxIndirectW)(MSGBOXPARAMSW* a0) = MessageBoxIndirectW; #else int (__stdcall * Real_MessageBoxIndirectW)(CONST MSGBOXPARAMSW* a0) = MessageBoxIndirectW; #endif int (__stdcall * Real_MessageBoxW)(HWND a0, LPCWSTR a1, LPCWSTR a2, UINT a3) = MessageBoxW; HRESULT (__stdcall * Real_MkParseDisplayName)(IBindCtx* a0, LPCOLESTR a1, ULONG* a2, IMoniker** a3) = MkParseDisplayName; BOOL (__stdcall * Real_ModifyMenuA)(HMENU a0, UINT a1, UINT a2, UINT_PTR a3, LPCSTR a4) = ModifyMenuA; BOOL (__stdcall * Real_ModifyMenuW)(HMENU a0, UINT a1, UINT a2, UINT_PTR a3, LPCWSTR a4) = ModifyMenuW; BOOL (__stdcall * Real_ModifyWorldTransform)(HDC a0, CONST XFORM* a1, DWORD a2) = ModifyWorldTransform; HRESULT (__stdcall * Real_MonikerCommonPrefixWith)(IMoniker* a0, IMoniker* a1, IMoniker** a2) = MonikerCommonPrefixWith; HRESULT (__stdcall * Real_MonikerRelativePathTo)(IMoniker* a0, IMoniker* a1, IMoniker** a2, BOOL a3) = MonikerRelativePathTo; BOOL (__stdcall * Real_MoveFileA)(LPCSTR a0, LPCSTR a1) = MoveFileA; BOOL (__stdcall * Real_MoveFileExA)(LPCSTR a0, LPCSTR a1, DWORD a2) = MoveFileExA; BOOL (__stdcall * Real_MoveFileExW)(LPCWSTR a0, LPCWSTR a1, DWORD a2) = MoveFileExW; BOOL (__stdcall * Real_MoveFileW)(LPCWSTR a0, LPCWSTR a1) = MoveFileW; BOOL (__stdcall * Real_MoveToEx)(HDC a0, int a1, int a2, POINT* a3) = MoveToEx; BOOL (__stdcall * Real_MoveWindow)(HWND a0, int a1, int a2, int a3, int a4, BOOL a5) = MoveWindow; #if _MSC_VER < 1300 DWORD (__stdcall * Real_MsgWaitForMultipleObjects)(DWORD a0, HANDLE * a1, BOOL a2, DWORD a3, DWORD a4) = MsgWaitForMultipleObjects; #else DWORD (__stdcall * Real_MsgWaitForMultipleObjects)(DWORD a0, CONST HANDLE * a1, BOOL a2, DWORD a3, DWORD a4) = MsgWaitForMultipleObjects; #endif #if _MSC_VER < 1300 DWORD (__stdcall * Real_MsgWaitForMultipleObjectsEx)(DWORD a0, HANDLE * a1, DWORD a2, DWORD a3, DWORD a4) = MsgWaitForMultipleObjectsEx; #else DWORD (__stdcall * Real_MsgWaitForMultipleObjectsEx)(DWORD a0, CONST HANDLE * a1, DWORD a2, DWORD a3, DWORD a4) = MsgWaitForMultipleObjectsEx; #endif int (__stdcall * Real_MulDiv)(int a0, int a1, int a2) = MulDiv; DWORD (__stdcall * Real_OemKeyScan)(WORD a0) = OemKeyScan; BOOL (__stdcall * Real_OemToCharA)(LPCSTR a0, LPSTR a1) = OemToCharA; BOOL (__stdcall * Real_OemToCharBuffA)(LPCSTR a0, LPSTR a1, DWORD a2) = OemToCharBuffA; BOOL (__stdcall * Real_OemToCharBuffW)(LPCSTR a0, LPWSTR a1, DWORD a2) = OemToCharBuffW; BOOL (__stdcall * Real_OemToCharW)(LPCSTR a0, LPWSTR a1) = OemToCharW; int (__stdcall * Real_OffsetClipRgn)(HDC a0, int a1, int a2) = OffsetClipRgn; BOOL (__stdcall * Real_OffsetRect)(LPRECT a0, int a1, int a2) = OffsetRect; int (__stdcall * Real_OffsetRgn)(HRGN a0, int a1, int a2) = OffsetRgn; BOOL (__stdcall * Real_OffsetViewportOrgEx)(HDC a0, int a1, int a2, POINT* a3) = OffsetViewportOrgEx; BOOL (__stdcall * Real_OffsetWindowOrgEx)(HDC a0, int a1, int a2, POINT* a3) = OffsetWindowOrgEx; DWORD (__stdcall * Real_OleBuildVersion)(void) = OleBuildVersion; HRESULT (__stdcall * Real_OleConvertIStorageToOLESTREAM)(IStorage* a0, LPOLESTREAM a1) = OleConvertIStorageToOLESTREAM; HRESULT (__stdcall * Real_OleConvertIStorageToOLESTREAMEx)(IStorage* a0, CLIPFORMAT a1, LONG a2, LONG a3, DWORD a4, LPSTGMEDIUM a5, LPOLESTREAM a6) = OleConvertIStorageToOLESTREAMEx; HRESULT (__stdcall * Real_OleConvertOLESTREAMToIStorage)(LPOLESTREAM a0, LPSTORAGE a1, CONST DVTARGETDEVICE* a2) = OleConvertOLESTREAMToIStorage; HRESULT (__stdcall * Real_OleConvertOLESTREAMToIStorageEx)(LPOLESTREAM a0, LPSTORAGE a1, CLIPFORMAT* a2, LONG* a3, LONG* a4, DWORD* a5, LPSTGMEDIUM a6) = OleConvertOLESTREAMToIStorageEx; HRESULT (__stdcall * Real_OleCreate)(CONST IID& a0, CONST IID& a1, DWORD a2, LPFORMATETC a3, LPOLECLIENTSITE a4, LPSTORAGE a5, LPVOID* a6) = OleCreate; HRESULT (__stdcall * Real_OleCreateDefaultHandler)(CONST IID& a0, LPUNKNOWN a1, CONST IID& a2, LPVOID* a3) = OleCreateDefaultHandler; HRESULT (__stdcall * Real_OleCreateEmbeddingHelper)(CONST IID& a0, LPUNKNOWN a1, DWORD a2, LPCLASSFACTORY a3, CONST IID& a4, LPVOID* a5) = OleCreateEmbeddingHelper; HRESULT (__stdcall * Real_OleCreateEx)(CONST IID& a0, CONST IID& a1, DWORD a2, DWORD a3, ULONG a4, DWORD* a5, LPFORMATETC a6, IAdviseSink* a7, DWORD* a8, LPOLECLIENTSITE a9, LPSTORAGE a10, LPVOID* a11) = OleCreateEx; HRESULT (__stdcall * Real_OleCreateFromData)(IDataObject* a0, CONST IID& a1, DWORD a2, LPFORMATETC a3, LPOLECLIENTSITE a4, LPSTORAGE a5, LPVOID* a6) = OleCreateFromData; HRESULT (__stdcall * Real_OleCreateFromDataEx)(IDataObject* a0, CONST IID& a1, DWORD a2, DWORD a3, ULONG a4, DWORD* a5, LPFORMATETC a6, IAdviseSink* a7, DWORD* a8, LPOLECLIENTSITE a9, LPSTORAGE a10, LPVOID* a11) = OleCreateFromDataEx; HRESULT (__stdcall * Real_OleCreateFromFile)(CONST IID& a0, LPCOLESTR a1, CONST IID& a2, DWORD a3, LPFORMATETC a4, LPOLECLIENTSITE a5, LPSTORAGE a6, LPVOID* a7) = OleCreateFromFile; HRESULT (__stdcall * Real_OleCreateFromFileEx)(CONST IID& a0, LPCOLESTR a1, CONST IID& a2, DWORD a3, DWORD a4, ULONG a5, DWORD* a6, LPFORMATETC a7, IAdviseSink* a8, DWORD* a9, LPOLECLIENTSITE a10, LPSTORAGE a11, LPVOID* a12) = OleCreateFromFileEx; HRESULT (__stdcall * Real_OleCreateLink)(IMoniker* a0, CONST IID& a1, DWORD a2, LPFORMATETC a3, LPOLECLIENTSITE a4, LPSTORAGE a5, LPVOID* a6) = OleCreateLink; HRESULT (__stdcall * Real_OleCreateLinkEx)(IMoniker* a0, CONST IID& a1, DWORD a2, DWORD a3, ULONG a4, DWORD* a5, LPFORMATETC a6, IAdviseSink* a7, DWORD* a8, LPOLECLIENTSITE a9, LPSTORAGE a10, LPVOID* a11) = OleCreateLinkEx; HRESULT (__stdcall * Real_OleCreateLinkFromData)(IDataObject* a0, CONST IID& a1, DWORD a2, LPFORMATETC a3, LPOLECLIENTSITE a4, LPSTORAGE a5, LPVOID* a6) = OleCreateLinkFromData; HRESULT (__stdcall * Real_OleCreateLinkFromDataEx)(IDataObject* a0, CONST IID& a1, DWORD a2, DWORD a3, ULONG a4, DWORD* a5, LPFORMATETC a6, IAdviseSink* a7, DWORD* a8, LPOLECLIENTSITE a9, LPSTORAGE a10, LPVOID* a11) = OleCreateLinkFromDataEx; HRESULT (__stdcall * Real_OleCreateLinkToFile)(LPCOLESTR a0, CONST IID& a1, DWORD a2, LPFORMATETC a3, LPOLECLIENTSITE a4, LPSTORAGE a5, LPVOID* a6) = OleCreateLinkToFile; HRESULT (__stdcall * Real_OleCreateLinkToFileEx)(LPCOLESTR a0, CONST IID& a1, DWORD a2, DWORD a3, ULONG a4, DWORD* a5, LPFORMATETC a6, IAdviseSink* a7, DWORD* a8, LPOLECLIENTSITE a9, LPSTORAGE a10, LPVOID* a11) = OleCreateLinkToFileEx; HOLEMENU (__stdcall * Real_OleCreateMenuDescriptor)(HMENU a0, LPOLEMENUGROUPWIDTHS a1) = OleCreateMenuDescriptor; HRESULT (__stdcall * Real_OleCreateStaticFromData)(IDataObject* a0, CONST IID& a1, DWORD a2, LPFORMATETC a3, LPOLECLIENTSITE a4, LPSTORAGE a5, LPVOID* a6) = OleCreateStaticFromData; HRESULT (__stdcall * Real_OleDestroyMenuDescriptor)(HOLEMENU a0) = OleDestroyMenuDescriptor; HRESULT (__stdcall * Real_OleDoAutoConvert)(LPSTORAGE a0, LPGUID a1) = OleDoAutoConvert; HRESULT (__stdcall * Real_OleDraw)(LPUNKNOWN a0, DWORD a1, HDC a2, LPCRECT a3) = OleDraw; HANDLE (__stdcall * Real_OleDuplicateData)(HANDLE a0, CLIPFORMAT a1, UINT a2) = OleDuplicateData; HRESULT (__stdcall * Real_OleFlushClipboard)(void) = OleFlushClipboard; HRESULT (__stdcall * Real_OleGetAutoConvert)(CONST IID& a0, LPGUID a1) = OleGetAutoConvert; HRESULT (__stdcall * Real_OleGetClipboard)(IDataObject** a0) = OleGetClipboard; HGLOBAL (__stdcall * Real_OleGetIconOfClass)(CONST IID& a0, LPOLESTR a1, BOOL a2) = OleGetIconOfClass; HGLOBAL (__stdcall * Real_OleGetIconOfFile)(LPOLESTR a0, BOOL a1) = OleGetIconOfFile; HRESULT (__stdcall * Real_OleInitialize)(LPVOID a0) = OleInitialize; HRESULT (__stdcall * Real_OleIsCurrentClipboard)(IDataObject* a0) = OleIsCurrentClipboard; BOOL (__stdcall * Real_OleIsRunning)(IOleObject* a0) = OleIsRunning; HRESULT (__stdcall * Real_OleLoad)(LPSTORAGE a0, CONST IID& a1, LPOLECLIENTSITE a2, LPVOID* a3) = OleLoad; HRESULT (__stdcall * Real_OleLoadFromStream)(LPSTREAM a0, CONST IID& a1, LPVOID* a2) = OleLoadFromStream; HRESULT (__stdcall * Real_OleLockRunning)(LPUNKNOWN a0, BOOL a1, BOOL a2) = OleLockRunning; HGLOBAL (__stdcall * Real_OleMetafilePictFromIconAndLabel)(HICON a0, LPOLESTR a1, LPOLESTR a2, UINT a3) = OleMetafilePictFromIconAndLabel; HRESULT (__stdcall * Real_OleNoteObjectVisible)(LPUNKNOWN a0, BOOL a1) = OleNoteObjectVisible; HRESULT (__stdcall * Real_OleQueryCreateFromData)(IDataObject* a0) = OleQueryCreateFromData; HRESULT (__stdcall * Real_OleQueryLinkFromData)(IDataObject* a0) = OleQueryLinkFromData; HRESULT (__stdcall * Real_OleRegEnumFormatEtc)(CONST IID& a0, DWORD a1, IEnumFORMATETC** a2) = OleRegEnumFormatEtc; HRESULT (__stdcall * Real_OleRegEnumVerbs)(CONST IID& a0, IEnumOLEVERB** a1) = OleRegEnumVerbs; HRESULT (__stdcall * Real_OleRegGetMiscStatus)(CONST IID& a0, DWORD a1, DWORD* a2) = OleRegGetMiscStatus; HRESULT (__stdcall * Real_OleRegGetUserType)(CONST IID& a0, DWORD a1, LPOLESTR* a2) = OleRegGetUserType; HRESULT (__stdcall * Real_OleRun)(LPUNKNOWN a0) = OleRun; HRESULT (__stdcall * Real_OleSave)(LPPERSISTSTORAGE a0, LPSTORAGE a1, BOOL a2) = OleSave; HRESULT (__stdcall * Real_OleSaveToStream)(IPersistStream* a0, LPSTREAM a1) = OleSaveToStream; HRESULT (__stdcall * Real_OleSetAutoConvert)(CONST IID& a0, CONST IID& a1) = OleSetAutoConvert; HRESULT (__stdcall * Real_OleSetClipboard)(IDataObject* a0) = OleSetClipboard; HRESULT (__stdcall * Real_OleSetContainedObject)(LPUNKNOWN a0, BOOL a1) = OleSetContainedObject; HRESULT (__stdcall * Real_OleSetMenuDescriptor)(HOLEMENU a0, HWND a1, HWND a2, LPOLEINPLACEFRAME a3, LPOLEINPLACEACTIVEOBJECT a4) = OleSetMenuDescriptor; HRESULT (__stdcall * Real_OleTranslateAccelerator)(LPOLEINPLACEFRAME a0, LPOLEINPLACEFRAMEINFO a1, LPMSG a2) = OleTranslateAccelerator; void (__stdcall * Real_OleUninitialize)(void) = OleUninitialize; BOOL (__stdcall * Real_OpenClipboard)(HWND a0) = OpenClipboard; #if _MSC_VER < 1300 HDESK (__stdcall * Real_OpenDesktopA)(LPSTR a0, DWORD a1, BOOL a2, ACCESS_MASK a3) = OpenDesktopA; #else HDESK (__stdcall * Real_OpenDesktopA)(LPCSTR a0, DWORD a1, BOOL a2, ACCESS_MASK a3) = OpenDesktopA; #endif #if _MSC_VER < 1300 HDESK (__stdcall * Real_OpenDesktopW)(LPWSTR a0, DWORD a1, BOOL a2, ACCESS_MASK a3) = OpenDesktopW; #else HDESK (__stdcall * Real_OpenDesktopW)(LPCWSTR a0, DWORD a1, BOOL a2, ACCESS_MASK a3) = OpenDesktopW; #endif HANDLE (__stdcall * Real_OpenEventA)(DWORD a0, BOOL a1, LPCSTR a2) = OpenEventA; HANDLE (__stdcall * Real_OpenEventW)(DWORD a0, BOOL a1, LPCWSTR a2) = OpenEventW; HFILE (__stdcall * Real_OpenFile)(LPCSTR a0, LPOFSTRUCT a1, UINT a2) = OpenFile; HANDLE (__stdcall * Real_OpenFileMappingA)(DWORD a0, BOOL a1, LPCSTR a2) = OpenFileMappingA; HANDLE (__stdcall * Real_OpenFileMappingW)(DWORD a0, BOOL a1, LPCWSTR a2) = OpenFileMappingW; BOOL (__stdcall * Real_OpenIcon)(HWND a0) = OpenIcon; HDESK (__stdcall * Real_OpenInputDesktop)(DWORD a0, BOOL a1, ACCESS_MASK a2) = OpenInputDesktop; HANDLE (__stdcall * Real_OpenMutexA)(DWORD a0, BOOL a1, LPCSTR a2) = OpenMutexA; HANDLE (__stdcall * Real_OpenMutexW)(DWORD a0, BOOL a1, LPCWSTR a2) = OpenMutexW; HANDLE (__stdcall * Real_OpenProcess)(DWORD a0, BOOL a1, DWORD pid) = OpenProcess; BOOL (__stdcall * Real_OpenProcessToken)(__in HANDLE ProcessHandle, __in DWORD DesiredAccess, __out PHANDLE TokenHandle ) = OpenProcessToken; HANDLE (__stdcall * Real_OpenSemaphoreA)(DWORD a0, BOOL a1, LPCSTR a2) = OpenSemaphoreA; HANDLE (__stdcall * Real_OpenSemaphoreW)(DWORD a0, BOOL a1, LPCWSTR a2) = OpenSemaphoreW; HANDLE (__stdcall * Real_OpenWaitableTimerA)(DWORD a0, BOOL a1, LPCSTR a2) = OpenWaitableTimerA; HANDLE (__stdcall * Real_OpenWaitableTimerW)(DWORD a0, BOOL a1, LPCWSTR a2) = OpenWaitableTimerW; #if _MSC_VER < 1300 HWINSTA (__stdcall * Real_OpenWindowStationA)(LPSTR a0, BOOL a1, ACCESS_MASK a2) = OpenWindowStationA; #else HWINSTA (__stdcall * Real_OpenWindowStationA)(LPCSTR a0, BOOL a1, ACCESS_MASK a2) = OpenWindowStationA; #endif #if _MSC_VER < 1300 HWINSTA (__stdcall * Real_OpenWindowStationW)(LPWSTR a0, BOOL a1, ACCESS_MASK a2) = OpenWindowStationW; #else HWINSTA (__stdcall * Real_OpenWindowStationW)(LPCWSTR a0, BOOL a1, ACCESS_MASK a2) = OpenWindowStationW; #endif void (__stdcall * Real_OutputDebugStringA)(LPCSTR a0) = OutputDebugStringA; void (__stdcall * Real_OutputDebugStringW)(LPCWSTR a0) = OutputDebugStringW; LPARAM (__stdcall * Real_PackDDElParam)(UINT a0, UINT_PTR a1, UINT_PTR a2) = PackDDElParam; BOOL (__stdcall * Real_PaintDesktop)(HDC a0) = PaintDesktop; BOOL (__stdcall * Real_PaintRgn)(HDC a0, HRGN a1) = PaintRgn; BOOL (__stdcall * Real_PatBlt)(HDC a0, int a1, int a2, int a3, int a4, DWORD a5) = PatBlt; HRGN (__stdcall * Real_PathToRegion)(HDC a0) = PathToRegion; BOOL (__stdcall * Real_PeekConsoleInputA)(HANDLE a0, PINPUT_RECORD a1, DWORD a2, LPDWORD a3) = PeekConsoleInputA; BOOL (__stdcall * Real_PeekConsoleInputW)(HANDLE a0, PINPUT_RECORD a1, DWORD a2, LPDWORD a3) = PeekConsoleInputW; BOOL (__stdcall * Real_PeekMessageA)(LPMSG a0, HWND a1, UINT a2, UINT a3, UINT a4) = PeekMessageA; BOOL (__stdcall * Real_PeekMessageW)(LPMSG a0, HWND a1, UINT a2, UINT a3, UINT a4) = PeekMessageW; BOOL (__stdcall * Real_PeekNamedPipe)(HANDLE a0, LPVOID a1, DWORD a2, LPDWORD a3, LPDWORD a4, LPDWORD a5) = PeekNamedPipe; BOOL (__stdcall * Real_Pie)(HDC a0, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) = Pie; BOOL (__stdcall * Real_PlayEnhMetaFile)(HDC a0, HENHMETAFILE a1, CONST RECT* a2) = PlayEnhMetaFile; BOOL (__stdcall * Real_PlayEnhMetaFileRecord)(HDC a0, LPHANDLETABLE a1, CONST ENHMETARECORD* a2, UINT a3) = PlayEnhMetaFileRecord; BOOL (__stdcall * Real_PlayMetaFile)(HDC a0, HMETAFILE a1) = PlayMetaFile; BOOL (__stdcall * Real_PlayMetaFileRecord)(HDC a0, LPHANDLETABLE a1, LPMETARECORD a2, UINT a3) = PlayMetaFileRecord; BOOL (__stdcall * Real_PlgBlt)(HDC a0, CONST POINT* a1, HDC a2, int a3, int a4, int a5, int a6, HBITMAP a7, int a8, int a9) = PlgBlt; BOOL (__stdcall * Real_PolyBezier)(HDC a0, CONST POINT* a1, DWORD a2) = PolyBezier; BOOL (__stdcall * Real_PolyBezierTo)(HDC a0, CONST POINT* a1, DWORD a2) = PolyBezierTo; BOOL (__stdcall * Real_PolyDraw)(HDC a0, CONST POINT* a1, CONST BYTE* a2, int a3) = PolyDraw; BOOL (__stdcall * Real_PolyPolygon)(HDC a0, CONST POINT* a1, CONST INT* a2, int a3) = PolyPolygon; BOOL (__stdcall * Real_PolyPolyline)(HDC a0, CONST POINT* a1, CONST DWORD* a2, DWORD a3) = PolyPolyline; BOOL (__stdcall * Real_PolyTextOutA)(HDC a0, CONST POLYTEXTA* a1, int a2) = PolyTextOutA; BOOL (__stdcall * Real_PolyTextOutW)(HDC a0, CONST POLYTEXTW* a1, int a2) = PolyTextOutW; BOOL (__stdcall * Real_Polygon)(HDC a0, CONST POINT* a1, int a2) = Polygon; BOOL (__stdcall * Real_Polyline)(HDC a0, CONST POINT* a1, int a2) = Polyline; BOOL (__stdcall * Real_PolylineTo)(HDC a0, CONST POINT* a1, DWORD a2) = PolylineTo; BOOL (__stdcall * Real_PostMessageA)(HWND a0, UINT a1, WPARAM a2, LPARAM a3) = PostMessageA; BOOL (__stdcall * Real_PostMessageW)(HWND a0, UINT a1, WPARAM a2, LPARAM a3) = PostMessageW; BOOL (__stdcall * Real_PostQueuedCompletionStatus)(HANDLE a0, DWORD a1, ULONG_PTR a2, LPOVERLAPPED a3) = PostQueuedCompletionStatus; void (__stdcall * Real_PostQuitMessage)(int a0) = PostQuitMessage; BOOL (__stdcall * Real_PostThreadMessageA)(DWORD a0, UINT a1, WPARAM a2, LPARAM a3) = PostThreadMessageA; BOOL (__stdcall * Real_PostThreadMessageW)(DWORD a0, UINT a1, WPARAM a2, LPARAM a3) = PostThreadMessageW; DWORD (__stdcall * Real_PrepareTape)(HANDLE a0, DWORD a1, BOOL a2) = PrepareTape; HRESULT (__stdcall * Real_ProgIDFromCLSID)(CONST IID& a0, LPOLESTR* a1) = ProgIDFromCLSID; HRESULT (__stdcall * Real_PropVariantClear)(PROPVARIANT* a0) = PropVariantClear; HRESULT (__stdcall * Real_PropVariantCopy)(PROPVARIANT* a0, CONST PROPVARIANT* a1) = PropVariantCopy; BOOL (__stdcall * Real_PtInRect)(CONST RECT* a0, POINT a1) = PtInRect; BOOL (__stdcall * Real_PtInRegion)(HRGN a0, int a1, int a2) = PtInRegion; BOOL (__stdcall * Real_PtVisible)(HDC a0, int a1, int a2) = PtVisible; BOOL (__stdcall * Real_PulseEvent)(HANDLE a0) = PulseEvent; BOOL (__stdcall * Real_PurgeComm)(HANDLE a0, DWORD a1) = PurgeComm; DWORD (__stdcall * Real_QueryDosDeviceA)(LPCSTR a0, LPSTR a1, DWORD a2) = QueryDosDeviceA; DWORD (__stdcall * Real_QueryDosDeviceW)(LPCWSTR a0, LPWSTR a1, DWORD a2) = QueryDosDeviceW; BOOL (__stdcall * Real_QueryPerformanceCounter)(LARGE_INTEGER* a0) = QueryPerformanceCounter; BOOL (__stdcall * Real_QueryPerformanceFrequency)(LARGE_INTEGER* a0) = QueryPerformanceFrequency; DWORD (__stdcall * Real_QueueUserAPC)(PAPCFUNC a0, HANDLE a1, ULONG_PTR a2) = QueueUserAPC; void (__stdcall * Real_RaiseException)(DWORD a0, DWORD a1, DWORD a2, CONST ULONG_PTR* a3) = RaiseException; HRESULT (__stdcall * Real_ReadClassStg)(LPSTORAGE a0, CLSID* a1) = ReadClassStg; HRESULT (__stdcall * Real_ReadClassStm)(LPSTREAM a0, CLSID* a1) = ReadClassStm; BOOL (__stdcall * Real_ReadConsoleA)( HANDLE a0, LPVOID a1, DWORD a2, LPDWORD a3, #ifdef ENABLE_INSERT_MODE PCONSOLE_READCONSOLE_CONTROL a4 #else LPVOID a4 #endif ) = ReadConsoleA; BOOL (__stdcall * Real_ReadConsoleInputA)(HANDLE a0, PINPUT_RECORD a1, DWORD a2, LPDWORD a3) = ReadConsoleInputA; BOOL (__stdcall * Real_ReadConsoleInputW)(HANDLE a0, PINPUT_RECORD a1, DWORD a2, LPDWORD a3) = ReadConsoleInputW; BOOL (__stdcall * Real_ReadConsoleOutputA)(HANDLE a0, PCHAR_INFO a1, COORD a2, COORD a3, PSMALL_RECT a4) = ReadConsoleOutputA; BOOL (__stdcall * Real_ReadConsoleOutputAttribute)(HANDLE a0, LPWORD a1, DWORD a2, COORD a3, LPDWORD a4) = ReadConsoleOutputAttribute; BOOL (__stdcall * Real_ReadConsoleOutputCharacterA)(HANDLE a0, LPSTR a1, DWORD a2, COORD a3, LPDWORD a4) = ReadConsoleOutputCharacterA; BOOL (__stdcall * Real_ReadConsoleOutputCharacterW)(HANDLE a0, LPWSTR a1, DWORD a2, COORD a3, LPDWORD a4) = ReadConsoleOutputCharacterW; BOOL (__stdcall * Real_ReadConsoleOutputW)(HANDLE a0, PCHAR_INFO a1, COORD a2, COORD a3, PSMALL_RECT a4) = ReadConsoleOutputW; BOOL (__stdcall * Real_ReadConsoleW)( HANDLE a0, LPVOID a1, DWORD a2, LPDWORD a3, #ifdef ENABLE_INSERT_MODE PCONSOLE_READCONSOLE_CONTROL a4 #else LPVOID a4 #endif ) = ReadConsoleW; BOOL (__stdcall * Real_ReadDirectoryChangesW)(HANDLE a0, LPVOID a1, DWORD a2, BOOL a3, DWORD a4, LPDWORD a5, LPOVERLAPPED a6, LPOVERLAPPED_COMPLETION_ROUTINE a7) = ReadDirectoryChangesW; BOOL (__stdcall * Real_ReadFile)(HANDLE a0, LPVOID a1, DWORD a2, LPDWORD a3, LPOVERLAPPED a4) = ReadFile; BOOL (__stdcall * Real_ReadFileEx)(HANDLE a0, LPVOID a1, DWORD a2, LPOVERLAPPED a3, LPOVERLAPPED_COMPLETION_ROUTINE a4) = ReadFileEx; HRESULT (__stdcall * Real_ReadFmtUserTypeStg)(LPSTORAGE a0, CLIPFORMAT* a1, LPOLESTR* a2) = ReadFmtUserTypeStg; BOOL (__stdcall * Real_ReadProcessMemory)(HANDLE a0, LPCVOID a1, LPVOID a2, DWORD_PTR a3, PDWORD_PTR a4) = ReadProcessMemory; UINT (__stdcall * Real_RealizePalette)(HDC a0) = RealizePalette; BOOL (__stdcall * Real_RectInRegion)(HRGN a0, CONST RECT* a1) = RectInRegion; BOOL (__stdcall * Real_RectVisible)(HDC a0, CONST RECT* a1) = RectVisible; BOOL (__stdcall * Real_Rectangle)(HDC a0, int a1, int a2, int a3, int a4) = Rectangle; BOOL (__stdcall * Real_RedrawWindow)(HWND a0, CONST RECT* a1, HRGN a2, UINT a3) = RedrawWindow; ATOM (__stdcall * Real_RegisterClassA)(CONST WNDCLASSA* a0) = RegisterClassA; ATOM (__stdcall * Real_RegisterClassExA)(CONST WNDCLASSEXA* a0) = RegisterClassExA; ATOM (__stdcall * Real_RegisterClassExW)(CONST WNDCLASSEXW* a0) = RegisterClassExW; ATOM (__stdcall * Real_RegisterClassW)(CONST WNDCLASSW* a0) = RegisterClassW; UINT (__stdcall * Real_RegisterClipboardFormatA)(LPCSTR a0) = RegisterClipboardFormatA; UINT (__stdcall * Real_RegisterClipboardFormatW)(LPCWSTR a0) = RegisterClipboardFormatW; HRESULT (__stdcall * Real_RegisterDragDrop)(HWND a0, IDropTarget* a1) = RegisterDragDrop; BOOL (__stdcall * Real_RegisterHotKey)(HWND a0, int a1, UINT a2, UINT a3) = RegisterHotKey; UINT (__stdcall * Real_RegisterWindowMessageA)(LPCSTR a0) = RegisterWindowMessageA; UINT (__stdcall * Real_RegisterWindowMessageW)(LPCWSTR a0) = RegisterWindowMessageW; BOOL (__stdcall * Real_ReleaseCapture)(void) = ReleaseCapture; int (__stdcall * Real_ReleaseDC)(HWND a0, HDC a1) = ReleaseDC; BOOL (__stdcall * Real_ReleaseMutex)(HANDLE a0) = ReleaseMutex; BOOL (__stdcall * Real_ReleaseSemaphore)(HANDLE a0, LONG a1, LPLONG a2) = ReleaseSemaphore; void (__stdcall * Real_ReleaseStgMedium)(LPSTGMEDIUM a0) = ReleaseStgMedium; BOOL (__stdcall * Real_RemoveDirectoryA)(LPCSTR a0) = RemoveDirectoryA; BOOL (__stdcall * Real_RemoveDirectoryW)(LPCWSTR a0) = RemoveDirectoryW; BOOL (__stdcall * Real_RemoveFontResourceA)(LPCSTR a0) = RemoveFontResourceA; BOOL (__stdcall * Real_RemoveFontResourceW)(LPCWSTR a0) = RemoveFontResourceW; BOOL (__stdcall * Real_RemoveMenu)(HMENU a0, UINT a1, UINT a2) = RemoveMenu; HANDLE (__stdcall * Real_RemovePropA)(HWND a0, LPCSTR a1) = RemovePropA; HANDLE (__stdcall * Real_RemovePropW)(HWND a0, LPCWSTR a1) = RemovePropW; BOOL (__stdcall * Real_ReplyMessage)(LRESULT a0) = ReplyMessage; HDC (__stdcall * Real_ResetDCA)(HDC a0, CONST DEVMODEA* a1) = ResetDCA; HDC (__stdcall * Real_ResetDCW)(HDC a0, CONST DEVMODEW* a1) = ResetDCW; BOOL (__stdcall * Real_ResetEvent)(HANDLE a0) = ResetEvent; BOOL (__stdcall * Real_ResizePalette)(HPALETTE a0, UINT a1) = ResizePalette; BOOL (__stdcall * Real_RestoreDC)(HDC a0, int a1) = RestoreDC; DWORD (__stdcall * Real_ResumeThread)(HANDLE a0) = ResumeThread; LPARAM (__stdcall * Real_ReuseDDElParam)(LPARAM a0, UINT a1, UINT a2, UINT_PTR a3, UINT_PTR a4) = ReuseDDElParam; HRESULT (__stdcall * Real_RevokeDragDrop)(HWND a0) = RevokeDragDrop; BOOL (__stdcall * Real_RoundRect)(HDC a0, int a1, int a2, int a3, int a4, int a5, int a6) = RoundRect; int (__stdcall * Real_SaveDC)(HDC a0) = SaveDC; BOOL (__stdcall * Real_ScaleViewportExtEx)(HDC a0, int a1, int a2, int a3, int a4, SIZE* a5) = ScaleViewportExtEx; BOOL (__stdcall * Real_ScaleWindowExtEx)(HDC a0, int a1, int a2, int a3, int a4, SIZE* a5) = ScaleWindowExtEx; BOOL (__stdcall * Real_ScreenToClient)(HWND a0, POINT* a1) = ScreenToClient; BOOL (__stdcall * Real_ScrollConsoleScreenBufferA)(HANDLE a0, CONST SMALL_RECT* a1, CONST SMALL_RECT* a2, COORD a3, CONST CHAR_INFO* a4) = ScrollConsoleScreenBufferA; BOOL (__stdcall * Real_ScrollConsoleScreenBufferW)(HANDLE a0, CONST SMALL_RECT* a1, CONST SMALL_RECT* a2, COORD a3, CONST CHAR_INFO* a4) = ScrollConsoleScreenBufferW; BOOL (__stdcall * Real_ScrollDC)(HDC a0, int a1, int a2, CONST RECT* a3, CONST RECT* a4, HRGN a5, LPRECT a6) = ScrollDC; BOOL (__stdcall * Real_ScrollWindow)(HWND a0, int a1, int a2, CONST RECT* a3, CONST RECT* a4) = ScrollWindow; int (__stdcall * Real_ScrollWindowEx)(HWND a0, int a1, int a2, CONST RECT* a3, CONST RECT* a4, HRGN a5, LPRECT a6, UINT a7) = ScrollWindowEx; DWORD (__stdcall * Real_SearchPathA)(LPCSTR a0, LPCSTR a1, LPCSTR a2, DWORD a3, LPSTR a4, LPSTR* a5) = SearchPathA; DWORD (__stdcall * Real_SearchPathW)(LPCWSTR a0, LPCWSTR a1, LPCWSTR a2, DWORD a3, LPWSTR a4, LPWSTR* a5) = SearchPathW; BOOL (__stdcall * Real_SelectClipPath)(HDC a0, int a1) = SelectClipPath; int (__stdcall * Real_SelectClipRgn)(HDC a0, HRGN a1) = SelectClipRgn; HGDIOBJ (__stdcall * Real_SelectObject)(HDC a0, HGDIOBJ a1) = SelectObject; HPALETTE (__stdcall * Real_SelectPalette)(HDC a0, HPALETTE a1, BOOL a2) = SelectPalette; LRESULT (__stdcall * Real_SendDlgItemMessageA)(HWND a0, int a1, UINT a2, WPARAM a3, LPARAM a4) = SendDlgItemMessageA; LRESULT (__stdcall * Real_SendDlgItemMessageW)(HWND a0, int a1, UINT a2, WPARAM a3, LPARAM a4) = SendDlgItemMessageW; LRESULT (__stdcall * Real_SendMessageA)(HWND a0, UINT a1, WPARAM a2, LPARAM a3) = SendMessageA; BOOL (__stdcall * Real_SendMessageCallbackA)(HWND a0, UINT a1, WPARAM a2, LPARAM a3, SENDASYNCPROC a4, ULONG_PTR a5) = SendMessageCallbackA; BOOL (__stdcall * Real_SendMessageCallbackW)(HWND a0, UINT a1, WPARAM a2, LPARAM a3, SENDASYNCPROC a4, ULONG_PTR a5) = SendMessageCallbackW; LRESULT (__stdcall * Real_SendMessageTimeoutA)(HWND a0, UINT a1, WPARAM a2, LPARAM a3, UINT a4, UINT a5, PULONG_PTR a6) = SendMessageTimeoutA; LRESULT (__stdcall * Real_SendMessageTimeoutW)(HWND a0, UINT a1, WPARAM a2, LPARAM a3, UINT a4, UINT a5, PULONG_PTR a6) = SendMessageTimeoutW; LRESULT (__stdcall * Real_SendMessageW)(HWND a0, UINT a1, WPARAM a2, LPARAM a3) = SendMessageW; BOOL (__stdcall * Real_SendNotifyMessageA)(HWND a0, UINT a1, WPARAM a2, LPARAM a3) = SendNotifyMessageA; BOOL (__stdcall * Real_SendNotifyMessageW)(HWND a0, UINT a1, WPARAM a2, LPARAM a3) = SendNotifyMessageW; int (__stdcall * Real_SetAbortProc)(HDC a0, ABORTPROC a1) = SetAbortProc; HWND (__stdcall * Real_SetActiveWindow)(HWND a0) = SetActiveWindow; int (__stdcall * Real_SetArcDirection)(HDC a0, int a1) = SetArcDirection; LONG (__stdcall * Real_SetBitmapBits)(HBITMAP a0, DWORD a1, CONST void* a2) = SetBitmapBits; BOOL (__stdcall * Real_SetBitmapDimensionEx)(HBITMAP a0, int a1, int a2, SIZE* a3) = SetBitmapDimensionEx; COLORREF (__stdcall * Real_SetBkColor)(HDC a0, COLORREF a1) = SetBkColor; int (__stdcall * Real_SetBkMode)(HDC a0, int a1) = SetBkMode; UINT (__stdcall * Real_SetBoundsRect)(HDC a0, CONST RECT* a1, UINT a2) = SetBoundsRect; BOOL (__stdcall * Real_SetBrushOrgEx)(HDC a0, int a1, int a2, POINT* a3) = SetBrushOrgEx; HWND (__stdcall * Real_SetCapture)(HWND a0) = SetCapture; BOOL (__stdcall * Real_SetCaretBlinkTime)(UINT a0) = SetCaretBlinkTime; BOOL (__stdcall * Real_SetCaretPos)(int a0, int a1) = SetCaretPos; DWORD (__stdcall * Real_SetClassLongA)(HWND a0, int a1, LONG a2) = SetClassLongA; DWORD (__stdcall * Real_SetClassLongW)(HWND a0, int a1, LONG a2) = SetClassLongW; WORD (__stdcall * Real_SetClassWord)(HWND a0, int a1, WORD a2) = SetClassWord; HANDLE (__stdcall * Real_SetClipboardData)(UINT a0, HANDLE a1) = SetClipboardData; HWND (__stdcall * Real_SetClipboardViewer)(HWND a0) = SetClipboardViewer; BOOL (__stdcall * Real_SetColorAdjustment)(HDC a0, CONST COLORADJUSTMENT* a1) = SetColorAdjustment; HCOLORSPACE (__stdcall * Real_SetColorSpace)(HDC a0, HCOLORSPACE a1) = SetColorSpace; BOOL (__stdcall * Real_SetCommBreak)(HANDLE a0) = SetCommBreak; BOOL (__stdcall * Real_SetCommConfig)(HANDLE a0, LPCOMMCONFIG a1, DWORD a2) = SetCommConfig; BOOL (__stdcall * Real_SetCommMask)(HANDLE a0, DWORD a1) = SetCommMask; BOOL (__stdcall * Real_SetCommState)(HANDLE a0, LPDCB a1) = SetCommState; BOOL (__stdcall * Real_SetCommTimeouts)(HANDLE a0, LPCOMMTIMEOUTS a1) = SetCommTimeouts; BOOL (__stdcall * Real_SetComputerNameA)(LPCSTR a0) = SetComputerNameA; BOOL (__stdcall * Real_SetComputerNameW)(LPCWSTR a0) = SetComputerNameW; BOOL (__stdcall * Real_SetConsoleActiveScreenBuffer)(HANDLE a0) = SetConsoleActiveScreenBuffer; BOOL (__stdcall * Real_SetConsoleCP)(UINT a0) = SetConsoleCP; BOOL (__stdcall * Real_SetConsoleCtrlHandler)(PHANDLER_ROUTINE a0, BOOL a1) = SetConsoleCtrlHandler; BOOL (__stdcall * Real_SetConsoleCursorInfo)(HANDLE a0, CONST CONSOLE_CURSOR_INFO* a1) = SetConsoleCursorInfo; BOOL (__stdcall * Real_SetConsoleCursorPosition)(HANDLE a0, COORD a1) = SetConsoleCursorPosition; BOOL (__stdcall * Real_SetConsoleMode)(HANDLE a0, DWORD a1) = SetConsoleMode; BOOL (__stdcall * Real_SetConsoleOutputCP)(UINT a0) = SetConsoleOutputCP; BOOL (__stdcall * Real_SetConsoleScreenBufferSize)(HANDLE a0, COORD a1) = SetConsoleScreenBufferSize; BOOL (__stdcall * Real_SetConsoleTextAttribute)(HANDLE a0, WORD a1) = SetConsoleTextAttribute; BOOL (__stdcall * Real_SetConsoleTitleA)(LPCSTR a0) = SetConsoleTitleA; BOOL (__stdcall * Real_SetConsoleTitleW)(LPCWSTR a0) = SetConsoleTitleW; BOOL (__stdcall * Real_SetConsoleWindowInfo)(HANDLE a0, BOOL a1, CONST SMALL_RECT* a2) = SetConsoleWindowInfo; HRESULT (__stdcall * Real_SetConvertStg)(LPSTORAGE a0, BOOL a1) = SetConvertStg; BOOL (__stdcall * Real_SetCurrentDirectoryA)(LPCSTR a0) = SetCurrentDirectoryA; BOOL (__stdcall * Real_SetCurrentDirectoryW)(LPCWSTR a0) = SetCurrentDirectoryW; HCURSOR (__stdcall * Real_SetCursor)(HCURSOR a0) = SetCursor; BOOL (__stdcall * Real_SetCursorPos)(int a0, int a1) = SetCursorPos; UINT (__stdcall * Real_SetDIBColorTable)(HDC a0, UINT a1, UINT a2, CONST RGBQUAD* a3) = SetDIBColorTable; int (__stdcall * Real_SetDIBits)(HDC a0, HBITMAP a1, UINT a2, UINT a3, CONST void* a4, CONST BITMAPINFO* a5, UINT a6) = SetDIBits; int (__stdcall * Real_SetDIBitsToDevice)(HDC a0, int a1, int a2, DWORD a3, DWORD a4, int a5, int a6, UINT a7, UINT a8, CONST void* a9, CONST BITMAPINFO* a10, UINT a11) = SetDIBitsToDevice; BOOL (__stdcall * Real_SetDefaultCommConfigA)(LPCSTR a0, LPCOMMCONFIG a1, DWORD a2) = SetDefaultCommConfigA; BOOL (__stdcall * Real_SetDefaultCommConfigW)(LPCWSTR a0, LPCOMMCONFIG a1, DWORD a2) = SetDefaultCommConfigW; BOOL (__stdcall * Real_SetDeviceGammaRamp)(HDC a0, LPVOID a1) = SetDeviceGammaRamp; BOOL (__stdcall * Real_SetDlgItemInt)(HWND a0, int a1, UINT a2, BOOL a3) = SetDlgItemInt; BOOL (__stdcall * Real_SetDlgItemTextA)(HWND a0, int a1, LPCSTR a2) = SetDlgItemTextA; BOOL (__stdcall * Real_SetDlgItemTextW)(HWND a0, int a1, LPCWSTR a2) = SetDlgItemTextW; BOOL (__stdcall * Real_SetDoubleClickTime)(UINT a0) = SetDoubleClickTime; BOOL (__stdcall * Real_SetEndOfFile)(HANDLE a0) = SetEndOfFile; HENHMETAFILE (__stdcall * Real_SetEnhMetaFileBits)(UINT a0, CONST BYTE* a1) = SetEnhMetaFileBits; BOOL (__stdcall * Real_SetEnvironmentVariableA)(LPCSTR a0, LPCSTR a1) = SetEnvironmentVariableA; BOOL (__stdcall * Real_SetEnvironmentVariableW)(LPCWSTR a0, LPCWSTR a1) = SetEnvironmentVariableW; UINT (__stdcall * Real_SetErrorMode)(UINT a0) = SetErrorMode; BOOL (__stdcall * Real_SetEvent)(HANDLE a0) = SetEvent; void (__stdcall * Real_SetFileApisToANSI)(void) = SetFileApisToANSI; void (__stdcall * Real_SetFileApisToOEM)(void) = SetFileApisToOEM; BOOL (__stdcall * Real_SetFileAttributesA)(LPCSTR a0, DWORD a1) = SetFileAttributesA; BOOL (__stdcall * Real_SetFileAttributesW)(LPCWSTR a0, DWORD a1) = SetFileAttributesW; DWORD (__stdcall * Real_SetFilePointer)(HANDLE a0, LONG a1, PLONG a2, DWORD a3) = SetFilePointer; BOOL (__stdcall * Real_SetFileTime)(HANDLE a0, CONST FILETIME* a1, CONST FILETIME* a2, CONST FILETIME* a3) = SetFileTime; HWND (__stdcall * Real_SetFocus)(HWND a0) = SetFocus; BOOL (__stdcall * Real_SetForegroundWindow)(HWND a0) = SetForegroundWindow; int (__stdcall * Real_SetGraphicsMode)(HDC a0, int a1) = SetGraphicsMode; UINT (__stdcall * Real_SetHandleCount)(UINT a0) = SetHandleCount; BOOL (__stdcall * Real_SetHandleInformation)(HANDLE a0, DWORD a1, DWORD a2) = SetHandleInformation; int (__stdcall * Real_SetICMMode)(HDC a0, int a1) = SetICMMode; BOOL (__stdcall * Real_SetICMProfileA)(HDC a0, LPSTR a1) = SetICMProfileA; BOOL (__stdcall * Real_SetICMProfileW)(HDC a0, LPWSTR a1) = SetICMProfileW; BOOL (__stdcall * Real_SetKeyboardState)(LPBYTE a0) = SetKeyboardState; BOOL (__stdcall * Real_SetLocalTime)(CONST SYSTEMTIME* a0) = SetLocalTime; BOOL (__stdcall * Real_SetLocaleInfoA)(LCID a0, LCTYPE a1, LPCSTR a2) = SetLocaleInfoA; BOOL (__stdcall * Real_SetLocaleInfoW)(LCID a0, LCTYPE a1, LPCWSTR a2) = SetLocaleInfoW; BOOL (__stdcall * Real_SetMailslotInfo)(HANDLE a0, DWORD a1) = SetMailslotInfo; int (__stdcall * Real_SetMapMode)(HDC a0, int a1) = SetMapMode; DWORD (__stdcall * Real_SetMapperFlags)(HDC a0, DWORD a1) = SetMapperFlags; BOOL (__stdcall * Real_SetMenu)(HWND a0, HMENU a1) = SetMenu; BOOL (__stdcall * Real_SetMenuContextHelpId)(HMENU a0, DWORD a1) = SetMenuContextHelpId; BOOL (__stdcall * Real_SetMenuDefaultItem)(HMENU a0, UINT a1, UINT a2) = SetMenuDefaultItem; BOOL (__stdcall * Real_SetMenuItemBitmaps)(HMENU a0, UINT a1, UINT a2, HBITMAP a3, HBITMAP a4) = SetMenuItemBitmaps; BOOL (__stdcall * Real_SetMenuItemInfoA)(HMENU a0, UINT a1, BOOL a2, CONST MENUITEMINFOA* a3) = SetMenuItemInfoA; BOOL (__stdcall * Real_SetMenuItemInfoW)(HMENU a0, UINT a1, BOOL a2, CONST MENUITEMINFOW* a3) = SetMenuItemInfoW; LPARAM (__stdcall * Real_SetMessageExtraInfo)(LPARAM a0) = SetMessageExtraInfo; BOOL (__stdcall * Real_SetMessageQueue)(int a0) = SetMessageQueue; HMETAFILE (__stdcall * Real_SetMetaFileBitsEx)(UINT a0, CONST BYTE* a1) = SetMetaFileBitsEx; int (__stdcall * Real_SetMetaRgn)(HDC a0) = SetMetaRgn; BOOL (__stdcall * Real_SetMiterLimit)(HDC a0, FLOAT a1, PFLOAT a2) = SetMiterLimit; BOOL (__stdcall * Real_SetNamedPipeHandleState)(HANDLE a0, LPDWORD a1, LPDWORD a2, LPDWORD a3) = SetNamedPipeHandleState; UINT (__stdcall * Real_SetPaletteEntries)(HPALETTE a0, UINT a1, UINT a2, CONST PALETTEENTRY* a3) = SetPaletteEntries; HWND (__stdcall * Real_SetParent)(HWND a0, HWND a1) = SetParent; COLORREF (__stdcall * Real_SetPixel)(HDC a0, int a1, int a2, COLORREF a3) = SetPixel; BOOL (__stdcall * Real_SetPixelFormat)(HDC a0, int a1, CONST PIXELFORMATDESCRIPTOR* a2) = SetPixelFormat; BOOL (__stdcall * Real_SetPixelV)(HDC a0, int a1, int a2, COLORREF a3) = SetPixelV; int (__stdcall * Real_SetPolyFillMode)(HDC a0, int a1) = SetPolyFillMode; BOOL (__stdcall * Real_SetPriorityClass)(HANDLE a0, DWORD a1) = SetPriorityClass; BOOL (__stdcall * Real_SetProcessAffinityMask)(HANDLE a0, DWORD_PTR a1) = SetProcessAffinityMask; BOOL (__stdcall * Real_SetProcessShutdownParameters)(DWORD a0, DWORD a1) = SetProcessShutdownParameters; BOOL (__stdcall * Real_SetProcessWindowStation)(HWINSTA a0) = SetProcessWindowStation; BOOL (__stdcall * Real_SetProcessWorkingSetSize)(HANDLE a0, SIZE_T a1, SIZE_T a2) = SetProcessWorkingSetSize; BOOL (__stdcall * Real_SetPropA)(HWND a0, LPCSTR a1, HANDLE a2) = SetPropA; BOOL (__stdcall * Real_SetPropW)(HWND a0, LPCWSTR a1, HANDLE a2) = SetPropW; int (__stdcall * Real_SetROP2)(HDC a0, int a1) = SetROP2; BOOL (__stdcall * Real_SetRect)(LPRECT a0, int a1, int a2, int a3, int a4) = SetRect; BOOL (__stdcall * Real_SetRectEmpty)(LPRECT a0) = SetRectEmpty; BOOL (__stdcall * Real_SetRectRgn)(HRGN a0, int a1, int a2, int a3, int a4) = SetRectRgn; int (__stdcall * Real_SetScrollInfo)(HWND a0, int a1, LPCSCROLLINFO a2, BOOL a3) = SetScrollInfo; int (__stdcall * Real_SetScrollPos)(HWND a0, int a1, int a2, BOOL a3) = SetScrollPos; BOOL (__stdcall * Real_SetScrollRange)(HWND a0, int a1, int a2, int a3, BOOL a4) = SetScrollRange; BOOL (__stdcall * Real_SetStdHandle)(DWORD a0, HANDLE a1) = SetStdHandle; int (__stdcall * Real_SetStretchBltMode)(HDC a0, int a1) = SetStretchBltMode; BOOL (__stdcall * Real_SetSysColors)(int a0, CONST INT* a1, CONST COLORREF* a2) = SetSysColors; BOOL (__stdcall * Real_SetSystemCursor)(HCURSOR a0, DWORD a1) = SetSystemCursor; UINT (__stdcall * Real_SetSystemPaletteUse)(HDC a0, UINT a1) = SetSystemPaletteUse; BOOL (__stdcall * Real_SetSystemPowerState)(BOOL a0, BOOL a1) = SetSystemPowerState; BOOL (__stdcall * Real_SetSystemTime)(CONST SYSTEMTIME* a0) = SetSystemTime; BOOL (__stdcall * Real_SetSystemTimeAdjustment)(DWORD a0, BOOL a1) = SetSystemTimeAdjustment; DWORD (__stdcall * Real_SetTapeParameters)(HANDLE a0, DWORD a1, LPVOID a2) = SetTapeParameters; DWORD (__stdcall * Real_SetTapePosition)(HANDLE a0, DWORD a1, DWORD a2, DWORD a3, DWORD a4, BOOL a5) = SetTapePosition; UINT (__stdcall * Real_SetTextAlign)(HDC a0, UINT a1) = SetTextAlign; int (__stdcall * Real_SetTextCharacterExtra)(HDC a0, int a1) = SetTextCharacterExtra; COLORREF (__stdcall * Real_SetTextColor)(HDC a0, COLORREF a1) = SetTextColor; BOOL (__stdcall * Real_SetTextJustification)(HDC a0, int a1, int a2) = SetTextJustification; DWORD_PTR (__stdcall * Real_SetThreadAffinityMask)(HANDLE a0, DWORD_PTR a1) = SetThreadAffinityMask; BOOL (__stdcall * Real_SetThreadContext)(HANDLE a0, CONST CONTEXT* a1) = SetThreadContext; BOOL (__stdcall * Real_SetThreadDesktop)(HDESK a0) = SetThreadDesktop; DWORD (__stdcall * Real_SetThreadIdealProcessor)(HANDLE a0, DWORD a1) = SetThreadIdealProcessor; #if(WINVER >= 0x0500) BOOL (__stdcall * Real_SetThreadLocale)(LCID a0) = SetThreadLocale; #endif // (WINVER >= 0x0500) BOOL (__stdcall * Real_SetThreadPriority)(HANDLE a0, int a1) = SetThreadPriority; BOOL (__stdcall * Real_SetThreadPriorityBoost)(HANDLE a0, BOOL a1) = SetThreadPriorityBoost; BOOL (__stdcall * Real_SetTimeZoneInformation)(CONST TIME_ZONE_INFORMATION* a0) = SetTimeZoneInformation; UINT_PTR (__stdcall * Real_SetTimer)(HWND a0, UINT_PTR a1, UINT a2, TIMERPROC a3) = SetTimer; LPTOP_LEVEL_EXCEPTION_FILTER (__stdcall * Real_SetUnhandledExceptionFilter)(LPTOP_LEVEL_EXCEPTION_FILTER a0) = SetUnhandledExceptionFilter; BOOL (__stdcall * Real_SetUserObjectInformationA)(HANDLE a0, int a1, PVOID a2, DWORD a3) = SetUserObjectInformationA; BOOL (__stdcall * Real_SetUserObjectInformationW)(HANDLE a0, int a1, PVOID a2, DWORD a3) = SetUserObjectInformationW; BOOL (__stdcall * Real_SetUserObjectSecurity)(HANDLE a0, PSECURITY_INFORMATION a1, PSECURITY_DESCRIPTOR a2) = SetUserObjectSecurity; BOOL (__stdcall * Real_SetViewportExtEx)(HDC a0, int a1, int a2, SIZE* a3) = SetViewportExtEx; BOOL (__stdcall * Real_SetViewportOrgEx)(HDC a0, int a1, int a2, POINT* a3) = SetViewportOrgEx; BOOL (__stdcall * Real_SetVolumeLabelA)(LPCSTR a0, LPCSTR a1) = SetVolumeLabelA; BOOL (__stdcall * Real_SetVolumeLabelW)(LPCWSTR a0, LPCWSTR a1) = SetVolumeLabelW; BOOL (__stdcall * Real_SetWaitableTimer)(HANDLE a0, CONST LARGE_INTEGER* a1, LONG a2, PTIMERAPCROUTINE a3, LPVOID a4, BOOL a5) = SetWaitableTimer; HENHMETAFILE (__stdcall * Real_SetWinMetaFileBits)(UINT a0, CONST BYTE* a1, HDC a2, CONST METAFILEPICT* a3) = SetWinMetaFileBits; BOOL (__stdcall * Real_SetWindowContextHelpId)(HWND a0, DWORD a1) = SetWindowContextHelpId; BOOL (__stdcall * Real_SetWindowExtEx)(HDC a0, int a1, int a2, SIZE* a3) = SetWindowExtEx; LONG (__stdcall * Real_SetWindowLongA)(HWND a0, int a1, LONG a2) = SetWindowLongA; LONG (__stdcall * Real_SetWindowLongW)(HWND a0, int a1, LONG a2) = SetWindowLongW; BOOL (__stdcall * Real_SetWindowOrgEx)(HDC a0, int a1, int a2, POINT* a3) = SetWindowOrgEx; BOOL (__stdcall * Real_SetWindowPlacement)(HWND a0, CONST WINDOWPLACEMENT* a1) = SetWindowPlacement; BOOL (__stdcall * Real_SetWindowPos)(HWND a0, HWND a1, int a2, int a3, int a4, int a5, UINT a6) = SetWindowPos; int (__stdcall * Real_SetWindowRgn)(HWND a0, HRGN a1, BOOL a2) = SetWindowRgn; BOOL (__stdcall * Real_SetWindowTextA)(HWND a0, LPCSTR a1) = SetWindowTextA; BOOL (__stdcall * Real_SetWindowTextW)(HWND a0, LPCWSTR a1) = SetWindowTextW; WORD (__stdcall * Real_SetWindowWord)(HWND a0, int a1, WORD a2) = SetWindowWord; HHOOK (__stdcall * Real_SetWindowsHookA)(int a0, HOOKPROC a1) = SetWindowsHookA; HHOOK (__stdcall * Real_SetWindowsHookExA)(int a0, HOOKPROC a1, HINSTANCE a2, DWORD a3) = SetWindowsHookExA; HHOOK (__stdcall * Real_SetWindowsHookExW)(int a0, HOOKPROC a1, HINSTANCE a2, DWORD a3) = SetWindowsHookExW; HHOOK (__stdcall * Real_SetWindowsHookW)(int a0, HOOKPROC a1) = SetWindowsHookW; BOOL (__stdcall * Real_SetWorldTransform)(HDC a0, CONST XFORM* a1) = SetWorldTransform; BOOL (__stdcall * Real_SetupComm)(HANDLE a0, DWORD a1, DWORD a2) = SetupComm; BOOL (__stdcall * Real_ShowCaret)(HWND a0) = ShowCaret; int (__stdcall * Real_ShowCursor)(BOOL a0) = ShowCursor; BOOL (__stdcall * Real_ShowOwnedPopups)(HWND a0, BOOL a1) = ShowOwnedPopups; BOOL (__stdcall * Real_ShowScrollBar)(HWND a0, int a1, BOOL a2) = ShowScrollBar; BOOL (__stdcall * Real_ShowWindow)(HWND a0, int a1) = ShowWindow; BOOL (__stdcall * Real_ShowWindowAsync)(HWND a0, int a1) = ShowWindowAsync; DWORD (__stdcall * Real_SignalObjectAndWait)(HANDLE a0, HANDLE a1, DWORD a2, BOOL a3) = SignalObjectAndWait; DWORD (__stdcall * Real_SizeofResource)(HMODULE a0, HRSRC a1) = SizeofResource; DWORD (__stdcall * Real_SleepEx)(DWORD a0, BOOL a1) = SleepEx; int (__stdcall * Real_StartDocA)(HDC a0, CONST DOCINFOA* a1) = StartDocA; int (__stdcall * Real_StartDocW)(HDC a0, CONST DOCINFOW* a1) = StartDocW; int (__stdcall * Real_StartPage)(HDC a0) = StartPage; HRESULT (__stdcall * Real_StgCreateDocfile)(CONST OLECHAR* a0, DWORD a1, DWORD a2, IStorage** a3) = StgCreateDocfile; HRESULT (__stdcall * Real_StgCreateDocfileOnILockBytes)(ILockBytes* a0, DWORD a1, DWORD a2, IStorage** a3) = StgCreateDocfileOnILockBytes; HRESULT (__stdcall * Real_StgCreatePropSetStg)(IStorage* a0, DWORD a1, IPropertySetStorage** a2) = StgCreatePropSetStg; HRESULT (__stdcall * Real_StgCreatePropStg)(IUnknown* a0, CONST IID& a1, CONST CLSID* a2, DWORD a3, DWORD a4, IPropertyStorage** a5) = StgCreatePropStg; #if _MSC_VER < 1300 HRESULT (__stdcall * Real_StgCreateStorageEx)(CONST WCHAR* a0, DWORD a1, DWORD a2, DWORD a3, void* a4, void* a5, CONST IID& a6, void** a7) = StgCreateStorageEx; #else HRESULT (__stdcall * Real_StgCreateStorageEx)(CONST WCHAR* a0, DWORD a1, DWORD a2, DWORD a3, STGOPTIONS* a4, void* a5, CONST IID& a6, void** a7) = StgCreateStorageEx; #endif HRESULT (__stdcall * Real_StgGetIFillLockBytesOnFile)(CONST OLECHAR* a0, IFillLockBytes** a1) = StgGetIFillLockBytesOnFile; HRESULT (__stdcall * Real_StgGetIFillLockBytesOnILockBytes)(ILockBytes* a0, IFillLockBytes** a1) = StgGetIFillLockBytesOnILockBytes; HRESULT (__stdcall * Real_StgIsStorageFile)(CONST OLECHAR* a0) = StgIsStorageFile; HRESULT (__stdcall * Real_StgIsStorageILockBytes)(ILockBytes* a0) = StgIsStorageILockBytes; HRESULT (__stdcall * Real_StgOpenAsyncDocfileOnIFillLockBytes)(IFillLockBytes* a0, DWORD a1, DWORD a2, IStorage** a3) = StgOpenAsyncDocfileOnIFillLockBytes; HRESULT (__stdcall * Real_StgOpenPropStg)(IUnknown* a0, CONST IID& a1, DWORD a2, DWORD a3, IPropertyStorage** a4) = StgOpenPropStg; HRESULT (__stdcall * Real_StgOpenStorage)(CONST OLECHAR* a0, IStorage* a1, DWORD a2, SNB a3, DWORD a4, IStorage** a5) = StgOpenStorage; #if _MSC_VER < 1300 HRESULT (__stdcall * Real_StgOpenStorageEx)(CONST WCHAR* a0, DWORD a1, DWORD a2, DWORD a3, void* a4, void* a5, CONST IID& a6, void** a7) = StgOpenStorageEx; #else HRESULT (__stdcall * Real_StgOpenStorageEx)(CONST WCHAR* a0, DWORD a1, DWORD a2, DWORD a3, STGOPTIONS* a4, void* a5, CONST IID& a6, void** a7) = StgOpenStorageEx; #endif HRESULT (__stdcall * Real_StgOpenStorageOnILockBytes)(ILockBytes* a0, IStorage* a1, DWORD a2, SNB a3, DWORD a4, IStorage** a5) = StgOpenStorageOnILockBytes; HRESULT (__stdcall * Real_StgSetTimes)(CONST OLECHAR* a0, CONST FILETIME* a1, CONST FILETIME* a2, CONST FILETIME* a3) = StgSetTimes; BOOL (__stdcall * Real_StretchBlt)(HDC a0, int a1, int a2, int a3, int a4, HDC a5, int a6, int a7, int a8, int a9, DWORD a10) = StretchBlt; int (__stdcall * Real_StretchDIBits)(HDC a0, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, CONST void* a9, CONST BITMAPINFO* a10, UINT a11, DWORD a12) = StretchDIBits; HRESULT (__stdcall * Real_StringFromCLSID)(CONST IID& a0, LPOLESTR* a1) = StringFromCLSID; int (__stdcall * Real_StringFromGUID2)(CONST GUID& a0, LPOLESTR a1, int a2) = StringFromGUID2; HRESULT (__stdcall * Real_StringFromIID)(CONST IID& a0, LPOLESTR* a1) = StringFromIID; BOOL (__stdcall * Real_StrokeAndFillPath)(HDC a0) = StrokeAndFillPath; BOOL (__stdcall * Real_StrokePath)(HDC a0) = StrokePath; BOOL (__stdcall * Real_SubtractRect)(LPRECT a0, CONST RECT* a1, CONST RECT* a2) = SubtractRect; DWORD (__stdcall * Real_SuspendThread)(HANDLE a0) = SuspendThread; BOOL (__stdcall * Real_SwapBuffers)(HDC a0) = SwapBuffers; BOOL (__stdcall * Real_SwapMouseButton)(BOOL a0) = SwapMouseButton; BOOL (__stdcall * Real_SwitchDesktop)(HDESK a0) = SwitchDesktop; void (__stdcall * Real_SwitchToFiber)(LPVOID a0) = SwitchToFiber; BOOL (__stdcall * Real_SwitchToThread)(void) = SwitchToThread; BOOL (__stdcall * Real_SystemParametersInfoA)(UINT a0, UINT a1, PVOID a2, UINT a3) = SystemParametersInfoA; BOOL (__stdcall * Real_SystemParametersInfoW)(UINT a0, UINT a1, PVOID a2, UINT a3) = SystemParametersInfoW; BOOL (__stdcall * Real_SystemTimeToFileTime)(CONST SYSTEMTIME* a0, LPFILETIME a1) = SystemTimeToFileTime; BOOL (__stdcall * Real_SystemTimeToTzSpecificLocalTime)( #ifdef PIPE_ACCEPT_REMOTE_CLIENTS const TIME_ZONE_INFORMATION *a0, const SYSTEMTIME *a1, #else LPTIME_ZONE_INFORMATION a0, LPSYSTEMTIME a1, #endif LPSYSTEMTIME a2 ) = SystemTimeToTzSpecificLocalTime; #if _MSC_VER < 1300 LONG (__stdcall * Real_TabbedTextOutA)(HDC a0, int a1, int a2, LPCSTR a3, int a4, int a5, INT* a6, int a7) = TabbedTextOutA; #else LONG (__stdcall * Real_TabbedTextOutA)(HDC a0, int a1, int a2, LPCSTR a3, int a4, int a5, CONST INT* a6, int a7) = TabbedTextOutA; #endif #if _MSC_VER < 1300 LONG (__stdcall * Real_TabbedTextOutW)(HDC a0, int a1, int a2, LPCWSTR a3, int a4, int a5, INT* a6, int a7) = TabbedTextOutW; #else LONG (__stdcall * Real_TabbedTextOutW)(HDC a0, int a1, int a2, LPCWSTR a3, int a4, int a5, CONST INT* a6, int a7) = TabbedTextOutW; #endif BOOL (__stdcall * Real_TerminateProcess)(HANDLE a0, UINT a1) = TerminateProcess; BOOL (__stdcall * Real_TerminateThread)(HANDLE a0, DWORD a1) = TerminateThread; BOOL (__stdcall * Real_TextOutA)(HDC a0, int a1, int a2, LPCSTR a3, int a4) = TextOutA; BOOL (__stdcall * Real_TextOutW)(HDC a0, int a1, int a2, LPCWSTR a3, int a4) = TextOutW; WORD (__stdcall * Real_TileWindows)(HWND a0, UINT a1, CONST RECT* a2, UINT a3, CONST HWND * a4) = TileWindows; #if _MSC_VER < 1300 int (__stdcall * Real_ToAscii)(UINT a0, UINT a1, BYTE* a2, LPWORD a3, UINT a4) = ToAscii; #else int (__stdcall * Real_ToAscii)(UINT a0, UINT a1, CONST BYTE* a2, LPWORD a3, UINT a4) = ToAscii; #endif #if _MSC_VER < 1300 int (__stdcall * Real_ToAsciiEx)(UINT a0, UINT a1, BYTE* a2, LPWORD a3, UINT a4, HKL a5) = ToAsciiEx; #else int (__stdcall * Real_ToAsciiEx)(UINT a0, UINT a1, CONST BYTE* a2, LPWORD a3, UINT a4, HKL a5) = ToAsciiEx; #endif #if _MSC_VER < 1300 int (__stdcall * Real_ToUnicode)(UINT a0, UINT a1, BYTE* a2, LPWSTR a3, int a4, UINT a5) = ToUnicode; #else int (__stdcall * Real_ToUnicode)(UINT a0, UINT a1, CONST BYTE* a2, LPWSTR a3, int a4, UINT a5) = ToUnicode; #endif #if _MSC_VER < 1300 int (__stdcall * Real_ToUnicodeEx)(UINT a0, UINT a1, BYTE* a2, LPWSTR a3, int a4, UINT a5, HKL a6) = ToUnicodeEx; #else int (__stdcall * Real_ToUnicodeEx)(UINT a0, UINT a1, CONST BYTE* a2, LPWSTR a3, int a4, UINT a5, HKL a6) = ToUnicodeEx; #endif BOOL (__stdcall * Real_TrackMouseEvent)(TRACKMOUSEEVENT* a0) = TrackMouseEvent; BOOL (__stdcall * Real_TrackPopupMenu)(HMENU a0, UINT a1, int a2, int a3, int a4, HWND a5, CONST RECT* a6) = TrackPopupMenu; BOOL (__stdcall * Real_TrackPopupMenuEx)(HMENU a0, UINT a1, int a2, int a3, HWND a4, LPTPMPARAMS a5) = TrackPopupMenuEx; BOOL (__stdcall * Real_TransactNamedPipe)(HANDLE a0, LPVOID a1, DWORD a2, LPVOID a3, DWORD a4, LPDWORD a5, LPOVERLAPPED a6) = TransactNamedPipe; int (__stdcall * Real_TranslateAcceleratorA)(HWND a0, HACCEL a1, LPMSG a2) = TranslateAcceleratorA; int (__stdcall * Real_TranslateAcceleratorW)(HWND a0, HACCEL a1, LPMSG a2) = TranslateAcceleratorW; BOOL (__stdcall * Real_TranslateCharsetInfo)(DWORD* a0, CHARSETINFO* a1, DWORD a2) = TranslateCharsetInfo; BOOL (__stdcall * Real_TranslateMDISysAccel)(HWND a0, LPMSG a1) = TranslateMDISysAccel; BOOL (__stdcall * Real_TranslateMessage)(CONST MSG* a0) = TranslateMessage; BOOL (__stdcall * Real_TransmitCommChar)(HANDLE a0, char a1) = TransmitCommChar; #if DETOUR_TryEnterCriticalSection_EVEN_IF_IT_EXERCISES_A_BUG_IN_RtlLookupFunctionTable BOOL (__stdcall * Real_TryEnterCriticalSection)(LPCRITICAL_SECTION a0) = TryEnterCriticalSection; #endif BOOL (__stdcall * Real_UnhookWindowsHook)(int a0, HOOKPROC a1) = UnhookWindowsHook; BOOL (__stdcall * Real_UnhookWindowsHookEx)(HHOOK a0) = UnhookWindowsHookEx; BOOL (__stdcall * Real_UnionRect)(LPRECT a0, CONST RECT* a1, CONST RECT* a2) = UnionRect; BOOL (__stdcall * Real_UnloadKeyboardLayout)(HKL a0) = UnloadKeyboardLayout; BOOL (__stdcall * Real_UnlockFile)(HANDLE a0, DWORD a1, DWORD a2, DWORD a3, DWORD a4) = UnlockFile; BOOL (__stdcall * Real_UnlockFileEx)(HANDLE a0, DWORD a1, DWORD a2, DWORD a3, LPOVERLAPPED a4) = UnlockFileEx; BOOL (__stdcall * Real_UnmapViewOfFile)(LPCVOID a0) = UnmapViewOfFile; BOOL (__stdcall * Real_UnpackDDElParam)(UINT a0, LPARAM a1, PUINT_PTR a2, PUINT_PTR a3) = UnpackDDElParam; BOOL (__stdcall * Real_UnrealizeObject)(HGDIOBJ a0) = UnrealizeObject; BOOL (__stdcall * Real_UnregisterClassA)(LPCSTR a0, HINSTANCE a1) = UnregisterClassA; BOOL (__stdcall * Real_UnregisterClassW)(LPCWSTR a0, HINSTANCE a1) = UnregisterClassW; BOOL (__stdcall * Real_UnregisterHotKey)(HWND a0, int a1) = UnregisterHotKey; BOOL (__stdcall * Real_UpdateColors)(HDC a0) = UpdateColors; BOOL (__stdcall * Real_UpdateResourceA)(HANDLE a0, LPCSTR a1, LPCSTR a2, WORD a3, LPVOID a4, DWORD a5) = UpdateResourceA; BOOL (__stdcall * Real_UpdateResourceW)(HANDLE a0, LPCWSTR a1, LPCWSTR a2, WORD a3, LPVOID a4, DWORD a5) = UpdateResourceW; BOOL (__stdcall * Real_UpdateWindow)(HWND a0) = UpdateWindow; BOOL (__stdcall * Real_ValidateRect)(HWND a0, CONST RECT* a1) = ValidateRect; BOOL (__stdcall * Real_ValidateRgn)(HWND a0, HRGN a1) = ValidateRgn; DWORD (__stdcall * Real_VerLanguageNameA)(DWORD a0, LPSTR a1, DWORD a2) = VerLanguageNameA; DWORD (__stdcall * Real_VerLanguageNameW)(DWORD a0, LPWSTR a1, DWORD a2) = VerLanguageNameW; LPVOID (__stdcall * Real_VirtualAllocEx)(HANDLE a0, LPVOID a1, SIZE_T a2, DWORD a3, DWORD a4) = VirtualAllocEx; BOOL (__stdcall * Real_VirtualFreeEx)(HANDLE a0, LPVOID a1, SIZE_T a2, DWORD a3) = VirtualFreeEx; BOOL (__stdcall * Real_VirtualProtectEx)(HANDLE a0, LPVOID a1, SIZE_T a2, DWORD a3, PDWORD a4) = VirtualProtectEx; DWORD_PTR (__stdcall * Real_VirtualQueryEx)(HANDLE a0, LPCVOID a1, PMEMORY_BASIC_INFORMATION a2, DWORD_PTR a3) = VirtualQueryEx; SHORT (__stdcall * Real_VkKeyScanA)(CHAR a0) = VkKeyScanA; SHORT (__stdcall * Real_VkKeyScanExA)(CHAR a0, HKL a1) = VkKeyScanExA; SHORT (__stdcall * Real_VkKeyScanExW)(WCHAR a0, HKL a1) = VkKeyScanExW; SHORT (__stdcall * Real_VkKeyScanW)(WCHAR a0) = VkKeyScanW; SOCKET (__stdcall * Real_WSAAccept)(SOCKET a0, sockaddr* a1, LPINT a2, LPCONDITIONPROC a3, DWORD_PTR a4) = WSAAccept; INT (__stdcall * Real_WSAAddressToStringA)(LPSOCKADDR a0, DWORD a1, LPWSAPROTOCOL_INFOA a2, LPSTR a3, LPDWORD a4) = WSAAddressToStringA; INT (__stdcall * Real_WSAAddressToStringW)(LPSOCKADDR a0, DWORD a1, LPWSAPROTOCOL_INFOW a2, LPWSTR a3, LPDWORD a4) = WSAAddressToStringW; HANDLE (__stdcall * Real_WSAAsyncGetHostByAddr)(HWND a0, u_int a1, CONST char* a2, int a3, int a4, char* a5, int a6) = WSAAsyncGetHostByAddr; HANDLE (__stdcall * Real_WSAAsyncGetHostByName)(HWND a0, u_int a1, CONST char* a2, char* a3, int a4) = WSAAsyncGetHostByName; HANDLE (__stdcall * Real_WSAAsyncGetProtoByName)(HWND a0, u_int a1, CONST char* a2, char* a3, int a4) = WSAAsyncGetProtoByName; HANDLE (__stdcall * Real_WSAAsyncGetProtoByNumber)(HWND a0, u_int a1, int a2, char* a3, int a4) = WSAAsyncGetProtoByNumber; HANDLE (__stdcall * Real_WSAAsyncGetServByName)(HWND a0, u_int a1, CONST char* a2, CONST char* a3, char* a4, int a5) = WSAAsyncGetServByName; HANDLE (__stdcall * Real_WSAAsyncGetServByPort)(HWND a0, u_int a1, int a2, CONST char* a3, char* a4, int a5) = WSAAsyncGetServByPort; int (__stdcall * Real_WSAAsyncSelect)(SOCKET a0, HWND a1, u_int a2, long a3) = WSAAsyncSelect; int (__stdcall * Real_WSACancelAsyncRequest)(HANDLE a0) = WSACancelAsyncRequest; int (__stdcall * Real_WSACancelBlockingCall)(void) = WSACancelBlockingCall; int (__stdcall * Real_WSACleanup)(void) = WSACleanup; BOOL (__stdcall * Real_WSACloseEvent)(HANDLE a0) = WSACloseEvent; int (__stdcall * Real_WSAConnect)(SOCKET a0, CONST sockaddr* a1, int a2, LPWSABUF a3, LPWSABUF a4, LPQOS a5, LPQOS a6) = WSAConnect; HANDLE (__stdcall * Real_WSACreateEvent)(void) = WSACreateEvent; int (__stdcall * Real_WSADuplicateSocketA)(SOCKET a0, DWORD a1, LPWSAPROTOCOL_INFOA a2) = WSADuplicateSocketA; int (__stdcall * Real_WSADuplicateSocketW)(SOCKET a0, DWORD a1, LPWSAPROTOCOL_INFOW a2) = WSADuplicateSocketW; INT (__stdcall * Real_WSAEnumNameSpaceProvidersA)(LPDWORD a0, LPWSANAMESPACE_INFOA a1) = WSAEnumNameSpaceProvidersA; INT (__stdcall * Real_WSAEnumNameSpaceProvidersW)(LPDWORD a0, LPWSANAMESPACE_INFOW a1) = WSAEnumNameSpaceProvidersW; int (__stdcall * Real_WSAEnumNetworkEvents)(SOCKET a0, HANDLE a1, LPWSANETWORKEVENTS a2) = WSAEnumNetworkEvents; int (__stdcall * Real_WSAEnumProtocolsA)(LPINT a0, LPWSAPROTOCOL_INFOA a1, LPDWORD a2) = WSAEnumProtocolsA; int (__stdcall * Real_WSAEnumProtocolsW)(LPINT a0, LPWSAPROTOCOL_INFOW a1, LPDWORD a2) = WSAEnumProtocolsW; int (__stdcall * Real_WSAEventSelect)(SOCKET a0, HANDLE a1, long a2) = WSAEventSelect; BOOL (__stdcall * Real_WSAGetOverlappedResult)(SOCKET a0, LPWSAOVERLAPPED a1, LPDWORD a2, BOOL a3, LPDWORD a4) = WSAGetOverlappedResult; BOOL (__stdcall * Real_WSAGetQOSByName)(SOCKET a0, LPWSABUF a1, LPQOS a2) = WSAGetQOSByName; INT (__stdcall * Real_WSAGetServiceClassInfoA)(LPGUID a0, LPGUID a1, LPDWORD a2, LPWSASERVICECLASSINFOA a3) = WSAGetServiceClassInfoA; INT (__stdcall * Real_WSAGetServiceClassInfoW)(LPGUID a0, LPGUID a1, LPDWORD a2, LPWSASERVICECLASSINFOW a3) = WSAGetServiceClassInfoW; INT (__stdcall * Real_WSAGetServiceClassNameByClassIdA)(LPGUID a0, LPSTR a1, LPDWORD a2) = WSAGetServiceClassNameByClassIdA; INT (__stdcall * Real_WSAGetServiceClassNameByClassIdW)(LPGUID a0, LPWSTR a1, LPDWORD a2) = WSAGetServiceClassNameByClassIdW; int (__stdcall * Real_WSAHtonl)(SOCKET a0, u_long a1, u_long* a2) = WSAHtonl; int (__stdcall * Real_WSAHtons)(SOCKET a0, u_short a1, u_short* a2) = WSAHtons; INT (__stdcall * Real_WSAInstallServiceClassA)(LPWSASERVICECLASSINFOA a0) = WSAInstallServiceClassA; INT (__stdcall * Real_WSAInstallServiceClassW)(LPWSASERVICECLASSINFOW a0) = WSAInstallServiceClassW; int (__stdcall * Real_WSAIoctl)(SOCKET a0, DWORD a1, LPVOID a2, DWORD a3, LPVOID a4, DWORD a5, LPDWORD a6, LPWSAOVERLAPPED a7, LPWSAOVERLAPPED_COMPLETION_ROUTINE a8) = WSAIoctl; BOOL (__stdcall * Real_WSAIsBlocking)(void) = WSAIsBlocking; SOCKET (__stdcall * Real_WSAJoinLeaf)(SOCKET a0, CONST sockaddr* a1, int a2, LPWSABUF a3, LPWSABUF a4, LPQOS a5, LPQOS a6, DWORD a7) = WSAJoinLeaf; INT (__stdcall * Real_WSALookupServiceBeginA)(LPWSAQUERYSETA a0, DWORD a1, LPHANDLE a2) = WSALookupServiceBeginA; INT (__stdcall * Real_WSALookupServiceBeginW)(LPWSAQUERYSETW a0, DWORD a1, LPHANDLE a2) = WSALookupServiceBeginW; INT (__stdcall * Real_WSALookupServiceEnd)(HANDLE a0) = WSALookupServiceEnd; INT (__stdcall * Real_WSALookupServiceNextA)(HANDLE a0, DWORD a1, LPDWORD a2, LPWSAQUERYSETA a3) = WSALookupServiceNextA; INT (__stdcall * Real_WSALookupServiceNextW)(HANDLE a0, DWORD a1, LPDWORD a2, LPWSAQUERYSETW a3) = WSALookupServiceNextW; int (__stdcall * Real_WSANtohl)(SOCKET a0, u_long a1, u_long* a2) = WSANtohl; int (__stdcall * Real_WSANtohs)(SOCKET a0, u_short a1, u_short* a2) = WSANtohs; INT (__stdcall * Real_WSAProviderConfigChange)(LPHANDLE a0, LPWSAOVERLAPPED a1, LPWSAOVERLAPPED_COMPLETION_ROUTINE a2) = WSAProviderConfigChange; int (__stdcall * Real_WSARecv)(SOCKET a0, LPWSABUF a1, DWORD a2, LPDWORD a3, LPDWORD a4, LPWSAOVERLAPPED a5, LPWSAOVERLAPPED_COMPLETION_ROUTINE a6) = WSARecv; int (__stdcall * Real_WSARecvDisconnect)(SOCKET a0, LPWSABUF a1) = WSARecvDisconnect; int (__stdcall * Real_WSARecvFrom)(SOCKET a0, LPWSABUF a1, DWORD a2, LPDWORD a3, LPDWORD a4, sockaddr* a5, LPINT a6, LPWSAOVERLAPPED a7, LPWSAOVERLAPPED_COMPLETION_ROUTINE a8) = WSARecvFrom; INT (__stdcall * Real_WSARemoveServiceClass)(LPGUID a0) = WSARemoveServiceClass; BOOL (__stdcall * Real_WSAResetEvent)(HANDLE a0) = WSAResetEvent; int (__stdcall * Real_WSASend)(SOCKET a0, LPWSABUF a1, DWORD a2, LPDWORD a3, DWORD a4, LPWSAOVERLAPPED a5, LPWSAOVERLAPPED_COMPLETION_ROUTINE a6) = WSASend; int (__stdcall * Real_WSASendDisconnect)(SOCKET a0, LPWSABUF a1) = WSASendDisconnect; int (__stdcall * Real_WSASendTo)(SOCKET a0, LPWSABUF a1, DWORD a2, LPDWORD a3, DWORD a4, CONST sockaddr* a5, int a6, LPWSAOVERLAPPED a7, LPWSAOVERLAPPED_COMPLETION_ROUTINE a8) = WSASendTo; FARPROC (__stdcall * Real_WSASetBlockingHook)(FARPROC a0) = WSASetBlockingHook; BOOL (__stdcall * Real_WSASetEvent)(HANDLE a0) = WSASetEvent; INT (__stdcall * Real_WSASetServiceA)(LPWSAQUERYSETA a0, WSAESETSERVICEOP a1, DWORD a2) = WSASetServiceA; INT (__stdcall * Real_WSASetServiceW)(LPWSAQUERYSETW a0, WSAESETSERVICEOP a1, DWORD a2) = WSASetServiceW; SOCKET (__stdcall * Real_WSASocketA)(int a0, int a1, int a2, LPWSAPROTOCOL_INFOA a3, GROUP a4, DWORD a5) = WSASocketA; SOCKET (__stdcall * Real_WSASocketW)(int a0, int a1, int a2, LPWSAPROTOCOL_INFOW a3, GROUP a4, DWORD a5) = WSASocketW; int (__stdcall * Real_WSAStartup)(WORD a0, LPWSADATA a1) = WSAStartup; INT (__stdcall * Real_WSAStringToAddressA)(LPSTR a0, INT a1, LPWSAPROTOCOL_INFOA a2, LPSOCKADDR a3, LPINT a4) = WSAStringToAddressA; INT (__stdcall * Real_WSAStringToAddressW)(LPWSTR a0, INT a1, LPWSAPROTOCOL_INFOW a2, LPSOCKADDR a3, LPINT a4) = WSAStringToAddressW; int (__stdcall * Real_WSAUnhookBlockingHook)(void) = WSAUnhookBlockingHook; DWORD (__stdcall * Real_WSAWaitForMultipleEvents)(DWORD a0, CONST HANDLE * a1, BOOL a2, DWORD a3, BOOL a4) = WSAWaitForMultipleEvents; BOOL (__stdcall * Real_WaitCommEvent)(HANDLE a0, LPDWORD a1, LPOVERLAPPED a2) = WaitCommEvent; #if !defined(DETOURS_ARM) BOOL (__stdcall * Real_WaitForDebugEvent)(LPDEBUG_EVENT a0, DWORD a1) = WaitForDebugEvent; #endif // !DETOUR_ARM DWORD (__stdcall * Real_WaitForInputIdle)(HANDLE a0, DWORD a1) = WaitForInputIdle; DWORD (__stdcall * Real_WaitForMultipleObjects)(DWORD a0, CONST HANDLE * a1, BOOL a2, DWORD a3) = WaitForMultipleObjects; DWORD (__stdcall * Real_WaitForMultipleObjectsEx)(DWORD a0, CONST HANDLE * a1, BOOL a2, DWORD a3, BOOL a4) = WaitForMultipleObjectsEx; DWORD (__stdcall * Real_WaitForSingleObject)(HANDLE a0, DWORD a1) = WaitForSingleObject; DWORD (__stdcall * Real_WaitForSingleObjectEx)(HANDLE a0, DWORD a1, BOOL a2) = WaitForSingleObjectEx; BOOL (__stdcall * Real_WaitMessage)(void) = WaitMessage; BOOL (__stdcall * Real_WaitNamedPipeA)(LPCSTR a0, DWORD a1) = WaitNamedPipeA; BOOL (__stdcall * Real_WaitNamedPipeW)(LPCWSTR a0, DWORD a1) = WaitNamedPipeW; BOOL (__stdcall * Real_WidenPath)(HDC a0) = WidenPath; UINT (__stdcall * Real_WinExec)(LPCSTR a0, UINT a1) = WinExec; BOOL (__stdcall * Real_WinHelpA)(HWND a0, LPCSTR a1, UINT a2, ULONG_PTR a3) = WinHelpA; BOOL (__stdcall * Real_WinHelpW)(HWND a0, LPCWSTR a1, UINT a2, ULONG_PTR a3) = WinHelpW; HWND (__stdcall * Real_WindowFromDC)(HDC a0) = WindowFromDC; HWND (__stdcall * Real_WindowFromPoint)(POINT a0) = WindowFromPoint; HRESULT (__stdcall * Real_WriteClassStg)(LPSTORAGE a0, CONST IID& a1) = WriteClassStg; HRESULT (__stdcall * Real_WriteClassStm)(LPSTREAM a0, CONST IID& a1) = WriteClassStm; BOOL (__stdcall * Real_WriteConsoleA)(HANDLE a0, CONST void* a1, DWORD a2, LPDWORD a3, LPVOID a4) = WriteConsoleA; BOOL (__stdcall * Real_WriteConsoleInputA)(HANDLE a0, CONST INPUT_RECORD* a1, DWORD a2, LPDWORD a3) = WriteConsoleInputA; BOOL (__stdcall * Real_WriteConsoleInputW)(HANDLE a0, CONST INPUT_RECORD* a1, DWORD a2, LPDWORD a3) = WriteConsoleInputW; BOOL (__stdcall * Real_WriteConsoleOutputA)(HANDLE a0, CONST CHAR_INFO* a1, COORD a2, COORD a3, PSMALL_RECT a4) = WriteConsoleOutputA; BOOL (__stdcall * Real_WriteConsoleOutputAttribute)(HANDLE a0, CONST WORD* a1, DWORD a2, COORD a3, LPDWORD a4) = WriteConsoleOutputAttribute; BOOL (__stdcall * Real_WriteConsoleOutputCharacterA)(HANDLE a0, LPCSTR a1, DWORD a2, COORD a3, LPDWORD a4) = WriteConsoleOutputCharacterA; BOOL (__stdcall * Real_WriteConsoleOutputCharacterW)(HANDLE a0, LPCWSTR a1, DWORD a2, COORD a3, LPDWORD a4) = WriteConsoleOutputCharacterW; BOOL (__stdcall * Real_WriteConsoleOutputW)(HANDLE a0, CONST CHAR_INFO* a1, COORD a2, COORD a3, PSMALL_RECT a4) = WriteConsoleOutputW; BOOL (__stdcall * Real_WriteConsoleW)(HANDLE a0, CONST void* a1, DWORD a2, LPDWORD a3, LPVOID a4) = WriteConsoleW; BOOL (__stdcall * Real_WriteFile)(HANDLE a0, LPCVOID a1, DWORD a2, LPDWORD a3, LPOVERLAPPED a4) = WriteFile; BOOL (__stdcall * Real_WriteFileEx)(HANDLE a0, LPCVOID a1, DWORD a2, LPOVERLAPPED a3, LPOVERLAPPED_COMPLETION_ROUTINE a4) = WriteFileEx; HRESULT (__stdcall * Real_WriteFmtUserTypeStg)(LPSTORAGE a0, CLIPFORMAT a1, LPOLESTR a2) = WriteFmtUserTypeStg; BOOL (__stdcall * Real_WritePrivateProfileSectionA)(LPCSTR a0, LPCSTR a1, LPCSTR a2) = WritePrivateProfileSectionA; BOOL (__stdcall * Real_WritePrivateProfileSectionW)(LPCWSTR a0, LPCWSTR a1, LPCWSTR a2) = WritePrivateProfileSectionW; BOOL (__stdcall * Real_WritePrivateProfileStringA)(LPCSTR a0, LPCSTR a1, LPCSTR a2, LPCSTR a3) = WritePrivateProfileStringA; BOOL (__stdcall * Real_WritePrivateProfileStringW)(LPCWSTR a0, LPCWSTR a1, LPCWSTR a2, LPCWSTR a3) = WritePrivateProfileStringW; BOOL (__stdcall * Real_WritePrivateProfileStructA)(LPCSTR a0, LPCSTR a1, LPVOID a2, UINT a3, LPCSTR a4) = WritePrivateProfileStructA; BOOL (__stdcall * Real_WritePrivateProfileStructW)(LPCWSTR a0, LPCWSTR a1, LPVOID a2, UINT a3, LPCWSTR a4) = WritePrivateProfileStructW; #if _MSC_VER < 1300 BOOL (__stdcall * Real_WriteProcessMemory)(HANDLE a0, LPVOID a1, LPVOID a2, DWORD_PTR a3, PDWORD_PTR a4) = WriteProcessMemory; #else BOOL (__stdcall * Real_WriteProcessMemory)(HANDLE a0, LPVOID a1, LPCVOID a2, DWORD_PTR a3, PDWORD_PTR a4) = WriteProcessMemory; #endif BOOL (__stdcall * Real_WriteProfileSectionA)(LPCSTR a0, LPCSTR a1) = WriteProfileSectionA; BOOL (__stdcall * Real_WriteProfileSectionW)(LPCWSTR a0, LPCWSTR a1) = WriteProfileSectionW; BOOL (__stdcall * Real_WriteProfileStringA)(LPCSTR a0, LPCSTR a1, LPCSTR a2) = WriteProfileStringA; BOOL (__stdcall * Real_WriteProfileStringW)(LPCWSTR a0, LPCWSTR a1, LPCWSTR a2) = WriteProfileStringW; DWORD (__stdcall * Real_WriteTapemark)(HANDLE a0, DWORD a1, DWORD a2, BOOL a3) = WriteTapemark; int (__stdcall * Real___WSAFDIsSet)(SOCKET a0, fd_set* a1) = __WSAFDIsSet; long (__stdcall * Real__hread)(HFILE a0, LPVOID a1, long a2) = _hread; long (__stdcall * Real__hwrite)(HFILE a0, LPCSTR a1, long a2) = _hwrite; HFILE (__stdcall * Real__lclose)(HFILE a0) = _lclose; HFILE (__stdcall * Real__lcreat)(LPCSTR a0, int a1) = _lcreat; LONG (__stdcall * Real__llseek)(HFILE a0, LONG a1, int a2) = _llseek; HFILE (__stdcall * Real__lopen)(LPCSTR a0, int a1) = _lopen; UINT (__stdcall * Real__lread)(HFILE a0, LPVOID a1, UINT a2) = _lread; UINT (__stdcall * Real__lwrite)(HFILE a0, LPCSTR a1, UINT a2) = _lwrite; SOCKET (__stdcall * Real_accept)(SOCKET a0, sockaddr* a1, int* a2) = accept; int (__stdcall * Real_bind)(SOCKET a0, CONST sockaddr* a1, int a2) = bind; int (__stdcall * Real_closesocket)(SOCKET a0) = closesocket; int (__stdcall * Real_connect)(SOCKET a0, CONST sockaddr* a1, int a2) = connect; hostent * (__stdcall * Real_gethostbyaddr)(CONST char* a0, int a1, int a2) = gethostbyaddr; hostent * (__stdcall * Real_gethostbyname)(CONST char* a0) = gethostbyname; int (__stdcall * Real_gethostname)(char* a0, int a1) = gethostname; int (__stdcall * Real_getpeername)(SOCKET a0, sockaddr* a1, int* a2) = getpeername; protoent * (__stdcall * Real_getprotobyname)(CONST char* a0) = getprotobyname; protoent * (__stdcall * Real_getprotobynumber)(int a0) = getprotobynumber; servent * (__stdcall * Real_getservbyname)(CONST char* a0, CONST char* a1) = getservbyname; servent * (__stdcall * Real_getservbyport)(int a0, CONST char* a1) = getservbyport; int (__stdcall * Real_getsockname)(SOCKET a0, sockaddr* a1, int* a2) = getsockname; int (__stdcall * Real_getsockopt)(SOCKET a0, int a1, int a2, char* a3, int* a4) = getsockopt; u_long (__stdcall * Real_htonl)(u_long a0) = htonl; u_short (__stdcall * Real_htons)(u_short a0) = htons; unsigned long (__stdcall * Real_inet_addr)(CONST char* a0) = inet_addr; char * (__stdcall * Real_inet_ntoa)(in_addr a0) = inet_ntoa; int (__stdcall * Real_ioctlsocket)(SOCKET a0, long a1, u_long* a2) = ioctlsocket; void (__stdcall * Real_keybd_event)(BYTE a0, BYTE a1, DWORD a2, ULONG_PTR a3) = keybd_event; int (__stdcall * Real_listen)(SOCKET a0, int a1) = listen; void (__stdcall * Real_mouse_event)(DWORD a0, DWORD a1, DWORD a2, DWORD a3, ULONG_PTR a4) = mouse_event; u_long (__stdcall * Real_ntohl)(u_long a0) = ntohl; u_short (__stdcall * Real_ntohs)(u_short a0) = ntohs; int (__stdcall * Real_recv)(SOCKET a0, char* a1, int a2, int a3) = recv; int (__stdcall * Real_recvfrom)(SOCKET a0, char* a1, int a2, int a3, sockaddr* a4, int* a5) = recvfrom; int (__stdcall * Real_select)(int a0, fd_set* a1, fd_set* a2, fd_set* a3, CONST timeval* a4) = select; int (__stdcall * Real_send)(SOCKET a0, CONST char* a1, int a2, int a3) = send; int (__stdcall * Real_sendto)(SOCKET a0, CONST char* a1, int a2, int a3, CONST sockaddr* a4, int a5) = sendto; int (__stdcall * Real_setsockopt)(SOCKET a0, int a1, int a2, CONST char* a3, int a4) = setsockopt; int (__stdcall * Real_shutdown)(SOCKET a0, int a1) = shutdown; SOCKET (__stdcall * Real_socket)(int a0, int a1, int a2) = socket; ///////////////////////////////////////////////////////////////////// Detours. // int __stdcall Mine_AbortDoc(HDC a0) { _PrintEnter("AbortDoc(%p)\n", a0); int rv = 0; __try { rv = Real_AbortDoc(a0); } __finally { _PrintExit("AbortDoc() -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_AbortPath(HDC a0) { _PrintEnter("AbortPath(%p)\n", a0); BOOL rv = 0; __try { rv = Real_AbortPath(a0); } __finally { _PrintExit("AbortPath() -> %x\n", rv); }; return rv; } HKL __stdcall Mine_ActivateKeyboardLayout(HKL a0, UINT a1) { _PrintEnter("ActivateKeyboardLayout(%p,%p)\n", a0, a1); HKL rv = 0; __try { rv = Real_ActivateKeyboardLayout(a0, a1); } __finally { _PrintExit("ActivateKeyboardLayout(,) -> %p\n", rv); }; return rv; } ATOM __stdcall Mine_AddAtomA(LPCSTR a0) { _PrintEnter("AddAtomA(%hs)\n", a0); ATOM rv = 0; __try { rv = Real_AddAtomA(a0); } __finally { _PrintExit("AddAtomA() -> %x\n", rv); }; return rv; } ATOM __stdcall Mine_AddAtomW(LPCWSTR a0) { _PrintEnter("AddAtomW(%ls)\n", a0); ATOM rv = 0; __try { rv = Real_AddAtomW(a0); } __finally { _PrintExit("AddAtomW() -> %x\n", rv); }; return rv; } int __stdcall Mine_AddFontResourceA(LPCSTR a0) { _PrintEnter("AddFontResourceA(%hs)\n", a0); int rv = 0; __try { rv = Real_AddFontResourceA(a0); } __finally { _PrintExit("AddFontResourceA() -> %x\n", rv); }; return rv; } int __stdcall Mine_AddFontResourceW(LPCWSTR a0) { _PrintEnter("AddFontResourceW(%ls)\n", a0); int rv = 0; __try { rv = Real_AddFontResourceW(a0); } __finally { _PrintExit("AddFontResourceW() -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_AdjustWindowRect(LPRECT a0, DWORD a1, BOOL a2) { _PrintEnter("AdjustWindowRect(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_AdjustWindowRect(a0, a1, a2); } __finally { _PrintExit("AdjustWindowRect(,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_AdjustWindowRectEx(LPRECT a0, DWORD a1, BOOL a2, DWORD a3) { _PrintEnter("AdjustWindowRectEx(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_AdjustWindowRectEx(a0, a1, a2, a3); } __finally { _PrintExit("AdjustWindowRectEx(,,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_AllocConsole(void) { _PrintEnter("AllocConsole()\n"); BOOL rv = 0; __try { rv = Real_AllocConsole(); } __finally { _PrintExit("AllocConsole() -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_AngleArc(HDC a0, int a1, int a2, DWORD a3, FLOAT a4, FLOAT a5) { _PrintEnter("AngleArc(%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); BOOL rv = 0; __try { rv = Real_AngleArc(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("AngleArc(,,,,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_AnimatePalette(HPALETTE a0, UINT a1, UINT a2, PALETTEENTRY* a3) { _PrintEnter("AnimatePalette(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_AnimatePalette(a0, a1, a2, a3); } __finally { _PrintExit("AnimatePalette(,,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_AnyPopup(void) { _PrintEnter("AnyPopup()\n"); BOOL rv = 0; __try { rv = Real_AnyPopup(); } __finally { _PrintExit("AnyPopup() -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_AppendMenuA(HMENU a0, UINT a1, UINT_PTR a2, LPCSTR a3) { _PrintEnter("AppendMenuA(%p,%p,%p,%hs)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_AppendMenuA(a0, a1, a2, a3); } __finally { _PrintExit("AppendMenuA(,,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_AppendMenuW(HMENU a0, UINT a1, UINT_PTR a2, LPCWSTR a3) { _PrintEnter("AppendMenuW(%p,%p,%p,%ls)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_AppendMenuW(a0, a1, a2, a3); } __finally { _PrintExit("AppendMenuW(,,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_Arc(HDC a0, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) { _PrintEnter("Arc(%p,%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8); BOOL rv = 0; __try { rv = Real_Arc(a0, a1, a2, a3, a4, a5, a6, a7, a8); } __finally { _PrintExit("Arc(,,,,,,,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_ArcTo(HDC a0, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) { _PrintEnter("ArcTo(%p,%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8); BOOL rv = 0; __try { rv = Real_ArcTo(a0, a1, a2, a3, a4, a5, a6, a7, a8); } __finally { _PrintExit("ArcTo(,,,,,,,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_AreFileApisANSI(void) { _PrintEnter("AreFileApisANSI()\n"); BOOL rv = 0; __try { rv = Real_AreFileApisANSI(); } __finally { _PrintExit("AreFileApisANSI() -> %x\n", rv); }; return rv; } UINT __stdcall Mine_ArrangeIconicWindows(HWND a0) { _PrintEnter("ArrangeIconicWindows(%p)\n", a0); UINT rv = 0; __try { rv = Real_ArrangeIconicWindows(a0); } __finally { _PrintExit("ArrangeIconicWindows() -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_AttachThreadInput(DWORD a0, DWORD a1, BOOL a2) { _PrintEnter("AttachThreadInput(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_AttachThreadInput(a0, a1, a2); } __finally { _PrintExit("AttachThreadInput(,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_BackupRead(HANDLE a0, LPBYTE a1, DWORD a2, LPDWORD a3, BOOL a4, BOOL a5, LPVOID* a6) { _PrintEnter("BackupRead(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); BOOL rv = 0; __try { rv = Real_BackupRead(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("BackupRead(,,,,,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_BackupSeek(HANDLE a0, DWORD a1, DWORD a2, LPDWORD a3, LPDWORD a4, LPVOID* a5) { _PrintEnter("BackupSeek(%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); BOOL rv = 0; __try { rv = Real_BackupSeek(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("BackupSeek(,,,,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_BackupWrite(HANDLE a0, LPBYTE a1, DWORD a2, LPDWORD a3, BOOL a4, BOOL a5, LPVOID* a6) { _PrintEnter("BackupWrite(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); BOOL rv = 0; __try { rv = Real_BackupWrite(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("BackupWrite(,,,,,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_Beep(DWORD a0, DWORD a1) { _PrintEnter("Beep(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_Beep(a0, a1); } __finally { _PrintExit("Beep(,) -> %x\n", rv); }; return rv; } HDWP __stdcall Mine_BeginDeferWindowPos(int a0) { _PrintEnter("BeginDeferWindowPos(%p)\n", a0); HDWP rv = 0; __try { rv = Real_BeginDeferWindowPos(a0); } __finally { _PrintExit("BeginDeferWindowPos() -> %p\n", rv); }; return rv; } HDC __stdcall Mine_BeginPaint(HWND a0, LPPAINTSTRUCT a1) { _PrintEnter("BeginPaint(%p,%p)\n", a0, a1); HDC rv = 0; __try { rv = Real_BeginPaint(a0, a1); } __finally { _PrintExit("BeginPaint(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_BeginPath(HDC a0) { _PrintEnter("BeginPath(%p)\n", a0); BOOL rv = 0; __try { rv = Real_BeginPath(a0); } __finally { _PrintExit("BeginPath() -> %x\n", rv); }; return rv; } HANDLE __stdcall Mine_BeginUpdateResourceA(LPCSTR a0, BOOL a1) { _PrintEnter("BeginUpdateResourceA(%hs,%p)\n", a0, a1); HANDLE rv = 0; __try { rv = Real_BeginUpdateResourceA(a0, a1); } __finally { _PrintExit("BeginUpdateResourceA(,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_BeginUpdateResourceW(LPCWSTR a0, BOOL a1) { _PrintEnter("BeginUpdateResourceW(%ls,%p)\n", a0, a1); HANDLE rv = 0; __try { rv = Real_BeginUpdateResourceW(a0, a1); } __finally { _PrintExit("BeginUpdateResourceW(,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_BindMoniker(IMoniker* a0, DWORD a1, CONST IID& a2, LPVOID* a3) { _PrintEnter("BindMoniker(%p,%p,%p,%p)\n", a0, a1, a2, a3); HRESULT rv = 0; __try { rv = Real_BindMoniker(a0, a1, a2, a3); } __finally { _PrintExit("BindMoniker(,,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_BitBlt(HDC a0, int a1, int a2, int a3, int a4, HDC a5, int a6, int a7, DWORD a8) { _PrintEnter("BitBlt(%p,%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8); BOOL rv = 0; __try { rv = Real_BitBlt(a0, a1, a2, a3, a4, a5, a6, a7, a8); } __finally { _PrintExit("BitBlt(,,,,,,,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_BringWindowToTop(HWND a0) { _PrintEnter("BringWindowToTop(%p)\n", a0); BOOL rv = 0; __try { rv = Real_BringWindowToTop(a0); } __finally { _PrintExit("BringWindowToTop() -> %x\n", rv); }; return rv; } long __stdcall Mine_BroadcastSystemMessageA(DWORD a0, LPDWORD a1, UINT a2, WPARAM a3, LPARAM a4) { _PrintEnter("BroadcastSystemMessageA(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); long rv = 0; __try { rv = Real_BroadcastSystemMessageA(a0, a1, a2, a3, a4); } __finally { _PrintExit("BroadcastSystemMessageA(,,,,) -> %x\n", rv); }; return rv; } long __stdcall Mine_BroadcastSystemMessageW(DWORD a0, LPDWORD a1, UINT a2, WPARAM a3, LPARAM a4) { _PrintEnter("BroadcastSystemMessageW(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); long rv = 0; __try { rv = Real_BroadcastSystemMessageW(a0, a1, a2, a3, a4); } __finally { _PrintExit("BroadcastSystemMessageW(,,,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_BuildCommDCBA(LPCSTR a0, LPDCB a1) { _PrintEnter("BuildCommDCBA(%hs,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_BuildCommDCBA(a0, a1); } __finally { _PrintExit("BuildCommDCBA(,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_BuildCommDCBAndTimeoutsA(LPCSTR a0, LPDCB a1, LPCOMMTIMEOUTS a2) { _PrintEnter("BuildCommDCBAndTimeoutsA(%hs,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_BuildCommDCBAndTimeoutsA(a0, a1, a2); } __finally { _PrintExit("BuildCommDCBAndTimeoutsA(,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_BuildCommDCBAndTimeoutsW(LPCWSTR a0, LPDCB a1, LPCOMMTIMEOUTS a2) { _PrintEnter("BuildCommDCBAndTimeoutsW(%ls,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_BuildCommDCBAndTimeoutsW(a0, a1, a2); } __finally { _PrintExit("BuildCommDCBAndTimeoutsW(,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_BuildCommDCBW(LPCWSTR a0, LPDCB a1) { _PrintEnter("BuildCommDCBW(%ls,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_BuildCommDCBW(a0, a1); } __finally { _PrintExit("BuildCommDCBW(,) -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CLSIDFromProgID(LPCOLESTR a0, LPGUID a1) { _PrintEnter("CLSIDFromProgID(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_CLSIDFromProgID(a0, a1); } __finally { _PrintExit("CLSIDFromProgID(,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_CLSIDFromString(LPOLESTR a0, LPGUID a1) { _PrintEnter("CLSIDFromString(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_CLSIDFromString(a0, a1); } __finally { _PrintExit("CLSIDFromString(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_CallMsgFilterA(LPMSG a0, int a1) { _PrintEnter("CallMsgFilterA(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_CallMsgFilterA(a0, a1); } __finally { _PrintExit("CallMsgFilterA(,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_CallMsgFilterW(LPMSG a0, int a1) { _PrintEnter("CallMsgFilterW(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_CallMsgFilterW(a0, a1); } __finally { _PrintExit("CallMsgFilterW(,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_CallNamedPipeA(LPCSTR a0, LPVOID a1, DWORD a2, LPVOID a3, DWORD a4, LPDWORD a5, DWORD a6) { _PrintEnter("CallNamedPipeA(%hs,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); BOOL rv = 0; __try { rv = Real_CallNamedPipeA(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("CallNamedPipeA(,,,,,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_CallNamedPipeW(LPCWSTR a0, LPVOID a1, DWORD a2, LPVOID a3, DWORD a4, LPDWORD a5, DWORD a6) { _PrintEnter("CallNamedPipeW(%ls,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); BOOL rv = 0; __try { rv = Real_CallNamedPipeW(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("CallNamedPipeW(,,,,,,) -> %x\n", rv); }; return rv; } LRESULT __stdcall Mine_CallNextHookEx(HHOOK a0, int a1, WPARAM a2, LPARAM a3) { _PrintEnter("CallNextHookEx(%p,%p,%p,%p)\n", a0, a1, a2, a3); LRESULT rv = 0; __try { rv = Real_CallNextHookEx(a0, a1, a2, a3); } __finally { _PrintExit("CallNextHookEx(,,,) -> %x\n", rv); }; return rv; } LRESULT __stdcall Mine_CallWindowProcA(WNDPROC a0, HWND a1, UINT a2, WPARAM a3, LPARAM a4) { _PrintEnter("CallWindowProcA(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); LRESULT rv = 0; __try { rv = Real_CallWindowProcA(a0, a1, a2, a3, a4); } __finally { _PrintExit("CallWindowProcA(,,,,) -> %x\n", rv); }; return rv; } LRESULT __stdcall Mine_CallWindowProcW(WNDPROC a0, HWND a1, UINT a2, WPARAM a3, LPARAM a4) { _PrintEnter("CallWindowProcW(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); LRESULT rv = 0; __try { rv = Real_CallWindowProcW(a0, a1, a2, a3, a4); } __finally { _PrintExit("CallWindowProcW(,,,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_CancelDC(HDC a0) { _PrintEnter("CancelDC(%p)\n", a0); BOOL rv = 0; __try { rv = Real_CancelDC(a0); } __finally { _PrintExit("CancelDC() -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_CancelIo(HANDLE a0) { _PrintEnter("CancelIo(%p)\n", a0); BOOL rv = 0; __try { rv = Real_CancelIo(a0); } __finally { _PrintExit("CancelIo() -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_CancelWaitableTimer(HANDLE a0) { _PrintEnter("CancelWaitableTimer(%p)\n", a0); BOOL rv = 0; __try { rv = Real_CancelWaitableTimer(a0); } __finally { _PrintExit("CancelWaitableTimer() -> %x\n", rv); }; return rv; } WORD __stdcall Mine_CascadeWindows(HWND a0, UINT a1, RECT* a2, UINT a3, struct HWND__** a4) { _PrintEnter("CascadeWindows(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); WORD rv = 0; __try { rv = Real_CascadeWindows(a0, a1, a2, a3, a4); } __finally { _PrintExit("CascadeWindows(,,,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_ChangeClipboardChain(HWND a0, HWND a1) { _PrintEnter("ChangeClipboardChain(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_ChangeClipboardChain(a0, a1); } __finally { _PrintExit("ChangeClipboardChain(,) -> %x\n", rv); }; return rv; } LONG __stdcall Mine_ChangeDisplaySettingsA(LPDEVMODEA a0, DWORD a1) { _PrintEnter("ChangeDisplaySettingsA(%p,%p)\n", a0, a1); LONG rv = 0; __try { rv = Real_ChangeDisplaySettingsA(a0, a1); } __finally { _PrintExit("ChangeDisplaySettingsA(,) -> %x\n", rv); }; return rv; } LONG __stdcall Mine_ChangeDisplaySettingsExA(LPCSTR a0, LPDEVMODEA a1, HWND a2, DWORD a3, LPVOID a4) { _PrintEnter("ChangeDisplaySettingsExA(%hs,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); LONG rv = 0; __try { rv = Real_ChangeDisplaySettingsExA(a0, a1, a2, a3, a4); } __finally { _PrintExit("ChangeDisplaySettingsExA(,,,,) -> %x\n", rv); }; return rv; } LONG __stdcall Mine_ChangeDisplaySettingsExW(LPCWSTR a0, LPDEVMODEW a1, HWND a2, DWORD a3, LPVOID a4) { _PrintEnter("ChangeDisplaySettingsExW(%ls,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); LONG rv = 0; __try { rv = Real_ChangeDisplaySettingsExW(a0, a1, a2, a3, a4); } __finally { _PrintExit("ChangeDisplaySettingsExW(,,,,) -> %x\n", rv); }; return rv; } LONG __stdcall Mine_ChangeDisplaySettingsW(LPDEVMODEW a0, DWORD a1) { _PrintEnter("ChangeDisplaySettingsW(%p,%p)\n", a0, a1); LONG rv = 0; __try { rv = Real_ChangeDisplaySettingsW(a0, a1); } __finally { _PrintExit("ChangeDisplaySettingsW(,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_ChangeMenuA(HMENU a0, UINT a1, LPCSTR a2, UINT a3, UINT a4) { _PrintEnter("ChangeMenuA(%p,%p,%hs,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_ChangeMenuA(a0, a1, a2, a3, a4); } __finally { _PrintExit("ChangeMenuA(,,,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_ChangeMenuW(HMENU a0, UINT a1, LPCWSTR a2, UINT a3, UINT a4) { _PrintEnter("ChangeMenuW(%p,%p,%ls,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_ChangeMenuW(a0, a1, a2, a3, a4); } __finally { _PrintExit("ChangeMenuW(,,,,) -> %x\n", rv); }; return rv; } LPSTR __stdcall Mine_CharLowerA(LPSTR a0) { _PrintEnter("CharLowerA(%hs)\n", a0); LPSTR rv = 0; __try { rv = Real_CharLowerA(a0); } __finally { _PrintExit("CharLowerA(%hs) -> %hs\n", a0, rv); }; return rv; } DWORD __stdcall Mine_CharLowerBuffA(LPSTR a0, DWORD a1) { _PrintEnter("CharLowerBuffA(%hs,%p)\n", a0, a1); DWORD rv = 0; __try { rv = Real_CharLowerBuffA(a0, a1); } __finally { _PrintExit("CharLowerBuffA(%hs,) -> %x\n", a0, rv); }; return rv; } DWORD __stdcall Mine_CharLowerBuffW(LPWSTR a0, DWORD a1) { _PrintEnter("CharLowerBuffW(%ls,%p)\n", a0, a1); DWORD rv = 0; __try { rv = Real_CharLowerBuffW(a0, a1); } __finally { _PrintExit("CharLowerBuffW(%ls,) -> %x\n", a0, rv); }; return rv; } LPWSTR __stdcall Mine_CharLowerW(LPWSTR a0) { _PrintEnter("CharLowerW(%ls)\n", a0); LPWSTR rv = 0; __try { rv = Real_CharLowerW(a0); } __finally { _PrintExit("CharLowerW(%ls) -> %ls\n", a0, rv); }; return rv; } LPSTR __stdcall Mine_CharNextA(LPCSTR a0) { _PrintEnter("CharNextA(%hs)\n", a0); LPSTR rv = 0; __try { rv = Real_CharNextA(a0); } __finally { _PrintExit("CharNextA() -> %hs\n", rv); }; return rv; } LPSTR __stdcall Mine_CharNextExA(WORD a0, LPCSTR a1, DWORD a2) { _PrintEnter("CharNextExA(%p,%hs,%p)\n", a0, a1, a2); LPSTR rv = 0; __try { rv = Real_CharNextExA(a0, a1, a2); } __finally { _PrintExit("CharNextExA(,,) -> %hs\n", rv); }; return rv; } LPWSTR __stdcall Mine_CharNextW(LPCWSTR a0) { _PrintEnter("CharNextW(%ls)\n", a0); LPWSTR rv = 0; __try { rv = Real_CharNextW(a0); } __finally { _PrintExit("CharNextW() -> %ls\n", rv); }; return rv; } LPSTR __stdcall Mine_CharPrevA(LPCSTR a0, LPCSTR a1) { _PrintEnter("CharPrevA(%hs,%hs)\n", a0, a1); LPSTR rv = 0; __try { rv = Real_CharPrevA(a0, a1); } __finally { _PrintExit("CharPrevA(,) -> %hs\n", rv); }; return rv; } LPSTR __stdcall Mine_CharPrevExA(WORD a0, LPCSTR a1, LPCSTR a2, DWORD a3) { _PrintEnter("CharPrevExA(%p,%hs,%hs,%p)\n", a0, a1, a2, a3); LPSTR rv = 0; __try { rv = Real_CharPrevExA(a0, a1, a2, a3); } __finally { _PrintExit("CharPrevExA(,,,) -> %hs\n", rv); }; return rv; } LPWSTR __stdcall Mine_CharPrevW(LPCWSTR a0, LPCWSTR a1) { _PrintEnter("CharPrevW(%ls,%ls)\n", a0, a1); LPWSTR rv = 0; __try { rv = Real_CharPrevW(a0, a1); } __finally { _PrintExit("CharPrevW(,) -> %ls\n", rv); }; return rv; } BOOL __stdcall Mine_CharToOemA(LPCSTR a0, LPSTR a1) { _PrintEnter("CharToOemA(%hs,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_CharToOemA(a0, a1); } __finally { _PrintExit("CharToOemA(,%hs) -> %x\n", a1, rv); }; return rv; } BOOL __stdcall Mine_CharToOemBuffA(LPCSTR a0, LPSTR a1, DWORD a2) { _PrintEnter("CharToOemBuffA(%hs,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_CharToOemBuffA(a0, a1, a2); } __finally { _PrintExit("CharToOemBuffA(,%hs,) -> %x\n", a1, rv); }; return rv; } BOOL __stdcall Mine_CharToOemBuffW(LPCWSTR a0, LPSTR a1, DWORD a2) { _PrintEnter("CharToOemBuffW(%ls,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_CharToOemBuffW(a0, a1, a2); } __finally { _PrintExit("CharToOemBuffW(,%hs,) -> %x\n", a1, rv); }; return rv; } BOOL __stdcall Mine_CharToOemW(LPCWSTR a0, LPSTR a1) { _PrintEnter("CharToOemW(%ls,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_CharToOemW(a0, a1); } __finally { _PrintExit("CharToOemW(,%hs) -> %x\n", a1, rv); }; return rv; } LPSTR __stdcall Mine_CharUpperA(LPSTR a0) { _PrintEnter("CharUpperA(%hs)\n", a0); LPSTR rv = 0; __try { rv = Real_CharUpperA(a0); } __finally { _PrintExit("CharUpperA(%hs) -> %hs\n", a0, rv); }; return rv; } DWORD __stdcall Mine_CharUpperBuffA(LPSTR a0, DWORD a1) { _PrintEnter("CharUpperBuffA(%hs,%p)\n", a0, a1); DWORD rv = 0; __try { rv = Real_CharUpperBuffA(a0, a1); } __finally { _PrintExit("CharUpperBuffA(%hs,) -> %x\n", a0, rv); }; return rv; } DWORD __stdcall Mine_CharUpperBuffW(LPWSTR a0, DWORD a1) { _PrintEnter("CharUpperBuffW(%ls,%p)\n", a0, a1); DWORD rv = 0; __try { rv = Real_CharUpperBuffW(a0, a1); } __finally { _PrintExit("CharUpperBuffW(%ls,) -> %x\n", a0, rv); }; return rv; } LPWSTR __stdcall Mine_CharUpperW(LPWSTR a0) { _PrintEnter("CharUpperW(%ls)\n", a0); LPWSTR rv = 0; __try { rv = Real_CharUpperW(a0); } __finally { _PrintExit("CharUpperW(%ls) -> %ls\n", a0, rv); }; return rv; } BOOL __stdcall Mine_CheckColorsInGamut( HDC a0, #ifdef GDIPLUS_TS_QUERYVER LPRGBTRIPLE a1, #else LPVOID a1, #endif LPVOID a2, DWORD a3 ) { _PrintEnter("CheckColorsInGamut(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_CheckColorsInGamut(a0, a1, a2, a3); } __finally { _PrintExit("CheckColorsInGamut(,,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_CheckDlgButton(HWND a0, int a1, UINT a2) { _PrintEnter("CheckDlgButton(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_CheckDlgButton(a0, a1, a2); } __finally { _PrintExit("CheckDlgButton(,,) -> %x\n", rv); }; return rv; } DWORD __stdcall Mine_CheckMenuItem(HMENU a0, UINT a1, UINT a2) { _PrintEnter("CheckMenuItem(%p,%p,%p)\n", a0, a1, a2); DWORD rv = 0; __try { rv = Real_CheckMenuItem(a0, a1, a2); } __finally { _PrintExit("CheckMenuItem(,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_CheckMenuRadioItem(HMENU a0, UINT a1, UINT a2, UINT a3, UINT a4) { _PrintEnter("CheckMenuRadioItem(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_CheckMenuRadioItem(a0, a1, a2, a3, a4); } __finally { _PrintExit("CheckMenuRadioItem(,,,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_CheckRadioButton(HWND a0, int a1, int a2, int a3) { _PrintEnter("CheckRadioButton(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_CheckRadioButton(a0, a1, a2, a3); } __finally { _PrintExit("CheckRadioButton(,,,) -> %x\n", rv); }; return rv; } HWND __stdcall Mine_ChildWindowFromPoint(HWND a0, POINT a1) { _PrintEnter("ChildWindowFromPoint(%p,%p)\n", a0, a1); HWND rv = 0; __try { rv = Real_ChildWindowFromPoint(a0, a1); } __finally { _PrintExit("ChildWindowFromPoint(,) -> %p\n", rv); }; return rv; } HWND __stdcall Mine_ChildWindowFromPointEx(HWND a0, POINT a1, UINT a2) { _PrintEnter("ChildWindowFromPointEx(%p,%p,%p)\n", a0, a1, a2); HWND rv = 0; __try { rv = Real_ChildWindowFromPointEx(a0, a1, a2); } __finally { _PrintExit("ChildWindowFromPointEx(,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_ChoosePixelFormat(HDC a0, PIXELFORMATDESCRIPTOR* a1) { _PrintEnter("ChoosePixelFormat(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real_ChoosePixelFormat(a0, a1); } __finally { _PrintExit("ChoosePixelFormat(,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_Chord(HDC a0, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) { _PrintEnter("Chord(%p,%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8); BOOL rv = 0; __try { rv = Real_Chord(a0, a1, a2, a3, a4, a5, a6, a7, a8); } __finally { _PrintExit("Chord(,,,,,,,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_ClearCommBreak(HANDLE a0) { _PrintEnter("ClearCommBreak(%p)\n", a0); BOOL rv = 0; __try { rv = Real_ClearCommBreak(a0); } __finally { _PrintExit("ClearCommBreak() -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_ClearCommError(HANDLE a0, LPDWORD a1, LPCOMSTAT a2) { _PrintEnter("ClearCommError(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_ClearCommError(a0, a1, a2); } __finally { _PrintExit("ClearCommError(,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_ClientToScreen(HWND a0, POINT* a1) { _PrintEnter("ClientToScreen(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_ClientToScreen(a0, a1); } __finally { _PrintExit("ClientToScreen(,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_ClipCursor(RECT* a0) { _PrintEnter("ClipCursor(%p)\n", a0); BOOL rv = 0; __try { rv = Real_ClipCursor(a0); } __finally { _PrintExit("ClipCursor() -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_CloseClipboard(void) { _PrintEnter("CloseClipboard()\n"); BOOL rv = 0; __try { rv = Real_CloseClipboard(); } __finally { _PrintExit("CloseClipboard() -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_CloseDesktop(HDESK a0) { _PrintEnter("CloseDesktop(%p)\n", a0); BOOL rv = 0; __try { rv = Real_CloseDesktop(a0); } __finally { _PrintExit("CloseDesktop() -> %x\n", rv); }; return rv; } HENHMETAFILE __stdcall Mine_CloseEnhMetaFile(HDC a0) { _PrintEnter("CloseEnhMetaFile(%p)\n", a0); HENHMETAFILE rv = 0; __try { rv = Real_CloseEnhMetaFile(a0); } __finally { _PrintExit("CloseEnhMetaFile() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_CloseFigure(HDC a0) { _PrintEnter("CloseFigure(%p)\n", a0); BOOL rv = 0; __try { rv = Real_CloseFigure(a0); } __finally { _PrintExit("CloseFigure() -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_CloseHandle(HANDLE a0) { _PrintEnter("CloseHandle(%p)\n", a0); BOOL rv = 0; __try { rv = Real_CloseHandle(a0); } __finally { _PrintExit("CloseHandle() -> %x\n", rv); }; return rv; } HMETAFILE __stdcall Mine_CloseMetaFile(HDC a0) { _PrintEnter("CloseMetaFile(%p)\n", a0); HMETAFILE rv = 0; __try { rv = Real_CloseMetaFile(a0); } __finally { _PrintExit("CloseMetaFile() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_CloseWindow(HWND a0) { _PrintEnter("CloseWindow(%p)\n", a0); BOOL rv = 0; __try { rv = Real_CloseWindow(a0); } __finally { _PrintExit("CloseWindow() -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_CloseWindowStation(HWINSTA a0) { _PrintEnter("CloseWindowStation(%p)\n", a0); BOOL rv = 0; __try { rv = Real_CloseWindowStation(a0); } __finally { _PrintExit("CloseWindowStation() -> %x\n", rv); }; return rv; } ULONG __stdcall Mine_CoAddRefServerProcess(void) { _PrintEnter("CoAddRefServerProcess()\n"); ULONG rv = 0; __try { rv = Real_CoAddRefServerProcess(); } __finally { _PrintExit("CoAddRefServerProcess() -> %x\n", rv); }; return rv; } DWORD __stdcall Mine_CoBuildVersion(void) { _PrintEnter("CoBuildVersion()\n"); DWORD rv = 0; __try { rv = Real_CoBuildVersion(); } __finally { _PrintExit("CoBuildVersion() -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoCopyProxy(IUnknown* a0, IUnknown** a1) { _PrintEnter("CoCopyProxy(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_CoCopyProxy(a0, a1); } __finally { _PrintExit("CoCopyProxy(,) -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoCreateFreeThreadedMarshaler(LPUNKNOWN a0, LPUNKNOWN* a1) { _PrintEnter("CoCreateFreeThreadedMarshaler(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_CoCreateFreeThreadedMarshaler(a0, a1); } __finally { _PrintExit("CoCreateFreeThreadedMarshaler(,) -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoCreateGuid(GUID* a0) { _PrintEnter("CoCreateGuid(%p)\n", a0); HRESULT rv = 0; __try { rv = Real_CoCreateGuid(a0); } __finally { _PrintExit("CoCreateGuid() -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoCreateInstance(CONST IID& a0, LPUNKNOWN a1, DWORD a2, CONST IID& a3, LPVOID* a4) { _PrintEnter("CoCreateInstance(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); HRESULT rv = 0; __try { rv = Real_CoCreateInstance(a0, a1, a2, a3, a4); } __finally { _PrintExit("CoCreateInstance(,,,,) -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoCreateInstanceEx(CONST IID& a0, IUnknown* a1, DWORD a2, COSERVERINFO* a3, DWORD a4, MULTI_QI* a5) { _PrintEnter("CoCreateInstanceEx(%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); HRESULT rv = 0; __try { rv = Real_CoCreateInstanceEx(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("CoCreateInstanceEx(,,,,,) -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoDisconnectObject(LPUNKNOWN a0, DWORD a1) { _PrintEnter("CoDisconnectObject(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_CoDisconnectObject(a0, a1); } __finally { _PrintExit("CoDisconnectObject(,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_CoDosDateTimeToFileTime(WORD a0, WORD a1, FILETIME* a2) { _PrintEnter("CoDosDateTimeToFileTime(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_CoDosDateTimeToFileTime(a0, a1, a2); } __finally { _PrintExit("CoDosDateTimeToFileTime(,,) -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoFileTimeNow(FILETIME* a0) { _PrintEnter("CoFileTimeNow(%p)\n", a0); HRESULT rv = 0; __try { rv = Real_CoFileTimeNow(a0); } __finally { _PrintExit("CoFileTimeNow() -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_CoFileTimeToDosDateTime(FILETIME* a0, LPWORD a1, LPWORD a2) { _PrintEnter("CoFileTimeToDosDateTime(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_CoFileTimeToDosDateTime(a0, a1, a2); } __finally { _PrintExit("CoFileTimeToDosDateTime(,,) -> %x\n", rv); }; return rv; } void __stdcall Mine_CoFreeAllLibraries(void) { _PrintEnter("CoFreeAllLibraries()\n"); __try { Real_CoFreeAllLibraries(); } __finally { _PrintExit("CoFreeAllLibraries() ->\n"); }; } void __stdcall Mine_CoFreeLibrary(HINSTANCE a0) { _PrintEnter("CoFreeLibrary(%p)\n", a0); __try { Real_CoFreeLibrary(a0); } __finally { _PrintExit("CoFreeLibrary() ->\n"); }; } void __stdcall Mine_CoFreeUnusedLibraries(void) { _PrintEnter("CoFreeUnusedLibraries()\n"); __try { Real_CoFreeUnusedLibraries(); } __finally { _PrintExit("CoFreeUnusedLibraries() ->\n"); }; } HRESULT __stdcall Mine_CoGetCallContext(CONST IID& a0, void** a1) { _PrintEnter("CoGetCallContext(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_CoGetCallContext(a0, a1); } __finally { _PrintExit("CoGetCallContext(,) -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoGetClassObject(CONST IID& a0, DWORD a1, LPVOID a2, CONST IID& a3, LPVOID* a4) { _PrintEnter("CoGetClassObject(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); HRESULT rv = 0; __try { rv = Real_CoGetClassObject(a0, a1, a2, a3, a4); } __finally { _PrintExit("CoGetClassObject(,,,,) -> %x\n", rv); }; return rv; } DWORD __stdcall Mine_CoGetCurrentProcess(void) { _PrintEnter("CoGetCurrentProcess()\n"); DWORD rv = 0; __try { rv = Real_CoGetCurrentProcess(); } __finally { _PrintExit("CoGetCurrentProcess() -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoGetInstanceFromFile(COSERVERINFO* a0, CLSID* a1, IUnknown* a2, DWORD a3, DWORD a4, OLECHAR* a5, DWORD a6, MULTI_QI* a7) { _PrintEnter("CoGetInstanceFromFile(%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7); HRESULT rv = 0; __try { rv = Real_CoGetInstanceFromFile(a0, a1, a2, a3, a4, a5, a6, a7); } __finally { _PrintExit("CoGetInstanceFromFile(,,,,,,,) -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoGetInstanceFromIStorage(COSERVERINFO* a0, CLSID* a1, IUnknown* a2, DWORD a3, IStorage* a4, DWORD a5, MULTI_QI* a6) { _PrintEnter("CoGetInstanceFromIStorage(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); HRESULT rv = 0; __try { rv = Real_CoGetInstanceFromIStorage(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("CoGetInstanceFromIStorage(,,,,,,) -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoGetInterfaceAndReleaseStream(LPSTREAM a0, CONST IID& a1, LPVOID* a2) { _PrintEnter("CoGetInterfaceAndReleaseStream(%p,%p,%p)\n", a0, a1, a2); HRESULT rv = 0; __try { rv = Real_CoGetInterfaceAndReleaseStream(a0, a1, a2); } __finally { _PrintExit("CoGetInterfaceAndReleaseStream(,,) -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoGetMalloc(DWORD a0, IMalloc** a1) { _PrintEnter("CoGetMalloc(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_CoGetMalloc(a0, a1); } __finally { _PrintExit("CoGetMalloc(,) -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoGetMarshalSizeMax(ULONG* a0, CONST IID& a1, LPUNKNOWN a2, DWORD a3, LPVOID a4, DWORD a5) { _PrintEnter("CoGetMarshalSizeMax(%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); HRESULT rv = 0; __try { rv = Real_CoGetMarshalSizeMax(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("CoGetMarshalSizeMax(,,,,,) -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoGetObject(LPCWSTR a0, BIND_OPTS* a1, CONST IID& a2, void** a3) { _PrintEnter("CoGetObject(%p,%p,%p,%p)\n", a0, a1, a2, a3); HRESULT rv = 0; __try { rv = Real_CoGetObject(a0, a1, a2, a3); } __finally { _PrintExit("CoGetObject(,,,) -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoGetPSClsid(CONST IID& a0, CLSID* a1) { _PrintEnter("CoGetPSClsid(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_CoGetPSClsid(a0, a1); } __finally { _PrintExit("CoGetPSClsid(,) -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoGetStandardMarshal(CONST IID& a0, LPUNKNOWN a1, DWORD a2, LPVOID a3, DWORD a4, IMarshal** a5) { _PrintEnter("CoGetStandardMarshal(%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); HRESULT rv = 0; __try { rv = Real_CoGetStandardMarshal(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("CoGetStandardMarshal(,,,,,) -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoGetStdMarshalEx(LPUNKNOWN a0, DWORD a1, LPUNKNOWN* a2) { _PrintEnter("CoGetStdMarshalEx(%p,%p,%p)\n", a0, a1, a2); HRESULT rv = 0; __try { rv = Real_CoGetStdMarshalEx(a0, a1, a2); } __finally { _PrintExit("CoGetStdMarshalEx(,,) -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoGetTreatAsClass(CONST IID& a0, LPGUID a1) { _PrintEnter("CoGetTreatAsClass(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_CoGetTreatAsClass(a0, a1); } __finally { _PrintExit("CoGetTreatAsClass(,) -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoImpersonateClient(void) { _PrintEnter("CoImpersonateClient()\n"); HRESULT rv = 0; __try { rv = Real_CoImpersonateClient(); } __finally { _PrintExit("CoImpersonateClient() -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoInitialize(LPVOID a0) { _PrintEnter("CoInitialize(%p)\n", a0); HRESULT rv = 0; __try { rv = Real_CoInitialize(a0); } __finally { _PrintExit("CoInitialize() -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoInitializeEx(LPVOID a0, DWORD a1) { _PrintEnter("CoInitializeEx(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_CoInitializeEx(a0, a1); } __finally { _PrintExit("CoInitializeEx(,) -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoInitializeSecurity(PSECURITY_DESCRIPTOR a0, LONG a1, SOLE_AUTHENTICATION_SERVICE* a2, void* a3, DWORD a4, DWORD a5, void* a6, DWORD a7, void* a8) { _PrintEnter("CoInitializeSecurity(%p,%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8); HRESULT rv = 0; __try { rv = Real_CoInitializeSecurity(a0, a1, a2, a3, a4, a5, a6, a7, a8); } __finally { _PrintExit("CoInitializeSecurity(,,,,,,,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_CoIsHandlerConnected(LPUNKNOWN a0) { _PrintEnter("CoIsHandlerConnected(%p)\n", a0); BOOL rv = 0; __try { rv = Real_CoIsHandlerConnected(a0); } __finally { _PrintExit("CoIsHandlerConnected() -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_CoIsOle1Class(CONST IID& a0) { _PrintEnter("CoIsOle1Class(%p)\n", a0); BOOL rv = 0; __try { rv = Real_CoIsOle1Class(a0); } __finally { _PrintExit("CoIsOle1Class() -> %x\n", rv); }; return rv; } HINSTANCE __stdcall Mine_CoLoadLibrary(LPOLESTR a0, BOOL a1) { _PrintEnter("CoLoadLibrary(%p,%p)\n", a0, a1); HINSTANCE rv = 0; __try { rv = Real_CoLoadLibrary(a0, a1); } __finally { _PrintExit("CoLoadLibrary(,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_CoLockObjectExternal(LPUNKNOWN a0, BOOL a1, BOOL a2) { _PrintEnter("CoLockObjectExternal(%p,%p,%p)\n", a0, a1, a2); HRESULT rv = 0; __try { rv = Real_CoLockObjectExternal(a0, a1, a2); } __finally { _PrintExit("CoLockObjectExternal(,,) -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoMarshalHresult(LPSTREAM a0, HRESULT a1) { _PrintEnter("CoMarshalHresult(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_CoMarshalHresult(a0, a1); } __finally { _PrintExit("CoMarshalHresult(,) -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoMarshalInterThreadInterfaceInStream(CONST IID& a0, LPUNKNOWN a1, LPSTREAM* a2) { _PrintEnter("CoMarshalInterThreadInterfaceInStream(%p,%p,%p)\n", a0, a1, a2); HRESULT rv = 0; __try { rv = Real_CoMarshalInterThreadInterfaceInStream(a0, a1, a2); } __finally { _PrintExit("CoMarshalInterThreadInterfaceInStream(,,) -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoMarshalInterface(LPSTREAM a0, CONST IID& a1, LPUNKNOWN a2, DWORD a3, LPVOID a4, DWORD a5) { _PrintEnter("CoMarshalInterface(%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); HRESULT rv = 0; __try { rv = Real_CoMarshalInterface(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("CoMarshalInterface(,,,,,) -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoQueryAuthenticationServices(DWORD* a0, SOLE_AUTHENTICATION_SERVICE** a1) { _PrintEnter("CoQueryAuthenticationServices(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_CoQueryAuthenticationServices(a0, a1); } __finally { _PrintExit("CoQueryAuthenticationServices(,) -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoQueryClientBlanket(DWORD* a0, DWORD* a1, OLECHAR** a2, DWORD* a3, DWORD* a4, RPC_AUTHZ_HANDLE* a5, DWORD* a6) { _PrintEnter("CoQueryClientBlanket(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); HRESULT rv = 0; __try { rv = Real_CoQueryClientBlanket(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("CoQueryClientBlanket(,,,,,,) -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoQueryProxyBlanket(IUnknown* a0, DWORD* a1, DWORD* a2, OLECHAR** a3, DWORD* a4, DWORD* a5, RPC_AUTH_IDENTITY_HANDLE* a6, DWORD* a7) { _PrintEnter("CoQueryProxyBlanket(%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7); HRESULT rv = 0; __try { rv = Real_CoQueryProxyBlanket(a0, a1, a2, a3, a4, a5, a6, a7); } __finally { _PrintExit("CoQueryProxyBlanket(,,,,,,,) -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoRegisterChannelHook(CONST GUID& a0, IChannelHook* a1) { _PrintEnter("CoRegisterChannelHook(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_CoRegisterChannelHook(a0, a1); } __finally { _PrintExit("CoRegisterChannelHook(,) -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoRegisterClassObject(CONST IID& a0, LPUNKNOWN a1, DWORD a2, DWORD a3, LPDWORD a4) { _PrintEnter("CoRegisterClassObject(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); HRESULT rv = 0; __try { rv = Real_CoRegisterClassObject(a0, a1, a2, a3, a4); } __finally { _PrintExit("CoRegisterClassObject(,,,,) -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoRegisterMallocSpy(IMallocSpy* a0) { _PrintEnter("CoRegisterMallocSpy(%p)\n", a0); HRESULT rv = 0; __try { rv = Real_CoRegisterMallocSpy(a0); } __finally { _PrintExit("CoRegisterMallocSpy() -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoRegisterMessageFilter(LPMESSAGEFILTER a0, LPMESSAGEFILTER* a1) { _PrintEnter("CoRegisterMessageFilter(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_CoRegisterMessageFilter(a0, a1); } __finally { _PrintExit("CoRegisterMessageFilter(,) -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoRegisterPSClsid(CONST IID& a0, CONST IID& a1) { _PrintEnter("CoRegisterPSClsid(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_CoRegisterPSClsid(a0, a1); } __finally { _PrintExit("CoRegisterPSClsid(,) -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoRegisterSurrogate(LPSURROGATE a0) { _PrintEnter("CoRegisterSurrogate(%p)\n", a0); HRESULT rv = 0; __try { rv = Real_CoRegisterSurrogate(a0); } __finally { _PrintExit("CoRegisterSurrogate() -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoReleaseMarshalData(LPSTREAM a0) { _PrintEnter("CoReleaseMarshalData(%p)\n", a0); HRESULT rv = 0; __try { rv = Real_CoReleaseMarshalData(a0); } __finally { _PrintExit("CoReleaseMarshalData() -> %x\n", rv); }; return rv; } ULONG __stdcall Mine_CoReleaseServerProcess(void) { _PrintEnter("CoReleaseServerProcess()\n"); ULONG rv = 0; __try { rv = Real_CoReleaseServerProcess(); } __finally { _PrintExit("CoReleaseServerProcess() -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoResumeClassObjects(void) { _PrintEnter("CoResumeClassObjects()\n"); HRESULT rv = 0; __try { rv = Real_CoResumeClassObjects(); } __finally { _PrintExit("CoResumeClassObjects() -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoRevertToSelf(void) { _PrintEnter("CoRevertToSelf()\n"); HRESULT rv = 0; __try { rv = Real_CoRevertToSelf(); } __finally { _PrintExit("CoRevertToSelf() -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoRevokeClassObject(DWORD a0) { _PrintEnter("CoRevokeClassObject(%p)\n", a0); HRESULT rv = 0; __try { rv = Real_CoRevokeClassObject(a0); } __finally { _PrintExit("CoRevokeClassObject() -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoRevokeMallocSpy(void) { _PrintEnter("CoRevokeMallocSpy()\n"); HRESULT rv = 0; __try { rv = Real_CoRevokeMallocSpy(); } __finally { _PrintExit("CoRevokeMallocSpy() -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoSetProxyBlanket(IUnknown* a0, DWORD a1, DWORD a2, OLECHAR* a3, DWORD a4, DWORD a5, RPC_AUTH_IDENTITY_HANDLE a6, DWORD a7) { _PrintEnter("CoSetProxyBlanket(%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7); HRESULT rv = 0; __try { rv = Real_CoSetProxyBlanket(a0, a1, a2, a3, a4, a5, a6, a7); } __finally { _PrintExit("CoSetProxyBlanket(,,,,,,,) -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoSuspendClassObjects(void) { _PrintEnter("CoSuspendClassObjects()\n"); HRESULT rv = 0; __try { rv = Real_CoSuspendClassObjects(); } __finally { _PrintExit("CoSuspendClassObjects() -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoSwitchCallContext(IUnknown* a0, IUnknown** a1) { _PrintEnter("CoSwitchCallContext(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_CoSwitchCallContext(a0, a1); } __finally { _PrintExit("CoSwitchCallContext(,) -> %x\n", rv); }; return rv; } LPVOID __stdcall Mine_CoTaskMemAlloc(SIZE_T a0) { _PrintEnter("CoTaskMemAlloc(%p)\n", a0); LPVOID rv = 0; __try { rv = Real_CoTaskMemAlloc(a0); } __finally { _PrintExit("CoTaskMemAlloc() -> %p\n", rv); }; return rv; } void __stdcall Mine_CoTaskMemFree(LPVOID a0) { _PrintEnter("CoTaskMemFree(%p)\n", a0); __try { Real_CoTaskMemFree(a0); } __finally { _PrintExit("CoTaskMemFree() ->\n"); }; } LPVOID __stdcall Mine_CoTaskMemRealloc(LPVOID a0, SIZE_T a1) { _PrintEnter("CoTaskMemRealloc(%p,%p)\n", a0, a1); LPVOID rv = 0; __try { rv = Real_CoTaskMemRealloc(a0, a1); } __finally { _PrintExit("CoTaskMemRealloc(,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_CoTreatAsClass(CONST IID& a0, CONST IID& a1) { _PrintEnter("CoTreatAsClass(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_CoTreatAsClass(a0, a1); } __finally { _PrintExit("CoTreatAsClass(,) -> %x\n", rv); }; return rv; } void __stdcall Mine_CoUninitialize(void) { _PrintEnter("CoUninitialize()\n"); __try { Real_CoUninitialize(); } __finally { _PrintExit("CoUninitialize() ->\n"); }; } HRESULT __stdcall Mine_CoUnmarshalHresult(LPSTREAM a0, HRESULT* a1) { _PrintEnter("CoUnmarshalHresult(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_CoUnmarshalHresult(a0, a1); } __finally { _PrintExit("CoUnmarshalHresult(,) -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CoUnmarshalInterface(LPSTREAM a0, CONST IID& a1, LPVOID* a2) { _PrintEnter("CoUnmarshalInterface(%p,%p,%p)\n", a0, a1, a2); HRESULT rv = 0; __try { rv = Real_CoUnmarshalInterface(a0, a1, a2); } __finally { _PrintExit("CoUnmarshalInterface(,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_ColorMatchToTarget(HDC a0, HDC a1, DWORD a2) { _PrintEnter("ColorMatchToTarget(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_ColorMatchToTarget(a0, a1, a2); } __finally { _PrintExit("ColorMatchToTarget(,,) -> %x\n", rv); }; return rv; } int __stdcall Mine_CombineRgn(HRGN a0, HRGN a1, HRGN a2, int a3) { _PrintEnter("CombineRgn(%p,%p,%p,%p)\n", a0, a1, a2, a3); int rv = 0; __try { rv = Real_CombineRgn(a0, a1, a2, a3); } __finally { _PrintExit("CombineRgn(,,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_CombineTransform(XFORM* a0, XFORM* a1, XFORM* a2) { _PrintEnter("CombineTransform(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_CombineTransform(a0, a1, a2); } __finally { _PrintExit("CombineTransform(,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_CommConfigDialogA(LPCSTR a0, HWND a1, LPCOMMCONFIG a2) { _PrintEnter("CommConfigDialogA(%hs,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_CommConfigDialogA(a0, a1, a2); } __finally { _PrintExit("CommConfigDialogA(,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_CommConfigDialogW(LPCWSTR a0, HWND a1, LPCOMMCONFIG a2) { _PrintEnter("CommConfigDialogW(%ls,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_CommConfigDialogW(a0, a1, a2); } __finally { _PrintExit("CommConfigDialogW(,,) -> %x\n", rv); }; return rv; } LONG __stdcall Mine_CompareFileTime(FILETIME* a0, FILETIME* a1) { _PrintEnter("CompareFileTime(%p,%p)\n", a0, a1); LONG rv = 0; __try { rv = Real_CompareFileTime(a0, a1); } __finally { _PrintExit("CompareFileTime(,) -> %x\n", rv); }; return rv; } int __stdcall Mine_CompareStringA(LCID a0, DWORD a1, LPCSTR a2, int a3, LPCSTR a4, int a5) { _PrintEnter("CompareStringA(%p,%p,%hs,%p,%hs,%p)\n", a0, a1, a2, a3, a4, a5); int rv = 0; __try { rv = Real_CompareStringA(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("CompareStringA(,,,,,) -> %x\n", rv); }; return rv; } int __stdcall Mine_CompareStringW(LCID a0, DWORD a1, LPCWSTR a2, int a3, LPCWSTR a4, int a5) { _PrintEnter("CompareStringW(%p,%p,%ls,%p,%ls,%p)\n", a0, a1, a2, a3, a4, a5); int rv = 0; __try { rv = Real_CompareStringW(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("CompareStringW(,,,,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_ConnectNamedPipe(HANDLE a0, LPOVERLAPPED a1) { _PrintEnter("ConnectNamedPipe(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_ConnectNamedPipe(a0, a1); } __finally { _PrintExit("ConnectNamedPipe(,) -> %x\n", rv); }; return rv; } #if !defined(DETOURS_ARM) BOOL __stdcall Mine_ContinueDebugEvent(DWORD a0, DWORD a1, DWORD a2) { _PrintEnter("ContinueDebugEvent(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_ContinueDebugEvent(a0, a1, a2); } __finally { _PrintExit("ContinueDebugEvent(,,) -> %x\n", rv); }; return rv; } #endif // !DETOURS_ARM LCID __stdcall Mine_ConvertDefaultLocale(LCID a0) { _PrintEnter("ConvertDefaultLocale(%p)\n", a0); LCID rv = 0; __try { rv = Real_ConvertDefaultLocale(a0); } __finally { _PrintExit("ConvertDefaultLocale() -> %x\n", rv); }; return rv; } LPVOID __stdcall Mine_ConvertThreadToFiber(LPVOID a0) { _PrintEnter("ConvertThreadToFiber(%p)\n", a0); LPVOID rv = 0; __try { rv = Real_ConvertThreadToFiber(a0); } __finally { _PrintExit("ConvertThreadToFiber() -> %p\n", rv); }; return rv; } int __stdcall Mine_CopyAcceleratorTableA(HACCEL a0, ACCEL* a1, int a2) { _PrintEnter("CopyAcceleratorTableA(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_CopyAcceleratorTableA(a0, a1, a2); } __finally { _PrintExit("CopyAcceleratorTableA(,,) -> %x\n", rv); }; return rv; } int __stdcall Mine_CopyAcceleratorTableW(HACCEL a0, ACCEL* a1, int a2) { _PrintEnter("CopyAcceleratorTableW(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_CopyAcceleratorTableW(a0, a1, a2); } __finally { _PrintExit("CopyAcceleratorTableW(,,) -> %x\n", rv); }; return rv; } HENHMETAFILE __stdcall Mine_CopyEnhMetaFileA(HENHMETAFILE a0, LPCSTR a1) { _PrintEnter("CopyEnhMetaFileA(%p,%hs)\n", a0, a1); HENHMETAFILE rv = 0; __try { rv = Real_CopyEnhMetaFileA(a0, a1); } __finally { _PrintExit("CopyEnhMetaFileA(,) -> %p\n", rv); }; return rv; } HENHMETAFILE __stdcall Mine_CopyEnhMetaFileW(HENHMETAFILE a0, LPCWSTR a1) { _PrintEnter("CopyEnhMetaFileW(%p,%ls)\n", a0, a1); HENHMETAFILE rv = 0; __try { rv = Real_CopyEnhMetaFileW(a0, a1); } __finally { _PrintExit("CopyEnhMetaFileW(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_CopyFileA(LPCSTR a0, LPCSTR a1, BOOL a2) { _PrintEnter("CopyFileA(%hs,%hs,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_CopyFileA(a0, a1, a2); } __finally { _PrintExit("CopyFileA(,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_CopyFileExA(LPCSTR a0, LPCSTR a1, LPPROGRESS_ROUTINE a2, LPVOID a3, LPBOOL a4, DWORD a5) { _PrintEnter("CopyFileExA(%hs,%hs,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); BOOL rv = 0; __try { rv = Real_CopyFileExA(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("CopyFileExA(,,,,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_CopyFileExW(LPCWSTR a0, LPCWSTR a1, LPPROGRESS_ROUTINE a2, LPVOID a3, LPBOOL a4, DWORD a5) { _PrintEnter("CopyFileExW(%ls,%ls,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); BOOL rv = 0; __try { rv = Real_CopyFileExW(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("CopyFileExW(,,,,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_CopyFileW(LPCWSTR a0, LPCWSTR a1, BOOL a2) { _PrintEnter("CopyFileW(%ls,%ls,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_CopyFileW(a0, a1, a2); } __finally { _PrintExit("CopyFileW(,,) -> %x\n", rv); }; return rv; } HICON __stdcall Mine_CopyIcon(HICON a0) { _PrintEnter("CopyIcon(%p)\n", a0); HICON rv = 0; __try { rv = Real_CopyIcon(a0); } __finally { _PrintExit("CopyIcon() -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_CopyImage(HANDLE a0, UINT a1, int a2, int a3, UINT a4) { _PrintEnter("CopyImage(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); HANDLE rv = 0; __try { rv = Real_CopyImage(a0, a1, a2, a3, a4); } __finally { _PrintExit("CopyImage(,,,,) -> %p\n", rv); }; return rv; } HMETAFILE __stdcall Mine_CopyMetaFileA(HMETAFILE a0, LPCSTR a1) { _PrintEnter("CopyMetaFileA(%p,%hs)\n", a0, a1); HMETAFILE rv = 0; __try { rv = Real_CopyMetaFileA(a0, a1); } __finally { _PrintExit("CopyMetaFileA(,) -> %p\n", rv); }; return rv; } HMETAFILE __stdcall Mine_CopyMetaFileW(HMETAFILE a0, LPCWSTR a1) { _PrintEnter("CopyMetaFileW(%p,%ls)\n", a0, a1); HMETAFILE rv = 0; __try { rv = Real_CopyMetaFileW(a0, a1); } __finally { _PrintExit("CopyMetaFileW(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_CopyRect(LPRECT a0, RECT* a1) { _PrintEnter("CopyRect(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_CopyRect(a0, a1); } __finally { _PrintExit("CopyRect(,) -> %x\n", rv); }; return rv; } int __stdcall Mine_CountClipboardFormats(void) { _PrintEnter("CountClipboardFormats()\n"); int rv = 0; __try { rv = Real_CountClipboardFormats(); } __finally { _PrintExit("CountClipboardFormats() -> %x\n", rv); }; return rv; } HACCEL __stdcall Mine_CreateAcceleratorTableA(ACCEL* a0, int a1) { _PrintEnter("CreateAcceleratorTableA(%p,%p)\n", a0, a1); HACCEL rv = 0; __try { rv = Real_CreateAcceleratorTableA(a0, a1); } __finally { _PrintExit("CreateAcceleratorTableA(,) -> %p\n", rv); }; return rv; } HACCEL __stdcall Mine_CreateAcceleratorTableW(ACCEL* a0, int a1) { _PrintEnter("CreateAcceleratorTableW(%p,%p)\n", a0, a1); HACCEL rv = 0; __try { rv = Real_CreateAcceleratorTableW(a0, a1); } __finally { _PrintExit("CreateAcceleratorTableW(,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_CreateAntiMoniker(IMoniker** a0) { _PrintEnter("CreateAntiMoniker(%p)\n", a0); HRESULT rv = 0; __try { rv = Real_CreateAntiMoniker(a0); } __finally { _PrintExit("CreateAntiMoniker() -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CreateBindCtx(DWORD a0, IBindCtx** a1) { _PrintEnter("CreateBindCtx(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_CreateBindCtx(a0, a1); } __finally { _PrintExit("CreateBindCtx(,) -> %x\n", rv); }; return rv; } HBITMAP __stdcall Mine_CreateBitmap(int a0, int a1, UINT a2, UINT a3, void* a4) { _PrintEnter("CreateBitmap(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); HBITMAP rv = 0; __try { rv = Real_CreateBitmap(a0, a1, a2, a3, a4); } __finally { _PrintExit("CreateBitmap(,,,,) -> %p\n", rv); }; return rv; } HBITMAP __stdcall Mine_CreateBitmapIndirect(BITMAP* a0) { _PrintEnter("CreateBitmapIndirect(%p)\n", a0); HBITMAP rv = 0; __try { rv = Real_CreateBitmapIndirect(a0); } __finally { _PrintExit("CreateBitmapIndirect() -> %p\n", rv); }; return rv; } HBRUSH __stdcall Mine_CreateBrushIndirect(LOGBRUSH* a0) { _PrintEnter("CreateBrushIndirect(%p)\n", a0); HBRUSH rv = 0; __try { rv = Real_CreateBrushIndirect(a0); } __finally { _PrintExit("CreateBrushIndirect() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_CreateCaret(HWND a0, HBITMAP a1, int a2, int a3) { _PrintEnter("CreateCaret(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_CreateCaret(a0, a1, a2, a3); } __finally { _PrintExit("CreateCaret(,,,) -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CreateClassMoniker(CONST IID& a0, IMoniker** a1) { _PrintEnter("CreateClassMoniker(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_CreateClassMoniker(a0, a1); } __finally { _PrintExit("CreateClassMoniker(,) -> %x\n", rv); }; return rv; } HCOLORSPACE __stdcall Mine_CreateColorSpaceA(LOGCOLORSPACEA* a0) { _PrintEnter("CreateColorSpaceA(%p)\n", a0); HCOLORSPACE rv = 0; __try { rv = Real_CreateColorSpaceA(a0); } __finally { _PrintExit("CreateColorSpaceA() -> %p\n", rv); }; return rv; } HCOLORSPACE __stdcall Mine_CreateColorSpaceW(LOGCOLORSPACEW* a0) { _PrintEnter("CreateColorSpaceW(%p)\n", a0); HCOLORSPACE rv = 0; __try { rv = Real_CreateColorSpaceW(a0); } __finally { _PrintExit("CreateColorSpaceW() -> %p\n", rv); }; return rv; } HBITMAP __stdcall Mine_CreateCompatibleBitmap(HDC a0, int a1, int a2) { _PrintEnter("CreateCompatibleBitmap(%p,%p,%p)\n", a0, a1, a2); HBITMAP rv = 0; __try { rv = Real_CreateCompatibleBitmap(a0, a1, a2); } __finally { _PrintExit("CreateCompatibleBitmap(,,) -> %p\n", rv); }; return rv; } HDC __stdcall Mine_CreateCompatibleDC(HDC a0) { _PrintEnter("CreateCompatibleDC(%p)\n", a0); HDC rv = 0; __try { rv = Real_CreateCompatibleDC(a0); } __finally { _PrintExit("CreateCompatibleDC() -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_CreateConsoleScreenBuffer(DWORD a0, DWORD a1, SECURITY_ATTRIBUTES* a2, DWORD a3, LPVOID a4) { _PrintEnter("CreateConsoleScreenBuffer(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); HANDLE rv = 0; __try { rv = Real_CreateConsoleScreenBuffer(a0, a1, a2, a3, a4); } __finally { _PrintExit("CreateConsoleScreenBuffer(,,,,) -> %p\n", rv); }; return rv; } HCURSOR __stdcall Mine_CreateCursor(HINSTANCE a0, int a1, int a2, int a3, int a4, void* a5, void* a6) { _PrintEnter("CreateCursor(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); HCURSOR rv = 0; __try { rv = Real_CreateCursor(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("CreateCursor(,,,,,,) -> %p\n", rv); }; return rv; } HDC __stdcall Mine_CreateDCA(LPCSTR a0, LPCSTR a1, LPCSTR a2, CONST DEVMODEA* a3) { _PrintEnter("CreateDCA(%hs,%hs,%hs,%p)\n", a0, a1, a2, a3); HDC rv = 0; __try { rv = Real_CreateDCA(a0, a1, a2, a3); } __finally { _PrintExit("CreateDCA(,,,) -> %p\n", rv); }; return rv; } HDC __stdcall Mine_CreateDCW(LPCWSTR a0, LPCWSTR a1, LPCWSTR a2, CONST DEVMODEW* a3) { _PrintEnter("CreateDCW(%ls,%ls,%ls,%p)\n", a0, a1, a2, a3); HDC rv = 0; __try { rv = Real_CreateDCW(a0, a1, a2, a3); } __finally { _PrintExit("CreateDCW(,,,) -> %p\n", rv); }; return rv; } HBRUSH __stdcall Mine_CreateDIBPatternBrush(HGLOBAL a0, UINT a1) { _PrintEnter("CreateDIBPatternBrush(%p,%p)\n", a0, a1); HBRUSH rv = 0; __try { rv = Real_CreateDIBPatternBrush(a0, a1); } __finally { _PrintExit("CreateDIBPatternBrush(,) -> %p\n", rv); }; return rv; } HBRUSH __stdcall Mine_CreateDIBPatternBrushPt(void* a0, UINT a1) { _PrintEnter("CreateDIBPatternBrushPt(%p,%p)\n", a0, a1); HBRUSH rv = 0; __try { rv = Real_CreateDIBPatternBrushPt(a0, a1); } __finally { _PrintExit("CreateDIBPatternBrushPt(,) -> %p\n", rv); }; return rv; } HBITMAP __stdcall Mine_CreateDIBSection(HDC a0, BITMAPINFO* a1, UINT a2, void** a3, HANDLE a4, DWORD a5) { _PrintEnter("CreateDIBSection(%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); HBITMAP rv = 0; __try { rv = Real_CreateDIBSection(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("CreateDIBSection(,,,,,) -> %p\n", rv); }; return rv; } HBITMAP __stdcall Mine_CreateDIBitmap(HDC a0, BITMAPINFOHEADER* a1, DWORD a2, void* a3, BITMAPINFO* a4, UINT a5) { _PrintEnter("CreateDIBitmap(%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); HBITMAP rv = 0; __try { rv = Real_CreateDIBitmap(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("CreateDIBitmap(,,,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_CreateDataAdviseHolder(LPDATAADVISEHOLDER* a0) { _PrintEnter("CreateDataAdviseHolder(%p)\n", a0); HRESULT rv = 0; __try { rv = Real_CreateDataAdviseHolder(a0); } __finally { _PrintExit("CreateDataAdviseHolder() -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CreateDataCache(LPUNKNOWN a0, CONST IID& a1, CONST IID& a2, LPVOID* a3) { _PrintEnter("CreateDataCache(%p,%p,%p,%p)\n", a0, a1, a2, a3); HRESULT rv = 0; __try { rv = Real_CreateDataCache(a0, a1, a2, a3); } __finally { _PrintExit("CreateDataCache(,,,) -> %x\n", rv); }; return rv; } #if _MSC_VER < 1300 HDESK __stdcall Mine_CreateDesktopA(LPSTR a0, LPSTR a1, LPDEVMODEA a2, DWORD a3, ACCESS_MASK a4, LPSECURITY_ATTRIBUTES a5) #else HDESK __stdcall Mine_CreateDesktopA(LPCSTR a0, LPCSTR a1, LPDEVMODEA a2, DWORD a3, ACCESS_MASK a4, LPSECURITY_ATTRIBUTES a5) #endif { _PrintEnter("CreateDesktopA(%hs,%hs,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); HDESK rv = 0; __try { rv = Real_CreateDesktopA(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("CreateDesktopA(,,,,,) -> %p\n", rv); }; return rv; } #if _MSC_VER < 1300 HDESK __stdcall Mine_CreateDesktopW(LPWSTR a0, // NT 3.51 and older. NT4? LPWSTR a1, // NT 3.51 and older. NT4? LPDEVMODEW a2, DWORD a3, ACCESS_MASK a4, LPSECURITY_ATTRIBUTES a5) #else HDESK __stdcall Mine_CreateDesktopW(LPCWSTR a0, // Windows 2000 and newer; NT4? LPCWSTR a1, // Windows 2000 and newer; NT4? LPDEVMODEW a2, DWORD a3, ACCESS_MASK a4, LPSECURITY_ATTRIBUTES a5) #endif { _PrintEnter("CreateDesktopW(%ls,%ls,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); HDESK rv = 0; __try { rv = Real_CreateDesktopW(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("CreateDesktopW(,,,,,) -> %p\n", rv); }; return rv; } HWND __stdcall Mine_CreateDialogIndirectParamA(HINSTANCE a0, LPCDLGTEMPLATEA a1, HWND a2, DLGPROC a3, LPARAM a4) { _PrintEnter("CreateDialogIndirectParamA(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); HWND rv = 0; __try { rv = Real_CreateDialogIndirectParamA(a0, a1, a2, a3, a4); } __finally { _PrintExit("CreateDialogIndirectParamA(,,,,) -> %p\n", rv); }; return rv; } HWND __stdcall Mine_CreateDialogIndirectParamW(HINSTANCE a0, LPCDLGTEMPLATEW a1, HWND a2, DLGPROC a3, LPARAM a4) { _PrintEnter("CreateDialogIndirectParamW(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); HWND rv = 0; __try { rv = Real_CreateDialogIndirectParamW(a0, a1, a2, a3, a4); } __finally { _PrintExit("CreateDialogIndirectParamW(,,,,) -> %p\n", rv); }; return rv; } HWND __stdcall Mine_CreateDialogParamA(HINSTANCE a0, LPCSTR a1, HWND a2, DLGPROC a3, LPARAM a4) { _PrintEnter("CreateDialogParamA(%p,%hs,%p,%p,%p)\n", a0, a1, a2, a3, a4); HWND rv = 0; __try { rv = Real_CreateDialogParamA(a0, a1, a2, a3, a4); } __finally { _PrintExit("CreateDialogParamA(,,,,) -> %p\n", rv); }; return rv; } HWND __stdcall Mine_CreateDialogParamW(HINSTANCE a0, LPCWSTR a1, HWND a2, DLGPROC a3, LPARAM a4) { _PrintEnter("CreateDialogParamW(%p,%ls,%p,%p,%p)\n", a0, a1, a2, a3, a4); HWND rv = 0; __try { rv = Real_CreateDialogParamW(a0, a1, a2, a3, a4); } __finally { _PrintExit("CreateDialogParamW(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_CreateDirectoryA(LPCSTR a0, LPSECURITY_ATTRIBUTES a1) { _PrintEnter("CreateDirectoryA(%hs,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_CreateDirectoryA(a0, a1); } __finally { _PrintExit("CreateDirectoryA(,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_CreateDirectoryExA(LPCSTR a0, LPCSTR a1, LPSECURITY_ATTRIBUTES a2) { _PrintEnter("CreateDirectoryExA(%hs,%hs,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_CreateDirectoryExA(a0, a1, a2); } __finally { _PrintExit("CreateDirectoryExA(,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_CreateDirectoryExW(LPCWSTR a0, LPCWSTR a1, LPSECURITY_ATTRIBUTES a2) { _PrintEnter("CreateDirectoryExW(%ls,%ls,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_CreateDirectoryExW(a0, a1, a2); } __finally { _PrintExit("CreateDirectoryExW(,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_CreateDirectoryW(LPCWSTR a0, LPSECURITY_ATTRIBUTES a1) { _PrintEnter("CreateDirectoryW(%ls,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_CreateDirectoryW(a0, a1); } __finally { _PrintExit("CreateDirectoryW(,) -> %x\n", rv); }; return rv; } HBITMAP __stdcall Mine_CreateDiscardableBitmap(HDC a0, int a1, int a2) { _PrintEnter("CreateDiscardableBitmap(%p,%p,%p)\n", a0, a1, a2); HBITMAP rv = 0; __try { rv = Real_CreateDiscardableBitmap(a0, a1, a2); } __finally { _PrintExit("CreateDiscardableBitmap(,,) -> %p\n", rv); }; return rv; } HRGN __stdcall Mine_CreateEllipticRgn(int a0, int a1, int a2, int a3) { _PrintEnter("CreateEllipticRgn(%p,%p,%p,%p)\n", a0, a1, a2, a3); HRGN rv = 0; __try { rv = Real_CreateEllipticRgn(a0, a1, a2, a3); } __finally { _PrintExit("CreateEllipticRgn(,,,) -> %p\n", rv); }; return rv; } HRGN __stdcall Mine_CreateEllipticRgnIndirect(RECT* a0) { _PrintEnter("CreateEllipticRgnIndirect(%p)\n", a0); HRGN rv = 0; __try { rv = Real_CreateEllipticRgnIndirect(a0); } __finally { _PrintExit("CreateEllipticRgnIndirect() -> %p\n", rv); }; return rv; } HDC __stdcall Mine_CreateEnhMetaFileA(HDC a0, LPCSTR a1, RECT* a2, LPCSTR a3) { _PrintEnter("CreateEnhMetaFileA(%p,%hs,%p,%hs)\n", a0, a1, a2, a3); HDC rv = 0; __try { rv = Real_CreateEnhMetaFileA(a0, a1, a2, a3); } __finally { _PrintExit("CreateEnhMetaFileA(,,,) -> %p\n", rv); }; return rv; } HDC __stdcall Mine_CreateEnhMetaFileW(HDC a0, LPCWSTR a1, RECT* a2, LPCWSTR a3) { _PrintEnter("CreateEnhMetaFileW(%p,%ls,%p,%ls)\n", a0, a1, a2, a3); HDC rv = 0; __try { rv = Real_CreateEnhMetaFileW(a0, a1, a2, a3); } __finally { _PrintExit("CreateEnhMetaFileW(,,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_CreateEventA(LPSECURITY_ATTRIBUTES a0, BOOL a1, BOOL a2, LPCSTR a3) { _PrintEnter("CreateEventA(%p,%p,%p,%hs)\n", a0, a1, a2, a3); HANDLE rv = 0; __try { rv = Real_CreateEventA(a0, a1, a2, a3); } __finally { _PrintExit("CreateEventA(,,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_CreateEventW(LPSECURITY_ATTRIBUTES a0, BOOL a1, BOOL a2, LPCWSTR a3) { _PrintEnter("CreateEventW(%p,%p,%p,%ls)\n", a0, a1, a2, a3); HANDLE rv = 0; __try { rv = Real_CreateEventW(a0, a1, a2, a3); } __finally { _PrintExit("CreateEventW(,,,) -> %p\n", rv); }; return rv; } LPVOID __stdcall Mine_CreateFiber(ULONG_PTR a0, LPFIBER_START_ROUTINE a1, LPVOID a2) { _PrintEnter("CreateFiber(%p,%p,%p)\n", a0, a1, a2); LPVOID rv = 0; __try { rv = Real_CreateFiber(a0, a1, a2); } __finally { _PrintExit("CreateFiber(,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_CreateFileA(LPCSTR a0, DWORD a1, DWORD a2, LPSECURITY_ATTRIBUTES a3, DWORD a4, DWORD a5, HANDLE a6) { _PrintEnter("CreateFileA(%hs,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); HANDLE rv = 0; __try { rv = Real_CreateFileA(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("CreateFileA(,,,,,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_CreateFileMappingA(HANDLE a0, LPSECURITY_ATTRIBUTES a1, DWORD a2, DWORD a3, DWORD a4, LPCSTR a5) { _PrintEnter("CreateFileMappingA(%p,%p,%p,%p,%p,%hs)\n", a0, a1, a2, a3, a4, a5); HANDLE rv = 0; __try { rv = Real_CreateFileMappingA(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("CreateFileMappingA(,,,,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_CreateFileMappingW(HANDLE a0, LPSECURITY_ATTRIBUTES a1, DWORD a2, DWORD a3, DWORD a4, LPCWSTR a5) { _PrintEnter("CreateFileMappingW(%p,%p,%p,%p,%p,%ls)\n", a0, a1, a2, a3, a4, a5); HANDLE rv = 0; __try { rv = Real_CreateFileMappingW(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("CreateFileMappingW(,,,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_CreateFileMoniker(LPCOLESTR a0, IMoniker** a1) { _PrintEnter("CreateFileMoniker(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_CreateFileMoniker(a0, a1); } __finally { _PrintExit("CreateFileMoniker(,) -> %x\n", rv); }; return rv; } HANDLE __stdcall Mine_CreateFileW(LPCWSTR a0, DWORD a1, DWORD a2, LPSECURITY_ATTRIBUTES a3, DWORD a4, DWORD a5, HANDLE a6) { _PrintEnter("CreateFileW(%ls,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); HANDLE rv = 0; __try { rv = Real_CreateFileW(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("CreateFileW(,,,,,,) -> %p\n", rv); }; return rv; } HFONT __stdcall Mine_CreateFontA(int a0, int a1, int a2, int a3, int a4, DWORD a5, DWORD a6, DWORD a7, DWORD a8, DWORD a9, DWORD a10, DWORD a11, DWORD a12, LPCSTR a13) { _PrintEnter("CreateFontA(%p,%p,%p,%p,%p,%p,%p,%p,%p,%p,%p,%p,%p,%hs)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); HFONT rv = 0; __try { rv = Real_CreateFontA(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); } __finally { _PrintExit("CreateFontA(,,,,,,,,,,,,,) -> %p\n", rv); }; return rv; } HFONT __stdcall Mine_CreateFontIndirectA(LOGFONTA* a0) { _PrintEnter("CreateFontIndirectA(%p)\n", a0); HFONT rv = 0; __try { rv = Real_CreateFontIndirectA(a0); } __finally { _PrintExit("CreateFontIndirectA() -> %p\n", rv); }; return rv; } HFONT __stdcall Mine_CreateFontIndirectW(LOGFONTW* a0) { _PrintEnter("CreateFontIndirectW(%p)\n", a0); HFONT rv = 0; __try { rv = Real_CreateFontIndirectW(a0); } __finally { _PrintExit("CreateFontIndirectW() -> %p\n", rv); }; return rv; } HFONT __stdcall Mine_CreateFontW(int a0, int a1, int a2, int a3, int a4, DWORD a5, DWORD a6, DWORD a7, DWORD a8, DWORD a9, DWORD a10, DWORD a11, DWORD a12, LPCWSTR a13) { _PrintEnter("CreateFontW(%p,%p,%p,%p,%p,%p,%p,%p,%p,%p,%p,%p,%p,%ls)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); HFONT rv = 0; __try { rv = Real_CreateFontW(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); } __finally { _PrintExit("CreateFontW(,,,,,,,,,,,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_CreateGenericComposite(IMoniker* a0, IMoniker* a1, IMoniker** a2) { _PrintEnter("CreateGenericComposite(%p,%p,%p)\n", a0, a1, a2); HRESULT rv = 0; __try { rv = Real_CreateGenericComposite(a0, a1, a2); } __finally { _PrintExit("CreateGenericComposite(,,) -> %x\n", rv); }; return rv; } HPALETTE __stdcall Mine_CreateHalftonePalette(HDC a0) { _PrintEnter("CreateHalftonePalette(%p)\n", a0); HPALETTE rv = 0; __try { rv = Real_CreateHalftonePalette(a0); } __finally { _PrintExit("CreateHalftonePalette() -> %p\n", rv); }; return rv; } HBRUSH __stdcall Mine_CreateHatchBrush(int a0, COLORREF a1) { _PrintEnter("CreateHatchBrush(%p,%p)\n", a0, a1); HBRUSH rv = 0; __try { rv = Real_CreateHatchBrush(a0, a1); } __finally { _PrintExit("CreateHatchBrush(,) -> %p\n", rv); }; return rv; } HDC __stdcall Mine_CreateICA(LPCSTR a0, LPCSTR a1, LPCSTR a2, CONST DEVMODEA* a3) { _PrintEnter("CreateICA(%hs,%hs,%hs,%p)\n", a0, a1, a2, a3); HDC rv = 0; __try { rv = Real_CreateICA(a0, a1, a2, a3); } __finally { _PrintExit("CreateICA(,,,) -> %p\n", rv); }; return rv; } HDC __stdcall Mine_CreateICW(LPCWSTR a0, LPCWSTR a1, LPCWSTR a2, CONST DEVMODEW* a3) { _PrintEnter("CreateICW(%ls,%ls,%ls,%p)\n", a0, a1, a2, a3); HDC rv = 0; __try { rv = Real_CreateICW(a0, a1, a2, a3); } __finally { _PrintExit("CreateICW(,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_CreateILockBytesOnHGlobal(HGLOBAL a0, BOOL a1, ILockBytes** a2) { _PrintEnter("CreateILockBytesOnHGlobal(%p,%p,%p)\n", a0, a1, a2); HRESULT rv = 0; __try { rv = Real_CreateILockBytesOnHGlobal(a0, a1, a2); } __finally { _PrintExit("CreateILockBytesOnHGlobal(,,) -> %x\n", rv); }; return rv; } HICON __stdcall Mine_CreateIcon(HINSTANCE a0, int a1, int a2, BYTE a3, BYTE a4, BYTE* a5, BYTE* a6) { _PrintEnter("CreateIcon(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); HICON rv = 0; __try { rv = Real_CreateIcon(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("CreateIcon(,,,,,,) -> %p\n", rv); }; return rv; } HICON __stdcall Mine_CreateIconFromResource(PBYTE a0, DWORD a1, BOOL a2, DWORD a3) { _PrintEnter("CreateIconFromResource(%p,%p,%p,%p)\n", a0, a1, a2, a3); HICON rv = 0; __try { rv = Real_CreateIconFromResource(a0, a1, a2, a3); } __finally { _PrintExit("CreateIconFromResource(,,,) -> %p\n", rv); }; return rv; } HICON __stdcall Mine_CreateIconFromResourceEx(PBYTE a0, DWORD a1, BOOL a2, DWORD a3, int a4, int a5, UINT a6) { _PrintEnter("CreateIconFromResourceEx(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); HICON rv = 0; __try { rv = Real_CreateIconFromResourceEx(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("CreateIconFromResourceEx(,,,,,,) -> %p\n", rv); }; return rv; } HICON __stdcall Mine_CreateIconIndirect(PICONINFO a0) { _PrintEnter("CreateIconIndirect(%p)\n", a0); HICON rv = 0; __try { rv = Real_CreateIconIndirect(a0); } __finally { _PrintExit("CreateIconIndirect() -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_CreateIoCompletionPort(HANDLE a0, HANDLE a1, ULONG_PTR a2, DWORD a3) { _PrintEnter("CreateIoCompletionPort(%p,%p,%p,%p)\n", a0, a1, a2, a3); HANDLE rv = 0; __try { rv = Real_CreateIoCompletionPort(a0, a1, a2, a3); } __finally { _PrintExit("CreateIoCompletionPort(,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_CreateItemMoniker(LPCOLESTR a0, LPCOLESTR a1, IMoniker** a2) { _PrintEnter("CreateItemMoniker(%p,%p,%p)\n", a0, a1, a2); HRESULT rv = 0; __try { rv = Real_CreateItemMoniker(a0, a1, a2); } __finally { _PrintExit("CreateItemMoniker(,,) -> %x\n", rv); }; return rv; } #if _MSC_VER < 1300 HWND __stdcall Mine_CreateMDIWindowA(LPSTR a0, // NT 3.51 and older. NT4? LPSTR a1, // NT 3.51 and older. NT4? DWORD a2, int a3, int a4, int a5, int a6, HWND a7, HINSTANCE a8, LPARAM a9) #else HWND __stdcall Mine_CreateMDIWindowA(LPCSTR a0, // Windows 2000 and newer; NT4? LPCSTR a1, // Windows 2000 and newer; NT4? DWORD a2, int a3, int a4, int a5, int a6, HWND a7, HINSTANCE a8, LPARAM a9) #endif { _PrintEnter("CreateMDIWindowA(%hs,%hs,%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); HWND rv = 0; __try { rv = Real_CreateMDIWindowA(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } __finally { _PrintExit("CreateMDIWindowA(,,,,,,,,,) -> %p\n", rv); }; return rv; } #if _MSC_VER < 1300 HWND __stdcall Mine_CreateMDIWindowW(LPWSTR a0, LPWSTR a1, DWORD a2, int a3, int a4, int a5, int a6, HWND a7, HINSTANCE a8, LPARAM a9) #else HWND __stdcall Mine_CreateMDIWindowW(LPCWSTR a0, LPCWSTR a1, DWORD a2, int a3, int a4, int a5, int a6, HWND a7, HINSTANCE a8, LPARAM a9) #endif { _PrintEnter("CreateMDIWindowW(%ls,%ls,%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); HWND rv = 0; __try { rv = Real_CreateMDIWindowW(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } __finally { _PrintExit("CreateMDIWindowW(,,,,,,,,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_CreateMailslotA(LPCSTR a0, DWORD a1, DWORD a2, LPSECURITY_ATTRIBUTES a3) { _PrintEnter("CreateMailslotA(%hs,%p,%p,%p)\n", a0, a1, a2, a3); HANDLE rv = 0; __try { rv = Real_CreateMailslotA(a0, a1, a2, a3); } __finally { _PrintExit("CreateMailslotA(,,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_CreateMailslotW(LPCWSTR a0, DWORD a1, DWORD a2, LPSECURITY_ATTRIBUTES a3) { _PrintEnter("CreateMailslotW(%ls,%p,%p,%p)\n", a0, a1, a2, a3); HANDLE rv = 0; __try { rv = Real_CreateMailslotW(a0, a1, a2, a3); } __finally { _PrintExit("CreateMailslotW(,,,) -> %p\n", rv); }; return rv; } HMENU __stdcall Mine_CreateMenu(void) { _PrintEnter("CreateMenu()\n"); HMENU rv = 0; __try { rv = Real_CreateMenu(); } __finally { _PrintExit("CreateMenu() -> %p\n", rv); }; return rv; } HDC __stdcall Mine_CreateMetaFileA(LPCSTR a0) { _PrintEnter("CreateMetaFileA(%hs)\n", a0); HDC rv = 0; __try { rv = Real_CreateMetaFileA(a0); } __finally { _PrintExit("CreateMetaFileA() -> %p\n", rv); }; return rv; } HDC __stdcall Mine_CreateMetaFileW(LPCWSTR a0) { _PrintEnter("CreateMetaFileW(%ls)\n", a0); HDC rv = 0; __try { rv = Real_CreateMetaFileW(a0); } __finally { _PrintExit("CreateMetaFileW() -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_CreateMutexA(LPSECURITY_ATTRIBUTES a0, BOOL a1, LPCSTR a2) { _PrintEnter("CreateMutexA(%p,%p,%hs)\n", a0, a1, a2); HANDLE rv = 0; __try { rv = Real_CreateMutexA(a0, a1, a2); } __finally { _PrintExit("CreateMutexA(,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_CreateMutexW(LPSECURITY_ATTRIBUTES a0, BOOL a1, LPCWSTR a2) { _PrintEnter("CreateMutexW(%p,%p,%ls)\n", a0, a1, a2); HANDLE rv = 0; __try { rv = Real_CreateMutexW(a0, a1, a2); } __finally { _PrintExit("CreateMutexW(,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_CreateNamedPipeA(LPCSTR a0, DWORD a1, DWORD a2, DWORD a3, DWORD a4, DWORD a5, DWORD a6, LPSECURITY_ATTRIBUTES a7) { _PrintEnter("CreateNamedPipeA(%hs,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7); HANDLE rv = 0; __try { rv = Real_CreateNamedPipeA(a0, a1, a2, a3, a4, a5, a6, a7); } __finally { _PrintExit("CreateNamedPipeA(,,,,,,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_CreateNamedPipeW(LPCWSTR a0, DWORD a1, DWORD a2, DWORD a3, DWORD a4, DWORD a5, DWORD a6, LPSECURITY_ATTRIBUTES a7) { _PrintEnter("CreateNamedPipeW(%ls,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7); HANDLE rv = 0; __try { rv = Real_CreateNamedPipeW(a0, a1, a2, a3, a4, a5, a6, a7); } __finally { _PrintExit("CreateNamedPipeW(,,,,,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_CreateOleAdviseHolder(LPOLEADVISEHOLDER* a0) { _PrintEnter("CreateOleAdviseHolder(%p)\n", a0); HRESULT rv = 0; __try { rv = Real_CreateOleAdviseHolder(a0); } __finally { _PrintExit("CreateOleAdviseHolder() -> %x\n", rv); }; return rv; } HPALETTE __stdcall Mine_CreatePalette(LOGPALETTE* a0) { _PrintEnter("CreatePalette(%p)\n", a0); HPALETTE rv = 0; __try { rv = Real_CreatePalette(a0); } __finally { _PrintExit("CreatePalette() -> %p\n", rv); }; return rv; } HBRUSH __stdcall Mine_CreatePatternBrush(HBITMAP a0) { _PrintEnter("CreatePatternBrush(%p)\n", a0); HBRUSH rv = 0; __try { rv = Real_CreatePatternBrush(a0); } __finally { _PrintExit("CreatePatternBrush() -> %p\n", rv); }; return rv; } HPEN __stdcall Mine_CreatePen(int a0, int a1, COLORREF a2) { _PrintEnter("CreatePen(%p,%p,%p)\n", a0, a1, a2); HPEN rv = 0; __try { rv = Real_CreatePen(a0, a1, a2); } __finally { _PrintExit("CreatePen(,,) -> %p\n", rv); }; return rv; } HPEN __stdcall Mine_CreatePenIndirect(LOGPEN* a0) { _PrintEnter("CreatePenIndirect(%p)\n", a0); HPEN rv = 0; __try { rv = Real_CreatePenIndirect(a0); } __finally { _PrintExit("CreatePenIndirect() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_CreatePipe(PHANDLE a0, PHANDLE a1, LPSECURITY_ATTRIBUTES a2, DWORD a3) { _PrintEnter("CreatePipe(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_CreatePipe(a0, a1, a2, a3); } __finally { _PrintExit("CreatePipe(,,,) -> %x\n", rv); }; return rv; } HRESULT __stdcall Mine_CreatePointerMoniker(LPUNKNOWN a0, IMoniker** a1) { _PrintEnter("CreatePointerMoniker(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_CreatePointerMoniker(a0, a1); } __finally { _PrintExit("CreatePointerMoniker(,) -> %x\n", rv); }; return rv; } HRGN __stdcall Mine_CreatePolyPolygonRgn(POINT* a0, INT* a1, int a2, int a3) { _PrintEnter("CreatePolyPolygonRgn(%p,%p,%p,%p)\n", a0, a1, a2, a3); HRGN rv = 0; __try { rv = Real_CreatePolyPolygonRgn(a0, a1, a2, a3); } __finally { _PrintExit("CreatePolyPolygonRgn(,,,) -> %p\n", rv); }; return rv; } HRGN __stdcall Mine_CreatePolygonRgn(POINT* a0, int a1, int a2) { _PrintEnter("CreatePolygonRgn(%p,%p,%p)\n", a0, a1, a2); HRGN rv = 0; __try { rv = Real_CreatePolygonRgn(a0, a1, a2); } __finally { _PrintExit("CreatePolygonRgn(,,) -> %p\n", rv); }; return rv; } HMENU __stdcall Mine_CreatePopupMenu(void) { _PrintEnter("CreatePopupMenu()\n"); HMENU rv = 0; __try { rv = Real_CreatePopupMenu(); } __finally { _PrintExit("CreatePopupMenu() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_CreateProcessA(LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) { _PrintEnter("CreateProcessA(%hs,%hs,%p,%p,%p,%p,%p,%hs,%p,%p)\n", lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation); PROCESS_INFORMATION procInfo; if (lpProcessInformation == NULL) { lpProcessInformation= &procInfo; ZeroMemory(&procInfo, sizeof(procInfo)); } BOOL rv = 0; __try { rv = DetourCreateProcessWithDllExA(lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation, s_szDllPath, Real_CreateProcessA); } __finally { _PrintExit("CreateProcessA(,,,,,,,,,) -> %x (proc:%d/%p, thrd:%d/%p\n", rv, lpProcessInformation->dwProcessId, lpProcessInformation->hProcess, lpProcessInformation->dwThreadId, lpProcessInformation->hThread); }; return rv; } BOOL __stdcall Mine_CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) { _PrintEnter("CreateProcessW(%ls,%ls,%p,%p,%p,%p,%p,%ls,%p,%p)\n", lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation); PROCESS_INFORMATION procInfo; if (lpProcessInformation == NULL) { lpProcessInformation= &procInfo; ZeroMemory(&procInfo, sizeof(procInfo)); } BOOL rv = 0; __try { rv = DetourCreateProcessWithDllExW(lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation, s_szDllPath, Real_CreateProcessW); } __finally { _PrintExit("CreateProcessW(,,,,,,,,,) -> %x (proc:%d/%p, thrd:%d/%p\n", rv, lpProcessInformation->dwProcessId, lpProcessInformation->hProcess, lpProcessInformation->dwThreadId, lpProcessInformation->hThread); }; return rv; } BOOL __stdcall Mine_CreateProcessAsUserA( __in_opt HANDLE hToken, __in_opt LPCSTR lpApplicationName, __inout_opt LPSTR lpCommandLine, __in_opt LPSECURITY_ATTRIBUTES lpProcessAttributes, __in_opt LPSECURITY_ATTRIBUTES lpThreadAttributes, __in BOOL bInheritHandles, __in DWORD dwCreationFlags, __in_opt LPVOID lpEnvironment, __in_opt LPCSTR lpCurrentDirectory, __in LPSTARTUPINFOA lpStartupInfo, __out LPPROCESS_INFORMATION lpProcessInformation ) { _PrintEnter("CreateProcessAsUserA(%ls,%ls,%p,%p,%p,%p,%p,%ls,%p,%p)\n", lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation); PROCESS_INFORMATION procInfo; if (lpProcessInformation == NULL) { lpProcessInformation= &procInfo; ZeroMemory(&procInfo, sizeof(procInfo)); } BOOL rv = 0; __try { rv = Real_CreateProcessAsUserA(hToken, lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation); } __finally { _PrintExit("CreateProcessAsUserAW(,,,,,,,,,) -> %x (proc:%d/%p, thrd:%d/%p\n", rv, lpProcessInformation->dwProcessId, lpProcessInformation->hProcess, lpProcessInformation->dwThreadId, lpProcessInformation->hThread); }; return rv; } BOOL __stdcall Mine_CreateProcessAsUserW( __in_opt HANDLE hToken, __in_opt LPCWSTR lpApplicationName, __inout_opt LPWSTR lpCommandLine, __in_opt LPSECURITY_ATTRIBUTES lpProcessAttributes, __in_opt LPSECURITY_ATTRIBUTES lpThreadAttributes, __in BOOL bInheritHandles, __in DWORD dwCreationFlags, __in_opt LPVOID lpEnvironment, __in_opt LPCWSTR lpCurrentDirectory, __in LPSTARTUPINFOW lpStartupInfo, __out LPPROCESS_INFORMATION lpProcessInformation ) { _PrintEnter("CreateProcessAsUserW(%ls,%ls,%p,%p,%p,%p,%p,%ls,%p,%p)\n", lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation); PROCESS_INFORMATION procInfo; if (lpProcessInformation == NULL) { lpProcessInformation= &procInfo; ZeroMemory(&procInfo, sizeof(procInfo)); } BOOL rv = 0; __try { rv = Real_CreateProcessAsUserW(hToken, lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation); } __finally { _PrintExit("CreateProcessAsUserW(,,,,,,,,,) -> %x (proc:%d/%p, thrd:%d/%p\n", rv, lpProcessInformation->dwProcessId, lpProcessInformation->hProcess, lpProcessInformation->dwThreadId, lpProcessInformation->hThread); }; return rv; } #if(_WIN32_WINNT >= 0x0500) BOOL WINAPI Mine_CreateProcessWithLogonW( __in LPCWSTR lpUsername, __in_opt LPCWSTR lpDomain, __in LPCWSTR lpPassword, __in DWORD dwLogonFlags, __in_opt LPCWSTR lpApplicationName, __inout_opt LPWSTR lpCommandLine, __in DWORD dwCreationFlags, __in_opt LPVOID lpEnvironment, __in_opt LPCWSTR lpCurrentDirectory, __in LPSTARTUPINFOW lpStartupInfo, __out LPPROCESS_INFORMATION lpProcessInfo ) { _PrintEnter("CreateProcessWithLogonW(%ls,%ls,%ls,%d,%ls,%ls,%p,%p,%ls,%p,%p)\n", lpUsername, lpDomain, lpPassword, dwLogonFlags, lpApplicationName, lpCommandLine, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInfo); PROCESS_INFORMATION procInfo; if (lpProcessInfo == NULL) { lpProcessInfo= &procInfo; ZeroMemory(&procInfo, sizeof(procInfo)); } BOOL rv = 0; __try { rv = Real_CreateProcessWithLogonW( lpUsername, lpDomain, lpPassword, dwLogonFlags, lpApplicationName, lpCommandLine, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInfo); } __finally { _PrintExit("CreateProcessWithLogonW(,,,,,,,,,) -> %x (proc:%d/%p, thrd:%d/%p\n", rv, lpProcessInfo->dwProcessId, lpProcessInfo->hProcess, lpProcessInfo->dwThreadId, lpProcessInfo->hThread); }; return rv; } BOOL WINAPI Mine_CreateProcessWithTokenW( __in HANDLE hToken, __in DWORD dwLogonFlags, __in_opt LPCWSTR lpApplicationName, __inout_opt LPWSTR lpCommandLine, __in DWORD dwCreationFlags, __in_opt LPVOID lpEnvironment, __in_opt LPCWSTR lpCurrentDirectory, __in LPSTARTUPINFOW lpStartupInfo, __out LPPROCESS_INFORMATION lpProcessInfo ) { _PrintEnter("CreateProcessWithTokenW(%ls,%ls,%p,%p,%ls,%p,%p)\n", lpApplicationName, lpCommandLine, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInfo); PROCESS_INFORMATION procInfo; if (lpProcessInfo == NULL) { lpProcessInfo= &procInfo; ZeroMemory(&procInfo, sizeof(procInfo)); } BOOL rv = 0; __try { rv = Real_CreateProcessWithTokenW(hToken, dwLogonFlags, lpApplicationName, lpCommandLine, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInfo); } __finally { _PrintExit("CreateProcessWithTokenW(,,,,,,,,,) -> %x (proc:%d/%p, thrd:%d/%p\n", rv, lpProcessInfo->dwProcessId, lpProcessInfo->hProcess, lpProcessInfo->dwThreadId, lpProcessInfo->hThread); }; return rv; } #endif // (_WIN32_WINNT >= 0x0500) HRGN __stdcall Mine_CreateRectRgn(int a0, int a1, int a2, int a3) { _PrintEnter("CreateRectRgn(%p,%p,%p,%p)\n", a0, a1, a2, a3); HRGN rv = 0; __try { rv = Real_CreateRectRgn(a0, a1, a2, a3); } __finally { _PrintExit("CreateRectRgn(,,,) -> %p\n", rv); }; return rv; } HRGN __stdcall Mine_CreateRectRgnIndirect(RECT* a0) { _PrintEnter("CreateRectRgnIndirect(%p)\n", a0); HRGN rv = 0; __try { rv = Real_CreateRectRgnIndirect(a0); } __finally { _PrintExit("CreateRectRgnIndirect() -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_CreateRemoteThread(HANDLE a0, LPSECURITY_ATTRIBUTES a1, ULONG_PTR a2, LPTHREAD_START_ROUTINE a3, LPVOID a4, DWORD a5, LPDWORD a6) { _PrintEnter("CreateRemoteThread(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); HANDLE rv = 0; __try { rv = Real_CreateRemoteThread(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("CreateRemoteThread(,,,,,,) -> %p\n", rv); }; return rv; } HRGN __stdcall Mine_CreateRoundRectRgn(int a0, int a1, int a2, int a3, int a4, int a5) { _PrintEnter("CreateRoundRectRgn(%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); HRGN rv = 0; __try { rv = Real_CreateRoundRectRgn(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("CreateRoundRectRgn(,,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_CreateScalableFontResourceA(DWORD a0, LPCSTR a1, LPCSTR a2, LPCSTR a3) { _PrintEnter("CreateScalableFontResourceA(%p,%hs,%hs,%hs)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_CreateScalableFontResourceA(a0, a1, a2, a3); } __finally { _PrintExit("CreateScalableFontResourceA(,,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_CreateScalableFontResourceW(DWORD a0, LPCWSTR a1, LPCWSTR a2, LPCWSTR a3) { _PrintEnter("CreateScalableFontResourceW(%p,%ls,%ls,%ls)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_CreateScalableFontResourceW(a0, a1, a2, a3); } __finally { _PrintExit("CreateScalableFontResourceW(,,,) -> %x\n", rv); }; return rv; } HANDLE __stdcall Mine_CreateSemaphoreA(LPSECURITY_ATTRIBUTES a0, LONG a1, LONG a2, LPCSTR a3) { _PrintEnter("CreateSemaphoreA(%p,%p,%p,%hs)\n", a0, a1, a2, a3); HANDLE rv = 0; __try { rv = Real_CreateSemaphoreA(a0, a1, a2, a3); } __finally { _PrintExit("CreateSemaphoreA(,,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_CreateSemaphoreW(LPSECURITY_ATTRIBUTES a0, LONG a1, LONG a2, LPCWSTR a3) { _PrintEnter("CreateSemaphoreW(%p,%p,%p,%ls)\n", a0, a1, a2, a3); HANDLE rv = 0; __try { rv = Real_CreateSemaphoreW(a0, a1, a2, a3); } __finally { _PrintExit("CreateSemaphoreW(,,,) -> %p\n", rv); }; return rv; } HBRUSH __stdcall Mine_CreateSolidBrush(COLORREF a0) { _PrintEnter("CreateSolidBrush(%p)\n", a0); HBRUSH rv = 0; __try { rv = Real_CreateSolidBrush(a0); } __finally { _PrintExit("CreateSolidBrush() -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_CreateStdProgressIndicator(HWND a0, LPCOLESTR a1, IBindStatusCallback* a2, IBindStatusCallback** a3) { _PrintEnter("CreateStdProgressIndicator(%p,%p,%p,%p)\n", a0, a1, a2, a3); HRESULT rv = 0; __try { rv = Real_CreateStdProgressIndicator(a0, a1, a2, a3); } __finally { _PrintExit("CreateStdProgressIndicator(,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_CreateStreamOnHGlobal(HGLOBAL a0, BOOL a1, LPSTREAM* a2) { _PrintEnter("CreateStreamOnHGlobal(%p,%p,%p)\n", a0, a1, a2); HRESULT rv = 0; __try { rv = Real_CreateStreamOnHGlobal(a0, a1, a2); } __finally { _PrintExit("CreateStreamOnHGlobal(,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_CreateTapePartition(HANDLE a0, DWORD a1, DWORD a2, DWORD a3) { _PrintEnter("CreateTapePartition(%p,%p,%p,%p)\n", a0, a1, a2, a3); DWORD rv = 0; __try { rv = Real_CreateTapePartition(a0, a1, a2, a3); } __finally { _PrintExit("CreateTapePartition(,,,) -> %x\n", rv); }; return rv; } HANDLE __stdcall Mine_CreateThread(LPSECURITY_ATTRIBUTES a0, ULONG_PTR a1, LPTHREAD_START_ROUTINE a2, LPVOID a3, DWORD a4, LPDWORD a5) { _PrintEnter("CreateThread(%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); HANDLE rv = 0; __try { rv = Real_CreateThread(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("CreateThread(,,,,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_CreateWaitableTimerA(LPSECURITY_ATTRIBUTES a0, BOOL a1, LPCSTR a2) { _PrintEnter("CreateWaitableTimerA(%p,%p,%hs)\n", a0, a1, a2); HANDLE rv = 0; __try { rv = Real_CreateWaitableTimerA(a0, a1, a2); } __finally { _PrintExit("CreateWaitableTimerA(,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_CreateWaitableTimerW(LPSECURITY_ATTRIBUTES a0, BOOL a1, LPCWSTR a2) { _PrintEnter("CreateWaitableTimerW(%p,%p,%ls)\n", a0, a1, a2); HANDLE rv = 0; __try { rv = Real_CreateWaitableTimerW(a0, a1, a2); } __finally { _PrintExit("CreateWaitableTimerW(,,) -> %p\n", rv); }; return rv; } HWND __stdcall Mine_CreateWindowExA(DWORD a0, LPCSTR a1, LPCSTR a2, DWORD a3, int a4, int a5, int a6, int a7, HWND a8, HMENU a9, HINSTANCE a10, LPVOID a11) { _PrintEnter("CreateWindowExA(%p,%hs,%hs,%p,%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); HWND rv = 0; __try { rv = Real_CreateWindowExA(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); } __finally { _PrintExit("CreateWindowExA(,,,,,,,,,,,) -> %p\n", rv); }; return rv; } HWND __stdcall Mine_CreateWindowExW(DWORD a0, LPCWSTR a1, LPCWSTR a2, DWORD a3, int a4, int a5, int a6, int a7, HWND a8, HMENU a9, HINSTANCE a10, LPVOID a11) { _PrintEnter("CreateWindowExW(%p,%ls,%ls,%p,%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); HWND rv = 0; __try { rv = Real_CreateWindowExW(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); } __finally { _PrintExit("CreateWindowExW(,,,,,,,,,,,) -> %p\n", rv); }; return rv; } #if _MSC_VER < 1300 HWINSTA __stdcall Mine_CreateWindowStationA(LPSTR a0, DWORD a1, ACCESS_MASK a2, LPSECURITY_ATTRIBUTES a3) #else HWINSTA __stdcall Mine_CreateWindowStationA(LPCSTR a0, DWORD a1, ACCESS_MASK a2, LPSECURITY_ATTRIBUTES a3) #endif { _PrintEnter("CreateWindowStationA(%hs,%p,%p,%p)\n", a0, a1, a2, a3); HWINSTA rv = 0; __try { rv = Real_CreateWindowStationA(a0, a1, a2, a3); } __finally { _PrintExit("CreateWindowStationA(,,,) -> %p\n", rv); }; return rv; } #if _MSC_VER < 1300 HWINSTA __stdcall Mine_CreateWindowStationW(LPWSTR a0, DWORD a1, ACCESS_MASK a2, LPSECURITY_ATTRIBUTES a3) #else HWINSTA __stdcall Mine_CreateWindowStationW(LPCWSTR a0, DWORD a1, ACCESS_MASK a2, LPSECURITY_ATTRIBUTES a3) #endif { _PrintEnter("CreateWindowStationW(%ls,%p,%p,%p)\n", a0, a1, a2, a3); HWINSTA rv = 0; __try { rv = Real_CreateWindowStationW(a0, a1, a2, a3); } __finally { _PrintExit("CreateWindowStationW(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DPtoLP(HDC a0, POINT* a1, int a2) { _PrintEnter("DPtoLP(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_DPtoLP(a0, a1, a2); } __finally { _PrintExit("DPtoLP(,,) -> %x\n", rv); }; return rv; } BOOL __stdcall Mine_DdeAbandonTransaction(DWORD a0, HCONV a1, DWORD a2) { _PrintEnter("DdeAbandonTransaction(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_DdeAbandonTransaction(a0, a1, a2); } __finally { _PrintExit("DdeAbandonTransaction(,,) -> %p\n", rv); }; return rv; } LPBYTE __stdcall Mine_DdeAccessData(HDDEDATA a0, LPDWORD a1) { _PrintEnter("DdeAccessData(%p,%p)\n", a0, a1); LPBYTE rv = 0; __try { rv = Real_DdeAccessData(a0, a1); } __finally { _PrintExit("DdeAccessData(,) -> %p\n", rv); }; return rv; } HDDEDATA __stdcall Mine_DdeAddData(HDDEDATA a0, LPBYTE a1, DWORD a2, DWORD a3) { _PrintEnter("DdeAddData(%p,%p,%p,%p)\n", a0, a1, a2, a3); HDDEDATA rv = 0; __try { rv = Real_DdeAddData(a0, a1, a2, a3); } __finally { _PrintExit("DdeAddData(,,,) -> %p\n", rv); }; return rv; } HDDEDATA __stdcall Mine_DdeClientTransaction(LPBYTE a0, DWORD a1, HCONV a2, HSZ a3, UINT a4, UINT a5, DWORD a6, LPDWORD a7) { _PrintEnter("DdeClientTransaction(%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7); HDDEDATA rv = 0; __try { rv = Real_DdeClientTransaction(a0, a1, a2, a3, a4, a5, a6, a7); } __finally { _PrintExit("DdeClientTransaction(,,,,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_DdeCmpStringHandles(HSZ a0, HSZ a1) { _PrintEnter("DdeCmpStringHandles(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real_DdeCmpStringHandles(a0, a1); } __finally { _PrintExit("DdeCmpStringHandles(,) -> %x\n", rv); }; return rv; } HCONV __stdcall Mine_DdeConnect(DWORD a0, HSZ a1, HSZ a2, PCONVCONTEXT a3) { _PrintEnter("DdeConnect(%p,%p,%p,%p)\n", a0, a1, a2, a3); HCONV rv = 0; __try { rv = Real_DdeConnect(a0, a1, a2, a3); } __finally { _PrintExit("DdeConnect(,,,) -> %p\n", rv); }; return rv; } HCONVLIST __stdcall Mine_DdeConnectList(DWORD a0, HSZ a1, HSZ a2, HCONVLIST a3, PCONVCONTEXT a4) { _PrintEnter("DdeConnectList(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); HCONVLIST rv = 0; __try { rv = Real_DdeConnectList(a0, a1, a2, a3, a4); } __finally { _PrintExit("DdeConnectList(,,,,) -> %p\n", rv); }; return rv; } HDDEDATA __stdcall Mine_DdeCreateDataHandle(DWORD a0, LPBYTE a1, DWORD a2, DWORD a3, HSZ a4, UINT a5, UINT a6) { _PrintEnter("DdeCreateDataHandle(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); HDDEDATA rv = 0; __try { rv = Real_DdeCreateDataHandle(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("DdeCreateDataHandle(,,,,,,) -> %p\n", rv); }; return rv; } HSZ __stdcall Mine_DdeCreateStringHandleA(DWORD a0, LPCSTR a1, int a2) { _PrintEnter("DdeCreateStringHandleA(%p,%hs,%p)\n", a0, a1, a2); HSZ rv = 0; __try { rv = Real_DdeCreateStringHandleA(a0, a1, a2); } __finally { _PrintExit("DdeCreateStringHandleA(,,) -> %p\n", rv); }; return rv; } HSZ __stdcall Mine_DdeCreateStringHandleW(DWORD a0, LPCWSTR a1, int a2) { _PrintEnter("DdeCreateStringHandleW(%p,%ls,%p)\n", a0, a1, a2); HSZ rv = 0; __try { rv = Real_DdeCreateStringHandleW(a0, a1, a2); } __finally { _PrintExit("DdeCreateStringHandleW(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DdeDisconnect(HCONV a0) { _PrintEnter("DdeDisconnect(%p)\n", a0); BOOL rv = 0; __try { rv = Real_DdeDisconnect(a0); } __finally { _PrintExit("DdeDisconnect() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DdeDisconnectList(HCONVLIST a0) { _PrintEnter("DdeDisconnectList(%p)\n", a0); BOOL rv = 0; __try { rv = Real_DdeDisconnectList(a0); } __finally { _PrintExit("DdeDisconnectList() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DdeEnableCallback(DWORD a0, HCONV a1, UINT a2) { _PrintEnter("DdeEnableCallback(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_DdeEnableCallback(a0, a1, a2); } __finally { _PrintExit("DdeEnableCallback(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DdeFreeDataHandle(HDDEDATA a0) { _PrintEnter("DdeFreeDataHandle(%p)\n", a0); BOOL rv = 0; __try { rv = Real_DdeFreeDataHandle(a0); } __finally { _PrintExit("DdeFreeDataHandle() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DdeFreeStringHandle(DWORD a0, HSZ a1) { _PrintEnter("DdeFreeStringHandle(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_DdeFreeStringHandle(a0, a1); } __finally { _PrintExit("DdeFreeStringHandle(,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_DdeGetData(HDDEDATA a0, LPBYTE a1, DWORD a2, DWORD a3) { _PrintEnter("DdeGetData(%p,%p,%p,%p)\n", a0, a1, a2, a3); DWORD rv = 0; __try { rv = Real_DdeGetData(a0, a1, a2, a3); } __finally { _PrintExit("DdeGetData(,,,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_DdeGetLastError(DWORD a0) { _PrintEnter("DdeGetLastError(%p)\n", a0); UINT rv = 0; __try { rv = Real_DdeGetLastError(a0); } __finally { _PrintExit("DdeGetLastError() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DdeImpersonateClient(HCONV a0) { _PrintEnter("DdeImpersonateClient(%p)\n", a0); BOOL rv = 0; __try { rv = Real_DdeImpersonateClient(a0); } __finally { _PrintExit("DdeImpersonateClient() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DdeKeepStringHandle(DWORD a0, HSZ a1) { _PrintEnter("DdeKeepStringHandle(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_DdeKeepStringHandle(a0, a1); } __finally { _PrintExit("DdeKeepStringHandle(,) -> %p\n", rv); }; return rv; } HDDEDATA __stdcall Mine_DdeNameService(DWORD a0, HSZ a1, HSZ a2, UINT a3) { _PrintEnter("DdeNameService(%p,%p,%p,%p)\n", a0, a1, a2, a3); HDDEDATA rv = 0; __try { rv = Real_DdeNameService(a0, a1, a2, a3); } __finally { _PrintExit("DdeNameService(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DdePostAdvise(DWORD a0, HSZ a1, HSZ a2) { _PrintEnter("DdePostAdvise(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_DdePostAdvise(a0, a1, a2); } __finally { _PrintExit("DdePostAdvise(,,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_DdeQueryConvInfo(HCONV a0, DWORD a1, CONVINFO* a2) { _PrintEnter("DdeQueryConvInfo(%p,%p,%p)\n", a0, a1, a2); UINT rv = 0; __try { rv = Real_DdeQueryConvInfo(a0, a1, a2); } __finally { _PrintExit("DdeQueryConvInfo(,,) -> %p\n", rv); }; return rv; } HCONV __stdcall Mine_DdeQueryNextServer(HCONVLIST a0, HCONV a1) { _PrintEnter("DdeQueryNextServer(%p,%p)\n", a0, a1); HCONV rv = 0; __try { rv = Real_DdeQueryNextServer(a0, a1); } __finally { _PrintExit("DdeQueryNextServer(,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_DdeQueryStringA(DWORD a0, HSZ a1, LPSTR a2, DWORD a3, int a4) { _PrintEnter("DdeQueryStringA(%p,%p,%hs,%p,%p)\n", a0, a1, a2, a3, a4); DWORD rv = 0; __try { rv = Real_DdeQueryStringA(a0, a1, a2, a3, a4); } __finally { _PrintExit("DdeQueryStringA(,,%hs,,) -> %p\n", a2, rv); }; return rv; } DWORD __stdcall Mine_DdeQueryStringW(DWORD a0, HSZ a1, LPWSTR a2, DWORD a3, int a4) { _PrintEnter("DdeQueryStringW(%p,%p,%ls,%p,%p)\n", a0, a1, a2, a3, a4); DWORD rv = 0; __try { rv = Real_DdeQueryStringW(a0, a1, a2, a3, a4); } __finally { _PrintExit("DdeQueryStringW(,,%ls,,) -> %p\n", a2, rv); }; return rv; } HCONV __stdcall Mine_DdeReconnect(HCONV a0) { _PrintEnter("DdeReconnect(%p)\n", a0); HCONV rv = 0; __try { rv = Real_DdeReconnect(a0); } __finally { _PrintExit("DdeReconnect() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DdeSetQualityOfService(HWND a0, PSECURITY_QUALITY_OF_SERVICE a1, PSECURITY_QUALITY_OF_SERVICE a2) { _PrintEnter("DdeSetQualityOfService(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_DdeSetQualityOfService(a0, a1, a2); } __finally { _PrintExit("DdeSetQualityOfService(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DdeSetUserHandle(HCONV a0, DWORD a1, ULONG_PTR a2) { _PrintEnter("DdeSetUserHandle(%p,%x,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_DdeSetUserHandle(a0, a1, a2); } __finally { _PrintExit("DdeSetUserHandle(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DdeUnaccessData(HDDEDATA a0) { _PrintEnter("DdeUnaccessData(%p)\n", a0); BOOL rv = 0; __try { rv = Real_DdeUnaccessData(a0); } __finally { _PrintExit("DdeUnaccessData() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DdeUninitialize(DWORD a0) { _PrintEnter("DdeUninitialize(%p)\n", a0); BOOL rv = 0; __try { rv = Real_DdeUninitialize(a0); } __finally { _PrintExit("DdeUninitialize() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DebugActiveProcess(DWORD a0) { _PrintEnter("DebugActiveProcess(pid=%d)\n", a0); BOOL rv = 0; __try { rv = Real_DebugActiveProcess(a0); } __finally { _PrintExit("DebugActiveProcess() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DebugActiveProcessStop(DWORD a0) { _PrintEnter("DebugActiveProcessStop(pid=%d)\n", a0); BOOL rv = 0; __try { rv = Real_DebugActiveProcess(a0); } __finally { _PrintExit("DebugActiveProcessStop() -> %p\n", rv); }; return rv; } void __stdcall Mine_DebugBreak(void) { _PrintEnter("DebugBreak()\n"); __try { Real_DebugBreak(); } __finally { _PrintExit("DebugBreak() ->\n"); }; } LRESULT __stdcall Mine_DefDlgProcA(HWND a0, UINT a1, WPARAM a2, LPARAM a3) { _PrintEnter("DefDlgProcA(%p,%p,%p,%p)\n", a0, a1, a2, a3); LRESULT rv = 0; __try { rv = Real_DefDlgProcA(a0, a1, a2, a3); } __finally { _PrintExit("DefDlgProcA(,,,) -> %p\n", rv); }; return rv; } LRESULT __stdcall Mine_DefDlgProcW(HWND a0, UINT a1, WPARAM a2, LPARAM a3) { _PrintEnter("DefDlgProcW(%p,%p,%p,%p)\n", a0, a1, a2, a3); LRESULT rv = 0; __try { rv = Real_DefDlgProcW(a0, a1, a2, a3); } __finally { _PrintExit("DefDlgProcW(,,,) -> %p\n", rv); }; return rv; } LRESULT __stdcall Mine_DefFrameProcA(HWND a0, HWND a1, UINT a2, WPARAM a3, LPARAM a4) { _PrintEnter("DefFrameProcA(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); LRESULT rv = 0; __try { rv = Real_DefFrameProcA(a0, a1, a2, a3, a4); } __finally { _PrintExit("DefFrameProcA(,,,,) -> %p\n", rv); }; return rv; } LRESULT __stdcall Mine_DefFrameProcW(HWND a0, HWND a1, UINT a2, WPARAM a3, LPARAM a4) { _PrintEnter("DefFrameProcW(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); LRESULT rv = 0; __try { rv = Real_DefFrameProcW(a0, a1, a2, a3, a4); } __finally { _PrintExit("DefFrameProcW(,,,,) -> %p\n", rv); }; return rv; } LRESULT __stdcall Mine_DefMDIChildProcA(HWND a0, UINT a1, WPARAM a2, LPARAM a3) { _PrintEnter("DefMDIChildProcA(%p,%p,%p,%p)\n", a0, a1, a2, a3); LRESULT rv = 0; __try { rv = Real_DefMDIChildProcA(a0, a1, a2, a3); } __finally { _PrintExit("DefMDIChildProcA(,,,) -> %p\n", rv); }; return rv; } LRESULT __stdcall Mine_DefMDIChildProcW(HWND a0, UINT a1, WPARAM a2, LPARAM a3) { _PrintEnter("DefMDIChildProcW(%p,%p,%p,%p)\n", a0, a1, a2, a3); LRESULT rv = 0; __try { rv = Real_DefMDIChildProcW(a0, a1, a2, a3); } __finally { _PrintExit("DefMDIChildProcW(,,,) -> %p\n", rv); }; return rv; } LRESULT __stdcall Mine_DefWindowProcA(HWND a0, UINT a1, WPARAM a2, LPARAM a3) { _PrintEnter("DefWindowProcA(%p,%p,%p,%p)\n", a0, a1, a2, a3); LRESULT rv = 0; __try { rv = Real_DefWindowProcA(a0, a1, a2, a3); } __finally { _PrintExit("DefWindowProcA(,,,) -> %p\n", rv); }; return rv; } LRESULT __stdcall Mine_DefWindowProcW(HWND a0, UINT a1, WPARAM a2, LPARAM a3) { _PrintEnter("DefWindowProcW(%p,%p,%p,%p)\n", a0, a1, a2, a3); LRESULT rv = 0; __try { rv = Real_DefWindowProcW(a0, a1, a2, a3); } __finally { _PrintExit("DefWindowProcW(,,,) -> %p\n", rv); }; return rv; } HDWP __stdcall Mine_DeferWindowPos(HDWP a0, HWND a1, HWND a2, int a3, int a4, int a5, int a6, UINT a7) { _PrintEnter("DeferWindowPos(%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7); HDWP rv = 0; __try { rv = Real_DeferWindowPos(a0, a1, a2, a3, a4, a5, a6, a7); } __finally { _PrintExit("DeferWindowPos(,,,,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DefineDosDeviceA(DWORD a0, LPCSTR a1, LPCSTR a2) { _PrintEnter("DefineDosDeviceA(%p,%hs,%hs)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_DefineDosDeviceA(a0, a1, a2); } __finally { _PrintExit("DefineDosDeviceA(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DefineDosDeviceW(DWORD a0, LPCWSTR a1, LPCWSTR a2) { _PrintEnter("DefineDosDeviceW(%p,%ls,%ls)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_DefineDosDeviceW(a0, a1, a2); } __finally { _PrintExit("DefineDosDeviceW(,,) -> %p\n", rv); }; return rv; } ATOM __stdcall Mine_DeleteAtom(ATOM a0) { _PrintEnter("DeleteAtom(%p)\n", a0); ATOM rv = 0; __try { rv = Real_DeleteAtom(a0); } __finally { _PrintExit("DeleteAtom() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DeleteColorSpace(HCOLORSPACE a0) { _PrintEnter("DeleteColorSpace(%p)\n", a0); BOOL rv = 0; __try { rv = Real_DeleteColorSpace(a0); } __finally { _PrintExit("DeleteColorSpace() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DeleteDC(HDC a0) { _PrintEnter("DeleteDC(%p)\n", a0); BOOL rv = 0; __try { rv = Real_DeleteDC(a0); } __finally { _PrintExit("DeleteDC() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DeleteEnhMetaFile(HENHMETAFILE a0) { _PrintEnter("DeleteEnhMetaFile(%p)\n", a0); BOOL rv = 0; __try { rv = Real_DeleteEnhMetaFile(a0); } __finally { _PrintExit("DeleteEnhMetaFile() -> %p\n", rv); }; return rv; } void __stdcall Mine_DeleteFiber(LPVOID a0) { _PrintEnter("DeleteFiber(%p)\n", a0); __try { Real_DeleteFiber(a0); } __finally { _PrintExit("DeleteFiber() ->\n"); }; } BOOL __stdcall Mine_DeleteFileA(LPCSTR a0) { _PrintEnter("DeleteFileA(%hs)\n", a0); BOOL rv = 0; __try { rv = Real_DeleteFileA(a0); } __finally { _PrintExit("DeleteFileA() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DeleteFileW(LPCWSTR a0) { _PrintEnter("DeleteFileW(%ls)\n", a0); BOOL rv = 0; __try { rv = Real_DeleteFileW(a0); } __finally { _PrintExit("DeleteFileW() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DeleteMenu(HMENU a0, UINT a1, UINT a2) { _PrintEnter("DeleteMenu(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_DeleteMenu(a0, a1, a2); } __finally { _PrintExit("DeleteMenu(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DeleteMetaFile(HMETAFILE a0) { _PrintEnter("DeleteMetaFile(%p)\n", a0); BOOL rv = 0; __try { rv = Real_DeleteMetaFile(a0); } __finally { _PrintExit("DeleteMetaFile() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DeleteObject(HGDIOBJ a0) { _PrintEnter("DeleteObject(%p)\n", a0); BOOL rv = 0; __try { rv = Real_DeleteObject(a0); } __finally { _PrintExit("DeleteObject() -> %p\n", rv); }; return rv; } int __stdcall Mine_DescribePixelFormat(HDC a0, int a1, UINT a2, PIXELFORMATDESCRIPTOR* a3) { _PrintEnter("DescribePixelFormat(%p,%p,%p,%p)\n", a0, a1, a2, a3); int rv = 0; __try { rv = Real_DescribePixelFormat(a0, a1, a2, a3); } __finally { _PrintExit("DescribePixelFormat(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DestroyAcceleratorTable(HACCEL a0) { _PrintEnter("DestroyAcceleratorTable(%p)\n", a0); BOOL rv = 0; __try { rv = Real_DestroyAcceleratorTable(a0); } __finally { _PrintExit("DestroyAcceleratorTable() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DestroyCaret(void) { _PrintEnter("DestroyCaret()\n"); BOOL rv = 0; __try { rv = Real_DestroyCaret(); } __finally { _PrintExit("DestroyCaret() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DestroyCursor(HCURSOR a0) { _PrintEnter("DestroyCursor(%p)\n", a0); BOOL rv = 0; __try { rv = Real_DestroyCursor(a0); } __finally { _PrintExit("DestroyCursor() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DestroyIcon(HICON a0) { _PrintEnter("DestroyIcon(%p)\n", a0); BOOL rv = 0; __try { rv = Real_DestroyIcon(a0); } __finally { _PrintExit("DestroyIcon() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DestroyMenu(HMENU a0) { _PrintEnter("DestroyMenu(%p)\n", a0); BOOL rv = 0; __try { rv = Real_DestroyMenu(a0); } __finally { _PrintExit("DestroyMenu() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DestroyWindow(HWND a0) { _PrintEnter("DestroyWindow(%p)\n", a0); BOOL rv = 0; __try { rv = Real_DestroyWindow(a0); } __finally { _PrintExit("DestroyWindow() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DeviceIoControl(HANDLE a0, DWORD a1, LPVOID a2, DWORD a3, LPVOID a4, DWORD a5, LPDWORD a6, LPOVERLAPPED a7) { _PrintEnter("DeviceIoControl(%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7); BOOL rv = 0; __try { rv = Real_DeviceIoControl(a0, a1, a2, a3, a4, a5, a6, a7); } __finally { _PrintExit("DeviceIoControl(,,,,,,,) -> %p\n", rv); }; return rv; } INT_PTR __stdcall Mine_DialogBoxIndirectParamA(HINSTANCE a0, LPCDLGTEMPLATEA a1, HWND a2, DLGPROC a3, LPARAM a4) { _PrintEnter("DialogBoxIndirectParamA(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); INT_PTR rv = 0; __try { rv = Real_DialogBoxIndirectParamA(a0, a1, a2, a3, a4); } __finally { _PrintExit("DialogBoxIndirectParamA(,,,,) -> %p\n", rv); }; return rv; } INT_PTR __stdcall Mine_DialogBoxIndirectParamW(HINSTANCE a0, LPCDLGTEMPLATEW a1, HWND a2, DLGPROC a3, LPARAM a4) { _PrintEnter("DialogBoxIndirectParamW(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); INT_PTR rv = 0; __try { rv = Real_DialogBoxIndirectParamW(a0, a1, a2, a3, a4); } __finally { _PrintExit("DialogBoxIndirectParamW(,,,,) -> %p\n", rv); }; return rv; } INT_PTR __stdcall Mine_DialogBoxParamA(HINSTANCE a0, LPCSTR a1, HWND a2, DLGPROC a3, LPARAM a4) { _PrintEnter("DialogBoxParamA(%p,%hs,%p,%p,%p)\n", a0, a1, a2, a3, a4); INT_PTR rv = 0; __try { rv = Real_DialogBoxParamA(a0, a1, a2, a3, a4); } __finally { _PrintExit("DialogBoxParamA(,,,,) -> %p\n", rv); }; return rv; } INT_PTR __stdcall Mine_DialogBoxParamW(HINSTANCE a0, LPCWSTR a1, HWND a2, DLGPROC a3, LPARAM a4) { _PrintEnter("DialogBoxParamW(%p,%ls,%p,%p,%p)\n", a0, a1, a2, a3, a4); INT_PTR rv = 0; __try { rv = Real_DialogBoxParamW(a0, a1, a2, a3, a4); } __finally { _PrintExit("DialogBoxParamW(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DisableThreadLibraryCalls(HMODULE a0) { _PrintEnter("DisableThreadLibraryCalls(%p)\n", a0); BOOL rv = 0; __try { rv = Real_DisableThreadLibraryCalls(a0); } __finally { _PrintExit("DisableThreadLibraryCalls() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DisconnectNamedPipe(HANDLE a0) { _PrintEnter("DisconnectNamedPipe(%p)\n", a0); BOOL rv = 0; __try { rv = Real_DisconnectNamedPipe(a0); } __finally { _PrintExit("DisconnectNamedPipe() -> %p\n", rv); }; return rv; } LRESULT __stdcall Mine_DispatchMessageA(MSG* a0) { _PrintEnter("DispatchMessageA(%p)\n", a0); LRESULT rv = 0; __try { rv = Real_DispatchMessageA(a0); } __finally { _PrintExit("DispatchMessageA() -> %p\n", rv); }; return rv; } LRESULT __stdcall Mine_DispatchMessageW(MSG* a0) { _PrintEnter("DispatchMessageW(%p)\n", a0); LRESULT rv = 0; __try { rv = Real_DispatchMessageW(a0); } __finally { _PrintExit("DispatchMessageW() -> %p\n", rv); }; return rv; } int __stdcall Mine_DlgDirListA(HWND a0, LPSTR a1, int a2, int a3, UINT a4) { _PrintEnter("DlgDirListA(%p,%hs,%p,%p,%p)\n", a0, a1, a2, a3, a4); int rv = 0; __try { rv = Real_DlgDirListA(a0, a1, a2, a3, a4); } __finally { _PrintExit("DlgDirListA(,%hs,,,) -> %p\n", a1, rv); }; return rv; } int __stdcall Mine_DlgDirListComboBoxA(HWND a0, LPSTR a1, int a2, int a3, UINT a4) { _PrintEnter("DlgDirListComboBoxA(%p,%hs,%p,%p,%p)\n", a0, a1, a2, a3, a4); int rv = 0; __try { rv = Real_DlgDirListComboBoxA(a0, a1, a2, a3, a4); } __finally { _PrintExit("DlgDirListComboBoxA(,%hs,,,) -> %p\n", a1, rv); }; return rv; } int __stdcall Mine_DlgDirListComboBoxW(HWND a0, LPWSTR a1, int a2, int a3, UINT a4) { _PrintEnter("DlgDirListComboBoxW(%p,%ls,%p,%p,%p)\n", a0, a1, a2, a3, a4); int rv = 0; __try { rv = Real_DlgDirListComboBoxW(a0, a1, a2, a3, a4); } __finally { _PrintExit("DlgDirListComboBoxW(,%ls,,,) -> %p\n", a1, rv); }; return rv; } int __stdcall Mine_DlgDirListW(HWND a0, LPWSTR a1, int a2, int a3, UINT a4) { _PrintEnter("DlgDirListW(%p,%ls,%p,%p,%p)\n", a0, a1, a2, a3, a4); int rv = 0; __try { rv = Real_DlgDirListW(a0, a1, a2, a3, a4); } __finally { _PrintExit("DlgDirListW(,%ls,,,) -> %p\n", a1, rv); }; return rv; } BOOL __stdcall Mine_DlgDirSelectComboBoxExA(HWND a0, LPSTR a1, int a2, int a3) { _PrintEnter("DlgDirSelectComboBoxExA(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_DlgDirSelectComboBoxExA(a0, a1, a2, a3); } __finally { _PrintExit("DlgDirSelectComboBoxExA(,%hs,,) -> %p\n", a1, rv); }; return rv; } BOOL __stdcall Mine_DlgDirSelectComboBoxExW(HWND a0, LPWSTR a1, int a2, int a3) { _PrintEnter("DlgDirSelectComboBoxExW(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_DlgDirSelectComboBoxExW(a0, a1, a2, a3); } __finally { _PrintExit("DlgDirSelectComboBoxExW(,%ls,,) -> %p\n", a1, rv); }; return rv; } BOOL __stdcall Mine_DlgDirSelectExA(HWND a0, LPSTR a1, int a2, int a3) { _PrintEnter("DlgDirSelectExA(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_DlgDirSelectExA(a0, a1, a2, a3); } __finally { _PrintExit("DlgDirSelectExA(,%hs,,) -> %p\n", a1, rv); }; return rv; } BOOL __stdcall Mine_DlgDirSelectExW(HWND a0, LPWSTR a1, int a2, int a3) { _PrintEnter("DlgDirSelectExW(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_DlgDirSelectExW(a0, a1, a2, a3); } __finally { _PrintExit("DlgDirSelectExW(,%ls,,) -> %p\n", a1, rv); }; return rv; } HRESULT __stdcall Mine_DoDragDrop(IDataObject* a0, IDropSource* a1, DWORD a2, LPDWORD a3) { _PrintEnter("DoDragDrop(%p,%p,%p,%p)\n", a0, a1, a2, a3); HRESULT rv = 0; __try { rv = Real_DoDragDrop(a0, a1, a2, a3); } __finally { _PrintExit("DoDragDrop(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DosDateTimeToFileTime(WORD a0, WORD a1, LPFILETIME a2) { _PrintEnter("DosDateTimeToFileTime(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_DosDateTimeToFileTime(a0, a1, a2); } __finally { _PrintExit("DosDateTimeToFileTime(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DragDetect(HWND a0, POINT a1) { _PrintEnter("DragDetect(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_DragDetect(a0, a1); } __finally { _PrintExit("DragDetect(,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_DragObject(HWND a0, HWND a1, UINT a2, ULONG_PTR a3, HCURSOR a4) { _PrintEnter("DragObject(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); DWORD rv = 0; __try { rv = Real_DragObject(a0, a1, a2, a3, a4); } __finally { _PrintExit("DragObject(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DrawAnimatedRects(HWND a0, int a1, RECT* a2, RECT* a3) { _PrintEnter("DrawAnimatedRects(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_DrawAnimatedRects(a0, a1, a2, a3); } __finally { _PrintExit("DrawAnimatedRects(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DrawCaption(HWND a0, HDC a1, RECT* a2, UINT a3) { _PrintEnter("DrawCaption(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_DrawCaption(a0, a1, a2, a3); } __finally { _PrintExit("DrawCaption(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DrawEdge(HDC a0, LPRECT a1, UINT a2, UINT a3) { _PrintEnter("DrawEdge(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_DrawEdge(a0, a1, a2, a3); } __finally { _PrintExit("DrawEdge(,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_DrawEscape(HDC a0, int a1, int a2, LPCSTR a3) { _PrintEnter("DrawEscape(%p,%p,%p,%hs)\n", a0, a1, a2, a3); int rv = 0; __try { rv = Real_DrawEscape(a0, a1, a2, a3); } __finally { _PrintExit("DrawEscape(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DrawFocusRect(HDC a0, RECT* a1) { _PrintEnter("DrawFocusRect(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_DrawFocusRect(a0, a1); } __finally { _PrintExit("DrawFocusRect(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DrawFrameControl(HDC a0, LPRECT a1, UINT a2, UINT a3) { _PrintEnter("DrawFrameControl(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_DrawFrameControl(a0, a1, a2, a3); } __finally { _PrintExit("DrawFrameControl(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DrawIcon(HDC a0, int a1, int a2, HICON a3) { _PrintEnter("DrawIcon(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_DrawIcon(a0, a1, a2, a3); } __finally { _PrintExit("DrawIcon(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DrawIconEx(HDC a0, int a1, int a2, HICON a3, int a4, int a5, UINT a6, HBRUSH a7, UINT a8) { _PrintEnter("DrawIconEx(%p,%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8); BOOL rv = 0; __try { rv = Real_DrawIconEx(a0, a1, a2, a3, a4, a5, a6, a7, a8); } __finally { _PrintExit("DrawIconEx(,,,,,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DrawMenuBar(HWND a0) { _PrintEnter("DrawMenuBar(%p)\n", a0); BOOL rv = 0; __try { rv = Real_DrawMenuBar(a0); } __finally { _PrintExit("DrawMenuBar() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DrawStateA(HDC a0, HBRUSH a1, DRAWSTATEPROC a2, LPARAM a3, WPARAM a4, int a5, int a6, int a7, int a8, UINT a9) { _PrintEnter("DrawStateA(%p,%p,%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); BOOL rv = 0; __try { rv = Real_DrawStateA(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } __finally { _PrintExit("DrawStateA(,,,,,,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DrawStateW(HDC a0, HBRUSH a1, DRAWSTATEPROC a2, LPARAM a3, WPARAM a4, int a5, int a6, int a7, int a8, UINT a9) { _PrintEnter("DrawStateW(%p,%p,%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); BOOL rv = 0; __try { rv = Real_DrawStateW(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } __finally { _PrintExit("DrawStateW(,,,,,,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_DrawTextA(HDC a0, LPCSTR a1, int a2, LPRECT a3, UINT a4) { _PrintEnter("DrawTextA(%p,%hs,%p,%p,%p)\n", a0, a1, a2, a3, a4); int rv = 0; __try { rv = Real_DrawTextA(a0, a1, a2, a3, a4); } __finally { _PrintExit("DrawTextA(,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_DrawTextExA(HDC a0, LPSTR a1, int a2, LPRECT a3, UINT a4, LPDRAWTEXTPARAMS a5) { _PrintEnter("DrawTextExA(%p,%hs,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); int rv = 0; __try { rv = Real_DrawTextExA(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("DrawTextExA(,%hs,,,,) -> %p\n", a1, rv); }; return rv; } int __stdcall Mine_DrawTextExW(HDC a0, LPWSTR a1, int a2, LPRECT a3, UINT a4, LPDRAWTEXTPARAMS a5) { _PrintEnter("DrawTextExW(%p,%ls,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); int rv = 0; __try { rv = Real_DrawTextExW(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("DrawTextExW(,%ls,,,,) -> %p\n", a1, rv); }; return rv; } int __stdcall Mine_DrawTextW(HDC a0, LPCWSTR a1, int a2, LPRECT a3, UINT a4) { _PrintEnter("DrawTextW(%p,%ls,%p,%p,%p)\n", a0, a1, a2, a3, a4); int rv = 0; __try { rv = Real_DrawTextW(a0, a1, a2, a3, a4); } __finally { _PrintExit("DrawTextW(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_DuplicateHandle(HANDLE a0, HANDLE a1, HANDLE a2, LPHANDLE a3, DWORD a4, BOOL a5, DWORD a6) { _PrintEnter("DuplicateHandle(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); BOOL rv = 0; __try { rv = Real_DuplicateHandle(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("DuplicateHandle(,,,%p,,,) -> %p\n", a3 != NULL ? *a3 : NULL, rv); }; return rv; } BOOL __stdcall Mine_Ellipse(HDC a0, int a1, int a2, int a3, int a4) { _PrintEnter("Ellipse(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_Ellipse(a0, a1, a2, a3, a4); } __finally { _PrintExit("Ellipse(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_EmptyClipboard(void) { _PrintEnter("EmptyClipboard()\n"); BOOL rv = 0; __try { rv = Real_EmptyClipboard(); } __finally { _PrintExit("EmptyClipboard() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_EnableMenuItem(HMENU a0, UINT a1, UINT a2) { _PrintEnter("EnableMenuItem(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_EnableMenuItem(a0, a1, a2); } __finally { _PrintExit("EnableMenuItem(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_EnableScrollBar(HWND a0, UINT a1, UINT a2) { _PrintEnter("EnableScrollBar(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_EnableScrollBar(a0, a1, a2); } __finally { _PrintExit("EnableScrollBar(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_EnableWindow(HWND a0, BOOL a1) { _PrintEnter("EnableWindow(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_EnableWindow(a0, a1); } __finally { _PrintExit("EnableWindow(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_EndDeferWindowPos(HDWP a0) { _PrintEnter("EndDeferWindowPos(%p)\n", a0); BOOL rv = 0; __try { rv = Real_EndDeferWindowPos(a0); } __finally { _PrintExit("EndDeferWindowPos() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_EndDialog(HWND a0, INT_PTR a1) { _PrintEnter("EndDialog(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_EndDialog(a0, a1); } __finally { _PrintExit("EndDialog(,) -> %p\n", rv); }; return rv; } int __stdcall Mine_EndDoc(HDC a0) { _PrintEnter("EndDoc(%p)\n", a0); int rv = 0; __try { rv = Real_EndDoc(a0); } __finally { _PrintExit("EndDoc() -> %p\n", rv); }; return rv; } int __stdcall Mine_EndPage(HDC a0) { _PrintEnter("EndPage(%p)\n", a0); int rv = 0; __try { rv = Real_EndPage(a0); } __finally { _PrintExit("EndPage() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_EndPaint(HWND a0, PAINTSTRUCT* a1) { _PrintEnter("EndPaint(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_EndPaint(a0, a1); } __finally { _PrintExit("EndPaint(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_EndPath(HDC a0) { _PrintEnter("EndPath(%p)\n", a0); BOOL rv = 0; __try { rv = Real_EndPath(a0); } __finally { _PrintExit("EndPath() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_EndUpdateResourceA(HANDLE a0, BOOL a1) { _PrintEnter("EndUpdateResourceA(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_EndUpdateResourceA(a0, a1); } __finally { _PrintExit("EndUpdateResourceA(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_EndUpdateResourceW(HANDLE a0, BOOL a1) { _PrintEnter("EndUpdateResourceW(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_EndUpdateResourceW(a0, a1); } __finally { _PrintExit("EndUpdateResourceW(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_EnumCalendarInfoA(CALINFO_ENUMPROCA a0, LCID a1, CALID a2, CALTYPE a3) { _PrintEnter("EnumCalendarInfoA(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_EnumCalendarInfoA(a0, a1, a2, a3); } __finally { _PrintExit("EnumCalendarInfoA(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_EnumCalendarInfoW(CALINFO_ENUMPROCW a0, LCID a1, CALID a2, CALTYPE a3) { _PrintEnter("EnumCalendarInfoW(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_EnumCalendarInfoW(a0, a1, a2, a3); } __finally { _PrintExit("EnumCalendarInfoW(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_EnumChildWindows(HWND a0, WNDENUMPROC a1, LPARAM a2) { _PrintEnter("EnumChildWindows(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_EnumChildWindows(a0, a1, a2); } __finally { _PrintExit("EnumChildWindows(,,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_EnumClipboardFormats(UINT a0) { _PrintEnter("EnumClipboardFormats(%p)\n", a0); UINT rv = 0; __try { rv = Real_EnumClipboardFormats(a0); } __finally { _PrintExit("EnumClipboardFormats() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_EnumDateFormatsA(DATEFMT_ENUMPROCA a0, LCID a1, DWORD a2) { _PrintEnter("EnumDateFormatsA(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_EnumDateFormatsA(a0, a1, a2); } __finally { _PrintExit("EnumDateFormatsA(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_EnumDateFormatsW(DATEFMT_ENUMPROCW a0, LCID a1, DWORD a2) { _PrintEnter("EnumDateFormatsW(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_EnumDateFormatsW(a0, a1, a2); } __finally { _PrintExit("EnumDateFormatsW(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_EnumDesktopWindows(HDESK a0, WNDENUMPROC a1, LPARAM a2) { _PrintEnter("EnumDesktopWindows(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_EnumDesktopWindows(a0, a1, a2); } __finally { _PrintExit("EnumDesktopWindows(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_EnumDesktopsA(HWINSTA a0, DESKTOPENUMPROCA a1, LPARAM a2) { _PrintEnter("EnumDesktopsA(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_EnumDesktopsA(a0, a1, a2); } __finally { _PrintExit("EnumDesktopsA(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_EnumDesktopsW(HWINSTA a0, DESKTOPENUMPROCW a1, LPARAM a2) { _PrintEnter("EnumDesktopsW(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_EnumDesktopsW(a0, a1, a2); } __finally { _PrintExit("EnumDesktopsW(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_EnumDisplaySettingsA(LPCSTR a0, DWORD a1, LPDEVMODEA a2) { _PrintEnter("EnumDisplaySettingsA(%hs,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_EnumDisplaySettingsA(a0, a1, a2); } __finally { _PrintExit("EnumDisplaySettingsA(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_EnumDisplaySettingsW(LPCWSTR a0, DWORD a1, LPDEVMODEW a2) { _PrintEnter("EnumDisplaySettingsW(%ls,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_EnumDisplaySettingsW(a0, a1, a2); } __finally { _PrintExit("EnumDisplaySettingsW(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_EnumEnhMetaFile(HDC a0, HENHMETAFILE a1, ENHMFENUMPROC a2, LPVOID a3, RECT* a4) { _PrintEnter("EnumEnhMetaFile(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_EnumEnhMetaFile(a0, a1, a2, a3, a4); } __finally { _PrintExit("EnumEnhMetaFile(,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_EnumFontFamiliesA(HDC a0, LPCSTR a1, FONTENUMPROCA a2, LPARAM a3) { _PrintEnter("EnumFontFamiliesA(%p,%hs,%p,%p)\n", a0, a1, a2, a3); int rv = 0; __try { rv = Real_EnumFontFamiliesA(a0, a1, a2, a3); } __finally { _PrintExit("EnumFontFamiliesA(,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_EnumFontFamiliesExA(HDC a0, LPLOGFONTA a1, FONTENUMPROCA a2, LPARAM a3, DWORD a4) { _PrintEnter("EnumFontFamiliesExA(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); int rv = 0; __try { rv = Real_EnumFontFamiliesExA(a0, a1, a2, a3, a4); } __finally { _PrintExit("EnumFontFamiliesExA(,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_EnumFontFamiliesExW(HDC a0, LPLOGFONTW a1, FONTENUMPROCW a2, LPARAM a3, DWORD a4) { _PrintEnter("EnumFontFamiliesExW(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); int rv = 0; __try { rv = Real_EnumFontFamiliesExW(a0, a1, a2, a3, a4); } __finally { _PrintExit("EnumFontFamiliesExW(,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_EnumFontFamiliesW(HDC a0, LPCWSTR a1, FONTENUMPROCW a2, LPARAM a3) { _PrintEnter("EnumFontFamiliesW(%p,%ls,%p,%p)\n", a0, a1, a2, a3); int rv = 0; __try { rv = Real_EnumFontFamiliesW(a0, a1, a2, a3); } __finally { _PrintExit("EnumFontFamiliesW(,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_EnumFontsA(HDC a0, LPCSTR a1, FONTENUMPROCA a2, LPARAM a3) { _PrintEnter("EnumFontsA(%p,%hs,%p,%p)\n", a0, a1, a2, a3); int rv = 0; __try { rv = Real_EnumFontsA(a0, a1, a2, a3); } __finally { _PrintExit("EnumFontsA(,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_EnumFontsW(HDC a0, LPCWSTR a1, FONTENUMPROCW a2, LPARAM a3) { _PrintEnter("EnumFontsW(%p,%ls,%p,%p)\n", a0, a1, a2, a3); int rv = 0; __try { rv = Real_EnumFontsW(a0, a1, a2, a3); } __finally { _PrintExit("EnumFontsW(,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_EnumICMProfilesA(HDC a0, ICMENUMPROCA a1, LPARAM a2) { _PrintEnter("EnumICMProfilesA(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_EnumICMProfilesA(a0, a1, a2); } __finally { _PrintExit("EnumICMProfilesA(,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_EnumICMProfilesW(HDC a0, ICMENUMPROCW a1, LPARAM a2) { _PrintEnter("EnumICMProfilesW(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_EnumICMProfilesW(a0, a1, a2); } __finally { _PrintExit("EnumICMProfilesW(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_EnumMetaFile(HDC a0, HMETAFILE a1, MFENUMPROC a2, LPARAM a3) { _PrintEnter("EnumMetaFile(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_EnumMetaFile(a0, a1, a2, a3); } __finally { _PrintExit("EnumMetaFile(,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_EnumObjects(HDC a0, int a1, GOBJENUMPROC a2, LPARAM a3) { _PrintEnter("EnumObjects(%p,%p,%p,%p)\n", a0, a1, a2, a3); int rv = 0; __try { rv = Real_EnumObjects(a0, a1, a2, a3); } __finally { _PrintExit("EnumObjects(,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_EnumPropsA(HWND a0, PROPENUMPROCA a1) { _PrintEnter("EnumPropsA(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real_EnumPropsA(a0, a1); } __finally { _PrintExit("EnumPropsA(,) -> %p\n", rv); }; return rv; } int __stdcall Mine_EnumPropsExA(HWND a0, PROPENUMPROCEXA a1, LPARAM a2) { _PrintEnter("EnumPropsExA(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_EnumPropsExA(a0, a1, a2); } __finally { _PrintExit("EnumPropsExA(,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_EnumPropsExW(HWND a0, PROPENUMPROCEXW a1, LPARAM a2) { _PrintEnter("EnumPropsExW(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_EnumPropsExW(a0, a1, a2); } __finally { _PrintExit("EnumPropsExW(,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_EnumPropsW(HWND a0, PROPENUMPROCW a1) { _PrintEnter("EnumPropsW(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real_EnumPropsW(a0, a1); } __finally { _PrintExit("EnumPropsW(,) -> %p\n", rv); }; return rv; } #if _MSC_VER < 1300 BOOL __stdcall Mine_EnumResourceLanguagesA(HMODULE a0, LPCSTR a1, LPCSTR a2, ENUMRESLANGPROC a3, LONG_PTR a4) #else BOOL __stdcall Mine_EnumResourceLanguagesA(HMODULE a0, LPCSTR a1, LPCSTR a2, ENUMRESLANGPROCA a3, LONG_PTR a4) #endif { _PrintEnter("EnumResourceLanguagesA(%p,%hs,%hs,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_EnumResourceLanguagesA(a0, a1, a2, a3, a4); } __finally { _PrintExit("EnumResourceLanguagesA(,,,,) -> %p\n", rv); }; return rv; } #if _MSC_VER < 1300 BOOL __stdcall Mine_EnumResourceLanguagesW(HMODULE a0, LPCWSTR a1, LPCWSTR a2, ENUMRESLANGPROC a3, LONG_PTR a4) #else BOOL __stdcall Mine_EnumResourceLanguagesW(HMODULE a0, LPCWSTR a1, LPCWSTR a2, ENUMRESLANGPROCW a3, LONG_PTR a4) #endif { _PrintEnter("EnumResourceLanguagesW(%p,%ls,%ls,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_EnumResourceLanguagesW(a0, a1, a2, a3, a4); } __finally { _PrintExit("EnumResourceLanguagesW(,,,,) -> %p\n", rv); }; return rv; } #if _MSC_VER < 1300 BOOL __stdcall Mine_EnumResourceNamesA(HMODULE a0, LPCSTR a1, ENUMRESNAMEPROC a2, LONG_PTR a3) #else BOOL __stdcall Mine_EnumResourceNamesA(HMODULE a0, LPCSTR a1, ENUMRESNAMEPROCA a2, LONG_PTR a3) #endif { _PrintEnter("EnumResourceNamesA(%p,%hs,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_EnumResourceNamesA(a0, a1, a2, a3); } __finally { _PrintExit("EnumResourceNamesA(,,,) -> %p\n", rv); }; return rv; } #if _MSC_VER < 1300 BOOL __stdcall Mine_EnumResourceNamesW(HMODULE a0, LPCWSTR a1, ENUMRESNAMEPROC a2, LONG_PTR a3) #else BOOL __stdcall Mine_EnumResourceNamesW(HMODULE a0, LPCWSTR a1, ENUMRESNAMEPROCW a2, LONG_PTR a3) #endif { _PrintEnter("EnumResourceNamesW(%p,%ls,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_EnumResourceNamesW(a0, a1, a2, a3); } __finally { _PrintExit("EnumResourceNamesW(,,,) -> %p\n", rv); }; return rv; } #if _MSC_VER < 1300 BOOL __stdcall Mine_EnumResourceTypesA(HMODULE a0, ENUMRESTYPEPROC a1, LONG_PTR a2) #else BOOL __stdcall Mine_EnumResourceTypesA(HMODULE a0, ENUMRESTYPEPROCA a1, LONG_PTR a2) #endif { _PrintEnter("EnumResourceTypesA(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_EnumResourceTypesA(a0, a1, a2); } __finally { _PrintExit("EnumResourceTypesA(,,) -> %p\n", rv); }; return rv; } #if _MSC_VER < 1300 BOOL __stdcall Mine_EnumResourceTypesW(HMODULE a0, ENUMRESTYPEPROC a1, LONG_PTR a2) #else BOOL __stdcall Mine_EnumResourceTypesW(HMODULE a0, ENUMRESTYPEPROCW a1, LONG_PTR a2) #endif { _PrintEnter("EnumResourceTypesW(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_EnumResourceTypesW(a0, a1, a2); } __finally { _PrintExit("EnumResourceTypesW(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_EnumSystemCodePagesA(CODEPAGE_ENUMPROCA a0, DWORD a1) { _PrintEnter("EnumSystemCodePagesA(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_EnumSystemCodePagesA(a0, a1); } __finally { _PrintExit("EnumSystemCodePagesA(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_EnumSystemCodePagesW(CODEPAGE_ENUMPROCW a0, DWORD a1) { _PrintEnter("EnumSystemCodePagesW(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_EnumSystemCodePagesW(a0, a1); } __finally { _PrintExit("EnumSystemCodePagesW(,) -> %p\n", rv); }; return rv; } #if(WINVER >= 0x0500) BOOL __stdcall Mine_EnumSystemLocalesA(LOCALE_ENUMPROCA a0, DWORD a1) { _PrintEnter("EnumSystemLocalesA(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_EnumSystemLocalesA(a0, a1); } __finally { _PrintExit("EnumSystemLocalesA(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_EnumSystemLocalesW(LOCALE_ENUMPROCW a0, DWORD a1) { _PrintEnter("EnumSystemLocalesW(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_EnumSystemLocalesW(a0, a1); } __finally { _PrintExit("EnumSystemLocalesW(,) -> %p\n", rv); }; return rv; } #endif // (WINVER >= 0x0500) BOOL __stdcall Mine_EnumThreadWindows(DWORD a0, WNDENUMPROC a1, LPARAM a2) { _PrintEnter("EnumThreadWindows(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_EnumThreadWindows(a0, a1, a2); } __finally { _PrintExit("EnumThreadWindows(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_EnumTimeFormatsA(TIMEFMT_ENUMPROCA a0, LCID a1, DWORD a2) { _PrintEnter("EnumTimeFormatsA(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_EnumTimeFormatsA(a0, a1, a2); } __finally { _PrintExit("EnumTimeFormatsA(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_EnumTimeFormatsW(TIMEFMT_ENUMPROCW a0, LCID a1, DWORD a2) { _PrintEnter("EnumTimeFormatsW(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_EnumTimeFormatsW(a0, a1, a2); } __finally { _PrintExit("EnumTimeFormatsW(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_EnumWindowStationsA(WINSTAENUMPROCA a0, LPARAM a1) { _PrintEnter("EnumWindowStationsA(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_EnumWindowStationsA(a0, a1); } __finally { _PrintExit("EnumWindowStationsA(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_EnumWindowStationsW(WINSTAENUMPROCW a0, LPARAM a1) { _PrintEnter("EnumWindowStationsW(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_EnumWindowStationsW(a0, a1); } __finally { _PrintExit("EnumWindowStationsW(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_EnumWindows(WNDENUMPROC a0, LPARAM a1) { _PrintEnter("EnumWindows(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_EnumWindows(a0, a1); } __finally { _PrintExit("EnumWindows(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_EqualRect(RECT* a0, RECT* a1) { _PrintEnter("EqualRect(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_EqualRect(a0, a1); } __finally { _PrintExit("EqualRect(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_EqualRgn(HRGN a0, HRGN a1) { _PrintEnter("EqualRgn(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_EqualRgn(a0, a1); } __finally { _PrintExit("EqualRgn(,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_EraseTape(HANDLE a0, DWORD a1, BOOL a2) { _PrintEnter("EraseTape(%p,%p,%p)\n", a0, a1, a2); DWORD rv = 0; __try { rv = Real_EraseTape(a0, a1, a2); } __finally { _PrintExit("EraseTape(,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_Escape(HDC a0, int a1, int a2, LPCSTR a3, LPVOID a4) { _PrintEnter("Escape(%p,%p,%p,%hs,%p)\n", a0, a1, a2, a3, a4); int rv = 0; __try { rv = Real_Escape(a0, a1, a2, a3, a4); } __finally { _PrintExit("Escape(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_EscapeCommFunction(HANDLE a0, DWORD a1) { _PrintEnter("EscapeCommFunction(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_EscapeCommFunction(a0, a1); } __finally { _PrintExit("EscapeCommFunction(,) -> %p\n", rv); }; return rv; } int __stdcall Mine_ExcludeClipRect(HDC a0, int a1, int a2, int a3, int a4) { _PrintEnter("ExcludeClipRect(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); int rv = 0; __try { rv = Real_ExcludeClipRect(a0, a1, a2, a3, a4); } __finally { _PrintExit("ExcludeClipRect(,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_ExcludeUpdateRgn(HDC a0, HWND a1) { _PrintEnter("ExcludeUpdateRgn(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real_ExcludeUpdateRgn(a0, a1); } __finally { _PrintExit("ExcludeUpdateRgn(,) -> %p\n", rv); }; return rv; } void __stdcall Mine_ExitProcess(UINT a0) { _PrintEnter("ExitProcess(%p)\n", a0); __try { Real_ExitProcess(a0); } __finally { _PrintExit("ExitProcess() ->\n"); }; } void __stdcall Mine_ExitThread(DWORD a0) { _PrintEnter("ExitThread(%p)\n", a0); __try { Real_ExitThread(a0); } __finally { _PrintExit("ExitThread() ->\n"); }; } BOOL __stdcall Mine_ExitWindowsEx(UINT a0, DWORD a1) { _PrintEnter("ExitWindowsEx(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_ExitWindowsEx(a0, a1); } __finally { _PrintExit("ExitWindowsEx(,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_ExpandEnvironmentStringsA(LPCSTR a0, LPSTR a1, DWORD a2) { _PrintEnter("ExpandEnvironmentStringsA(%hs,%p,%p)\n", a0, a1, a2); DWORD rv = 0; __try { rv = Real_ExpandEnvironmentStringsA(a0, a1, a2); } __finally { _PrintExit("ExpandEnvironmentStringsA(,%hs,) -> %p\n", a1, rv); }; return rv; } DWORD __stdcall Mine_ExpandEnvironmentStringsW(LPCWSTR a0, LPWSTR a1, DWORD a2) { _PrintEnter("ExpandEnvironmentStringsW(%ls,%p,%p)\n", a0, a1, a2); DWORD rv = 0; __try { rv = Real_ExpandEnvironmentStringsW(a0, a1, a2); } __finally { _PrintExit("ExpandEnvironmentStringsW(,%ls,) -> %p\n", a1, rv); }; return rv; } HPEN __stdcall Mine_ExtCreatePen(DWORD a0, DWORD a1, LOGBRUSH* a2, DWORD a3, DWORD* a4) { _PrintEnter("ExtCreatePen(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); HPEN rv = 0; __try { rv = Real_ExtCreatePen(a0, a1, a2, a3, a4); } __finally { _PrintExit("ExtCreatePen(,,,,) -> %p\n", rv); }; return rv; } HRGN __stdcall Mine_ExtCreateRegion(XFORM* a0, DWORD a1, RGNDATA* a2) { _PrintEnter("ExtCreateRegion(%p,%p,%p)\n", a0, a1, a2); HRGN rv = 0; __try { rv = Real_ExtCreateRegion(a0, a1, a2); } __finally { _PrintExit("ExtCreateRegion(,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_ExtEscape(HDC a0, int a1, int a2, LPCSTR a3, int a4, LPSTR a5) { _PrintEnter("ExtEscape(%p,%p,%p,%hs,%p,%p)\n", a0, a1, a2, a3, a4, a5); int rv = 0; __try { rv = Real_ExtEscape(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("ExtEscape(,,,,,%hs) -> %p\n", a5, rv); }; return rv; } BOOL __stdcall Mine_ExtFloodFill(HDC a0, int a1, int a2, COLORREF a3, UINT a4) { _PrintEnter("ExtFloodFill(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_ExtFloodFill(a0, a1, a2, a3, a4); } __finally { _PrintExit("ExtFloodFill(,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_ExtSelectClipRgn(HDC a0, HRGN a1, int a2) { _PrintEnter("ExtSelectClipRgn(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_ExtSelectClipRgn(a0, a1, a2); } __finally { _PrintExit("ExtSelectClipRgn(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ExtTextOutA(HDC a0, int a1, int a2, UINT a3, RECT* a4, LPCSTR a5, UINT a6, INT* a7) { _PrintEnter("ExtTextOutA(%p,%p,%p,%p,%p,%hs,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7); BOOL rv = 0; __try { rv = Real_ExtTextOutA(a0, a1, a2, a3, a4, a5, a6, a7); } __finally { _PrintExit("ExtTextOutA(,,,,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ExtTextOutW(HDC a0, int a1, int a2, UINT a3, RECT* a4, LPCWSTR a5, UINT a6, INT* a7) { _PrintEnter("ExtTextOutW(%p,%p,%p,%p,%p,%ls,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7); BOOL rv = 0; __try { rv = Real_ExtTextOutW(a0, a1, a2, a3, a4, a5, a6, a7); } __finally { _PrintExit("ExtTextOutW(,,,,,,,) -> %p\n", rv); }; return rv; } void __stdcall Mine_FatalAppExitA(UINT a0, LPCSTR a1) { _PrintEnter("FatalAppExitA(%p,%hs)\n", a0, a1); __try { Real_FatalAppExitA(a0, a1); } __finally { _PrintExit("FatalAppExitA(,) ->\n"); }; } void __stdcall Mine_FatalAppExitW(UINT a0, LPCWSTR a1) { _PrintEnter("FatalAppExitW(%p,%ls)\n", a0, a1); __try { Real_FatalAppExitW(a0, a1); } __finally { _PrintExit("FatalAppExitW(,) ->\n"); }; } void __stdcall Mine_FatalExit(int a0) { _PrintEnter("FatalExit(%p)\n", a0); __try { Real_FatalExit(a0); } __finally { _PrintExit("FatalExit() ->\n"); }; } BOOL __stdcall Mine_FileTimeToDosDateTime(FILETIME* a0, LPWORD a1, LPWORD a2) { _PrintEnter("FileTimeToDosDateTime(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_FileTimeToDosDateTime(a0, a1, a2); } __finally { _PrintExit("FileTimeToDosDateTime(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_FileTimeToLocalFileTime(FILETIME* a0, LPFILETIME a1) { _PrintEnter("FileTimeToLocalFileTime(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_FileTimeToLocalFileTime(a0, a1); } __finally { _PrintExit("FileTimeToLocalFileTime(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_FileTimeToSystemTime(FILETIME* a0, LPSYSTEMTIME a1) { _PrintEnter("FileTimeToSystemTime(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_FileTimeToSystemTime(a0, a1); } __finally { _PrintExit("FileTimeToSystemTime(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_FillConsoleOutputAttribute(HANDLE a0, WORD a1, DWORD a2, COORD a3, LPDWORD a4) { _PrintEnter("FillConsoleOutputAttribute(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_FillConsoleOutputAttribute(a0, a1, a2, a3, a4); } __finally { _PrintExit("FillConsoleOutputAttribute(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_FillConsoleOutputCharacterA(HANDLE a0, CHAR a1, DWORD a2, COORD a3, LPDWORD a4) { _PrintEnter("FillConsoleOutputCharacterA(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_FillConsoleOutputCharacterA(a0, a1, a2, a3, a4); } __finally { _PrintExit("FillConsoleOutputCharacterA(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_FillConsoleOutputCharacterW(HANDLE a0, WCHAR a1, DWORD a2, COORD a3, LPDWORD a4) { _PrintEnter("FillConsoleOutputCharacterW(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_FillConsoleOutputCharacterW(a0, a1, a2, a3, a4); } __finally { _PrintExit("FillConsoleOutputCharacterW(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_FillPath(HDC a0) { _PrintEnter("FillPath(%p)\n", a0); BOOL rv = 0; __try { rv = Real_FillPath(a0); } __finally { _PrintExit("FillPath() -> %p\n", rv); }; return rv; } int __stdcall Mine_FillRect(HDC a0, RECT* a1, HBRUSH a2) { _PrintEnter("FillRect(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_FillRect(a0, a1, a2); } __finally { _PrintExit("FillRect(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_FillRgn(HDC a0, HRGN a1, HBRUSH a2) { _PrintEnter("FillRgn(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_FillRgn(a0, a1, a2); } __finally { _PrintExit("FillRgn(,,) -> %p\n", rv); }; return rv; } ATOM __stdcall Mine_FindAtomA(LPCSTR a0) { _PrintEnter("FindAtomA(%hs)\n", a0); ATOM rv = 0; __try { rv = Real_FindAtomA(a0); } __finally { _PrintExit("FindAtomA() -> %p\n", rv); }; return rv; } ATOM __stdcall Mine_FindAtomW(LPCWSTR a0) { _PrintEnter("FindAtomW(%ls)\n", a0); ATOM rv = 0; __try { rv = Real_FindAtomW(a0); } __finally { _PrintExit("FindAtomW() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_FindClose(HANDLE a0) { _PrintEnter("FindClose(%p)\n", a0); BOOL rv = 0; __try { rv = Real_FindClose(a0); } __finally { _PrintExit("FindClose() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_FindCloseChangeNotification(HANDLE a0) { _PrintEnter("FindCloseChangeNotification(%p)\n", a0); BOOL rv = 0; __try { rv = Real_FindCloseChangeNotification(a0); } __finally { _PrintExit("FindCloseChangeNotification() -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_FindFirstChangeNotificationA(LPCSTR a0, BOOL a1, DWORD a2) { _PrintEnter("FindFirstChangeNotificationA(%hs,%p,%p)\n", a0, a1, a2); HANDLE rv = 0; __try { rv = Real_FindFirstChangeNotificationA(a0, a1, a2); } __finally { _PrintExit("FindFirstChangeNotificationA(,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_FindFirstChangeNotificationW(LPCWSTR a0, BOOL a1, DWORD a2) { _PrintEnter("FindFirstChangeNotificationW(%ls,%p,%p)\n", a0, a1, a2); HANDLE rv = 0; __try { rv = Real_FindFirstChangeNotificationW(a0, a1, a2); } __finally { _PrintExit("FindFirstChangeNotificationW(,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_FindFirstFileA(LPCSTR a0, LPWIN32_FIND_DATAA a1) { _PrintEnter("FindFirstFileA(%hs,%p)\n", a0, a1); HANDLE rv = 0; __try { rv = Real_FindFirstFileA(a0, a1); } __finally { _PrintExit("FindFirstFileA(,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_FindFirstFileExA(LPCSTR a0, FINDEX_INFO_LEVELS a1, LPVOID a2, FINDEX_SEARCH_OPS a3, LPVOID a4, DWORD a5) { _PrintEnter("FindFirstFileExA(%hs,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); HANDLE rv = 0; __try { rv = Real_FindFirstFileExA(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("FindFirstFileExA(,,,,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_FindFirstFileExW(LPCWSTR a0, FINDEX_INFO_LEVELS a1, LPVOID a2, FINDEX_SEARCH_OPS a3, LPVOID a4, DWORD a5) { _PrintEnter("FindFirstFileExW(%ls,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); HANDLE rv = 0; __try { rv = Real_FindFirstFileExW(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("FindFirstFileExW(,,,,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_FindFirstFileW(LPCWSTR a0, LPWIN32_FIND_DATAW a1) { _PrintEnter("FindFirstFileW(%ls,%p)\n", a0, a1); HANDLE rv = 0; __try { rv = Real_FindFirstFileW(a0, a1); } __finally { _PrintExit("FindFirstFileW(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_FindNextChangeNotification(HANDLE a0) { _PrintEnter("FindNextChangeNotification(%p)\n", a0); BOOL rv = 0; __try { rv = Real_FindNextChangeNotification(a0); } __finally { _PrintExit("FindNextChangeNotification() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_FindNextFileA(HANDLE a0, LPWIN32_FIND_DATAA a1) { _PrintEnter("FindNextFileA(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_FindNextFileA(a0, a1); } __finally { _PrintExit("FindNextFileA(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_FindNextFileW(HANDLE a0, LPWIN32_FIND_DATAW a1) { _PrintEnter("FindNextFileW(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_FindNextFileW(a0, a1); } __finally { _PrintExit("FindNextFileW(,) -> %p\n", rv); }; return rv; } HRSRC __stdcall Mine_FindResourceA(HMODULE a0, LPCSTR a1, LPCSTR a2) { _PrintEnter("FindResourceA(%p,%hs,%hs)\n", a0, a1, a2); HRSRC rv = 0; __try { rv = Real_FindResourceA(a0, a1, a2); } __finally { _PrintExit("FindResourceA(,,) -> %p\n", rv); }; return rv; } HRSRC __stdcall Mine_FindResourceExA(HMODULE a0, LPCSTR a1, LPCSTR a2, WORD a3) { _PrintEnter("FindResourceExA(%p,%hs,%hs,%p)\n", a0, a1, a2, a3); HRSRC rv = 0; __try { rv = Real_FindResourceExA(a0, a1, a2, a3); } __finally { _PrintExit("FindResourceExA(,,,) -> %p\n", rv); }; return rv; } HRSRC __stdcall Mine_FindResourceExW(HMODULE a0, LPCWSTR a1, LPCWSTR a2, WORD a3) { _PrintEnter("FindResourceExW(%p,%ls,%ls,%p)\n", a0, a1, a2, a3); HRSRC rv = 0; __try { rv = Real_FindResourceExW(a0, a1, a2, a3); } __finally { _PrintExit("FindResourceExW(,,,) -> %p\n", rv); }; return rv; } HRSRC __stdcall Mine_FindResourceW(HMODULE a0, LPCWSTR a1, LPCWSTR a2) { _PrintEnter("FindResourceW(%p,%ls,%ls)\n", a0, a1, a2); HRSRC rv = 0; __try { rv = Real_FindResourceW(a0, a1, a2); } __finally { _PrintExit("FindResourceW(,,) -> %p\n", rv); }; return rv; } HWND __stdcall Mine_FindWindowA(LPCSTR a0, LPCSTR a1) { _PrintEnter("FindWindowA(%hs,%hs)\n", a0, a1); HWND rv = 0; __try { rv = Real_FindWindowA(a0, a1); } __finally { _PrintExit("FindWindowA(,) -> %p\n", rv); }; return rv; } HWND __stdcall Mine_FindWindowExA(HWND a0, HWND a1, LPCSTR a2, LPCSTR a3) { _PrintEnter("FindWindowExA(%p,%p,%hs,%hs)\n", a0, a1, a2, a3); HWND rv = 0; __try { rv = Real_FindWindowExA(a0, a1, a2, a3); } __finally { _PrintExit("FindWindowExA(,,,) -> %p\n", rv); }; return rv; } HWND __stdcall Mine_FindWindowExW(HWND a0, HWND a1, LPCWSTR a2, LPCWSTR a3) { _PrintEnter("FindWindowExW(%p,%p,%ls,%ls)\n", a0, a1, a2, a3); HWND rv = 0; __try { rv = Real_FindWindowExW(a0, a1, a2, a3); } __finally { _PrintExit("FindWindowExW(,,,) -> %p\n", rv); }; return rv; } HWND __stdcall Mine_FindWindowW(LPCWSTR a0, LPCWSTR a1) { _PrintEnter("FindWindowW(%ls,%ls)\n", a0, a1); HWND rv = 0; __try { rv = Real_FindWindowW(a0, a1); } __finally { _PrintExit("FindWindowW(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_FixBrushOrgEx(HDC a0, int a1, int a2, POINT* a3) { _PrintEnter("FixBrushOrgEx(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_FixBrushOrgEx(a0, a1, a2, a3); } __finally { _PrintExit("FixBrushOrgEx(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_FlashWindow(HWND a0, BOOL a1) { _PrintEnter("FlashWindow(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_FlashWindow(a0, a1); } __finally { _PrintExit("FlashWindow(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_FlattenPath(HDC a0) { _PrintEnter("FlattenPath(%p)\n", a0); BOOL rv = 0; __try { rv = Real_FlattenPath(a0); } __finally { _PrintExit("FlattenPath() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_FloodFill(HDC a0, int a1, int a2, COLORREF a3) { _PrintEnter("FloodFill(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_FloodFill(a0, a1, a2, a3); } __finally { _PrintExit("FloodFill(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_FlushConsoleInputBuffer(HANDLE a0) { _PrintEnter("FlushConsoleInputBuffer(%p)\n", a0); BOOL rv = 0; __try { rv = Real_FlushConsoleInputBuffer(a0); } __finally { _PrintExit("FlushConsoleInputBuffer() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_FlushFileBuffers(HANDLE a0) { _PrintEnter("FlushFileBuffers(%p)\n", a0); BOOL rv = 0; __try { rv = Real_FlushFileBuffers(a0); } __finally { _PrintExit("FlushFileBuffers() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_FlushViewOfFile(LPCVOID a0, SIZE_T a1) { _PrintEnter("FlushViewOfFile(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_FlushViewOfFile(a0, a1); } __finally { _PrintExit("FlushViewOfFile(,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_FmtIdToPropStgName(FMTID* a0, LPOLESTR a1) { _PrintEnter("FmtIdToPropStgName(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_FmtIdToPropStgName(a0, a1); } __finally { _PrintExit("FmtIdToPropStgName(,) -> %p\n", rv); }; return rv; } int __stdcall Mine_FoldStringA(DWORD a0, LPCSTR a1, int a2, LPSTR a3, int a4) { _PrintEnter("FoldStringA(%p,%hs,%p,%p,%p)\n", a0, a1, a2, a3, a4); int rv = 0; __try { rv = Real_FoldStringA(a0, a1, a2, a3, a4); } __finally { _PrintExit("FoldStringA(,,,%hs,) -> %p\n", a3, rv); }; return rv; } int __stdcall Mine_FoldStringW(DWORD a0, LPCWSTR a1, int a2, LPWSTR a3, int a4) { _PrintEnter("FoldStringW(%p,%ls,%p,%p,%p)\n", a0, a1, a2, a3, a4); int rv = 0; __try { rv = Real_FoldStringW(a0, a1, a2, a3, a4); } __finally { _PrintExit("FoldStringW(,,,%ls,) -> %p\n", a3, rv); }; return rv; } DWORD __stdcall Mine_FormatMessageA(DWORD a0, LPCVOID a1, DWORD a2, DWORD a3, LPSTR a4, DWORD a5, va_list* a6) { _PrintEnter("FormatMessageA(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); DWORD rv = 0; __try { rv = Real_FormatMessageA(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("FormatMessageA(,,,,%hs,,) -> %p\n", a4, rv); }; return rv; } DWORD __stdcall Mine_FormatMessageW(DWORD a0, LPCVOID a1, DWORD a2, DWORD a3, LPWSTR a4, DWORD a5, va_list* a6) { _PrintEnter("FormatMessageW(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); DWORD rv = 0; __try { rv = Real_FormatMessageW(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("FormatMessageW(,,,,%ls,,) -> %p\n", a4, rv); }; return rv; } int __stdcall Mine_FrameRect(HDC a0, RECT* a1, HBRUSH a2) { _PrintEnter("FrameRect(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_FrameRect(a0, a1, a2); } __finally { _PrintExit("FrameRect(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_FrameRgn(HDC a0, HRGN a1, HBRUSH a2, int a3, int a4) { _PrintEnter("FrameRgn(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_FrameRgn(a0, a1, a2, a3, a4); } __finally { _PrintExit("FrameRgn(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_FreeConsole(void) { _PrintEnter("FreeConsole()\n"); BOOL rv = 0; __try { rv = Real_FreeConsole(); } __finally { _PrintExit("FreeConsole() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_FreeDDElParam(UINT a0, LPARAM a1) { _PrintEnter("FreeDDElParam(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_FreeDDElParam(a0, a1); } __finally { _PrintExit("FreeDDElParam(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_FreeEnvironmentStringsA(LPSTR a0) { _PrintEnter("FreeEnvironmentStringsA(%hs)\n", a0); BOOL rv = 0; __try { rv = Real_FreeEnvironmentStringsA(a0); } __finally { _PrintExit("FreeEnvironmentStringsA() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_FreeEnvironmentStringsW(LPWSTR a0) { _PrintEnter("FreeEnvironmentStringsW(%ls)\n", a0); BOOL rv = 0; __try { rv = Real_FreeEnvironmentStringsW(a0); } __finally { _PrintExit("FreeEnvironmentStringsW() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_FreeLibrary(HMODULE a0) { _PrintEnter("FreeLibrary(%p)\n", a0); BOOL rv = 0; __try { rv = Real_FreeLibrary(a0); } __finally { _PrintExit("FreeLibrary() -> %p\n", rv); }; return rv; } void __stdcall Mine_FreeLibraryAndExitThread(HMODULE a0, DWORD a1) { _PrintEnter("FreeLibraryAndExitThread(%p,%p)\n", a0, a1); __try { Real_FreeLibraryAndExitThread(a0, a1); } __finally { _PrintExit("FreeLibraryAndExitThread(,) ->\n"); }; } HRESULT __stdcall Mine_FreePropVariantArray(ULONG a0, PROPVARIANT* a1) { _PrintEnter("FreePropVariantArray(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_FreePropVariantArray(a0, a1); } __finally { _PrintExit("FreePropVariantArray(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_FreeResource(HGLOBAL a0) { _PrintEnter("FreeResource(%p)\n", a0); BOOL rv = 0; __try { rv = Real_FreeResource(a0); } __finally { _PrintExit("FreeResource() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GdiComment(HDC a0, UINT a1, BYTE* a2) { _PrintEnter("GdiComment(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_GdiComment(a0, a1, a2); } __finally { _PrintExit("GdiComment(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GdiFlush(void) { _PrintEnter("GdiFlush()\n"); BOOL rv = 0; __try { rv = Real_GdiFlush(); } __finally { _PrintExit("GdiFlush() -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GdiGetBatchLimit(void) { _PrintEnter("GdiGetBatchLimit()\n"); DWORD rv = 0; __try { rv = Real_GdiGetBatchLimit(); } __finally { _PrintExit("GdiGetBatchLimit() -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GdiSetBatchLimit(DWORD a0) { _PrintEnter("GdiSetBatchLimit(%p)\n", a0); DWORD rv = 0; __try { rv = Real_GdiSetBatchLimit(a0); } __finally { _PrintExit("GdiSetBatchLimit() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GenerateConsoleCtrlEvent(DWORD a0, DWORD a1) { _PrintEnter("GenerateConsoleCtrlEvent(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GenerateConsoleCtrlEvent(a0, a1); } __finally { _PrintExit("GenerateConsoleCtrlEvent(,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_GetACP(void) { _PrintEnter("GetACP()\n"); UINT rv = 0; __try { rv = Real_GetACP(); } __finally { _PrintExit("GetACP() -> %p\n", rv); }; return rv; } HWND __stdcall Mine_GetActiveWindow(void) { _PrintEnter("GetActiveWindow()\n"); HWND rv = 0; __try { rv = Real_GetActiveWindow(); } __finally { _PrintExit("GetActiveWindow() -> %p\n", rv); }; return rv; } int __stdcall Mine_GetArcDirection(HDC a0) { _PrintEnter("GetArcDirection(%p)\n", a0); int rv = 0; __try { rv = Real_GetArcDirection(a0); } __finally { _PrintExit("GetArcDirection() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetAspectRatioFilterEx(HDC a0, SIZE* a1) { _PrintEnter("GetAspectRatioFilterEx(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetAspectRatioFilterEx(a0, a1); } __finally { _PrintExit("GetAspectRatioFilterEx(,) -> %p\n", rv); }; return rv; } SHORT __stdcall Mine_GetAsyncKeyState(int a0) { _PrintEnter("GetAsyncKeyState(%p)\n", a0); SHORT rv = 0; __try { rv = Real_GetAsyncKeyState(a0); } __finally { _PrintExit("GetAsyncKeyState() -> %p\n", rv); }; return rv; } UINT __stdcall Mine_GetAtomNameA(ATOM a0, LPSTR a1, int a2) { _PrintEnter("GetAtomNameA(%p,%p,%p)\n", a0, a1, a2); UINT rv = 0; __try { rv = Real_GetAtomNameA(a0, a1, a2); } __finally { _PrintExit("GetAtomNameA(,%hs,) -> %p\n", a1, rv); }; return rv; } UINT __stdcall Mine_GetAtomNameW(ATOM a0, LPWSTR a1, int a2) { _PrintEnter("GetAtomNameW(%p,%p,%p)\n", a0, a1, a2); UINT rv = 0; __try { rv = Real_GetAtomNameW(a0, a1, a2); } __finally { _PrintExit("GetAtomNameW(,%ls,) -> %p\n", a1, rv); }; return rv; } BOOL __stdcall Mine_GetBinaryTypeA(LPCSTR a0, LPDWORD a1) { _PrintEnter("GetBinaryTypeA(%hs,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetBinaryTypeA(a0, a1); } __finally { _PrintExit("GetBinaryTypeA(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetBinaryTypeW(LPCWSTR a0, LPDWORD a1) { _PrintEnter("GetBinaryTypeW(%ls,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetBinaryTypeW(a0, a1); } __finally { _PrintExit("GetBinaryTypeW(,) -> %p\n", rv); }; return rv; } LONG __stdcall Mine_GetBitmapBits(HBITMAP a0, LONG a1, LPVOID a2) { _PrintEnter("GetBitmapBits(%p,%p,%p)\n", a0, a1, a2); LONG rv = 0; __try { rv = Real_GetBitmapBits(a0, a1, a2); } __finally { _PrintExit("GetBitmapBits(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetBitmapDimensionEx(HBITMAP a0, SIZE* a1) { _PrintEnter("GetBitmapDimensionEx(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetBitmapDimensionEx(a0, a1); } __finally { _PrintExit("GetBitmapDimensionEx(,) -> %p\n", rv); }; return rv; } COLORREF __stdcall Mine_GetBkColor(HDC a0) { _PrintEnter("GetBkColor(%p)\n", a0); COLORREF rv = 0; __try { rv = Real_GetBkColor(a0); } __finally { _PrintExit("GetBkColor() -> %p\n", rv); }; return rv; } int __stdcall Mine_GetBkMode(HDC a0) { _PrintEnter("GetBkMode(%p)\n", a0); int rv = 0; __try { rv = Real_GetBkMode(a0); } __finally { _PrintExit("GetBkMode() -> %p\n", rv); }; return rv; } UINT __stdcall Mine_GetBoundsRect(HDC a0, LPRECT a1, UINT a2) { _PrintEnter("GetBoundsRect(%p,%p,%p)\n", a0, a1, a2); UINT rv = 0; __try { rv = Real_GetBoundsRect(a0, a1, a2); } __finally { _PrintExit("GetBoundsRect(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetBrushOrgEx(HDC a0, POINT* a1) { _PrintEnter("GetBrushOrgEx(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetBrushOrgEx(a0, a1); } __finally { _PrintExit("GetBrushOrgEx(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetCPInfo(UINT a0, LPCPINFO a1) { _PrintEnter("GetCPInfo(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetCPInfo(a0, a1); } __finally { _PrintExit("GetCPInfo(,) -> %p\n", rv); }; return rv; } HWND __stdcall Mine_GetCapture(void) { _PrintEnter("GetCapture()\n"); HWND rv = 0; __try { rv = Real_GetCapture(); } __finally { _PrintExit("GetCapture() -> %p\n", rv); }; return rv; } UINT __stdcall Mine_GetCaretBlinkTime(void) { _PrintEnter("GetCaretBlinkTime()\n"); UINT rv = 0; __try { rv = Real_GetCaretBlinkTime(); } __finally { _PrintExit("GetCaretBlinkTime() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetCaretPos(POINT* a0) { _PrintEnter("GetCaretPos(%p)\n", a0); BOOL rv = 0; __try { rv = Real_GetCaretPos(a0); } __finally { _PrintExit("GetCaretPos() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetCharABCWidthsA(HDC a0, UINT a1, UINT a2, LPABC a3) { _PrintEnter("GetCharABCWidthsA(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_GetCharABCWidthsA(a0, a1, a2, a3); } __finally { _PrintExit("GetCharABCWidthsA(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetCharABCWidthsFloatA(HDC a0, UINT a1, UINT a2, LPABCFLOAT a3) { _PrintEnter("GetCharABCWidthsFloatA(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_GetCharABCWidthsFloatA(a0, a1, a2, a3); } __finally { _PrintExit("GetCharABCWidthsFloatA(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetCharABCWidthsFloatW(HDC a0, UINT a1, UINT a2, LPABCFLOAT a3) { _PrintEnter("GetCharABCWidthsFloatW(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_GetCharABCWidthsFloatW(a0, a1, a2, a3); } __finally { _PrintExit("GetCharABCWidthsFloatW(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetCharABCWidthsW(HDC a0, UINT a1, UINT a2, LPABC a3) { _PrintEnter("GetCharABCWidthsW(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_GetCharABCWidthsW(a0, a1, a2, a3); } __finally { _PrintExit("GetCharABCWidthsW(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetCharWidth32A(HDC a0, UINT a1, UINT a2, LPINT a3) { _PrintEnter("GetCharWidth32A(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_GetCharWidth32A(a0, a1, a2, a3); } __finally { _PrintExit("GetCharWidth32A(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetCharWidth32W(HDC a0, UINT a1, UINT a2, LPINT a3) { _PrintEnter("GetCharWidth32W(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_GetCharWidth32W(a0, a1, a2, a3); } __finally { _PrintExit("GetCharWidth32W(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetCharWidthA(HDC a0, UINT a1, UINT a2, LPINT a3) { _PrintEnter("GetCharWidthA(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_GetCharWidthA(a0, a1, a2, a3); } __finally { _PrintExit("GetCharWidthA(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetCharWidthFloatA(HDC a0, UINT a1, UINT a2, PFLOAT a3) { _PrintEnter("GetCharWidthFloatA(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_GetCharWidthFloatA(a0, a1, a2, a3); } __finally { _PrintExit("GetCharWidthFloatA(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetCharWidthFloatW(HDC a0, UINT a1, UINT a2, PFLOAT a3) { _PrintEnter("GetCharWidthFloatW(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_GetCharWidthFloatW(a0, a1, a2, a3); } __finally { _PrintExit("GetCharWidthFloatW(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetCharWidthW(HDC a0, UINT a1, UINT a2, LPINT a3) { _PrintEnter("GetCharWidthW(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_GetCharWidthW(a0, a1, a2, a3); } __finally { _PrintExit("GetCharWidthW(,,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetCharacterPlacementA(HDC a0, LPCSTR a1, int a2, int a3, LPGCP_RESULTSA a4, DWORD a5) { _PrintEnter("GetCharacterPlacementA(%p,%hs,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); DWORD rv = 0; __try { rv = Real_GetCharacterPlacementA(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("GetCharacterPlacementA(,,,,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetCharacterPlacementW(HDC a0, LPCWSTR a1, int a2, int a3, LPGCP_RESULTSW a4, DWORD a5) { _PrintEnter("GetCharacterPlacementW(%p,%ls,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); DWORD rv = 0; __try { rv = Real_GetCharacterPlacementW(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("GetCharacterPlacementW(,,,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_GetClassFile(LPCOLESTR a0, CLSID* a1) { _PrintEnter("GetClassFile(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_GetClassFile(a0, a1); } __finally { _PrintExit("GetClassFile(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetClassInfoA(HINSTANCE a0, LPCSTR a1, LPWNDCLASSA a2) { _PrintEnter("GetClassInfoA(%p,%hs,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_GetClassInfoA(a0, a1, a2); } __finally { _PrintExit("GetClassInfoA(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetClassInfoExA(HINSTANCE a0, LPCSTR a1, LPWNDCLASSEXA a2) { _PrintEnter("GetClassInfoExA(%p,%hs,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_GetClassInfoExA(a0, a1, a2); } __finally { _PrintExit("GetClassInfoExA(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetClassInfoExW(HINSTANCE a0, LPCWSTR a1, LPWNDCLASSEXW a2) { _PrintEnter("GetClassInfoExW(%p,%ls,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_GetClassInfoExW(a0, a1, a2); } __finally { _PrintExit("GetClassInfoExW(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetClassInfoW(HINSTANCE a0, LPCWSTR a1, LPWNDCLASSW a2) { _PrintEnter("GetClassInfoW(%p,%ls,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_GetClassInfoW(a0, a1, a2); } __finally { _PrintExit("GetClassInfoW(,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetClassLongA(HWND a0, int a1) { _PrintEnter("GetClassLongA(%p,%p)\n", a0, a1); DWORD rv = 0; __try { rv = Real_GetClassLongA(a0, a1); } __finally { _PrintExit("GetClassLongA(,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetClassLongW(HWND a0, int a1) { _PrintEnter("GetClassLongW(%p,%p)\n", a0, a1); DWORD rv = 0; __try { rv = Real_GetClassLongW(a0, a1); } __finally { _PrintExit("GetClassLongW(,) -> %p\n", rv); }; return rv; } int __stdcall Mine_GetClassNameA(HWND a0, LPSTR a1, int a2) { _PrintEnter("GetClassNameA(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_GetClassNameA(a0, a1, a2); } __finally { _PrintExit("GetClassNameA(,%hs,) -> %p\n", a1, rv); }; return rv; } int __stdcall Mine_GetClassNameW(HWND a0, LPWSTR a1, int a2) { _PrintEnter("GetClassNameW(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_GetClassNameW(a0, a1, a2); } __finally { _PrintExit("GetClassNameW(,%ls,) -> %p\n", a1, rv); }; return rv; } WORD __stdcall Mine_GetClassWord(HWND a0, int a1) { _PrintEnter("GetClassWord(%p,%p)\n", a0, a1); WORD rv = 0; __try { rv = Real_GetClassWord(a0, a1); } __finally { _PrintExit("GetClassWord(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetClientRect(HWND a0, LPRECT a1) { _PrintEnter("GetClientRect(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetClientRect(a0, a1); } __finally { _PrintExit("GetClientRect(,) -> %p\n", rv); }; return rv; } int __stdcall Mine_GetClipBox(HDC a0, LPRECT a1) { _PrintEnter("GetClipBox(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real_GetClipBox(a0, a1); } __finally { _PrintExit("GetClipBox(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetClipCursor(LPRECT a0) { _PrintEnter("GetClipCursor(%p)\n", a0); BOOL rv = 0; __try { rv = Real_GetClipCursor(a0); } __finally { _PrintExit("GetClipCursor() -> %p\n", rv); }; return rv; } int __stdcall Mine_GetClipRgn(HDC a0, HRGN a1) { _PrintEnter("GetClipRgn(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real_GetClipRgn(a0, a1); } __finally { _PrintExit("GetClipRgn(,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_GetClipboardData(UINT a0) { _PrintEnter("GetClipboardData(%p)\n", a0); HANDLE rv = 0; __try { rv = Real_GetClipboardData(a0); } __finally { _PrintExit("GetClipboardData() -> %p\n", rv); }; return rv; } int __stdcall Mine_GetClipboardFormatNameA(UINT a0, LPSTR a1, int a2) { _PrintEnter("GetClipboardFormatNameA(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_GetClipboardFormatNameA(a0, a1, a2); } __finally { _PrintExit("GetClipboardFormatNameA(,%hs,) -> %p\n", a1, rv); }; return rv; } int __stdcall Mine_GetClipboardFormatNameW(UINT a0, LPWSTR a1, int a2) { _PrintEnter("GetClipboardFormatNameW(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_GetClipboardFormatNameW(a0, a1, a2); } __finally { _PrintExit("GetClipboardFormatNameW(,%ls,) -> %p\n", a1, rv); }; return rv; } HWND __stdcall Mine_GetClipboardOwner(void) { _PrintEnter("GetClipboardOwner()\n"); HWND rv = 0; __try { rv = Real_GetClipboardOwner(); } __finally { _PrintExit("GetClipboardOwner() -> %p\n", rv); }; return rv; } HWND __stdcall Mine_GetClipboardViewer(void) { _PrintEnter("GetClipboardViewer()\n"); HWND rv = 0; __try { rv = Real_GetClipboardViewer(); } __finally { _PrintExit("GetClipboardViewer() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetColorAdjustment(HDC a0, LPCOLORADJUSTMENT a1) { _PrintEnter("GetColorAdjustment(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetColorAdjustment(a0, a1); } __finally { _PrintExit("GetColorAdjustment(,) -> %p\n", rv); }; return rv; } HCOLORSPACE __stdcall Mine_GetColorSpace(HDC a0) { _PrintEnter("GetColorSpace(%p)\n", a0); HCOLORSPACE rv = 0; __try { rv = Real_GetColorSpace(a0); } __finally { _PrintExit("GetColorSpace() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetCommConfig(HANDLE a0, LPCOMMCONFIG a1, LPDWORD a2) { _PrintEnter("GetCommConfig(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_GetCommConfig(a0, a1, a2); } __finally { _PrintExit("GetCommConfig(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetCommMask(HANDLE a0, LPDWORD a1) { _PrintEnter("GetCommMask(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetCommMask(a0, a1); } __finally { _PrintExit("GetCommMask(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetCommModemStatus(HANDLE a0, LPDWORD a1) { _PrintEnter("GetCommModemStatus(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetCommModemStatus(a0, a1); } __finally { _PrintExit("GetCommModemStatus(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetCommProperties(HANDLE a0, LPCOMMPROP a1) { _PrintEnter("GetCommProperties(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetCommProperties(a0, a1); } __finally { _PrintExit("GetCommProperties(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetCommState(HANDLE a0, LPDCB a1) { _PrintEnter("GetCommState(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetCommState(a0, a1); } __finally { _PrintExit("GetCommState(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetCommTimeouts(HANDLE a0, LPCOMMTIMEOUTS a1) { _PrintEnter("GetCommTimeouts(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetCommTimeouts(a0, a1); } __finally { _PrintExit("GetCommTimeouts(,) -> %p\n", rv); }; return rv; } LPSTR __stdcall Mine_GetCommandLineA(void) { _PrintEnter("GetCommandLineA()\n"); LPSTR rv = 0; __try { rv = Real_GetCommandLineA(); } __finally { _PrintExit("GetCommandLineA() -> %hs\n", rv); }; return rv; } LPWSTR __stdcall Mine_GetCommandLineW(void) { _PrintEnter("GetCommandLineW()\n"); LPWSTR rv = 0; __try { rv = Real_GetCommandLineW(); } __finally { _PrintExit("GetCommandLineW() -> %ls\n", rv); }; return rv; } BOOL __stdcall Mine_GetComputerNameA(LPSTR a0, LPDWORD a1) { _PrintEnter("GetComputerNameA(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetComputerNameA(a0, a1); } __finally { _PrintExit("GetComputerNameA(%hs,) -> %p\n", a0, rv); }; return rv; } BOOL __stdcall Mine_GetComputerNameW(LPWSTR a0, LPDWORD a1) { _PrintEnter("GetComputerNameW(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetComputerNameW(a0, a1); } __finally { _PrintExit("GetComputerNameW(%ls,) -> %p\n", a0, rv); }; return rv; } UINT __stdcall Mine_GetConsoleCP(void) { _PrintEnter("GetConsoleCP()\n"); UINT rv = 0; __try { rv = Real_GetConsoleCP(); } __finally { _PrintExit("GetConsoleCP() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetConsoleCursorInfo(HANDLE a0, PCONSOLE_CURSOR_INFO a1) { _PrintEnter("GetConsoleCursorInfo(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetConsoleCursorInfo(a0, a1); } __finally { _PrintExit("GetConsoleCursorInfo(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetConsoleMode(HANDLE a0, LPDWORD a1) { _PrintEnter("GetConsoleMode(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetConsoleMode(a0, a1); } __finally { _PrintExit("GetConsoleMode(,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_GetConsoleOutputCP(void) { _PrintEnter("GetConsoleOutputCP()\n"); UINT rv = 0; __try { rv = Real_GetConsoleOutputCP(); } __finally { _PrintExit("GetConsoleOutputCP() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetConsoleScreenBufferInfo(HANDLE a0, PCONSOLE_SCREEN_BUFFER_INFO a1) { _PrintEnter("GetConsoleScreenBufferInfo(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetConsoleScreenBufferInfo(a0, a1); } __finally { _PrintExit("GetConsoleScreenBufferInfo(,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetConsoleTitleA(LPSTR a0, DWORD a1) { _PrintEnter("GetConsoleTitleA(%p,%p)\n", a0, a1); DWORD rv = 0; __try { rv = Real_GetConsoleTitleA(a0, a1); } __finally { _PrintExit("GetConsoleTitleA(%hs,) -> %p\n", a0, rv); }; return rv; } DWORD __stdcall Mine_GetConsoleTitleW(LPWSTR a0, DWORD a1) { _PrintEnter("GetConsoleTitleW(%p,%p)\n", a0, a1); DWORD rv = 0; __try { rv = Real_GetConsoleTitleW(a0, a1); } __finally { _PrintExit("GetConsoleTitleW(%ls,) -> %p\n", a0, rv); }; return rv; } HRESULT __stdcall Mine_GetConvertStg(LPSTORAGE a0) { _PrintEnter("GetConvertStg(%p)\n", a0); HRESULT rv = 0; __try { rv = Real_GetConvertStg(a0); } __finally { _PrintExit("GetConvertStg() -> %p\n", rv); }; return rv; } int __stdcall Mine_GetCurrencyFormatA(LCID a0, DWORD a1, LPCSTR a2, CURRENCYFMTA* a3, LPSTR a4, int a5) { _PrintEnter("GetCurrencyFormatA(%p,%p,%hs,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); int rv = 0; __try { rv = Real_GetCurrencyFormatA(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("GetCurrencyFormatA(,,,,%hs,) -> %p\n", a4, rv); }; return rv; } int __stdcall Mine_GetCurrencyFormatW(LCID a0, DWORD a1, LPCWSTR a2, CURRENCYFMTW* a3, LPWSTR a4, int a5) { _PrintEnter("GetCurrencyFormatW(%p,%p,%ls,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); int rv = 0; __try { rv = Real_GetCurrencyFormatW(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("GetCurrencyFormatW(,,,,%ls,) -> %p\n", a4, rv); }; return rv; } DWORD __stdcall Mine_GetCurrentDirectoryA(DWORD a0, LPSTR a1) { _PrintEnter("GetCurrentDirectoryA(%p,%p)\n", a0, a1); DWORD rv = 0; __try { rv = Real_GetCurrentDirectoryA(a0, a1); } __finally { _PrintExit("GetCurrentDirectoryA(,%hs) -> %p\n", a1, rv); }; return rv; } DWORD __stdcall Mine_GetCurrentDirectoryW(DWORD a0, LPWSTR a1) { _PrintEnter("GetCurrentDirectoryW(%p,%p)\n", a0, a1); DWORD rv = 0; __try { rv = Real_GetCurrentDirectoryW(a0, a1); } __finally { _PrintExit("GetCurrentDirectoryW(,%ls) -> %p\n", a1, rv); }; return rv; } HGDIOBJ __stdcall Mine_GetCurrentObject(HDC a0, UINT a1) { _PrintEnter("GetCurrentObject(%p,%p)\n", a0, a1); HGDIOBJ rv = 0; __try { rv = Real_GetCurrentObject(a0, a1); } __finally { _PrintExit("GetCurrentObject(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetCurrentPositionEx(HDC a0, POINT* a1) { _PrintEnter("GetCurrentPositionEx(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetCurrentPositionEx(a0, a1); } __finally { _PrintExit("GetCurrentPositionEx(,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_GetCurrentProcess(void) { _PrintEnter("GetCurrentProcess()\n"); HANDLE rv = 0; __try { rv = Real_GetCurrentProcess(); } __finally { _PrintExit("GetCurrentProcess() -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetCurrentProcessId(void) { _PrintEnter("GetCurrentProcessId()\n"); DWORD rv = 0; __try { rv = Real_GetCurrentProcessId(); } __finally { _PrintExit("GetCurrentProcessId() -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetCurrentThreadId(void) { _PrintEnter("GetCurrentThreadId()\n"); DWORD rv = 0; __try { rv = Real_GetCurrentThreadId(); } __finally { _PrintExit("GetCurrentThreadId() -> %p\n", rv); }; return rv; } HCURSOR __stdcall Mine_GetCursor(void) { _PrintEnter("GetCursor()\n"); HCURSOR rv = 0; __try { rv = Real_GetCursor(); } __finally { _PrintExit("GetCursor() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetCursorPos(POINT* a0) { _PrintEnter("GetCursorPos(%p)\n", a0); BOOL rv = 0; __try { rv = Real_GetCursorPos(a0); } __finally { _PrintExit("GetCursorPos() -> %p\n", rv); }; return rv; } HDC __stdcall Mine_GetDC(HWND a0) { _PrintEnter("GetDC(%p)\n", a0); HDC rv = 0; __try { rv = Real_GetDC(a0); } __finally { _PrintExit("GetDC() -> %p\n", rv); }; return rv; } HDC __stdcall Mine_GetDCEx(HWND a0, HRGN a1, DWORD a2) { _PrintEnter("GetDCEx(%p,%p,%p)\n", a0, a1, a2); HDC rv = 0; __try { rv = Real_GetDCEx(a0, a1, a2); } __finally { _PrintExit("GetDCEx(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetDCOrgEx(HDC a0, POINT* a1) { _PrintEnter("GetDCOrgEx(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetDCOrgEx(a0, a1); } __finally { _PrintExit("GetDCOrgEx(,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_GetDIBColorTable(HDC a0, UINT a1, UINT a2, RGBQUAD* a3) { _PrintEnter("GetDIBColorTable(%p,%p,%p,%p)\n", a0, a1, a2, a3); UINT rv = 0; __try { rv = Real_GetDIBColorTable(a0, a1, a2, a3); } __finally { _PrintExit("GetDIBColorTable(,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_GetDIBits(HDC a0, HBITMAP a1, UINT a2, UINT a3, LPVOID a4, LPBITMAPINFO a5, UINT a6) { _PrintEnter("GetDIBits(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); int rv = 0; __try { rv = Real_GetDIBits(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("GetDIBits(,,,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_GetDateFormatA(LCID a0, DWORD a1, SYSTEMTIME* a2, LPCSTR a3, LPSTR a4, int a5) { _PrintEnter("GetDateFormatA(%p,%p,%p,%hs,%p,%p)\n", a0, a1, a2, a3, a4, a5); int rv = 0; __try { rv = Real_GetDateFormatA(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("GetDateFormatA(,,,,%hs,) -> %p\n", a4, rv); }; return rv; } int __stdcall Mine_GetDateFormatW(LCID a0, DWORD a1, SYSTEMTIME* a2, LPCWSTR a3, LPWSTR a4, int a5) { _PrintEnter("GetDateFormatW(%p,%p,%p,%ls,%p,%p)\n", a0, a1, a2, a3, a4, a5); int rv = 0; __try { rv = Real_GetDateFormatW(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("GetDateFormatW(,,,,%ls,) -> %p\n", a4, rv); }; return rv; } BOOL __stdcall Mine_GetDefaultCommConfigA(LPCSTR a0, LPCOMMCONFIG a1, LPDWORD a2) { _PrintEnter("GetDefaultCommConfigA(%hs,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_GetDefaultCommConfigA(a0, a1, a2); } __finally { _PrintExit("GetDefaultCommConfigA(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetDefaultCommConfigW(LPCWSTR a0, LPCOMMCONFIG a1, LPDWORD a2) { _PrintEnter("GetDefaultCommConfigW(%ls,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_GetDefaultCommConfigW(a0, a1, a2); } __finally { _PrintExit("GetDefaultCommConfigW(,,) -> %p\n", rv); }; return rv; } HWND __stdcall Mine_GetDesktopWindow(void) { _PrintEnter("GetDesktopWindow()\n"); HWND rv = 0; __try { rv = Real_GetDesktopWindow(); } __finally { _PrintExit("GetDesktopWindow() -> %p\n", rv); }; return rv; } int __stdcall Mine_GetDeviceCaps(HDC a0, int a1) { _PrintEnter("GetDeviceCaps(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real_GetDeviceCaps(a0, a1); } __finally { _PrintExit("GetDeviceCaps(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetDeviceGammaRamp(HDC a0, LPVOID a1) { _PrintEnter("GetDeviceGammaRamp(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetDeviceGammaRamp(a0, a1); } __finally { _PrintExit("GetDeviceGammaRamp(,) -> %p\n", rv); }; return rv; } long __stdcall Mine_GetDialogBaseUnits(void) { _PrintEnter("GetDialogBaseUnits()\n"); long rv = 0; __try { rv = Real_GetDialogBaseUnits(); } __finally { _PrintExit("GetDialogBaseUnits() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetDiskFreeSpaceA(LPCSTR a0, LPDWORD a1, LPDWORD a2, LPDWORD a3, LPDWORD a4) { _PrintEnter("GetDiskFreeSpaceA(%hs,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_GetDiskFreeSpaceA(a0, a1, a2, a3, a4); } __finally { _PrintExit("GetDiskFreeSpaceA(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetDiskFreeSpaceExA(LPCSTR a0, union _ULARGE_INTEGER* a1, union _ULARGE_INTEGER* a2, union _ULARGE_INTEGER* a3) { _PrintEnter("GetDiskFreeSpaceExA(%hs,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_GetDiskFreeSpaceExA(a0, a1, a2, a3); } __finally { _PrintExit("GetDiskFreeSpaceExA(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetDiskFreeSpaceExW(LPCWSTR a0, union _ULARGE_INTEGER* a1, union _ULARGE_INTEGER* a2, union _ULARGE_INTEGER* a3) { _PrintEnter("GetDiskFreeSpaceExW(%ls,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_GetDiskFreeSpaceExW(a0, a1, a2, a3); } __finally { _PrintExit("GetDiskFreeSpaceExW(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetDiskFreeSpaceW(LPCWSTR a0, LPDWORD a1, LPDWORD a2, LPDWORD a3, LPDWORD a4) { _PrintEnter("GetDiskFreeSpaceW(%ls,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_GetDiskFreeSpaceW(a0, a1, a2, a3, a4); } __finally { _PrintExit("GetDiskFreeSpaceW(,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_GetDlgCtrlID(HWND a0) { _PrintEnter("GetDlgCtrlID(%p)\n", a0); int rv = 0; __try { rv = Real_GetDlgCtrlID(a0); } __finally { _PrintExit("GetDlgCtrlID() -> %p\n", rv); }; return rv; } HWND __stdcall Mine_GetDlgItem(HWND a0, int a1) { _PrintEnter("GetDlgItem(%p,%p)\n", a0, a1); HWND rv = 0; __try { rv = Real_GetDlgItem(a0, a1); } __finally { _PrintExit("GetDlgItem(,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_GetDlgItemInt(HWND a0, int a1, BOOL* a2, BOOL a3) { _PrintEnter("GetDlgItemInt(%p,%p,%p,%p)\n", a0, a1, a2, a3); UINT rv = 0; __try { rv = Real_GetDlgItemInt(a0, a1, a2, a3); } __finally { _PrintExit("GetDlgItemInt(,,,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_GetDlgItemTextA(HWND a0, int a1, LPSTR a2, int a3) { _PrintEnter("GetDlgItemTextA(%p,%p,%p,%p)\n", a0, a1, a2, a3); UINT rv = 0; __try { rv = Real_GetDlgItemTextA(a0, a1, a2, a3); } __finally { _PrintExit("GetDlgItemTextA(,,%hs,) -> %p\n", a2, rv); }; return rv; } UINT __stdcall Mine_GetDlgItemTextW(HWND a0, int a1, LPWSTR a2, int a3) { _PrintEnter("GetDlgItemTextW(%p,%p,%p,%p)\n", a0, a1, a2, a3); UINT rv = 0; __try { rv = Real_GetDlgItemTextW(a0, a1, a2, a3); } __finally { _PrintExit("GetDlgItemTextW(,,%ls,) -> %p\n", a2, rv); }; return rv; } UINT __stdcall Mine_GetDoubleClickTime(void) { _PrintEnter("GetDoubleClickTime()\n"); UINT rv = 0; __try { rv = Real_GetDoubleClickTime(); } __finally { _PrintExit("GetDoubleClickTime() -> %p\n", rv); }; return rv; } UINT __stdcall Mine_GetDriveTypeA(LPCSTR a0) { _PrintEnter("GetDriveTypeA(%hs)\n", a0); UINT rv = 0; __try { rv = Real_GetDriveTypeA(a0); } __finally { _PrintExit("GetDriveTypeA() -> %p\n", rv); }; return rv; } UINT __stdcall Mine_GetDriveTypeW(LPCWSTR a0) { _PrintEnter("GetDriveTypeW(%ls)\n", a0); UINT rv = 0; __try { rv = Real_GetDriveTypeW(a0); } __finally { _PrintExit("GetDriveTypeW() -> %p\n", rv); }; return rv; } HENHMETAFILE __stdcall Mine_GetEnhMetaFileA(LPCSTR a0) { _PrintEnter("GetEnhMetaFileA(%hs)\n", a0); HENHMETAFILE rv = 0; __try { rv = Real_GetEnhMetaFileA(a0); } __finally { _PrintExit("GetEnhMetaFileA() -> %p\n", rv); }; return rv; } UINT __stdcall Mine_GetEnhMetaFileBits(HENHMETAFILE a0, UINT a1, LPBYTE a2) { _PrintEnter("GetEnhMetaFileBits(%p,%p,%p)\n", a0, a1, a2); UINT rv = 0; __try { rv = Real_GetEnhMetaFileBits(a0, a1, a2); } __finally { _PrintExit("GetEnhMetaFileBits(,,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_GetEnhMetaFileDescriptionA(HENHMETAFILE a0, UINT a1, LPSTR a2) { _PrintEnter("GetEnhMetaFileDescriptionA(%p,%p,%p)\n", a0, a1, a2); UINT rv = 0; __try { rv = Real_GetEnhMetaFileDescriptionA(a0, a1, a2); } __finally { _PrintExit("GetEnhMetaFileDescriptionA(,,%hs) -> %p\n", a2, rv); }; return rv; } UINT __stdcall Mine_GetEnhMetaFileDescriptionW(HENHMETAFILE a0, UINT a1, LPWSTR a2) { _PrintEnter("GetEnhMetaFileDescriptionW(%p,%p,%p)\n", a0, a1, a2); UINT rv = 0; __try { rv = Real_GetEnhMetaFileDescriptionW(a0, a1, a2); } __finally { _PrintExit("GetEnhMetaFileDescriptionW(,,%ls) -> %p\n", a2, rv); }; return rv; } UINT __stdcall Mine_GetEnhMetaFileHeader(HENHMETAFILE a0, UINT a1, ENHMETAHEADER* a2) { _PrintEnter("GetEnhMetaFileHeader(%p,%p,%p)\n", a0, a1, a2); UINT rv = 0; __try { rv = Real_GetEnhMetaFileHeader(a0, a1, a2); } __finally { _PrintExit("GetEnhMetaFileHeader(,,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_GetEnhMetaFilePaletteEntries(HENHMETAFILE a0, UINT a1, PALETTEENTRY* a2) { _PrintEnter("GetEnhMetaFilePaletteEntries(%p,%p,%p)\n", a0, a1, a2); UINT rv = 0; __try { rv = Real_GetEnhMetaFilePaletteEntries(a0, a1, a2); } __finally { _PrintExit("GetEnhMetaFilePaletteEntries(,,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_GetEnhMetaFilePixelFormat(HENHMETAFILE a0, UINT a1, PIXELFORMATDESCRIPTOR* a2) { _PrintEnter("GetEnhMetaFilePixelFormat(%p,%p,%p)\n", a0, a1, a2); UINT rv = 0; __try { rv = Real_GetEnhMetaFilePixelFormat(a0, a1, a2); } __finally { _PrintExit("GetEnhMetaFilePixelFormat(,,) -> %p\n", rv); }; return rv; } HENHMETAFILE __stdcall Mine_GetEnhMetaFileW(LPCWSTR a0) { _PrintEnter("GetEnhMetaFileW(%ls)\n", a0); HENHMETAFILE rv = 0; __try { rv = Real_GetEnhMetaFileW(a0); } __finally { _PrintExit("GetEnhMetaFileW() -> %p\n", rv); }; return rv; } LPSTR __stdcall Mine_GetEnvironmentStrings(void) { _PrintEnter("GetEnvironmentStrings()\n"); LPSTR rv = 0; __try { rv = Real_GetEnvironmentStrings(); } __finally { _PrintExit("GetEnvironmentStrings() -> %hs\n", rv); }; return rv; } LPWSTR __stdcall Mine_GetEnvironmentStringsW(void) { _PrintEnter("GetEnvironmentStringsW()\n"); LPWSTR rv = 0; __try { rv = Real_GetEnvironmentStringsW(); } __finally { _PrintExit("GetEnvironmentStringsW() -> %ls\n", rv); }; return rv; } DWORD __stdcall Mine_GetEnvironmentVariableA(LPCSTR a0, LPSTR a1, DWORD a2) { _PrintEnter("GetEnvironmentVariableA(%hs,%p,%p)\n", a0, a1, a2); DWORD rv = 0; __try { rv = Real_GetEnvironmentVariableA(a0, a1, a2); } __finally { _PrintExit("GetEnvironmentVariableA(,%hs,) -> %p\n", a1, rv); }; return rv; } DWORD __stdcall Mine_GetEnvironmentVariableW(LPCWSTR a0, LPWSTR a1, DWORD a2) { _PrintEnter("GetEnvironmentVariableW(%ls,%p,%p)\n", a0, a1, a2); DWORD rv = 0; __try { rv = Real_GetEnvironmentVariableW(a0, a1, a2); } __finally { _PrintExit("GetEnvironmentVariableW(,%ls,) -> %p\n", a1, rv); }; return rv; } BOOL __stdcall Mine_GetExitCodeProcess(HANDLE a0, LPDWORD a1) { _PrintEnter("GetExitCodeProcess(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetExitCodeProcess(a0, a1); } __finally { _PrintExit("GetExitCodeProcess(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetExitCodeThread(HANDLE a0, LPDWORD a1) { _PrintEnter("GetExitCodeThread(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetExitCodeThread(a0, a1); } __finally { _PrintExit("GetExitCodeThread(,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetFileAttributesA(LPCSTR a0) { _PrintEnter("GetFileAttributesA(%hs)\n", a0); DWORD rv = 0; __try { rv = Real_GetFileAttributesA(a0); } __finally { _PrintExit("GetFileAttributesA() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetFileAttributesExA(LPCSTR a0, enum _GET_FILEEX_INFO_LEVELS a1, LPVOID a2) { _PrintEnter("GetFileAttributesExA(%hs,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_GetFileAttributesExA(a0, a1, a2); } __finally { _PrintExit("GetFileAttributesExA(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetFileAttributesExW(LPCWSTR a0, enum _GET_FILEEX_INFO_LEVELS a1, LPVOID a2) { _PrintEnter("GetFileAttributesExW(%ls,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_GetFileAttributesExW(a0, a1, a2); } __finally { _PrintExit("GetFileAttributesExW(,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetFileAttributesW(LPCWSTR a0) { _PrintEnter("GetFileAttributesW(%ls)\n", a0); DWORD rv = 0; __try { rv = Real_GetFileAttributesW(a0); } __finally { _PrintExit("GetFileAttributesW() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetFileInformationByHandle(HANDLE a0, LPBY_HANDLE_FILE_INFORMATION a1) { _PrintEnter("GetFileInformationByHandle(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetFileInformationByHandle(a0, a1); } __finally { _PrintExit("GetFileInformationByHandle(,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetFileSize(HANDLE a0, LPDWORD a1) { _PrintEnter("GetFileSize(%p,%p)\n", a0, a1); DWORD rv = 0; __try { rv = Real_GetFileSize(a0, a1); } __finally { _PrintExit("GetFileSize(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetFileTime(HANDLE a0, LPFILETIME a1, LPFILETIME a2, LPFILETIME a3) { _PrintEnter("GetFileTime(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_GetFileTime(a0, a1, a2, a3); } __finally { _PrintExit("GetFileTime(,,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetFileType(HANDLE a0) { _PrintEnter("GetFileType(%p)\n", a0); DWORD rv = 0; __try { rv = Real_GetFileType(a0); } __finally { _PrintExit("GetFileType() -> %p\n", rv); }; return rv; } HWND __stdcall Mine_GetFocus(void) { _PrintEnter("GetFocus()\n"); HWND rv = 0; __try { rv = Real_GetFocus(); } __finally { _PrintExit("GetFocus() -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetFontData(HDC a0, DWORD a1, DWORD a2, LPVOID a3, DWORD a4) { _PrintEnter("GetFontData(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); DWORD rv = 0; __try { rv = Real_GetFontData(a0, a1, a2, a3, a4); } __finally { _PrintExit("GetFontData(,,,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetFontLanguageInfo(HDC a0) { _PrintEnter("GetFontLanguageInfo(%p)\n", a0); DWORD rv = 0; __try { rv = Real_GetFontLanguageInfo(a0); } __finally { _PrintExit("GetFontLanguageInfo() -> %p\n", rv); }; return rv; } HWND __stdcall Mine_GetForegroundWindow(void) { _PrintEnter("GetForegroundWindow()\n"); HWND rv = 0; __try { rv = Real_GetForegroundWindow(); } __finally { _PrintExit("GetForegroundWindow() -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetFullPathNameA(LPCSTR a0, DWORD a1, LPSTR a2, LPSTR* a3) { _PrintEnter("GetFullPathNameA(%hs,%p,%p,%p)\n", a0, a1, a2, a3); DWORD rv = 0; __try { rv = Real_GetFullPathNameA(a0, a1, a2, a3); } __finally { _PrintExit("GetFullPathNameA(,,%hs,) -> %p\n", a2, rv); }; return rv; } DWORD __stdcall Mine_GetFullPathNameW(LPCWSTR a0, DWORD a1, LPWSTR a2, LPWSTR* a3) { _PrintEnter("GetFullPathNameW(%ls,%p,%p,%p)\n", a0, a1, a2, a3); DWORD rv = 0; __try { rv = Real_GetFullPathNameW(a0, a1, a2, a3); } __finally { _PrintExit("GetFullPathNameW(,,%ls,) -> %p\n", a2, rv); }; return rv; } DWORD __stdcall Mine_GetGlyphOutlineA(HDC a0, UINT a1, UINT a2, LPGLYPHMETRICS a3, DWORD a4, LPVOID a5, MAT2* a6) { _PrintEnter("GetGlyphOutlineA(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); DWORD rv = 0; __try { rv = Real_GetGlyphOutlineA(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("GetGlyphOutlineA(,,,,,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetGlyphOutlineW(HDC a0, UINT a1, UINT a2, LPGLYPHMETRICS a3, DWORD a4, LPVOID a5, MAT2* a6) { _PrintEnter("GetGlyphOutlineW(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); DWORD rv = 0; __try { rv = Real_GetGlyphOutlineW(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("GetGlyphOutlineW(,,,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_GetGraphicsMode(HDC a0) { _PrintEnter("GetGraphicsMode(%p)\n", a0); int rv = 0; __try { rv = Real_GetGraphicsMode(a0); } __finally { _PrintExit("GetGraphicsMode() -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_GetHGlobalFromILockBytes(ILockBytes* a0, HGLOBAL* a1) { _PrintEnter("GetHGlobalFromILockBytes(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_GetHGlobalFromILockBytes(a0, a1); } __finally { _PrintExit("GetHGlobalFromILockBytes(,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_GetHGlobalFromStream(LPSTREAM a0, HGLOBAL* a1) { _PrintEnter("GetHGlobalFromStream(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_GetHGlobalFromStream(a0, a1); } __finally { _PrintExit("GetHGlobalFromStream(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetHandleInformation(HANDLE a0, LPDWORD a1) { _PrintEnter("GetHandleInformation(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetHandleInformation(a0, a1); } __finally { _PrintExit("GetHandleInformation(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetICMProfileA(HDC a0, LPDWORD a1, LPSTR a2) { _PrintEnter("GetICMProfileA(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_GetICMProfileA(a0, a1, a2); } __finally { _PrintExit("GetICMProfileA(,,%hs) -> %p\n", a2, rv); }; return rv; } BOOL __stdcall Mine_GetICMProfileW(HDC a0, LPDWORD a1, LPWSTR a2) { _PrintEnter("GetICMProfileW(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_GetICMProfileW(a0, a1, a2); } __finally { _PrintExit("GetICMProfileW(,,%ls) -> %p\n", a2, rv); }; return rv; } BOOL __stdcall Mine_GetIconInfo(HICON a0, PICONINFO a1) { _PrintEnter("GetIconInfo(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetIconInfo(a0, a1); } __finally { _PrintExit("GetIconInfo(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetInputState(void) { _PrintEnter("GetInputState()\n"); BOOL rv = 0; __try { rv = Real_GetInputState(); } __finally { _PrintExit("GetInputState() -> %p\n", rv); }; return rv; } UINT __stdcall Mine_GetKBCodePage(void) { _PrintEnter("GetKBCodePage()\n"); UINT rv = 0; __try { rv = Real_GetKBCodePage(); } __finally { _PrintExit("GetKBCodePage() -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetKerningPairsA(HDC a0, DWORD a1, KERNINGPAIR* a2) { _PrintEnter("GetKerningPairsA(%p,%p,%p)\n", a0, a1, a2); DWORD rv = 0; __try { rv = Real_GetKerningPairsA(a0, a1, a2); } __finally { _PrintExit("GetKerningPairsA(,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetKerningPairsW(HDC a0, DWORD a1, KERNINGPAIR* a2) { _PrintEnter("GetKerningPairsW(%p,%p,%p)\n", a0, a1, a2); DWORD rv = 0; __try { rv = Real_GetKerningPairsW(a0, a1, a2); } __finally { _PrintExit("GetKerningPairsW(,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_GetKeyNameTextA(LONG a0, LPSTR a1, int a2) { _PrintEnter("GetKeyNameTextA(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_GetKeyNameTextA(a0, a1, a2); } __finally { _PrintExit("GetKeyNameTextA(,%hs,) -> %p\n", a1, rv); }; return rv; } int __stdcall Mine_GetKeyNameTextW(LONG a0, LPWSTR a1, int a2) { _PrintEnter("GetKeyNameTextW(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_GetKeyNameTextW(a0, a1, a2); } __finally { _PrintExit("GetKeyNameTextW(,%ls,) -> %p\n", a1, rv); }; return rv; } SHORT __stdcall Mine_GetKeyState(int a0) { _PrintEnter("GetKeyState(%p)\n", a0); SHORT rv = 0; __try { rv = Real_GetKeyState(a0); } __finally { _PrintExit("GetKeyState() -> %p\n", rv); }; return rv; } HKL __stdcall Mine_GetKeyboardLayout(DWORD a0) { _PrintEnter("GetKeyboardLayout(%p)\n", a0); HKL rv = 0; __try { rv = Real_GetKeyboardLayout(a0); } __finally { _PrintExit("GetKeyboardLayout() -> %p\n", rv); }; return rv; } int __stdcall Mine_GetKeyboardLayoutList(int a0, HKL* a1) { _PrintEnter("GetKeyboardLayoutList(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real_GetKeyboardLayoutList(a0, a1); } __finally { _PrintExit("GetKeyboardLayoutList(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetKeyboardLayoutNameA(LPSTR a0) { _PrintEnter("GetKeyboardLayoutNameA(%p)\n", a0); BOOL rv = 0; __try { rv = Real_GetKeyboardLayoutNameA(a0); } __finally { _PrintExit("GetKeyboardLayoutNameA(%hs) -> %p\n", a0, rv); }; return rv; } BOOL __stdcall Mine_GetKeyboardLayoutNameW(LPWSTR a0) { _PrintEnter("GetKeyboardLayoutNameW(%p)\n", a0); BOOL rv = 0; __try { rv = Real_GetKeyboardLayoutNameW(a0); } __finally { _PrintExit("GetKeyboardLayoutNameW(%ls) -> %p\n", a0, rv); }; return rv; } BOOL __stdcall Mine_GetKeyboardState(PBYTE a0) { _PrintEnter("GetKeyboardState(%p)\n", a0); BOOL rv = 0; __try { rv = Real_GetKeyboardState(a0); } __finally { _PrintExit("GetKeyboardState() -> %p\n", rv); }; return rv; } int __stdcall Mine_GetKeyboardType(int a0) { _PrintEnter("GetKeyboardType(%p)\n", a0); int rv = 0; __try { rv = Real_GetKeyboardType(a0); } __finally { _PrintExit("GetKeyboardType() -> %p\n", rv); }; return rv; } HWND __stdcall Mine_GetLastActivePopup(HWND a0) { _PrintEnter("GetLastActivePopup(%p)\n", a0); HWND rv = 0; __try { rv = Real_GetLastActivePopup(a0); } __finally { _PrintExit("GetLastActivePopup() -> %p\n", rv); }; return rv; } void __stdcall Mine_GetLocalTime(LPSYSTEMTIME a0) { _PrintEnter("GetLocalTime(%p)\n", a0); __try { Real_GetLocalTime(a0); } __finally { _PrintExit("GetLocalTime() ->\n"); }; } int __stdcall Mine_GetLocaleInfoA(LCID a0, LCTYPE a1, LPSTR a2, int a3) { _PrintEnter("GetLocaleInfoA(%p,%p,%p,%p)\n", a0, a1, a2, a3); int rv = 0; __try { rv = Real_GetLocaleInfoA(a0, a1, a2, a3); } __finally { _PrintExit("GetLocaleInfoA(,,%hs,) -> %p\n", a2, rv); }; return rv; } int __stdcall Mine_GetLocaleInfoW(LCID a0, LCTYPE a1, LPWSTR a2, int a3) { _PrintEnter("GetLocaleInfoW(%p,%p,%p,%p)\n", a0, a1, a2, a3); int rv = 0; __try { rv = Real_GetLocaleInfoW(a0, a1, a2, a3); } __finally { _PrintExit("GetLocaleInfoW(,,%ls,) -> %p\n", a2, rv); }; return rv; } BOOL __stdcall Mine_GetLogColorSpaceA(HCOLORSPACE a0, LOGCOLORSPACEA* a1, DWORD a2) { _PrintEnter("GetLogColorSpaceA(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_GetLogColorSpaceA(a0, a1, a2); } __finally { _PrintExit("GetLogColorSpaceA(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetLogColorSpaceW(HCOLORSPACE a0, LOGCOLORSPACEW* a1, DWORD a2) { _PrintEnter("GetLogColorSpaceW(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_GetLogColorSpaceW(a0, a1, a2); } __finally { _PrintExit("GetLogColorSpaceW(,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetLogicalDriveStringsA(DWORD a0, LPSTR a1) { _PrintEnter("GetLogicalDriveStringsA(%p,%p)\n", a0, a1); DWORD rv = 0; __try { rv = Real_GetLogicalDriveStringsA(a0, a1); } __finally { _PrintExit("GetLogicalDriveStringsA(,%hs) -> %p\n", a1, rv); }; return rv; } DWORD __stdcall Mine_GetLogicalDriveStringsW(DWORD a0, LPWSTR a1) { _PrintEnter("GetLogicalDriveStringsW(%p,%p)\n", a0, a1); DWORD rv = 0; __try { rv = Real_GetLogicalDriveStringsW(a0, a1); } __finally { _PrintExit("GetLogicalDriveStringsW(,%ls) -> %p\n", a1, rv); }; return rv; } DWORD __stdcall Mine_GetLogicalDrives(void) { _PrintEnter("GetLogicalDrives()\n"); DWORD rv = 0; __try { rv = Real_GetLogicalDrives(); } __finally { _PrintExit("GetLogicalDrives() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetMailslotInfo(HANDLE a0, LPDWORD a1, LPDWORD a2, LPDWORD a3, LPDWORD a4) { _PrintEnter("GetMailslotInfo(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_GetMailslotInfo(a0, a1, a2, a3, a4); } __finally { _PrintExit("GetMailslotInfo(,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_GetMapMode(HDC a0) { _PrintEnter("GetMapMode(%p)\n", a0); int rv = 0; __try { rv = Real_GetMapMode(a0); } __finally { _PrintExit("GetMapMode() -> %p\n", rv); }; return rv; } HMENU __stdcall Mine_GetMenu(HWND a0) { _PrintEnter("GetMenu(%p)\n", a0); HMENU rv = 0; __try { rv = Real_GetMenu(a0); } __finally { _PrintExit("GetMenu() -> %p\n", rv); }; return rv; } LONG __stdcall Mine_GetMenuCheckMarkDimensions(void) { _PrintEnter("GetMenuCheckMarkDimensions()\n"); LONG rv = 0; __try { rv = Real_GetMenuCheckMarkDimensions(); } __finally { _PrintExit("GetMenuCheckMarkDimensions() -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetMenuContextHelpId(HMENU a0) { _PrintEnter("GetMenuContextHelpId(%p)\n", a0); DWORD rv = 0; __try { rv = Real_GetMenuContextHelpId(a0); } __finally { _PrintExit("GetMenuContextHelpId() -> %p\n", rv); }; return rv; } UINT __stdcall Mine_GetMenuDefaultItem(HMENU a0, UINT a1, UINT a2) { _PrintEnter("GetMenuDefaultItem(%p,%p,%p)\n", a0, a1, a2); UINT rv = 0; __try { rv = Real_GetMenuDefaultItem(a0, a1, a2); } __finally { _PrintExit("GetMenuDefaultItem(,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_GetMenuItemCount(HMENU a0) { _PrintEnter("GetMenuItemCount(%p)\n", a0); int rv = 0; __try { rv = Real_GetMenuItemCount(a0); } __finally { _PrintExit("GetMenuItemCount() -> %p\n", rv); }; return rv; } UINT __stdcall Mine_GetMenuItemID(HMENU a0, int a1) { _PrintEnter("GetMenuItemID(%p,%p)\n", a0, a1); UINT rv = 0; __try { rv = Real_GetMenuItemID(a0, a1); } __finally { _PrintExit("GetMenuItemID(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetMenuItemInfoA(HMENU a0, UINT a1, BOOL a2, LPMENUITEMINFOA a3) { _PrintEnter("GetMenuItemInfoA(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_GetMenuItemInfoA(a0, a1, a2, a3); } __finally { _PrintExit("GetMenuItemInfoA(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetMenuItemInfoW(HMENU a0, UINT a1, BOOL a2, LPMENUITEMINFOW a3) { _PrintEnter("GetMenuItemInfoW(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_GetMenuItemInfoW(a0, a1, a2, a3); } __finally { _PrintExit("GetMenuItemInfoW(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetMenuItemRect(HWND a0, HMENU a1, UINT a2, LPRECT a3) { _PrintEnter("GetMenuItemRect(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_GetMenuItemRect(a0, a1, a2, a3); } __finally { _PrintExit("GetMenuItemRect(,,,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_GetMenuState(HMENU a0, UINT a1, UINT a2) { _PrintEnter("GetMenuState(%p,%p,%p)\n", a0, a1, a2); UINT rv = 0; __try { rv = Real_GetMenuState(a0, a1, a2); } __finally { _PrintExit("GetMenuState(,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_GetMenuStringA(HMENU a0, UINT a1, LPSTR a2, int a3, UINT a4) { _PrintEnter("GetMenuStringA(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); int rv = 0; __try { rv = Real_GetMenuStringA(a0, a1, a2, a3, a4); } __finally { _PrintExit("GetMenuStringA(,,%hs,,) -> %p\n", a2, rv); }; return rv; } int __stdcall Mine_GetMenuStringW(HMENU a0, UINT a1, LPWSTR a2, int a3, UINT a4) { _PrintEnter("GetMenuStringW(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); int rv = 0; __try { rv = Real_GetMenuStringW(a0, a1, a2, a3, a4); } __finally { _PrintExit("GetMenuStringW(,,%ls,,) -> %p\n", a2, rv); }; return rv; } BOOL __stdcall Mine_GetMessageA(LPMSG a0, HWND a1, UINT a2, UINT a3) { _PrintEnter("GetMessageA(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_GetMessageA(a0, a1, a2, a3); } __finally { _PrintExit("GetMessageA(,,,) -> %p\n", rv); }; return rv; } LPARAM __stdcall Mine_GetMessageExtraInfo(void) { _PrintEnter("GetMessageExtraInfo()\n"); LPARAM rv = 0; __try { rv = Real_GetMessageExtraInfo(); } __finally { _PrintExit("GetMessageExtraInfo() -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetMessagePos(void) { _PrintEnter("GetMessagePos()\n"); DWORD rv = 0; __try { rv = Real_GetMessagePos(); } __finally { _PrintExit("GetMessagePos() -> %p\n", rv); }; return rv; } LONG __stdcall Mine_GetMessageTime(void) { _PrintEnter("GetMessageTime()\n"); LONG rv = 0; __try { rv = Real_GetMessageTime(); } __finally { _PrintExit("GetMessageTime() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetMessageW(LPMSG a0, HWND a1, UINT a2, UINT a3) { _PrintEnter("GetMessageW(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_GetMessageW(a0, a1, a2, a3); } __finally { _PrintExit("GetMessageW(,,,) -> %p\n", rv); }; return rv; } HMETAFILE __stdcall Mine_GetMetaFileA(LPCSTR a0) { _PrintEnter("GetMetaFileA(%hs)\n", a0); HMETAFILE rv = 0; __try { rv = Real_GetMetaFileA(a0); } __finally { _PrintExit("GetMetaFileA() -> %p\n", rv); }; return rv; } UINT __stdcall Mine_GetMetaFileBitsEx(HMETAFILE a0, UINT a1, LPVOID a2) { _PrintEnter("GetMetaFileBitsEx(%p,%p,%p)\n", a0, a1, a2); UINT rv = 0; __try { rv = Real_GetMetaFileBitsEx(a0, a1, a2); } __finally { _PrintExit("GetMetaFileBitsEx(,,) -> %p\n", rv); }; return rv; } HMETAFILE __stdcall Mine_GetMetaFileW(LPCWSTR a0) { _PrintEnter("GetMetaFileW(%ls)\n", a0); HMETAFILE rv = 0; __try { rv = Real_GetMetaFileW(a0); } __finally { _PrintExit("GetMetaFileW() -> %p\n", rv); }; return rv; } int __stdcall Mine_GetMetaRgn(HDC a0, HRGN a1) { _PrintEnter("GetMetaRgn(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real_GetMetaRgn(a0, a1); } __finally { _PrintExit("GetMetaRgn(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetMiterLimit(HDC a0, PFLOAT a1) { _PrintEnter("GetMiterLimit(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetMiterLimit(a0, a1); } __finally { _PrintExit("GetMiterLimit(,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetModuleFileNameA(HMODULE a0, LPSTR a1, DWORD a2) { _PrintEnter("GetModuleFileNameA(%p,%p,%p)\n", a0, a1, a2); DWORD rv = 0; __try { rv = Real_GetModuleFileNameA(a0, a1, a2); } __finally { _PrintExit("GetModuleFileNameA(,%hs,) -> %p\n", a1, rv); }; return rv; } DWORD __stdcall Mine_GetModuleFileNameW(HMODULE a0, LPWSTR a1, DWORD a2) { _PrintEnter("GetModuleFileNameW(%p,%p,%p)\n", a0, a1, a2); DWORD rv = 0; __try { rv = Real_GetModuleFileNameW(a0, a1, a2); } __finally { _PrintExit("GetModuleFileNameW(,%ls,) -> %p\n", a1, rv); }; return rv; } HMODULE __stdcall Mine_GetModuleHandleA(LPCSTR a0) { _PrintEnter("GetModuleHandleA(%hs)\n", a0); HMODULE rv = 0; __try { rv = Real_GetModuleHandleA(a0); } __finally { _PrintExit("GetModuleHandleA() -> %p\n", rv); }; return rv; } HMODULE __stdcall Mine_GetModuleHandleW(LPCWSTR a0) { _PrintEnter("GetModuleHandleW(%ls)\n", a0); HMODULE rv = 0; __try { rv = Real_GetModuleHandleW(a0); } __finally { _PrintExit("GetModuleHandleW() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetNamedPipeHandleStateA(HANDLE a0, LPDWORD a1, LPDWORD a2, LPDWORD a3, LPDWORD a4, LPSTR a5, DWORD a6) { _PrintEnter("GetNamedPipeHandleStateA(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); BOOL rv = 0; __try { rv = Real_GetNamedPipeHandleStateA(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("GetNamedPipeHandleStateA(,,,,,%hs,) -> %p\n", a5, rv); }; return rv; } BOOL __stdcall Mine_GetNamedPipeHandleStateW(HANDLE a0, LPDWORD a1, LPDWORD a2, LPDWORD a3, LPDWORD a4, LPWSTR a5, DWORD a6) { _PrintEnter("GetNamedPipeHandleStateW(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); BOOL rv = 0; __try { rv = Real_GetNamedPipeHandleStateW(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("GetNamedPipeHandleStateW(,,,,,%ls,) -> %p\n", a5, rv); }; return rv; } BOOL __stdcall Mine_GetNamedPipeInfo(HANDLE a0, LPDWORD a1, LPDWORD a2, LPDWORD a3, LPDWORD a4) { _PrintEnter("GetNamedPipeInfo(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_GetNamedPipeInfo(a0, a1, a2, a3, a4); } __finally { _PrintExit("GetNamedPipeInfo(,,,,) -> %p\n", rv); }; return rv; } COLORREF __stdcall Mine_GetNearestColor(HDC a0, COLORREF a1) { _PrintEnter("GetNearestColor(%p,%p)\n", a0, a1); COLORREF rv = 0; __try { rv = Real_GetNearestColor(a0, a1); } __finally { _PrintExit("GetNearestColor(,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_GetNearestPaletteIndex(HPALETTE a0, COLORREF a1) { _PrintEnter("GetNearestPaletteIndex(%p,%p)\n", a0, a1); UINT rv = 0; __try { rv = Real_GetNearestPaletteIndex(a0, a1); } __finally { _PrintExit("GetNearestPaletteIndex(,) -> %p\n", rv); }; return rv; } HWND __stdcall Mine_GetNextDlgGroupItem(HWND a0, HWND a1, BOOL a2) { _PrintEnter("GetNextDlgGroupItem(%p,%p,%p)\n", a0, a1, a2); HWND rv = 0; __try { rv = Real_GetNextDlgGroupItem(a0, a1, a2); } __finally { _PrintExit("GetNextDlgGroupItem(,,) -> %p\n", rv); }; return rv; } HWND __stdcall Mine_GetNextDlgTabItem(HWND a0, HWND a1, BOOL a2) { _PrintEnter("GetNextDlgTabItem(%p,%p,%p)\n", a0, a1, a2); HWND rv = 0; __try { rv = Real_GetNextDlgTabItem(a0, a1, a2); } __finally { _PrintExit("GetNextDlgTabItem(,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_GetNumberFormatA(LCID a0, DWORD a1, LPCSTR a2, NUMBERFMTA* a3, LPSTR a4, int a5) { _PrintEnter("GetNumberFormatA(%p,%p,%hs,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); int rv = 0; __try { rv = Real_GetNumberFormatA(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("GetNumberFormatA(,,,,%hs,) -> %p\n", a4, rv); }; return rv; } int __stdcall Mine_GetNumberFormatW(LCID a0, DWORD a1, LPCWSTR a2, NUMBERFMTW* a3, LPWSTR a4, int a5) { _PrintEnter("GetNumberFormatW(%p,%p,%ls,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); int rv = 0; __try { rv = Real_GetNumberFormatW(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("GetNumberFormatW(,,,,%ls,) -> %p\n", a4, rv); }; return rv; } BOOL __stdcall Mine_GetNumberOfConsoleInputEvents(HANDLE a0, LPDWORD a1) { _PrintEnter("GetNumberOfConsoleInputEvents(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetNumberOfConsoleInputEvents(a0, a1); } __finally { _PrintExit("GetNumberOfConsoleInputEvents(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetNumberOfConsoleMouseButtons(LPDWORD a0) { _PrintEnter("GetNumberOfConsoleMouseButtons(%p)\n", a0); BOOL rv = 0; __try { rv = Real_GetNumberOfConsoleMouseButtons(a0); } __finally { _PrintExit("GetNumberOfConsoleMouseButtons() -> %p\n", rv); }; return rv; } UINT __stdcall Mine_GetOEMCP(void) { _PrintEnter("GetOEMCP()\n"); UINT rv = 0; __try { rv = Real_GetOEMCP(); } __finally { _PrintExit("GetOEMCP() -> %p\n", rv); }; return rv; } int __stdcall Mine_GetObjectA(HGDIOBJ a0, int a1, LPVOID a2) { _PrintEnter("GetObjectA(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_GetObjectA(a0, a1, a2); } __finally { _PrintExit("GetObjectA(,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetObjectType(HGDIOBJ a0) { _PrintEnter("GetObjectType(%p)\n", a0); DWORD rv = 0; __try { rv = Real_GetObjectType(a0); } __finally { _PrintExit("GetObjectType() -> %p\n", rv); }; return rv; } int __stdcall Mine_GetObjectW(HGDIOBJ a0, int a1, LPVOID a2) { _PrintEnter("GetObjectW(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_GetObjectW(a0, a1, a2); } __finally { _PrintExit("GetObjectW(,,) -> %p\n", rv); }; return rv; } HWND __stdcall Mine_GetOpenClipboardWindow(void) { _PrintEnter("GetOpenClipboardWindow()\n"); HWND rv = 0; __try { rv = Real_GetOpenClipboardWindow(); } __finally { _PrintExit("GetOpenClipboardWindow() -> %p\n", rv); }; return rv; } UINT __stdcall Mine_GetOutlineTextMetricsA(HDC a0, UINT a1, LPOUTLINETEXTMETRICA a2) { _PrintEnter("GetOutlineTextMetricsA(%p,%p,%p)\n", a0, a1, a2); UINT rv = 0; __try { rv = Real_GetOutlineTextMetricsA(a0, a1, a2); } __finally { _PrintExit("GetOutlineTextMetricsA(,,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_GetOutlineTextMetricsW(HDC a0, UINT a1, LPOUTLINETEXTMETRICW a2) { _PrintEnter("GetOutlineTextMetricsW(%p,%p,%p)\n", a0, a1, a2); UINT rv = 0; __try { rv = Real_GetOutlineTextMetricsW(a0, a1, a2); } __finally { _PrintExit("GetOutlineTextMetricsW(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetOverlappedResult(HANDLE a0, LPOVERLAPPED a1, LPDWORD a2, BOOL a3) { _PrintEnter("GetOverlappedResult(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_GetOverlappedResult(a0, a1, a2, a3); } __finally { _PrintExit("GetOverlappedResult(,,,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_GetPaletteEntries(HPALETTE a0, UINT a1, UINT a2, PALETTEENTRY* a3) { _PrintEnter("GetPaletteEntries(%p,%p,%p,%p)\n", a0, a1, a2, a3); UINT rv = 0; __try { rv = Real_GetPaletteEntries(a0, a1, a2, a3); } __finally { _PrintExit("GetPaletteEntries(,,,) -> %p\n", rv); }; return rv; } HWND __stdcall Mine_GetParent(HWND a0) { _PrintEnter("GetParent(%p)\n", a0); HWND rv = 0; __try { rv = Real_GetParent(a0); } __finally { _PrintExit("GetParent() -> %p\n", rv); }; return rv; } int __stdcall Mine_GetPath(HDC a0, POINT* a1, LPBYTE a2, int a3) { _PrintEnter("GetPath(%p,%p,%p,%p)\n", a0, a1, a2, a3); int rv = 0; __try { rv = Real_GetPath(a0, a1, a2, a3); } __finally { _PrintExit("GetPath(,,,) -> %p\n", rv); }; return rv; } COLORREF __stdcall Mine_GetPixel(HDC a0, int a1, int a2) { _PrintEnter("GetPixel(%p,%p,%p)\n", a0, a1, a2); COLORREF rv = 0; __try { rv = Real_GetPixel(a0, a1, a2); } __finally { _PrintExit("GetPixel(,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_GetPixelFormat(HDC a0) { _PrintEnter("GetPixelFormat(%p)\n", a0); int rv = 0; __try { rv = Real_GetPixelFormat(a0); } __finally { _PrintExit("GetPixelFormat() -> %p\n", rv); }; return rv; } int __stdcall Mine_GetPolyFillMode(HDC a0) { _PrintEnter("GetPolyFillMode(%p)\n", a0); int rv = 0; __try { rv = Real_GetPolyFillMode(a0); } __finally { _PrintExit("GetPolyFillMode() -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetPriorityClass(HANDLE a0) { _PrintEnter("GetPriorityClass(%p)\n", a0); DWORD rv = 0; __try { rv = Real_GetPriorityClass(a0); } __finally { _PrintExit("GetPriorityClass() -> %p\n", rv); }; return rv; } int __stdcall Mine_GetPriorityClipboardFormat(UINT* a0, int a1) { _PrintEnter("GetPriorityClipboardFormat(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real_GetPriorityClipboardFormat(a0, a1); } __finally { _PrintExit("GetPriorityClipboardFormat(,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_GetPrivateProfileIntA(LPCSTR a0, LPCSTR a1, INT a2, LPCSTR a3) { _PrintEnter("GetPrivateProfileIntA(%hs,%hs,%p,%hs)\n", a0, a1, a2, a3); UINT rv = 0; __try { rv = Real_GetPrivateProfileIntA(a0, a1, a2, a3); } __finally { _PrintExit("GetPrivateProfileIntA(,,,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_GetPrivateProfileIntW(LPCWSTR a0, LPCWSTR a1, INT a2, LPCWSTR a3) { _PrintEnter("GetPrivateProfileIntW(%ls,%ls,%p,%ls)\n", a0, a1, a2, a3); UINT rv = 0; __try { rv = Real_GetPrivateProfileIntW(a0, a1, a2, a3); } __finally { _PrintExit("GetPrivateProfileIntW(,,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetPrivateProfileSectionA(LPCSTR a0, LPSTR a1, DWORD a2, LPCSTR a3) { _PrintEnter("GetPrivateProfileSectionA(%hs,%p,%p,%hs)\n", a0, a1, a2, a3); DWORD rv = 0; __try { rv = Real_GetPrivateProfileSectionA(a0, a1, a2, a3); } __finally { _PrintExit("GetPrivateProfileSectionA(,%hs,,) -> %p\n", a1, rv); }; return rv; } DWORD __stdcall Mine_GetPrivateProfileSectionNamesA(LPSTR a0, DWORD a1, LPCSTR a2) { _PrintEnter("GetPrivateProfileSectionNamesA(%p,%p,%hs)\n", a0, a1, a2); DWORD rv = 0; __try { rv = Real_GetPrivateProfileSectionNamesA(a0, a1, a2); } __finally { _PrintExit("GetPrivateProfileSectionNamesA(%hs,,) -> %p\n", a0, rv); }; return rv; } DWORD __stdcall Mine_GetPrivateProfileSectionNamesW(LPWSTR a0, DWORD a1, LPCWSTR a2) { _PrintEnter("GetPrivateProfileSectionNamesW(%p,%p,%ls)\n", a0, a1, a2); DWORD rv = 0; __try { rv = Real_GetPrivateProfileSectionNamesW(a0, a1, a2); } __finally { _PrintExit("GetPrivateProfileSectionNamesW(%ls,,) -> %p\n", a0, rv); }; return rv; } DWORD __stdcall Mine_GetPrivateProfileSectionW(LPCWSTR a0, LPWSTR a1, DWORD a2, LPCWSTR a3) { _PrintEnter("GetPrivateProfileSectionW(%ls,%p,%p,%ls)\n", a0, a1, a2, a3); DWORD rv = 0; __try { rv = Real_GetPrivateProfileSectionW(a0, a1, a2, a3); } __finally { _PrintExit("GetPrivateProfileSectionW(,%ls,,) -> %p\n", a1, rv); }; return rv; } DWORD __stdcall Mine_GetPrivateProfileStringA(LPCSTR a0, LPCSTR a1, LPCSTR a2, LPSTR a3, DWORD a4, LPCSTR a5) { _PrintEnter("GetPrivateProfileStringA(%hs,%hs,%hs,%p,%p,%hs)\n", a0, a1, a2, a3, a4, a5); DWORD rv = 0; __try { rv = Real_GetPrivateProfileStringA(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("GetPrivateProfileStringA(,,,%hs,,) -> %p\n", a3, rv); }; return rv; } DWORD __stdcall Mine_GetPrivateProfileStringW(LPCWSTR a0, LPCWSTR a1, LPCWSTR a2, LPWSTR a3, DWORD a4, LPCWSTR a5) { _PrintEnter("GetPrivateProfileStringW(%ls,%ls,%ls,%p,%p,%ls)\n", a0, a1, a2, a3, a4, a5); DWORD rv = 0; __try { rv = Real_GetPrivateProfileStringW(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("GetPrivateProfileStringW(,,,%ls,,) -> %p\n", a3, rv); }; return rv; } BOOL __stdcall Mine_GetPrivateProfileStructA(LPCSTR a0, LPCSTR a1, LPVOID a2, UINT a3, LPCSTR a4) { _PrintEnter("GetPrivateProfileStructA(%hs,%hs,%p,%p,%hs)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_GetPrivateProfileStructA(a0, a1, a2, a3, a4); } __finally { _PrintExit("GetPrivateProfileStructA(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetPrivateProfileStructW(LPCWSTR a0, LPCWSTR a1, LPVOID a2, UINT a3, LPCWSTR a4) { _PrintEnter("GetPrivateProfileStructW(%ls,%ls,%p,%p,%ls)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_GetPrivateProfileStructW(a0, a1, a2, a3, a4); } __finally { _PrintExit("GetPrivateProfileStructW(,,,,) -> %p\n", rv); }; return rv; } FARPROC __stdcall Mine_GetProcAddress(HMODULE a0, LPCSTR a1) { _PrintEnter("GetProcAddress(%p,%hs)\n", a0, a1); FARPROC rv = 0; __try { rv = Real_GetProcAddress(a0, a1); } __finally { _PrintExit("GetProcAddress(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetProcessAffinityMask(HANDLE a0, PDWORD_PTR a1, PDWORD_PTR a2) { _PrintEnter("GetProcessAffinityMask(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_GetProcessAffinityMask(a0, a1, a2); } __finally { _PrintExit("GetProcessAffinityMask(,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetProcessHeaps(DWORD a0, PHANDLE a1) { _PrintEnter("GetProcessHeaps(%p,%p)\n", a0, a1); DWORD rv = 0; __try { rv = Real_GetProcessHeaps(a0, a1); } __finally { _PrintExit("GetProcessHeaps(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetProcessShutdownParameters(LPDWORD a0, LPDWORD a1) { _PrintEnter("GetProcessShutdownParameters(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetProcessShutdownParameters(a0, a1); } __finally { _PrintExit("GetProcessShutdownParameters(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetProcessTimes(HANDLE a0, LPFILETIME a1, LPFILETIME a2, LPFILETIME a3, LPFILETIME a4) { _PrintEnter("GetProcessTimes(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_GetProcessTimes(a0, a1, a2, a3, a4); } __finally { _PrintExit("GetProcessTimes(,,,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetProcessVersion(DWORD a0) { _PrintEnter("GetProcessVersion(%p)\n", a0); DWORD rv = 0; __try { rv = Real_GetProcessVersion(a0); } __finally { _PrintExit("GetProcessVersion() -> %p\n", rv); }; return rv; } HWINSTA __stdcall Mine_GetProcessWindowStation(void) { _PrintEnter("GetProcessWindowStation()\n"); HWINSTA rv = 0; __try { rv = Real_GetProcessWindowStation(); } __finally { _PrintExit("GetProcessWindowStation() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetProcessWorkingSetSize(HANDLE a0, PSIZE_T a1, PSIZE_T a2) { _PrintEnter("GetProcessWorkingSetSize(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_GetProcessWorkingSetSize(a0, a1, a2); } __finally { _PrintExit("GetProcessWorkingSetSize(,,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_GetProfileIntA(LPCSTR a0, LPCSTR a1, INT a2) { _PrintEnter("GetProfileIntA(%hs,%hs,%p)\n", a0, a1, a2); UINT rv = 0; __try { rv = Real_GetProfileIntA(a0, a1, a2); } __finally { _PrintExit("GetProfileIntA(,,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_GetProfileIntW(LPCWSTR a0, LPCWSTR a1, INT a2) { _PrintEnter("GetProfileIntW(%ls,%ls,%p)\n", a0, a1, a2); UINT rv = 0; __try { rv = Real_GetProfileIntW(a0, a1, a2); } __finally { _PrintExit("GetProfileIntW(,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetProfileSectionA(LPCSTR a0, LPSTR a1, DWORD a2) { _PrintEnter("GetProfileSectionA(%hs,%p,%p)\n", a0, a1, a2); DWORD rv = 0; __try { rv = Real_GetProfileSectionA(a0, a1, a2); } __finally { _PrintExit("GetProfileSectionA(,%hs,) -> %p\n", a1, rv); }; return rv; } DWORD __stdcall Mine_GetProfileSectionW(LPCWSTR a0, LPWSTR a1, DWORD a2) { _PrintEnter("GetProfileSectionW(%ls,%p,%p)\n", a0, a1, a2); DWORD rv = 0; __try { rv = Real_GetProfileSectionW(a0, a1, a2); } __finally { _PrintExit("GetProfileSectionW(,%ls,) -> %p\n", a1, rv); }; return rv; } DWORD __stdcall Mine_GetProfileStringA(LPCSTR a0, LPCSTR a1, LPCSTR a2, LPSTR a3, DWORD a4) { _PrintEnter("GetProfileStringA(%hs,%hs,%hs,%p,%p)\n", a0, a1, a2, a3, a4); DWORD rv = 0; __try { rv = Real_GetProfileStringA(a0, a1, a2, a3, a4); } __finally { _PrintExit("GetProfileStringA(,,,%hs,) -> %p\n", a3, rv); }; return rv; } DWORD __stdcall Mine_GetProfileStringW(LPCWSTR a0, LPCWSTR a1, LPCWSTR a2, LPWSTR a3, DWORD a4) { _PrintEnter("GetProfileStringW(%ls,%ls,%ls,%p,%p)\n", a0, a1, a2, a3, a4); DWORD rv = 0; __try { rv = Real_GetProfileStringW(a0, a1, a2, a3, a4); } __finally { _PrintExit("GetProfileStringW(,,,%ls,) -> %p\n", a3, rv); }; return rv; } HANDLE __stdcall Mine_GetPropA(HWND a0, LPCSTR a1) { _PrintEnter("GetPropA(%p,%hs)\n", a0, a1); HANDLE rv = 0; __try { rv = Real_GetPropA(a0, a1); } __finally { _PrintExit("GetPropA(,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_GetPropW(HWND a0, LPCWSTR a1) { _PrintEnter("GetPropW(%p,%ls)\n", a0, a1); HANDLE rv = 0; __try { rv = Real_GetPropW(a0, a1); } __finally { _PrintExit("GetPropW(,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetQueueStatus(UINT a0) { _PrintEnter("GetQueueStatus(%p)\n", a0); DWORD rv = 0; __try { rv = Real_GetQueueStatus(a0); } __finally { _PrintExit("GetQueueStatus() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetQueuedCompletionStatus(HANDLE a0, LPDWORD a1, PULONG_PTR a2, LPOVERLAPPED* a3, DWORD a4) { _PrintEnter("GetQueuedCompletionStatus(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_GetQueuedCompletionStatus(a0, a1, a2, a3, a4); } __finally { _PrintExit("GetQueuedCompletionStatus(,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_GetROP2(HDC a0) { _PrintEnter("GetROP2(%p)\n", a0); int rv = 0; __try { rv = Real_GetROP2(a0); } __finally { _PrintExit("GetROP2() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetRasterizerCaps(LPRASTERIZER_STATUS a0, UINT a1) { _PrintEnter("GetRasterizerCaps(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetRasterizerCaps(a0, a1); } __finally { _PrintExit("GetRasterizerCaps(,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetRegionData(HRGN a0, DWORD a1, LPRGNDATA a2) { _PrintEnter("GetRegionData(%p,%p,%p)\n", a0, a1, a2); DWORD rv = 0; __try { rv = Real_GetRegionData(a0, a1, a2); } __finally { _PrintExit("GetRegionData(,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_GetRgnBox(HRGN a0, LPRECT a1) { _PrintEnter("GetRgnBox(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real_GetRgnBox(a0, a1); } __finally { _PrintExit("GetRgnBox(,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_GetRunningObjectTable(DWORD a0, LPRUNNINGOBJECTTABLE* a1) { _PrintEnter("GetRunningObjectTable(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_GetRunningObjectTable(a0, a1); } __finally { _PrintExit("GetRunningObjectTable(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetScrollInfo(HWND a0, int a1, LPSCROLLINFO a2) { _PrintEnter("GetScrollInfo(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_GetScrollInfo(a0, a1, a2); } __finally { _PrintExit("GetScrollInfo(,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_GetScrollPos(HWND a0, int a1) { _PrintEnter("GetScrollPos(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real_GetScrollPos(a0, a1); } __finally { _PrintExit("GetScrollPos(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetScrollRange(HWND a0, int a1, LPINT a2, LPINT a3) { _PrintEnter("GetScrollRange(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_GetScrollRange(a0, a1, a2, a3); } __finally { _PrintExit("GetScrollRange(,,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetShortPathNameA(LPCSTR a0, LPSTR a1, DWORD a2) { _PrintEnter("GetShortPathNameA(%hs,%p,%p)\n", a0, a1, a2); DWORD rv = 0; __try { rv = Real_GetShortPathNameA(a0, a1, a2); } __finally { _PrintExit("GetShortPathNameA(,%hs,) -> %p\n", a1, rv); }; return rv; } DWORD __stdcall Mine_GetShortPathNameW(LPCWSTR a0, LPWSTR a1, DWORD a2) { _PrintEnter("GetShortPathNameW(%ls,%p,%p)\n", a0, a1, a2); DWORD rv = 0; __try { rv = Real_GetShortPathNameW(a0, a1, a2); } __finally { _PrintExit("GetShortPathNameW(,%ls,) -> %p\n", a1, rv); }; return rv; } void __stdcall Mine_GetStartupInfoA(LPSTARTUPINFOA a0) { _PrintEnter("GetStartupInfoA(%p)\n", a0); __try { Real_GetStartupInfoA(a0); } __finally { _PrintExit("GetStartupInfoA() ->\n"); }; } void __stdcall Mine_GetStartupInfoW(LPSTARTUPINFOW a0) { _PrintEnter("GetStartupInfoW(%p)\n", a0); __try { Real_GetStartupInfoW(a0); } __finally { _PrintExit("GetStartupInfoW() ->\n"); }; } HANDLE __stdcall Mine_GetStdHandle(DWORD a0) { _PrintEnter("GetStdHandle(%p)\n", a0); HANDLE rv = 0; __try { rv = Real_GetStdHandle(a0); } __finally { _PrintExit("GetStdHandle() -> %p\n", rv); }; return rv; } HGDIOBJ __stdcall Mine_GetStockObject(int a0) { _PrintEnter("GetStockObject(%p)\n", a0); HGDIOBJ rv = 0; __try { rv = Real_GetStockObject(a0); } __finally { _PrintExit("GetStockObject() -> %p\n", rv); }; return rv; } int __stdcall Mine_GetStretchBltMode(HDC a0) { _PrintEnter("GetStretchBltMode(%p)\n", a0); int rv = 0; __try { rv = Real_GetStretchBltMode(a0); } __finally { _PrintExit("GetStretchBltMode() -> %p\n", rv); }; return rv; } HMENU __stdcall Mine_GetSubMenu(HMENU a0, int a1) { _PrintEnter("GetSubMenu(%p,%p)\n", a0, a1); HMENU rv = 0; __try { rv = Real_GetSubMenu(a0, a1); } __finally { _PrintExit("GetSubMenu(,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetSysColor(int a0) { _PrintEnter("GetSysColor(%p)\n", a0); DWORD rv = 0; __try { rv = Real_GetSysColor(a0); } __finally { _PrintExit("GetSysColor() -> %p\n", rv); }; return rv; } HBRUSH __stdcall Mine_GetSysColorBrush(int a0) { _PrintEnter("GetSysColorBrush(%p)\n", a0); HBRUSH rv = 0; __try { rv = Real_GetSysColorBrush(a0); } __finally { _PrintExit("GetSysColorBrush() -> %p\n", rv); }; return rv; } LCID __stdcall Mine_GetSystemDefaultLCID(void) { _PrintEnter("GetSystemDefaultLCID()\n"); LCID rv = 0; __try { rv = Real_GetSystemDefaultLCID(); } __finally { _PrintExit("GetSystemDefaultLCID() -> %p\n", rv); }; return rv; } LANGID __stdcall Mine_GetSystemDefaultLangID(void) { _PrintEnter("GetSystemDefaultLangID()\n"); LANGID rv = 0; __try { rv = Real_GetSystemDefaultLangID(); } __finally { _PrintExit("GetSystemDefaultLangID() -> %p\n", rv); }; return rv; } UINT __stdcall Mine_GetSystemDirectoryA(LPSTR a0, UINT a1) { _PrintEnter("GetSystemDirectoryA(%p,%p)\n", a0, a1); UINT rv = 0; __try { rv = Real_GetSystemDirectoryA(a0, a1); } __finally { _PrintExit("GetSystemDirectoryA(%hs,) -> %p\n", a0, rv); }; return rv; } UINT __stdcall Mine_GetSystemDirectoryW(LPWSTR a0, UINT a1) { _PrintEnter("GetSystemDirectoryW(%p,%p)\n", a0, a1); UINT rv = 0; __try { rv = Real_GetSystemDirectoryW(a0, a1); } __finally { _PrintExit("GetSystemDirectoryW(%ls,) -> %p\n", a0, rv); }; return rv; } void __stdcall Mine_GetSystemInfo(LPSYSTEM_INFO a0) { _PrintEnter("GetSystemInfo(%p)\n", a0); __try { Real_GetSystemInfo(a0); } __finally { _PrintExit("GetSystemInfo() ->\n"); }; } HMENU __stdcall Mine_GetSystemMenu(HWND a0, BOOL a1) { _PrintEnter("GetSystemMenu(%p,%p)\n", a0, a1); HMENU rv = 0; __try { rv = Real_GetSystemMenu(a0, a1); } __finally { _PrintExit("GetSystemMenu(,) -> %p\n", rv); }; return rv; } int __stdcall Mine_GetSystemMetrics(int a0) { _PrintEnter("GetSystemMetrics(%p)\n", a0); int rv = 0; __try { rv = Real_GetSystemMetrics(a0); } __finally { _PrintExit("GetSystemMetrics() -> %p\n", rv); }; return rv; } UINT __stdcall Mine_GetSystemPaletteEntries(HDC a0, UINT a1, UINT a2, PALETTEENTRY* a3) { _PrintEnter("GetSystemPaletteEntries(%p,%p,%p,%p)\n", a0, a1, a2, a3); UINT rv = 0; __try { rv = Real_GetSystemPaletteEntries(a0, a1, a2, a3); } __finally { _PrintExit("GetSystemPaletteEntries(,,,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_GetSystemPaletteUse(HDC a0) { _PrintEnter("GetSystemPaletteUse(%p)\n", a0); UINT rv = 0; __try { rv = Real_GetSystemPaletteUse(a0); } __finally { _PrintExit("GetSystemPaletteUse() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetSystemPowerStatus(LPSYSTEM_POWER_STATUS a0) { _PrintEnter("GetSystemPowerStatus(%p)\n", a0); BOOL rv = 0; __try { rv = Real_GetSystemPowerStatus(a0); } __finally { _PrintExit("GetSystemPowerStatus() -> %p\n", rv); }; return rv; } void __stdcall Mine_GetSystemTime(LPSYSTEMTIME a0) { _PrintEnter("GetSystemTime(%p)\n", a0); __try { Real_GetSystemTime(a0); } __finally { _PrintExit("GetSystemTime() ->\n"); }; } BOOL __stdcall Mine_GetSystemTimeAdjustment(PDWORD a0, PDWORD a1, PBOOL a2) { _PrintEnter("GetSystemTimeAdjustment(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_GetSystemTimeAdjustment(a0, a1, a2); } __finally { _PrintExit("GetSystemTimeAdjustment(,,) -> %p\n", rv); }; return rv; } void __stdcall Mine_GetSystemTimeAsFileTime(LPFILETIME a0) { _PrintEnter("GetSystemTimeAsFileTime(%p)\n", a0); __try { Real_GetSystemTimeAsFileTime(a0); } __finally { _PrintExit("GetSystemTimeAsFileTime() ->\n"); }; } DWORD __stdcall Mine_GetTabbedTextExtentA(HDC a0, LPCSTR a1, int a2, int a3, INT* a4) { _PrintEnter("GetTabbedTextExtentA(%p,%hs,%p,%p,%p)\n", a0, a1, a2, a3, a4); DWORD rv = 0; __try { rv = Real_GetTabbedTextExtentA(a0, a1, a2, a3, a4); } __finally { _PrintExit("GetTabbedTextExtentA(,,,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetTabbedTextExtentW(HDC a0, LPCWSTR a1, int a2, int a3, INT* a4) { _PrintEnter("GetTabbedTextExtentW(%p,%ls,%p,%p,%p)\n", a0, a1, a2, a3, a4); DWORD rv = 0; __try { rv = Real_GetTabbedTextExtentW(a0, a1, a2, a3, a4); } __finally { _PrintExit("GetTabbedTextExtentW(,,,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetTapeParameters(HANDLE a0, DWORD a1, LPDWORD a2, LPVOID a3) { _PrintEnter("GetTapeParameters(%p,%p,%p,%p)\n", a0, a1, a2, a3); DWORD rv = 0; __try { rv = Real_GetTapeParameters(a0, a1, a2, a3); } __finally { _PrintExit("GetTapeParameters(,,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetTapePosition(HANDLE a0, DWORD a1, LPDWORD a2, LPDWORD a3, LPDWORD a4) { _PrintEnter("GetTapePosition(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); DWORD rv = 0; __try { rv = Real_GetTapePosition(a0, a1, a2, a3, a4); } __finally { _PrintExit("GetTapePosition(,,,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetTapeStatus(HANDLE a0) { _PrintEnter("GetTapeStatus(%p)\n", a0); DWORD rv = 0; __try { rv = Real_GetTapeStatus(a0); } __finally { _PrintExit("GetTapeStatus() -> %p\n", rv); }; return rv; } UINT __stdcall Mine_GetTempFileNameA(LPCSTR a0, LPCSTR a1, UINT a2, LPSTR a3) { _PrintEnter("GetTempFileNameA(%hs,%hs,%p,%p)\n", a0, a1, a2, a3); UINT rv = 0; __try { rv = Real_GetTempFileNameA(a0, a1, a2, a3); } __finally { _PrintExit("GetTempFileNameA(,,,%hs) -> %p\n", a3, rv); }; return rv; } UINT __stdcall Mine_GetTempFileNameW(LPCWSTR a0, LPCWSTR a1, UINT a2, LPWSTR a3) { _PrintEnter("GetTempFileNameW(%ls,%ls,%p,%p)\n", a0, a1, a2, a3); UINT rv = 0; __try { rv = Real_GetTempFileNameW(a0, a1, a2, a3); } __finally { _PrintExit("GetTempFileNameW(,,,%ls) -> %p\n", a3, rv); }; return rv; } DWORD __stdcall Mine_GetTempPathA(DWORD a0, LPSTR a1) { _PrintEnter("GetTempPathA(%p,%p)\n", a0, a1); DWORD rv = 0; __try { rv = Real_GetTempPathA(a0, a1); } __finally { _PrintExit("GetTempPathA(,%hs) -> %p\n", a1, rv); }; return rv; } DWORD __stdcall Mine_GetTempPathW(DWORD a0, LPWSTR a1) { _PrintEnter("GetTempPathW(%p,%p)\n", a0, a1); DWORD rv = 0; __try { rv = Real_GetTempPathW(a0, a1); } __finally { _PrintExit("GetTempPathW(,%ls) -> %p\n", a1, rv); }; return rv; } UINT __stdcall Mine_GetTextAlign(HDC a0) { _PrintEnter("GetTextAlign(%p)\n", a0); UINT rv = 0; __try { rv = Real_GetTextAlign(a0); } __finally { _PrintExit("GetTextAlign() -> %p\n", rv); }; return rv; } int __stdcall Mine_GetTextCharacterExtra(HDC a0) { _PrintEnter("GetTextCharacterExtra(%p)\n", a0); int rv = 0; __try { rv = Real_GetTextCharacterExtra(a0); } __finally { _PrintExit("GetTextCharacterExtra() -> %p\n", rv); }; return rv; } int __stdcall Mine_GetTextCharset(HDC a0) { _PrintEnter("GetTextCharset(%p)\n", a0); int rv = 0; __try { rv = Real_GetTextCharset(a0); } __finally { _PrintExit("GetTextCharset() -> %p\n", rv); }; return rv; } int __stdcall Mine_GetTextCharsetInfo(HDC a0, LPFONTSIGNATURE a1, DWORD a2) { _PrintEnter("GetTextCharsetInfo(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_GetTextCharsetInfo(a0, a1, a2); } __finally { _PrintExit("GetTextCharsetInfo(,,) -> %p\n", rv); }; return rv; } COLORREF __stdcall Mine_GetTextColor(HDC a0) { _PrintEnter("GetTextColor(%p)\n", a0); COLORREF rv = 0; __try { rv = Real_GetTextColor(a0); } __finally { _PrintExit("GetTextColor() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetTextExtentExPointA(HDC a0, LPCSTR a1, int a2, int a3, LPINT a4, LPINT a5, SIZE* a6) { _PrintEnter("GetTextExtentExPointA(%p,%hs,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); BOOL rv = 0; __try { rv = Real_GetTextExtentExPointA(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("GetTextExtentExPointA(,,,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetTextExtentExPointW(HDC a0, LPCWSTR a1, int a2, int a3, LPINT a4, LPINT a5, SIZE* a6) { _PrintEnter("GetTextExtentExPointW(%p,%ls,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); BOOL rv = 0; __try { rv = Real_GetTextExtentExPointW(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("GetTextExtentExPointW(,,,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetTextExtentPoint32A(HDC a0, LPCSTR a1, int a2, SIZE* a3) { _PrintEnter("GetTextExtentPoint32A(%p,%hs,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_GetTextExtentPoint32A(a0, a1, a2, a3); } __finally { _PrintExit("GetTextExtentPoint32A(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetTextExtentPoint32W(HDC a0, LPCWSTR a1, int a2, SIZE* a3) { _PrintEnter("GetTextExtentPoint32W(%p,%ls,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_GetTextExtentPoint32W(a0, a1, a2, a3); } __finally { _PrintExit("GetTextExtentPoint32W(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetTextExtentPointA(HDC a0, LPCSTR a1, int a2, SIZE* a3) { _PrintEnter("GetTextExtentPointA(%p,%hs,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_GetTextExtentPointA(a0, a1, a2, a3); } __finally { _PrintExit("GetTextExtentPointA(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetTextExtentPointW(HDC a0, LPCWSTR a1, int a2, SIZE* a3) { _PrintEnter("GetTextExtentPointW(%p,%ls,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_GetTextExtentPointW(a0, a1, a2, a3); } __finally { _PrintExit("GetTextExtentPointW(,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_GetTextFaceA(HDC a0, int a1, LPSTR a2) { _PrintEnter("GetTextFaceA(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_GetTextFaceA(a0, a1, a2); } __finally { _PrintExit("GetTextFaceA(,,%hs) -> %p\n", a2, rv); }; return rv; } int __stdcall Mine_GetTextFaceW(HDC a0, int a1, LPWSTR a2) { _PrintEnter("GetTextFaceW(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_GetTextFaceW(a0, a1, a2); } __finally { _PrintExit("GetTextFaceW(,,%ls) -> %p\n", a2, rv); }; return rv; } BOOL __stdcall Mine_GetTextMetricsA(HDC a0, LPTEXTMETRICA a1) { _PrintEnter("GetTextMetricsA(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetTextMetricsA(a0, a1); } __finally { _PrintExit("GetTextMetricsA(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetTextMetricsW(HDC a0, LPTEXTMETRICW a1) { _PrintEnter("GetTextMetricsW(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetTextMetricsW(a0, a1); } __finally { _PrintExit("GetTextMetricsW(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetThreadContext(HANDLE a0, LPCONTEXT a1) { _PrintEnter("GetThreadContext(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetThreadContext(a0, a1); } __finally { _PrintExit("GetThreadContext(,) -> %p\n", rv); }; return rv; } HDESK __stdcall Mine_GetThreadDesktop(DWORD a0) { _PrintEnter("GetThreadDesktop(%p)\n", a0); HDESK rv = 0; __try { rv = Real_GetThreadDesktop(a0); } __finally { _PrintExit("GetThreadDesktop() -> %p\n", rv); }; return rv; } #if(WINVER >= 0x0500) LCID __stdcall Mine_GetThreadLocale(void) { _PrintEnter("GetThreadLocale()\n"); LCID rv = 0; __try { rv = Real_GetThreadLocale(); } __finally { _PrintExit("GetThreadLocale() -> %p\n", rv); }; return rv; } #endif // (WINVER >= 0x0500) int __stdcall Mine_GetThreadPriority(HANDLE a0) { _PrintEnter("GetThreadPriority(%p)\n", a0); int rv = 0; __try { rv = Real_GetThreadPriority(a0); } __finally { _PrintExit("GetThreadPriority() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetThreadPriorityBoost(HANDLE a0, PBOOL a1) { _PrintEnter("GetThreadPriorityBoost(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetThreadPriorityBoost(a0, a1); } __finally { _PrintExit("GetThreadPriorityBoost(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetThreadSelectorEntry(HANDLE a0, DWORD a1, LPLDT_ENTRY a2) { _PrintEnter("GetThreadSelectorEntry(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_GetThreadSelectorEntry(a0, a1, a2); } __finally { _PrintExit("GetThreadSelectorEntry(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetThreadTimes(HANDLE a0, LPFILETIME a1, LPFILETIME a2, LPFILETIME a3, LPFILETIME a4) { _PrintEnter("GetThreadTimes(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_GetThreadTimes(a0, a1, a2, a3, a4); } __finally { _PrintExit("GetThreadTimes(,,,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetTickCount(void) { _PrintEnter("GetTickCount()\n"); DWORD rv = 0; __try { rv = Real_GetTickCount(); } __finally { _PrintExit("GetTickCount() -> %p\n", rv); }; return rv; } int __stdcall Mine_GetTimeFormatA(LCID a0, DWORD a1, SYSTEMTIME* a2, LPCSTR a3, LPSTR a4, int a5) { _PrintEnter("GetTimeFormatA(%p,%p,%p,%hs,%p,%p)\n", a0, a1, a2, a3, a4, a5); int rv = 0; __try { rv = Real_GetTimeFormatA(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("GetTimeFormatA(,,,,%hs,) -> %p\n", a4, rv); }; return rv; } int __stdcall Mine_GetTimeFormatW(LCID a0, DWORD a1, SYSTEMTIME* a2, LPCWSTR a3, LPWSTR a4, int a5) { _PrintEnter("GetTimeFormatW(%p,%p,%p,%ls,%p,%p)\n", a0, a1, a2, a3, a4, a5); int rv = 0; __try { rv = Real_GetTimeFormatW(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("GetTimeFormatW(,,,,%ls,) -> %p\n", a4, rv); }; return rv; } DWORD __stdcall Mine_GetTimeZoneInformation(LPTIME_ZONE_INFORMATION a0) { _PrintEnter("GetTimeZoneInformation(%p)\n", a0); DWORD rv = 0; __try { rv = Real_GetTimeZoneInformation(a0); } __finally { _PrintExit("GetTimeZoneInformation() -> %p\n", rv); }; return rv; } HWND __stdcall Mine_GetTopWindow(HWND a0) { _PrintEnter("GetTopWindow(%p)\n", a0); HWND rv = 0; __try { rv = Real_GetTopWindow(a0); } __finally { _PrintExit("GetTopWindow() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetUpdateRect(HWND a0, LPRECT a1, BOOL a2) { _PrintEnter("GetUpdateRect(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_GetUpdateRect(a0, a1, a2); } __finally { _PrintExit("GetUpdateRect(,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_GetUpdateRgn(HWND a0, HRGN a1, BOOL a2) { _PrintEnter("GetUpdateRgn(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_GetUpdateRgn(a0, a1, a2); } __finally { _PrintExit("GetUpdateRgn(,,) -> %p\n", rv); }; return rv; } LCID __stdcall Mine_GetUserDefaultLCID(void) { _PrintEnter("GetUserDefaultLCID()\n"); LCID rv = 0; __try { rv = Real_GetUserDefaultLCID(); } __finally { _PrintExit("GetUserDefaultLCID() -> %p\n", rv); }; return rv; } LANGID __stdcall Mine_GetUserDefaultLangID(void) { _PrintEnter("GetUserDefaultLangID()\n"); LANGID rv = 0; __try { rv = Real_GetUserDefaultLangID(); } __finally { _PrintExit("GetUserDefaultLangID() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetUserObjectInformationA(HANDLE a0, int a1, PVOID a2, DWORD a3, LPDWORD a4) { _PrintEnter("GetUserObjectInformationA(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_GetUserObjectInformationA(a0, a1, a2, a3, a4); } __finally { _PrintExit("GetUserObjectInformationA(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetUserObjectInformationW(HANDLE a0, int a1, PVOID a2, DWORD a3, LPDWORD a4) { _PrintEnter("GetUserObjectInformationW(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_GetUserObjectInformationW(a0, a1, a2, a3, a4); } __finally { _PrintExit("GetUserObjectInformationW(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetUserObjectSecurity(HANDLE a0, PSECURITY_INFORMATION a1, PSECURITY_DESCRIPTOR a2, DWORD a3, LPDWORD a4) { _PrintEnter("GetUserObjectSecurity(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_GetUserObjectSecurity(a0, a1, a2, a3, a4); } __finally { _PrintExit("GetUserObjectSecurity(,,,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetVersion(void) { _PrintEnter("GetVersion()\n"); DWORD rv = 0; __try { rv = Real_GetVersion(); } __finally { _PrintExit("GetVersion() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetVersionExA(LPOSVERSIONINFOA a0) { _PrintEnter("GetVersionExA(%p)\n", a0); BOOL rv = 0; __try { rv = Real_GetVersionExA(a0); } __finally { _PrintExit("GetVersionExA() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetVersionExW(LPOSVERSIONINFOW a0) { _PrintEnter("GetVersionExW(%p)\n", a0); BOOL rv = 0; __try { rv = Real_GetVersionExW(a0); } __finally { _PrintExit("GetVersionExW() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetViewportExtEx(HDC a0, SIZE* a1) { _PrintEnter("GetViewportExtEx(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetViewportExtEx(a0, a1); } __finally { _PrintExit("GetViewportExtEx(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetViewportOrgEx(HDC a0, POINT* a1) { _PrintEnter("GetViewportOrgEx(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetViewportOrgEx(a0, a1); } __finally { _PrintExit("GetViewportOrgEx(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetVolumeInformationA(LPCSTR a0, LPSTR a1, DWORD a2, LPDWORD a3, LPDWORD a4, LPDWORD a5, LPSTR a6, DWORD a7) { _PrintEnter("GetVolumeInformationA(%hs,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7); BOOL rv = 0; __try { rv = Real_GetVolumeInformationA(a0, a1, a2, a3, a4, a5, a6, a7); } __finally { _PrintExit("GetVolumeInformationA(,%hs,,,,,%hs,) -> %p\n", a1, a6, rv); }; return rv; } BOOL __stdcall Mine_GetVolumeInformationW(LPCWSTR a0, LPWSTR a1, DWORD a2, LPDWORD a3, LPDWORD a4, LPDWORD a5, LPWSTR a6, DWORD a7) { _PrintEnter("GetVolumeInformationW(%ls,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7); BOOL rv = 0; __try { rv = Real_GetVolumeInformationW(a0, a1, a2, a3, a4, a5, a6, a7); } __finally { _PrintExit("GetVolumeInformationW(,%ls,,,,,%ls,) -> %p\n", a1, a6, rv); }; return rv; } UINT __stdcall Mine_GetWinMetaFileBits(HENHMETAFILE a0, UINT a1, LPBYTE a2, INT a3, HDC a4) { _PrintEnter("GetWinMetaFileBits(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); UINT rv = 0; __try { rv = Real_GetWinMetaFileBits(a0, a1, a2, a3, a4); } __finally { _PrintExit("GetWinMetaFileBits(,,,,) -> %p\n", rv); }; return rv; } HWND __stdcall Mine_GetWindow(HWND a0, UINT a1) { _PrintEnter("GetWindow(%p,%p)\n", a0, a1); HWND rv = 0; __try { rv = Real_GetWindow(a0, a1); } __finally { _PrintExit("GetWindow(,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_GetWindowContextHelpId(HWND a0) { _PrintEnter("GetWindowContextHelpId(%p)\n", a0); DWORD rv = 0; __try { rv = Real_GetWindowContextHelpId(a0); } __finally { _PrintExit("GetWindowContextHelpId() -> %p\n", rv); }; return rv; } HDC __stdcall Mine_GetWindowDC(HWND a0) { _PrintEnter("GetWindowDC(%p)\n", a0); HDC rv = 0; __try { rv = Real_GetWindowDC(a0); } __finally { _PrintExit("GetWindowDC() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetWindowExtEx(HDC a0, SIZE* a1) { _PrintEnter("GetWindowExtEx(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetWindowExtEx(a0, a1); } __finally { _PrintExit("GetWindowExtEx(,) -> %p\n", rv); }; return rv; } LONG __stdcall Mine_GetWindowLongA(HWND a0, int a1) { _PrintEnter("GetWindowLongA(%p,%p)\n", a0, a1); LONG rv = 0; __try { rv = Real_GetWindowLongA(a0, a1); } __finally { _PrintExit("GetWindowLongA(,) -> %p\n", rv); }; return rv; } LONG __stdcall Mine_GetWindowLongW(HWND a0, int a1) { _PrintEnter("GetWindowLongW(%p,%p)\n", a0, a1); LONG rv = 0; __try { rv = Real_GetWindowLongW(a0, a1); } __finally { _PrintExit("GetWindowLongW(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetWindowOrgEx(HDC a0, POINT* a1) { _PrintEnter("GetWindowOrgEx(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetWindowOrgEx(a0, a1); } __finally { _PrintExit("GetWindowOrgEx(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetWindowPlacement(HWND a0, WINDOWPLACEMENT* a1) { _PrintEnter("GetWindowPlacement(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetWindowPlacement(a0, a1); } __finally { _PrintExit("GetWindowPlacement(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GetWindowRect(HWND a0, LPRECT a1) { _PrintEnter("GetWindowRect(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetWindowRect(a0, a1); } __finally { _PrintExit("GetWindowRect(,) -> %p\n", rv); }; return rv; } int __stdcall Mine_GetWindowRgn(HWND a0, HRGN a1) { _PrintEnter("GetWindowRgn(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real_GetWindowRgn(a0, a1); } __finally { _PrintExit("GetWindowRgn(,) -> %p\n", rv); }; return rv; } int __stdcall Mine_GetWindowTextA(HWND a0, LPSTR a1, int a2) { _PrintEnter("GetWindowTextA(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_GetWindowTextA(a0, a1, a2); } __finally { _PrintExit("GetWindowTextA(,%hs,) -> %p\n", a1, rv); }; return rv; } int __stdcall Mine_GetWindowTextLengthA(HWND a0) { _PrintEnter("GetWindowTextLengthA(%p)\n", a0); int rv = 0; __try { rv = Real_GetWindowTextLengthA(a0); } __finally { _PrintExit("GetWindowTextLengthA() -> %p\n", rv); }; return rv; } int __stdcall Mine_GetWindowTextLengthW(HWND a0) { _PrintEnter("GetWindowTextLengthW(%p)\n", a0); int rv = 0; __try { rv = Real_GetWindowTextLengthW(a0); } __finally { _PrintExit("GetWindowTextLengthW() -> %p\n", rv); }; return rv; } int __stdcall Mine_GetWindowTextW(HWND a0, LPWSTR a1, int a2) { _PrintEnter("GetWindowTextW(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_GetWindowTextW(a0, a1, a2); } __finally { _PrintExit("GetWindowTextW(,%ls,) -> %p\n", a1, rv); }; return rv; } DWORD __stdcall Mine_GetWindowThreadProcessId(HWND a0, LPDWORD a1) { _PrintEnter("GetWindowThreadProcessId(%p,%p)\n", a0, a1); DWORD rv = 0; __try { rv = Real_GetWindowThreadProcessId(a0, a1); } __finally { _PrintExit("GetWindowThreadProcessId(,) -> %p\n", rv); }; return rv; } WORD __stdcall Mine_GetWindowWord(HWND a0, int a1) { _PrintEnter("GetWindowWord(%p,%p)\n", a0, a1); WORD rv = 0; __try { rv = Real_GetWindowWord(a0, a1); } __finally { _PrintExit("GetWindowWord(,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_GetWindowsDirectoryA(LPSTR a0, UINT a1) { _PrintEnter("GetWindowsDirectoryA(%p,%p)\n", a0, a1); UINT rv = 0; __try { rv = Real_GetWindowsDirectoryA(a0, a1); } __finally { _PrintExit("GetWindowsDirectoryA(%hs,) -> %p\n", a0, rv); }; return rv; } UINT __stdcall Mine_GetWindowsDirectoryW(LPWSTR a0, UINT a1) { _PrintEnter("GetWindowsDirectoryW(%p,%p)\n", a0, a1); UINT rv = 0; __try { rv = Real_GetWindowsDirectoryW(a0, a1); } __finally { _PrintExit("GetWindowsDirectoryW(%ls,) -> %p\n", a0, rv); }; return rv; } BOOL __stdcall Mine_GetWorldTransform(HDC a0, XFORM* a1) { _PrintEnter("GetWorldTransform(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetWorldTransform(a0, a1); } __finally { _PrintExit("GetWorldTransform(,) -> %p\n", rv); }; return rv; } ATOM __stdcall Mine_GlobalAddAtomA(LPCSTR a0) { _PrintEnter("GlobalAddAtomA(%hs)\n", a0); ATOM rv = 0; __try { rv = Real_GlobalAddAtomA(a0); } __finally { _PrintExit("GlobalAddAtomA() -> %p\n", rv); }; return rv; } ATOM __stdcall Mine_GlobalAddAtomW(LPCWSTR a0) { _PrintEnter("GlobalAddAtomW(%ls)\n", a0); ATOM rv = 0; __try { rv = Real_GlobalAddAtomW(a0); } __finally { _PrintExit("GlobalAddAtomW() -> %p\n", rv); }; return rv; } HGLOBAL __stdcall Mine_GlobalAlloc(UINT a0, SIZE_T a1) { _PrintEnter("GlobalAlloc(%p,%p)\n", a0, a1); HGLOBAL rv = 0; __try { rv = Real_GlobalAlloc(a0, a1); } __finally { _PrintExit("GlobalAlloc(,) -> %p\n", rv); }; return rv; } SIZE_T __stdcall Mine_GlobalCompact(DWORD a0) { _PrintEnter("GlobalCompact(%p)\n", a0); SIZE_T rv = 0; __try { rv = Real_GlobalCompact(a0); } __finally { _PrintExit("GlobalCompact() -> %p\n", rv); }; return rv; } ATOM __stdcall Mine_GlobalDeleteAtom(ATOM a0) { _PrintEnter("GlobalDeleteAtom(%p)\n", a0); ATOM rv = 0; __try { rv = Real_GlobalDeleteAtom(a0); } __finally { _PrintExit("GlobalDeleteAtom() -> %p\n", rv); }; return rv; } ATOM __stdcall Mine_GlobalFindAtomA(LPCSTR a0) { _PrintEnter("GlobalFindAtomA(%hs)\n", a0); ATOM rv = 0; __try { rv = Real_GlobalFindAtomA(a0); } __finally { _PrintExit("GlobalFindAtomA() -> %p\n", rv); }; return rv; } ATOM __stdcall Mine_GlobalFindAtomW(LPCWSTR a0) { _PrintEnter("GlobalFindAtomW(%ls)\n", a0); ATOM rv = 0; __try { rv = Real_GlobalFindAtomW(a0); } __finally { _PrintExit("GlobalFindAtomW() -> %p\n", rv); }; return rv; } void __stdcall Mine_GlobalFix(HGLOBAL a0) { _PrintEnter("GlobalFix(%p)\n", a0); __try { Real_GlobalFix(a0); } __finally { _PrintExit("GlobalFix() ->\n"); }; } UINT __stdcall Mine_GlobalFlags(HGLOBAL a0) { _PrintEnter("GlobalFlags(%p)\n", a0); UINT rv = 0; __try { rv = Real_GlobalFlags(a0); } __finally { _PrintExit("GlobalFlags() -> %p\n", rv); }; return rv; } HGLOBAL __stdcall Mine_GlobalFree(HGLOBAL a0) { _PrintEnter("GlobalFree(%p)\n", a0); HGLOBAL rv = 0; __try { rv = Real_GlobalFree(a0); } __finally { _PrintExit("GlobalFree() -> %p\n", rv); }; return rv; } UINT __stdcall Mine_GlobalGetAtomNameA(ATOM a0, LPSTR a1, int a2) { _PrintEnter("GlobalGetAtomNameA(%p,%p,%p)\n", a0, a1, a2); UINT rv = 0; __try { rv = Real_GlobalGetAtomNameA(a0, a1, a2); } __finally { _PrintExit("GlobalGetAtomNameA(,%hs,) -> %p\n", a1, rv); }; return rv; } UINT __stdcall Mine_GlobalGetAtomNameW(ATOM a0, LPWSTR a1, int a2) { _PrintEnter("GlobalGetAtomNameW(%p,%p,%p)\n", a0, a1, a2); UINT rv = 0; __try { rv = Real_GlobalGetAtomNameW(a0, a1, a2); } __finally { _PrintExit("GlobalGetAtomNameW(,%ls,) -> %p\n", a1, rv); }; return rv; } HGLOBAL __stdcall Mine_GlobalHandle(LPCVOID a0) { _PrintEnter("GlobalHandle(%p)\n", a0); HGLOBAL rv = 0; __try { rv = Real_GlobalHandle(a0); } __finally { _PrintExit("GlobalHandle() -> %p\n", rv); }; return rv; } LPVOID __stdcall Mine_GlobalLock(HGLOBAL a0) { _PrintEnter("GlobalLock(%p)\n", a0); LPVOID rv = 0; __try { rv = Real_GlobalLock(a0); } __finally { _PrintExit("GlobalLock() -> %p\n", rv); }; return rv; } void __stdcall Mine_GlobalMemoryStatus(LPMEMORYSTATUS a0) { _PrintEnter("GlobalMemoryStatus(%p)\n", a0); __try { Real_GlobalMemoryStatus(a0); } __finally { _PrintExit("GlobalMemoryStatus() ->\n"); }; } HGLOBAL __stdcall Mine_GlobalReAlloc(HGLOBAL a0, SIZE_T a1, UINT a2) { _PrintEnter("GlobalReAlloc(%p,%p,%p)\n", a0, a1, a2); HGLOBAL rv = 0; __try { rv = Real_GlobalReAlloc(a0, a1, a2); } __finally { _PrintExit("GlobalReAlloc(,,) -> %p\n", rv); }; return rv; } SIZE_T __stdcall Mine_GlobalSize(HGLOBAL a0) { _PrintEnter("GlobalSize(%p)\n", a0); SIZE_T rv = 0; __try { rv = Real_GlobalSize(a0); } __finally { _PrintExit("GlobalSize() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GlobalUnWire(HGLOBAL a0) { _PrintEnter("GlobalUnWire(%p)\n", a0); BOOL rv = 0; __try { rv = Real_GlobalUnWire(a0); } __finally { _PrintExit("GlobalUnWire() -> %p\n", rv); }; return rv; } void __stdcall Mine_GlobalUnfix(HGLOBAL a0) { _PrintEnter("GlobalUnfix(%p)\n", a0); __try { Real_GlobalUnfix(a0); } __finally { _PrintExit("GlobalUnfix() ->\n"); }; } BOOL __stdcall Mine_GlobalUnlock(HGLOBAL a0) { _PrintEnter("GlobalUnlock(%p)\n", a0); BOOL rv = 0; __try { rv = Real_GlobalUnlock(a0); } __finally { _PrintExit("GlobalUnlock() -> %p\n", rv); }; return rv; } LPVOID __stdcall Mine_GlobalWire(HGLOBAL a0) { _PrintEnter("GlobalWire(%p)\n", a0); LPVOID rv = 0; __try { rv = Real_GlobalWire(a0); } __finally { _PrintExit("GlobalWire() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GrayStringA(HDC a0, HBRUSH a1, GRAYSTRINGPROC a2, LPARAM a3, int a4, int a5, int a6, int a7, int a8) { _PrintEnter("GrayStringA(%p,%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8); BOOL rv = 0; __try { rv = Real_GrayStringA(a0, a1, a2, a3, a4, a5, a6, a7, a8); } __finally { _PrintExit("GrayStringA(,,,,,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_GrayStringW(HDC a0, HBRUSH a1, GRAYSTRINGPROC a2, LPARAM a3, int a4, int a5, int a6, int a7, int a8) { _PrintEnter("GrayStringW(%p,%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8); BOOL rv = 0; __try { rv = Real_GrayStringW(a0, a1, a2, a3, a4, a5, a6, a7, a8); } __finally { _PrintExit("GrayStringW(,,,,,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_HeapLock(HANDLE a0) { _PrintEnter("HeapLock(%p)\n", a0); BOOL rv = 0; __try { rv = Real_HeapLock(a0); } __finally { _PrintExit("HeapLock() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_HeapUnlock(HANDLE a0) { _PrintEnter("HeapUnlock(%p)\n", a0); BOOL rv = 0; __try { rv = Real_HeapUnlock(a0); } __finally { _PrintExit("HeapUnlock() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_HideCaret(HWND a0) { _PrintEnter("HideCaret(%p)\n", a0); BOOL rv = 0; __try { rv = Real_HideCaret(a0); } __finally { _PrintExit("HideCaret() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_HiliteMenuItem(HWND a0, HMENU a1, UINT a2, UINT a3) { _PrintEnter("HiliteMenuItem(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_HiliteMenuItem(a0, a1, a2, a3); } __finally { _PrintExit("HiliteMenuItem(,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_IIDFromString(LPOLESTR a0, LPGUID a1) { _PrintEnter("IIDFromString(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_IIDFromString(a0, a1); } __finally { _PrintExit("IIDFromString(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ImpersonateDdeClientWindow(HWND a0, HWND a1) { _PrintEnter("ImpersonateDdeClientWindow(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_ImpersonateDdeClientWindow(a0, a1); } __finally { _PrintExit("ImpersonateDdeClientWindow(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_InSendMessage(void) { _PrintEnter("InSendMessage()\n"); BOOL rv = 0; __try { rv = Real_InSendMessage(); } __finally { _PrintExit("InSendMessage() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_InflateRect(LPRECT a0, int a1, int a2) { _PrintEnter("InflateRect(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_InflateRect(a0, a1, a2); } __finally { _PrintExit("InflateRect(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_InitAtomTable(DWORD a0) { _PrintEnter("InitAtomTable(%p)\n", a0); BOOL rv = 0; __try { rv = Real_InitAtomTable(a0); } __finally { _PrintExit("InitAtomTable() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_InsertMenuA(HMENU a0, UINT a1, UINT a2, UINT_PTR a3, LPCSTR a4) { _PrintEnter("InsertMenuA(%p,%p,%p,%p,%hs)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_InsertMenuA(a0, a1, a2, a3, a4); } __finally { _PrintExit("InsertMenuA(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_InsertMenuItemA(HMENU a0, UINT a1, BOOL a2, MENUITEMINFOA* a3) { _PrintEnter("InsertMenuItemA(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_InsertMenuItemA(a0, a1, a2, a3); } __finally { _PrintExit("InsertMenuItemA(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_InsertMenuItemW(HMENU a0, UINT a1, BOOL a2, MENUITEMINFOW* a3) { _PrintEnter("InsertMenuItemW(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_InsertMenuItemW(a0, a1, a2, a3); } __finally { _PrintExit("InsertMenuItemW(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_InsertMenuW(HMENU a0, UINT a1, UINT a2, UINT_PTR a3, LPCWSTR a4) { _PrintEnter("InsertMenuW(%p,%p,%p,%p,%ls)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_InsertMenuW(a0, a1, a2, a3, a4); } __finally { _PrintExit("InsertMenuW(,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_IntersectClipRect(HDC a0, int a1, int a2, int a3, int a4) { _PrintEnter("IntersectClipRect(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); int rv = 0; __try { rv = Real_IntersectClipRect(a0, a1, a2, a3, a4); } __finally { _PrintExit("IntersectClipRect(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_IntersectRect(LPRECT a0, RECT* a1, RECT* a2) { _PrintEnter("IntersectRect(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_IntersectRect(a0, a1, a2); } __finally { _PrintExit("IntersectRect(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_InvalidateRect(HWND a0, RECT* a1, BOOL a2) { _PrintEnter("InvalidateRect(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_InvalidateRect(a0, a1, a2); } __finally { _PrintExit("InvalidateRect(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_InvalidateRgn(HWND a0, HRGN a1, BOOL a2) { _PrintEnter("InvalidateRgn(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_InvalidateRgn(a0, a1, a2); } __finally { _PrintExit("InvalidateRgn(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_InvertRect(HDC a0, RECT* a1) { _PrintEnter("InvertRect(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_InvertRect(a0, a1); } __finally { _PrintExit("InvertRect(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_InvertRgn(HDC a0, HRGN a1) { _PrintEnter("InvertRgn(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_InvertRgn(a0, a1); } __finally { _PrintExit("InvertRgn(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_IsAccelerator(HACCEL a0, int a1, LPMSG a2, WORD* a3) { _PrintEnter("IsAccelerator(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_IsAccelerator(a0, a1, a2, a3); } __finally { _PrintExit("IsAccelerator(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_IsBadCodePtr(FARPROC a0) { _PrintEnter("IsBadCodePtr(%p)\n", a0); BOOL rv = 0; __try { rv = Real_IsBadCodePtr(a0); } __finally { _PrintExit("IsBadCodePtr() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_IsBadHugeReadPtr(void* a0, UINT_PTR a1) { _PrintEnter("IsBadHugeReadPtr(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_IsBadHugeReadPtr(a0, a1); } __finally { _PrintExit("IsBadHugeReadPtr(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_IsBadHugeWritePtr(LPVOID a0, UINT_PTR a1) { _PrintEnter("IsBadHugeWritePtr(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_IsBadHugeWritePtr(a0, a1); } __finally { _PrintExit("IsBadHugeWritePtr(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_IsBadReadPtr(void* a0, UINT_PTR a1) { _PrintEnter("IsBadReadPtr(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_IsBadReadPtr(a0, a1); } __finally { _PrintExit("IsBadReadPtr(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_IsBadStringPtrA(LPCSTR a0, UINT_PTR a1) { _PrintEnter("IsBadStringPtrA(%hs,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_IsBadStringPtrA(a0, a1); } __finally { _PrintExit("IsBadStringPtrA(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_IsBadStringPtrW(LPCWSTR a0, UINT_PTR a1) { _PrintEnter("IsBadStringPtrW(%ls,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_IsBadStringPtrW(a0, a1); } __finally { _PrintExit("IsBadStringPtrW(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_IsBadWritePtr(LPVOID a0, UINT_PTR a1) { _PrintEnter("IsBadWritePtr(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_IsBadWritePtr(a0, a1); } __finally { _PrintExit("IsBadWritePtr(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_IsCharAlphaA(CHAR a0) { _PrintEnter("IsCharAlphaA(%p)\n", a0); BOOL rv = 0; __try { rv = Real_IsCharAlphaA(a0); } __finally { _PrintExit("IsCharAlphaA() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_IsCharAlphaNumericA(CHAR a0) { _PrintEnter("IsCharAlphaNumericA(%p)\n", a0); BOOL rv = 0; __try { rv = Real_IsCharAlphaNumericA(a0); } __finally { _PrintExit("IsCharAlphaNumericA() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_IsCharAlphaNumericW(WCHAR a0) { _PrintEnter("IsCharAlphaNumericW(%p)\n", a0); BOOL rv = 0; __try { rv = Real_IsCharAlphaNumericW(a0); } __finally { _PrintExit("IsCharAlphaNumericW() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_IsCharAlphaW(WCHAR a0) { _PrintEnter("IsCharAlphaW(%p)\n", a0); BOOL rv = 0; __try { rv = Real_IsCharAlphaW(a0); } __finally { _PrintExit("IsCharAlphaW() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_IsCharLowerA(CHAR a0) { _PrintEnter("IsCharLowerA(%p)\n", a0); BOOL rv = 0; __try { rv = Real_IsCharLowerA(a0); } __finally { _PrintExit("IsCharLowerA() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_IsCharLowerW(WCHAR a0) { _PrintEnter("IsCharLowerW(%p)\n", a0); BOOL rv = 0; __try { rv = Real_IsCharLowerW(a0); } __finally { _PrintExit("IsCharLowerW() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_IsCharUpperA(CHAR a0) { _PrintEnter("IsCharUpperA(%p)\n", a0); BOOL rv = 0; __try { rv = Real_IsCharUpperA(a0); } __finally { _PrintExit("IsCharUpperA() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_IsCharUpperW(WCHAR a0) { _PrintEnter("IsCharUpperW(%p)\n", a0); BOOL rv = 0; __try { rv = Real_IsCharUpperW(a0); } __finally { _PrintExit("IsCharUpperW() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_IsChild(HWND a0, HWND a1) { _PrintEnter("IsChild(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_IsChild(a0, a1); } __finally { _PrintExit("IsChild(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_IsClipboardFormatAvailable(UINT a0) { _PrintEnter("IsClipboardFormatAvailable(%p)\n", a0); BOOL rv = 0; __try { rv = Real_IsClipboardFormatAvailable(a0); } __finally { _PrintExit("IsClipboardFormatAvailable() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_IsDBCSLeadByte(BYTE a0) { _PrintEnter("IsDBCSLeadByte(%p)\n", a0); BOOL rv = 0; __try { rv = Real_IsDBCSLeadByte(a0); } __finally { _PrintExit("IsDBCSLeadByte() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_IsDBCSLeadByteEx(UINT a0, BYTE a1) { _PrintEnter("IsDBCSLeadByteEx(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_IsDBCSLeadByteEx(a0, a1); } __finally { _PrintExit("IsDBCSLeadByteEx(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_IsDebuggerPresent(void) { _PrintEnter("IsDebuggerPresent()\n"); BOOL rv = 0; __try { rv = Real_IsDebuggerPresent(); } __finally { _PrintExit("IsDebuggerPresent() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_IsDialogMessageA(HWND a0, LPMSG a1) { _PrintEnter("IsDialogMessageA(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_IsDialogMessageA(a0, a1); } __finally { _PrintExit("IsDialogMessageA(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_IsDialogMessageW(HWND a0, LPMSG a1) { _PrintEnter("IsDialogMessageW(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_IsDialogMessageW(a0, a1); } __finally { _PrintExit("IsDialogMessageW(,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_IsDlgButtonChecked(HWND a0, int a1) { _PrintEnter("IsDlgButtonChecked(%p,%p)\n", a0, a1); UINT rv = 0; __try { rv = Real_IsDlgButtonChecked(a0, a1); } __finally { _PrintExit("IsDlgButtonChecked(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_IsIconic(HWND a0) { _PrintEnter("IsIconic(%p)\n", a0); BOOL rv = 0; __try { rv = Real_IsIconic(a0); } __finally { _PrintExit("IsIconic() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_IsMenu(HMENU a0) { _PrintEnter("IsMenu(%p)\n", a0); BOOL rv = 0; __try { rv = Real_IsMenu(a0); } __finally { _PrintExit("IsMenu() -> %p\n", rv); }; return rv; } #if !defined(DETOURS_ARM) BOOL __stdcall Mine_IsProcessorFeaturePresent(DWORD a0) { _PrintEnter("IsProcessorFeaturePresent(%p)\n", a0); BOOL rv = 0; __try { rv = Real_IsProcessorFeaturePresent(a0); } __finally { _PrintExit("IsProcessorFeaturePresent() -> %p\n", rv); }; return rv; } #endif // !DETOURS_ARM BOOL __stdcall Mine_IsRectEmpty(RECT* a0) { _PrintEnter("IsRectEmpty(%p)\n", a0); BOOL rv = 0; __try { rv = Real_IsRectEmpty(a0); } __finally { _PrintExit("IsRectEmpty() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_IsValidCodePage(UINT a0) { _PrintEnter("IsValidCodePage(%p)\n", a0); BOOL rv = 0; __try { rv = Real_IsValidCodePage(a0); } __finally { _PrintExit("IsValidCodePage() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_IsValidLocale(LCID a0, DWORD a1) { _PrintEnter("IsValidLocale(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_IsValidLocale(a0, a1); } __finally { _PrintExit("IsValidLocale(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_IsWindow(HWND a0) { _PrintEnter("IsWindow(%p)\n", a0); BOOL rv = 0; __try { rv = Real_IsWindow(a0); } __finally { _PrintExit("IsWindow() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_IsWindowEnabled(HWND a0) { _PrintEnter("IsWindowEnabled(%p)\n", a0); BOOL rv = 0; __try { rv = Real_IsWindowEnabled(a0); } __finally { _PrintExit("IsWindowEnabled() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_IsWindowUnicode(HWND a0) { _PrintEnter("IsWindowUnicode(%p)\n", a0); BOOL rv = 0; __try { rv = Real_IsWindowUnicode(a0); } __finally { _PrintExit("IsWindowUnicode() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_IsWindowVisible(HWND a0) { _PrintEnter("IsWindowVisible(%p)\n", a0); BOOL rv = 0; __try { rv = Real_IsWindowVisible(a0); } __finally { _PrintExit("IsWindowVisible() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_IsZoomed(HWND a0) { _PrintEnter("IsZoomed(%p)\n", a0); BOOL rv = 0; __try { rv = Real_IsZoomed(a0); } __finally { _PrintExit("IsZoomed() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_KillTimer(HWND a0, UINT_PTR a1) { _PrintEnter("KillTimer(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_KillTimer(a0, a1); } __finally { _PrintExit("KillTimer(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_LPtoDP(HDC a0, POINT* a1, int a2) { _PrintEnter("LPtoDP(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_LPtoDP(a0, a1, a2); } __finally { _PrintExit("LPtoDP(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_LineDDA(int a0, int a1, int a2, int a3, LINEDDAPROC a4, LPARAM a5) { _PrintEnter("LineDDA(%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); BOOL rv = 0; __try { rv = Real_LineDDA(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("LineDDA(,,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_LineTo(HDC a0, int a1, int a2) { _PrintEnter("LineTo(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_LineTo(a0, a1, a2); } __finally { _PrintExit("LineTo(,,) -> %p\n", rv); }; return rv; } HACCEL __stdcall Mine_LoadAcceleratorsA(HINSTANCE a0, LPCSTR a1) { _PrintEnter("LoadAcceleratorsA(%p,%hs)\n", a0, a1); HACCEL rv = 0; __try { rv = Real_LoadAcceleratorsA(a0, a1); } __finally { _PrintExit("LoadAcceleratorsA(,) -> %p\n", rv); }; return rv; } HACCEL __stdcall Mine_LoadAcceleratorsW(HINSTANCE a0, LPCWSTR a1) { _PrintEnter("LoadAcceleratorsW(%p,%ls)\n", a0, a1); HACCEL rv = 0; __try { rv = Real_LoadAcceleratorsW(a0, a1); } __finally { _PrintExit("LoadAcceleratorsW(,) -> %p\n", rv); }; return rv; } HBITMAP __stdcall Mine_LoadBitmapA(HINSTANCE a0, LPCSTR a1) { _PrintEnter("LoadBitmapA(%p,%hs)\n", a0, a1); HBITMAP rv = 0; __try { rv = Real_LoadBitmapA(a0, a1); } __finally { _PrintExit("LoadBitmapA(,) -> %p\n", rv); }; return rv; } HBITMAP __stdcall Mine_LoadBitmapW(HINSTANCE a0, LPCWSTR a1) { _PrintEnter("LoadBitmapW(%p,%ls)\n", a0, a1); HBITMAP rv = 0; __try { rv = Real_LoadBitmapW(a0, a1); } __finally { _PrintExit("LoadBitmapW(,) -> %p\n", rv); }; return rv; } HCURSOR __stdcall Mine_LoadCursorA(HINSTANCE a0, LPCSTR a1) { _PrintEnter("LoadCursorA(%p,%hs)\n", a0, a1); HCURSOR rv = 0; __try { rv = Real_LoadCursorA(a0, a1); } __finally { _PrintExit("LoadCursorA(,) -> %p\n", rv); }; return rv; } HCURSOR __stdcall Mine_LoadCursorFromFileA(LPCSTR a0) { _PrintEnter("LoadCursorFromFileA(%hs)\n", a0); HCURSOR rv = 0; __try { rv = Real_LoadCursorFromFileA(a0); } __finally { _PrintExit("LoadCursorFromFileA() -> %p\n", rv); }; return rv; } HCURSOR __stdcall Mine_LoadCursorFromFileW(LPCWSTR a0) { _PrintEnter("LoadCursorFromFileW(%ls)\n", a0); HCURSOR rv = 0; __try { rv = Real_LoadCursorFromFileW(a0); } __finally { _PrintExit("LoadCursorFromFileW() -> %p\n", rv); }; return rv; } HCURSOR __stdcall Mine_LoadCursorW(HINSTANCE a0, LPCWSTR a1) { _PrintEnter("LoadCursorW(%p,%ls)\n", a0, a1); HCURSOR rv = 0; __try { rv = Real_LoadCursorW(a0, a1); } __finally { _PrintExit("LoadCursorW(,) -> %p\n", rv); }; return rv; } HICON __stdcall Mine_LoadIconA(HINSTANCE a0, LPCSTR a1) { _PrintEnter("LoadIconA(%p,%hs)\n", a0, a1); HICON rv = 0; __try { rv = Real_LoadIconA(a0, a1); } __finally { _PrintExit("LoadIconA(,) -> %p\n", rv); }; return rv; } HICON __stdcall Mine_LoadIconW(HINSTANCE a0, LPCWSTR a1) { _PrintEnter("LoadIconW(%p,%ls)\n", a0, a1); HICON rv = 0; __try { rv = Real_LoadIconW(a0, a1); } __finally { _PrintExit("LoadIconW(,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_LoadImageA(HINSTANCE a0, LPCSTR a1, UINT a2, int a3, int a4, UINT a5) { _PrintEnter("LoadImageA(%p,%hs,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); HANDLE rv = 0; __try { rv = Real_LoadImageA(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("LoadImageA(,,,,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_LoadImageW(HINSTANCE a0, LPCWSTR a1, UINT a2, int a3, int a4, UINT a5) { _PrintEnter("LoadImageW(%p,%ls,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); HANDLE rv = 0; __try { rv = Real_LoadImageW(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("LoadImageW(,,,,,) -> %p\n", rv); }; return rv; } HKL __stdcall Mine_LoadKeyboardLayoutA(LPCSTR a0, UINT a1) { _PrintEnter("LoadKeyboardLayoutA(%hs,%p)\n", a0, a1); HKL rv = 0; __try { rv = Real_LoadKeyboardLayoutA(a0, a1); } __finally { _PrintExit("LoadKeyboardLayoutA(,) -> %p\n", rv); }; return rv; } HKL __stdcall Mine_LoadKeyboardLayoutW(LPCWSTR a0, UINT a1) { _PrintEnter("LoadKeyboardLayoutW(%ls,%p)\n", a0, a1); HKL rv = 0; __try { rv = Real_LoadKeyboardLayoutW(a0, a1); } __finally { _PrintExit("LoadKeyboardLayoutW(,) -> %p\n", rv); }; return rv; } HMODULE __stdcall Mine_LoadLibraryA(LPCSTR a0) { _PrintEnter("LoadLibraryA(%hs)\n", a0); HMODULE rv = 0; __try { rv = Real_LoadLibraryA(a0); } __finally { _PrintExit("LoadLibraryA() -> %p\n", rv); }; return rv; } HMODULE __stdcall Mine_LoadLibraryExA(LPCSTR a0, HANDLE a1, DWORD a2) { _PrintEnter("LoadLibraryExA(%hs,%p,%p)\n", a0, a1, a2); HMODULE rv = 0; __try { rv = Real_LoadLibraryExA(a0, a1, a2); } __finally { _PrintExit("LoadLibraryExA(,,) -> %p\n", rv); }; return rv; } HMODULE __stdcall Mine_LoadLibraryExW(LPCWSTR a0, HANDLE a1, DWORD a2) { _PrintEnter("LoadLibraryExW(%ls,%p,%p)\n", a0, a1, a2); HMODULE rv = 0; __try { rv = Real_LoadLibraryExW(a0, a1, a2); } __finally { _PrintExit("LoadLibraryExW(,,) -> %p\n", rv); }; return rv; } HMODULE __stdcall Mine_LoadLibraryW(LPCWSTR a0) { _PrintEnter("LoadLibraryW(%ls)\n", a0); HMODULE rv = 0; __try { rv = Real_LoadLibraryW(a0); } __finally { _PrintExit("LoadLibraryW() -> %p\n", rv); }; return rv; } HMENU __stdcall Mine_LoadMenuA(HINSTANCE a0, LPCSTR a1) { _PrintEnter("LoadMenuA(%p,%hs)\n", a0, a1); HMENU rv = 0; __try { rv = Real_LoadMenuA(a0, a1); } __finally { _PrintExit("LoadMenuA(,) -> %p\n", rv); }; return rv; } HMENU __stdcall Mine_LoadMenuIndirectA(MENUTEMPLATEA* a0) { _PrintEnter("LoadMenuIndirectA(%p)\n", a0); HMENU rv = 0; __try { rv = Real_LoadMenuIndirectA(a0); } __finally { _PrintExit("LoadMenuIndirectA() -> %p\n", rv); }; return rv; } HMENU __stdcall Mine_LoadMenuIndirectW(MENUTEMPLATEW* a0) { _PrintEnter("LoadMenuIndirectW(%p)\n", a0); HMENU rv = 0; __try { rv = Real_LoadMenuIndirectW(a0); } __finally { _PrintExit("LoadMenuIndirectW() -> %p\n", rv); }; return rv; } HMENU __stdcall Mine_LoadMenuW(HINSTANCE a0, LPCWSTR a1) { _PrintEnter("LoadMenuW(%p,%ls)\n", a0, a1); HMENU rv = 0; __try { rv = Real_LoadMenuW(a0, a1); } __finally { _PrintExit("LoadMenuW(,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_LoadModule(LPCSTR a0, LPVOID a1) { _PrintEnter("LoadModule(%hs,%p)\n", a0, a1); DWORD rv = 0; __try { rv = Real_LoadModule(a0, a1); } __finally { _PrintExit("LoadModule(,) -> %p\n", rv); }; return rv; } HGLOBAL __stdcall Mine_LoadResource(HMODULE a0, HRSRC a1) { _PrintEnter("LoadResource(%p,%p)\n", a0, a1); HGLOBAL rv = 0; __try { rv = Real_LoadResource(a0, a1); } __finally { _PrintExit("LoadResource(,) -> %p\n", rv); }; return rv; } int __stdcall Mine_LoadStringA(HINSTANCE a0, UINT a1, LPSTR a2, int a3) { _PrintEnter("LoadStringA(%p,%p,%p,%p)\n", a0, a1, a2, a3); int rv = 0; __try { rv = Real_LoadStringA(a0, a1, a2, a3); } __finally { _PrintExit("LoadStringA(,,%hs,) -> %p\n", a2, rv); }; return rv; } int __stdcall Mine_LoadStringW(HINSTANCE a0, UINT a1, LPWSTR a2, int a3) { _PrintEnter("LoadStringW(%p,%p,%p,%p)\n", a0, a1, a2, a3); int rv = 0; __try { rv = Real_LoadStringW(a0, a1, a2, a3); } __finally { _PrintExit("LoadStringW(,,%ls,) -> %p\n", a2, rv); }; return rv; } HLOCAL __stdcall Mine_LocalAlloc(UINT a0, SIZE_T a1) { _PrintEnter("LocalAlloc(%p,%p)\n", a0, a1); HLOCAL rv = 0; __try { rv = Real_LocalAlloc(a0, a1); } __finally { _PrintExit("LocalAlloc(,) -> %p\n", rv); }; return rv; } SIZE_T __stdcall Mine_LocalCompact(UINT a0) { _PrintEnter("LocalCompact(%p)\n", a0); SIZE_T rv = 0; __try { rv = Real_LocalCompact(a0); } __finally { _PrintExit("LocalCompact() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_LocalFileTimeToFileTime(FILETIME* a0, LPFILETIME a1) { _PrintEnter("LocalFileTimeToFileTime(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_LocalFileTimeToFileTime(a0, a1); } __finally { _PrintExit("LocalFileTimeToFileTime(,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_LocalFlags(HLOCAL a0) { _PrintEnter("LocalFlags(%p)\n", a0); UINT rv = 0; __try { rv = Real_LocalFlags(a0); } __finally { _PrintExit("LocalFlags() -> %p\n", rv); }; return rv; } HLOCAL __stdcall Mine_LocalFree(HLOCAL a0) { _PrintEnter("LocalFree(%p)\n", a0); HLOCAL rv = 0; __try { rv = Real_LocalFree(a0); } __finally { _PrintExit("LocalFree() -> %p\n", rv); }; return rv; } HLOCAL __stdcall Mine_LocalHandle(LPCVOID a0) { _PrintEnter("LocalHandle(%p)\n", a0); HLOCAL rv = 0; __try { rv = Real_LocalHandle(a0); } __finally { _PrintExit("LocalHandle() -> %p\n", rv); }; return rv; } LPVOID __stdcall Mine_LocalLock(HLOCAL a0) { _PrintEnter("LocalLock(%p)\n", a0); LPVOID rv = 0; __try { rv = Real_LocalLock(a0); } __finally { _PrintExit("LocalLock() -> %p\n", rv); }; return rv; } HLOCAL __stdcall Mine_LocalReAlloc(HLOCAL a0, SIZE_T a1, UINT a2) { _PrintEnter("LocalReAlloc(%p,%p,%p)\n", a0, a1, a2); HLOCAL rv = 0; __try { rv = Real_LocalReAlloc(a0, a1, a2); } __finally { _PrintExit("LocalReAlloc(,,) -> %p\n", rv); }; return rv; } SIZE_T __stdcall Mine_LocalShrink(HLOCAL a0, UINT a1) { _PrintEnter("LocalShrink(%p,%p)\n", a0, a1); SIZE_T rv = 0; __try { rv = Real_LocalShrink(a0, a1); } __finally { _PrintExit("LocalShrink(,) -> %p\n", rv); }; return rv; } SIZE_T __stdcall Mine_LocalSize(HLOCAL a0) { _PrintEnter("LocalSize(%p)\n", a0); SIZE_T rv = 0; __try { rv = Real_LocalSize(a0); } __finally { _PrintExit("LocalSize() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_LocalUnlock(HLOCAL a0) { _PrintEnter("LocalUnlock(%p)\n", a0); BOOL rv = 0; __try { rv = Real_LocalUnlock(a0); } __finally { _PrintExit("LocalUnlock() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_LockFile(HANDLE a0, DWORD a1, DWORD a2, DWORD a3, DWORD a4) { _PrintEnter("LockFile(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_LockFile(a0, a1, a2, a3, a4); } __finally { _PrintExit("LockFile(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_LockFileEx(HANDLE a0, DWORD a1, DWORD a2, DWORD a3, DWORD a4, LPOVERLAPPED a5) { _PrintEnter("LockFileEx(%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); BOOL rv = 0; __try { rv = Real_LockFileEx(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("LockFileEx(,,,,,) -> %p\n", rv); }; return rv; } LPVOID __stdcall Mine_LockResource(HGLOBAL a0) { _PrintEnter("LockResource(%p)\n", a0); LPVOID rv = 0; __try { rv = Real_LockResource(a0); } __finally { _PrintExit("LockResource() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_LockWindowUpdate(HWND a0) { _PrintEnter("LockWindowUpdate(%p)\n", a0); BOOL rv = 0; __try { rv = Real_LockWindowUpdate(a0); } __finally { _PrintExit("LockWindowUpdate() -> %p\n", rv); }; return rv; } int __stdcall Mine_LookupIconIdFromDirectory(PBYTE a0, BOOL a1) { _PrintEnter("LookupIconIdFromDirectory(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real_LookupIconIdFromDirectory(a0, a1); } __finally { _PrintExit("LookupIconIdFromDirectory(,) -> %p\n", rv); }; return rv; } int __stdcall Mine_LookupIconIdFromDirectoryEx(PBYTE a0, BOOL a1, int a2, int a3, UINT a4) { _PrintEnter("LookupIconIdFromDirectoryEx(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); int rv = 0; __try { rv = Real_LookupIconIdFromDirectoryEx(a0, a1, a2, a3, a4); } __finally { _PrintExit("LookupIconIdFromDirectoryEx(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_MapDialogRect(HWND a0, LPRECT a1) { _PrintEnter("MapDialogRect(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_MapDialogRect(a0, a1); } __finally { _PrintExit("MapDialogRect(,) -> %p\n", rv); }; return rv; } LPVOID __stdcall Mine_MapViewOfFile(HANDLE a0, DWORD a1, DWORD a2, DWORD a3, SIZE_T a4) { _PrintEnter("MapViewOfFile(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); LPVOID rv = 0; __try { rv = Real_MapViewOfFile(a0, a1, a2, a3, a4); } __finally { _PrintExit("MapViewOfFile(,,,,) -> %p\n", rv); }; return rv; } LPVOID __stdcall Mine_MapViewOfFileEx(HANDLE a0, DWORD a1, DWORD a2, DWORD a3, SIZE_T a4, LPVOID a5) { _PrintEnter("MapViewOfFileEx(%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); LPVOID rv = 0; __try { rv = Real_MapViewOfFileEx(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("MapViewOfFileEx(,,,,,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_MapVirtualKeyA(UINT a0, UINT a1) { _PrintEnter("MapVirtualKeyA(%p,%p)\n", a0, a1); UINT rv = 0; __try { rv = Real_MapVirtualKeyA(a0, a1); } __finally { _PrintExit("MapVirtualKeyA(,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_MapVirtualKeyExA(UINT a0, UINT a1, HKL a2) { _PrintEnter("MapVirtualKeyExA(%p,%p,%p)\n", a0, a1, a2); UINT rv = 0; __try { rv = Real_MapVirtualKeyExA(a0, a1, a2); } __finally { _PrintExit("MapVirtualKeyExA(,,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_MapVirtualKeyExW(UINT a0, UINT a1, HKL a2) { _PrintEnter("MapVirtualKeyExW(%p,%p,%p)\n", a0, a1, a2); UINT rv = 0; __try { rv = Real_MapVirtualKeyExW(a0, a1, a2); } __finally { _PrintExit("MapVirtualKeyExW(,,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_MapVirtualKeyW(UINT a0, UINT a1) { _PrintEnter("MapVirtualKeyW(%p,%p)\n", a0, a1); UINT rv = 0; __try { rv = Real_MapVirtualKeyW(a0, a1); } __finally { _PrintExit("MapVirtualKeyW(,) -> %p\n", rv); }; return rv; } int __stdcall Mine_MapWindowPoints(HWND a0, HWND a1, POINT* a2, UINT a3) { _PrintEnter("MapWindowPoints(%p,%p,%p,%p)\n", a0, a1, a2, a3); int rv = 0; __try { rv = Real_MapWindowPoints(a0, a1, a2, a3); } __finally { _PrintExit("MapWindowPoints(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_MaskBlt(HDC a0, int a1, int a2, int a3, int a4, HDC a5, int a6, int a7, HBITMAP a8, int a9, int a10, DWORD a11) { _PrintEnter("MaskBlt(%p,%p,%p,%p,%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); BOOL rv = 0; __try { rv = Real_MaskBlt(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); } __finally { _PrintExit("MaskBlt(,,,,,,,,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_MenuItemFromPoint(HWND a0, HMENU a1, POINT a2) { _PrintEnter("MenuItemFromPoint(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_MenuItemFromPoint(a0, a1, a2); } __finally { _PrintExit("MenuItemFromPoint(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_MessageBeep(UINT a0) { _PrintEnter("MessageBeep(%p)\n", a0); BOOL rv = 0; __try { rv = Real_MessageBeep(a0); } __finally { _PrintExit("MessageBeep() -> %p\n", rv); }; return rv; } int __stdcall Mine_MessageBoxA(HWND a0, LPCSTR a1, LPCSTR a2, UINT a3) { _PrintEnter("MessageBoxA(%p,%hs,%hs,%p)\n", a0, a1, a2, a3); int rv = 0; __try { rv = Real_MessageBoxA(a0, a1, a2, a3); } __finally { _PrintExit("MessageBoxA(,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_MessageBoxExA(HWND a0, LPCSTR a1, LPCSTR a2, UINT a3, WORD a4) { _PrintEnter("MessageBoxExA(%p,%hs,%hs,%p,%p)\n", a0, a1, a2, a3, a4); int rv = 0; __try { rv = Real_MessageBoxExA(a0, a1, a2, a3, a4); } __finally { _PrintExit("MessageBoxExA(,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_MessageBoxExW(HWND a0, LPCWSTR a1, LPCWSTR a2, UINT a3, WORD a4) { _PrintEnter("MessageBoxExW(%p,%ls,%ls,%p,%p)\n", a0, a1, a2, a3, a4); int rv = 0; __try { rv = Real_MessageBoxExW(a0, a1, a2, a3, a4); } __finally { _PrintExit("MessageBoxExW(,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_MessageBoxIndirectA(MSGBOXPARAMSA* a0) { _PrintEnter("MessageBoxIndirectA(%p)\n", a0); int rv = 0; __try { rv = Real_MessageBoxIndirectA(a0); } __finally { _PrintExit("MessageBoxIndirectA() -> %p\n", rv); }; return rv; } int __stdcall Mine_MessageBoxIndirectW(MSGBOXPARAMSW* a0) { _PrintEnter("MessageBoxIndirectW(%p)\n", a0); int rv = 0; __try { rv = Real_MessageBoxIndirectW(a0); } __finally { _PrintExit("MessageBoxIndirectW() -> %p\n", rv); }; return rv; } int __stdcall Mine_MessageBoxW(HWND a0, LPCWSTR a1, LPCWSTR a2, UINT a3) { _PrintEnter("MessageBoxW(%p,%ls,%ls,%p)\n", a0, a1, a2, a3); int rv = 0; __try { rv = Real_MessageBoxW(a0, a1, a2, a3); } __finally { _PrintExit("MessageBoxW(,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_MkParseDisplayName(IBindCtx* a0, LPCOLESTR a1, ULONG* a2, IMoniker** a3) { _PrintEnter("MkParseDisplayName(%p,%p,%p,%p)\n", a0, a1, a2, a3); HRESULT rv = 0; __try { rv = Real_MkParseDisplayName(a0, a1, a2, a3); } __finally { _PrintExit("MkParseDisplayName(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ModifyMenuA(HMENU a0, UINT a1, UINT a2, UINT_PTR a3, LPCSTR a4) { _PrintEnter("ModifyMenuA(%p,%p,%p,%p,%hs)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_ModifyMenuA(a0, a1, a2, a3, a4); } __finally { _PrintExit("ModifyMenuA(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ModifyMenuW(HMENU a0, UINT a1, UINT a2, UINT_PTR a3, LPCWSTR a4) { _PrintEnter("ModifyMenuW(%p,%p,%p,%p,%ls)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_ModifyMenuW(a0, a1, a2, a3, a4); } __finally { _PrintExit("ModifyMenuW(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ModifyWorldTransform(HDC a0, XFORM* a1, DWORD a2) { _PrintEnter("ModifyWorldTransform(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_ModifyWorldTransform(a0, a1, a2); } __finally { _PrintExit("ModifyWorldTransform(,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_MonikerCommonPrefixWith(IMoniker* a0, IMoniker* a1, IMoniker** a2) { _PrintEnter("MonikerCommonPrefixWith(%p,%p,%p)\n", a0, a1, a2); HRESULT rv = 0; __try { rv = Real_MonikerCommonPrefixWith(a0, a1, a2); } __finally { _PrintExit("MonikerCommonPrefixWith(,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_MonikerRelativePathTo(IMoniker* a0, IMoniker* a1, IMoniker** a2, BOOL a3) { _PrintEnter("MonikerRelativePathTo(%p,%p,%p,%p)\n", a0, a1, a2, a3); HRESULT rv = 0; __try { rv = Real_MonikerRelativePathTo(a0, a1, a2, a3); } __finally { _PrintExit("MonikerRelativePathTo(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_MoveFileA(LPCSTR a0, LPCSTR a1) { _PrintEnter("MoveFileA(%hs,%hs)\n", a0, a1); BOOL rv = 0; __try { rv = Real_MoveFileA(a0, a1); } __finally { _PrintExit("MoveFileA(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_MoveFileExA(LPCSTR a0, LPCSTR a1, DWORD a2) { _PrintEnter("MoveFileExA(%hs,%hs,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_MoveFileExA(a0, a1, a2); } __finally { _PrintExit("MoveFileExA(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_MoveFileExW(LPCWSTR a0, LPCWSTR a1, DWORD a2) { _PrintEnter("MoveFileExW(%ls,%ls,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_MoveFileExW(a0, a1, a2); } __finally { _PrintExit("MoveFileExW(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_MoveFileW(LPCWSTR a0, LPCWSTR a1) { _PrintEnter("MoveFileW(%ls,%ls)\n", a0, a1); BOOL rv = 0; __try { rv = Real_MoveFileW(a0, a1); } __finally { _PrintExit("MoveFileW(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_MoveToEx(HDC a0, int a1, int a2, POINT* a3) { _PrintEnter("MoveToEx(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_MoveToEx(a0, a1, a2, a3); } __finally { _PrintExit("MoveToEx(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_MoveWindow(HWND a0, int a1, int a2, int a3, int a4, BOOL a5) { _PrintEnter("MoveWindow(%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); BOOL rv = 0; __try { rv = Real_MoveWindow(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("MoveWindow(,,,,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_MsgWaitForMultipleObjects(DWORD a0, void** a1, BOOL a2, DWORD a3, DWORD a4) { _PrintEnter("MsgWaitForMultipleObjects(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); DWORD rv = 0; __try { rv = Real_MsgWaitForMultipleObjects(a0, a1, a2, a3, a4); } __finally { _PrintExit("MsgWaitForMultipleObjects(,,,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_MsgWaitForMultipleObjectsEx(DWORD a0, void** a1, DWORD a2, DWORD a3, DWORD a4) { _PrintEnter("MsgWaitForMultipleObjectsEx(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); DWORD rv = 0; __try { rv = Real_MsgWaitForMultipleObjectsEx(a0, a1, a2, a3, a4); } __finally { _PrintExit("MsgWaitForMultipleObjectsEx(,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_MulDiv(int a0, int a1, int a2) { _PrintEnter("MulDiv(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_MulDiv(a0, a1, a2); } __finally { _PrintExit("MulDiv(,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_OemKeyScan(WORD a0) { _PrintEnter("OemKeyScan(%p)\n", a0); DWORD rv = 0; __try { rv = Real_OemKeyScan(a0); } __finally { _PrintExit("OemKeyScan() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_OemToCharA(LPCSTR a0, LPSTR a1) { _PrintEnter("OemToCharA(%hs,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_OemToCharA(a0, a1); } __finally { _PrintExit("OemToCharA(,%hs) -> %p\n", a1, rv); }; return rv; } BOOL __stdcall Mine_OemToCharBuffA(LPCSTR a0, LPSTR a1, DWORD a2) { _PrintEnter("OemToCharBuffA(%hs,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_OemToCharBuffA(a0, a1, a2); } __finally { _PrintExit("OemToCharBuffA(,%hs,) -> %p\n", a1, rv); }; return rv; } BOOL __stdcall Mine_OemToCharBuffW(LPCSTR a0, LPWSTR a1, DWORD a2) { _PrintEnter("OemToCharBuffW(%hs,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_OemToCharBuffW(a0, a1, a2); } __finally { _PrintExit("OemToCharBuffW(,%ls,) -> %p\n", a1, rv); }; return rv; } BOOL __stdcall Mine_OemToCharW(LPCSTR a0, LPWSTR a1) { _PrintEnter("OemToCharW(%hs,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_OemToCharW(a0, a1); } __finally { _PrintExit("OemToCharW(,%ls) -> %p\n", a1, rv); }; return rv; } int __stdcall Mine_OffsetClipRgn(HDC a0, int a1, int a2) { _PrintEnter("OffsetClipRgn(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_OffsetClipRgn(a0, a1, a2); } __finally { _PrintExit("OffsetClipRgn(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_OffsetRect(LPRECT a0, int a1, int a2) { _PrintEnter("OffsetRect(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_OffsetRect(a0, a1, a2); } __finally { _PrintExit("OffsetRect(,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_OffsetRgn(HRGN a0, int a1, int a2) { _PrintEnter("OffsetRgn(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_OffsetRgn(a0, a1, a2); } __finally { _PrintExit("OffsetRgn(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_OffsetViewportOrgEx(HDC a0, int a1, int a2, POINT* a3) { _PrintEnter("OffsetViewportOrgEx(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_OffsetViewportOrgEx(a0, a1, a2, a3); } __finally { _PrintExit("OffsetViewportOrgEx(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_OffsetWindowOrgEx(HDC a0, int a1, int a2, POINT* a3) { _PrintEnter("OffsetWindowOrgEx(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_OffsetWindowOrgEx(a0, a1, a2, a3); } __finally { _PrintExit("OffsetWindowOrgEx(,,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_OleBuildVersion(void) { _PrintEnter("OleBuildVersion()\n"); DWORD rv = 0; __try { rv = Real_OleBuildVersion(); } __finally { _PrintExit("OleBuildVersion() -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleConvertIStorageToOLESTREAM(LPSTORAGE a0, LPOLESTREAM a1) { _PrintEnter("OleConvertIStorageToOLESTREAM(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_OleConvertIStorageToOLESTREAM(a0, a1); } __finally { _PrintExit("OleConvertIStorageToOLESTREAM(,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleConvertIStorageToOLESTREAMEx(LPSTORAGE a0, CLIPFORMAT a1, LONG a2, LONG a3, DWORD a4, LPSTGMEDIUM a5, LPOLESTREAM a6) { _PrintEnter("OleConvertIStorageToOLESTREAMEx(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); HRESULT rv = 0; __try { rv = Real_OleConvertIStorageToOLESTREAMEx(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("OleConvertIStorageToOLESTREAMEx(,,,,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleConvertOLESTREAMToIStorage(LPOLESTREAM a0, LPSTORAGE a1, DVTARGETDEVICE* a2) { _PrintEnter("OleConvertOLESTREAMToIStorage(%p,%p,%p)\n", a0, a1, a2); HRESULT rv = 0; __try { rv = Real_OleConvertOLESTREAMToIStorage(a0, a1, a2); } __finally { _PrintExit("OleConvertOLESTREAMToIStorage(,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleConvertOLESTREAMToIStorageEx(LPOLESTREAM a0, LPSTORAGE a1, CLIPFORMAT* a2, LONG* a3, LONG* a4, DWORD* a5, LPSTGMEDIUM a6) { _PrintEnter("OleConvertOLESTREAMToIStorageEx(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); HRESULT rv = 0; __try { rv = Real_OleConvertOLESTREAMToIStorageEx(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("OleConvertOLESTREAMToIStorageEx(,,,,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleCreate(CONST IID& a0, CONST IID& a1, DWORD a2, LPFORMATETC a3, LPOLECLIENTSITE a4, LPSTORAGE a5, LPVOID* a6) { _PrintEnter("OleCreate(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); HRESULT rv = 0; __try { rv = Real_OleCreate(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("OleCreate(,,,,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleCreateDefaultHandler(CONST IID& a0, LPUNKNOWN a1, CONST IID& a2, LPVOID* a3) { _PrintEnter("OleCreateDefaultHandler(%p,%p,%p,%p)\n", a0, a1, a2, a3); HRESULT rv = 0; __try { rv = Real_OleCreateDefaultHandler(a0, a1, a2, a3); } __finally { _PrintExit("OleCreateDefaultHandler(,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleCreateEmbeddingHelper(CONST IID& a0, LPUNKNOWN a1, DWORD a2, LPCLASSFACTORY a3, CONST IID& a4, LPVOID* a5) { _PrintEnter("OleCreateEmbeddingHelper(%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); HRESULT rv = 0; __try { rv = Real_OleCreateEmbeddingHelper(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("OleCreateEmbeddingHelper(,,,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleCreateEx(CONST IID& a0, CONST IID& a1, DWORD a2, DWORD a3, ULONG a4, DWORD* a5, LPFORMATETC a6, IAdviseSink* a7, DWORD* a8, LPOLECLIENTSITE a9, LPSTORAGE a10, LPVOID* a11) { _PrintEnter("OleCreateEx(%p,%p,%p,%p,%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); HRESULT rv = 0; __try { rv = Real_OleCreateEx(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); } __finally { _PrintExit("OleCreateEx(,,,,,,,,,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleCreateFromData(IDataObject* a0, CONST IID& a1, DWORD a2, LPFORMATETC a3, LPOLECLIENTSITE a4, LPSTORAGE a5, LPVOID* a6) { _PrintEnter("OleCreateFromData(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); HRESULT rv = 0; __try { rv = Real_OleCreateFromData(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("OleCreateFromData(,,,,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleCreateFromDataEx(IDataObject* a0, CONST IID& a1, DWORD a2, DWORD a3, ULONG a4, DWORD* a5, LPFORMATETC a6, IAdviseSink* a7, DWORD* a8, LPOLECLIENTSITE a9, LPSTORAGE a10, LPVOID* a11) { _PrintEnter("OleCreateFromDataEx(%p,%p,%p,%p,%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); HRESULT rv = 0; __try { rv = Real_OleCreateFromDataEx(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); } __finally { _PrintExit("OleCreateFromDataEx(,,,,,,,,,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleCreateFromFile(CONST IID& a0, LPCOLESTR a1, CONST IID& a2, DWORD a3, LPFORMATETC a4, LPOLECLIENTSITE a5, LPSTORAGE a6, LPVOID* a7) { _PrintEnter("OleCreateFromFile(%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7); HRESULT rv = 0; __try { rv = Real_OleCreateFromFile(a0, a1, a2, a3, a4, a5, a6, a7); } __finally { _PrintExit("OleCreateFromFile(,,,,,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleCreateFromFileEx(CONST IID& a0, LPCOLESTR a1, CONST IID& a2, DWORD a3, DWORD a4, ULONG a5, DWORD* a6, LPFORMATETC a7, IAdviseSink* a8, DWORD* a9, LPOLECLIENTSITE a10, LPSTORAGE a11, LPVOID* a12) { _PrintEnter("OleCreateFromFileEx(%p,%p,%p,%p,%p,%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); HRESULT rv = 0; __try { rv = Real_OleCreateFromFileEx(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); } __finally { _PrintExit("OleCreateFromFileEx(,,,,,,,,,,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleCreateLink(IMoniker* a0, CONST IID& a1, DWORD a2, LPFORMATETC a3, LPOLECLIENTSITE a4, LPSTORAGE a5, LPVOID* a6) { _PrintEnter("OleCreateLink(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); HRESULT rv = 0; __try { rv = Real_OleCreateLink(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("OleCreateLink(,,,,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleCreateLinkEx(IMoniker* a0, CONST IID& a1, DWORD a2, DWORD a3, ULONG a4, DWORD* a5, LPFORMATETC a6, IAdviseSink* a7, DWORD* a8, LPOLECLIENTSITE a9, LPSTORAGE a10, LPVOID* a11) { _PrintEnter("OleCreateLinkEx(%p,%p,%p,%p,%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); HRESULT rv = 0; __try { rv = Real_OleCreateLinkEx(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); } __finally { _PrintExit("OleCreateLinkEx(,,,,,,,,,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleCreateLinkFromData(IDataObject* a0, CONST IID& a1, DWORD a2, LPFORMATETC a3, LPOLECLIENTSITE a4, LPSTORAGE a5, LPVOID* a6) { _PrintEnter("OleCreateLinkFromData(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); HRESULT rv = 0; __try { rv = Real_OleCreateLinkFromData(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("OleCreateLinkFromData(,,,,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleCreateLinkFromDataEx(IDataObject* a0, CONST IID& a1, DWORD a2, DWORD a3, ULONG a4, DWORD* a5, LPFORMATETC a6, IAdviseSink* a7, DWORD* a8, LPOLECLIENTSITE a9, LPSTORAGE a10, LPVOID* a11) { _PrintEnter("OleCreateLinkFromDataEx(%p,%p,%p,%p,%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); HRESULT rv = 0; __try { rv = Real_OleCreateLinkFromDataEx(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); } __finally { _PrintExit("OleCreateLinkFromDataEx(,,,,,,,,,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleCreateLinkToFile(LPCOLESTR a0, CONST IID& a1, DWORD a2, LPFORMATETC a3, LPOLECLIENTSITE a4, LPSTORAGE a5, LPVOID* a6) { _PrintEnter("OleCreateLinkToFile(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); HRESULT rv = 0; __try { rv = Real_OleCreateLinkToFile(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("OleCreateLinkToFile(,,,,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleCreateLinkToFileEx(LPCOLESTR a0, CONST IID& a1, DWORD a2, DWORD a3, ULONG a4, DWORD* a5, LPFORMATETC a6, IAdviseSink* a7, DWORD* a8, LPOLECLIENTSITE a9, LPSTORAGE a10, LPVOID* a11) { _PrintEnter("OleCreateLinkToFileEx(%p,%p,%p,%p,%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); HRESULT rv = 0; __try { rv = Real_OleCreateLinkToFileEx(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); } __finally { _PrintExit("OleCreateLinkToFileEx(,,,,,,,,,,,) -> %p\n", rv); }; return rv; } HOLEMENU __stdcall Mine_OleCreateMenuDescriptor(HMENU a0, LPOLEMENUGROUPWIDTHS a1) { _PrintEnter("OleCreateMenuDescriptor(%p,%p)\n", a0, a1); HOLEMENU rv = 0; __try { rv = Real_OleCreateMenuDescriptor(a0, a1); } __finally { _PrintExit("OleCreateMenuDescriptor(,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleCreateStaticFromData(IDataObject* a0, CONST IID& a1, DWORD a2, LPFORMATETC a3, LPOLECLIENTSITE a4, LPSTORAGE a5, LPVOID* a6) { _PrintEnter("OleCreateStaticFromData(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); HRESULT rv = 0; __try { rv = Real_OleCreateStaticFromData(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("OleCreateStaticFromData(,,,,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleDestroyMenuDescriptor(HOLEMENU a0) { _PrintEnter("OleDestroyMenuDescriptor(%p)\n", a0); HRESULT rv = 0; __try { rv = Real_OleDestroyMenuDescriptor(a0); } __finally { _PrintExit("OleDestroyMenuDescriptor() -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleDoAutoConvert(LPSTORAGE a0, LPGUID a1) { _PrintEnter("OleDoAutoConvert(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_OleDoAutoConvert(a0, a1); } __finally { _PrintExit("OleDoAutoConvert(,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleDraw(LPUNKNOWN a0, DWORD a1, HDC a2, LPCRECT a3) { _PrintEnter("OleDraw(%p,%p,%p,%p)\n", a0, a1, a2, a3); HRESULT rv = 0; __try { rv = Real_OleDraw(a0, a1, a2, a3); } __finally { _PrintExit("OleDraw(,,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_OleDuplicateData(HANDLE a0, CLIPFORMAT a1, UINT a2) { _PrintEnter("OleDuplicateData(%p,%p,%p)\n", a0, a1, a2); HANDLE rv = 0; __try { rv = Real_OleDuplicateData(a0, a1, a2); } __finally { _PrintExit("OleDuplicateData(,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleFlushClipboard(void) { _PrintEnter("OleFlushClipboard()\n"); HRESULT rv = 0; __try { rv = Real_OleFlushClipboard(); } __finally { _PrintExit("OleFlushClipboard() -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleGetAutoConvert(CONST IID& a0, LPGUID a1) { _PrintEnter("OleGetAutoConvert(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_OleGetAutoConvert(a0, a1); } __finally { _PrintExit("OleGetAutoConvert(,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleGetClipboard(IDataObject** a0) { _PrintEnter("OleGetClipboard(%p)\n", a0); HRESULT rv = 0; __try { rv = Real_OleGetClipboard(a0); } __finally { _PrintExit("OleGetClipboard() -> %p\n", rv); }; return rv; } HGLOBAL __stdcall Mine_OleGetIconOfClass(CONST IID& a0, LPOLESTR a1, BOOL a2) { _PrintEnter("OleGetIconOfClass(%p,%p,%p)\n", a0, a1, a2); HGLOBAL rv = 0; __try { rv = Real_OleGetIconOfClass(a0, a1, a2); } __finally { _PrintExit("OleGetIconOfClass(,,) -> %p\n", rv); }; return rv; } HGLOBAL __stdcall Mine_OleGetIconOfFile(LPOLESTR a0, BOOL a1) { _PrintEnter("OleGetIconOfFile(%p,%p)\n", a0, a1); HGLOBAL rv = 0; __try { rv = Real_OleGetIconOfFile(a0, a1); } __finally { _PrintExit("OleGetIconOfFile(,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleInitialize(LPVOID a0) { _PrintEnter("OleInitialize(%p)\n", a0); HRESULT rv = 0; __try { rv = Real_OleInitialize(a0); } __finally { _PrintExit("OleInitialize() -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleIsCurrentClipboard(IDataObject* a0) { _PrintEnter("OleIsCurrentClipboard(%p)\n", a0); HRESULT rv = 0; __try { rv = Real_OleIsCurrentClipboard(a0); } __finally { _PrintExit("OleIsCurrentClipboard() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_OleIsRunning(IOleObject* a0) { _PrintEnter("OleIsRunning(%p)\n", a0); BOOL rv = 0; __try { rv = Real_OleIsRunning(a0); } __finally { _PrintExit("OleIsRunning() -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleLoad(LPSTORAGE a0, CONST IID& a1, LPOLECLIENTSITE a2, LPVOID* a3) { _PrintEnter("OleLoad(%p,%p,%p,%p)\n", a0, a1, a2, a3); HRESULT rv = 0; __try { rv = Real_OleLoad(a0, a1, a2, a3); } __finally { _PrintExit("OleLoad(,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleLoadFromStream(LPSTREAM a0, CONST IID& a1, LPVOID* a2) { _PrintEnter("OleLoadFromStream(%p,%p,%p)\n", a0, a1, a2); HRESULT rv = 0; __try { rv = Real_OleLoadFromStream(a0, a1, a2); } __finally { _PrintExit("OleLoadFromStream(,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleLockRunning(LPUNKNOWN a0, BOOL a1, BOOL a2) { _PrintEnter("OleLockRunning(%p,%p,%p)\n", a0, a1, a2); HRESULT rv = 0; __try { rv = Real_OleLockRunning(a0, a1, a2); } __finally { _PrintExit("OleLockRunning(,,) -> %p\n", rv); }; return rv; } HGLOBAL __stdcall Mine_OleMetafilePictFromIconAndLabel(HICON a0, LPOLESTR a1, LPOLESTR a2, UINT a3) { _PrintEnter("OleMetafilePictFromIconAndLabel(%p,%p,%p,%p)\n", a0, a1, a2, a3); HGLOBAL rv = 0; __try { rv = Real_OleMetafilePictFromIconAndLabel(a0, a1, a2, a3); } __finally { _PrintExit("OleMetafilePictFromIconAndLabel(,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleNoteObjectVisible(LPUNKNOWN a0, BOOL a1) { _PrintEnter("OleNoteObjectVisible(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_OleNoteObjectVisible(a0, a1); } __finally { _PrintExit("OleNoteObjectVisible(,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleQueryCreateFromData(IDataObject* a0) { _PrintEnter("OleQueryCreateFromData(%p)\n", a0); HRESULT rv = 0; __try { rv = Real_OleQueryCreateFromData(a0); } __finally { _PrintExit("OleQueryCreateFromData() -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleQueryLinkFromData(IDataObject* a0) { _PrintEnter("OleQueryLinkFromData(%p)\n", a0); HRESULT rv = 0; __try { rv = Real_OleQueryLinkFromData(a0); } __finally { _PrintExit("OleQueryLinkFromData() -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleRegEnumFormatEtc(CONST IID& a0, DWORD a1, IEnumFORMATETC** a2) { _PrintEnter("OleRegEnumFormatEtc(%p,%p,%p)\n", a0, a1, a2); HRESULT rv = 0; __try { rv = Real_OleRegEnumFormatEtc(a0, a1, a2); } __finally { _PrintExit("OleRegEnumFormatEtc(,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleRegEnumVerbs(CONST IID& a0, IEnumOLEVERB** a1) { _PrintEnter("OleRegEnumVerbs(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_OleRegEnumVerbs(a0, a1); } __finally { _PrintExit("OleRegEnumVerbs(,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleRegGetMiscStatus(CONST IID& a0, DWORD a1, DWORD* a2) { _PrintEnter("OleRegGetMiscStatus(%p,%p,%p)\n", a0, a1, a2); HRESULT rv = 0; __try { rv = Real_OleRegGetMiscStatus(a0, a1, a2); } __finally { _PrintExit("OleRegGetMiscStatus(,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleRegGetUserType(CONST IID& a0, DWORD a1, LPOLESTR* a2) { _PrintEnter("OleRegGetUserType(%p,%p,%p)\n", a0, a1, a2); HRESULT rv = 0; __try { rv = Real_OleRegGetUserType(a0, a1, a2); } __finally { _PrintExit("OleRegGetUserType(,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleRun(LPUNKNOWN a0) { _PrintEnter("OleRun(%p)\n", a0); HRESULT rv = 0; __try { rv = Real_OleRun(a0); } __finally { _PrintExit("OleRun() -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleSave(LPPERSISTSTORAGE a0, LPSTORAGE a1, BOOL a2) { _PrintEnter("OleSave(%p,%p,%p)\n", a0, a1, a2); HRESULT rv = 0; __try { rv = Real_OleSave(a0, a1, a2); } __finally { _PrintExit("OleSave(,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleSaveToStream(IPersistStream* a0, LPSTREAM a1) { _PrintEnter("OleSaveToStream(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_OleSaveToStream(a0, a1); } __finally { _PrintExit("OleSaveToStream(,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleSetAutoConvert(CONST IID& a0, CONST IID& a1) { _PrintEnter("OleSetAutoConvert(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_OleSetAutoConvert(a0, a1); } __finally { _PrintExit("OleSetAutoConvert(,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleSetClipboard(IDataObject* a0) { _PrintEnter("OleSetClipboard(%p)\n", a0); HRESULT rv = 0; __try { rv = Real_OleSetClipboard(a0); } __finally { _PrintExit("OleSetClipboard() -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleSetContainedObject(LPUNKNOWN a0, BOOL a1) { _PrintEnter("OleSetContainedObject(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_OleSetContainedObject(a0, a1); } __finally { _PrintExit("OleSetContainedObject(,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleSetMenuDescriptor(HOLEMENU a0, HWND a1, HWND a2, LPOLEINPLACEFRAME a3, LPOLEINPLACEACTIVEOBJECT a4) { _PrintEnter("OleSetMenuDescriptor(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); HRESULT rv = 0; __try { rv = Real_OleSetMenuDescriptor(a0, a1, a2, a3, a4); } __finally { _PrintExit("OleSetMenuDescriptor(,,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_OleTranslateAccelerator(LPOLEINPLACEFRAME a0, LPOLEINPLACEFRAMEINFO a1, LPMSG a2) { _PrintEnter("OleTranslateAccelerator(%p,%p,%p)\n", a0, a1, a2); HRESULT rv = 0; __try { rv = Real_OleTranslateAccelerator(a0, a1, a2); } __finally { _PrintExit("OleTranslateAccelerator(,,) -> %p\n", rv); }; return rv; } void __stdcall Mine_OleUninitialize(void) { _PrintEnter("OleUninitialize()\n"); __try { Real_OleUninitialize(); } __finally { _PrintExit("OleUninitialize() ->\n"); }; } BOOL __stdcall Mine_OpenClipboard(HWND a0) { _PrintEnter("OpenClipboard(%p)\n", a0); BOOL rv = 0; __try { rv = Real_OpenClipboard(a0); } __finally { _PrintExit("OpenClipboard() -> %p\n", rv); }; return rv; } #if _MSC_VER < 1300 HDESK __stdcall Mine_OpenDesktopA(LPSTR a0, DWORD a1, BOOL a2, ACCESS_MASK a3) #else HDESK __stdcall Mine_OpenDesktopA(LPCSTR a0, DWORD a1, BOOL a2, ACCESS_MASK a3) #endif { _PrintEnter("OpenDesktopA(%hs,%p,%p,%p)\n", a0, a1, a2, a3); HDESK rv = 0; __try { rv = Real_OpenDesktopA(a0, a1, a2, a3); } __finally { _PrintExit("OpenDesktopA(,,,) -> %p\n", rv); }; return rv; } #if _MSC_VER < 1300 HDESK __stdcall Mine_OpenDesktopW(LPWSTR a0, DWORD a1, BOOL a2, ACCESS_MASK a3) #else HDESK __stdcall Mine_OpenDesktopW(LPCWSTR a0, DWORD a1, BOOL a2, ACCESS_MASK a3) #endif { _PrintEnter("OpenDesktopW(%ls,%p,%p,%p)\n", a0, a1, a2, a3); HDESK rv = 0; __try { rv = Real_OpenDesktopW(a0, a1, a2, a3); } __finally { _PrintExit("OpenDesktopW(,,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_OpenEventA(DWORD a0, BOOL a1, LPCSTR a2) { _PrintEnter("OpenEventA(%p,%p,%hs)\n", a0, a1, a2); HANDLE rv = 0; __try { rv = Real_OpenEventA(a0, a1, a2); } __finally { _PrintExit("OpenEventA(,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_OpenEventW(DWORD a0, BOOL a1, LPCWSTR a2) { _PrintEnter("OpenEventW(%p,%p,%ls)\n", a0, a1, a2); HANDLE rv = 0; __try { rv = Real_OpenEventW(a0, a1, a2); } __finally { _PrintExit("OpenEventW(,,) -> %p\n", rv); }; return rv; } HFILE __stdcall Mine_OpenFile(LPCSTR a0, LPOFSTRUCT a1, UINT a2) { _PrintEnter("OpenFile(%hs,%p,%p)\n", a0, a1, a2); HFILE rv = 0; __try { rv = Real_OpenFile(a0, a1, a2); } __finally { _PrintExit("OpenFile(,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_OpenFileMappingA(DWORD a0, BOOL a1, LPCSTR a2) { _PrintEnter("OpenFileMappingA(%p,%p,%hs)\n", a0, a1, a2); HANDLE rv = 0; __try { rv = Real_OpenFileMappingA(a0, a1, a2); } __finally { _PrintExit("OpenFileMappingA(,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_OpenFileMappingW(DWORD a0, BOOL a1, LPCWSTR a2) { _PrintEnter("OpenFileMappingW(%p,%p,%ls)\n", a0, a1, a2); HANDLE rv = 0; __try { rv = Real_OpenFileMappingW(a0, a1, a2); } __finally { _PrintExit("OpenFileMappingW(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_OpenIcon(HWND a0) { _PrintEnter("OpenIcon(%p)\n", a0); BOOL rv = 0; __try { rv = Real_OpenIcon(a0); } __finally { _PrintExit("OpenIcon() -> %p\n", rv); }; return rv; } HDESK __stdcall Mine_OpenInputDesktop(DWORD a0, BOOL a1, ACCESS_MASK a2) { _PrintEnter("OpenInputDesktop(%p,%p,%p)\n", a0, a1, a2); HDESK rv = 0; __try { rv = Real_OpenInputDesktop(a0, a1, a2); } __finally { _PrintExit("OpenInputDesktop(,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_OpenMutexA(DWORD a0, BOOL a1, LPCSTR a2) { _PrintEnter("OpenMutexA(%p,%p,%hs)\n", a0, a1, a2); HANDLE rv = 0; __try { rv = Real_OpenMutexA(a0, a1, a2); } __finally { _PrintExit("OpenMutexA(,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_OpenMutexW(DWORD a0, BOOL a1, LPCWSTR a2) { _PrintEnter("OpenMutexW(%p,%p,%ls)\n", a0, a1, a2); HANDLE rv = 0; __try { rv = Real_OpenMutexW(a0, a1, a2); } __finally { _PrintExit("OpenMutexW(,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_OpenProcess(DWORD a0, BOOL a1, DWORD pid) { _PrintEnter("OpenProcess(%p,%p,pid=%d)\n", a0, a1, pid); HANDLE rv = 0; __try { rv = Real_OpenProcess(a0, a1, pid); } __finally { _PrintExit("OpenProcess(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_OpenProcessToken(__in HANDLE ProcessHandle, __in DWORD DesiredAccess, __out PHANDLE TokenHandle ) { _PrintEnter("OpenProcessToken(%p,%p,%p)\n", ProcessHandle, DesiredAccess, TokenHandle); BOOL rv = 0; __try { rv = Real_OpenProcessToken(ProcessHandle, DesiredAccess, TokenHandle); } __finally { _PrintExit("OpenProcessToken(,,%p) -> %p\n", TokenHandle != NULL ? *TokenHandle : 0, rv); }; return rv; } HANDLE __stdcall Mine_OpenSemaphoreA(DWORD a0, BOOL a1, LPCSTR a2) { _PrintEnter("OpenSemaphoreA(%p,%p,%hs)\n", a0, a1, a2); HANDLE rv = 0; __try { rv = Real_OpenSemaphoreA(a0, a1, a2); } __finally { _PrintExit("OpenSemaphoreA(,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_OpenSemaphoreW(DWORD a0, BOOL a1, LPCWSTR a2) { _PrintEnter("OpenSemaphoreW(%p,%p,%ls)\n", a0, a1, a2); HANDLE rv = 0; __try { rv = Real_OpenSemaphoreW(a0, a1, a2); } __finally { _PrintExit("OpenSemaphoreW(,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_OpenWaitableTimerA(DWORD a0, BOOL a1, LPCSTR a2) { _PrintEnter("OpenWaitableTimerA(%p,%p,%hs)\n", a0, a1, a2); HANDLE rv = 0; __try { rv = Real_OpenWaitableTimerA(a0, a1, a2); } __finally { _PrintExit("OpenWaitableTimerA(,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_OpenWaitableTimerW(DWORD a0, BOOL a1, LPCWSTR a2) { _PrintEnter("OpenWaitableTimerW(%p,%p,%ls)\n", a0, a1, a2); HANDLE rv = 0; __try { rv = Real_OpenWaitableTimerW(a0, a1, a2); } __finally { _PrintExit("OpenWaitableTimerW(,,) -> %p\n", rv); }; return rv; } #if _MSC_VER < 1300 HWINSTA __stdcall Mine_OpenWindowStationA(LPSTR a0, BOOL a1, ACCESS_MASK a2) #else HWINSTA __stdcall Mine_OpenWindowStationA(LPCSTR a0, BOOL a1, ACCESS_MASK a2) #endif { _PrintEnter("OpenWindowStationA(%hs,%p,%p)\n", a0, a1, a2); HWINSTA rv = 0; __try { rv = Real_OpenWindowStationA(a0, a1, a2); } __finally { _PrintExit("OpenWindowStationA(,,) -> %p\n", rv); }; return rv; } #if _MSC_VER < 1300 HWINSTA __stdcall Mine_OpenWindowStationW(LPWSTR a0, BOOL a1, ACCESS_MASK a2) #else HWINSTA __stdcall Mine_OpenWindowStationW(LPCWSTR a0, BOOL a1, ACCESS_MASK a2) #endif { _PrintEnter("OpenWindowStationW(%ls,%p,%p)\n", a0, a1, a2); HWINSTA rv = 0; __try { rv = Real_OpenWindowStationW(a0, a1, a2); } __finally { _PrintExit("OpenWindowStationW(,,) -> %p\n", rv); }; return rv; } void __stdcall Mine_OutputDebugStringA(LPCSTR a0) { _PrintEnter("OutputDebugStringA(%hs)\n", a0); __try { Real_OutputDebugStringA(a0); } __finally { _PrintExit("OutputDebugStringA() ->\n"); }; } void __stdcall Mine_OutputDebugStringW(LPCWSTR a0) { _PrintEnter("OutputDebugStringW(%ls)\n", a0); __try { Real_OutputDebugStringW(a0); } __finally { _PrintExit("OutputDebugStringW() ->\n"); }; } LPARAM __stdcall Mine_PackDDElParam(UINT a0, UINT_PTR a1, UINT_PTR a2) { _PrintEnter("PackDDElParam(%p,%p,%p)\n", a0, a1, a2); LPARAM rv = 0; __try { rv = Real_PackDDElParam(a0, a1, a2); } __finally { _PrintExit("PackDDElParam(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_PaintDesktop(HDC a0) { _PrintEnter("PaintDesktop(%p)\n", a0); BOOL rv = 0; __try { rv = Real_PaintDesktop(a0); } __finally { _PrintExit("PaintDesktop() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_PaintRgn(HDC a0, HRGN a1) { _PrintEnter("PaintRgn(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_PaintRgn(a0, a1); } __finally { _PrintExit("PaintRgn(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_PatBlt(HDC a0, int a1, int a2, int a3, int a4, DWORD a5) { _PrintEnter("PatBlt(%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); BOOL rv = 0; __try { rv = Real_PatBlt(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("PatBlt(,,,,,) -> %p\n", rv); }; return rv; } HRGN __stdcall Mine_PathToRegion(HDC a0) { _PrintEnter("PathToRegion(%p)\n", a0); HRGN rv = 0; __try { rv = Real_PathToRegion(a0); } __finally { _PrintExit("PathToRegion() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_PeekConsoleInputA(HANDLE a0, PINPUT_RECORD a1, DWORD a2, LPDWORD a3) { _PrintEnter("PeekConsoleInputA(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_PeekConsoleInputA(a0, a1, a2, a3); } __finally { _PrintExit("PeekConsoleInputA(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_PeekConsoleInputW(HANDLE a0, PINPUT_RECORD a1, DWORD a2, LPDWORD a3) { _PrintEnter("PeekConsoleInputW(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_PeekConsoleInputW(a0, a1, a2, a3); } __finally { _PrintExit("PeekConsoleInputW(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_PeekMessageA(LPMSG a0, HWND a1, UINT a2, UINT a3, UINT a4) { _PrintEnter("PeekMessageA(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_PeekMessageA(a0, a1, a2, a3, a4); } __finally { _PrintExit("PeekMessageA(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_PeekMessageW(LPMSG a0, HWND a1, UINT a2, UINT a3, UINT a4) { _PrintEnter("PeekMessageW(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_PeekMessageW(a0, a1, a2, a3, a4); } __finally { _PrintExit("PeekMessageW(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_PeekNamedPipe(HANDLE a0, LPVOID a1, DWORD a2, LPDWORD a3, LPDWORD a4, LPDWORD a5) { _PrintEnter("PeekNamedPipe(%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); BOOL rv = 0; __try { rv = Real_PeekNamedPipe(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("PeekNamedPipe(,,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_Pie(HDC a0, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) { _PrintEnter("Pie(%p,%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8); BOOL rv = 0; __try { rv = Real_Pie(a0, a1, a2, a3, a4, a5, a6, a7, a8); } __finally { _PrintExit("Pie(,,,,,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_PlayEnhMetaFile(HDC a0, HENHMETAFILE a1, RECT* a2) { _PrintEnter("PlayEnhMetaFile(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_PlayEnhMetaFile(a0, a1, a2); } __finally { _PrintExit("PlayEnhMetaFile(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_PlayEnhMetaFileRecord(HDC a0, LPHANDLETABLE a1, ENHMETARECORD* a2, UINT a3) { _PrintEnter("PlayEnhMetaFileRecord(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_PlayEnhMetaFileRecord(a0, a1, a2, a3); } __finally { _PrintExit("PlayEnhMetaFileRecord(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_PlayMetaFile(HDC a0, HMETAFILE a1) { _PrintEnter("PlayMetaFile(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_PlayMetaFile(a0, a1); } __finally { _PrintExit("PlayMetaFile(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_PlayMetaFileRecord(HDC a0, LPHANDLETABLE a1, LPMETARECORD a2, UINT a3) { _PrintEnter("PlayMetaFileRecord(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_PlayMetaFileRecord(a0, a1, a2, a3); } __finally { _PrintExit("PlayMetaFileRecord(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_PlgBlt(HDC a0, POINT* a1, HDC a2, int a3, int a4, int a5, int a6, HBITMAP a7, int a8, int a9) { _PrintEnter("PlgBlt(%p,%p,%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); BOOL rv = 0; __try { rv = Real_PlgBlt(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } __finally { _PrintExit("PlgBlt(,,,,,,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_PolyBezier(HDC a0, POINT* a1, DWORD a2) { _PrintEnter("PolyBezier(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_PolyBezier(a0, a1, a2); } __finally { _PrintExit("PolyBezier(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_PolyBezierTo(HDC a0, POINT* a1, DWORD a2) { _PrintEnter("PolyBezierTo(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_PolyBezierTo(a0, a1, a2); } __finally { _PrintExit("PolyBezierTo(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_PolyDraw(HDC a0, POINT* a1, BYTE* a2, int a3) { _PrintEnter("PolyDraw(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_PolyDraw(a0, a1, a2, a3); } __finally { _PrintExit("PolyDraw(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_PolyPolygon(HDC a0, POINT* a1, INT* a2, int a3) { _PrintEnter("PolyPolygon(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_PolyPolygon(a0, a1, a2, a3); } __finally { _PrintExit("PolyPolygon(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_PolyPolyline(HDC a0, POINT* a1, DWORD* a2, DWORD a3) { _PrintEnter("PolyPolyline(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_PolyPolyline(a0, a1, a2, a3); } __finally { _PrintExit("PolyPolyline(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_PolyTextOutA(HDC a0, POLYTEXTA* a1, int a2) { _PrintEnter("PolyTextOutA(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_PolyTextOutA(a0, a1, a2); } __finally { _PrintExit("PolyTextOutA(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_PolyTextOutW(HDC a0, POLYTEXTW* a1, int a2) { _PrintEnter("PolyTextOutW(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_PolyTextOutW(a0, a1, a2); } __finally { _PrintExit("PolyTextOutW(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_Polygon(HDC a0, POINT* a1, int a2) { _PrintEnter("Polygon(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_Polygon(a0, a1, a2); } __finally { _PrintExit("Polygon(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_Polyline(HDC a0, POINT* a1, int a2) { _PrintEnter("Polyline(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_Polyline(a0, a1, a2); } __finally { _PrintExit("Polyline(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_PolylineTo(HDC a0, POINT* a1, DWORD a2) { _PrintEnter("PolylineTo(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_PolylineTo(a0, a1, a2); } __finally { _PrintExit("PolylineTo(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_PostMessageA(HWND a0, UINT a1, WPARAM a2, LPARAM a3) { _PrintEnter("PostMessageA(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_PostMessageA(a0, a1, a2, a3); } __finally { _PrintExit("PostMessageA(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_PostMessageW(HWND a0, UINT a1, WPARAM a2, LPARAM a3) { _PrintEnter("PostMessageW(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_PostMessageW(a0, a1, a2, a3); } __finally { _PrintExit("PostMessageW(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_PostQueuedCompletionStatus(HANDLE a0, DWORD a1, ULONG_PTR a2, LPOVERLAPPED a3) { _PrintEnter("PostQueuedCompletionStatus(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_PostQueuedCompletionStatus(a0, a1, a2, a3); } __finally { _PrintExit("PostQueuedCompletionStatus(,,,) -> %p\n", rv); }; return rv; } void __stdcall Mine_PostQuitMessage(int a0) { _PrintEnter("PostQuitMessage(%p)\n", a0); __try { Real_PostQuitMessage(a0); } __finally { _PrintExit("PostQuitMessage() ->\n"); }; } BOOL __stdcall Mine_PostThreadMessageA(DWORD a0, UINT a1, WPARAM a2, LPARAM a3) { _PrintEnter("PostThreadMessageA(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_PostThreadMessageA(a0, a1, a2, a3); } __finally { _PrintExit("PostThreadMessageA(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_PostThreadMessageW(DWORD a0, UINT a1, WPARAM a2, LPARAM a3) { _PrintEnter("PostThreadMessageW(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_PostThreadMessageW(a0, a1, a2, a3); } __finally { _PrintExit("PostThreadMessageW(,,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_PrepareTape(HANDLE a0, DWORD a1, BOOL a2) { _PrintEnter("PrepareTape(%p,%p,%p)\n", a0, a1, a2); DWORD rv = 0; __try { rv = Real_PrepareTape(a0, a1, a2); } __finally { _PrintExit("PrepareTape(,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_ProgIDFromCLSID(CONST IID& a0, LPOLESTR* a1) { _PrintEnter("ProgIDFromCLSID(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_ProgIDFromCLSID(a0, a1); } __finally { _PrintExit("ProgIDFromCLSID(,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_PropVariantClear(PROPVARIANT* a0) { _PrintEnter("PropVariantClear(%p)\n", a0); HRESULT rv = 0; __try { rv = Real_PropVariantClear(a0); } __finally { _PrintExit("PropVariantClear() -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_PropVariantCopy(PROPVARIANT* a0, PROPVARIANT* a1) { _PrintEnter("PropVariantCopy(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_PropVariantCopy(a0, a1); } __finally { _PrintExit("PropVariantCopy(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_PtInRect(RECT* a0, POINT a1) { _PrintEnter("PtInRect(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_PtInRect(a0, a1); } __finally { _PrintExit("PtInRect(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_PtInRegion(HRGN a0, int a1, int a2) { _PrintEnter("PtInRegion(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_PtInRegion(a0, a1, a2); } __finally { _PrintExit("PtInRegion(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_PtVisible(HDC a0, int a1, int a2) { _PrintEnter("PtVisible(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_PtVisible(a0, a1, a2); } __finally { _PrintExit("PtVisible(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_PulseEvent(HANDLE a0) { _PrintEnter("PulseEvent(%p)\n", a0); BOOL rv = 0; __try { rv = Real_PulseEvent(a0); } __finally { _PrintExit("PulseEvent() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_PurgeComm(HANDLE a0, DWORD a1) { _PrintEnter("PurgeComm(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_PurgeComm(a0, a1); } __finally { _PrintExit("PurgeComm(,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_QueryDosDeviceA(LPCSTR a0, LPSTR a1, DWORD a2) { _PrintEnter("QueryDosDeviceA(%hs,%p,%p)\n", a0, a1, a2); DWORD rv = 0; __try { rv = Real_QueryDosDeviceA(a0, a1, a2); } __finally { _PrintExit("QueryDosDeviceA(,%hs,) -> %p\n", a1, rv); }; return rv; } DWORD __stdcall Mine_QueryDosDeviceW(LPCWSTR a0, LPWSTR a1, DWORD a2) { _PrintEnter("QueryDosDeviceW(%ls,%p,%p)\n", a0, a1, a2); DWORD rv = 0; __try { rv = Real_QueryDosDeviceW(a0, a1, a2); } __finally { _PrintExit("QueryDosDeviceW(,%ls,) -> %p\n", a1, rv); }; return rv; } BOOL __stdcall Mine_QueryPerformanceCounter(LARGE_INTEGER* a0) { _PrintEnter("QueryPerformanceCounter(%p)\n", a0); BOOL rv = 0; __try { rv = Real_QueryPerformanceCounter(a0); } __finally { _PrintExit("QueryPerformanceCounter() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_QueryPerformanceFrequency(LARGE_INTEGER* a0) { _PrintEnter("QueryPerformanceFrequency(%p)\n", a0); BOOL rv = 0; __try { rv = Real_QueryPerformanceFrequency(a0); } __finally { _PrintExit("QueryPerformanceFrequency() -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_QueueUserAPC(PAPCFUNC a0, HANDLE a1, ULONG_PTR a2) { _PrintEnter("QueueUserAPC(%p,%p,%p)\n", a0, a1, a2); DWORD rv = 0; __try { rv = Real_QueueUserAPC(a0, a1, a2); } __finally { _PrintExit("QueueUserAPC(,,) -> %p\n", rv); }; return rv; } void __stdcall Mine_RaiseException(DWORD a0, DWORD a1, DWORD a2, ULONG_PTR* a3) { _PrintEnter("RaiseException(%p,%p,%p,%p)\n", a0, a1, a2, a3); __try { Real_RaiseException(a0, a1, a2, a3); } __finally { _PrintExit("RaiseException(,,,) ->\n"); }; } HRESULT __stdcall Mine_ReadClassStg(LPSTORAGE a0, CLSID* a1) { _PrintEnter("ReadClassStg(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_ReadClassStg(a0, a1); } __finally { _PrintExit("ReadClassStg(,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_ReadClassStm(LPSTREAM a0, CLSID* a1) { _PrintEnter("ReadClassStm(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_ReadClassStm(a0, a1); } __finally { _PrintExit("ReadClassStm(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ReadConsoleA( HANDLE a0, LPVOID a1, DWORD a2, LPDWORD a3, #ifdef ENABLE_INSERT_MODE PCONSOLE_READCONSOLE_CONTROL a4 #else LPVOID a4 #endif ) { _PrintEnter("ReadConsoleA(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_ReadConsoleA(a0, a1, a2, a3, a4); } __finally { _PrintExit("ReadConsoleA(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ReadConsoleInputA(HANDLE a0, PINPUT_RECORD a1, DWORD a2, LPDWORD a3) { _PrintEnter("ReadConsoleInputA(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_ReadConsoleInputA(a0, a1, a2, a3); } __finally { _PrintExit("ReadConsoleInputA(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ReadConsoleInputW(HANDLE a0, PINPUT_RECORD a1, DWORD a2, LPDWORD a3) { _PrintEnter("ReadConsoleInputW(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_ReadConsoleInputW(a0, a1, a2, a3); } __finally { _PrintExit("ReadConsoleInputW(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ReadConsoleOutputA(HANDLE a0, PCHAR_INFO a1, COORD a2, COORD a3, PSMALL_RECT a4) { _PrintEnter("ReadConsoleOutputA(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_ReadConsoleOutputA(a0, a1, a2, a3, a4); } __finally { _PrintExit("ReadConsoleOutputA(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ReadConsoleOutputAttribute(HANDLE a0, LPWORD a1, DWORD a2, COORD a3, LPDWORD a4) { _PrintEnter("ReadConsoleOutputAttribute(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_ReadConsoleOutputAttribute(a0, a1, a2, a3, a4); } __finally { _PrintExit("ReadConsoleOutputAttribute(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ReadConsoleOutputCharacterA(HANDLE a0, LPSTR a1, DWORD a2, COORD a3, LPDWORD a4) { _PrintEnter("ReadConsoleOutputCharacterA(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_ReadConsoleOutputCharacterA(a0, a1, a2, a3, a4); } __finally { _PrintExit("ReadConsoleOutputCharacterA(,%hs,,,) -> %p\n", a1, rv); }; return rv; } BOOL __stdcall Mine_ReadConsoleOutputCharacterW(HANDLE a0, LPWSTR a1, DWORD a2, COORD a3, LPDWORD a4) { _PrintEnter("ReadConsoleOutputCharacterW(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_ReadConsoleOutputCharacterW(a0, a1, a2, a3, a4); } __finally { _PrintExit("ReadConsoleOutputCharacterW(,%ls,,,) -> %p\n", a1, rv); }; return rv; } BOOL __stdcall Mine_ReadConsoleOutputW(HANDLE a0, PCHAR_INFO a1, COORD a2, COORD a3, PSMALL_RECT a4) { _PrintEnter("ReadConsoleOutputW(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_ReadConsoleOutputW(a0, a1, a2, a3, a4); } __finally { _PrintExit("ReadConsoleOutputW(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ReadConsoleW( HANDLE a0, LPVOID a1, DWORD a2, LPDWORD a3, #ifdef ENABLE_INSERT_MODE PCONSOLE_READCONSOLE_CONTROL a4 #else LPVOID a4 #endif ) { _PrintEnter("ReadConsoleW(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_ReadConsoleW(a0, a1, a2, a3, a4); } __finally { _PrintExit("ReadConsoleW(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ReadDirectoryChangesW(HANDLE a0, LPVOID a1, DWORD a2, BOOL a3, DWORD a4, LPDWORD a5, LPOVERLAPPED a6, LPOVERLAPPED_COMPLETION_ROUTINE a7) { _PrintEnter("ReadDirectoryChangesW(%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7); BOOL rv = 0; __try { rv = Real_ReadDirectoryChangesW(a0, a1, a2, a3, a4, a5, a6, a7); } __finally { _PrintExit("ReadDirectoryChangesW(,,,,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ReadFile(HANDLE a0, LPVOID a1, DWORD a2, LPDWORD a3, LPOVERLAPPED a4) { _PrintEnter("ReadFile(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_ReadFile(a0, a1, a2, a3, a4); } __finally { _PrintExit("ReadFile(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ReadFileEx(HANDLE a0, LPVOID a1, DWORD a2, LPOVERLAPPED a3, LPOVERLAPPED_COMPLETION_ROUTINE a4) { _PrintEnter("ReadFileEx(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_ReadFileEx(a0, a1, a2, a3, a4); } __finally { _PrintExit("ReadFileEx(,,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_ReadFmtUserTypeStg(LPSTORAGE a0, CLIPFORMAT* a1, LPOLESTR* a2) { _PrintEnter("ReadFmtUserTypeStg(%p,%p,%p)\n", a0, a1, a2); HRESULT rv = 0; __try { rv = Real_ReadFmtUserTypeStg(a0, a1, a2); } __finally { _PrintExit("ReadFmtUserTypeStg(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ReadProcessMemory(HANDLE a0, LPCVOID lpBase, LPVOID lpBuf, DWORD_PTR nSize, PDWORD_PTR a4) { _PrintEnter("ReadProcessMemory(%p,@%p..%p,%p,%p)\n", a0, lpBase, (PBYTE)lpBase + ((nSize > 0) ? nSize - 1 : 0), lpBuf, a4); BOOL rv = 0; __try { rv = Real_ReadProcessMemory(a0, lpBase, lpBuf, nSize, a4); } __finally { _PrintExit("ReadProcessMemory(,,,,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_RealizePalette(HDC a0) { _PrintEnter("RealizePalette(%p)\n", a0); UINT rv = 0; __try { rv = Real_RealizePalette(a0); } __finally { _PrintExit("RealizePalette() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_RectInRegion(HRGN a0, RECT* a1) { _PrintEnter("RectInRegion(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_RectInRegion(a0, a1); } __finally { _PrintExit("RectInRegion(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_RectVisible(HDC a0, RECT* a1) { _PrintEnter("RectVisible(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_RectVisible(a0, a1); } __finally { _PrintExit("RectVisible(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_Rectangle(HDC a0, int a1, int a2, int a3, int a4) { _PrintEnter("Rectangle(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_Rectangle(a0, a1, a2, a3, a4); } __finally { _PrintExit("Rectangle(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_RedrawWindow(HWND a0, RECT* a1, HRGN a2, UINT a3) { _PrintEnter("RedrawWindow(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_RedrawWindow(a0, a1, a2, a3); } __finally { _PrintExit("RedrawWindow(,,,) -> %p\n", rv); }; return rv; } ATOM __stdcall Mine_RegisterClassA(WNDCLASSA* a0) { _PrintEnter("RegisterClassA(%p)\n", a0); ATOM rv = 0; __try { rv = Real_RegisterClassA(a0); } __finally { _PrintExit("RegisterClassA() -> %p\n", rv); }; return rv; } ATOM __stdcall Mine_RegisterClassExA(WNDCLASSEXA* a0) { _PrintEnter("RegisterClassExA(%p)\n", a0); ATOM rv = 0; __try { rv = Real_RegisterClassExA(a0); } __finally { _PrintExit("RegisterClassExA() -> %p\n", rv); }; return rv; } ATOM __stdcall Mine_RegisterClassExW(WNDCLASSEXW* a0) { _PrintEnter("RegisterClassExW(%p)\n", a0); ATOM rv = 0; __try { rv = Real_RegisterClassExW(a0); } __finally { _PrintExit("RegisterClassExW() -> %p\n", rv); }; return rv; } ATOM __stdcall Mine_RegisterClassW(WNDCLASSW* a0) { _PrintEnter("RegisterClassW(%p)\n", a0); ATOM rv = 0; __try { rv = Real_RegisterClassW(a0); } __finally { _PrintExit("RegisterClassW() -> %p\n", rv); }; return rv; } UINT __stdcall Mine_RegisterClipboardFormatA(LPCSTR a0) { _PrintEnter("RegisterClipboardFormatA(%hs)\n", a0); UINT rv = 0; __try { rv = Real_RegisterClipboardFormatA(a0); } __finally { _PrintExit("RegisterClipboardFormatA() -> %p\n", rv); }; return rv; } UINT __stdcall Mine_RegisterClipboardFormatW(LPCWSTR a0) { _PrintEnter("RegisterClipboardFormatW(%ls)\n", a0); UINT rv = 0; __try { rv = Real_RegisterClipboardFormatW(a0); } __finally { _PrintExit("RegisterClipboardFormatW() -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_RegisterDragDrop(HWND a0, IDropTarget* a1) { _PrintEnter("RegisterDragDrop(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_RegisterDragDrop(a0, a1); } __finally { _PrintExit("RegisterDragDrop(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_RegisterHotKey(HWND a0, int a1, UINT a2, UINT a3) { _PrintEnter("RegisterHotKey(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_RegisterHotKey(a0, a1, a2, a3); } __finally { _PrintExit("RegisterHotKey(,,,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_RegisterWindowMessageA(LPCSTR a0) { _PrintEnter("RegisterWindowMessageA(%hs)\n", a0); UINT rv = 0; __try { rv = Real_RegisterWindowMessageA(a0); } __finally { _PrintExit("RegisterWindowMessageA() -> %p\n", rv); }; return rv; } UINT __stdcall Mine_RegisterWindowMessageW(LPCWSTR a0) { _PrintEnter("RegisterWindowMessageW(%ls)\n", a0); UINT rv = 0; __try { rv = Real_RegisterWindowMessageW(a0); } __finally { _PrintExit("RegisterWindowMessageW() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ReleaseCapture(void) { _PrintEnter("ReleaseCapture()\n"); BOOL rv = 0; __try { rv = Real_ReleaseCapture(); } __finally { _PrintExit("ReleaseCapture() -> %p\n", rv); }; return rv; } int __stdcall Mine_ReleaseDC(HWND a0, HDC a1) { _PrintEnter("ReleaseDC(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real_ReleaseDC(a0, a1); } __finally { _PrintExit("ReleaseDC(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ReleaseMutex(HANDLE a0) { _PrintEnter("ReleaseMutex(%p)\n", a0); BOOL rv = 0; __try { rv = Real_ReleaseMutex(a0); } __finally { _PrintExit("ReleaseMutex() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ReleaseSemaphore(HANDLE a0, LONG a1, LPLONG a2) { _PrintEnter("ReleaseSemaphore(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_ReleaseSemaphore(a0, a1, a2); } __finally { _PrintExit("ReleaseSemaphore(,,) -> %p\n", rv); }; return rv; } void __stdcall Mine_ReleaseStgMedium(LPSTGMEDIUM a0) { _PrintEnter("ReleaseStgMedium(%p)\n", a0); __try { Real_ReleaseStgMedium(a0); } __finally { _PrintExit("ReleaseStgMedium() ->\n"); }; } BOOL __stdcall Mine_RemoveDirectoryA(LPCSTR a0) { _PrintEnter("RemoveDirectoryA(%hs)\n", a0); BOOL rv = 0; __try { rv = Real_RemoveDirectoryA(a0); } __finally { _PrintExit("RemoveDirectoryA() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_RemoveDirectoryW(LPCWSTR a0) { _PrintEnter("RemoveDirectoryW(%ls)\n", a0); BOOL rv = 0; __try { rv = Real_RemoveDirectoryW(a0); } __finally { _PrintExit("RemoveDirectoryW() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_RemoveFontResourceA(LPCSTR a0) { _PrintEnter("RemoveFontResourceA(%hs)\n", a0); BOOL rv = 0; __try { rv = Real_RemoveFontResourceA(a0); } __finally { _PrintExit("RemoveFontResourceA() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_RemoveFontResourceW(LPCWSTR a0) { _PrintEnter("RemoveFontResourceW(%ls)\n", a0); BOOL rv = 0; __try { rv = Real_RemoveFontResourceW(a0); } __finally { _PrintExit("RemoveFontResourceW() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_RemoveMenu(HMENU a0, UINT a1, UINT a2) { _PrintEnter("RemoveMenu(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_RemoveMenu(a0, a1, a2); } __finally { _PrintExit("RemoveMenu(,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_RemovePropA(HWND a0, LPCSTR a1) { _PrintEnter("RemovePropA(%p,%hs)\n", a0, a1); HANDLE rv = 0; __try { rv = Real_RemovePropA(a0, a1); } __finally { _PrintExit("RemovePropA(,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_RemovePropW(HWND a0, LPCWSTR a1) { _PrintEnter("RemovePropW(%p,%ls)\n", a0, a1); HANDLE rv = 0; __try { rv = Real_RemovePropW(a0, a1); } __finally { _PrintExit("RemovePropW(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ReplyMessage(LRESULT a0) { _PrintEnter("ReplyMessage(%p)\n", a0); BOOL rv = 0; __try { rv = Real_ReplyMessage(a0); } __finally { _PrintExit("ReplyMessage() -> %p\n", rv); }; return rv; } HDC __stdcall Mine_ResetDCA(HDC a0, CONST DEVMODEA* a1) { _PrintEnter("ResetDCA(%p,%p)\n", a0, a1); HDC rv = 0; __try { rv = Real_ResetDCA(a0, a1); } __finally { _PrintExit("ResetDCA(,) -> %p\n", rv); }; return rv; } HDC __stdcall Mine_ResetDCW(HDC a0, CONST DEVMODEW* a1) { _PrintEnter("ResetDCW(%p,%p)\n", a0, a1); HDC rv = 0; __try { rv = Real_ResetDCW(a0, a1); } __finally { _PrintExit("ResetDCW(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ResetEvent(HANDLE a0) { _PrintEnter("ResetEvent(%p)\n", a0); BOOL rv = 0; __try { rv = Real_ResetEvent(a0); } __finally { _PrintExit("ResetEvent() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ResizePalette(HPALETTE a0, UINT a1) { _PrintEnter("ResizePalette(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_ResizePalette(a0, a1); } __finally { _PrintExit("ResizePalette(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_RestoreDC(HDC a0, int a1) { _PrintEnter("RestoreDC(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_RestoreDC(a0, a1); } __finally { _PrintExit("RestoreDC(,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_ResumeThread(HANDLE a0) { _PrintEnter("ResumeThread(%p)\n", a0); DWORD rv = 0; __try { rv = Real_ResumeThread(a0); } __finally { _PrintExit("ResumeThread() -> %p\n", rv); }; return rv; } LPARAM __stdcall Mine_ReuseDDElParam(LPARAM a0, UINT a1, UINT a2, UINT_PTR a3, UINT_PTR a4) { _PrintEnter("ReuseDDElParam(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); LPARAM rv = 0; __try { rv = Real_ReuseDDElParam(a0, a1, a2, a3, a4); } __finally { _PrintExit("ReuseDDElParam(,,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_RevokeDragDrop(HWND a0) { _PrintEnter("RevokeDragDrop(%p)\n", a0); HRESULT rv = 0; __try { rv = Real_RevokeDragDrop(a0); } __finally { _PrintExit("RevokeDragDrop() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_RoundRect(HDC a0, int a1, int a2, int a3, int a4, int a5, int a6) { _PrintEnter("RoundRect(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); BOOL rv = 0; __try { rv = Real_RoundRect(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("RoundRect(,,,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_SaveDC(HDC a0) { _PrintEnter("SaveDC(%p)\n", a0); int rv = 0; __try { rv = Real_SaveDC(a0); } __finally { _PrintExit("SaveDC() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ScaleViewportExtEx(HDC a0, int a1, int a2, int a3, int a4, SIZE* a5) { _PrintEnter("ScaleViewportExtEx(%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); BOOL rv = 0; __try { rv = Real_ScaleViewportExtEx(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("ScaleViewportExtEx(,,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ScaleWindowExtEx(HDC a0, int a1, int a2, int a3, int a4, SIZE* a5) { _PrintEnter("ScaleWindowExtEx(%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); BOOL rv = 0; __try { rv = Real_ScaleWindowExtEx(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("ScaleWindowExtEx(,,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ScreenToClient(HWND a0, POINT* a1) { _PrintEnter("ScreenToClient(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_ScreenToClient(a0, a1); } __finally { _PrintExit("ScreenToClient(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ScrollConsoleScreenBufferA(HANDLE a0, SMALL_RECT* a1, SMALL_RECT* a2, COORD a3, CHAR_INFO* a4) { _PrintEnter("ScrollConsoleScreenBufferA(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_ScrollConsoleScreenBufferA(a0, a1, a2, a3, a4); } __finally { _PrintExit("ScrollConsoleScreenBufferA(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ScrollConsoleScreenBufferW(HANDLE a0, SMALL_RECT* a1, SMALL_RECT* a2, COORD a3, CHAR_INFO* a4) { _PrintEnter("ScrollConsoleScreenBufferW(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_ScrollConsoleScreenBufferW(a0, a1, a2, a3, a4); } __finally { _PrintExit("ScrollConsoleScreenBufferW(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ScrollDC(HDC a0, int a1, int a2, RECT* a3, RECT* a4, HRGN a5, LPRECT a6) { _PrintEnter("ScrollDC(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); BOOL rv = 0; __try { rv = Real_ScrollDC(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("ScrollDC(,,,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ScrollWindow(HWND a0, int a1, int a2, RECT* a3, RECT* a4) { _PrintEnter("ScrollWindow(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_ScrollWindow(a0, a1, a2, a3, a4); } __finally { _PrintExit("ScrollWindow(,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_ScrollWindowEx(HWND a0, int a1, int a2, RECT* a3, RECT* a4, HRGN a5, LPRECT a6, UINT a7) { _PrintEnter("ScrollWindowEx(%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7); int rv = 0; __try { rv = Real_ScrollWindowEx(a0, a1, a2, a3, a4, a5, a6, a7); } __finally { _PrintExit("ScrollWindowEx(,,,,,,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_SearchPathA(LPCSTR a0, LPCSTR a1, LPCSTR a2, DWORD a3, LPSTR a4, LPSTR* a5) { _PrintEnter("SearchPathA(%hs,%hs,%hs,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); DWORD rv = 0; __try { rv = Real_SearchPathA(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("SearchPathA(,,,,%hs,) -> %p\n", a4, rv); }; return rv; } DWORD __stdcall Mine_SearchPathW(LPCWSTR a0, LPCWSTR a1, LPCWSTR a2, DWORD a3, LPWSTR a4, LPWSTR* a5) { _PrintEnter("SearchPathW(%ls,%ls,%ls,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); DWORD rv = 0; __try { rv = Real_SearchPathW(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("SearchPathW(,,,,%ls,) -> %p\n", a4, rv); }; return rv; } BOOL __stdcall Mine_SelectClipPath(HDC a0, int a1) { _PrintEnter("SelectClipPath(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SelectClipPath(a0, a1); } __finally { _PrintExit("SelectClipPath(,) -> %p\n", rv); }; return rv; } int __stdcall Mine_SelectClipRgn(HDC a0, HRGN a1) { _PrintEnter("SelectClipRgn(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real_SelectClipRgn(a0, a1); } __finally { _PrintExit("SelectClipRgn(,) -> %p\n", rv); }; return rv; } HGDIOBJ __stdcall Mine_SelectObject(HDC a0, HGDIOBJ a1) { _PrintEnter("SelectObject(%p,%p)\n", a0, a1); HGDIOBJ rv = 0; __try { rv = Real_SelectObject(a0, a1); } __finally { _PrintExit("SelectObject(,) -> %p\n", rv); }; return rv; } HPALETTE __stdcall Mine_SelectPalette(HDC a0, HPALETTE a1, BOOL a2) { _PrintEnter("SelectPalette(%p,%p,%p)\n", a0, a1, a2); HPALETTE rv = 0; __try { rv = Real_SelectPalette(a0, a1, a2); } __finally { _PrintExit("SelectPalette(,,) -> %p\n", rv); }; return rv; } LRESULT __stdcall Mine_SendDlgItemMessageA(HWND a0, int a1, UINT a2, WPARAM a3, LPARAM a4) { _PrintEnter("SendDlgItemMessageA(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); LRESULT rv = 0; __try { rv = Real_SendDlgItemMessageA(a0, a1, a2, a3, a4); } __finally { _PrintExit("SendDlgItemMessageA(,,,,) -> %p\n", rv); }; return rv; } LRESULT __stdcall Mine_SendDlgItemMessageW(HWND a0, int a1, UINT a2, WPARAM a3, LPARAM a4) { _PrintEnter("SendDlgItemMessageW(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); LRESULT rv = 0; __try { rv = Real_SendDlgItemMessageW(a0, a1, a2, a3, a4); } __finally { _PrintExit("SendDlgItemMessageW(,,,,) -> %p\n", rv); }; return rv; } LRESULT __stdcall Mine_SendMessageA(HWND a0, UINT a1, WPARAM a2, LPARAM a3) { _PrintEnter("SendMessageA(%p,%p,%p,%p)\n", a0, a1, a2, a3); LRESULT rv = 0; __try { rv = Real_SendMessageA(a0, a1, a2, a3); } __finally { _PrintExit("SendMessageA(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SendMessageCallbackA(HWND a0, UINT a1, WPARAM a2, LPARAM a3, SENDASYNCPROC a4, ULONG_PTR a5) { _PrintEnter("SendMessageCallbackA(%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); BOOL rv = 0; __try { rv = Real_SendMessageCallbackA(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("SendMessageCallbackA(,,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SendMessageCallbackW(HWND a0, UINT a1, WPARAM a2, LPARAM a3, SENDASYNCPROC a4, ULONG_PTR a5) { _PrintEnter("SendMessageCallbackW(%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); BOOL rv = 0; __try { rv = Real_SendMessageCallbackW(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("SendMessageCallbackW(,,,,,) -> %p\n", rv); }; return rv; } LRESULT __stdcall Mine_SendMessageTimeoutA(HWND a0, UINT a1, WPARAM a2, LPARAM a3, UINT a4, UINT a5, PULONG_PTR a6) { _PrintEnter("SendMessageTimeoutA(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); LRESULT rv = 0; __try { rv = Real_SendMessageTimeoutA(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("SendMessageTimeoutA(,,,,,,) -> %p\n", rv); }; return rv; } LRESULT __stdcall Mine_SendMessageTimeoutW(HWND a0, UINT a1, WPARAM a2, LPARAM a3, UINT a4, UINT a5, PULONG_PTR a6) { _PrintEnter("SendMessageTimeoutW(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); LRESULT rv = 0; __try { rv = Real_SendMessageTimeoutW(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("SendMessageTimeoutW(,,,,,,) -> %p\n", rv); }; return rv; } LRESULT __stdcall Mine_SendMessageW(HWND a0, UINT a1, WPARAM a2, LPARAM a3) { _PrintEnter("SendMessageW(%p,%p,%p,%p)\n", a0, a1, a2, a3); LRESULT rv = 0; __try { rv = Real_SendMessageW(a0, a1, a2, a3); } __finally { _PrintExit("SendMessageW(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SendNotifyMessageA(HWND a0, UINT a1, WPARAM a2, LPARAM a3) { _PrintEnter("SendNotifyMessageA(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_SendNotifyMessageA(a0, a1, a2, a3); } __finally { _PrintExit("SendNotifyMessageA(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SendNotifyMessageW(HWND a0, UINT a1, WPARAM a2, LPARAM a3) { _PrintEnter("SendNotifyMessageW(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_SendNotifyMessageW(a0, a1, a2, a3); } __finally { _PrintExit("SendNotifyMessageW(,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_SetAbortProc(HDC a0, ABORTPROC a1) { _PrintEnter("SetAbortProc(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real_SetAbortProc(a0, a1); } __finally { _PrintExit("SetAbortProc(,) -> %p\n", rv); }; return rv; } HWND __stdcall Mine_SetActiveWindow(HWND a0) { _PrintEnter("SetActiveWindow(%p)\n", a0); HWND rv = 0; __try { rv = Real_SetActiveWindow(a0); } __finally { _PrintExit("SetActiveWindow() -> %p\n", rv); }; return rv; } int __stdcall Mine_SetArcDirection(HDC a0, int a1) { _PrintEnter("SetArcDirection(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real_SetArcDirection(a0, a1); } __finally { _PrintExit("SetArcDirection(,) -> %p\n", rv); }; return rv; } LONG __stdcall Mine_SetBitmapBits(HBITMAP a0, DWORD a1, void* a2) { _PrintEnter("SetBitmapBits(%p,%p,%p)\n", a0, a1, a2); LONG rv = 0; __try { rv = Real_SetBitmapBits(a0, a1, a2); } __finally { _PrintExit("SetBitmapBits(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetBitmapDimensionEx(HBITMAP a0, int a1, int a2, SIZE* a3) { _PrintEnter("SetBitmapDimensionEx(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_SetBitmapDimensionEx(a0, a1, a2, a3); } __finally { _PrintExit("SetBitmapDimensionEx(,,,) -> %p\n", rv); }; return rv; } COLORREF __stdcall Mine_SetBkColor(HDC a0, COLORREF a1) { _PrintEnter("SetBkColor(%p,%p)\n", a0, a1); COLORREF rv = 0; __try { rv = Real_SetBkColor(a0, a1); } __finally { _PrintExit("SetBkColor(,) -> %p\n", rv); }; return rv; } int __stdcall Mine_SetBkMode(HDC a0, int a1) { _PrintEnter("SetBkMode(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real_SetBkMode(a0, a1); } __finally { _PrintExit("SetBkMode(,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_SetBoundsRect(HDC a0, RECT* a1, UINT a2) { _PrintEnter("SetBoundsRect(%p,%p,%p)\n", a0, a1, a2); UINT rv = 0; __try { rv = Real_SetBoundsRect(a0, a1, a2); } __finally { _PrintExit("SetBoundsRect(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetBrushOrgEx(HDC a0, int a1, int a2, POINT* a3) { _PrintEnter("SetBrushOrgEx(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_SetBrushOrgEx(a0, a1, a2, a3); } __finally { _PrintExit("SetBrushOrgEx(,,,) -> %p\n", rv); }; return rv; } HWND __stdcall Mine_SetCapture(HWND a0) { _PrintEnter("SetCapture(%p)\n", a0); HWND rv = 0; __try { rv = Real_SetCapture(a0); } __finally { _PrintExit("SetCapture() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetCaretBlinkTime(UINT a0) { _PrintEnter("SetCaretBlinkTime(%p)\n", a0); BOOL rv = 0; __try { rv = Real_SetCaretBlinkTime(a0); } __finally { _PrintExit("SetCaretBlinkTime() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetCaretPos(int a0, int a1) { _PrintEnter("SetCaretPos(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetCaretPos(a0, a1); } __finally { _PrintExit("SetCaretPos(,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_SetClassLongA(HWND a0, int a1, LONG a2) { _PrintEnter("SetClassLongA(%p,%p,%p)\n", a0, a1, a2); DWORD rv = 0; __try { rv = Real_SetClassLongA(a0, a1, a2); } __finally { _PrintExit("SetClassLongA(,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_SetClassLongW(HWND a0, int a1, LONG a2) { _PrintEnter("SetClassLongW(%p,%p,%p)\n", a0, a1, a2); DWORD rv = 0; __try { rv = Real_SetClassLongW(a0, a1, a2); } __finally { _PrintExit("SetClassLongW(,,) -> %p\n", rv); }; return rv; } WORD __stdcall Mine_SetClassWord(HWND a0, int a1, WORD a2) { _PrintEnter("SetClassWord(%p,%p,%p)\n", a0, a1, a2); WORD rv = 0; __try { rv = Real_SetClassWord(a0, a1, a2); } __finally { _PrintExit("SetClassWord(,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_SetClipboardData(UINT a0, HANDLE a1) { _PrintEnter("SetClipboardData(%p,%p)\n", a0, a1); HANDLE rv = 0; __try { rv = Real_SetClipboardData(a0, a1); } __finally { _PrintExit("SetClipboardData(,) -> %p\n", rv); }; return rv; } HWND __stdcall Mine_SetClipboardViewer(HWND a0) { _PrintEnter("SetClipboardViewer(%p)\n", a0); HWND rv = 0; __try { rv = Real_SetClipboardViewer(a0); } __finally { _PrintExit("SetClipboardViewer() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetColorAdjustment(HDC a0, COLORADJUSTMENT* a1) { _PrintEnter("SetColorAdjustment(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetColorAdjustment(a0, a1); } __finally { _PrintExit("SetColorAdjustment(,) -> %p\n", rv); }; return rv; } HCOLORSPACE __stdcall Mine_SetColorSpace(HDC a0, HCOLORSPACE a1) { _PrintEnter("SetColorSpace(%p,%p)\n", a0, a1); HCOLORSPACE rv = 0; __try { rv = Real_SetColorSpace(a0, a1); } __finally { _PrintExit("SetColorSpace(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetCommBreak(HANDLE a0) { _PrintEnter("SetCommBreak(%p)\n", a0); BOOL rv = 0; __try { rv = Real_SetCommBreak(a0); } __finally { _PrintExit("SetCommBreak() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetCommConfig(HANDLE a0, LPCOMMCONFIG a1, DWORD a2) { _PrintEnter("SetCommConfig(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_SetCommConfig(a0, a1, a2); } __finally { _PrintExit("SetCommConfig(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetCommMask(HANDLE a0, DWORD a1) { _PrintEnter("SetCommMask(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetCommMask(a0, a1); } __finally { _PrintExit("SetCommMask(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetCommState(HANDLE a0, LPDCB a1) { _PrintEnter("SetCommState(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetCommState(a0, a1); } __finally { _PrintExit("SetCommState(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetCommTimeouts(HANDLE a0, LPCOMMTIMEOUTS a1) { _PrintEnter("SetCommTimeouts(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetCommTimeouts(a0, a1); } __finally { _PrintExit("SetCommTimeouts(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetComputerNameA(LPCSTR a0) { _PrintEnter("SetComputerNameA(%hs)\n", a0); BOOL rv = 0; __try { rv = Real_SetComputerNameA(a0); } __finally { _PrintExit("SetComputerNameA() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetComputerNameW(LPCWSTR a0) { _PrintEnter("SetComputerNameW(%ls)\n", a0); BOOL rv = 0; __try { rv = Real_SetComputerNameW(a0); } __finally { _PrintExit("SetComputerNameW() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetConsoleActiveScreenBuffer(HANDLE a0) { _PrintEnter("SetConsoleActiveScreenBuffer(%p)\n", a0); BOOL rv = 0; __try { rv = Real_SetConsoleActiveScreenBuffer(a0); } __finally { _PrintExit("SetConsoleActiveScreenBuffer() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetConsoleCP(UINT a0) { _PrintEnter("SetConsoleCP(%p)\n", a0); BOOL rv = 0; __try { rv = Real_SetConsoleCP(a0); } __finally { _PrintExit("SetConsoleCP() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetConsoleCtrlHandler(PHANDLER_ROUTINE a0, BOOL a1) { _PrintEnter("SetConsoleCtrlHandler(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetConsoleCtrlHandler(a0, a1); } __finally { _PrintExit("SetConsoleCtrlHandler(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetConsoleCursorInfo(HANDLE a0, CONSOLE_CURSOR_INFO* a1) { _PrintEnter("SetConsoleCursorInfo(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetConsoleCursorInfo(a0, a1); } __finally { _PrintExit("SetConsoleCursorInfo(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetConsoleCursorPosition(HANDLE a0, COORD a1) { _PrintEnter("SetConsoleCursorPosition(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetConsoleCursorPosition(a0, a1); } __finally { _PrintExit("SetConsoleCursorPosition(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetConsoleMode(HANDLE a0, DWORD a1) { _PrintEnter("SetConsoleMode(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetConsoleMode(a0, a1); } __finally { _PrintExit("SetConsoleMode(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetConsoleOutputCP(UINT a0) { _PrintEnter("SetConsoleOutputCP(%p)\n", a0); BOOL rv = 0; __try { rv = Real_SetConsoleOutputCP(a0); } __finally { _PrintExit("SetConsoleOutputCP() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetConsoleScreenBufferSize(HANDLE a0, COORD a1) { _PrintEnter("SetConsoleScreenBufferSize(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetConsoleScreenBufferSize(a0, a1); } __finally { _PrintExit("SetConsoleScreenBufferSize(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetConsoleTextAttribute(HANDLE a0, WORD a1) { _PrintEnter("SetConsoleTextAttribute(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetConsoleTextAttribute(a0, a1); } __finally { _PrintExit("SetConsoleTextAttribute(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetConsoleTitleA(LPCSTR a0) { _PrintEnter("SetConsoleTitleA(%hs)\n", a0); BOOL rv = 0; __try { rv = Real_SetConsoleTitleA(a0); } __finally { _PrintExit("SetConsoleTitleA() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetConsoleTitleW(LPCWSTR a0) { _PrintEnter("SetConsoleTitleW(%ls)\n", a0); BOOL rv = 0; __try { rv = Real_SetConsoleTitleW(a0); } __finally { _PrintExit("SetConsoleTitleW() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetConsoleWindowInfo(HANDLE a0, BOOL a1, SMALL_RECT* a2) { _PrintEnter("SetConsoleWindowInfo(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_SetConsoleWindowInfo(a0, a1, a2); } __finally { _PrintExit("SetConsoleWindowInfo(,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_SetConvertStg(LPSTORAGE a0, BOOL a1) { _PrintEnter("SetConvertStg(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_SetConvertStg(a0, a1); } __finally { _PrintExit("SetConvertStg(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetCurrentDirectoryA(LPCSTR a0) { _PrintEnter("SetCurrentDirectoryA(%hs)\n", a0); BOOL rv = 0; __try { rv = Real_SetCurrentDirectoryA(a0); } __finally { _PrintExit("SetCurrentDirectoryA() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetCurrentDirectoryW(LPCWSTR a0) { _PrintEnter("SetCurrentDirectoryW(%ls)\n", a0); BOOL rv = 0; __try { rv = Real_SetCurrentDirectoryW(a0); } __finally { _PrintExit("SetCurrentDirectoryW() -> %p\n", rv); }; return rv; } HCURSOR __stdcall Mine_SetCursor(HCURSOR a0) { _PrintEnter("SetCursor(%p)\n", a0); HCURSOR rv = 0; __try { rv = Real_SetCursor(a0); } __finally { _PrintExit("SetCursor() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetCursorPos(int a0, int a1) { _PrintEnter("SetCursorPos(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetCursorPos(a0, a1); } __finally { _PrintExit("SetCursorPos(,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_SetDIBColorTable(HDC a0, UINT a1, UINT a2, RGBQUAD* a3) { _PrintEnter("SetDIBColorTable(%p,%p,%p,%p)\n", a0, a1, a2, a3); UINT rv = 0; __try { rv = Real_SetDIBColorTable(a0, a1, a2, a3); } __finally { _PrintExit("SetDIBColorTable(,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_SetDIBits(HDC a0, HBITMAP a1, UINT a2, UINT a3, void* a4, BITMAPINFO* a5, UINT a6) { _PrintEnter("SetDIBits(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); int rv = 0; __try { rv = Real_SetDIBits(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("SetDIBits(,,,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_SetDIBitsToDevice(HDC a0, int a1, int a2, DWORD a3, DWORD a4, int a5, int a6, UINT a7, UINT a8, void* a9, BITMAPINFO* a10, UINT a11) { _PrintEnter("SetDIBitsToDevice(%p,%p,%p,%p,%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); int rv = 0; __try { rv = Real_SetDIBitsToDevice(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); } __finally { _PrintExit("SetDIBitsToDevice(,,,,,,,,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetDefaultCommConfigA(LPCSTR a0, LPCOMMCONFIG a1, DWORD a2) { _PrintEnter("SetDefaultCommConfigA(%hs,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_SetDefaultCommConfigA(a0, a1, a2); } __finally { _PrintExit("SetDefaultCommConfigA(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetDefaultCommConfigW(LPCWSTR a0, LPCOMMCONFIG a1, DWORD a2) { _PrintEnter("SetDefaultCommConfigW(%ls,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_SetDefaultCommConfigW(a0, a1, a2); } __finally { _PrintExit("SetDefaultCommConfigW(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetDeviceGammaRamp(HDC a0, LPVOID a1) { _PrintEnter("SetDeviceGammaRamp(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetDeviceGammaRamp(a0, a1); } __finally { _PrintExit("SetDeviceGammaRamp(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetDlgItemInt(HWND a0, int a1, UINT a2, BOOL a3) { _PrintEnter("SetDlgItemInt(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_SetDlgItemInt(a0, a1, a2, a3); } __finally { _PrintExit("SetDlgItemInt(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetDlgItemTextA(HWND a0, int a1, LPCSTR a2) { _PrintEnter("SetDlgItemTextA(%p,%p,%hs)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_SetDlgItemTextA(a0, a1, a2); } __finally { _PrintExit("SetDlgItemTextA(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetDlgItemTextW(HWND a0, int a1, LPCWSTR a2) { _PrintEnter("SetDlgItemTextW(%p,%p,%ls)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_SetDlgItemTextW(a0, a1, a2); } __finally { _PrintExit("SetDlgItemTextW(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetDoubleClickTime(UINT a0) { _PrintEnter("SetDoubleClickTime(%p)\n", a0); BOOL rv = 0; __try { rv = Real_SetDoubleClickTime(a0); } __finally { _PrintExit("SetDoubleClickTime() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetEndOfFile(HANDLE a0) { _PrintEnter("SetEndOfFile(%p)\n", a0); BOOL rv = 0; __try { rv = Real_SetEndOfFile(a0); } __finally { _PrintExit("SetEndOfFile() -> %p\n", rv); }; return rv; } HENHMETAFILE __stdcall Mine_SetEnhMetaFileBits(UINT a0, BYTE* a1) { _PrintEnter("SetEnhMetaFileBits(%p,%p)\n", a0, a1); HENHMETAFILE rv = 0; __try { rv = Real_SetEnhMetaFileBits(a0, a1); } __finally { _PrintExit("SetEnhMetaFileBits(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetEnvironmentVariableA(LPCSTR a0, LPCSTR a1) { _PrintEnter("SetEnvironmentVariableA(%hs,%hs)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetEnvironmentVariableA(a0, a1); } __finally { _PrintExit("SetEnvironmentVariableA(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetEnvironmentVariableW(LPCWSTR a0, LPCWSTR a1) { _PrintEnter("SetEnvironmentVariableW(%ls,%ls)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetEnvironmentVariableW(a0, a1); } __finally { _PrintExit("SetEnvironmentVariableW(,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_SetErrorMode(UINT a0) { _PrintEnter("SetErrorMode(%p)\n", a0); UINT rv = 0; __try { rv = Real_SetErrorMode(a0); } __finally { _PrintExit("SetErrorMode() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetEvent(HANDLE a0) { _PrintEnter("SetEvent(%p)\n", a0); BOOL rv = 0; __try { rv = Real_SetEvent(a0); } __finally { _PrintExit("SetEvent() -> %p\n", rv); }; return rv; } void __stdcall Mine_SetFileApisToANSI(void) { _PrintEnter("SetFileApisToANSI()\n"); __try { Real_SetFileApisToANSI(); } __finally { _PrintExit("SetFileApisToANSI() ->\n"); }; } void __stdcall Mine_SetFileApisToOEM(void) { _PrintEnter("SetFileApisToOEM()\n"); __try { Real_SetFileApisToOEM(); } __finally { _PrintExit("SetFileApisToOEM() ->\n"); }; } BOOL __stdcall Mine_SetFileAttributesA(LPCSTR a0, DWORD a1) { _PrintEnter("SetFileAttributesA(%hs,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetFileAttributesA(a0, a1); } __finally { _PrintExit("SetFileAttributesA(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetFileAttributesW(LPCWSTR a0, DWORD a1) { _PrintEnter("SetFileAttributesW(%ls,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetFileAttributesW(a0, a1); } __finally { _PrintExit("SetFileAttributesW(,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_SetFilePointer(HANDLE a0, LONG a1, PLONG a2, DWORD a3) { _PrintEnter("SetFilePointer(%p,%p,%p,%p)\n", a0, a1, a2, a3); DWORD rv = 0; __try { rv = Real_SetFilePointer(a0, a1, a2, a3); } __finally { _PrintExit("SetFilePointer(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetFileTime(HANDLE a0, FILETIME* a1, FILETIME* a2, FILETIME* a3) { _PrintEnter("SetFileTime(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_SetFileTime(a0, a1, a2, a3); } __finally { _PrintExit("SetFileTime(,,,) -> %p\n", rv); }; return rv; } HWND __stdcall Mine_SetFocus(HWND a0) { _PrintEnter("SetFocus(%p)\n", a0); HWND rv = 0; __try { rv = Real_SetFocus(a0); } __finally { _PrintExit("SetFocus() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetForegroundWindow(HWND a0) { _PrintEnter("SetForegroundWindow(%p)\n", a0); BOOL rv = 0; __try { rv = Real_SetForegroundWindow(a0); } __finally { _PrintExit("SetForegroundWindow() -> %p\n", rv); }; return rv; } int __stdcall Mine_SetGraphicsMode(HDC a0, int a1) { _PrintEnter("SetGraphicsMode(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real_SetGraphicsMode(a0, a1); } __finally { _PrintExit("SetGraphicsMode(,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_SetHandleCount(UINT a0) { _PrintEnter("SetHandleCount(%p)\n", a0); UINT rv = 0; __try { rv = Real_SetHandleCount(a0); } __finally { _PrintExit("SetHandleCount() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetHandleInformation(HANDLE a0, DWORD a1, DWORD a2) { _PrintEnter("SetHandleInformation(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_SetHandleInformation(a0, a1, a2); } __finally { _PrintExit("SetHandleInformation(,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_SetICMMode(HDC a0, int a1) { _PrintEnter("SetICMMode(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real_SetICMMode(a0, a1); } __finally { _PrintExit("SetICMMode(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetICMProfileA(HDC a0, LPSTR a1) { _PrintEnter("SetICMProfileA(%p,%hs)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetICMProfileA(a0, a1); } __finally { _PrintExit("SetICMProfileA(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetICMProfileW(HDC a0, LPWSTR a1) { _PrintEnter("SetICMProfileW(%p,%ls)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetICMProfileW(a0, a1); } __finally { _PrintExit("SetICMProfileW(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetKeyboardState(LPBYTE a0) { _PrintEnter("SetKeyboardState(%p)\n", a0); BOOL rv = 0; __try { rv = Real_SetKeyboardState(a0); } __finally { _PrintExit("SetKeyboardState() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetLocalTime(SYSTEMTIME* a0) { _PrintEnter("SetLocalTime(%p)\n", a0); BOOL rv = 0; __try { rv = Real_SetLocalTime(a0); } __finally { _PrintExit("SetLocalTime() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetLocaleInfoA(LCID a0, LCTYPE a1, LPCSTR a2) { _PrintEnter("SetLocaleInfoA(%p,%p,%hs)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_SetLocaleInfoA(a0, a1, a2); } __finally { _PrintExit("SetLocaleInfoA(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetLocaleInfoW(LCID a0, LCTYPE a1, LPCWSTR a2) { _PrintEnter("SetLocaleInfoW(%p,%p,%ls)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_SetLocaleInfoW(a0, a1, a2); } __finally { _PrintExit("SetLocaleInfoW(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetMailslotInfo(HANDLE a0, DWORD a1) { _PrintEnter("SetMailslotInfo(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetMailslotInfo(a0, a1); } __finally { _PrintExit("SetMailslotInfo(,) -> %p\n", rv); }; return rv; } int __stdcall Mine_SetMapMode(HDC a0, int a1) { _PrintEnter("SetMapMode(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real_SetMapMode(a0, a1); } __finally { _PrintExit("SetMapMode(,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_SetMapperFlags(HDC a0, DWORD a1) { _PrintEnter("SetMapperFlags(%p,%p)\n", a0, a1); DWORD rv = 0; __try { rv = Real_SetMapperFlags(a0, a1); } __finally { _PrintExit("SetMapperFlags(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetMenu(HWND a0, HMENU a1) { _PrintEnter("SetMenu(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetMenu(a0, a1); } __finally { _PrintExit("SetMenu(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetMenuContextHelpId(HMENU a0, DWORD a1) { _PrintEnter("SetMenuContextHelpId(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetMenuContextHelpId(a0, a1); } __finally { _PrintExit("SetMenuContextHelpId(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetMenuDefaultItem(HMENU a0, UINT a1, UINT a2) { _PrintEnter("SetMenuDefaultItem(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_SetMenuDefaultItem(a0, a1, a2); } __finally { _PrintExit("SetMenuDefaultItem(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetMenuItemBitmaps(HMENU a0, UINT a1, UINT a2, HBITMAP a3, HBITMAP a4) { _PrintEnter("SetMenuItemBitmaps(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_SetMenuItemBitmaps(a0, a1, a2, a3, a4); } __finally { _PrintExit("SetMenuItemBitmaps(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetMenuItemInfoA(HMENU a0, UINT a1, BOOL a2, MENUITEMINFOA* a3) { _PrintEnter("SetMenuItemInfoA(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_SetMenuItemInfoA(a0, a1, a2, a3); } __finally { _PrintExit("SetMenuItemInfoA(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetMenuItemInfoW(HMENU a0, UINT a1, BOOL a2, MENUITEMINFOW* a3) { _PrintEnter("SetMenuItemInfoW(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_SetMenuItemInfoW(a0, a1, a2, a3); } __finally { _PrintExit("SetMenuItemInfoW(,,,) -> %p\n", rv); }; return rv; } LPARAM __stdcall Mine_SetMessageExtraInfo(LPARAM a0) { _PrintEnter("SetMessageExtraInfo(%p)\n", a0); LPARAM rv = 0; __try { rv = Real_SetMessageExtraInfo(a0); } __finally { _PrintExit("SetMessageExtraInfo() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetMessageQueue(int a0) { _PrintEnter("SetMessageQueue(%p)\n", a0); BOOL rv = 0; __try { rv = Real_SetMessageQueue(a0); } __finally { _PrintExit("SetMessageQueue() -> %p\n", rv); }; return rv; } HMETAFILE __stdcall Mine_SetMetaFileBitsEx(UINT a0, BYTE* a1) { _PrintEnter("SetMetaFileBitsEx(%p,%p)\n", a0, a1); HMETAFILE rv = 0; __try { rv = Real_SetMetaFileBitsEx(a0, a1); } __finally { _PrintExit("SetMetaFileBitsEx(,) -> %p\n", rv); }; return rv; } int __stdcall Mine_SetMetaRgn(HDC a0) { _PrintEnter("SetMetaRgn(%p)\n", a0); int rv = 0; __try { rv = Real_SetMetaRgn(a0); } __finally { _PrintExit("SetMetaRgn() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetMiterLimit(HDC a0, FLOAT a1, PFLOAT a2) { _PrintEnter("SetMiterLimit(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_SetMiterLimit(a0, a1, a2); } __finally { _PrintExit("SetMiterLimit(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetNamedPipeHandleState(HANDLE a0, LPDWORD a1, LPDWORD a2, LPDWORD a3) { _PrintEnter("SetNamedPipeHandleState(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_SetNamedPipeHandleState(a0, a1, a2, a3); } __finally { _PrintExit("SetNamedPipeHandleState(,,,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_SetPaletteEntries(HPALETTE a0, UINT a1, UINT a2, PALETTEENTRY* a3) { _PrintEnter("SetPaletteEntries(%p,%p,%p,%p)\n", a0, a1, a2, a3); UINT rv = 0; __try { rv = Real_SetPaletteEntries(a0, a1, a2, a3); } __finally { _PrintExit("SetPaletteEntries(,,,) -> %p\n", rv); }; return rv; } HWND __stdcall Mine_SetParent(HWND a0, HWND a1) { _PrintEnter("SetParent(%p,%p)\n", a0, a1); HWND rv = 0; __try { rv = Real_SetParent(a0, a1); } __finally { _PrintExit("SetParent(,) -> %p\n", rv); }; return rv; } COLORREF __stdcall Mine_SetPixel(HDC a0, int a1, int a2, COLORREF a3) { _PrintEnter("SetPixel(%p,%p,%p,%p)\n", a0, a1, a2, a3); COLORREF rv = 0; __try { rv = Real_SetPixel(a0, a1, a2, a3); } __finally { _PrintExit("SetPixel(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetPixelFormat(HDC a0, int a1, PIXELFORMATDESCRIPTOR* a2) { _PrintEnter("SetPixelFormat(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_SetPixelFormat(a0, a1, a2); } __finally { _PrintExit("SetPixelFormat(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetPixelV(HDC a0, int a1, int a2, COLORREF a3) { _PrintEnter("SetPixelV(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_SetPixelV(a0, a1, a2, a3); } __finally { _PrintExit("SetPixelV(,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_SetPolyFillMode(HDC a0, int a1) { _PrintEnter("SetPolyFillMode(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real_SetPolyFillMode(a0, a1); } __finally { _PrintExit("SetPolyFillMode(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetPriorityClass(HANDLE a0, DWORD a1) { _PrintEnter("SetPriorityClass(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetPriorityClass(a0, a1); } __finally { _PrintExit("SetPriorityClass(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetProcessAffinityMask(HANDLE a0, DWORD_PTR a1) { _PrintEnter("SetProcessAffinityMask(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetProcessAffinityMask(a0, a1); } __finally { _PrintExit("SetProcessAffinityMask(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetProcessShutdownParameters(DWORD a0, DWORD a1) { _PrintEnter("SetProcessShutdownParameters(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetProcessShutdownParameters(a0, a1); } __finally { _PrintExit("SetProcessShutdownParameters(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetProcessWindowStation(HWINSTA a0) { _PrintEnter("SetProcessWindowStation(%p)\n", a0); BOOL rv = 0; __try { rv = Real_SetProcessWindowStation(a0); } __finally { _PrintExit("SetProcessWindowStation() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetProcessWorkingSetSize(HANDLE a0, SIZE_T a1, SIZE_T a2) { _PrintEnter("SetProcessWorkingSetSize(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_SetProcessWorkingSetSize(a0, a1, a2); } __finally { _PrintExit("SetProcessWorkingSetSize(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetPropA(HWND a0, LPCSTR a1, HANDLE a2) { _PrintEnter("SetPropA(%p,%hs,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_SetPropA(a0, a1, a2); } __finally { _PrintExit("SetPropA(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetPropW(HWND a0, LPCWSTR a1, HANDLE a2) { _PrintEnter("SetPropW(%p,%ls,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_SetPropW(a0, a1, a2); } __finally { _PrintExit("SetPropW(,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_SetROP2(HDC a0, int a1) { _PrintEnter("SetROP2(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real_SetROP2(a0, a1); } __finally { _PrintExit("SetROP2(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetRect(LPRECT a0, int a1, int a2, int a3, int a4) { _PrintEnter("SetRect(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_SetRect(a0, a1, a2, a3, a4); } __finally { _PrintExit("SetRect(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetRectEmpty(LPRECT a0) { _PrintEnter("SetRectEmpty(%p)\n", a0); BOOL rv = 0; __try { rv = Real_SetRectEmpty(a0); } __finally { _PrintExit("SetRectEmpty() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetRectRgn(HRGN a0, int a1, int a2, int a3, int a4) { _PrintEnter("SetRectRgn(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_SetRectRgn(a0, a1, a2, a3, a4); } __finally { _PrintExit("SetRectRgn(,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_SetScrollInfo(HWND a0, int a1, LPCSCROLLINFO a2, BOOL a3) { _PrintEnter("SetScrollInfo(%p,%p,%p,%p)\n", a0, a1, a2, a3); int rv = 0; __try { rv = Real_SetScrollInfo(a0, a1, a2, a3); } __finally { _PrintExit("SetScrollInfo(,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_SetScrollPos(HWND a0, int a1, int a2, BOOL a3) { _PrintEnter("SetScrollPos(%p,%p,%p,%p)\n", a0, a1, a2, a3); int rv = 0; __try { rv = Real_SetScrollPos(a0, a1, a2, a3); } __finally { _PrintExit("SetScrollPos(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetScrollRange(HWND a0, int a1, int a2, int a3, BOOL a4) { _PrintEnter("SetScrollRange(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_SetScrollRange(a0, a1, a2, a3, a4); } __finally { _PrintExit("SetScrollRange(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetStdHandle(DWORD a0, HANDLE a1) { _PrintEnter("SetStdHandle(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetStdHandle(a0, a1); } __finally { _PrintExit("SetStdHandle(,) -> %p\n", rv); }; return rv; } int __stdcall Mine_SetStretchBltMode(HDC a0, int a1) { _PrintEnter("SetStretchBltMode(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real_SetStretchBltMode(a0, a1); } __finally { _PrintExit("SetStretchBltMode(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetSysColors(int a0, INT* a1, COLORREF* a2) { _PrintEnter("SetSysColors(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_SetSysColors(a0, a1, a2); } __finally { _PrintExit("SetSysColors(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetSystemCursor(HCURSOR a0, DWORD a1) { _PrintEnter("SetSystemCursor(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetSystemCursor(a0, a1); } __finally { _PrintExit("SetSystemCursor(,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_SetSystemPaletteUse(HDC a0, UINT a1) { _PrintEnter("SetSystemPaletteUse(%p,%p)\n", a0, a1); UINT rv = 0; __try { rv = Real_SetSystemPaletteUse(a0, a1); } __finally { _PrintExit("SetSystemPaletteUse(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetSystemPowerState(BOOL a0, BOOL a1) { _PrintEnter("SetSystemPowerState(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetSystemPowerState(a0, a1); } __finally { _PrintExit("SetSystemPowerState(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetSystemTime(SYSTEMTIME* a0) { _PrintEnter("SetSystemTime(%p)\n", a0); BOOL rv = 0; __try { rv = Real_SetSystemTime(a0); } __finally { _PrintExit("SetSystemTime() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetSystemTimeAdjustment(DWORD a0, BOOL a1) { _PrintEnter("SetSystemTimeAdjustment(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetSystemTimeAdjustment(a0, a1); } __finally { _PrintExit("SetSystemTimeAdjustment(,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_SetTapeParameters(HANDLE a0, DWORD a1, LPVOID a2) { _PrintEnter("SetTapeParameters(%p,%p,%p)\n", a0, a1, a2); DWORD rv = 0; __try { rv = Real_SetTapeParameters(a0, a1, a2); } __finally { _PrintExit("SetTapeParameters(,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_SetTapePosition(HANDLE a0, DWORD a1, DWORD a2, DWORD a3, DWORD a4, BOOL a5) { _PrintEnter("SetTapePosition(%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); DWORD rv = 0; __try { rv = Real_SetTapePosition(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("SetTapePosition(,,,,,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine_SetTextAlign(HDC a0, UINT a1) { _PrintEnter("SetTextAlign(%p,%p)\n", a0, a1); UINT rv = 0; __try { rv = Real_SetTextAlign(a0, a1); } __finally { _PrintExit("SetTextAlign(,) -> %p\n", rv); }; return rv; } int __stdcall Mine_SetTextCharacterExtra(HDC a0, int a1) { _PrintEnter("SetTextCharacterExtra(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real_SetTextCharacterExtra(a0, a1); } __finally { _PrintExit("SetTextCharacterExtra(,) -> %p\n", rv); }; return rv; } COLORREF __stdcall Mine_SetTextColor(HDC a0, COLORREF a1) { _PrintEnter("SetTextColor(%p,%p)\n", a0, a1); COLORREF rv = 0; __try { rv = Real_SetTextColor(a0, a1); } __finally { _PrintExit("SetTextColor(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetTextJustification(HDC a0, int a1, int a2) { _PrintEnter("SetTextJustification(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_SetTextJustification(a0, a1, a2); } __finally { _PrintExit("SetTextJustification(,,) -> %p\n", rv); }; return rv; } DWORD_PTR __stdcall Mine_SetThreadAffinityMask(HANDLE a0, DWORD_PTR a1) { _PrintEnter("SetThreadAffinityMask(%p,%p)\n", a0, a1); DWORD_PTR rv = 0; __try { rv = Real_SetThreadAffinityMask(a0, a1); } __finally { _PrintExit("SetThreadAffinityMask(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetThreadContext(HANDLE a0, CONTEXT* a1) { _PrintEnter("SetThreadContext(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetThreadContext(a0, a1); } __finally { _PrintExit("SetThreadContext(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetThreadDesktop(HDESK a0) { _PrintEnter("SetThreadDesktop(%p)\n", a0); BOOL rv = 0; __try { rv = Real_SetThreadDesktop(a0); } __finally { _PrintExit("SetThreadDesktop() -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_SetThreadIdealProcessor(HANDLE a0, DWORD a1) { _PrintEnter("SetThreadIdealProcessor(%p,%p)\n", a0, a1); DWORD rv = 0; __try { rv = Real_SetThreadIdealProcessor(a0, a1); } __finally { _PrintExit("SetThreadIdealProcessor(,) -> %p\n", rv); }; return rv; } #if(WINVER >= 0x0500) BOOL __stdcall Mine_SetThreadLocale(LCID a0) { _PrintEnter("SetThreadLocale(%p)\n", a0); BOOL rv = 0; __try { rv = Real_SetThreadLocale(a0); } __finally { _PrintExit("SetThreadLocale() -> %p\n", rv); }; return rv; } #endif // (WINVER >= 0x0500) BOOL __stdcall Mine_SetThreadPriority(HANDLE a0, int a1) { _PrintEnter("SetThreadPriority(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetThreadPriority(a0, a1); } __finally { _PrintExit("SetThreadPriority(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetThreadPriorityBoost(HANDLE a0, BOOL a1) { _PrintEnter("SetThreadPriorityBoost(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetThreadPriorityBoost(a0, a1); } __finally { _PrintExit("SetThreadPriorityBoost(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetTimeZoneInformation(TIME_ZONE_INFORMATION* a0) { _PrintEnter("SetTimeZoneInformation(%p)\n", a0); BOOL rv = 0; __try { rv = Real_SetTimeZoneInformation(a0); } __finally { _PrintExit("SetTimeZoneInformation() -> %p\n", rv); }; return rv; } UINT_PTR __stdcall Mine_SetTimer(HWND a0, UINT_PTR a1, UINT a2, TIMERPROC a3) { _PrintEnter("SetTimer(%p,%p,%p,%p)\n", a0, a1, a2, a3); UINT_PTR rv = 0; __try { rv = Real_SetTimer(a0, a1, a2, a3); } __finally { _PrintExit("SetTimer(,,,) -> %p\n", rv); }; return rv; } LPTOP_LEVEL_EXCEPTION_FILTER __stdcall Mine_SetUnhandledExceptionFilter(LPTOP_LEVEL_EXCEPTION_FILTER a0) { _PrintEnter("SetUnhandledExceptionFilter(%p)\n", a0); LPTOP_LEVEL_EXCEPTION_FILTER rv = 0; __try { rv = Real_SetUnhandledExceptionFilter(a0); } __finally { _PrintExit("SetUnhandledExceptionFilter() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetUserObjectInformationA(HANDLE a0, int a1, PVOID a2, DWORD a3) { _PrintEnter("SetUserObjectInformationA(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_SetUserObjectInformationA(a0, a1, a2, a3); } __finally { _PrintExit("SetUserObjectInformationA(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetUserObjectInformationW(HANDLE a0, int a1, PVOID a2, DWORD a3) { _PrintEnter("SetUserObjectInformationW(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_SetUserObjectInformationW(a0, a1, a2, a3); } __finally { _PrintExit("SetUserObjectInformationW(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetUserObjectSecurity(HANDLE a0, PSECURITY_INFORMATION a1, PSECURITY_DESCRIPTOR a2) { _PrintEnter("SetUserObjectSecurity(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_SetUserObjectSecurity(a0, a1, a2); } __finally { _PrintExit("SetUserObjectSecurity(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetViewportExtEx(HDC a0, int a1, int a2, SIZE* a3) { _PrintEnter("SetViewportExtEx(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_SetViewportExtEx(a0, a1, a2, a3); } __finally { _PrintExit("SetViewportExtEx(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetViewportOrgEx(HDC a0, int a1, int a2, POINT* a3) { _PrintEnter("SetViewportOrgEx(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_SetViewportOrgEx(a0, a1, a2, a3); } __finally { _PrintExit("SetViewportOrgEx(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetVolumeLabelA(LPCSTR a0, LPCSTR a1) { _PrintEnter("SetVolumeLabelA(%hs,%hs)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetVolumeLabelA(a0, a1); } __finally { _PrintExit("SetVolumeLabelA(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetVolumeLabelW(LPCWSTR a0, LPCWSTR a1) { _PrintEnter("SetVolumeLabelW(%ls,%ls)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetVolumeLabelW(a0, a1); } __finally { _PrintExit("SetVolumeLabelW(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetWaitableTimer(HANDLE a0, LARGE_INTEGER* a1, LONG a2, PTIMERAPCROUTINE a3, LPVOID a4, BOOL a5) { _PrintEnter("SetWaitableTimer(%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); BOOL rv = 0; __try { rv = Real_SetWaitableTimer(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("SetWaitableTimer(,,,,,) -> %p\n", rv); }; return rv; } HENHMETAFILE __stdcall Mine_SetWinMetaFileBits(UINT a0, BYTE* a1, HDC a2, METAFILEPICT* a3) { _PrintEnter("SetWinMetaFileBits(%p,%p,%p,%p)\n", a0, a1, a2, a3); HENHMETAFILE rv = 0; __try { rv = Real_SetWinMetaFileBits(a0, a1, a2, a3); } __finally { _PrintExit("SetWinMetaFileBits(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetWindowContextHelpId(HWND a0, DWORD a1) { _PrintEnter("SetWindowContextHelpId(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetWindowContextHelpId(a0, a1); } __finally { _PrintExit("SetWindowContextHelpId(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetWindowExtEx(HDC a0, int a1, int a2, SIZE* a3) { _PrintEnter("SetWindowExtEx(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_SetWindowExtEx(a0, a1, a2, a3); } __finally { _PrintExit("SetWindowExtEx(,,,) -> %p\n", rv); }; return rv; } LONG __stdcall Mine_SetWindowLongA(HWND a0, int a1, LONG a2) { _PrintEnter("SetWindowLongA(%p,%p,%p)\n", a0, a1, a2); LONG rv = 0; __try { rv = Real_SetWindowLongA(a0, a1, a2); } __finally { _PrintExit("SetWindowLongA(,,) -> %p\n", rv); }; return rv; } LONG __stdcall Mine_SetWindowLongW(HWND a0, int a1, LONG a2) { _PrintEnter("SetWindowLongW(%p,%p,%p)\n", a0, a1, a2); LONG rv = 0; __try { rv = Real_SetWindowLongW(a0, a1, a2); } __finally { _PrintExit("SetWindowLongW(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetWindowOrgEx(HDC a0, int a1, int a2, POINT* a3) { _PrintEnter("SetWindowOrgEx(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_SetWindowOrgEx(a0, a1, a2, a3); } __finally { _PrintExit("SetWindowOrgEx(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetWindowPlacement(HWND a0, WINDOWPLACEMENT* a1) { _PrintEnter("SetWindowPlacement(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetWindowPlacement(a0, a1); } __finally { _PrintExit("SetWindowPlacement(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetWindowPos(HWND a0, HWND a1, int a2, int a3, int a4, int a5, UINT a6) { _PrintEnter("SetWindowPos(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); BOOL rv = 0; __try { rv = Real_SetWindowPos(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("SetWindowPos(,,,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_SetWindowRgn(HWND a0, HRGN a1, BOOL a2) { _PrintEnter("SetWindowRgn(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_SetWindowRgn(a0, a1, a2); } __finally { _PrintExit("SetWindowRgn(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetWindowTextA(HWND a0, LPCSTR a1) { _PrintEnter("SetWindowTextA(%p,%hs)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetWindowTextA(a0, a1); } __finally { _PrintExit("SetWindowTextA(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetWindowTextW(HWND a0, LPCWSTR a1) { _PrintEnter("SetWindowTextW(%p,%ls)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetWindowTextW(a0, a1); } __finally { _PrintExit("SetWindowTextW(,) -> %p\n", rv); }; return rv; } WORD __stdcall Mine_SetWindowWord(HWND a0, int a1, WORD a2) { _PrintEnter("SetWindowWord(%p,%p,%p)\n", a0, a1, a2); WORD rv = 0; __try { rv = Real_SetWindowWord(a0, a1, a2); } __finally { _PrintExit("SetWindowWord(,,) -> %p\n", rv); }; return rv; } HHOOK __stdcall Mine_SetWindowsHookA(int a0, HOOKPROC a1) { _PrintEnter("SetWindowsHookA(%p,%p)\n", a0, a1); HHOOK rv = 0; __try { rv = Real_SetWindowsHookA(a0, a1); } __finally { _PrintExit("SetWindowsHookA(,) -> %p\n", rv); }; return rv; } HHOOK __stdcall Mine_SetWindowsHookExA(int a0, HOOKPROC a1, HINSTANCE a2, DWORD a3) { _PrintEnter("SetWindowsHookExA(%p,%p,%p,%p)\n", a0, a1, a2, a3); HHOOK rv = 0; __try { rv = Real_SetWindowsHookExA(a0, a1, a2, a3); } __finally { _PrintExit("SetWindowsHookExA(,,,) -> %p\n", rv); }; return rv; } HHOOK __stdcall Mine_SetWindowsHookExW(int a0, HOOKPROC a1, HINSTANCE a2, DWORD a3) { _PrintEnter("SetWindowsHookExW(%p,%p,%p,%p)\n", a0, a1, a2, a3); HHOOK rv = 0; __try { rv = Real_SetWindowsHookExW(a0, a1, a2, a3); } __finally { _PrintExit("SetWindowsHookExW(,,,) -> %p\n", rv); }; return rv; } HHOOK __stdcall Mine_SetWindowsHookW(int a0, HOOKPROC a1) { _PrintEnter("SetWindowsHookW(%p,%p)\n", a0, a1); HHOOK rv = 0; __try { rv = Real_SetWindowsHookW(a0, a1); } __finally { _PrintExit("SetWindowsHookW(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetWorldTransform(HDC a0, XFORM* a1) { _PrintEnter("SetWorldTransform(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetWorldTransform(a0, a1); } __finally { _PrintExit("SetWorldTransform(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SetupComm(HANDLE a0, DWORD a1, DWORD a2) { _PrintEnter("SetupComm(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_SetupComm(a0, a1, a2); } __finally { _PrintExit("SetupComm(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ShowCaret(HWND a0) { _PrintEnter("ShowCaret(%p)\n", a0); BOOL rv = 0; __try { rv = Real_ShowCaret(a0); } __finally { _PrintExit("ShowCaret() -> %p\n", rv); }; return rv; } int __stdcall Mine_ShowCursor(BOOL a0) { _PrintEnter("ShowCursor(%p)\n", a0); int rv = 0; __try { rv = Real_ShowCursor(a0); } __finally { _PrintExit("ShowCursor() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ShowOwnedPopups(HWND a0, BOOL a1) { _PrintEnter("ShowOwnedPopups(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_ShowOwnedPopups(a0, a1); } __finally { _PrintExit("ShowOwnedPopups(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ShowScrollBar(HWND a0, int a1, BOOL a2) { _PrintEnter("ShowScrollBar(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_ShowScrollBar(a0, a1, a2); } __finally { _PrintExit("ShowScrollBar(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ShowWindow(HWND a0, int a1) { _PrintEnter("ShowWindow(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_ShowWindow(a0, a1); } __finally { _PrintExit("ShowWindow(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ShowWindowAsync(HWND a0, int a1) { _PrintEnter("ShowWindowAsync(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_ShowWindowAsync(a0, a1); } __finally { _PrintExit("ShowWindowAsync(,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_SignalObjectAndWait(HANDLE a0, HANDLE a1, DWORD a2, BOOL a3) { _PrintEnter("SignalObjectAndWait(%p,%p,%p,%p)\n", a0, a1, a2, a3); DWORD rv = 0; __try { rv = Real_SignalObjectAndWait(a0, a1, a2, a3); } __finally { _PrintExit("SignalObjectAndWait(,,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_SizeofResource(HMODULE a0, HRSRC a1) { _PrintEnter("SizeofResource(%p,%p)\n", a0, a1); DWORD rv = 0; __try { rv = Real_SizeofResource(a0, a1); } __finally { _PrintExit("SizeofResource(,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_SleepEx(DWORD a0, BOOL a1) { _PrintEnter("SleepEx(%p,%p)\n", a0, a1); DWORD rv = 0; __try { rv = Real_SleepEx(a0, a1); } __finally { _PrintExit("SleepEx(,) -> %p\n", rv); }; return rv; } int __stdcall Mine_StartDocA(HDC a0, DOCINFOA* a1) { _PrintEnter("StartDocA(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real_StartDocA(a0, a1); } __finally { _PrintExit("StartDocA(,) -> %p\n", rv); }; return rv; } int __stdcall Mine_StartDocW(HDC a0, DOCINFOW* a1) { _PrintEnter("StartDocW(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real_StartDocW(a0, a1); } __finally { _PrintExit("StartDocW(,) -> %p\n", rv); }; return rv; } int __stdcall Mine_StartPage(HDC a0) { _PrintEnter("StartPage(%p)\n", a0); int rv = 0; __try { rv = Real_StartPage(a0); } __finally { _PrintExit("StartPage() -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_StgCreateDocfile(OLECHAR* a0, DWORD a1, DWORD a2, IStorage** a3) { _PrintEnter("StgCreateDocfile(%p,%p,%p,%p)\n", a0, a1, a2, a3); HRESULT rv = 0; __try { rv = Real_StgCreateDocfile(a0, a1, a2, a3); } __finally { _PrintExit("StgCreateDocfile(,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_StgCreateDocfileOnILockBytes(ILockBytes* a0, DWORD a1, DWORD a2, IStorage** a3) { _PrintEnter("StgCreateDocfileOnILockBytes(%p,%p,%p,%p)\n", a0, a1, a2, a3); HRESULT rv = 0; __try { rv = Real_StgCreateDocfileOnILockBytes(a0, a1, a2, a3); } __finally { _PrintExit("StgCreateDocfileOnILockBytes(,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_StgCreatePropSetStg(IStorage* a0, DWORD a1, IPropertySetStorage** a2) { _PrintEnter("StgCreatePropSetStg(%p,%p,%p)\n", a0, a1, a2); HRESULT rv = 0; __try { rv = Real_StgCreatePropSetStg(a0, a1, a2); } __finally { _PrintExit("StgCreatePropSetStg(,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_StgCreatePropStg(IUnknown* a0, CONST IID& a1, CLSID* a2, DWORD a3, DWORD a4, IPropertyStorage** a5) { _PrintEnter("StgCreatePropStg(%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); HRESULT rv = 0; __try { rv = Real_StgCreatePropStg(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("StgCreatePropStg(,,,,,) -> %p\n", rv); }; return rv; } #if _MSC_VER < 1300 HRESULT __stdcall Mine_StgCreateStorageEx(WCHAR* a0, DWORD a1, DWORD a2, DWORD a3, void* a4, void* a5, CONST IID& a6, void** a7) #else HRESULT __stdcall Mine_StgCreateStorageEx(WCHAR* a0, DWORD a1, DWORD a2, DWORD a3, STGOPTIONS* a4, void* a5, CONST IID& a6, void** a7) #endif { _PrintEnter("StgCreateStorageEx(%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7); HRESULT rv = 0; __try { rv = Real_StgCreateStorageEx(a0, a1, a2, a3, a4, a5, a6, a7); } __finally { _PrintExit("StgCreateStorageEx(,,,,,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_StgGetIFillLockBytesOnFile(OLECHAR* a0, IFillLockBytes** a1) { _PrintEnter("StgGetIFillLockBytesOnFile(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_StgGetIFillLockBytesOnFile(a0, a1); } __finally { _PrintExit("StgGetIFillLockBytesOnFile(,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_StgGetIFillLockBytesOnILockBytes(ILockBytes* a0, IFillLockBytes** a1) { _PrintEnter("StgGetIFillLockBytesOnILockBytes(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_StgGetIFillLockBytesOnILockBytes(a0, a1); } __finally { _PrintExit("StgGetIFillLockBytesOnILockBytes(,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_StgIsStorageFile(OLECHAR* a0) { _PrintEnter("StgIsStorageFile(%p)\n", a0); HRESULT rv = 0; __try { rv = Real_StgIsStorageFile(a0); } __finally { _PrintExit("StgIsStorageFile() -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_StgIsStorageILockBytes(ILockBytes* a0) { _PrintEnter("StgIsStorageILockBytes(%p)\n", a0); HRESULT rv = 0; __try { rv = Real_StgIsStorageILockBytes(a0); } __finally { _PrintExit("StgIsStorageILockBytes() -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_StgOpenAsyncDocfileOnIFillLockBytes(IFillLockBytes* a0, DWORD a1, DWORD a2, IStorage** a3) { _PrintEnter("StgOpenAsyncDocfileOnIFillLockBytes(%p,%p,%p,%p)\n", a0, a1, a2, a3); HRESULT rv = 0; __try { rv = Real_StgOpenAsyncDocfileOnIFillLockBytes(a0, a1, a2, a3); } __finally { _PrintExit("StgOpenAsyncDocfileOnIFillLockBytes(,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_StgOpenPropStg(IUnknown* a0, CONST IID& a1, DWORD a2, DWORD a3, IPropertyStorage** a4) { _PrintEnter("StgOpenPropStg(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); HRESULT rv = 0; __try { rv = Real_StgOpenPropStg(a0, a1, a2, a3, a4); } __finally { _PrintExit("StgOpenPropStg(,,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_StgOpenStorage(OLECHAR* a0, IStorage* a1, DWORD a2, SNB a3, DWORD a4, IStorage** a5) { _PrintEnter("StgOpenStorage(%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); HRESULT rv = 0; __try { rv = Real_StgOpenStorage(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("StgOpenStorage(,,,,,) -> %p\n", rv); }; return rv; } #if _MSC_VER < 1300 HRESULT __stdcall Mine_StgOpenStorageEx(WCHAR* a0, DWORD a1, DWORD a2, DWORD a3, void* a4, void* a5, CONST IID& a6, void** a7) #else HRESULT __stdcall Mine_StgOpenStorageEx(WCHAR* a0, DWORD a1, DWORD a2, DWORD a3, STGOPTIONS* a4, void* a5, CONST IID& a6, void** a7) #endif { _PrintEnter("StgOpenStorageEx(%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7); HRESULT rv = 0; __try { rv = Real_StgOpenStorageEx(a0, a1, a2, a3, a4, a5, a6, a7); } __finally { _PrintExit("StgOpenStorageEx(,,,,,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_StgOpenStorageOnILockBytes(ILockBytes* a0, IStorage* a1, DWORD a2, SNB a3, DWORD a4, IStorage** a5) { _PrintEnter("StgOpenStorageOnILockBytes(%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); HRESULT rv = 0; __try { rv = Real_StgOpenStorageOnILockBytes(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("StgOpenStorageOnILockBytes(,,,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_StgSetTimes(OLECHAR* a0, FILETIME* a1, FILETIME* a2, FILETIME* a3) { _PrintEnter("StgSetTimes(%p,%p,%p,%p)\n", a0, a1, a2, a3); HRESULT rv = 0; __try { rv = Real_StgSetTimes(a0, a1, a2, a3); } __finally { _PrintExit("StgSetTimes(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_StretchBlt(HDC a0, int a1, int a2, int a3, int a4, HDC a5, int a6, int a7, int a8, int a9, DWORD a10) { _PrintEnter("StretchBlt(%p,%p,%p,%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); BOOL rv = 0; __try { rv = Real_StretchBlt(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); } __finally { _PrintExit("StretchBlt(,,,,,,,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_StretchDIBits(HDC a0, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, void* a9, BITMAPINFO* a10, UINT a11, DWORD a12) { _PrintEnter("StretchDIBits(%p,%p,%p,%p,%p,%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); int rv = 0; __try { rv = Real_StretchDIBits(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); } __finally { _PrintExit("StretchDIBits(,,,,,,,,,,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_StringFromCLSID(CONST IID& a0, LPOLESTR* a1) { _PrintEnter("StringFromCLSID(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_StringFromCLSID(a0, a1); } __finally { _PrintExit("StringFromCLSID(,) -> %p\n", rv); }; return rv; } int __stdcall Mine_StringFromGUID2(CONST GUID& a0, LPOLESTR a1, int a2) { _PrintEnter("StringFromGUID2(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_StringFromGUID2(a0, a1, a2); } __finally { _PrintExit("StringFromGUID2(,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_StringFromIID(CONST IID& a0, LPOLESTR* a1) { _PrintEnter("StringFromIID(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_StringFromIID(a0, a1); } __finally { _PrintExit("StringFromIID(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_StrokeAndFillPath(HDC a0) { _PrintEnter("StrokeAndFillPath(%p)\n", a0); BOOL rv = 0; __try { rv = Real_StrokeAndFillPath(a0); } __finally { _PrintExit("StrokeAndFillPath() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_StrokePath(HDC a0) { _PrintEnter("StrokePath(%p)\n", a0); BOOL rv = 0; __try { rv = Real_StrokePath(a0); } __finally { _PrintExit("StrokePath() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SubtractRect(LPRECT a0, RECT* a1, RECT* a2) { _PrintEnter("SubtractRect(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_SubtractRect(a0, a1, a2); } __finally { _PrintExit("SubtractRect(,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_SuspendThread(HANDLE a0) { _PrintEnter("SuspendThread(%p)\n", a0); DWORD rv = 0; __try { rv = Real_SuspendThread(a0); } __finally { _PrintExit("SuspendThread() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SwapBuffers(HDC a0) { _PrintEnter("SwapBuffers(%p)\n", a0); BOOL rv = 0; __try { rv = Real_SwapBuffers(a0); } __finally { _PrintExit("SwapBuffers() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SwapMouseButton(BOOL a0) { _PrintEnter("SwapMouseButton(%p)\n", a0); BOOL rv = 0; __try { rv = Real_SwapMouseButton(a0); } __finally { _PrintExit("SwapMouseButton() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SwitchDesktop(HDESK a0) { _PrintEnter("SwitchDesktop(%p)\n", a0); BOOL rv = 0; __try { rv = Real_SwitchDesktop(a0); } __finally { _PrintExit("SwitchDesktop() -> %p\n", rv); }; return rv; } void __stdcall Mine_SwitchToFiber(LPVOID a0) { _PrintEnter("SwitchToFiber(%p)\n", a0); __try { Real_SwitchToFiber(a0); } __finally { _PrintExit("SwitchToFiber() ->\n"); }; } BOOL __stdcall Mine_SwitchToThread(void) { _PrintEnter("SwitchToThread()\n"); BOOL rv = 0; __try { rv = Real_SwitchToThread(); } __finally { _PrintExit("SwitchToThread() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SystemParametersInfoA(UINT a0, UINT a1, PVOID a2, UINT a3) { _PrintEnter("SystemParametersInfoA(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_SystemParametersInfoA(a0, a1, a2, a3); } __finally { _PrintExit("SystemParametersInfoA(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SystemParametersInfoW(UINT a0, UINT a1, PVOID a2, UINT a3) { _PrintEnter("SystemParametersInfoW(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_SystemParametersInfoW(a0, a1, a2, a3); } __finally { _PrintExit("SystemParametersInfoW(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SystemTimeToFileTime(SYSTEMTIME* a0, LPFILETIME a1) { _PrintEnter("SystemTimeToFileTime(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SystemTimeToFileTime(a0, a1); } __finally { _PrintExit("SystemTimeToFileTime(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_SystemTimeToTzSpecificLocalTime( #ifdef PIPE_ACCEPT_REMOTE_CLIENTS const TIME_ZONE_INFORMATION *a0, const SYSTEMTIME *a1, #else LPTIME_ZONE_INFORMATION a0, LPSYSTEMTIME a1, #endif LPSYSTEMTIME a2 ) { _PrintEnter("SystemTimeToTzSpecificLocalTime(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_SystemTimeToTzSpecificLocalTime(a0, a1, a2); } __finally { _PrintExit("SystemTimeToTzSpecificLocalTime(,,) -> %p\n", rv); }; return rv; } LONG __stdcall Mine_TabbedTextOutA(HDC a0, int a1, int a2, LPCSTR a3, int a4, int a5, INT* a6, int a7) { _PrintEnter("TabbedTextOutA(%p,%p,%p,%hs,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7); LONG rv = 0; __try { rv = Real_TabbedTextOutA(a0, a1, a2, a3, a4, a5, a6, a7); } __finally { _PrintExit("TabbedTextOutA(,,,,,,,) -> %p\n", rv); }; return rv; } LONG __stdcall Mine_TabbedTextOutW(HDC a0, int a1, int a2, LPCWSTR a3, int a4, int a5, INT* a6, int a7) { _PrintEnter("TabbedTextOutW(%p,%p,%p,%ls,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7); LONG rv = 0; __try { rv = Real_TabbedTextOutW(a0, a1, a2, a3, a4, a5, a6, a7); } __finally { _PrintExit("TabbedTextOutW(,,,,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_TerminateProcess(HANDLE a0, UINT a1) { _PrintEnter("TerminateProcess(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_TerminateProcess(a0, a1); } __finally { _PrintExit("TerminateProcess(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_TerminateThread(HANDLE a0, DWORD a1) { _PrintEnter("TerminateThread(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_TerminateThread(a0, a1); } __finally { _PrintExit("TerminateThread(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_TextOutA(HDC a0, int a1, int a2, LPCSTR a3, int a4) { _PrintEnter("TextOutA(%p,%p,%p,%hs,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_TextOutA(a0, a1, a2, a3, a4); } __finally { _PrintExit("TextOutA(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_TextOutW(HDC a0, int a1, int a2, LPCWSTR a3, int a4) { _PrintEnter("TextOutW(%p,%p,%p,%ls,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_TextOutW(a0, a1, a2, a3, a4); } __finally { _PrintExit("TextOutW(,,,,) -> %p\n", rv); }; return rv; } WORD __stdcall Mine_TileWindows(HWND a0, UINT a1, RECT* a2, UINT a3, struct HWND__** a4) { _PrintEnter("TileWindows(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); WORD rv = 0; __try { rv = Real_TileWindows(a0, a1, a2, a3, a4); } __finally { _PrintExit("TileWindows(,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_ToAscii(UINT a0, UINT a1, BYTE* a2, LPWORD a3, UINT a4) { _PrintEnter("ToAscii(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); int rv = 0; __try { rv = Real_ToAscii(a0, a1, a2, a3, a4); } __finally { _PrintExit("ToAscii(,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_ToAsciiEx(UINT a0, UINT a1, BYTE* a2, LPWORD a3, UINT a4, HKL a5) { _PrintEnter("ToAsciiEx(%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); int rv = 0; __try { rv = Real_ToAsciiEx(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("ToAsciiEx(,,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_ToUnicode(UINT a0, UINT a1, BYTE* a2, LPWSTR a3, int a4, UINT a5) { _PrintEnter("ToUnicode(%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); int rv = 0; __try { rv = Real_ToUnicode(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("ToUnicode(,,,%ls,,) -> %p\n", a3, rv); }; return rv; } int __stdcall Mine_ToUnicodeEx(UINT a0, UINT a1, BYTE* a2, LPWSTR a3, int a4, UINT a5, HKL a6) { _PrintEnter("ToUnicodeEx(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); int rv = 0; __try { rv = Real_ToUnicodeEx(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("ToUnicodeEx(,,,%ls,,,) -> %p\n", a3, rv); }; return rv; } BOOL __stdcall Mine_TrackMouseEvent(TRACKMOUSEEVENT* a0) { _PrintEnter("TrackMouseEvent(%p)\n", a0); BOOL rv = 0; __try { rv = Real_TrackMouseEvent(a0); } __finally { _PrintExit("TrackMouseEvent() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_TrackPopupMenu(HMENU a0, UINT a1, int a2, int a3, int a4, HWND a5, RECT* a6) { _PrintEnter("TrackPopupMenu(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); BOOL rv = 0; __try { rv = Real_TrackPopupMenu(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("TrackPopupMenu(,,,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_TrackPopupMenuEx(HMENU a0, UINT a1, int a2, int a3, HWND a4, LPTPMPARAMS a5) { _PrintEnter("TrackPopupMenuEx(%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); BOOL rv = 0; __try { rv = Real_TrackPopupMenuEx(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("TrackPopupMenuEx(,,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_TransactNamedPipe(HANDLE a0, LPVOID a1, DWORD a2, LPVOID a3, DWORD a4, LPDWORD a5, LPOVERLAPPED a6) { _PrintEnter("TransactNamedPipe(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); BOOL rv = 0; __try { rv = Real_TransactNamedPipe(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("TransactNamedPipe(,,,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_TranslateAcceleratorA(HWND a0, HACCEL a1, LPMSG a2) { _PrintEnter("TranslateAcceleratorA(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_TranslateAcceleratorA(a0, a1, a2); } __finally { _PrintExit("TranslateAcceleratorA(,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_TranslateAcceleratorW(HWND a0, HACCEL a1, LPMSG a2) { _PrintEnter("TranslateAcceleratorW(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_TranslateAcceleratorW(a0, a1, a2); } __finally { _PrintExit("TranslateAcceleratorW(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_TranslateCharsetInfo(DWORD* a0, CHARSETINFO* a1, DWORD a2) { _PrintEnter("TranslateCharsetInfo(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_TranslateCharsetInfo(a0, a1, a2); } __finally { _PrintExit("TranslateCharsetInfo(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_TranslateMDISysAccel(HWND a0, LPMSG a1) { _PrintEnter("TranslateMDISysAccel(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_TranslateMDISysAccel(a0, a1); } __finally { _PrintExit("TranslateMDISysAccel(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_TranslateMessage(MSG* a0) { _PrintEnter("TranslateMessage(%p)\n", a0); BOOL rv = 0; __try { rv = Real_TranslateMessage(a0); } __finally { _PrintExit("TranslateMessage() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_TransmitCommChar(HANDLE a0, char a1) { _PrintEnter("TransmitCommChar(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_TransmitCommChar(a0, a1); } __finally { _PrintExit("TransmitCommChar(,) -> %p\n", rv); }; return rv; } #if DETOUR_TryEnterCriticalSection_EVEN_IF_IT_EXERCISES_A_BUG_IN_RtlLookupFunctionTable BOOL __stdcall Mine_TryEnterCriticalSection(LPCRITICAL_SECTION a0) { _PrintEnter("TryEnterCriticalSection(%p)\n", a0); BOOL rv = 0; __try { rv = Real_TryEnterCriticalSection(a0); } __finally { _PrintExit("TryEnterCriticalSection() -> %p\n", rv); }; return rv; } #endif BOOL __stdcall Mine_UnhookWindowsHook(int a0, HOOKPROC a1) { _PrintEnter("UnhookWindowsHook(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_UnhookWindowsHook(a0, a1); } __finally { _PrintExit("UnhookWindowsHook(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_UnhookWindowsHookEx(HHOOK a0) { _PrintEnter("UnhookWindowsHookEx(%p)\n", a0); BOOL rv = 0; __try { rv = Real_UnhookWindowsHookEx(a0); } __finally { _PrintExit("UnhookWindowsHookEx() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_UnionRect(LPRECT a0, RECT* a1, RECT* a2) { _PrintEnter("UnionRect(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_UnionRect(a0, a1, a2); } __finally { _PrintExit("UnionRect(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_UnloadKeyboardLayout(HKL a0) { _PrintEnter("UnloadKeyboardLayout(%p)\n", a0); BOOL rv = 0; __try { rv = Real_UnloadKeyboardLayout(a0); } __finally { _PrintExit("UnloadKeyboardLayout() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_UnlockFile(HANDLE a0, DWORD a1, DWORD a2, DWORD a3, DWORD a4) { _PrintEnter("UnlockFile(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_UnlockFile(a0, a1, a2, a3, a4); } __finally { _PrintExit("UnlockFile(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_UnlockFileEx(HANDLE a0, DWORD a1, DWORD a2, DWORD a3, LPOVERLAPPED a4) { _PrintEnter("UnlockFileEx(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_UnlockFileEx(a0, a1, a2, a3, a4); } __finally { _PrintExit("UnlockFileEx(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_UnmapViewOfFile(LPCVOID a0) { _PrintEnter("UnmapViewOfFile(%p)\n", a0); BOOL rv = 0; __try { rv = Real_UnmapViewOfFile(a0); } __finally { _PrintExit("UnmapViewOfFile() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_UnpackDDElParam(UINT a0, LPARAM a1, PUINT_PTR a2, PUINT_PTR a3) { _PrintEnter("UnpackDDElParam(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_UnpackDDElParam(a0, a1, a2, a3); } __finally { _PrintExit("UnpackDDElParam(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_UnrealizeObject(HGDIOBJ a0) { _PrintEnter("UnrealizeObject(%p)\n", a0); BOOL rv = 0; __try { rv = Real_UnrealizeObject(a0); } __finally { _PrintExit("UnrealizeObject() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_UnregisterClassA(LPCSTR a0, HINSTANCE a1) { _PrintEnter("UnregisterClassA(%hs,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_UnregisterClassA(a0, a1); } __finally { _PrintExit("UnregisterClassA(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_UnregisterClassW(LPCWSTR a0, HINSTANCE a1) { _PrintEnter("UnregisterClassW(%ls,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_UnregisterClassW(a0, a1); } __finally { _PrintExit("UnregisterClassW(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_UnregisterHotKey(HWND a0, int a1) { _PrintEnter("UnregisterHotKey(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_UnregisterHotKey(a0, a1); } __finally { _PrintExit("UnregisterHotKey(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_UpdateColors(HDC a0) { _PrintEnter("UpdateColors(%p)\n", a0); BOOL rv = 0; __try { rv = Real_UpdateColors(a0); } __finally { _PrintExit("UpdateColors() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_UpdateResourceA(HANDLE a0, LPCSTR a1, LPCSTR a2, WORD a3, LPVOID a4, DWORD a5) { _PrintEnter("UpdateResourceA(%p,%hs,%hs,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); BOOL rv = 0; __try { rv = Real_UpdateResourceA(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("UpdateResourceA(,,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_UpdateResourceW(HANDLE a0, LPCWSTR a1, LPCWSTR a2, WORD a3, LPVOID a4, DWORD a5) { _PrintEnter("UpdateResourceW(%p,%ls,%ls,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); BOOL rv = 0; __try { rv = Real_UpdateResourceW(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("UpdateResourceW(,,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_UpdateWindow(HWND a0) { _PrintEnter("UpdateWindow(%p)\n", a0); BOOL rv = 0; __try { rv = Real_UpdateWindow(a0); } __finally { _PrintExit("UpdateWindow() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ValidateRect(HWND a0, RECT* a1) { _PrintEnter("ValidateRect(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_ValidateRect(a0, a1); } __finally { _PrintExit("ValidateRect(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_ValidateRgn(HWND a0, HRGN a1) { _PrintEnter("ValidateRgn(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_ValidateRgn(a0, a1); } __finally { _PrintExit("ValidateRgn(,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_VerLanguageNameA(DWORD a0, LPSTR a1, DWORD a2) { _PrintEnter("VerLanguageNameA(%p,%p,%p)\n", a0, a1, a2); DWORD rv = 0; __try { rv = Real_VerLanguageNameA(a0, a1, a2); } __finally { _PrintExit("VerLanguageNameA(,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_VerLanguageNameW(DWORD a0, LPWSTR a1, DWORD a2) { _PrintEnter("VerLanguageNameW(%p,%p,%p)\n", a0, a1, a2); DWORD rv = 0; __try { rv = Real_VerLanguageNameW(a0, a1, a2); } __finally { _PrintExit("VerLanguageNameW(,,) -> %p\n", rv); }; return rv; } LPVOID __stdcall Mine_VirtualAllocEx(HANDLE a0, LPVOID a1, SIZE_T a2, DWORD a3, DWORD a4) { _PrintEnter("VirtualAllocEx(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); LPVOID rv = 0; __try { rv = Real_VirtualAllocEx(a0, a1, a2, a3, a4); } __finally { _PrintExit("VirtualAllocEx(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_VirtualFreeEx(HANDLE a0, LPVOID a1, SIZE_T a2, DWORD a3) { _PrintEnter("VirtualFreeEx(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_VirtualFreeEx(a0, a1, a2, a3); } __finally { _PrintExit("VirtualFreeEx(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_VirtualProtectEx(HANDLE a0, LPVOID a1, SIZE_T a2, DWORD a3, PDWORD a4) { _PrintEnter("VirtualProtectEx(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_VirtualProtectEx(a0, a1, a2, a3, a4); } __finally { _PrintExit("VirtualProtectEx(,,,,) -> %p\n", rv); }; return rv; } DWORD_PTR __stdcall Mine_VirtualQueryEx(HANDLE a0, LPCVOID a1, PMEMORY_BASIC_INFORMATION a2, DWORD_PTR a3) { _PrintEnter("VirtualQueryEx(%p,%p,%p,%p)\n", a0, a1, a2, a3); DWORD_PTR rv = 0; __try { rv = Real_VirtualQueryEx(a0, a1, a2, a3); } __finally { _PrintExit("VirtualQueryEx(,,,) -> %p\n", rv); }; return rv; } SHORT __stdcall Mine_VkKeyScanA(CHAR a0) { _PrintEnter("VkKeyScanA(%p)\n", a0); SHORT rv = 0; __try { rv = Real_VkKeyScanA(a0); } __finally { _PrintExit("VkKeyScanA() -> %p\n", rv); }; return rv; } SHORT __stdcall Mine_VkKeyScanExA(CHAR a0, HKL a1) { _PrintEnter("VkKeyScanExA(%p,%p)\n", a0, a1); SHORT rv = 0; __try { rv = Real_VkKeyScanExA(a0, a1); } __finally { _PrintExit("VkKeyScanExA(,) -> %p\n", rv); }; return rv; } SHORT __stdcall Mine_VkKeyScanExW(WCHAR a0, HKL a1) { _PrintEnter("VkKeyScanExW(%p,%p)\n", a0, a1); SHORT rv = 0; __try { rv = Real_VkKeyScanExW(a0, a1); } __finally { _PrintExit("VkKeyScanExW(,) -> %p\n", rv); }; return rv; } SHORT __stdcall Mine_VkKeyScanW(WCHAR a0) { _PrintEnter("VkKeyScanW(%p)\n", a0); SHORT rv = 0; __try { rv = Real_VkKeyScanW(a0); } __finally { _PrintExit("VkKeyScanW() -> %p\n", rv); }; return rv; } SOCKET __stdcall Mine_WSAAccept(SOCKET a0, sockaddr* a1, LPINT a2, LPCONDITIONPROC a3, DWORD_PTR a4) { _PrintEnter("WSAAccept(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); SOCKET rv = 0; __try { rv = Real_WSAAccept(a0, a1, a2, a3, a4); } __finally { _PrintExit("WSAAccept(,,,,) -> %p\n", rv); }; return rv; } INT __stdcall Mine_WSAAddressToStringA(LPSOCKADDR a0, DWORD a1, LPWSAPROTOCOL_INFOA a2, LPSTR a3, LPDWORD a4) { _PrintEnter("WSAAddressToStringA(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); INT rv = 0; __try { rv = Real_WSAAddressToStringA(a0, a1, a2, a3, a4); } __finally { _PrintExit("WSAAddressToStringA(,,,,) -> %p\n", rv); }; return rv; } INT __stdcall Mine_WSAAddressToStringW(LPSOCKADDR a0, DWORD a1, LPWSAPROTOCOL_INFOW a2, LPWSTR a3, LPDWORD a4) { _PrintEnter("WSAAddressToStringW(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); INT rv = 0; __try { rv = Real_WSAAddressToStringW(a0, a1, a2, a3, a4); } __finally { _PrintExit("WSAAddressToStringW(,,,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_WSAAsyncGetHostByAddr(HWND a0, u_int a1, char* a2, int a3, int a4, char* a5, int a6) { _PrintEnter("WSAAsyncGetHostByAddr(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); HANDLE rv = 0; __try { rv = Real_WSAAsyncGetHostByAddr(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("WSAAsyncGetHostByAddr(,,,,,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_WSAAsyncGetHostByName(HWND a0, u_int a1, char* a2, char* a3, int a4) { _PrintEnter("WSAAsyncGetHostByName(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); HANDLE rv = 0; __try { rv = Real_WSAAsyncGetHostByName(a0, a1, a2, a3, a4); } __finally { _PrintExit("WSAAsyncGetHostByName(,,,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_WSAAsyncGetProtoByName(HWND a0, u_int a1, char* a2, char* a3, int a4) { _PrintEnter("WSAAsyncGetProtoByName(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); HANDLE rv = 0; __try { rv = Real_WSAAsyncGetProtoByName(a0, a1, a2, a3, a4); } __finally { _PrintExit("WSAAsyncGetProtoByName(,,,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_WSAAsyncGetProtoByNumber(HWND a0, u_int a1, int a2, char* a3, int a4) { _PrintEnter("WSAAsyncGetProtoByNumber(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); HANDLE rv = 0; __try { rv = Real_WSAAsyncGetProtoByNumber(a0, a1, a2, a3, a4); } __finally { _PrintExit("WSAAsyncGetProtoByNumber(,,,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_WSAAsyncGetServByName(HWND a0, u_int a1, char* a2, char* a3, char* a4, int a5) { _PrintEnter("WSAAsyncGetServByName(%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); HANDLE rv = 0; __try { rv = Real_WSAAsyncGetServByName(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("WSAAsyncGetServByName(,,,,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_WSAAsyncGetServByPort(HWND a0, u_int a1, int a2, char* a3, char* a4, int a5) { _PrintEnter("WSAAsyncGetServByPort(%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); HANDLE rv = 0; __try { rv = Real_WSAAsyncGetServByPort(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("WSAAsyncGetServByPort(,,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_WSAAsyncSelect(SOCKET a0, HWND a1, u_int a2, long a3) { _PrintEnter("WSAAsyncSelect(%p,%p,%p,%p)\n", a0, a1, a2, a3); int rv = 0; __try { rv = Real_WSAAsyncSelect(a0, a1, a2, a3); } __finally { _PrintExit("WSAAsyncSelect(,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_WSACancelAsyncRequest(HANDLE a0) { _PrintEnter("WSACancelAsyncRequest(%p)\n", a0); int rv = 0; __try { rv = Real_WSACancelAsyncRequest(a0); } __finally { _PrintExit("WSACancelAsyncRequest() -> %p\n", rv); }; return rv; } int __stdcall Mine_WSACancelBlockingCall(void) { _PrintEnter("WSACancelBlockingCall()\n"); int rv = 0; __try { rv = Real_WSACancelBlockingCall(); } __finally { _PrintExit("WSACancelBlockingCall() -> %p\n", rv); }; return rv; } int __stdcall Mine_WSACleanup(void) { _PrintEnter("WSACleanup()\n"); int rv = 0; __try { rv = Real_WSACleanup(); } __finally { _PrintExit("WSACleanup() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_WSACloseEvent(HANDLE a0) { _PrintEnter("WSACloseEvent(%p)\n", a0); BOOL rv = 0; __try { rv = Real_WSACloseEvent(a0); } __finally { _PrintExit("WSACloseEvent() -> %p\n", rv); }; return rv; } int __stdcall Mine_WSAConnect(SOCKET a0, sockaddr* a1, int a2, LPWSABUF a3, LPWSABUF a4, LPQOS a5, LPQOS a6) { _PrintEnter("WSAConnect(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); int rv = 0; __try { rv = Real_WSAConnect(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("WSAConnect(,,,,,,) -> %p\n", rv); }; return rv; } HANDLE __stdcall Mine_WSACreateEvent(void) { _PrintEnter("WSACreateEvent()\n"); HANDLE rv = 0; __try { rv = Real_WSACreateEvent(); } __finally { _PrintExit("WSACreateEvent() -> %p\n", rv); }; return rv; } int __stdcall Mine_WSADuplicateSocketA(SOCKET a0, DWORD a1, LPWSAPROTOCOL_INFOA a2) { _PrintEnter("WSADuplicateSocketA(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_WSADuplicateSocketA(a0, a1, a2); } __finally { _PrintExit("WSADuplicateSocketA(,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_WSADuplicateSocketW(SOCKET a0, DWORD a1, LPWSAPROTOCOL_INFOW a2) { _PrintEnter("WSADuplicateSocketW(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_WSADuplicateSocketW(a0, a1, a2); } __finally { _PrintExit("WSADuplicateSocketW(,,) -> %p\n", rv); }; return rv; } INT __stdcall Mine_WSAEnumNameSpaceProvidersA(LPDWORD a0, LPWSANAMESPACE_INFOA a1) { _PrintEnter("WSAEnumNameSpaceProvidersA(%p,%p)\n", a0, a1); INT rv = 0; __try { rv = Real_WSAEnumNameSpaceProvidersA(a0, a1); } __finally { _PrintExit("WSAEnumNameSpaceProvidersA(,) -> %p\n", rv); }; return rv; } INT __stdcall Mine_WSAEnumNameSpaceProvidersW(LPDWORD a0, LPWSANAMESPACE_INFOW a1) { _PrintEnter("WSAEnumNameSpaceProvidersW(%p,%p)\n", a0, a1); INT rv = 0; __try { rv = Real_WSAEnumNameSpaceProvidersW(a0, a1); } __finally { _PrintExit("WSAEnumNameSpaceProvidersW(,) -> %p\n", rv); }; return rv; } int __stdcall Mine_WSAEnumNetworkEvents(SOCKET a0, HANDLE a1, LPWSANETWORKEVENTS a2) { _PrintEnter("WSAEnumNetworkEvents(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_WSAEnumNetworkEvents(a0, a1, a2); } __finally { _PrintExit("WSAEnumNetworkEvents(,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_WSAEnumProtocolsA(LPINT a0, LPWSAPROTOCOL_INFOA a1, LPDWORD a2) { _PrintEnter("WSAEnumProtocolsA(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_WSAEnumProtocolsA(a0, a1, a2); } __finally { _PrintExit("WSAEnumProtocolsA(,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_WSAEnumProtocolsW(LPINT a0, LPWSAPROTOCOL_INFOW a1, LPDWORD a2) { _PrintEnter("WSAEnumProtocolsW(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_WSAEnumProtocolsW(a0, a1, a2); } __finally { _PrintExit("WSAEnumProtocolsW(,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_WSAEventSelect(SOCKET a0, HANDLE a1, long a2) { _PrintEnter("WSAEventSelect(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_WSAEventSelect(a0, a1, a2); } __finally { _PrintExit("WSAEventSelect(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_WSAGetOverlappedResult(SOCKET a0, LPWSAOVERLAPPED a1, LPDWORD a2, BOOL a3, LPDWORD a4) { _PrintEnter("WSAGetOverlappedResult(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_WSAGetOverlappedResult(a0, a1, a2, a3, a4); } __finally { _PrintExit("WSAGetOverlappedResult(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_WSAGetQOSByName(SOCKET a0, LPWSABUF a1, LPQOS a2) { _PrintEnter("WSAGetQOSByName(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_WSAGetQOSByName(a0, a1, a2); } __finally { _PrintExit("WSAGetQOSByName(,,) -> %p\n", rv); }; return rv; } INT __stdcall Mine_WSAGetServiceClassInfoA(LPGUID a0, LPGUID a1, LPDWORD a2, LPWSASERVICECLASSINFOA a3) { _PrintEnter("WSAGetServiceClassInfoA(%p,%p,%p,%p)\n", a0, a1, a2, a3); INT rv = 0; __try { rv = Real_WSAGetServiceClassInfoA(a0, a1, a2, a3); } __finally { _PrintExit("WSAGetServiceClassInfoA(,,,) -> %p\n", rv); }; return rv; } INT __stdcall Mine_WSAGetServiceClassInfoW(LPGUID a0, LPGUID a1, LPDWORD a2, LPWSASERVICECLASSINFOW a3) { _PrintEnter("WSAGetServiceClassInfoW(%p,%p,%p,%p)\n", a0, a1, a2, a3); INT rv = 0; __try { rv = Real_WSAGetServiceClassInfoW(a0, a1, a2, a3); } __finally { _PrintExit("WSAGetServiceClassInfoW(,,,) -> %p\n", rv); }; return rv; } INT __stdcall Mine_WSAGetServiceClassNameByClassIdA(LPGUID a0, LPSTR a1, LPDWORD a2) { _PrintEnter("WSAGetServiceClassNameByClassIdA(%p,%p,%p)\n", a0, a1, a2); INT rv = 0; __try { rv = Real_WSAGetServiceClassNameByClassIdA(a0, a1, a2); } __finally { _PrintExit("WSAGetServiceClassNameByClassIdA(,,) -> %p\n", rv); }; return rv; } INT __stdcall Mine_WSAGetServiceClassNameByClassIdW(LPGUID a0, LPWSTR a1, LPDWORD a2) { _PrintEnter("WSAGetServiceClassNameByClassIdW(%p,%p,%p)\n", a0, a1, a2); INT rv = 0; __try { rv = Real_WSAGetServiceClassNameByClassIdW(a0, a1, a2); } __finally { _PrintExit("WSAGetServiceClassNameByClassIdW(,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_WSAHtonl(SOCKET a0, u_long a1, u_long* a2) { _PrintEnter("WSAHtonl(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_WSAHtonl(a0, a1, a2); } __finally { _PrintExit("WSAHtonl(,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_WSAHtons(SOCKET a0, u_short a1, u_short* a2) { _PrintEnter("WSAHtons(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_WSAHtons(a0, a1, a2); } __finally { _PrintExit("WSAHtons(,,) -> %p\n", rv); }; return rv; } INT __stdcall Mine_WSAInstallServiceClassA(LPWSASERVICECLASSINFOA a0) { _PrintEnter("WSAInstallServiceClassA(%p)\n", a0); INT rv = 0; __try { rv = Real_WSAInstallServiceClassA(a0); } __finally { _PrintExit("WSAInstallServiceClassA() -> %p\n", rv); }; return rv; } INT __stdcall Mine_WSAInstallServiceClassW(LPWSASERVICECLASSINFOW a0) { _PrintEnter("WSAInstallServiceClassW(%p)\n", a0); INT rv = 0; __try { rv = Real_WSAInstallServiceClassW(a0); } __finally { _PrintExit("WSAInstallServiceClassW() -> %p\n", rv); }; return rv; } int __stdcall Mine_WSAIoctl(SOCKET a0, DWORD a1, LPVOID a2, DWORD a3, LPVOID a4, DWORD a5, LPDWORD a6, LPWSAOVERLAPPED a7, LPWSAOVERLAPPED_COMPLETION_ROUTINE a8) { _PrintEnter("WSAIoctl(%p,%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8); int rv = 0; __try { rv = Real_WSAIoctl(a0, a1, a2, a3, a4, a5, a6, a7, a8); } __finally { _PrintExit("WSAIoctl(,,,,,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_WSAIsBlocking(void) { _PrintEnter("WSAIsBlocking()\n"); BOOL rv = 0; __try { rv = Real_WSAIsBlocking(); } __finally { _PrintExit("WSAIsBlocking() -> %p\n", rv); }; return rv; } SOCKET __stdcall Mine_WSAJoinLeaf(SOCKET a0, sockaddr* a1, int a2, LPWSABUF a3, LPWSABUF a4, LPQOS a5, LPQOS a6, DWORD a7) { _PrintEnter("WSAJoinLeaf(%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7); SOCKET rv = 0; __try { rv = Real_WSAJoinLeaf(a0, a1, a2, a3, a4, a5, a6, a7); } __finally { _PrintExit("WSAJoinLeaf(,,,,,,,) -> %p\n", rv); }; return rv; } INT __stdcall Mine_WSALookupServiceBeginA(LPWSAQUERYSETA a0, DWORD a1, LPHANDLE a2) { _PrintEnter("WSALookupServiceBeginA(%p,%p,%p)\n", a0, a1, a2); INT rv = 0; __try { rv = Real_WSALookupServiceBeginA(a0, a1, a2); } __finally { _PrintExit("WSALookupServiceBeginA(,,) -> %p\n", rv); }; return rv; } INT __stdcall Mine_WSALookupServiceBeginW(LPWSAQUERYSETW a0, DWORD a1, LPHANDLE a2) { _PrintEnter("WSALookupServiceBeginW(%p,%p,%p)\n", a0, a1, a2); INT rv = 0; __try { rv = Real_WSALookupServiceBeginW(a0, a1, a2); } __finally { _PrintExit("WSALookupServiceBeginW(,,) -> %p\n", rv); }; return rv; } INT __stdcall Mine_WSALookupServiceEnd(HANDLE a0) { _PrintEnter("WSALookupServiceEnd(%p)\n", a0); INT rv = 0; __try { rv = Real_WSALookupServiceEnd(a0); } __finally { _PrintExit("WSALookupServiceEnd() -> %p\n", rv); }; return rv; } INT __stdcall Mine_WSALookupServiceNextA(HANDLE a0, DWORD a1, LPDWORD a2, LPWSAQUERYSETA a3) { _PrintEnter("WSALookupServiceNextA(%p,%p,%p,%p)\n", a0, a1, a2, a3); INT rv = 0; __try { rv = Real_WSALookupServiceNextA(a0, a1, a2, a3); } __finally { _PrintExit("WSALookupServiceNextA(,,,) -> %p\n", rv); }; return rv; } INT __stdcall Mine_WSALookupServiceNextW(HANDLE a0, DWORD a1, LPDWORD a2, LPWSAQUERYSETW a3) { _PrintEnter("WSALookupServiceNextW(%p,%p,%p,%p)\n", a0, a1, a2, a3); INT rv = 0; __try { rv = Real_WSALookupServiceNextW(a0, a1, a2, a3); } __finally { _PrintExit("WSALookupServiceNextW(,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_WSANtohl(SOCKET a0, u_long a1, u_long* a2) { _PrintEnter("WSANtohl(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_WSANtohl(a0, a1, a2); } __finally { _PrintExit("WSANtohl(,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_WSANtohs(SOCKET a0, u_short a1, u_short* a2) { _PrintEnter("WSANtohs(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_WSANtohs(a0, a1, a2); } __finally { _PrintExit("WSANtohs(,,) -> %p\n", rv); }; return rv; } INT __stdcall Mine_WSAProviderConfigChange(LPHANDLE a0, LPWSAOVERLAPPED a1, LPWSAOVERLAPPED_COMPLETION_ROUTINE a2) { _PrintEnter("WSAProviderConfigChange(%p,%p,%p)\n", a0, a1, a2); INT rv = 0; __try { rv = Real_WSAProviderConfigChange(a0, a1, a2); } __finally { _PrintExit("WSAProviderConfigChange(,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_WSARecv(SOCKET a0, LPWSABUF a1, DWORD a2, LPDWORD a3, LPDWORD a4, LPWSAOVERLAPPED a5, LPWSAOVERLAPPED_COMPLETION_ROUTINE a6) { _PrintEnter("WSARecv(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); int rv = 0; __try { rv = Real_WSARecv(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("WSARecv(,,,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_WSARecvDisconnect(SOCKET a0, LPWSABUF a1) { _PrintEnter("WSARecvDisconnect(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real_WSARecvDisconnect(a0, a1); } __finally { _PrintExit("WSARecvDisconnect(,) -> %p\n", rv); }; return rv; } int __stdcall Mine_WSARecvFrom(SOCKET a0, LPWSABUF a1, DWORD a2, LPDWORD a3, LPDWORD a4, sockaddr* a5, LPINT a6, LPWSAOVERLAPPED a7, LPWSAOVERLAPPED_COMPLETION_ROUTINE a8) { _PrintEnter("WSARecvFrom(%p,%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8); int rv = 0; __try { rv = Real_WSARecvFrom(a0, a1, a2, a3, a4, a5, a6, a7, a8); } __finally { _PrintExit("WSARecvFrom(,,,,,,,,) -> %p\n", rv); }; return rv; } INT __stdcall Mine_WSARemoveServiceClass(LPGUID a0) { _PrintEnter("WSARemoveServiceClass(%p)\n", a0); INT rv = 0; __try { rv = Real_WSARemoveServiceClass(a0); } __finally { _PrintExit("WSARemoveServiceClass() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_WSAResetEvent(HANDLE a0) { _PrintEnter("WSAResetEvent(%p)\n", a0); BOOL rv = 0; __try { rv = Real_WSAResetEvent(a0); } __finally { _PrintExit("WSAResetEvent() -> %p\n", rv); }; return rv; } int __stdcall Mine_WSASend(SOCKET a0, LPWSABUF a1, DWORD a2, LPDWORD a3, DWORD a4, LPWSAOVERLAPPED a5, LPWSAOVERLAPPED_COMPLETION_ROUTINE a6) { _PrintEnter("WSASend(%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); int rv = 0; __try { rv = Real_WSASend(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("WSASend(,,,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_WSASendDisconnect(SOCKET a0, LPWSABUF a1) { _PrintEnter("WSASendDisconnect(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real_WSASendDisconnect(a0, a1); } __finally { _PrintExit("WSASendDisconnect(,) -> %p\n", rv); }; return rv; } int __stdcall Mine_WSASendTo(SOCKET a0, LPWSABUF a1, DWORD a2, LPDWORD a3, DWORD a4, sockaddr* a5, int a6, LPWSAOVERLAPPED a7, LPWSAOVERLAPPED_COMPLETION_ROUTINE a8) { _PrintEnter("WSASendTo(%p,%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8); int rv = 0; __try { rv = Real_WSASendTo(a0, a1, a2, a3, a4, a5, a6, a7, a8); } __finally { _PrintExit("WSASendTo(,,,,,,,,) -> %p\n", rv); }; return rv; } FARPROC __stdcall Mine_WSASetBlockingHook(FARPROC a0) { _PrintEnter("WSASetBlockingHook(%p)\n", a0); FARPROC rv = 0; __try { rv = Real_WSASetBlockingHook(a0); } __finally { _PrintExit("WSASetBlockingHook() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_WSASetEvent(HANDLE a0) { _PrintEnter("WSASetEvent(%p)\n", a0); BOOL rv = 0; __try { rv = Real_WSASetEvent(a0); } __finally { _PrintExit("WSASetEvent() -> %p\n", rv); }; return rv; } INT __stdcall Mine_WSASetServiceA(LPWSAQUERYSETA a0, WSAESETSERVICEOP a1, DWORD a2) { _PrintEnter("WSASetServiceA(%p,%p,%p)\n", a0, a1, a2); INT rv = 0; __try { rv = Real_WSASetServiceA(a0, a1, a2); } __finally { _PrintExit("WSASetServiceA(,,) -> %p\n", rv); }; return rv; } INT __stdcall Mine_WSASetServiceW(LPWSAQUERYSETW a0, WSAESETSERVICEOP a1, DWORD a2) { _PrintEnter("WSASetServiceW(%p,%p,%p)\n", a0, a1, a2); INT rv = 0; __try { rv = Real_WSASetServiceW(a0, a1, a2); } __finally { _PrintExit("WSASetServiceW(,,) -> %p\n", rv); }; return rv; } SOCKET __stdcall Mine_WSASocketA(int a0, int a1, int a2, LPWSAPROTOCOL_INFOA a3, GROUP a4, DWORD a5) { _PrintEnter("WSASocketA(%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); SOCKET rv = 0; __try { rv = Real_WSASocketA(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("WSASocketA(,,,,,) -> %p\n", rv); }; return rv; } SOCKET __stdcall Mine_WSASocketW(int a0, int a1, int a2, LPWSAPROTOCOL_INFOW a3, GROUP a4, DWORD a5) { _PrintEnter("WSASocketW(%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); SOCKET rv = 0; __try { rv = Real_WSASocketW(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("WSASocketW(,,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_WSAStartup(WORD a0, LPWSADATA a1) { _PrintEnter("WSAStartup(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real_WSAStartup(a0, a1); } __finally { _PrintExit("WSAStartup(,) -> %p\n", rv); }; return rv; } INT __stdcall Mine_WSAStringToAddressA(LPSTR a0, INT a1, LPWSAPROTOCOL_INFOA a2, LPSOCKADDR a3, LPINT a4) { _PrintEnter("WSAStringToAddressA(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); INT rv = 0; __try { rv = Real_WSAStringToAddressA(a0, a1, a2, a3, a4); } __finally { _PrintExit("WSAStringToAddressA(,,,,) -> %p\n", rv); }; return rv; } INT __stdcall Mine_WSAStringToAddressW(LPWSTR a0, INT a1, LPWSAPROTOCOL_INFOW a2, LPSOCKADDR a3, LPINT a4) { _PrintEnter("WSAStringToAddressW(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); INT rv = 0; __try { rv = Real_WSAStringToAddressW(a0, a1, a2, a3, a4); } __finally { _PrintExit("WSAStringToAddressW(,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_WSAUnhookBlockingHook(void) { _PrintEnter("WSAUnhookBlockingHook()\n"); int rv = 0; __try { rv = Real_WSAUnhookBlockingHook(); } __finally { _PrintExit("WSAUnhookBlockingHook() -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_WSAWaitForMultipleEvents(DWORD a0, void** a1, BOOL a2, DWORD a3, BOOL a4) { _PrintEnter("WSAWaitForMultipleEvents(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); DWORD rv = 0; __try { rv = Real_WSAWaitForMultipleEvents(a0, a1, a2, a3, a4); } __finally { _PrintExit("WSAWaitForMultipleEvents(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_WaitCommEvent(HANDLE a0, LPDWORD a1, LPOVERLAPPED a2) { _PrintEnter("WaitCommEvent(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_WaitCommEvent(a0, a1, a2); } __finally { _PrintExit("WaitCommEvent(,,) -> %p\n", rv); }; return rv; } #if !defined(DETOURS_ARM) BOOL __stdcall Mine_WaitForDebugEvent(LPDEBUG_EVENT a0, DWORD a1) { _PrintEnter("WaitForDebugEvent(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_WaitForDebugEvent(a0, a1); } __finally { if (rv) { _PrintExit("WaitForDebugEvent(%d,) -> %p\n", a0->dwDebugEventCode, rv); } else { _PrintExit("WaitForDebugEvent(,) -> %p\n", rv); } }; return rv; } #endif // !DETOURS_ARM DWORD __stdcall Mine_WaitForInputIdle(HANDLE a0, DWORD a1) { _PrintEnter("WaitForInputIdle(%p,%p)\n", a0, a1); DWORD rv = 0; __try { rv = Real_WaitForInputIdle(a0, a1); } __finally { _PrintExit("WaitForInputIdle(,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_WaitForMultipleObjects(DWORD a0, void** a1, BOOL a2, DWORD a3) { _PrintEnter("WaitForMultipleObjects(%p,%p,%p,%p)\n", a0, a1, a2, a3); DWORD rv = 0; __try { rv = Real_WaitForMultipleObjects(a0, a1, a2, a3); } __finally { _PrintExit("WaitForMultipleObjects(,,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_WaitForMultipleObjectsEx(DWORD a0, void** a1, BOOL a2, DWORD a3, BOOL a4) { _PrintEnter("WaitForMultipleObjectsEx(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); DWORD rv = 0; __try { rv = Real_WaitForMultipleObjectsEx(a0, a1, a2, a3, a4); } __finally { _PrintExit("WaitForMultipleObjectsEx(,,,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_WaitForSingleObject(HANDLE a0, DWORD a1) { _PrintEnter("WaitForSingleObject(%p,%p)\n", a0, a1); DWORD rv = 0; __try { rv = Real_WaitForSingleObject(a0, a1); } __finally { _PrintExit("WaitForSingleObject(,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_WaitForSingleObjectEx(HANDLE a0, DWORD a1, BOOL a2) { _PrintEnter("WaitForSingleObjectEx(%p,%p,%p)\n", a0, a1, a2); DWORD rv = 0; __try { rv = Real_WaitForSingleObjectEx(a0, a1, a2); } __finally { _PrintExit("WaitForSingleObjectEx(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_WaitMessage(void) { _PrintEnter("WaitMessage()\n"); BOOL rv = 0; __try { rv = Real_WaitMessage(); } __finally { _PrintExit("WaitMessage() -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_WaitNamedPipeA(LPCSTR a0, DWORD a1) { _PrintEnter("WaitNamedPipeA(%hs,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_WaitNamedPipeA(a0, a1); } __finally { _PrintExit("WaitNamedPipeA(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_WaitNamedPipeW(LPCWSTR a0, DWORD a1) { _PrintEnter("WaitNamedPipeW(%ls,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_WaitNamedPipeW(a0, a1); } __finally { _PrintExit("WaitNamedPipeW(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_WidenPath(HDC a0) { _PrintEnter("WidenPath(%p)\n", a0); BOOL rv = 0; __try { rv = Real_WidenPath(a0); } __finally { _PrintExit("WidenPath() -> %p\n", rv); }; return rv; } UINT __stdcall Mine_WinExec(LPCSTR a0, UINT a1) { _PrintEnter("WinExec(%hs,%p)\n", a0, a1); UINT rv = 0; __try { rv = Real_WinExec(a0, a1); } __finally { _PrintExit("WinExec(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_WinHelpA(HWND a0, LPCSTR a1, UINT a2, ULONG_PTR a3) { _PrintEnter("WinHelpA(%p,%hs,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_WinHelpA(a0, a1, a2, a3); } __finally { _PrintExit("WinHelpA(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_WinHelpW(HWND a0, LPCWSTR a1, UINT a2, ULONG_PTR a3) { _PrintEnter("WinHelpW(%p,%ls,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_WinHelpW(a0, a1, a2, a3); } __finally { _PrintExit("WinHelpW(,,,) -> %p\n", rv); }; return rv; } HWND __stdcall Mine_WindowFromDC(HDC a0) { _PrintEnter("WindowFromDC(%p)\n", a0); HWND rv = 0; __try { rv = Real_WindowFromDC(a0); } __finally { _PrintExit("WindowFromDC() -> %p\n", rv); }; return rv; } HWND __stdcall Mine_WindowFromPoint(POINT a0) { _PrintEnter("WindowFromPoint(%p)\n", a0); HWND rv = 0; __try { rv = Real_WindowFromPoint(a0); } __finally { _PrintExit("WindowFromPoint() -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_WriteClassStg(LPSTORAGE a0, CONST IID& a1) { _PrintEnter("WriteClassStg(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_WriteClassStg(a0, a1); } __finally { _PrintExit("WriteClassStg(,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_WriteClassStm(LPSTREAM a0, CONST IID& a1) { _PrintEnter("WriteClassStm(%p,%p)\n", a0, a1); HRESULT rv = 0; __try { rv = Real_WriteClassStm(a0, a1); } __finally { _PrintExit("WriteClassStm(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_WriteConsoleA(HANDLE a0, void* a1, DWORD a2, LPDWORD a3, LPVOID a4) { _PrintEnter("WriteConsoleA(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_WriteConsoleA(a0, a1, a2, a3, a4); } __finally { _PrintExit("WriteConsoleA(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_WriteConsoleInputA(HANDLE a0, INPUT_RECORD* a1, DWORD a2, LPDWORD a3) { _PrintEnter("WriteConsoleInputA(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_WriteConsoleInputA(a0, a1, a2, a3); } __finally { _PrintExit("WriteConsoleInputA(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_WriteConsoleInputW(HANDLE a0, INPUT_RECORD* a1, DWORD a2, LPDWORD a3) { _PrintEnter("WriteConsoleInputW(%p,%p,%p,%p)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_WriteConsoleInputW(a0, a1, a2, a3); } __finally { _PrintExit("WriteConsoleInputW(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_WriteConsoleOutputA(HANDLE a0, CHAR_INFO* a1, COORD a2, COORD a3, PSMALL_RECT a4) { _PrintEnter("WriteConsoleOutputA(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_WriteConsoleOutputA(a0, a1, a2, a3, a4); } __finally { _PrintExit("WriteConsoleOutputA(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_WriteConsoleOutputAttribute(HANDLE a0, WORD* a1, DWORD a2, COORD a3, LPDWORD a4) { _PrintEnter("WriteConsoleOutputAttribute(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_WriteConsoleOutputAttribute(a0, a1, a2, a3, a4); } __finally { _PrintExit("WriteConsoleOutputAttribute(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_WriteConsoleOutputCharacterA(HANDLE a0, LPCSTR a1, DWORD a2, COORD a3, LPDWORD a4) { _PrintEnter("WriteConsoleOutputCharacterA(%p,%hs,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_WriteConsoleOutputCharacterA(a0, a1, a2, a3, a4); } __finally { _PrintExit("WriteConsoleOutputCharacterA(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_WriteConsoleOutputCharacterW(HANDLE a0, LPCWSTR a1, DWORD a2, COORD a3, LPDWORD a4) { _PrintEnter("WriteConsoleOutputCharacterW(%p,%ls,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_WriteConsoleOutputCharacterW(a0, a1, a2, a3, a4); } __finally { _PrintExit("WriteConsoleOutputCharacterW(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_WriteConsoleOutputW(HANDLE a0, CHAR_INFO* a1, COORD a2, COORD a3, PSMALL_RECT a4) { _PrintEnter("WriteConsoleOutputW(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_WriteConsoleOutputW(a0, a1, a2, a3, a4); } __finally { _PrintExit("WriteConsoleOutputW(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_WriteConsoleW(HANDLE a0, void* a1, DWORD a2, LPDWORD a3, LPVOID a4) { _PrintEnter("WriteConsoleW(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_WriteConsoleW(a0, a1, a2, a3, a4); } __finally { _PrintExit("WriteConsoleW(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_WriteFile(HANDLE a0, LPCVOID a1, DWORD a2, LPDWORD a3, LPOVERLAPPED a4) { _PrintEnter("WriteFile(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_WriteFile(a0, a1, a2, a3, a4); } __finally { _PrintExit("WriteFile(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_WriteFileEx(HANDLE a0, LPCVOID a1, DWORD a2, LPOVERLAPPED a3, LPOVERLAPPED_COMPLETION_ROUTINE a4) { _PrintEnter("WriteFileEx(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_WriteFileEx(a0, a1, a2, a3, a4); } __finally { _PrintExit("WriteFileEx(,,,,) -> %p\n", rv); }; return rv; } HRESULT __stdcall Mine_WriteFmtUserTypeStg(LPSTORAGE a0, CLIPFORMAT a1, LPOLESTR a2) { _PrintEnter("WriteFmtUserTypeStg(%p,%p,%p)\n", a0, a1, a2); HRESULT rv = 0; __try { rv = Real_WriteFmtUserTypeStg(a0, a1, a2); } __finally { _PrintExit("WriteFmtUserTypeStg(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_WritePrivateProfileSectionA(LPCSTR a0, LPCSTR a1, LPCSTR a2) { _PrintEnter("WritePrivateProfileSectionA(%hs,%hs,%hs)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_WritePrivateProfileSectionA(a0, a1, a2); } __finally { _PrintExit("WritePrivateProfileSectionA(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_WritePrivateProfileSectionW(LPCWSTR a0, LPCWSTR a1, LPCWSTR a2) { _PrintEnter("WritePrivateProfileSectionW(%ls,%ls,%ls)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_WritePrivateProfileSectionW(a0, a1, a2); } __finally { _PrintExit("WritePrivateProfileSectionW(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_WritePrivateProfileStringA(LPCSTR a0, LPCSTR a1, LPCSTR a2, LPCSTR a3) { _PrintEnter("WritePrivateProfileStringA(%hs,%hs,%hs,%hs)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_WritePrivateProfileStringA(a0, a1, a2, a3); } __finally { _PrintExit("WritePrivateProfileStringA(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_WritePrivateProfileStringW(LPCWSTR a0, LPCWSTR a1, LPCWSTR a2, LPCWSTR a3) { _PrintEnter("WritePrivateProfileStringW(%ls,%ls,%ls,%ls)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_WritePrivateProfileStringW(a0, a1, a2, a3); } __finally { _PrintExit("WritePrivateProfileStringW(,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_WritePrivateProfileStructA(LPCSTR a0, LPCSTR a1, LPVOID a2, UINT a3, LPCSTR a4) { _PrintEnter("WritePrivateProfileStructA(%hs,%hs,%p,%p,%hs)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_WritePrivateProfileStructA(a0, a1, a2, a3, a4); } __finally { _PrintExit("WritePrivateProfileStructA(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_WritePrivateProfileStructW(LPCWSTR a0, LPCWSTR a1, LPVOID a2, UINT a3, LPCWSTR a4) { _PrintEnter("WritePrivateProfileStructW(%ls,%ls,%p,%p,%ls)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_WritePrivateProfileStructW(a0, a1, a2, a3, a4); } __finally { _PrintExit("WritePrivateProfileStructW(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_WriteProcessMemory(HANDLE a0, LPVOID lpBase, LPVOID lpBuf, DWORD_PTR nSize, PDWORD_PTR a4) { _PrintEnter("WriteProcessMemory(%p,@%p..%p,%p,%p)\n", a0, lpBase, (PBYTE)lpBase + ((nSize > 0) ? nSize - 1 : 0), lpBuf, a4); BOOL rv = 0; __try { rv = Real_WriteProcessMemory(a0, lpBase, lpBuf, nSize, a4); } __finally { _PrintExit("WriteProcessMemory(,,,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_WriteProfileSectionA(LPCSTR a0, LPCSTR a1) { _PrintEnter("WriteProfileSectionA(%hs,%hs)\n", a0, a1); BOOL rv = 0; __try { rv = Real_WriteProfileSectionA(a0, a1); } __finally { _PrintExit("WriteProfileSectionA(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_WriteProfileSectionW(LPCWSTR a0, LPCWSTR a1) { _PrintEnter("WriteProfileSectionW(%ls,%ls)\n", a0, a1); BOOL rv = 0; __try { rv = Real_WriteProfileSectionW(a0, a1); } __finally { _PrintExit("WriteProfileSectionW(,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_WriteProfileStringA(LPCSTR a0, LPCSTR a1, LPCSTR a2) { _PrintEnter("WriteProfileStringA(%hs,%hs,%hs)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_WriteProfileStringA(a0, a1, a2); } __finally { _PrintExit("WriteProfileStringA(,,) -> %p\n", rv); }; return rv; } BOOL __stdcall Mine_WriteProfileStringW(LPCWSTR a0, LPCWSTR a1, LPCWSTR a2) { _PrintEnter("WriteProfileStringW(%ls,%ls,%ls)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_WriteProfileStringW(a0, a1, a2); } __finally { _PrintExit("WriteProfileStringW(,,) -> %p\n", rv); }; return rv; } DWORD __stdcall Mine_WriteTapemark(HANDLE a0, DWORD a1, DWORD a2, BOOL a3) { _PrintEnter("WriteTapemark(%p,%p,%p,%p)\n", a0, a1, a2, a3); DWORD rv = 0; __try { rv = Real_WriteTapemark(a0, a1, a2, a3); } __finally { _PrintExit("WriteTapemark(,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine___WSAFDIsSet(SOCKET a0, fd_set* a1) { _PrintEnter("__WSAFDIsSet(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real___WSAFDIsSet(a0, a1); } __finally { _PrintExit("__WSAFDIsSet(,) -> %p\n", rv); }; return rv; } long __stdcall Mine__hread(HFILE a0, LPVOID a1, long a2) { _PrintEnter("_hread(%p,%p,%p)\n", a0, a1, a2); long rv = 0; __try { rv = Real__hread(a0, a1, a2); } __finally { _PrintExit("_hread(,,) -> %p\n", rv); }; return rv; } long __stdcall Mine__hwrite(HFILE a0, LPCSTR a1, long a2) { _PrintEnter("_hwrite(%p,%hs,%p)\n", a0, a1, a2); long rv = 0; __try { rv = Real__hwrite(a0, a1, a2); } __finally { _PrintExit("_hwrite(,,) -> %p\n", rv); }; return rv; } HFILE __stdcall Mine__lclose(HFILE a0) { _PrintEnter("_lclose(%p)\n", a0); HFILE rv = 0; __try { rv = Real__lclose(a0); } __finally { _PrintExit("_lclose() -> %p\n", rv); }; return rv; } HFILE __stdcall Mine__lcreat(LPCSTR a0, int a1) { _PrintEnter("_lcreat(%hs,%p)\n", a0, a1); HFILE rv = 0; __try { rv = Real__lcreat(a0, a1); } __finally { _PrintExit("_lcreat(,) -> %p\n", rv); }; return rv; } LONG __stdcall Mine__llseek(HFILE a0, LONG a1, int a2) { _PrintEnter("_llseek(%p,%p,%p)\n", a0, a1, a2); LONG rv = 0; __try { rv = Real__llseek(a0, a1, a2); } __finally { _PrintExit("_llseek(,,) -> %p\n", rv); }; return rv; } HFILE __stdcall Mine__lopen(LPCSTR a0, int a1) { _PrintEnter("_lopen(%hs,%p)\n", a0, a1); HFILE rv = 0; __try { rv = Real__lopen(a0, a1); } __finally { _PrintExit("_lopen(,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine__lread(HFILE a0, LPVOID a1, UINT a2) { _PrintEnter("_lread(%p,%p,%p)\n", a0, a1, a2); UINT rv = 0; __try { rv = Real__lread(a0, a1, a2); } __finally { _PrintExit("_lread(,,) -> %p\n", rv); }; return rv; } UINT __stdcall Mine__lwrite(HFILE a0, LPCSTR a1, UINT a2) { _PrintEnter("_lwrite(%p,%hs,%p)\n", a0, a1, a2); UINT rv = 0; __try { rv = Real__lwrite(a0, a1, a2); } __finally { _PrintExit("_lwrite(,,) -> %p\n", rv); }; return rv; } SOCKET __stdcall Mine_accept(SOCKET a0, sockaddr* a1, int* a2) { _PrintEnter("accept(%p,%p,%p)\n", a0, a1, a2); SOCKET rv = 0; __try { rv = Real_accept(a0, a1, a2); } __finally { _PrintExit("accept(,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_bind(SOCKET a0, sockaddr* a1, int a2) { _PrintEnter("bind(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_bind(a0, a1, a2); } __finally { _PrintExit("bind(,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_closesocket(SOCKET a0) { _PrintEnter("closesocket(%p)\n", a0); int rv = 0; __try { rv = Real_closesocket(a0); } __finally { _PrintExit("closesocket() -> %p\n", rv); }; return rv; } int __stdcall Mine_connect(SOCKET a0, sockaddr* a1, int a2) { _PrintEnter("connect(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_connect(a0, a1, a2); } __finally { _PrintExit("connect(,,) -> %p\n", rv); }; return rv; } hostent* __stdcall Mine_gethostbyaddr(char* a0, int a1, int a2) { _PrintEnter("gethostbyaddr(%p,%p,%p)\n", a0, a1, a2); hostent* rv = 0; __try { rv = Real_gethostbyaddr(a0, a1, a2); } __finally { _PrintExit("gethostbyaddr(,,) -> %p\n", rv); }; return rv; } hostent* __stdcall Mine_gethostbyname(char* a0) { _PrintEnter("gethostbyname(%p)\n", a0); hostent* rv = 0; __try { rv = Real_gethostbyname(a0); } __finally { _PrintExit("gethostbyname() -> %p\n", rv); }; return rv; } int __stdcall Mine_gethostname(char* a0, int a1) { _PrintEnter("gethostname(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real_gethostname(a0, a1); } __finally { _PrintExit("gethostname(,) -> %p\n", rv); }; return rv; } int __stdcall Mine_getpeername(SOCKET a0, sockaddr* a1, int* a2) { _PrintEnter("getpeername(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_getpeername(a0, a1, a2); } __finally { _PrintExit("getpeername(,,) -> %p\n", rv); }; return rv; } protoent* __stdcall Mine_getprotobyname(char* a0) { _PrintEnter("getprotobyname(%p)\n", a0); protoent* rv = 0; __try { rv = Real_getprotobyname(a0); } __finally { _PrintExit("getprotobyname() -> %p\n", rv); }; return rv; } protoent* __stdcall Mine_getprotobynumber(int a0) { _PrintEnter("getprotobynumber(%p)\n", a0); protoent* rv = 0; __try { rv = Real_getprotobynumber(a0); } __finally { _PrintExit("getprotobynumber() -> %p\n", rv); }; return rv; } servent* __stdcall Mine_getservbyname(char* a0, char* a1) { _PrintEnter("getservbyname(%p,%p)\n", a0, a1); servent* rv = 0; __try { rv = Real_getservbyname(a0, a1); } __finally { _PrintExit("getservbyname(,) -> %p\n", rv); }; return rv; } servent* __stdcall Mine_getservbyport(int a0, char* a1) { _PrintEnter("getservbyport(%p,%p)\n", a0, a1); servent* rv = 0; __try { rv = Real_getservbyport(a0, a1); } __finally { _PrintExit("getservbyport(,) -> %p\n", rv); }; return rv; } int __stdcall Mine_getsockname(SOCKET a0, sockaddr* a1, int* a2) { _PrintEnter("getsockname(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_getsockname(a0, a1, a2); } __finally { _PrintExit("getsockname(,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_getsockopt(SOCKET a0, int a1, int a2, char* a3, int* a4) { _PrintEnter("getsockopt(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); int rv = 0; __try { rv = Real_getsockopt(a0, a1, a2, a3, a4); } __finally { _PrintExit("getsockopt(,,,,) -> %p\n", rv); }; return rv; } u_long __stdcall Mine_htonl(u_long a0) { _PrintEnter("htonl(%p)\n", a0); u_long rv = 0; __try { rv = Real_htonl(a0); } __finally { _PrintExit("htonl() -> %p\n", rv); }; return rv; } u_short __stdcall Mine_htons(u_short a0) { _PrintEnter("htons(%p)\n", a0); u_short rv = 0; __try { rv = Real_htons(a0); } __finally { _PrintExit("htons() -> %p\n", rv); }; return rv; } unsigned long __stdcall Mine_inet_addr(char* a0) { _PrintEnter("inet_addr(%p)\n", a0); unsigned long rv = 0; __try { rv = Real_inet_addr(a0); } __finally { _PrintExit("inet_addr() -> %p\n", rv); }; return rv; } char* __stdcall Mine_inet_ntoa(in_addr a0) { _PrintEnter("inet_ntoa(%p)\n", a0); char* rv = 0; __try { rv = Real_inet_ntoa(a0); } __finally { _PrintExit("inet_ntoa() -> %p\n", rv); }; return rv; } int __stdcall Mine_ioctlsocket(SOCKET a0, long a1, u_long* a2) { _PrintEnter("ioctlsocket(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_ioctlsocket(a0, a1, a2); } __finally { _PrintExit("ioctlsocket(,,) -> %p\n", rv); }; return rv; } void __stdcall Mine_keybd_event(BYTE a0, BYTE a1, DWORD a2, ULONG_PTR a3) { _PrintEnter("keybd_event(%p,%p,%p,%p)\n", a0, a1, a2, a3); __try { Real_keybd_event(a0, a1, a2, a3); } __finally { _PrintExit("keybd_event(,,,) ->\n"); }; } int __stdcall Mine_listen(SOCKET a0, int a1) { _PrintEnter("listen(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real_listen(a0, a1); } __finally { _PrintExit("listen(,) -> %p\n", rv); }; return rv; } void __stdcall Mine_mouse_event(DWORD a0, DWORD a1, DWORD a2, DWORD a3, ULONG_PTR a4) { _PrintEnter("mouse_event(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); __try { Real_mouse_event(a0, a1, a2, a3, a4); } __finally { _PrintExit("mouse_event(,,,,) ->\n"); }; } u_long __stdcall Mine_ntohl(u_long a0) { _PrintEnter("ntohl(%p)\n", a0); u_long rv = 0; __try { rv = Real_ntohl(a0); } __finally { _PrintExit("ntohl() -> %p\n", rv); }; return rv; } u_short __stdcall Mine_ntohs(u_short a0) { _PrintEnter("ntohs(%p)\n", a0); u_short rv = 0; __try { rv = Real_ntohs(a0); } __finally { _PrintExit("ntohs() -> %p\n", rv); }; return rv; } int __stdcall Mine_recv(SOCKET a0, char* a1, int a2, int a3) { _PrintEnter("recv(%p,%p,%p,%p)\n", a0, a1, a2, a3); int rv = 0; __try { rv = Real_recv(a0, a1, a2, a3); } __finally { _PrintExit("recv(,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_recvfrom(SOCKET a0, char* a1, int a2, int a3, sockaddr* a4, int* a5) { _PrintEnter("recvfrom(%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); int rv = 0; __try { rv = Real_recvfrom(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("recvfrom(,,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_select(int a0, fd_set* a1, fd_set* a2, fd_set* a3, timeval* a4) { _PrintEnter("select(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); int rv = 0; __try { rv = Real_select(a0, a1, a2, a3, a4); } __finally { _PrintExit("select(,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_send(SOCKET a0, char* a1, int a2, int a3) { _PrintEnter("send(%p,%p,%p,%p)\n", a0, a1, a2, a3); int rv = 0; __try { rv = Real_send(a0, a1, a2, a3); } __finally { _PrintExit("send(,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_sendto(SOCKET a0, char* a1, int a2, int a3, sockaddr* a4, int a5) { _PrintEnter("sendto(%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5); int rv = 0; __try { rv = Real_sendto(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("sendto(,,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_setsockopt(SOCKET a0, int a1, int a2, char* a3, int a4) { _PrintEnter("setsockopt(%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4); int rv = 0; __try { rv = Real_setsockopt(a0, a1, a2, a3, a4); } __finally { _PrintExit("setsockopt(,,,,) -> %p\n", rv); }; return rv; } int __stdcall Mine_shutdown(SOCKET a0, int a1) { _PrintEnter("shutdown(%p,%p)\n", a0, a1); int rv = 0; __try { rv = Real_shutdown(a0, a1); } __finally { _PrintExit("shutdown(,) -> %p\n", rv); }; return rv; } SOCKET __stdcall Mine_socket(int a0, int a1, int a2) { _PrintEnter("socket(%x,%x,%x)\n", a0, a1, a2); SOCKET rv = 0; __try { rv = Real_socket(a0, a1, a2); } __finally { _PrintExit("socket(,,) -> %p\n", rv); }; return rv; } ////////////////////////////////////////////////////////////// AttachDetours. // static PCHAR DetRealName(PCHAR psz) { PCHAR pszBeg = psz; // Move to end of name. while (*psz) { psz++; } // Move back through A-Za-z0-9 names. while (psz > pszBeg && ((psz[-1] >= 'A' && psz[-1] <= 'Z') || (psz[-1] >= 'a' && psz[-1] <= 'z') || (psz[-1] >= '0' && psz[-1] <= '9'))) { psz--; } return psz; } static VOID Dump(PBYTE pbBytes, LONG nBytes, PBYTE pbTarget) { CHAR szBuffer[256]; PCHAR pszBuffer = szBuffer; for (LONG n = 0; n < nBytes; n += 12) { pszBuffer += StringCchPrintfA(pszBuffer, sizeof(szBuffer), " %p: ", pbBytes + n); for (LONG m = n; m < n + 12; m++) { if (m >= nBytes) { pszBuffer += StringCchPrintfA(pszBuffer, sizeof(szBuffer), " "); } else { pszBuffer += StringCchPrintfA(pszBuffer, sizeof(szBuffer), "%02x ", pbBytes[m]); } } if (n == 0) { pszBuffer += StringCchPrintfA(pszBuffer, sizeof(szBuffer), "[%p]", pbTarget); } pszBuffer += StringCchPrintfA(pszBuffer, sizeof(szBuffer), "\n"); } Syelog(SYELOG_SEVERITY_INFORMATION, "%s", szBuffer); } static VOID Decode(PBYTE pbCode, LONG nInst) { PBYTE pbSrc = pbCode; PBYTE pbEnd; PBYTE pbTarget; for (LONG n = 0; n < nInst; n++) { pbTarget = NULL; pbEnd = (PBYTE)DetourCopyInstruction(NULL, NULL, (PVOID)pbSrc, (PVOID*)&pbTarget, NULL); Dump(pbSrc, (int)(pbEnd - pbSrc), pbTarget); pbSrc = pbEnd; if (pbTarget != NULL) { break; } } } VOID DetAttach(PVOID *ppvReal, PVOID pvMine, PCHAR psz) { PVOID pvReal = NULL; if (ppvReal == NULL) { ppvReal = &pvReal; } LONG l = DetourAttach(ppvReal, pvMine); if (l != 0) { Syelog(SYELOG_SEVERITY_NOTICE, "Attach failed: `%s': error %d\n", DetRealName(psz), l); Decode((PBYTE)*ppvReal, 3); } } VOID DetDetach(PVOID *ppvReal, PVOID pvMine, PCHAR psz) { LONG l = DetourDetach(ppvReal, pvMine); if (l != 0) { #if 0 Syelog(SYELOG_SEVERITY_NOTICE, "Detach failed: `%s': error %d\n", DetRealName(psz), l); #else (void)psz; #endif } } #define ATTACH(x) DetAttach(&(PVOID&)Real_##x,Mine_##x,#x) #define DETACH(x) DetDetach(&(PVOID&)Real_##x,Mine_##x,#x) LONG AttachDetours(VOID) { DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); // For this many APIs, we'll ignore one or two can't be detoured. DetourSetIgnoreTooSmall(TRUE); ATTACH(AbortDoc); ATTACH(AbortPath); ATTACH(ActivateKeyboardLayout); ATTACH(AddAtomA); ATTACH(AddAtomW); ATTACH(AddFontResourceA); ATTACH(AddFontResourceW); ATTACH(AdjustWindowRect); ATTACH(AdjustWindowRectEx); ATTACH(AllocConsole); ATTACH(AngleArc); ATTACH(AnimatePalette); ATTACH(AnyPopup); ATTACH(AppendMenuA); ATTACH(AppendMenuW); ATTACH(Arc); ATTACH(ArcTo); ATTACH(AreFileApisANSI); ATTACH(ArrangeIconicWindows); ATTACH(AttachThreadInput); ATTACH(BackupRead); ATTACH(BackupSeek); ATTACH(BackupWrite); ATTACH(Beep); ATTACH(BeginDeferWindowPos); ATTACH(BeginPaint); ATTACH(BeginPath); ATTACH(BeginUpdateResourceA); ATTACH(BeginUpdateResourceW); ATTACH(BindMoniker); ATTACH(BitBlt); ATTACH(BringWindowToTop); ATTACH(BroadcastSystemMessageA); ATTACH(BroadcastSystemMessageW); ATTACH(BuildCommDCBA); ATTACH(BuildCommDCBAndTimeoutsA); ATTACH(BuildCommDCBAndTimeoutsW); ATTACH(BuildCommDCBW); ATTACH(CLSIDFromProgID); ATTACH(CLSIDFromString); ATTACH(CallMsgFilterA); ATTACH(CallMsgFilterW); ATTACH(CallNamedPipeA); ATTACH(CallNamedPipeW); ATTACH(CallNextHookEx); ATTACH(CallWindowProcA); ATTACH(CallWindowProcW); ATTACH(CancelDC); ATTACH(CancelIo); ATTACH(CancelWaitableTimer); ATTACH(CascadeWindows); ATTACH(ChangeClipboardChain); ATTACH(ChangeDisplaySettingsA); ATTACH(ChangeDisplaySettingsExA); ATTACH(ChangeDisplaySettingsExW); ATTACH(ChangeDisplaySettingsW); ATTACH(ChangeMenuA); ATTACH(ChangeMenuW); ATTACH(CharLowerA); ATTACH(CharLowerBuffA); ATTACH(CharLowerBuffW); ATTACH(CharLowerW); ATTACH(CharNextA); ATTACH(CharNextExA); ATTACH(CharNextW); ATTACH(CharPrevA); ATTACH(CharPrevExA); ATTACH(CharPrevW); ATTACH(CharToOemA); ATTACH(CharToOemBuffA); ATTACH(CharToOemBuffW); ATTACH(CharToOemW); ATTACH(CharUpperA); ATTACH(CharUpperBuffA); ATTACH(CharUpperBuffW); ATTACH(CharUpperW); ATTACH(CheckColorsInGamut); ATTACH(CheckDlgButton); ATTACH(CheckMenuItem); ATTACH(CheckMenuRadioItem); ATTACH(CheckRadioButton); ATTACH(ChildWindowFromPoint); ATTACH(ChildWindowFromPointEx); ATTACH(ChoosePixelFormat); ATTACH(Chord); ATTACH(ClearCommBreak); ATTACH(ClearCommError); ATTACH(ClientToScreen); ATTACH(ClipCursor); ATTACH(CloseClipboard); ATTACH(CloseDesktop); ATTACH(CloseEnhMetaFile); ATTACH(CloseFigure); ATTACH(CloseHandle); ATTACH(CloseMetaFile); ATTACH(CloseWindow); ATTACH(CloseWindowStation); ATTACH(CoAddRefServerProcess); ATTACH(CoBuildVersion); ATTACH(CoCopyProxy); ATTACH(CoCreateFreeThreadedMarshaler); ATTACH(CoCreateGuid); ATTACH(CoCreateInstance); ATTACH(CoCreateInstanceEx); ATTACH(CoDisconnectObject); ATTACH(CoDosDateTimeToFileTime); ATTACH(CoFileTimeNow); ATTACH(CoFileTimeToDosDateTime); ATTACH(CoFreeAllLibraries); ATTACH(CoFreeLibrary); ATTACH(CoFreeUnusedLibraries); ATTACH(CoGetCallContext); ATTACH(CoGetClassObject); ATTACH(CoGetCurrentProcess); ATTACH(CoGetInstanceFromFile); ATTACH(CoGetInstanceFromIStorage); ATTACH(CoGetInterfaceAndReleaseStream); ATTACH(CoGetMalloc); ATTACH(CoGetMarshalSizeMax); ATTACH(CoGetObject); ATTACH(CoGetPSClsid); ATTACH(CoGetStandardMarshal); ATTACH(CoGetStdMarshalEx); ATTACH(CoGetTreatAsClass); ATTACH(CoImpersonateClient); ATTACH(CoInitialize); ATTACH(CoInitializeEx); ATTACH(CoInitializeSecurity); ATTACH(CoIsHandlerConnected); ATTACH(CoIsOle1Class); ATTACH(CoLoadLibrary); ATTACH(CoLockObjectExternal); ATTACH(CoMarshalHresult); ATTACH(CoMarshalInterThreadInterfaceInStream); ATTACH(CoMarshalInterface); ATTACH(CoQueryAuthenticationServices); ATTACH(CoQueryClientBlanket); ATTACH(CoQueryProxyBlanket); ATTACH(CoRegisterChannelHook); ATTACH(CoRegisterClassObject); ATTACH(CoRegisterMallocSpy); ATTACH(CoRegisterMessageFilter); ATTACH(CoRegisterPSClsid); ATTACH(CoRegisterSurrogate); ATTACH(CoReleaseMarshalData); ATTACH(CoReleaseServerProcess); ATTACH(CoResumeClassObjects); ATTACH(CoRevertToSelf); ATTACH(CoRevokeClassObject); ATTACH(CoRevokeMallocSpy); ATTACH(CoSetProxyBlanket); ATTACH(CoSuspendClassObjects); ATTACH(CoSwitchCallContext); ATTACH(CoTaskMemAlloc); ATTACH(CoTaskMemFree); ATTACH(CoTaskMemRealloc); ATTACH(CoTreatAsClass); ATTACH(CoUninitialize); ATTACH(CoUnmarshalHresult); ATTACH(CoUnmarshalInterface); ATTACH(ColorMatchToTarget); ATTACH(CombineRgn); ATTACH(CombineTransform); ATTACH(CommConfigDialogA); ATTACH(CommConfigDialogW); ATTACH(CompareFileTime); ATTACH(CompareStringA); ATTACH(CompareStringW); ATTACH(ConnectNamedPipe); #if !defined(DETOURS_ARM) ATTACH(ContinueDebugEvent); #endif // !DETOURS_ARM ATTACH(ConvertDefaultLocale); ATTACH(ConvertThreadToFiber); ATTACH(CopyAcceleratorTableA); ATTACH(CopyAcceleratorTableW); ATTACH(CopyEnhMetaFileA); ATTACH(CopyEnhMetaFileW); ATTACH(CopyFileA); ATTACH(CopyFileExA); ATTACH(CopyFileExW); ATTACH(CopyFileW); ATTACH(CopyIcon); ATTACH(CopyImage); ATTACH(CopyMetaFileA); ATTACH(CopyMetaFileW); ATTACH(CopyRect); ATTACH(CountClipboardFormats); ATTACH(CreateAcceleratorTableA); ATTACH(CreateAcceleratorTableW); ATTACH(CreateAntiMoniker); ATTACH(CreateBindCtx); ATTACH(CreateBitmap); ATTACH(CreateBitmapIndirect); ATTACH(CreateBrushIndirect); ATTACH(CreateCaret); ATTACH(CreateClassMoniker); ATTACH(CreateColorSpaceA); ATTACH(CreateColorSpaceW); ATTACH(CreateCompatibleBitmap); ATTACH(CreateCompatibleDC); ATTACH(CreateConsoleScreenBuffer); ATTACH(CreateCursor); ATTACH(CreateDCA); ATTACH(CreateDCW); ATTACH(CreateDIBPatternBrush); ATTACH(CreateDIBPatternBrushPt); ATTACH(CreateDIBSection); ATTACH(CreateDIBitmap); ATTACH(CreateDataAdviseHolder); ATTACH(CreateDataCache); ATTACH(CreateDesktopA); ATTACH(CreateDesktopW); ATTACH(CreateDialogIndirectParamA); ATTACH(CreateDialogIndirectParamW); ATTACH(CreateDialogParamA); ATTACH(CreateDialogParamW); ATTACH(CreateDirectoryA); ATTACH(CreateDirectoryExA); ATTACH(CreateDirectoryExW); ATTACH(CreateDirectoryW); ATTACH(CreateDiscardableBitmap); ATTACH(CreateEllipticRgn); ATTACH(CreateEllipticRgnIndirect); ATTACH(CreateEnhMetaFileA); ATTACH(CreateEnhMetaFileW); ATTACH(CreateEventA); ATTACH(CreateEventW); ATTACH(CreateFiber); ATTACH(CreateFileA); ATTACH(CreateFileMappingA); ATTACH(CreateFileMappingW); ATTACH(CreateFileMoniker); ATTACH(CreateFileW); ATTACH(CreateFontA); ATTACH(CreateFontIndirectA); ATTACH(CreateFontIndirectW); ATTACH(CreateFontW); ATTACH(CreateGenericComposite); ATTACH(CreateHalftonePalette); ATTACH(CreateHatchBrush); ATTACH(CreateICA); ATTACH(CreateICW); ATTACH(CreateILockBytesOnHGlobal); ATTACH(CreateIcon); ATTACH(CreateIconFromResource); ATTACH(CreateIconFromResourceEx); ATTACH(CreateIconIndirect); ATTACH(CreateIoCompletionPort); ATTACH(CreateItemMoniker); ATTACH(CreateMDIWindowA); ATTACH(CreateMDIWindowW); ATTACH(CreateMailslotA); ATTACH(CreateMailslotW); ATTACH(CreateMenu); ATTACH(CreateMetaFileA); ATTACH(CreateMetaFileW); ATTACH(CreateMutexA); ATTACH(CreateMutexW); ATTACH(CreateNamedPipeA); ATTACH(CreateNamedPipeW); ATTACH(CreateOleAdviseHolder); ATTACH(CreatePalette); ATTACH(CreatePatternBrush); ATTACH(CreatePen); ATTACH(CreatePenIndirect); ATTACH(CreatePipe); ATTACH(CreatePointerMoniker); ATTACH(CreatePolyPolygonRgn); ATTACH(CreatePolygonRgn); ATTACH(CreatePopupMenu); ATTACH(CreateProcessA); ATTACH(CreateProcessW); ATTACH(CreateProcessAsUserA); ATTACH(CreateProcessAsUserW); #if(_WIN32_WINNT >= 0x0500) ATTACH(CreateProcessWithLogonW); ATTACH(CreateProcessWithTokenW); #endif //(_WIN32_WINNT >= 0x0500) ATTACH(CreateRectRgn); ATTACH(CreateRectRgnIndirect); ATTACH(CreateRemoteThread); ATTACH(CreateRoundRectRgn); ATTACH(CreateScalableFontResourceA); ATTACH(CreateScalableFontResourceW); ATTACH(CreateSemaphoreA); ATTACH(CreateSemaphoreW); ATTACH(CreateSolidBrush); ATTACH(CreateStdProgressIndicator); ATTACH(CreateStreamOnHGlobal); ATTACH(CreateTapePartition); ATTACH(CreateThread); ATTACH(CreateWaitableTimerA); ATTACH(CreateWaitableTimerW); ATTACH(CreateWindowExA); ATTACH(CreateWindowExW); ATTACH(CreateWindowStationA); ATTACH(CreateWindowStationW); ATTACH(DPtoLP); ATTACH(DdeAbandonTransaction); ATTACH(DdeAccessData); ATTACH(DdeAddData); ATTACH(DdeClientTransaction); ATTACH(DdeCmpStringHandles); ATTACH(DdeConnect); ATTACH(DdeConnectList); ATTACH(DdeCreateDataHandle); ATTACH(DdeCreateStringHandleA); ATTACH(DdeCreateStringHandleW); ATTACH(DdeDisconnect); ATTACH(DdeDisconnectList); ATTACH(DdeEnableCallback); ATTACH(DdeFreeDataHandle); ATTACH(DdeFreeStringHandle); ATTACH(DdeGetData); ATTACH(DdeGetLastError); ATTACH(DdeImpersonateClient); ATTACH(DdeKeepStringHandle); ATTACH(DdeNameService); ATTACH(DdePostAdvise); ATTACH(DdeQueryConvInfo); ATTACH(DdeQueryNextServer); ATTACH(DdeQueryStringA); ATTACH(DdeQueryStringW); ATTACH(DdeReconnect); ATTACH(DdeSetQualityOfService); ATTACH(DdeSetUserHandle); ATTACH(DdeUnaccessData); ATTACH(DdeUninitialize); ATTACH(DebugActiveProcess); ATTACH(DebugActiveProcessStop); ATTACH(DebugBreak); ATTACH(DefDlgProcA); ATTACH(DefDlgProcW); ATTACH(DefFrameProcA); ATTACH(DefFrameProcW); ATTACH(DefMDIChildProcA); ATTACH(DefMDIChildProcW); ATTACH(DefWindowProcA); ATTACH(DefWindowProcW); ATTACH(DeferWindowPos); ATTACH(DefineDosDeviceA); ATTACH(DefineDosDeviceW); ATTACH(DeleteAtom); ATTACH(DeleteColorSpace); ATTACH(DeleteDC); ATTACH(DeleteEnhMetaFile); ATTACH(DeleteFiber); ATTACH(DeleteFileA); ATTACH(DeleteFileW); ATTACH(DeleteMenu); ATTACH(DeleteMetaFile); ATTACH(DeleteObject); ATTACH(DescribePixelFormat); ATTACH(DestroyAcceleratorTable); ATTACH(DestroyCaret); ATTACH(DestroyCursor); ATTACH(DestroyIcon); ATTACH(DestroyMenu); ATTACH(DestroyWindow); ATTACH(DeviceIoControl); ATTACH(DialogBoxIndirectParamA); ATTACH(DialogBoxIndirectParamW); ATTACH(DialogBoxParamA); ATTACH(DialogBoxParamW); ATTACH(DisableThreadLibraryCalls); ATTACH(DisconnectNamedPipe); ATTACH(DispatchMessageA); ATTACH(DispatchMessageW); ATTACH(DlgDirListA); ATTACH(DlgDirListComboBoxA); ATTACH(DlgDirListComboBoxW); ATTACH(DlgDirListW); ATTACH(DlgDirSelectComboBoxExA); ATTACH(DlgDirSelectComboBoxExW); ATTACH(DlgDirSelectExA); ATTACH(DlgDirSelectExW); ATTACH(DoDragDrop); ATTACH(DosDateTimeToFileTime); ATTACH(DragDetect); ATTACH(DragObject); ATTACH(DrawAnimatedRects); ATTACH(DrawCaption); ATTACH(DrawEdge); ATTACH(DrawEscape); ATTACH(DrawFocusRect); ATTACH(DrawFrameControl); ATTACH(DrawIcon); ATTACH(DrawIconEx); ATTACH(DrawMenuBar); ATTACH(DrawStateA); ATTACH(DrawStateW); ATTACH(DrawTextA); ATTACH(DrawTextExA); ATTACH(DrawTextExW); ATTACH(DrawTextW); ATTACH(DuplicateHandle); ATTACH(Ellipse); ATTACH(EmptyClipboard); ATTACH(EnableMenuItem); ATTACH(EnableScrollBar); ATTACH(EnableWindow); ATTACH(EndDeferWindowPos); ATTACH(EndDialog); ATTACH(EndDoc); ATTACH(EndPage); ATTACH(EndPaint); ATTACH(EndPath); ATTACH(EndUpdateResourceA); ATTACH(EndUpdateResourceW); ATTACH(EnumCalendarInfoA); ATTACH(EnumCalendarInfoW); ATTACH(EnumChildWindows); ATTACH(EnumClipboardFormats); ATTACH(EnumDateFormatsA); ATTACH(EnumDateFormatsW); ATTACH(EnumDesktopWindows); ATTACH(EnumDesktopsA); ATTACH(EnumDesktopsW); ATTACH(EnumDisplaySettingsA); ATTACH(EnumDisplaySettingsW); ATTACH(EnumEnhMetaFile); ATTACH(EnumFontFamiliesA); ATTACH(EnumFontFamiliesExA); ATTACH(EnumFontFamiliesExW); ATTACH(EnumFontFamiliesW); ATTACH(EnumFontsA); ATTACH(EnumFontsW); ATTACH(EnumICMProfilesA); ATTACH(EnumICMProfilesW); ATTACH(EnumMetaFile); ATTACH(EnumObjects); ATTACH(EnumPropsA); ATTACH(EnumPropsExA); ATTACH(EnumPropsExW); ATTACH(EnumPropsW); ATTACH(EnumResourceLanguagesA); ATTACH(EnumResourceLanguagesW); ATTACH(EnumResourceNamesA); ATTACH(EnumResourceNamesW); ATTACH(EnumResourceTypesA); ATTACH(EnumResourceTypesW); ATTACH(EnumSystemCodePagesA); ATTACH(EnumSystemCodePagesW); #if(WINVER >= 0x0500) ATTACH(EnumSystemLocalesA); ATTACH(EnumSystemLocalesW); #endif // (WINVER >= 0x0500) ATTACH(EnumThreadWindows); ATTACH(EnumTimeFormatsA); ATTACH(EnumTimeFormatsW); ATTACH(EnumWindowStationsA); ATTACH(EnumWindowStationsW); ATTACH(EnumWindows); ATTACH(EqualRect); ATTACH(EqualRgn); ATTACH(EraseTape); ATTACH(Escape); ATTACH(EscapeCommFunction); ATTACH(ExcludeClipRect); ATTACH(ExcludeUpdateRgn); ATTACH(ExitProcess); ATTACH(ExitThread); ATTACH(ExitWindowsEx); ATTACH(ExpandEnvironmentStringsA); ATTACH(ExpandEnvironmentStringsW); ATTACH(ExtCreatePen); ATTACH(ExtCreateRegion); ATTACH(ExtEscape); ATTACH(ExtFloodFill); ATTACH(ExtSelectClipRgn); ATTACH(ExtTextOutA); ATTACH(ExtTextOutW); ATTACH(FatalAppExitA); ATTACH(FatalAppExitW); ATTACH(FatalExit); ATTACH(FileTimeToDosDateTime); ATTACH(FileTimeToLocalFileTime); ATTACH(FileTimeToSystemTime); ATTACH(FillConsoleOutputAttribute); ATTACH(FillConsoleOutputCharacterA); ATTACH(FillConsoleOutputCharacterW); ATTACH(FillPath); ATTACH(FillRect); ATTACH(FillRgn); ATTACH(FindAtomA); ATTACH(FindAtomW); ATTACH(FindClose); ATTACH(FindCloseChangeNotification); ATTACH(FindFirstChangeNotificationA); ATTACH(FindFirstChangeNotificationW); ATTACH(FindFirstFileA); ATTACH(FindFirstFileExA); ATTACH(FindFirstFileExW); ATTACH(FindFirstFileW); ATTACH(FindNextChangeNotification); ATTACH(FindNextFileA); ATTACH(FindNextFileW); ATTACH(FindResourceA); ATTACH(FindResourceExA); ATTACH(FindResourceExW); ATTACH(FindResourceW); ATTACH(FindWindowA); ATTACH(FindWindowExA); ATTACH(FindWindowExW); ATTACH(FindWindowW); ATTACH(FixBrushOrgEx); ATTACH(FlashWindow); ATTACH(FlattenPath); ATTACH(FloodFill); ATTACH(FlushConsoleInputBuffer); ATTACH(FlushFileBuffers); ATTACH(FlushViewOfFile); ATTACH(FmtIdToPropStgName); ATTACH(FoldStringA); ATTACH(FoldStringW); ATTACH(FormatMessageA); ATTACH(FormatMessageW); ATTACH(FrameRect); ATTACH(FrameRgn); ATTACH(FreeConsole); ATTACH(FreeDDElParam); ATTACH(FreeEnvironmentStringsA); ATTACH(FreeEnvironmentStringsW); ATTACH(FreeLibrary); ATTACH(FreeLibraryAndExitThread); ATTACH(FreePropVariantArray); ATTACH(FreeResource); ATTACH(GdiComment); ATTACH(GdiFlush); ATTACH(GdiGetBatchLimit); ATTACH(GdiSetBatchLimit); ATTACH(GenerateConsoleCtrlEvent); ATTACH(GetACP); ATTACH(GetActiveWindow); ATTACH(GetArcDirection); ATTACH(GetAspectRatioFilterEx); ATTACH(GetAsyncKeyState); ATTACH(GetAtomNameA); ATTACH(GetAtomNameW); ATTACH(GetBinaryTypeA); ATTACH(GetBinaryTypeW); ATTACH(GetBitmapBits); ATTACH(GetBitmapDimensionEx); ATTACH(GetBkColor); ATTACH(GetBkMode); ATTACH(GetBoundsRect); ATTACH(GetBrushOrgEx); ATTACH(GetCPInfo); ATTACH(GetCapture); ATTACH(GetCaretBlinkTime); ATTACH(GetCaretPos); ATTACH(GetCharABCWidthsA); ATTACH(GetCharABCWidthsFloatA); ATTACH(GetCharABCWidthsFloatW); ATTACH(GetCharABCWidthsW); ATTACH(GetCharWidth32A); ATTACH(GetCharWidth32W); ATTACH(GetCharWidthA); ATTACH(GetCharWidthFloatA); ATTACH(GetCharWidthFloatW); ATTACH(GetCharWidthW); ATTACH(GetCharacterPlacementA); ATTACH(GetCharacterPlacementW); ATTACH(GetClassFile); ATTACH(GetClassInfoA); ATTACH(GetClassInfoExA); ATTACH(GetClassInfoExW); ATTACH(GetClassInfoW); ATTACH(GetClassLongA); ATTACH(GetClassLongW); ATTACH(GetClassNameA); ATTACH(GetClassNameW); ATTACH(GetClassWord); ATTACH(GetClientRect); ATTACH(GetClipBox); ATTACH(GetClipCursor); ATTACH(GetClipRgn); ATTACH(GetClipboardData); ATTACH(GetClipboardFormatNameA); ATTACH(GetClipboardFormatNameW); ATTACH(GetClipboardOwner); ATTACH(GetClipboardViewer); ATTACH(GetColorAdjustment); ATTACH(GetColorSpace); ATTACH(GetCommConfig); ATTACH(GetCommMask); ATTACH(GetCommModemStatus); ATTACH(GetCommProperties); ATTACH(GetCommState); ATTACH(GetCommTimeouts); ATTACH(GetCommandLineA); ATTACH(GetCommandLineW); ATTACH(GetComputerNameA); ATTACH(GetComputerNameW); ATTACH(GetConsoleCP); ATTACH(GetConsoleCursorInfo); ATTACH(GetConsoleMode); ATTACH(GetConsoleOutputCP); ATTACH(GetConsoleScreenBufferInfo); ATTACH(GetConsoleTitleA); ATTACH(GetConsoleTitleW); ATTACH(GetConvertStg); ATTACH(GetCurrencyFormatA); ATTACH(GetCurrencyFormatW); ATTACH(GetCurrentDirectoryA); ATTACH(GetCurrentDirectoryW); ATTACH(GetCurrentObject); ATTACH(GetCurrentPositionEx); ATTACH(GetCurrentProcess); ATTACH(GetCurrentProcessId); ATTACH(GetCurrentThreadId); ATTACH(GetCursor); ATTACH(GetCursorPos); ATTACH(GetDC); ATTACH(GetDCEx); ATTACH(GetDCOrgEx); ATTACH(GetDIBColorTable); ATTACH(GetDIBits); ATTACH(GetDateFormatA); ATTACH(GetDateFormatW); ATTACH(GetDefaultCommConfigA); ATTACH(GetDefaultCommConfigW); ATTACH(GetDesktopWindow); ATTACH(GetDeviceCaps); ATTACH(GetDeviceGammaRamp); ATTACH(GetDialogBaseUnits); ATTACH(GetDiskFreeSpaceA); ATTACH(GetDiskFreeSpaceExA); ATTACH(GetDiskFreeSpaceExW); ATTACH(GetDiskFreeSpaceW); ATTACH(GetDlgCtrlID); ATTACH(GetDlgItem); ATTACH(GetDlgItemInt); ATTACH(GetDlgItemTextA); ATTACH(GetDlgItemTextW); ATTACH(GetDoubleClickTime); ATTACH(GetDriveTypeA); ATTACH(GetDriveTypeW); ATTACH(GetEnhMetaFileA); ATTACH(GetEnhMetaFileBits); ATTACH(GetEnhMetaFileDescriptionA); ATTACH(GetEnhMetaFileDescriptionW); ATTACH(GetEnhMetaFileHeader); ATTACH(GetEnhMetaFilePaletteEntries); ATTACH(GetEnhMetaFilePixelFormat); ATTACH(GetEnhMetaFileW); ATTACH(GetEnvironmentStrings); ATTACH(GetEnvironmentStringsW); ATTACH(GetEnvironmentVariableA); ATTACH(GetEnvironmentVariableW); ATTACH(GetExitCodeProcess); ATTACH(GetExitCodeThread); ATTACH(GetFileAttributesA); ATTACH(GetFileAttributesExA); ATTACH(GetFileAttributesExW); ATTACH(GetFileAttributesW); ATTACH(GetFileInformationByHandle); ATTACH(GetFileSize); ATTACH(GetFileTime); ATTACH(GetFileType); ATTACH(GetFocus); ATTACH(GetFontData); ATTACH(GetFontLanguageInfo); ATTACH(GetForegroundWindow); ATTACH(GetFullPathNameA); ATTACH(GetFullPathNameW); ATTACH(GetGlyphOutlineA); ATTACH(GetGlyphOutlineW); ATTACH(GetGraphicsMode); ATTACH(GetHGlobalFromILockBytes); ATTACH(GetHGlobalFromStream); ATTACH(GetHandleInformation); ATTACH(GetICMProfileA); ATTACH(GetICMProfileW); ATTACH(GetIconInfo); ATTACH(GetInputState); ATTACH(GetKBCodePage); ATTACH(GetKerningPairsA); ATTACH(GetKerningPairsW); ATTACH(GetKeyNameTextA); ATTACH(GetKeyNameTextW); ATTACH(GetKeyState); ATTACH(GetKeyboardLayout); ATTACH(GetKeyboardLayoutList); ATTACH(GetKeyboardLayoutNameA); ATTACH(GetKeyboardLayoutNameW); ATTACH(GetKeyboardState); ATTACH(GetKeyboardType); ATTACH(GetLastActivePopup); ATTACH(GetLocalTime); ATTACH(GetLocaleInfoA); ATTACH(GetLocaleInfoW); ATTACH(GetLogColorSpaceA); ATTACH(GetLogColorSpaceW); ATTACH(GetLogicalDriveStringsA); ATTACH(GetLogicalDriveStringsW); ATTACH(GetLogicalDrives); ATTACH(GetMailslotInfo); ATTACH(GetMapMode); ATTACH(GetMenu); ATTACH(GetMenuCheckMarkDimensions); ATTACH(GetMenuContextHelpId); ATTACH(GetMenuDefaultItem); ATTACH(GetMenuItemCount); ATTACH(GetMenuItemID); ATTACH(GetMenuItemInfoA); ATTACH(GetMenuItemInfoW); ATTACH(GetMenuItemRect); ATTACH(GetMenuState); ATTACH(GetMenuStringA); ATTACH(GetMenuStringW); ATTACH(GetMessageA); ATTACH(GetMessageExtraInfo); ATTACH(GetMessagePos); ATTACH(GetMessageTime); ATTACH(GetMessageW); ATTACH(GetMetaFileA); ATTACH(GetMetaFileBitsEx); ATTACH(GetMetaFileW); ATTACH(GetMetaRgn); ATTACH(GetMiterLimit); ATTACH(GetModuleFileNameA); ATTACH(GetModuleFileNameW); ATTACH(GetModuleHandleA); ATTACH(GetModuleHandleW); ATTACH(GetNamedPipeHandleStateA); ATTACH(GetNamedPipeHandleStateW); ATTACH(GetNamedPipeInfo); ATTACH(GetNearestColor); ATTACH(GetNearestPaletteIndex); ATTACH(GetNextDlgGroupItem); ATTACH(GetNextDlgTabItem); ATTACH(GetNumberFormatA); ATTACH(GetNumberFormatW); ATTACH(GetNumberOfConsoleInputEvents); ATTACH(GetNumberOfConsoleMouseButtons); ATTACH(GetOEMCP); ATTACH(GetObjectA); ATTACH(GetObjectType); ATTACH(GetObjectW); ATTACH(GetOpenClipboardWindow); ATTACH(GetOutlineTextMetricsA); ATTACH(GetOutlineTextMetricsW); ATTACH(GetOverlappedResult); ATTACH(GetPaletteEntries); ATTACH(GetParent); ATTACH(GetPath); ATTACH(GetPixel); ATTACH(GetPixelFormat); ATTACH(GetPolyFillMode); ATTACH(GetPriorityClass); ATTACH(GetPriorityClipboardFormat); ATTACH(GetPrivateProfileIntA); ATTACH(GetPrivateProfileIntW); ATTACH(GetPrivateProfileSectionA); ATTACH(GetPrivateProfileSectionNamesA); ATTACH(GetPrivateProfileSectionNamesW); ATTACH(GetPrivateProfileSectionW); ATTACH(GetPrivateProfileStringA); ATTACH(GetPrivateProfileStringW); ATTACH(GetPrivateProfileStructA); ATTACH(GetPrivateProfileStructW); ATTACH(GetProcAddress); ATTACH(GetProcessAffinityMask); ATTACH(GetProcessHeaps); ATTACH(GetProcessShutdownParameters); ATTACH(GetProcessTimes); ATTACH(GetProcessVersion); ATTACH(GetProcessWindowStation); ATTACH(GetProcessWorkingSetSize); ATTACH(GetProfileIntA); ATTACH(GetProfileIntW); ATTACH(GetProfileSectionA); ATTACH(GetProfileSectionW); ATTACH(GetProfileStringA); ATTACH(GetProfileStringW); ATTACH(GetPropA); ATTACH(GetPropW); ATTACH(GetQueueStatus); ATTACH(GetQueuedCompletionStatus); ATTACH(GetROP2); ATTACH(GetRasterizerCaps); ATTACH(GetRegionData); ATTACH(GetRgnBox); ATTACH(GetRunningObjectTable); ATTACH(GetScrollInfo); ATTACH(GetScrollPos); ATTACH(GetScrollRange); ATTACH(GetShortPathNameA); ATTACH(GetShortPathNameW); ATTACH(GetStartupInfoA); ATTACH(GetStartupInfoW); ATTACH(GetStdHandle); ATTACH(GetStockObject); ATTACH(GetStretchBltMode); ATTACH(GetSubMenu); ATTACH(GetSysColor); ATTACH(GetSysColorBrush); ATTACH(GetSystemDefaultLCID); ATTACH(GetSystemDefaultLangID); ATTACH(GetSystemDirectoryA); ATTACH(GetSystemDirectoryW); ATTACH(GetSystemInfo); ATTACH(GetSystemMenu); ATTACH(GetSystemMetrics); ATTACH(GetSystemPaletteEntries); ATTACH(GetSystemPaletteUse); ATTACH(GetSystemPowerStatus); ATTACH(GetSystemTime); ATTACH(GetSystemTimeAdjustment); ATTACH(GetSystemTimeAsFileTime); ATTACH(GetTabbedTextExtentA); ATTACH(GetTabbedTextExtentW); ATTACH(GetTapeParameters); ATTACH(GetTapePosition); ATTACH(GetTapeStatus); ATTACH(GetTempFileNameA); ATTACH(GetTempFileNameW); ATTACH(GetTempPathA); ATTACH(GetTempPathW); ATTACH(GetTextAlign); ATTACH(GetTextCharacterExtra); ATTACH(GetTextCharset); ATTACH(GetTextCharsetInfo); ATTACH(GetTextColor); ATTACH(GetTextExtentExPointA); ATTACH(GetTextExtentExPointW); ATTACH(GetTextExtentPoint32A); ATTACH(GetTextExtentPoint32W); ATTACH(GetTextExtentPointA); ATTACH(GetTextExtentPointW); ATTACH(GetTextFaceA); ATTACH(GetTextFaceW); ATTACH(GetTextMetricsA); ATTACH(GetTextMetricsW); ATTACH(GetThreadContext); ATTACH(GetThreadDesktop); #if(WINVER >= 0x0500) ATTACH(GetThreadLocale); #endif // (WINVER >= 0x0500) ATTACH(GetThreadPriority); ATTACH(GetThreadPriorityBoost); ATTACH(GetThreadSelectorEntry); ATTACH(GetThreadTimes); ATTACH(GetTickCount); ATTACH(GetTimeFormatA); ATTACH(GetTimeFormatW); ATTACH(GetTimeZoneInformation); ATTACH(GetTopWindow); ATTACH(GetUpdateRect); ATTACH(GetUpdateRgn); ATTACH(GetUserDefaultLCID); ATTACH(GetUserDefaultLangID); ATTACH(GetUserObjectInformationA); ATTACH(GetUserObjectInformationW); ATTACH(GetUserObjectSecurity); ATTACH(GetVersion); ATTACH(GetVersionExA); ATTACH(GetVersionExW); ATTACH(GetViewportExtEx); ATTACH(GetViewportOrgEx); ATTACH(GetVolumeInformationA); ATTACH(GetVolumeInformationW); ATTACH(GetWinMetaFileBits); ATTACH(GetWindow); ATTACH(GetWindowContextHelpId); ATTACH(GetWindowDC); ATTACH(GetWindowExtEx); ATTACH(GetWindowLongA); ATTACH(GetWindowLongW); ATTACH(GetWindowOrgEx); ATTACH(GetWindowPlacement); ATTACH(GetWindowRect); ATTACH(GetWindowRgn); ATTACH(GetWindowTextA); ATTACH(GetWindowTextLengthA); ATTACH(GetWindowTextLengthW); ATTACH(GetWindowTextW); ATTACH(GetWindowThreadProcessId); ATTACH(GetWindowWord); ATTACH(GetWindowsDirectoryA); ATTACH(GetWindowsDirectoryW); ATTACH(GetWorldTransform); ATTACH(GlobalAddAtomA); ATTACH(GlobalAddAtomW); ATTACH(GlobalAlloc); ATTACH(GlobalCompact); ATTACH(GlobalDeleteAtom); ATTACH(GlobalFindAtomA); ATTACH(GlobalFindAtomW); ATTACH(GlobalFix); ATTACH(GlobalFlags); ATTACH(GlobalFree); ATTACH(GlobalGetAtomNameA); ATTACH(GlobalGetAtomNameW); ATTACH(GlobalHandle); ATTACH(GlobalLock); ATTACH(GlobalMemoryStatus); ATTACH(GlobalReAlloc); ATTACH(GlobalSize); ATTACH(GlobalUnWire); ATTACH(GlobalUnfix); ATTACH(GlobalUnlock); ATTACH(GlobalWire); ATTACH(GrayStringA); ATTACH(GrayStringW); ATTACH(HeapLock); ATTACH(HeapUnlock); ATTACH(HideCaret); ATTACH(HiliteMenuItem); ATTACH(IIDFromString); ATTACH(ImpersonateDdeClientWindow); ATTACH(InSendMessage); ATTACH(InflateRect); ATTACH(InitAtomTable); ATTACH(InsertMenuA); ATTACH(InsertMenuItemA); ATTACH(InsertMenuItemW); ATTACH(InsertMenuW); ATTACH(IntersectClipRect); ATTACH(IntersectRect); ATTACH(InvalidateRect); ATTACH(InvalidateRgn); ATTACH(InvertRect); ATTACH(InvertRgn); ATTACH(IsAccelerator); ATTACH(IsBadCodePtr); ATTACH(IsBadHugeReadPtr); ATTACH(IsBadHugeWritePtr); ATTACH(IsBadReadPtr); ATTACH(IsBadStringPtrA); ATTACH(IsBadStringPtrW); ATTACH(IsBadWritePtr); ATTACH(IsCharAlphaA); ATTACH(IsCharAlphaNumericA); ATTACH(IsCharAlphaNumericW); ATTACH(IsCharAlphaW); ATTACH(IsCharLowerA); ATTACH(IsCharLowerW); ATTACH(IsCharUpperA); ATTACH(IsCharUpperW); ATTACH(IsChild); ATTACH(IsClipboardFormatAvailable); ATTACH(IsDBCSLeadByte); ATTACH(IsDBCSLeadByteEx); ATTACH(IsDebuggerPresent); ATTACH(IsDialogMessageA); ATTACH(IsDialogMessageW); ATTACH(IsDlgButtonChecked); ATTACH(IsIconic); ATTACH(IsMenu); #if !defined(DETOURS_ARM) ATTACH(IsProcessorFeaturePresent); #endif // !DETOURS_ARM ATTACH(IsRectEmpty); ATTACH(IsValidCodePage); ATTACH(IsValidLocale); ATTACH(IsWindow); ATTACH(IsWindowEnabled); ATTACH(IsWindowUnicode); ATTACH(IsWindowVisible); ATTACH(IsZoomed); ATTACH(KillTimer); ATTACH(LPtoDP); ATTACH(LineDDA); ATTACH(LineTo); ATTACH(LoadAcceleratorsA); ATTACH(LoadAcceleratorsW); ATTACH(LoadBitmapA); ATTACH(LoadBitmapW); ATTACH(LoadCursorA); ATTACH(LoadCursorFromFileA); ATTACH(LoadCursorFromFileW); ATTACH(LoadCursorW); ATTACH(LoadIconA); ATTACH(LoadIconW); ATTACH(LoadImageA); ATTACH(LoadImageW); ATTACH(LoadKeyboardLayoutA); ATTACH(LoadKeyboardLayoutW); ATTACH(LoadLibraryA); ATTACH(LoadLibraryExA); ATTACH(LoadLibraryExW); ATTACH(LoadLibraryW); ATTACH(LoadMenuA); ATTACH(LoadMenuIndirectA); ATTACH(LoadMenuIndirectW); ATTACH(LoadMenuW); ATTACH(LoadModule); ATTACH(LoadResource); ATTACH(LoadStringA); ATTACH(LoadStringW); ATTACH(LocalAlloc); ATTACH(LocalCompact); ATTACH(LocalFileTimeToFileTime); ATTACH(LocalFlags); ATTACH(LocalFree); ATTACH(LocalHandle); ATTACH(LocalLock); ATTACH(LocalReAlloc); ATTACH(LocalShrink); ATTACH(LocalSize); ATTACH(LocalUnlock); ATTACH(LockFile); ATTACH(LockFileEx); ATTACH(LockResource); ATTACH(LockWindowUpdate); ATTACH(LookupIconIdFromDirectory); ATTACH(LookupIconIdFromDirectoryEx); ATTACH(MapDialogRect); ATTACH(MapViewOfFile); ATTACH(MapViewOfFileEx); ATTACH(MapVirtualKeyA); ATTACH(MapVirtualKeyExA); ATTACH(MapVirtualKeyExW); ATTACH(MapVirtualKeyW); ATTACH(MapWindowPoints); ATTACH(MaskBlt); ATTACH(MenuItemFromPoint); ATTACH(MessageBeep); ATTACH(MessageBoxA); ATTACH(MessageBoxExA); ATTACH(MessageBoxExW); ATTACH(MessageBoxIndirectA); ATTACH(MessageBoxIndirectW); ATTACH(MessageBoxW); ATTACH(MkParseDisplayName); ATTACH(ModifyMenuA); ATTACH(ModifyMenuW); ATTACH(ModifyWorldTransform); ATTACH(MonikerCommonPrefixWith); ATTACH(MonikerRelativePathTo); ATTACH(MoveFileA); ATTACH(MoveFileExA); ATTACH(MoveFileExW); ATTACH(MoveFileW); ATTACH(MoveToEx); ATTACH(MoveWindow); ATTACH(MsgWaitForMultipleObjects); ATTACH(MsgWaitForMultipleObjectsEx); ATTACH(MulDiv); ATTACH(OemKeyScan); ATTACH(OemToCharA); ATTACH(OemToCharBuffA); ATTACH(OemToCharBuffW); ATTACH(OemToCharW); ATTACH(OffsetClipRgn); ATTACH(OffsetRect); ATTACH(OffsetRgn); ATTACH(OffsetViewportOrgEx); ATTACH(OffsetWindowOrgEx); ATTACH(OleBuildVersion); ATTACH(OleConvertIStorageToOLESTREAM); ATTACH(OleConvertIStorageToOLESTREAMEx); ATTACH(OleConvertOLESTREAMToIStorage); ATTACH(OleConvertOLESTREAMToIStorageEx); ATTACH(OleCreate); ATTACH(OleCreateDefaultHandler); ATTACH(OleCreateEmbeddingHelper); ATTACH(OleCreateEx); ATTACH(OleCreateFromData); ATTACH(OleCreateFromDataEx); ATTACH(OleCreateFromFile); ATTACH(OleCreateFromFileEx); ATTACH(OleCreateLink); ATTACH(OleCreateLinkEx); ATTACH(OleCreateLinkFromData); ATTACH(OleCreateLinkFromDataEx); ATTACH(OleCreateLinkToFile); ATTACH(OleCreateLinkToFileEx); ATTACH(OleCreateMenuDescriptor); ATTACH(OleCreateStaticFromData); ATTACH(OleDestroyMenuDescriptor); ATTACH(OleDoAutoConvert); ATTACH(OleDraw); ATTACH(OleDuplicateData); ATTACH(OleFlushClipboard); ATTACH(OleGetAutoConvert); ATTACH(OleGetClipboard); ATTACH(OleGetIconOfClass); ATTACH(OleGetIconOfFile); ATTACH(OleInitialize); ATTACH(OleIsCurrentClipboard); ATTACH(OleIsRunning); ATTACH(OleLoad); ATTACH(OleLoadFromStream); ATTACH(OleLockRunning); ATTACH(OleMetafilePictFromIconAndLabel); ATTACH(OleNoteObjectVisible); ATTACH(OleQueryCreateFromData); ATTACH(OleQueryLinkFromData); ATTACH(OleRegEnumFormatEtc); ATTACH(OleRegEnumVerbs); ATTACH(OleRegGetMiscStatus); ATTACH(OleRegGetUserType); ATTACH(OleRun); ATTACH(OleSave); ATTACH(OleSaveToStream); ATTACH(OleSetAutoConvert); ATTACH(OleSetClipboard); ATTACH(OleSetContainedObject); ATTACH(OleSetMenuDescriptor); ATTACH(OleTranslateAccelerator); ATTACH(OleUninitialize); ATTACH(OpenClipboard); ATTACH(OpenDesktopA); ATTACH(OpenDesktopW); ATTACH(OpenEventA); ATTACH(OpenEventW); ATTACH(OpenFile); ATTACH(OpenFileMappingA); ATTACH(OpenFileMappingW); ATTACH(OpenIcon); ATTACH(OpenInputDesktop); ATTACH(OpenMutexA); ATTACH(OpenMutexW); ATTACH(OpenProcess); ATTACH(OpenProcessToken); ATTACH(OpenSemaphoreA); ATTACH(OpenSemaphoreW); ATTACH(OpenWaitableTimerA); ATTACH(OpenWaitableTimerW); ATTACH(OpenWindowStationA); ATTACH(OpenWindowStationW); ATTACH(OutputDebugStringA); ATTACH(OutputDebugStringW); ATTACH(PackDDElParam); ATTACH(PaintDesktop); ATTACH(PaintRgn); ATTACH(PatBlt); ATTACH(PathToRegion); ATTACH(PeekConsoleInputA); ATTACH(PeekConsoleInputW); ATTACH(PeekMessageA); ATTACH(PeekMessageW); ATTACH(PeekNamedPipe); ATTACH(Pie); ATTACH(PlayEnhMetaFile); ATTACH(PlayEnhMetaFileRecord); ATTACH(PlayMetaFile); ATTACH(PlayMetaFileRecord); ATTACH(PlgBlt); ATTACH(PolyBezier); ATTACH(PolyBezierTo); ATTACH(PolyDraw); ATTACH(PolyPolygon); ATTACH(PolyPolyline); ATTACH(PolyTextOutA); ATTACH(PolyTextOutW); ATTACH(Polygon); ATTACH(Polyline); ATTACH(PolylineTo); ATTACH(PostMessageA); ATTACH(PostMessageW); ATTACH(PostQueuedCompletionStatus); ATTACH(PostQuitMessage); ATTACH(PostThreadMessageA); ATTACH(PostThreadMessageW); ATTACH(PrepareTape); ATTACH(ProgIDFromCLSID); ATTACH(PropVariantClear); ATTACH(PropVariantCopy); ATTACH(PtInRect); ATTACH(PtInRegion); ATTACH(PtVisible); ATTACH(PulseEvent); ATTACH(PurgeComm); ATTACH(QueryDosDeviceA); ATTACH(QueryDosDeviceW); ATTACH(QueryPerformanceCounter); ATTACH(QueryPerformanceFrequency); ATTACH(QueueUserAPC); ATTACH(RaiseException); ATTACH(ReadClassStg); ATTACH(ReadClassStm); ATTACH(ReadConsoleA); ATTACH(ReadConsoleInputA); ATTACH(ReadConsoleInputW); ATTACH(ReadConsoleOutputA); ATTACH(ReadConsoleOutputAttribute); ATTACH(ReadConsoleOutputCharacterA); ATTACH(ReadConsoleOutputCharacterW); ATTACH(ReadConsoleOutputW); ATTACH(ReadConsoleW); ATTACH(ReadDirectoryChangesW); ATTACH(ReadFile); ATTACH(ReadFileEx); ATTACH(ReadFmtUserTypeStg); ATTACH(ReadProcessMemory); ATTACH(RealizePalette); ATTACH(RectInRegion); ATTACH(RectVisible); ATTACH(Rectangle); ATTACH(RedrawWindow); ATTACH(RegisterClassA); ATTACH(RegisterClassExA); ATTACH(RegisterClassExW); ATTACH(RegisterClassW); ATTACH(RegisterClipboardFormatA); ATTACH(RegisterClipboardFormatW); ATTACH(RegisterDragDrop); ATTACH(RegisterHotKey); ATTACH(RegisterWindowMessageA); ATTACH(RegisterWindowMessageW); ATTACH(ReleaseCapture); ATTACH(ReleaseDC); ATTACH(ReleaseMutex); ATTACH(ReleaseSemaphore); ATTACH(ReleaseStgMedium); ATTACH(RemoveDirectoryA); ATTACH(RemoveDirectoryW); ATTACH(RemoveFontResourceA); ATTACH(RemoveFontResourceW); ATTACH(RemoveMenu); ATTACH(RemovePropA); ATTACH(RemovePropW); ATTACH(ReplyMessage); ATTACH(ResetDCA); ATTACH(ResetDCW); ATTACH(ResetEvent); ATTACH(ResizePalette); ATTACH(RestoreDC); ATTACH(ResumeThread); ATTACH(ReuseDDElParam); ATTACH(RevokeDragDrop); ATTACH(RoundRect); ATTACH(SaveDC); ATTACH(ScaleViewportExtEx); ATTACH(ScaleWindowExtEx); ATTACH(ScreenToClient); ATTACH(ScrollConsoleScreenBufferA); ATTACH(ScrollConsoleScreenBufferW); ATTACH(ScrollDC); ATTACH(ScrollWindow); ATTACH(ScrollWindowEx); ATTACH(SearchPathA); ATTACH(SearchPathW); ATTACH(SelectClipPath); ATTACH(SelectClipRgn); ATTACH(SelectObject); ATTACH(SelectPalette); ATTACH(SendDlgItemMessageA); ATTACH(SendDlgItemMessageW); ATTACH(SendMessageA); ATTACH(SendMessageCallbackA); ATTACH(SendMessageCallbackW); ATTACH(SendMessageTimeoutA); ATTACH(SendMessageTimeoutW); ATTACH(SendMessageW); ATTACH(SendNotifyMessageA); ATTACH(SendNotifyMessageW); ATTACH(SetAbortProc); ATTACH(SetActiveWindow); ATTACH(SetArcDirection); ATTACH(SetBitmapBits); ATTACH(SetBitmapDimensionEx); ATTACH(SetBkColor); ATTACH(SetBkMode); ATTACH(SetBoundsRect); ATTACH(SetBrushOrgEx); ATTACH(SetCapture); ATTACH(SetCaretBlinkTime); ATTACH(SetCaretPos); ATTACH(SetClassLongA); ATTACH(SetClassLongW); ATTACH(SetClassWord); ATTACH(SetClipboardData); ATTACH(SetClipboardViewer); ATTACH(SetColorAdjustment); ATTACH(SetColorSpace); ATTACH(SetCommBreak); ATTACH(SetCommConfig); ATTACH(SetCommMask); ATTACH(SetCommState); ATTACH(SetCommTimeouts); ATTACH(SetComputerNameA); ATTACH(SetComputerNameW); ATTACH(SetConsoleActiveScreenBuffer); ATTACH(SetConsoleCP); ATTACH(SetConsoleCtrlHandler); ATTACH(SetConsoleCursorInfo); ATTACH(SetConsoleCursorPosition); ATTACH(SetConsoleMode); ATTACH(SetConsoleOutputCP); ATTACH(SetConsoleScreenBufferSize); ATTACH(SetConsoleTextAttribute); ATTACH(SetConsoleTitleA); ATTACH(SetConsoleTitleW); ATTACH(SetConsoleWindowInfo); ATTACH(SetConvertStg); ATTACH(SetCurrentDirectoryA); ATTACH(SetCurrentDirectoryW); ATTACH(SetCursor); ATTACH(SetCursorPos); ATTACH(SetDIBColorTable); ATTACH(SetDIBits); ATTACH(SetDIBitsToDevice); ATTACH(SetDefaultCommConfigA); ATTACH(SetDefaultCommConfigW); ATTACH(SetDeviceGammaRamp); ATTACH(SetDlgItemInt); ATTACH(SetDlgItemTextA); ATTACH(SetDlgItemTextW); ATTACH(SetDoubleClickTime); ATTACH(SetEndOfFile); ATTACH(SetEnhMetaFileBits); ATTACH(SetEnvironmentVariableA); ATTACH(SetEnvironmentVariableW); ATTACH(SetErrorMode); ATTACH(SetEvent); ATTACH(SetFileApisToANSI); ATTACH(SetFileApisToOEM); ATTACH(SetFileAttributesA); ATTACH(SetFileAttributesW); ATTACH(SetFilePointer); ATTACH(SetFileTime); ATTACH(SetFocus); ATTACH(SetForegroundWindow); ATTACH(SetGraphicsMode); ATTACH(SetHandleCount); ATTACH(SetHandleInformation); ATTACH(SetICMMode); ATTACH(SetICMProfileA); ATTACH(SetICMProfileW); ATTACH(SetKeyboardState); ATTACH(SetLocalTime); ATTACH(SetLocaleInfoA); ATTACH(SetLocaleInfoW); ATTACH(SetMailslotInfo); ATTACH(SetMapMode); ATTACH(SetMapperFlags); ATTACH(SetMenu); ATTACH(SetMenuContextHelpId); ATTACH(SetMenuDefaultItem); ATTACH(SetMenuItemBitmaps); ATTACH(SetMenuItemInfoA); ATTACH(SetMenuItemInfoW); ATTACH(SetMessageExtraInfo); ATTACH(SetMessageQueue); ATTACH(SetMetaFileBitsEx); ATTACH(SetMetaRgn); ATTACH(SetMiterLimit); ATTACH(SetNamedPipeHandleState); ATTACH(SetPaletteEntries); ATTACH(SetParent); ATTACH(SetPixel); ATTACH(SetPixelFormat); ATTACH(SetPixelV); ATTACH(SetPolyFillMode); ATTACH(SetPriorityClass); ATTACH(SetProcessAffinityMask); ATTACH(SetProcessShutdownParameters); ATTACH(SetProcessWindowStation); ATTACH(SetProcessWorkingSetSize); ATTACH(SetPropA); ATTACH(SetPropW); ATTACH(SetROP2); ATTACH(SetRect); ATTACH(SetRectEmpty); ATTACH(SetRectRgn); ATTACH(SetScrollInfo); ATTACH(SetScrollPos); ATTACH(SetScrollRange); ATTACH(SetStdHandle); ATTACH(SetStretchBltMode); ATTACH(SetSysColors); ATTACH(SetSystemCursor); ATTACH(SetSystemPaletteUse); ATTACH(SetSystemPowerState); ATTACH(SetSystemTime); ATTACH(SetSystemTimeAdjustment); ATTACH(SetTapeParameters); ATTACH(SetTapePosition); ATTACH(SetTextAlign); ATTACH(SetTextCharacterExtra); ATTACH(SetTextColor); ATTACH(SetTextJustification); ATTACH(SetThreadAffinityMask); ATTACH(SetThreadContext); ATTACH(SetThreadDesktop); ATTACH(SetThreadIdealProcessor); #if(WINVER >= 0x0500) ATTACH(SetThreadLocale); #endif // (WINVER >= 0x0500) ATTACH(SetThreadPriority); ATTACH(SetThreadPriorityBoost); ATTACH(SetTimeZoneInformation); ATTACH(SetTimer); ATTACH(SetUnhandledExceptionFilter); ATTACH(SetUserObjectInformationA); ATTACH(SetUserObjectInformationW); ATTACH(SetUserObjectSecurity); ATTACH(SetViewportExtEx); ATTACH(SetViewportOrgEx); ATTACH(SetVolumeLabelA); ATTACH(SetVolumeLabelW); ATTACH(SetWaitableTimer); ATTACH(SetWinMetaFileBits); ATTACH(SetWindowContextHelpId); ATTACH(SetWindowExtEx); ATTACH(SetWindowLongA); ATTACH(SetWindowLongW); ATTACH(SetWindowOrgEx); ATTACH(SetWindowPlacement); ATTACH(SetWindowPos); ATTACH(SetWindowRgn); ATTACH(SetWindowTextA); ATTACH(SetWindowTextW); ATTACH(SetWindowWord); ATTACH(SetWindowsHookA); ATTACH(SetWindowsHookExA); ATTACH(SetWindowsHookExW); ATTACH(SetWindowsHookW); ATTACH(SetWorldTransform); ATTACH(SetupComm); ATTACH(ShowCaret); ATTACH(ShowCursor); ATTACH(ShowOwnedPopups); ATTACH(ShowScrollBar); ATTACH(ShowWindow); ATTACH(ShowWindowAsync); ATTACH(SignalObjectAndWait); ATTACH(SizeofResource); ATTACH(SleepEx); ATTACH(StartDocA); ATTACH(StartDocW); ATTACH(StartPage); ATTACH(StgCreateDocfile); ATTACH(StgCreateDocfileOnILockBytes); ATTACH(StgCreatePropSetStg); ATTACH(StgCreatePropStg); ATTACH(StgCreateStorageEx); ATTACH(StgGetIFillLockBytesOnFile); ATTACH(StgGetIFillLockBytesOnILockBytes); ATTACH(StgIsStorageFile); ATTACH(StgIsStorageILockBytes); ATTACH(StgOpenAsyncDocfileOnIFillLockBytes); ATTACH(StgOpenPropStg); ATTACH(StgOpenStorage); ATTACH(StgOpenStorageEx); ATTACH(StgOpenStorageOnILockBytes); ATTACH(StgSetTimes); ATTACH(StretchBlt); ATTACH(StretchDIBits); ATTACH(StringFromCLSID); ATTACH(StringFromGUID2); ATTACH(StringFromIID); ATTACH(StrokeAndFillPath); ATTACH(StrokePath); ATTACH(SubtractRect); ATTACH(SuspendThread); ATTACH(SwapBuffers); ATTACH(SwapMouseButton); ATTACH(SwitchDesktop); ATTACH(SwitchToFiber); ATTACH(SwitchToThread); ATTACH(SystemParametersInfoA); ATTACH(SystemParametersInfoW); ATTACH(SystemTimeToFileTime); ATTACH(SystemTimeToTzSpecificLocalTime); ATTACH(TabbedTextOutA); ATTACH(TabbedTextOutW); ATTACH(TerminateProcess); ATTACH(TerminateThread); ATTACH(TextOutA); ATTACH(TextOutW); ATTACH(TileWindows); ATTACH(ToAscii); ATTACH(ToAsciiEx); ATTACH(ToUnicode); ATTACH(ToUnicodeEx); ATTACH(TrackMouseEvent); ATTACH(TrackPopupMenu); ATTACH(TrackPopupMenuEx); ATTACH(TransactNamedPipe); ATTACH(TranslateAcceleratorA); ATTACH(TranslateAcceleratorW); ATTACH(TranslateCharsetInfo); ATTACH(TranslateMDISysAccel); ATTACH(TranslateMessage); ATTACH(TransmitCommChar); #if DETOUR_TryEnterCriticalSection_EVEN_IF_IT_EXERCISES_A_BUG_IN_RtlLookupFunctionTable ATTACH(TryEnterCriticalSection); #endif ATTACH(UnhookWindowsHook); ATTACH(UnhookWindowsHookEx); ATTACH(UnionRect); ATTACH(UnloadKeyboardLayout); ATTACH(UnlockFile); ATTACH(UnlockFileEx); ATTACH(UnmapViewOfFile); ATTACH(UnpackDDElParam); ATTACH(UnrealizeObject); ATTACH(UnregisterClassA); ATTACH(UnregisterClassW); ATTACH(UnregisterHotKey); ATTACH(UpdateColors); ATTACH(UpdateResourceA); ATTACH(UpdateResourceW); ATTACH(UpdateWindow); ATTACH(ValidateRect); ATTACH(ValidateRgn); ATTACH(VerLanguageNameA); ATTACH(VerLanguageNameW); ATTACH(VirtualAllocEx); ATTACH(VirtualFreeEx); ATTACH(VirtualProtectEx); ATTACH(VirtualQueryEx); ATTACH(VkKeyScanA); ATTACH(VkKeyScanExA); ATTACH(VkKeyScanExW); ATTACH(VkKeyScanW); ATTACH(WSAAccept); ATTACH(WSAAddressToStringA); ATTACH(WSAAddressToStringW); ATTACH(WSAAsyncGetHostByAddr); ATTACH(WSAAsyncGetHostByName); ATTACH(WSAAsyncGetProtoByName); ATTACH(WSAAsyncGetProtoByNumber); ATTACH(WSAAsyncGetServByName); ATTACH(WSAAsyncGetServByPort); ATTACH(WSAAsyncSelect); ATTACH(WSACancelAsyncRequest); ATTACH(WSACancelBlockingCall); ATTACH(WSACleanup); ATTACH(WSACloseEvent); ATTACH(WSAConnect); ATTACH(WSACreateEvent); ATTACH(WSADuplicateSocketA); ATTACH(WSADuplicateSocketW); ATTACH(WSAEnumNameSpaceProvidersA); ATTACH(WSAEnumNameSpaceProvidersW); ATTACH(WSAEnumNetworkEvents); ATTACH(WSAEnumProtocolsA); ATTACH(WSAEnumProtocolsW); ATTACH(WSAEventSelect); ATTACH(WSAGetOverlappedResult); ATTACH(WSAGetQOSByName); ATTACH(WSAGetServiceClassInfoA); ATTACH(WSAGetServiceClassInfoW); ATTACH(WSAGetServiceClassNameByClassIdA); ATTACH(WSAGetServiceClassNameByClassIdW); ATTACH(WSAHtonl); ATTACH(WSAHtons); ATTACH(WSAInstallServiceClassA); ATTACH(WSAInstallServiceClassW); ATTACH(WSAIoctl); ATTACH(WSAIsBlocking); ATTACH(WSAJoinLeaf); ATTACH(WSALookupServiceBeginA); ATTACH(WSALookupServiceBeginW); ATTACH(WSALookupServiceEnd); ATTACH(WSALookupServiceNextA); ATTACH(WSALookupServiceNextW); ATTACH(WSANtohl); ATTACH(WSANtohs); ATTACH(WSAProviderConfigChange); ATTACH(WSARecv); ATTACH(WSARecvDisconnect); ATTACH(WSARecvFrom); ATTACH(WSARemoveServiceClass); ATTACH(WSAResetEvent); ATTACH(WSASend); ATTACH(WSASendDisconnect); ATTACH(WSASendTo); ATTACH(WSASetBlockingHook); ATTACH(WSASetEvent); ATTACH(WSASetServiceA); ATTACH(WSASetServiceW); ATTACH(WSASocketA); ATTACH(WSASocketW); ATTACH(WSAStartup); ATTACH(WSAStringToAddressA); ATTACH(WSAStringToAddressW); ATTACH(WSAUnhookBlockingHook); ATTACH(WSAWaitForMultipleEvents); ATTACH(WaitCommEvent); #if !defined(DETOURS_ARM) ATTACH(WaitForDebugEvent); #endif // !DETOURS_ARM ATTACH(WaitForInputIdle); ATTACH(WaitForMultipleObjects); ATTACH(WaitForMultipleObjectsEx); ATTACH(WaitForSingleObject); ATTACH(WaitForSingleObjectEx); ATTACH(WaitMessage); ATTACH(WaitNamedPipeA); ATTACH(WaitNamedPipeW); ATTACH(WidenPath); ATTACH(WinExec); ATTACH(WinHelpA); ATTACH(WinHelpW); ATTACH(WindowFromDC); ATTACH(WindowFromPoint); ATTACH(WriteClassStg); ATTACH(WriteClassStm); ATTACH(WriteConsoleA); ATTACH(WriteConsoleInputA); ATTACH(WriteConsoleInputW); ATTACH(WriteConsoleOutputA); ATTACH(WriteConsoleOutputAttribute); ATTACH(WriteConsoleOutputCharacterA); ATTACH(WriteConsoleOutputCharacterW); ATTACH(WriteConsoleOutputW); ATTACH(WriteConsoleW); ATTACH(WriteFile); ATTACH(WriteFileEx); ATTACH(WriteFmtUserTypeStg); ATTACH(WritePrivateProfileSectionA); ATTACH(WritePrivateProfileSectionW); ATTACH(WritePrivateProfileStringA); ATTACH(WritePrivateProfileStringW); ATTACH(WritePrivateProfileStructA); ATTACH(WritePrivateProfileStructW); ATTACH(WriteProcessMemory); ATTACH(WriteProfileSectionA); ATTACH(WriteProfileSectionW); ATTACH(WriteProfileStringA); ATTACH(WriteProfileStringW); ATTACH(WriteTapemark); ATTACH(__WSAFDIsSet); ATTACH(_hread); ATTACH(_hwrite); ATTACH(_lclose); ATTACH(_lcreat); ATTACH(_llseek); ATTACH(_lopen); ATTACH(_lread); ATTACH(_lwrite); ATTACH(accept); ATTACH(bind); ATTACH(closesocket); ATTACH(connect); ATTACH(gethostbyaddr); ATTACH(gethostbyname); ATTACH(gethostname); ATTACH(getpeername); ATTACH(getprotobyname); ATTACH(getprotobynumber); ATTACH(getservbyname); ATTACH(getservbyport); ATTACH(getsockname); ATTACH(getsockopt); ATTACH(htonl); ATTACH(htons); ATTACH(inet_addr); ATTACH(inet_ntoa); ATTACH(ioctlsocket); ATTACH(keybd_event); ATTACH(listen); ATTACH(mouse_event); ATTACH(ntohl); ATTACH(ntohs); ATTACH(recv); ATTACH(recvfrom); ATTACH(select); ATTACH(send); ATTACH(sendto); ATTACH(setsockopt); ATTACH(shutdown); ATTACH(socket); PVOID *ppbFailedPointer = NULL; LONG error = DetourTransactionCommitEx(&ppbFailedPointer); if (error != 0) { printf("traceapi.dll: Attach transaction failed to commit. Error %ld (%p/%p)", error, ppbFailedPointer, *ppbFailedPointer); return error; } return 0; } LONG DetachDetours(VOID) { DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); // For this many APIs, we'll ignore one or two can't be detoured. DetourSetIgnoreTooSmall(TRUE); DETACH(AbortDoc); DETACH(AbortPath); DETACH(ActivateKeyboardLayout); DETACH(AddAtomA); DETACH(AddAtomW); DETACH(AddFontResourceA); DETACH(AddFontResourceW); DETACH(AdjustWindowRect); DETACH(AdjustWindowRectEx); DETACH(AllocConsole); DETACH(AngleArc); DETACH(AnimatePalette); DETACH(AnyPopup); DETACH(AppendMenuA); DETACH(AppendMenuW); DETACH(Arc); DETACH(ArcTo); DETACH(AreFileApisANSI); DETACH(ArrangeIconicWindows); DETACH(AttachThreadInput); DETACH(BackupRead); DETACH(BackupSeek); DETACH(BackupWrite); DETACH(Beep); DETACH(BeginDeferWindowPos); DETACH(BeginPaint); DETACH(BeginPath); DETACH(BeginUpdateResourceA); DETACH(BeginUpdateResourceW); DETACH(BindMoniker); DETACH(BitBlt); DETACH(BringWindowToTop); DETACH(BroadcastSystemMessageA); DETACH(BroadcastSystemMessageW); DETACH(BuildCommDCBA); DETACH(BuildCommDCBAndTimeoutsA); DETACH(BuildCommDCBAndTimeoutsW); DETACH(BuildCommDCBW); DETACH(CLSIDFromProgID); DETACH(CLSIDFromString); DETACH(CallMsgFilterA); DETACH(CallMsgFilterW); DETACH(CallNamedPipeA); DETACH(CallNamedPipeW); DETACH(CallNextHookEx); DETACH(CallWindowProcA); DETACH(CallWindowProcW); DETACH(CancelDC); DETACH(CancelIo); DETACH(CancelWaitableTimer); DETACH(CascadeWindows); DETACH(ChangeClipboardChain); DETACH(ChangeDisplaySettingsA); DETACH(ChangeDisplaySettingsExA); DETACH(ChangeDisplaySettingsExW); DETACH(ChangeDisplaySettingsW); DETACH(ChangeMenuA); DETACH(ChangeMenuW); DETACH(CharLowerA); DETACH(CharLowerBuffA); DETACH(CharLowerBuffW); DETACH(CharLowerW); DETACH(CharNextA); DETACH(CharNextExA); DETACH(CharNextW); DETACH(CharPrevA); DETACH(CharPrevExA); DETACH(CharPrevW); DETACH(CharToOemA); DETACH(CharToOemBuffA); DETACH(CharToOemBuffW); DETACH(CharToOemW); DETACH(CharUpperA); DETACH(CharUpperBuffA); DETACH(CharUpperBuffW); DETACH(CharUpperW); DETACH(CheckColorsInGamut); DETACH(CheckDlgButton); DETACH(CheckMenuItem); DETACH(CheckMenuRadioItem); DETACH(CheckRadioButton); DETACH(ChildWindowFromPoint); DETACH(ChildWindowFromPointEx); DETACH(ChoosePixelFormat); DETACH(Chord); DETACH(ClearCommBreak); DETACH(ClearCommError); DETACH(ClientToScreen); DETACH(ClipCursor); DETACH(CloseClipboard); DETACH(CloseDesktop); DETACH(CloseEnhMetaFile); DETACH(CloseFigure); DETACH(CloseHandle); DETACH(CloseMetaFile); DETACH(CloseWindow); DETACH(CloseWindowStation); DETACH(CoAddRefServerProcess); DETACH(CoBuildVersion); DETACH(CoCopyProxy); DETACH(CoCreateFreeThreadedMarshaler); DETACH(CoCreateGuid); DETACH(CoCreateInstance); DETACH(CoCreateInstanceEx); DETACH(CoDisconnectObject); DETACH(CoDosDateTimeToFileTime); DETACH(CoFileTimeNow); DETACH(CoFileTimeToDosDateTime); DETACH(CoFreeAllLibraries); DETACH(CoFreeLibrary); DETACH(CoFreeUnusedLibraries); DETACH(CoGetCallContext); DETACH(CoGetClassObject); DETACH(CoGetCurrentProcess); DETACH(CoGetInstanceFromFile); DETACH(CoGetInstanceFromIStorage); DETACH(CoGetInterfaceAndReleaseStream); DETACH(CoGetMalloc); DETACH(CoGetMarshalSizeMax); DETACH(CoGetObject); DETACH(CoGetPSClsid); DETACH(CoGetStandardMarshal); DETACH(CoGetStdMarshalEx); DETACH(CoGetTreatAsClass); DETACH(CoImpersonateClient); DETACH(CoInitialize); DETACH(CoInitializeEx); DETACH(CoInitializeSecurity); DETACH(CoIsHandlerConnected); DETACH(CoIsOle1Class); DETACH(CoLoadLibrary); DETACH(CoLockObjectExternal); DETACH(CoMarshalHresult); DETACH(CoMarshalInterThreadInterfaceInStream); DETACH(CoMarshalInterface); DETACH(CoQueryAuthenticationServices); DETACH(CoQueryClientBlanket); DETACH(CoQueryProxyBlanket); DETACH(CoRegisterChannelHook); DETACH(CoRegisterClassObject); DETACH(CoRegisterMallocSpy); DETACH(CoRegisterMessageFilter); DETACH(CoRegisterPSClsid); DETACH(CoRegisterSurrogate); DETACH(CoReleaseMarshalData); DETACH(CoReleaseServerProcess); DETACH(CoResumeClassObjects); DETACH(CoRevertToSelf); DETACH(CoRevokeClassObject); DETACH(CoRevokeMallocSpy); DETACH(CoSetProxyBlanket); DETACH(CoSuspendClassObjects); DETACH(CoSwitchCallContext); DETACH(CoTaskMemAlloc); DETACH(CoTaskMemFree); DETACH(CoTaskMemRealloc); DETACH(CoTreatAsClass); DETACH(CoUninitialize); DETACH(CoUnmarshalHresult); DETACH(CoUnmarshalInterface); DETACH(ColorMatchToTarget); DETACH(CombineRgn); DETACH(CombineTransform); DETACH(CommConfigDialogA); DETACH(CommConfigDialogW); DETACH(CompareFileTime); DETACH(CompareStringA); DETACH(CompareStringW); DETACH(ConnectNamedPipe); #if !defined(DETOURS_ARM) DETACH(ContinueDebugEvent); #endif // !DETOURS_ARM DETACH(ConvertDefaultLocale); DETACH(ConvertThreadToFiber); DETACH(CopyAcceleratorTableA); DETACH(CopyAcceleratorTableW); DETACH(CopyEnhMetaFileA); DETACH(CopyEnhMetaFileW); DETACH(CopyFileA); DETACH(CopyFileExA); DETACH(CopyFileExW); DETACH(CopyFileW); DETACH(CopyIcon); DETACH(CopyImage); DETACH(CopyMetaFileA); DETACH(CopyMetaFileW); DETACH(CopyRect); DETACH(CountClipboardFormats); DETACH(CreateAcceleratorTableA); DETACH(CreateAcceleratorTableW); DETACH(CreateAntiMoniker); DETACH(CreateBindCtx); DETACH(CreateBitmap); DETACH(CreateBitmapIndirect); DETACH(CreateBrushIndirect); DETACH(CreateCaret); DETACH(CreateClassMoniker); DETACH(CreateColorSpaceA); DETACH(CreateColorSpaceW); DETACH(CreateCompatibleBitmap); DETACH(CreateCompatibleDC); DETACH(CreateConsoleScreenBuffer); DETACH(CreateCursor); DETACH(CreateDCA); DETACH(CreateDCW); DETACH(CreateDIBPatternBrush); DETACH(CreateDIBPatternBrushPt); DETACH(CreateDIBSection); DETACH(CreateDIBitmap); DETACH(CreateDataAdviseHolder); DETACH(CreateDataCache); DETACH(CreateDesktopA); DETACH(CreateDesktopW); DETACH(CreateDialogIndirectParamA); DETACH(CreateDialogIndirectParamW); DETACH(CreateDialogParamA); DETACH(CreateDialogParamW); DETACH(CreateDirectoryA); DETACH(CreateDirectoryExA); DETACH(CreateDirectoryExW); DETACH(CreateDirectoryW); DETACH(CreateDiscardableBitmap); DETACH(CreateEllipticRgn); DETACH(CreateEllipticRgnIndirect); DETACH(CreateEnhMetaFileA); DETACH(CreateEnhMetaFileW); DETACH(CreateEventA); DETACH(CreateEventW); DETACH(CreateFiber); DETACH(CreateFileA); DETACH(CreateFileMappingA); DETACH(CreateFileMappingW); DETACH(CreateFileMoniker); DETACH(CreateFileW); DETACH(CreateFontA); DETACH(CreateFontIndirectA); DETACH(CreateFontIndirectW); DETACH(CreateFontW); DETACH(CreateGenericComposite); DETACH(CreateHalftonePalette); DETACH(CreateHatchBrush); DETACH(CreateICA); DETACH(CreateICW); DETACH(CreateILockBytesOnHGlobal); DETACH(CreateIcon); DETACH(CreateIconFromResource); DETACH(CreateIconFromResourceEx); DETACH(CreateIconIndirect); DETACH(CreateIoCompletionPort); DETACH(CreateItemMoniker); DETACH(CreateMDIWindowA); DETACH(CreateMDIWindowW); DETACH(CreateMailslotA); DETACH(CreateMailslotW); DETACH(CreateMenu); DETACH(CreateMetaFileA); DETACH(CreateMetaFileW); DETACH(CreateMutexA); DETACH(CreateMutexW); DETACH(CreateNamedPipeA); DETACH(CreateNamedPipeW); DETACH(CreateOleAdviseHolder); DETACH(CreatePalette); DETACH(CreatePatternBrush); DETACH(CreatePen); DETACH(CreatePenIndirect); DETACH(CreatePipe); DETACH(CreatePointerMoniker); DETACH(CreatePolyPolygonRgn); DETACH(CreatePolygonRgn); DETACH(CreatePopupMenu); DETACH(CreateProcessA); DETACH(CreateProcessW); DETACH(CreateProcessAsUserA); DETACH(CreateProcessAsUserW); #if(_WIN32_WINNT >= 0x0500) DETACH(CreateProcessWithLogonW); DETACH(CreateProcessWithTokenW); #endif //(_WIN32_WINNT >= 0x0500) DETACH(CreateRectRgn); DETACH(CreateRectRgnIndirect); DETACH(CreateRemoteThread); DETACH(CreateRoundRectRgn); DETACH(CreateScalableFontResourceA); DETACH(CreateScalableFontResourceW); DETACH(CreateSemaphoreA); DETACH(CreateSemaphoreW); DETACH(CreateSolidBrush); DETACH(CreateStdProgressIndicator); DETACH(CreateStreamOnHGlobal); DETACH(CreateTapePartition); DETACH(CreateThread); DETACH(CreateWaitableTimerA); DETACH(CreateWaitableTimerW); DETACH(CreateWindowExA); DETACH(CreateWindowExW); DETACH(CreateWindowStationA); DETACH(CreateWindowStationW); DETACH(DPtoLP); DETACH(DdeAbandonTransaction); DETACH(DdeAccessData); DETACH(DdeAddData); DETACH(DdeClientTransaction); DETACH(DdeCmpStringHandles); DETACH(DdeConnect); DETACH(DdeConnectList); DETACH(DdeCreateDataHandle); DETACH(DdeCreateStringHandleA); DETACH(DdeCreateStringHandleW); DETACH(DdeDisconnect); DETACH(DdeDisconnectList); DETACH(DdeEnableCallback); DETACH(DdeFreeDataHandle); DETACH(DdeFreeStringHandle); DETACH(DdeGetData); DETACH(DdeGetLastError); DETACH(DdeImpersonateClient); DETACH(DdeKeepStringHandle); DETACH(DdeNameService); DETACH(DdePostAdvise); DETACH(DdeQueryConvInfo); DETACH(DdeQueryNextServer); DETACH(DdeQueryStringA); DETACH(DdeQueryStringW); DETACH(DdeReconnect); DETACH(DdeSetQualityOfService); DETACH(DdeSetUserHandle); DETACH(DdeUnaccessData); DETACH(DdeUninitialize); DETACH(DebugActiveProcess); DETACH(DebugActiveProcessStop); DETACH(DebugBreak); DETACH(DefDlgProcA); DETACH(DefDlgProcW); DETACH(DefFrameProcA); DETACH(DefFrameProcW); DETACH(DefMDIChildProcA); DETACH(DefMDIChildProcW); DETACH(DefWindowProcA); DETACH(DefWindowProcW); DETACH(DeferWindowPos); DETACH(DefineDosDeviceA); DETACH(DefineDosDeviceW); DETACH(DeleteAtom); DETACH(DeleteColorSpace); DETACH(DeleteDC); DETACH(DeleteEnhMetaFile); DETACH(DeleteFiber); DETACH(DeleteFileA); DETACH(DeleteFileW); DETACH(DeleteMenu); DETACH(DeleteMetaFile); DETACH(DeleteObject); DETACH(DescribePixelFormat); DETACH(DestroyAcceleratorTable); DETACH(DestroyCaret); DETACH(DestroyCursor); DETACH(DestroyIcon); DETACH(DestroyMenu); DETACH(DestroyWindow); DETACH(DeviceIoControl); DETACH(DialogBoxIndirectParamA); DETACH(DialogBoxIndirectParamW); DETACH(DialogBoxParamA); DETACH(DialogBoxParamW); DETACH(DisableThreadLibraryCalls); DETACH(DisconnectNamedPipe); DETACH(DispatchMessageA); DETACH(DispatchMessageW); DETACH(DlgDirListA); DETACH(DlgDirListComboBoxA); DETACH(DlgDirListComboBoxW); DETACH(DlgDirListW); DETACH(DlgDirSelectComboBoxExA); DETACH(DlgDirSelectComboBoxExW); DETACH(DlgDirSelectExA); DETACH(DlgDirSelectExW); DETACH(DoDragDrop); DETACH(DosDateTimeToFileTime); DETACH(DragDetect); DETACH(DragObject); DETACH(DrawAnimatedRects); DETACH(DrawCaption); DETACH(DrawEdge); DETACH(DrawEscape); DETACH(DrawFocusRect); DETACH(DrawFrameControl); DETACH(DrawIcon); DETACH(DrawIconEx); DETACH(DrawMenuBar); DETACH(DrawStateA); DETACH(DrawStateW); DETACH(DrawTextA); DETACH(DrawTextExA); DETACH(DrawTextExW); DETACH(DrawTextW); DETACH(DuplicateHandle); DETACH(Ellipse); DETACH(EmptyClipboard); DETACH(EnableMenuItem); DETACH(EnableScrollBar); DETACH(EnableWindow); DETACH(EndDeferWindowPos); DETACH(EndDialog); DETACH(EndDoc); DETACH(EndPage); DETACH(EndPaint); DETACH(EndPath); DETACH(EndUpdateResourceA); DETACH(EndUpdateResourceW); DETACH(EnumCalendarInfoA); DETACH(EnumCalendarInfoW); DETACH(EnumChildWindows); DETACH(EnumClipboardFormats); DETACH(EnumDateFormatsA); DETACH(EnumDateFormatsW); DETACH(EnumDesktopWindows); DETACH(EnumDesktopsA); DETACH(EnumDesktopsW); DETACH(EnumDisplaySettingsA); DETACH(EnumDisplaySettingsW); DETACH(EnumEnhMetaFile); DETACH(EnumFontFamiliesA); DETACH(EnumFontFamiliesExA); DETACH(EnumFontFamiliesExW); DETACH(EnumFontFamiliesW); DETACH(EnumFontsA); DETACH(EnumFontsW); DETACH(EnumICMProfilesA); DETACH(EnumICMProfilesW); DETACH(EnumMetaFile); DETACH(EnumObjects); DETACH(EnumPropsA); DETACH(EnumPropsExA); DETACH(EnumPropsExW); DETACH(EnumPropsW); DETACH(EnumResourceLanguagesA); DETACH(EnumResourceLanguagesW); DETACH(EnumResourceNamesA); DETACH(EnumResourceNamesW); DETACH(EnumResourceTypesA); DETACH(EnumResourceTypesW); DETACH(EnumSystemCodePagesA); DETACH(EnumSystemCodePagesW); #if(WINVER >= 0x0500) DETACH(EnumSystemLocalesA); DETACH(EnumSystemLocalesW); #endif // (WINVER >= 0x0500) DETACH(EnumThreadWindows); DETACH(EnumTimeFormatsA); DETACH(EnumTimeFormatsW); DETACH(EnumWindowStationsA); DETACH(EnumWindowStationsW); DETACH(EnumWindows); DETACH(EqualRect); DETACH(EqualRgn); DETACH(EraseTape); DETACH(Escape); DETACH(EscapeCommFunction); DETACH(ExcludeClipRect); DETACH(ExcludeUpdateRgn); DETACH(ExitProcess); DETACH(ExitThread); DETACH(ExitWindowsEx); DETACH(ExpandEnvironmentStringsA); DETACH(ExpandEnvironmentStringsW); DETACH(ExtCreatePen); DETACH(ExtCreateRegion); DETACH(ExtEscape); DETACH(ExtFloodFill); DETACH(ExtSelectClipRgn); DETACH(ExtTextOutA); DETACH(ExtTextOutW); DETACH(FatalAppExitA); DETACH(FatalAppExitW); DETACH(FatalExit); DETACH(FileTimeToDosDateTime); DETACH(FileTimeToLocalFileTime); DETACH(FileTimeToSystemTime); DETACH(FillConsoleOutputAttribute); DETACH(FillConsoleOutputCharacterA); DETACH(FillConsoleOutputCharacterW); DETACH(FillPath); DETACH(FillRect); DETACH(FillRgn); DETACH(FindAtomA); DETACH(FindAtomW); DETACH(FindClose); DETACH(FindCloseChangeNotification); DETACH(FindFirstChangeNotificationA); DETACH(FindFirstChangeNotificationW); DETACH(FindFirstFileA); DETACH(FindFirstFileExA); DETACH(FindFirstFileExW); DETACH(FindFirstFileW); DETACH(FindNextChangeNotification); DETACH(FindNextFileA); DETACH(FindNextFileW); DETACH(FindResourceA); DETACH(FindResourceExA); DETACH(FindResourceExW); DETACH(FindResourceW); DETACH(FindWindowA); DETACH(FindWindowExA); DETACH(FindWindowExW); DETACH(FindWindowW); DETACH(FixBrushOrgEx); DETACH(FlashWindow); DETACH(FlattenPath); DETACH(FloodFill); DETACH(FlushConsoleInputBuffer); DETACH(FlushFileBuffers); DETACH(FlushViewOfFile); DETACH(FmtIdToPropStgName); DETACH(FoldStringA); DETACH(FoldStringW); DETACH(FormatMessageA); DETACH(FormatMessageW); DETACH(FrameRect); DETACH(FrameRgn); DETACH(FreeConsole); DETACH(FreeDDElParam); DETACH(FreeEnvironmentStringsA); DETACH(FreeEnvironmentStringsW); DETACH(FreeLibrary); DETACH(FreeLibraryAndExitThread); DETACH(FreePropVariantArray); DETACH(FreeResource); DETACH(GdiComment); DETACH(GdiFlush); DETACH(GdiGetBatchLimit); DETACH(GdiSetBatchLimit); DETACH(GenerateConsoleCtrlEvent); DETACH(GetACP); DETACH(GetActiveWindow); DETACH(GetArcDirection); DETACH(GetAspectRatioFilterEx); DETACH(GetAsyncKeyState); DETACH(GetAtomNameA); DETACH(GetAtomNameW); DETACH(GetBinaryTypeA); DETACH(GetBinaryTypeW); DETACH(GetBitmapBits); DETACH(GetBitmapDimensionEx); DETACH(GetBkColor); DETACH(GetBkMode); DETACH(GetBoundsRect); DETACH(GetBrushOrgEx); DETACH(GetCPInfo); DETACH(GetCapture); DETACH(GetCaretBlinkTime); DETACH(GetCaretPos); DETACH(GetCharABCWidthsA); DETACH(GetCharABCWidthsFloatA); DETACH(GetCharABCWidthsFloatW); DETACH(GetCharABCWidthsW); DETACH(GetCharWidth32A); DETACH(GetCharWidth32W); DETACH(GetCharWidthA); DETACH(GetCharWidthFloatA); DETACH(GetCharWidthFloatW); DETACH(GetCharWidthW); DETACH(GetCharacterPlacementA); DETACH(GetCharacterPlacementW); DETACH(GetClassFile); DETACH(GetClassInfoA); DETACH(GetClassInfoExA); DETACH(GetClassInfoExW); DETACH(GetClassInfoW); DETACH(GetClassLongA); DETACH(GetClassLongW); DETACH(GetClassNameA); DETACH(GetClassNameW); DETACH(GetClassWord); DETACH(GetClientRect); DETACH(GetClipBox); DETACH(GetClipCursor); DETACH(GetClipRgn); DETACH(GetClipboardData); DETACH(GetClipboardFormatNameA); DETACH(GetClipboardFormatNameW); DETACH(GetClipboardOwner); DETACH(GetClipboardViewer); DETACH(GetColorAdjustment); DETACH(GetColorSpace); DETACH(GetCommConfig); DETACH(GetCommMask); DETACH(GetCommModemStatus); DETACH(GetCommProperties); DETACH(GetCommState); DETACH(GetCommTimeouts); DETACH(GetCommandLineA); DETACH(GetCommandLineW); DETACH(GetComputerNameA); DETACH(GetComputerNameW); DETACH(GetConsoleCP); DETACH(GetConsoleCursorInfo); DETACH(GetConsoleMode); DETACH(GetConsoleOutputCP); DETACH(GetConsoleScreenBufferInfo); DETACH(GetConsoleTitleA); DETACH(GetConsoleTitleW); DETACH(GetConvertStg); DETACH(GetCurrencyFormatA); DETACH(GetCurrencyFormatW); DETACH(GetCurrentDirectoryA); DETACH(GetCurrentDirectoryW); DETACH(GetCurrentObject); DETACH(GetCurrentPositionEx); DETACH(GetCurrentProcess); DETACH(GetCurrentProcessId); DETACH(GetCurrentThreadId); DETACH(GetCursor); DETACH(GetCursorPos); DETACH(GetDC); DETACH(GetDCEx); DETACH(GetDCOrgEx); DETACH(GetDIBColorTable); DETACH(GetDIBits); DETACH(GetDateFormatA); DETACH(GetDateFormatW); DETACH(GetDefaultCommConfigA); DETACH(GetDefaultCommConfigW); DETACH(GetDesktopWindow); DETACH(GetDeviceCaps); DETACH(GetDeviceGammaRamp); DETACH(GetDialogBaseUnits); DETACH(GetDiskFreeSpaceA); DETACH(GetDiskFreeSpaceExA); DETACH(GetDiskFreeSpaceExW); DETACH(GetDiskFreeSpaceW); DETACH(GetDlgCtrlID); DETACH(GetDlgItem); DETACH(GetDlgItemInt); DETACH(GetDlgItemTextA); DETACH(GetDlgItemTextW); DETACH(GetDoubleClickTime); DETACH(GetDriveTypeA); DETACH(GetDriveTypeW); DETACH(GetEnhMetaFileA); DETACH(GetEnhMetaFileBits); DETACH(GetEnhMetaFileDescriptionA); DETACH(GetEnhMetaFileDescriptionW); DETACH(GetEnhMetaFileHeader); DETACH(GetEnhMetaFilePaletteEntries); DETACH(GetEnhMetaFilePixelFormat); DETACH(GetEnhMetaFileW); DETACH(GetEnvironmentStrings); DETACH(GetEnvironmentStringsW); DETACH(GetEnvironmentVariableA); DETACH(GetEnvironmentVariableW); DETACH(GetExitCodeProcess); DETACH(GetExitCodeThread); DETACH(GetFileAttributesA); DETACH(GetFileAttributesExA); DETACH(GetFileAttributesExW); DETACH(GetFileAttributesW); DETACH(GetFileInformationByHandle); DETACH(GetFileSize); DETACH(GetFileTime); DETACH(GetFileType); DETACH(GetFocus); DETACH(GetFontData); DETACH(GetFontLanguageInfo); DETACH(GetForegroundWindow); DETACH(GetFullPathNameA); DETACH(GetFullPathNameW); DETACH(GetGlyphOutlineA); DETACH(GetGlyphOutlineW); DETACH(GetGraphicsMode); DETACH(GetHGlobalFromILockBytes); DETACH(GetHGlobalFromStream); DETACH(GetHandleInformation); DETACH(GetICMProfileA); DETACH(GetICMProfileW); DETACH(GetIconInfo); DETACH(GetInputState); DETACH(GetKBCodePage); DETACH(GetKerningPairsA); DETACH(GetKerningPairsW); DETACH(GetKeyNameTextA); DETACH(GetKeyNameTextW); DETACH(GetKeyState); DETACH(GetKeyboardLayout); DETACH(GetKeyboardLayoutList); DETACH(GetKeyboardLayoutNameA); DETACH(GetKeyboardLayoutNameW); DETACH(GetKeyboardState); DETACH(GetKeyboardType); DETACH(GetLastActivePopup); DETACH(GetLocalTime); DETACH(GetLocaleInfoA); DETACH(GetLocaleInfoW); DETACH(GetLogColorSpaceA); DETACH(GetLogColorSpaceW); DETACH(GetLogicalDriveStringsA); DETACH(GetLogicalDriveStringsW); DETACH(GetLogicalDrives); DETACH(GetMailslotInfo); DETACH(GetMapMode); DETACH(GetMenu); DETACH(GetMenuCheckMarkDimensions); DETACH(GetMenuContextHelpId); DETACH(GetMenuDefaultItem); DETACH(GetMenuItemCount); DETACH(GetMenuItemID); DETACH(GetMenuItemInfoA); DETACH(GetMenuItemInfoW); DETACH(GetMenuItemRect); DETACH(GetMenuState); DETACH(GetMenuStringA); DETACH(GetMenuStringW); DETACH(GetMessageA); DETACH(GetMessageExtraInfo); DETACH(GetMessagePos); DETACH(GetMessageTime); DETACH(GetMessageW); DETACH(GetMetaFileA); DETACH(GetMetaFileBitsEx); DETACH(GetMetaFileW); DETACH(GetMetaRgn); DETACH(GetMiterLimit); DETACH(GetModuleFileNameA); DETACH(GetModuleFileNameW); DETACH(GetModuleHandleA); DETACH(GetModuleHandleW); DETACH(GetNamedPipeHandleStateA); DETACH(GetNamedPipeHandleStateW); DETACH(GetNamedPipeInfo); DETACH(GetNearestColor); DETACH(GetNearestPaletteIndex); DETACH(GetNextDlgGroupItem); DETACH(GetNextDlgTabItem); DETACH(GetNumberFormatA); DETACH(GetNumberFormatW); DETACH(GetNumberOfConsoleInputEvents); DETACH(GetNumberOfConsoleMouseButtons); DETACH(GetOEMCP); DETACH(GetObjectA); DETACH(GetObjectType); DETACH(GetObjectW); DETACH(GetOpenClipboardWindow); DETACH(GetOutlineTextMetricsA); DETACH(GetOutlineTextMetricsW); DETACH(GetOverlappedResult); DETACH(GetPaletteEntries); DETACH(GetParent); DETACH(GetPath); DETACH(GetPixel); DETACH(GetPixelFormat); DETACH(GetPolyFillMode); DETACH(GetPriorityClass); DETACH(GetPriorityClipboardFormat); DETACH(GetPrivateProfileIntA); DETACH(GetPrivateProfileIntW); DETACH(GetPrivateProfileSectionA); DETACH(GetPrivateProfileSectionNamesA); DETACH(GetPrivateProfileSectionNamesW); DETACH(GetPrivateProfileSectionW); DETACH(GetPrivateProfileStringA); DETACH(GetPrivateProfileStringW); DETACH(GetPrivateProfileStructA); DETACH(GetPrivateProfileStructW); DETACH(GetProcAddress); DETACH(GetProcessAffinityMask); DETACH(GetProcessHeaps); DETACH(GetProcessShutdownParameters); DETACH(GetProcessTimes); DETACH(GetProcessVersion); DETACH(GetProcessWindowStation); DETACH(GetProcessWorkingSetSize); DETACH(GetProfileIntA); DETACH(GetProfileIntW); DETACH(GetProfileSectionA); DETACH(GetProfileSectionW); DETACH(GetProfileStringA); DETACH(GetProfileStringW); DETACH(GetPropA); DETACH(GetPropW); DETACH(GetQueueStatus); DETACH(GetQueuedCompletionStatus); DETACH(GetROP2); DETACH(GetRasterizerCaps); DETACH(GetRegionData); DETACH(GetRgnBox); DETACH(GetRunningObjectTable); DETACH(GetScrollInfo); DETACH(GetScrollPos); DETACH(GetScrollRange); DETACH(GetShortPathNameA); DETACH(GetShortPathNameW); DETACH(GetStartupInfoA); DETACH(GetStartupInfoW); DETACH(GetStdHandle); DETACH(GetStockObject); DETACH(GetStretchBltMode); DETACH(GetSubMenu); DETACH(GetSysColor); DETACH(GetSysColorBrush); DETACH(GetSystemDefaultLCID); DETACH(GetSystemDefaultLangID); DETACH(GetSystemDirectoryA); DETACH(GetSystemDirectoryW); DETACH(GetSystemInfo); DETACH(GetSystemMenu); DETACH(GetSystemMetrics); DETACH(GetSystemPaletteEntries); DETACH(GetSystemPaletteUse); DETACH(GetSystemPowerStatus); DETACH(GetSystemTime); DETACH(GetSystemTimeAdjustment); DETACH(GetSystemTimeAsFileTime); DETACH(GetTabbedTextExtentA); DETACH(GetTabbedTextExtentW); DETACH(GetTapeParameters); DETACH(GetTapePosition); DETACH(GetTapeStatus); DETACH(GetTempFileNameA); DETACH(GetTempFileNameW); DETACH(GetTempPathA); DETACH(GetTempPathW); DETACH(GetTextAlign); DETACH(GetTextCharacterExtra); DETACH(GetTextCharset); DETACH(GetTextCharsetInfo); DETACH(GetTextColor); DETACH(GetTextExtentExPointA); DETACH(GetTextExtentExPointW); DETACH(GetTextExtentPoint32A); DETACH(GetTextExtentPoint32W); DETACH(GetTextExtentPointA); DETACH(GetTextExtentPointW); DETACH(GetTextFaceA); DETACH(GetTextFaceW); DETACH(GetTextMetricsA); DETACH(GetTextMetricsW); DETACH(GetThreadContext); DETACH(GetThreadDesktop); #if(WINVER >= 0x0500) DETACH(GetThreadLocale); #endif // (WINVER >= 0x0500) DETACH(GetThreadPriority); DETACH(GetThreadPriorityBoost); DETACH(GetThreadSelectorEntry); DETACH(GetThreadTimes); DETACH(GetTickCount); DETACH(GetTimeFormatA); DETACH(GetTimeFormatW); DETACH(GetTimeZoneInformation); DETACH(GetTopWindow); DETACH(GetUpdateRect); DETACH(GetUpdateRgn); DETACH(GetUserDefaultLCID); DETACH(GetUserDefaultLangID); DETACH(GetUserObjectInformationA); DETACH(GetUserObjectInformationW); DETACH(GetUserObjectSecurity); DETACH(GetVersion); DETACH(GetVersionExA); DETACH(GetVersionExW); DETACH(GetViewportExtEx); DETACH(GetViewportOrgEx); DETACH(GetVolumeInformationA); DETACH(GetVolumeInformationW); DETACH(GetWinMetaFileBits); DETACH(GetWindow); DETACH(GetWindowContextHelpId); DETACH(GetWindowDC); DETACH(GetWindowExtEx); DETACH(GetWindowLongA); DETACH(GetWindowLongW); DETACH(GetWindowOrgEx); DETACH(GetWindowPlacement); DETACH(GetWindowRect); DETACH(GetWindowRgn); DETACH(GetWindowTextA); DETACH(GetWindowTextLengthA); DETACH(GetWindowTextLengthW); DETACH(GetWindowTextW); DETACH(GetWindowThreadProcessId); DETACH(GetWindowWord); DETACH(GetWindowsDirectoryA); DETACH(GetWindowsDirectoryW); DETACH(GetWorldTransform); DETACH(GlobalAddAtomA); DETACH(GlobalAddAtomW); DETACH(GlobalAlloc); DETACH(GlobalCompact); DETACH(GlobalDeleteAtom); DETACH(GlobalFindAtomA); DETACH(GlobalFindAtomW); DETACH(GlobalFix); DETACH(GlobalFlags); DETACH(GlobalFree); DETACH(GlobalGetAtomNameA); DETACH(GlobalGetAtomNameW); DETACH(GlobalHandle); DETACH(GlobalLock); DETACH(GlobalMemoryStatus); DETACH(GlobalReAlloc); DETACH(GlobalSize); DETACH(GlobalUnWire); DETACH(GlobalUnfix); DETACH(GlobalUnlock); DETACH(GlobalWire); DETACH(GrayStringA); DETACH(GrayStringW); DETACH(HeapLock); DETACH(HeapUnlock); DETACH(HideCaret); DETACH(HiliteMenuItem); DETACH(IIDFromString); DETACH(ImpersonateDdeClientWindow); DETACH(InSendMessage); DETACH(InflateRect); DETACH(InitAtomTable); DETACH(InsertMenuA); DETACH(InsertMenuItemA); DETACH(InsertMenuItemW); DETACH(InsertMenuW); DETACH(IntersectClipRect); DETACH(IntersectRect); DETACH(InvalidateRect); DETACH(InvalidateRgn); DETACH(InvertRect); DETACH(InvertRgn); DETACH(IsAccelerator); DETACH(IsBadCodePtr); DETACH(IsBadHugeReadPtr); DETACH(IsBadHugeWritePtr); DETACH(IsBadReadPtr); DETACH(IsBadStringPtrA); DETACH(IsBadStringPtrW); DETACH(IsBadWritePtr); DETACH(IsCharAlphaA); DETACH(IsCharAlphaNumericA); DETACH(IsCharAlphaNumericW); DETACH(IsCharAlphaW); DETACH(IsCharLowerA); DETACH(IsCharLowerW); DETACH(IsCharUpperA); DETACH(IsCharUpperW); DETACH(IsChild); DETACH(IsClipboardFormatAvailable); DETACH(IsDBCSLeadByte); DETACH(IsDBCSLeadByteEx); DETACH(IsDebuggerPresent); DETACH(IsDialogMessageA); DETACH(IsDialogMessageW); DETACH(IsDlgButtonChecked); DETACH(IsIconic); DETACH(IsMenu); #if !defined(DETOURS_ARM) DETACH(IsProcessorFeaturePresent); #endif // !DETOURS_ARM DETACH(IsRectEmpty); DETACH(IsValidCodePage); DETACH(IsValidLocale); DETACH(IsWindow); DETACH(IsWindowEnabled); DETACH(IsWindowUnicode); DETACH(IsWindowVisible); DETACH(IsZoomed); DETACH(KillTimer); DETACH(LPtoDP); DETACH(LineDDA); DETACH(LineTo); DETACH(LoadAcceleratorsA); DETACH(LoadAcceleratorsW); DETACH(LoadBitmapA); DETACH(LoadBitmapW); DETACH(LoadCursorA); DETACH(LoadCursorFromFileA); DETACH(LoadCursorFromFileW); DETACH(LoadCursorW); DETACH(LoadIconA); DETACH(LoadIconW); DETACH(LoadImageA); DETACH(LoadImageW); DETACH(LoadKeyboardLayoutA); DETACH(LoadKeyboardLayoutW); DETACH(LoadLibraryA); DETACH(LoadLibraryExA); DETACH(LoadLibraryExW); DETACH(LoadLibraryW); DETACH(LoadMenuA); DETACH(LoadMenuIndirectA); DETACH(LoadMenuIndirectW); DETACH(LoadMenuW); DETACH(LoadModule); DETACH(LoadResource); DETACH(LoadStringA); DETACH(LoadStringW); DETACH(LocalAlloc); DETACH(LocalCompact); DETACH(LocalFileTimeToFileTime); DETACH(LocalFlags); DETACH(LocalFree); DETACH(LocalHandle); DETACH(LocalLock); DETACH(LocalReAlloc); DETACH(LocalShrink); DETACH(LocalSize); DETACH(LocalUnlock); DETACH(LockFile); DETACH(LockFileEx); DETACH(LockResource); DETACH(LockWindowUpdate); DETACH(LookupIconIdFromDirectory); DETACH(LookupIconIdFromDirectoryEx); DETACH(MapDialogRect); DETACH(MapViewOfFile); DETACH(MapViewOfFileEx); DETACH(MapVirtualKeyA); DETACH(MapVirtualKeyExA); DETACH(MapVirtualKeyExW); DETACH(MapVirtualKeyW); DETACH(MapWindowPoints); DETACH(MaskBlt); DETACH(MenuItemFromPoint); DETACH(MessageBeep); DETACH(MessageBoxA); DETACH(MessageBoxExA); DETACH(MessageBoxExW); DETACH(MessageBoxIndirectA); DETACH(MessageBoxIndirectW); DETACH(MessageBoxW); DETACH(MkParseDisplayName); DETACH(ModifyMenuA); DETACH(ModifyMenuW); DETACH(ModifyWorldTransform); DETACH(MonikerCommonPrefixWith); DETACH(MonikerRelativePathTo); DETACH(MoveFileA); DETACH(MoveFileExA); DETACH(MoveFileExW); DETACH(MoveFileW); DETACH(MoveToEx); DETACH(MoveWindow); DETACH(MsgWaitForMultipleObjects); DETACH(MsgWaitForMultipleObjectsEx); DETACH(MulDiv); DETACH(OemKeyScan); DETACH(OemToCharA); DETACH(OemToCharBuffA); DETACH(OemToCharBuffW); DETACH(OemToCharW); DETACH(OffsetClipRgn); DETACH(OffsetRect); DETACH(OffsetRgn); DETACH(OffsetViewportOrgEx); DETACH(OffsetWindowOrgEx); DETACH(OleBuildVersion); DETACH(OleConvertIStorageToOLESTREAM); DETACH(OleConvertIStorageToOLESTREAMEx); DETACH(OleConvertOLESTREAMToIStorage); DETACH(OleConvertOLESTREAMToIStorageEx); DETACH(OleCreate); DETACH(OleCreateDefaultHandler); DETACH(OleCreateEmbeddingHelper); DETACH(OleCreateEx); DETACH(OleCreateFromData); DETACH(OleCreateFromDataEx); DETACH(OleCreateFromFile); DETACH(OleCreateFromFileEx); DETACH(OleCreateLink); DETACH(OleCreateLinkEx); DETACH(OleCreateLinkFromData); DETACH(OleCreateLinkFromDataEx); DETACH(OleCreateLinkToFile); DETACH(OleCreateLinkToFileEx); DETACH(OleCreateMenuDescriptor); DETACH(OleCreateStaticFromData); DETACH(OleDestroyMenuDescriptor); DETACH(OleDoAutoConvert); DETACH(OleDraw); DETACH(OleDuplicateData); DETACH(OleFlushClipboard); DETACH(OleGetAutoConvert); DETACH(OleGetClipboard); DETACH(OleGetIconOfClass); DETACH(OleGetIconOfFile); DETACH(OleInitialize); DETACH(OleIsCurrentClipboard); DETACH(OleIsRunning); DETACH(OleLoad); DETACH(OleLoadFromStream); DETACH(OleLockRunning); DETACH(OleMetafilePictFromIconAndLabel); DETACH(OleNoteObjectVisible); DETACH(OleQueryCreateFromData); DETACH(OleQueryLinkFromData); DETACH(OleRegEnumFormatEtc); DETACH(OleRegEnumVerbs); DETACH(OleRegGetMiscStatus); DETACH(OleRegGetUserType); DETACH(OleRun); DETACH(OleSave); DETACH(OleSaveToStream); DETACH(OleSetAutoConvert); DETACH(OleSetClipboard); DETACH(OleSetContainedObject); DETACH(OleSetMenuDescriptor); DETACH(OleTranslateAccelerator); DETACH(OleUninitialize); DETACH(OpenClipboard); DETACH(OpenDesktopA); DETACH(OpenDesktopW); DETACH(OpenEventA); DETACH(OpenEventW); DETACH(OpenFile); DETACH(OpenFileMappingA); DETACH(OpenFileMappingW); DETACH(OpenIcon); DETACH(OpenInputDesktop); DETACH(OpenMutexA); DETACH(OpenMutexW); DETACH(OpenProcess); DETACH(OpenProcessToken); DETACH(OpenSemaphoreA); DETACH(OpenSemaphoreW); DETACH(OpenWaitableTimerA); DETACH(OpenWaitableTimerW); DETACH(OpenWindowStationA); DETACH(OpenWindowStationW); DETACH(OutputDebugStringA); DETACH(OutputDebugStringW); DETACH(PackDDElParam); DETACH(PaintDesktop); DETACH(PaintRgn); DETACH(PatBlt); DETACH(PathToRegion); DETACH(PeekConsoleInputA); DETACH(PeekConsoleInputW); DETACH(PeekMessageA); DETACH(PeekMessageW); DETACH(PeekNamedPipe); DETACH(Pie); DETACH(PlayEnhMetaFile); DETACH(PlayEnhMetaFileRecord); DETACH(PlayMetaFile); DETACH(PlayMetaFileRecord); DETACH(PlgBlt); DETACH(PolyBezier); DETACH(PolyBezierTo); DETACH(PolyDraw); DETACH(PolyPolygon); DETACH(PolyPolyline); DETACH(PolyTextOutA); DETACH(PolyTextOutW); DETACH(Polygon); DETACH(Polyline); DETACH(PolylineTo); DETACH(PostMessageA); DETACH(PostMessageW); DETACH(PostQueuedCompletionStatus); DETACH(PostQuitMessage); DETACH(PostThreadMessageA); DETACH(PostThreadMessageW); DETACH(PrepareTape); DETACH(ProgIDFromCLSID); DETACH(PropVariantClear); DETACH(PropVariantCopy); DETACH(PtInRect); DETACH(PtInRegion); DETACH(PtVisible); DETACH(PulseEvent); DETACH(PurgeComm); DETACH(QueryDosDeviceA); DETACH(QueryDosDeviceW); DETACH(QueryPerformanceCounter); DETACH(QueryPerformanceFrequency); DETACH(QueueUserAPC); DETACH(RaiseException); DETACH(ReadClassStg); DETACH(ReadClassStm); DETACH(ReadConsoleA); DETACH(ReadConsoleInputA); DETACH(ReadConsoleInputW); DETACH(ReadConsoleOutputA); DETACH(ReadConsoleOutputAttribute); DETACH(ReadConsoleOutputCharacterA); DETACH(ReadConsoleOutputCharacterW); DETACH(ReadConsoleOutputW); DETACH(ReadConsoleW); DETACH(ReadDirectoryChangesW); DETACH(ReadFile); DETACH(ReadFileEx); DETACH(ReadFmtUserTypeStg); DETACH(ReadProcessMemory); DETACH(RealizePalette); DETACH(RectInRegion); DETACH(RectVisible); DETACH(Rectangle); DETACH(RedrawWindow); DETACH(RegisterClassA); DETACH(RegisterClassExA); DETACH(RegisterClassExW); DETACH(RegisterClassW); DETACH(RegisterClipboardFormatA); DETACH(RegisterClipboardFormatW); DETACH(RegisterDragDrop); DETACH(RegisterHotKey); DETACH(RegisterWindowMessageA); DETACH(RegisterWindowMessageW); DETACH(ReleaseCapture); DETACH(ReleaseDC); DETACH(ReleaseMutex); DETACH(ReleaseSemaphore); DETACH(ReleaseStgMedium); DETACH(RemoveDirectoryA); DETACH(RemoveDirectoryW); DETACH(RemoveFontResourceA); DETACH(RemoveFontResourceW); DETACH(RemoveMenu); DETACH(RemovePropA); DETACH(RemovePropW); DETACH(ReplyMessage); DETACH(ResetDCA); DETACH(ResetDCW); DETACH(ResetEvent); DETACH(ResizePalette); DETACH(RestoreDC); DETACH(ResumeThread); DETACH(ReuseDDElParam); DETACH(RevokeDragDrop); DETACH(RoundRect); DETACH(SaveDC); DETACH(ScaleViewportExtEx); DETACH(ScaleWindowExtEx); DETACH(ScreenToClient); DETACH(ScrollConsoleScreenBufferA); DETACH(ScrollConsoleScreenBufferW); DETACH(ScrollDC); DETACH(ScrollWindow); DETACH(ScrollWindowEx); DETACH(SearchPathA); DETACH(SearchPathW); DETACH(SelectClipPath); DETACH(SelectClipRgn); DETACH(SelectObject); DETACH(SelectPalette); DETACH(SendDlgItemMessageA); DETACH(SendDlgItemMessageW); DETACH(SendMessageA); DETACH(SendMessageCallbackA); DETACH(SendMessageCallbackW); DETACH(SendMessageTimeoutA); DETACH(SendMessageTimeoutW); DETACH(SendMessageW); DETACH(SendNotifyMessageA); DETACH(SendNotifyMessageW); DETACH(SetAbortProc); DETACH(SetActiveWindow); DETACH(SetArcDirection); DETACH(SetBitmapBits); DETACH(SetBitmapDimensionEx); DETACH(SetBkColor); DETACH(SetBkMode); DETACH(SetBoundsRect); DETACH(SetBrushOrgEx); DETACH(SetCapture); DETACH(SetCaretBlinkTime); DETACH(SetCaretPos); DETACH(SetClassLongA); DETACH(SetClassLongW); DETACH(SetClassWord); DETACH(SetClipboardData); DETACH(SetClipboardViewer); DETACH(SetColorAdjustment); DETACH(SetColorSpace); DETACH(SetCommBreak); DETACH(SetCommConfig); DETACH(SetCommMask); DETACH(SetCommState); DETACH(SetCommTimeouts); DETACH(SetComputerNameA); DETACH(SetComputerNameW); DETACH(SetConsoleActiveScreenBuffer); DETACH(SetConsoleCP); DETACH(SetConsoleCtrlHandler); DETACH(SetConsoleCursorInfo); DETACH(SetConsoleCursorPosition); DETACH(SetConsoleMode); DETACH(SetConsoleOutputCP); DETACH(SetConsoleScreenBufferSize); DETACH(SetConsoleTextAttribute); DETACH(SetConsoleTitleA); DETACH(SetConsoleTitleW); DETACH(SetConsoleWindowInfo); DETACH(SetConvertStg); DETACH(SetCurrentDirectoryA); DETACH(SetCurrentDirectoryW); DETACH(SetCursor); DETACH(SetCursorPos); DETACH(SetDIBColorTable); DETACH(SetDIBits); DETACH(SetDIBitsToDevice); DETACH(SetDefaultCommConfigA); DETACH(SetDefaultCommConfigW); DETACH(SetDeviceGammaRamp); DETACH(SetDlgItemInt); DETACH(SetDlgItemTextA); DETACH(SetDlgItemTextW); DETACH(SetDoubleClickTime); DETACH(SetEndOfFile); DETACH(SetEnhMetaFileBits); DETACH(SetEnvironmentVariableA); DETACH(SetEnvironmentVariableW); DETACH(SetErrorMode); DETACH(SetEvent); DETACH(SetFileApisToANSI); DETACH(SetFileApisToOEM); DETACH(SetFileAttributesA); DETACH(SetFileAttributesW); DETACH(SetFilePointer); DETACH(SetFileTime); DETACH(SetFocus); DETACH(SetForegroundWindow); DETACH(SetGraphicsMode); DETACH(SetHandleCount); DETACH(SetHandleInformation); DETACH(SetICMMode); DETACH(SetICMProfileA); DETACH(SetICMProfileW); DETACH(SetKeyboardState); DETACH(SetLocalTime); DETACH(SetLocaleInfoA); DETACH(SetLocaleInfoW); DETACH(SetMailslotInfo); DETACH(SetMapMode); DETACH(SetMapperFlags); DETACH(SetMenu); DETACH(SetMenuContextHelpId); DETACH(SetMenuDefaultItem); DETACH(SetMenuItemBitmaps); DETACH(SetMenuItemInfoA); DETACH(SetMenuItemInfoW); DETACH(SetMessageExtraInfo); DETACH(SetMessageQueue); DETACH(SetMetaFileBitsEx); DETACH(SetMetaRgn); DETACH(SetMiterLimit); DETACH(SetNamedPipeHandleState); DETACH(SetPaletteEntries); DETACH(SetParent); DETACH(SetPixel); DETACH(SetPixelFormat); DETACH(SetPixelV); DETACH(SetPolyFillMode); DETACH(SetPriorityClass); DETACH(SetProcessAffinityMask); DETACH(SetProcessShutdownParameters); DETACH(SetProcessWindowStation); DETACH(SetProcessWorkingSetSize); DETACH(SetPropA); DETACH(SetPropW); DETACH(SetROP2); DETACH(SetRect); DETACH(SetRectEmpty); DETACH(SetRectRgn); DETACH(SetScrollInfo); DETACH(SetScrollPos); DETACH(SetScrollRange); DETACH(SetStdHandle); DETACH(SetStretchBltMode); DETACH(SetSysColors); DETACH(SetSystemCursor); DETACH(SetSystemPaletteUse); DETACH(SetSystemPowerState); DETACH(SetSystemTime); DETACH(SetSystemTimeAdjustment); DETACH(SetTapeParameters); DETACH(SetTapePosition); DETACH(SetTextAlign); DETACH(SetTextCharacterExtra); DETACH(SetTextColor); DETACH(SetTextJustification); DETACH(SetThreadAffinityMask); DETACH(SetThreadContext); DETACH(SetThreadDesktop); DETACH(SetThreadIdealProcessor); #if(WINVER >= 0x0500) DETACH(SetThreadLocale); #endif // (WINVER >= 0x0500) DETACH(SetThreadPriority); DETACH(SetThreadPriorityBoost); DETACH(SetTimeZoneInformation); DETACH(SetTimer); DETACH(SetUnhandledExceptionFilter); DETACH(SetUserObjectInformationA); DETACH(SetUserObjectInformationW); DETACH(SetUserObjectSecurity); DETACH(SetViewportExtEx); DETACH(SetViewportOrgEx); DETACH(SetVolumeLabelA); DETACH(SetVolumeLabelW); DETACH(SetWaitableTimer); DETACH(SetWinMetaFileBits); DETACH(SetWindowContextHelpId); DETACH(SetWindowExtEx); DETACH(SetWindowLongA); DETACH(SetWindowLongW); DETACH(SetWindowOrgEx); DETACH(SetWindowPlacement); DETACH(SetWindowPos); DETACH(SetWindowRgn); DETACH(SetWindowTextA); DETACH(SetWindowTextW); DETACH(SetWindowWord); DETACH(SetWindowsHookA); DETACH(SetWindowsHookExA); DETACH(SetWindowsHookExW); DETACH(SetWindowsHookW); DETACH(SetWorldTransform); DETACH(SetupComm); DETACH(ShowCaret); DETACH(ShowCursor); DETACH(ShowOwnedPopups); DETACH(ShowScrollBar); DETACH(ShowWindow); DETACH(ShowWindowAsync); DETACH(SignalObjectAndWait); DETACH(SizeofResource); DETACH(SleepEx); DETACH(StartDocA); DETACH(StartDocW); DETACH(StartPage); DETACH(StgCreateDocfile); DETACH(StgCreateDocfileOnILockBytes); DETACH(StgCreatePropSetStg); DETACH(StgCreatePropStg); DETACH(StgCreateStorageEx); DETACH(StgGetIFillLockBytesOnFile); DETACH(StgGetIFillLockBytesOnILockBytes); DETACH(StgIsStorageFile); DETACH(StgIsStorageILockBytes); DETACH(StgOpenAsyncDocfileOnIFillLockBytes); DETACH(StgOpenPropStg); DETACH(StgOpenStorage); DETACH(StgOpenStorageEx); DETACH(StgOpenStorageOnILockBytes); DETACH(StgSetTimes); DETACH(StretchBlt); DETACH(StretchDIBits); DETACH(StringFromCLSID); DETACH(StringFromGUID2); DETACH(StringFromIID); DETACH(StrokeAndFillPath); DETACH(StrokePath); DETACH(SubtractRect); DETACH(SuspendThread); DETACH(SwapBuffers); DETACH(SwapMouseButton); DETACH(SwitchDesktop); DETACH(SwitchToFiber); DETACH(SwitchToThread); DETACH(SystemParametersInfoA); DETACH(SystemParametersInfoW); DETACH(SystemTimeToFileTime); DETACH(SystemTimeToTzSpecificLocalTime); DETACH(TabbedTextOutA); DETACH(TabbedTextOutW); DETACH(TerminateProcess); DETACH(TerminateThread); DETACH(TextOutA); DETACH(TextOutW); DETACH(TileWindows); DETACH(ToAscii); DETACH(ToAsciiEx); DETACH(ToUnicode); DETACH(ToUnicodeEx); DETACH(TrackMouseEvent); DETACH(TrackPopupMenu); DETACH(TrackPopupMenuEx); DETACH(TransactNamedPipe); DETACH(TranslateAcceleratorA); DETACH(TranslateAcceleratorW); DETACH(TranslateCharsetInfo); DETACH(TranslateMDISysAccel); DETACH(TranslateMessage); DETACH(TransmitCommChar); #if DETOUR_TryEnterCriticalSection_EVEN_IF_IT_EXERCISES_A_BUG_IN_RtlLookupFunctionTable DETACH(TryEnterCriticalSection); #endif DETACH(UnhookWindowsHook); DETACH(UnhookWindowsHookEx); DETACH(UnionRect); DETACH(UnloadKeyboardLayout); DETACH(UnlockFile); DETACH(UnlockFileEx); DETACH(UnmapViewOfFile); DETACH(UnpackDDElParam); DETACH(UnrealizeObject); DETACH(UnregisterClassA); DETACH(UnregisterClassW); DETACH(UnregisterHotKey); DETACH(UpdateColors); DETACH(UpdateResourceA); DETACH(UpdateResourceW); DETACH(UpdateWindow); DETACH(ValidateRect); DETACH(ValidateRgn); DETACH(VerLanguageNameA); DETACH(VerLanguageNameW); DETACH(VirtualAllocEx); DETACH(VirtualFreeEx); DETACH(VirtualProtectEx); DETACH(VirtualQueryEx); DETACH(VkKeyScanA); DETACH(VkKeyScanExA); DETACH(VkKeyScanExW); DETACH(VkKeyScanW); DETACH(WSAAccept); DETACH(WSAAddressToStringA); DETACH(WSAAddressToStringW); DETACH(WSAAsyncGetHostByAddr); DETACH(WSAAsyncGetHostByName); DETACH(WSAAsyncGetProtoByName); DETACH(WSAAsyncGetProtoByNumber); DETACH(WSAAsyncGetServByName); DETACH(WSAAsyncGetServByPort); DETACH(WSAAsyncSelect); DETACH(WSACancelAsyncRequest); DETACH(WSACancelBlockingCall); DETACH(WSACleanup); DETACH(WSACloseEvent); DETACH(WSAConnect); DETACH(WSACreateEvent); DETACH(WSADuplicateSocketA); DETACH(WSADuplicateSocketW); DETACH(WSAEnumNameSpaceProvidersA); DETACH(WSAEnumNameSpaceProvidersW); DETACH(WSAEnumNetworkEvents); DETACH(WSAEnumProtocolsA); DETACH(WSAEnumProtocolsW); DETACH(WSAEventSelect); DETACH(WSAGetOverlappedResult); DETACH(WSAGetQOSByName); DETACH(WSAGetServiceClassInfoA); DETACH(WSAGetServiceClassInfoW); DETACH(WSAGetServiceClassNameByClassIdA); DETACH(WSAGetServiceClassNameByClassIdW); DETACH(WSAHtonl); DETACH(WSAHtons); DETACH(WSAInstallServiceClassA); DETACH(WSAInstallServiceClassW); DETACH(WSAIoctl); DETACH(WSAIsBlocking); DETACH(WSAJoinLeaf); DETACH(WSALookupServiceBeginA); DETACH(WSALookupServiceBeginW); DETACH(WSALookupServiceEnd); DETACH(WSALookupServiceNextA); DETACH(WSALookupServiceNextW); DETACH(WSANtohl); DETACH(WSANtohs); DETACH(WSAProviderConfigChange); DETACH(WSARecv); DETACH(WSARecvDisconnect); DETACH(WSARecvFrom); DETACH(WSARemoveServiceClass); DETACH(WSAResetEvent); DETACH(WSASend); DETACH(WSASendDisconnect); DETACH(WSASendTo); DETACH(WSASetBlockingHook); DETACH(WSASetEvent); DETACH(WSASetServiceA); DETACH(WSASetServiceW); DETACH(WSASocketA); DETACH(WSASocketW); DETACH(WSAStartup); DETACH(WSAStringToAddressA); DETACH(WSAStringToAddressW); DETACH(WSAUnhookBlockingHook); DETACH(WSAWaitForMultipleEvents); DETACH(WaitCommEvent); #if !defined(DETOURS_ARM) DETACH(WaitForDebugEvent); #endif // !DETOURS_ARM DETACH(WaitForInputIdle); DETACH(WaitForMultipleObjects); DETACH(WaitForMultipleObjectsEx); DETACH(WaitForSingleObject); DETACH(WaitForSingleObjectEx); DETACH(WaitMessage); DETACH(WaitNamedPipeA); DETACH(WaitNamedPipeW); DETACH(WidenPath); DETACH(WinExec); DETACH(WinHelpA); DETACH(WinHelpW); DETACH(WindowFromDC); DETACH(WindowFromPoint); DETACH(WriteClassStg); DETACH(WriteClassStm); DETACH(WriteConsoleA); DETACH(WriteConsoleInputA); DETACH(WriteConsoleInputW); DETACH(WriteConsoleOutputA); DETACH(WriteConsoleOutputAttribute); DETACH(WriteConsoleOutputCharacterA); DETACH(WriteConsoleOutputCharacterW); DETACH(WriteConsoleOutputW); DETACH(WriteConsoleW); DETACH(WriteFile); DETACH(WriteFileEx); DETACH(WriteFmtUserTypeStg); DETACH(WritePrivateProfileSectionA); DETACH(WritePrivateProfileSectionW); DETACH(WritePrivateProfileStringA); DETACH(WritePrivateProfileStringW); DETACH(WritePrivateProfileStructA); DETACH(WritePrivateProfileStructW); DETACH(WriteProcessMemory); DETACH(WriteProfileSectionA); DETACH(WriteProfileSectionW); DETACH(WriteProfileStringA); DETACH(WriteProfileStringW); DETACH(WriteTapemark); DETACH(__WSAFDIsSet); DETACH(_hread); DETACH(_hwrite); DETACH(_lclose); DETACH(_lcreat); DETACH(_llseek); DETACH(_lopen); DETACH(_lread); DETACH(_lwrite); DETACH(accept); DETACH(bind); DETACH(closesocket); DETACH(connect); DETACH(gethostbyaddr); DETACH(gethostbyname); DETACH(gethostname); DETACH(getpeername); DETACH(getprotobyname); DETACH(getprotobynumber); DETACH(getservbyname); DETACH(getservbyport); DETACH(getsockname); DETACH(getsockopt); DETACH(htonl); DETACH(htons); DETACH(inet_addr); DETACH(inet_ntoa); DETACH(ioctlsocket); DETACH(keybd_event); DETACH(listen); DETACH(mouse_event); DETACH(ntohl); DETACH(ntohs); DETACH(recv); DETACH(recvfrom); DETACH(select); DETACH(send); DETACH(sendto); DETACH(setsockopt); DETACH(shutdown); DETACH(socket); if (DetourTransactionCommit() != 0) { PVOID *ppbFailedPointer = NULL; LONG error = DetourTransactionCommitEx(&ppbFailedPointer); printf("traceapi.dll: Detach transaction failed to commit. Error %ld (%p/%p)", error, ppbFailedPointer, *ppbFailedPointer); return error; } return 0; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/traceapi/testapi.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (testapi.cpp of testapi.exe) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include "trcapi.cpp" #if (_MSC_VER < 1299) typedef ULONG * PULONG_PTR; typedef ULONG ULONG_PTR; typedef LONG * PLONG_PTR; typedef LONG LONG_PTR; #endif VOID SyelogOpen(PCSTR pszIdentifier, BYTE nFacility) { (void)pszIdentifier; (void)nFacility; } VOID SyelogExV(BOOL fTerminate, BYTE nSeverity, PCSTR pszMsgf, va_list args) { (void)fTerminate; CHAR szBuffer[1024]; PCHAR psz = szBuffer; BOOL fLf = FALSE; StringCchPrintfA(psz, szBuffer + sizeof(szBuffer) - psz, "--.%02x: ", nSeverity); while (*psz) { psz++; } StringCchVPrintfA(psz, szBuffer + sizeof(szBuffer) - psz, pszMsgf, args); for (psz = szBuffer; *psz; psz++) { if (*psz == '\n') { if (fLf) { *psz = '\0'; break; } fLf = TRUE; } } if (!fLf) { *psz++ = '\n'; *psz = '\0'; } printf("%s", szBuffer); Real_OutputDebugStringA(szBuffer); } VOID SyelogV(BYTE nSeverity, PCSTR pszMsgf, va_list args) { SyelogExV(FALSE, nSeverity, pszMsgf, args); } VOID Syelog(BYTE nSeverity, PCSTR pszMsgf, ...) { va_list args; va_start(args, pszMsgf); SyelogExV(FALSE, nSeverity, pszMsgf, args); va_end(args); } VOID SyelogEx(BOOL fTerminate, BYTE nSeverity, PCSTR pszMsgf, ...) { va_list args; va_start(args, pszMsgf); SyelogExV(fTerminate, nSeverity, pszMsgf, args); va_end(args); } VOID SyelogClose(BOOL fTerminate) { (void)fTerminate; } DWORD main(int argc, char **argv) { (void)argc; (void)argv; printf("testapi: Starting\n"); ProcessAttach(NULL); Sleep(100); ProcessDetach(NULL); return 0; } // ////////////////////////////////////////////////////////////////////////////// ================================================ FILE: ext/detours/samples/traceapi/trcapi.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (trcapi.cpp of trcapi.dll) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #undef WIN32_LEAN_AND_MEAN #define _WIN32_WINNT 0x400 #define WIN32 #define NT #define _WINSOCK_DEPRECATED_NO_WARNINGS #define DBG_TRACE 0 #if _MSC_VER >= 1300 #include #endif #include #include #pragma warning(push) #if _MSC_VER > 1400 #pragma warning(disable:6102 6103) // /analyze warnings #endif #include #pragma warning(pop) #include "detours.h" #include "syelog.h" #if (_MSC_VER < 1299) #define LONG_PTR LONG #define ULONG_PTR ULONG #define PLONG_PTR PLONG #define PULONG_PTR PULONG #define INT_PTR INT #define UINT_PTR UINT #define PINT_PTR PINT #define PUINT_PTR PUINT #define DWORD_PTR DWORD #define PDWORD_PTR PDWORD #endif #pragma warning(disable:4996) // We don't care about deprecated APIs. ////////////////////////////////////////////////////////////////////////////// #pragma warning(disable:4127) // Many of our asserts are constants. #define ASSERT_ALWAYS(x) \ do { \ if (!(x)) { \ AssertMessage(#x, __FILE__, __LINE__); \ DebugBreak(); \ } \ } while (0) #ifndef NDEBUG #define ASSERT(x) ASSERT_ALWAYS(x) #else #define ASSERT(x) #endif #define UNUSED(c) (c) = (c) ////////////////////////////////////////////////////////////////////////////// static HMODULE s_hInst = NULL; static WCHAR s_wzDllPath[MAX_PATH]; static CHAR s_szDllPath[MAX_PATH]; BOOL ProcessEnumerate(); BOOL InstanceEnumerate(HINSTANCE hInst); VOID _PrintEnter(const CHAR *psz, ...); VOID _PrintExit(const CHAR *psz, ...); VOID _Print(const CHAR *psz, ...); VOID _VPrint(PCSTR msg, va_list args, PCHAR pszBuf, LONG cbBuf); VOID AssertMessage(CONST PCHAR pszMsg, CONST PCHAR pszFile, ULONG nLine); ////////////////////////////////////////////////////////////////////////////// // // Trampolines // extern "C" { // Trampolines for SYELOG library. // extern HANDLE (WINAPI *Real_CreateFileW)(LPCWSTR a0, DWORD a1, DWORD a2, LPSECURITY_ATTRIBUTES a3, DWORD a4, DWORD a5, HANDLE a6); extern BOOL (WINAPI *Real_WriteFile)(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped); extern BOOL (WINAPI *Real_FlushFileBuffers)(HANDLE hFile); extern BOOL (WINAPI *Real_CloseHandle)(HANDLE hObject); extern BOOL (WINAPI *Real_WaitNamedPipeW)(LPCWSTR lpNamedPipeName, DWORD nTimeOut); extern BOOL (WINAPI *Real_SetNamedPipeHandleState)(HANDLE hNamedPipe, LPDWORD lpMode, LPDWORD lpMaxCollectionCount, LPDWORD lpCollectDataTimeout); extern DWORD (WINAPI *Real_GetCurrentProcessId)(VOID); extern VOID (WINAPI *Real_GetSystemTimeAsFileTime)(LPFILETIME lpSystemTimeAsFileTime); VOID ( WINAPI * Real_InitializeCriticalSection)(LPCRITICAL_SECTION lpSection) = InitializeCriticalSection; VOID ( WINAPI * Real_EnterCriticalSection)(LPCRITICAL_SECTION lpSection) = EnterCriticalSection; VOID ( WINAPI * Real_LeaveCriticalSection)(LPCRITICAL_SECTION lpSection) = LeaveCriticalSection; } #include "_win32.cpp" ////////////////////////////////////////////////////////////// Logging System. // static BOOL s_bLog = FALSE; static LONG s_nTlsIndent = -1; static LONG s_nTlsThread = -1; static LONG s_nThreadCnt = 0; VOID _PrintEnter(const CHAR *psz, ...) { DWORD dwErr = GetLastError(); LONG nIndent = 0; LONG nThread = 0; if (s_nTlsIndent >= 0) { nIndent = (LONG)(LONG_PTR)TlsGetValue(s_nTlsIndent); TlsSetValue(s_nTlsIndent, (PVOID)(LONG_PTR)(nIndent + 1)); } if (s_nTlsThread >= 0) { nThread = (LONG)(LONG_PTR)TlsGetValue(s_nTlsThread); } if (s_bLog && psz) { CHAR szBuf[1024]; PCHAR pszBuf = szBuf; PCHAR pszEnd = szBuf + ARRAYSIZE(szBuf) - 1; LONG nLen = (nIndent > 0) ? (nIndent < 35 ? nIndent * 2 : 70) : 0; *pszBuf++ = (CHAR)('0' + ((nThread / 100) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 10) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 1) % 10)); *pszBuf++ = ' '; while (nLen-- > 0) { *pszBuf++ = ' '; } *pszBuf++ = '+'; *pszBuf = '\0'; va_list args; va_start(args, psz); while ((*pszBuf++ = *psz++) != 0 && pszBuf < pszEnd) { // Copy characters. } *pszEnd = '\0'; SyelogV(SYELOG_SEVERITY_INFORMATION, szBuf, args); va_end(args); } SetLastError(dwErr); } VOID _PrintExit(const CHAR *psz, ...) { DWORD dwErr = GetLastError(); LONG nIndent = 0; LONG nThread = 0; if (s_nTlsIndent >= 0) { nIndent = (LONG)(LONG_PTR)TlsGetValue(s_nTlsIndent) - 1; ASSERT_ALWAYS(nIndent >= 0); TlsSetValue(s_nTlsIndent, (PVOID)(LONG_PTR)nIndent); } if (s_nTlsThread >= 0) { nThread = (LONG)(LONG_PTR)TlsGetValue(s_nTlsThread); } if (s_bLog && psz) { CHAR szBuf[1024]; PCHAR pszEnd = szBuf + ARRAYSIZE(szBuf) - 1; PCHAR pszBuf = szBuf; LONG nLen = (nIndent > 0) ? (nIndent < 35 ? nIndent * 2 : 70) : 0; *pszBuf++ = (CHAR)('0' + ((nThread / 100) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 10) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 1) % 10)); *pszBuf++ = ' '; while (nLen-- > 0) { *pszBuf++ = ' '; } *pszBuf++ = '-'; *pszBuf = '\0'; va_list args; va_start(args, psz); while ((*pszBuf++ = *psz++) != 0 && pszBuf < pszEnd) { // Copy characters. } *pszEnd = '\0'; SyelogV(SYELOG_SEVERITY_INFORMATION, szBuf, args); va_end(args); } SetLastError(dwErr); } VOID _Print(const CHAR *psz, ...) { DWORD dwErr = GetLastError(); LONG nIndent = 0; LONG nThread = 0; if (s_nTlsIndent >= 0) { nIndent = (LONG)(LONG_PTR)TlsGetValue(s_nTlsIndent); } if (s_nTlsThread >= 0) { nThread = (LONG)(LONG_PTR)TlsGetValue(s_nTlsThread); } if (s_bLog && psz) { CHAR szBuf[1024]; PCHAR pszEnd = szBuf + ARRAYSIZE(szBuf) - 1; PCHAR pszBuf = szBuf; LONG nLen = (nIndent > 0) ? (nIndent < 35 ? nIndent * 2 : 70) : 0; *pszBuf++ = (CHAR)('0' + ((nThread / 100) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 10) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 1) % 10)); *pszBuf++ = ' '; while (nLen-- > 0) { *pszBuf++ = ' '; } *pszBuf = '\0'; va_list args; va_start(args, psz); while ((*pszBuf++ = *psz++) != 0 && pszBuf < pszEnd) { // Copy characters. } *pszEnd = '\0'; SyelogV(SYELOG_SEVERITY_INFORMATION, szBuf, args); va_end(args); } SetLastError(dwErr); } VOID AssertMessage(CONST PCHAR pszMsg, CONST PCHAR pszFile, ULONG nLine) { Syelog(SYELOG_SEVERITY_FATAL, "ASSERT(%s) failed in %s, line %d.\n", pszMsg, pszFile, nLine); } ////////////////////////////////////////////////////////////////////////////// // PIMAGE_NT_HEADERS NtHeadersForInstance(HINSTANCE hInst) { PIMAGE_DOS_HEADER pDosHeader = (PIMAGE_DOS_HEADER)hInst; __try { if (pDosHeader->e_magic != IMAGE_DOS_SIGNATURE) { SetLastError(ERROR_BAD_EXE_FORMAT); return NULL; } PIMAGE_NT_HEADERS pNtHeader = (PIMAGE_NT_HEADERS)((PBYTE)pDosHeader + pDosHeader->e_lfanew); if (pNtHeader->Signature != IMAGE_NT_SIGNATURE) { SetLastError(ERROR_INVALID_EXE_SIGNATURE); return NULL; } if (pNtHeader->FileHeader.SizeOfOptionalHeader == 0) { SetLastError(ERROR_EXE_MARKED_INVALID); return NULL; } return pNtHeader; } __except(EXCEPTION_EXECUTE_HANDLER) { } SetLastError(ERROR_EXE_MARKED_INVALID); return NULL; } BOOL InstanceEnumerate(HINSTANCE hInst) { WCHAR wzDllName[MAX_PATH]; PIMAGE_NT_HEADERS pinh = NtHeadersForInstance(hInst); if (pinh && Real_GetModuleFileNameW(hInst, wzDllName, ARRAYSIZE(wzDllName))) { Syelog(SYELOG_SEVERITY_INFORMATION, "### %p: %ls\n", hInst, wzDllName); return TRUE; } return FALSE; } BOOL ProcessEnumerate() { Syelog(SYELOG_SEVERITY_INFORMATION, "######################################################### Binaries\n"); PBYTE pbNext; for (PBYTE pbRegion = (PBYTE)0x10000;; pbRegion = pbNext) { MEMORY_BASIC_INFORMATION mbi; ZeroMemory(&mbi, sizeof(mbi)); if (VirtualQuery((PVOID)pbRegion, &mbi, sizeof(mbi)) <= 0) { break; } pbNext = (PBYTE)mbi.BaseAddress + mbi.RegionSize; // Skip free regions, reserver regions, and guard pages. // if (mbi.State == MEM_FREE || mbi.State == MEM_RESERVE) { continue; } if (mbi.Protect & PAGE_GUARD || mbi.Protect & PAGE_NOCACHE) { continue; } if (mbi.Protect == PAGE_NOACCESS) { continue; } // Skip over regions from the same allocation... { MEMORY_BASIC_INFORMATION mbiStep; while (VirtualQuery((PVOID)pbNext, &mbiStep, sizeof(mbiStep)) > 0) { if ((PBYTE)mbiStep.AllocationBase != pbRegion) { break; } pbNext = (PBYTE)mbiStep.BaseAddress + mbiStep.RegionSize; mbi.Protect |= mbiStep.Protect; } } WCHAR wzDllName[MAX_PATH]; PIMAGE_NT_HEADERS pinh = NtHeadersForInstance((HINSTANCE)pbRegion); if (pinh && Real_GetModuleFileNameW((HINSTANCE)pbRegion,wzDllName,ARRAYSIZE(wzDllName))) { Syelog(SYELOG_SEVERITY_INFORMATION, "### %p..%p: %ls\n", pbRegion, pbNext, wzDllName); } else { Syelog(SYELOG_SEVERITY_INFORMATION, "### %p..%p: State=%04x, Protect=%08x\n", pbRegion, pbNext, mbi.State, mbi.Protect); } } Syelog(SYELOG_SEVERITY_INFORMATION, "###\n"); LPVOID lpvEnv = Real_GetEnvironmentStrings(); Syelog(SYELOG_SEVERITY_INFORMATION, "### Env= %08x [%08x %08x]\n", lpvEnv, ((PVOID*)lpvEnv)[0], ((PVOID*)lpvEnv)[1]); return TRUE; } ////////////////////////////////////////////////////////////////////////////// // // DLL module information // BOOL ThreadAttach(HMODULE hDll) { (void)hDll; if (s_nTlsIndent >= 0) { TlsSetValue(s_nTlsIndent, (PVOID)0); } if (s_nTlsThread >= 0) { LONG nThread = InterlockedIncrement(&s_nThreadCnt); TlsSetValue(s_nTlsThread, (PVOID)(LONG_PTR)nThread); } return TRUE; } BOOL ThreadDetach(HMODULE hDll) { (void)hDll; if (s_nTlsIndent >= 0) { TlsSetValue(s_nTlsIndent, (PVOID)0); } if (s_nTlsThread >= 0) { TlsSetValue(s_nTlsThread, (PVOID)0); } return TRUE; } BOOL ProcessAttach(HMODULE hDll) { s_bLog = FALSE; s_nTlsIndent = TlsAlloc(); s_nTlsThread = TlsAlloc(); ThreadAttach(hDll); WCHAR wzExeName[MAX_PATH]; s_hInst = hDll; Real_GetModuleFileNameW(hDll, s_wzDllPath, ARRAYSIZE(s_wzDllPath)); Real_GetModuleFileNameW(NULL, wzExeName, ARRAYSIZE(wzExeName)); StringCchPrintfA(s_szDllPath, ARRAYSIZE(s_szDllPath), "%ls", s_wzDllPath); SyelogOpen("trcapi" DETOURS_STRINGIFY(DETOURS_BITS), SYELOG_FACILITY_APPLICATION); ProcessEnumerate(); LONG error = AttachDetours(); if (error != NO_ERROR) { Syelog(SYELOG_SEVERITY_FATAL, "### Error attaching detours: %d\n", error); } s_bLog = TRUE; return TRUE; } BOOL ProcessDetach(HMODULE hDll) { ThreadDetach(hDll); s_bLog = FALSE; LONG error = DetachDetours(); if (error != NO_ERROR) { Syelog(SYELOG_SEVERITY_FATAL, "### Error detaching detours: %d\n", error); } Syelog(SYELOG_SEVERITY_NOTICE, "### Closing.\n"); SyelogClose(FALSE); if (s_nTlsIndent >= 0) { TlsFree(s_nTlsIndent); } if (s_nTlsThread >= 0) { TlsFree(s_nTlsThread); } return TRUE; } BOOL APIENTRY DllMain(HINSTANCE hModule, DWORD dwReason, PVOID lpReserved) { (void)hModule; (void)lpReserved; BOOL ret; if (DetourIsHelperProcess()) { return TRUE; } switch (dwReason) { case DLL_PROCESS_ATTACH: DetourRestoreAfterWith(); OutputDebugStringA("trcapi" DETOURS_STRINGIFY(DETOURS_BITS) ".dll:" " DllMain DLL_PROCESS_ATTACH\n"); return ProcessAttach(hModule); case DLL_PROCESS_DETACH: ret = ProcessDetach(hModule); OutputDebugStringA("trcapi" DETOURS_STRINGIFY(DETOURS_BITS) ".dll:" " DllMain DLL_PROCESS_DETACH\n"); return ret; case DLL_THREAD_ATTACH: OutputDebugStringA("trcapi" DETOURS_STRINGIFY(DETOURS_BITS) ".dll:" " DllMain DLL_THREAD_ATTACH\n"); return ThreadAttach(hModule); case DLL_THREAD_DETACH: OutputDebugStringA("trcapi" DETOURS_STRINGIFY(DETOURS_BITS) ".dll:" " DllMain DLL_THREAD_DETACH\n"); return ThreadDetach(hModule); } return TRUE; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/traceapi/trcapi.rc ================================================ ////////////////////////////////////////////////////////////////////////////// // // Version information for trcapi.rc. // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include "detver.h" #define VER_INTERNALNAME_STR "trcapi" DETOURS_STRINGIFY(DETOURS_BITS) #define VER_ORIGINALFILENAME_STR "trcapi" DETOURS_STRINGIFY(DETOURS_BITS) ".dll" #define VER_FILEDESCRIPTION_STR "Detours Win32 API Tracing Module" #define VER_COMPANYNAME_STR "Microsoft Corporation" #include "common.ver" ================================================ FILE: ext/detours/samples/tracebld/Makefile ================================================ ############################################################################## ## ## Utility to registry and file access APIs. ## ## Microsoft Research Detours Package ## ## Copyright (c) Microsoft Corporation. All rights reserved. ## !include ..\common.mak LIBS=$(LIBS) kernel32.lib ############################################################################## all: dirs \ $(BIND)\trcbld$(DETOURS_BITS).dll \ $(BIND)\tracebld.exe \ \ !IF $(DETOURS_SOURCE_BROWSING)==1 $(OBJD)\trcbld$(DETOURS_BITS).bsc \ $(OBJD)\tracebld.bsc \ !ENDIF option ############################################################################## clean: -del *~ test.txt log.*.xml 2>nul -del $(BIND)\tracebld.* $(BIND)\trcbld*.* 2>nul -rmdir /q /s $(OBJD) 2>nul realclean: clean -rmdir /q /s $(OBJDS) 2>nul dirs: @if not exist $(BIND) mkdir $(BIND) && echo. Created $(BIND) @if not exist $(OBJD) mkdir $(OBJD) && echo. Created $(OBJD) ############################################################################## $(OBJD)\trcbld.obj : trcbld.cpp $(OBJD)\trcbld.res : trcbld.rc $(BIND)\trcbld$(DETOURS_BITS).dll : $(OBJD)\trcbld.obj $(OBJD)\trcbld.res $(DEPS) cl /LD $(CFLAGS) /Fe$@ /Fd$(@R).pdb \ $(OBJD)\trcbld.obj $(OBJD)\trcbld.res \ /link $(LINKFLAGS) /release /subsystem:console \ /export:DetourFinishHelperProcess,@1,NONAME \ $(LIBS) $(OBJD)\trcbld$(DETOURS_BITS).bsc : $(OBJD)\trcbld.obj bscmake /v /n /o $@ $(OBJD)\trcbld.sbr $(OBJD)\tracebld.obj : tracebld.cpp $(BIND)\tracebld.exe : $(OBJD)\tracebld.obj $(DEPS) cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb $(OBJD)\tracebld.obj \ /link $(LINKFLAGS) $(LIBS) \ /subsystem:console /fixed:no $(OBJD)\tracebld.bsc : $(OBJD)\tracebld.obj bscmake /v /n /o $@ $(OBJD)\tracebld.sbr ############################################### Install non-bit-size binaries. !IF "$(DETOURS_OPTION_PROCESSOR)" != "" $(OPTD)\trcbld$(DETOURS_OPTION_BITS).dll: $(OPTD)\trcbld$(DETOURS_OPTION_BITS).pdb: $(BIND)\trcbld$(DETOURS_OPTION_BITS).dll : $(OPTD)\trcbld$(DETOURS_OPTION_BITS).dll @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\trcbld$(DETOURS_OPTION_BITS).pdb : $(OPTD)\trcbld$(DETOURS_OPTION_BITS).pdb @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). option: \ $(BIND)\trcbld$(DETOURS_OPTION_BITS).dll \ $(BIND)\trcbld$(DETOURS_OPTION_BITS).pdb \ !ELSE option: !ENDIF ############################################################################## test: all -del log.*.xml 2>nul $(BIND)\tracebld.exe /o:log %COMSPEC% /c dir @echo -------- Log from log.00000000 --------------------- type log.00000000.xml test0: all -del log.*.xml 2>nul $(BIND)\tracebld.exe /o:log %COMSPEC% /c xx.cmd @echo -------- Log from log.00000000 --------------------- type log.00000000.xml @echo -------- Log from log.00000001 --------------------- type log.00000001.xml test1: all set FooBAR=1 -del log.*.xml 2>nul @echo -------- Logging output to log ------------ -rmdir /q /s obj 2>nul $(BIND)\tracebld.exe /o:log nmake.exe test2 @echo -------- Log from log.00000000 --------------------- type log.00000000.xml | findstr /c:"t:Line" type log.00000002.xml | findstr /c:"t:Line" test1d: all -del log.*.xml 2>nul @echo -------- Logging output to log ------------ -rmdir /q /s obj 2>nul windbg -g -G -o $(BIND)\tracebld.exe /o:log nmake.exe test2 @echo -------- Log from log.00000000 --------------------- type log.00000000.xml | findstr /c:"t:Line" type log.00000002.xml | findstr /c:"t:Line" test2: all -del foo.txt echo foo1 >> foo.txt echo foo2 >> foo.txt echo foo3 >> foo.txt -del log.foo.xml -mkdir obj cmd.exe /c "set Foo=BAR&&cmd.exe /c echo. FOO=%Foo%" cl /LD $(CFLAGS) /Tp<< @< log.foo.xml #include << /Feobj\tbtest.exe /Fd$(@R).pdb $(DET_SRC) /link $(LINKFLAGS) /subsystem:console /export:DetourFinishHelperProcess,@1 < obj\test.cpp cl /c /Foobj\test.obj obj\test.cpp -del tbtest.* 2>nul test3: all -del log.*.xml 2>nul @echo -------- Logging output to log ------------ -rmdir /q /s foo $(BIND)\tracebld.exe /o:log xcopy.exe $(BIND)\trcbld.cpp foo\ /y @echo -------- Log from log.00000000 --------------------- type log.00000000.xml test4: all -del log.*.xml 2>nul echo int main() { return 0; } > obj\test.cpp $(BIND)\tracebld.exe /o:log cl /c /Foobj\test.obj obj\test.cpp @echo -------- Log from log.00000000 --------------------- type log.00000000.xml ################################################################# End of File. ================================================ FILE: ext/detours/samples/tracebld/tracebld.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (tracebld.cpp of tracebld.exe) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include #include #include #include #pragma warning(push) #if _MSC_VER > 1400 #pragma warning(disable:6102 6103) // /analyze warnings #endif #include #pragma warning(pop) #include #include "tracebld.h" #if (_MSC_VER < 1299) typedef ULONG * PULONG_PTR; typedef ULONG ULONG_PTR; typedef LONG * PLONG_PTR; typedef LONG LONG_PTR; #endif ////////////////////////////////////////////////////////////////////////////// #pragma warning(disable:4127) // Many of our asserts are constants. #define ASSERT_ALWAYS(x) \ do { \ if (!(x)) { \ AssertMessage(#x, __FILE__, __LINE__); \ DebugBreak(); \ } \ } while (0) #ifndef NDEBUG #define ASSERT(x) ASSERT_ALWAYS(x) #else #define ASSERT(x) #endif #define UNUSED(c) (c) = (c) ////////////////////////////////////////////////////////////////////////////// enum { CLIENT_AWAITING_PIPE_ACCEPT = 0x21, CLIENT_AWAITING_PIPE_DATA = 0x22, }; typedef struct _CLIENT : OVERLAPPED { HANDLE hPipe; LONG nClient; HANDLE hFile; BOOL fAwaitingAccept; PVOID Zero; TBLOG_MESSAGE Message; BOOL LogMessage(PTBLOG_MESSAGE pMessage, DWORD nBytes); BOOL LogMessageV(PCHAR pszMsg, ...); } CLIENT, *PCLIENT; ////////////////////////////////////////////////////////////////////////////// // CHAR s_szLogFile[MAX_PATH]; CHAR s_szPipe[MAX_PATH]; LONG s_nActiveClients = 0; LONG s_nTotalClients = 0; LONGLONG s_llStartTime; BOOL s_fVerbose = FALSE; TBLOG_PAYLOAD s_Payload; ////////////////////////////////////////////////////////////////////////////// // VOID MyErrExit(PCSTR pszMsg) { DWORD error = GetLastError(); fprintf(stderr, "TRACEBLD: Error %ld in %s.\n", error, pszMsg); fflush(stderr); exit(1); } ////////////////////////////////////////////////////////////////////////////// // BOOL CLIENT::LogMessageV(PCHAR pszMsg, ...) { DWORD cbWritten = 0; CHAR szBuf[1024]; PCHAR pcchEnd = szBuf + ARRAYSIZE(szBuf) - 2; PCHAR pcchCur = szBuf; HRESULT hr; va_list args; va_start(args, pszMsg); hr = StringCchVPrintfExA(pcchCur, pcchEnd - pcchCur, &pcchCur, NULL, STRSAFE_NULL_ON_FAILURE, pszMsg, args); va_end(args); if (FAILED(hr)) { goto cleanup; } hr = StringCchPrintfExA(pcchCur, szBuf + (ARRAYSIZE(szBuf)) - pcchCur, &pcchCur, NULL, STRSAFE_NULL_ON_FAILURE, "\n"); cleanup: WriteFile(hFile, szBuf, (DWORD)(pcchCur - szBuf), &cbWritten, NULL); return TRUE; } BOOL CLIENT::LogMessage(PTBLOG_MESSAGE pMessage, DWORD nBytes) { // Sanity check the size of the message. // if (nBytes > pMessage->nBytes) { nBytes = pMessage->nBytes; } if (nBytes >= sizeof(*pMessage)) { nBytes = sizeof(*pMessage) - 1; } // Don't log message if there isn't and message text. // DWORD cbWrite = nBytes - offsetof(TBLOG_MESSAGE, szMessage); if (cbWrite <= 0 ) { return TRUE; } if (s_fVerbose) { printf("[%s]", pMessage->szMessage); } DWORD cbWritten = 0; WriteFile(hFile, pMessage->szMessage, cbWrite, &cbWritten, NULL); return TRUE; } BOOL CloseConnection(PCLIENT pClient) { InterlockedDecrement(&s_nActiveClients); if (pClient != NULL) { if (pClient->hPipe != INVALID_HANDLE_VALUE) { //FlushFileBuffers(pClient->hPipe); if (!DisconnectNamedPipe(pClient->hPipe)) { DWORD error = GetLastError(); pClient->LogMessageV("\n", error); } CloseHandle(pClient->hPipe); pClient->hPipe = INVALID_HANDLE_VALUE; } if (pClient->hFile != INVALID_HANDLE_VALUE) { CloseHandle(pClient->hFile); pClient->hFile = INVALID_HANDLE_VALUE; } GlobalFree(pClient); pClient = NULL; } return TRUE; } // Creates a pipe instance and initiate an accept request. // PCLIENT CreatePipeConnection(HANDLE hCompletionPort, LONG nClient) { HANDLE hPipe = CreateNamedPipeA(s_szPipe, // pipe name PIPE_ACCESS_INBOUND | // read-only access FILE_FLAG_OVERLAPPED, // overlapped mode PIPE_TYPE_MESSAGE | // message-type pipe PIPE_READMODE_MESSAGE | // message read mode PIPE_WAIT, // blocking mode PIPE_UNLIMITED_INSTANCES, // unlimited instances 0, // output buffer size 0, // input buffer size 20000, // client time-out NULL); // no security attributes if (hPipe == INVALID_HANDLE_VALUE) { MyErrExit("CreateNamedPipe"); } // Allocate the client data structure. // PCLIENT pClient = (PCLIENT) GlobalAlloc(GPTR, sizeof(CLIENT)); if (pClient == NULL) { MyErrExit("GlobalAlloc pClient"); } CHAR szLogFile[MAX_PATH]; StringCchPrintfA(szLogFile, ARRAYSIZE(szLogFile), "%s.%08d.xml", s_szLogFile, nClient); ZeroMemory(pClient, sizeof(*pClient)); pClient->hPipe = hPipe; pClient->nClient = nClient; pClient->fAwaitingAccept = TRUE; pClient->hFile = CreateFileA(szLogFile, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL); if (pClient->hFile == INVALID_HANDLE_VALUE) { fprintf(stderr, "TRACEBLD: Error opening output file: %s: %ld\n\n", szLogFile, GetLastError()); fflush(stderr); MyErrExit("CreateFile"); } // Associate file with our complietion port. // if (!CreateIoCompletionPort(pClient->hPipe, hCompletionPort, (ULONG_PTR)pClient, 0)) { MyErrExit("CreateIoComplietionPort pClient"); } if (!ConnectNamedPipe(hPipe, pClient)) { DWORD error = GetLastError(); if (error == ERROR_IO_PENDING) { return NULL; } if (error == ERROR_PIPE_CONNECTED) { #if 0 pClient->LogMessageV(""); #endif pClient->fAwaitingAccept = FALSE; } else if (error != ERROR_IO_PENDING && error != ERROR_PIPE_LISTENING) { MyErrExit("ConnectNamedPipe"); } } else { fprintf(stderr, "*** ConnectNamedPipe accepted immediately.\n"); #if 0 pClient->LogMessageV(""); #endif pClient->fAwaitingAccept = FALSE; } return pClient; } BOOL DoRead(PCLIENT pClient) { SetLastError(NO_ERROR); DWORD nBytes = 0; BOOL b = ReadFile(pClient->hPipe, &pClient->Message, sizeof(pClient->Message), &nBytes, pClient); DWORD error = GetLastError(); if (b && error == NO_ERROR) { return TRUE; } if (error == ERROR_BROKEN_PIPE) { pClient->LogMessageV("\n", nBytes); CloseConnection(pClient); return TRUE; } else if (error == ERROR_INVALID_HANDLE) { // ? pClient->LogMessageV("\n"); // I have no idea why this happens. Our remedy is to drop the connection. return TRUE; } else if (error != ERROR_IO_PENDING) { if (b) { pClient->LogMessageV("\n", error); } else { pClient->LogMessageV("\n", error); } CloseConnection(pClient); } return TRUE; } DWORD WINAPI WorkerThread(LPVOID pvVoid) { PCLIENT pClient; BOOL b; LPOVERLAPPED lpo; DWORD nBytes; HANDLE hCompletionPort = (HANDLE)pvVoid; for (BOOL fKeepLooping = TRUE; fKeepLooping;) { pClient = NULL; lpo = NULL; nBytes = 0; b = GetQueuedCompletionStatus(hCompletionPort, &nBytes, (PULONG_PTR)&pClient, &lpo, INFINITE); if (!b) { if (pClient) { if (GetLastError() == ERROR_BROKEN_PIPE) { pClient->LogMessageV(""); } else { pClient->LogMessageV("", GetLastError()); } CloseConnection(pClient); } continue; } if (pClient->fAwaitingAccept) { BOOL fAgain = TRUE; while (fAgain) { LONG nClient = InterlockedIncrement(&s_nTotalClients); InterlockedIncrement(&s_nActiveClients); pClient->fAwaitingAccept = FALSE; PCLIENT pNew = CreatePipeConnection(hCompletionPort, nClient); fAgain = FALSE; if (pNew != NULL) { fAgain = !pNew->fAwaitingAccept; DoRead(pNew); } } } else { if (nBytes <= offsetof(TBLOG_MESSAGE, szMessage)) { pClient->LogMessageV("\n"); CloseConnection(pClient); continue; } pClient->LogMessage(&pClient->Message, nBytes); } DoRead(pClient); } return 0; } BOOL CreateWorkers(HANDLE hCompletionPort) { DWORD dwThread; HANDLE hThread; DWORD i; SYSTEM_INFO SystemInfo; GetSystemInfo(&SystemInfo); for (i = 0; i < 1; i++) { hThread = CreateThread(NULL, 0, WorkerThread, hCompletionPort, 0, &dwThread); if (!hThread) { MyErrExit("CreateThread WorkerThread"); // Unreachable: return FALSE; } CloseHandle(hThread); } return TRUE; } DWORD CopyEnvironment(PWCHAR pwzzOut, PCWSTR pwzzIn) { PCWSTR pwzzBeg = pwzzOut; while (*pwzzIn) { while (*pwzzIn) { *pwzzOut++ = *pwzzIn++; } *pwzzOut++ = *pwzzIn++; // Copy zero. } *pwzzOut++ = '\0'; // Add last zero. return (DWORD)(pwzzOut - pwzzBeg); } ////////////////////////////////////////////////////////////////////////////// // DWORD main(int argc, char **argv) { HANDLE hCompletionPort; BOOL fNeedHelp = FALSE; WCHAR wzzDrop[1024] = L"build\0nmake\0"; GetSystemTimeAsFileTime((FILETIME *)&s_llStartTime); StringCchPrintfA(s_szPipe, ARRAYSIZE(s_szPipe), "%s.%d", TBLOG_PIPE_NAME, GetCurrentProcessId()); int arg = 1; for (; arg < argc && (argv[arg][0] == '-' || argv[arg][0] == '/'); arg++) { CHAR *argn = argv[arg] + 1; CHAR *argp = argn; while (*argp && *argp != ':' && *argp != '=') { argp++; } if (*argp == ':' || *argp == '=') { *argp++ = '\0'; } switch (argn[0]) { case 'd': // Drop Processes case 'D': if (*argp) { PWCHAR pwz = wzzDrop; while (*argp) { if (*argp == ';') { *pwz++ = '\0'; } else { *pwz++ = *argp++; } } *pwz++ = '\0'; *pwz = '\0'; } case 'o': // Output file. case 'O': StringCchCopyA(s_szLogFile, ARRAYSIZE(s_szLogFile), argp); break; case 'v': // Verbose case 'V': s_fVerbose = TRUE; break; case '?': // Help. fNeedHelp = TRUE; break; default: fNeedHelp = TRUE; printf("TRACEBLD: Bad argument: %s:%s\n", argn, argp); break; } } if (arg >= argc) { fNeedHelp = TRUE; } if (fNeedHelp) { printf("Usage:\n" " tracebld [options] command {command arguments}\n" "Options:\n" " /o:file Log all events to the output files.\n" " /? Display this help message.\n" "Summary:\n" " Runs the build commands and figures out which files have dependencies..\n" "\n"); exit(9001); } // Create the completion port. hCompletionPort = CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, NULL, 0); if (hCompletionPort == NULL) { MyErrExit("CreateIoCompletionPort"); } // Create completion port worker threads. // CreateWorkers(hCompletionPort); CreatePipeConnection(hCompletionPort, 0); printf("TRACEBLD: Ready for clients. Press Ctrl-C to stop.\n"); /////////////////////////////////////////////////////////// Validate DLLs. // CHAR szTmpPath[MAX_PATH]; CHAR szExePath[MAX_PATH]; CHAR szDllPath[MAX_PATH]; PCHAR pszFilePart = NULL; if (!GetModuleFileNameA(NULL, szTmpPath, ARRAYSIZE(szTmpPath))) { printf("TRACEBLD: Couldn't retreive exe name.\n"); return 9002; } if (!GetFullPathNameA(szTmpPath, ARRAYSIZE(szExePath), szExePath, &pszFilePart) || pszFilePart == NULL) { printf("TRACEBLD: Error: %s is not a valid path name..\n", szTmpPath); return 9002; } StringCchCopyA(pszFilePart, szExePath + ARRAYSIZE(szExePath) - pszFilePart, "trcbld" DETOURS_STRINGIFY(DETOURS_BITS) ".dll"); StringCchCopyA(szDllPath, ARRAYSIZE(szDllPath), szExePath); ////////////////////////////////////////////////////////////////////////// STARTUPINFOA si; PROCESS_INFORMATION pi; CHAR szCommand[2048]; CHAR szExe[MAX_PATH]; CHAR szFullExe[MAX_PATH] = "\0"; PCHAR pszFileExe = NULL; ZeroMemory(&si, sizeof(si)); ZeroMemory(&pi, sizeof(pi)); si.cb = sizeof(si); szCommand[0] = L'\0'; StringCchCopyA(szExe, sizeof(szExe), argv[arg]); for (; arg < argc; arg++) { if (strchr(argv[arg], ' ') != NULL || strchr(argv[arg], '\t') != NULL) { StringCchCatA(szCommand, sizeof(szCommand), "\""); StringCchCatA(szCommand, sizeof(szCommand), argv[arg]); StringCchCatA(szCommand, sizeof(szCommand), "\""); } else { StringCchCatA(szCommand, sizeof(szCommand), argv[arg]); } if (arg + 1 < argc) { StringCchCatA(szCommand, sizeof(szCommand), " "); } } printf("TRACEBLD: Starting: `%s'\n", szCommand); printf("TRACEBLD: with `%s'\n", szDllPath); fflush(stdout); DWORD dwFlags = CREATE_DEFAULT_ERROR_MODE | CREATE_SUSPENDED; SetLastError(0); SearchPathA(NULL, szExe, ".exe", ARRAYSIZE(szFullExe), szFullExe, &pszFileExe); if (!DetourCreateProcessWithDllExA(szFullExe[0] ? szFullExe : NULL, szCommand, NULL, NULL, TRUE, dwFlags, NULL, NULL, &si, &pi, szDllPath, NULL)) { printf("TRACEBLD: DetourCreateProcessWithDllEx failed: %ld\n", GetLastError()); ExitProcess(9007); } ZeroMemory(&s_Payload, sizeof(s_Payload)); s_Payload.nParentProcessId = GetCurrentProcessId(); s_Payload.nTraceProcessId = GetCurrentProcessId(); s_Payload.nGeneology = 1; s_Payload.rGeneology[0] = 0; StringCchCopyW(s_Payload.wzStdin, ARRAYSIZE(s_Payload.wzStdin), L"\\\\.\\CONIN$"); StringCchCopyW(s_Payload.wzStdout, ARRAYSIZE(s_Payload.wzStdout), L"\\\\.\\CONOUT$"); StringCchCopyW(s_Payload.wzStderr, ARRAYSIZE(s_Payload.wzStderr), L"\\\\.\\CONOUT$"); StringCchCopyW(s_Payload.wzParents, ARRAYSIZE(s_Payload.wzParents), L""); CopyEnvironment(s_Payload.wzzDrop, wzzDrop); LPWCH pwStrings = GetEnvironmentStringsW(); CopyEnvironment(s_Payload.wzzEnvironment, pwStrings); FreeEnvironmentStringsW(pwStrings); if (!DetourCopyPayloadToProcess(pi.hProcess, s_guidTrace, &s_Payload, sizeof(s_Payload))) { printf("TRACEBLD: DetourCopyPayloadToProcess failed: %ld\n", GetLastError()); ExitProcess(9008); } ResumeThread(pi.hThread); WaitForSingleObject(pi.hProcess, INFINITE); DWORD dwResult = 0; if (!GetExitCodeProcess(pi.hProcess, &dwResult)) { printf("TRACEBLD: GetExitCodeProcess failed: %ld\n", GetLastError()); return 9008; } printf("TRACEBLD: %ld processes.\n", s_nTotalClients); return dwResult; } // ////////////////////////////////////////////////////////////////////////////// ================================================ FILE: ext/detours/samples/tracebld/tracebld.h ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (tracebld.h of tracebld.exe) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #pragma once #ifndef _TRACEBLD_H_ #define _TRACEBLD_H_ #include ////////////////////////////////////////////////////////////////////////////// // // #define TBLOG_PIPE_NAMEA "\\\\.\\pipe\\tracebuild" #define TBLOG_PIPE_NAMEW L"\\\\.\\pipe\\tracebuild" #ifdef UNICODE #define TBLOG_PIPE_NAME TBLOG_PIPE_NAMEW #else #define TBLOG_PIPE_NAME TBLOG_PIPE_NAMEA #endif ////////////////////////////////////////////////////////////////////////////// // typedef struct _TBLOG_MESSAGE { DWORD nBytes; CHAR szMessage[32764]; // 32768 - sizeof(nBytes) } TBLOG_MESSAGE, *PTBLOG_MESSAGE; typedef struct _TBLOG_PAYLOAD { DWORD nParentProcessId; DWORD nTraceProcessId; DWORD nGeneology; DWORD rGeneology[64]; WCHAR wzParents[256]; WCHAR wzStdin[256]; WCHAR wzStdout[256]; WCHAR wzStderr[256]; BOOL fStdoutAppend; BOOL fStderrAppend; WCHAR wzzDrop[1024]; // Like an environment: zero terminated strings with a last zero. WCHAR wzzEnvironment[32768]; } TBLOG_PAYLOAD, *PTBLOG_PAYLOAD; // Shared state payload guid. // const GUID s_guidTrace = { 0xd8e2dc69, 0x3004, 0x453e, {0x94, 0x15, 0x19, 0x0e, 0x79, 0xe8, 0x93, 0x52} }; #endif // _TRACEBLD_H_ // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/tracebld/trcbld.cpp ================================================ ///////////////////////////////////////////////////////////////////////////// // // Detours Test Program (trcbld.cpp of trcbld.dll) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #define _WIN32_WINNT 0x0500 #define WIN32 #define NT #define DBG_TRACE 0 #include #include #pragma warning(push) #if _MSC_VER > 1400 #pragma warning(disable:6102 6103) // /analyze warnings #endif #include #pragma warning(pop) #include "detours.h" #include "tracebld.h" #define PULONG_PTR PVOID #define PLONG_PTR PVOID #define ULONG_PTR PVOID ////////////////////////////////////////////////////////////////////////////// #pragma warning(disable:4127) // Many of our asserts are constants. #define DEBUG_BREAK() DebugBreak() #define ASSERT_ALWAYS(x) \ do { \ if (!(x)) { \ AssertFailed(#x, __FILE__, __LINE__); \ DebugBreak(); \ } \ } while (0) #ifndef NDEBUG #define ASSERT(x) ASSERT_ALWAYS(x) #else #define ASSERT(x) #endif #define UNUSED(c) (c) = (c) ////////////////////////////////////////////////////////////////////////////// static HMODULE s_hInst = NULL; static HMODULE s_hKernel32 = NULL; static CHAR s_szDllPath[MAX_PATH]; static TBLOG_PAYLOAD s_Payload; static TBLOG_PAYLOAD s_ChildPayload; static CRITICAL_SECTION s_csChildPayload; static DWORD s_nTraceProcessId = 0; static LONG s_nChildCnt = 0; static CRITICAL_SECTION s_csPipe; // Guards access to hPipe. static HANDLE s_hPipe = INVALID_HANDLE_VALUE; static TBLOG_MESSAGE s_rMessage; // Logging Functions. // VOID Tblog(PCSTR pszMsgf, ...); VOID TblogV(PCSTR pszMsgf, va_list args); VOID VSafePrintf(PCSTR pszMsg, va_list args, PCHAR pszBuffer, LONG cbBuffer); PCHAR SafePrintf(PCHAR pszBuffer, LONG cbBuffer, PCSTR pszMsg, ...); LONG EnterFunc(); VOID ExitFunc(); VOID Print(PCSTR psz, ...); VOID NoteRead(PCSTR psz); VOID NoteRead(PCWSTR pwz); VOID NoteWrite(PCSTR psz); VOID NoteWrite(PCWSTR pwz); VOID NoteDelete(PCSTR psz); VOID NoteDelete(PCWSTR pwz); VOID NoteCleanup(PCSTR psz); VOID NoteCleanup(PCWSTR pwz); PBYTE LoadFile(HANDLE hFile, DWORD cbFile); static PCHAR RemoveReturns(PCHAR pszBuffer); static PWCHAR RemoveReturns(PWCHAR pwzBuffer); VOID AssertFailed(CONST PCHAR pszMsg, CONST PCHAR pszFile, ULONG nLine); int WINAPI Mine_EntryPoint(VOID); VOID WINAPI Mine_ExitProcess(UINT a0); ////////////////////////////////////////////////////////////////////////////// // int (WINAPI * Real_EntryPoint)(VOID) = NULL; BOOL (WINAPI * Real_CreateDirectoryW)(LPCWSTR a0, LPSECURITY_ATTRIBUTES a1) = CreateDirectoryW; BOOL (WINAPI * Real_CreateDirectoryExW)(LPCWSTR a0, LPCWSTR a1, LPSECURITY_ATTRIBUTES a2) = CreateDirectoryExW; HANDLE (WINAPI * Real_CreateFileW)(LPCWSTR a0, DWORD a1, DWORD a2, LPSECURITY_ATTRIBUTES a3, DWORD a4, DWORD a5, HANDLE a6) = CreateFileW; HANDLE (WINAPI * Real_CreateFileMappingW)(HANDLE hFile, LPSECURITY_ATTRIBUTES lpAttributes, DWORD flProtect, DWORD dwMaximumSizeHigh, DWORD dwMaximumSizeLow, LPCWSTR lpName ) = CreateFileMappingW; BOOL (WINAPI * Real_CreatePipe)(PHANDLE hReadPipe, PHANDLE hWritePipe, LPSECURITY_ATTRIBUTES lpPipeAttributes, DWORD nSize) = CreatePipe; BOOL (WINAPI * Real_CloseHandle)(HANDLE a0) = CloseHandle; BOOL (WINAPI * Real_DuplicateHandle)(HANDLE hSourceProcessHandle, HANDLE hSourceHandle, HANDLE hTargetProcessHandle, LPHANDLE lpTargetHandle, DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwOptions) = DuplicateHandle; BOOL (WINAPI * Real_CreateProcessW)(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) = CreateProcessW; BOOL (WINAPI * Real_CreateProcessA)(LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) = CreateProcessA; BOOL (WINAPI * Real_DeleteFileW)(LPCWSTR a0) = DeleteFileW; BOOL (WINAPI * Real_DeviceIoControl)(HANDLE a0, DWORD dwIoControlCode, LPVOID lpInBuffer, DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped) = DeviceIoControl; DWORD (WINAPI * Real_GetFileAttributesW)(LPCWSTR a0) = GetFileAttributesW; BOOL (WINAPI * Real_MoveFileWithProgressW)(LPCWSTR lpExistingFileName, LPCWSTR lpNewFileName, LPPROGRESS_ROUTINE lpProgressRoutine, LPVOID lpData, DWORD dwFlags) = MoveFileWithProgressW; BOOL (WINAPI * Real_MoveFileA)(LPCSTR a0, LPCSTR a1) = MoveFileA; BOOL (WINAPI * Real_MoveFileW)(LPCWSTR a0, LPCWSTR a12) = MoveFileW; BOOL (WINAPI * Real_MoveFileExA)(LPCSTR a0, LPCSTR a1, DWORD a2) = MoveFileExA; BOOL (WINAPI * Real_MoveFileExW)(LPCWSTR a0, LPCWSTR a1, DWORD a2) = MoveFileExW; BOOL (WINAPI * Real_CopyFileExA)(LPCSTR a0, LPCSTR a1, LPPROGRESS_ROUTINE a2, LPVOID a4, LPBOOL a5, DWORD a6) = CopyFileExA; BOOL (WINAPI * Real_CopyFileExW)(LPCWSTR a0, LPCWSTR a1, LPPROGRESS_ROUTINE a2, LPVOID a4, LPBOOL a5, DWORD a6) = CopyFileExW; BOOL (WINAPI * Real_PrivCopyFileExW)(LPCWSTR lpExistingFileName, LPCWSTR lpNewFileName, LPPROGRESS_ROUTINE lpProgressRoutine, LPVOID lpData, LPBOOL pbCancel, DWORD dwCopyFlags) = NULL; BOOL (WINAPI * Real_CreateHardLinkA)(LPCSTR a0, LPCSTR a1, LPSECURITY_ATTRIBUTES a2) = CreateHardLinkA; BOOL (WINAPI * Real_CreateHardLinkW)(LPCWSTR a0, LPCWSTR a1, LPSECURITY_ATTRIBUTES a2) = CreateHardLinkW; BOOL (WINAPI * Real_SetStdHandle)(DWORD a0, HANDLE a1) = SetStdHandle; HMODULE (WINAPI * Real_LoadLibraryA)(LPCSTR a0) = LoadLibraryA; HMODULE (WINAPI * Real_LoadLibraryW)(LPCWSTR a0) = LoadLibraryW; HMODULE (WINAPI * Real_LoadLibraryExA)(LPCSTR a0, HANDLE a1, DWORD a2) = LoadLibraryExA; HMODULE (WINAPI * Real_LoadLibraryExW)(LPCWSTR a0, HANDLE a1, DWORD a2) = LoadLibraryExW; DWORD (WINAPI * Real_SetFilePointer)(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod) = SetFilePointer; BOOL (WINAPI * Real_SetFilePointerEx)(HANDLE hFile, LARGE_INTEGER liDistanceToMove, PLARGE_INTEGER lpNewFilePointer, DWORD dwMoveMethod) = SetFilePointerEx; BOOL (WINAPI * Real_ReadFile)(HANDLE a0, LPVOID a1, DWORD a2, LPDWORD a3, LPOVERLAPPED a4) = ReadFile; BOOL (WINAPI * Real_ReadFileEx)(HANDLE a0, LPVOID a1, DWORD a2, LPOVERLAPPED a3, LPOVERLAPPED_COMPLETION_ROUTINE a4) = ReadFileEx; BOOL (WINAPI * Real_WriteFile)(HANDLE a0, LPCVOID a1, DWORD a2, LPDWORD a3, LPOVERLAPPED a4) = WriteFile; BOOL (WINAPI * Real_WriteFileEx)(HANDLE a0, LPCVOID a1, DWORD a2, LPOVERLAPPED a3, LPOVERLAPPED_COMPLETION_ROUTINE a4) = WriteFileEx; BOOL (WINAPI * Real_WriteConsoleA)(HANDLE a0, const VOID* a1, DWORD a2, LPDWORD a3, LPVOID a4) = WriteConsoleA; BOOL (WINAPI * Real_WriteConsoleW)(HANDLE a0, const VOID* a1, DWORD a2, LPDWORD a3, LPVOID a4) = WriteConsoleW; VOID (WINAPI * Real_ExitProcess)(UINT a0) = ExitProcess; DWORD (WINAPI * Real_ExpandEnvironmentStringsA)(PCSTR lpSrc, PCHAR lpDst, DWORD nSize) = ExpandEnvironmentStringsA; DWORD (WINAPI * Real_ExpandEnvironmentStringsW)(PCWSTR lpSrc, PWCHAR lpDst, DWORD nSize) = ExpandEnvironmentStringsW; DWORD (WINAPI * Real_GetEnvironmentVariableA)(PCSTR lpName, PCHAR lpBuffer, DWORD nSize) = GetEnvironmentVariableA; DWORD (WINAPI * Real_GetEnvironmentVariableW)(PCWSTR lpName, PWCHAR lpBuffer, DWORD nSize) = GetEnvironmentVariableW; PCWSTR (CDECL * Real_wgetenv)(PCWSTR var) = NULL; PCSTR (CDECL * Real_getenv)(PCSTR var) = NULL; DWORD (CDECL * Real_getenv_s)(DWORD *pValue, PCHAR pBuffer, DWORD cBuffer, PCSTR varname) = NULL; DWORD (CDECL * Real_wgetenv_s)(DWORD *pValue, PWCHAR pBuffer, DWORD cBuffer, PCWSTR varname) = NULL; DWORD (CDECL * Real_dupenv_s)(PCHAR *ppBuffer, DWORD *pcBuffer, PCSTR varname) = NULL; DWORD (CDECL * Real_wdupenv_s)(PWCHAR *ppBuffer, DWORD *pcBuffer, PCWSTR varname) = NULL; ////////////////////////////////////////////////////////////////////////////// // static VOID Copy(PWCHAR pwzDst, PCWSTR pwzSrc) { while (*pwzSrc) { *pwzDst++ = *pwzSrc++; } *pwzDst = '\0'; } static DWORD Size(PCWSTR pwzSrc) { DWORD c = 0; while (pwzSrc[c]) { c++; } return c; } static PCWSTR Save(PCWSTR pwzSrc) { DWORD c = (Size(pwzSrc) + 1) * sizeof(WCHAR); PWCHAR pwzDst = (PWCHAR)GlobalAlloc(GPTR, c); CopyMemory(pwzDst, pwzSrc, c); return pwzDst; } static BOOL HasSpace(PCWSTR pwz) { for (; *pwz; pwz++) { if (*pwz == ' ' || *pwz == '\t' || *pwz == '\r' || *pwz == '\n') { return TRUE; } } return FALSE; } static BOOL HasChar(PCWSTR pwz, WCHAR w) { for (; *pwz; pwz++) { if (*pwz == w) { return TRUE; } } return FALSE; } static DWORD Compare(PCWSTR pwzA, PCWSTR pwzB) { for (;;) { WCHAR cA = *pwzA++; WCHAR cB = *pwzB++; if (cA >= 'A' && cA <= 'Z') { cA += ('a' - 'A'); } if (cB >= 'A' && cB <= 'Z') { cB += ('a' - 'A'); } if (cA == 0 && cB == 0) { return 0; } if (cA != cB) { return cA - cB; } } } static DWORD Compare(PCWSTR pwzA, PCSTR pszB) { for (;;) { WCHAR cA = *pwzA++; WCHAR cB = *pszB++; if (cA >= 'A' && cA <= 'Z') { cA += ('a' - 'A'); } if (cB >= 'A' && cB <= 'Z') { cB += ('a' - 'A'); } if (cA == 0 && cB == 0) { return 0; } if (cA != cB) { return cA - cB; } } } static DWORD Compare(PCSTR pszA, PCSTR pszB) { for (;;) { CHAR cA = *pszA++; CHAR cB = *pszB++; if (cA >= 'A' && cA <= 'Z') { cA += ('a' - 'A'); } if (cB >= 'A' && cB <= 'Z') { cB += ('a' - 'A'); } if (cA == 0 && cB == 0) { return 0; } if (cA != cB) { return cA - cB; } } } ////////////////////////////////////////////////////////////////////////////// static PCSTR s_rpszMsvcrNames[] = { "msvcr80.dll", "msvcr80d.dll", "msvcr71.dll", "msvcr71d.dll", "msvcr70.dll", "msvcr70d.dll", NULL }; HMODULE s_hMsvcr = NULL; PCSTR s_pszMsvcr = NULL; static BOOL WINAPI ImportFileCallback(PVOID pContext, HMODULE hFile, PCSTR pszFile) { UNUSED(pContext); if (pszFile != NULL) { for (int i = 0; s_rpszMsvcrNames[i]; i++) { if (Compare(pszFile, s_rpszMsvcrNames[i]) == 0) { s_hMsvcr = hFile; s_pszMsvcr = s_rpszMsvcrNames[i]; return FALSE; } } } return TRUE; } BOOL FindMsvcr() { DetourEnumerateImports(NULL, NULL, ImportFileCallback, NULL); if (s_hMsvcr != NULL) { return TRUE; } return FALSE; } BOOL FindProc(PVOID * ppvCode, PCSTR pwzFunc) { PVOID pv = GetProcAddress(s_hMsvcr, pwzFunc); if (pv != NULL) { *ppvCode = pv; return TRUE; } else { *ppvCode = NULL; return FALSE; } } ////////////////////////////////////////////////////////////////////////////// // struct EnvInfo { DWORD m_nHash; DWORD m_nIndex; PCWSTR m_pwzVar; PCWSTR m_pwzVal; BOOL m_fDefined; BOOL m_fUsed; BOOL m_fOriginal; }; ////////////////////////////////////////////////////////////////////////////// // class EnvVars { private: static CRITICAL_SECTION s_csLock; static DWORD s_nVars; static DWORD s_nCapacity; static EnvInfo ** s_pVars; private: static DWORD Hash(PCWSTR pwzVar) { DWORD hash = 5381; while (*pwzVar != 0) { WCHAR c = *pwzVar++; if (c >= 'A' && c <= 'Z') { c += ('a' - 'A'); } hash = ((hash << 5) + hash) + c; } return hash; } static VOID LockAcquire() { EnterCriticalSection(&s_csLock); } static VOID LockRelease() { LeaveCriticalSection(&s_csLock); } static VOID Resize(DWORD nCapacity); static VOID Set(EnvInfo *info); static EnvInfo * Find(PCWSTR pwzVar); public: static BOOL Equal(PCWSTR pwzA, PCWSTR pwzB) { return (Compare(pwzA, pwzB) == 0); } public: static VOID Initialize(); static VOID Dump(); static VOID Add(PCWSTR pwzVar, PCWSTR pwzVal); static VOID Used(PCWSTR pwzVar); static VOID Used(PCSTR pszVar); }; CRITICAL_SECTION EnvVars::s_csLock; DWORD EnvVars::s_nVars = 0; DWORD EnvVars::s_nCapacity = 0; EnvInfo ** EnvVars::s_pVars = NULL; VOID EnvVars::Initialize() { InitializeCriticalSection(&s_csLock); Resize(919); } VOID EnvVars::Resize(DWORD nCapacity) { if (nCapacity > s_nCapacity) { DWORD nOld = s_nCapacity; EnvInfo ** pOld = s_pVars; // DEBUG_BREAK(); s_pVars = (EnvInfo **)GlobalAlloc(GPTR, nCapacity * sizeof(EnvInfo *)); s_nCapacity = nCapacity; if (pOld != NULL) { for (DWORD n = 0; n < nOld; n++) { if (pOld[n] != NULL) { Set(pOld[n]); } } GlobalFree((HGLOBAL)pOld); pOld = NULL; } } } VOID EnvVars::Set(EnvInfo *info) { DWORD hash = info->m_nHash; DWORD slot = hash % s_nCapacity; DWORD death = 0; // Find an empty slot. for (; s_pVars[slot] != NULL; slot = (slot + 1) % s_nCapacity) { if (++death > s_nCapacity) { // We should have dropped out at some point... DEBUG_BREAK(); } } s_pVars[slot] = info; } EnvInfo * EnvVars::Find(PCWSTR pwzVar) { DWORD hash = Hash(pwzVar); DWORD slot = hash % s_nCapacity; LockAcquire(); // Find the the matching slot, or an empty one. for (; s_pVars[slot] != NULL; slot = (slot + 1) % s_nCapacity) { if (Equal(s_pVars[slot]->m_pwzVar, pwzVar)) { LockRelease(); return s_pVars[slot]; } } LockRelease(); return NULL; } VOID EnvVars::Add(PCWSTR pwzVar, PCWSTR pwzVal) { if (pwzVar == NULL) { return; } WCHAR wzVar[MAX_PATH]; PWCHAR pwzDst = wzVar; while (*pwzVar) { if (*pwzVar >= 'a' && *pwzVar <= 'z') { *pwzDst++ = *pwzVar - ('a' - 'A'); } else { *pwzDst++ = *pwzVar; } pwzVar++; } *pwzDst = '\0'; pwzVar = wzVar; WCHAR wzVal[] = L""; if (pwzVal != NULL) { while (*pwzVal == ' ' || *pwzVal == '\t') { *pwzVal++; } } else { pwzVal = wzVal; } // Tblog("\n", pwzVar, pwzVal); LockAcquire(); // DEBUG_BREAK(); DWORD hash = Hash(pwzVar); DWORD slot = hash % s_nCapacity; EnvInfo *info = NULL; DWORD death = 0; // Find the the matching slot, or an empty one. for (; s_pVars[slot] != NULL; slot = (slot + 1) % s_nCapacity) { if (Equal(s_pVars[slot]->m_pwzVar, pwzVar)) { LockRelease(); return; } if (++death > s_nCapacity) { // We should have dropped out at some point... DEBUG_BREAK(); } } // Add the var to list of known vars. info = (EnvInfo *)GlobalAlloc(GPTR, sizeof(EnvInfo)); info->m_nHash = hash; info->m_nIndex = s_nVars++; info->m_pwzVar = Save(pwzVar); info->m_pwzVal = Save(pwzVal); if (pwzVal[0] == '\0') { info->m_fDefined = FALSE; info->m_fUsed = TRUE; } else { info->m_fDefined = TRUE; } s_pVars[slot] = info; // Check if we should grow the table. if (s_nVars > (s_nCapacity / 2)) { Resize(s_nCapacity * 2 - 1); } LockRelease(); } VOID EnvVars::Used(PCWSTR pwzVar) { if (pwzVar != NULL) { // Tblog("\n", pwzVar); EnvInfo *pInfo = Find(pwzVar); if (pInfo) { pInfo->m_fUsed = TRUE; } #if 0 else { Add(pwzVar, NULL); } #endif } } VOID EnvVars::Used(PCSTR pszVar) { if (pszVar != NULL) { WCHAR wzVar[MAX_PATH]; PWCHAR pwzVar = wzVar; while (*pszVar) { *pwzVar++ = *pszVar++; } *pwzVar = '\0'; Used(wzVar); } } VOID EnvVars::Dump() { if (s_nVars == 0) { return; } LockAcquire(); Tblog("\n"); // Remove any variables that match the original environment. PCWSTR pwzz = s_Payload.wzzEnvironment; while (*pwzz) { WCHAR wzVar[MAX_PATH]; PWCHAR pwzVar = wzVar; while (*pwzz && *pwzz != '=') { *pwzVar++ = *pwzz++; } *pwzVar = '\0'; if (*pwzz == '=') { pwzz++; } EnvInfo *pInfo = Find(wzVar); if (pInfo) { if (Compare(pwzz, pInfo->m_pwzVal) == 0) { pInfo->m_fUsed = FALSE; } } pwzz += Size(pwzz) + 1; } EnvInfo ** pSorted = (EnvInfo **)GlobalAlloc(GPTR, s_nVars * sizeof(EnvInfo *)); for (DWORD n = 0; n < s_nCapacity; n++) { if (s_pVars[n] != NULL) { if (s_pVars[n]->m_nIndex > s_nVars) { DEBUG_BREAK(); } pSorted[s_pVars[n]->m_nIndex] = s_pVars[n]; } } for (DWORD n = 0; n < s_nVars; n++) { EnvInfo *pInfo = pSorted[n]; if (pInfo == NULL) { Print("\n", n, s_nVars); continue; } if (pInfo->m_fUsed && pInfo->m_pwzVal[0]) { Print("%le\n", pInfo->m_pwzVar, pInfo->m_pwzVal); } } GlobalFree((HGLOBAL)pSorted); Tblog("\n"); LockRelease(); } void SaveEnvironment() { LPWCH pwStrings = GetEnvironmentStringsW(); PCWSTR pwEnv = (PCWSTR)pwStrings; while (*pwEnv != '\0') { WCHAR wzVar[MAX_PATH]; PWCHAR pwzDst = wzVar; PCWSTR pwzVal = NULL; if (*pwEnv == '=') { *pwzDst++ = *pwEnv++; } while (*pwEnv != '\0' && *pwEnv != '=') { *pwzDst++ = *pwEnv++; } *pwzDst++ = '\0'; if (*pwEnv == '=') { pwEnv++; } pwzVal = pwEnv; while (*pwEnv != '\0') { pwEnv++; } if (*pwEnv == '\0') { pwEnv++; } if (wzVar[0] != '=') { EnvVars::Add(wzVar, pwzVal); } } FreeEnvironmentStringsW(pwStrings); } ////////////////////////////////////////////////////////////////////////////// // struct ProcInfo { HANDLE m_hProc; DWORD m_nProcId; DWORD m_nProc; }; class Procs { private: static CRITICAL_SECTION s_csLock; static DWORD s_nProcs; static ProcInfo s_rProcs[4049]; private: static ProcInfo& HashToSlot(HANDLE handle) { return s_rProcs[((DWORD_PTR)handle) % ARRAYSIZE(s_rProcs)]; } static VOID LockAcquire() { EnterCriticalSection(&s_csLock); } static VOID LockRelease() { LeaveCriticalSection(&s_csLock); } public: static VOID Initialize(); static ProcInfo * Create(HANDLE hProc, DWORD nProcId); static BOOL Close(HANDLE hProc); }; CRITICAL_SECTION Procs::s_csLock; DWORD Procs::s_nProcs = 0; ProcInfo Procs::s_rProcs[4049]; VOID Procs::Initialize() { InitializeCriticalSection(&s_csLock); for (DWORD i = 0; i < ARRAYSIZE(s_rProcs); i++) { s_rProcs[i].m_hProc = INVALID_HANDLE_VALUE; } } ProcInfo * Procs::Create(HANDLE hProc, DWORD nProcId) { LockAcquire(); s_nProcs++; ProcInfo& slot = HashToSlot(hProc); slot.m_hProc = hProc; slot.m_nProcId = nProcId; slot.m_nProc = s_nProcs; Print("\n", slot.m_nProc); LockRelease(); return &slot; } BOOL Procs::Close(HANDLE hProc) { BOOL first = false; LockAcquire(); ProcInfo& slot = HashToSlot(hProc); if (slot.m_hProc == hProc) { first = true; Print("\n", slot.m_nProc); slot.m_hProc = INVALID_HANDLE_VALUE; slot.m_nProcId = 0; slot.m_nProc = 0; s_nProcs--; } LockRelease(); return first; } ////////////////////////////////////////////////////////////////////////////// // struct FileInfo { DWORD m_nHash; DWORD m_nIndex; BOOL m_fCantRead; // Set for file that are opened Create BOOL m_fRead; BOOL m_fWrite; BOOL m_fDelete; BOOL m_fCleanup; BOOL m_fSystemPath; BOOL m_fTemporaryPath; BOOL m_fTemporaryFile; DWORD m_cbRead; DWORD m_cbWrite; BOOL m_fAppend; BOOL m_fAbsorbed; // Absorbed by TraceBld. BOOL m_fDirectory; PCWSTR m_pwzPath; PBYTE m_pbContent; DWORD m_cbContent; }; ////////////////////////////////////////////////////////////////////////////// // class FileNames { private: static CRITICAL_SECTION s_csLock; static DWORD s_nFiles; static DWORD s_nCapacity; static FileInfo ** s_pFiles; public: static WCHAR s_wzSysPath[MAX_PATH]; static WCHAR s_wzS64Path[MAX_PATH]; static WCHAR s_wzTmpPath[MAX_PATH]; static WCHAR s_wzExePath[MAX_PATH]; static DWORD s_wcSysPath; static DWORD s_wcS64Path; static DWORD s_wcTmpPath; static DWORD s_wcExePath; private: static DWORD Hash(PCWSTR pwzFile) { DWORD hash = 5381; while (*pwzFile != 0) { WCHAR c = *pwzFile++; if (c >= 'A' && c <= 'Z') { c += ('a' - 'A'); } hash = ((hash << 5) + hash) + c; } return hash; } static VOID LockAcquire() { EnterCriticalSection(&s_csLock); } static VOID LockRelease() { LeaveCriticalSection(&s_csLock); } static VOID Resize(DWORD nCapacity); static VOID Set(FileInfo *info); static VOID Replace(PWCHAR pwzBuffer, PWCHAR pwzDstEnd, DWORD cwOld, PCWSTR pwzNew); public: static BOOL Equal(PCWSTR pwzA, PCWSTR pwzB) { return (Compare(pwzA, pwzB) == 0); } static BOOL PrefixMatch(PCWSTR pwzFile, PCWSTR pwzPrefix) { for (;;) { WCHAR cFile = *pwzFile++; WCHAR cPrefix = *pwzPrefix++; if (cFile >= 'A' && cFile <= 'Z') { cFile += ('a' - 'A'); } if (cPrefix >= 'A' && cPrefix <= 'Z') { cPrefix += ('a' - 'A'); } if (cPrefix == 0) { return TRUE; } if (cFile != cPrefix) { return FALSE; } } } static BOOL SuffixMatch(PCWSTR pwzFile, PCWSTR pwzSuffix) { // Move both pointers to the end of the strings. PCWSTR pwzFileBeg = pwzFile; while (*pwzFile) { pwzFile++; } PCWSTR pwzSuffixBeg = pwzSuffix; while (*pwzSuffix) { pwzSuffix++; } // Now walk backwards comparing strings. for (;;) { WCHAR cFile = (pwzFile > pwzFileBeg) ? *--pwzFile : 0; WCHAR cSuffix = (pwzSuffix > pwzSuffixBeg) ? *--pwzSuffix : 0; if (cFile >= 'A' && cFile <= 'Z') { cFile += ('a' - 'A'); } if (cSuffix >= 'A' && cSuffix <= 'Z') { cSuffix += ('a' - 'A'); } if (cSuffix == 0) { return TRUE; } if (cFile != cSuffix) { return FALSE; } } } static VOID EndInSlash(PWCHAR pwzPath) { if (*pwzPath) { while (*pwzPath) { pwzPath++; } if (pwzPath[-1] != '\\') { *pwzPath++ = '\\'; *pwzPath = '\0'; } } } public: static VOID Initialize(); static VOID Dump(); static FileInfo * FindPartial(PCWSTR pwzPath); static FileInfo * FindPartial(PCSTR pszPath); static FileInfo * FindFull(PCWSTR pwzPath); static PCWSTR ParameterizeName(PWCHAR pwzDst, DWORD cMaxDst, PCWSTR pwzPath); static PCWSTR ParameterizeName(PWCHAR pwzDst, DWORD cMaxDst, FileInfo *pInfo); static VOID ParameterizeLine(PWCHAR pwzDst, PWCHAR pwzDstEnd); }; CRITICAL_SECTION FileNames::s_csLock; DWORD FileNames::s_nFiles = 0; DWORD FileNames::s_nCapacity = 0; FileInfo ** FileNames::s_pFiles; WCHAR FileNames::s_wzSysPath[MAX_PATH]; WCHAR FileNames::s_wzS64Path[MAX_PATH]; WCHAR FileNames::s_wzTmpPath[MAX_PATH]; WCHAR FileNames::s_wzExePath[MAX_PATH]; DWORD FileNames::s_wcSysPath; DWORD FileNames::s_wcS64Path; DWORD FileNames::s_wcTmpPath; DWORD FileNames::s_wcExePath; VOID FileNames::Initialize() { InitializeCriticalSection(&s_csLock); s_wzSysPath[0] = '\0'; GetSystemDirectoryW(s_wzSysPath, ARRAYSIZE(s_wzSysPath)); EndInSlash(s_wzSysPath); s_wzS64Path[0] = '\0'; GetWindowsDirectoryW(s_wzS64Path, ARRAYSIZE(s_wzS64Path)); EndInSlash(s_wzS64Path); Copy(s_wzS64Path + Size(s_wzS64Path), L"SysWOW64\\"); s_wzTmpPath[0] = '\0'; GetTempPathW(ARRAYSIZE(s_wzTmpPath), s_wzTmpPath); EndInSlash(s_wzTmpPath); s_wzExePath[0] = '\0'; GetModuleFileNameW(NULL, s_wzExePath, ARRAYSIZE(s_wzExePath)); PWCHAR pwzLast = s_wzExePath; for (PWCHAR pwz = s_wzExePath; *pwz; pwz++) { if (*pwz == '\\') { pwzLast = pwz; } } if (*pwzLast == '\\') { *++pwzLast = '\0'; } s_wcSysPath = Size(s_wzSysPath); s_wcS64Path = Size(s_wzS64Path); s_wcTmpPath = Size(s_wzTmpPath); s_wcExePath = Size(s_wzExePath); Resize(4049); } VOID FileNames::Resize(DWORD nCapacity) { if (nCapacity > s_nCapacity) { DWORD nOld = s_nCapacity; FileInfo ** pOld = s_pFiles; s_pFiles = (FileInfo **)GlobalAlloc(GPTR, nCapacity * sizeof(FileInfo *)); s_nCapacity = nCapacity; if (pOld != NULL) { for (DWORD n = 0; n < nOld; n++) { if (pOld[n] != NULL) { Set(pOld[n]); } } GlobalFree((HGLOBAL)pOld); pOld = NULL; } s_nCapacity = nCapacity; } } VOID FileNames::Set(FileInfo *info) { DWORD hash = info->m_nHash; DWORD slot = hash % s_nCapacity; DWORD death = 0; // Find an empty slot. for (; s_pFiles[slot] != NULL; slot = (slot + 1) % s_nCapacity) { if (++death > s_nCapacity) { // We should have dropped out at some point... DEBUG_BREAK(); } } s_pFiles[slot] = info; } FileInfo * FileNames::FindFull(PCWSTR pwzPath) { if (pwzPath == NULL) { return NULL; } LockAcquire(); DWORD hash = Hash(pwzPath); DWORD slot = hash % s_nCapacity; FileInfo *info = NULL; DWORD death = 0; // Find the the matching slot, or an empty one. for (; s_pFiles[slot] != NULL; slot = (slot + 1) % s_nCapacity) { if (Equal(s_pFiles[slot]->m_pwzPath, pwzPath)) { info = s_pFiles[slot]; goto succeed; } if (++death > s_nCapacity) { // We should have dropped out at some point... DEBUG_BREAK(); } } // Add the file to list of known files. info = (FileInfo *)GlobalAlloc(GPTR, sizeof(FileInfo)); info->m_nHash = hash; info->m_nIndex = s_nFiles++; info->m_pwzPath = Save(pwzPath); info->m_fSystemPath = (PrefixMatch(info->m_pwzPath, s_wzSysPath) || PrefixMatch(info->m_pwzPath, s_wzS64Path)); info->m_fTemporaryPath = PrefixMatch(info->m_pwzPath, s_wzTmpPath); info->m_fTemporaryFile = SuffixMatch(info->m_pwzPath, L".tmp"); s_pFiles[slot] = info; // Check if we should grow the table. if (s_nFiles > (s_nCapacity / 2)) { Resize(s_nCapacity * 2 - 1); } succeed: LockRelease(); return info; } FileInfo * FileNames::FindPartial(PCWSTR pwzPath) { WCHAR wzPath[MAX_PATH]; PWCHAR pwzFile = NULL; if (!GetFullPathNameW(pwzPath, ARRAYSIZE(wzPath), wzPath, &pwzFile)) { return FindFull(pwzPath); } else { return FindFull(wzPath); } } FileInfo * FileNames::FindPartial(PCSTR pwzPath) { WCHAR wzPath[MAX_PATH]; PWCHAR pwzFile = wzPath; while (*pwzPath) { *pwzFile++ = *pwzPath++; } *pwzFile = '\0'; return FindPartial(wzPath); } PCWSTR FileNames::ParameterizeName(PWCHAR pwzDst, DWORD cMaxDst, FileInfo *pInfo) { return ParameterizeName(pwzDst, cMaxDst, pInfo->m_pwzPath); } PCWSTR FileNames::ParameterizeName(PWCHAR pwzDst, DWORD cMaxDst, PCWSTR pwzPath) { if (PrefixMatch(pwzPath, s_wzSysPath)) { Copy(pwzDst, L"%SYSDIR%\\"); Copy(pwzDst + Size(pwzDst), pwzPath + s_wcSysPath); goto finish; } else if (PrefixMatch(pwzPath, s_wzS64Path)) { Copy(pwzDst, L"%SYSDIR%\\"); Copy(pwzDst + Size(pwzDst), pwzPath + s_wcS64Path); goto finish; } else if (PrefixMatch(pwzPath, s_wzTmpPath)) { Copy(pwzDst, L"%TMPDIR%\\"); Copy(pwzDst + Size(pwzDst), pwzPath + s_wcTmpPath); goto finish; } else { Copy(pwzDst, pwzPath); finish: #if 0 // to convert to all lower case. for (PWCHAR pwz = pwzDst; *pwz && pwz < pwzDst + cMaxDst; pwz++) { if (*pwz >= 'A' && *pwz <= 'Z') { *pwz = 'a' + (*pwz - 'A'); } } #else (void)cMaxDst; #endif return pwzDst; } } VOID FileNames::Replace(PWCHAR pwzDst, PWCHAR pwzDstEnd, DWORD cwOld, PCWSTR pwzNew) { DWORD cwNew = Size(pwzNew); DWORD cwDst = Size(pwzDst); if (cwOld < cwNew) { // We have to insert. if ((cwDst + cwNew - cwOld) >= (DWORD)(pwzDstEnd - pwzDst)) { // Won't fit, so abort. return; } PWCHAR pwzTo = pwzDst + cwDst + (cwNew - cwOld); PWCHAR pwzFm = pwzDst + cwDst; while (pwzTo >= pwzDst) { *pwzTo-- = *pwzFm--; } } else if (cwOld > cwNew) { // We have to remove. PWCHAR pwzTo = pwzDst + cwNew; PWCHAR pwzFm = pwzDst + cwOld; while (*pwzFm) { *pwzTo++ = *pwzFm++; } *pwzTo = '\0'; } // Now write the new string. while (*pwzNew) { *pwzDst++ = *pwzNew++; } } VOID FileNames::ParameterizeLine(PWCHAR pwzDst, PWCHAR pwzDstEnd) { for (; *pwzDst != '\0'; pwzDst++) { if (PrefixMatch(pwzDst, s_wzSysPath)) { Replace(pwzDst, pwzDstEnd, s_wcSysPath, L"%SYSDIR%\\"); } else if (PrefixMatch(pwzDst, s_wzS64Path)) { Replace(pwzDst, pwzDstEnd, s_wcS64Path, L"%SYSDIR%\\"); } else if (PrefixMatch(pwzDst, s_wzTmpPath)) { Replace(pwzDst, pwzDstEnd, s_wcTmpPath, L"%TMPDIR%\\"); } } } VOID FileNames::Dump() { WCHAR wzPath[MAX_PATH]; if (s_nFiles == 0) { return; } LockAcquire(); Tblog("\n"); FileInfo ** pSorted = (FileInfo **)GlobalAlloc(GPTR, s_nFiles * sizeof(FileInfo *)); for (DWORD n = 0; n < s_nCapacity; n++) { if (s_pFiles[n] != NULL) { if (s_pFiles[n]->m_nIndex > s_nFiles) { DEBUG_BREAK(); } pSorted[s_pFiles[n]->m_nIndex] = s_pFiles[n]; } } for (DWORD n = 0; n < s_nFiles; n++) { FileInfo *pInfo = pSorted[n]; if (pInfo == NULL) { Print("\n", n, s_nFiles); continue; } BOOL fRead = pInfo->m_fRead; BOOL fWrite = pInfo->m_fWrite; BOOL fDelete = (pInfo->m_fDelete); BOOL fCleanup = (pInfo->m_fCleanup); BOOL fAppend = (pInfo->m_fAppend); #if 0 if (fDelete && !fRead && !fWrite) { Print("\n", pInfo->m_pwzPath); // Discard pipe files only passed to children. continue; } #endif if (pInfo->m_fAbsorbed) { // Discard response fles continue; } if (PrefixMatch(pInfo->m_pwzPath, s_wzExePath) || PrefixMatch(pInfo->m_pwzPath, s_wzSysPath) || PrefixMatch(pInfo->m_pwzPath, s_wzS64Path)) { // Discard files from exec directory (because considered internal to code). continue; } #if 1 // Ignore PIPEs. if (FileNames::PrefixMatch(pInfo->m_pwzPath, L"\\\\.\\PIPE\\")) { continue; } #endif if (FileNames::SuffixMatch(pInfo->m_pwzPath, L"\\conout$")) { continue; } if (FileNames::SuffixMatch(pInfo->m_pwzPath, L"\\conin$")) { continue; } if (FileNames::SuffixMatch(pInfo->m_pwzPath, L"\\nul")) { continue; } ParameterizeName(wzPath, ARRAYSIZE(wzPath), pInfo); if (pInfo->m_fDirectory) { Print("%ls\n", wzPath); continue; } if (!fRead && !fWrite && !fDelete && !fCleanup) { // Discard do "none" files. continue; } if (pInfo->m_pbContent == NULL || pInfo->m_fDelete || pInfo->m_fCleanup || pInfo->m_fWrite) { Print("%ls\n", fRead ? " read=\"true\"" : "", fWrite ? " write=\"true\"" : "", fDelete ? " delete=\"true\"" : "", fCleanup ? " cleanup=\"true\"" : "", fAppend ? " append=\"true\"" : "", // size=\"%d\" pInfo->m_cbContent, wzPath); } else if ((pInfo->m_pbContent)[0] == 0xff && (pInfo->m_pbContent)[1] == 0xfe) { // Unicode Print("%ls%le\n", fRead ? " read=\"true\"" : "", fWrite ? " write=\"true\"" : "", fDelete ? " delete=\"true\"" : "", fCleanup ? " cleanup=\"true\"" : "", fAppend ? " append=\"true\"" : "", // size=\"%d\" pInfo->m_cbContent, wzPath, RemoveReturns((PWCHAR)pInfo->m_pbContent)); } else { // Ascii Print("%ls%he\n", fRead ? " read=\"true\"" : "", fWrite ? " write=\"true\"" : "", fDelete ? " delete=\"true\"" : "", fCleanup ? " cleanup=\"true\"" : "", fAppend ? " append=\"true\"" : "", // size=\"%d\" pInfo->m_cbContent, wzPath, RemoveReturns((PCHAR)pInfo->m_pbContent)); } if (pInfo->m_pbContent != NULL) { GlobalFree((HGLOBAL)pInfo->m_pbContent); pInfo->m_pbContent = NULL; } } GlobalFree((HGLOBAL)pSorted); Tblog("\n"); LockRelease(); } ////////////////////////////////////////////////////////////////////////////// // class OpenFiles { private: struct SLOT { HANDLE m_hHandle; FileInfo * m_pFile; ProcInfo * m_pProc; }; private: static CRITICAL_SECTION s_csLock; static DWORD s_nHandles; static SLOT s_rHandles[4049]; private: static SLOT& HashToSlot(HANDLE handle) { return s_rHandles[((DWORD_PTR)handle) % ARRAYSIZE(s_rHandles)]; } static VOID LockAcquire() { EnterCriticalSection(&s_csLock); } static VOID LockRelease() { LeaveCriticalSection(&s_csLock); } public: static VOID Initialize(); static VOID SetWrite(HANDLE hFile, DWORD cbData) { SLOT& slot = HashToSlot(hFile); if (slot.m_hHandle == hFile) { slot.m_pFile->m_fWrite = TRUE; slot.m_pFile->m_cbWrite += cbData; } } static VOID SetRead(HANDLE hFile, DWORD cbData) { SLOT& slot = HashToSlot(hFile); if (slot.m_hHandle == hFile) { slot.m_pFile->m_fRead = TRUE; slot.m_pFile->m_cbRead += cbData; } } static BOOL Forget(HANDLE handle); static BOOL Remember(HANDLE hFile, FileInfo *pInfo); static BOOL Remember(HANDLE hProc, ProcInfo *pInfo); static FileInfo * RecallFile(HANDLE hFile); static ProcInfo * RecallProc(HANDLE hProc); }; CRITICAL_SECTION OpenFiles::s_csLock; // Guards access to OpenFile stuctures. DWORD OpenFiles::s_nHandles = 0; OpenFiles::SLOT OpenFiles::s_rHandles[4049]; VOID OpenFiles::Initialize() { InitializeCriticalSection(&s_csLock); for (DWORD n = 0; n < ARRAYSIZE(s_rHandles); n++) { s_rHandles[n].m_hHandle = INVALID_HANDLE_VALUE; s_rHandles[n].m_pFile = NULL; s_rHandles[n].m_pProc = NULL; } } BOOL OpenFiles::Forget(HANDLE handle) { LockAcquire(); OpenFiles::SLOT& slot = HashToSlot(handle); if (slot.m_hHandle == handle ) { slot.m_hHandle = INVALID_HANDLE_VALUE; slot.m_pFile = NULL; slot.m_pProc = NULL; s_nHandles--; } LockRelease(); return FALSE; } BOOL OpenFiles::Remember(HANDLE hFile, FileInfo *pFile) { LockAcquire(); OpenFiles::SLOT& slot = HashToSlot(hFile); if (slot.m_hHandle != hFile && slot.m_hHandle != INVALID_HANDLE_VALUE) { // hash collision DEBUG_BREAK(); } slot.m_hHandle = hFile; slot.m_pFile = pFile; slot.m_pProc = NULL; s_nHandles++; LockRelease(); return TRUE; } BOOL OpenFiles::Remember(HANDLE hProc, ProcInfo *pProc) { LockAcquire(); OpenFiles::SLOT& slot = HashToSlot(hProc); if (slot.m_hHandle != hProc && slot.m_hHandle != INVALID_HANDLE_VALUE) { // hash collision DEBUG_BREAK(); } slot.m_hHandle = hProc; slot.m_pProc = pProc; slot.m_pFile = NULL; s_nHandles++; LockRelease(); return TRUE; } FileInfo * OpenFiles::RecallFile(HANDLE hFile) { LockAcquire(); OpenFiles::SLOT& slot = HashToSlot(hFile); if (slot.m_hHandle == hFile) { LockRelease(); return slot.m_pFile; } LockRelease(); return NULL; } ProcInfo * OpenFiles::RecallProc(HANDLE hProc) { LockAcquire(); OpenFiles::SLOT& slot = HashToSlot(hProc); if (slot.m_hHandle == hProc) { LockRelease(); return slot.m_pProc; } LockRelease(); return NULL; } ///////////////////////////////////////////////////////////////////// VPrintf. // // Completely side-effect free printf replacement (but no FP numbers). // static PCHAR do_base(PCHAR pszOut, UINT64 nValue, UINT nBase, PCSTR pszDigits) { CHAR szTmp[96]; int nDigit = sizeof(szTmp)-2; for (; nDigit >= 0; nDigit--) { szTmp[nDigit] = pszDigits[nValue % nBase]; nValue /= nBase; } for (nDigit = 0; nDigit < sizeof(szTmp) - 2 && szTmp[nDigit] == '0'; nDigit++) { // skip leading zeros. } for (; nDigit < sizeof(szTmp) - 1; nDigit++) { *pszOut++ = szTmp[nDigit]; } *pszOut = '\0'; return pszOut; } static PCHAR do_str(PCHAR pszOut, PCHAR pszEnd, PCSTR pszIn) { while (*pszIn && pszOut < pszEnd) { *pszOut++ = *pszIn++; } *pszOut = '\0'; return pszOut; } static PCHAR do_wstr(PCHAR pszOut, PCHAR pszEnd, PCWSTR pszIn) { while (*pszIn && pszOut < pszEnd) { *pszOut++ = (CHAR)*pszIn++; } *pszOut = '\0'; return pszOut; } static PCHAR do_estr(PCHAR pszOut, PCHAR pszEnd, PCSTR pszIn) { while (*pszIn && pszOut < pszEnd) { if (*pszIn == '<') { if (pszOut + 4 > pszEnd) { break; } pszIn++; *pszOut++ = '&'; *pszOut++ = 'l'; *pszOut++ = 't'; *pszOut++ = ';'; } else if (*pszIn == '>') { if (pszOut + 4 > pszEnd) { break; } pszIn++; *pszOut++ = '&'; *pszOut++ = 'g'; *pszOut++ = 't'; *pszOut++ = ';'; } else if (*pszIn == '&') { if (pszOut + 5 > pszEnd) { break; } pszIn++; *pszOut++ = '&'; *pszOut++ = 'a'; *pszOut++ = 'm'; *pszOut++ = 'p'; *pszOut++ = ';'; } else if (*pszIn == '\"') { if (pszOut + 6 > pszEnd) { break; } pszIn++; *pszOut++ = '&'; *pszOut++ = 'q'; *pszOut++ = 'u'; *pszOut++ = 'o'; *pszOut++ = 't'; *pszOut++ = ';'; } else if (*pszIn == '\'') { if (pszOut + 6 > pszEnd) { break; } pszIn++; *pszOut++ = '&'; *pszOut++ = 'a'; *pszOut++ = 'p'; *pszOut++ = 'o'; *pszOut++ = 's'; *pszOut++ = ';'; } else if (*pszIn < ' ') { BYTE c = (BYTE)(*pszIn++); if (c < 10 && pszOut + 4 <= pszEnd) { *pszOut++ = '&'; *pszOut++ = '#'; *pszOut++ = '0' + (c % 10); *pszOut++ = ';'; } else if (c < 100 && pszOut + 5 <= pszEnd) { *pszOut++ = '&'; *pszOut++ = '#'; *pszOut++ = '0' + ((c / 10) % 10); *pszOut++ = '0' + (c % 10); *pszOut++ = ';'; } else if (c < 1000 && pszOut + 6 <= pszEnd) { *pszOut++ = '&'; *pszOut++ = '#'; *pszOut++ = '0' + ((c / 100) % 10); *pszOut++ = '0' + ((c / 10) % 10); *pszOut++ = '0' + (c % 10); *pszOut++ = ';'; } else { break; } } else { *pszOut++ = *pszIn++; } } *pszOut = '\0'; return pszOut; } static PCHAR do_ewstr(PCHAR pszOut, PCHAR pszEnd, PCWSTR pszIn) { while (*pszIn && pszOut < pszEnd) { if (*pszIn == '<') { if (pszOut + 4 > pszEnd) { break; } pszIn++; *pszOut++ = '&'; *pszOut++ = 'l'; *pszOut++ = 't'; *pszOut++ = ';'; } else if (*pszIn == '>') { if (pszOut + 4 > pszEnd) { break; } pszIn++; *pszOut++ = '&'; *pszOut++ = 'g'; *pszOut++ = 't'; *pszOut++ = ';'; } else if (*pszIn == '&') { if (pszOut + 5 > pszEnd) { break; } pszIn++; *pszOut++ = '&'; *pszOut++ = 'a'; *pszOut++ = 'm'; *pszOut++ = 'p'; *pszOut++ = ';'; } else if (*pszIn == '\"') { if (pszOut + 6 > pszEnd) { break; } pszIn++; *pszOut++ = '&'; *pszOut++ = 'q'; *pszOut++ = 'u'; *pszOut++ = 'o'; *pszOut++ = 't'; *pszOut++ = ';'; } else if (*pszIn == '\'') { if (pszOut + 6 > pszEnd) { break; } pszIn++; *pszOut++ = '&'; *pszOut++ = 'a'; *pszOut++ = 'p'; *pszOut++ = 'o'; *pszOut++ = 's'; *pszOut++ = ';'; } else if (*pszIn < ' ' || *pszIn > 127) { WCHAR c = *pszIn++; if (c < 10 && pszOut + 4 <= pszEnd) { *pszOut++ = '&'; *pszOut++ = '#'; *pszOut++ = '0' + (CHAR)(c % 10); *pszOut++ = ';'; } else if (c < 100 && pszOut + 5 <= pszEnd) { *pszOut++ = '&'; *pszOut++ = '#'; *pszOut++ = '0' + (CHAR)((c / 10) % 10); *pszOut++ = '0' + (CHAR)(c % 10); *pszOut++ = ';'; } else if (c < 1000 && pszOut + 6 <= pszEnd) { *pszOut++ = '&'; *pszOut++ = '#'; *pszOut++ = '0' + (CHAR)((c / 100) % 10); *pszOut++ = '0' + (CHAR)((c / 10) % 10); *pszOut++ = '0' + (CHAR)(c % 10); *pszOut++ = ';'; } else { break; } } else { *pszOut++ = (CHAR)*pszIn++; } } *pszOut = '\0'; return pszOut; } #if _MSC_VER >= 1900 #pragma warning(push) #pragma warning(disable:4456) // declaration hides previous local declaration #endif VOID VSafePrintf(PCSTR pszMsg, va_list args, PCHAR pszBuffer, LONG cbBuffer) { PCHAR pszOut = pszBuffer; PCHAR pszEnd = pszBuffer + cbBuffer - 1; pszBuffer[0] = '\0'; __try { while (*pszMsg && pszOut < pszEnd) { if (*pszMsg == '%') { CHAR szHead[4] = ""; INT nLen; INT nWidth = 0; INT nPrecision = 0; BOOL fLeft = FALSE; BOOL fPositive = FALSE; BOOL fPound = FALSE; BOOL fBlank = FALSE; BOOL fZero = FALSE; BOOL fDigit = FALSE; BOOL fSmall = FALSE; BOOL fLarge = FALSE; BOOL f64Bit = FALSE; PCSTR pszArg = pszMsg; pszMsg++; for (; (*pszMsg == '-' || *pszMsg == '+' || *pszMsg == '#' || *pszMsg == ' ' || *pszMsg == '0'); pszMsg++) { switch (*pszMsg) { case '-': fLeft = TRUE; break; case '+': fPositive = TRUE; break; case '#': fPound = TRUE; break; case ' ': fBlank = TRUE; break; case '0': fZero = TRUE; break; } } if (*pszMsg == '*') { nWidth = va_arg(args, INT); pszMsg++; } else { while (*pszMsg >= '0' && *pszMsg <= '9') { nWidth = nWidth * 10 + (*pszMsg++ - '0'); } } if (*pszMsg == '.') { pszMsg++; fDigit = TRUE; if (*pszMsg == '*') { nPrecision = va_arg(args, INT); pszMsg++; } else { while (*pszMsg >= '0' && *pszMsg <= '9') { nPrecision = nPrecision * 10 + (*pszMsg++ - '0'); } } } if (*pszMsg == 'h') { fSmall = TRUE; pszMsg++; } else if (*pszMsg == 'l') { fLarge = TRUE; pszMsg++; } else if (*pszMsg == 'I' && pszMsg[1] == '6' && pszMsg[2] == '4') { f64Bit = TRUE; pszMsg += 3; } if (*pszMsg == 's' || *pszMsg == 'e' || *pszMsg == 'c') { // We ignore the length, precision, and alignment // to avoid using a temporary buffer. if (*pszMsg == 's') { // [GalenH] need to not use temp. PVOID pvData = va_arg(args, PVOID); pszMsg++; if (fSmall) { fLarge = FALSE; } __try { if (pvData == NULL) { pszOut = do_str(pszOut, pszEnd, "-NULL-"); } else if (fLarge) { pszOut = do_wstr(pszOut, pszEnd, (PWCHAR)pvData); } else { pszOut = do_str(pszOut, pszEnd, (PCHAR)pvData); } } __except(EXCEPTION_EXECUTE_HANDLER) { pszOut = do_str(pszOut, pszEnd, "-"); pszOut = do_base(pszOut, (UINT64)pvData, 16, "0123456789ABCDEF"); pszOut = do_str(pszOut, pszEnd, "-"); } } else if (*pszMsg == 'e') { // Escape the string. PVOID pvData = va_arg(args, PVOID); pszMsg++; if (fSmall) { fLarge = FALSE; } __try { if (pvData == NULL) { pszOut = do_str(pszOut, pszEnd, "-NULL-"); } else if (fLarge) { pszOut = do_ewstr(pszOut, pszEnd, (PWCHAR)pvData); } else { pszOut = do_estr(pszOut, pszEnd, (PCHAR)pvData); } } __except(EXCEPTION_EXECUTE_HANDLER) { pszOut = do_str(pszOut, pszEnd, "-"); pszOut = do_base(pszOut, (UINT64)pvData, 16, "0123456789ABCDEF"); pszOut = do_str(pszOut, pszEnd, "-"); } } else { CHAR szTemp[2]; pszMsg++; szTemp[0] = (CHAR)va_arg(args, INT); szTemp[1] = '\0'; pszOut = do_str(pszOut, pszEnd, szTemp); } } else if (*pszMsg == 'd' || *pszMsg == 'i' || *pszMsg == 'o' || *pszMsg == 'x' || *pszMsg == 'X' || *pszMsg == 'b' || *pszMsg == 'u') { CHAR szTemp[128]; UINT64 value; if (f64Bit) { value = va_arg(args, UINT64); } else { value = va_arg(args, UINT); } if (*pszMsg == 'x') { pszMsg++; nLen = (int)(do_base(szTemp, value, 16, "0123456789abcdef") - szTemp); if (fPound && value) { do_str(szHead, szHead + sizeof(szHead) - 1, "0x"); } } else if (*pszMsg == 'X') { pszMsg++; nLen = (int)(do_base(szTemp, value, 16, "0123456789ABCDEF") - szTemp); if (fPound && value) { do_str(szHead, szHead + sizeof(szHead) - 1, "0X"); } } else if (*pszMsg == 'd') { pszMsg++; if ((INT64)value < 0) { value = -(INT64)value; do_str(szHead, szHead + sizeof(szHead) - 1, "-"); } else if (fPositive) { if (value > 0) { do_str(szHead, szHead + sizeof(szHead) - 1, "+"); } } else if (fBlank) { if (value > 0) { do_str(szHead, szHead + sizeof(szHead) - 1, " "); } } nLen = (int)(do_base(szTemp, value, 10, "0123456789") - szTemp); nPrecision = 0; } else if (*pszMsg == 'u') { pszMsg++; nLen = (int)(do_base(szTemp, value, 10, "0123456789") - szTemp); nPrecision = 0; } else if (*pszMsg == 'o') { pszMsg++; nLen = (int)(do_base(szTemp, value, 8, "01234567") - szTemp); nPrecision = 0; if (fPound && value) { do_str(szHead, szHead + sizeof(szHead) - 1, "0"); } } else if (*pszMsg == 'b') { pszMsg++; nLen = (int)(do_base(szTemp, value, 2, "01") - szTemp); nPrecision = 0; if (fPound && value) { do_str(szHead, szHead + sizeof(szHead) - 1, "0b"); } } else { pszMsg++; if ((INT64)value < 0) { value = -(INT64)value; do_str(szHead, szHead + sizeof(szHead) - 1, "-"); } else if (fPositive) { if (value > 0) { do_str(szHead, szHead + sizeof(szHead) - 1, "+"); } } else if (fBlank) { if (value > 0) { do_str(szHead, szHead + sizeof(szHead) - 1, " "); } } nLen = (int)(do_base(szTemp, value, 10, "0123456789") - szTemp); nPrecision = 0; } INT nHead = 0; for (; szHead[nHead]; nHead++) { // Count characters in head string. } if (fLeft) { if (nHead) { pszOut = do_str(pszOut, pszEnd, szHead); nLen += nHead; } pszOut = do_str(pszOut, pszEnd, szTemp); for (; nLen < nWidth && pszOut < pszEnd; nLen++) { *pszOut++ = ' '; } } else if (fZero) { if (nHead) { pszOut = do_str(pszOut, pszEnd, szHead); nLen += nHead; } for (; nLen < nWidth && pszOut < pszEnd; nLen++) { *pszOut++ = '0'; } pszOut = do_str(pszOut, pszEnd, szTemp); } else { if (nHead) { nLen += nHead; } for (; nLen < nWidth && pszOut < pszEnd; nLen++) { *pszOut++ = ' '; } if (nHead) { pszOut = do_str(pszOut, pszEnd, szHead); } pszOut = do_str(pszOut, pszEnd, szTemp); } } else if (*pszMsg == 'p') { CHAR szTemp[64]; ULONG_PTR value; value = va_arg(args, ULONG_PTR); if (*pszMsg == 'p') { pszMsg++; nLen = (int)(do_base(szTemp, (UINT64)value, 16, "0123456789abcdef") - szTemp); if (fPound && value) { do_str(szHead, szHead + sizeof(szHead) - 1, "0x"); } } else { pszMsg++; nLen = (int)(do_base(szTemp, (UINT64)value, 16, "0123456789ABCDEF") - szTemp); if (fPound && value) { do_str(szHead, szHead + sizeof(szHead) - 1, "0x"); } } INT nHead = 0; for (; szHead[nHead]; nHead++) { // Count characters in head string. } if (nHead) { pszOut = do_str(pszOut, pszEnd, szHead); nLen += nHead; } for (; nLen < nWidth && pszOut < pszEnd; nLen++) { *pszOut++ = '0'; } pszOut = do_str(pszOut, pszEnd, szTemp); } else { pszMsg++; while (pszArg < pszMsg && pszOut < pszEnd) { *pszOut++ = *pszArg++; } } } else { if (pszOut < pszEnd) { *pszOut++ = *pszMsg++; } } } *pszOut = '\0'; pszBuffer[cbBuffer - 1] = '\0'; } __except(EXCEPTION_EXECUTE_HANDLER) { PCHAR pszOut = pszBuffer; *pszOut = '\0'; pszOut = do_str(pszOut, pszEnd, "-exception:"); pszOut = do_base(pszOut, (UINT64)GetExceptionCode(), 10, "0123456789"); pszOut = do_str(pszOut, pszEnd, "-"); } } #if _MSC_VER >= 1900 #pragma warning(pop) #endif PCHAR SafePrintf(PCHAR pszBuffer, LONG cbBuffer, PCSTR pszMsg, ...) { va_list args; va_start(args, pszMsg); VSafePrintf(pszMsg, args, pszBuffer, cbBuffer); va_end(args); while (*pszBuffer) { pszBuffer++; } return pszBuffer; } ////////////////////////////////////////////////////////////////////////////// // BOOL TblogOpen() { EnterCriticalSection(&s_csPipe); WCHAR wzPipe[256]; StringCchPrintfW(wzPipe, ARRAYSIZE(wzPipe), L"%ls.%d", TBLOG_PIPE_NAMEW, s_nTraceProcessId); for (int retries = 0; retries < 10; retries++) { WaitNamedPipeW(wzPipe, 10000); // Wait up to 10 seconds for a pipe to appear. s_hPipe = Real_CreateFileW(wzPipe, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); if (s_hPipe != INVALID_HANDLE_VALUE) { DWORD dwMode = PIPE_READMODE_MESSAGE; if (SetNamedPipeHandleState(s_hPipe, &dwMode, NULL, NULL)) { LeaveCriticalSection(&s_csPipe); return TRUE; } } } LeaveCriticalSection(&s_csPipe); // Couldn't open pipe. DEBUG_BREAK(); Real_ExitProcess(9990); return FALSE; } VOID TblogV(PCSTR pszMsgf, va_list args) { if (s_hPipe == INVALID_HANDLE_VALUE) { return; } EnterCriticalSection(&s_csPipe); DWORD cbWritten = 0; PCHAR pszBuf = s_rMessage.szMessage; VSafePrintf(pszMsgf, args, pszBuf, (int)(s_rMessage.szMessage + sizeof(s_rMessage.szMessage) - pszBuf)); PCHAR pszEnd = s_rMessage.szMessage; for (; *pszEnd; pszEnd++) { // no internal contents. } s_rMessage.nBytes = (DWORD)(pszEnd - ((PCSTR)&s_rMessage)); // If the write fails, then we abort if (s_hPipe != INVALID_HANDLE_VALUE) { if (!Real_WriteFile(s_hPipe, &s_rMessage, s_rMessage.nBytes, &cbWritten, NULL)) { Real_ExitProcess(9991); } } LeaveCriticalSection(&s_csPipe); } VOID Tblog(PCSTR pszMsgf, ...) { if (s_hPipe == INVALID_HANDLE_VALUE) { return; } va_list args; va_start(args, pszMsgf); TblogV(pszMsgf, args); va_end(args); } VOID TblogClose() { EnterCriticalSection(&s_csPipe); if (s_hPipe != INVALID_HANDLE_VALUE) { DWORD cbWritten = 0; s_rMessage.nBytes = 0; Real_WriteFile(s_hPipe, &s_rMessage, 4, &cbWritten, NULL); FlushFileBuffers(s_hPipe); Real_CloseHandle(s_hPipe); s_hPipe = INVALID_HANDLE_VALUE; } LeaveCriticalSection(&s_csPipe); } ///////////////////////////////////////////////////////////// // Detours // static BOOL IsInherited(HANDLE hHandle) { DWORD dwFlags; if (GetHandleInformation(hHandle, &dwFlags)) { return (dwFlags & HANDLE_FLAG_INHERIT) ? TRUE : FALSE; } return FALSE; } static void SaveStdHandleName(HANDLE hFile, PWCHAR pwzBuffer, BOOL *fAppend) { pwzBuffer[0] = '\0'; if ((hFile != INVALID_HANDLE_VALUE) && IsInherited(hFile)) { FileInfo * pInfo = OpenFiles::RecallFile(hFile); if (pInfo) { Copy(pwzBuffer, pInfo->m_pwzPath); if (pInfo->m_fAppend && fAppend != NULL) { *fAppend = TRUE; } } } } static void LoadStdHandleName(DWORD id, PCWSTR pwzBuffer, BOOL fAppend) { HANDLE hFile = GetStdHandle(id); if ((hFile != INVALID_HANDLE_VALUE) && pwzBuffer[0] != '\0') { FileInfo *pInfo = FileNames::FindPartial(pwzBuffer); if (fAppend) { pInfo->m_fAppend = TRUE; } OpenFiles::Remember(hFile, pInfo); } } BOOL CreateProcessInternals(HANDLE hProcess, DWORD nProcessId, PCHAR pszId, HANDLE hStdin, HANDLE hStdout, HANDLE hStderr) { EnterCriticalSection(&s_csChildPayload); ProcInfo *proc = Procs::Create(hProcess, nProcessId); OpenFiles::Remember(hProcess, proc); ZeroMemory(&s_ChildPayload, sizeof(s_ChildPayload)); CopyMemory(&s_ChildPayload, &s_Payload, sizeof(s_ChildPayload)); s_ChildPayload.nParentProcessId = GetCurrentProcessId(); s_ChildPayload.rGeneology[s_ChildPayload.nGeneology] = (DWORD)InterlockedIncrement(&s_nChildCnt); s_ChildPayload.nGeneology++; SaveStdHandleName(hStdin, s_ChildPayload.wzStdin, NULL); SaveStdHandleName(hStdout, s_ChildPayload.wzStdout, &s_ChildPayload.fStdoutAppend); SaveStdHandleName(hStderr, s_ChildPayload.wzStderr, &s_ChildPayload.fStderrAppend); DetourCopyPayloadToProcess(hProcess, s_guidTrace, &s_ChildPayload, sizeof(s_ChildPayload)); for (DWORD i = 0; i < s_ChildPayload.nGeneology; i++) { pszId = SafePrintf(pszId, 16, "%d.", s_ChildPayload.rGeneology[i]); } *pszId = '\0'; LeaveCriticalSection(&s_csChildPayload); return TRUE; } BOOL WINAPI Mine_CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) { EnterFunc(); if (lpCommandLine == NULL) { lpCommandLine = (LPWSTR)lpApplicationName; } CHAR szProc[MAX_PATH]; BOOL rv = 0; __try { LPPROCESS_INFORMATION ppi = lpProcessInformation; PROCESS_INFORMATION pi; if (ppi == NULL) { ppi = π } rv = DetourCreateProcessWithDllExW(lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags | CREATE_SUSPENDED, lpEnvironment, lpCurrentDirectory, lpStartupInfo, ppi, s_szDllPath, Real_CreateProcessW); if (rv) { HANDLE hStdin = GetStdHandle(STD_INPUT_HANDLE); HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE); HANDLE hStderr = GetStdHandle(STD_ERROR_HANDLE); if (lpStartupInfo != NULL && (lpStartupInfo->dwFlags & STARTF_USESTDHANDLES) != 0) { hStdin = lpStartupInfo->hStdInput; hStdout = lpStartupInfo->hStdOutput; hStderr = lpStartupInfo->hStdError; } CreateProcessInternals(ppi->hProcess, ppi->dwProcessId, szProc, hStdin, hStdout, hStderr); Print("\n", szProc); WCHAR wzPath[MAX_PATH]; FileInfo *pInfo = NULL; if (lpApplicationName == NULL) { PWCHAR pwzDst = wzPath; PWCHAR pwzSrc = lpCommandLine; if (*pwzSrc == '\"') { WCHAR cQuote = *pwzSrc++; while (*pwzSrc && *pwzSrc != cQuote) { *pwzDst++ = *pwzSrc++; } *pwzDst++ = '\0'; } else { while (*pwzSrc && *pwzSrc != ' ' && *pwzSrc != '\t') { if (*pwzSrc == '\t') { *pwzSrc = ' '; } *pwzDst++ = *pwzSrc++; } *pwzDst++ = '\0'; } pInfo = FileNames::FindPartial(wzPath); } else { pInfo = FileNames::FindPartial(lpApplicationName); } Print("%ls\n", FileNames::ParameterizeName(wzPath, ARRAYSIZE(wzPath), pInfo)); Print("%le\n", lpCommandLine); Print("\n"); if (pInfo) { pInfo->m_fAbsorbed = true; } if (!(dwCreationFlags & CREATE_SUSPENDED)) { ResumeThread(ppi->hThread); } if (ppi == &pi) { Real_CloseHandle(ppi->hThread); Real_CloseHandle(ppi->hProcess); } } } __finally { ExitFunc(); if (!rv) { Print("\n", GetLastError(), lpApplicationName, lpCommandLine); } } return rv; } BOOL WINAPI Mine_CreateProcessA(LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) { EnterFunc(); if (lpCommandLine == NULL) { lpCommandLine = (LPSTR)lpApplicationName; } CHAR szProc[MAX_PATH]; BOOL rv = 0; __try { LPPROCESS_INFORMATION ppi = lpProcessInformation; PROCESS_INFORMATION pi; if (ppi == NULL) { ppi = π } rv = DetourCreateProcessWithDllExA(lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags | CREATE_SUSPENDED, lpEnvironment, lpCurrentDirectory, lpStartupInfo, ppi, s_szDllPath, Real_CreateProcessA); if (rv) { HANDLE hStdin = GetStdHandle(STD_INPUT_HANDLE); HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE); HANDLE hStderr = GetStdHandle(STD_ERROR_HANDLE); if (lpStartupInfo != NULL && (lpStartupInfo->dwFlags & STARTF_USESTDHANDLES) != 0) { hStdin = lpStartupInfo->hStdInput; hStdout = lpStartupInfo->hStdOutput; hStderr = lpStartupInfo->hStdError; } CreateProcessInternals(ppi->hProcess, ppi->dwProcessId, szProc, hStdin, hStdout, hStderr); Print("\n", szProc); WCHAR wzPath[MAX_PATH]; FileInfo *pInfo = NULL; if (lpApplicationName == NULL) { PCHAR pszDst = szProc; PCHAR pszSrc = lpCommandLine; if (*pszSrc == '\"') { CHAR cQuote = *pszSrc++; while (*pszSrc && *pszSrc != cQuote) { *pszDst++ = *pszSrc++; } *pszDst++ = '\0'; } else { while (*pszSrc && *pszSrc != ' ' && *pszSrc != '\t') { if (*pszSrc == '\t') { *pszSrc = ' '; } *pszDst++ = *pszSrc++; } *pszDst++ = '\0'; } pInfo = FileNames::FindPartial(szProc); } else { pInfo = FileNames::FindPartial(lpApplicationName); } Print("%ls\n", FileNames::ParameterizeName(wzPath, ARRAYSIZE(wzPath), pInfo)); Print("%he\n", lpCommandLine); Print("\n"); if (pInfo) { pInfo->m_fAbsorbed = true; } if (!(dwCreationFlags & CREATE_SUSPENDED)) { ResumeThread(ppi->hThread); } if (ppi == &pi) { Real_CloseHandle(ppi->hThread); Real_CloseHandle(ppi->hProcess); } } } __finally { ExitFunc(); if (!rv) { Print("\n", GetLastError(), lpApplicationName, lpCommandLine); } } return rv; } // ////////////////////////////////////////////////////////////////////////////// BOOL WINAPI Mine_CopyFileExA(LPCSTR a0, LPCSTR a1, LPPROGRESS_ROUTINE a2, LPVOID a3, LPBOOL a4, DWORD a5) { EnterFunc(); BOOL rv = 0; __try { rv = Real_CopyFileExA(a0, a1, a2, a3, a4, a5); } __finally { ExitFunc(); if (rv) { #if 0 Print("\n", a0, a1); #endif NoteRead(a0); NoteWrite(a1); } }; return rv; } BOOL WINAPI Mine_CopyFileExW(LPCWSTR a0, LPCWSTR a1, LPPROGRESS_ROUTINE a2, LPVOID a3, LPBOOL a4, DWORD a5) { EnterFunc(); BOOL rv = 0; __try { #if 0 Print("\n"); Print("\n", a0, a1); #endif rv = Real_CopyFileExW(a0, a1, a2, a3, a4, a5); } __finally { ExitFunc(); if (rv) { #if 0 Print("\n", a0, a1); #endif NoteRead(a0); NoteWrite(a1); } }; return rv; } BOOL WINAPI Mine_PrivCopyFileExW(LPCWSTR a0, LPCWSTR a1, LPPROGRESS_ROUTINE a2, LPVOID a3, LPBOOL a4, DWORD a5) { EnterFunc(); BOOL rv = 0; __try { rv = Real_PrivCopyFileExW(a0, a1, a2, a3, a4, a5); } __finally { ExitFunc(); if (rv) { #if 0 Print("\n", a0, a1); #endif NoteRead(a0); NoteWrite(a1); } }; return rv; } BOOL WINAPI Mine_CreateHardLinkA(LPCSTR a0, LPCSTR a1, LPSECURITY_ATTRIBUTES a2) { EnterFunc(); BOOL rv = 0; __try { rv = Real_CreateHardLinkA(a0, a1, a2); } __finally { ExitFunc(); if (rv) { #if 0 Print("\n", a0, a1); #endif NoteRead(a1); NoteWrite(a0); } }; return rv; } BOOL WINAPI Mine_CreateHardLinkW(LPCWSTR a0, LPCWSTR a1, LPSECURITY_ATTRIBUTES a2) { EnterFunc(); BOOL rv = 0; __try { rv = Real_CreateHardLinkW(a0, a1, a2); } __finally { ExitFunc(); if (rv) { #if 0 Print("\n", a0, a1); #endif NoteRead(a1); NoteWrite(a0); } }; return rv; } BOOL WINAPI Mine_CloseHandle(HANDLE a0) { /*int nIndent =*/ EnterFunc(); BOOL rv = 0; __try { ProcInfo * pProc = OpenFiles::RecallProc(a0); if (pProc != NULL) { Procs::Close(pProc->m_hProc); } FileInfo * pFile = OpenFiles::RecallFile(a0); if (pFile != NULL) { DWORD dwErr = GetLastError(); pFile->m_cbContent = GetFileSize(a0, NULL); if (pFile->m_cbContent == INVALID_FILE_SIZE) { pFile->m_cbContent = 0; } if (pFile->m_fCantRead) { if (pFile->m_fRead) { #if 0 Print("\n", pFile->m_pwzPath); #endif pFile->m_fRead = FALSE; } } // Here we should think about reading the file contents as appropriate. if (pFile->m_fTemporaryPath && pFile->m_fRead && !pFile->m_fAbsorbed && !pFile->m_fDelete && !pFile->m_fCleanup && !pFile->m_fWrite && pFile->m_pbContent == NULL && pFile->m_cbContent < 16384) { pFile->m_pbContent = LoadFile(a0, pFile->m_cbContent); } SetLastError(dwErr); } rv = Real_CloseHandle(a0); } __finally { ExitFunc(); if (rv /* && nIndent == 0*/) { OpenFiles::Forget(a0); } }; return rv; } BOOL WINAPI Mine_DuplicateHandle(HANDLE hSourceProcessHandle, HANDLE hSourceHandle, HANDLE hTargetProcessHandle, LPHANDLE lpTargetHandle, DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwOptions) { HANDLE hTemp = INVALID_HANDLE_VALUE; EnterFunc(); BOOL rv = 0; __try { if (lpTargetHandle == NULL) { lpTargetHandle = &hTemp; } *lpTargetHandle = INVALID_HANDLE_VALUE; rv = Real_DuplicateHandle(hSourceProcessHandle, hSourceHandle, hTargetProcessHandle, lpTargetHandle, dwDesiredAccess, bInheritHandle, dwOptions); } __finally { ExitFunc(); if (*lpTargetHandle != INVALID_HANDLE_VALUE) { FileInfo *pInfo = OpenFiles::RecallFile(hSourceHandle); if (pInfo) { OpenFiles::Remember(*lpTargetHandle, pInfo); } } }; return rv; } static LONG s_nPipeCnt = 0; BOOL WINAPI Mine_CreatePipe(PHANDLE hReadPipe, PHANDLE hWritePipe, LPSECURITY_ATTRIBUTES lpPipeAttributes, DWORD nSize) { HANDLE hRead = INVALID_HANDLE_VALUE; HANDLE hWrite = INVALID_HANDLE_VALUE; if (hReadPipe == NULL) { hReadPipe = &hRead; } if (hWritePipe == NULL) { hWritePipe = &hWrite; } /*int nIndent = */ EnterFunc(); BOOL rv = 0; __try { rv = Real_CreatePipe(hReadPipe, hWritePipe, lpPipeAttributes, nSize); } __finally { ExitFunc(); if (rv) { CHAR szPipe[128]; SafePrintf(szPipe, ARRAYSIZE(szPipe), "\\\\.\\PIPE\\Temp.%d.%d", GetCurrentProcessId(), InterlockedIncrement(&s_nPipeCnt)); FileInfo *pInfo = FileNames::FindPartial(szPipe); pInfo->m_fCleanup = TRUE; OpenFiles::Remember(*hReadPipe, pInfo); OpenFiles::Remember(*hWritePipe, pInfo); } }; return rv; } BOOL WINAPI Mine_CreateDirectoryW(LPCWSTR a0, LPSECURITY_ATTRIBUTES a1) { /* int nIndent = */ EnterFunc(); BOOL rv = 0; __try { rv = Real_CreateDirectoryW(a0, a1); } __finally { ExitFunc(); if (rv) { FileInfo *pInfo = FileNames::FindPartial(a0); pInfo->m_fDirectory = TRUE; } }; return rv; } BOOL WINAPI Mine_CreateDirectoryExW(LPCWSTR a0, LPCWSTR a1, LPSECURITY_ATTRIBUTES a2) { /* int nIndent = */ EnterFunc(); BOOL rv = 0; __try { rv = Real_CreateDirectoryExW(a0, a1, a2); } __finally { ExitFunc(); if (rv) { FileInfo *pInfo = FileNames::FindPartial(a1); pInfo->m_fDirectory = TRUE; } }; return rv; } HANDLE WINAPI Mine_CreateFileW(LPCWSTR a0, DWORD access, DWORD share, LPSECURITY_ATTRIBUTES a3, DWORD create, DWORD flags, HANDLE a6) { /* int nIndent = */ EnterFunc(); HANDLE rv = 0; __try { rv = Real_CreateFileW(a0, access, share, a3, create, flags, a6); } __finally { ExitFunc(); #if 0 Print("\n", a0, access, create, flags); #endif if (access != 0 && /* nIndent == 0 && */ rv != INVALID_HANDLE_VALUE) { FileInfo *pInfo = FileNames::FindPartial(a0); // FILE_FLAG_WRITE_THROUGH 0x80000000 // FILE_FLAG_OVERLAPPED 0x40000000 // FILE_FLAG_NO_BUFFERING 0x20000000 // FILE_FLAG_RANDOM_ACCESS 0x10000000 // FILE_FLAG_SEQUENTIAL_SCAN 0x08000000 // FILE_FLAG_DELETE_ON_CLOSE 0x04000000 // FILE_FLAG_BACKUP_SEMANTICS 0x02000000 // FILE_FLAG_POSIX_SEMANTICS 0x01000000 // FILE_FLAG_OPEN_REPARSE_POINT 0x00200000 // FILE_FLAG_OPEN_NO_RECALL 0x00100000 // FILE_FLAG_FIRST_PIPE_INSTANCE 0x00080000 // FILE_ATTRIBUTE_ENCRYPTED 0x00004000 // FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000 // FILE_ATTRIBUTE_OFFLINE 0x00001000 // FILE_ATTRIBUTE_COMPRESSED 0x00000800 // FILE_ATTRIBUTE_REPARSE_POINT 0x00000400 // FILE_ATTRIBUTE_SPARSE_FILE 0x00000200 // FILE_ATTRIBUTE_TEMPORARY 0x00000100 // FILE_ATTRIBUTE_NORMAL 0x00000080 // FILE_ATTRIBUTE_DEVICE 0x00000040 // FILE_ATTRIBUTE_ARCHIVE 0x00000020 // FILE_ATTRIBUTE_DIRECTORY 0x00000010 // FILE_ATTRIBUTE_SYSTEM 0x00000004 // FILE_ATTRIBUTE_HIDDEN 0x00000002 // FILE_ATTRIBUTE_READONLY 0x00000001 // CREATE_NEW 1 // CREATE_ALWAYS 2 // OPEN_EXISTING 3 // OPEN_ALWAYS 4 // TRUNCATE_EXISTING 5 if (create == CREATE_NEW || create == CREATE_ALWAYS || create == TRUNCATE_EXISTING) { if (!pInfo->m_fRead) { pInfo->m_fCantRead = TRUE; } } else if (create == OPEN_EXISTING) { } else if (create == OPEN_ALWAYS) { // pInfo->m_fAppend = TRUE; // !!! } if ((flags & FILE_FLAG_DELETE_ON_CLOSE)) { pInfo->m_fCleanup = TRUE; } OpenFiles::Remember(rv, pInfo); } }; return rv; } HANDLE WINAPI Mine_CreateFileMappingW(HANDLE hFile, LPSECURITY_ATTRIBUTES a1, DWORD flProtect, DWORD a3, DWORD a4, LPCWSTR a5) { /* int nIndent = */ EnterFunc(); HANDLE rv = 0; __try { rv = Real_CreateFileMappingW(hFile, a1, flProtect, a3, a4, a5); } __finally { ExitFunc(); if (rv != INVALID_HANDLE_VALUE) { FileInfo *pInfo = OpenFiles::RecallFile(hFile); if (pInfo != NULL) { switch (flProtect) { case PAGE_READONLY: pInfo->m_fRead = TRUE; break; case PAGE_READWRITE: pInfo->m_fRead = TRUE; pInfo->m_fWrite = TRUE; break; case PAGE_WRITECOPY: pInfo->m_fRead = TRUE; break; case PAGE_EXECUTE_READ: pInfo->m_fRead = TRUE; break; case PAGE_EXECUTE_READWRITE: pInfo->m_fRead = TRUE; pInfo->m_fWrite = TRUE; break; } } } }; return rv; } BOOL WINAPI Mine_DeleteFileW(LPCWSTR a0) { EnterFunc(); BOOL rv = 0; __try { rv = Real_DeleteFileW(a0); } __finally { ExitFunc(); #if 0 Print("\n", a0); #endif NoteDelete(a0); }; return rv; } static VOID Dump(LPVOID pvData, DWORD cbData) { CHAR szBuffer[128]; PBYTE pbData = (PBYTE)pvData; for (DWORD i = 0; i < cbData; i += 16) { PCHAR psz = szBuffer; psz = SafePrintf(psz, (LONG)(szBuffer + ARRAYSIZE(szBuffer) - psz), "%4d: ", i); for (DWORD j = i; j < i + 16; j++) { if (j < cbData) { psz = SafePrintf(psz, (LONG)(szBuffer + ARRAYSIZE(szBuffer) - psz), "%02x", pbData[j]); } else { psz = SafePrintf(psz, (LONG)(szBuffer + ARRAYSIZE(szBuffer) - psz), " "); } } for (DWORD j = i; j < i + 16; j++) { if (j < cbData) { if (pbData[j] >= ' ' && pbData[j] <= 127) { psz = SafePrintf(psz, (LONG)(szBuffer + ARRAYSIZE(szBuffer) - psz), "%c", pbData[j]); } else { psz = SafePrintf(psz, (LONG)(szBuffer + ARRAYSIZE(szBuffer) - psz), "."); } } else { psz = SafePrintf(psz, (LONG)(szBuffer + ARRAYSIZE(szBuffer) - psz), " "); } } Print("%s\n", szBuffer); } } BOOL WINAPI Mine_DeviceIoControl(HANDLE a0, DWORD a1, LPVOID a2, DWORD a3, LPVOID a4, DWORD a5, LPDWORD a6, LPOVERLAPPED a7) { EnterFunc(); DWORD d6 = 0; if (a6 == NULL) { a6 = &d6; } BOOL rv = 0; __try { rv = Real_DeviceIoControl(a0, a1, a2, a3, a4, a5, a6, a7); } __finally { ExitFunc(); OpenFiles::SetRead(a0, 0); OpenFiles::SetWrite(a0, 0); if (rv && a1 != 0x390008 && a1 != 0x4d0008 && a1 != 0x6d0008) { FileInfo *pInfo = OpenFiles::RecallFile(a0); DWORD DeviceType = (a1 & 0xffff0000) >> 16; DWORD Access = (a1 & 0x0000c000) >> 14; DWORD Function = (a1 & 0x00003ffc) >> 2; DWORD Method = (a1 & 0x00000003) >> 0; if (pInfo) { Print("\n", a1, DeviceType, Access, Function, Method, pInfo->m_pwzPath); } else { Print("\n", a1, DeviceType, Access, Function, Method, a3, *a6, a5, a0); if (a3 > 0) { Dump(a2, a3); } if (a5 > 0) { Dump(a4, (*a6 < a5) ? *a6 : a5); } } } }; return rv; } DWORD WINAPI Mine_GetFileAttributesW(LPCWSTR a0) { EnterFunc(); DWORD rv = 0; __try { rv = Real_GetFileAttributesW(a0); } __finally { ExitFunc(); }; return rv; } BOOL WINAPI Mine_MoveFileWithProgressW(LPCWSTR a0, LPCWSTR a1, LPPROGRESS_ROUTINE a2, LPVOID a3, DWORD a4) { EnterFunc(); BOOL rv = 0; __try { rv = Real_MoveFileWithProgressW(a0, a1, a2, a3, a4); } __finally { ExitFunc(); if (rv) { NoteRead(a0); NoteWrite(a1); } }; return rv; } BOOL WINAPI Mine_MoveFileA(LPCSTR a0, LPCSTR a1) { EnterFunc(); BOOL rv = 0; __try { rv = Real_MoveFileA(a0, a1); } __finally { ExitFunc(); if (rv) { NoteRead(a0); NoteCleanup(a0); NoteWrite(a1); } }; return rv; } BOOL WINAPI Mine_MoveFileW(LPCWSTR a0, LPCWSTR a1) { EnterFunc(); BOOL rv = 0; __try { rv = Real_MoveFileW(a0, a1); } __finally { ExitFunc(); if (rv) { NoteRead(a0); NoteCleanup(a0); NoteWrite(a1); } }; return rv; } BOOL WINAPI Mine_MoveFileExA(LPCSTR a0, LPCSTR a1, DWORD a2) { EnterFunc(); BOOL rv = 0; __try { rv = Real_MoveFileExA(a0, a1, a2); } __finally { ExitFunc(); if (rv) { NoteRead(a0); NoteCleanup(a0); NoteWrite(a1); } }; return rv; } BOOL WINAPI Mine_MoveFileExW(LPCWSTR a0, LPCWSTR a1, DWORD a2) { EnterFunc(); BOOL rv = 0; __try { rv = Real_MoveFileExW(a0, a1, a2); } __finally { ExitFunc(); if (rv) { NoteRead(a0); NoteCleanup(a0); NoteWrite(a1); } }; return rv; } void SetHandle(PCSTR pszName, HANDLE h) { #if 0 FileInfo *pInfo = OpenFiles::RecallFile(h); if (pInfo != NULL) { Tblog("\n", pszName, h, pInfo->m_pwzPath); } else { Tblog("\n", pszName, h); } #else (void)pszName; (void)h; #endif } BOOL WINAPI Mine_SetStdHandle(DWORD a0, HANDLE a1) { EnterFunc(); BOOL rv = 0; __try { rv = Real_SetStdHandle(a0, a1); if (rv && a1 != 0) { switch (a0) { case STD_INPUT_HANDLE: SetHandle("stdin", a1); break; case STD_OUTPUT_HANDLE: SetHandle("stdout", a1); break; case STD_ERROR_HANDLE: SetHandle("stderr", a1); break; } } } __finally { ExitFunc(); }; return rv; } HMODULE WINAPI Mine_LoadLibraryA(LPCSTR a0) { EnterFunc(); HMODULE rv = 0; __try { rv = Real_LoadLibraryA(a0); } __finally { ExitFunc(); }; return rv; } HMODULE WINAPI Mine_LoadLibraryW(LPCWSTR a0) { EnterFunc(); HMODULE rv = 0; __try { rv = Real_LoadLibraryW(a0); } __finally { ExitFunc(); }; return rv; } HMODULE WINAPI Mine_LoadLibraryExA(LPCSTR a0, HANDLE a1, DWORD a2) { EnterFunc(); HMODULE rv = 0; __try { rv = Real_LoadLibraryExA(a0, a1, a2); } __finally { ExitFunc(); }; return rv; } HMODULE WINAPI Mine_LoadLibraryExW(LPCWSTR a0, HANDLE a1, DWORD a2) { EnterFunc(); HMODULE rv = 0; __try { rv = Real_LoadLibraryExW(a0, a1, a2); } __finally { ExitFunc(); }; return rv; } DWORD WINAPI Mine_SetFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod) { EnterFunc(); DWORD rv = 0; __try { rv = Real_SetFilePointer(hFile, lDistanceToMove, lpDistanceToMoveHigh, dwMoveMethod); } __finally { LONG high = 0; if (lpDistanceToMoveHigh == NULL) { lpDistanceToMoveHigh = &high; } FileInfo * pInfo = OpenFiles::RecallFile(hFile); if (pInfo != NULL) { if (dwMoveMethod == FILE_END && lDistanceToMove == 0xffffffff) { #if 0 Print("\n", pInfo->m_pwzPath); #endif pInfo->m_fAppend = TRUE; } #if 0 else if (dwMoveMethod == FILE_END) { Print("\n", (int)lDistanceToMove, *lpDistanceToMoveHigh, pInfo->m_pwzPath); } else if (dwMoveMethod == FILE_BEGIN) { Print("\n", (int)lDistanceToMove, *lpDistanceToMoveHigh, pInfo->m_pwzPath); } else if (dwMoveMethod == FILE_CURRENT) { Print("\n", (int)lDistanceToMove, *lpDistanceToMoveHigh, pInfo->m_pwzPath); } #endif } ExitFunc(); }; return rv; } BOOL WINAPI Mine_SetFilePointerEx(HANDLE hFile, LARGE_INTEGER liDistanceToMove, PLARGE_INTEGER lpNewFilePointer, DWORD dwMoveMethod) { EnterFunc(); BOOL rv = 0; __try { rv = Real_SetFilePointerEx(hFile, liDistanceToMove, lpNewFilePointer, dwMoveMethod); } __finally { #if 0 FileInfo * pInfo = OpenFiles::RecallFile(hFile); if (pInfo != NULL) { if (dwMoveMethod == FILE_END) { Print("\n", liDistanceToMove.QuadPart, pInfo->m_pwzPath); } else if (dwMoveMethod == FILE_BEGIN) { Print("\n", liDistanceToMove.QuadPart, pInfo->m_pwzPath); } else if (dwMoveMethod == FILE_CURRENT) { Print("\n", liDistanceToMove.QuadPart, pInfo->m_pwzPath); } } #endif ExitFunc(); }; return rv; } BOOL WINAPI Mine_ReadFile(HANDLE a0, LPVOID a1, DWORD a2, LPDWORD a3, LPOVERLAPPED a4) { EnterFunc(); BOOL rv = 0; __try { rv = Real_ReadFile(a0, a1, a2, a3, a4); } __finally { if (rv) { OpenFiles::SetRead(a0, a2); } ExitFunc(); }; return rv; } BOOL WINAPI Mine_ReadFileEx(HANDLE a0, LPVOID a1, DWORD a2, LPOVERLAPPED a3, LPOVERLAPPED_COMPLETION_ROUTINE a4) { EnterFunc(); BOOL rv = 0; __try { rv = Real_ReadFileEx(a0, a1, a2, a3, a4); } __finally { if (rv) { OpenFiles::SetRead(a0, a2); } ExitFunc(); }; return rv; } BOOL WINAPI Mine_WriteFile(HANDLE a0, LPCVOID a1, DWORD a2, LPDWORD a3, LPOVERLAPPED a4) { EnterFunc(); BOOL rv = 0; __try { rv = Real_WriteFile(a0, a1, a2, a3, a4); } __finally { OpenFiles::SetWrite(a0, a2); ExitFunc(); }; return rv; } BOOL WINAPI Mine_WriteFileEx(HANDLE a0, LPCVOID a1, DWORD a2, LPOVERLAPPED a3, LPOVERLAPPED_COMPLETION_ROUTINE a4) { EnterFunc(); BOOL rv = 0; __try { rv = Real_WriteFileEx(a0, a1, a2, a3, a4); } __finally { OpenFiles::SetWrite(a0, a2); ExitFunc(); }; return rv; } BOOL WINAPI Mine_WriteConsoleA(HANDLE a0, const VOID* a1, DWORD a2, LPDWORD a3, LPVOID a4) { EnterFunc(); BOOL rv = 0; __try { rv = Real_WriteConsoleA(a0, a1, a2, a3, a4); } __finally { OpenFiles::SetWrite(a0, a2); ExitFunc(); }; return rv; } BOOL WINAPI Mine_WriteConsoleW(HANDLE a0, const VOID* a1, DWORD a2, LPDWORD a3, LPVOID a4) { EnterFunc(); BOOL rv = 0; __try { rv = Real_WriteConsoleW(a0, a1, a2, a3, a4); } __finally { OpenFiles::SetWrite(a0, a2); ExitFunc(); }; return rv; } ////////////////////////////////////////////////////////////////////////////// // DWORD WINAPI Mine_ExpandEnvironmentStringsA(PCSTR lpSrc, PCHAR lpDst, DWORD nSize) { EnterFunc(); DWORD rv = 0; __try { rv = Real_ExpandEnvironmentStringsA(lpSrc, lpDst, nSize); } __finally { if (rv > 0) { #if 0 Print("\n", lpSrc); #endif } ExitFunc(); }; return rv; } DWORD WINAPI Mine_ExpandEnvironmentStringsW(PCWSTR lpSrc, PWCHAR lpDst, DWORD nSize) { EnterFunc(); DWORD rv = 0; __try { rv = Real_ExpandEnvironmentStringsW(lpSrc, lpDst, nSize); } __finally { if (rv > 0) { #if 0 Print("\n", lpSrc); #endif } ExitFunc(); }; return rv; } DWORD WINAPI Mine_GetEnvironmentVariableA(PCSTR lpName, PCHAR lpBuffer, DWORD nSize) { EnterFunc(); DWORD rv = 0; __try { rv = Real_GetEnvironmentVariableA(lpName, lpBuffer, nSize); // if (rv > 0 && rv < nSize && lpBuffer != NULL) { // EnvVars::Used(lpName); // } } __finally { EnvVars::Used(lpName); ExitFunc(); }; return rv; } DWORD WINAPI Mine_GetEnvironmentVariableW(PCWSTR lpName, PWCHAR lpBuffer, DWORD nSize) { EnterFunc(); DWORD rv = 0; __try { rv = Real_GetEnvironmentVariableW(lpName, lpBuffer, nSize); // if (rv > 0 && rv < nSize && lpBuffer != NULL) { // EnvVars::Used(lpName); // } } __finally { EnvVars::Used(lpName); ExitFunc(); }; return rv; } PCWSTR CDECL Mine_wgetenv(PCWSTR var) { EnterFunc(); PCWSTR rv = 0; __try { rv = Real_wgetenv(var); // if (rv != NULL) { // EnvVars::Used(var); // } } __finally { EnvVars::Used(var); ExitFunc(); } return rv; } PCSTR CDECL Mine_getenv(PCSTR var) { EnterFunc(); PCSTR rv = 0; __try { rv = Real_getenv(var); // if (rv) { // EnvVars::Used(var); // } } __finally { EnvVars::Used(var); ExitFunc(); } return rv; } DWORD CDECL Mine_getenv_s(DWORD *pValue, PCHAR pBuffer, DWORD cBuffer, PCSTR varname) { EnterFunc(); DWORD rv = 0; __try { DWORD value; if (pValue == NULL) { pValue = &value; } rv = Real_getenv_s(pValue, pBuffer, cBuffer, varname); // if (rv == 0 && *pValue > 0) { // EnvVars::Used(varname); // } } __finally { EnvVars::Used(varname); ExitFunc(); } return rv; } DWORD CDECL Mine_wgetenv_s(DWORD *pValue, PWCHAR pBuffer, DWORD cBuffer, PCWSTR varname) { EnterFunc(); DWORD rv = 0; __try { DWORD value; if (pValue == NULL) { pValue = &value; } rv = Real_wgetenv_s(pValue, pBuffer, cBuffer, varname); // if (rv == 0 && *pValue > 0) { // EnvVars::Used(varname); // } } __finally { EnvVars::Used(varname); ExitFunc(); } return rv; } DWORD CDECL Mine_dupenv_s(PCHAR *ppBuffer, DWORD *pcBuffer, PCSTR varname) { EnterFunc(); DWORD rv = 0; __try { PCHAR pb; DWORD cb; if (ppBuffer == NULL) { ppBuffer = &pb; } if (pcBuffer == NULL) { pcBuffer = &cb; } rv = Real_dupenv_s(ppBuffer, pcBuffer, varname); // if (rv == 0 && *pcBuffer > 0 && *ppBuffer != NULL) { // EnvVars::Used(varname); // } } __finally { EnvVars::Used(varname); ExitFunc(); } return rv; } DWORD CDECL Mine_wdupenv_s(PWCHAR *ppBuffer, DWORD *pcBuffer, PCWSTR varname) { EnterFunc(); DWORD rv = 0; __try { PWCHAR pb; DWORD cb; if (ppBuffer == NULL) { ppBuffer = &pb; } if (pcBuffer == NULL) { pcBuffer = &cb; } rv = Real_wdupenv_s(ppBuffer, pcBuffer, varname); // if (rv == 0 && *pcBuffer > 0 && *ppBuffer != NULL) { // EnvVars::Used(varname); // } } __finally { EnvVars::Used(varname); ExitFunc(); } return rv; } ///////////////////////////////////////////////////////////// // AttachDetours // LONG AttachDetours(VOID) { DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)Real_EntryPoint, Mine_EntryPoint); DetourAttach(&(PVOID&)Real_ExitProcess, Mine_ExitProcess); DetourAttach(&(PVOID&)Real_CopyFileExA, Mine_CopyFileExA); DetourAttach(&(PVOID&)Real_CopyFileExW, Mine_CopyFileExW); DetourAttach(&(PVOID&)Real_PrivCopyFileExW, Mine_PrivCopyFileExW); DetourAttach(&(PVOID&)Real_CreateHardLinkA, Mine_CreateHardLinkA); DetourAttach(&(PVOID&)Real_CreateHardLinkW, Mine_CreateHardLinkW); DetourAttach(&(PVOID&)Real_CreateDirectoryW, Mine_CreateDirectoryW); DetourAttach(&(PVOID&)Real_CreateDirectoryExW, Mine_CreateDirectoryExW); DetourAttach(&(PVOID&)Real_CreateFileW, Mine_CreateFileW); DetourAttach(&(PVOID&)Real_CreatePipe, Mine_CreatePipe); DetourAttach(&(PVOID&)Real_CreateFileMappingW, Mine_CreateFileMappingW); DetourAttach(&(PVOID&)Real_CloseHandle, Mine_CloseHandle); DetourAttach(&(PVOID&)Real_DuplicateHandle, Mine_DuplicateHandle); DetourAttach(&(PVOID&)Real_CreateProcessW, Mine_CreateProcessW); DetourAttach(&(PVOID&)Real_CreateProcessA, Mine_CreateProcessA); DetourAttach(&(PVOID&)Real_DeleteFileW, Mine_DeleteFileW); DetourAttach(&(PVOID&)Real_DeviceIoControl, Mine_DeviceIoControl); DetourAttach(&(PVOID&)Real_GetFileAttributesW, Mine_GetFileAttributesW); DetourAttach(&(PVOID&)Real_MoveFileA, Mine_MoveFileA); DetourAttach(&(PVOID&)Real_MoveFileW, Mine_MoveFileW); DetourAttach(&(PVOID&)Real_MoveFileExA, Mine_MoveFileExA); DetourAttach(&(PVOID&)Real_MoveFileExW, Mine_MoveFileExW); DetourAttach(&(PVOID&)Real_MoveFileWithProgressW, Mine_MoveFileWithProgressW); DetourAttach(&(PVOID&)Real_SetStdHandle, Mine_SetStdHandle); DetourAttach(&(PVOID&)Real_LoadLibraryA, Mine_LoadLibraryA); DetourAttach(&(PVOID&)Real_LoadLibraryW, Mine_LoadLibraryW); DetourAttach(&(PVOID&)Real_LoadLibraryExA, Mine_LoadLibraryExA); DetourAttach(&(PVOID&)Real_LoadLibraryExW, Mine_LoadLibraryExW); DetourAttach(&(PVOID&)Real_SetFilePointer, Mine_SetFilePointer); DetourAttach(&(PVOID&)Real_SetFilePointerEx, Mine_SetFilePointerEx); DetourAttach(&(PVOID&)Real_ReadFile, Mine_ReadFile); DetourAttach(&(PVOID&)Real_ReadFileEx, Mine_ReadFileEx); DetourAttach(&(PVOID&)Real_WriteFile, Mine_WriteFile); DetourAttach(&(PVOID&)Real_WriteFileEx, Mine_WriteFileEx); DetourAttach(&(PVOID&)Real_WriteConsoleA, Mine_WriteConsoleA); DetourAttach(&(PVOID&)Real_WriteConsoleW, Mine_WriteConsoleW); DetourAttach(&(PVOID&)Real_ExpandEnvironmentStringsA, Mine_ExpandEnvironmentStringsA); DetourAttach(&(PVOID&)Real_ExpandEnvironmentStringsW, Mine_ExpandEnvironmentStringsW); DetourAttach(&(PVOID&)Real_GetEnvironmentVariableA, Mine_GetEnvironmentVariableA); DetourAttach(&(PVOID&)Real_GetEnvironmentVariableW, Mine_GetEnvironmentVariableW); return DetourTransactionCommit(); } LONG DetachDetours(VOID) { DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourDetach(&(PVOID&)Real_EntryPoint, Mine_EntryPoint); DetourAttach(&(PVOID&)Real_ExitProcess, Mine_ExitProcess); DetourDetach(&(PVOID&)Real_CopyFileExA, Mine_CopyFileExA); DetourDetach(&(PVOID&)Real_CopyFileExW, Mine_CopyFileExW); DetourDetach(&(PVOID&)Real_PrivCopyFileExW, Mine_PrivCopyFileExW); DetourDetach(&(PVOID&)Real_CreateHardLinkA, Mine_CreateHardLinkA); DetourDetach(&(PVOID&)Real_CreateHardLinkW, Mine_CreateHardLinkW); DetourDetach(&(PVOID&)Real_CreateDirectoryW, Mine_CreateDirectoryW); DetourDetach(&(PVOID&)Real_CreateDirectoryExW, Mine_CreateDirectoryExW); DetourDetach(&(PVOID&)Real_CreateFileW, Mine_CreateFileW); DetourDetach(&(PVOID&)Real_CreatePipe, Mine_CreatePipe); DetourDetach(&(PVOID&)Real_CreateFileMappingW, Mine_CreateFileMappingW); DetourDetach(&(PVOID&)Real_CloseHandle, Mine_CloseHandle); DetourDetach(&(PVOID&)Real_DuplicateHandle, Mine_DuplicateHandle); DetourDetach(&(PVOID&)Real_CreateProcessW, Mine_CreateProcessW); DetourDetach(&(PVOID&)Real_CreateProcessA, Mine_CreateProcessA); DetourDetach(&(PVOID&)Real_DeleteFileW, Mine_DeleteFileW); DetourDetach(&(PVOID&)Real_DeviceIoControl, Mine_DeviceIoControl); DetourDetach(&(PVOID&)Real_GetFileAttributesW, Mine_GetFileAttributesW); DetourDetach(&(PVOID&)Real_MoveFileA, Mine_MoveFileA); DetourDetach(&(PVOID&)Real_MoveFileW, Mine_MoveFileW); DetourDetach(&(PVOID&)Real_MoveFileExA, Mine_MoveFileExA); DetourDetach(&(PVOID&)Real_MoveFileExW, Mine_MoveFileExW); DetourDetach(&(PVOID&)Real_MoveFileWithProgressW, Mine_MoveFileWithProgressW); DetourDetach(&(PVOID&)Real_SetStdHandle, Mine_SetStdHandle); DetourDetach(&(PVOID&)Real_LoadLibraryA, Mine_LoadLibraryA); DetourDetach(&(PVOID&)Real_LoadLibraryW, Mine_LoadLibraryW); DetourDetach(&(PVOID&)Real_LoadLibraryExA, Mine_LoadLibraryExA); DetourDetach(&(PVOID&)Real_LoadLibraryExW, Mine_LoadLibraryExW); DetourDetach(&(PVOID&)Real_SetFilePointer, Mine_SetFilePointer); DetourDetach(&(PVOID&)Real_SetFilePointerEx, Mine_SetFilePointerEx); DetourDetach(&(PVOID&)Real_ReadFile, Mine_ReadFile); DetourDetach(&(PVOID&)Real_ReadFileEx, Mine_ReadFileEx); DetourDetach(&(PVOID&)Real_WriteFile, Mine_WriteFile); DetourDetach(&(PVOID&)Real_WriteFileEx, Mine_WriteFileEx); DetourDetach(&(PVOID&)Real_WriteConsoleA, Mine_WriteConsoleA); DetourDetach(&(PVOID&)Real_WriteConsoleW, Mine_WriteConsoleW); DetourDetach(&(PVOID&)Real_ExpandEnvironmentStringsA, Mine_ExpandEnvironmentStringsA); DetourDetach(&(PVOID&)Real_ExpandEnvironmentStringsW, Mine_ExpandEnvironmentStringsW); DetourDetach(&(PVOID&)Real_GetEnvironmentVariableA, Mine_GetEnvironmentVariableA); DetourDetach(&(PVOID&)Real_GetEnvironmentVariableW, Mine_GetEnvironmentVariableW); if (Real_getenv) { DetourDetach(&(PVOID&)Real_getenv, Mine_getenv); } if (Real_getenv_s) { DetourDetach(&(PVOID&)Real_getenv_s, Mine_getenv_s); } if (Real_wgetenv) { DetourDetach(&(PVOID&)Real_wgetenv, Mine_wgetenv); } if (Real_wgetenv_s) { DetourDetach(&(PVOID&)Real_wgetenv, Mine_wgetenv_s); } if (Real_dupenv_s) { DetourDetach(&(PVOID&)Real_dupenv_s, Mine_dupenv_s); } if (Real_wdupenv_s) { DetourDetach(&(PVOID&)Real_wdupenv_s, Mine_wdupenv_s); } return DetourTransactionCommit(); } // ////////////////////////////////////////////////////////////////////////////// VOID NoteRead(PCSTR psz) { FileInfo *pInfo = FileNames::FindPartial(psz); pInfo->m_fRead = TRUE; } VOID NoteRead(PCWSTR pwz) { FileInfo *pInfo = FileNames::FindPartial(pwz); pInfo->m_fRead = TRUE; } VOID NoteWrite(PCSTR psz) { FileInfo *pInfo = FileNames::FindPartial(psz); pInfo->m_fWrite = TRUE; if (!pInfo->m_fRead) { pInfo->m_fCantRead = TRUE; } } VOID NoteWrite(PCWSTR pwz) { FileInfo *pInfo = FileNames::FindPartial(pwz); pInfo->m_fWrite = TRUE; if (!pInfo->m_fRead) { pInfo->m_fCantRead = TRUE; } } VOID NoteDelete(PCSTR psz) { FileInfo *pInfo = FileNames::FindPartial(psz); if (pInfo->m_fWrite || pInfo->m_fRead) { pInfo->m_fCleanup = TRUE; } else { pInfo->m_fDelete = TRUE; } if (!pInfo->m_fRead) { pInfo->m_fCantRead = TRUE; } } VOID NoteDelete(PCWSTR pwz) { FileInfo *pInfo = FileNames::FindPartial(pwz); if (pInfo->m_fWrite || pInfo->m_fRead) { pInfo->m_fCleanup = TRUE; } else { pInfo->m_fDelete = TRUE; } if (!pInfo->m_fRead) { pInfo->m_fCantRead = TRUE; } } VOID NoteCleanup(PCSTR psz) { FileInfo *pInfo = FileNames::FindPartial(psz); pInfo->m_fCleanup = TRUE; } VOID NoteCleanup(PCWSTR pwz) { FileInfo *pInfo = FileNames::FindPartial(pwz); pInfo->m_fCleanup = TRUE; } ////////////////////////////////////////////////////////////// Logging System. // static BOOL s_bLog = 1; static LONG s_nTlsIndent = -1; static LONG s_nTlsThread = -1; static LONG s_nThreadCnt = 0; LONG EnterFunc() { DWORD dwErr = GetLastError(); LONG nIndent = 0; LONG nThread = 0; if (s_nTlsIndent >= 0) { nIndent = (LONG)(LONG_PTR)TlsGetValue(s_nTlsIndent); TlsSetValue(s_nTlsIndent, (PVOID)(LONG_PTR)(nIndent + 1)); } if (s_nTlsThread >= 0) { nThread = (LONG)(LONG_PTR)TlsGetValue(s_nTlsThread); } SetLastError(dwErr); return nIndent; } VOID ExitFunc() { DWORD dwErr = GetLastError(); LONG nIndent = 0; LONG nThread = 0; if (s_nTlsIndent >= 0) { nIndent = (LONG)(LONG_PTR)TlsGetValue(s_nTlsIndent) - 1; ASSERT(nIndent >= 0); TlsSetValue(s_nTlsIndent, (PVOID)(LONG_PTR)nIndent); } if (s_nTlsThread >= 0) { nThread = (LONG)(LONG_PTR)TlsGetValue(s_nTlsThread); } SetLastError(dwErr); } VOID Print(const CHAR *psz, ...) { DWORD dwErr = GetLastError(); if (s_bLog && psz) { va_list args; va_start(args, psz); TblogV(psz, args); va_end(args); } SetLastError(dwErr); } VOID AssertFailed(CONST PCHAR pszMsg, CONST PCHAR pszFile, ULONG nLine) { Tblog("ASSERT(%hs) failed in %s, line %d.\n", pszMsg, pszFile, nLine); } ////////////////////////////////////////////////////////////////////////////// // // DLL module information // BOOL ThreadAttach(HMODULE hDll) { (void)hDll; if (s_nTlsIndent >= 0) { TlsSetValue(s_nTlsIndent, (PVOID)0); } if (s_nTlsThread >= 0) { LONG nThread = InterlockedIncrement(&s_nThreadCnt); TlsSetValue(s_nTlsThread, (PVOID)(LONG_PTR)nThread); } return TRUE; } BOOL ThreadDetach(HMODULE hDll) { (void)hDll; if (s_nTlsIndent >= 0) { TlsSetValue(s_nTlsIndent, (PVOID)0); } if (s_nTlsThread >= 0) { TlsSetValue(s_nTlsThread, (PVOID)0); } return TRUE; } BOOL ProcessAttach(HMODULE hDll) { InitializeCriticalSection(&s_csPipe); InitializeCriticalSection(&s_csChildPayload); Procs::Initialize(); EnvVars::Initialize(); FileNames::Initialize(); OpenFiles::Initialize(); s_bLog = FALSE; s_nTlsIndent = TlsAlloc(); s_nTlsThread = TlsAlloc(); s_hInst = hDll; s_hKernel32 = NULL; PBYTE xCreate = (PBYTE)DetourCodeFromPointer((PVOID)Real_CreateProcessW, NULL); PTBLOG_PAYLOAD pPayload = NULL; for (HMODULE hMod = NULL; (hMod = DetourEnumerateModules(hMod)) != NULL;) { ULONG cbData; PVOID pvData = DetourFindPayload(hMod, s_guidTrace, &cbData); if (pvData != NULL && pPayload == NULL) { pPayload = (PTBLOG_PAYLOAD)pvData; } ULONG cbMod = DetourGetModuleSize(hMod); if (((PBYTE)hMod) < xCreate && ((PBYTE)hMod + cbMod) > xCreate) { s_hKernel32 = hMod; } } ZeroMemory(&s_Payload, sizeof(s_Payload)); if (pPayload == NULL) { return FALSE; } CopyMemory(&s_Payload, pPayload, sizeof(s_Payload)); LoadStdHandleName(STD_INPUT_HANDLE, s_Payload.wzStdin, FALSE); LoadStdHandleName(STD_OUTPUT_HANDLE, s_Payload.wzStdout, s_Payload.fStdoutAppend); LoadStdHandleName(STD_ERROR_HANDLE, s_Payload.wzStderr, s_Payload.fStderrAppend); s_nTraceProcessId = s_Payload.nTraceProcessId; GetModuleFileNameA(s_hInst, s_szDllPath, ARRAYSIZE(s_szDllPath)); // Find hidden functions. Real_PrivCopyFileExW = (BOOL (WINAPI *)(LPCWSTR, LPCWSTR, LPPROGRESS_ROUTINE, LPVOID, LPBOOL, DWORD)) GetProcAddress(s_hKernel32, "PrivCopyFileExW"); if (Real_PrivCopyFileExW == NULL) { DEBUG_BREAK(); } LONG error = AttachDetours(); if (error != NO_ERROR) { DEBUG_BREAK(); Tblog("\n", error); } ThreadAttach(hDll); s_bLog = TRUE; return TRUE; } BOOL ProcessDetach(HMODULE hDll) { ThreadDetach(hDll); s_bLog = FALSE; LONG error = DetachDetours(); if (error != NO_ERROR) { Tblog("\n", error); } TblogClose(); if (s_nTlsIndent >= 0) { TlsFree(s_nTlsIndent); } if (s_nTlsThread >= 0) { TlsFree(s_nTlsThread); } return TRUE; } inline VOID UpdateIfRoom(PWCHAR& pwzDst, PWCHAR pwzDstEnd, WCHAR c) { if (pwzDst < pwzDstEnd) { *pwzDst++ = c; // Write character if room in buffer. } else { pwzDst++; // If no room, just advance pointer (to alloc calculation) } } static PCHAR RemoveReturns(PCHAR pszBuffer) { PCHAR pszIn = pszBuffer; PCHAR pszOut = pszBuffer; while (*pszIn) { if (*pszIn == '\r') { pszIn++; continue; } *pszOut++ = *pszIn++; } *pszOut = '\0'; return pszBuffer; } static PWCHAR RemoveReturns(PWCHAR pwzBuffer) { PWCHAR pwzIn = pwzBuffer; PWCHAR pwzOut = pwzBuffer; while (*pwzIn) { if (*pwzIn == '\r') { pwzIn++; continue; } *pwzOut++ = *pwzIn++; } *pwzOut = '\0'; return pwzBuffer; } PBYTE LoadFile(HANDLE hFile, DWORD cbFile) { PBYTE pbFile = (PBYTE)GlobalAlloc(GPTR, cbFile + 3); if (pbFile == NULL) { return NULL; } DWORD cbRead = 0; Real_SetFilePointer(hFile, 0, NULL, FILE_BEGIN); Real_ReadFile(hFile, pbFile, cbFile, &cbRead, NULL); // Make sure the file is zero terminated. pbFile[cbRead + 0] = 0; pbFile[cbRead + 1] = 0; pbFile[cbRead + 2] = 0; return pbFile; } PWCHAR More(PCWSTR pwzPath, PWCHAR pwzDst, PWCHAR pwzDstEnd) { HANDLE hFile = Real_CreateFileW(pwzPath, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL); if (hFile == INVALID_HANDLE_VALUE) { return NULL; } FileInfo *pInfo = FileNames::FindPartial(pwzPath); pInfo->m_fAbsorbed = true; DWORD cbFile = Real_SetFilePointer(hFile, 0, NULL, FILE_END); DWORD cbRead = 0; PCHAR pszFile = (PCHAR)GlobalAlloc(GPTR, cbFile + 2); // 2 bytes null for Unicode or Ascii. if (pszFile != NULL) { Real_SetFilePointer(hFile, 0, NULL, FILE_BEGIN); Real_ReadFile(hFile, pszFile, cbFile, &cbRead, NULL); if (((PUCHAR)pszFile)[0] == 0xff && ((PUCHAR)pszFile)[1] == 0xfe) { // Unicode PWCHAR pwzFile = ((PWCHAR)pszFile) + 1; PCWSTR pwzIn = pwzFile; while (*pwzIn) { if (*pwzIn == ' ' || *pwzIn == '\t' || *pwzIn == '\r' || *pwzIn == '\n') { UpdateIfRoom(pwzDst, pwzDstEnd, ' '); while (*pwzIn == ' ' || *pwzIn == '\t' || *pwzIn == '\r' || *pwzIn == '\n') { pwzIn++; } } else { UpdateIfRoom(pwzDst, pwzDstEnd, *pwzIn++); } } } else { PCSTR pszIn = pszFile; while (*pszIn) { if (*pszIn == ' ' || *pszIn == '\t' || *pszIn == '\r' || *pszIn == '\n') { UpdateIfRoom(pwzDst, pwzDstEnd, ' '); while (*pszIn == ' ' || *pszIn == '\t' || *pszIn == '\r' || *pszIn == '\n') { pszIn++; } } else { UpdateIfRoom(pwzDst, pwzDstEnd, *pszIn++); } } } GlobalFree(pszFile); } Real_CloseHandle(hFile); return pwzDst; } // This function is called twice. On the first call, pwzDstEnd <= pwzDst and // no data is copied, but pwzDst is advanced so we can see how big of a // buffer is needed to hold the command line. // // On the second call, the command line is actually populated. PWCHAR LoadCommandLine(PCWSTR pwz, PWCHAR pwzDst, PWCHAR pwzDstEnd) { while (*pwz) { PCWSTR pwzArgBeg = NULL; PCWSTR pwzArgEnd = NULL; WCHAR cQuote = '\0'; BOOL fMore = false; if (*pwz == '@') { fMore = true; pwz++; } if (*pwz == '\"' || *pwz == '\'') { cQuote = *pwz++; pwzArgBeg = pwz; while (*pwz != '\0' && *pwz != cQuote) { pwz++; } pwzArgEnd = pwz; if (*pwz == cQuote) { pwz++; } } else { pwzArgBeg = pwz; while (*pwz != '\0' && *pwz != ' ' && *pwz != '\t' && *pwz != '\n' && *pwz != '\r') { pwz++; } pwzArgEnd = pwz; } if (fMore) { // More arguments! WCHAR wzPath[MAX_PATH]; PWCHAR pwzPath = wzPath; PCWSTR pwzTmp = pwzArgBeg + 1; while (pwzTmp < pwzArgEnd && pwzPath < wzPath + ARRAYSIZE(wzPath)-2) { *pwzPath++ = *pwzTmp++; } *pwzPath = '\0'; PWCHAR pwzOut = More(wzPath, pwzDst, pwzDstEnd); if (pwzOut != NULL) { pwzDst = pwzOut; cQuote = 0; pwzArgBeg = pwzArgEnd; } } if (cQuote) { UpdateIfRoom(pwzDst, pwzDstEnd, cQuote); } for (; pwzArgBeg < pwzArgEnd; pwzArgBeg++) { UpdateIfRoom(pwzDst, pwzDstEnd, *pwzArgBeg); } if (cQuote) { UpdateIfRoom(pwzDst, pwzDstEnd, cQuote); } if (*pwz) { UpdateIfRoom(pwzDst, pwzDstEnd, ' '); } // skip over separating spaces. while (*pwz == ' ' || *pwz == '\t' || *pwz == '\n' || *pwz == '\r') { pwz++; } } return pwzDst; } void TestHandle(PCSTR pszName, HANDLE h) { FileInfo *pInfo = OpenFiles::RecallFile(h); if (pInfo != NULL) { #if 1 // Ignore PIPEs. if (FileNames::PrefixMatch(pInfo->m_pwzPath, L"\\\\.\\PIPE\\")) { // Ignore; } else #endif if (FileNames::SuffixMatch(pInfo->m_pwzPath, L"\\conout$")) { // Ignore; } else if (FileNames::SuffixMatch(pInfo->m_pwzPath, L"\\conin$")) { // Ignore; } else if (FileNames::SuffixMatch(pInfo->m_pwzPath, L"\\nul")) { // Ignore; } else { Tblog("<%hs%hs>%le\n", pszName, pInfo->m_fAppend ? " append=\"true\"" : "", pInfo->m_pwzPath, pszName); } } else { Tblog("\n", pszName, h); } } LONG WINAPI DetourAttachIf(PVOID *ppPointer, PVOID pDetour) { if (*ppPointer == NULL) { Tblog("\n", pDetour); return NO_ERROR; } PDETOUR_TRAMPOLINE pRealTrampoline; PVOID pRealTarget; PVOID pRealDetour; LONG err = DetourAttachEx(ppPointer, pDetour, &pRealTrampoline, &pRealTarget, &pRealDetour); if (err == NO_ERROR) { // Tblog("\n", pDetour, pRealTarget); return NO_ERROR; } return err; } int WINAPI Mine_EntryPoint(VOID) { // This function is invoked instead of the process EntryPoint (Real_EntryPoint). TblogOpen(); SaveEnvironment(); { CHAR szExeName[MAX_PATH]; CHAR szId[128]; CHAR szParent[128]; WCHAR wzPath[MAX_PATH]; PCHAR pszExeName = szExeName; // Get the base command line (skipping over the executable name) PCWSTR pwzLine = GetCommandLineW(); if (*pwzLine == '\"') { pwzLine++; while (*pwzLine && *pwzLine != '\"') { pwzLine++; } if (*pwzLine == '\"') { pwzLine++; } } else { while (*pwzLine && *pwzLine != ' ' && *pwzLine != '\t') { pwzLine++; } } while (*pwzLine && (*pwzLine == ' ' || *pwzLine == '\t')) { pwzLine++; } // Get the root executable name. if (GetModuleFileNameA(0, szExeName, ARRAYSIZE(szExeName))) { PCHAR psz = szExeName; while (*psz) { psz++; } while (psz > szExeName && psz[-1] != ':' && psz[-1] != '\\' && psz[-1] != '/') { psz--; } pszExeName = psz; while (*psz && *psz != '.') { psz++; } *psz = '\0'; } else { szExeName[0] = '\0'; } // Start the XML process node. Tblog("\n"); { PCHAR pszId = szId; PCHAR pszParent = szParent; for (DWORD i = 0; i < s_Payload.nGeneology; i++) { pszId = SafePrintf(pszId, 16, "%d.", s_Payload.rGeneology[i]); if (i < s_Payload.nGeneology - 1) { pszParent = SafePrintf(pszParent, 16, "%d.", s_Payload.rGeneology[i]); } } *pszId = '\0'; *pszParent = '\0'; if (szParent[0] == '\0') { Tblog("')) { Tblog(" redirects=\"true\""); } Tblog(" xmlns:t=\"http://schemas.microsoft.com/research/tracebld/2008\">\n"); // Get the directory. DWORD dwSize = GetCurrentDirectoryA(ARRAYSIZE(szExeName), szExeName); if (dwSize > 0 && dwSize < ARRAYSIZE(szExeName)) { Tblog("%hs\n", szExeName); } // Get the real executable name. wzPath[0] = '\0'; if (GetModuleFileNameA(0, szExeName, ARRAYSIZE(szExeName))) { FileInfo *pInfo = FileNames::FindPartial(szExeName); Tblog("%ls\n", FileNames::ParameterizeName(wzPath, ARRAYSIZE(wzPath), pInfo)); } // Construct the processed command line. PWCHAR pwzDstEnd = (PWCHAR)pwzLine; PWCHAR pwzDst = pwzDstEnd; pwzDst = LoadCommandLine(pwzLine, pwzDst, pwzDstEnd); DWORD wcNew = (DWORD)((pwzDst - pwzDstEnd) + 1); PWCHAR pwzFin = (PWCHAR)GlobalAlloc(GPTR, wcNew * sizeof(WCHAR)); pwzDst = pwzFin; pwzDstEnd = pwzFin + wcNew; pwzDst = LoadCommandLine(pwzLine, pwzDst, pwzDstEnd); *pwzDst = '\0'; FileNames::ParameterizeLine(pwzFin, pwzFin + wcNew); if (HasSpace(wzPath)) { Tblog(""%le" %le\n", wzPath, pwzFin); } else { Tblog("%le %le\n", wzPath, pwzFin); } TestHandle("t:StdIn", GetStdHandle(STD_INPUT_HANDLE)); TestHandle("t:StdOut", GetStdHandle(STD_OUTPUT_HANDLE)); TestHandle("t:StdErr", GetStdHandle(STD_ERROR_HANDLE)); } if (FindMsvcr()) { FindProc(&(PVOID&)Real_getenv, "getenv"); FindProc(&(PVOID&)Real_wgetenv, "_wgetenv"); FindProc(&(PVOID&)Real_getenv_s, "getenv_s"); FindProc(&(PVOID&)Real_wgetenv_s, "_wgetenv_s"); FindProc(&(PVOID&)Real_dupenv_s, "_dupenv_s"); FindProc(&(PVOID&)Real_wdupenv_s, "_wdupenv_s"); DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttachIf(&(PVOID&)Real_getenv, Mine_getenv); DetourAttachIf(&(PVOID&)Real_getenv_s, Mine_getenv_s); DetourAttachIf(&(PVOID&)Real_wgetenv, Mine_wgetenv); DetourAttachIf(&(PVOID&)Real_wgetenv, Mine_wgetenv_s); DetourAttachIf(&(PVOID&)Real_dupenv_s, Mine_dupenv_s); DetourAttachIf(&(PVOID&)Real_wdupenv_s, Mine_wdupenv_s); DetourTransactionCommit(); } return Real_EntryPoint(); } VOID WINAPI Mine_ExitProcess(UINT a0) { if (a0 & 0x80000000) { Tblog("%d\n", -(int)a0); } else { Tblog("%d\n", a0); } FileNames::Dump(); EnvVars::Dump(); TblogClose(); Real_ExitProcess(a0); } BOOL APIENTRY DllMain(HINSTANCE hModule, DWORD dwReason, PVOID lpReserved) { (void)hModule; (void)lpReserved; if (DetourIsHelperProcess()) { return TRUE; } if (dwReason == DLL_PROCESS_ATTACH) { DetourRestoreAfterWith(); Real_EntryPoint = (int (WINAPI *)(VOID))DetourGetEntryPoint(NULL); return ProcessAttach(hModule); } else if (dwReason == DLL_PROCESS_DETACH) { return ProcessDetach(hModule); } else if (dwReason == DLL_THREAD_ATTACH) { return ThreadAttach(hModule); } else if (dwReason == DLL_THREAD_DETACH) { return ThreadDetach(hModule); } return TRUE; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/tracebld/trcbld.rc ================================================ ////////////////////////////////////////////////////////////////////////////// // // Version information for trcbld.rc. // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include "detver.h" #define VER_INTERNALNAME_STR "trcbld" DETOURS_STRINGIFY(DETOURS_BITS) #define VER_ORIGINALFILENAME_STR "trcbld" DETOURS_STRINGIFY(DETOURS_BITS) ".dll" #define VER_FILEDESCRIPTION_STR "Detours Build Tracing Module" #define VER_COMPANYNAME_STR "Microsoft Corporation" #include "common.ver" ================================================ FILE: ext/detours/samples/tracelnk/Makefile ================================================ ############################################################################## ## ## Utility to trace Dynamic Linking. ## ## Microsoft Research Detours Package ## ## Copyright (c) Microsoft Corporation. All rights reserved. ## !include ..\common.mak LIBS=$(LIBS) kernel32.lib ############################################################################## all: dirs \ $(BIND)\trclnk$(DETOURS_BITS).dll \ !IF $(DETOURS_SOURCE_BROWSING)==1 $(OBJD)\trclnk$(DETOURS_BITS).bsc \ !ENDIF option ############################################################################## clean: -del *~ test.txt 2>nul -del $(BIND)\trclnk*.* 2>nul -rmdir /q /s $(OBJD) 2>nul realclean: clean -rmdir /q /s $(OBJDS) 2>nul dirs: @if not exist $(BIND) mkdir $(BIND) && echo . Created $(BIND) @if not exist $(OBJD) mkdir $(OBJD) && echo . Created $(OBJD) ############################################################################## $(OBJD)\trclnk.obj : trclnk.cpp $(OBJD)\trclnk.res : trclnk.rc $(BIND)\trclnk$(DETOURS_BITS).dll : $(OBJD)\trclnk.obj $(OBJD)\trclnk.res $(DEPS) cl /LD $(CFLAGS) /Fe$@ /Fd$(@R).pdb \ $(OBJD)\trclnk.obj $(OBJD)\trclnk.res \ /link $(LINKFLAGS) /subsystem:console \ /export:DetourFinishHelperProcess,@1,NONAME \ $(LIBS) $(OBJD)\trclnk$(DETOURS_BITS).bsc : $(OBJD)\trclnk.obj bscmake /v /n /o $@ $(OBJD)\trclnk.sbr ############################################### Install non-bit-size binaries. !IF "$(DETOURS_OPTION_PROCESSOR)" != "" $(OPTD)\trclnk$(DETOURS_OPTION_BITS).dll: $(OPTD)\trclnk$(DETOURS_OPTION_BITS).pdb: $(BIND)\trclnk$(DETOURS_OPTION_BITS).dll : $(OPTD)\trclnk$(DETOURS_OPTION_BITS).dll @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\trclnk$(DETOURS_OPTION_BITS).pdb : $(OPTD)\trclnk$(DETOURS_OPTION_BITS).pdb @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). option: \ $(BIND)\trclnk$(DETOURS_OPTION_BITS).dll \ $(BIND)\trclnk$(DETOURS_OPTION_BITS).pdb \ !ELSE option: !ENDIF ############################################################################## notepad: all @echo -------- Logging output to test.txt ------------ start $(BIND)\syelogd.exe /o test.txt $(BIND)\sleep5.exe 1 @echo -------- Should load trclnk$(DETOURS_BITS).dll dynamically using withdll.exe ------------ @echo . @echo ** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ** @echo ** @echo ** Close the NotePad window to continue test. @echo ** @echo ** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ** @echo . $(BIND)\withdll -d:$(BIND)\trclnk$(DETOURS_BITS).dll $(SYSTEMROOT)\system32\notepad.exe @echo -------- Log from syelog ------------- type test.txt test: all @echo -------- Logging output to test.txt ------------ start $(BIND)\syelogd.exe /o test.txt $(BIND)\sleep5.exe 1 @echo -------- Should load trclnk$(DETOURS_BITS).dll dynamically using withdll.exe ------------ @echo . $(BIND)\withdll -d:$(BIND)\trclnk$(DETOURS_BITS).dll $(SYSTEMROOT)\system32\cmd.exe /c dir @echo -------- Log from syelog ------------- type test.txt ################################################################# End of File. ================================================ FILE: ext/detours/samples/tracelnk/trclnk.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (trclnk.cpp of trclnk.dll) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #define _WIN32_WINNT 0x0400 #define WIN32 #define NT #define DBG_TRACE 0 #include #include #include "detours.h" #include "syelog.h" #define PULONG_PTR PVOID #define PLONG_PTR PVOID #define ULONG_PTR PVOID #define ENUMRESNAMEPROCA PVOID #define ENUMRESNAMEPROCW PVOID #define ENUMRESLANGPROCA PVOID #define ENUMRESLANGPROCW PVOID #define ENUMRESTYPEPROCA PVOID #define ENUMRESTYPEPROCW PVOID #define STGOPTIONS PVOID ////////////////////////////////////////////////////////////////////////////// #pragma warning(disable:4127) // Many of our asserts are constants. #define ASSERT_ALWAYS(x) \ do { \ if (!(x)) { \ AssertMessage(#x, __FILE__, __LINE__); \ DebugBreak(); \ } \ } while (0) #ifndef NDEBUG #define ASSERT(x) ASSERT_ALWAYS(x) #else #define ASSERT(x) #endif #define UNUSED(c) (c) = (c) ////////////////////////////////////////////////////////////////////////////// static HMODULE s_hInst = NULL; static WCHAR s_wzDllPath[MAX_PATH]; BOOL ProcessEnumerate(); BOOL InstanceEnumerate(HINSTANCE hInst); BOOL ImportEnumerate(HINSTANCE hInst); VOID _PrintEnter(const CHAR *psz, ...); VOID _PrintExit(const CHAR *psz, ...); VOID _Print(const CHAR *psz, ...); VOID _VPrint(PCSTR msg, va_list args, PCHAR pszBuf, LONG cbBuf); VOID AssertMessage(CONST PCHAR pszMsg, CONST PCHAR pszFile, ULONG nLine); ////////////////////////////////////////////////////////////////////////////// // // Trampolines // extern "C" { // Trampolines for SYELOG library. // HANDLE (WINAPI * Real_CreateFileW)(LPCWSTR a0, DWORD a1, DWORD a2, LPSECURITY_ATTRIBUTES a3, DWORD a4, DWORD a5, HANDLE a6) = CreateFileW; BOOL (WINAPI * Real_WriteFile)(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped) = WriteFile; BOOL (WINAPI * Real_FlushFileBuffers)(HANDLE hFile) = FlushFileBuffers; BOOL (WINAPI * Real_CloseHandle)(HANDLE hObject) = CloseHandle; BOOL (WINAPI * Real_WaitNamedPipeW)(LPCWSTR lpNamedPipeName, DWORD nTimeOut) = WaitNamedPipeW; BOOL (WINAPI * Real_SetNamedPipeHandleState)(HANDLE hNamedPipe, LPDWORD lpMode, LPDWORD lpMaxCollectionCount, LPDWORD lpCollectDataTimeout) = SetNamedPipeHandleState; DWORD (WINAPI * Real_GetCurrentProcessId)(VOID) = GetCurrentProcessId; VOID (WINAPI * Real_GetSystemTimeAsFileTime)(LPFILETIME lpSystemTimeAsFileTime) = GetSystemTimeAsFileTime; VOID (WINAPI * Real_InitializeCriticalSection)(LPCRITICAL_SECTION lpSection) = InitializeCriticalSection; VOID (WINAPI * Real_EnterCriticalSection)(LPCRITICAL_SECTION lpSection) = EnterCriticalSection; VOID (WINAPI * Real_LeaveCriticalSection)(LPCRITICAL_SECTION lpSection) = LeaveCriticalSection; } BOOL (WINAPI * Real_FreeLibrary)(HMODULE a0) = FreeLibrary; DWORD (WINAPI * Real_GetModuleFileNameW)(HMODULE a0, LPWSTR a1, DWORD a2) = GetModuleFileNameW; HMODULE (WINAPI * Real_GetModuleHandleW)(LPCWSTR a0) = GetModuleHandleW; FARPROC (WINAPI * Real_GetProcAddress)(HMODULE a0, LPCSTR a1) = GetProcAddress; HMODULE (WINAPI * Real_LoadLibraryExW)(LPCWSTR a0, HANDLE a1, DWORD a2) = LoadLibraryExW; HMODULE (WINAPI * Real_LoadLibraryW)(LPCWSTR a0) = LoadLibraryW; ////////////////////////////////////////////////////////////////////////////// // BOOL WINAPI Mine_FreeLibrary(HMODULE a0) { (void)a0; return TRUE; } DWORD WINAPI Mine_GetModuleFileNameW(HMODULE a0, LPWSTR a1, DWORD a2) { return Real_GetModuleFileNameW(a0, a1, a2); } HMODULE WINAPI Mine_GetModuleHandleW(LPCWSTR a0) { return Real_GetModuleHandleW(a0); } FARPROC WINAPI Mine_GetProcAddress(HMODULE a0, LPCSTR a1) { _PrintEnter("GetProcAddress(%p,%hs)\n", a0, a1); FARPROC rv = 0; __try { rv = Real_GetProcAddress(a0, a1); } __finally { _PrintExit("GetProcAddress(,) -> %p\n", rv); }; return rv; } HMODULE WINAPI Mine_LoadLibraryExW(LPCWSTR a0, HANDLE a1, DWORD a2) { _PrintEnter("LoadLibraryExW(%ls,%p,%x)\n", a0, a1, a2); HMODULE rv = 0; __try { rv = Real_LoadLibraryExW(a0, a1, a2); } __finally { _PrintExit("LoadLibraryExW(,,) -> %p\n", rv); if (rv) { InstanceEnumerate(rv); ImportEnumerate(rv); } }; return rv; } HMODULE WINAPI Mine_LoadLibraryW(LPCWSTR a0) { _PrintEnter("LoadLibraryW(%ls)\n", a0); HMODULE rv = 0; __try { rv = Real_LoadLibraryW(a0); } __finally { _PrintExit("LoadLibraryW() -> %p\n", rv); }; return rv; } ///////////////////////////////////////////////////////////// // AttachDetours // PCHAR DetRealName(PCHAR psz) { PCHAR pszBeg = psz; // Move to end of name. while (*psz) { psz++; } // Move back through A-Za-z0-9 names. while (psz > pszBeg && ((psz[-1] >= 'A' && psz[-1] <= 'Z') || (psz[-1] >= 'a' && psz[-1] <= 'z') || (psz[-1] >= '0' && psz[-1] <= '9'))) { psz--; } return psz; } VOID DetAttach(PVOID *ppbReal, PVOID pbMine, PCHAR psz) { LONG l = DetourAttach(ppbReal, pbMine); if (l != 0) { Syelog(SYELOG_SEVERITY_NOTICE, "Attach failed: `%s': error %d\n", DetRealName(psz), l); } } VOID DetDetach(PVOID *ppbReal, PVOID pbMine, PCHAR psz) { LONG l = DetourDetach(ppbReal, pbMine); if (l != 0) { Syelog(SYELOG_SEVERITY_NOTICE, "Detach failed: `%s': error %d\n", DetRealName(psz), l); } } #define ATTACH(x) DetAttach(&(PVOID&)Real_##x,Mine_##x,#x) #define DETACH(x) DetDetach(&(PVOID&)Real_##x,Mine_##x,#x) LONG AttachDetours(VOID) { DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); ATTACH(FreeLibrary); ATTACH(GetModuleHandleW); ATTACH(GetProcAddress); ATTACH(LoadLibraryExW); ATTACH(LoadLibraryW); return DetourTransactionCommit(); } LONG DetachDetours(VOID) { DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DETACH(FreeLibrary); DETACH(GetModuleHandleW); DETACH(GetProcAddress); DETACH(LoadLibraryExW); DETACH(LoadLibraryW); return DetourTransactionCommit(); } ////////////////////////////////////////////////////////////// Logging System. // static BOOL s_bLog = 1; static LONG s_nTlsIndent = -1; static LONG s_nTlsThread = -1; static LONG s_nThreadCnt = 0; VOID _PrintEnter(const CHAR *psz, ...) { DWORD dwErr = GetLastError(); LONG nIndent = 0; LONG nThread = 0; if (s_nTlsIndent >= 0) { nIndent = (LONG)(LONG_PTR)TlsGetValue(s_nTlsIndent); TlsSetValue(s_nTlsIndent, (PVOID)(LONG_PTR)(nIndent + 1)); } if (s_nTlsThread >= 0) { nThread = (LONG)(LONG_PTR)TlsGetValue(s_nTlsThread); } if (s_bLog && psz) { CHAR szBuf[1024]; PCHAR pszBuf = szBuf; PCHAR pszEnd = szBuf + ARRAYSIZE(szBuf) - 1; LONG nLen = (nIndent > 0) ? (nIndent < 35 ? nIndent * 2 : 70) : 0; *pszBuf++ = (CHAR)('0' + ((nThread / 100) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 10) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 1) % 10)); *pszBuf++ = ' '; while (nLen-- > 0) { *pszBuf++ = ' '; } va_list args; va_start(args, psz); while ((*pszBuf++ = *psz++) != 0 && pszBuf < pszEnd) { // Copy characters. } *pszEnd = '\0'; SyelogV(SYELOG_SEVERITY_INFORMATION, szBuf, args); va_end(args); } SetLastError(dwErr); } VOID _PrintExit(const CHAR *psz, ...) { DWORD dwErr = GetLastError(); LONG nIndent = 0; LONG nThread = 0; if (s_nTlsIndent >= 0) { nIndent = (LONG)(LONG_PTR)TlsGetValue(s_nTlsIndent) - 1; ASSERT(nIndent >= 0); TlsSetValue(s_nTlsIndent, (PVOID)(LONG_PTR)nIndent); } if (s_nTlsThread >= 0) { nThread = (LONG)(LONG_PTR)TlsGetValue(s_nTlsThread); } if (s_bLog && psz) { CHAR szBuf[1024]; PCHAR pszBuf = szBuf; PCHAR pszEnd = szBuf + ARRAYSIZE(szBuf) - 1; LONG nLen = (nIndent > 0) ? (nIndent < 35 ? nIndent * 2 : 70) : 0; *pszBuf++ = (CHAR)('0' + ((nThread / 100) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 10) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 1) % 10)); *pszBuf++ = ' '; while (nLen-- > 0) { *pszBuf++ = ' '; } va_list args; va_start(args, psz); while ((*pszBuf++ = *psz++) != 0 && pszBuf < pszEnd) { // Copy characters. } *pszEnd = '\0'; SyelogV(SYELOG_SEVERITY_INFORMATION, szBuf, args); va_end(args); } SetLastError(dwErr); } VOID _Print(const CHAR *psz, ...) { DWORD dwErr = GetLastError(); LONG nIndent = 0; LONG nThread = 0; if (s_nTlsIndent >= 0) { nIndent = (LONG)(LONG_PTR)TlsGetValue(s_nTlsIndent); } if (s_nTlsThread >= 0) { nThread = (LONG)(LONG_PTR)TlsGetValue(s_nTlsThread); } if (s_bLog && psz) { CHAR szBuf[1024]; PCHAR pszBuf = szBuf; PCHAR pszEnd = szBuf + ARRAYSIZE(szBuf) - 1; LONG nLen = (nIndent > 0) ? (nIndent < 35 ? nIndent * 2 : 70) : 0; *pszBuf++ = (CHAR)('0' + ((nThread / 100) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 10) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 1) % 10)); *pszBuf++ = ' '; while (nLen-- > 0) { *pszBuf++ = ' '; } va_list args; va_start(args, psz); while ((*pszBuf++ = *psz++) != 0 && pszBuf < pszEnd) { // Copy characters. } *pszEnd = '\0'; SyelogV(SYELOG_SEVERITY_INFORMATION, szBuf, args); va_end(args); } SetLastError(dwErr); } VOID AssertMessage(CONST PCHAR pszMsg, CONST PCHAR pszFile, ULONG nLine) { Syelog(SYELOG_SEVERITY_FATAL, "ASSERT(%s) failed in %s, line %d.\n", pszMsg, pszFile, nLine); } ////////////////////////////////////////////////////////////////////////////// // PIMAGE_NT_HEADERS NtHeadersForInstance(HINSTANCE hInst) { PIMAGE_DOS_HEADER pDosHeader = (PIMAGE_DOS_HEADER)hInst; __try { if (pDosHeader->e_magic != IMAGE_DOS_SIGNATURE) { SetLastError(ERROR_BAD_EXE_FORMAT); return NULL; } PIMAGE_NT_HEADERS pNtHeader = (PIMAGE_NT_HEADERS)((PBYTE)pDosHeader + pDosHeader->e_lfanew); if (pNtHeader->Signature != IMAGE_NT_SIGNATURE) { SetLastError(ERROR_INVALID_EXE_SIGNATURE); return NULL; } if (pNtHeader->FileHeader.SizeOfOptionalHeader == 0) { SetLastError(ERROR_EXE_MARKED_INVALID); return NULL; } return pNtHeader; } __except(EXCEPTION_EXECUTE_HANDLER) { } SetLastError(ERROR_EXE_MARKED_INVALID); return NULL; } static inline PBYTE RvaToVa(PBYTE pbBase, DWORD nOffset) { return nOffset ? pbBase + nOffset : NULL; } #if _MSC_VER >= 1900 #pragma warning(push) #pragma warning(disable:4456) // declaration hides previous local declaration #endif BOOL ImportEnumerate(HINSTANCE hInst) { PBYTE pbBase = (PBYTE)hInst; PIMAGE_NT_HEADERS pNtHeader; // Read & Write PIMAGE_SECTION_HEADER pSectionHeaders; DWORD nPeOffset; DWORD nSectionsOffset; ////////////////////////////////////////////////////// Process DOS Header. // PIMAGE_DOS_HEADER pDosHeader = (PIMAGE_DOS_HEADER)pbBase; if (pDosHeader->e_magic != IMAGE_DOS_SIGNATURE) { return FALSE; } nPeOffset = pDosHeader->e_lfanew; /////////////////////////////////////////////////////// Process PE Header. // pNtHeader = (PIMAGE_NT_HEADERS)RvaToVa(pbBase, nPeOffset); if (pNtHeader->Signature != IMAGE_NT_SIGNATURE) { return FALSE; } if (pNtHeader->FileHeader.SizeOfOptionalHeader == 0) { return FALSE; } nSectionsOffset = nPeOffset + sizeof(pNtHeader->Signature) + sizeof(pNtHeader->FileHeader) + pNtHeader->FileHeader.SizeOfOptionalHeader; ///////////////////////////////////////////////// Process Section Headers. // pSectionHeaders = (PIMAGE_SECTION_HEADER)RvaToVa(pbBase, nSectionsOffset); //////////////////////////////////////////////////////// Get Import Table. // DWORD rvaImageDirectory = pNtHeader->OptionalHeader .DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress; PIMAGE_IMPORT_DESCRIPTOR iidp = (PIMAGE_IMPORT_DESCRIPTOR)RvaToVa(pbBase, rvaImageDirectory); if (iidp == NULL) { return FALSE; } DWORD nFiles = 0; for (; iidp[nFiles].Characteristics != 0; nFiles++) { // Count the files. } for (DWORD n = 0; n < nFiles; n++, iidp++) { DWORD rvaName = iidp->Name; PCHAR pszName = (PCHAR)RvaToVa(pbBase, rvaName); DWORD rvaThunk = (DWORD)iidp->OriginalFirstThunk; PIMAGE_THUNK_DATA pThunk = (PIMAGE_THUNK_DATA)RvaToVa(pbBase, rvaThunk); rvaThunk = (DWORD)iidp->FirstThunk; PIMAGE_THUNK_DATA pBoundThunk = (PIMAGE_THUNK_DATA)RvaToVa(pbBase, rvaThunk); Syelog(SYELOG_SEVERITY_INFORMATION, "%s [%p %p]\n", pszName, pThunk, pBoundThunk); DWORD nNames = 0; if (pThunk == NULL) { break; } for (; pThunk[nNames].u1.Ordinal; nNames++) { // Count the imports. } for (DWORD f = 0; f < nNames; f++) { DWORD nOrdinal = 0; PCHAR pszName = NULL; PDWORD pFunc = (PDWORD)pBoundThunk[f].u1.Function; DWORD rvaName = (DWORD)pThunk[f].u1.Ordinal; if (rvaName & IMAGE_ORDINAL_FLAG) { nOrdinal = IMAGE_ORDINAL(rvaName); } else { PIMAGE_IMPORT_BY_NAME pName = (PIMAGE_IMPORT_BY_NAME)RvaToVa(pbBase, rvaName); if (pName) { pszName = (PCHAR)pName->Name; } } Syelog(SYELOG_SEVERITY_INFORMATION, " %-32.32s %4I64d %p\n", pszName, nOrdinal, pFunc); } } return TRUE; } #if _MSC_VER >= 1900 #pragma warning(pop) #endif BOOL InstanceEnumerate(HINSTANCE hInst) { WCHAR wzDllName[MAX_PATH]; PIMAGE_NT_HEADERS pinh = NtHeadersForInstance(hInst); if (pinh && Real_GetModuleFileNameW(hInst, wzDllName, ARRAYSIZE(wzDllName))) { Syelog(SYELOG_SEVERITY_INFORMATION, "### %08lx: %-43.43ls %08x\n", hInst, wzDllName, pinh->OptionalHeader.CheckSum); return TRUE; } return FALSE; } BOOL ProcessEnumerate() { Syelog(SYELOG_SEVERITY_INFORMATION, "######################################################### Binaries\n"); for (HINSTANCE hInst = NULL; (hInst = DetourEnumerateModules(hInst)) != NULL;) { InstanceEnumerate(hInst); } Syelog(SYELOG_SEVERITY_INFORMATION, "###\n"); return ImportEnumerate(GetModuleHandle(NULL)); } ////////////////////////////////////////////////////////////////////////////// // // DLL module information // BOOL ThreadAttach(HMODULE hDll) { (void)hDll; if (s_nTlsIndent >= 0) { TlsSetValue(s_nTlsIndent, (PVOID)0); } if (s_nTlsThread >= 0) { LONG nThread = InterlockedIncrement(&s_nThreadCnt); TlsSetValue(s_nTlsThread, (PVOID)(LONG_PTR)nThread); } return TRUE; } BOOL ThreadDetach(HMODULE hDll) { (void)hDll; if (s_nTlsIndent >= 0) { TlsSetValue(s_nTlsIndent, (PVOID)0); } if (s_nTlsThread >= 0) { TlsSetValue(s_nTlsThread, (PVOID)0); } return TRUE; } BOOL ProcessAttach(HMODULE hDll) { s_bLog = FALSE; s_nTlsIndent = TlsAlloc(); s_nTlsThread = TlsAlloc(); ThreadAttach(hDll); WCHAR wzExeName[MAX_PATH]; s_hInst = hDll; Real_GetModuleFileNameW(hDll, s_wzDllPath, ARRAYSIZE(s_wzDllPath)); Real_GetModuleFileNameW(NULL, wzExeName, ARRAYSIZE(wzExeName)); SyelogOpen("trclnk" DETOURS_STRINGIFY(DETOURS_BITS), SYELOG_FACILITY_APPLICATION); ProcessEnumerate(); LONG error = AttachDetours(); if (error != NO_ERROR) { Syelog(SYELOG_SEVERITY_FATAL, "### Error attaching detours: %d\n", error); } s_bLog = TRUE; return TRUE; } BOOL ProcessDetach(HMODULE hDll) { ThreadDetach(hDll); s_bLog = FALSE; LONG error = DetachDetours(); if (error != NO_ERROR) { Syelog(SYELOG_SEVERITY_FATAL, "### Error detaching detours: %d\n", error); } Syelog(SYELOG_SEVERITY_NOTICE, "### Closing.\n"); SyelogClose(FALSE); if (s_nTlsIndent >= 0) { TlsFree(s_nTlsIndent); } if (s_nTlsThread >= 0) { TlsFree(s_nTlsThread); } return TRUE; } BOOL APIENTRY DllMain(HINSTANCE hModule, DWORD dwReason, PVOID lpReserved) { (void)hModule; (void)lpReserved; if (DetourIsHelperProcess()) { return TRUE; } switch (dwReason) { case DLL_PROCESS_ATTACH: DetourRestoreAfterWith(); return ProcessAttach(hModule); case DLL_PROCESS_DETACH: return ProcessDetach(hModule); case DLL_THREAD_ATTACH: return ThreadAttach(hModule); case DLL_THREAD_DETACH: return ThreadDetach(hModule); } return TRUE; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/tracelnk/trclnk.rc ================================================ ////////////////////////////////////////////////////////////////////////////// // // Version information for trclnk.rc. // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include "detver.h" #define VER_INTERNALNAME_STR "trclnk" DETOURS_STRINGIFY(DETOURS_BITS) #define VER_ORIGINALFILENAME_STR "trclnk" DETOURS_STRINGIFY(DETOURS_BITS) ".dll" #define VER_FILEDESCRIPTION_STR "Detours Dynamic Linking Trace Module" #define VER_COMPANYNAME_STR "Microsoft Corporation" #include "common.ver" ================================================ FILE: ext/detours/samples/tracemem/Makefile ================================================ ############################################################################## ## ## Utility to trace HeapAlloc APIs. ## ## Microsoft Research Detours Package ## ## Copyright (c) Microsoft Corporation. All rights reserved. ## !include ..\common.mak LIBS=$(LIBS) kernel32.lib all: dirs \ $(BIND)\trcmem$(DETOURS_BITS).dll \ !IF $(DETOURS_SOURCE_BROWSING)==1 $(OBJD)\trcmem$(DETOURS_BITS).bsc \ !ENDIF option clean: -del *~ test.txt 2>nul -del $(BIND)\trcmem*.* 2>nul -rmdir /q /s $(OBJD) 2>nul dirs: @if not exist $(BIND) mkdir $(BIND) && echo. Created $(BIND) @if not exist $(OBJD) mkdir $(OBJD) && echo. Created $(OBJD) realclean: clean -rmdir /q /s $(OBJDS) 2>nul ############################################################################## $(OBJD)\trcmem.obj : trcmem.cpp $(OBJD)\trcmem.res : trcmem.rc $(BIND)\trcmem$(DETOURS_BITS).dll : $(OBJD)\trcmem.obj $(OBJD)\trcmem.res $(DEPS) cl /LD $(CFLAGS) /Fe$@ /Fd$(@R).pdb \ $(OBJD)\trcmem.obj $(OBJD)\trcmem.res \ /link $(LINKFLAGS) /subsystem:console \ /export:DetourFinishHelperProcess,@1,NONAME \ $(LIBS) $(OBJD)\trcmem$(DETOURS_BITS).bsc : $(OBJD)\trcmem.obj bscmake /v /n /o $@ $(OBJD)\trcmem.sbr ############################################### Install non-bit-size binaries. !IF "$(DETOURS_OPTION_PROCESSOR)" != "" $(OPTD)\trcmem$(DETOURS_OPTION_BITS).dll: $(OPTD)\trcmem$(DETOURS_OPTION_BITS).pdb: $(BIND)\trcmem$(DETOURS_OPTION_BITS).dll : $(OPTD)\trcmem$(DETOURS_OPTION_BITS).dll @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\trcmem$(DETOURS_OPTION_BITS).pdb : $(OPTD)\trcmem$(DETOURS_OPTION_BITS).pdb @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). option: \ $(BIND)\trcmem$(DETOURS_OPTION_BITS).dll \ $(BIND)\trcmem$(DETOURS_OPTION_BITS).pdb \ !ELSE option: !ENDIF ############################################################################## test: all @echo -------- Logging output to test.txt ------------ start $(BIND)\syelogd.exe /o test.txt $(BIND)\sleep5.exe 1 @echo -------- Should load trcmem$(DETOURS_BITS).dll dynamically using withdll.exe ------------ $(BIND)\withdll -d:$(BIND)\trcmem$(DETOURS_BITS).dll $(BIND)\sleepold.exe @echo -------- Log from syelog ------------- type test.txt ################################################################# End of File. ================================================ FILE: ext/detours/samples/tracemem/trcmem.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (trcmem.cpp of trcmem.dll) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #define _WIN32_WINNT 0x0400 #define WIN32 #define NT #define DBG_TRACE 0 #include #include #include "detours.h" #include "syelog.h" #define PULONG_PTR PVOID #define PLONG_PTR PVOID #define ULONG_PTR PVOID #define ENUMRESNAMEPROCA PVOID #define ENUMRESNAMEPROCW PVOID #define ENUMRESLANGPROCA PVOID #define ENUMRESLANGPROCW PVOID #define ENUMRESTYPEPROCA PVOID #define ENUMRESTYPEPROCW PVOID #define STGOPTIONS PVOID ////////////////////////////////////////////////////////////////////////////// #pragma warning(disable:4127) // Many of our asserts are constants. #define ASSERT_ALWAYS(x) \ do { \ if (!(x)) { \ AssertMessage(#x, __FILE__, __LINE__); \ DebugBreak(); \ } \ } while (0) #ifndef NDEBUG #define ASSERT(x) ASSERT_ALWAYS(x) #else #define ASSERT(x) #endif #define UNUSED(c) (c) = (c) ////////////////////////////////////////////////////////////////////////////// static HMODULE s_hInst = NULL; static CHAR s_szDllPath[MAX_PATH]; VOID _PrintEnter(const CHAR *psz, ...); VOID _PrintExit(const CHAR *psz, ...); VOID _Print(const CHAR *psz, ...); VOID _VPrint(PCSTR msg, va_list args, PCHAR pszBuf, LONG cbBuf); VOID AssertMessage(CONST PCHAR pszMsg, CONST PCHAR pszFile, ULONG nLine); ////////////////////////////////////////////////////////////////////////////// // Trampolines // extern "C" { HANDLE (WINAPI * Real_CreateFileW)(LPCWSTR a0, DWORD a1, DWORD a2, LPSECURITY_ATTRIBUTES a3, DWORD a4, DWORD a5, HANDLE a6) = CreateFileW; BOOL (WINAPI * Real_WriteFile)(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped) = WriteFile; BOOL (WINAPI * Real_FlushFileBuffers)(HANDLE hFile) = FlushFileBuffers; BOOL (WINAPI * Real_CloseHandle)(HANDLE hObject) = CloseHandle; BOOL (WINAPI * Real_WaitNamedPipeW)(LPCWSTR lpNamedPipeName, DWORD nTimeOut) = WaitNamedPipeW; BOOL (WINAPI * Real_SetNamedPipeHandleState)(HANDLE hNamedPipe, LPDWORD lpMode, LPDWORD lpMaxCollectionCount, LPDWORD lpCollectDataTimeout) = SetNamedPipeHandleState; DWORD (WINAPI * Real_GetCurrentProcessId)(VOID) = GetCurrentProcessId; VOID (WINAPI * Real_GetSystemTimeAsFileTime)(LPFILETIME lpSystemTimeAsFileTime) = GetSystemTimeAsFileTime; VOID (WINAPI * Real_InitializeCriticalSection)(LPCRITICAL_SECTION lpSection) = InitializeCriticalSection; VOID (WINAPI * Real_EnterCriticalSection)(LPCRITICAL_SECTION lpSection) = EnterCriticalSection; VOID (WINAPI * Real_LeaveCriticalSection)(LPCRITICAL_SECTION lpSection) = LeaveCriticalSection; } #if _MSC_VER < 1300 LPVOID (WINAPI * Real_HeapAlloc)(HANDLE hHeap, DWORD dwFlags, DWORD dwBytes) = HeapAlloc; #else LPVOID (WINAPI * Real_HeapAlloc)(HANDLE hHeap, DWORD dwFlags, DWORD_PTR dwBytes) = HeapAlloc; #endif DWORD (WINAPI * Real_GetModuleFileNameW)(HMODULE a0, LPWSTR a1, DWORD a2) = GetModuleFileNameW; DWORD (WINAPI * Real_GetModuleFileNameA)(HMODULE a0, LPSTR a1, DWORD a2) = GetModuleFileNameA; BOOL (WINAPI * Real_CreateProcessW)(LPCWSTR a0, LPWSTR a1, LPSECURITY_ATTRIBUTES a2, LPSECURITY_ATTRIBUTES a3, BOOL a4, DWORD a5, LPVOID a6, LPCWSTR a7, struct _STARTUPINFOW* a8, LPPROCESS_INFORMATION a9) = CreateProcessW; ////////////////////////////////////////////////////////////////////////////// // Detours // #if _MSC_VER < 1300 LPVOID WINAPI Mine_HeapAlloc(HANDLE hHeap, DWORD dwFlags, DWORD dwBytes) #else LPVOID WINAPI Mine_HeapAlloc(HANDLE hHeap, DWORD dwFlags, DWORD_PTR dwBytes) #endif { _PrintEnter("HeapAlloc(%p, %x, %p))\n", hHeap, dwFlags, dwBytes); LPVOID rv = 0; __try { rv = Real_HeapAlloc(hHeap, dwFlags, dwBytes); } __finally { _PrintExit("HeapAlloc() -> %p\n", rv); }; return rv; } BOOL WINAPI Mine_CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) { _PrintEnter("CreateProcessW(%ls,%ls,%p,%p,%x,%x,%p,%ls,%p,%p)\n", lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation); _Print("Calling DetourCreateProcessWithDllExW(,%hs)\n", s_szDllPath); BOOL rv = 0; __try { rv = DetourCreateProcessWithDllExW(lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation, s_szDllPath, Real_CreateProcessW); } __finally { _PrintExit("CreateProcessW(,,,,,,,,,) -> %x\n", rv); }; return rv; } ////////////////////////////////////////////////////////////////////////////// // AttachDetours // PCHAR DetRealName(PCHAR psz) { PCHAR pszBeg = psz; // Move to end of name. while (*psz) { psz++; } // Move back through A-Za-z0-9 names. while (psz > pszBeg && ((psz[-1] >= 'A' && psz[-1] <= 'Z') || (psz[-1] >= 'a' && psz[-1] <= 'z') || (psz[-1] >= '0' && psz[-1] <= '9'))) { psz--; } return psz; } VOID DetAttach(PVOID *ppbReal, PVOID pbMine, PCHAR psz) { LONG l = DetourAttach(ppbReal, pbMine); if (l != 0) { Syelog(SYELOG_SEVERITY_NOTICE, "Attach failed: `%s': error %d\n", DetRealName(psz), l); } } VOID DetDetach(PVOID *ppbReal, PVOID pbMine, PCHAR psz) { LONG l = DetourDetach(ppbReal, pbMine); if (l != 0) { Syelog(SYELOG_SEVERITY_NOTICE, "Detach failed: `%s': error %d\n", DetRealName(psz), l); } } #define ATTACH(x) DetAttach(&(PVOID&)Real_##x,Mine_##x,#x) #define DETACH(x) DetDetach(&(PVOID&)Real_##x,Mine_##x,#x) LONG AttachDetours(VOID) { DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); ATTACH(CreateProcessW); ATTACH(HeapAlloc); return DetourTransactionCommit(); } LONG DetachDetours(VOID) { DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DETACH(CreateProcessW); DETACH(HeapAlloc); return DetourTransactionCommit(); } ////////////////////////////////////////////////////////////// Logging System. // static BOOL s_bLog = FALSE; static LONG s_nTlsIndent = -1; static LONG s_nTlsThread = -1; static LONG s_nThreadCnt = 0; VOID _PrintEnter(const CHAR *psz, ...) { DWORD dwErr = GetLastError(); LONG nIndent = 0; LONG nThread = 0; if (s_nTlsIndent >= 0) { nIndent = (LONG)(LONG_PTR)TlsGetValue(s_nTlsIndent); TlsSetValue(s_nTlsIndent, (PVOID)(LONG_PTR)(nIndent + 1)); } if (s_nTlsThread >= 0) { nThread = (LONG)(LONG_PTR)TlsGetValue(s_nTlsThread); } if (s_bLog && psz) { CHAR szBuf[1024]; PCHAR pszBuf = szBuf; PCHAR pszEnd = szBuf + ARRAYSIZE(szBuf) - 1; LONG nLen = (nIndent > 0) ? (nIndent < 35 ? nIndent * 2 : 70) : 0; *pszBuf++ = (CHAR)('0' + ((nThread / 100) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 10) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 1) % 10)); *pszBuf++ = ' '; while (nLen-- > 0) { *pszBuf++ = ' '; } va_list args; va_start(args, psz); while ((*pszBuf++ = *psz++) != 0 && pszBuf < pszEnd) { // Copy characters. } *pszEnd = '\0'; SyelogV(SYELOG_SEVERITY_INFORMATION, szBuf, args); va_end(args); } SetLastError(dwErr); } VOID _PrintExit(const CHAR *psz, ...) { DWORD dwErr = GetLastError(); LONG nIndent = 0; LONG nThread = 0; if (s_nTlsIndent >= 0) { nIndent = (LONG)(LONG_PTR)TlsGetValue(s_nTlsIndent) - 1; ASSERT(nIndent >= 0); TlsSetValue(s_nTlsIndent, (PVOID)(LONG_PTR)nIndent); } if (s_nTlsThread >= 0) { nThread = (LONG)(LONG_PTR)TlsGetValue(s_nTlsThread); } if (s_bLog && psz) { CHAR szBuf[1024]; PCHAR pszBuf = szBuf; PCHAR pszEnd = szBuf + ARRAYSIZE(szBuf) - 1; LONG nLen = (nIndent > 0) ? (nIndent < 35 ? nIndent * 2 : 70) : 0; *pszBuf++ = (CHAR)('0' + ((nThread / 100) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 10) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 1) % 10)); *pszBuf++ = ' '; while (nLen-- > 0) { *pszBuf++ = ' '; } va_list args; va_start(args, psz); while ((*pszBuf++ = *psz++) != 0 && pszBuf < pszEnd) { // Copy characters. } *pszEnd = '\0'; SyelogV(SYELOG_SEVERITY_INFORMATION, szBuf, args); va_end(args); } SetLastError(dwErr); } VOID _Print(const CHAR *psz, ...) { DWORD dwErr = GetLastError(); LONG nIndent = 0; LONG nThread = 0; if (s_nTlsIndent >= 0) { nIndent = (LONG)(LONG_PTR)TlsGetValue(s_nTlsIndent); } if (s_nTlsThread >= 0) { nThread = (LONG)(LONG_PTR)TlsGetValue(s_nTlsThread); } if (s_bLog && psz) { CHAR szBuf[1024]; PCHAR pszBuf = szBuf; PCHAR pszEnd = szBuf + ARRAYSIZE(szBuf) - 1; LONG nLen = (nIndent > 0) ? (nIndent < 35 ? nIndent * 2 : 70) : 0; *pszBuf++ = (CHAR)('0' + ((nThread / 100) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 10) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 1) % 10)); *pszBuf++ = ' '; while (nLen-- > 0) { *pszBuf++ = ' '; } va_list args; va_start(args, psz); while ((*pszBuf++ = *psz++) != 0 && pszBuf < pszEnd) { // Copy characters. } *pszEnd = '\0'; SyelogV(SYELOG_SEVERITY_INFORMATION, szBuf, args); va_end(args); } SetLastError(dwErr); } VOID AssertMessage(CONST PCHAR pszMsg, CONST PCHAR pszFile, ULONG nLine) { Syelog(SYELOG_SEVERITY_FATAL, "ASSERT(%s) failed in %s, line %d.\n", pszMsg, pszFile, nLine); } ////////////////////////////////////////////////////////////////////////////// // // DLL module information // BOOL ThreadAttach(HMODULE hDll) { (void)hDll; if (s_nTlsIndent >= 0) { TlsSetValue(s_nTlsIndent, (PVOID)0); } if (s_nTlsThread >= 0) { LONG nThread = InterlockedIncrement(&s_nThreadCnt); TlsSetValue(s_nTlsThread, (PVOID)(LONG_PTR)nThread); } return TRUE; } BOOL ThreadDetach(HMODULE hDll) { (void)hDll; if (s_nTlsIndent >= 0) { TlsSetValue(s_nTlsIndent, (PVOID)0); } if (s_nTlsThread >= 0) { TlsSetValue(s_nTlsThread, (PVOID)0); } return TRUE; } BOOL ProcessAttach(HMODULE hDll) { s_bLog = FALSE; s_nTlsIndent = TlsAlloc(); s_nTlsThread = TlsAlloc(); WCHAR wzExePath[MAX_PATH]; s_hInst = hDll; Real_GetModuleFileNameA(s_hInst, s_szDllPath, ARRAYSIZE(s_szDllPath)); Real_GetModuleFileNameW(NULL, wzExePath, ARRAYSIZE(wzExePath)); SyelogOpen("trcmem" DETOURS_STRINGIFY(DETOURS_BITS), SYELOG_FACILITY_APPLICATION); Syelog(SYELOG_SEVERITY_INFORMATION, "##########################################\n"); Syelog(SYELOG_SEVERITY_INFORMATION, "### %ls\n", wzExePath); LONG error = AttachDetours(); if (error != NO_ERROR) { Syelog(SYELOG_SEVERITY_FATAL, "### Error attaching detours: %d\n", error); } ThreadAttach(hDll); s_bLog = TRUE; return TRUE; } BOOL ProcessDetach(HMODULE hDll) { ThreadDetach(hDll); s_bLog = FALSE; LONG error = DetachDetours(); if (error != NO_ERROR) { Syelog(SYELOG_SEVERITY_FATAL, "### Error detaching detours: %d\n", error); } Syelog(SYELOG_SEVERITY_NOTICE, "### Closing.\n"); SyelogClose(FALSE); if (s_nTlsIndent >= 0) { TlsFree(s_nTlsIndent); } if (s_nTlsThread >= 0) { TlsFree(s_nTlsThread); } return TRUE; } BOOL APIENTRY DllMain(HINSTANCE hModule, DWORD dwReason, PVOID lpReserved) { (void)hModule; (void)lpReserved; if (DetourIsHelperProcess()) { return TRUE; } switch (dwReason) { case DLL_PROCESS_ATTACH: DetourRestoreAfterWith(); return ProcessAttach(hModule); case DLL_PROCESS_DETACH: return ProcessDetach(hModule); case DLL_THREAD_ATTACH: return ThreadAttach(hModule); case DLL_THREAD_DETACH: return ThreadDetach(hModule); } return TRUE; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/tracemem/trcmem.rc ================================================ ////////////////////////////////////////////////////////////////////////////// // // Version information for trcmem.rc. // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include "detver.h" #define VER_INTERNALNAME_STR "trcmem" DETOURS_STRINGIFY(DETOURS_BITS) #define VER_ORIGINALFILENAME_STR "trcmem" DETOURS_STRINGIFY(DETOURS_BITS) ".dll" #define VER_FILEDESCRIPTION_STR "Detours Memory Trace Module" #define VER_COMPANYNAME_STR "Microsoft Corporation" #include "common.ver" ================================================ FILE: ext/detours/samples/tracereg/Makefile ================================================ ############################################################################## ## ## Utility to registry and file access APIs. ## ## Microsoft Research Detours Package ## ## Copyright (c) Microsoft Corporation. All rights reserved. ## !include ..\common.mak LIBS=$(LIBS) kernel32.lib advapi32.lib all: dirs \ $(BIND)\trcreg$(DETOURS_BITS).dll \ !IF $(DETOURS_SOURCE_BROWSING)==1 $(OBJD)\trcreg$(DETOURS_BITS).bsc \ !ENDIF option dirs: @if not exist $(BIND) mkdir $(BIND) && echo. Created $(BIND) @if not exist $(OBJD) mkdir $(OBJD) && echo. Created $(OBJD) clean: -del *~ test.txt 2>nul -del $(BIND)\trcreg*.* 2>nul -rmdir /q /s $(OBJD) 2>nul realclean: clean -rmdir /q /s $(OBJDS) 2>nul ############################################################################## $(OBJD)\trcreg.obj : trcreg.cpp $(OBJD)\trcreg.res : trcreg.rc $(BIND)\trcreg$(DETOURS_BITS).dll : $(OBJD)\trcreg.obj $(OBJD)\trcreg.res $(DEPS) cl /LD $(CFLAGS) /Fe$@ /Fd$(@R).pdb \ $(OBJD)\trcreg.obj $(OBJD)\trcreg.res \ /link $(LINKFLAGS) /subsystem:console \ /export:DetourFinishHelperProcess,@1,NONAME \ $(LIBS) $(OBJD)\trcreg$(DETOURS_BITS).bsc : $(OBJD)\trcreg.obj bscmake /v /n /o $@ $(OBJD)\trcreg.sbr ############################################### Install non-bit-size binaries. !IF "$(DETOURS_OPTION_PROCESSOR)" != "" $(OPTD)\trcreg$(DETOURS_OPTION_BITS).dll: $(OPTD)\trcreg$(DETOURS_OPTION_BITS).pdb: $(BIND)\trcreg$(DETOURS_OPTION_BITS).dll : $(OPTD)\trcreg$(DETOURS_OPTION_BITS).dll @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\trcreg$(DETOURS_OPTION_BITS).pdb : $(OPTD)\trcreg$(DETOURS_OPTION_BITS).pdb @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). option: \ $(BIND)\trcreg$(DETOURS_OPTION_BITS).dll \ $(BIND)\trcreg$(DETOURS_OPTION_BITS).pdb \ !ELSE option: !ENDIF ############################################################################## test: all @echo -------- Logging output to test.txt ------------ start $(BIND)\syelogd.exe /o test.txt $(BIND)\sleep5.exe 1 @echo -------- Should load trcreg$(DETOURS_BITS).dll dynamically using withdll.exe ------------ $(BIND)\withdll -d:$(BIND)\trcreg$(DETOURS_BITS).dll $(BIND)\sleepold.exe @echo -------- Log from syelog ------------- type test.txt ################################################################# End of File. ================================================ FILE: ext/detours/samples/tracereg/trcreg.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (trcreg.cpp of trcreg.dll) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #define _WIN32_WINNT 0x0400 #define WIN32 #define NT #define DBG_TRACE 0 #include #include #include "detours.h" #include "syelog.h" #define PULONG_PTR PVOID #define PLONG_PTR PVOID #define ULONG_PTR PVOID #define ENUMRESNAMEPROCA PVOID #define ENUMRESNAMEPROCW PVOID #define ENUMRESLANGPROCA PVOID #define ENUMRESLANGPROCW PVOID #define ENUMRESTYPEPROCA PVOID #define ENUMRESTYPEPROCW PVOID #define STGOPTIONS PVOID ////////////////////////////////////////////////////////////////////////////// #pragma warning(disable:4127) // Many of our asserts are constants. #define ASSERT_ALWAYS(x) \ do { \ if (!(x)) { \ AssertMessage(#x, __FILE__, __LINE__); \ DebugBreak(); \ } \ } while (0) #ifndef NDEBUG #define ASSERT(x) ASSERT_ALWAYS(x) #else #define ASSERT(x) #endif #define UNUSED(c) (c) = (c) ////////////////////////////////////////////////////////////////////////////// static HMODULE s_hInst = NULL; static CHAR s_szDllPath[MAX_PATH]; BOOL ProcessEnumerate(); BOOL InstanceEnumerate(HINSTANCE hInst); VOID _PrintEnter(PCSTR psz, ...); VOID _PrintExit(PCSTR psz, ...); VOID _Print(PCSTR psz, ...); VOID AssertMessage(CONST PCHAR pszMsg, CONST PCHAR pszFile, ULONG nLine); ////////////////////////////////////////////////////////////////////////////// // extern "C" { HANDLE (WINAPI * Real_CreateFileW)(LPCWSTR a0, DWORD a1, DWORD a2, LPSECURITY_ATTRIBUTES a3, DWORD a4, DWORD a5, HANDLE a6) = CreateFileW; BOOL (WINAPI * Real_WriteFile)(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped) = WriteFile; BOOL (WINAPI * Real_FlushFileBuffers)(HANDLE hFile) = FlushFileBuffers; BOOL (WINAPI * Real_CloseHandle)(HANDLE hObject) = CloseHandle; BOOL (WINAPI * Real_WaitNamedPipeW)(LPCWSTR lpNamedPipeName, DWORD nTimeOut) = WaitNamedPipeW; BOOL (WINAPI * Real_SetNamedPipeHandleState)(HANDLE hNamedPipe, LPDWORD lpMode, LPDWORD lpMaxCollectionCount, LPDWORD lpCollectDataTimeout) = SetNamedPipeHandleState; DWORD (WINAPI * Real_GetCurrentProcessId)(VOID) = GetCurrentProcessId; VOID (WINAPI * Real_GetSystemTimeAsFileTime)(LPFILETIME lpSystemTimeAsFileTime) = GetSystemTimeAsFileTime; VOID (WINAPI * Real_InitializeCriticalSection)(LPCRITICAL_SECTION lpSection) = InitializeCriticalSection; VOID (WINAPI * Real_EnterCriticalSection)(LPCRITICAL_SECTION lpSection) = EnterCriticalSection; VOID (WINAPI * Real_LeaveCriticalSection)(LPCRITICAL_SECTION lpSection) = LeaveCriticalSection; } ////////////////////////////////////////////////////////////////////////////// // BOOL (WINAPI * Real_CopyFileExA)(LPCSTR a0, LPCSTR a1, LPPROGRESS_ROUTINE a2, LPVOID a3, LPBOOL a4, DWORD a5) = CopyFileExA; BOOL (WINAPI * Real_CopyFileExW)(LPCWSTR a0, LPCWSTR a1, LPPROGRESS_ROUTINE a2, LPVOID a3, LPBOOL a4, DWORD a5) = CopyFileExW; BOOL (WINAPI * Real_CreateDirectoryExW)(LPCWSTR a0, LPCWSTR a1, LPSECURITY_ATTRIBUTES a2) = CreateDirectoryExW; BOOL (WINAPI * Real_CreateDirectoryW)(LPCWSTR a0, LPSECURITY_ATTRIBUTES a1) = CreateDirectoryW; BOOL (WINAPI * Real_CreateProcessW)(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) = CreateProcessW; BOOL (WINAPI * Real_DeleteFileA)(LPCSTR a0) = DeleteFileA; BOOL (WINAPI * Real_DeleteFileW)(LPCWSTR a0) = DeleteFileW; HANDLE (WINAPI * Real_FindFirstFileExA)(LPCSTR a0, FINDEX_INFO_LEVELS a1, LPVOID a2, FINDEX_SEARCH_OPS a3, LPVOID a4, DWORD a5) = FindFirstFileExA; HANDLE (WINAPI * Real_FindFirstFileExW)(LPCWSTR a0, FINDEX_INFO_LEVELS a1, LPVOID a2, FINDEX_SEARCH_OPS a3, LPVOID a4, DWORD a5) = FindFirstFileExW; DWORD (WINAPI * Real_GetFileAttributesW)(LPCWSTR a0) = GetFileAttributesW; DWORD (WINAPI * Real_GetModuleFileNameW)(HMODULE a0, LPWSTR a1, DWORD a2) = GetModuleFileNameW; DWORD (WINAPI * Real_GetModuleFileNameA)(HMODULE a0, LPSTR a1, DWORD a2) = GetModuleFileNameA; FARPROC (WINAPI * Real_GetProcAddress)(struct HINSTANCE__* a0, LPCSTR a1) = GetProcAddress; HMODULE (WINAPI * Real_LoadLibraryExW)(LPCWSTR a0, HANDLE a1, DWORD a2) = LoadLibraryExW; BOOL (WINAPI * Real_MoveFileA)(LPCSTR a0, LPCSTR a1) = MoveFileA; BOOL (WINAPI * Real_MoveFileExA)(LPCSTR a0, LPCSTR a1, DWORD a2) = MoveFileExA; BOOL (WINAPI * Real_MoveFileExW)(LPCWSTR a0, LPCWSTR a1, DWORD a2) = MoveFileExW; BOOL (WINAPI * Real_MoveFileW)(LPCWSTR a0, LPCWSTR a1) = MoveFileW; HFILE (WINAPI * Real_OpenFile)(LPCSTR a0, struct _OFSTRUCT* a1, UINT a2) = OpenFile; LONG (WINAPI * Real_RegCreateKeyExA)(HKEY a0, LPCSTR a1, DWORD a2, LPSTR a3, DWORD a4, REGSAM a5, LPSECURITY_ATTRIBUTES a6, PHKEY a7, LPDWORD a8) = RegCreateKeyExA; LONG (WINAPI * Real_RegCreateKeyExW)(HKEY a0, LPCWSTR a1, DWORD a2, LPWSTR a3, DWORD a4, REGSAM a5, LPSECURITY_ATTRIBUTES a6, PHKEY a7, LPDWORD a8) = RegCreateKeyExW; LONG (WINAPI * Real_RegDeleteKeyA)(HKEY a0, LPCSTR a1) = RegDeleteKeyA; LONG (WINAPI * Real_RegDeleteKeyW)(HKEY a0, LPCWSTR a1) = RegDeleteKeyW; LONG (WINAPI * Real_RegDeleteValueA)(HKEY a0, LPCSTR a1) = RegDeleteValueA; LONG (WINAPI * Real_RegDeleteValueW)(HKEY a0, LPCWSTR a1) = RegDeleteValueW; LONG (WINAPI * Real_RegEnumKeyExA)(HKEY a0, DWORD a1, LPSTR a2, LPDWORD a3, LPDWORD a4, LPSTR a5, LPDWORD a6, struct _FILETIME* a7) = RegEnumKeyExA; LONG (WINAPI * Real_RegEnumKeyExW)(HKEY a0, DWORD a1, LPWSTR a2, LPDWORD a3, LPDWORD a4, LPWSTR a5, LPDWORD a6, struct _FILETIME* a7) = RegEnumKeyExW; LONG (WINAPI * Real_RegEnumValueA)(HKEY a0, DWORD a1, LPSTR a2, LPDWORD a3, LPDWORD a4, LPDWORD a5, LPBYTE a6, LPDWORD a7) = RegEnumValueA; LONG (WINAPI * Real_RegEnumValueW)(HKEY a0, DWORD a1, LPWSTR a2, LPDWORD a3, LPDWORD a4, LPDWORD a5, LPBYTE a6, LPDWORD a7) = RegEnumValueW; LONG (WINAPI * Real_RegOpenKeyExA)(HKEY a0, LPCSTR a1, DWORD a2, REGSAM a3, PHKEY a4) = RegOpenKeyExA; LONG (WINAPI * Real_RegOpenKeyExW)(HKEY a0, LPCWSTR a1, DWORD a2, REGSAM a3, PHKEY a4) = RegOpenKeyExW; LONG (WINAPI * Real_RegQueryInfoKeyA)(HKEY a0, LPSTR a1, LPDWORD a2, LPDWORD a3, LPDWORD a4, LPDWORD a5, LPDWORD a6, LPDWORD a7, LPDWORD a8, LPDWORD a9, LPDWORD a10, struct _FILETIME* a11) = RegQueryInfoKeyA; LONG (WINAPI * Real_RegQueryInfoKeyW)(HKEY a0, LPWSTR a1, LPDWORD a2, LPDWORD a3, LPDWORD a4, LPDWORD a5, LPDWORD a6, LPDWORD a7, LPDWORD a8, LPDWORD a9, LPDWORD a10, struct _FILETIME* a11) = RegQueryInfoKeyW; LONG (WINAPI * Real_RegQueryValueExA)(HKEY a0, LPCSTR a1, LPDWORD a2, LPDWORD a3, LPBYTE a4, LPDWORD a5) = RegQueryValueExA; LONG (WINAPI * Real_RegQueryValueExW)(HKEY a0, LPCWSTR a1, LPDWORD a2, LPDWORD a3, LPBYTE a4, LPDWORD a5) = RegQueryValueExW; LONG (WINAPI * Real_RegSetValueExA)(HKEY a0, LPCSTR a1, DWORD a2, DWORD a3, const BYTE* a4, DWORD a5) = RegSetValueExA; LONG (WINAPI * Real_RegSetValueExW)(HKEY a0, LPCWSTR a1, DWORD a2, DWORD a3, const BYTE* a4, DWORD a5) = RegSetValueExW; HFILE (WINAPI * Real__lcreat)(LPCSTR a0, int a1) = _lcreat; HFILE (WINAPI * Real__lopen)(LPCSTR a0, int a1) = _lopen; ///////////////////////////////////////////////////////////// // Detours // BOOL WINAPI Mine_WaitNamedPipeW(LPCWSTR lpNamedPipeName, DWORD nTimeOut) { return Real_WaitNamedPipeW(lpNamedPipeName, nTimeOut); } BOOL WINAPI Mine_CloseHandle(HANDLE hObject) { return Real_CloseHandle(hObject); } VOID WINAPI Mine_GetSystemTimeAsFileTime(LPFILETIME lpSystemTimeAsFileTime) { Real_GetSystemTimeAsFileTime(lpSystemTimeAsFileTime); } BOOL WINAPI Mine_SetNamedPipeHandleState(HANDLE hNamedPipe, LPDWORD lpMode, LPDWORD lpMaxCollectionCount, LPDWORD lpCollectDataTimeout) { return Real_SetNamedPipeHandleState(hNamedPipe, lpMode, lpMaxCollectionCount, lpCollectDataTimeout); } BOOL WINAPI Mine_WriteFile(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped) { return Real_WriteFile(hFile, lpBuffer, nNumberOfBytesToWrite, lpNumberOfBytesWritten, lpOverlapped); } BOOL WINAPI Mine_CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) { _PrintEnter("CreateProcessW(%ls,%ls,%p,%p,%x,%x,%p,%ls,%p,%p)\n", lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation); _Print("Calling DetourCreateProcessWithDllExW(,%hs)\n", s_szDllPath); BOOL rv = 0; __try { rv = DetourCreateProcessWithDllExW(lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation, s_szDllPath, Real_CreateProcessW); } __finally { _PrintExit("CreateProcessW(,,,,,,,,,) -> %x\n", rv); }; return rv; } // ////////////////////////////////////////////////////////////////////////////// BOOL WINAPI Mine_CopyFileExA(LPCSTR a0, LPCSTR a1, LPPROGRESS_ROUTINE a2, LPVOID a3, LPBOOL a4, DWORD a5) { _PrintEnter("CopyFileExA(%hs,%hs,%p,%p,%p,%x)\n", a0, a1, a2, a3, a4, a5); BOOL rv = 0; __try { rv = Real_CopyFileExA(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("CopyFileExA(,,,,,) -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_CopyFileExW(LPCWSTR a0, LPCWSTR a1, LPPROGRESS_ROUTINE a2, LPVOID a3, LPBOOL a4, DWORD a5) { _PrintEnter("CopyFileExW(%ls,%ls,%p,%p,%p,%x)\n", a0, a1, a2, a3, a4, a5); BOOL rv = 0; __try { rv = Real_CopyFileExW(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("CopyFileExW(,,,,,) -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_CreateDirectoryExW(LPCWSTR a0, LPCWSTR a1, LPSECURITY_ATTRIBUTES a2) { _PrintEnter("CreateDirectoryExW(%ls,%ls,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_CreateDirectoryExW(a0, a1, a2); } __finally { _PrintExit("CreateDirectoryExW(,,) -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_CreateDirectoryW(LPCWSTR a0, LPSECURITY_ATTRIBUTES a1) { _PrintEnter("CreateDirectoryW(%ls,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_CreateDirectoryW(a0, a1); } __finally { _PrintExit("CreateDirectoryW(,) -> %x\n", rv); }; return rv; } HANDLE WINAPI Mine_CreateFileW(LPCWSTR a0, DWORD a1, DWORD a2, LPSECURITY_ATTRIBUTES a3, DWORD a4, DWORD a5, HANDLE a6) { _PrintEnter(NULL); HANDLE rv = 0; __try { rv = Real_CreateFileW(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("CreateFileW(%ls,%x,%x,%p,%x,%x,%p) -> %p\n", a0, a1, a2, a3, a4, a5, a6, rv); }; return rv; } BOOL WINAPI Mine_DeleteFileA(LPCSTR a0) { _PrintEnter("DeleteFileA(%hs)\n", a0); BOOL rv = 0; __try { rv = Real_DeleteFileA(a0); } __finally { _PrintExit("DeleteFileA() -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_DeleteFileW(LPCWSTR a0) { _PrintEnter("DeleteFileW(%ls)\n", a0); BOOL rv = 0; __try { rv = Real_DeleteFileW(a0); } __finally { _PrintExit("DeleteFileW() -> %x\n", rv); }; return rv; } HANDLE WINAPI Mine_FindFirstFileExA(LPCSTR a0, FINDEX_INFO_LEVELS a1, LPVOID a2, FINDEX_SEARCH_OPS a3, LPVOID a4, DWORD a5) { _PrintEnter("FindFirstFileExA(%hs,%p,%p,%x,%p,%x)\n", a0, a1, a2, a3, a4, a5); HANDLE rv = 0; __try { rv = Real_FindFirstFileExA(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("FindFirstFileExA(,,,,,) -> %p\n", rv); }; return rv; } HANDLE WINAPI Mine_FindFirstFileExW(LPCWSTR a0, FINDEX_INFO_LEVELS a1, LPVOID a2, FINDEX_SEARCH_OPS a3, LPVOID a4, DWORD a5) { _PrintEnter(NULL); HANDLE rv = 0; __try { rv = Real_FindFirstFileExW(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("FindFirstFileExW(%ls,%x,%p,%x,%p,%x) -> %p\n", a0, a1, a2, a3, a4, a5, rv); }; return rv; } DWORD WINAPI Mine_GetFileAttributesW(LPCWSTR a0) { _PrintEnter(NULL); DWORD rv = 0; __try { rv = Real_GetFileAttributesW(a0); } __finally { _PrintExit("GetFileAttributesW(%ls) -> %x\n", a0, rv); }; return rv; } DWORD WINAPI Mine_GetModuleFileNameW(HMODULE a0, LPWSTR a1, DWORD a2) { _PrintEnter("GetModuleFileNameW(%p,%p,%x)\n", a0, a1, a2); DWORD rv = 0; __try { rv = Real_GetModuleFileNameW(a0, a1, a2); } __finally { _PrintExit("GetModuleFileNameW(%p,%p:%ls,%p) -> %p\n", a0, a1, a1, a2, rv); }; return rv; } FARPROC WINAPI Mine_GetProcAddress(HINSTANCE a0, LPCSTR a1) { WCHAR wzModule[MAX_PATH] = L""; PWCHAR pwzModule = wzModule; if (Real_GetModuleFileNameW(a0, wzModule, ARRAYSIZE(wzModule)) != 0) { if ((pwzModule = wcsrchr(wzModule, '\\')) == NULL) { if ((pwzModule = wcsrchr(wzModule, ':')) == NULL) { pwzModule = wzModule; } else { pwzModule++; // Skip ':' } } else { pwzModule++; // Skip '\\' } } else { wzModule[0] = '\0'; } _PrintEnter(NULL); FARPROC rv = 0; __try { rv = Real_GetProcAddress(a0, a1); } __finally { if (pwzModule[0] == 0) { _PrintExit("GetProcAddress(%p,%hs) -> %p\n", a0, a1, rv); } else { _PrintExit("GetProcAddress(%p:%ls,%hs) -> %p\n", a0, pwzModule, a1, rv); } }; return rv; } HMODULE WINAPI Mine_LoadLibraryExW(LPCWSTR a0, HANDLE a1, DWORD a2) { _PrintEnter("LoadLibraryExW(%ls,%p,%x)\n", a0, a1, a2); HMODULE rv = 0; __try { rv = Real_LoadLibraryExW(a0, a1, a2); } __finally { _PrintExit("LoadLibraryExW(,,) -> %p\n", rv); if (rv) { InstanceEnumerate(rv); } }; return rv; } BOOL WINAPI Mine_MoveFileA(LPCSTR a0, LPCSTR a1) { _PrintEnter("MoveFileA(%hs,%hs)\n", a0, a1); BOOL rv = 0; __try { rv = Real_MoveFileA(a0, a1); } __finally { _PrintExit("MoveFileA(,) -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_MoveFileExA(LPCSTR a0, LPCSTR a1, DWORD a2) { _PrintEnter("MoveFileExA(%hs,%hs,%x)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_MoveFileExA(a0, a1, a2); } __finally { _PrintExit("MoveFileExA(,,) -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_MoveFileExW(LPCWSTR a0, LPCWSTR a1, DWORD a2) { _PrintEnter("MoveFileExW(%ls,%ls,%x)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_MoveFileExW(a0, a1, a2); } __finally { _PrintExit("MoveFileExW(,,) -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_MoveFileW(LPCWSTR a0, LPCWSTR a1) { _PrintEnter("MoveFileW(%ls,%ls)\n", a0, a1); BOOL rv = 0; __try { rv = Real_MoveFileW(a0, a1); } __finally { _PrintExit("MoveFileW(,) -> %x\n", rv); }; return rv; } HFILE WINAPI Mine_OpenFile(LPCSTR a0, LPOFSTRUCT a1, UINT a2) { _PrintEnter("OpenFile(%hs,%p,%x)\n", a0, a1, a2); HFILE rv = 0; __try { rv = Real_OpenFile(a0, a1, a2); } __finally { _PrintExit("OpenFile(,,) -> %p\n", rv); }; return rv; } LONG WINAPI Mine_RegCreateKeyExA(HKEY a0, LPCSTR a1, DWORD a2, LPSTR a3, DWORD a4, REGSAM a5, LPSECURITY_ATTRIBUTES a6, PHKEY a7, LPDWORD a8) { _PrintEnter("RegCreateKeyExA(%p,%hs,%x,%hs,%x,%x,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8); LONG rv = 0; __try { rv = Real_RegCreateKeyExA(a0, a1, a2, a3, a4, a5, a6, a7, a8); } __finally { _PrintExit("RegCreateKeyExA(,,,,,,,,) -> %x\n", rv); }; return rv; } LONG WINAPI Mine_RegCreateKeyExW(HKEY a0, LPCWSTR a1, DWORD a2, LPWSTR a3, DWORD a4, REGSAM a5, LPSECURITY_ATTRIBUTES a6, PHKEY a7, LPDWORD a8) { _PrintEnter(NULL); LONG rv = 0; __try { rv = Real_RegCreateKeyExW(a0, a1, a2, a3, a4, a5, a6, a7, a8); } __finally { _PrintExit("RegCreateKeyExW(%p,%ls,%x,%ls,%x,%x,%p,%p,%p) -> %x\n", a0, a1, a2, a3, a4, a5, a6, a7, a8, rv); }; return rv; } LONG WINAPI Mine_RegDeleteKeyA(HKEY a0, LPCSTR a1) { _PrintEnter(NULL); LONG rv = 0; __try { rv = Real_RegDeleteKeyA(a0, a1); } __finally { _PrintExit("RegDeleteKeyA(%p,%hs) -> %x\n", a0, a1, rv); }; return rv; } LONG WINAPI Mine_RegDeleteKeyW(HKEY a0, LPCWSTR a1) { _PrintEnter(NULL); LONG rv = 0; __try { rv = Real_RegDeleteKeyW(a0, a1); } __finally { _PrintExit("RegDeleteKeyW(%p,%ls) -> %x\n", a0, a1, rv); }; return rv; } LONG WINAPI Mine_RegDeleteValueA(HKEY a0, LPCSTR a1) { _PrintEnter("RegDeleteValueA(%p,%hs)\n", a0, a1); LONG rv = 0; __try { rv = Real_RegDeleteValueA(a0, a1); } __finally { _PrintExit("RegDeleteValueA(,) -> %x\n", rv); }; return rv; } LONG WINAPI Mine_RegDeleteValueW(HKEY a0, LPCWSTR a1) { _PrintEnter("RegDeleteValueW(%p,%ls)\n", a0, a1); LONG rv = 0; __try { rv = Real_RegDeleteValueW(a0, a1); } __finally { _PrintExit("RegDeleteValueW(,) -> %x\n", rv); }; return rv; } LONG WINAPI Mine_RegEnumKeyExA(HKEY a0, DWORD a1, LPSTR a2, LPDWORD a3, LPDWORD a4, LPSTR a5, LPDWORD a6, LPFILETIME a7) { _PrintEnter("RegEnumKeyExA(%p,%x,%p,%p,%p,%hs,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7); LONG rv = 0; __try { rv = Real_RegEnumKeyExA(a0, a1, a2, a3, a4, a5, a6, a7); } __finally { _PrintExit("RegEnumKeyExA(,,%hs,,,%hs,,) -> %x\n", a2, a5, rv); }; return rv; } LONG WINAPI Mine_RegEnumKeyExW(HKEY a0, DWORD a1, LPWSTR a2, LPDWORD a3, LPDWORD a4, LPWSTR a5, LPDWORD a6, struct _FILETIME* a7) { _PrintEnter("RegEnumKeyExW(%p,%x,%p,%p,%p,%ls,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7); LONG rv = 0; __try { rv = Real_RegEnumKeyExW(a0, a1, a2, a3, a4, a5, a6, a7); } __finally { _PrintExit("RegEnumKeyExW(,,%ls,,,%ls,,) -> %x\n", a2, a5, rv); }; return rv; } LONG WINAPI Mine_RegEnumValueA(HKEY a0, DWORD a1, LPSTR a2, LPDWORD a3, LPDWORD a4, LPDWORD a5, LPBYTE a6, LPDWORD a7) { _PrintEnter("RegEnumValueA(%p,%x,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7); LONG rv = 0; __try { rv = Real_RegEnumValueA(a0, a1, a2, a3, a4, a5, a6, a7); } __finally { _PrintExit("RegEnumValueA(,,%hs,,,,,) -> %x\n", a2, rv); }; return rv; } LONG WINAPI Mine_RegEnumValueW(HKEY a0, DWORD a1, LPWSTR a2, LPDWORD a3, LPDWORD a4, LPDWORD a5, LPBYTE a6, LPDWORD a7) { _PrintEnter("RegEnumValueW(%p,%x,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7); LONG rv = 0; __try { rv = Real_RegEnumValueW(a0, a1, a2, a3, a4, a5, a6, a7); } __finally { _PrintExit("RegEnumValueW(,,%ls,,,,,) -> %x\n", a2, rv); }; return rv; } LONG WINAPI Mine_RegOpenKeyExA(HKEY a0, LPCSTR a1, DWORD a2, REGSAM a3, PHKEY a4) { _PrintEnter(NULL); LONG rv = 0; __try { rv = Real_RegOpenKeyExA(a0, a1, a2, a3, a4); } __finally { _PrintExit("RegOpenKeyExA(%p,%hs,%x,%x,%p) -> %x\n", a0, a1, a2, a3, a4, rv); }; return rv; } LONG WINAPI Mine_RegOpenKeyExW(HKEY a0, LPCWSTR a1, DWORD a2, REGSAM a3, PHKEY a4) { _PrintEnter(NULL); LONG rv = 0; __try { rv = Real_RegOpenKeyExW(a0, a1, a2, a3, a4); } __finally { _PrintExit("RegOpenKeyExW(%p,%ls,%x,%x,%p) -> %x\n", a0, a1, a2, a3, a4, rv); }; return rv; } LONG WINAPI Mine_RegQueryInfoKeyA(HKEY a0, LPSTR a1, LPDWORD a2, LPDWORD a3, LPDWORD a4, LPDWORD a5, LPDWORD a6, LPDWORD a7, LPDWORD a8, LPDWORD a9, LPDWORD a10, LPFILETIME a11) { _PrintEnter("RegQueryInfoKeyA(%p,%p,%p,%p,%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); LONG rv = 0; __try { rv = Real_RegQueryInfoKeyA(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); } __finally { _PrintExit("RegQueryInfoKeyA(,%hs,,,,,,,,,,) -> %x\n", a1, rv); }; return rv; } LONG WINAPI Mine_RegQueryInfoKeyW(HKEY a0, LPWSTR a1, LPDWORD a2, LPDWORD a3, LPDWORD a4, LPDWORD a5, LPDWORD a6, LPDWORD a7, LPDWORD a8, LPDWORD a9, LPDWORD a10, LPFILETIME a11) { _PrintEnter("RegQueryInfoKeyW(%p,%p,%p,%p,%p,%p,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); LONG rv = 0; __try { rv = Real_RegQueryInfoKeyW(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); } __finally { _PrintExit("RegQueryInfoKeyW(,%ls,,,,,,,,,,) -> %x\n", a1, rv); }; return rv; } LONG WINAPI Mine_RegQueryValueExA(HKEY a0, LPCSTR a1, LPDWORD a2, LPDWORD a3, LPBYTE a4, LPDWORD a5) { _PrintEnter(NULL); LONG rv = 0; __try { rv = Real_RegQueryValueExA(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("RegQueryValueExA(%p,%hs,%p,%p,%p,%p) -> %x\n", a0, a1, a2, a3, a4, a5, rv); }; return rv; } LONG WINAPI Mine_RegQueryValueExW(HKEY a0, LPCWSTR a1, LPDWORD a2, LPDWORD a3, LPBYTE a4, LPDWORD a5) { _PrintEnter(NULL); LONG rv = 0; __try { rv = Real_RegQueryValueExW(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("RegQueryValueExW(%p,%ls,%p,%p,%p,%p) -> %x\n", a0, a1, a2, a3, a4, a5, rv); }; return rv; } LONG WINAPI Mine_RegSetValueExA(HKEY a0, LPCSTR a1, DWORD a2, DWORD a3, BYTE* a4, DWORD a5) { _PrintEnter(NULL); LONG rv = 0; __try { rv = Real_RegSetValueExA(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("RegSetValueExA(%p,%hs,%x,%x,%p,%x) -> %x\n", a0, a1, a2, a3, a4, a5, rv); }; return rv; } LONG WINAPI Mine_RegSetValueExW(HKEY a0, LPCWSTR a1, DWORD a2, DWORD a3, BYTE* a4, DWORD a5) { _PrintEnter(NULL); LONG rv = 0; __try { rv = Real_RegSetValueExW(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("RegSetValueExW(%p,%ls,%x,%x,%p,%x) -> %x\n", a0, a1, a2, a3, a4, a5, rv); }; return rv; } HFILE WINAPI Mine__lcreat(LPCSTR a0, int a1) { _PrintEnter(NULL); HFILE rv = 0; __try { rv = Real__lcreat(a0, a1); } __finally { _PrintExit("_lcreat(%hs,%x) -> %p\n", a0, a1, rv); }; return rv; } HFILE WINAPI Mine__lopen(LPCSTR a0, int a1) { _PrintEnter(NULL); HFILE rv = 0; __try { rv = Real__lopen(a0, a1); } __finally { _PrintEnter("_lopen(%hs,%x) -> %p\n", a0, a1, rv); }; return rv; } ///////////////////////////////////////////////////////////// // AttachDetours // PCHAR DetRealName(PCHAR psz) { PCHAR pszBeg = psz; // Move to end of name. while (*psz) { psz++; } // Move back through A-Za-z0-9 names. while (psz > pszBeg && ((psz[-1] >= 'A' && psz[-1] <= 'Z') || (psz[-1] >= 'a' && psz[-1] <= 'z') || (psz[-1] >= '0' && psz[-1] <= '9'))) { psz--; } return psz; } VOID DetAttach(PVOID *ppbReal, PVOID pbMine, PCHAR psz) { LONG l = DetourAttach(ppbReal, pbMine); if (l != 0) { Syelog(SYELOG_SEVERITY_NOTICE, "Attach failed: `%s': error %d\n", DetRealName(psz), l); } } VOID DetDetach(PVOID *ppbReal, PVOID pbMine, PCHAR psz) { LONG l = DetourDetach(ppbReal, pbMine); if (l != 0) { Syelog(SYELOG_SEVERITY_NOTICE, "Detach failed: `%s': error %d\n", DetRealName(psz), l); } } #define ATTACH(x) DetAttach(&(PVOID&)Real_##x,Mine_##x,#x) #define DETACH(x) DetDetach(&(PVOID&)Real_##x,Mine_##x,#x) LONG AttachDetours(VOID) { DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); ATTACH(CloseHandle); ATTACH(CopyFileExA); ATTACH(CopyFileExW); ATTACH(CreateDirectoryExW); ATTACH(CreateDirectoryW); ATTACH(CreateFileW); ATTACH(CreateProcessW); ATTACH(DeleteFileA); ATTACH(DeleteFileW); ATTACH(FindFirstFileExA); ATTACH(FindFirstFileExW); ATTACH(GetFileAttributesW); ATTACH(GetModuleFileNameW); ATTACH(GetProcAddress); ATTACH(GetSystemTimeAsFileTime); ATTACH(LoadLibraryExW); ATTACH(MoveFileA); ATTACH(MoveFileExA); ATTACH(MoveFileExW); ATTACH(MoveFileW); ATTACH(OpenFile); ATTACH(RegCreateKeyExA); ATTACH(RegCreateKeyExW); ATTACH(RegDeleteKeyA); ATTACH(RegDeleteKeyW); ATTACH(RegDeleteValueA); ATTACH(RegDeleteValueW); ATTACH(RegEnumKeyExA); ATTACH(RegEnumKeyExW); ATTACH(RegEnumValueA); ATTACH(RegEnumValueW); ATTACH(RegOpenKeyExA); ATTACH(RegOpenKeyExW); ATTACH(RegQueryInfoKeyA); ATTACH(RegQueryInfoKeyW); ATTACH(RegQueryValueExA); ATTACH(RegQueryValueExW); ATTACH(RegSetValueExA); ATTACH(RegSetValueExW); ATTACH(SetNamedPipeHandleState); ATTACH(WaitNamedPipeW); ATTACH(WriteFile); ATTACH(_lcreat); ATTACH(_lopen); return DetourTransactionCommit(); } LONG DetachDetours(VOID) { DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DETACH(CloseHandle); DETACH(CopyFileExA); DETACH(CopyFileExW); DETACH(CreateDirectoryExW); DETACH(CreateDirectoryW); DETACH(CreateFileW); DETACH(CreateProcessW); DETACH(DeleteFileA); DETACH(DeleteFileW); DETACH(FindFirstFileExA); DETACH(FindFirstFileExW); DETACH(GetFileAttributesW); DETACH(GetModuleFileNameW); DETACH(GetProcAddress); DETACH(GetSystemTimeAsFileTime); DETACH(LoadLibraryExW); DETACH(MoveFileA); DETACH(MoveFileExA); DETACH(MoveFileExW); DETACH(MoveFileW); DETACH(OpenFile); DETACH(RegCreateKeyExA); DETACH(RegCreateKeyExW); DETACH(RegDeleteKeyA); DETACH(RegDeleteKeyW); DETACH(RegDeleteValueA); DETACH(RegDeleteValueW); DETACH(RegEnumKeyExA); DETACH(RegEnumKeyExW); DETACH(RegEnumValueA); DETACH(RegEnumValueW); DETACH(RegOpenKeyExA); DETACH(RegOpenKeyExW); DETACH(RegQueryInfoKeyA); DETACH(RegQueryInfoKeyW); DETACH(RegQueryValueExA); DETACH(RegQueryValueExW); DETACH(RegSetValueExA); DETACH(RegSetValueExW); DETACH(SetNamedPipeHandleState); DETACH(WaitNamedPipeW); DETACH(WriteFile); DETACH(_lcreat); DETACH(_lopen); return DetourTransactionCommit(); } // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////// Logging System. // static BOOL s_bLog = 1; static LONG s_nTlsIndent = -1; static LONG s_nTlsThread = -1; static LONG s_nThreadCnt = 0; VOID _PrintEnter(const CHAR *psz, ...) { DWORD dwErr = GetLastError(); LONG nIndent = 0; LONG nThread = 0; if (s_nTlsIndent >= 0) { nIndent = (LONG)(LONG_PTR)TlsGetValue(s_nTlsIndent); TlsSetValue(s_nTlsIndent, (PVOID)(LONG_PTR)(nIndent + 1)); } if (s_nTlsThread >= 0) { nThread = (LONG)(LONG_PTR)TlsGetValue(s_nTlsThread); } if (s_bLog && psz) { CHAR szBuf[1024]; PCHAR pszBuf = szBuf; PCHAR pszEnd = szBuf + ARRAYSIZE(szBuf) - 1; LONG nLen = (nIndent > 0) ? (nIndent < 35 ? nIndent * 2 : 70) : 0; *pszBuf++ = (CHAR)('0' + ((nThread / 100) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 10) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 1) % 10)); *pszBuf++ = ' '; while (nLen-- > 0) { *pszBuf++ = ' '; } va_list args; va_start(args, psz); while ((*pszBuf++ = *psz++) != 0 && pszBuf < pszEnd) { // Copy characters. } *pszEnd = '\0'; SyelogV(SYELOG_SEVERITY_INFORMATION, szBuf, args); va_end(args); } SetLastError(dwErr); } VOID _PrintExit(const CHAR *psz, ...) { DWORD dwErr = GetLastError(); LONG nIndent = 0; LONG nThread = 0; if (s_nTlsIndent >= 0) { nIndent = (LONG)(LONG_PTR)TlsGetValue(s_nTlsIndent) - 1; ASSERT(nIndent >= 0); TlsSetValue(s_nTlsIndent, (PVOID)(LONG_PTR)nIndent); } if (s_nTlsThread >= 0) { nThread = (LONG)(LONG_PTR)TlsGetValue(s_nTlsThread); } if (s_bLog && psz) { CHAR szBuf[1024]; PCHAR pszBuf = szBuf; PCHAR pszEnd = szBuf + ARRAYSIZE(szBuf) - 1; LONG nLen = (nIndent > 0) ? (nIndent < 35 ? nIndent * 2 : 70) : 0; *pszBuf++ = (CHAR)('0' + ((nThread / 100) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 10) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 1) % 10)); *pszBuf++ = ' '; while (nLen-- > 0) { *pszBuf++ = ' '; } va_list args; va_start(args, psz); while ((*pszBuf++ = *psz++) != 0 && pszBuf < pszEnd) { // Copy characters. } *pszEnd = '\0'; SyelogV(SYELOG_SEVERITY_INFORMATION, szBuf, args); va_end(args); } SetLastError(dwErr); } VOID _Print(const CHAR *psz, ...) { DWORD dwErr = GetLastError(); LONG nIndent = 0; LONG nThread = 0; if (s_nTlsIndent >= 0) { nIndent = (LONG)(LONG_PTR)TlsGetValue(s_nTlsIndent); } if (s_nTlsThread >= 0) { nThread = (LONG)(LONG_PTR)TlsGetValue(s_nTlsThread); } if (s_bLog && psz) { CHAR szBuf[1024]; PCHAR pszBuf = szBuf; PCHAR pszEnd = szBuf + ARRAYSIZE(szBuf) - 1; LONG nLen = (nIndent > 0) ? (nIndent < 35 ? nIndent * 2 : 70) : 0; *pszBuf++ = (CHAR)('0' + ((nThread / 100) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 10) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 1) % 10)); *pszBuf++ = ' '; while (nLen-- > 0) { *pszBuf++ = ' '; } va_list args; va_start(args, psz); while ((*pszBuf++ = *psz++) != 0 && pszBuf < pszEnd) { // Copy characters. } *pszEnd = '\0'; SyelogV(SYELOG_SEVERITY_INFORMATION, szBuf, args); va_end(args); } SetLastError(dwErr); } VOID AssertMessage(CONST PCHAR pszMsg, CONST PCHAR pszFile, ULONG nLine) { Syelog(SYELOG_SEVERITY_FATAL, "ASSERT(%s) failed in %s, line %d.\n", pszMsg, pszFile, nLine); } ////////////////////////////////////////////////////////////////////////////// // PIMAGE_NT_HEADERS NtHeadersForInstance(HINSTANCE hInst) { PIMAGE_DOS_HEADER pDosHeader = (PIMAGE_DOS_HEADER)hInst; __try { if (pDosHeader->e_magic != IMAGE_DOS_SIGNATURE) { SetLastError(ERROR_BAD_EXE_FORMAT); return NULL; } PIMAGE_NT_HEADERS pNtHeader = (PIMAGE_NT_HEADERS)((PBYTE)pDosHeader + pDosHeader->e_lfanew); if (pNtHeader->Signature != IMAGE_NT_SIGNATURE) { SetLastError(ERROR_INVALID_EXE_SIGNATURE); return NULL; } if (pNtHeader->FileHeader.SizeOfOptionalHeader == 0) { SetLastError(ERROR_EXE_MARKED_INVALID); return NULL; } return pNtHeader; } __except(EXCEPTION_EXECUTE_HANDLER) { } SetLastError(ERROR_EXE_MARKED_INVALID); return NULL; } BOOL InstanceEnumerate(HINSTANCE hInst) { WCHAR wzDllName[MAX_PATH]; PIMAGE_NT_HEADERS pinh = NtHeadersForInstance(hInst); if (pinh && Real_GetModuleFileNameW(hInst, wzDllName, ARRAYSIZE(wzDllName))) { Syelog(SYELOG_SEVERITY_INFORMATION, "### %08lx: %-43.43ls %08x\n", hInst, wzDllName, pinh->OptionalHeader.CheckSum); return TRUE; } return FALSE; } BOOL ProcessEnumerate() { Syelog(SYELOG_SEVERITY_INFORMATION, "######################################################### Binaries\n"); for (HINSTANCE hInst = NULL; (hInst = DetourEnumerateModules(hInst)) != NULL;) { InstanceEnumerate(hInst); } return TRUE; } ////////////////////////////////////////////////////////////////////////////// // // DLL module information // BOOL ThreadAttach(HMODULE hDll) { (void)hDll; if (s_nTlsIndent >= 0) { TlsSetValue(s_nTlsIndent, (PVOID)0); } if (s_nTlsThread >= 0) { LONG nThread = InterlockedIncrement(&s_nThreadCnt); TlsSetValue(s_nTlsThread, (PVOID)(LONG_PTR)nThread); } return TRUE; } BOOL ThreadDetach(HMODULE hDll) { (void)hDll; if (s_nTlsIndent >= 0) { TlsSetValue(s_nTlsIndent, (PVOID)0); } if (s_nTlsThread >= 0) { TlsSetValue(s_nTlsThread, (PVOID)0); } return TRUE; } BOOL ProcessAttach(HMODULE hDll) { s_bLog = FALSE; s_nTlsIndent = TlsAlloc(); s_nTlsThread = TlsAlloc(); s_hInst = hDll; Real_GetModuleFileNameA(s_hInst, s_szDllPath, ARRAYSIZE(s_szDllPath)); SyelogOpen("trcreg" DETOURS_STRINGIFY(DETOURS_BITS), SYELOG_FACILITY_APPLICATION); ProcessEnumerate(); LONG error = AttachDetours(); if (error != NO_ERROR) { Syelog(SYELOG_SEVERITY_FATAL, "### Error attaching detours: %d\n", error); } ThreadAttach(hDll); s_bLog = TRUE; return TRUE; } BOOL ProcessDetach(HMODULE hDll) { ThreadDetach(hDll); s_bLog = FALSE; LONG error = DetachDetours(); if (error != NO_ERROR) { Syelog(SYELOG_SEVERITY_FATAL, "### Error detaching detours: %d\n", error); } Syelog(SYELOG_SEVERITY_NOTICE, "### Closing.\n"); SyelogClose(FALSE); if (s_nTlsIndent >= 0) { TlsFree(s_nTlsIndent); } if (s_nTlsThread >= 0) { TlsFree(s_nTlsThread); } return TRUE; } BOOL APIENTRY DllMain(HINSTANCE hModule, DWORD dwReason, PVOID lpReserved) { (void)hModule; (void)lpReserved; if (DetourIsHelperProcess()) { return TRUE; } switch (dwReason) { case DLL_PROCESS_ATTACH: DetourRestoreAfterWith(); return ProcessAttach(hModule); case DLL_PROCESS_DETACH: return ProcessDetach(hModule); case DLL_THREAD_ATTACH: return ThreadAttach(hModule); case DLL_THREAD_DETACH: return ThreadDetach(hModule); } return TRUE; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/tracereg/trcreg.rc ================================================ ////////////////////////////////////////////////////////////////////////////// // // Version information for trcreg.rc. // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include "detver.h" #define VER_INTERNALNAME_STR "trcreg" DETOURS_STRINGIFY(DETOURS_BITS) #define VER_ORIGINALFILENAME_STR "trcreg" DETOURS_STRINGIFY(DETOURS_BITS) ".dll" #define VER_FILEDESCRIPTION_STR "Detours Registry Trace Module" #define VER_COMPANYNAME_STR "Microsoft Corporation" #include "common.ver" ================================================ FILE: ext/detours/samples/traceser/Makefile ================================================ ############################################################################## ## ## Utility to trace serial (COM1, COM2, etc.) APIs. ## ## Microsoft Research Detours Package ## ## Copyright (c) Microsoft Corporation. All rights reserved. ## !include ..\common.mak LIBS=$(LIBS) kernel32.lib all: dirs \ $(BIND)\trcser$(DETOURS_BITS).dll \ !IF $(DETOURS_SOURCE_BROWSING)==1 $(OBJD)\trcser$(DETOURS_BITS).bsc \ !ENDIF option dirs: @if not exist $(BIND) mkdir $(BIND) && echo. Created $(BIND) @if not exist $(OBJD) mkdir $(OBJD) && echo. Created $(OBJD) clean: -del *~ test.txt 2>nul -del $(BIND)\trcser*.* 2>nul -rmdir /q /s $(OBJD) 2>nul realclean: clean -rmdir /q /s $(OBJDS) 2>nul ############################################################################## $(OBJD)\trcser.obj: trcser.cpp $(OBJD)\trcser.res: trcser.rc $(BIND)\trcser$(DETOURS_BITS).dll: $(OBJD)\trcser.obj $(OBJD)\trcser.res $(DEPS) cl /LD $(CFLAGS) /Fe$@ /Fd$(@R).pdb \ $(OBJD)\trcser.obj $(OBJD)\trcser.res \ /link $(LINKFLAGS) /subsystem:console \ /export:DetourFinishHelperProcess,@1,NONAME \ $(LIBS) $(OBJD)\trcser$(DETOURS_BITS).bsc : $(OBJD)\trcser.obj bscmake /v /n /o $@ $(OBJD)\trcser.sbr ############################################### Install non-bit-size binaries. !IF "$(DETOURS_OPTION_PROCESSOR)" != "" $(OPTD)\trcser$(DETOURS_OPTION_BITS).dll: $(OPTD)\trcser$(DETOURS_OPTION_BITS).pdb: $(BIND)\trcser$(DETOURS_OPTION_BITS).dll : $(OPTD)\trcser$(DETOURS_OPTION_BITS).dll @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\trcser$(DETOURS_OPTION_BITS).pdb : $(OPTD)\trcser$(DETOURS_OPTION_BITS).pdb @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). option: \ $(BIND)\trcser$(DETOURS_OPTION_BITS).dll \ $(BIND)\trcser$(DETOURS_OPTION_BITS).pdb \ !ELSE option: !ENDIF ############################################################################## test: all @echo -------- Logging output to test.txt ------------ start $(BIND)\syelogd.exe /o test.txt $(BIND)\sleep5.exe 1 @echo -------- Should load trcser$(DETOURS_BITS).dll dynamically using withdll.exe ------------ $(BIND)\withdll -d:$(BIND)\trcser$(DETOURS_BITS).dll $(BIND)\sleepold.exe @echo -------- Log from syelog ------------- type test.txt ################################################################# End of File. ================================================ FILE: ext/detours/samples/traceser/trcser.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (trcser.cpp of trcser.dll) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #define _WIN32_WINNT 0x0400 #define WIN32 #define NT #define DBG_TRACE 0 #include #include #include "detours.h" #include "syelog.h" #define PULONG_PTR PVOID #define PLONG_PTR PVOID #define ULONG_PTR PVOID #define ENUMRESNAMEPROCA PVOID #define ENUMRESNAMEPROCW PVOID #define ENUMRESLANGPROCA PVOID #define ENUMRESLANGPROCW PVOID #define ENUMRESTYPEPROCA PVOID #define ENUMRESTYPEPROCW PVOID #define STGOPTIONS PVOID ////////////////////////////////////////////////////////////////////// #pragma warning(disable:4127) // Many of our asserts are constants. #define ASSERT_ALWAYS(x) \ do { \ if (!(x)) { \ AssertMessage(#x, __FILE__, __LINE__); \ DebugBreak(); \ } \ } while (0) #ifndef NDEBUG #define ASSERT(x) ASSERT_ALWAYS(x) #else #define ASSERT(x) #endif #define UNUSED(c) (c) = (c) ////////////////////////////////////////////////////////////////////// static HMODULE s_hInst = NULL; static CHAR s_szDllPath[MAX_PATH]; VOID _PrintDump(HANDLE h, PCHAR pszData, INT cbData); VOID _PrintEnter(PCSTR psz, ...); VOID _PrintExit(PCSTR psz, ...); VOID _Print(PCSTR psz, ...); VOID AssertMessage(CONST PCHAR pszMsg, CONST PCHAR pszFile, ULONG nLine); ////////////////////////////////////////////////////////////////////////////// // extern "C" { HANDLE (WINAPI * Real_CreateFileW)(LPCWSTR a0, DWORD a1, DWORD a2, LPSECURITY_ATTRIBUTES a3, DWORD a4, DWORD a5, HANDLE a6) = CreateFileW; BOOL (WINAPI * Real_WriteFile)(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped) = WriteFile; BOOL (WINAPI * Real_FlushFileBuffers)(HANDLE hFile) = FlushFileBuffers; BOOL (WINAPI * Real_CloseHandle)(HANDLE hObject) = CloseHandle; BOOL (WINAPI * Real_WaitNamedPipeW)(LPCWSTR lpNamedPipeName, DWORD nTimeOut) = WaitNamedPipeW; BOOL (WINAPI * Real_SetNamedPipeHandleState)(HANDLE hNamedPipe, LPDWORD lpMode, LPDWORD lpMaxCollectionCount, LPDWORD lpCollectDataTimeout) = SetNamedPipeHandleState; DWORD (WINAPI * Real_GetCurrentProcessId)(VOID) = GetCurrentProcessId; VOID (WINAPI * Real_GetSystemTimeAsFileTime)(LPFILETIME lpSystemTimeAsFileTime) = GetSystemTimeAsFileTime; VOID (WINAPI * Real_InitializeCriticalSection)(LPCRITICAL_SECTION lpSection) = InitializeCriticalSection; VOID (WINAPI * Real_EnterCriticalSection)(LPCRITICAL_SECTION lpSection) = EnterCriticalSection; VOID (WINAPI * Real_LeaveCriticalSection)(LPCRITICAL_SECTION lpSection) = LeaveCriticalSection; } DWORD (WINAPI * Real_GetModuleFileNameW)(HMODULE a0, LPWSTR a1, DWORD a2) = GetModuleFileNameW; DWORD (WINAPI * Real_GetModuleFileNameA)(HMODULE a0, LPSTR a1, DWORD a2) = GetModuleFileNameA; BOOL (WINAPI * Real_CreateProcessW)(LPCWSTR a0, LPWSTR a1, LPSECURITY_ATTRIBUTES a2, LPSECURITY_ATTRIBUTES a3, BOOL a4, DWORD a5, LPVOID a6, LPCWSTR a7, struct _STARTUPINFOW* a8, LPPROCESS_INFORMATION a9) = CreateProcessW; BOOL (WINAPI * Real_BuildCommDCBA)(LPCSTR a0, struct _DCB* a1) = BuildCommDCBA; BOOL (WINAPI * Real_BuildCommDCBAndTimeoutsA)(LPCSTR a0, struct _DCB* a1, struct _COMMTIMEOUTS* a2) = BuildCommDCBAndTimeoutsA; BOOL (WINAPI * Real_BuildCommDCBAndTimeoutsW)(LPCWSTR a0, struct _DCB* a1, struct _COMMTIMEOUTS* a2) = BuildCommDCBAndTimeoutsW; BOOL (WINAPI * Real_BuildCommDCBW)(LPCWSTR a0, struct _DCB* a1) = BuildCommDCBW; BOOL (WINAPI * Real_ClearCommBreak)(HANDLE a0) = ClearCommBreak; BOOL (WINAPI * Real_ClearCommError)(HANDLE a0, LPDWORD a1, struct _COMSTAT* a2) = ClearCommError; HANDLE (WINAPI * Real_CreateFileA)(LPCSTR a0, DWORD a1, DWORD a2, LPSECURITY_ATTRIBUTES a3, DWORD a4, DWORD a5, HANDLE a6) = CreateFileA; BOOL (WINAPI * Real_EscapeCommFunction)(HANDLE a0, DWORD a1) = EscapeCommFunction; BOOL (WINAPI * Real_GetCommConfig)(HANDLE a0, LPCOMMCONFIG a1, LPDWORD a2) = GetCommConfig; BOOL (WINAPI * Real_GetCommMask)(HANDLE a0, LPDWORD a1) = GetCommMask; BOOL (WINAPI * Real_GetCommModemStatus)(HANDLE a0, LPDWORD a1) = GetCommModemStatus; BOOL (WINAPI * Real_GetCommProperties)(HANDLE a0, LPCOMMPROP a1) = GetCommProperties; BOOL (WINAPI * Real_GetCommState)(HANDLE a0, struct _DCB* a1) = GetCommState; BOOL (WINAPI * Real_GetCommTimeouts)(HANDLE a0, struct _COMMTIMEOUTS* a1) = GetCommTimeouts; DWORD (WINAPI * Real_GetCurrentThreadId)(void) = GetCurrentThreadId; BOOL (WINAPI * Real_GetOverlappedResult)(HANDLE a0, LPOVERLAPPED a1, LPDWORD a2, BOOL a3) = GetOverlappedResult; BOOL (WINAPI * Real_PurgeComm)(HANDLE a0, DWORD a1) = PurgeComm; BOOL (WINAPI * Real_ReadFile)(HANDLE a0, LPVOID a1, DWORD a2, LPDWORD a3, LPOVERLAPPED a4) = ReadFile; BOOL (WINAPI * Real_SetCommBreak)(HANDLE a0) = SetCommBreak; BOOL (WINAPI * Real_SetCommConfig)(HANDLE a0, LPCOMMCONFIG a1, DWORD a2) = SetCommConfig; BOOL (WINAPI * Real_SetCommMask)(HANDLE a0, DWORD a1) = SetCommMask; BOOL (WINAPI * Real_SetCommState)(HANDLE a0, struct _DCB* a1) = SetCommState; BOOL (WINAPI * Real_SetCommTimeouts)(HANDLE a0, struct _COMMTIMEOUTS* a1) = SetCommTimeouts; BOOL (WINAPI * Real_SetupComm)(HANDLE a0, DWORD a1, DWORD a2) = SetupComm; BOOL (WINAPI * Real_TransmitCommChar)(HANDLE a0, char a1) = TransmitCommChar; BOOL (WINAPI * Real_WaitCommEvent)(HANDLE a0, LPDWORD a1, LPOVERLAPPED a2) = WaitCommEvent; ///////////////////////////////////////////////////////////// // Detours // BOOL WINAPI Mine_CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) { _PrintEnter("CreateProcessW(%ls,%ls,%p,%p,%x,%x,%p,%ls,%p,%p)\n", lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation); _Print("Calling DetourCreateProcessWithDllExW(,%hs)\n", s_szDllPath); BOOL rv = 0; __try { rv = DetourCreateProcessWithDllExW(lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation, s_szDllPath, Real_CreateProcessW); } __finally { _PrintExit("CreateProcessW(,,,,,,,,,) -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_BuildCommDCBA(LPCSTR a0, LPDCB a1) { _PrintEnter("BuildCommDCBA(%hs,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_BuildCommDCBA(a0, a1); } __finally { _PrintExit("BuildCommDCBA(,) -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_BuildCommDCBAndTimeoutsA(LPCSTR a0, LPDCB a1, LPCOMMTIMEOUTS a2) { _PrintEnter("BuildCommDCBAndTimeoutsA(%hs,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_BuildCommDCBAndTimeoutsA(a0, a1, a2); } __finally { _PrintExit("BuildCommDCBAndTimeoutsA(,,) -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_BuildCommDCBAndTimeoutsW(LPCWSTR a0, LPDCB a1, LPCOMMTIMEOUTS a2) { _PrintEnter("BuildCommDCBAndTimeoutsW(%ls,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_BuildCommDCBAndTimeoutsW(a0, a1, a2); } __finally { _PrintExit("BuildCommDCBAndTimeoutsW(,,) -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_BuildCommDCBW(LPCWSTR a0, LPDCB a1) { _PrintEnter("BuildCommDCBW(%ls,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_BuildCommDCBW(a0, a1); } __finally { _PrintExit("BuildCommDCBW(,) -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_ClearCommBreak(HANDLE a0) { _PrintEnter("ClearCommBreak(%p)\n", a0); BOOL rv = 0; __try { rv = Real_ClearCommBreak(a0); } __finally { _PrintExit("ClearCommBreak() -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_ClearCommError(HANDLE a0, LPDWORD a1, LPCOMSTAT a2) { _PrintEnter("ClearCommError(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_ClearCommError(a0, a1, a2); } __finally { _PrintExit("ClearCommError(,,) -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_CloseHandle(HANDLE a0) { _PrintEnter("CloseHandle(%p)\n", a0); BOOL rv = 0; __try { rv = Real_CloseHandle(a0); } __finally { _PrintExit("CloseHandle() -> %x\n", rv); }; return rv; } HANDLE WINAPI Mine_CreateFileA(LPCSTR a0, DWORD a1, DWORD a2, LPSECURITY_ATTRIBUTES a3, DWORD a4, DWORD a5, HANDLE a6) { _PrintEnter("CreateFileA(%hs,%x,%x,%p,%x,%x,%p)\n", a0, a1, a2, a3, a4, a5, a6); HANDLE rv = 0; __try { rv = Real_CreateFileA(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("CreateFileA(,,,,,,) -> %p\n", rv); }; return rv; } HANDLE WINAPI Mine_CreateFileW(LPCWSTR a0, DWORD a1, DWORD a2, LPSECURITY_ATTRIBUTES a3, DWORD a4, DWORD a5, HANDLE a6) { _PrintEnter("CreateFileW(%ls,%x,%x,%p,%x,%x,%p)\n", a0, a1, a2, a3, a4, a5, a6); HANDLE rv = 0; __try { rv = Real_CreateFileW(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("CreateFileW(,,,,,,) -> %p\n", rv); }; return rv; } BOOL WINAPI Mine_EscapeCommFunction(HANDLE a0, DWORD a1) { _PrintEnter("EscapeCommFunction(%p,%x)\n", a0, a1); BOOL rv = 0; __try { rv = Real_EscapeCommFunction(a0, a1); } __finally { _PrintExit("EscapeCommFunction(,) -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_GetCommConfig(HANDLE a0, LPCOMMCONFIG a1, LPDWORD a2) { _PrintEnter("GetCommConfig(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_GetCommConfig(a0, a1, a2); } __finally { _PrintExit("GetCommConfig(,,) -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_GetCommMask(HANDLE a0, LPDWORD a1) { _PrintEnter("GetCommMask(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetCommMask(a0, a1); } __finally { _PrintExit("GetCommMask(,) -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_GetCommModemStatus(HANDLE a0, LPDWORD a1) { _PrintEnter("GetCommModemStatus(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetCommModemStatus(a0, a1); } __finally { _PrintExit("GetCommModemStatus(,) -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_GetCommProperties(HANDLE a0, LPCOMMPROP a1) { _PrintEnter("GetCommProperties(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetCommProperties(a0, a1); } __finally { _PrintExit("GetCommProperties(,) -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_GetCommState(HANDLE a0, LPDCB a1) { _PrintEnter("GetCommState(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetCommState(a0, a1); } __finally { _PrintExit("GetCommState(,) -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_GetCommTimeouts(HANDLE a0, LPCOMMTIMEOUTS a1) { _PrintEnter("GetCommTimeouts(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_GetCommTimeouts(a0, a1); } __finally { _PrintExit("GetCommTimeouts(,) -> %x\n", rv); }; return rv; } DWORD WINAPI Mine_GetCurrentThreadId(void) { _PrintEnter("GetCurrentThreadId()\n"); DWORD rv = 0; __try { rv = Real_GetCurrentThreadId(); } __finally { _PrintExit("GetCurrentThreadId() -> %x\n", rv); }; return rv; } DWORD WINAPI Mine_GetModuleFileNameW(HINSTANCE a0, LPWSTR a1, DWORD a2) { _PrintEnter("GetModuleFileNameW(%p,%p,%x)\n", a0, a1, a2); DWORD rv = 0; __try { rv = Real_GetModuleFileNameW(a0, a1, a2); } __finally { _PrintExit("GetModuleFileNameW(,%ls,) -> %x\n", a1, rv); }; return rv; } BOOL WINAPI Mine_GetOverlappedResult(HANDLE a0, LPOVERLAPPED a1, LPDWORD a2, BOOL a3) { _PrintEnter("GetOverlappedResult(%p,%p,%p,%x)\n", a0, a1, a2, a3); BOOL rv = 0; __try { rv = Real_GetOverlappedResult(a0, a1, a2, a3); } __finally { _PrintExit("GetOverlappedResult(,,,) -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_PurgeComm(HANDLE a0, DWORD a1) { _PrintEnter("PurgeComm(%p,%x)\n", a0, a1); BOOL rv = 0; __try { rv = Real_PurgeComm(a0, a1); } __finally { _PrintExit("PurgeComm(,) -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_ReadFile(HANDLE a0, LPVOID a1, DWORD a2, LPDWORD a3, LPOVERLAPPED a4) { _PrintEnter("ReadFile(%p,%p,%x,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_ReadFile(a0, a1, a2, a3, a4); } __finally { _PrintExit("ReadFile(,,,,) -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_SetCommBreak(HANDLE a0) { _PrintEnter("SetCommBreak(%p)\n", a0); BOOL rv = 0; __try { rv = Real_SetCommBreak(a0); } __finally { _PrintExit("SetCommBreak() -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_SetCommConfig(HANDLE a0, LPCOMMCONFIG a1, DWORD a2) { _PrintEnter("SetCommConfig(%p,%p,%x)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_SetCommConfig(a0, a1, a2); } __finally { _PrintExit("SetCommConfig(,,) -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_SetCommMask(HANDLE a0, DWORD a1) { _PrintEnter("SetCommMask(%p,%x)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetCommMask(a0, a1); } __finally { _PrintExit("SetCommMask(,) -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_SetCommState(HANDLE a0, LPDCB a1) { _PrintEnter("SetCommState(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetCommState(a0, a1); } __finally { _PrintExit("SetCommState(,) -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_SetCommTimeouts(HANDLE a0, LPCOMMTIMEOUTS a1) { _PrintEnter("SetCommTimeouts(%p,%p)\n", a0, a1); BOOL rv = 0; __try { rv = Real_SetCommTimeouts(a0, a1); } __finally { _PrintExit("SetCommTimeouts(,) -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_SetupComm(HANDLE a0, DWORD a1, DWORD a2) { _PrintEnter("SetupComm(%p,%x,%x)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_SetupComm(a0, a1, a2); } __finally { _PrintExit("SetupComm(,,) -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_TransmitCommChar(HANDLE a0, char a1) { _PrintEnter("TransmitCommChar(%p,%x)\n", a0, a1); BOOL rv = 0; __try { rv = Real_TransmitCommChar(a0, a1); } __finally { _PrintExit("TransmitCommChar(,) -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_WaitCommEvent(HANDLE a0, LPDWORD a1, LPOVERLAPPED a2) { _PrintEnter("WaitCommEvent(%p,%p,%p)\n", a0, a1, a2); BOOL rv = 0; __try { rv = Real_WaitCommEvent(a0, a1, a2); } __finally { _PrintExit("WaitCommEvent(,,) -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_WriteFile(HANDLE a0, LPCVOID a1, DWORD a2, LPDWORD a3, LPOVERLAPPED a4) { _PrintEnter("WriteFile(%p,%p,%x,%p,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { _PrintDump(a0, (PCHAR)a1, a2); rv = Real_WriteFile(a0, a1, a2, a3, a4); } __finally { _PrintExit("WriteFile(,,,,) -> %x\n", rv); }; return rv; } ///////////////////////////////////////////////////////////// // AttachDetours // PCHAR DetRealName(PCHAR psz) { PCHAR pszBeg = psz; // Move to end of name. while (*psz) { psz++; } // Move back through A-Za-z0-9 names. while (psz > pszBeg && ((psz[-1] >= 'A' && psz[-1] <= 'Z') || (psz[-1] >= 'a' && psz[-1] <= 'z') || (psz[-1] >= '0' && psz[-1] <= '9'))) { psz--; } return psz; } VOID DetAttach(PVOID *ppbReal, PVOID pbMine, PCHAR psz) { LONG l = DetourAttach(ppbReal, pbMine); if (l != 0) { Syelog(SYELOG_SEVERITY_NOTICE, "Attach failed: `%s': error %d\n", DetRealName(psz), l); } } VOID DetDetach(PVOID *ppbReal, PVOID pbMine, PCHAR psz) { LONG l = DetourDetach(ppbReal, pbMine); if (l != 0) { Syelog(SYELOG_SEVERITY_NOTICE, "Detach failed: `%s': error %d\n", DetRealName(psz), l); } } #define ATTACH(x) DetAttach(&(PVOID&)Real_##x,Mine_##x,#x) #define DETACH(x) DetDetach(&(PVOID&)Real_##x,Mine_##x,#x) LONG AttachDetours(VOID) { DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); ATTACH(BuildCommDCBA); ATTACH(BuildCommDCBAndTimeoutsA); ATTACH(BuildCommDCBAndTimeoutsW); ATTACH(BuildCommDCBW); ATTACH(ClearCommBreak); ATTACH(ClearCommError); ATTACH(CloseHandle); ATTACH(CreateFileA); ATTACH(CreateFileW); ATTACH(EscapeCommFunction); ATTACH(GetCommConfig); ATTACH(GetCommMask); ATTACH(GetCommModemStatus); ATTACH(GetCommProperties); ATTACH(GetCommState); ATTACH(GetCommTimeouts); ATTACH(GetCurrentThreadId); ATTACH(GetModuleFileNameW); ATTACH(GetOverlappedResult); ATTACH(PurgeComm); ATTACH(ReadFile); ATTACH(SetCommBreak); ATTACH(SetCommConfig); ATTACH(SetCommMask); ATTACH(SetCommState); ATTACH(SetCommTimeouts); ATTACH(SetupComm); ATTACH(TransmitCommChar); ATTACH(WaitCommEvent); ATTACH(WriteFile); return DetourTransactionCommit(); } LONG DetachDetours(VOID) { DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DETACH(BuildCommDCBA); DETACH(BuildCommDCBAndTimeoutsA); DETACH(BuildCommDCBAndTimeoutsW); DETACH(BuildCommDCBW); DETACH(ClearCommBreak); DETACH(ClearCommError); DETACH(CloseHandle); DETACH(CreateFileA); DETACH(CreateFileW); DETACH(EscapeCommFunction); DETACH(GetCommConfig); DETACH(GetCommMask); DETACH(GetCommModemStatus); DETACH(GetCommProperties); DETACH(GetCommState); DETACH(GetCommTimeouts); DETACH(GetCurrentThreadId); DETACH(GetModuleFileNameW); DETACH(GetOverlappedResult); DETACH(PurgeComm); DETACH(ReadFile); DETACH(SetCommBreak); DETACH(SetCommConfig); DETACH(SetCommMask); DETACH(SetCommState); DETACH(SetCommTimeouts); DETACH(SetupComm); DETACH(TransmitCommChar); DETACH(WaitCommEvent); DETACH(WriteFile); return DetourTransactionCommit(); } ///////////////////////////////////////////////////////////// // Detours // VOID _PrintDump(HANDLE h, PCHAR pszData, INT cbData) { if (pszData && cbData > 0) { CHAR szBuffer[256]; PCHAR pszBuffer = szBuffer; INT cbBuffer = 0; INT nLines = 0; while (cbData > 0) { if (nLines > 20) { *pszBuffer++ = '.'; *pszBuffer++ = '.'; *pszBuffer++ = '.'; cbBuffer += 3; break; } if (*pszData == '\t') { *pszBuffer++ = '\\'; *pszBuffer++ = 't'; cbBuffer += 2; pszData++; cbData--; continue; } if (*pszData == '\r') { *pszBuffer++ = '\\'; *pszBuffer++ = 'r'; cbBuffer += 2; pszData++; cbData--; continue; } else if (*pszData == '\n') { *pszBuffer++ = '\\'; *pszBuffer++ = 'n'; cbBuffer += 2; *pszBuffer++ = '\0'; _Print("%p: %hs\n", h, szBuffer); nLines++; pszBuffer = szBuffer; cbBuffer = 0; pszData++; cbData--; continue; } else if (cbBuffer >= 80) { *pszBuffer++ = '\0'; _Print("%p: %hs\n", h, szBuffer); nLines++; pszBuffer = szBuffer; cbBuffer = 0; } if (*pszData < ' ' || *pszData >= 127) { *pszBuffer++ = '\\'; *pszBuffer++ = 'x'; *pszBuffer++ = "0123456789ABCDEF"[(*pszData & 0xf0) >> 4]; *pszBuffer++ = "0123456789ABCDEF"[(*pszData & 0x0f)]; cbBuffer += 4; } else { *pszBuffer++ = *pszData; } cbBuffer++; pszData++; cbData--; } if (cbBuffer > 0) { *pszBuffer++ = '\0'; _Print("%p: %hs\n", h, szBuffer); } } } ////////////////////////////////////////////////////////////// Logging System. // static BOOL s_bLog = 1; static LONG s_nTlsIndent = -1; static LONG s_nTlsThread = -1; static LONG s_nThreadCnt = 0; VOID _PrintEnter(const CHAR *psz, ...) { DWORD dwErr = GetLastError(); LONG nIndent = 0; LONG nThread = 0; if (s_nTlsIndent >= 0) { nIndent = (LONG)(LONG_PTR)TlsGetValue(s_nTlsIndent); TlsSetValue(s_nTlsIndent, (PVOID)(LONG_PTR)(nIndent + 1)); } if (s_nTlsThread >= 0) { nThread = (LONG)(LONG_PTR)TlsGetValue(s_nTlsThread); } if (s_bLog && psz) { CHAR szBuf[1024]; PCHAR pszBuf = szBuf; PCHAR pszEnd = szBuf + ARRAYSIZE(szBuf) - 1; LONG nLen = (nIndent > 0) ? (nIndent < 35 ? nIndent * 2 : 70) : 0; *pszBuf++ = (CHAR)('0' + ((nThread / 100) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 10) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 1) % 10)); *pszBuf++ = ' '; while (nLen-- > 0) { *pszBuf++ = ' '; } va_list args; va_start(args, psz); while ((*pszBuf++ = *psz++) != 0 && pszBuf < pszEnd) { // Copy characters. } *pszEnd = '\0'; SyelogV(SYELOG_SEVERITY_INFORMATION, szBuf, args); va_end(args); } SetLastError(dwErr); } VOID _PrintExit(const CHAR *psz, ...) { DWORD dwErr = GetLastError(); LONG nIndent = 0; LONG nThread = 0; if (s_nTlsIndent >= 0) { nIndent = (LONG)(LONG_PTR)TlsGetValue(s_nTlsIndent) - 1; ASSERT(nIndent >= 0); TlsSetValue(s_nTlsIndent, (PVOID)(LONG_PTR)nIndent); } if (s_nTlsThread >= 0) { nThread = (LONG)(LONG_PTR)TlsGetValue(s_nTlsThread); } if (s_bLog && psz) { CHAR szBuf[1024]; PCHAR pszBuf = szBuf; PCHAR pszEnd = szBuf + ARRAYSIZE(szBuf) - 1; LONG nLen = (nIndent > 0) ? (nIndent < 35 ? nIndent * 2 : 70) : 0; *pszBuf++ = (CHAR)('0' + ((nThread / 100) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 10) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 1) % 10)); *pszBuf++ = ' '; while (nLen-- > 0) { *pszBuf++ = ' '; } va_list args; va_start(args, psz); while ((*pszBuf++ = *psz++) != 0 && pszBuf < pszEnd) { // Copy characters. } *pszEnd = '\0'; SyelogV(SYELOG_SEVERITY_INFORMATION, szBuf, args); va_end(args); } SetLastError(dwErr); } VOID _Print(const CHAR *psz, ...) { DWORD dwErr = GetLastError(); LONG nIndent = 0; LONG nThread = 0; if (s_nTlsIndent >= 0) { nIndent = (LONG)(LONG_PTR)TlsGetValue(s_nTlsIndent); } if (s_nTlsThread >= 0) { nThread = (LONG)(LONG_PTR)TlsGetValue(s_nTlsThread); } if (s_bLog && psz) { CHAR szBuf[1024]; PCHAR pszBuf = szBuf; PCHAR pszEnd = szBuf + ARRAYSIZE(szBuf) - 1; LONG nLen = (nIndent > 0) ? (nIndent < 35 ? nIndent * 2 : 70) : 0; *pszBuf++ = (CHAR)('0' + ((nThread / 100) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 10) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 1) % 10)); *pszBuf++ = ' '; while (nLen-- > 0) { *pszBuf++ = ' '; } va_list args; va_start(args, psz); while ((*pszBuf++ = *psz++) != 0 && pszBuf < pszEnd) { // Copy characters. } *pszEnd = '\0'; SyelogV(SYELOG_SEVERITY_INFORMATION, szBuf, args); va_end(args); } SetLastError(dwErr); } VOID AssertMessage(CONST PCHAR pszMsg, CONST PCHAR pszFile, ULONG nLine) { Syelog(SYELOG_SEVERITY_FATAL, "ASSERT(%s) failed in %s, line %d.\n", pszMsg, pszFile, nLine); } ////////////////////////////////////////////////////////////////////////////// // // DLL module information // BOOL ThreadAttach(HMODULE hDll) { (void)hDll; if (s_nTlsIndent >= 0) { TlsSetValue(s_nTlsIndent, (PVOID)0); } if (s_nTlsThread >= 0) { LONG nThread = InterlockedIncrement(&s_nThreadCnt); TlsSetValue(s_nTlsThread, (PVOID)(LONG_PTR)nThread); } return TRUE; } BOOL ThreadDetach(HMODULE hDll) { (void)hDll; if (s_nTlsIndent >= 0) { TlsSetValue(s_nTlsIndent, (PVOID)0); } if (s_nTlsThread >= 0) { TlsSetValue(s_nTlsThread, (PVOID)0); } return TRUE; } BOOL ProcessAttach(HMODULE hDll) { s_bLog = FALSE; s_nTlsIndent = TlsAlloc(); s_nTlsThread = TlsAlloc(); WCHAR wzExePath[MAX_PATH]; s_hInst = hDll; Real_GetModuleFileNameA(s_hInst, s_szDllPath, ARRAYSIZE(s_szDllPath)); Real_GetModuleFileNameW(NULL, wzExePath, ARRAYSIZE(wzExePath)); SyelogOpen("trcser" DETOURS_STRINGIFY(DETOURS_BITS), SYELOG_FACILITY_APPLICATION); Syelog(SYELOG_SEVERITY_INFORMATION, "##################################################################\n"); Syelog(SYELOG_SEVERITY_INFORMATION, "### %ls\n", wzExePath); LONG error = AttachDetours(); if (error != NO_ERROR) { Syelog(SYELOG_SEVERITY_FATAL, "### Error attaching detours: %d\n", error); } ThreadAttach(hDll); s_bLog = TRUE; return TRUE; } BOOL ProcessDetach(HMODULE hDll) { ThreadDetach(hDll); s_bLog = FALSE; LONG error = DetachDetours(); if (error != NO_ERROR) { Syelog(SYELOG_SEVERITY_FATAL, "### Error detaching detours: %d\n", error); } Syelog(SYELOG_SEVERITY_NOTICE, "### Closing.\n"); SyelogClose(FALSE); if (s_nTlsIndent >= 0) { TlsFree(s_nTlsIndent); } if (s_nTlsThread >= 0) { TlsFree(s_nTlsThread); } return TRUE; } BOOL APIENTRY DllMain(HINSTANCE hModule, DWORD dwReason, PVOID lpReserved) { (void)hModule; (void)lpReserved; if (DetourIsHelperProcess()) { return TRUE; } switch (dwReason) { case DLL_PROCESS_ATTACH: DetourRestoreAfterWith(); return ProcessAttach(hModule); case DLL_PROCESS_DETACH: return ProcessDetach(hModule); case DLL_THREAD_ATTACH: return ThreadAttach(hModule); case DLL_THREAD_DETACH: return ThreadDetach(hModule); } return TRUE; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/traceser/trcser.rc ================================================ ////////////////////////////////////////////////////////////////////////////// // // Version information for trcser.rc. // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include "detver.h" #define VER_INTERNALNAME_STR "trcser" DETOURS_STRINGIFY(DETOURS_BITS) #define VER_ORIGINALFILENAME_STR "trcsrc" DETOURS_STRINGIFY(DETOURS_BITS) ".dll" #define VER_FILEDESCRIPTION_STR "Detours Serial Trace Module" #define VER_COMPANYNAME_STR "Microsoft Corporation" #include "common.ver" ================================================ FILE: ext/detours/samples/tracessl/Makefile ================================================ ############################################################################## ## ## Utility to trace WinSock SSL APIs. ## ## Microsoft Research Detours Package ## ## Copyright (c) Microsoft Corporation. All rights reserved. ## !include ..\common.mak LIBS=$(LIBS) kernel32.lib ws2_32.lib secur32.lib ############################################################################## all: dirs \ $(BIND)\trcssl$(DETOURS_BITS).dll \ !IF $(DETOURS_SOURCE_BROWSING)==1 $(OBJD)\trcssl$(DETOURS_BITS).bsc \ !ENDIF option ############################################################################## dirs: @if not exist $(BIND) mkdir $(BIND) && echo. Created $(BIND) @if not exist $(OBJD) mkdir $(OBJD) && echo. Created $(OBJD) $(OBJD)\trcssl.obj : trcssl.cpp $(OBJD)\trcssl.res : trcssl.rc $(BIND)\trcssl$(DETOURS_BITS).dll : $(OBJD)\trcssl.obj $(OBJD)\trcssl.res $(DEPS) cl /LD $(CFLAGS) /Fe$@ /Fd$(@R).pdb \ $(OBJD)\trcssl.obj $(OBJD)\trcssl.res \ /link $(LINKFLAGS) /subsystem:console \ /export:DetourFinishHelperProcess,@1,NONAME \ $(LIBS) $(OBJD)\trcssl$(DETOURS_BITS).bsc : $(OBJD)\trcssl.obj bscmake /v /n /o $@ $(OBJD)\trcssl.sbr ############################################################################## clean: -del *~ test.txt 2>nul -del $(BIND)\trcssl*.* 2>nul -rmdir /q /s $(OBJD) 2>nul realclean: clean -rmdir /q /s $(OBJDS) 2>nul ############################################### Install non-bit-size binaries. !IF "$(DETOURS_OPTION_PROCESSOR)" != "" $(OPTD)\trcssl$(DETOURS_OPTION_BITS).dll: $(OPTD)\trcssl$(DETOURS_OPTION_BITS).pdb: $(BIND)\trcssl$(DETOURS_OPTION_BITS).dll : $(OPTD)\trcssl$(DETOURS_OPTION_BITS).dll @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\trcssl$(DETOURS_OPTION_BITS).pdb : $(OPTD)\trcssl$(DETOURS_OPTION_BITS).pdb @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). option: \ $(BIND)\trcssl$(DETOURS_OPTION_BITS).dll \ $(BIND)\trcssl$(DETOURS_OPTION_BITS).pdb \ !ELSE option: !ENDIF ############################################################################## test: all @echo -------- Logging output to test.txt ------------ start $(BIND)\syelogd.exe /o test.txt $(BIND)\sleep5.exe 1 @echo -------- Should load trcssl$(DETOURS_BITS).dll dynamically using withdll.exe ------------ @echo. @echo ** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ** @echo ** @echo ** Close the Internet Explorer window to continue test. @echo ** @echo ** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ** @echo. $(BIND)\withdll -d:$(BIND)\trcssl$(DETOURS_BITS).dll \ "c:\program files\Internet Explorer\iexplore.exe" "https://www.microsoft.com" @echo -------- Log from syelog ------------- type test.txt ################################################################# End of File. ================================================ FILE: ext/detours/samples/tracessl/trcssl.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (trcssl.cpp of trcssl.dll) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #define _WIN32_WINNT 0x0400 #define WIN32 #define NT #define SECURITY_WIN32 #define _WINSOCK_DEPRECATED_NO_WARNINGS #define DBG_TRACE 0 #if _MSC_VER >= 1300 #include #endif #include #include #include #include "detours.h" #include "syelog.h" #define PULONG_PTR PVOID #define PLONG_PTR PVOID #define ULONG_PTR PVOID #define ENUMRESNAMEPROCA PVOID #define ENUMRESNAMEPROCW PVOID #define ENUMRESLANGPROCA PVOID #define ENUMRESLANGPROCW PVOID #define ENUMRESTYPEPROCA PVOID #define ENUMRESTYPEPROCW PVOID #define STGOPTIONS PVOID ////////////////////////////////////////////////////////////////////////////// #pragma warning(disable:4127) // Many of our asserts are constants. #define ASSERT_ALWAYS(x) \ do { \ if (!(x)) { \ AssertMessage(#x, __FILE__, __LINE__); \ DebugBreak(); \ } \ } while (0) #ifndef NDEBUG #define ASSERT(x) ASSERT_ALWAYS(x) #else #define ASSERT(x) #endif #define UNUSED(c) (c) = (c) ////////////////////////////////////////////////////////////////////////////// static HMODULE s_hInst = NULL; static WCHAR s_wzDllPath[MAX_PATH]; VOID _PrintDump(SOCKET socket, PCHAR pszData, INT cbData); VOID _PrintEnter(PCSTR psz, ...); VOID _PrintExit(PCSTR psz, ...); VOID _Print(PCSTR psz, ...); VOID AssertMessage(CONST PCHAR pszMsg, CONST PCHAR pszFile, ULONG nLine); ////////////////////////////////////////////////////////////////////////////// // extern "C" { HANDLE (WINAPI * Real_CreateFileW)(LPCWSTR a0, DWORD a1, DWORD a2, LPSECURITY_ATTRIBUTES a3, DWORD a4, DWORD a5, HANDLE a6) = CreateFileW; BOOL (WINAPI * Real_WriteFile)(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped) = WriteFile; BOOL (WINAPI * Real_FlushFileBuffers)(HANDLE hFile) = FlushFileBuffers; BOOL (WINAPI * Real_CloseHandle)(HANDLE hObject) = CloseHandle; BOOL (WINAPI * Real_WaitNamedPipeW)(LPCWSTR lpNamedPipeName, DWORD nTimeOut) = WaitNamedPipeW; BOOL (WINAPI * Real_SetNamedPipeHandleState)(HANDLE hNamedPipe, LPDWORD lpMode, LPDWORD lpMaxCollectionCount, LPDWORD lpCollectDataTimeout) = SetNamedPipeHandleState; DWORD (WINAPI * Real_GetCurrentProcessId)(VOID) = GetCurrentProcessId; VOID (WINAPI * Real_GetSystemTimeAsFileTime)(LPFILETIME lpSystemTimeAsFileTime) = GetSystemTimeAsFileTime; VOID (WINAPI * Real_InitializeCriticalSection)(LPCRITICAL_SECTION lpSection) = InitializeCriticalSection; VOID (WINAPI * Real_EnterCriticalSection)(LPCRITICAL_SECTION lpSection) = EnterCriticalSection; VOID (WINAPI * Real_LeaveCriticalSection)(LPCRITICAL_SECTION lpSection) = LeaveCriticalSection; } DWORD (WINAPI * Real_GetModuleFileNameW)(HMODULE a0, LPWSTR a1, DWORD a2) = GetModuleFileNameW; BOOL (WINAPI * Real_CreateProcessW)(LPCWSTR a0, LPWSTR a1, LPSECURITY_ATTRIBUTES a2, LPSECURITY_ATTRIBUTES a3, BOOL a4, DWORD a5, LPVOID a6, LPCWSTR a7, LPSTARTUPINFOW a8, LPPROCESS_INFORMATION a9) = CreateProcessW; #if _MSC_VER < 1300 SOCKET (WINAPI * Real_WSAAccept)(SOCKET a0, sockaddr* a1, LPINT a2, LPCONDITIONPROC a3, DWORD a4) = WSAAccept; #else SOCKET (WINAPI * Real_WSAAccept)(SOCKET a0, sockaddr* a1, LPINT a2, LPCONDITIONPROC a3, DWORD_PTR a4) = WSAAccept; #endif INT (WINAPI * Real_WSAAddressToStringA)(LPSOCKADDR a0, DWORD a1, LPWSAPROTOCOL_INFOA a2, LPSTR a3, LPDWORD a4) = WSAAddressToStringA; INT (WINAPI * Real_WSAAddressToStringW)(LPSOCKADDR a0, DWORD a1, LPWSAPROTOCOL_INFOW a2, LPWSTR a3, LPDWORD a4) = WSAAddressToStringW; HANDLE (WINAPI * Real_WSAAsyncGetHostByAddr)(HWND a0, u_int a1, CONST char* a2, int a3, int a4, char* a5, int a6) = WSAAsyncGetHostByAddr; HANDLE (WINAPI * Real_WSAAsyncGetHostByName)(HWND a0, u_int a1, CONST char* a2, char* a3, int a4) = WSAAsyncGetHostByName; HANDLE (WINAPI * Real_WSAAsyncGetProtoByName)(HWND a0, u_int a1, CONST char* a2, char* a3, int a4) = WSAAsyncGetProtoByName; HANDLE (WINAPI * Real_WSAAsyncGetProtoByNumber)(HWND a0, u_int a1, int a2, char* a3, int a4) = WSAAsyncGetProtoByNumber; HANDLE (WINAPI * Real_WSAAsyncGetServByName)(HWND a0, u_int a1, CONST char* a2, CONST char* a3, char* a4, int a5) = WSAAsyncGetServByName; HANDLE (WINAPI * Real_WSAAsyncGetServByPort)(HWND a0, u_int a1, int a2, CONST char* a3, char* a4, int a5) = WSAAsyncGetServByPort; int (WINAPI * Real_WSACancelAsyncRequest)(HANDLE a0) = WSACancelAsyncRequest; int (WINAPI * Real_WSACancelBlockingCall)(void) = WSACancelBlockingCall; int (WINAPI * Real_WSACleanup)(void) = WSACleanup; BOOL (WINAPI * Real_WSACloseEvent)(HANDLE a0) = WSACloseEvent; int (WINAPI * Real_WSAConnect)(SOCKET a0, CONST sockaddr* a1, int a2, LPWSABUF a3, LPWSABUF a4, LPQOS a5, LPQOS a6) = WSAConnect; HANDLE (WINAPI * Real_WSACreateEvent)(void) = WSACreateEvent; int (WINAPI * Real_WSADuplicateSocketA)(SOCKET a0, DWORD a1, LPWSAPROTOCOL_INFOA a2) = WSADuplicateSocketA; int (WINAPI * Real_WSADuplicateSocketW)(SOCKET a0, DWORD a1, LPWSAPROTOCOL_INFOW a2) = WSADuplicateSocketW; INT (WINAPI * Real_WSAEnumNameSpaceProvidersA)(LPDWORD a0, LPWSANAMESPACE_INFOA a1) = WSAEnumNameSpaceProvidersA; INT (WINAPI * Real_WSAEnumNameSpaceProvidersW)(LPDWORD a0, LPWSANAMESPACE_INFOW a1) = WSAEnumNameSpaceProvidersW; int (WINAPI * Real_WSAEnumNetworkEvents)(SOCKET a0, HANDLE a1, LPWSANETWORKEVENTS a2) = WSAEnumNetworkEvents; int (WINAPI * Real_WSAEnumProtocolsA)(LPINT a0, LPWSAPROTOCOL_INFOA a1, LPDWORD a2) = WSAEnumProtocolsA; int (WINAPI * Real_WSAEnumProtocolsW)(LPINT a0, LPWSAPROTOCOL_INFOW a1, LPDWORD a2) = WSAEnumProtocolsW; BOOL (WINAPI * Real_WSAGetOverlappedResult)(SOCKET a0, LPWSAOVERLAPPED a1, LPDWORD a2, BOOL a3, LPDWORD a4) = WSAGetOverlappedResult; BOOL (WINAPI * Real_WSAIsBlocking)(void) = WSAIsBlocking; SOCKET (WINAPI * Real_WSAJoinLeaf)(SOCKET a0, CONST sockaddr* a1, int a2, LPWSABUF a3, LPWSABUF a4, LPQOS a5, LPQOS a6, DWORD a7) = WSAJoinLeaf; INT (WINAPI * Real_WSAProviderConfigChange)(LPHANDLE a0, LPWSAOVERLAPPED a1, LPWSAOVERLAPPED_COMPLETION_ROUTINE a2) = WSAProviderConfigChange; int (WINAPI * Real_WSARecv)(SOCKET a0, LPWSABUF a1, DWORD a2, LPDWORD a3, LPDWORD a4, LPWSAOVERLAPPED a5, LPWSAOVERLAPPED_COMPLETION_ROUTINE a6) = WSARecv; int (WINAPI * Real_WSARecvDisconnect)(SOCKET a0, LPWSABUF a1) = WSARecvDisconnect; int (WINAPI * Real_WSARecvFrom)(SOCKET a0, LPWSABUF a1, DWORD a2, LPDWORD a3, LPDWORD a4, sockaddr* a5, LPINT a6, LPWSAOVERLAPPED a7, LPWSAOVERLAPPED_COMPLETION_ROUTINE a8) = WSARecvFrom; BOOL (WINAPI * Real_WSAResetEvent)(HANDLE a0) = WSAResetEvent; int (WINAPI * Real_WSASend)(SOCKET a0, LPWSABUF a1, DWORD a2, LPDWORD a3, DWORD a4, LPWSAOVERLAPPED a5, LPWSAOVERLAPPED_COMPLETION_ROUTINE a6) = WSASend; int (WINAPI * Real_WSASendDisconnect)(SOCKET a0, LPWSABUF a1) = WSASendDisconnect; int (WINAPI * Real_WSASendTo)(SOCKET a0, LPWSABUF a1, DWORD a2, LPDWORD a3, DWORD a4, CONST sockaddr* a5, int a6, LPWSAOVERLAPPED a7, LPWSAOVERLAPPED_COMPLETION_ROUTINE a8) = WSASendTo; INT (WINAPI * Real_WSAStringToAddressA)(LPSTR a0, INT a1, LPWSAPROTOCOL_INFOA a2, LPSOCKADDR a3, LPINT a4) = WSAStringToAddressA; INT (WINAPI * Real_WSAStringToAddressW)(LPWSTR a0, INT a1, LPWSAPROTOCOL_INFOW a2, LPSOCKADDR a3, LPINT a4) = WSAStringToAddressW; DWORD (WINAPI * Real_WSAWaitForMultipleEvents)(DWORD a0, CONST HANDLE * a1, BOOL a2, DWORD a3, BOOL a4) = WSAWaitForMultipleEvents; SOCKET (WINAPI * Real_accept)(SOCKET a0, sockaddr* a1, int* a2) = accept; int (WINAPI * Real_closesocket)(SOCKET a0) = closesocket; int (WINAPI * Real_connect)(SOCKET a0, CONST sockaddr* a1, int a2) = connect; int (WINAPI * Real_listen)(SOCKET a0, int a1) = listen; int (WINAPI * Real_recv)(SOCKET a0, char* a1, int a2, int a3) = recv; int (WINAPI * Real_recvfrom)(SOCKET a0, char* a1, int a2, int a3, sockaddr* a4, int* a5) = recvfrom; int (WINAPI * Real_send)(SOCKET a0, CONST char* a1, int a2, int a3) = send; int (WINAPI * Real_sendto)(SOCKET a0, CONST char* a1, int a2, int a3, CONST sockaddr* a4, int a5) = sendto; int (WINAPI * Real_shutdown)(SOCKET a0, int a1) = shutdown; SECURITY_STATUS (SEC_ENTRY * Real_EncryptMessage)( PCtxtHandle phContext, unsigned long fQOP, PSecBufferDesc pMessage, unsigned long MessageSeqNo) = EncryptMessage; SECURITY_STATUS (SEC_ENTRY * Real_DecryptMessage)( PCtxtHandle phContext, PSecBufferDesc pMessage, unsigned long MessageSeqNo, unsigned long * pfQOP) = DecryptMessage; ////////////////////////////////////////////////////////////////////////////// // Detours // BOOL WINAPI Mine_CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) { _PrintEnter("CreateProcessW(%ls,%ls,%p,%p,%x,%x,%p,%ls,%p,%p)\n", lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation); BOOL rv = 0; __try { rv = Real_CreateProcessW(lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation); } __finally { _PrintExit("CreateProcessW(,,,,,,,,,) -> %x\n", rv); }; return rv; } #if _MSC_VER < 1300 SOCKET WINAPI Mine_WSAAccept(SOCKET a0, sockaddr* a1, LPINT a2, LPCONDITIONPROC a3, DWORD a4) #else SOCKET WINAPI Mine_WSAAccept(SOCKET a0, sockaddr* a1, LPINT a2, LPCONDITIONPROC a3, DWORD_PTR a4) #endif { SOCKET rv = 0; __try { rv = Real_WSAAccept(a0, a1, a2, a3, a4); } __finally { _PrintEnter("%p: WSAAccept(,%p,%p,%p,%p) -> %p\n", a0, a1, a2, a3, a4, rv); _PrintExit(NULL); }; return rv; } INT WINAPI Mine_WSAAddressToStringA(LPSOCKADDR a0, DWORD a1, LPWSAPROTOCOL_INFOA a2, LPSTR a3, LPDWORD a4) { _PrintEnter("WSAAddressToStringA(%p,%x,%p,%p,%p)\n", a0, a1, a2, a3, a4); INT rv = 0; __try { rv = Real_WSAAddressToStringA(a0, a1, a2, a3, a4); } __finally { _PrintExit("WSAAddressToStringA(,,,,) -> %x\n", rv); }; return rv; } INT WINAPI Mine_WSAAddressToStringW(LPSOCKADDR a0, DWORD a1, LPWSAPROTOCOL_INFOW a2, LPWSTR a3, LPDWORD a4) { _PrintEnter("WSAAddressToStringW(%p,%x,%p,%p,%p)\n", a0, a1, a2, a3, a4); INT rv = 0; __try { rv = Real_WSAAddressToStringW(a0, a1, a2, a3, a4); } __finally { _PrintExit("WSAAddressToStringW(,,,,) -> %x\n", rv); }; return rv; } HANDLE WINAPI Mine_WSAAsyncGetHostByAddr(HWND a0, u_int a1, char* a2, int a3, int a4, char* a5, int a6) { _PrintEnter("WSAAsyncGetHostByAddr(%p,%x,%p,%x,%x,%p,%x)\n", a0, a1, a2, a3, a4, a5, a6); HANDLE rv = 0; __try { rv = Real_WSAAsyncGetHostByAddr(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("WSAAsyncGetHostByAddr(,,,,,,) -> %p\n", rv); }; return rv; } HANDLE WINAPI Mine_WSAAsyncGetHostByName(HWND a0, u_int a1, char* a2, char* a3, int a4) { _PrintEnter("WSAAsyncGetHostByName(%p,%x,%p,%p,%x)\n", a0, a1, a2, a3, a4); HANDLE rv = 0; __try { rv = Real_WSAAsyncGetHostByName(a0, a1, a2, a3, a4); } __finally { _PrintExit("WSAAsyncGetHostByName(,,,,) -> %p\n", rv); }; return rv; } HANDLE WINAPI Mine_WSAAsyncGetProtoByName(HWND a0, u_int a1, char* a2, char* a3, int a4) { _PrintEnter("WSAAsyncGetProtoByName(%p,%x,%p,%p,%x)\n", a0, a1, a2, a3, a4); HANDLE rv = 0; __try { rv = Real_WSAAsyncGetProtoByName(a0, a1, a2, a3, a4); } __finally { _PrintExit("WSAAsyncGetProtoByName(,,,,) -> %p\n", rv); }; return rv; } HANDLE WINAPI Mine_WSAAsyncGetProtoByNumber(HWND a0, u_int a1, int a2, char* a3, int a4) { _PrintEnter("WSAAsyncGetProtoByNumber(%p,%x,%p,%p,%x)\n", a0, a1, a2, a3, a4); HANDLE rv = 0; __try { rv = Real_WSAAsyncGetProtoByNumber(a0, a1, a2, a3, a4); } __finally { _PrintExit("WSAAsyncGetProtoByNumber(,,,,) -> %p\n", rv); }; return rv; } HANDLE WINAPI Mine_WSAAsyncGetServByName(HWND a0, u_int a1, char* a2, char* a3, char* a4, int a5) { _PrintEnter("WSAAsyncGetServByName(%p,%x,%p,%p,%p,%x)\n", a0, a1, a2, a3, a4, a5); HANDLE rv = 0; __try { rv = Real_WSAAsyncGetServByName(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("WSAAsyncGetServByName(,,,,,) -> %p\n", rv); }; return rv; } HANDLE WINAPI Mine_WSAAsyncGetServByPort(HWND a0, u_int a1, int a2, char* a3, char* a4, int a5) { _PrintEnter("WSAAsyncGetServByPort(%p,%x,%x,%p,%p,%x)\n", a0, a1, a2, a3, a4, a5); HANDLE rv = 0; __try { rv = Real_WSAAsyncGetServByPort(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("WSAAsyncGetServByPort(,,,,,) -> %p\n", rv); }; return rv; } int WINAPI Mine_WSACancelAsyncRequest(HANDLE a0) { _PrintEnter("WSACancelAsyncRequest(%p)\n", a0); int rv = 0; __try { rv = Real_WSACancelAsyncRequest(a0); } __finally { _PrintExit("WSACancelAsyncRequest() -> %x\n", rv); }; return rv; } int WINAPI Mine_WSACancelBlockingCall(void) { _PrintEnter("WSACancelBlockingCall()\n"); int rv = 0; __try { rv = Real_WSACancelBlockingCall(); } __finally { _PrintExit("WSACancelBlockingCall() -> %x\n", rv); }; return rv; } int WINAPI Mine_WSACleanup(void) { _PrintEnter("WSACleanup()\n"); int rv = 0; __try { rv = Real_WSACleanup(); } __finally { _PrintExit("WSACleanup() -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_WSACloseEvent(HANDLE a0) { _PrintEnter("WSACloseEvent(%p)\n", a0); BOOL rv = 0; __try { rv = Real_WSACloseEvent(a0); } __finally { _PrintExit("WSACloseEvent() -> %x\n", rv); }; return rv; } int WINAPI Mine_WSAConnect(SOCKET a0, sockaddr* a1, int a2, LPWSABUF a3, LPWSABUF a4, LPQOS a5, LPQOS a6) { int rv = 0; __try { rv = Real_WSAConnect(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintEnter("%p: WSAConnect(,%p,%x,%p,%p,%p,%p) -> %x\n", a0, a1, a2, a3, a4, a5, a6, rv); _PrintExit(NULL); }; return rv; } HANDLE WINAPI Mine_WSACreateEvent(void) { _PrintEnter("WSACreateEvent()\n"); HANDLE rv = 0; __try { rv = Real_WSACreateEvent(); } __finally { _PrintExit("WSACreateEvent() -> %p\n", rv); }; return rv; } int WINAPI Mine_WSADuplicateSocketA(SOCKET a0, DWORD a1, LPWSAPROTOCOL_INFOA a2) { _PrintEnter("%p: WSADuplicateSocketA(,%x,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_WSADuplicateSocketA(a0, a1, a2); } __finally { _PrintExit("%p: WSADuplicateSocketA(,,) -> %x\n", a0, rv); }; return rv; } int WINAPI Mine_WSADuplicateSocketW(SOCKET a0, DWORD a1, LPWSAPROTOCOL_INFOW a2) { _PrintEnter("%p: WSADuplicateSocketW(,%x,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_WSADuplicateSocketW(a0, a1, a2); } __finally { _PrintExit("%p: WSADuplicateSocketW(,,) -> %x\n", a0, rv); }; return rv; } INT WINAPI Mine_WSAEnumNameSpaceProvidersA(LPDWORD a0, LPWSANAMESPACE_INFOA a1) { _PrintEnter("WSAEnumNameSpaceProvidersA(%p,%p)\n", a0, a1); INT rv = 0; __try { rv = Real_WSAEnumNameSpaceProvidersA(a0, a1); } __finally { _PrintExit("WSAEnumNameSpaceProvidersA(,) -> %x\n", rv); }; return rv; } INT WINAPI Mine_WSAEnumNameSpaceProvidersW(LPDWORD a0, LPWSANAMESPACE_INFOW a1) { _PrintEnter("WSAEnumNameSpaceProvidersW(%p,%p)\n", a0, a1); INT rv = 0; __try { rv = Real_WSAEnumNameSpaceProvidersW(a0, a1); } __finally { _PrintExit("WSAEnumNameSpaceProvidersW(,) -> %x\n", rv); }; return rv; } int WINAPI Mine_WSAEnumNetworkEvents(SOCKET a0, HANDLE a1, LPWSANETWORKEVENTS a2) { _PrintEnter("%p: WSAEnumNetworkEvents(,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_WSAEnumNetworkEvents(a0, a1, a2); } __finally { _PrintExit("%p: WSAEnumNetworkEvents(,,) -> %x\n", a0, rv); }; return rv; } int WINAPI Mine_WSAEnumProtocolsA(LPINT a0, LPWSAPROTOCOL_INFOA a1, LPDWORD a2) { _PrintEnter("WSAEnumProtocolsA(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_WSAEnumProtocolsA(a0, a1, a2); } __finally { _PrintExit("WSAEnumProtocolsA(,,) -> %x\n", rv); }; return rv; } int WINAPI Mine_WSAEnumProtocolsW(LPINT a0, LPWSAPROTOCOL_INFOW a1, LPDWORD a2) { _PrintEnter("WSAEnumProtocolsW(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_WSAEnumProtocolsW(a0, a1, a2); } __finally { _PrintExit("WSAEnumProtocolsW(,,) -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_WSAGetOverlappedResult(SOCKET a0, LPWSAOVERLAPPED a1, LPDWORD a2, BOOL a3, LPDWORD a4) { _PrintEnter("%p: WSAGetOverlappedResult(,%p,%p,%x,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_WSAGetOverlappedResult(a0, a1, a2, a3, a4); } __finally { _PrintExit("%p: WSAGetOverlappedResult(,,,,) -> %x\n", a0, rv); }; return rv; } BOOL WINAPI Mine_WSAIsBlocking(void) { _PrintEnter("WSAIsBlocking()\n"); BOOL rv = 0; __try { rv = Real_WSAIsBlocking(); } __finally { _PrintExit("WSAIsBlocking() -> %x\n", rv); }; return rv; } SOCKET WINAPI Mine_WSAJoinLeaf(SOCKET a0, sockaddr* a1, int a2, LPWSABUF a3, LPWSABUF a4, LPQOS a5, LPQOS a6, DWORD a7) { _PrintEnter("%p: WSAJoinLeaf(,%p,%x,%p,%p,%p,%p,%x)\n", a0, a1, a2, a3, a4, a5, a6, a7); SOCKET rv = 0; __try { rv = Real_WSAJoinLeaf(a0, a1, a2, a3, a4, a5, a6, a7); } __finally { _PrintExit("%p: WSAJoinLeaf(,,,,,,,) -> %p\n", a0, rv); }; return rv; } INT WINAPI Mine_WSAProviderConfigChange(LPHANDLE a0, LPWSAOVERLAPPED a1, LPWSAOVERLAPPED_COMPLETION_ROUTINE a2) { _PrintEnter("WSAProviderConfigChange(%p,%p,%p)\n", a0, a1, a2); INT rv = 0; __try { rv = Real_WSAProviderConfigChange(a0, a1, a2); } __finally { _PrintExit("WSAProviderConfigChange(,,) -> %x\n", rv); }; return rv; } int WINAPI Mine_WSARecv(SOCKET a0, LPWSABUF a1, DWORD a2, LPDWORD a3, LPDWORD a4, LPWSAOVERLAPPED a5, LPWSAOVERLAPPED_COMPLETION_ROUTINE a6) { int rv = -1; __try { rv = Real_WSARecv(a0, a1, a2, a3, a4, a5, a6); } __finally { if (rv == 0) { _PrintEnter("%p: WSARecv(,%p,%x,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); #if 0 _PrintDump(a0, a1[0].buf, a1[0].len < *a3 ? a1[0].len : *a3); #endif _PrintExit("%p: WSARecv(,,,,,,) -> %x\n", a0, rv); } }; return rv; } int WINAPI Mine_WSARecvDisconnect(SOCKET a0, LPWSABUF a1) { _PrintEnter("%p: WSARecvDisconnect(,%p)\n", a0, a1); int rv = 0; __try { rv = Real_WSARecvDisconnect(a0, a1); } __finally { _PrintExit("%p: WSARecvDisconnect(,) -> %x\n", a0, rv); }; return rv; } int WINAPI Mine_WSARecvFrom(SOCKET a0, LPWSABUF a1, DWORD a2, LPDWORD a3, LPDWORD a4, sockaddr* a5, LPINT a6, LPWSAOVERLAPPED a7, LPWSAOVERLAPPED_COMPLETION_ROUTINE a8) { _PrintEnter("%p: WSARecvFrom(,%p,%x,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8); int rv = 0; __try { rv = Real_WSARecvFrom(a0, a1, a2, a3, a4, a5, a6, a7, a8); } __finally { _PrintExit("%p: WSARecvFrom(,,,,,,,,) -> %x\n", a0, rv); }; return rv; } BOOL WINAPI Mine_WSAResetEvent(HANDLE a0) { _PrintEnter("WSAResetEvent(%p)\n", a0); BOOL rv = 0; __try { rv = Real_WSAResetEvent(a0); } __finally { _PrintExit("WSAResetEvent() -> %x\n", rv); }; return rv; } int WINAPI Mine_WSASend(SOCKET a0, LPWSABUF a1, DWORD a2, LPDWORD a3, DWORD a4, LPWSAOVERLAPPED a5, LPWSAOVERLAPPED_COMPLETION_ROUTINE a6) { _PrintEnter("%p: WSASend(,%p,%x,%p,%x,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); int rv = 0; __try { rv = Real_WSASend(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("%p: WSASend(,,,,,,) -> %x\n", a0, rv); }; return rv; } int WINAPI Mine_WSASendDisconnect(SOCKET a0, LPWSABUF a1) { _PrintEnter("%p: WSASendDisconnect(,%p)\n", a0, a1); int rv = 0; __try { rv = Real_WSASendDisconnect(a0, a1); } __finally { _PrintExit("%p: WSASendDisconnect(,) -> %x\n", a0, rv); }; return rv; } int WINAPI Mine_WSASendTo(SOCKET a0, LPWSABUF a1, DWORD a2, LPDWORD a3, DWORD a4, sockaddr* a5, int a6, LPWSAOVERLAPPED a7, LPWSAOVERLAPPED_COMPLETION_ROUTINE a8) { _PrintEnter("%p: WSASendTo(,%p,%x,%p,%x,%p,%x,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8); int rv = 0; __try { rv = Real_WSASendTo(a0, a1, a2, a3, a4, a5, a6, a7, a8); } __finally { _PrintExit("%p: WSASendTo(,,,,,,,,) -> %x\n", a0, rv); }; return rv; } INT WINAPI Mine_WSAStringToAddressA(LPSTR a0, INT a1, LPWSAPROTOCOL_INFOA a2, LPSOCKADDR a3, LPINT a4) { _PrintEnter("WSAStringToAddressA(%p,%x,%p,%p,%p)\n", a0, a1, a2, a3, a4); INT rv = 0; __try { rv = Real_WSAStringToAddressA(a0, a1, a2, a3, a4); } __finally { _PrintExit("WSAStringToAddressA(,,,,) -> %x\n", rv); }; return rv; } INT WINAPI Mine_WSAStringToAddressW(LPWSTR a0, INT a1, LPWSAPROTOCOL_INFOW a2, LPSOCKADDR a3, LPINT a4) { _PrintEnter("WSAStringToAddressW(%p,%x,%p,%p,%p)\n", a0, a1, a2, a3, a4); INT rv = 0; __try { rv = Real_WSAStringToAddressW(a0, a1, a2, a3, a4); } __finally { _PrintExit("WSAStringToAddressW(,,,,) -> %x\n", rv); }; return rv; } DWORD WINAPI Mine_WSAWaitForMultipleEvents(DWORD a0, void** a1, BOOL a2, DWORD a3, BOOL a4) { _PrintEnter("WSAWaitForMultipleEvents(%x,%p,%x,%x,%x)\n", a0, a1, a2, a3, a4); DWORD rv = 0; __try { rv = Real_WSAWaitForMultipleEvents(a0, a1, a2, a3, a4); } __finally { _PrintExit("WSAWaitForMultipleEvents(,,,,) -> %x\n", rv); }; return rv; } SOCKET WINAPI Mine_accept(SOCKET a0, sockaddr* a1, int* a2) { SOCKET rv = 0; __try { rv = Real_accept(a0, a1, a2); } __finally { WCHAR wzAddress[512] = L""; int err = WSAGetLastError(); if (rv != INVALID_SOCKET) { DWORD nAddress = ARRAYSIZE(wzAddress); if (Real_WSAAddressToStringW(a1, *a2, NULL, wzAddress, &nAddress) != 0) { wzAddress[0] = 0; } } WSASetLastError(err); if (wzAddress[0]) { _PrintEnter("%p: accept(,%ls,%p) -> %p\n", a0, wzAddress, a2, rv); } else { _PrintEnter("%p: accept(,%p,%p) -> %p\n", a0, a1, a2, rv); } _PrintExit(NULL); }; return rv; } int WINAPI Mine_closesocket(SOCKET a0) { int rv = 0; __try { rv = Real_closesocket(a0); } __finally { _PrintEnter("%p: closesocket() -> %x\n", a0, rv); _PrintExit(NULL); }; return rv; } int WINAPI Mine_connect(SOCKET a0, sockaddr* name, int namelen) { int rv = 0; __try { rv = Real_connect(a0, name, namelen); } __finally { WCHAR wzAddress[512]; DWORD nAddress = ARRAYSIZE(wzAddress); int err = WSAGetLastError(); if (Real_WSAAddressToStringW(name, namelen, NULL, wzAddress, &nAddress) == 0) { if (rv == SOCKET_ERROR) { _PrintEnter("%p: connect(,%p:%ls,%x) -> %x [%d]\n", a0, name, wzAddress, namelen, rv, err); } else { _PrintEnter("%p: connect(,%p:%ls,%x) -> %x\n", a0, name, wzAddress, namelen, rv); } } else { if (rv == SOCKET_ERROR) { _PrintEnter("%p: connect(,%p,%x) -> %x [%d]\n", a0, name, namelen, rv, err); } else { _PrintEnter("%p: connect(,%p,%x) -> %x\n", a0, name, namelen, rv); } } WSASetLastError(err); _PrintExit(NULL); }; return rv; } int WINAPI Mine_listen(SOCKET a0, int a1) { _PrintEnter("%p: listen(,%x)\n", a0, a1); int rv = 0; __try { rv = Real_listen(a0, a1); } __finally { _PrintExit("%p: listen(,) -> %x\n", a0, rv); }; return rv; } int WINAPI Mine_recv(SOCKET a0, char* a1, int a2, int a3) { _PrintEnter("%p: recv(,%p,%x,%x)\n", a0, a1, a2, a3); int rv = 0; __try { rv = Real_recv(a0, a1, a2, a3); #if 0 _PrintDump(a0, a1, rv); #endif } __finally { _PrintExit("%p: recv(,%p,,) -> %x\n", a0, a1, rv); }; return rv; } int WINAPI Mine_recvfrom(SOCKET a0, char* a1, int a2, int a3, sockaddr* a4, int* a5) { _PrintEnter("%p: recvfrom(,%p,%x,%x,%p,%p)\n", a0, a1, a2, a3, a4, a5); int rv = 0; __try { rv = Real_recvfrom(a0, a1, a2, a3, a4, a5); #if 0 _PrintDump(a0, a1, rv); #endif } __finally { _PrintExit("%p: recvfrom(,%p,,,,) -> %x\n", a0, a1, rv); }; return rv; } VOID _PrintDump(SOCKET socket, PCHAR pszData, INT cbData) { if (pszData && cbData > 0) { CHAR szBuffer[256]; PCHAR pszBuffer = szBuffer; INT cbBuffer = 0; INT nLines = 0; while (cbData > 0) { #if ABBREVIATE if (nLines > 20) { *pszBuffer++ = '.'; *pszBuffer++ = '.'; *pszBuffer++ = '.'; cbBuffer += 3; break; } #endif if (*pszData == '\t') { *pszBuffer++ = '\\'; *pszBuffer++ = 't'; cbBuffer += 2; pszData++; cbData--; continue; } if (*pszData == '\r') { *pszBuffer++ = '\\'; *pszBuffer++ = 'r'; cbBuffer += 2; pszData++; cbData--; continue; } else if (*pszData == '\n') { *pszBuffer++ = '\\'; *pszBuffer++ = 'n'; cbBuffer += 2; *pszBuffer++ = '\0'; _Print("%p: %hs\n", socket, szBuffer); nLines++; pszBuffer = szBuffer; cbBuffer = 0; pszData++; cbData--; continue; } else if (cbBuffer >= 80) { *pszBuffer++ = '\0'; _Print("%p: %hs\n", socket, szBuffer); nLines++; pszBuffer = szBuffer; cbBuffer = 0; } if (*pszData < ' ' || *pszData >= 127) { *pszBuffer++ = '\\'; *pszBuffer++ = 'x'; *pszBuffer++ = "0123456789ABCDEF"[(*pszData & 0xf0) >> 4]; *pszBuffer++ = "0123456789ABCDEF"[(*pszData & 0x0f)]; cbBuffer += 4; } else { *pszBuffer++ = *pszData; } cbBuffer++; pszData++; cbData--; } if (cbBuffer > 0) { *pszBuffer++ = '\0'; _Print("%p: %hs\n", socket, szBuffer); } } } int WINAPI Mine_send(SOCKET a0, char* a1, int a2, int a3) { _PrintEnter("%p: send(,%p,%x,%x)\n", a0, a1, a2, a3); #if 0 _PrintDump(a0, a1, a2); #endif int rv = 0; __try { rv = Real_send(a0, a1, a2, a3); } __finally { if (rv == SOCKET_ERROR) { int err = WSAGetLastError(); _PrintExit("%p: send(,,,) -> %x (%d)\n", a0, rv, err); } else { _PrintExit("%p: send(,,,) -> %x\n", a0, rv); } }; return rv; } int WINAPI Mine_sendto(SOCKET a0, char* a1, int a2, int a3, sockaddr* a4, int a5) { _PrintEnter("%p: sendto(,%s,%x,%x,%p,%x)\n", a0, a1, a2, a3, a4, a5); int rv = 0; __try { rv = Real_sendto(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("%p: sendto(%ls,,,,,) -> %x\n", a0, a1, rv); }; return rv; } int WINAPI Mine_shutdown(SOCKET a0, int a1) { _PrintEnter("%p: shutdown(,%x)\n", a0, a1); int rv = 0; __try { rv = Real_shutdown(a0, a1); } __finally { _PrintExit("%p: shutdown(,) -> %x\n", a0, rv); }; return rv; } SECURITY_STATUS SEC_ENTRY Mine_EncryptMessage( PCtxtHandle phContext, unsigned long fQOP, PSecBufferDesc pMessage, unsigned long MessageSeqNo) { _PrintEnter("%p: EncryptMessage(%x,%x,%x)\n", phContext, fQOP, pMessage, MessageSeqNo); SECURITY_STATUS rv = 0; __try { if (pMessage != NULL) { for (unsigned b = 0; b < pMessage->cBuffers; b++) { PSecBuffer pBuffer = &pMessage->pBuffers[b]; if ((pBuffer->BufferType & 0xfff) == 1) { _Print("%p: Type=%08x Size=%d\n", phContext, pBuffer->BufferType, pBuffer->cbBuffer); _PrintDump((SOCKET)phContext, (PCHAR)pBuffer->pvBuffer, pBuffer->cbBuffer); } } } rv = Real_EncryptMessage(phContext, fQOP, pMessage, MessageSeqNo); } __finally { _PrintExit("%p: EncryptMessage(,) -> %x\n", phContext, rv); }; return rv; } SECURITY_STATUS SEC_ENTRY Mine_DecryptMessage( PCtxtHandle phContext, PSecBufferDesc pMessage, unsigned long MessageSeqNo, unsigned long * pfQOP) { _PrintEnter("%p: DecryptMessage(%x,%x,%x)\n", phContext, pMessage, MessageSeqNo, pfQOP); SECURITY_STATUS rv = 0; __try { rv = Real_DecryptMessage(phContext, pMessage, MessageSeqNo, pfQOP); for (unsigned b = 0; b < pMessage->cBuffers; b++) { PSecBuffer pBuffer = &pMessage->pBuffers[b]; if ((pBuffer->BufferType & 0xfff) == 1) { _Print("%p: Type=%08x Size=%d\n", phContext, pBuffer->BufferType, pBuffer->cbBuffer); _PrintDump((SOCKET)phContext, (PCHAR)pBuffer->pvBuffer, pBuffer->cbBuffer); } } } __finally { _PrintExit("%p: DecryptMessage(,) -> %x\n", phContext, rv); }; return rv; } ///////////////////////////////////////////////////////////// // AttachDetours // PCHAR DetRealName(PCHAR psz) { PCHAR pszBeg = psz; // Move to end of name. while (*psz) { psz++; } // Move back through A-Za-z0-9 names. while (psz > pszBeg && ((psz[-1] >= 'A' && psz[-1] <= 'Z') || (psz[-1] >= 'a' && psz[-1] <= 'z') || (psz[-1] >= '0' && psz[-1] <= '9'))) { psz--; } return psz; } VOID DetAttach(PVOID *ppbReal, PVOID pbMine, PCHAR psz) { LONG l = DetourAttach(ppbReal, pbMine); if (l != 0) { Syelog(SYELOG_SEVERITY_NOTICE, "Attach failed: `%s': error %d\n", DetRealName(psz), l); } } VOID DetDetach(PVOID *ppbReal, PVOID pbMine, PCHAR psz) { LONG l = DetourDetach(ppbReal, pbMine); if (l != 0) { Syelog(SYELOG_SEVERITY_NOTICE, "Detach failed: `%s': error %d\n", DetRealName(psz), l); } } #define ATTACH(x) DetAttach(&(PVOID&)Real_##x,Mine_##x,#x) #define DETACH(x) DetDetach(&(PVOID&)Real_##x,Mine_##x,#x) LONG AttachDetours(VOID) { DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); ATTACH(CreateProcessW); ATTACH(DecryptMessage); ATTACH(EncryptMessage); ATTACH(WSAAccept); ATTACH(WSAAddressToStringA); ATTACH(WSAAddressToStringW); ATTACH(WSAAsyncGetHostByAddr); ATTACH(WSAAsyncGetHostByName); ATTACH(WSAAsyncGetProtoByName); ATTACH(WSAAsyncGetProtoByNumber); ATTACH(WSAAsyncGetServByName); ATTACH(WSAAsyncGetServByPort); ATTACH(WSACancelAsyncRequest); ATTACH(WSACancelBlockingCall); ATTACH(WSACleanup); ATTACH(WSACloseEvent); ATTACH(WSAConnect); ATTACH(WSACreateEvent); ATTACH(WSADuplicateSocketA); ATTACH(WSADuplicateSocketW); ATTACH(WSAEnumNameSpaceProvidersA); ATTACH(WSAEnumNameSpaceProvidersW); ATTACH(WSAEnumNetworkEvents); ATTACH(WSAEnumProtocolsA); ATTACH(WSAEnumProtocolsW); ATTACH(WSAIsBlocking); ATTACH(WSAJoinLeaf); ATTACH(WSAProviderConfigChange); ATTACH(WSARecv); ATTACH(WSARecvDisconnect); ATTACH(WSARecvFrom); ATTACH(WSAResetEvent); ATTACH(WSASend); ATTACH(WSASendDisconnect); ATTACH(WSASendTo); ATTACH(WSAStringToAddressA); ATTACH(WSAStringToAddressW); ATTACH(WSAWaitForMultipleEvents); ATTACH(accept); ATTACH(closesocket); ATTACH(connect); ATTACH(listen); ATTACH(recv); ATTACH(recvfrom); ATTACH(send); ATTACH(sendto); ATTACH(shutdown); return DetourTransactionCommit(); } LONG DetachDetours(VOID) { DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DETACH(CreateProcessW); DETACH(DecryptMessage); DETACH(EncryptMessage); DETACH(WSAAccept); DETACH(WSAAddressToStringA); DETACH(WSAAddressToStringW); DETACH(WSAAsyncGetHostByAddr); DETACH(WSAAsyncGetHostByName); DETACH(WSAAsyncGetProtoByName); DETACH(WSAAsyncGetProtoByNumber); DETACH(WSAAsyncGetServByName); DETACH(WSAAsyncGetServByPort); DETACH(WSACancelAsyncRequest); DETACH(WSACancelBlockingCall); DETACH(WSACleanup); DETACH(WSACloseEvent); DETACH(WSAConnect); DETACH(WSACreateEvent); DETACH(WSADuplicateSocketA); DETACH(WSADuplicateSocketW); DETACH(WSAEnumNameSpaceProvidersA); DETACH(WSAEnumNameSpaceProvidersW); DETACH(WSAEnumNetworkEvents); DETACH(WSAEnumProtocolsA); DETACH(WSAEnumProtocolsW); DETACH(WSAIsBlocking); DETACH(WSAJoinLeaf); DETACH(WSAProviderConfigChange); DETACH(WSARecv); DETACH(WSARecvDisconnect); DETACH(WSARecvFrom); DETACH(WSAResetEvent); DETACH(WSASend); DETACH(WSASendDisconnect); DETACH(WSASendTo); DETACH(WSAStringToAddressA); DETACH(WSAStringToAddressW); DETACH(WSAWaitForMultipleEvents); DETACH(accept); DETACH(closesocket); DETACH(connect); DETACH(listen); DETACH(recv); DETACH(recvfrom); DETACH(send); DETACH(sendto); DETACH(shutdown); return DetourTransactionCommit(); } // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////// Logging System. // static BOOL s_bLog = 1; static LONG s_nTlsIndent = -1; static LONG s_nTlsThread = -1; static LONG s_nThreadCnt = 0; VOID _PrintEnter(const CHAR *psz, ...) { DWORD dwErr = GetLastError(); LONG nIndent = 0; LONG nThread = 0; if (s_nTlsIndent >= 0) { nIndent = (LONG)(LONG_PTR)TlsGetValue(s_nTlsIndent); TlsSetValue(s_nTlsIndent, (PVOID)(LONG_PTR)(nIndent + 1)); } if (s_nTlsThread >= 0) { nThread = (LONG)(LONG_PTR)TlsGetValue(s_nTlsThread); } if (s_bLog && psz) { CHAR szBuf[1024]; PCHAR pszBuf = szBuf; PCHAR pszEnd = szBuf + ARRAYSIZE(szBuf) - 1; LONG nLen = (nIndent > 0) ? (nIndent < 35 ? nIndent * 2 : 70) : 0; *pszBuf++ = (CHAR)('0' + ((nThread / 100) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 10) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 1) % 10)); *pszBuf++ = ' '; while (nLen-- > 0) { *pszBuf++ = ' '; } va_list args; va_start(args, psz); while ((*pszBuf++ = *psz++) != 0 && pszBuf < pszEnd) { // Copy characters. } *pszEnd = '\0'; SyelogV(SYELOG_SEVERITY_INFORMATION, szBuf, args); va_end(args); } SetLastError(dwErr); } VOID _PrintExit(const CHAR *psz, ...) { DWORD dwErr = GetLastError(); LONG nIndent = 0; LONG nThread = 0; if (s_nTlsIndent >= 0) { nIndent = (LONG)(LONG_PTR)TlsGetValue(s_nTlsIndent) - 1; ASSERT(nIndent >= 0); TlsSetValue(s_nTlsIndent, (PVOID)(LONG_PTR)nIndent); } if (s_nTlsThread >= 0) { nThread = (LONG)(LONG_PTR)TlsGetValue(s_nTlsThread); } if (s_bLog && psz) { CHAR szBuf[1024]; PCHAR pszBuf = szBuf; PCHAR pszEnd = szBuf + ARRAYSIZE(szBuf) - 1; LONG nLen = (nIndent > 0) ? (nIndent < 35 ? nIndent * 2 : 70) : 0; *pszBuf++ = (CHAR)('0' + ((nThread / 100) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 10) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 1) % 10)); *pszBuf++ = ' '; while (nLen-- > 0) { *pszBuf++ = ' '; } va_list args; va_start(args, psz); while ((*pszBuf++ = *psz++) != 0 && pszBuf < pszEnd) { // Copy characters. } *pszEnd = '\0'; SyelogV(SYELOG_SEVERITY_INFORMATION, szBuf, args); va_end(args); } SetLastError(dwErr); } VOID _Print(const CHAR *psz, ...) { DWORD dwErr = GetLastError(); LONG nIndent = 0; LONG nThread = 0; if (s_nTlsIndent >= 0) { nIndent = (LONG)(LONG_PTR)TlsGetValue(s_nTlsIndent); } if (s_nTlsThread >= 0) { nThread = (LONG)(LONG_PTR)TlsGetValue(s_nTlsThread); } if (s_bLog && psz) { CHAR szBuf[1024]; PCHAR pszBuf = szBuf; PCHAR pszEnd = szBuf + ARRAYSIZE(szBuf) - 1; LONG nLen = (nIndent > 0) ? (nIndent < 35 ? nIndent * 2 : 70) : 0; *pszBuf++ = (CHAR)('0' + ((nThread / 100) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 10) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 1) % 10)); *pszBuf++ = ' '; while (nLen-- > 0) { *pszBuf++ = ' '; } va_list args; va_start(args, psz); while ((*pszBuf++ = *psz++) != 0 && pszBuf < pszEnd) { // Copy characters. } *pszEnd = '\0'; SyelogV(SYELOG_SEVERITY_INFORMATION, szBuf, args); va_end(args); } SetLastError(dwErr); } VOID AssertMessage(CONST PCHAR pszMsg, CONST PCHAR pszFile, ULONG nLine) { Syelog(SYELOG_SEVERITY_FATAL, "ASSERT(%s) failed in %s, line %d.\n", pszMsg, pszFile, nLine); } ////////////////////////////////////////////////////////////////////////////// // // DLL module information // BOOL ThreadAttach(HMODULE hDll) { (void)hDll; if (s_nTlsIndent >= 0) { TlsSetValue(s_nTlsIndent, (PVOID)0); } if (s_nTlsThread >= 0) { LONG nThread = InterlockedIncrement(&s_nThreadCnt); TlsSetValue(s_nTlsThread, (PVOID)(LONG_PTR)nThread); } return TRUE; } BOOL ThreadDetach(HMODULE hDll) { (void)hDll; if (s_nTlsIndent >= 0) { TlsSetValue(s_nTlsIndent, (PVOID)0); } if (s_nTlsThread >= 0) { TlsSetValue(s_nTlsThread, (PVOID)0); } return TRUE; } BOOL ProcessAttach(HMODULE hDll) { s_bLog = FALSE; s_nTlsIndent = TlsAlloc(); s_nTlsThread = TlsAlloc(); WCHAR wzExeName[MAX_PATH]; s_hInst = hDll; Real_GetModuleFileNameW(hDll, s_wzDllPath, ARRAYSIZE(s_wzDllPath)); Real_GetModuleFileNameW(NULL, wzExeName, ARRAYSIZE(wzExeName)); SyelogOpen("trcssl" DETOURS_STRINGIFY(DETOURS_BITS), SYELOG_FACILITY_APPLICATION); Syelog(SYELOG_SEVERITY_INFORMATION, "##################################################################\n"); Syelog(SYELOG_SEVERITY_INFORMATION, "### %ls\n", wzExeName); LONG error = AttachDetours(); if (error != NO_ERROR) { Syelog(SYELOG_SEVERITY_FATAL, "### Error attaching detours: %d\n", error); } ThreadAttach(hDll); s_bLog = TRUE; return TRUE; } BOOL ProcessDetach(HMODULE hDll) { ThreadDetach(hDll); s_bLog = FALSE; LONG error = DetachDetours(); if (error != NO_ERROR) { Syelog(SYELOG_SEVERITY_FATAL, "### Error detaching detours: %d\n", error); } Syelog(SYELOG_SEVERITY_NOTICE, "### Closing.\n"); SyelogClose(FALSE); if (s_nTlsIndent >= 0) { TlsFree(s_nTlsIndent); } if (s_nTlsThread >= 0) { TlsFree(s_nTlsThread); } return TRUE; } BOOL APIENTRY DllMain(HINSTANCE hModule, DWORD dwReason, PVOID lpReserved) { (void)hModule; (void)lpReserved; if (DetourIsHelperProcess()) { return TRUE; } switch (dwReason) { case DLL_PROCESS_ATTACH: DetourRestoreAfterWith(); return ProcessAttach(hModule); case DLL_PROCESS_DETACH: return ProcessDetach(hModule); case DLL_THREAD_ATTACH: return ThreadAttach(hModule); case DLL_THREAD_DETACH: return ThreadDetach(hModule); } return TRUE; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/tracessl/trcssl.rc ================================================ ////////////////////////////////////////////////////////////////////////////// // // Version information for trcssl.rc. // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include "detver.h" #define VER_INTERNALNAME_STR "trcssl" DETOURS_STRINGIFY(DETOURS_BITS) #define VER_ORIGINALFILENAME_STR "trcsll" DETOURS_STRINGIFY(DETOURS_BITS) ".dll" #define VER_FILEDESCRIPTION_STR "Detours SSL Trace Module" #define VER_COMPANYNAME_STR "Microsoft Corporation" #include "common.ver" ================================================ FILE: ext/detours/samples/tracetcp/Makefile ================================================ ############################################################################## ## ## Utility to trace WinSock TCP APIs. ## ## Microsoft Research Detours Package ## ## Copyright (c) Microsoft Corporation. All rights reserved. ## !include ..\common.mak LIBS=$(LIBS) kernel32.lib ws2_32.lib ############################################################################## all: dirs \ $(BIND)\trctcp$(DETOURS_BITS).dll \ !IF $(DETOURS_SOURCE_BROWSING)==1 $(OBJD)\trctcp$(DETOURS_BITS).bsc \ !ENDIF option ############################################################################## dirs: @if not exist $(BIND) mkdir $(BIND) && echo. Created $(BIND) @if not exist $(OBJD) mkdir $(OBJD) && echo. Created $(OBJD) $(OBJD)\trctcp.obj: trctcp.cpp $(OBJD)\trctcp.res: trctcp.rc $(BIND)\trctcp$(DETOURS_BITS).dll: $(OBJD)\trctcp.obj $(OBJD)\trctcp.res $(DEPS) cl /LD $(CFLAGS) /Fe$@ /Fd$(@R).pdb \ $(OBJD)\trctcp.obj $(OBJD)\trctcp.res \ /link $(LINKFLAGS) /subsystem:console \ /export:DetourFinishHelperProcess,@1,NONAME \ $(LIBS) $(OBJD)\trctcp$(DETOURS_BITS).bsc : $(OBJD)\trctcp.obj bscmake /v /n /o $@ $(OBJD)\trctcp.sbr ############################################################################## clean: -del *~ test.txt 2>nul -del $(BIND)\trctcp*.* 2>nul -rmdir /q /s $(OBJD) 2>nul realclean: clean -rmdir /q /s $(OBJDS) 2>nul ############################################### Install non-bit-size binaries. !IF "$(DETOURS_OPTION_PROCESSOR)" != "" $(OPTD)\trctcp$(DETOURS_OPTION_BITS).dll: $(OPTD)\trctcp$(DETOURS_OPTION_BITS).pdb: $(BIND)\trctcp$(DETOURS_OPTION_BITS).dll : $(OPTD)\trctcp$(DETOURS_OPTION_BITS).dll @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). $(BIND)\trctcp$(DETOURS_OPTION_BITS).pdb : $(OPTD)\trctcp$(DETOURS_OPTION_BITS).pdb @if exist $? copy /y $? $(BIND) >nul && echo $@ copied from $(DETOURS_OPTION_PROCESSOR). option: \ $(BIND)\trctcp$(DETOURS_OPTION_BITS).dll \ $(BIND)\trctcp$(DETOURS_OPTION_BITS).pdb \ !ELSE option: !ENDIF ############################################################################## test: all @echo -------- Logging output to test.txt ------------ start $(BIND)\syelogd.exe /o test.txt $(BIND)\sleep5.exe 1 @echo -------- Should load trctcp$(DETOURS_BITS).dll dynamically using withdll.exe ------------ @echo. @echo ** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ** @echo ** @echo ** Close the Internet Explorer window to continue test. @echo ** @echo ** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ** @echo. $(BIND)\withdll -d:$(BIND)\trctcp$(DETOURS_BITS).dll \ "c:\program files\Internet Explorer\iexplore.exe" "http://www.microsoft.com" @echo -------- Log from syelog ------------- type test.txt debug: all windbg -g -G -o $(BIND)\withdll -d:$(BIND)\trctcp$(DETOURS_BITS).dll \ "c:\program files\Internet Explorer\iexplore.exe" "http://www.microsoft.com" ################################################################# End of File. ================================================ FILE: ext/detours/samples/tracetcp/trctcp.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (trctcp.cpp of trctcp.dll) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #define _WIN32_WINNT 0x0400 #define WIN32 #define NT #define _WINSOCK_DEPRECATED_NO_WARNINGS #define DBG_TRACE 0 #if _MSC_VER >= 1300 #include #endif #include #include #include "detours.h" #include "syelog.h" #define PULONG_PTR PVOID #define PLONG_PTR PVOID #define ULONG_PTR PVOID #define ENUMRESNAMEPROCA PVOID #define ENUMRESNAMEPROCW PVOID #define ENUMRESLANGPROCA PVOID #define ENUMRESLANGPROCW PVOID #define ENUMRESTYPEPROCA PVOID #define ENUMRESTYPEPROCW PVOID #define STGOPTIONS PVOID ////////////////////////////////////////////////////////////////////////////// #pragma warning(disable:4127) // Many of our asserts are constants. #define ASSERT_ALWAYS(x) \ do { \ if (!(x)) { \ AssertMessage(#x, __FILE__, __LINE__); \ DebugBreak(); \ } \ } while (0) #ifndef NDEBUG #define ASSERT(x) ASSERT_ALWAYS(x) #else #define ASSERT(x) #endif #define UNUSED(c) (c) = (c) ////////////////////////////////////////////////////////////////////////////// static HMODULE s_hInst = NULL; static WCHAR s_wzDllPath[MAX_PATH]; VOID _PrintDump(SOCKET socket, PCHAR pszData, INT cbData); VOID _PrintEnter(PCSTR psz, ...); VOID _PrintExit(PCSTR psz, ...); VOID _Print(PCSTR psz, ...); VOID AssertMessage(CONST PCHAR pszMsg, CONST PCHAR pszFile, ULONG nLine); ////////////////////////////////////////////////////////////////////////////// // extern "C" { HANDLE (WINAPI * Real_CreateFileW)(LPCWSTR a0, DWORD a1, DWORD a2, LPSECURITY_ATTRIBUTES a3, DWORD a4, DWORD a5, HANDLE a6) = CreateFileW; BOOL (WINAPI * Real_WriteFile)(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped) = WriteFile; BOOL (WINAPI * Real_FlushFileBuffers)(HANDLE hFile) = FlushFileBuffers; BOOL (WINAPI * Real_CloseHandle)(HANDLE hObject) = CloseHandle; BOOL (WINAPI * Real_WaitNamedPipeW)(LPCWSTR lpNamedPipeName, DWORD nTimeOut) = WaitNamedPipeW; BOOL (WINAPI * Real_SetNamedPipeHandleState)(HANDLE hNamedPipe, LPDWORD lpMode, LPDWORD lpMaxCollectionCount, LPDWORD lpCollectDataTimeout) = SetNamedPipeHandleState; DWORD (WINAPI * Real_GetCurrentProcessId)(VOID) = GetCurrentProcessId; VOID (WINAPI * Real_GetSystemTimeAsFileTime)(LPFILETIME lpSystemTimeAsFileTime) = GetSystemTimeAsFileTime; VOID (WINAPI * Real_InitializeCriticalSection)(LPCRITICAL_SECTION lpSection) = InitializeCriticalSection; VOID (WINAPI * Real_EnterCriticalSection)(LPCRITICAL_SECTION lpSection) = EnterCriticalSection; VOID (WINAPI * Real_LeaveCriticalSection)(LPCRITICAL_SECTION lpSection) = LeaveCriticalSection; } DWORD (WINAPI * Real_GetModuleFileNameW)(HMODULE a0, LPWSTR a1, DWORD a2) = GetModuleFileNameW; BOOL (WINAPI * Real_CreateProcessW)(LPCWSTR a0, LPWSTR a1, LPSECURITY_ATTRIBUTES a2, LPSECURITY_ATTRIBUTES a3, BOOL a4, DWORD a5, LPVOID a6, LPCWSTR a7, LPSTARTUPINFOW a8, LPPROCESS_INFORMATION a9) = CreateProcessW; #if _MSC_VER < 1300 SOCKET (WINAPI * Real_WSAAccept)(SOCKET a0, sockaddr* a1, LPINT a2, LPCONDITIONPROC a3, DWORD a4) = WSAAccept; #else SOCKET (WINAPI * Real_WSAAccept)(SOCKET a0, sockaddr* a1, LPINT a2, LPCONDITIONPROC a3, DWORD_PTR a4) = WSAAccept; #endif INT (WINAPI * Real_WSAAddressToStringA)(LPSOCKADDR a0, DWORD a1, LPWSAPROTOCOL_INFOA a2, LPSTR a3, LPDWORD a4) = WSAAddressToStringA; INT (WINAPI * Real_WSAAddressToStringW)(LPSOCKADDR a0, DWORD a1, LPWSAPROTOCOL_INFOW a2, LPWSTR a3, LPDWORD a4) = WSAAddressToStringW; HANDLE (WINAPI * Real_WSAAsyncGetHostByAddr)(HWND a0, u_int a1, CONST char* a2, int a3, int a4, char* a5, int a6) = WSAAsyncGetHostByAddr; HANDLE (WINAPI * Real_WSAAsyncGetHostByName)(HWND a0, u_int a1, CONST char* a2, char* a3, int a4) = WSAAsyncGetHostByName; HANDLE (WINAPI * Real_WSAAsyncGetProtoByName)(HWND a0, u_int a1, CONST char* a2, char* a3, int a4) = WSAAsyncGetProtoByName; HANDLE (WINAPI * Real_WSAAsyncGetProtoByNumber)(HWND a0, u_int a1, int a2, char* a3, int a4) = WSAAsyncGetProtoByNumber; HANDLE (WINAPI * Real_WSAAsyncGetServByName)(HWND a0, u_int a1, CONST char* a2, CONST char* a3, char* a4, int a5) = WSAAsyncGetServByName; HANDLE (WINAPI * Real_WSAAsyncGetServByPort)(HWND a0, u_int a1, int a2, CONST char* a3, char* a4, int a5) = WSAAsyncGetServByPort; int (WINAPI * Real_WSACancelAsyncRequest)(HANDLE a0) = WSACancelAsyncRequest; int (WINAPI * Real_WSACancelBlockingCall)(void) = WSACancelBlockingCall; int (WINAPI * Real_WSACleanup)(void) = WSACleanup; BOOL (WINAPI * Real_WSACloseEvent)(HANDLE a0) = WSACloseEvent; int (WINAPI * Real_WSAConnect)(SOCKET a0, CONST sockaddr* a1, int a2, LPWSABUF a3, LPWSABUF a4, LPQOS a5, LPQOS a6) = WSAConnect; HANDLE (WINAPI * Real_WSACreateEvent)(void) = WSACreateEvent; int (WINAPI * Real_WSADuplicateSocketA)(SOCKET a0, DWORD a1, LPWSAPROTOCOL_INFOA a2) = WSADuplicateSocketA; int (WINAPI * Real_WSADuplicateSocketW)(SOCKET a0, DWORD a1, LPWSAPROTOCOL_INFOW a2) = WSADuplicateSocketW; INT (WINAPI * Real_WSAEnumNameSpaceProvidersA)(LPDWORD a0, LPWSANAMESPACE_INFOA a1) = WSAEnumNameSpaceProvidersA; INT (WINAPI * Real_WSAEnumNameSpaceProvidersW)(LPDWORD a0, LPWSANAMESPACE_INFOW a1) = WSAEnumNameSpaceProvidersW; int (WINAPI * Real_WSAEnumNetworkEvents)(SOCKET a0, HANDLE a1, LPWSANETWORKEVENTS a2) = WSAEnumNetworkEvents; int (WINAPI * Real_WSAEnumProtocolsA)(LPINT a0, LPWSAPROTOCOL_INFOA a1, LPDWORD a2) = WSAEnumProtocolsA; int (WINAPI * Real_WSAEnumProtocolsW)(LPINT a0, LPWSAPROTOCOL_INFOW a1, LPDWORD a2) = WSAEnumProtocolsW; BOOL (WINAPI * Real_WSAGetOverlappedResult)(SOCKET a0, LPWSAOVERLAPPED a1, LPDWORD a2, BOOL a3, LPDWORD a4) = WSAGetOverlappedResult; BOOL (WINAPI * Real_WSAIsBlocking)(void) = WSAIsBlocking; SOCKET (WINAPI * Real_WSAJoinLeaf)(SOCKET a0, CONST sockaddr* a1, int a2, LPWSABUF a3, LPWSABUF a4, LPQOS a5, LPQOS a6, DWORD a7) = WSAJoinLeaf; INT (WINAPI * Real_WSALookupServiceBeginA)( LPWSAQUERYSETA lpqsRestrictions, DWORD dwControlFlags, LPHANDLE lphLookup ) = WSALookupServiceBeginA; INT (WINAPI * Real_WSALookupServiceBeginW)( LPWSAQUERYSETW lpqsRestrictions, DWORD dwControlFlags, LPHANDLE lphLookup ) = WSALookupServiceBeginW; INT (WINAPI * Real_WSALookupServiceNextA)( HANDLE hLookup, DWORD dwControlFlags, LPDWORD lpdwBufferLength, LPWSAQUERYSETA lpqsResults ) = WSALookupServiceNextA; INT (WINAPI * Real_WSALookupServiceNextW)( HANDLE hLookup, DWORD dwControlFlags, LPDWORD lpdwBufferLength, LPWSAQUERYSETW lpqsResults ) = WSALookupServiceNextW; INT (WINAPI * Real_WSALookupServiceEnd)( HANDLE hLookup ) = WSALookupServiceEnd; INT (WINAPI * Real_WSAProviderConfigChange)(LPHANDLE a0, LPWSAOVERLAPPED a1, LPWSAOVERLAPPED_COMPLETION_ROUTINE a2) = WSAProviderConfigChange; int (WINAPI * Real_WSARecv)(SOCKET a0, LPWSABUF a1, DWORD a2, LPDWORD a3, LPDWORD a4, LPWSAOVERLAPPED a5, LPWSAOVERLAPPED_COMPLETION_ROUTINE a6) = WSARecv; int (WINAPI * Real_WSARecvDisconnect)(SOCKET a0, LPWSABUF a1) = WSARecvDisconnect; int (WINAPI * Real_WSARecvFrom)(SOCKET a0, LPWSABUF a1, DWORD a2, LPDWORD a3, LPDWORD a4, sockaddr* a5, LPINT a6, LPWSAOVERLAPPED a7, LPWSAOVERLAPPED_COMPLETION_ROUTINE a8) = WSARecvFrom; BOOL (WINAPI * Real_WSAResetEvent)(HANDLE a0) = WSAResetEvent; int (WINAPI * Real_WSASend)(SOCKET a0, LPWSABUF a1, DWORD a2, LPDWORD a3, DWORD a4, LPWSAOVERLAPPED a5, LPWSAOVERLAPPED_COMPLETION_ROUTINE a6) = WSASend; int (WINAPI * Real_WSASendDisconnect)(SOCKET a0, LPWSABUF a1) = WSASendDisconnect; int (WINAPI * Real_WSASendTo)(SOCKET a0, LPWSABUF a1, DWORD a2, LPDWORD a3, DWORD a4, CONST sockaddr* a5, int a6, LPWSAOVERLAPPED a7, LPWSAOVERLAPPED_COMPLETION_ROUTINE a8) = WSASendTo; INT (WINAPI * Real_WSAStringToAddressA)(LPSTR a0, INT a1, LPWSAPROTOCOL_INFOA a2, LPSOCKADDR a3, LPINT a4) = WSAStringToAddressA; INT (WINAPI * Real_WSAStringToAddressW)(LPWSTR a0, INT a1, LPWSAPROTOCOL_INFOW a2, LPSOCKADDR a3, LPINT a4) = WSAStringToAddressW; DWORD (WINAPI * Real_WSAWaitForMultipleEvents)(DWORD a0, CONST HANDLE * a1, BOOL a2, DWORD a3, BOOL a4) = WSAWaitForMultipleEvents; SOCKET (WINAPI * Real_accept)(SOCKET a0, sockaddr* a1, int* a2) = accept; int (WINAPI * Real_closesocket)(SOCKET a0) = closesocket; int (WINAPI * Real_connect)(SOCKET a0, CONST sockaddr* a1, int a2) = connect; int (WINAPI * Real_listen)(SOCKET a0, int a1) = listen; int (WINAPI * Real_recv)(SOCKET a0, char* a1, int a2, int a3) = recv; int (WINAPI * Real_recvfrom)(SOCKET a0, char* a1, int a2, int a3, sockaddr* a4, int* a5) = recvfrom; int (WINAPI * Real_send)(SOCKET a0, CONST char* a1, int a2, int a3) = send; int (WINAPI * Real_sendto)(SOCKET a0, CONST char* a1, int a2, int a3, CONST sockaddr* a4, int a5) = sendto; int (WINAPI * Real_shutdown)(SOCKET a0, int a1) = shutdown; ///////////////////////////////////////////////////////////// // Detours // BOOL WINAPI Mine_CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) { _PrintEnter("CreateProcessW(%ls,%ls,%p,%p,%x,%x,%p,%ls,%p,%p)\n", lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation); BOOL rv = 0; __try { rv = Real_CreateProcessW(lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation); } __finally { _PrintExit("CreateProcessW(,,,,,,,,,) -> %x\n", rv); }; return rv; } #if _MSC_VER < 1300 SOCKET WINAPI Mine_WSAAccept(SOCKET a0, sockaddr* a1, LPINT a2, LPCONDITIONPROC a3, DWORD a4) #else SOCKET WINAPI Mine_WSAAccept(SOCKET a0, sockaddr* a1, LPINT a2, LPCONDITIONPROC a3, DWORD_PTR a4) #endif { SOCKET rv = 0; __try { rv = Real_WSAAccept(a0, a1, a2, a3, a4); } __finally { _PrintEnter("%p: WSAAccept(,%p,%p,%p,%p) -> %p\n", a0, a1, a2, a3, a4, rv); _PrintExit(NULL); }; return rv; } INT WINAPI Mine_WSAAddressToStringA(LPSOCKADDR a0, DWORD a1, LPWSAPROTOCOL_INFOA a2, LPSTR a3, LPDWORD a4) { _PrintEnter("WSAAddressToStringA(%p,%x,%p,%p,%p)\n", a0, a1, a2, a3, a4); INT rv = 0; __try { __try { sockaddr_in *in = (sockaddr_in *)a0; _Print("in=%d.%d.%d.%d\n", in->sin_addr.S_un.S_un_b.s_b1, in->sin_addr.S_un.S_un_b.s_b2, in->sin_addr.S_un.S_un_b.s_b3, in->sin_addr.S_un.S_un_b.s_b4); } __finally { } rv = Real_WSAAddressToStringA(a0, a1, a2, a3, a4); } __finally { _PrintExit("WSAAddressToStringA(,,,,) -> %x\n", rv); }; return rv; } INT WINAPI Mine_WSAAddressToStringW(LPSOCKADDR a0, DWORD a1, LPWSAPROTOCOL_INFOW a2, LPWSTR a3, LPDWORD a4) { _PrintEnter("WSAAddressToStringW(%p,%x,%p,%p,%p)\n", a0, a1, a2, a3, a4); INT rv = 0; __try { __try { sockaddr_in *in = (sockaddr_in *)a0; _Print("in=%d.%d.%d.%d\n", in->sin_addr.S_un.S_un_b.s_b1, in->sin_addr.S_un.S_un_b.s_b2, in->sin_addr.S_un.S_un_b.s_b3, in->sin_addr.S_un.S_un_b.s_b4); } __finally { } rv = Real_WSAAddressToStringW(a0, a1, a2, a3, a4); } __finally { _PrintExit("WSAAddressToStringW(,,,,) -> %x\n", rv); }; return rv; } HANDLE WINAPI Mine_WSAAsyncGetHostByAddr(HWND a0, u_int a1, char* a2, int a3, int a4, char* a5, int a6) { _PrintEnter("WSAAsyncGetHostByAddr(%p,%x,%p,%x,%x,%p,%x)\n", a0, a1, a2, a3, a4, a5, a6); HANDLE rv = 0; __try { rv = Real_WSAAsyncGetHostByAddr(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("WSAAsyncGetHostByAddr(,,,,,,) -> %p\n", rv); }; return rv; } HANDLE WINAPI Mine_WSAAsyncGetHostByName(HWND a0, u_int a1, char* a2, char* a3, int a4) { _PrintEnter("WSAAsyncGetHostByName(%p,%x,%p,%p,%x)\n", a0, a1, a2, a3, a4); HANDLE rv = 0; __try { rv = Real_WSAAsyncGetHostByName(a0, a1, a2, a3, a4); } __finally { _PrintExit("WSAAsyncGetHostByName(,,,,) -> %p\n", rv); }; return rv; } HANDLE WINAPI Mine_WSAAsyncGetProtoByName(HWND a0, u_int a1, char* a2, char* a3, int a4) { _PrintEnter("WSAAsyncGetProtoByName(%p,%x,%p,%p,%x)\n", a0, a1, a2, a3, a4); HANDLE rv = 0; __try { rv = Real_WSAAsyncGetProtoByName(a0, a1, a2, a3, a4); } __finally { _PrintExit("WSAAsyncGetProtoByName(,,,,) -> %p\n", rv); }; return rv; } HANDLE WINAPI Mine_WSAAsyncGetProtoByNumber(HWND a0, u_int a1, int a2, char* a3, int a4) { _PrintEnter("WSAAsyncGetProtoByNumber(%p,%x,%p,%p,%x)\n", a0, a1, a2, a3, a4); HANDLE rv = 0; __try { rv = Real_WSAAsyncGetProtoByNumber(a0, a1, a2, a3, a4); } __finally { _PrintExit("WSAAsyncGetProtoByNumber(,,,,) -> %p\n", rv); }; return rv; } HANDLE WINAPI Mine_WSAAsyncGetServByName(HWND a0, u_int a1, char* a2, char* a3, char* a4, int a5) { _PrintEnter("WSAAsyncGetServByName(%p,%x,%p,%p,%p,%x)\n", a0, a1, a2, a3, a4, a5); HANDLE rv = 0; __try { rv = Real_WSAAsyncGetServByName(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("WSAAsyncGetServByName(,,,,,) -> %p\n", rv); }; return rv; } HANDLE WINAPI Mine_WSAAsyncGetServByPort(HWND a0, u_int a1, int a2, char* a3, char* a4, int a5) { _PrintEnter("WSAAsyncGetServByPort(%p,%x,%x,%p,%p,%x)\n", a0, a1, a2, a3, a4, a5); HANDLE rv = 0; __try { rv = Real_WSAAsyncGetServByPort(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("WSAAsyncGetServByPort(,,,,,) -> %p\n", rv); }; return rv; } int WINAPI Mine_WSACancelAsyncRequest(HANDLE a0) { _PrintEnter("WSACancelAsyncRequest(%p)\n", a0); int rv = 0; __try { rv = Real_WSACancelAsyncRequest(a0); } __finally { _PrintExit("WSACancelAsyncRequest() -> %x\n", rv); }; return rv; } int WINAPI Mine_WSACancelBlockingCall(void) { _PrintEnter("WSACancelBlockingCall()\n"); int rv = 0; __try { rv = Real_WSACancelBlockingCall(); } __finally { _PrintExit("WSACancelBlockingCall() -> %x\n", rv); }; return rv; } int WINAPI Mine_WSACleanup(void) { _PrintEnter("WSACleanup()\n"); int rv = 0; __try { rv = Real_WSACleanup(); } __finally { _PrintExit("WSACleanup() -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_WSACloseEvent(HANDLE a0) { _PrintEnter("WSACloseEvent(%p)\n", a0); BOOL rv = 0; __try { rv = Real_WSACloseEvent(a0); } __finally { _PrintExit("WSACloseEvent() -> %x\n", rv); }; return rv; } int WINAPI Mine_WSAConnect(SOCKET a0, sockaddr* a1, int a2, LPWSABUF a3, LPWSABUF a4, LPQOS a5, LPQOS a6) { int rv = 0; __try { rv = Real_WSAConnect(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintEnter("%p: WSAConnect(,%p,%x,%p,%p,%p,%p) -> %x\n", a0, a1, a2, a3, a4, a5, a6, rv); _PrintExit(NULL); }; return rv; } HANDLE WINAPI Mine_WSACreateEvent(void) { _PrintEnter("WSACreateEvent()\n"); HANDLE rv = 0; __try { rv = Real_WSACreateEvent(); } __finally { _PrintExit("WSACreateEvent() -> %p\n", rv); }; return rv; } int WINAPI Mine_WSADuplicateSocketA(SOCKET a0, DWORD a1, LPWSAPROTOCOL_INFOA a2) { _PrintEnter("%p: WSADuplicateSocketA(,%x,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_WSADuplicateSocketA(a0, a1, a2); } __finally { _PrintExit("%p: WSADuplicateSocketA(,,) -> %x\n", a0, rv); }; return rv; } int WINAPI Mine_WSADuplicateSocketW(SOCKET a0, DWORD a1, LPWSAPROTOCOL_INFOW a2) { _PrintEnter("%p: WSADuplicateSocketW(,%x,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_WSADuplicateSocketW(a0, a1, a2); } __finally { _PrintExit("%p: WSADuplicateSocketW(,,) -> %x\n", a0, rv); }; return rv; } INT WINAPI Mine_WSAEnumNameSpaceProvidersA(LPDWORD a0, LPWSANAMESPACE_INFOA a1) { _PrintEnter("WSAEnumNameSpaceProvidersA(%p,%p)\n", a0, a1); INT rv = 0; __try { rv = Real_WSAEnumNameSpaceProvidersA(a0, a1); } __finally { _PrintExit("WSAEnumNameSpaceProvidersA(,) -> %x\n", rv); }; return rv; } INT WINAPI Mine_WSAEnumNameSpaceProvidersW(LPDWORD a0, LPWSANAMESPACE_INFOW a1) { _PrintEnter("WSAEnumNameSpaceProvidersW(%p,%p)\n", a0, a1); INT rv = 0; __try { rv = Real_WSAEnumNameSpaceProvidersW(a0, a1); } __finally { _PrintExit("WSAEnumNameSpaceProvidersW(,) -> %x\n", rv); }; return rv; } int WINAPI Mine_WSAEnumNetworkEvents(SOCKET a0, HANDLE a1, LPWSANETWORKEVENTS a2) { _PrintEnter("%p: WSAEnumNetworkEvents(,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_WSAEnumNetworkEvents(a0, a1, a2); } __finally { _PrintExit("%p: WSAEnumNetworkEvents(,,) -> %x\n", a0, rv); }; return rv; } int WINAPI Mine_WSAEnumProtocolsA(LPINT a0, LPWSAPROTOCOL_INFOA a1, LPDWORD a2) { _PrintEnter("WSAEnumProtocolsA(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_WSAEnumProtocolsA(a0, a1, a2); } __finally { _PrintExit("WSAEnumProtocolsA(,,) -> %x\n", rv); }; return rv; } int WINAPI Mine_WSAEnumProtocolsW(LPINT a0, LPWSAPROTOCOL_INFOW a1, LPDWORD a2) { _PrintEnter("WSAEnumProtocolsW(%p,%p,%p)\n", a0, a1, a2); int rv = 0; __try { rv = Real_WSAEnumProtocolsW(a0, a1, a2); } __finally { _PrintExit("WSAEnumProtocolsW(,,) -> %x\n", rv); }; return rv; } BOOL WINAPI Mine_WSAGetOverlappedResult(SOCKET a0, LPWSAOVERLAPPED a1, LPDWORD a2, BOOL a3, LPDWORD a4) { _PrintEnter("%p: WSAGetOverlappedResult(,%p,%p,%x,%p)\n", a0, a1, a2, a3, a4); BOOL rv = 0; __try { rv = Real_WSAGetOverlappedResult(a0, a1, a2, a3, a4); } __finally { _PrintExit("%p: WSAGetOverlappedResult(,,,,) -> %x\n", a0, rv); }; return rv; } BOOL WINAPI Mine_WSAIsBlocking(void) { _PrintEnter("WSAIsBlocking()\n"); BOOL rv = 0; __try { rv = Real_WSAIsBlocking(); } __finally { _PrintExit("WSAIsBlocking() -> %x\n", rv); }; return rv; } SOCKET WINAPI Mine_WSAJoinLeaf(SOCKET a0, sockaddr* a1, int a2, LPWSABUF a3, LPWSABUF a4, LPQOS a5, LPQOS a6, DWORD a7) { _PrintEnter("%p: WSAJoinLeaf(,%p,%x,%p,%p,%p,%p,%x)\n", a0, a1, a2, a3, a4, a5, a6, a7); SOCKET rv = 0; __try { rv = Real_WSAJoinLeaf(a0, a1, a2, a3, a4, a5, a6, a7); } __finally { _PrintExit("%p: WSAJoinLeaf(,,,,,,,) -> %p\n", a0, rv); }; return rv; } INT WINAPI Mine_WSALookupServiceBeginA( LPWSAQUERYSETA lpqsRestrictions, DWORD dwControlFlags, LPHANDLE lphLookup ) { _PrintEnter("WSALookupServiceBeginA(%p,%x,%p)\n", lpqsRestrictions, dwControlFlags, lphLookup); INT rv = 0; __try { __try { _Print("service: [%hs]", lpqsRestrictions->lpszServiceInstanceName); _Print("queries: [%hs]", lpqsRestrictions->lpszQueryString); } __finally { } rv = Real_WSALookupServiceBeginA( lpqsRestrictions, dwControlFlags, lphLookup); } __finally { _PrintExit("WSALookupServiceBeginA(,,) -> %x\n", rv); }; return rv; } INT WINAPI Mine_WSALookupServiceBeginW( LPWSAQUERYSETW lpqsRestrictions, DWORD dwControlFlags, LPHANDLE lphLookup ) { _PrintEnter("WSALookupServiceBeginW(%p,%p,%p)\n", lpqsRestrictions, dwControlFlags, lphLookup); __debugbreak(); INT rv = 0; __try { __try { _Print("service: [%ls]", lpqsRestrictions->lpszServiceInstanceName); _Print("queries: [%ls]", lpqsRestrictions->lpszQueryString); } __finally { } rv = Real_WSALookupServiceBeginW( lpqsRestrictions, dwControlFlags, lphLookup); } __finally { _PrintExit("WSALookupServiceBeginW(,,) -> %x\n", rv); }; return rv; } INT WINAPI Mine_WSALookupServiceNextA( HANDLE hLookup, DWORD dwControlFlags, LPDWORD lpdwBufferLength, LPWSAQUERYSETA lpqsResults ) { _PrintEnter("WSALookupServiceNextA(%p,%p,%p,%p)\n", hLookup, dwControlFlags, lpdwBufferLength, lpqsResults); INT rv = 0; __try { rv = Real_WSALookupServiceNextA( hLookup, dwControlFlags, lpdwBufferLength, lpqsResults); } __finally { _PrintExit("WSALookupServiceNextA(,,) -> %x\n", rv); }; return rv; } INT WINAPI Mine_WSALookupServiceNextW( HANDLE hLookup, DWORD dwControlFlags, LPDWORD lpdwBufferLength, LPWSAQUERYSETW lpqsResults ) { _PrintEnter("WSALookupServiceNextW(%p,%p,%p,%p)\n", hLookup, dwControlFlags, lpdwBufferLength, lpqsResults); INT rv = 0; __try { rv = Real_WSALookupServiceNextW( hLookup, dwControlFlags, lpdwBufferLength, lpqsResults); } __finally { _PrintExit("WSALookupServiceNextW(,,) -> %x\n", rv); }; return rv; } INT WINAPI Mine_WSALookupServiceEnd( HANDLE hLookup ) { _PrintEnter("WSALookupServiceEnd(%p)\n", hLookup); INT rv = 0; __try { rv = Real_WSALookupServiceEnd(hLookup); } __finally { _PrintExit("WSALookupServiceEnd(,,) -> %x\n", rv); }; return rv; } INT WINAPI Mine_WSAProviderConfigChange(LPHANDLE a0, LPWSAOVERLAPPED a1, LPWSAOVERLAPPED_COMPLETION_ROUTINE a2) { _PrintEnter("WSAProviderConfigChange(%p,%p,%p)\n", a0, a1, a2); INT rv = 0; __try { rv = Real_WSAProviderConfigChange(a0, a1, a2); } __finally { _PrintExit("WSAProviderConfigChange(,,) -> %x\n", rv); }; return rv; } int WINAPI Mine_WSARecv(SOCKET a0, LPWSABUF a1, DWORD a2, LPDWORD a3, LPDWORD a4, LPWSAOVERLAPPED a5, LPWSAOVERLAPPED_COMPLETION_ROUTINE a6) { int rv = -1; __try { rv = Real_WSARecv(a0, a1, a2, a3, a4, a5, a6); } __finally { if (rv == 0) { _PrintEnter("%p: WSARecv(,%p,%x,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); _PrintDump(a0, a1[0].buf, a1[0].len < *a3 ? a1[0].len : *a3); _PrintExit("%p: WSARecv(,,,,,,) -> %x\n", a0, rv); } }; return rv; } int WINAPI Mine_WSARecvDisconnect(SOCKET a0, LPWSABUF a1) { _PrintEnter("%p: WSARecvDisconnect(,%p)\n", a0, a1); int rv = 0; __try { rv = Real_WSARecvDisconnect(a0, a1); } __finally { _PrintExit("%p: WSARecvDisconnect(,) -> %x\n", a0, rv); }; return rv; } int WINAPI Mine_WSARecvFrom(SOCKET a0, LPWSABUF a1, DWORD a2, LPDWORD a3, LPDWORD a4, sockaddr* a5, LPINT a6, LPWSAOVERLAPPED a7, LPWSAOVERLAPPED_COMPLETION_ROUTINE a8) { _PrintEnter("%p: WSARecvFrom(,%p,%x,%p,%p,%p,%p,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8); int rv = 0; __try { rv = Real_WSARecvFrom(a0, a1, a2, a3, a4, a5, a6, a7, a8); } __finally { _PrintExit("%p: WSARecvFrom(,,,,,,,,) -> %x\n", a0, rv); }; return rv; } BOOL WINAPI Mine_WSAResetEvent(HANDLE a0) { _PrintEnter("WSAResetEvent(%p)\n", a0); BOOL rv = 0; __try { rv = Real_WSAResetEvent(a0); } __finally { _PrintExit("WSAResetEvent() -> %x\n", rv); }; return rv; } int WINAPI Mine_WSASend(SOCKET a0, LPWSABUF a1, DWORD a2, LPDWORD a3, DWORD a4, LPWSAOVERLAPPED a5, LPWSAOVERLAPPED_COMPLETION_ROUTINE a6) { _PrintEnter("%p: WSASend(,%p,%x,%p,%x,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6); int rv = 0; __try { rv = Real_WSASend(a0, a1, a2, a3, a4, a5, a6); } __finally { _PrintExit("%p: WSASend(,,,,,,) -> %x\n", a0, rv); }; return rv; } int WINAPI Mine_WSASendDisconnect(SOCKET a0, LPWSABUF a1) { _PrintEnter("%p: WSASendDisconnect(,%p)\n", a0, a1); int rv = 0; __try { rv = Real_WSASendDisconnect(a0, a1); } __finally { _PrintExit("%p: WSASendDisconnect(,) -> %x\n", a0, rv); }; return rv; } int WINAPI Mine_WSASendTo(SOCKET a0, LPWSABUF a1, DWORD a2, LPDWORD a3, DWORD a4, sockaddr* a5, int a6, LPWSAOVERLAPPED a7, LPWSAOVERLAPPED_COMPLETION_ROUTINE a8) { _PrintEnter("%p: WSASendTo(,%p,%x,%p,%x,%p,%x,%p,%p)\n", a0, a1, a2, a3, a4, a5, a6, a7, a8); int rv = 0; __try { rv = Real_WSASendTo(a0, a1, a2, a3, a4, a5, a6, a7, a8); } __finally { _PrintExit("%p: WSASendTo(,,,,,,,,) -> %x\n", a0, rv); }; return rv; } INT WINAPI Mine_WSAStringToAddressA(LPSTR a0, INT a1, LPWSAPROTOCOL_INFOA a2, LPSOCKADDR a3, LPINT a4) { _PrintEnter("WSAStringToAddressA(%p,%x,%p,%p,%p)\n", a0, a1, a2, a3, a4); INT rv = 0; __try { rv = Real_WSAStringToAddressA(a0, a1, a2, a3, a4); } __finally { _PrintExit("WSAStringToAddressA(,,,,) -> %x\n", rv); }; return rv; } INT WINAPI Mine_WSAStringToAddressW(LPWSTR a0, INT a1, LPWSAPROTOCOL_INFOW a2, LPSOCKADDR a3, LPINT a4) { _PrintEnter("WSAStringToAddressW(%p,%x,%p,%p,%p)\n", a0, a1, a2, a3, a4); INT rv = 0; __try { rv = Real_WSAStringToAddressW(a0, a1, a2, a3, a4); } __finally { _PrintExit("WSAStringToAddressW(,,,,) -> %x\n", rv); }; return rv; } DWORD WINAPI Mine_WSAWaitForMultipleEvents(DWORD a0, void** a1, BOOL a2, DWORD a3, BOOL a4) { _PrintEnter("WSAWaitForMultipleEvents(%x,%p,%x,%x,%x)\n", a0, a1, a2, a3, a4); DWORD rv = 0; __try { rv = Real_WSAWaitForMultipleEvents(a0, a1, a2, a3, a4); } __finally { _PrintExit("WSAWaitForMultipleEvents(,,,,) -> %x\n", rv); }; return rv; } SOCKET WINAPI Mine_accept(SOCKET a0, sockaddr* a1, int* a2) { SOCKET rv = 0; __try { rv = Real_accept(a0, a1, a2); } __finally { WCHAR wzAddress[512] = L""; int err = WSAGetLastError(); if (rv != INVALID_SOCKET) { DWORD nAddress = ARRAYSIZE(wzAddress); if (Real_WSAAddressToStringW(a1, *a2, NULL, wzAddress, &nAddress) != 0) { wzAddress[0] = 0; } } WSASetLastError(err); if (wzAddress[0]) { _PrintEnter("%p: accept(,%ls,%p) -> %p\n", a0, wzAddress, a2, rv); } else { _PrintEnter("%p: accept(,%p,%p) -> %p\n", a0, a1, a2, rv); } _PrintExit(NULL); }; return rv; } int WINAPI Mine_closesocket(SOCKET a0) { int rv = 0; __try { rv = Real_closesocket(a0); } __finally { _PrintEnter("%p: closesocket() -> %x\n", a0, rv); _PrintExit(NULL); }; return rv; } int WINAPI Mine_connect(SOCKET a0, sockaddr* name, int namelen) { int rv = 0; __try { rv = Real_connect(a0, name, namelen); } __finally { WCHAR wzAddress[512]; DWORD nAddress = ARRAYSIZE(wzAddress); int err = WSAGetLastError(); if (Real_WSAAddressToStringW(name, namelen, NULL, wzAddress, &nAddress) == 0) { if (rv == SOCKET_ERROR) { _PrintEnter("%p: connect(,%p:%ls,%x) -> %x [%d]\n", a0, name, wzAddress, namelen, rv, err); } else { _PrintEnter("%p: connect(,%p:%ls,%x) -> %x\n", a0, name, wzAddress, namelen, rv); } } else { if (rv == SOCKET_ERROR) { _PrintEnter("%p: connect(,%p,%x) -> %x [%d]\n", a0, name, namelen, rv, err); } else { _PrintEnter("%p: connect(,%p,%x) -> %x\n", a0, name, namelen, rv); } } WSASetLastError(err); _PrintExit(NULL); }; return rv; } int WINAPI Mine_listen(SOCKET a0, int a1) { _PrintEnter("%p: listen(,%x)\n", a0, a1); int rv = 0; __try { rv = Real_listen(a0, a1); } __finally { _PrintExit("%p: listen(,) -> %x\n", a0, rv); }; return rv; } int WINAPI Mine_recv(SOCKET a0, char* a1, int a2, int a3) { _PrintEnter("%p: recv(,%p,%x,%x)\n", a0, a1, a2, a3); int rv = 0; __try { rv = Real_recv(a0, a1, a2, a3); } __finally { _PrintExit("%p: recv(,%s,,) -> %x\n", a0, a1, rv); }; return rv; } int WINAPI Mine_recvfrom(SOCKET a0, char* a1, int a2, int a3, sockaddr* a4, int* a5) { _PrintEnter("%p: recvfrom(,%p,%x,%x,%p,%p)\n", a0, a1, a2, a3, a4, a5); int rv = 0; __try { rv = Real_recvfrom(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("%p: recvfrom(,%s,,,,) -> %x\n", a0, a1, rv); }; return rv; } VOID _PrintDump(SOCKET socket, PCHAR pszData, INT cbData) { if (pszData && cbData > 0) { CHAR szBuffer[256]; PCHAR pszBuffer = szBuffer; INT cbBuffer = 0; INT nLines = 0; while (cbData > 0) { if (nLines > 20) { *pszBuffer++ = '.'; *pszBuffer++ = '.'; *pszBuffer++ = '.'; cbBuffer += 3; break; } if (*pszData == '\t') { *pszBuffer++ = '\\'; *pszBuffer++ = 't'; cbBuffer += 2; pszData++; cbData--; continue; } if (*pszData == '\r') { *pszBuffer++ = '\\'; *pszBuffer++ = 'r'; cbBuffer += 2; pszData++; cbData--; continue; } else if (*pszData == '\n') { *pszBuffer++ = '\\'; *pszBuffer++ = 'n'; cbBuffer += 2; *pszBuffer++ = '\0'; _Print("%p: %hs\n", socket, szBuffer); nLines++; pszBuffer = szBuffer; cbBuffer = 0; pszData++; cbData--; continue; } else if (cbBuffer >= 80) { *pszBuffer++ = '\0'; _Print("%p: %hs\n", socket, szBuffer); nLines++; pszBuffer = szBuffer; cbBuffer = 0; } if (*pszData < ' ' || *pszData >= 127) { *pszBuffer++ = '\\'; *pszBuffer++ = 'x'; *pszBuffer++ = "0123456789ABCDEF"[(*pszData & 0xf0) >> 4]; *pszBuffer++ = "0123456789ABCDEF"[(*pszData & 0x0f)]; cbBuffer += 4; } else { *pszBuffer++ = *pszData; } cbBuffer++; pszData++; cbData--; } if (cbBuffer > 0) { *pszBuffer++ = '\0'; _Print("%p: %hs\n", socket, szBuffer); } } } int WINAPI Mine_send(SOCKET a0, char* a1, int a2, int a3) { _PrintEnter("%p: send(,%p,%x,%x)\n", a0, a1, a2, a3); _PrintDump(a0, a1, a2); int rv = 0; __try { rv = Real_send(a0, a1, a2, a3); } __finally { if (rv == SOCKET_ERROR) { int err = WSAGetLastError(); _PrintExit("%p: send(,,,) -> %x (%d)\n", a0, rv, err); } else { _PrintExit("%p: send(,,,) -> %x\n", a0, rv); } }; return rv; } int WINAPI Mine_sendto(SOCKET a0, char* a1, int a2, int a3, sockaddr* a4, int a5) { _PrintEnter("%p: sendto(,%s,%x,%x,%p,%x)\n", a0, a1, a2, a3, a4, a5); int rv = 0; __try { rv = Real_sendto(a0, a1, a2, a3, a4, a5); } __finally { _PrintExit("%p: sendto(%ls,,,,,) -> %x\n", a0, a1, rv); }; return rv; } int WINAPI Mine_shutdown(SOCKET a0, int a1) { _PrintEnter("%p: shutdown(,%x)\n", a0, a1); int rv = 0; __try { rv = Real_shutdown(a0, a1); } __finally { _PrintExit("%p: shutdown(,) -> %x\n", a0, rv); }; return rv; } ///////////////////////////////////////////////////////////// // AttachDetours // PCHAR DetRealName(PCHAR psz) { PCHAR pszBeg = psz; // Move to end of name. while (*psz) { psz++; } // Move back through A-Za-z0-9 names. while (psz > pszBeg && ((psz[-1] >= 'A' && psz[-1] <= 'Z') || (psz[-1] >= 'a' && psz[-1] <= 'z') || (psz[-1] >= '0' && psz[-1] <= '9'))) { psz--; } return psz; } VOID DetAttach(PVOID *ppbReal, PVOID pbMine, PCHAR psz) { LONG l = DetourAttach(ppbReal, pbMine); if (l != 0) { Syelog(SYELOG_SEVERITY_NOTICE, "Attach failed: `%s': error %d\n", DetRealName(psz), l); } } VOID DetDetach(PVOID *ppbReal, PVOID pbMine, PCHAR psz) { LONG l = DetourDetach(ppbReal, pbMine); if (l != 0) { Syelog(SYELOG_SEVERITY_NOTICE, "Detach failed: `%s': error %d\n", DetRealName(psz), l); } } #define ATTACH(x) DetAttach(&(PVOID&)Real_##x,Mine_##x,#x) #define DETACH(x) DetDetach(&(PVOID&)Real_##x,Mine_##x,#x) LONG AttachDetours(VOID) { DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); ATTACH(CreateProcessW); ATTACH(WSAAccept); ATTACH(WSAAddressToStringA); ATTACH(WSAAddressToStringW); ATTACH(WSAAsyncGetHostByAddr); ATTACH(WSAAsyncGetHostByName); ATTACH(WSAAsyncGetProtoByName); ATTACH(WSAAsyncGetProtoByNumber); ATTACH(WSAAsyncGetServByName); ATTACH(WSAAsyncGetServByPort); ATTACH(WSACancelAsyncRequest); ATTACH(WSACancelBlockingCall); ATTACH(WSACleanup); ATTACH(WSACloseEvent); ATTACH(WSAConnect); ATTACH(WSACreateEvent); ATTACH(WSADuplicateSocketA); ATTACH(WSADuplicateSocketW); ATTACH(WSAEnumNameSpaceProvidersA); ATTACH(WSAEnumNameSpaceProvidersW); ATTACH(WSAEnumNetworkEvents); ATTACH(WSAEnumProtocolsA); ATTACH(WSAEnumProtocolsW); ATTACH(WSAIsBlocking); ATTACH(WSAJoinLeaf); ATTACH(WSALookupServiceBeginA); ATTACH(WSALookupServiceBeginW); ATTACH(WSALookupServiceNextA); ATTACH(WSALookupServiceNextW); ATTACH(WSALookupServiceEnd); ATTACH(WSAProviderConfigChange); ATTACH(WSARecv); ATTACH(WSARecvDisconnect); ATTACH(WSARecvFrom); ATTACH(WSAResetEvent); ATTACH(WSASend); ATTACH(WSASendDisconnect); ATTACH(WSASendTo); ATTACH(WSAStringToAddressA); ATTACH(WSAStringToAddressW); ATTACH(WSAWaitForMultipleEvents); ATTACH(accept); ATTACH(closesocket); ATTACH(connect); ATTACH(listen); ATTACH(recv); ATTACH(recvfrom); ATTACH(send); ATTACH(sendto); ATTACH(shutdown); return DetourTransactionCommit(); } LONG DetachDetours(VOID) { DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DETACH(CreateProcessW); DETACH(WSAAccept); DETACH(WSAAddressToStringA); DETACH(WSAAddressToStringW); DETACH(WSAAsyncGetHostByAddr); DETACH(WSAAsyncGetHostByName); DETACH(WSAAsyncGetProtoByName); DETACH(WSAAsyncGetProtoByNumber); DETACH(WSAAsyncGetServByName); DETACH(WSAAsyncGetServByPort); DETACH(WSACancelAsyncRequest); DETACH(WSACancelBlockingCall); DETACH(WSACleanup); DETACH(WSACloseEvent); DETACH(WSAConnect); DETACH(WSACreateEvent); DETACH(WSADuplicateSocketA); DETACH(WSADuplicateSocketW); DETACH(WSAEnumNameSpaceProvidersA); DETACH(WSAEnumNameSpaceProvidersW); DETACH(WSAEnumNetworkEvents); DETACH(WSAEnumProtocolsA); DETACH(WSAEnumProtocolsW); DETACH(WSAIsBlocking); DETACH(WSAJoinLeaf); DETACH(WSALookupServiceBeginA); DETACH(WSALookupServiceBeginW); DETACH(WSALookupServiceNextA); DETACH(WSALookupServiceNextW); DETACH(WSALookupServiceEnd); DETACH(WSAProviderConfigChange); DETACH(WSARecv); DETACH(WSARecvDisconnect); DETACH(WSARecvFrom); DETACH(WSAResetEvent); DETACH(WSASend); DETACH(WSASendDisconnect); DETACH(WSASendTo); DETACH(WSAStringToAddressA); DETACH(WSAStringToAddressW); DETACH(WSAWaitForMultipleEvents); DETACH(accept); DETACH(closesocket); DETACH(connect); DETACH(listen); DETACH(recv); DETACH(recvfrom); DETACH(send); DETACH(sendto); DETACH(shutdown); return DetourTransactionCommit(); } // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////// Logging System. // static BOOL s_bLog = 1; static LONG s_nTlsIndent = -1; static LONG s_nTlsThread = -1; static LONG s_nThreadCnt = 0; VOID _PrintEnter(const CHAR *psz, ...) { DWORD dwErr = GetLastError(); LONG nIndent = 0; LONG nThread = 0; if (s_nTlsIndent >= 0) { nIndent = (LONG)(LONG_PTR)TlsGetValue(s_nTlsIndent); TlsSetValue(s_nTlsIndent, (PVOID)(LONG_PTR)(nIndent + 1)); } if (s_nTlsThread >= 0) { nThread = (LONG)(LONG_PTR)TlsGetValue(s_nTlsThread); } if (s_bLog && psz) { CHAR szBuf[1024]; PCHAR pszBuf = szBuf; PCHAR pszEnd = szBuf + ARRAYSIZE(szBuf) - 1; LONG nLen = (nIndent > 0) ? (nIndent < 35 ? nIndent * 2 : 70) : 0; *pszBuf++ = (CHAR)('0' + ((nThread / 100) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 10) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 1) % 10)); *pszBuf++ = ' '; while (nLen-- > 0) { *pszBuf++ = ' '; } va_list args; va_start(args, psz); while ((*pszBuf++ = *psz++) != 0 && pszBuf < pszEnd) { // Copy characters. } *pszEnd = '\0'; SyelogV(SYELOG_SEVERITY_INFORMATION, szBuf, args); va_end(args); } SetLastError(dwErr); } VOID _PrintExit(const CHAR *psz, ...) { DWORD dwErr = GetLastError(); LONG nIndent = 0; LONG nThread = 0; if (s_nTlsIndent >= 0) { nIndent = (LONG)(LONG_PTR)TlsGetValue(s_nTlsIndent) - 1; ASSERT(nIndent >= 0); TlsSetValue(s_nTlsIndent, (PVOID)(LONG_PTR)nIndent); } if (s_nTlsThread >= 0) { nThread = (LONG)(LONG_PTR)TlsGetValue(s_nTlsThread); } if (s_bLog && psz) { CHAR szBuf[1024]; PCHAR pszBuf = szBuf; PCHAR pszEnd = szBuf + ARRAYSIZE(szBuf) - 1; LONG nLen = (nIndent > 0) ? (nIndent < 35 ? nIndent * 2 : 70) : 0; *pszBuf++ = (CHAR)('0' + ((nThread / 100) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 10) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 1) % 10)); *pszBuf++ = ' '; while (nLen-- > 0) { *pszBuf++ = ' '; } va_list args; va_start(args, psz); while ((*pszBuf++ = *psz++) != 0 && pszBuf < pszEnd) { // Copy characters. } *pszEnd = '\0'; SyelogV(SYELOG_SEVERITY_INFORMATION, szBuf, args); va_end(args); } SetLastError(dwErr); } VOID _Print(const CHAR *psz, ...) { DWORD dwErr = GetLastError(); LONG nIndent = 0; LONG nThread = 0; if (s_nTlsIndent >= 0) { nIndent = (LONG)(LONG_PTR)TlsGetValue(s_nTlsIndent); } if (s_nTlsThread >= 0) { nThread = (LONG)(LONG_PTR)TlsGetValue(s_nTlsThread); } if (s_bLog && psz) { CHAR szBuf[1024]; PCHAR pszBuf = szBuf; PCHAR pszEnd = szBuf + ARRAYSIZE(szBuf) - 1; LONG nLen = (nIndent > 0) ? (nIndent < 35 ? nIndent * 2 : 70) : 0; *pszBuf++ = (CHAR)('0' + ((nThread / 100) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 10) % 10)); *pszBuf++ = (CHAR)('0' + ((nThread / 1) % 10)); *pszBuf++ = ' '; while (nLen-- > 0) { *pszBuf++ = ' '; } va_list args; va_start(args, psz); while ((*pszBuf++ = *psz++) != 0 && pszBuf < pszEnd) { // Copy characters. } *pszEnd = '\0'; SyelogV(SYELOG_SEVERITY_INFORMATION, szBuf, args); va_end(args); } SetLastError(dwErr); } VOID AssertMessage(CONST PCHAR pszMsg, CONST PCHAR pszFile, ULONG nLine) { Syelog(SYELOG_SEVERITY_FATAL, "ASSERT(%s) failed in %s, line %d.\n", pszMsg, pszFile, nLine); } ////////////////////////////////////////////////////////////////////////////// // // DLL module information // BOOL ThreadAttach(HMODULE hDll) { (void)hDll; if (s_nTlsIndent >= 0) { TlsSetValue(s_nTlsIndent, (PVOID)0); } if (s_nTlsThread >= 0) { LONG nThread = InterlockedIncrement(&s_nThreadCnt); TlsSetValue(s_nTlsThread, (PVOID)(LONG_PTR)nThread); } return TRUE; } BOOL ThreadDetach(HMODULE hDll) { (void)hDll; if (s_nTlsIndent >= 0) { TlsSetValue(s_nTlsIndent, (PVOID)0); } if (s_nTlsThread >= 0) { TlsSetValue(s_nTlsThread, (PVOID)0); } return TRUE; } BOOL ProcessAttach(HMODULE hDll) { s_bLog = FALSE; s_nTlsIndent = TlsAlloc(); s_nTlsThread = TlsAlloc(); WCHAR wzExeName[MAX_PATH]; s_hInst = hDll; Real_GetModuleFileNameW(hDll, s_wzDllPath, ARRAYSIZE(s_wzDllPath)); Real_GetModuleFileNameW(NULL, wzExeName, ARRAYSIZE(wzExeName)); SyelogOpen("trctcp" DETOURS_STRINGIFY(DETOURS_BITS), SYELOG_FACILITY_APPLICATION); Syelog(SYELOG_SEVERITY_INFORMATION, "##################################################################\n"); Syelog(SYELOG_SEVERITY_INFORMATION, "### %ls\n", wzExeName); LONG error = AttachDetours(); if (error != NO_ERROR) { Syelog(SYELOG_SEVERITY_FATAL, "### Error attaching detours: %d\n", error); } ThreadAttach(hDll); s_bLog = TRUE; return TRUE; } BOOL ProcessDetach(HMODULE hDll) { ThreadDetach(hDll); s_bLog = FALSE; LONG error = DetachDetours(); if (error != NO_ERROR) { Syelog(SYELOG_SEVERITY_FATAL, "### Error detaching detours: %d\n", error); } Syelog(SYELOG_SEVERITY_NOTICE, "### Closing.\n"); SyelogClose(FALSE); if (s_nTlsIndent >= 0) { TlsFree(s_nTlsIndent); } if (s_nTlsThread >= 0) { TlsFree(s_nTlsThread); } return TRUE; } BOOL APIENTRY DllMain(HINSTANCE hModule, DWORD dwReason, PVOID lpReserved) { (void)hModule; (void)lpReserved; if (DetourIsHelperProcess()) { return TRUE; } switch (dwReason) { case DLL_PROCESS_ATTACH: DetourRestoreAfterWith(); printf("trctcp" DETOURS_STRINGIFY(DETOURS_BITS) ".dll: Starting.\n"); fflush(stdout); return ProcessAttach(hModule); case DLL_PROCESS_DETACH: return ProcessDetach(hModule); case DLL_THREAD_ATTACH: return ThreadAttach(hModule); case DLL_THREAD_DETACH: return ThreadDetach(hModule); } return TRUE; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/tracetcp/trctcp.rc ================================================ ////////////////////////////////////////////////////////////////////////////// // // Version information for trctcp.rc. // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include "detver.h" #define VER_INTERNALNAME_STR "trctcp" DETOURS_STRINGIFY(DETOURS_BITS) #define VER_ORIGINALFILENAME_STR "trctcp" DETOURS_STRINGIFY(DETOURS_BITS) ".dll" #define VER_FILEDESCRIPTION_STR "Detours TCP Trace Module" #define VER_COMPANYNAME_STR "Microsoft Corporation" #include "common.ver" ================================================ FILE: ext/detours/samples/tryman/Makefile ================================================ ############################################################################## ## ## Detours Test Program ## ## Microsoft Research Detours Package ## ## Copyright (c) Microsoft Corporation. All rights reserved. ## !include ..\common.mak BIND_X86=$(ROOT)\bin.x86 BIND_X64=$(ROOT)\bin.x64 LIBS = $(LIBS) kernel32.lib ############################################################################## all: dirs \ $(BIND)\tstman$(DETOURS_BITS).dll \ $(BIND)\tryman$(DETOURS_BITS).exe \ $(BIND)\size$(DETOURS_BITS).exe \ \ $(BIND)\managed-x64.exe \ $(BIND)\managed-ia64.exe \ $(BIND)\managed-x86.exe \ $(BIND)\managed-any.exe \ $(BIND)\managed-any32.exe \ \ !IF $(DETOURS_SOURCE_BROWSING)==1 $(OBJD)\tstman$(DETOURS_BITS).bsc \ $(OBJD)\tryman$(DETOURS_BITS).bsc \ !ENDIF option ############################################################################## dirs: @if not exist $(BIND) mkdir $(BIND) && echo. Created $(BIND) @if not exist $(OBJD) mkdir $(OBJD) && echo. Created $(BIND) $(OBJD)\tstman.obj : tstman.cpp $(OBJD)\tstman.res : tstman.rc $(BIND)\tstman$(DETOURS_BITS).dll $(BIND)\tstman$(DETOURS_BITS).lib: \ $(OBJD)\tstman.obj $(OBJD)\tstman.res $(DEPS) cl /LD $(CFLAGS) /Fe$(@R).dll /Fd$(@R).pdb \ $(OBJD)\tstman.obj $(OBJD)\tstman.res \ /link $(LINKFLAGS) /subsystem:console \ /export:DetourFinishHelperProcess,@1,NONAME \ /export:Test3264 \ $(LIBS) $(OBJD)\tstman$(DETOURS_BITS).bsc : tstman.obj bscmake /v /n /o $@ tstman.sbr $(OBJD)\tryman.obj : tryman.cpp $(BIND)\tryman$(DETOURS_BITS).exe : $(OBJD)\tryman.obj $(DEPS) $(BIND)\tstman$(DETOURS_BITS).lib cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb $(OBJD)\tryman.obj \ /link $(LINKFLAGS) $(LIBS) $(BIND)\tstman$(DETOURS_BITS).lib \ /subsystem:console $(OBJD)\tryman$(DETOURS_BITS).bsc : $(OBJD)\tryman.obj bscmake /v /n /o $@ $(OBJD)\tryman.sbr $(OBJD)\size.obj : size.cpp $(BIND)\size$(DETOURS_BITS).exe : $(OBJD)\size.obj $(DEPS) cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb $(OBJD)\size.obj \ /link $(LINKFLAGS) $(LIBS) \ /subsystem:console /fixed:no $(OBJD)\size$(DETOURS_BITS).bsc : $(OBJD)\size.obj bscmake /v /n /o $@ $(OBJD)\size.sbr $(BIND)\key.snk: if not exist $(BIND)\key.snk sn -k $(BIND)\key.snk CSCFLAGS=/nowarn:1607 /unsafe- /optimize+ /debug+ /warnaserror $(BIND)\managed-x64.exe : $(BIND)\key.snk managed.cs csc /nologo $(CSCFLAGS) /platform:x64 /keyfile:$(BIND)\key.snk \ /out:$(BIND)\managed-x64.exe managed.cs $(BIND)\managed-ia64.exe : $(BIND)\key.snk managed.cs csc /nologo $(CSCFLAGS) /platform:itanium /keyfile:$(BIND)\key.snk \ /out:$(BIND)\managed-ia64.exe managed.cs $(BIND)\managed-x86.exe : $(BIND)\key.snk managed.cs csc /nologo $(CSCFLAGS) /platform:x86 /keyfile:$(BIND)\key.snk \ /out:$(BIND)\managed-x86.exe managed.cs $(BIND)\managed-any.exe : $(BIND)\key.snk managed.cs csc /nologo $(CSCFLAGS) /platform:anycpu /keyfile:$(BIND)\key.snk \ /out:$(BIND)\managed-any.exe managed.cs $(BIND)\managed-any32.exe : $(BIND)\key.snk managed.cs -csc /nologo $(CSCFLAGS) /platform:anycpu32bitpreferred /keyfile:$(BIND)\key.snk \ /out:$(BIND)\managed-any32.exe managed.cs ############################################################################## clean: -del *~ 2>nul -del $(BIND)\managed-*.* 2>nul -del $(BIND)\tstman*.* 2>nul -del $(BIND)\tryman*.* 2>nul -del $(BIND)\size*.* 2>nul -rmdir /q /s $(OBJD) 2>nul realclean: clean -rmdir /q /s $(OBJDS) 2>nul ############################################### Install non-bit-size binaries. !IF "$(DETOURS_OPTION_PROCESSOR)" != "" $(OPTD)\tstman$(DETOURS_OPTION_BITS).dll: $(OPTD)\tstman$(DETOURS_OPTION_BITS).pdb: $(OPTD)\tryman$(DETOURS_OPTION_BITS).exe: $(OPTD)\tryman$(DETOURS_OPTION_BITS).pdb: $(OPTD)\size$(DETOURS_OPTION_BITS).exe: $(OPTD)\size$(DETOURS_OPTION_BITS).pdb: $(BIND)\tstman$(DETOURS_OPTION_BITS).dll : $(OPTD)\tstman$(DETOURS_OPTION_BITS).dll @if exist $? copy /y $? $(BIND) >nul >nul && echo. $@ copied. $(BIND)\tstman$(DETOURS_OPTION_BITS).pdb : $(OPTD)\tstman$(DETOURS_OPTION_BITS).pdb @if exist $? copy /y $? $(BIND) >nul >nul && echo. $@ copied. $(BIND)\tryman$(DETOURS_OPTION_BITS).exe : $(OPTD)\tryman$(DETOURS_OPTION_BITS).exe @if exist $? copy /y $? $(BIND) >nul >nul && echo. $@ copied. $(BIND)\tryman$(DETOURS_OPTION_BITS).pdb : $(OPTD)\tryman$(DETOURS_OPTION_BITS).pdb @if exist $? copy /y $? $(BIND) >nul >nul && echo. $@ copied. $(BIND)\size$(DETOURS_OPTION_BITS).exe : $(OPTD)\size$(DETOURS_OPTION_BITS).exe @if exist $? copy /y $? $(BIND) >nul >nul && echo. $@ copied. $(BIND)\size$(DETOURS_OPTION_BITS).pdb : $(OPTD)\size$(DETOURS_OPTION_BITS).pdb @if exist $? copy /y $? $(BIND) >nul >nul && echo. $@ copied. option: \ $(BIND)\tstman$(DETOURS_OPTION_BITS).dll \ $(BIND)\tstman$(DETOURS_OPTION_BITS).pdb \ $(BIND)\tryman$(DETOURS_OPTION_BITS).exe \ $(BIND)\tryman$(DETOURS_OPTION_BITS).pdb \ $(BIND)\size$(DETOURS_OPTION_BITS).exe \ $(BIND)\size$(DETOURS_OPTION_BITS).pdb \ !ELSE option: !ENDIF ############################################################################## # !IF "$(DETOURS_TARGET_PROCESSOR)" == "X64" # #!MESSAGE Building for 64-bit X64. # DETOURS_SOURCE_BROWSING = 0 # !ELSEIF "$(DETOURS_TARGET_PROCESSOR)" == "IA64" # #!MESSAGE Building for 64-bit IA64. # !ELSEIF "$(DETOURS_TARGET_PROCESSOR)" == "X86" # #!MESSAGE Building for 32-bit X86. # !ELSE !if "$(DETOURS_OPTION_PROCESSOR)" != "" test: all size32 size64 !else test: all !endif @echo ---- Trying native binary w/o test ---------------------- $(BIND)\tryman$(DETOURS_BITS).exe @echo. @echo ---- Trying native binary ------------------------------- $(BIND)\withdll.exe -d:$(BIND)\tstman$(DETOURS_BITS).dll $(BIND)\tryman$(DETOURS_BITS).exe @echo. @echo ---- Trying anycpu managed binary ----------------------- -$(BIND)\withdll.exe -d:$(BIND)\tstman$(DETOURS_BITS).dll $(BIND)\managed-any.exe @echo. @echo ---- Trying anycpu managed 32-bit preferrred binary ----- -if exist $(BIND)\managed-any32.exe $(BIND)\withdll.exe -d:$(BIND)\tstman$(DETOURS_BITS).dll $(BIND)\managed-any32.exe @echo. @echo ---- Trying x86 managed binary -------------------------- -$(BIND)\withdll.exe -d:$(BIND)\tstman$(DETOURS_BITS).dll $(BIND)\managed-x86.exe @echo. @echo ---- Trying x64 managed binary -------------------------- -$(BIND)\withdll.exe -d:$(BIND)\tstman$(DETOURS_BITS).dll $(BIND)\managed-x64.exe @echo. @echo ---- Trying ia64 managed binary ------------------------- -$(BIND)\withdll.exe -d:$(BIND)\tstman$(DETOURS_BITS).dll $(BIND)\managed-ia64.exe @echo. testm: all csc managed.cs @echo. $(BIND)\withdll.exe -d:$(BIND)\tstman$(DETOURS_BITS).dll $(BIND)\managed-any.exe @echo. size: all @echo. $(BIND)\withdll.exe -d:$(BIND)\tstman$(DETOURS_BITS).dll $(BIND)\size$(DETOURS_BITS).exe 10 @echo. size32: all @echo. $(BIND)\withdll.exe -d:$(BIND)\tstman$(DETOURS_BITS).dll $(BIND)\size32.exe 10 @echo. size64: all @echo. $(BIND)\withdll.exe -d:$(BIND)\tstman$(DETOURS_BITS).dll $(BIND)\size64.exe 10 @echo. sizedbg: all @echo. windbg -o $(BIND)\withdll.exe -d:$(BIND)\tstman$(DETOURS_BITS).dll $(BIND)\size$(DETOURS_BITS).exe 10 @echo. tx: all cd $(MAKEDIR)\..\..\src nmake /nologo cd $(MAKEDIR)\..\..\samples\withdll nmake /nologo cd $(MAKEDIR) rem $(BIND)\withdll.exe -d:$(BIND)\tstman$(DETOURS_BITS).dll $(BIND)\managed.exe windbg -g -o $(BIND)\withdll.exe -d:$(BIND)\tstman$(DETOURS_BITS).dll $(BIND)\managed-any.exe mx: all cd $(MAKEDIR)\..\..\src nmake /nologo cd $(MAKEDIR)\..\..\samples\withdll nmake /nologo cd $(MAKEDIR) $(BIND)\withdll.exe -d:$(BIND)\tstman$(DETOURS_BITS).dll $(BIND)\tryman$(DETOURS_BITS).exe test-managed: all @echo ---- Trying anycpu managed binary ----------------------- -$(BIND)\withdll.exe -d:$(BIND)\tstman$(DETOURS_BITS).dll $(BIND)\managed-any.exe @echo. @echo ---- Trying x86 managed binary -------------------------- -$(BIND_X86)\withdll.exe -d:$(BIND_X86)\tstman32.dll $(BIND_X86)\managed-x86.exe @echo. @echo ---- Trying anycpu managed 32-bit preferrred binary ----- -if exist $(BIND_X86)\managed-any32.exe $(BIND_X86)\withdll.exe -d:$(BIND_X86)\tstman32.dll $(BIND_X86)\managed-any32.exe @echo. @echo ---- Trying x64 managed binary -------------------------- -$(BIND)\withdll.exe -d:$(BIND_X64)\tstman64.dll $(BIND)\managed-x64.exe ################################################################# End of File. ================================================ FILE: ext/detours/samples/tryman/managed.cs ================================================ using System; using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyProduct("Microsoft Research Detours")] [assembly: AssemblyCompany("Microsoft Corporation")] [assembly: AssemblyVersion("1.0.0.0")] public class Test { // [DllImport("kernel32.dll", CharSet=CharSet.Auto, SetLastError=true)] // static extern IntPtr LoadLibrary([In, MarshalAs(UnmanagedType.LPStr)] string lpFileName); [DllImport("kernel32", CharSet=CharSet.Auto, SetLastError=true)] static extern IntPtr LoadLibrary(string lpFileName); public static int Main() { if (IntPtr.Size == 4) { Console.WriteLine(" *** Managed code with 32-bit runtime ({0})", Environment.Version); } else if (IntPtr.Size == 8) { Console.WriteLine(" *** Managed code with 64-bit runtime ({0})", Environment.Version); } else { Console.WriteLine(" *** Managed code of unknown IntPtr.Size: {0}", IntPtr.Size); } if (IntPtr.Size == 4) { if (LoadLibrary("tstman32.dll") == (IntPtr)0) { Console.WriteLine("--------: managed code failed to load tstman32.dll"); } } else { if (LoadLibrary("tstman64.dll") == (IntPtr)0) { Console.WriteLine("--------: managed code failed to load tstman64.dll"); } } return 0; } } ================================================ FILE: ext/detours/samples/tryman/size.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detour Test Program (sleepold.cpp of sleepold.exe) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include #include #include #pragma warning(push) #if _MSC_VER > 1400 #pragma warning(disable:6102 6103) // /analyze warnings #endif #include #pragma warning(pop) #include int __cdecl main(int argc, char **argv) { STARTUPINFOA si; PROCESS_INFORMATION pi; CHAR szFullExe[MAX_PATH]; CHAR szCommand[MAX_PATH]; PCHAR pszFileExe; PCHAR pszExe; ZeroMemory(&si, sizeof(si)); ZeroMemory(&pi, sizeof(pi)); si.cb = sizeof(si); if (argc != 2) { printf("size" DETOURS_STRINGIFY(DETOURS_BITS) ".exe:" " must take a single integer argument.\n"); fflush(stdout); return 3; } int repeats = atoi(argv[1]); if (repeats <= 0) { printf("size" DETOURS_STRINGIFY(DETOURS_BITS) ".exe:" " End of the road, repeats=0.\n"); fflush(stdout); return 0; } if ((repeats % 2) == 0) { #ifdef DETOURS_OPTION_BITS pszExe = "size" DETOURS_STRINGIFY(DETOURS_OPTION_BITS) ".exe"; #else pszExe = "size" DETOURS_STRINGIFY(DETOURS_BITS) ".exe"; #endif } else { pszExe = "size" DETOURS_STRINGIFY(DETOURS_BITS) ".exe"; } if (!SearchPathA(NULL, pszExe, ".exe", ARRAYSIZE(szFullExe), szFullExe, &pszFileExe)) { pszExe = "size" DETOURS_STRINGIFY(DETOURS_BITS) ".exe"; SearchPathA(NULL, pszExe, ".exe", ARRAYSIZE(szFullExe), szFullExe, &pszFileExe); } StringCchPrintfA(szCommand, sizeof(szCommand), "%s %d", pszExe, repeats - 1); printf("size" DETOURS_STRINGIFY(DETOURS_BITS) ".exe:" " [%s]\n", szCommand); fflush(stdout); SetLastError(0); if (!CreateProcessA(szFullExe[0] ? szFullExe : NULL, szCommand, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi)) { DWORD dwError = GetLastError(); printf("size" DETOURS_STRINGIFY(DETOURS_BITS) ".exe:" " CreateProcess failed: %ld\n", dwError); return 1; } WaitForSingleObject(pi.hProcess, INFINITE); DWORD dwResult = 0; if (!GetExitCodeProcess(pi.hProcess, &dwResult)) { printf("size" DETOURS_STRINGIFY(DETOURS_BITS) ".exe:" " GetExitCodeProcess failed: %ld\n", GetLastError()); return 9010; } return 0; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/tryman/tryman.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (tryman.cpp of tryman.exe) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include extern int WINAPI Test3264(int arg); int __cdecl main(int argc, char ** argv) { (void)argv; int ret = 0; ret = Test3264(argc); return ret == 0 ? ret : 0; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/tryman/tstman.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Detours Test Program (tstman.cpp of tstman.dll) // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // // This DLL doesn't detour any APIs, but it does enumerate the modules // loaded in a process and look at their size and processor target. // #include #include #pragma warning(push) #if _MSC_VER > 1400 #pragma warning(disable:6102 6103) // /analyze warnings #endif #include #pragma warning(pop) #include "detours.h" static HMODULE s_hInst = NULL; static CHAR s_szDllPath[MAX_PATH]; static int (WINAPI * TrueEntryPoint)(VOID) = NULL; static int (WINAPI * RawEntryPoint)(VOID) = NULL; BOOL (WINAPI * Real_CreateProcessA)(LPCSTR a0, LPSTR a1, LPSECURITY_ATTRIBUTES a2, LPSECURITY_ATTRIBUTES a3, BOOL a4, DWORD a5, LPVOID a6, LPCSTR a7, struct _STARTUPINFOA* a8, LPPROCESS_INFORMATION a9) = CreateProcessA; BOOL (WINAPI * Real_CreateProcessW)(LPCWSTR a0, LPWSTR a1, LPSECURITY_ATTRIBUTES a2, LPSECURITY_ATTRIBUTES a3, BOOL a4, DWORD a5, LPVOID a6, LPCWSTR a7, struct _STARTUPINFOW* a8, LPPROCESS_INFORMATION a9) = CreateProcessW; BOOL WINAPI Mine_CreateProcessA(LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) { BOOL rv = 0; __try { rv = DetourCreateProcessWithDllExA(lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation, s_szDllPath, Real_CreateProcessA); } __finally { }; return rv; } BOOL WINAPI Mine_CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) { BOOL rv = 0; __try { rv = DetourCreateProcessWithDllExW(lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation, s_szDllPath, Real_CreateProcessW); } __finally { }; return rv; } void DumpModuleInfo(HMODULE hModule) { PBYTE pbModule = (PBYTE)hModule; PIMAGE_DOS_HEADER pidh = (PIMAGE_DOS_HEADER)pbModule; PIMAGE_NT_HEADERS pinh = (PIMAGE_NT_HEADERS)(pbModule + pidh->e_lfanew); CHAR szFile[MAX_PATH] = ""; GetModuleFileNameA(hModule, szFile, sizeof(szFile)); CHAR szMagic[64]; CHAR szMachine[64]; CHAR szClr[64]; PIMAGE_DATA_DIRECTORY pdir = (pinh->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC) ? ((PIMAGE_NT_HEADERS32)pinh)->OptionalHeader.DataDirectory : ((PIMAGE_NT_HEADERS64)pinh)->OptionalHeader.DataDirectory; if (pdir[IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR].VirtualAddress != 0 && pdir[IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR].Size != 0) { PDETOUR_CLR_HEADER pch = (PDETOUR_CLR_HEADER) (pbModule + pdir[IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR].VirtualAddress); if ((pch->Flags & 0x3) == 0x0) { StringCchPrintfA(szClr, ARRAYSIZE(szClr), "clr "); // 32- or 64-bit. } else if ((pch->Flags & 0x3) == 0x1) { StringCchPrintfA(szClr, ARRAYSIZE(szClr), "clri "); // IL-Only, 32- or 64-bit. } else if ((pch->Flags & 0x3) == 0x2) { StringCchPrintfA(szClr, ARRAYSIZE(szClr), "clr32 "); // must be 32-bit. } else if ((pch->Flags & 0x3) == 0x3) { StringCchPrintfA(szClr, ARRAYSIZE(szClr), "clr32i"); // IL-Only, must be 32-bit. } } else { StringCchPrintfA(szClr, ARRAYSIZE(szClr), " "); } if (pinh->OptionalHeader.Magic == 0x10b) { StringCchPrintfA(szMagic, ARRAYSIZE(szMagic), "32"); } else if (pinh->OptionalHeader.Magic == 0x20b) { StringCchPrintfA(szMagic, ARRAYSIZE(szMagic), "64"); } else { StringCchPrintfA(szMagic, ARRAYSIZE(szMagic), "??"); } if (pinh->FileHeader.Machine == 0x8664) { StringCchPrintfA(szMachine, ARRAYSIZE(szMachine), "x64", pinh->FileHeader.Machine); } else if (pinh->FileHeader.Machine == 0x014c) { StringCchPrintfA(szMachine, ARRAYSIZE(szMachine), "x86", pinh->FileHeader.Machine); } else if (pinh->FileHeader.Machine == 0x0200) { StringCchPrintfA(szMachine, ARRAYSIZE(szMachine), "i64", pinh->FileHeader.Machine); } else if (pinh->FileHeader.Machine == 0x01c0) { StringCchPrintfA(szMachine, ARRAYSIZE(szMachine), "arm", pinh->FileHeader.Machine); } else { StringCchPrintfA(szMachine, ARRAYSIZE(szMachine), "%04x", pinh->FileHeader.Machine); DWORD dwSize = DetourGetSizeOfPayloads(hModule); if (dwSize > 0) { StringCchPrintfA(szMachine, ARRAYSIZE(szMachine), " "); StringCchPrintfA(szFile, ARRAYSIZE(szFile), "-- %d byte payload.", dwSize); } } printf("%16I64x: %s %s %s %s\n", (ULONG64)hModule, szMagic, szMachine, szClr, szFile); } void DumpMemory(PBYTE pbData, DWORD cbData) { for (DWORD i = 0; i < cbData; i += 16) { printf(" %p:", pbData + i); for (DWORD j = 0; j < 16; j++) { if (i + j < cbData) { printf("%02x", pbData[i+j]); } else { printf(" "); } } printf(" "); for (DWORD j = 0; j < 16; j++) { if (i + j < cbData) { if ( pbData[i+j] >= ' ' && pbData[i+j] < 127) { printf("%c", pbData[i+j]); } else { printf("."); } } else { printf(" "); } } printf("\n"); } } int WINAPI Test3264(int arg) { return arg + 1; } int WINAPI TestEntryPoint(VOID) { #if DETOURS_64BIT printf("----------------: "); #else printf("--------: "); #endif printf("Calling EntryPoint() from detour.\n"); fflush(stdout); return TrueEntryPoint(); } BOOL WINAPI DllMain(HINSTANCE hinst, DWORD dwReason, LPVOID reserved) { (void)hinst; (void)reserved; if (DetourIsHelperProcess()) { return TRUE; } if (dwReason == DLL_PROCESS_ATTACH) { DetourRestoreAfterWith(); s_hInst = hinst; GetModuleFileNameA(s_hInst, s_szDllPath, ARRAYSIZE(s_szDllPath)); #if DETOURS_64BIT printf("----------------: "); #else printf("--------: "); #endif SYSTEM_INFO si; GetSystemInfo(&si); if (si.wProcessorArchitecture == 9) { printf("x64 Processor\n"); } else if (si.wProcessorArchitecture == 0) { printf("x86 Processor\n"); } else if (si.wProcessorArchitecture == 6) { printf("ia64 Processor\n"); } else { printf("%04x Processor\n", si.wProcessorArchitecture); } HMODULE hSelf = GetModuleHandle(NULL); HMODULE hTest = (HMODULE)DetourGetContainingModule(DetourCodeFromPointer(Test3264, NULL)); HMODULE hKern = (HMODULE)DetourGetContainingModule(DetourCodeFromPointer(CreateProcessW, NULL)); DumpModuleInfo(hSelf); DumpModuleInfo(hTest); DumpModuleInfo(hKern); for (HINSTANCE hInst = NULL; (hInst = DetourEnumerateModules(hInst)) != NULL;) { if (hInst == hSelf || hInst == hTest || hInst == hKern) { continue; } DumpModuleInfo(hInst); } fflush(stdout); TrueEntryPoint = (int (WINAPI *)(VOID))DetourGetEntryPoint(NULL); RawEntryPoint = TrueEntryPoint; DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)TrueEntryPoint, TestEntryPoint); DetourAttach(&(PVOID&)Real_CreateProcessA, Mine_CreateProcessA); DetourAttach(&(PVOID&)Real_CreateProcessW, Mine_CreateProcessW); LONG error = DetourTransactionCommit(); #if DETOURS_64BIT printf("----------------: "); #else printf("--------: "); #endif if (error == NO_ERROR) { printf("Detoured EntryPoint().\n"); } else { printf("Error detouring EntryPoint(): %ld (@ %p)\n", error, RawEntryPoint); __debugbreak(); } } else if (dwReason == DLL_PROCESS_DETACH) { DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourDetach(&(PVOID&)TrueEntryPoint, TestEntryPoint); DetourDetach(&(PVOID&)Real_CreateProcessA, Mine_CreateProcessA); DetourDetach(&(PVOID&)Real_CreateProcessW, Mine_CreateProcessW); LONG error = DetourTransactionCommit(); if (error != NO_ERROR) { printf("Error detach detours failed: %ld\n", error); } } return TRUE; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/samples/tryman/tstman.rc ================================================ ////////////////////////////////////////////////////////////////////////////// // // Version information for tstman.rc. // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include "detver.h" #define VER_INTERNALNAME_STR "tstman" DETOURS_STRINGIFY(DETOURS_BITS) #define VER_ORIGINALFILENAME_STR "tstman" DETOURS_STRINGIFY(DETOURS_BITS) ".dll" #define VER_FILEDESCRIPTION_STR "Detours 32/64-bit Test Module" #define VER_COMPANYNAME_STR "Microsoft Corporation" #include "common.ver" ================================================ FILE: ext/detours/samples/withdll/Makefile ================================================ ############################################################################## ## ## Makefile for Detours Test Programs. ## ## Microsoft Research Detours Package ## ## Copyright (c) Microsoft Corporation. All rights reserved. ## !include ..\common.mak LIBS=$(LIBS) kernel32.lib ############################################################################## all: dirs \ $(BIND)\withdll.exe \ !IF $(DETOURS_SOURCE_BROWSING)==1 $(OBJD)\withdll.bsc \ !ENDIF option clean: -del *~ 2>nul -del $(BIND)\withdll.* 2>nul -rmdir /q /s $(OBJD) 2>nul realclean: clean -rmdir /q /s $(OBJDS) 2>nul ############################################################################## dirs: @if not exist $(BIND) mkdir $(BIND) && echo. Created $(BIND) @if not exist $(OBJD) mkdir $(OBJD) && echo. Created $(OBJD) $(OBJD)\withdll.obj : withdll.cpp $(BIND)\withdll.exe : $(OBJD)\withdll.obj $(DEPS) cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb $(OBJD)\withdll.obj \ /link $(LINKFLAGS) $(LIBS) /subsystem:console $(OBJD)\withdll.bsc : $(OBJD)\withdll.obj bscmake /v /n /o $@ $(OBJD)\withdll.sbr ############################################### Install non-bit-size binaries. option: ############################################################################## test: all $(BIND)\withdll.exe -d:$(BIND)\slept$(DETOURS_BITS).dll $(BIND)\sleepold.exe $(BIND)\withdll.exe -v -d:$(BIND)\slept$(DETOURS_BITS).dll $(BIND)\sleepold.exe debug: all windbg -c ".srcfix;l+s;l+t" -o \ $(BIND)\withdll.exe -d:$(BIND)\slept$(DETOURS_BITS).dll $(BIND)\sleepold.exe ################################################################# End of File. ================================================ FILE: ext/detours/samples/withdll/withdll.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Test DetourCreateProcessWithDll function (withdll.cpp). // // Microsoft Research Detours Package // // Copyright (c) Microsoft Corporation. All rights reserved. // #include #include #include #pragma warning(push) #if _MSC_VER > 1400 #pragma warning(disable:6102 6103) // /analyze warnings #endif #include #pragma warning(pop) ////////////////////////////////////////////////////////////////////////////// // void PrintUsage(void) { printf("Usage:\n" " withdll.exe [options] [command line]\n" "Options:\n" " /d:file.dll : Start the process with file.dll.\n" " /v : Verbose, display memory at start.\n" " /? : This help screen.\n"); } ////////////////////////////////////////////////////////////////////////////// // // This code verifies that the named DLL has been configured correctly // to be imported into the target process. DLLs must export a function with // ordinal #1 so that the import table touch-up magic works. // struct ExportContext { BOOL fHasOrdinal1; ULONG nExports; }; static BOOL CALLBACK ExportCallback(_In_opt_ PVOID pContext, _In_ ULONG nOrdinal, _In_opt_ LPCSTR pszSymbol, _In_opt_ PVOID pbTarget) { (void)pContext; (void)pbTarget; (void)pszSymbol; ExportContext *pec = (ExportContext *)pContext; if (nOrdinal == 1) { pec->fHasOrdinal1 = TRUE; } pec->nExports++; return TRUE; } ////////////////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////////////////// // void TypeToString(DWORD Type, char *pszBuffer, size_t cBuffer) { if (Type == MEM_IMAGE) { StringCchPrintfA(pszBuffer, cBuffer, "img"); } else if (Type == MEM_MAPPED) { StringCchPrintfA(pszBuffer, cBuffer, "map"); } else if (Type == MEM_PRIVATE) { StringCchPrintfA(pszBuffer, cBuffer, "pri"); } else { StringCchPrintfA(pszBuffer, cBuffer, "%x", Type); } } void StateToString(DWORD State, char *pszBuffer, size_t cBuffer) { if (State == MEM_COMMIT) { StringCchPrintfA(pszBuffer, cBuffer, "com"); } else if (State == MEM_FREE) { StringCchPrintfA(pszBuffer, cBuffer, "fre"); } else if (State == MEM_RESERVE) { StringCchPrintfA(pszBuffer, cBuffer, "res"); } else { StringCchPrintfA(pszBuffer, cBuffer, "%x", State); } } void ProtectToString(DWORD Protect, char *pszBuffer, size_t cBuffer) { if (Protect == 0) { StringCchPrintfA(pszBuffer, cBuffer, ""); } else if (Protect == PAGE_EXECUTE) { StringCchPrintfA(pszBuffer, cBuffer, "--x"); } else if (Protect == PAGE_EXECUTE_READ) { StringCchPrintfA(pszBuffer, cBuffer, "r-x"); } else if (Protect == PAGE_EXECUTE_READWRITE) { StringCchPrintfA(pszBuffer, cBuffer, "rwx"); } else if (Protect == PAGE_EXECUTE_WRITECOPY) { StringCchPrintfA(pszBuffer, cBuffer, "rcx"); } else if (Protect == PAGE_NOACCESS) { StringCchPrintfA(pszBuffer, cBuffer, "---"); } else if (Protect == PAGE_READONLY) { StringCchPrintfA(pszBuffer, cBuffer, "r--"); } else if (Protect == PAGE_READWRITE) { StringCchPrintfA(pszBuffer, cBuffer, "rw-"); } else if (Protect == PAGE_WRITECOPY) { StringCchPrintfA(pszBuffer, cBuffer, "rc-"); } else if (Protect == (PAGE_GUARD | PAGE_EXECUTE)) { StringCchPrintfA(pszBuffer, cBuffer, "g--x"); } else if (Protect == (PAGE_GUARD | PAGE_EXECUTE_READ)) { StringCchPrintfA(pszBuffer, cBuffer, "gr-x"); } else if (Protect == (PAGE_GUARD | PAGE_EXECUTE_READWRITE)) { StringCchPrintfA(pszBuffer, cBuffer, "grwx"); } else if (Protect == (PAGE_GUARD | PAGE_EXECUTE_WRITECOPY)) { StringCchPrintfA(pszBuffer, cBuffer, "grcx"); } else if (Protect == (PAGE_GUARD | PAGE_NOACCESS)) { StringCchPrintfA(pszBuffer, cBuffer, "g---"); } else if (Protect == (PAGE_GUARD | PAGE_READONLY)) { StringCchPrintfA(pszBuffer, cBuffer, "gr--"); } else if (Protect == (PAGE_GUARD | PAGE_READWRITE)) { StringCchPrintfA(pszBuffer, cBuffer, "grw-"); } else if (Protect == (PAGE_GUARD | PAGE_WRITECOPY)) { StringCchPrintfA(pszBuffer, cBuffer, "grc-"); } else { StringCchPrintfA(pszBuffer, cBuffer, "%x", Protect); } } typedef union { struct { DWORD Signature; IMAGE_FILE_HEADER FileHeader; } ih; IMAGE_NT_HEADERS32 ih32; IMAGE_NT_HEADERS64 ih64; } IMAGE_NT_HEADER; struct SECTIONS { PBYTE pbBeg; PBYTE pbEnd; CHAR szName[16]; } Sections[256]; DWORD SectionCount = 0; DWORD Bitness = 0; PCHAR FindSectionName(PBYTE pbBase, PBYTE& pbEnd) { for (DWORD n = 0; n < SectionCount; n++) { if (Sections[n].pbBeg == pbBase) { pbEnd = Sections[n].pbEnd; return Sections[n].szName; } } pbEnd = NULL; return NULL; } ULONG PadToPage(ULONG Size) { return (Size & 0xfff) ? Size + 0x1000 - (Size & 0xfff) : Size; } BOOL GetSections(HANDLE hp, PBYTE pbBase) { DWORD beg = 0; DWORD cnt = 0; SIZE_T done; IMAGE_DOS_HEADER idh; if (!ReadProcessMemory(hp, pbBase, &idh, sizeof(idh), &done) || done != sizeof(idh)) { return FALSE; } if (idh.e_magic != IMAGE_DOS_SIGNATURE) { return FALSE; } IMAGE_NT_HEADER inh; if (!ReadProcessMemory(hp, pbBase + idh.e_lfanew, &inh, sizeof(inh), &done) || done != sizeof(inh)) { printf("No Read\n"); return FALSE; } if (inh.ih.Signature != IMAGE_NT_SIGNATURE) { printf("No NT\n"); return FALSE; } beg = idh.e_lfanew + FIELD_OFFSET( IMAGE_NT_HEADERS, OptionalHeader ) + inh.ih.FileHeader.SizeOfOptionalHeader; cnt = inh.ih.FileHeader.NumberOfSections; Bitness = (inh.ih32.OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC) ? 32 : 64; #if 0 printf("%d %d count=%d\n", beg, Bitness, cnt); #endif IMAGE_SECTION_HEADER ish; for (DWORD n = 0; n < cnt; n++) { if (!ReadProcessMemory(hp, pbBase + beg + n * sizeof(ish), &ish, sizeof(ish), &done) || done != sizeof(ish)) { printf("No Read\n"); return FALSE; } Sections[n].pbBeg = pbBase + ish.VirtualAddress; Sections[n].pbEnd = pbBase + ish.VirtualAddress + PadToPage(ish.Misc.VirtualSize); memcpy(Sections[n].szName, ish.Name, sizeof(ish.Name)); Sections[n].szName[sizeof(ish.Name)] = '\0'; #if 0 printf("--- %p %s\n", Sections[n].pbBeg, Sections[n].szName); #endif } SectionCount = cnt; return TRUE; } BOOL DumpProcess(HANDLE hp) { ULONG64 base; ULONG64 next; MEMORY_BASIC_INFORMATION mbi; printf(" %12s %8s %8s: %3s %3s %4s %3s : %8s\n", "Address", "Offset", "Size", "Typ", "Sta", "Prot", "Ini", "Contents"); printf(" %12s %8s %8s: %3s %3s %4s %3s : %8s\n", "------------", "--------", "--------", "---", "---", "----", "---", "-----------------"); for (next = 0;;) { base = next; ZeroMemory(&mbi, sizeof(mbi)); if (VirtualQueryEx(hp, (PVOID)base, &mbi, sizeof(mbi)) == 0) { break; } if ((mbi.RegionSize & 0xfff) == 0xfff) { break; } next = (ULONG64)mbi.BaseAddress + mbi.RegionSize; if (mbi.State == MEM_FREE) { continue; } CHAR szType[16]; TypeToString(mbi.Type, szType, ARRAYSIZE(szType)); CHAR szState[16]; StateToString(mbi.State, szState, ARRAYSIZE(szState)); CHAR szProtect[16]; ProtectToString(mbi.Protect, szProtect, ARRAYSIZE(szProtect)); CHAR szAllocProtect[16]; ProtectToString(mbi.AllocationProtect, szAllocProtect, ARRAYSIZE(szAllocProtect)); CHAR szFile[MAX_PATH]; szFile[0] = '\0'; DWORD cb = 0; PCHAR pszFile = szFile; if (base == (ULONG64)mbi.AllocationBase) { #if 0 cb = pfGetMappedFileName(hp, (PVOID)mbi.AllocationBase, szFile, ARRAYSIZE(szFile)); #endif if (GetSections(hp, (PBYTE)mbi.AllocationBase)) { next = base + 0x1000; StringCchPrintfA(szFile, ARRAYSIZE(szFile), "%d-bit PE", Bitness); } } if (cb > 0) { for (DWORD c = 0; c < cb; c++) { szFile[c] = (szFile[c] >= 'a' && szFile[c] <= 'z') ? szFile[c] - 'a' + 'A' : szFile[c]; } szFile[cb] = '\0'; } if ((pszFile = strrchr(szFile, '\\')) == NULL) { pszFile = szFile; } else { pszFile++; } PBYTE pbEnd; PCHAR pszSect = FindSectionName((PBYTE)base, pbEnd); if (pszSect != NULL) { pszFile = pszSect; if (next > (ULONG64)pbEnd) { next = (ULONG64)pbEnd; } } CHAR szDesc[128]; ZeroMemory(&szDesc, ARRAYSIZE(szDesc)); if (base == (ULONG64)mbi.AllocationBase) { StringCchPrintfA(szDesc, ARRAYSIZE(szDesc), " %12I64x %8I64x %8I64x: %3s %3s %4s %3s : %s", (ULONG64)base, (ULONG64)base - (ULONG64)mbi.AllocationBase, (ULONG64)next - (ULONG64)base, szType, szState, szProtect, szAllocProtect, pszFile); } else { StringCchPrintfA(szDesc, ARRAYSIZE(szDesc), " %12s %8I64x %8I64x: %3s %3s %4s %3s : %s", "-", (ULONG64)base - (ULONG64)mbi.AllocationBase, (ULONG64)next - (ULONG64)base, szType, szState, szProtect, szAllocProtect, pszFile); } printf("%s\n", szDesc); } return TRUE; } //////////////////////////////////////////////////////////////////////// main. // int CDECL main(int argc, char **argv) { BOOLEAN fNeedHelp = FALSE; BOOLEAN fVerbose = FALSE; LPCSTR rpszDllsRaw[256]; LPCSTR rpszDllsOut[256]; DWORD nDlls = 0; for (DWORD n = 0; n < ARRAYSIZE(rpszDllsRaw); n++) { rpszDllsRaw[n] = NULL; rpszDllsOut[n] = NULL; } int arg = 1; for (; arg < argc && (argv[arg][0] == '-' || argv[arg][0] == '/'); arg++) { CHAR *argn = argv[arg] + 1; CHAR *argp = argn; while (*argp && *argp != ':' && *argp != '=') argp++; if (*argp == ':' || *argp == '=') *argp++ = '\0'; switch (argn[0]) { case 'd': // Set DLL Name case 'D': if (nDlls < ARRAYSIZE(rpszDllsRaw)) { rpszDllsRaw[nDlls++] = argp; } else { printf("withdll.exe: Too many DLLs.\n"); fNeedHelp = TRUE; break; } break; case 'v': // Verbose case 'V': fVerbose = TRUE; break; case '?': // Help fNeedHelp = TRUE; break; default: fNeedHelp = TRUE; printf("withdll.exe: Bad argument: %s\n", argv[arg]); break; } } if (arg >= argc) { fNeedHelp = TRUE; } if (nDlls == 0) { fNeedHelp = TRUE; } if (fNeedHelp) { PrintUsage(); return 9001; } /////////////////////////////////////////////////////////// Validate DLLs. // for (DWORD n = 0; n < nDlls; n++) { CHAR szDllPath[1024]; PCHAR pszFilePart = NULL; if (!GetFullPathNameA(rpszDllsRaw[n], ARRAYSIZE(szDllPath), szDllPath, &pszFilePart)) { printf("withdll.exe: Error: %s is not a valid path name..\n", rpszDllsRaw[n]); return 9002; } DWORD c = (DWORD)strlen(szDllPath) + 1; PCHAR psz = new CHAR [c]; StringCchCopyA(psz, c, szDllPath); rpszDllsOut[n] = psz; HMODULE hDll = LoadLibraryExA(rpszDllsOut[n], NULL, DONT_RESOLVE_DLL_REFERENCES); if (hDll == NULL) { printf("withdll.exe: Error: %s failed to load (error %ld).\n", rpszDllsOut[n], GetLastError()); return 9003; } ExportContext ec; ec.fHasOrdinal1 = FALSE; ec.nExports = 0; DetourEnumerateExports(hDll, &ec, ExportCallback); FreeLibrary(hDll); if (!ec.fHasOrdinal1) { printf("withdll.exe: Error: %s does not export ordinal #1.\n", rpszDllsOut[n]); printf(" See help entry DetourCreateProcessWithDllEx in Detours.chm.\n"); return 9004; } } ////////////////////////////////////////////////////////////////////////// STARTUPINFOA si; PROCESS_INFORMATION pi; CHAR szCommand[2048]; CHAR szExe[1024]; CHAR szFullExe[1024] = "\0"; PCHAR pszFileExe = NULL; ZeroMemory(&si, sizeof(si)); ZeroMemory(&pi, sizeof(pi)); si.cb = sizeof(si); szCommand[0] = L'\0'; StringCchCopyA(szExe, sizeof(szExe), argv[arg]); for (; arg < argc; arg++) { if (strchr(argv[arg], ' ') != NULL || strchr(argv[arg], '\t') != NULL) { StringCchCatA(szCommand, sizeof(szCommand), "\""); StringCchCatA(szCommand, sizeof(szCommand), argv[arg]); StringCchCatA(szCommand, sizeof(szCommand), "\""); } else { StringCchCatA(szCommand, sizeof(szCommand), argv[arg]); } if (arg + 1 < argc) { StringCchCatA(szCommand, sizeof(szCommand), " "); } } printf("withdll.exe: Starting: `%s'\n", szCommand); for (DWORD n = 0; n < nDlls; n++) { printf("withdll.exe: with `%s'\n", rpszDllsOut[n]); } fflush(stdout); DWORD dwFlags = CREATE_DEFAULT_ERROR_MODE | CREATE_SUSPENDED; SetLastError(0); SearchPathA(NULL, szExe, ".exe", ARRAYSIZE(szFullExe), szFullExe, &pszFileExe); if (!DetourCreateProcessWithDllsA(szFullExe[0] ? szFullExe : NULL, szCommand, NULL, NULL, TRUE, dwFlags, NULL, NULL, &si, &pi, nDlls, rpszDllsOut, NULL)) { DWORD dwError = GetLastError(); printf("withdll.exe: DetourCreateProcessWithDllEx failed: %ld\n", dwError); if (dwError == ERROR_INVALID_HANDLE) { #if DETOURS_64BIT printf("withdll.exe: Can't detour a 32-bit target process from a 64-bit parent process.\n"); #else printf("withdll.exe: Can't detour a 64-bit target process from a 32-bit parent process.\n"); #endif } ExitProcess(9009); } if (fVerbose) { DumpProcess(pi.hProcess); } ResumeThread(pi.hThread); WaitForSingleObject(pi.hProcess, INFINITE); DWORD dwResult = 0; if (!GetExitCodeProcess(pi.hProcess, &dwResult)) { printf("withdll.exe: GetExitCodeProcess failed: %ld\n", GetLastError()); return 9010; } for (DWORD n = 0; n < nDlls; n++) { if (rpszDllsOut[n] != NULL) { delete[] rpszDllsOut[n]; rpszDllsOut[n] = NULL; } } return dwResult; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/src/Makefile ================================================ ############################################################################## ## ## Makefile for Detours. ## ## Microsoft Research Detours Package, Version 4.0.1 ## ## Copyright (c) Microsoft Corporation. All rights reserved. ## ROOT = .. !include "$(ROOT)\system.mak" !IF "$(DETOURS_SOURCE_BROWSING)" == "" DETOURS_SOURCE_BROWSING = 0 !ENDIF #######################/####################################################### ## CFLAGS=/nologo /W4 /WX /we4777 /we4800 /Zi /MT /Gy /Gm- /Zl /Od !IF $(DETOURS_SOURCE_BROWSING)==1 CFLAGS=$(CFLAGS) /FR !ELSE CFLAGS=$(CFLAGS) /DWIN32_LEAN_AND_MEAN /D_WIN32_WINNT=0x501 !ENDIF !IF "$(DETOURS_TARGET_PROCESSOR)" == "IA64" CFLAGS=$(CFLAGS) /wd4163 # intrinsic rdtebex not available; using newer Windows headers with older compiler !ENDIF !if defined(DETOURS_WIN_7) && defined(DETOURS_CL_17_OR_NEWER) CFLAGS=$(CFLAGS) /D_USING_V110_SDK71_ !elseif defined(DETOURS_ANALYZE) CFLAGS=$(CFLAGS) /analyze !endif OBJS = \ $(OBJD)\detours.obj \ $(OBJD)\modules.obj \ $(OBJD)\disasm.obj \ $(OBJD)\image.obj \ $(OBJD)\creatwth.obj \ $(OBJD)\disolx86.obj \ $(OBJD)\disolx64.obj \ $(OBJD)\disolia64.obj \ $(OBJD)\disolarm.obj \ $(OBJD)\disolarm64.obj \ ############################################################################## ## .SUFFIXES: .cpp .h .obj !ifdef DETOURS_ANALYZE .cpp{$(OBJD)}.obj: $(CC) $(CFLAGS) /Fd$(LIBD)\detours.pdb /Fo$(OBJD)\ /c $< !else .cpp{$(OBJD)}.obj:: $(CC) $(CFLAGS) /Fd$(LIBD)\detours.pdb /Fo$(OBJD)\ /c $< !endif ############################################################################## all: dirs \ $(LIBD)\detours.lib \ $(INCD)\detours.h \ $(INCD)\detver.h \ !IF $(DETOURS_SOURCE_BROWSING)==1 $(OBJD)\detours.bsc \ !endif ############################################################################## clean: -del *~ 2>nul -del $(LIBD)\detours.pdb $(LIBD)\detours.lib 2>nul -rmdir /q /s $(OBJD) 2>nul realclean: clean -rmdir /q /s $(OBJDS) 2>nul ############################################################################## dirs: @if not exist "$(INCD)" mkdir "$(INCD)" && echo. Created $(INCD) @if not exist "$(LIBD)" mkdir "$(LIBD)" && echo. Created $(LIBD) @if not exist "$(BIND)" mkdir "$(BIND)" && echo. Created $(BIND) @if not exist "$(OBJD)" mkdir "$(OBJD)" && echo. Created $(OBJD) $(OBJD)\detours.bsc : $(OBJS) bscmake /v /n /o $@ $(OBJS:.obj=.sbr) $(LIBD)\detours.lib : $(OBJS) link /lib /out:$@ /nologo $(OBJS) $(INCD)\detours.h : detours.h copy detours.h $@ $(INCD)\detver.h : detver.h copy detver.h $@ $(OBJD)\detours.obj : detours.cpp detours.h $(OBJD)\modules.obj : modules.cpp detours.h $(OBJD)\disasm.obj : disasm.cpp detours.h $(OBJD)\image.obj : image.cpp detours.h $(OBJD)\creatwth.obj : creatwth.cpp uimports.cpp detours.h $(OBJD)\disolx86.obj: disasm.cpp detours.h $(OBJD)\disolx64.obj: disasm.cpp detours.h $(OBJD)\disolia64.obj: disasm.cpp detours.h $(OBJD)\disolarm.obj: disasm.cpp detours.h $(OBJD)\disolarm64.obj: disasm.cpp detours.h test: all cd $(MAKEDIR)\..\samples\slept nmake /nologo test cd $(MAKEDIR) ################################################################# End of File. ================================================ FILE: ext/detours/src/creatwth.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Create a process with a DLL (creatwth.cpp of detours.lib) // // Microsoft Research Detours Package, Version 4.0.1 // // Copyright (c) Microsoft Corporation. All rights reserved. // // #define DETOUR_DEBUG 1 #define DETOURS_INTERNAL #include "detours.h" #include #include #if DETOURS_VERSION != 0x4c0c1 // 0xMAJORcMINORcPATCH #error detours.h version mismatch #endif #define IMPORT_DIRECTORY OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT] #define BOUND_DIRECTORY OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT] #define CLR_DIRECTORY OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR] #define IAT_DIRECTORY OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IAT] ////////////////////////////////////////////////////////////////////////////// // const GUID DETOUR_EXE_HELPER_GUID = { /* ea0251b9-5cde-41b5-98d0-2af4a26b0fee */ 0xea0251b9, 0x5cde, 0x41b5, { 0x98, 0xd0, 0x2a, 0xf4, 0xa2, 0x6b, 0x0f, 0xee }}; ////////////////////////////////////////////////////////////////////////////// // // Enumate through modules in the target process. // static BOOL WINAPI LoadNtHeaderFromProcess(HANDLE hProcess, HMODULE hModule, PIMAGE_NT_HEADERS32 pNtHeader) { PBYTE pbModule = (PBYTE)hModule; if (pbModule == NULL) { SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } MEMORY_BASIC_INFORMATION mbi; ZeroMemory(&mbi, sizeof(mbi)); if (VirtualQueryEx(hProcess, hModule, &mbi, sizeof(mbi)) == 0) { return FALSE; } IMAGE_DOS_HEADER idh; if (!ReadProcessMemory(hProcess, pbModule, &idh, sizeof(idh), NULL)) { DETOUR_TRACE(("ReadProcessMemory(idh@%p..%p) failed: %d\n", pbModule, pbModule + sizeof(idh), GetLastError())); return FALSE; } if (idh.e_magic != IMAGE_DOS_SIGNATURE || (DWORD)idh.e_lfanew > mbi.RegionSize || (DWORD)idh.e_lfanew < sizeof(idh)) { SetLastError(ERROR_BAD_EXE_FORMAT); return FALSE; } if (!ReadProcessMemory(hProcess, pbModule + idh.e_lfanew, pNtHeader, sizeof(*pNtHeader), NULL)) { DETOUR_TRACE(("ReadProcessMemory(inh@%p..%p:%p) failed: %d\n", pbModule + idh.e_lfanew, pbModule + idh.e_lfanew + sizeof(*pNtHeader), pbModule, GetLastError())); return FALSE; } if (pNtHeader->Signature != IMAGE_NT_SIGNATURE) { SetLastError(ERROR_BAD_EXE_FORMAT); return FALSE; } return TRUE; } static HMODULE WINAPI EnumerateModulesInProcess(HANDLE hProcess, HMODULE hModuleLast, PIMAGE_NT_HEADERS32 pNtHeader) { PBYTE pbLast = (PBYTE)hModuleLast + MM_ALLOCATION_GRANULARITY; MEMORY_BASIC_INFORMATION mbi; ZeroMemory(&mbi, sizeof(mbi)); // Find the next memory region that contains a mapped PE image. // for (;; pbLast = (PBYTE)mbi.BaseAddress + mbi.RegionSize) { if (VirtualQueryEx(hProcess, (PVOID)pbLast, &mbi, sizeof(mbi)) == 0) { break; } // Usermode address space has such an unaligned region size always at the // end and only at the end. // if ((mbi.RegionSize & 0xfff) == 0xfff) { break; } if (((PBYTE)mbi.BaseAddress + mbi.RegionSize) < pbLast) { break; } // Skip uncommitted regions and guard pages. // if ((mbi.State != MEM_COMMIT) || ((mbi.Protect & 0xff) == PAGE_NOACCESS) || (mbi.Protect & PAGE_GUARD)) { continue; } if (LoadNtHeaderFromProcess(hProcess, (HMODULE)pbLast, pNtHeader)) { return (HMODULE)pbLast; } } return NULL; } ////////////////////////////////////////////////////////////////////////////// // // Find a region of memory in which we can create a replacement import table. // static PBYTE FindAndAllocateNearBase(HANDLE hProcess, PBYTE pbModule, PBYTE pbBase, DWORD cbAlloc) { MEMORY_BASIC_INFORMATION mbi; ZeroMemory(&mbi, sizeof(mbi)); PBYTE pbLast = pbBase; for (;; pbLast = (PBYTE)mbi.BaseAddress + mbi.RegionSize) { ZeroMemory(&mbi, sizeof(mbi)); if (VirtualQueryEx(hProcess, (PVOID)pbLast, &mbi, sizeof(mbi)) == 0) { if (GetLastError() == ERROR_INVALID_PARAMETER) { break; } DETOUR_TRACE(("VirtualQueryEx(%p) failed: %d\n", pbLast, GetLastError())); break; } // Usermode address space has such an unaligned region size always at the // end and only at the end. // if ((mbi.RegionSize & 0xfff) == 0xfff) { break; } // Skip anything other than a pure free region. // if (mbi.State != MEM_FREE) { continue; } // Use the max of mbi.BaseAddress and pbBase, in case mbi.BaseAddress < pbBase. PBYTE pbAddress = (PBYTE)mbi.BaseAddress > pbBase ? (PBYTE)mbi.BaseAddress : pbBase; // Round pbAddress up to the nearest MM allocation boundary. const DWORD_PTR mmGranularityMinusOne = (DWORD_PTR)(MM_ALLOCATION_GRANULARITY -1); pbAddress = (PBYTE)(((DWORD_PTR)pbAddress + mmGranularityMinusOne) & ~mmGranularityMinusOne); #ifdef _WIN64 // The offset from pbModule to any replacement import must fit into 32 bits. // For simplicity, we check that the offset to the last byte fits into 32 bits, // instead of the largest offset we'll actually use. The values are very similar. const size_t GB4 = ((((size_t)1) << 32) - 1); if ((size_t)(pbAddress + cbAlloc - 1 - pbModule) > GB4) { DETOUR_TRACE(("FindAndAllocateNearBase(1) failing due to distance >4GB %p\n", pbAddress)); return NULL; } #else UNREFERENCED_PARAMETER(pbModule); #endif DETOUR_TRACE(("Free region %p..%p\n", mbi.BaseAddress, (PBYTE)mbi.BaseAddress + mbi.RegionSize)); for (; pbAddress < (PBYTE)mbi.BaseAddress + mbi.RegionSize; pbAddress += MM_ALLOCATION_GRANULARITY) { PBYTE pbAlloc = (PBYTE)VirtualAllocEx(hProcess, pbAddress, cbAlloc, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); if (pbAlloc == NULL) { DETOUR_TRACE(("VirtualAllocEx(%p) failed: %d\n", pbAddress, GetLastError())); continue; } #ifdef _WIN64 // The offset from pbModule to any replacement import must fit into 32 bits. if ((size_t)(pbAddress + cbAlloc - 1 - pbModule) > GB4) { DETOUR_TRACE(("FindAndAllocateNearBase(2) failing due to distance >4GB %p\n", pbAddress)); return NULL; } #endif DETOUR_TRACE(("[%p..%p] Allocated for import table.\n", pbAlloc, pbAlloc + cbAlloc)); return pbAlloc; } } return NULL; } static inline DWORD PadToDword(DWORD dw) { return (dw + 3) & ~3u; } static inline DWORD PadToDwordPtr(DWORD dw) { return (dw + 7) & ~7u; } static inline HRESULT ReplaceOptionalSizeA(_Inout_z_count_(cchDest) LPSTR pszDest, _In_ size_t cchDest, _In_z_ LPCSTR pszSize) { if (cchDest == 0 || pszDest == NULL || pszSize == NULL || pszSize[0] == '\0' || pszSize[1] == '\0' || pszSize[2] != '\0') { // can not write into empty buffer or with string other than two chars. return ERROR_INVALID_PARAMETER; } for (; cchDest >= 2; cchDest--, pszDest++) { if (pszDest[0] == '?' && pszDest[1] == '?') { pszDest[0] = pszSize[0]; pszDest[1] = pszSize[1]; break; } } return S_OK; } static BOOL RecordExeRestore(HANDLE hProcess, HMODULE hModule, DETOUR_EXE_RESTORE& der) { // Save the various headers for DetourRestoreAfterWith. ZeroMemory(&der, sizeof(der)); der.cb = sizeof(der); der.pidh = (PBYTE)hModule; der.cbidh = sizeof(der.idh); if (!ReadProcessMemory(hProcess, der.pidh, &der.idh, sizeof(der.idh), NULL)) { DETOUR_TRACE(("ReadProcessMemory(idh@%p..%p) failed: %d\n", der.pidh, der.pidh + der.cbidh, GetLastError())); return FALSE; } DETOUR_TRACE(("IDH: %p..%p\n", der.pidh, der.pidh + der.cbidh)); // We read the NT header in two passes to get the full size. // First we read just the Signature and FileHeader. der.pinh = der.pidh + der.idh.e_lfanew; der.cbinh = FIELD_OFFSET(IMAGE_NT_HEADERS, OptionalHeader); if (!ReadProcessMemory(hProcess, der.pinh, &der.inh, der.cbinh, NULL)) { DETOUR_TRACE(("ReadProcessMemory(inh@%p..%p) failed: %d\n", der.pinh, der.pinh + der.cbinh, GetLastError())); return FALSE; } // Second we read the OptionalHeader and Section headers. der.cbinh = (FIELD_OFFSET(IMAGE_NT_HEADERS, OptionalHeader) + der.inh.FileHeader.SizeOfOptionalHeader + der.inh.FileHeader.NumberOfSections * sizeof(IMAGE_SECTION_HEADER)); if (der.cbinh > sizeof(der.raw)) { return FALSE; } if (!ReadProcessMemory(hProcess, der.pinh, &der.inh, der.cbinh, NULL)) { DETOUR_TRACE(("ReadProcessMemory(inh@%p..%p) failed: %d\n", der.pinh, der.pinh + der.cbinh, GetLastError())); return FALSE; } DETOUR_TRACE(("INH: %p..%p\n", der.pinh, der.pinh + der.cbinh)); // Third, we read the CLR header if (der.inh.OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC) { if (der.inh32.CLR_DIRECTORY.VirtualAddress != 0 && der.inh32.CLR_DIRECTORY.Size != 0) { DETOUR_TRACE(("CLR32.VirtAddr=%x, CLR.Size=%x\n", der.inh32.CLR_DIRECTORY.VirtualAddress, der.inh32.CLR_DIRECTORY.Size)); der.pclr = ((PBYTE)hModule) + der.inh32.CLR_DIRECTORY.VirtualAddress; } } else if (der.inh.OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC) { if (der.inh64.CLR_DIRECTORY.VirtualAddress != 0 && der.inh64.CLR_DIRECTORY.Size != 0) { DETOUR_TRACE(("CLR64.VirtAddr=%x, CLR.Size=%x\n", der.inh64.CLR_DIRECTORY.VirtualAddress, der.inh64.CLR_DIRECTORY.Size)); der.pclr = ((PBYTE)hModule) + der.inh64.CLR_DIRECTORY.VirtualAddress; } } if (der.pclr != 0) { der.cbclr = sizeof(der.clr); if (!ReadProcessMemory(hProcess, der.pclr, &der.clr, der.cbclr, NULL)) { DETOUR_TRACE(("ReadProcessMemory(clr@%p..%p) failed: %d\n", der.pclr, der.pclr + der.cbclr, GetLastError())); return FALSE; } DETOUR_TRACE(("CLR: %p..%p\n", der.pclr, der.pclr + der.cbclr)); } return TRUE; } ////////////////////////////////////////////////////////////////////////////// // #if DETOURS_32BIT #define DWORD_XX DWORD32 #define IMAGE_NT_HEADERS_XX IMAGE_NT_HEADERS32 #define IMAGE_NT_OPTIONAL_HDR_MAGIC_XX IMAGE_NT_OPTIONAL_HDR32_MAGIC #define IMAGE_ORDINAL_FLAG_XX IMAGE_ORDINAL_FLAG32 #define IMAGE_THUNK_DATAXX IMAGE_THUNK_DATA32 #define UPDATE_IMPORTS_XX UpdateImports32 #define DETOURS_BITS_XX 32 #include "uimports.cpp" #undef DETOUR_EXE_RESTORE_FIELD_XX #undef DWORD_XX #undef IMAGE_NT_HEADERS_XX #undef IMAGE_NT_OPTIONAL_HDR_MAGIC_XX #undef IMAGE_ORDINAL_FLAG_XX #undef UPDATE_IMPORTS_XX #endif // DETOURS_32BIT #if DETOURS_64BIT #define DWORD_XX DWORD64 #define IMAGE_NT_HEADERS_XX IMAGE_NT_HEADERS64 #define IMAGE_NT_OPTIONAL_HDR_MAGIC_XX IMAGE_NT_OPTIONAL_HDR64_MAGIC #define IMAGE_ORDINAL_FLAG_XX IMAGE_ORDINAL_FLAG64 #define IMAGE_THUNK_DATAXX IMAGE_THUNK_DATA64 #define UPDATE_IMPORTS_XX UpdateImports64 #define DETOURS_BITS_XX 64 #include "uimports.cpp" #undef DETOUR_EXE_RESTORE_FIELD_XX #undef DWORD_XX #undef IMAGE_NT_HEADERS_XX #undef IMAGE_NT_OPTIONAL_HDR_MAGIC_XX #undef IMAGE_ORDINAL_FLAG_XX #undef UPDATE_IMPORTS_XX #endif // DETOURS_64BIT ////////////////////////////////////////////////////////////////////////////// // #if DETOURS_64BIT C_ASSERT(sizeof(IMAGE_NT_HEADERS64) == sizeof(IMAGE_NT_HEADERS32) + 16); static BOOL UpdateFrom32To64(HANDLE hProcess, HMODULE hModule, WORD machine, DETOUR_EXE_RESTORE& der) { IMAGE_DOS_HEADER idh; IMAGE_NT_HEADERS32 inh32; IMAGE_NT_HEADERS64 inh64; IMAGE_SECTION_HEADER sects[32]; PBYTE pbModule = (PBYTE)hModule; DWORD n; ZeroMemory(&inh32, sizeof(inh32)); ZeroMemory(&inh64, sizeof(inh64)); ZeroMemory(sects, sizeof(sects)); DETOUR_TRACE(("UpdateFrom32To64(%04x)\n", machine)); //////////////////////////////////////////////////////// Read old headers. // if (!ReadProcessMemory(hProcess, pbModule, &idh, sizeof(idh), NULL)) { DETOUR_TRACE(("ReadProcessMemory(idh@%p..%p) failed: %d\n", pbModule, pbModule + sizeof(idh), GetLastError())); return FALSE; } DETOUR_TRACE(("ReadProcessMemory(idh@%p..%p)\n", pbModule, pbModule + sizeof(idh))); PBYTE pnh = pbModule + idh.e_lfanew; if (!ReadProcessMemory(hProcess, pnh, &inh32, sizeof(inh32), NULL)) { DETOUR_TRACE(("ReadProcessMemory(inh@%p..%p) failed: %d\n", pnh, pnh + sizeof(inh32), GetLastError())); return FALSE; } DETOUR_TRACE(("ReadProcessMemory(inh@%p..%p)\n", pnh, pnh + sizeof(inh32))); if (inh32.FileHeader.NumberOfSections > (sizeof(sects)/sizeof(sects[0]))) { return FALSE; } PBYTE psects = pnh + FIELD_OFFSET(IMAGE_NT_HEADERS, OptionalHeader) + inh32.FileHeader.SizeOfOptionalHeader; ULONG cb = inh32.FileHeader.NumberOfSections * sizeof(IMAGE_SECTION_HEADER); if (!ReadProcessMemory(hProcess, psects, §s, cb, NULL)) { DETOUR_TRACE(("ReadProcessMemory(ish@%p..%p) failed: %d\n", psects, psects + cb, GetLastError())); return FALSE; } DETOUR_TRACE(("ReadProcessMemory(ish@%p..%p)\n", psects, psects + cb)); ////////////////////////////////////////////////////////// Convert header. // inh64.Signature = inh32.Signature; inh64.FileHeader = inh32.FileHeader; inh64.FileHeader.Machine = machine; inh64.FileHeader.SizeOfOptionalHeader = sizeof(IMAGE_OPTIONAL_HEADER64); inh64.OptionalHeader.Magic = IMAGE_NT_OPTIONAL_HDR64_MAGIC; inh64.OptionalHeader.MajorLinkerVersion = inh32.OptionalHeader.MajorLinkerVersion; inh64.OptionalHeader.MinorLinkerVersion = inh32.OptionalHeader.MinorLinkerVersion; inh64.OptionalHeader.SizeOfCode = inh32.OptionalHeader.SizeOfCode; inh64.OptionalHeader.SizeOfInitializedData = inh32.OptionalHeader.SizeOfInitializedData; inh64.OptionalHeader.SizeOfUninitializedData = inh32.OptionalHeader.SizeOfUninitializedData; inh64.OptionalHeader.AddressOfEntryPoint = inh32.OptionalHeader.AddressOfEntryPoint; inh64.OptionalHeader.BaseOfCode = inh32.OptionalHeader.BaseOfCode; inh64.OptionalHeader.ImageBase = inh32.OptionalHeader.ImageBase; inh64.OptionalHeader.SectionAlignment = inh32.OptionalHeader.SectionAlignment; inh64.OptionalHeader.FileAlignment = inh32.OptionalHeader.FileAlignment; inh64.OptionalHeader.MajorOperatingSystemVersion = inh32.OptionalHeader.MajorOperatingSystemVersion; inh64.OptionalHeader.MinorOperatingSystemVersion = inh32.OptionalHeader.MinorOperatingSystemVersion; inh64.OptionalHeader.MajorImageVersion = inh32.OptionalHeader.MajorImageVersion; inh64.OptionalHeader.MinorImageVersion = inh32.OptionalHeader.MinorImageVersion; inh64.OptionalHeader.MajorSubsystemVersion = inh32.OptionalHeader.MajorSubsystemVersion; inh64.OptionalHeader.MinorSubsystemVersion = inh32.OptionalHeader.MinorSubsystemVersion; inh64.OptionalHeader.Win32VersionValue = inh32.OptionalHeader.Win32VersionValue; inh64.OptionalHeader.SizeOfImage = inh32.OptionalHeader.SizeOfImage; inh64.OptionalHeader.SizeOfHeaders = inh32.OptionalHeader.SizeOfHeaders; inh64.OptionalHeader.CheckSum = inh32.OptionalHeader.CheckSum; inh64.OptionalHeader.Subsystem = inh32.OptionalHeader.Subsystem; inh64.OptionalHeader.DllCharacteristics = inh32.OptionalHeader.DllCharacteristics; inh64.OptionalHeader.SizeOfStackReserve = inh32.OptionalHeader.SizeOfStackReserve; inh64.OptionalHeader.SizeOfStackCommit = inh32.OptionalHeader.SizeOfStackCommit; inh64.OptionalHeader.SizeOfHeapReserve = inh32.OptionalHeader.SizeOfHeapReserve; inh64.OptionalHeader.SizeOfHeapCommit = inh32.OptionalHeader.SizeOfHeapCommit; inh64.OptionalHeader.LoaderFlags = inh32.OptionalHeader.LoaderFlags; inh64.OptionalHeader.NumberOfRvaAndSizes = inh32.OptionalHeader.NumberOfRvaAndSizes; for (n = 0; n < IMAGE_NUMBEROF_DIRECTORY_ENTRIES; n++) { inh64.OptionalHeader.DataDirectory[n] = inh32.OptionalHeader.DataDirectory[n]; } /////////////////////////////////////////////////////// Write new headers. // DWORD dwProtect = 0; if (!DetourVirtualProtectSameExecuteEx(hProcess, pbModule, inh64.OptionalHeader.SizeOfHeaders, PAGE_EXECUTE_READWRITE, &dwProtect)) { return FALSE; } if (!WriteProcessMemory(hProcess, pnh, &inh64, sizeof(inh64), NULL)) { DETOUR_TRACE(("WriteProcessMemory(inh@%p..%p) failed: %d\n", pnh, pnh + sizeof(inh64), GetLastError())); return FALSE; } DETOUR_TRACE(("WriteProcessMemory(inh@%p..%p)\n", pnh, pnh + sizeof(inh64))); psects = pnh + FIELD_OFFSET(IMAGE_NT_HEADERS, OptionalHeader) + inh64.FileHeader.SizeOfOptionalHeader; cb = inh64.FileHeader.NumberOfSections * sizeof(IMAGE_SECTION_HEADER); if (!WriteProcessMemory(hProcess, psects, §s, cb, NULL)) { DETOUR_TRACE(("WriteProcessMemory(ish@%p..%p) failed: %d\n", psects, psects + cb, GetLastError())); return FALSE; } DETOUR_TRACE(("WriteProcessMemory(ish@%p..%p)\n", psects, psects + cb)); // Record the updated headers. if (!RecordExeRestore(hProcess, hModule, der)) { return FALSE; } // Remove the import table. if (der.pclr != NULL && (der.clr.Flags & COMIMAGE_FLAGS_ILONLY)) { inh64.IMPORT_DIRECTORY.VirtualAddress = 0; inh64.IMPORT_DIRECTORY.Size = 0; if (!WriteProcessMemory(hProcess, pnh, &inh64, sizeof(inh64), NULL)) { DETOUR_TRACE(("WriteProcessMemory(inh@%p..%p) failed: %d\n", pnh, pnh + sizeof(inh64), GetLastError())); return FALSE; } } DWORD dwOld = 0; if (!VirtualProtectEx(hProcess, pbModule, inh64.OptionalHeader.SizeOfHeaders, dwProtect, &dwOld)) { return FALSE; } return TRUE; } #endif // DETOURS_64BIT typedef BOOL(WINAPI *LPFN_ISWOW64PROCESS)(HANDLE, PBOOL); static BOOL IsWow64ProcessHelper(HANDLE hProcess, PBOOL Wow64Process) { #ifdef _X86_ if (Wow64Process == NULL) { return FALSE; } // IsWow64Process is not available on all supported versions of Windows. // HMODULE hKernel32 = LoadLibraryW(L"KERNEL32.DLL"); if (hKernel32 == NULL) { DETOUR_TRACE(("LoadLibraryW failed: %d\n", GetLastError())); return FALSE; } LPFN_ISWOW64PROCESS pfnIsWow64Process = (LPFN_ISWOW64PROCESS)GetProcAddress( hKernel32, "IsWow64Process"); if (pfnIsWow64Process == NULL) { DETOUR_TRACE(("GetProcAddress failed: %d\n", GetLastError())); return FALSE; } return pfnIsWow64Process(hProcess, Wow64Process); #else return IsWow64Process(hProcess, Wow64Process); #endif } ////////////////////////////////////////////////////////////////////////////// // BOOL WINAPI DetourUpdateProcessWithDll(_In_ HANDLE hProcess, _In_reads_(nDlls) LPCSTR *rlpDlls, _In_ DWORD nDlls) { // Find the next memory region that contains a mapped PE image. // BOOL bIs32BitProcess; BOOL bIs64BitOS = FALSE; HMODULE hModule = NULL; HMODULE hLast = NULL; DETOUR_TRACE(("DetourUpdateProcessWithDll(%p,dlls=%d)\n", hProcess, nDlls)); for (;;) { IMAGE_NT_HEADERS32 inh; if ((hLast = EnumerateModulesInProcess(hProcess, hLast, &inh)) == NULL) { break; } DETOUR_TRACE(("%p machine=%04x magic=%04x\n", hLast, inh.FileHeader.Machine, inh.OptionalHeader.Magic)); if ((inh.FileHeader.Characteristics & IMAGE_FILE_DLL) == 0) { hModule = hLast; DETOUR_TRACE(("%p Found EXE\n", hLast)); } } if (hModule == NULL) { SetLastError(ERROR_INVALID_OPERATION); return FALSE; } // Determine if the target process is 32bit or 64bit. This is a two-stop process: // // 1. First, determine if we're running on a 64bit operating system. // - If we're running 64bit code (i.e. _WIN64 is defined), this is trivially true. // - If we're running 32bit code (i.e. _WIN64 is not defined), test if // we're running under Wow64. If so, it implies that the operating system // is 64bit. // #ifdef _WIN64 bIs64BitOS = TRUE; #else if (!IsWow64ProcessHelper(GetCurrentProcess(), &bIs64BitOS)) { return FALSE; } #endif // 2. With the operating system bitness known, we can now consider the target process: // - If we're running on a 64bit OS, the target process is 32bit in case // it is running under Wow64. Otherwise, it's 64bit, running natively // (without Wow64). // - If we're running on a 32bit OS, the target process must be 32bit, too. // if (bIs64BitOS) { if (!IsWow64ProcessHelper(hProcess, &bIs32BitProcess)) { return FALSE; } } else { bIs32BitProcess = TRUE; } DETOUR_TRACE((" 32BitExe=%d 32BitProcess\n", bHas32BitExe, bIs32BitProcess)); return DetourUpdateProcessWithDllEx(hProcess, hModule, bIs32BitProcess, rlpDlls, nDlls); } BOOL WINAPI DetourUpdateProcessWithDllEx(_In_ HANDLE hProcess, _In_ HMODULE hModule, _In_ BOOL bIs32BitProcess, _In_reads_(nDlls) LPCSTR *rlpDlls, _In_ DWORD nDlls) { // Find the next memory region that contains a mapped PE image. // BOOL bIs32BitExe = FALSE; DETOUR_TRACE(("DetourUpdateProcessWithDllEx(%p,%p,dlls=%d)\n", hProcess, hModule, nDlls)); IMAGE_NT_HEADERS32 inh; if (hModule == NULL || LoadNtHeaderFromProcess(hProcess, hModule, &inh) == NULL) { SetLastError(ERROR_INVALID_OPERATION); return FALSE; } if (inh.OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC && inh.FileHeader.Machine != 0) { bIs32BitExe = TRUE; } DETOUR_TRACE((" 32BitExe=%d 32BitProcess\n", bIs32BitExe, bIs32BitProcess)); if (hModule == NULL) { SetLastError(ERROR_INVALID_OPERATION); return FALSE; } // Save the various headers for DetourRestoreAfterWith. // DETOUR_EXE_RESTORE der; if (!RecordExeRestore(hProcess, hModule, der)) { return FALSE; } #if defined(DETOURS_64BIT) // Try to convert a neutral 32-bit managed binary to a 64-bit managed binary. if (bIs32BitExe && !bIs32BitProcess) { if (!der.pclr // Native binary || (der.clr.Flags & COMIMAGE_FLAGS_ILONLY) == 0 // Or mixed-mode MSIL || (der.clr.Flags & COMIMAGE_FLAGS_32BITREQUIRED) != 0) { // Or 32BIT Required MSIL SetLastError(ERROR_INVALID_HANDLE); return FALSE; } if (!UpdateFrom32To64(hProcess, hModule, #if defined(DETOURS_X64) IMAGE_FILE_MACHINE_AMD64, #elif defined(DETOURS_IA64) IMAGE_FILE_MACHINE_IA64, #elif defined(DETOURS_ARM64) IMAGE_FILE_MACHINE_ARM64, #else #error Must define one of DETOURS_X64 or DETOURS_IA64 or DETOURS_ARM64 on 64-bit. #endif der)) { return FALSE; } bIs32BitExe = FALSE; } #endif // DETOURS_64BIT // Now decide if we can insert the detour. #if defined(DETOURS_32BIT) if (bIs32BitProcess) { // 32-bit native or 32-bit managed process on any platform. if (!UpdateImports32(hProcess, hModule, rlpDlls, nDlls)) { return FALSE; } } else { // 64-bit native or 64-bit managed process. // // Can't detour a 64-bit process with 32-bit code. // Note: This happens for 32-bit PE binaries containing only // manage code that have been marked as 64-bit ready. // SetLastError(ERROR_INVALID_HANDLE); return FALSE; } #elif defined(DETOURS_64BIT) if (bIs32BitProcess || bIs32BitExe) { // Can't detour a 32-bit process with 64-bit code. SetLastError(ERROR_INVALID_HANDLE); return FALSE; } else { // 64-bit native or 64-bit managed process on any platform. if (!UpdateImports64(hProcess, hModule, rlpDlls, nDlls)) { return FALSE; } } #else #pragma Must define one of DETOURS_32BIT or DETOURS_64BIT. #endif // DETOURS_64BIT /////////////////////////////////////////////////// Update the CLR header. // if (der.pclr != NULL) { DETOUR_CLR_HEADER clr; CopyMemory(&clr, &der.clr, sizeof(clr)); clr.Flags &= ~COMIMAGE_FLAGS_ILONLY; // Clear the IL_ONLY flag. DWORD dwProtect; if (!DetourVirtualProtectSameExecuteEx(hProcess, der.pclr, sizeof(clr), PAGE_READWRITE, &dwProtect)) { DETOUR_TRACE(("VirtualProtectEx(clr) write failed: %d\n", GetLastError())); return FALSE; } if (!WriteProcessMemory(hProcess, der.pclr, &clr, sizeof(clr), NULL)) { DETOUR_TRACE(("WriteProcessMemory(clr) failed: %d\n", GetLastError())); return FALSE; } if (!VirtualProtectEx(hProcess, der.pclr, sizeof(clr), dwProtect, &dwProtect)) { DETOUR_TRACE(("VirtualProtectEx(clr) restore failed: %d\n", GetLastError())); return FALSE; } DETOUR_TRACE(("CLR: %p..%p\n", der.pclr, der.pclr + der.cbclr)); #if DETOURS_64BIT if (der.clr.Flags & COMIMAGE_FLAGS_32BITREQUIRED) { // Is the 32BIT Required Flag set? // X64 never gets here because the process appears as a WOW64 process. // However, on IA64, it doesn't appear to be a WOW process. DETOUR_TRACE(("CLR Requires 32-bit\n", der.pclr, der.pclr + der.cbclr)); SetLastError(ERROR_INVALID_HANDLE); return FALSE; } #endif // DETOURS_64BIT } //////////////////////////////// Save the undo data to the target process. // if (!DetourCopyPayloadToProcess(hProcess, DETOUR_EXE_RESTORE_GUID, &der, sizeof(der))) { DETOUR_TRACE(("DetourCopyPayloadToProcess failed: %d\n", GetLastError())); return FALSE; } return TRUE; } ////////////////////////////////////////////////////////////////////////////// // BOOL WINAPI DetourCreateProcessWithDllA(_In_opt_ LPCSTR lpApplicationName, _Inout_opt_ LPSTR lpCommandLine, _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes, _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes, _In_ BOOL bInheritHandles, _In_ DWORD dwCreationFlags, _In_opt_ LPVOID lpEnvironment, _In_opt_ LPCSTR lpCurrentDirectory, _In_ LPSTARTUPINFOA lpStartupInfo, _Out_ LPPROCESS_INFORMATION lpProcessInformation, _In_ LPCSTR lpDllName, _In_opt_ PDETOUR_CREATE_PROCESS_ROUTINEA pfCreateProcessA) { DWORD dwMyCreationFlags = (dwCreationFlags | CREATE_SUSPENDED); PROCESS_INFORMATION pi; BOOL fResult = FALSE; if (pfCreateProcessA == NULL) { pfCreateProcessA = CreateProcessA; } fResult = pfCreateProcessA(lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwMyCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, &pi); if (lpProcessInformation != NULL) { CopyMemory(lpProcessInformation, &pi, sizeof(pi)); } if (!fResult) { return FALSE; } LPCSTR rlpDlls[2]; DWORD nDlls = 0; if (lpDllName != NULL) { rlpDlls[nDlls++] = lpDllName; } if (!DetourUpdateProcessWithDll(pi.hProcess, rlpDlls, nDlls)) { TerminateProcess(pi.hProcess, ~0u); return FALSE; } if (!(dwCreationFlags & CREATE_SUSPENDED)) { ResumeThread(pi.hThread); } return TRUE; } BOOL WINAPI DetourCreateProcessWithDllW(_In_opt_ LPCWSTR lpApplicationName, _Inout_opt_ LPWSTR lpCommandLine, _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes, _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes, _In_ BOOL bInheritHandles, _In_ DWORD dwCreationFlags, _In_opt_ LPVOID lpEnvironment, _In_opt_ LPCWSTR lpCurrentDirectory, _In_ LPSTARTUPINFOW lpStartupInfo, _Out_ LPPROCESS_INFORMATION lpProcessInformation, _In_ LPCSTR lpDllName, _In_opt_ PDETOUR_CREATE_PROCESS_ROUTINEW pfCreateProcessW) { DWORD dwMyCreationFlags = (dwCreationFlags | CREATE_SUSPENDED); PROCESS_INFORMATION pi; if (pfCreateProcessW == NULL) { pfCreateProcessW = CreateProcessW; } BOOL fResult = pfCreateProcessW(lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwMyCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, &pi); if (lpProcessInformation) { CopyMemory(lpProcessInformation, &pi, sizeof(pi)); } if (!fResult) { return FALSE; } LPCSTR rlpDlls[2]; DWORD nDlls = 0; if (lpDllName != NULL) { rlpDlls[nDlls++] = lpDllName; } if (!DetourUpdateProcessWithDll(pi.hProcess, rlpDlls, nDlls)) { TerminateProcess(pi.hProcess, ~0u); return FALSE; } if (!(dwCreationFlags & CREATE_SUSPENDED)) { ResumeThread(pi.hThread); } return TRUE; } BOOL WINAPI DetourCopyPayloadToProcess(_In_ HANDLE hProcess, _In_ REFGUID rguid, _In_reads_bytes_(cbData) PVOID pvData, _In_ DWORD cbData) { DWORD cbTotal = (sizeof(IMAGE_DOS_HEADER) + sizeof(IMAGE_NT_HEADERS) + sizeof(IMAGE_SECTION_HEADER) + sizeof(DETOUR_SECTION_HEADER) + sizeof(DETOUR_SECTION_RECORD) + cbData); PBYTE pbBase = (PBYTE)VirtualAllocEx(hProcess, NULL, cbTotal, MEM_COMMIT, PAGE_READWRITE); if (pbBase == NULL) { DETOUR_TRACE(("VirtualAllocEx(%d) failed: %d\n", cbTotal, GetLastError())); return FALSE; } PBYTE pbTarget = pbBase; IMAGE_DOS_HEADER idh; IMAGE_NT_HEADERS inh; IMAGE_SECTION_HEADER ish; DETOUR_SECTION_HEADER dsh; DETOUR_SECTION_RECORD dsr; SIZE_T cbWrote = 0; ZeroMemory(&idh, sizeof(idh)); idh.e_magic = IMAGE_DOS_SIGNATURE; idh.e_lfanew = sizeof(idh); if (!WriteProcessMemory(hProcess, pbTarget, &idh, sizeof(idh), &cbWrote) || cbWrote != sizeof(idh)) { DETOUR_TRACE(("WriteProcessMemory(idh) failed: %d\n", GetLastError())); return FALSE; } pbTarget += sizeof(idh); ZeroMemory(&inh, sizeof(inh)); inh.Signature = IMAGE_NT_SIGNATURE; inh.FileHeader.SizeOfOptionalHeader = sizeof(inh.OptionalHeader); inh.FileHeader.Characteristics = IMAGE_FILE_DLL; inh.FileHeader.NumberOfSections = 1; inh.OptionalHeader.Magic = IMAGE_NT_OPTIONAL_HDR_MAGIC; if (!WriteProcessMemory(hProcess, pbTarget, &inh, sizeof(inh), &cbWrote) || cbWrote != sizeof(inh)) { return FALSE; } pbTarget += sizeof(inh); ZeroMemory(&ish, sizeof(ish)); memcpy(ish.Name, ".detour", sizeof(ish.Name)); ish.VirtualAddress = (DWORD)((pbTarget + sizeof(ish)) - pbBase); ish.SizeOfRawData = (sizeof(DETOUR_SECTION_HEADER) + sizeof(DETOUR_SECTION_RECORD) + cbData); if (!WriteProcessMemory(hProcess, pbTarget, &ish, sizeof(ish), &cbWrote) || cbWrote != sizeof(ish)) { return FALSE; } pbTarget += sizeof(ish); ZeroMemory(&dsh, sizeof(dsh)); dsh.cbHeaderSize = sizeof(dsh); dsh.nSignature = DETOUR_SECTION_HEADER_SIGNATURE; dsh.nDataOffset = sizeof(DETOUR_SECTION_HEADER); dsh.cbDataSize = (sizeof(DETOUR_SECTION_HEADER) + sizeof(DETOUR_SECTION_RECORD) + cbData); if (!WriteProcessMemory(hProcess, pbTarget, &dsh, sizeof(dsh), &cbWrote) || cbWrote != sizeof(dsh)) { return FALSE; } pbTarget += sizeof(dsh); ZeroMemory(&dsr, sizeof(dsr)); dsr.cbBytes = cbData + sizeof(DETOUR_SECTION_RECORD); dsr.nReserved = 0; dsr.guid = rguid; if (!WriteProcessMemory(hProcess, pbTarget, &dsr, sizeof(dsr), &cbWrote) || cbWrote != sizeof(dsr)) { return FALSE; } pbTarget += sizeof(dsr); if (!WriteProcessMemory(hProcess, pbTarget, pvData, cbData, &cbWrote) || cbWrote != cbData) { return FALSE; } pbTarget += cbData; DETOUR_TRACE(("Copied %d byte payload into target process at %p\n", cbTotal, pbTarget - cbTotal)); return TRUE; } static BOOL s_fSearchedForHelper = FALSE; static PDETOUR_EXE_HELPER s_pHelper = NULL; VOID CALLBACK DetourFinishHelperProcess(_In_ HWND, _In_ HINSTANCE, _In_ LPSTR, _In_ INT) { LPCSTR * rlpDlls = NULL; DWORD Result = 9900; DWORD cOffset = 0; DWORD cSize = 0; HANDLE hProcess = NULL; if (s_pHelper == NULL) { DETOUR_TRACE(("DetourFinishHelperProcess called with s_pHelper = NULL.\n")); Result = 9905; goto Cleanup; } hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, s_pHelper->pid); if (hProcess == NULL) { DETOUR_TRACE(("OpenProcess(pid=%d) failed: %d\n", s_pHelper->pid, GetLastError())); Result = 9901; goto Cleanup; } rlpDlls = new NOTHROW LPCSTR [s_pHelper->nDlls]; cSize = s_pHelper->cb - sizeof(DETOUR_EXE_HELPER); for (DWORD n = 0; n < s_pHelper->nDlls; n++) { size_t cchDest = 0; HRESULT hr = StringCchLengthA(&s_pHelper->rDlls[cOffset], cSize - cOffset, &cchDest); if (!SUCCEEDED(hr)) { Result = 9902; goto Cleanup; } rlpDlls[n] = &s_pHelper->rDlls[cOffset]; cOffset += (DWORD)cchDest + 1; } if (!DetourUpdateProcessWithDll(hProcess, rlpDlls, s_pHelper->nDlls)) { DETOUR_TRACE(("DetourUpdateProcessWithDll(pid=%d) failed: %d\n", s_pHelper->pid, GetLastError())); Result = 9903; goto Cleanup; } Result = 0; Cleanup: if (rlpDlls != NULL) { delete[] rlpDlls; rlpDlls = NULL; } ExitProcess(Result); } BOOL WINAPI DetourIsHelperProcess(VOID) { PVOID pvData; DWORD cbData; if (s_fSearchedForHelper) { return (s_pHelper != NULL); } s_fSearchedForHelper = TRUE; pvData = DetourFindPayloadEx(DETOUR_EXE_HELPER_GUID, &cbData); if (pvData == NULL || cbData < sizeof(DETOUR_EXE_HELPER)) { return FALSE; } s_pHelper = (PDETOUR_EXE_HELPER)pvData; if (s_pHelper->cb < sizeof(*s_pHelper)) { s_pHelper = NULL; return FALSE; } return TRUE; } static BOOL WINAPI AllocExeHelper(_Out_ PDETOUR_EXE_HELPER *pHelper, _In_ DWORD dwTargetPid, _In_ DWORD nDlls, _In_reads_(nDlls) LPCSTR *rlpDlls) { PDETOUR_EXE_HELPER Helper = NULL; BOOL Result = FALSE; _Field_range_(0, cSize - 4) DWORD cOffset = 0; DWORD cSize = 4; if (pHelper == NULL) { goto Cleanup; } *pHelper = NULL; if (nDlls < 1 || nDlls > 4096) { SetLastError(ERROR_INVALID_PARAMETER); goto Cleanup; } for (DWORD n = 0; n < nDlls; n++) { HRESULT hr; size_t cchDest = 0; hr = StringCchLengthA(rlpDlls[n], 4096, &cchDest); if (!SUCCEEDED(hr)) { goto Cleanup; } cSize += (DWORD)cchDest + 1; } Helper = (PDETOUR_EXE_HELPER) new NOTHROW BYTE[sizeof(DETOUR_EXE_HELPER) + cSize]; if (Helper == NULL) { goto Cleanup; } Helper->cb = sizeof(DETOUR_EXE_HELPER) + cSize; Helper->pid = dwTargetPid; Helper->nDlls = nDlls; for (DWORD n = 0; n < nDlls; n++) { HRESULT hr; size_t cchDest = 0; if (cOffset > 0x10000 || cSize > 0x10000 || cOffset + 2 >= cSize) { goto Cleanup; } if (cOffset + 2 >= cSize || cOffset + 65536 < cSize) { goto Cleanup; } _Analysis_assume_(cOffset + 1 < cSize); _Analysis_assume_(cOffset < 0x10000); _Analysis_assume_(cSize < 0x10000); PCHAR psz = &Helper->rDlls[cOffset]; hr = StringCchCopyA(psz, cSize - cOffset, rlpDlls[n]); if (!SUCCEEDED(hr)) { goto Cleanup; } // REVIEW 28020 The expression '1<=_Param_(2)& &_Param_(2)<=2147483647' is not true at this call. // REVIEW 28313 Analysis will not proceed past this point because of annotation evaluation. The annotation expression *_Param_(3)<_Param_(2)&&*_Param_(3)<=stringLength$(_Param_(1)) cannot be true under any assumptions at this point in the program. #pragma warning(suppress:28020 28313) hr = StringCchLengthA(psz, cSize - cOffset, &cchDest); if (!SUCCEEDED(hr)) { goto Cleanup; } // Replace "32." with "64." or "64." with "32." for (DWORD c = (DWORD)cchDest + 1; c > 3; c--) { #if DETOURS_32BIT if (psz[c - 3] == '3' && psz[c - 2] == '2' && psz[c - 1] == '.') { psz[c - 3] = '6'; psz[c - 2] = '4'; break; } #else if (psz[c - 3] == '6' && psz[c - 2] == '4' && psz[c - 1] == '.') { psz[c - 3] = '3'; psz[c - 2] = '2'; break; } #endif } cOffset += (DWORD)cchDest + 1; } *pHelper = Helper; Helper = NULL; Result = TRUE; Cleanup: if (Helper != NULL) { delete[] (PBYTE)Helper; Helper = NULL; } return Result; } static VOID WINAPI FreeExeHelper(PDETOUR_EXE_HELPER *pHelper) { if (*pHelper != NULL) { delete[] (PBYTE)*pHelper; *pHelper = NULL; } } BOOL WINAPI DetourProcessViaHelperA(_In_ DWORD dwTargetPid, _In_ LPCSTR lpDllName, _In_ PDETOUR_CREATE_PROCESS_ROUTINEA pfCreateProcessA) { return DetourProcessViaHelperDllsA(dwTargetPid, 1, &lpDllName, pfCreateProcessA); } BOOL WINAPI DetourProcessViaHelperDllsA(_In_ DWORD dwTargetPid, _In_ DWORD nDlls, _In_reads_(nDlls) LPCSTR *rlpDlls, _In_ PDETOUR_CREATE_PROCESS_ROUTINEA pfCreateProcessA) { BOOL Result = FALSE; PROCESS_INFORMATION pi; STARTUPINFOA si; CHAR szExe[MAX_PATH]; CHAR szCommand[MAX_PATH]; PDETOUR_EXE_HELPER helper = NULL; HRESULT hr; DWORD nLen = GetEnvironmentVariableA("WINDIR", szExe, ARRAYSIZE(szExe)); DETOUR_TRACE(("DetourProcessViaHelperDlls(pid=%d,dlls=%d)\n", dwTargetPid, nDlls)); if (nDlls < 1 || nDlls > 4096) { SetLastError(ERROR_INVALID_PARAMETER); goto Cleanup; } if (!AllocExeHelper(&helper, dwTargetPid, nDlls, rlpDlls)) { goto Cleanup; } if (nLen == 0 || nLen >= ARRAYSIZE(szExe)) { goto Cleanup; } #if DETOURS_OPTION_BITS #if DETOURS_32BIT hr = StringCchCatA(szExe, ARRAYSIZE(szExe), "\\sysnative\\rundll32.exe"); #else // !DETOURS_32BIT hr = StringCchCatA(szExe, ARRAYSIZE(szExe), "\\syswow64\\rundll32.exe"); #endif // !DETOURS_32BIT #else // DETOURS_OPTIONS_BITS hr = StringCchCatA(szExe, ARRAYSIZE(szExe), "\\system32\\rundll32.exe"); #endif // DETOURS_OPTIONS_BITS if (!SUCCEEDED(hr)) { goto Cleanup; } //for East Asia languages and so on, like Chinese, print format with "%hs" can not work fine before user call _tsetlocale(LC_ALL,_T(".ACP")); //so we can't use "%hs" in format string, because the dll that contain this code would inject to any process, even not call _tsetlocale(LC_ALL,_T(".ACP")) before hr = StringCchPrintfA(szCommand, ARRAYSIZE(szCommand), "rundll32.exe \"%s\",#1", &helper->rDlls[0]); if (!SUCCEEDED(hr)) { goto Cleanup; } ZeroMemory(&pi, sizeof(pi)); ZeroMemory(&si, sizeof(si)); si.cb = sizeof(si); DETOUR_TRACE(("DetourProcessViaHelperDlls(\"%hs\", \"%hs\")\n", szExe, szCommand)); if (pfCreateProcessA(szExe, szCommand, NULL, NULL, FALSE, CREATE_SUSPENDED, NULL, NULL, &si, &pi)) { if (!DetourCopyPayloadToProcess(pi.hProcess, DETOUR_EXE_HELPER_GUID, helper, helper->cb)) { DETOUR_TRACE(("DetourCopyPayloadToProcess failed: %d\n", GetLastError())); TerminateProcess(pi.hProcess, ~0u); CloseHandle(pi.hProcess); CloseHandle(pi.hThread); goto Cleanup; } ResumeThread(pi.hThread); WaitForSingleObject(pi.hProcess, INFINITE); DWORD dwResult = 500; GetExitCodeProcess(pi.hProcess, &dwResult); CloseHandle(pi.hProcess); CloseHandle(pi.hThread); if (dwResult != 0) { DETOUR_TRACE(("Rundll32.exe failed: result=%d\n", dwResult)); goto Cleanup; } Result = TRUE; } else { DETOUR_TRACE(("CreateProcess failed: %d\n", GetLastError())); goto Cleanup; } Cleanup: FreeExeHelper(&helper); return Result; } BOOL WINAPI DetourProcessViaHelperW(_In_ DWORD dwTargetPid, _In_ LPCSTR lpDllName, _In_ PDETOUR_CREATE_PROCESS_ROUTINEW pfCreateProcessW) { return DetourProcessViaHelperDllsW(dwTargetPid, 1, &lpDllName, pfCreateProcessW); } BOOL WINAPI DetourProcessViaHelperDllsW(_In_ DWORD dwTargetPid, _In_ DWORD nDlls, _In_reads_(nDlls) LPCSTR *rlpDlls, _In_ PDETOUR_CREATE_PROCESS_ROUTINEW pfCreateProcessW) { BOOL Result = FALSE; PROCESS_INFORMATION pi; STARTUPINFOW si; WCHAR szExe[MAX_PATH]; WCHAR szCommand[MAX_PATH]; PDETOUR_EXE_HELPER helper = NULL; HRESULT hr; WCHAR szDllName[MAX_PATH]; int cchWrittenWideChar; DWORD nLen = GetEnvironmentVariableW(L"WINDIR", szExe, ARRAYSIZE(szExe)); DETOUR_TRACE(("DetourProcessViaHelperDlls(pid=%d,dlls=%d)\n", dwTargetPid, nDlls)); if (nDlls < 1 || nDlls > 4096) { SetLastError(ERROR_INVALID_PARAMETER); goto Cleanup; } if (!AllocExeHelper(&helper, dwTargetPid, nDlls, rlpDlls)) { goto Cleanup; } if (nLen == 0 || nLen >= ARRAYSIZE(szExe)) { goto Cleanup; } #if DETOURS_OPTION_BITS #if DETOURS_32BIT hr = StringCchCatW(szExe, ARRAYSIZE(szExe), L"\\sysnative\\rundll32.exe"); #else // !DETOURS_32BIT hr = StringCchCatW(szExe, ARRAYSIZE(szExe), L"\\syswow64\\rundll32.exe"); #endif // !DETOURS_32BIT #else // DETOURS_OPTIONS_BITS hr = StringCchCatW(szExe, ARRAYSIZE(szExe), L"\\system32\\rundll32.exe"); #endif // DETOURS_OPTIONS_BITS if (!SUCCEEDED(hr)) { goto Cleanup; } //for East Asia languages and so on, like Chinese, print format with "%hs" can not work fine before user call _tsetlocale(LC_ALL,_T(".ACP")); //so we can't use "%hs" in format string, because the dll that contain this code would inject to any process, even not call _tsetlocale(LC_ALL,_T(".ACP")) before cchWrittenWideChar = MultiByteToWideChar(CP_ACP, 0, &helper->rDlls[0], -1, szDllName, ARRAYSIZE(szDllName)); if (cchWrittenWideChar >= ARRAYSIZE(szDllName) || cchWrittenWideChar <= 0) { goto Cleanup; } hr = StringCchPrintfW(szCommand, ARRAYSIZE(szCommand), L"rundll32.exe \"%s\",#1", szDllName); if (!SUCCEEDED(hr)) { goto Cleanup; } ZeroMemory(&pi, sizeof(pi)); ZeroMemory(&si, sizeof(si)); si.cb = sizeof(si); DETOUR_TRACE(("DetourProcessViaHelperDlls(\"%ls\", \"%ls\")\n", szExe, szCommand)); if (pfCreateProcessW(szExe, szCommand, NULL, NULL, FALSE, CREATE_SUSPENDED, NULL, NULL, &si, &pi)) { if (!DetourCopyPayloadToProcess(pi.hProcess, DETOUR_EXE_HELPER_GUID, helper, helper->cb)) { DETOUR_TRACE(("DetourCopyPayloadToProcess failed: %d\n", GetLastError())); TerminateProcess(pi.hProcess, ~0u); CloseHandle(pi.hProcess); CloseHandle(pi.hThread); goto Cleanup; } ResumeThread(pi.hThread); WaitForSingleObject(pi.hProcess, INFINITE); DWORD dwResult = 500; GetExitCodeProcess(pi.hProcess, &dwResult); CloseHandle(pi.hProcess); CloseHandle(pi.hThread); if (dwResult != 0) { DETOUR_TRACE(("Rundll32.exe failed: result=%d\n", dwResult)); goto Cleanup; } Result = TRUE; } else { DETOUR_TRACE(("CreateProcess failed: %d\n", GetLastError())); goto Cleanup; } Cleanup: FreeExeHelper(&helper); return Result; } BOOL WINAPI DetourCreateProcessWithDllExA(_In_opt_ LPCSTR lpApplicationName, _Inout_opt_ LPSTR lpCommandLine, _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes, _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes, _In_ BOOL bInheritHandles, _In_ DWORD dwCreationFlags, _In_opt_ LPVOID lpEnvironment, _In_opt_ LPCSTR lpCurrentDirectory, _In_ LPSTARTUPINFOA lpStartupInfo, _Out_ LPPROCESS_INFORMATION lpProcessInformation, _In_ LPCSTR lpDllName, _In_opt_ PDETOUR_CREATE_PROCESS_ROUTINEA pfCreateProcessA) { if (pfCreateProcessA == NULL) { pfCreateProcessA = CreateProcessA; } PROCESS_INFORMATION backup; if (lpProcessInformation == NULL) { lpProcessInformation = &backup; ZeroMemory(&backup, sizeof(backup)); } if (!pfCreateProcessA(lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags | CREATE_SUSPENDED, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation)) { return FALSE; } LPCSTR szDll = lpDllName; if (!DetourUpdateProcessWithDll(lpProcessInformation->hProcess, &szDll, 1) && !DetourProcessViaHelperA(lpProcessInformation->dwProcessId, lpDllName, pfCreateProcessA)) { TerminateProcess(lpProcessInformation->hProcess, ~0u); CloseHandle(lpProcessInformation->hProcess); CloseHandle(lpProcessInformation->hThread); return FALSE; } if (!(dwCreationFlags & CREATE_SUSPENDED)) { ResumeThread(lpProcessInformation->hThread); } if (lpProcessInformation == &backup) { CloseHandle(lpProcessInformation->hProcess); CloseHandle(lpProcessInformation->hThread); } return TRUE; } BOOL WINAPI DetourCreateProcessWithDllExW(_In_opt_ LPCWSTR lpApplicationName, _Inout_opt_ LPWSTR lpCommandLine, _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes, _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes, _In_ BOOL bInheritHandles, _In_ DWORD dwCreationFlags, _In_opt_ LPVOID lpEnvironment, _In_opt_ LPCWSTR lpCurrentDirectory, _In_ LPSTARTUPINFOW lpStartupInfo, _Out_ LPPROCESS_INFORMATION lpProcessInformation, _In_ LPCSTR lpDllName, _In_opt_ PDETOUR_CREATE_PROCESS_ROUTINEW pfCreateProcessW) { if (pfCreateProcessW == NULL) { pfCreateProcessW = CreateProcessW; } PROCESS_INFORMATION backup; if (lpProcessInformation == NULL) { lpProcessInformation = &backup; ZeroMemory(&backup, sizeof(backup)); } if (!pfCreateProcessW(lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags | CREATE_SUSPENDED, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation)) { return FALSE; } LPCSTR sz = lpDllName; if (!DetourUpdateProcessWithDll(lpProcessInformation->hProcess, &sz, 1) && !DetourProcessViaHelperW(lpProcessInformation->dwProcessId, lpDllName, pfCreateProcessW)) { TerminateProcess(lpProcessInformation->hProcess, ~0u); CloseHandle(lpProcessInformation->hProcess); CloseHandle(lpProcessInformation->hThread); return FALSE; } if (!(dwCreationFlags & CREATE_SUSPENDED)) { ResumeThread(lpProcessInformation->hThread); } if (lpProcessInformation == &backup) { CloseHandle(lpProcessInformation->hProcess); CloseHandle(lpProcessInformation->hThread); } return TRUE; } BOOL WINAPI DetourCreateProcessWithDllsA(_In_opt_ LPCSTR lpApplicationName, _Inout_opt_ LPSTR lpCommandLine, _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes, _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes, _In_ BOOL bInheritHandles, _In_ DWORD dwCreationFlags, _In_opt_ LPVOID lpEnvironment, _In_opt_ LPCSTR lpCurrentDirectory, _In_ LPSTARTUPINFOA lpStartupInfo, _Out_ LPPROCESS_INFORMATION lpProcessInformation, _In_ DWORD nDlls, _In_reads_(nDlls) LPCSTR *rlpDlls, _In_opt_ PDETOUR_CREATE_PROCESS_ROUTINEA pfCreateProcessA) { if (pfCreateProcessA == NULL) { pfCreateProcessA = CreateProcessA; } PROCESS_INFORMATION backup; if (lpProcessInformation == NULL) { lpProcessInformation = &backup; ZeroMemory(&backup, sizeof(backup)); } if (!pfCreateProcessA(lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags | CREATE_SUSPENDED, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation)) { return FALSE; } if (!DetourUpdateProcessWithDll(lpProcessInformation->hProcess, rlpDlls, nDlls) && !DetourProcessViaHelperDllsA(lpProcessInformation->dwProcessId, nDlls, rlpDlls, pfCreateProcessA)) { TerminateProcess(lpProcessInformation->hProcess, ~0u); CloseHandle(lpProcessInformation->hProcess); CloseHandle(lpProcessInformation->hThread); return FALSE; } if (!(dwCreationFlags & CREATE_SUSPENDED)) { ResumeThread(lpProcessInformation->hThread); } if (lpProcessInformation == &backup) { CloseHandle(lpProcessInformation->hProcess); CloseHandle(lpProcessInformation->hThread); } return TRUE; } BOOL WINAPI DetourCreateProcessWithDllsW(_In_opt_ LPCWSTR lpApplicationName, _Inout_opt_ LPWSTR lpCommandLine, _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes, _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes, _In_ BOOL bInheritHandles, _In_ DWORD dwCreationFlags, _In_opt_ LPVOID lpEnvironment, _In_opt_ LPCWSTR lpCurrentDirectory, _In_ LPSTARTUPINFOW lpStartupInfo, _Out_ LPPROCESS_INFORMATION lpProcessInformation, _In_ DWORD nDlls, _In_reads_(nDlls) LPCSTR *rlpDlls, _In_opt_ PDETOUR_CREATE_PROCESS_ROUTINEW pfCreateProcessW) { if (pfCreateProcessW == NULL) { pfCreateProcessW = CreateProcessW; } PROCESS_INFORMATION backup; if (lpProcessInformation == NULL) { lpProcessInformation = &backup; ZeroMemory(&backup, sizeof(backup)); } if (!pfCreateProcessW(lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags | CREATE_SUSPENDED, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation)) { return FALSE; } if (!DetourUpdateProcessWithDll(lpProcessInformation->hProcess, rlpDlls, nDlls) && !DetourProcessViaHelperDllsW(lpProcessInformation->dwProcessId, nDlls, rlpDlls, pfCreateProcessW)) { TerminateProcess(lpProcessInformation->hProcess, ~0u); CloseHandle(lpProcessInformation->hProcess); CloseHandle(lpProcessInformation->hThread); return FALSE; } if (!(dwCreationFlags & CREATE_SUSPENDED)) { ResumeThread(lpProcessInformation->hThread); } if (lpProcessInformation == &backup) { CloseHandle(lpProcessInformation->hProcess); CloseHandle(lpProcessInformation->hThread); } return TRUE; } // ///////////////////////////////////////////////////////////////// End of File. ================================================ FILE: ext/detours/src/detours.cpp ================================================ ////////////////////////////////////////////////////////////////////////////// // // Core Detours Functionality (detours.cpp of detours.lib) // // Microsoft Research Detours Package, Version 4.0.1 // // Copyright (c) Microsoft Corporation. All rights reserved. // //#define DETOUR_DEBUG 1 #define DETOURS_INTERNAL #include "detours.h" #if DETOURS_VERSION != 0x4c0c1 // 0xMAJORcMINORcPATCH #error detours.h version mismatch #endif #define NOTHROW ////////////////////////////////////////////////////////////////////////////// // struct _DETOUR_ALIGN { BYTE obTarget : 3; BYTE obTrampoline : 5; }; C_ASSERT(sizeof(_DETOUR_ALIGN) == 1); ////////////////////////////////////////////////////////////////////////////// // // Region reserved for system DLLs, which cannot be used for trampolines. // static PVOID s_pSystemRegionLowerBound = (PVOID)(ULONG_PTR)0x70000000; static PVOID s_pSystemRegionUpperBound = (PVOID)(ULONG_PTR)0x80000000; ////////////////////////////////////////////////////////////////////////////// // static bool detour_is_imported(PBYTE pbCode, PBYTE pbAddress) { MEMORY_BASIC_INFORMATION mbi; VirtualQuery((PVOID)pbCode, &mbi, sizeof(mbi)); __try { PIMAGE_DOS_HEADER pDosHeader = (PIMAGE_DOS_HEADER)mbi.AllocationBase; if (pDosHeader->e_magic != IMAGE_DOS_SIGNATURE) { return false; } PIMAGE_NT_HEADERS pNtHeader = (PIMAGE_NT_HEADERS)((PBYTE)pDosHeader + pDosHeader->e_lfanew); if (pNtHeader->Signature != IMAGE_NT_SIGNATURE) { return false; } if (pbAddress >= ((PBYTE)pDosHeader + pNtHeader->OptionalHeader .DataDirectory[IMAGE_DIRECTORY_ENTRY_IAT].VirtualAddress) && pbAddress < ((PBYTE)pDosHeader + pNtHeader->OptionalHeader .DataDirectory[IMAGE_DIRECTORY_ENTRY_IAT].VirtualAddress + pNtHeader->OptionalHeader .DataDirectory[IMAGE_DIRECTORY_ENTRY_IAT].Size)) { return true; } } #pragma prefast(suppress:28940, "A bad pointer means this probably isn't a PE header.") __except(GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) { return false; } return false; } inline ULONG_PTR detour_2gb_below(ULONG_PTR address) { return (address > (ULONG_PTR)0x7ff80000) ? address - 0x7ff80000 : 0x80000; } inline ULONG_PTR detour_2gb_above(ULONG_PTR address) { #if defined(DETOURS_64BIT) return (address < (ULONG_PTR)0xffffffff80000000) ? address + 0x7ff80000 : (ULONG_PTR)0xfffffffffff80000; #else return (address < (ULONG_PTR)0x80000000) ? address + 0x7ff80000 : (ULONG_PTR)0xfff80000; #endif } ///////////////////////////////////////////////////////////////////////// X86. // #ifdef DETOURS_X86 struct _DETOUR_TRAMPOLINE { BYTE rbCode[30]; // target code + jmp to pbRemain BYTE cbCode; // size of moved target code. BYTE cbCodeBreak; // padding to make debugging easier. BYTE rbRestore[22]; // original target code. BYTE cbRestore; // size of original target code. BYTE cbRestoreBreak; // padding to make debugging easier. _DETOUR_ALIGN rAlign[8]; // instruction alignment array. PBYTE pbRemain; // first instruction after moved code. [free list] PBYTE pbDetour; // first instruction of detour function. }; C_ASSERT(sizeof(_DETOUR_TRAMPOLINE) == 72); enum { SIZE_OF_JMP = 5 }; inline PBYTE detour_gen_jmp_immediate(PBYTE pbCode, PBYTE pbJmpVal) { PBYTE pbJmpSrc = pbCode + 5; *pbCode++ = 0xE9; // jmp +imm32 *((INT32*&)pbCode)++ = (INT32)(pbJmpVal - pbJmpSrc); return pbCode; } inline PBYTE detour_gen_jmp_indirect(PBYTE pbCode, PBYTE *ppbJmpVal) { *pbCode++ = 0xff; // jmp [+imm32] *pbCode++ = 0x25; *((INT32*&)pbCode)++ = (INT32)((PBYTE)ppbJmpVal); return pbCode; } inline PBYTE detour_gen_brk(PBYTE pbCode, PBYTE pbLimit) { while (pbCode < pbLimit) { *pbCode++ = 0xcc; // brk; } return pbCode; } inline PBYTE detour_skip_jmp(PBYTE pbCode, PVOID *ppGlobals) { if (pbCode == NULL) { return NULL; } if (ppGlobals != NULL) { *ppGlobals = NULL; } // First, skip over the import vector if there is one. if (pbCode[0] == 0xff && pbCode[1] == 0x25) { // jmp [imm32] // Looks like an import alias jump, then get the code it points to. PBYTE pbTarget = *(UNALIGNED PBYTE *)&pbCode[2]; if (detour_is_imported(pbCode, pbTarget)) { PBYTE pbNew = *(UNALIGNED PBYTE *)pbTarget; DETOUR_TRACE(("%p->%p: skipped over import table.\n", pbCode, pbNew)); pbCode = pbNew; } } // Then, skip over a patch jump if (pbCode[0] == 0xeb) { // jmp +imm8 PBYTE pbNew = pbCode + 2 + *(CHAR *)&pbCode[1]; DETOUR_TRACE(("%p->%p: skipped over short jump.\n", pbCode, pbNew)); pbCode = pbNew; // First, skip over the import vector if there is one. if (pbCode[0] == 0xff && pbCode[1] == 0x25) { // jmp [imm32] // Looks like an import alias jump, then get the code it points to. PBYTE pbTarget = *(UNALIGNED PBYTE *)&pbCode[2]; if (detour_is_imported(pbCode, pbTarget)) { pbNew = *(UNALIGNED PBYTE *)pbTarget; DETOUR_TRACE(("%p->%p: skipped over import table.\n", pbCode, pbNew)); pbCode = pbNew; } } // Finally, skip over a long jump if it is the target of the patch jump. else if (pbCode[0] == 0xe9) { // jmp +imm32 pbNew = pbCode + 5 + *(UNALIGNED INT32 *)&pbCode[1]; DETOUR_TRACE(("%p->%p: skipped over long jump.\n", pbCode, pbNew)); pbCode = pbNew; } } return pbCode; } inline void detour_find_jmp_bounds(PBYTE pbCode, PDETOUR_TRAMPOLINE *ppLower, PDETOUR_TRAMPOLINE *ppUpper) { // We have to place trampolines within +/- 2GB of code. ULONG_PTR lo = detour_2gb_below((ULONG_PTR)pbCode); ULONG_PTR hi = detour_2gb_above((ULONG_PTR)pbCode); DETOUR_TRACE(("[%p..%p..%p]\n", lo, pbCode, hi)); // And, within +/- 2GB of relative jmp targets. if (pbCode[0] == 0xe9) { // jmp +imm32 PBYTE pbNew = pbCode + 5 + *(UNALIGNED INT32 *)&pbCode[1]; if (pbNew < pbCode) { hi = detour_2gb_above((ULONG_PTR)pbNew); } else { lo = detour_2gb_below((ULONG_PTR)pbNew); } DETOUR_TRACE(("[%p..%p..%p] +imm32\n", lo, pbCode, hi)); } *ppLower = (PDETOUR_TRAMPOLINE)lo; *ppUpper = (PDETOUR_TRAMPOLINE)hi; } inline BOOL detour_does_code_end_function(PBYTE pbCode) { if (pbCode[0] == 0xeb || // jmp +imm8 pbCode[0] == 0xe9 || // jmp +imm32 pbCode[0] == 0xe0 || // jmp eax pbCode[0] == 0xc2 || // ret +imm8 pbCode[0] == 0xc3 || // ret pbCode[0] == 0xcc) { // brk return TRUE; } else if (pbCode[0] == 0xf3 && pbCode[1] == 0xc3) { // rep ret return TRUE; } else if (pbCode[0] == 0xff && pbCode[1] == 0x25) { // jmp [+imm32] return TRUE; } else if ((pbCode[0] == 0x26 || // jmp es: pbCode[0] == 0x2e || // jmp cs: pbCode[0] == 0x36 || // jmp ss: pbCode[0] == 0x3e || // jmp ds: pbCode[0] == 0x64 || // jmp fs: pbCode[0] == 0x65) && // jmp gs: pbCode[1] == 0xff && // jmp [+imm32] pbCode[2] == 0x25) { return TRUE; } return FALSE; } inline ULONG detour_is_code_filler(PBYTE pbCode) { // 1-byte through 11-byte NOPs. if (pbCode[0] == 0x90) { return 1; } if (pbCode[0] == 0x66 && pbCode[1] == 0x90) { return 2; } if (pbCode[0] == 0x0F && pbCode[1] == 0x1F && pbCode[2] == 0x00) { return 3; } if (pbCode[0] == 0x0F && pbCode[1] == 0x1F && pbCode[2] == 0x40 && pbCode[3] == 0x00) { return 4; } if (pbCode[0] == 0x0F && pbCode[1] == 0x1F && pbCode[2] == 0x44 && pbCode[3] == 0x00 && pbCode[4] == 0x00) { return 5; } if (pbCode[0] == 0x66 && pbCode[1] == 0x0F && pbCode[2] == 0x1F && pbCode[3] == 0x44 && pbCode[4] == 0x00 && pbCode[5] == 0x00) { return 6; } if (pbCode[0] == 0x0F && pbCode[1] == 0x1F && pbCode[2] == 0x80 && pbCode[3] == 0x00 && pbCode[4] == 0x00 && pbCode[5] == 0x00 && pbCode[6] == 0x00) { return 7; } if (pbCode[0] == 0x0F && pbCode[1] == 0x1F && pbCode[2] == 0x84 && pbCode[3] == 0x00 && pbCode[4] == 0x00 && pbCode[5] == 0x00 && pbCode[6] == 0x00 && pbCode[7] == 0x00) { return 8; } if (pbCode[0] == 0x66 && pbCode[1] == 0x0F && pbCode[2] == 0x1F && pbCode[3] == 0x84 && pbCode[4] == 0x00 && pbCode[5] == 0x00 && pbCode[6] == 0x00 && pbCode[7] == 0x00 && pbCode[8] == 0x00) { return 9; } if (pbCode[0] == 0x66 && pbCode[1] == 0x66 && pbCode[2] == 0x0F && pbCode[3] == 0x1F && pbCode[4] == 0x84 && pbCode[5] == 0x00 && pbCode[6] == 0x00 && pbCode[7] == 0x00 && pbCode[8] == 0x00 && pbCode[9] == 0x00) { return 10; } if (pbCode[0] == 0x66 && pbCode[1] == 0x66 && pbCode[2] == 0x66 && pbCode[3] == 0x0F && pbCode[4] == 0x1F && pbCode[5] == 0x84 && pbCode[6] == 0x00 && pbCode[7] == 0x00 && pbCode[8] == 0x00 && pbCode[9] == 0x00 && pbCode[10] == 0x00) { return 11; } // int 3. if (pbCode[0] == 0xcc) { return 1; } return 0; } #endif // DETOURS_X86 ///////////////////////////////////////////////////////////////////////// X64. // #ifdef DETOURS_X64 struct _DETOUR_TRAMPOLINE { // An X64 instuction can be 15 bytes long. // In practice 11 seems to be the limit. BYTE rbCode[30]; // target code + jmp to pbRemain. BYTE cbCode; // size of moved target code. BYTE cbCodeBreak; // padding to make debugging easier. BYTE rbRestore[30]; // original target code. BYTE cbRestore; // size of original target code. BYTE cbRestoreBreak; // padding to make debugging easier. _DETOUR_ALIGN rAlign[8]; // instruction alignment array. PBYTE pbRemain; // first instruction after moved code. [free list] PBYTE pbDetour; // first instruction of detour function. BYTE rbCodeIn[8]; // jmp [pbDetour] }; C_ASSERT(sizeof(_DETOUR_TRAMPOLINE) == 96); enum { SIZE_OF_JMP = 5 }; inline PBYTE detour_gen_jmp_immediate(PBYTE pbCode, PBYTE pbJmpVal) { PBYTE pbJmpSrc = pbCode + 5; *pbCode++ = 0xE9; // jmp +imm32 *((INT32*&)pbCode)++ = (INT32)(pbJmpVal - pbJmpSrc); return pbCode; } inline PBYTE detour_gen_jmp_indirect(PBYTE pbCode, PBYTE *ppbJmpVal) { PBYTE pbJmpSrc = pbCode + 6; *pbCode++ = 0xff; // jmp [+imm32] *pbCode++ = 0x25; *((INT32*&)pbCode)++ = (INT32)((PBYTE)ppbJmpVal - pbJmpSrc); return pbCode; } inline PBYTE detour_gen_brk(PBYTE pbCode, PBYTE pbLimit) { while (pbCode < pbLimit) { *pbCode++ = 0xcc; // brk; } return pbCode; } inline PBYTE detour_skip_jmp(PBYTE pbCode, PVOID *ppGlobals) { if (pbCode == NULL) { return NULL; } if (ppGlobals != NULL) { *ppGlobals = NULL; } // First, skip over the import vector if there is one. if (pbCode[0] == 0xff && pbCode[1] == 0x25) { // jmp [+imm32] // Looks like an import alias jump, then get the code it points to. PBYTE pbTarget = pbCode + 6 + *(UNALIGNED INT32 *)&pbCode[2]; if (detour_is_imported(pbCode, pbTarget)) { PBYTE pbNew = *(UNALIGNED PBYTE *)pbTarget; DETOUR_TRACE(("%p->%p: skipped over import table.\n", pbCode, pbNew)); pbCode = pbNew; } } // Then, skip over a patch jump if (pbCode[0] == 0xeb) { // jmp +imm8 PBYTE pbNew = pbCode + 2 + *(CHAR *)&pbCode[1]; DETOUR_TRACE(("%p->%p: skipped over short jump.\n", pbCode, pbNew)); pbCode = pbNew; // First, skip over the import vector if there is one. if (pbCode[0] == 0xff && pbCode[1] == 0x25) { // jmp [+imm32] // Looks like an import alias jump, then get the code it points to. PBYTE pbTarget = pbCode + 6 + *(UNALIGNED INT32 *)&pbCode[2]; if (detour_is_imported(pbCode, pbTarget)) { pbNew = *(UNALIGNED PBYTE *)pbTarget; DETOUR_TRACE(("%p->%p: skipped over import table.\n", pbCode, pbNew)); pbCode = pbNew; } } // Finally, skip over a long jump if it is the target of the patch jump. else if (pbCode[0] == 0xe9) { // jmp +imm32 pbNew = pbCode + 5 + *(UNALIGNED INT32 *)&pbCode[1]; DETOUR_TRACE(("%p->%p: skipped over long jump.\n", pbCode, pbNew)); pbCode = pbNew; } } return pbCode; } inline void detour_find_jmp_bounds(PBYTE pbCode, PDETOUR_TRAMPOLINE *ppLower, PDETOUR_TRAMPOLINE *ppUpper) { // We have to place trampolines within +/- 2GB of code. ULONG_PTR lo = detour_2gb_below((ULONG_PTR)pbCode); ULONG_PTR hi = detour_2gb_above((ULONG_PTR)pbCode); DETOUR_TRACE(("[%p..%p..%p]\n", lo, pbCode, hi)); // And, within +/- 2GB of relative jmp vectors. if (pbCode[0] == 0xff && pbCode[1] == 0x25) { // jmp [+imm32] PBYTE pbNew = pbCode + 6 + *(UNALIGNED INT32 *)&pbCode[2]; if (pbNew < pbCode) { hi = detour_2gb_above((ULONG_PTR)pbNew); } else { lo = detour_2gb_below((ULONG_PTR)pbNew); } DETOUR_TRACE(("[%p..%p..%p] [+imm32]\n", lo, pbCode, hi)); } // And, within +/- 2GB of relative jmp targets. else if (pbCode[0] == 0xe9) { // jmp +imm32 PBYTE pbNew = pbCode + 5 + *(UNALIGNED INT32 *)&pbCode[1]; if (pbNew < pbCode) { hi = detour_2gb_above((ULONG_PTR)pbNew); } else { lo = detour_2gb_below((ULONG_PTR)pbNew); } DETOUR_TRACE(("[%p..%p..%p] +imm32\n", lo, pbCode, hi)); } *ppLower = (PDETOUR_TRAMPOLINE)lo; *ppUpper = (PDETOUR_TRAMPOLINE)hi; } inline BOOL detour_does_code_end_function(PBYTE pbCode) { if (pbCode[0] == 0xeb || // jmp +imm8 pbCode[0] == 0xe9 || // jmp +imm32 pbCode[0] == 0xe0 || // jmp eax pbCode[0] == 0xc2 || // ret +imm8 pbCode[0] == 0xc3 || // ret pbCode[0] == 0xcc) { // brk return TRUE; } else if (pbCode[0] == 0xf3 && pbCode[1] == 0xc3) { // rep ret return TRUE; } else if (pbCode[0] == 0xff && pbCode[1] == 0x25) { // jmp [+imm32] return TRUE; } else if ((pbCode[0] == 0x26 || // jmp es: pbCode[0] == 0x2e || // jmp cs: pbCode[0] == 0x36 || // jmp ss: pbCode[0] == 0x3e || // jmp ds: pbCode[0] == 0x64 || // jmp fs: pbCode[0] == 0x65) && // jmp gs: pbCode[1] == 0xff && // jmp [+imm32] pbCode[2] == 0x25) { return TRUE; } return FALSE; } inline ULONG detour_is_code_filler(PBYTE pbCode) { // 1-byte through 11-byte NOPs. if (pbCode[0] == 0x90) { return 1; } if (pbCode[0] == 0x66 && pbCode[1] == 0x90) { return 2; } if (pbCode[0] == 0x0F && pbCode[1] == 0x1F && pbCode[2] == 0x00) { return 3; } if (pbCode[0] == 0x0F && pbCode[1] == 0x1F && pbCode[2] == 0x40 && pbCode[3] == 0x00) { return 4; } if (pbCode[0] == 0x0F && pbCode[1] == 0x1F && pbCode[2] == 0x44 && pbCode[3] == 0x00 && pbCode[4] == 0x00) { return 5; } if (pbCode[0] == 0x66 && pbCode[1] == 0x0F && pbCode[2] == 0x1F && pbCode[3] == 0x44 && pbCode[4] == 0x00 && pbCode[5] == 0x00) { return 6; } if (pbCode[0] == 0x0F && pbCode[1] == 0x1F && pbCode[2] == 0x80 && pbCode[3] == 0x00 && pbCode[4] == 0x00 && pbCode[5] == 0x00 && pbCode[6] == 0x00) { return 7; } if (pbCode[0] == 0x0F && pbCode[1] == 0x1F && pbCode[2] == 0x84 && pbCode[3] == 0x00 && pbCode[4] == 0x00 && pbCode[5] == 0x00 && pbCode[6] == 0x00 && pbCode[7] == 0x00) { return 8; } if (pbCode[0] == 0x66 && pbCode[1] == 0x0F && pbCode[2] == 0x1F && pbCode[3] == 0x84 && pbCode[4] == 0x00 && pbCode[5] == 0x00 && pbCode[6] == 0x00 && pbCode[7] == 0x00 && pbCode[8] == 0x00) { return 9; } if (pbCode[0] == 0x66 && pbCode[1] == 0x66 && pbCode[2] == 0x0F && pbCode[3] == 0x1F && pbCode[4] == 0x84 && pbCode[5] == 0x00 && pbCode[6] == 0x00 && pbCode[7] == 0x00 && pbCode[8] == 0x00 && pbCode[9] == 0x00) { return 10; } if (pbCode[0] == 0x66 && pbCode[1] == 0x66 && pbCode[2] == 0x66 && pbCode[3] == 0x0F && pbCode[4] == 0x1F && pbCode[5] == 0x84 && pbCode[6] == 0x00 && pbCode[7] == 0x00 && pbCode[8] == 0x00 && pbCode[9] == 0x00 && pbCode[10] == 0x00) { return 11; } // int 3. if (pbCode[0] == 0xcc) { return 1; } return 0; } #endif // DETOURS_X64 //////////////////////////////////////////////////////////////////////// IA64. // #ifdef DETOURS_IA64 struct _DETOUR_TRAMPOLINE { // On the IA64, a trampoline is used for both incoming and outgoing calls. // // The trampoline contains the following bundles for the outgoing call: // movl gp=target_gp; // // brl target_code; // // The trampoline contains the following bundles for the incoming call: // alloc r41=ar.pfs, b, 0, 8, 0 // mov r40=rp // // adds r50=0, r39 // adds r49=0, r38 // adds r48=0, r37 ;; // // adds r47=0, r36 // adds r46=0, r35 // adds r45=0, r34 // // adds r44=0, r33 // adds r43=0, r32 // adds r42=0, gp ;; // // movl gp=ffffffff`ffffffff ;; // // brl.call.sptk.few rp=disas!TestCodes+20e0 (00000000`00404ea0) ;; // // adds gp=0, r42 // mov rp=r40, +0 ;; // mov.i ar.pfs=r41 // // br.ret.sptk.many rp ;; // // This way, we only have to relocate a single bundle. // // The complicated incoming trampoline is required because we have to // create an additional stack frame so that we save and restore the gp. // We must do this because gp is a caller-saved register, but not saved // if the caller thinks the target is in the same DLL, which changes // when we insert a detour. // DETOUR_IA64_BUNDLE bMovlTargetGp; // Bundle which sets target GP BYTE rbCode[sizeof(DETOUR_IA64_BUNDLE)]; // moved bundle. DETOUR_IA64_BUNDLE bBrlRemainEip; // Brl to pbRemain // This must be adjacent to bBranchIslands. // Each instruction in the moved bundle could be a IP-relative chk or branch or call. // Any such instructions are changed to point to a brl in bBranchIslands. // This must be adjacent to bBrlRemainEip -- see "pbPool". DETOUR_IA64_BUNDLE bBranchIslands[DETOUR_IA64_INSTRUCTIONS_PER_BUNDLE]; // Target of brl inserted in target function DETOUR_IA64_BUNDLE bAllocFrame; // alloc frame DETOUR_IA64_BUNDLE bSave37to39; // save r37, r38, r39. DETOUR_IA64_BUNDLE bSave34to36; // save r34, r35, r36. DETOUR_IA64_BUNDLE bSaveGPto33; // save gp, r32, r33. DETOUR_IA64_BUNDLE bMovlDetourGp; // set detour GP. DETOUR_IA64_BUNDLE bCallDetour; // call detour. DETOUR_IA64_BUNDLE bPopFrameGp; // pop frame and restore gp. DETOUR_IA64_BUNDLE bReturn; // return to caller. PLABEL_DESCRIPTOR pldTrampoline; BYTE rbRestore[sizeof(DETOUR_IA64_BUNDLE)]; // original target bundle. BYTE cbRestore; // size of original target code. BYTE cbCode; // size of moved target code. _DETOUR_ALIGN rAlign[14]; // instruction alignment array. PBYTE pbRemain; // first instruction after moved code. [free list] PBYTE pbDetour; // first instruction of detour function. PPLABEL_DESCRIPTOR ppldDetour; // [pbDetour,gpDetour] PPLABEL_DESCRIPTOR ppldTarget; // [pbTarget,gpDetour] }; C_ASSERT(sizeof(DETOUR_IA64_BUNDLE) == 16); C_ASSERT(sizeof(_DETOUR_TRAMPOLINE) == 256 + DETOUR_IA64_INSTRUCTIONS_PER_BUNDLE * 16); enum { SIZE_OF_JMP = sizeof(DETOUR_IA64_BUNDLE) }; inline PBYTE detour_skip_jmp(PBYTE pPointer, PVOID *ppGlobals) { PBYTE pGlobals = NULL; PBYTE pbCode = NULL; if (pPointer != NULL) { PPLABEL_DESCRIPTOR ppld = (PPLABEL_DESCRIPTOR)pPointer; pbCode = (PBYTE)ppld->EntryPoint; pGlobals = (PBYTE)ppld->GlobalPointer; } if (ppGlobals != NULL) { *ppGlobals = pGlobals; } if (pbCode == NULL) { return NULL; } DETOUR_IA64_BUNDLE *pb = (DETOUR_IA64_BUNDLE *)pbCode; // IA64 Local Import Jumps look like: // addl r2=ffffffff`ffe021c0, gp ;; // ld8 r2=[r2] // nop.i 0 ;; // // ld8 r3=[r2], 8 ;; // ld8 gp=[r2] // mov b6=r3, +0 // // nop.m 0 // nop.i 0 // br.cond.sptk.few b6 // // 002024000200100b if ((pb[0].wide[0] & 0xfffffc000603ffff) == 0x002024000200100b && pb[0].wide[1] == 0x0004000000203008 && pb[1].wide[0] == 0x001014180420180a && pb[1].wide[1] == 0x07000830c0203008 && pb[2].wide[0] == 0x0000000100000010 && pb[2].wide[1] == 0x0080006000000200) { ULONG64 offset = ((pb[0].wide[0] & 0x0000000001fc0000) >> 18) | // imm7b ((pb[0].wide[0] & 0x000001ff00000000) >> 25) | // imm9d ((pb[0].wide[0] & 0x00000000f8000000) >> 11); // imm5c if (pb[0].wide[0] & 0x0000020000000000) { // sign offset |= 0xffffffffffe00000; } PBYTE pbTarget = pGlobals + offset; DETOUR_TRACE(("%p: potential import jump, target=%p\n", pb, pbTarget)); if (detour_is_imported(pbCode, pbTarget) && *(PBYTE*)pbTarget != NULL) { DETOUR_TRACE(("%p: is import jump, label=%p\n", pb, *(PBYTE *)pbTarget)); PPLABEL_DESCRIPTOR ppld = (PPLABEL_DESCRIPTOR)*(PBYTE *)pbTarget; pbCode = (PBYTE)ppld->EntryPoint; pGlobals = (PBYTE)ppld->GlobalPointer; if (ppGlobals != NULL) { *ppGlobals = pGlobals; } } } return pbCode; } inline void detour_find_jmp_bounds(PBYTE pbCode, PDETOUR_TRAMPOLINE *ppLower, PDETOUR_TRAMPOLINE *ppUpper) { (void)pbCode; *ppLower = (PDETOUR_TRAMPOLINE)(ULONG_PTR)0x0000000000080000; *ppUpper = (PDETOUR_TRAMPOLINE)(ULONG_PTR)0xfffffffffff80000; } inline BOOL detour_does_code_end_function(PBYTE pbCode) { // Routine not needed on IA64. (void)pbCode; return FALSE; } inline ULONG detour_is_code_filler(PBYTE pbCode) { // Routine not needed on IA64. (void)pbCode; return 0; } #endif // DETOURS_IA64 #ifdef DETOURS_ARM struct _DETOUR_TRAMPOLINE { // A Thumb-2 instruction can be 2 or 4 bytes long. BYTE rbCode[62]; // target code + jmp to pbRemain BYTE cbCode; // size of moved target code. BYTE cbCodeBreak; // padding to make debugging easier. BYTE rbRestore[22]; // original target code. BYTE cbRestore; // size of original target code. BYTE cbRestoreBreak; // padding to make debugging easier. _DETOUR_ALIGN rAlign[8]; // instruction alignment array. PBYTE pbRemain; // first instruction after moved code. [free list] PBYTE pbDetour; // first instruction of detour function. }; C_ASSERT(sizeof(_DETOUR_TRAMPOLINE) == 104); enum { SIZE_OF_JMP = 8 }; inline PBYTE align4(PBYTE pValue) { return (PBYTE)(((ULONG)pValue) & ~(ULONG)3u); } inline ULONG fetch_thumb_opcode(PBYTE pbCode) { ULONG Opcode = *(UINT16 *)&pbCode[0]; if (Opcode >= 0xe800) { Opcode = (Opcode << 16) | *(UINT16 *)&pbCode[2]; } return Opcode; } inline void write_thumb_opcode(PBYTE &pbCode, ULONG Opcode) { if (Opcode >= 0x10000) { *((UINT16*&)pbCode)++ = Opcode >> 16; } *((UINT16*&)pbCode)++ = (UINT16)Opcode; } PBYTE detour_gen_jmp_immediate(PBYTE pbCode, PBYTE *ppPool, PBYTE pbJmpVal) { PBYTE pbLiteral; if (ppPool != NULL) { *ppPool = *ppPool - 4; pbLiteral = *ppPool; } else { pbLiteral = align4(pbCode + 6); } *((PBYTE*&)pbLiteral) = DETOURS_PBYTE_TO_PFUNC(pbJmpVal); LONG delta = pbLiteral - align4(pbCode + 4); write_thumb_opcode(pbCode, 0xf8dff000 | delta); // LDR PC,[PC+n] if (ppPool == NULL) { if (((ULONG)pbCode & 2) != 0) { write_thumb_opcode(pbCode, 0xdefe); // BREAK } pbCode += 4; } return pbCode; } inline PBYTE detour_gen_brk(PBYTE pbCode, PBYTE pbLimit) { while (pbCode < pbLimit) { write_thumb_opcode(pbCode, 0xdefe); } return pbCode; } inline PBYTE detour_skip_jmp(PBYTE pbCode, PVOID *ppGlobals) { if (pbCode == NULL) { return NULL; } if (ppGlobals != NULL) { *ppGlobals = NULL; } // Skip over the import jump if there is one. pbCode = (PBYTE)DETOURS_PFUNC_TO_PBYTE(pbCode); ULONG Opcode = fetch_thumb_opcode(pbCode); if ((Opcode & 0xfbf08f00) == 0xf2400c00) { // movw r12,#xxxx ULONG Opcode2 = fetch_thumb_opcode(pbCode+4); if ((Opcode2 & 0xfbf08f00) == 0xf2c00c00) { // movt r12,#xxxx ULONG Opcode3 = fetch_thumb_opcode(pbCode+8); if (Opcode3 == 0xf8dcf000) { // ldr pc,[r12] PBYTE pbTarget = (PBYTE)(((Opcode2 << 12) & 0xf7000000) | ((Opcode2 << 1) & 0x08000000) | ((Opcode2 << 16) & 0x00ff0000) | ((Opcode >> 4) & 0x0000f700) | ((Opcode >> 15) & 0x00000800) | ((Opcode >> 0) & 0x000000ff)); if (detour_is_imported(pbCode, pbTarget)) { PBYTE pbNew = *(PBYTE *)pbTarget; pbNew = DETOURS_PFUNC_TO_PBYTE(pbNew); DETOUR_TRACE(("%p->%p: skipped over import table.\n", pbCode, pbNew)); return pbNew; } } } } return pbCode; } inline void detour_find_jmp_bounds(PBYTE pbCode, PDETOUR_TRAMPOLINE *ppLower, PDETOUR_TRAMPOLINE *ppUpper) { // We have to place trampolines within +/- 2GB of code. ULONG_PTR lo = detour_2gb_below((ULONG_PTR)pbCode); ULONG_PTR hi = detour_2gb_above((ULONG_PTR)pbCode); DETOUR_TRACE(("[%p..%p..%p]\n", lo, pbCode, hi)); *ppLower = (PDETOUR_TRAMPOLINE)lo; *ppUpper = (PDETOUR_TRAMPOLINE)hi; } inline BOOL detour_does_code_end_function(PBYTE pbCode) { ULONG Opcode = fetch_thumb_opcode(pbCode); if ((Opcode & 0xffffff87) == 0x4700 || // bx (Opcode & 0xf800d000) == 0xf0009000) { // b return TRUE; } if ((Opcode & 0xffff8000) == 0xe8bd8000) { // pop {...,pc} __debugbreak(); return TRUE; } if ((Opcode & 0xffffff00) == 0x0000bd00) { // pop {...,pc} __debugbreak(); return TRUE; } return FALSE; } inline ULONG detour_is_code_filler(PBYTE pbCode) { if (pbCode[0] == 0x00 && pbCode[1] == 0xbf) { // nop. return 2; } if (pbCode[0] == 0x00 && pbCode[1] == 0x00) { // zero-filled padding. return 2; } return 0; } #endif // DETOURS_ARM #ifdef DETOURS_ARM64 struct _DETOUR_TRAMPOLINE { // An ARM64 instruction is 4 bytes long. // // The overwrite is always composed of 3 instructions (12 bytes) which perform an indirect jump // using _DETOUR_TRAMPOLINE::pbDetour as the address holding the target location. // // Copied instructions can expand. // // The scheme using MovImmediate can cause an instruction // to grow as much as 6 times. // That would be Bcc or Tbz with a large address space: // 4 instructions to form immediate // inverted tbz/bcc // br // // An expansion of 4 is not uncommon -- bl/blr and small address space: // 3 instructions to form immediate // br or brl // // A theoretical maximum for rbCode is thefore 4*4*6 + 16 = 112 (another 16 for jmp to pbRemain). // // With literals, the maximum expansion is 5, including the literals: 4*4*5 + 16 = 96. // // The number is rounded up to 128. m_rbScratchDst should match this. // BYTE rbCode[128]; // target code + jmp to pbRemain BYTE cbCode; // size of moved target code. BYTE cbCodeBreak[3]; // padding to make debugging easier. BYTE rbRestore[24]; // original target code. BYTE cbRestore; // size of original target code. BYTE cbRestoreBreak[3]; // padding to make debugging easier. _DETOUR_ALIGN rAlign[8]; // instruction alignment array. PBYTE pbRemain; // first instruction after moved code. [free list] PBYTE pbDetour; // first instruction of detour function. }; C_ASSERT(sizeof(_DETOUR_TRAMPOLINE) == 184); enum { SIZE_OF_JMP = 12 }; inline ULONG fetch_opcode(PBYTE pbCode) { return *(ULONG *)pbCode; } inline void write_opcode(PBYTE &pbCode, ULONG Opcode) { *(ULONG *)pbCode = Opcode; pbCode += 4; } struct ARM64_INDIRECT_JMP { struct { ULONG Rd : 5; ULONG immhi : 19; ULONG iop : 5; ULONG immlo : 2; ULONG op : 1; } ardp; struct { ULONG Rt : 5; ULONG Rn : 5; ULONG imm : 12; ULONG opc : 2; ULONG iop1 : 2; ULONG V : 1; ULONG iop2 : 3; ULONG size : 2; } ldr; ULONG br; }; #pragma warning(push) #pragma warning(disable:4201) union ARM64_INDIRECT_IMM { struct { ULONG64 pad : 12; ULONG64 adrp_immlo : 2; ULONG64 adrp_immhi : 19; }; LONG64 value; }; #pragma warning(pop) PBYTE detour_gen_jmp_indirect(BYTE *pbCode, ULONG64 *pbJmpVal) { // adrp x17, [jmpval] // ldr x17, [x17, jmpval] // br x17 struct ARM64_INDIRECT_JMP *pIndJmp; union ARM64_INDIRECT_IMM jmpIndAddr; jmpIndAddr.value = (((LONG64)pbJmpVal) & 0xFFFFFFFFFFFFF000) - (((LONG64)pbCode) & 0xFFFFFFFFFFFFF000); pIndJmp = (struct ARM64_INDIRECT_JMP *)pbCode; pbCode = (BYTE *)(pIndJmp + 1); pIndJmp->ardp.Rd = 17; pIndJmp->ardp.immhi = jmpIndAddr.adrp_immhi; pIndJmp->ardp.iop = 0x10; pIndJmp->ardp.immlo = jmpIndAddr.adrp_immlo; pIndJmp->ardp.op = 1; pIndJmp->ldr.Rt = 17; pIndJmp->ldr.Rn = 17; pIndJmp->ldr.imm = (((ULONG64)pbJmpVal) & 0xFFF) / 8; pIndJmp->ldr.opc = 1; pIndJmp->ldr.iop1 = 1; pIndJmp->ldr.V = 0; pIndJmp->ldr.iop2 = 7; pIndJmp->ldr.size = 3; pIndJmp->br = 0xD61F0220; return pbCode; } PBYTE detour_gen_jmp_immediate(PBYTE pbCode, PBYTE *ppPool, PBYTE pbJmpVal) { PBYTE pbLiteral; if (ppPool != NULL) { *ppPool = *ppPool - 8; pbLiteral = *ppPool; } else { pbLiteral = pbCode + 8; } *((PBYTE*&)pbLiteral) = pbJmpVal; LONG delta = (LONG)(pbLiteral - pbCode); write_opcode(pbCode, 0x58000011 | ((delta / 4) << 5)); // LDR X17,[PC+n] write_opcode(pbCode, 0xd61f0000 | (17 << 5)); // BR X17 if (ppPool == NULL) { pbCode += 8; } return pbCode; } inline PBYTE detour_gen_brk(PBYTE pbCode, PBYTE pbLimit) { while (pbCode < pbLimit) { write_opcode(pbCode, 0xd4100000 | (0xf000 << 5)); } return pbCode; } inline INT64 detour_sign_extend(UINT64 value, UINT bits) { const UINT left = 64 - bits; const INT64 m1 = -1; const INT64 wide = (INT64)(value << left); const INT64 sign = (wide < 0) ? (m1 << left) : 0; return value | sign; } inline PBYTE detour_skip_jmp(PBYTE pbCode, PVOID *ppGlobals) { if (pbCode == NULL) { return NULL; } if (ppGlobals != NULL) { *ppGlobals = NULL; } // Skip over the import jump if there is one. pbCode = (PBYTE)pbCode; ULONG Opcode = fetch_opcode(pbCode); if ((Opcode & 0x9f00001f) == 0x90000010) { // adrp x16, IAT ULONG Opcode2 = fetch_opcode(pbCode + 4); if ((Opcode2 & 0xffe003ff) == 0xf9400210) { // ldr x16, [x16, IAT] ULONG Opcode3 = fetch_opcode(pbCode + 8); if (Opcode3 == 0xd61f0200) { // br x16 /* https://static.docs.arm.com/ddi0487/bb/DDI0487B_b_armv8_arm.pdf The ADRP instruction shifts a signed, 21-bit immediate left by 12 bits, adds it to the value of the program counter with the bottom 12 bits cleared to zero, and then writes the result to a general-purpose register. This permits the calculation of the address at a 4KB aligned memory region. In conjunction with an ADD (immediate) instruction, or a Load/Store instruction with a 12-bit immediate offset, this allows for the calculation of, or access to, any address within +/- 4GB of the current PC. PC-rel. addressing This section describes the encoding of the PC-rel. addressing instruction class. The encodings in this section are decoded from Data Processing -- Immediate on page C4-226. Add/subtract (immediate) This section describes the encoding of the Add/subtract (immediate) instruction class. The encodings in this section are decoded from Data Processing -- Immediate on page C4-226. Decode fields Instruction page op 0 ADR 1 ADRP C6.2.10 ADRP Form PC-relative address to 4KB page adds an immediate value that is shifted left by 12 bits, to the PC value to form a PC-relative address, with the bottom 12 bits masked out, and writes the result to the destination register. ADRP ,