Add support of ROCm 6. (#27)

* Add support of ROCm 6.1.2 for Windows.

* Fix CI.

* Use llvm.sqrt.f64.
This commit is contained in:
Seunghoon Lee 2024-07-13 13:47:35 +09:00 committed by GitHub
parent d23b3f4636
commit d7714d84c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 11747 additions and 8619 deletions

View file

@ -5,7 +5,7 @@ on:
env:
CARGO_TERM_COLOR: always
ROCM_VERSION: "5.7.3"
ROCM_VERSION: "6.1.3"
jobs:
build_lin:
@ -40,7 +40,7 @@ jobs:
submodules: true
- name: Install AMD HIP SDK
run: |
C:\msys64\usr\bin\wget.exe https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-23.Q4-Win10-Win11-For-HIP.exe -O "amdgpu-install.exe"
C:\msys64\usr\bin\wget.exe https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-24.Q3-Win10-Win11-For-HIP.exe -O "amdgpu-install.exe"
.\amdgpu-install.exe -Install -View:1
Start-Sleep -Seconds 60
$setupId = (Get-Process ATISetup).id

View file

@ -5,7 +5,7 @@ on:
env:
CARGO_TERM_COLOR: always
ROCM_VERSION: "5.7.3"
ROCM_VERSION: "6.1.3"
jobs:
release:
@ -87,7 +87,7 @@ jobs:
submodules: true
- name: Install AMD HIP SDK
run: |
C:\msys64\usr\bin\wget.exe https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-23.Q4-Win10-Win11-For-HIP.exe -O "amdgpu-install.exe"
C:\msys64\usr\bin\wget.exe https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-24.Q3-Win10-Win11-For-HIP.exe -O "amdgpu-install.exe"
.\amdgpu-install.exe -Install -View:1
Start-Sleep -Seconds 60
$setupId = (Get-Process ATISetup).id

View file

@ -1 +1 @@
bindgen .\include\amd_comgr.h --size_t-is-usize --must-use-type "amd_comgr_status_t" --no-layout-tests --no-derive-debug --default-enum-style=newtype --dynamic-loading LibComgr --dynamic-link-require-all -o src/amd_comgr.rs --whitelist-function="^amd_comgr_action_data_get_data$|^amd_comgr_action_info_set_isa_name$|^amd_comgr_action_info_set_option_list$|^amd_comgr_create_action_info$|^amd_comgr_create_data$|^amd_comgr_create_data_set$|^amd_comgr_data_set_add$|^amd_comgr_destroy_action_info$|^amd_comgr_destroy_data_set$|^amd_comgr_do_action$|^amd_comgr_get_data$|^amd_comgr_release_data$|^amd_comgr_set_data$|^amd_comgr_set_data_name$|^amd_comgr_action_info_set_language$|^amd_comgr_set_data_name$"
bindgen $Env:HIP_PATH/include/amd_comgr.h --must-use-type "amd_comgr_status_t" --no-layout-tests --no-derive-debug --default-enum-style=newtype --dynamic-loading LibComgr --dynamic-link-require-all -o src/amd_comgr.rs --allowlist-function="^amd_comgr_action_data_get_data$|^amd_comgr_action_info_set_isa_name$|^amd_comgr_action_info_set_option_list$|^amd_comgr_create_action_info$|^amd_comgr_create_data$|^amd_comgr_create_data_set$|^amd_comgr_data_set_add$|^amd_comgr_destroy_action_info$|^amd_comgr_destroy_data_set$|^amd_comgr_do_action$|^amd_comgr_get_data$|^amd_comgr_release_data$|^amd_comgr_set_data$|^amd_comgr_set_data_name$|^amd_comgr_action_info_set_language$|^amd_comgr_set_data_name$"

View file

@ -1,4 +1,4 @@
/* automatically generated by rust-bindgen 0.60.1 */
/* automatically generated by rust-bindgen 0.69.4 */
impl amd_comgr_status_s {
#[doc = " The function has been executed successfully."]
@ -9,8 +9,7 @@ impl amd_comgr_status_s {
pub const AMD_COMGR_STATUS_ERROR: amd_comgr_status_s = amd_comgr_status_s(1);
}
impl amd_comgr_status_s {
#[doc = " One of the actual arguments does not meet a precondition stated"]
#[doc = " in the documentation of the corresponding formal argument."]
#[doc = " One of the actual arguments does not meet a precondition stated\n in the documentation of the corresponding formal argument. This\n includes both invalid Action types, and invalid arguments to\n valid Action types."]
pub const AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT: amd_comgr_status_s = amd_comgr_status_s(2);
}
impl amd_comgr_status_s {
@ -20,7 +19,7 @@ impl amd_comgr_status_s {
#[repr(transparent)]
#[doc = " @brief Status codes."]
#[derive(Copy, Clone, Hash, PartialEq, Eq, Debug)]
pub struct amd_comgr_status_s(pub ::std::os::raw::c_uint);
pub struct amd_comgr_status_s(pub ::std::os::raw::c_int);
#[doc = " @brief Status codes."]
pub use self::amd_comgr_status_s as amd_comgr_status_t;
impl amd_comgr_language_s {
@ -43,14 +42,18 @@ impl amd_comgr_language_s {
#[doc = " HIP."]
pub const AMD_COMGR_LANGUAGE_HIP: amd_comgr_language_s = amd_comgr_language_s(4);
}
impl amd_comgr_language_s {
#[doc = " LLVM IR, either textual (.ll) or bitcode (.bc) format."]
pub const AMD_COMGR_LANGUAGE_LLVM_IR: amd_comgr_language_s = amd_comgr_language_s(5);
}
impl amd_comgr_language_s {
#[doc = " Marker for last valid language."]
pub const AMD_COMGR_LANGUAGE_LAST: amd_comgr_language_s = amd_comgr_language_s(4);
pub const AMD_COMGR_LANGUAGE_LAST: amd_comgr_language_s = amd_comgr_language_s(5);
}
#[repr(transparent)]
#[doc = " @brief The source languages supported by the compiler."]
#[derive(Copy, Clone, Hash, PartialEq, Eq)]
pub struct amd_comgr_language_s(pub ::std::os::raw::c_uint);
pub struct amd_comgr_language_s(pub ::std::os::raw::c_int);
#[doc = " @brief The source languages supported by the compiler."]
pub use self::amd_comgr_language_s as amd_comgr_language_t;
impl amd_comgr_data_kind_s {
@ -62,13 +65,11 @@ impl amd_comgr_data_kind_s {
pub const AMD_COMGR_DATA_KIND_SOURCE: amd_comgr_data_kind_s = amd_comgr_data_kind_s(1);
}
impl amd_comgr_data_kind_s {
#[doc = " The data is a textual source that is included in the main source"]
#[doc = " or other include source."]
#[doc = " The data is a textual source that is included in the main source\n or other include source."]
pub const AMD_COMGR_DATA_KIND_INCLUDE: amd_comgr_data_kind_s = amd_comgr_data_kind_s(2);
}
impl amd_comgr_data_kind_s {
#[doc = " The data is a precompiled-header source that is included in the main"]
#[doc = " source or other include source."]
#[doc = " The data is a precompiled-header source that is included in the main\n source or other include source."]
pub const AMD_COMGR_DATA_KIND_PRECOMPILED_HEADER: amd_comgr_data_kind_s =
amd_comgr_data_kind_s(3);
}
@ -89,9 +90,7 @@ impl amd_comgr_data_kind_s {
pub const AMD_COMGR_DATA_KIND_RELOCATABLE: amd_comgr_data_kind_s = amd_comgr_data_kind_s(7);
}
impl amd_comgr_data_kind_s {
#[doc = " The data is an executable machine code object for a specific"]
#[doc = " isa. An executable is the kind of code object that can be loaded"]
#[doc = " and executed."]
#[doc = " The data is an executable machine code object for a specific\n isa. An executable is the kind of code object that can be loaded\n and executed."]
pub const AMD_COMGR_DATA_KIND_EXECUTABLE: amd_comgr_data_kind_s = amd_comgr_data_kind_s(8);
}
impl amd_comgr_data_kind_s {
@ -102,320 +101,149 @@ impl amd_comgr_data_kind_s {
#[doc = " The data is a fat binary (clang-offload-bundler output)."]
pub const AMD_COMGR_DATA_KIND_FATBIN: amd_comgr_data_kind_s = amd_comgr_data_kind_s(16);
}
impl amd_comgr_data_kind_s {
#[doc = " The data is an archive."]
pub const AMD_COMGR_DATA_KIND_AR: amd_comgr_data_kind_s = amd_comgr_data_kind_s(17);
}
impl amd_comgr_data_kind_s {
#[doc = " The data is a bundled bitcode."]
pub const AMD_COMGR_DATA_KIND_BC_BUNDLE: amd_comgr_data_kind_s = amd_comgr_data_kind_s(18);
}
impl amd_comgr_data_kind_s {
#[doc = " The data is a bundled archive."]
pub const AMD_COMGR_DATA_KIND_AR_BUNDLE: amd_comgr_data_kind_s = amd_comgr_data_kind_s(19);
}
impl amd_comgr_data_kind_s {
#[doc = " Marker for last valid data kind."]
pub const AMD_COMGR_DATA_KIND_LAST: amd_comgr_data_kind_s = amd_comgr_data_kind_s(16);
pub const AMD_COMGR_DATA_KIND_LAST: amd_comgr_data_kind_s = amd_comgr_data_kind_s(19);
}
#[repr(transparent)]
#[doc = " @brief The kinds of data supported."]
#[derive(Copy, Clone, Hash, PartialEq, Eq)]
pub struct amd_comgr_data_kind_s(pub ::std::os::raw::c_uint);
pub struct amd_comgr_data_kind_s(pub ::std::os::raw::c_int);
#[doc = " @brief The kinds of data supported."]
pub use self::amd_comgr_data_kind_s as amd_comgr_data_kind_t;
#[doc = " @brief A handle to a data object."]
#[doc = ""]
#[doc = " Data objects are used to hold the data which is either an input or"]
#[doc = " output of a code object manager action."]
#[doc = " @brief A handle to a data object.\n\n Data objects are used to hold the data which is either an input or\n output of a code object manager action."]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct amd_comgr_data_s {
pub handle: u64,
}
#[doc = " @brief A handle to a data object."]
#[doc = ""]
#[doc = " Data objects are used to hold the data which is either an input or"]
#[doc = " output of a code object manager action."]
#[doc = " @brief A handle to a data object.\n\n Data objects are used to hold the data which is either an input or\n output of a code object manager action."]
pub type amd_comgr_data_t = amd_comgr_data_s;
#[doc = " @brief A handle to an action data object."]
#[doc = ""]
#[doc = " An action data object holds a set of data objects. These can be"]
#[doc = " used as inputs to an action, or produced as the result of an"]
#[doc = " action."]
#[doc = " @brief A handle to an action data object.\n\n An action data object holds a set of data objects. These can be\n used as inputs to an action, or produced as the result of an\n action."]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct amd_comgr_data_set_s {
pub handle: u64,
}
#[doc = " @brief A handle to an action data object."]
#[doc = ""]
#[doc = " An action data object holds a set of data objects. These can be"]
#[doc = " used as inputs to an action, or produced as the result of an"]
#[doc = " action."]
#[doc = " @brief A handle to an action data object.\n\n An action data object holds a set of data objects. These can be\n used as inputs to an action, or produced as the result of an\n action."]
pub type amd_comgr_data_set_t = amd_comgr_data_set_s;
#[doc = " @brief A handle to an action information object."]
#[doc = ""]
#[doc = " An action information object holds all the necessary information,"]
#[doc = " excluding the input data objects, required to perform an action."]
#[doc = " @brief A handle to an action information object.\n\n An action information object holds all the necessary information,\n excluding the input data objects, required to perform an action."]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct amd_comgr_action_info_s {
pub handle: u64,
}
#[doc = " @brief A handle to an action information object."]
#[doc = ""]
#[doc = " An action information object holds all the necessary information,"]
#[doc = " excluding the input data objects, required to perform an action."]
#[doc = " @brief A handle to an action information object.\n\n An action information object holds all the necessary information,\n excluding the input data objects, required to perform an action."]
pub type amd_comgr_action_info_t = amd_comgr_action_info_s;
impl amd_comgr_action_kind_s {
#[doc = " Preprocess each source data object in @p input in order. For each"]
#[doc = " successful preprocessor invocation, add a source data object to @p result."]
#[doc = " Resolve any include source names using the names of include data objects"]
#[doc = " in @p input. Resolve any include relative path names using the working"]
#[doc = " directory path in @p info. Preprocess the source for the language in @p"]
#[doc = " info."]
#[doc = ""]
#[doc = " Return @p AMD_COMGR_STATUS_ERROR if any preprocessing fails."]
#[doc = ""]
#[doc = " Return @p AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT"]
#[doc = " if isa name or language is not set in @p info."]
#[doc = " Preprocess each source data object in @p input in order. For each\n successful preprocessor invocation, add a source data object to @p result.\n Resolve any include source names using the names of include data objects\n in @p input. Resolve any include relative path names using the working\n directory path in @p info. Preprocess the source for the language in @p\n info.\n\n Return @p AMD_COMGR_STATUS_ERROR if any preprocessing fails.\n\n Return @p AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT\n if isa name or language is not set in @p info."]
pub const AMD_COMGR_ACTION_SOURCE_TO_PREPROCESSOR: amd_comgr_action_kind_s =
amd_comgr_action_kind_s(0);
}
impl amd_comgr_action_kind_s {
#[doc = " Copy all existing data objects in @p input to @p output, then add the"]
#[doc = " device-specific and language-specific precompiled headers required for"]
#[doc = " compilation."]
#[doc = ""]
#[doc = " Currently the only supported languages are @p AMD_COMGR_LANGUAGE_OPENCL_1_2"]
#[doc = " and @p AMD_COMGR_LANGUAGE_OPENCL_2_0."]
#[doc = ""]
#[doc = " Return @p AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT if isa name or language"]
#[doc = " is not set in @p info, or the language is not supported."]
#[doc = " Copy all existing data objects in @p input to @p output, then add the\n device-specific and language-specific precompiled headers required for\n compilation.\n\n Currently the only supported languages are @p AMD_COMGR_LANGUAGE_OPENCL_1_2\n and @p AMD_COMGR_LANGUAGE_OPENCL_2_0.\n\n Return @p AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT if isa name or language\n is not set in @p info, or the language is not supported."]
pub const AMD_COMGR_ACTION_ADD_PRECOMPILED_HEADERS: amd_comgr_action_kind_s =
amd_comgr_action_kind_s(1);
}
impl amd_comgr_action_kind_s {
#[doc = " Compile each source data object in @p input in order. For each"]
#[doc = " successful compilation add a bc data object to @p result. Resolve"]
#[doc = " any include source names using the names of include data objects"]
#[doc = " in @p input. Resolve any include relative path names using the"]
#[doc = " working directory path in @p info. Produce bc for isa name in @p"]
#[doc = " info. Compile the source for the language in @p info."]
#[doc = ""]
#[doc = " Return @p AMD_COMGR_STATUS_ERROR if any compilation"]
#[doc = " fails."]
#[doc = ""]
#[doc = " Return @p AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT"]
#[doc = " if isa name or language is not set in @p info."]
#[doc = " Compile each source data object in @p input in order. For each\n successful compilation add a bc data object to @p result. Resolve\n any include source names using the names of include data objects\n in @p input. Resolve any include relative path names using the\n working directory path in @p info. Produce bc for isa name in @p\n info. Compile the source for the language in @p info.\n\n Return @p AMD_COMGR_STATUS_ERROR if any compilation\n fails.\n\n Return @p AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT\n if isa name or language is not set in @p info."]
pub const AMD_COMGR_ACTION_COMPILE_SOURCE_TO_BC: amd_comgr_action_kind_s =
amd_comgr_action_kind_s(2);
}
impl amd_comgr_action_kind_s {
#[doc = " Copy all existing data objects in @p input to @p output, then add the"]
#[doc = " device-specific and language-specific bitcode libraries required for"]
#[doc = " compilation."]
#[doc = ""]
#[doc = " Currently the only supported languages are @p AMD_COMGR_LANGUAGE_OPENCL_1_2,"]
#[doc = " @p AMD_COMGR_LANGUAGE_OPENCL_2_0, and @p AMD_COMGR_LANGUAGE_HIP."]
#[doc = ""]
#[doc = " The options in @p info should be set to a set of language-specific flags."]
#[doc = " For OpenCL and HIP these include:"]
#[doc = ""]
#[doc = " correctly_rounded_sqrt"]
#[doc = " daz_opt"]
#[doc = " finite_only"]
#[doc = " unsafe_math"]
#[doc = " wavefrontsize64"]
#[doc = ""]
#[doc = " For example, to enable daz_opt and unsafe_math, the options should be set"]
#[doc = " as:"]
#[doc = ""]
#[doc = " const char *options[] = {\"daz_opt, \"unsafe_math\"};"]
#[doc = " size_t optionsCount = sizeof(options) / sizeof(options[0]);"]
#[doc = " amd_comgr_action_info_set_option_list(info, options, optionsCount);"]
#[doc = ""]
#[doc = " Return @p AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT if isa name or language"]
#[doc = " is not set in @p info, the language is not supported, an unknown"]
#[doc = " language-specific flag is supplied, or a language-specific flag is"]
#[doc = " repeated."]
#[doc = ""]
#[doc = " @deprecated since 1.7"]
#[doc = " @warning This action, followed by @c AMD_COMGR_ACTION_LINK_BC_TO_BC, may"]
#[doc = " result in subtle bugs due to incorrect linking of the device libraries."]
#[doc = " The @c AMD_COMGR_ACTION_COMPILE_SOURCE_WITH_DEVICE_LIBS_TO_BC action can"]
#[doc = " be used as a workaround which ensures the link occurs correctly."]
#[doc = " Copy all existing data objects in @p input to @p output, then add the\n device-specific and language-specific bitcode libraries required for\n compilation.\n\n Currently the only supported languages are @p AMD_COMGR_LANGUAGE_OPENCL_1_2,\n @p AMD_COMGR_LANGUAGE_OPENCL_2_0, and @p AMD_COMGR_LANGUAGE_HIP.\n\n The options in @p info should be set to a set of language-specific flags.\n For OpenCL and HIP these include:\n\n correctly_rounded_sqrt\n daz_opt\n finite_only\n unsafe_math\n wavefrontsize64\n\n For example, to enable daz_opt and unsafe_math, the options should be set\n as:\n\n const char *options[] = {\"daz_opt, \"unsafe_math\"};\n size_t optionsCount = sizeof(options) / sizeof(options[0]);\n amd_comgr_action_info_set_option_list(info, options, optionsCount);\n\n Return @p AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT if isa name or language\n is not set in @p info, the language is not supported, an unknown\n language-specific flag is supplied, or a language-specific flag is\n repeated.\n\n @deprecated since 1.7\n @warning This action, followed by @c AMD_COMGR_ACTION_LINK_BC_TO_BC, may\n result in subtle bugs due to incorrect linking of the device libraries.\n The @c AMD_COMGR_ACTION_COMPILE_SOURCE_WITH_DEVICE_LIBS_TO_BC action can\n be used as a workaround which ensures the link occurs correctly."]
pub const AMD_COMGR_ACTION_ADD_DEVICE_LIBRARIES: amd_comgr_action_kind_s =
amd_comgr_action_kind_s(3);
}
impl amd_comgr_action_kind_s {
#[doc = " Link each bc data object in @p input together and add the linked"]
#[doc = " bc data object to @p result. Any device library bc data object"]
#[doc = " must be explicitly added to @p input if needed."]
#[doc = ""]
#[doc = " Return @p AMD_COMGR_STATUS_ERROR if the link fails."]
#[doc = ""]
#[doc = " Return @p AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT"]
#[doc = " if isa name is not set in @p info and does not match the isa name"]
#[doc = " of all bc data objects in @p input."]
#[doc = " Link a collection of bitcodes, bundled bitcodes, and bundled bitcode\n archives in @p into a single composite (unbundled) bitcode @p.\n Any device library bc data object must be explicitly added to @p input if\n needed.\n\n Return @p AMD_COMGR_STATUS_ERROR if the link or unbundling fails.\n\n Return @p AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT\n if IsaName is not set in @p info and does not match the isa name\n of all bc data objects in @p input, or if the Name field is not set for\n any DataObject in the input set."]
pub const AMD_COMGR_ACTION_LINK_BC_TO_BC: amd_comgr_action_kind_s = amd_comgr_action_kind_s(4);
}
impl amd_comgr_action_kind_s {
#[doc = " Optimize each bc data object in @p input and create an optimized bc data"]
#[doc = " object to @p result."]
#[doc = ""]
#[doc = " Return @p AMD_COMGR_STATUS_ERROR if the optimization fails."]
#[doc = ""]
#[doc = " Return @p AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT"]
#[doc = " if isa name is not set in @p info and does not match the isa name"]
#[doc = " of all bc data objects in @p input."]
#[doc = " Optimize each bc data object in @p input and create an optimized bc data\n object to @p result.\n\n Return @p AMD_COMGR_STATUS_ERROR if the optimization fails.\n\n Return @p AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT\n if isa name is not set in @p info and does not match the isa name\n of all bc data objects in @p input."]
pub const AMD_COMGR_ACTION_OPTIMIZE_BC_TO_BC: amd_comgr_action_kind_s =
amd_comgr_action_kind_s(5);
}
impl amd_comgr_action_kind_s {
#[doc = " Perform code generation for each bc data object in @p input in"]
#[doc = " order. For each successful code generation add a relocatable data"]
#[doc = " object to @p result."]
#[doc = ""]
#[doc = " Return @p AMD_COMGR_STATUS_ERROR if any code"]
#[doc = " generation fails."]
#[doc = ""]
#[doc = " Return @p AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT"]
#[doc = " if isa name is not set in @p info and does not match the isa name"]
#[doc = " of all bc data objects in @p input."]
#[doc = " Perform code generation for each bc data object in @p input in\n order. For each successful code generation add a relocatable data\n object to @p result.\n\n Return @p AMD_COMGR_STATUS_ERROR if any code\n generation fails.\n\n Return @p AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT\n if isa name is not set in @p info and does not match the isa name\n of all bc data objects in @p input."]
pub const AMD_COMGR_ACTION_CODEGEN_BC_TO_RELOCATABLE: amd_comgr_action_kind_s =
amd_comgr_action_kind_s(6);
}
impl amd_comgr_action_kind_s {
#[doc = " Perform code generation for each bc data object in @p input in"]
#[doc = " order. For each successful code generation add an assembly source data"]
#[doc = " object to @p result."]
#[doc = ""]
#[doc = " Return @p AMD_COMGR_STATUS_ERROR if any code"]
#[doc = " generation fails."]
#[doc = ""]
#[doc = " Return @p AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT"]
#[doc = " if isa name is not set in @p info and does not match the isa name"]
#[doc = " of all bc data objects in @p input."]
#[doc = " Perform code generation for each bc data object in @p input in\n order. For each successful code generation add an assembly source data\n object to @p result.\n\n Return @p AMD_COMGR_STATUS_ERROR if any code\n generation fails.\n\n Return @p AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT\n if isa name is not set in @p info and does not match the isa name\n of all bc data objects in @p input."]
pub const AMD_COMGR_ACTION_CODEGEN_BC_TO_ASSEMBLY: amd_comgr_action_kind_s =
amd_comgr_action_kind_s(7);
}
impl amd_comgr_action_kind_s {
#[doc = " Link each relocatable data object in @p input together and add"]
#[doc = " the linked relocatable data object to @p result. Any device"]
#[doc = " library relocatable data object must be explicitly added to @p"]
#[doc = " input if needed."]
#[doc = ""]
#[doc = " Return @p AMD_COMGR_STATUS_ERROR if the link fails."]
#[doc = ""]
#[doc = " Return @p AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT"]
#[doc = " if isa name is not set in @p info and does not match the isa name"]
#[doc = " of all relocatable data objects in @p input."]
#[doc = " Link each relocatable data object in @p input together and add\n the linked relocatable data object to @p result. Any device\n library relocatable data object must be explicitly added to @p\n input if needed.\n\n Return @p AMD_COMGR_STATUS_ERROR if the link fails.\n\n Return @p AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT\n if isa name is not set in @p info and does not match the isa name\n of all relocatable data objects in @p input."]
pub const AMD_COMGR_ACTION_LINK_RELOCATABLE_TO_RELOCATABLE: amd_comgr_action_kind_s =
amd_comgr_action_kind_s(8);
}
impl amd_comgr_action_kind_s {
#[doc = " Link each relocatable data object in @p input together and add"]
#[doc = " the linked executable data object to @p result. Any device"]
#[doc = " library relocatable data object must be explicitly added to @p"]
#[doc = " input if needed."]
#[doc = ""]
#[doc = " Return @p AMD_COMGR_STATUS_ERROR if the link fails."]
#[doc = ""]
#[doc = " Return @p AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT"]
#[doc = " if isa name is not set in @p info and does not match the isa name"]
#[doc = " of all relocatable data objects in @p input."]
#[doc = " Link each relocatable data object in @p input together and add\n the linked executable data object to @p result. Any device\n library relocatable data object must be explicitly added to @p\n input if needed.\n\n Return @p AMD_COMGR_STATUS_ERROR if the link fails.\n\n Return @p AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT\n if isa name is not set in @p info and does not match the isa name\n of all relocatable data objects in @p input."]
pub const AMD_COMGR_ACTION_LINK_RELOCATABLE_TO_EXECUTABLE: amd_comgr_action_kind_s =
amd_comgr_action_kind_s(9);
}
impl amd_comgr_action_kind_s {
#[doc = " Assemble each source data object in @p input in order into machine code."]
#[doc = " For each successful assembly add a relocatable data object to @p result."]
#[doc = " Resolve any include source names using the names of include data objects in"]
#[doc = " @p input. Resolve any include relative path names using the working"]
#[doc = " directory path in @p info. Produce relocatable for isa name in @p info."]
#[doc = ""]
#[doc = " Return @p AMD_COMGR_STATUS_ERROR if any assembly fails."]
#[doc = ""]
#[doc = " Return @p AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT if isa name is not set in"]
#[doc = " @p info."]
#[doc = " Assemble each source data object in @p input in order into machine code.\n For each successful assembly add a relocatable data object to @p result.\n Resolve any include source names using the names of include data objects in\n @p input. Resolve any include relative path names using the working\n directory path in @p info. Produce relocatable for isa name in @p info.\n\n Return @p AMD_COMGR_STATUS_ERROR if any assembly fails.\n\n Return @p AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT if isa name is not set in\n @p info."]
pub const AMD_COMGR_ACTION_ASSEMBLE_SOURCE_TO_RELOCATABLE: amd_comgr_action_kind_s =
amd_comgr_action_kind_s(10);
}
impl amd_comgr_action_kind_s {
#[doc = " Disassemble each relocatable data object in @p input in"]
#[doc = " order. For each successful disassembly add a source data object to"]
#[doc = " @p result."]
#[doc = ""]
#[doc = " Return @p AMD_COMGR_STATUS_ERROR if any disassembly"]
#[doc = " fails."]
#[doc = ""]
#[doc = " Return @p AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT"]
#[doc = " if isa name is not set in @p info and does not match the isa name"]
#[doc = " of all relocatable data objects in @p input."]
#[doc = " Disassemble each relocatable data object in @p input in\n order. For each successful disassembly add a source data object to\n @p result.\n\n Return @p AMD_COMGR_STATUS_ERROR if any disassembly\n fails.\n\n Return @p AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT\n if isa name is not set in @p info and does not match the isa name\n of all relocatable data objects in @p input."]
pub const AMD_COMGR_ACTION_DISASSEMBLE_RELOCATABLE_TO_SOURCE: amd_comgr_action_kind_s =
amd_comgr_action_kind_s(11);
}
impl amd_comgr_action_kind_s {
#[doc = " Disassemble each executable data object in @p input in order. For"]
#[doc = " each successful disassembly add a source data object to @p result."]
#[doc = ""]
#[doc = " Return @p AMD_COMGR_STATUS_ERROR if any disassembly"]
#[doc = " fails."]
#[doc = ""]
#[doc = " Return @p AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT"]
#[doc = " if isa name is not set in @p info and does not match the isa name"]
#[doc = " of all relocatable data objects in @p input."]
#[doc = " Disassemble each executable data object in @p input in order. For\n each successful disassembly add a source data object to @p result.\n\n Return @p AMD_COMGR_STATUS_ERROR if any disassembly\n fails.\n\n Return @p AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT\n if isa name is not set in @p info and does not match the isa name\n of all relocatable data objects in @p input."]
pub const AMD_COMGR_ACTION_DISASSEMBLE_EXECUTABLE_TO_SOURCE: amd_comgr_action_kind_s =
amd_comgr_action_kind_s(12);
}
impl amd_comgr_action_kind_s {
#[doc = " Disassemble each bytes data object in @p input in order. For each"]
#[doc = " successful disassembly add a source data object to @p"]
#[doc = " result. Only simple assembly language commands are generate that"]
#[doc = " corresponf to raw bytes are supported, not any directives that"]
#[doc = " control the code object layout, or symbolic branch targets or"]
#[doc = " names."]
#[doc = ""]
#[doc = " Return @p AMD_COMGR_STATUS_ERROR if any disassembly"]
#[doc = " fails."]
#[doc = ""]
#[doc = " Return @p AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT"]
#[doc = " if isa name is not set in @p info"]
#[doc = " Disassemble each bytes data object in @p input in order. For each\n successful disassembly add a source data object to @p\n result. Only simple assembly language commands are generate that\n corresponf to raw bytes are supported, not any directives that\n control the code object layout, or symbolic branch targets or\n names.\n\n Return @p AMD_COMGR_STATUS_ERROR if any disassembly\n fails.\n\n Return @p AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT\n if isa name is not set in @p info"]
pub const AMD_COMGR_ACTION_DISASSEMBLE_BYTES_TO_SOURCE: amd_comgr_action_kind_s =
amd_comgr_action_kind_s(13);
}
impl amd_comgr_action_kind_s {
#[doc = " Compile each source data object in @p input in order. For each"]
#[doc = " successful compilation add a fat binary to @p result. Resolve"]
#[doc = " any include source names using the names of include data objects"]
#[doc = " in @p input. Resolve any include relative path names using the"]
#[doc = " working directory path in @p info. Produce fat binary for isa name in @p"]
#[doc = " info. Compile the source for the language in @p info."]
#[doc = ""]
#[doc = " Return @p AMD_COMGR_STATUS_ERROR if any compilation"]
#[doc = " fails."]
#[doc = ""]
#[doc = " Return @p AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT"]
#[doc = " if isa name or language is not set in @p info."]
#[doc = " Compile each source data object in @p input in order. For each\n successful compilation add a fat binary to @p result. Resolve\n any include source names using the names of include data objects\n in @p input. Resolve any include relative path names using the\n working directory path in @p info. Produce fat binary for isa name in @p\n info. Compile the source for the language in @p info.\n\n Return @p AMD_COMGR_STATUS_ERROR if any compilation\n fails.\n\n Return @p AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT\n if isa name or language is not set in @p info.\n\n @deprecated since 2.5\n @see in-process compilation via AMD_COMGR_ACTION_COMPILE_SOURCE_TO_BC, etc.\n insteaad"]
pub const AMD_COMGR_ACTION_COMPILE_SOURCE_TO_FATBIN: amd_comgr_action_kind_s =
amd_comgr_action_kind_s(14);
}
impl amd_comgr_action_kind_s {
#[doc = " Compile each source data object in @p input in order. For each"]
#[doc = " successful compilation add a bc data object to @p result. Resolve"]
#[doc = " any include source names using the names of include data objects"]
#[doc = " in @p input. Resolve any include relative path names using the"]
#[doc = " working directory path in @p info. Produce bc for isa name in @p"]
#[doc = " info. Compile the source for the language in @p info. Link against"]
#[doc = " the device-specific and language-specific bitcode device libraries"]
#[doc = " required for compilation."]
#[doc = ""]
#[doc = " Return @p AMD_COMGR_STATUS_ERROR if any compilation"]
#[doc = " fails."]
#[doc = ""]
#[doc = " Return @p AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT"]
#[doc = " if isa name or language is not set in @p info."]
#[doc = " Compile each source data object in @p input in order. For each\n successful compilation add a bc data object to @p result. Resolve\n any include source names using the names of include data objects\n in @p input. Resolve any include relative path names using the\n working directory path in @p info. Produce bc for isa name in @p\n info. Compile the source for the language in @p info. Link against\n the device-specific and language-specific bitcode device libraries\n required for compilation.\n\n Return @p AMD_COMGR_STATUS_ERROR if any compilation\n fails.\n\n Return @p AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT\n if isa name or language is not set in @p info."]
pub const AMD_COMGR_ACTION_COMPILE_SOURCE_WITH_DEVICE_LIBS_TO_BC: amd_comgr_action_kind_s =
amd_comgr_action_kind_s(15);
}
impl amd_comgr_action_kind_s {
#[doc = " Compile a single source data object in @p input in order. For each\n successful compilation add a relocatable data object to @p result.\n Resolve any include source names using the names of include data objects\n in @p input. Resolve any include relative path names using the\n working directory path in @p info. Produce relocatable for hip name in @p\n info. Compile the source for the language in @p info. Link against\n the device-specific and language-specific bitcode device libraries\n required for compilation. Currently only supports HIP language.\n\n Return @p AMD_COMGR_STATUS_ERROR if any compilation\n fails.\n\n Return @p AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT\n if isa name or language is not set in @p info."]
pub const AMD_COMGR_ACTION_COMPILE_SOURCE_TO_RELOCATABLE: amd_comgr_action_kind_s =
amd_comgr_action_kind_s(16);
}
impl amd_comgr_action_kind_s {
#[doc = " Compile each source data object in @p input and create a single executabele\n in @p result. Resolve any include source names using the names of include\n data objects in @p input. Resolve any include relative path names using the\n working directory path in @p info. Produce executable for isa name in @p\n info. Compile the source for the language in @p info. Link against\n the device-specific and language-specific bitcode device libraries\n required for compilation.\n\n Return @p AMD_COMGR_STATUS_ERROR if any compilation\n fails.\n\n Return @p AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT\n if isa name or language is not set in @p info."]
pub const AMD_COMGR_ACTION_COMPILE_SOURCE_TO_EXECUTABLE: amd_comgr_action_kind_s =
amd_comgr_action_kind_s(17);
}
impl amd_comgr_action_kind_s {
#[doc = " Marker for last valid action kind."]
pub const AMD_COMGR_ACTION_LAST: amd_comgr_action_kind_s = amd_comgr_action_kind_s(15);
pub const AMD_COMGR_ACTION_LAST: amd_comgr_action_kind_s = amd_comgr_action_kind_s(17);
}
#[repr(transparent)]
#[doc = " @brief The kinds of actions that can be performed."]
#[derive(Copy, Clone, Hash, PartialEq, Eq)]
pub struct amd_comgr_action_kind_s(pub ::std::os::raw::c_uint);
pub struct amd_comgr_action_kind_s(pub ::std::os::raw::c_int);
#[doc = " @brief The kinds of actions that can be performed."]
pub use self::amd_comgr_action_kind_s as amd_comgr_action_kind_t;
extern crate libloading;
@ -440,11 +268,6 @@ pub struct LibComgr {
size: *mut usize,
bytes: *mut ::std::os::raw::c_char,
) -> amd_comgr_status_t,
pub amd_comgr_get_data_name: unsafe extern "C" fn(
data: amd_comgr_data_t,
size: *mut usize,
name: *mut ::std::os::raw::c_char,
) -> amd_comgr_status_t,
pub amd_comgr_create_data_set:
unsafe extern "C" fn(data_set: *mut amd_comgr_data_set_t) -> amd_comgr_status_t,
pub amd_comgr_destroy_data_set:
@ -503,9 +326,6 @@ impl LibComgr {
.get(b"amd_comgr_set_data_name\0")
.map(|sym| *sym)?;
let amd_comgr_get_data = __library.get(b"amd_comgr_get_data\0").map(|sym| *sym)?;
let amd_comgr_get_data_name = __library
.get(b"amd_comgr_get_data_name\0")
.map(|sym| *sym)?;
let amd_comgr_create_data_set = __library
.get(b"amd_comgr_create_data_set\0")
.map(|sym| *sym)?;
@ -539,7 +359,6 @@ impl LibComgr {
amd_comgr_set_data,
amd_comgr_set_data_name,
amd_comgr_get_data,
amd_comgr_get_data_name,
amd_comgr_create_data_set,
amd_comgr_destroy_data_set,
amd_comgr_data_set_add,
@ -553,27 +372,7 @@ impl LibComgr {
})
}
#[must_use]
#[doc = " @brief Create a data object that can hold data of a specified kind."]
#[doc = ""]
#[doc = " Data objects are reference counted and are destroyed when the"]
#[doc = " reference count reaches 0. When a data object is created its"]
#[doc = " reference count is 1, it has 0 bytes of data, it has an empty name,"]
#[doc = " and it has no metadata."]
#[doc = ""]
#[doc = " @param[in] kind The kind of data the object is intended to hold."]
#[doc = ""]
#[doc = " @param[out] data A handle to the data object created. Its reference"]
#[doc = " count is set to 1."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_SUCCESS The function has"]
#[doc = " been executed successfully."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p"]
#[doc = " kind is an invalid data kind, or @p"]
#[doc = " AMD_COMGR_DATA_KIND_UNDEF. @p data is NULL."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES"]
#[doc = " Unable to create the data object as out of resources."]
#[doc = " @brief Create a data object that can hold data of a specified kind.\n\n Data objects are reference counted and are destroyed when the\n reference count reaches 0. When a data object is created its\n reference count is 1, it has 0 bytes of data, it has an empty name,\n and it has no metadata.\n\n @param[in] kind The kind of data the object is intended to hold.\n\n @param[out] data A handle to the data object created. Its reference\n count is set to 1.\n\n @retval ::AMD_COMGR_STATUS_SUCCESS The function has\n been executed successfully.\n\n @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p\n kind is an invalid data kind, or @p\n AMD_COMGR_DATA_KIND_UNDEF. @p data is NULL.\n\n @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES\n Unable to create the data object as out of resources."]
pub unsafe fn amd_comgr_create_data(
&self,
kind: amd_comgr_data_kind_t,
@ -582,49 +381,12 @@ impl LibComgr {
(self.amd_comgr_create_data)(kind, data)
}
#[must_use]
#[doc = " @brief Indicate that no longer using a data object handle."]
#[doc = ""]
#[doc = " The reference count of the associated data object is"]
#[doc = " decremented. If it reaches 0 it is destroyed."]
#[doc = ""]
#[doc = " @param[in] data The data object to release."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_SUCCESS The function has"]
#[doc = " been executed successfully."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p"]
#[doc = " data is an invalid data object, or has kind @p"]
#[doc = " AMD_COMGR_DATA_KIND_UNDEF."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES"]
#[doc = " Unable to update the data object as out of resources."]
#[doc = " @brief Indicate that no longer using a data object handle.\n\n The reference count of the associated data object is\n decremented. If it reaches 0 it is destroyed.\n\n @param[in] data The data object to release.\n\n @retval ::AMD_COMGR_STATUS_SUCCESS The function has\n been executed successfully.\n\n @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p\n data is an invalid data object, or has kind @p\n AMD_COMGR_DATA_KIND_UNDEF.\n\n @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES\n Unable to update the data object as out of resources."]
pub unsafe fn amd_comgr_release_data(&self, data: amd_comgr_data_t) -> amd_comgr_status_t {
(self.amd_comgr_release_data)(data)
}
#[must_use]
#[doc = " @brief Set the data content of a data object to the specified"]
#[doc = " bytes."]
#[doc = ""]
#[doc = " Any previous value of the data object is overwritten. Any metadata"]
#[doc = " associated with the data object is also replaced which invalidates"]
#[doc = " all metadata handles to the old metadata."]
#[doc = ""]
#[doc = " @param[in] data The data object to update."]
#[doc = ""]
#[doc = " @param[in] size The number of bytes in the data specified by @p bytes."]
#[doc = ""]
#[doc = " @param[in] bytes The bytes to set the data object to. The bytes are"]
#[doc = " copied into the data object and can be freed after the call."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_SUCCESS The function has"]
#[doc = " been executed successfully."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p"]
#[doc = " data is an invalid data object, or has kind @p"]
#[doc = " AMD_COMGR_DATA_KIND_UNDEF."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES"]
#[doc = " Unable to update the data object as out of resources."]
#[doc = " @brief Set the data content of a data object to the specified\n bytes.\n\n Any previous value of the data object is overwritten. Any metadata\n associated with the data object is also replaced which invalidates\n all metadata handles to the old metadata.\n\n @param[in] data The data object to update.\n\n @param[in] size The number of bytes in the data specified by @p bytes.\n\n @param[in] bytes The bytes to set the data object to. The bytes are\n copied into the data object and can be freed after the call.\n\n @retval ::AMD_COMGR_STATUS_SUCCESS The function has\n been executed successfully.\n\n @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p\n data is an invalid data object, or has kind @p\n AMD_COMGR_DATA_KIND_UNDEF.\n\n @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES\n Unable to update the data object as out of resources."]
pub unsafe fn amd_comgr_set_data(
&self,
data: amd_comgr_data_t,
@ -634,28 +396,7 @@ impl LibComgr {
(self.amd_comgr_set_data)(data, size, bytes)
}
#[must_use]
#[doc = " @brief Set the name associated with a data object."]
#[doc = ""]
#[doc = " When compiling, the fle name of an include directive is used to"]
#[doc = " reference the contents of the include data object with the same"]
#[doc = " name. The name may also be used for other data objects in log and"]
#[doc = " diagnostic output."]
#[doc = ""]
#[doc = " @param[in] data The data object to update."]
#[doc = ""]
#[doc = " @param[in] name A null terminated string that specifies the name to"]
#[doc = " use for the data object. If NULL then the name is set to the empty"]
#[doc = " string."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_SUCCESS The function has"]
#[doc = " been executed successfully."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p"]
#[doc = " data is an invalid data object, or has kind @p"]
#[doc = " AMD_COMGR_DATA_KIND_UNDEF."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES"]
#[doc = " Unable to update the data object as out of resources."]
#[doc = " @brief Set the name associated with a data object.\n\n When compiling, the full name of an include directive is used to\n reference the contents of the include data object with the same\n name. The name may also be used for other data objects in log and\n diagnostic output.\n\n @param[in] data The data object to update.\n\n @param[in] name A null terminated string that specifies the name to\n use for the data object. If NULL then the name is set to the empty\n string.\n\n @retval ::AMD_COMGR_STATUS_SUCCESS The function has\n been executed successfully.\n\n @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p\n data is an invalid data object, or has kind @p\n AMD_COMGR_DATA_KIND_UNDEF.\n\n @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES\n Unable to update the data object as out of resources."]
pub unsafe fn amd_comgr_set_data_name(
&self,
data: amd_comgr_data_t,
@ -664,28 +405,7 @@ impl LibComgr {
(self.amd_comgr_set_data_name)(data, name)
}
#[must_use]
#[doc = " @brief Get the data contents, and/or the size of the data"]
#[doc = " associated with a data object."]
#[doc = ""]
#[doc = " @param[in] data The data object to query."]
#[doc = ""]
#[doc = " @param[in, out] size On entry, the size of @p bytes. On return, if @p bytes"]
#[doc = " is NULL, set to the size of the data object contents."]
#[doc = ""]
#[doc = " @param[out] bytes If not NULL, then the first @p size bytes of the"]
#[doc = " data object contents is copied. If NULL, no data is copied, and"]
#[doc = " only @p size is updated (useful in order to find the size of buffer"]
#[doc = " required to copy the data)."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_SUCCESS The function has"]
#[doc = " been executed successfully."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p"]
#[doc = " data is an invalid data object, or has kind @p"]
#[doc = " AMD_COMGR_DATA_KIND_UNDEF. @p size is NULL."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES"]
#[doc = " Unable to update the data object as out of resources."]
#[doc = " @brief Get the data contents, and/or the size of the data\n associated with a data object.\n\n @param[in] data The data object to query.\n\n @param[in, out] size On entry, the size of @p bytes. On return, if @p bytes\n is NULL, set to the size of the data object contents.\n\n @param[out] bytes If not NULL, then the first @p size bytes of the\n data object contents is copied. If NULL, no data is copied, and\n only @p size is updated (useful in order to find the size of buffer\n required to copy the data).\n\n @retval ::AMD_COMGR_STATUS_SUCCESS The function has\n been executed successfully.\n\n @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p\n data is an invalid data object, or has kind @p\n AMD_COMGR_DATA_KIND_UNDEF. @p size is NULL.\n\n @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES\n Unable to update the data object as out of resources."]
pub unsafe fn amd_comgr_get_data(
&self,
data: amd_comgr_data_t,
@ -695,47 +415,7 @@ impl LibComgr {
(self.amd_comgr_get_data)(data, size, bytes)
}
#[must_use]
#[doc = " @brief Get the data object name and/or name length."]
#[doc = ""]
#[doc = " @param[in] data The data object to query."]
#[doc = ""]
#[doc = " @param[in, out] size On entry, the size of @p name. On return, the size of"]
#[doc = " the data object name including the terminating null character."]
#[doc = ""]
#[doc = " @param[out] name If not NULL, then the first @p size characters of the"]
#[doc = " data object name are copied. If @p name is NULL, only @p size is updated"]
#[doc = " (useful in order to find the size of buffer required to copy the name)."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_SUCCESS The function has"]
#[doc = " been executed successfully."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p"]
#[doc = " data is an invalid data object, or has kind @p"]
#[doc = " AMD_COMGR_DATA_KIND_UNDEF. @p size is NULL."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES"]
#[doc = " Unable to update the data object as out of resources."]
pub unsafe fn amd_comgr_get_data_name(
&self,
data: amd_comgr_data_t,
size: *mut usize,
name: *mut ::std::os::raw::c_char,
) -> amd_comgr_status_t {
(self.amd_comgr_get_data_name)(data, size, name)
}
#[must_use]
#[doc = " @brief Create a data set object."]
#[doc = ""]
#[doc = " @param[out] data_set A handle to the data set created. Initially it"]
#[doc = " contains no data objects."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_SUCCESS The function has been executed"]
#[doc = " successfully."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p data_set is NULL."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES Unable to create the data"]
#[doc = " set object as out of resources."]
#[doc = " @brief Create a data set object.\n\n @param[out] data_set A handle to the data set created. Initially it\n contains no data objects.\n\n @retval ::AMD_COMGR_STATUS_SUCCESS The function has been executed\n successfully.\n\n @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p data_set is NULL.\n\n @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES Unable to create the data\n set object as out of resources."]
pub unsafe fn amd_comgr_create_data_set(
&self,
data_set: *mut amd_comgr_data_set_t,
@ -743,21 +423,7 @@ impl LibComgr {
(self.amd_comgr_create_data_set)(data_set)
}
#[must_use]
#[doc = " @brief Destroy a data set object."]
#[doc = ""]
#[doc = " The reference counts of any associated data objects are decremented. Any"]
#[doc = " handles to the data set object become invalid."]
#[doc = ""]
#[doc = " @param[in] data_set A handle to the data set object to destroy."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_SUCCESS The function has been executed"]
#[doc = " successfully."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p data_set is an invalid"]
#[doc = " data set object."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES Unable to update data set"]
#[doc = " object as out of resources."]
#[doc = " @brief Destroy a data set object.\n\n The reference counts of any associated data objects are decremented. Any\n handles to the data set object become invalid.\n\n @param[in] data_set A handle to the data set object to destroy.\n\n @retval ::AMD_COMGR_STATUS_SUCCESS The function has been executed\n successfully.\n\n @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p data_set is an invalid\n data set object.\n\n @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES Unable to update data set\n object as out of resources."]
pub unsafe fn amd_comgr_destroy_data_set(
&self,
data_set: amd_comgr_data_set_t,
@ -765,25 +431,7 @@ impl LibComgr {
(self.amd_comgr_destroy_data_set)(data_set)
}
#[must_use]
#[doc = " @brief Add a data object to a data set object if it is not already added."]
#[doc = ""]
#[doc = " The reference count of the data object is incremented."]
#[doc = ""]
#[doc = " @param[in] data_set A handle to the data set object to be updated."]
#[doc = ""]
#[doc = " @param[in] data A handle to the data object to be added. If @p data_set"]
#[doc = " already has the specified handle present, then it is not added. The order"]
#[doc = " that data objects are added is preserved."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_SUCCESS The function has been executed"]
#[doc = " successfully."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p data_set is an invalid"]
#[doc = " data set object. @p data is an invalid data object; has undef kind; has"]
#[doc = " include kind but does not have a name."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES Unable to update data set"]
#[doc = " object as out of resources."]
#[doc = " @brief Add a data object to a data set object if it is not already added.\n\n The reference count of the data object is incremented.\n\n @param[in] data_set A handle to the data set object to be updated.\n\n @param[in] data A handle to the data object to be added. If @p data_set\n already has the specified handle present, then it is not added. The order\n that data objects are added is preserved.\n\n @retval ::AMD_COMGR_STATUS_SUCCESS The function has been executed\n successfully.\n\n @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p data_set is an invalid\n data set object. @p data is an invalid data object; has undef kind; has\n include kind but does not have a name.\n\n @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES Unable to update data set\n object as out of resources."]
pub unsafe fn amd_comgr_data_set_add(
&self,
data_set: amd_comgr_data_set_t,
@ -792,31 +440,7 @@ impl LibComgr {
(self.amd_comgr_data_set_add)(data_set, data)
}
#[must_use]
#[doc = " @brief Return the Nth data object of a specified data kind that is added to a"]
#[doc = " data set object."]
#[doc = ""]
#[doc = " The reference count of the returned data object is incremented."]
#[doc = ""]
#[doc = " @param[in] data_set A handle to the data set object to be queried."]
#[doc = ""]
#[doc = " @param[in] data_kind The data kind of the data object to be returned."]
#[doc = ""]
#[doc = " @param[in] index The index of the data object of data kind @data_kind to be"]
#[doc = " returned. The first data object is index 0. The order of data objects matches"]
#[doc = " the order that they were added to the data set object."]
#[doc = ""]
#[doc = " @param[out] data The data object being requested."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_SUCCESS The function has been executed"]
#[doc = " successfully."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p data_set is an invalid"]
#[doc = " data set object. @p data_kind is an invalid data kind or @p"]
#[doc = " AMD_COMGR_DATA_KIND_UNDEF. @p index is greater than the number of data"]
#[doc = " objects of kind @p data_kind. @p data is NULL."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES Unable to query data set"]
#[doc = " object as out of resources."]
#[doc = " @brief Return the Nth data object of a specified data kind that is added to a\n data set object.\n\n The reference count of the returned data object is incremented.\n\n @param[in] data_set A handle to the data set object to be queried.\n\n @param[in] data_kind The data kind of the data object to be returned.\n\n @param[in] index The index of the data object of data kind @data_kind to be\n returned. The first data object is index 0. The order of data objects matches\n the order that they were added to the data set object.\n\n @param[out] data The data object being requested.\n\n @retval ::AMD_COMGR_STATUS_SUCCESS The function has been executed\n successfully.\n\n @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p data_set is an invalid\n data set object. @p data_kind is an invalid data kind or @p\n AMD_COMGR_DATA_KIND_UNDEF. @p index is greater than the number of data\n objects of kind @p data_kind. @p data is NULL.\n\n @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES Unable to query data set\n object as out of resources."]
pub unsafe fn amd_comgr_action_data_get_data(
&self,
data_set: amd_comgr_data_set_t,
@ -827,18 +451,7 @@ impl LibComgr {
(self.amd_comgr_action_data_get_data)(data_set, data_kind, index, data)
}
#[must_use]
#[doc = " @brief Create an action info object."]
#[doc = ""]
#[doc = " @param[out] action_info A handle to the action info object created."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_SUCCESS The function has"]
#[doc = " been executed successfully."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p"]
#[doc = " action_info is NULL."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES"]
#[doc = " Unable to create the action info object as out of resources."]
#[doc = " @brief Create an action info object.\n\n @param[out] action_info A handle to the action info object created.\n\n @retval ::AMD_COMGR_STATUS_SUCCESS The function has\n been executed successfully.\n\n @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p\n action_info is NULL.\n\n @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES\n Unable to create the action info object as out of resources."]
pub unsafe fn amd_comgr_create_action_info(
&self,
action_info: *mut amd_comgr_action_info_t,
@ -846,18 +459,7 @@ impl LibComgr {
(self.amd_comgr_create_action_info)(action_info)
}
#[must_use]
#[doc = " @brief Destroy an action info object."]
#[doc = ""]
#[doc = " @param[in] action_info A handle to the action info object to destroy."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_SUCCESS The function has"]
#[doc = " been executed successfully."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p"]
#[doc = " action_info is an invalid action info object."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES"]
#[doc = " Unable to update action info object as out of resources."]
#[doc = " @brief Destroy an action info object.\n\n @param[in] action_info A handle to the action info object to destroy.\n\n @retval ::AMD_COMGR_STATUS_SUCCESS The function has\n been executed successfully.\n\n @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p\n action_info is an invalid action info object.\n\n @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES\n Unable to update action info object as out of resources."]
pub unsafe fn amd_comgr_destroy_action_info(
&self,
action_info: amd_comgr_action_info_t,
@ -865,30 +467,7 @@ impl LibComgr {
(self.amd_comgr_destroy_action_info)(action_info)
}
#[must_use]
#[doc = " @brief Set the isa name of an action info object."]
#[doc = ""]
#[doc = " When an action info object is created it has no isa name. Some"]
#[doc = " actions require that the action info object has an isa name"]
#[doc = " defined."]
#[doc = ""]
#[doc = " @param[in] action_info A handle to the action info object to be"]
#[doc = " updated."]
#[doc = ""]
#[doc = " @param[in] isa_name A null terminated string that is the isa name. If NULL"]
#[doc = " or the empty string then the isa name is cleared. The isa name is defined as"]
#[doc = " the Code Object Target Identification string, described at"]
#[doc = " https://llvm.org/docs/AMDGPUUsage.html#code-object-target-identification"]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_SUCCESS The function has"]
#[doc = " been executed successfully."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p"]
#[doc = " action_info is an invalid action info object. @p isa_name is not an"]
#[doc = " isa name supported by this version of the code object manager"]
#[doc = " library."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES"]
#[doc = " Unable to update action info object as out of resources."]
#[doc = " @brief Set the isa name of an action info object.\n\n When an action info object is created it has no isa name. Some\n actions require that the action info object has an isa name\n defined.\n\n @param[in] action_info A handle to the action info object to be\n updated.\n\n @param[in] isa_name A null terminated string that is the isa name. If NULL\n or the empty string then the isa name is cleared. The isa name is defined as\n the Code Object Target Identification string, described at\n https://llvm.org/docs/AMDGPUUsage.html#code-object-target-identification\n\n @retval ::AMD_COMGR_STATUS_SUCCESS The function has\n been executed successfully.\n\n @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p\n action_info is an invalid action info object. @p isa_name is not an\n isa name supported by this version of the code object manager\n library.\n\n @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES\n Unable to update action info object as out of resources."]
pub unsafe fn amd_comgr_action_info_set_isa_name(
&self,
action_info: amd_comgr_action_info_t,
@ -897,28 +476,7 @@ impl LibComgr {
(self.amd_comgr_action_info_set_isa_name)(action_info, isa_name)
}
#[must_use]
#[doc = " @brief Set the source language of an action info object."]
#[doc = ""]
#[doc = " When an action info object is created it has no language defined"]
#[doc = " which is represented by @p"]
#[doc = " AMD_COMGR_LANGUAGE_NONE. Some actions require that"]
#[doc = " the action info object has a source language defined."]
#[doc = ""]
#[doc = " @param[in] action_info A handle to the action info object to be"]
#[doc = " updated."]
#[doc = ""]
#[doc = " @param[in] language The language to set. If @p"]
#[doc = " AMD_COMGR_LANGUAGE_NONE then the language is cleared."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_SUCCESS The function has"]
#[doc = " been executed successfully."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p"]
#[doc = " action_info is an invalid action info object. @p language is an"]
#[doc = " invalid language."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES"]
#[doc = " Unable to update action info object as out of resources."]
#[doc = " @brief Set the source language of an action info object.\n\n When an action info object is created it has no language defined\n which is represented by @p\n AMD_COMGR_LANGUAGE_NONE. Some actions require that\n the action info object has a source language defined.\n\n @param[in] action_info A handle to the action info object to be\n updated.\n\n @param[in] language The language to set. If @p\n AMD_COMGR_LANGUAGE_NONE then the language is cleared.\n\n @retval ::AMD_COMGR_STATUS_SUCCESS The function has\n been executed successfully.\n\n @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p\n action_info is an invalid action info object. @p language is an\n invalid language.\n\n @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES\n Unable to update action info object as out of resources."]
pub unsafe fn amd_comgr_action_info_set_language(
&self,
action_info: amd_comgr_action_info_t,
@ -927,31 +485,7 @@ impl LibComgr {
(self.amd_comgr_action_info_set_language)(action_info, language)
}
#[must_use]
#[doc = " @brief Set the options array of an action info object."]
#[doc = ""]
#[doc = " This overrides any option strings or arrays previously set by calls to this"]
#[doc = " function or @p amd_comgr_action_info_set_options."]
#[doc = ""]
#[doc = " An @p action_info object which had its options set with this function can"]
#[doc = " only have its option inspected with @p"]
#[doc = " amd_comgr_action_info_get_option_list_count and @p"]
#[doc = " amd_comgr_action_info_get_option_list_item."]
#[doc = ""]
#[doc = " @param[in] action_info A handle to the action info object to be updated."]
#[doc = ""]
#[doc = " @param[in] options An array of null terminated strings. May be NULL if @p"]
#[doc = " count is zero, which will result in an empty options array."]
#[doc = ""]
#[doc = " @param[in] count The number of null terminated strings in @p options."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_SUCCESS The function has been executed"]
#[doc = " successfully."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p action_info is an"]
#[doc = " invalid action info object, or @p options is NULL and @p count is non-zero."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES Unable to update action"]
#[doc = " info object as out of resources."]
#[doc = " @brief Set the options array of an action info object.\n\n This overrides any option strings or arrays previously set by calls to this\n function or @p amd_comgr_action_info_set_options.\n\n An @p action_info object which had its options set with this function can\n only have its option inspected with @p\n amd_comgr_action_info_get_option_list_count and @p\n amd_comgr_action_info_get_option_list_item.\n\n @param[in] action_info A handle to the action info object to be updated.\n\n @param[in] options An array of null terminated strings. May be NULL if @p\n count is zero, which will result in an empty options array.\n\n @param[in] count The number of null terminated strings in @p options.\n\n @retval ::AMD_COMGR_STATUS_SUCCESS The function has been executed\n successfully.\n\n @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p action_info is an\n invalid action info object, or @p options is NULL and @p count is non-zero.\n\n @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES Unable to update action\n info object as out of resources."]
pub unsafe fn amd_comgr_action_info_set_option_list(
&self,
action_info: amd_comgr_action_info_t,
@ -961,37 +495,7 @@ impl LibComgr {
(self.amd_comgr_action_info_set_option_list)(action_info, options, count)
}
#[must_use]
#[doc = " @brief Perform an action."]
#[doc = ""]
#[doc = " Each action ignores any data objects in @p input that it does not"]
#[doc = " use. If logging is enabled in @info then @p result will have a log"]
#[doc = " data object added. Any diagnostic data objects produced by the"]
#[doc = " action will be added to @p result. See the description of each"]
#[doc = " action in @p amd_comgr_action_kind_t."]
#[doc = ""]
#[doc = " @param[in] kind The action to perform."]
#[doc = ""]
#[doc = " @param[in] info The action info to use when performing the action."]
#[doc = ""]
#[doc = " @param[in] input The input data objects to the @p kind action."]
#[doc = ""]
#[doc = " @param[out] result Any data objects are removed before performing"]
#[doc = " the action which then adds all data objects produced by the action."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_SUCCESS The function has"]
#[doc = " been executed successfully."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_ERROR An error was"]
#[doc = " reported when executing the action."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p"]
#[doc = " kind is an invalid action kind. @p input_data or @p result_data are"]
#[doc = " invalid action data object handles. See the description of each"]
#[doc = " action in @p amd_comgr_action_kind_t for other"]
#[doc = " conditions that result in this status."]
#[doc = ""]
#[doc = " @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES"]
#[doc = " Unable to update the data object as out of resources."]
#[doc = " @brief Perform an action.\n\n Each action ignores any data objects in @p input that it does not\n use. If logging is enabled in @info then @p result will have a log\n data object added. Any diagnostic data objects produced by the\n action will be added to @p result. See the description of each\n action in @p amd_comgr_action_kind_t.\n\n @param[in] kind The action to perform.\n\n @param[in] info The action info to use when performing the action.\n\n @param[in] input The input data objects to the @p kind action.\n\n @param[out] result Any data objects are removed before performing\n the action which then adds all data objects produced by the action.\n\n @retval ::AMD_COMGR_STATUS_SUCCESS The function has\n been executed successfully.\n\n @retval ::AMD_COMGR_STATUS_ERROR An error was\n reported when executing the action.\n\n @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p\n kind is an invalid action kind. @p input_data or @p result_data are\n invalid action data object handles. See the description of each\n action in @p amd_comgr_action_kind_t for other\n conditions that result in this status.\n\n @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES\n Unable to update the data object as out of resources."]
pub unsafe fn amd_comgr_do_action(
&self,
kind: amd_comgr_action_kind_t,

View file

@ -60,7 +60,7 @@ impl Comgr {
#[cfg(windows)]
unsafe fn load_library() -> std::result::Result<LibComgr, libloading::Error> {
LibComgr::new("amd_comgr.dll")
LibComgr::new("amd_comgr_2.dll")
}
#[cfg(not(windows))]

View file

@ -76,7 +76,7 @@ pub enum CompilationMode {
impl CompilationMode {
pub unsafe fn from_device(device: i32) -> Result<CompilationMode, hipError_t> {
let mut device_props = mem::zeroed();
hip! { hipGetDeviceProperties(&mut device_props, device) };
hip! { hipGetDevicePropertiesR0600(&mut device_props, device) };
if device_props.warpSize == 32 {
Ok(CompilationMode::Wave32)
} else {
@ -96,7 +96,7 @@ impl CompilationMode {
pub unsafe fn comgr_isa(device: i32) -> Result<CString, hipError_t> {
let mut device_props = mem::zeroed();
hip! { hipGetDeviceProperties(&mut device_props, device) };
hip! { hipGetDevicePropertiesR0600(&mut device_props, device) };
let gcn_arch = CStr::from_ptr(device_props.gcnArchName.as_ptr() as _);
let mut arch_name = b"amdgcn-amd-amdhsa--".to_vec();
arch_name.extend_from_slice(gcn_arch.to_bytes_with_nul());

View file

@ -1 +1 @@
bindgen include/hip_runtime_api.h -o src/hip_runtime_api.rs --no-layout-tests --size_t-is-usize --default-enum-style=newtype --whitelist-function "hip.*" --whitelist-type "hip.*" --no-derive-debug --must-use-type hipError_t --new-type-alias "^hipDeviceptr_t$" --whitelist-var "^hip.*$" -- -I/opt/rocm/include -D__HIP_PLATFORM_AMD__
bindgen $Env:HIP_PATH/include/hip/hip_runtime_api.h -o src/hip_runtime_api.rs --no-layout-tests --default-enum-style=newtype --allowlist-function "hip.*" --allowlist-type "hip.*" --no-derive-debug --must-use-type hipError_t --new-type-alias "^hipDeviceptr_t$" --allowlist-var "^hip.*$" -- -I"$Env:HIP_PATH/include" -D__HIP_PLATFORM_AMD__

View file

@ -6,7 +6,7 @@ fn main() -> Result<(), VarError> {
if cfg!(windows) {
let env = env::var("CARGO_CFG_TARGET_ENV")?;
if env == "msvc" {
let mut path = PathBuf::from(env::var("CARGO_MANIFEST_DIR")?);
let mut path = PathBuf::from(env::var("HIP_PATH")?);
path.push("lib");
println!("cargo:rustc-link-search=native={}", path.display());
} else {

View file

@ -1,561 +0,0 @@
;
; Definition file of amdhip64.dll
; Automatic generated by gendef
; written by Kai Tietz 2008
;
LIBRARY "amdhip64.dll"
EXPORTS
hipCreateSurfaceObject
hipDestroySurfaceObject
hipExtModuleLaunchKernel
hipHccModuleLaunchKernel
hipModuleLaunchKernelExt
hipTexRefGetArray
hipTexRefGetBorderColor
hipTexRefGetMipmappedArray
AMD_CPU_AFFINITY DATA
AMD_DIRECT_DISPATCH DATA
AMD_GPU_FORCE_SINGLE_FP_DENORM DATA
AMD_LOG_LEVEL DATA
AMD_LOG_LEVEL_FILE DATA
AMD_LOG_MASK DATA
AMD_OCL_BUILD_OPTIONS DATA
AMD_OCL_BUILD_OPTIONS_APPEND DATA
AMD_OCL_LINK_OPTIONS DATA
AMD_OCL_LINK_OPTIONS_APPEND DATA
AMD_OCL_SC_LIB DATA
AMD_OCL_WAIT_COMMAND DATA
AMD_OPT_FLUSH DATA
AMD_SERIALIZE_COPY DATA
AMD_SERIALIZE_KERNEL DATA
AMD_THREAD_TRACE_ENABLE DATA
CL_KHR_FP64 DATA
CQ_THREAD_STACK_SIZE DATA
CUDA_VISIBLE_DEVICES DATA
DISABLE_DEFERRED_ALLOC DATA
GPU_ADD_HBCC_SIZE DATA
GPU_ANALYZE_HANG DATA
GPU_BLIT_ENGINE_TYPE DATA
GPU_CP_DMA_COPY_SIZE DATA
GPU_DEVICE_ORDINAL DATA
GPU_DUMP_BLIT_KERNELS DATA
GPU_DUMP_CODE_OBJECT DATA
GPU_ENABLE_COOP_GROUPS DATA
GPU_ENABLE_HW_P2P DATA
GPU_ENABLE_LARGE_ALLOCATION DATA
GPU_ENABLE_LC DATA
GPU_ENABLE_PAL DATA
GPU_ENABLE_WAVE32_MODE DATA
GPU_ENABLE_WGP_MODE DATA
GPU_FLUSH_ON_EXECUTION DATA
GPU_FORCE_64BIT_PTR DATA
GPU_FORCE_BLIT_COPY_SIZE DATA
GPU_FORCE_OCL20_32BIT DATA
GPU_FORCE_QUEUE_PROFILING DATA
GPU_IFH_MODE DATA
GPU_IMAGE_BUFFER_WAR DATA
GPU_IMAGE_DMA DATA
GPU_MAX_COMMAND_BUFFERS DATA
GPU_MAX_COMMAND_QUEUES DATA
GPU_MAX_HEAP_SIZE DATA
GPU_MAX_HW_QUEUES DATA
GPU_MAX_REMOTE_MEM_SIZE DATA
GPU_MAX_SUBALLOC_SIZE DATA
GPU_MAX_USWC_ALLOC_SIZE DATA
GPU_MAX_WORKGROUP_SIZE DATA
GPU_MAX_WORKGROUP_SIZE_2D_X DATA
GPU_MAX_WORKGROUP_SIZE_2D_Y DATA
GPU_MAX_WORKGROUP_SIZE_3D_X DATA
GPU_MAX_WORKGROUP_SIZE_3D_Y DATA
GPU_MAX_WORKGROUP_SIZE_3D_Z DATA
GPU_MIPMAP DATA
GPU_NUM_COMPUTE_RINGS DATA
GPU_NUM_MEM_DEPENDENCY DATA
GPU_PINNED_MIN_XFER_SIZE DATA
GPU_PINNED_XFER_SIZE DATA
GPU_PRINT_CHILD_KERNEL DATA
GPU_RAW_TIMESTAMP DATA
GPU_RESOURCE_CACHE_SIZE DATA
GPU_SELECT_COMPUTE_RINGS_ID DATA
GPU_SINGLE_ALLOC_PERCENT DATA
GPU_STAGING_BUFFER_SIZE DATA
GPU_STREAMOPS_CP_WAIT DATA
GPU_USE_DEVICE_QUEUE DATA
GPU_USE_SINGLE_SCRATCH DATA
GPU_USE_SYNC_OBJECTS DATA
GPU_WAVES_PER_SIMD DATA
GPU_WAVE_LIMIT_ENABLE DATA
GPU_WORKLOAD_SPLIT DATA
GPU_XFER_BUFFER_SIZE DATA
HIPRTC_USE_RUNTIME_UNBUNDLER DATA
HIP_FORCE_DEV_KERNARG DATA
HIP_HIDDEN_FREE_MEM DATA
HIP_HOST_COHERENT DATA
HIP_INITIAL_DM_SIZE DATA
HIP_MEM_POOL_SUPPORT DATA
HIP_MEM_POOL_USE_VM DATA
HIP_USE_RUNTIME_UNBUNDLER DATA
HIP_VISIBLE_DEVICES DATA
HSA_ENABLE_COARSE_GRAIN_SVM DATA
HSA_KERNARG_POOL_SIZE DATA
HSA_LOCAL_MEMORY_ENABLE DATA
OCL_CODE_CACHE_ENABLE DATA
OCL_CODE_CACHE_RESET DATA
OCL_SET_SVM_SIZE DATA
OCL_STUB_PROGRAMS DATA
OPENCL_VERSION DATA
PAL_ALWAYS_RESIDENT DATA
PAL_DISABLE_SDMA DATA
PAL_EMBED_KERNEL_MD DATA
PAL_FORCE_ASIC_REVISION DATA
PAL_MALL_POLICY DATA
PAL_PREPINNED_MEMORY_SIZE DATA
PAL_RGP_DISP_COUNT DATA
REMOTE_ALLOC DATA
ROC_ACTIVE_WAIT_TIMEOUT DATA
ROC_AQL_QUEUE_SIZE DATA
ROC_CPU_WAIT_FOR_SIGNAL DATA
ROC_ENABLE_LARGE_BAR DATA
ROC_ENABLE_PRE_VEGA DATA
ROC_GLOBAL_CU_MASK DATA
ROC_HMM_FLAGS DATA
ROC_P2P_SDMA_SIZE DATA
ROC_SIGNAL_POOL_SIZE DATA
ROC_SKIP_COPY_SYNC DATA
ROC_SKIP_KERNEL_ARG_COPY DATA
ROC_SYSTEM_SCOPE_SIGNAL DATA
ROC_USE_FGS_KERNARG DATA
__gnu_f2h_ieee
__gnu_h2f_ieee
__hipPopCallConfiguration
__hipPushCallConfiguration
__hipRegisterFatBinary
__hipRegisterFunction
__hipRegisterManagedVar
__hipRegisterSurface
__hipRegisterTexture
__hipRegisterVar
__hipUnregisterFatBinary
amd_dbgapi_get_build_id
amd_dbgapi_get_build_name
amd_dbgapi_get_git_hash
hipApiName
hipArray3DCreate
hipArray3DGetDescriptor
hipArrayCreate
hipArrayDestroy
hipArrayGetDescriptor
hipArrayGetInfo
hipBindTexture
hipBindTexture2D
hipBindTextureToArray
hipBindTextureToMipmappedArray
hipChooseDevice
hipConfigureCall
hipCreateChannelDesc
hipCreateTextureObject
hipCtxCreate
hipCtxDestroy
hipCtxDisablePeerAccess
hipCtxEnablePeerAccess
hipCtxGetApiVersion
hipCtxGetCacheConfig
hipCtxGetCurrent
hipCtxGetDevice
hipCtxGetFlags
hipCtxGetSharedMemConfig
hipCtxPopCurrent
hipCtxPushCurrent
hipCtxSetCacheConfig
hipCtxSetCurrent
hipCtxSetSharedMemConfig
hipCtxSynchronize
hipDestroyExternalMemory
hipDestroyExternalSemaphore
hipDestroyTextureObject
hipDeviceCanAccessPeer
hipDeviceComputeCapability
hipDeviceDisablePeerAccess
hipDeviceEnablePeerAccess
hipDeviceGet
hipDeviceGetAttribute
hipDeviceGetByPCIBusId
hipDeviceGetCacheConfig
hipDeviceGetDefaultMemPool
hipDeviceGetGraphMemAttribute
hipDeviceGetLimit
hipDeviceGetMemPool
hipDeviceGetName
hipDeviceGetP2PAttribute
hipDeviceGetPCIBusId
hipDeviceGetSharedMemConfig
hipDeviceGetStreamPriorityRange
hipDeviceGetUuid
hipDeviceGraphMemTrim
hipDevicePrimaryCtxGetState
hipDevicePrimaryCtxRelease
hipDevicePrimaryCtxReset
hipDevicePrimaryCtxRetain
hipDevicePrimaryCtxSetFlags
hipDeviceReset
hipDeviceSetCacheConfig
hipDeviceSetGraphMemAttribute
hipDeviceSetLimit
hipDeviceSetMemPool
hipDeviceSetSharedMemConfig
hipDeviceSynchronize
hipDeviceTotalMem
hipDriverGetVersion
hipDrvGetErrorName
hipDrvGetErrorString
hipDrvMemcpy2DUnaligned
hipDrvMemcpy3D
hipDrvMemcpy3DAsync
hipDrvPointerGetAttributes
hipEventCreate
hipEventCreateWithFlags
hipEventDestroy
hipEventElapsedTime
hipEventQuery
hipEventRecord
hipEventRecord_spt
hipEventSynchronize
hipExtGetLinkTypeAndHopCount
hipExtLaunchKernel
hipExtLaunchMultiKernelMultiDevice
hipExtMallocWithFlags
hipExtStreamCreateWithCUMask
hipExtStreamGetCUMask
hipExternalMemoryGetMappedBuffer
hipFree
hipFreeArray
hipFreeAsync
hipFreeHost
hipFreeMipmappedArray
hipFuncGetAttribute
hipFuncGetAttributes
hipFuncSetAttribute
hipFuncSetCacheConfig
hipFuncSetSharedMemConfig
hipGLGetDevices
hipGetChannelDesc
hipGetCmdName
hipGetDevice
hipGetDeviceCount
hipGetDeviceFlags
hipGetDeviceProperties
hipGetErrorName
hipGetErrorString
hipGetLastError
hipGetMipmappedArrayLevel
hipGetStreamDeviceId
hipGetSymbolAddress
hipGetSymbolSize
hipGetTextureAlignmentOffset
hipGetTextureObjectResourceDesc
hipGetTextureObjectResourceViewDesc
hipGetTextureObjectTextureDesc
hipGetTextureReference
hipGraphAddChildGraphNode
hipGraphAddDependencies
hipGraphAddEmptyNode
hipGraphAddEventRecordNode
hipGraphAddEventWaitNode
hipGraphAddHostNode
hipGraphAddKernelNode
hipGraphAddMemAllocNode
hipGraphAddMemFreeNode
hipGraphAddMemcpyNode
hipGraphAddMemcpyNode1D
hipGraphAddMemcpyNodeFromSymbol
hipGraphAddMemcpyNodeToSymbol
hipGraphAddMemsetNode
hipGraphChildGraphNodeGetGraph
hipGraphClone
hipGraphCreate
hipGraphDebugDotPrint
hipGraphDestroy
hipGraphDestroyNode
hipGraphEventRecordNodeGetEvent
hipGraphEventRecordNodeSetEvent
hipGraphEventWaitNodeGetEvent
hipGraphEventWaitNodeSetEvent
hipGraphExecChildGraphNodeSetParams
hipGraphExecDestroy
hipGraphExecEventRecordNodeSetEvent
hipGraphExecEventWaitNodeSetEvent
hipGraphExecHostNodeSetParams
hipGraphExecKernelNodeSetParams
hipGraphExecMemcpyNodeSetParams
hipGraphExecMemcpyNodeSetParams1D
hipGraphExecMemcpyNodeSetParamsFromSymbol
hipGraphExecMemcpyNodeSetParamsToSymbol
hipGraphExecMemsetNodeSetParams
hipGraphExecUpdate
hipGraphGetEdges
hipGraphGetNodes
hipGraphGetRootNodes
hipGraphHostNodeGetParams
hipGraphHostNodeSetParams
hipGraphInstantiate
hipGraphInstantiateWithFlags
hipGraphKernelNodeCopyAttributes
hipGraphKernelNodeGetAttribute
hipGraphKernelNodeGetParams
hipGraphKernelNodeSetAttribute
hipGraphKernelNodeSetParams
hipGraphLaunch
hipGraphLaunch_spt
hipGraphMemAllocNodeGetParams
hipGraphMemFreeNodeGetParams
hipGraphMemcpyNodeGetParams
hipGraphMemcpyNodeSetParams
hipGraphMemcpyNodeSetParams1D
hipGraphMemcpyNodeSetParamsFromSymbol
hipGraphMemcpyNodeSetParamsToSymbol
hipGraphMemsetNodeGetParams
hipGraphMemsetNodeSetParams
hipGraphNodeFindInClone
hipGraphNodeGetDependencies
hipGraphNodeGetDependentNodes
hipGraphNodeGetEnabled
hipGraphNodeGetType
hipGraphNodeSetEnabled
hipGraphReleaseUserObject
hipGraphRemoveDependencies
hipGraphRetainUserObject
hipGraphUpload
hipGraphicsGLRegisterBuffer
hipGraphicsGLRegisterImage
hipGraphicsMapResources
hipGraphicsResourceGetMappedPointer
hipGraphicsSubResourceGetMappedArray
hipGraphicsUnmapResources
hipGraphicsUnregisterResource
hipHostAlloc
hipHostFree
hipHostGetDevicePointer
hipHostGetFlags
hipHostMalloc
hipHostRegister
hipHostUnregister
hipImportExternalMemory
hipImportExternalSemaphore
hipInit
hipIpcCloseMemHandle
hipIpcGetEventHandle
hipIpcGetMemHandle
hipIpcOpenEventHandle
hipIpcOpenMemHandle
hipKernelNameRef
hipLaunchByPtr
hipLaunchCooperativeKernel
hipLaunchCooperativeKernelMultiDevice
hipLaunchCooperativeKernel_spt
hipLaunchHostFunc
hipLaunchHostFunc_spt
hipLaunchKernel
hipLaunchKernel_spt
hipMalloc
hipMalloc3D
hipMalloc3DArray
hipMallocArray
hipMallocAsync
hipMallocFromPoolAsync
hipMallocHost
hipMallocManaged
hipMallocMipmappedArray
hipMallocPitch
hipMemAddressFree
hipMemAddressReserve
hipMemAdvise
hipMemAllocHost
hipMemAllocPitch
hipMemCreate
hipMemExportToShareableHandle
hipMemGetAccess
hipMemGetAddressRange
hipMemGetAllocationGranularity
hipMemGetAllocationPropertiesFromHandle
hipMemGetInfo
hipMemImportFromShareableHandle
hipMemMap
hipMemMapArrayAsync
hipMemPoolCreate
hipMemPoolDestroy
hipMemPoolExportPointer
hipMemPoolExportToShareableHandle
hipMemPoolGetAccess
hipMemPoolGetAttribute
hipMemPoolImportFromShareableHandle
hipMemPoolImportPointer
hipMemPoolSetAccess
hipMemPoolSetAttribute
hipMemPoolTrimTo
hipMemPrefetchAsync
hipMemPtrGetInfo
hipMemRangeGetAttribute
hipMemRangeGetAttributes
hipMemRelease
hipMemRetainAllocationHandle
hipMemSetAccess
hipMemUnmap
hipMemcpy
hipMemcpy2D
hipMemcpy2DAsync
hipMemcpy2DAsync_spt
hipMemcpy2DFromArray
hipMemcpy2DFromArrayAsync
hipMemcpy2DFromArrayAsync_spt
hipMemcpy2DFromArray_spt
hipMemcpy2DToArray
hipMemcpy2DToArrayAsync
hipMemcpy2DToArrayAsync_spt
hipMemcpy2DToArray_spt
hipMemcpy2D_spt
hipMemcpy3D
hipMemcpy3DAsync
hipMemcpy3DAsync_spt
hipMemcpy3D_spt
hipMemcpyAsync
hipMemcpyAsync_spt
hipMemcpyAtoH
hipMemcpyDtoD
hipMemcpyDtoDAsync
hipMemcpyDtoH
hipMemcpyDtoHAsync
hipMemcpyFromArray
hipMemcpyFromArray_spt
hipMemcpyFromSymbol
hipMemcpyFromSymbolAsync
hipMemcpyFromSymbolAsync_spt
hipMemcpyFromSymbol_spt
hipMemcpyHtoA
hipMemcpyHtoD
hipMemcpyHtoDAsync
hipMemcpyParam2D
hipMemcpyParam2DAsync
hipMemcpyPeer
hipMemcpyPeerAsync
hipMemcpyToArray
hipMemcpyToSymbol
hipMemcpyToSymbolAsync
hipMemcpyToSymbolAsync_spt
hipMemcpyToSymbol_spt
hipMemcpyWithStream
hipMemcpy_spt
hipMemset
hipMemset2D
hipMemset2DAsync
hipMemset2DAsync_spt
hipMemset2D_spt
hipMemset3D
hipMemset3DAsync
hipMemset3DAsync_spt
hipMemset3D_spt
hipMemsetAsync
hipMemsetAsync_spt
hipMemsetD16
hipMemsetD16Async
hipMemsetD32
hipMemsetD32Async
hipMemsetD8
hipMemsetD8Async
hipMemset_spt
hipMipmappedArrayCreate
hipMipmappedArrayDestroy
hipMipmappedArrayGetLevel
hipModuleGetFunction
hipModuleGetGlobal
hipModuleGetTexRef
hipModuleLaunchCooperativeKernel
hipModuleLaunchCooperativeKernelMultiDevice
hipModuleLaunchKernel
hipModuleLoad
hipModuleLoadData
hipModuleLoadDataEx
hipModuleOccupancyMaxActiveBlocksPerMultiprocessor
hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags
hipModuleOccupancyMaxPotentialBlockSize
hipModuleOccupancyMaxPotentialBlockSizeWithFlags
hipModuleUnload
hipOccupancyMaxActiveBlocksPerMultiprocessor
hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags
hipOccupancyMaxPotentialBlockSize
hipPeekAtLastError
hipPointerGetAttribute
hipPointerGetAttributes
hipProfilerStart
hipProfilerStop
hipRegisterTracerCallback
hipRuntimeGetVersion
hipSetDevice
hipSetDeviceFlags
hipSetupArgument
hipSignalExternalSemaphoresAsync
hipStreamAddCallback
hipStreamAddCallback_spt
hipStreamAttachMemAsync
hipStreamBeginCapture
hipStreamBeginCapture_spt
hipStreamCreate
hipStreamCreateWithFlags
hipStreamCreateWithPriority
hipStreamDestroy
hipStreamEndCapture
hipStreamEndCapture_spt
hipStreamGetCaptureInfo
hipStreamGetCaptureInfo_spt
hipStreamGetCaptureInfo_v2
hipStreamGetCaptureInfo_v2_spt
hipStreamGetDevice
hipStreamGetFlags
hipStreamGetFlags_spt
hipStreamGetPriority
hipStreamGetPriority_spt
hipStreamIsCapturing
hipStreamIsCapturing_spt
hipStreamQuery
hipStreamQuery_spt
hipStreamSynchronize
hipStreamSynchronize_spt
hipStreamUpdateCaptureDependencies
hipStreamWaitEvent
hipStreamWaitEvent_spt
hipStreamWaitValue32
hipStreamWaitValue64
hipStreamWriteValue32
hipStreamWriteValue64
hipTexObjectCreate
hipTexObjectDestroy
hipTexObjectGetResourceDesc
hipTexObjectGetResourceViewDesc
hipTexObjectGetTextureDesc
hipTexRefGetAddress
hipTexRefGetAddressMode
hipTexRefGetFilterMode
hipTexRefGetFlags
hipTexRefGetFormat
hipTexRefGetMaxAnisotropy
hipTexRefGetMipmapFilterMode
hipTexRefGetMipmapLevelBias
hipTexRefGetMipmapLevelClamp
hipTexRefSetAddress
hipTexRefSetAddress2D
hipTexRefSetAddressMode
hipTexRefSetArray
hipTexRefSetBorderColor
hipTexRefSetFilterMode
hipTexRefSetFlags
hipTexRefSetFormat
hipTexRefSetMaxAnisotropy
hipTexRefSetMipmapFilterMode
hipTexRefSetMipmapLevelBias
hipTexRefSetMipmapLevelClamp
hipTexRefSetMipmappedArray
hipThreadExchangeStreamCaptureMode
hipUnbindTexture
hipUserObjectCreate
hipUserObjectRelease
hipUserObjectRetain
hipWaitExternalSemaphoresAsync

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -1 +1 @@
bindgen /opt/rocm/include/hipfft/hipfft.h -o src/hipfft.rs --no-layout-tests --default-enum-style=newtype --no-derive-debug --allowlist-function "hipfft.*" --must-use-type hipfftResult_t -- -I/opt/rocm/include -D__HIP_PLATFORM_AMD__
bindgen $Env:HIP_PATH/include/hipfft/hipfft.h -o src/hipfft.rs --no-layout-tests --default-enum-style=newtype --no-derive-debug --allowlist-function "hipfft.*" --must-use-type hipfftResult_t -- -I"$Env:HIP_PATH/include" -D__HIP_PLATFORM_AMD__

View file

@ -1,4 +1,4 @@
/* automatically generated by rust-bindgen 0.66.1 */
/* automatically generated by rust-bindgen 0.69.4 */
#[repr(C)]
#[derive(Copy, Clone)]
@ -89,7 +89,7 @@ impl hipfftResult_t {
#[doc = " @brief Result/status/error codes"]
#[must_use]
#[derive(Copy, Clone, Hash, PartialEq, Eq)]
pub struct hipfftResult_t(pub ::std::os::raw::c_uint);
pub struct hipfftResult_t(pub ::std::os::raw::c_int);
#[doc = " @brief Result/status/error codes"]
pub use self::hipfftResult_t as hipfftResult;
impl hipfftType_t {
@ -119,7 +119,7 @@ impl hipfftType_t {
#[repr(transparent)]
#[doc = " @brief Transform type\n @details This type is used to declare the Fourier transform type that will be executed."]
#[derive(Copy, Clone, Hash, PartialEq, Eq)]
pub struct hipfftType_t(pub ::std::os::raw::c_uint);
pub struct hipfftType_t(pub ::std::os::raw::c_int);
#[doc = " @brief Transform type\n @details This type is used to declare the Fourier transform type that will be executed."]
pub use self::hipfftType_t as hipfftType;
impl hipfftLibraryPropertyType_t {
@ -133,7 +133,7 @@ impl hipfftLibraryPropertyType_t {
}
#[repr(transparent)]
#[derive(Copy, Clone, Hash, PartialEq, Eq)]
pub struct hipfftLibraryPropertyType_t(pub ::std::os::raw::c_uint);
pub struct hipfftLibraryPropertyType_t(pub ::std::os::raw::c_int);
pub use self::hipfftLibraryPropertyType_t as hipfftLibraryPropertyType;
#[repr(C)]
#[derive(Copy, Clone)]
@ -198,7 +198,7 @@ extern "C" {
pub fn hipfftExtPlanScaleFactor(plan: hipfftHandle, scalefactor: f64) -> hipfftResult;
}
extern "C" {
#[doc = " @brief Initialize a new one-dimensional FFT plan.\n\n @details Assumes that the plan has been created already, and\n modifies the plan associated with the plan handle.\n\n @param[in] plan Handle of the FFT plan.\n @param[in] nx FFT length.\n @param[in] type FFT type.\n @param[in] batch Number of batched transforms to compute."]
#[doc = " @brief Initialize a new one-dimensional FFT plan.\n\n @details Assumes that the plan has been created already, and\n modifies the plan associated with the plan handle.\n\n @param[in] plan Handle of the FFT plan.\n @param[in] nx FFT length.\n @param[in] type FFT type.\n @param[in] batch Number of batched transforms to compute.\n @param[out] workSize Pointer to work area size (returned value)."]
pub fn hipfftMakePlan1d(
plan: hipfftHandle,
nx: ::std::os::raw::c_int,
@ -262,7 +262,7 @@ extern "C" {
) -> hipfftResult;
}
extern "C" {
#[doc = " @brief Return an estimate of the work area size required for a 1D plan.\n\n @param[in] nx Number of elements in the x-direction.\n @param[in] type FFT type.\n @param[out] workSize Pointer to work area size (returned value)."]
#[doc = " @brief Return an estimate of the work area size required for a 1D plan.\n\n @param[in] nx Number of elements in the x-direction.\n @param[in] type FFT type.\n @param[in] batch Number of batched transforms to perform.\n @param[out] workSize Pointer to work area size (returned value)."]
pub fn hipfftEstimate1d(
nx: ::std::os::raw::c_int,
type_: hipfftType,
@ -306,7 +306,7 @@ extern "C" {
) -> hipfftResult;
}
extern "C" {
#[doc = " @brief Return size of the work area size required for a 1D plan.\n\n @param[in] plan Pointer to the FFT plan.\n @param[in] nx Number of elements in the x-direction.\n @param[in] type FFT type.\n @param[out] workSize Pointer to work area size (returned value)."]
#[doc = " @brief Return size of the work area size required for a 1D plan.\n\n @param[in] plan Pointer to the FFT plan.\n @param[in] nx Number of elements in the x-direction.\n @param[in] type FFT type.\n @param[in] batch Number of batched transforms to perform.\n @param[out] workSize Pointer to work area size (returned value)."]
pub fn hipfftGetSize1d(
plan: hipfftHandle,
nx: ::std::os::raw::c_int,
@ -370,7 +370,7 @@ extern "C" {
) -> hipfftResult;
}
extern "C" {
#[doc = " @brief Return size of the work area size required for a rank-dimensional plan.\n\n @param[in] plan Pointer to the FFT plan."]
#[doc = " @brief Return size of the work area size required for a rank-dimensional plan.\n\n @param[in] plan Pointer to the FFT plan.\n @param[out] workSize Pointer to work area size (returned value)."]
pub fn hipfftGetSize(plan: hipfftHandle, workSize: *mut usize) -> hipfftResult;
}
extern "C" {

View file

@ -1 +1 @@
bindgen $Env:HIP_PATH/include/hip/hiprtc.h -o src/hiprtc.rs --no-layout-tests --default-enum-style=newtype --no-derive-debug --allowlist-function "hiprtc.*" --must-use-type hiprtcResult_t -- -I$Env:HIP_PATH/include -D__HIP_PLATFORM_AMD__
bindgen $Env:HIP_PATH/include/hip/hiprtc.h -o src/hiprtc.rs --no-layout-tests --default-enum-style=newtype --no-derive-debug --allowlist-function "hiprtc.*" --must-use-type hiprtcResult_t -- -I"$Env:HIP_PATH/include" -D__HIP_PLATFORM_AMD__

View file

@ -57,39 +57,39 @@ impl hiprtcResult {
#[derive(Copy, Clone, Hash, PartialEq, Eq)]
pub struct hiprtcResult(pub ::std::os::raw::c_int);
impl hiprtcJIT_option {
#[doc = "< Maximum registers"]
#[doc = "< Maximum registers may be used in a thread, passed to compiler"]
pub const HIPRTC_JIT_MAX_REGISTERS: hiprtcJIT_option = hiprtcJIT_option(0);
}
impl hiprtcJIT_option {
#[doc = "< Thread per block"]
#[doc = "< Number of thread per block"]
pub const HIPRTC_JIT_THREADS_PER_BLOCK: hiprtcJIT_option = hiprtcJIT_option(1);
}
impl hiprtcJIT_option {
#[doc = "< Time from aall clock"]
#[doc = "< Value for total wall clock time"]
pub const HIPRTC_JIT_WALL_TIME: hiprtcJIT_option = hiprtcJIT_option(2);
}
impl hiprtcJIT_option {
#[doc = "< Log buffer info"]
#[doc = "< Pointer to the buffer with logged information"]
pub const HIPRTC_JIT_INFO_LOG_BUFFER: hiprtcJIT_option = hiprtcJIT_option(3);
}
impl hiprtcJIT_option {
#[doc = "< Log buffer size in bytes"]
#[doc = "< Size of the buffer in bytes for logged info"]
pub const HIPRTC_JIT_INFO_LOG_BUFFER_SIZE_BYTES: hiprtcJIT_option = hiprtcJIT_option(4);
}
impl hiprtcJIT_option {
#[doc = "< Log buffer error"]
#[doc = "< Pointer to the buffer with logged error(s)"]
pub const HIPRTC_JIT_ERROR_LOG_BUFFER: hiprtcJIT_option = hiprtcJIT_option(5);
}
impl hiprtcJIT_option {
#[doc = "< Log buffer size in bytes"]
#[doc = "< Size of the buffer in bytes for logged error(s)"]
pub const HIPRTC_JIT_ERROR_LOG_BUFFER_SIZE_BYTES: hiprtcJIT_option = hiprtcJIT_option(6);
}
impl hiprtcJIT_option {
#[doc = "< Optimization level"]
#[doc = "< Value of optimization level for generated codes"]
pub const HIPRTC_JIT_OPTIMIZATION_LEVEL: hiprtcJIT_option = hiprtcJIT_option(7);
}
impl hiprtcJIT_option {
#[doc = "<"]
#[doc = "< The target context, which is the default"]
pub const HIPRTC_JIT_TARGET_FROM_HIPCONTEXT: hiprtcJIT_option = hiprtcJIT_option(8);
}
impl hiprtcJIT_option {
@ -105,55 +105,55 @@ impl hiprtcJIT_option {
pub const HIPRTC_JIT_GENERATE_DEBUG_INFO: hiprtcJIT_option = hiprtcJIT_option(11);
}
impl hiprtcJIT_option {
#[doc = "< Log verbose"]
#[doc = "< Generate log verbose"]
pub const HIPRTC_JIT_LOG_VERBOSE: hiprtcJIT_option = hiprtcJIT_option(12);
}
impl hiprtcJIT_option {
#[doc = "< Generate line information"]
#[doc = "< Generate line number information"]
pub const HIPRTC_JIT_GENERATE_LINE_INFO: hiprtcJIT_option = hiprtcJIT_option(13);
}
impl hiprtcJIT_option {
#[doc = "< Cache mode"]
#[doc = "< Set cache mode"]
pub const HIPRTC_JIT_CACHE_MODE: hiprtcJIT_option = hiprtcJIT_option(14);
}
impl hiprtcJIT_option {
#[doc = "< New SM3X option"]
#[doc = "< @deprecated New SM3X option."]
pub const HIPRTC_JIT_NEW_SM3X_OPT: hiprtcJIT_option = hiprtcJIT_option(15);
}
impl hiprtcJIT_option {
#[doc = "< Fast compile"]
#[doc = "< Set fast compile"]
pub const HIPRTC_JIT_FAST_COMPILE: hiprtcJIT_option = hiprtcJIT_option(16);
}
impl hiprtcJIT_option {
#[doc = "< Global symbol names"]
#[doc = "< Array of device symbol names to be relocated to the host"]
pub const HIPRTC_JIT_GLOBAL_SYMBOL_NAMES: hiprtcJIT_option = hiprtcJIT_option(17);
}
impl hiprtcJIT_option {
#[doc = "< Global symbol address"]
#[doc = "< Array of host addresses to be relocated to the device"]
pub const HIPRTC_JIT_GLOBAL_SYMBOL_ADDRESS: hiprtcJIT_option = hiprtcJIT_option(18);
}
impl hiprtcJIT_option {
#[doc = "< Global symbol count"]
#[doc = "< Number of symbol count."]
pub const HIPRTC_JIT_GLOBAL_SYMBOL_COUNT: hiprtcJIT_option = hiprtcJIT_option(19);
}
impl hiprtcJIT_option {
#[doc = "< LTO"]
#[doc = "< @deprecated Enable link-time optimization for device code"]
pub const HIPRTC_JIT_LTO: hiprtcJIT_option = hiprtcJIT_option(20);
}
impl hiprtcJIT_option {
#[doc = "< FTZ"]
#[doc = "< @deprecated Set single-precision denormals."]
pub const HIPRTC_JIT_FTZ: hiprtcJIT_option = hiprtcJIT_option(21);
}
impl hiprtcJIT_option {
#[doc = "< Prec_VIV"]
#[doc = "< @deprecated Set single-precision floating-point division and\n< reciprocals"]
pub const HIPRTC_JIT_PREC_DIV: hiprtcJIT_option = hiprtcJIT_option(22);
}
impl hiprtcJIT_option {
#[doc = "< PREC_SQRT"]
#[doc = "< @deprecated Set single-precision floating-point square root"]
pub const HIPRTC_JIT_PREC_SQRT: hiprtcJIT_option = hiprtcJIT_option(23);
}
impl hiprtcJIT_option {
#[doc = "< FMA"]
#[doc = "< @deprecated Enable floating-point multiplies and adds/subtracts operations"]
pub const HIPRTC_JIT_FMA: hiprtcJIT_option = hiprtcJIT_option(24);
}
impl hiprtcJIT_option {
@ -161,11 +161,11 @@ impl hiprtcJIT_option {
pub const HIPRTC_JIT_NUM_OPTIONS: hiprtcJIT_option = hiprtcJIT_option(25);
}
impl hiprtcJIT_option {
#[doc = "< AMD only. Linker options to be passed on to"]
#[doc = "< Linker options to be passed on to compiler"]
pub const HIPRTC_JIT_IR_TO_ISA_OPT_EXT: hiprtcJIT_option = hiprtcJIT_option(10000);
}
impl hiprtcJIT_option {
#[doc = "< AMD only. Count of linker options"]
#[doc = "< Count of linker options to be passed on to\n< compiler @note Only supported for the AMD platform"]
pub const HIPRTC_JIT_IR_TO_ISA_OPT_COUNT_EXT: hiprtcJIT_option = hiprtcJIT_option(10001);
}
#[repr(transparent)]
@ -201,7 +201,7 @@ impl hiprtcJITInputType {
pub const HIPRTC_JIT_NUM_LEGACY_INPUT_TYPES: hiprtcJITInputType = hiprtcJITInputType(6);
}
impl hiprtcJITInputType {
#[doc = "< LLVM bitcode"]
#[doc = "< LLVM bitcode or IR assembly"]
pub const HIPRTC_JIT_INPUT_LLVM_BITCODE: hiprtcJITInputType = hiprtcJITInputType(100);
}
impl hiprtcJITInputType {

View file

@ -1730,12 +1730,12 @@ fn emit_inst_sqrt(
(ast::ScalarType::F64, ast::RcpSqrtKind::Approx) => {
(&b"llvm.sqrt.f64\0"[..], FastMathFlags::ApproxFunc)
}
// TODO: Go back to llvm.sqrt.f64 when this commit lands:
// https://github.com/RadeonOpenCompute/llvm-project/commit/e3fd8f83a801b1918508c7c0a71cc31bc95ad4d2
// It's not yet present as of ROCm 5.7.1
// TODO: support correct rounding
(ast::ScalarType::F32, _) => (&b"__ocml_sqrt_f32\0"[..], FastMathFlags::empty()),
(ast::ScalarType::F64, _) => (&b"__ocml_sqrt_f64\0"[..], FastMathFlags::empty()),
(ast::ScalarType::F32, _) => {
(&b"llvm.sqrt.f32\0"[..], FastMathFlags::empty())
},
(ast::ScalarType::F64, _) => {
(&b"llvm.sqrt.f64\0"[..], FastMathFlags::empty())
},
_ => return Err(TranslateError::unreachable()),
};
let sqrt_result = emit_intrinsic_arg2(

View file

@ -671,7 +671,7 @@ fn run_hip<Input: From<u8> + Copy + Debug, Output: From<u8> + Copy + Debug + Def
let mut stream = ptr::null_mut();
hip_call! { hipStreamCreateWithFlags(&mut stream, hipStreamNonBlocking) };
let mut dev_props = unsafe { mem::zeroed() };
hip_call! { hipGetDeviceProperties(&mut dev_props, dev) };
hip_call! { hipGetDevicePropertiesR0600(&mut dev_props, dev) };
let mut module = ptr::null_mut();
hip_call! { hipModuleLoadData(&mut module, compiled.as_ptr() as _) };
let mut kernel = ptr::null_mut();

View file

@ -1 +1 @@
bindgen /opt/rocm/include/rocblas/rocblas.h -o src/rocblas.rs --no-layout-tests --size_t-is-usize --default-enum-style=newtype --no-derive-debug --allowlist-function "rocblas_.*" --allowlist-var "ROCBLAS_*" --must-use-type rocblas_status -- -I/opt/rocm/include
bindgen $Env:HIP_PATH/include/rocblas/rocblas.h -o src/rocblas.rs --no-layout-tests --default-enum-style=newtype --no-derive-debug --allowlist-function "rocblas_.*" --allowlist-var "ROCBLAS_*" --must-use-type rocblas_status -- -I"$Env:HIP_PATH/include"

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
bindgen /opt/rocm/include/rocsolver/rocsolver.h -o src/rocsolver.rs --no-layout-tests --default-enum-style=newtype --no-derive-debug --allowlist-function "rocsolver_.*" --allowlist-var "ROCSOLVER_*" --must-use-type rocblas_status -- -I/opt/rocm/include
bindgen $Env:HIP_PATH/include/rocsolver/rocsolver.h -o src/rocsolver.rs --no-layout-tests --default-enum-style=newtype --no-derive-debug --allowlist-function "rocsolver_.*" --allowlist-var "ROCSOLVER_*" --must-use-type rocblas_status -- -I"$Env:HIP_PATH/include"

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
bindgen /opt/rocm/include/rocsparse/rocsparse.h -o src/rocsparse.rs --no-layout-tests --default-enum-style=newtype --no-derive-debug --allowlist-function "rocsparse_.*" --allowlist-var "ROCSPARSE_*" --must-use-type rocsparse_status -- -I/opt/rocm/include
bindgen $Env:HIP_PATH/include/rocsparse/rocsparse.h -o src/rocsparse.rs --no-layout-tests --default-enum-style=newtype --no-derive-debug --allowlist-function "rocsparse_.*" --allowlist-var "ROCSPARSE_*" --must-use-type rocsparse_status -- -I"$Env:HIP_PATH/include"

File diff suppressed because one or more lines are too long

View file

@ -176,7 +176,7 @@ pub(crate) unsafe fn get_attribute(
| CUdevice_attribute::CU_DEVICE_ATTRIBUTE_MAX_BLOCKS_PER_MULTIPROCESSOR => {
// in practical terms max group size = max blocks * warp size
let mut prop = mem::zeroed();
hip_call_cuda! { hipGetDeviceProperties(&mut prop, dev) };
hip_call_cuda! { hipGetDevicePropertiesR0600(&mut prop, dev) };
*pi = (prop.maxThreadsPerBlock / 2) / prop.warpSize;
return Ok(());
}
@ -260,13 +260,13 @@ pub(crate) unsafe fn get_attribute(
// linear sizes
CUdevice_attribute::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH => {
let mut prop = mem::zeroed();
hip_call_cuda! { hipGetDeviceProperties(&mut prop, dev) };
hip_call_cuda! { hipGetDevicePropertiesR0600(&mut prop, dev) };
*pi = prop.maxTexture1DLinear;
return Ok(());
}
CUdevice_attribute::CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID => {
let mut prop = mem::zeroed();
hip_call_cuda! { hipGetDeviceProperties(&mut prop, dev) };
hip_call_cuda! { hipGetDevicePropertiesR0600(&mut prop, dev) };
*pi = prop.pciDomainID;
return Ok(());
}
@ -455,7 +455,7 @@ pub(crate) unsafe fn get_properties(
return Err(CUresult::CUDA_ERROR_INVALID_VALUE);
}
let mut hip_props = mem::zeroed();
hip_call_cuda! { hipGetDeviceProperties(&mut hip_props, dev) };
hip_call_cuda! { hipGetDevicePropertiesR0600(&mut hip_props, dev) };
(*prop).maxThreadsPerBlock = hip_props.maxThreadsPerBlock;
(*prop).maxThreadsDim = hip_props.maxThreadsDim;
(*prop).maxGridSize = hip_props.maxGridSize;

View file

@ -299,46 +299,30 @@ macro_rules! try_downcast {
#[allow(non_snake_case)]
pub(crate) fn memcpy3d_from_cuda(this: &CUDA_MEMCPY3D) -> Result<HIP_MEMCPY3D, CUresult> {
// TODO: remove the casts when HIP fixes it
let srcXInBytes = try_downcast!(this.srcXInBytes, usize => u32);
let srcY = try_downcast!(this.srcY, usize => u32);
let srcZ = try_downcast!(this.srcZ, usize => u32);
let srcLOD = try_downcast!(this.srcLOD, usize => u32);
let srcPitch = try_downcast!(this.srcPitch, usize => u32);
let srcHeight = try_downcast!(this.srcHeight, usize => u32);
let dstXInBytes = try_downcast!(this.dstXInBytes, usize => u32);
let dstY = try_downcast!(this.dstY, usize => u32);
let dstZ = try_downcast!(this.dstZ, usize => u32);
let dstLOD = try_downcast!(this.dstLOD, usize => u32);
let dstPitch = try_downcast!(this.dstPitch, usize => u32);
let dstHeight = try_downcast!(this.dstHeight, usize => u32);
let WidthInBytes = try_downcast!(this.WidthInBytes, usize => u32);
let Height = try_downcast!(this.Height, usize => u32);
let Depth = try_downcast!(this.Depth, usize => u32);
Ok(HIP_MEMCPY3D {
srcXInBytes,
srcY,
srcZ,
srcLOD,
srcXInBytes: this.srcXInBytes,
srcY: this.srcY,
srcZ: this.srcZ,
srcLOD: this.srcLOD,
srcMemoryType: memory_type_from_cuda(this.srcMemoryType),
srcHost: this.srcHost,
srcDevice: FromCuda::from_cuda(this.srcDevice),
srcArray: hipfix::array::get(this.srcArray),
srcPitch,
srcHeight,
dstXInBytes,
dstY,
dstZ,
dstLOD,
srcPitch: this.srcPitch,
srcHeight: this.srcHeight,
dstXInBytes: this.dstXInBytes,
dstY: this.dstY,
dstZ: this.dstZ,
dstLOD: this.dstLOD,
dstMemoryType: memory_type_from_cuda(this.dstMemoryType),
dstHost: this.dstHost,
dstDevice: FromCuda::from_cuda(this.dstDevice),
dstArray: hipfix::array::get(this.dstArray),
dstPitch,
dstHeight,
WidthInBytes,
Height,
Depth,
dstPitch: this.dstPitch,
dstHeight: this.dstHeight,
WidthInBytes: this.WidthInBytes,
Height: this.Height,
Depth: this.Depth,
})
}
@ -348,7 +332,7 @@ pub(crate) fn memory_type_from_cuda(this: CUmemorytype) -> hipMemoryType {
CUmemorytype::CU_MEMORYTYPE_DEVICE => hipMemoryType::hipMemoryTypeDevice,
CUmemorytype::CU_MEMORYTYPE_ARRAY => hipMemoryType::hipMemoryTypeArray,
CUmemorytype::CU_MEMORYTYPE_UNIFIED => hipMemoryType::hipMemoryTypeUnified,
CUmemorytype(val) => hipMemoryType(val - 1),
_ => panic!("[ZLUDA] Unknown memory type: {}", this.0),
}
}

View file

@ -25,7 +25,7 @@ pub(crate) unsafe fn get_attribute(
match attribute {
hipPointer_attribute::HIP_POINTER_ATTRIBUTE_MEMORY_TYPE => {
*(data as *mut _) =
memory_type(attribs.__bindgen_anon_1.memoryType).map_err(IntoCuda::into_cuda)?;
memory_type(attribs.type_).map_err(IntoCuda::into_cuda)?;
Ok(())
}
hipPointer_attribute::HIP_POINTER_ATTRIBUTE_DEVICE_POINTER => {

View file

@ -868,7 +868,7 @@ unsafe fn dtrmm_v2(
let uplo = to_fill(uplo);
let transa = op_from_cuda(transa);
let diag = to_diag(diag);
to_cuda(rocblas_dtrmm_outofplace(
to_cuda(rocblas_dtrmm(
handle.cast(),
side,
uplo,
@ -952,7 +952,7 @@ unsafe fn get_pointer_mode(
unsafe fn set_pointer_mode(handle: cublasHandle_t, mode: cublasPointerMode_t) -> cublasStatus_t {
to_cuda(rocblas_set_pointer_mode(
handle.cast(),
rocblas_pointer_mode_(mode.0),
rocblas_pointer_mode_(mode.0 as _),
))
}
@ -1207,7 +1207,7 @@ unsafe fn gemm_batched_ex(
compute_type,
algo,
0,
rocblas_gemm_flags::rocblas_gemm_flags_none.0,
0,
))
}
@ -1272,6 +1272,6 @@ unsafe fn gemm_strided_batched_ex(
compute_type,
algo,
0,
rocblas_gemm_flags::rocblas_gemm_flags_none.0,
0,
))
}

View file

@ -502,6 +502,7 @@ unsafe fn spmv(
vec_y.cast(),
compute_type,
alg,
rocsparse_spmv_stage::rocsparse_spmv_stage_compute,
&mut size,
external_buffer,
))
@ -532,6 +533,7 @@ unsafe fn spmv_buffersize(
vec_y.cast(),
compute_type,
alg,
rocsparse_spmv_stage::rocsparse_spmv_stage_buffer_size,
buffer_size,
ptr::null_mut(),
))