Rewrite nvrtcVersion.

This commit is contained in:
Seunghoon Lee 2024-04-21 00:32:58 +09:00
parent cf262c6889
commit b9e932b9c8
No known key found for this signature in database
GPG key ID: 436E38F4E70BD152
2 changed files with 12 additions and 3 deletions

View file

@ -13,6 +13,8 @@ fn unsupported() -> nvrtcResult {
nvrtcResult::NVRTC_ERROR_INTERNAL_ERROR
}
const NVRTC_VERSION_MAJOR: i32 = 11;
const NVRTC_VERSION_MINOR: i32 = 8;
const SUPPORTED_OPTIONS: [&'static str; 1] = ["--std"];
fn to_nvrtc(status: hiprtc_sys::hiprtcResult) -> nvrtcResult {
@ -37,6 +39,15 @@ unsafe fn get_error_string(result: nvrtcResult) -> *const ::std::os::raw::c_char
hiprtcGetErrorString(to_hiprtc(result))
}
unsafe fn version(
major: *mut i32,
minor: *mut i32,
) -> nvrtcResult {
*major = NVRTC_VERSION_MAJOR;
*minor = NVRTC_VERSION_MINOR;
nvrtcResult::NVRTC_SUCCESS
}
unsafe fn create_program(
prog: *mut nvrtcProgram,
src: *const std::ffi::c_char,

View file

@ -53,9 +53,7 @@ pub unsafe extern "system" fn nvrtcVersion(
major: *mut ::std::os::raw::c_int,
minor: *mut ::std::os::raw::c_int,
) -> nvrtcResult {
*major = 11;
*minor = 8;
nvrtcResult::NVRTC_SUCCESS
crate::version(major, minor)
}
#[doc = " \\ingroup query\n \\brief nvrtcGetNumSupportedArchs sets the output parameter \\p numArchs\n with the number of architectures supported by NVRTC. This can\n then be used to pass an array to ::nvrtcGetSupportedArchs to\n get the supported architectures.\n\n \\param [out] numArchs number of supported architectures.\n \\return\n - \\link #nvrtcResult NVRTC_SUCCESS \\endlink\n - \\link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \\endlink\n\n see ::nvrtcGetSupportedArchs"]