mirror of
https://github.com/vosen/ZLUDA.git
synced 2025-04-28 21:47:57 +03:00
Generate types for cudnn and cufft
This commit is contained in:
parent
6a511ffb8a
commit
714a616d63
9 changed files with 5483 additions and 18 deletions
2579
cuda_base/src/cudnn8.rs
Normal file
2579
cuda_base/src/cudnn8.rs
Normal file
File diff suppressed because it is too large
Load diff
2055
cuda_base/src/cudnn9.rs
Normal file
2055
cuda_base/src/cudnn9.rs
Normal file
File diff suppressed because it is too large
Load diff
368
cuda_base/src/cufft.rs
Normal file
368
cuda_base/src/cufft.rs
Normal file
|
@ -0,0 +1,368 @@
|
|||
// Generated automatically by zluda_bindgen
|
||||
// DO NOT EDIT MANUALLY
|
||||
#![allow(warnings)]
|
||||
extern "system" {
|
||||
fn cufftPlan1d(
|
||||
plan: *mut cuda_types::cufft::cufftHandle,
|
||||
nx: ::core::ffi::c_int,
|
||||
type_: cuda_types::cufft::cufftType,
|
||||
batch: ::core::ffi::c_int,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftPlan2d(
|
||||
plan: *mut cuda_types::cufft::cufftHandle,
|
||||
nx: ::core::ffi::c_int,
|
||||
ny: ::core::ffi::c_int,
|
||||
type_: cuda_types::cufft::cufftType,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftPlan3d(
|
||||
plan: *mut cuda_types::cufft::cufftHandle,
|
||||
nx: ::core::ffi::c_int,
|
||||
ny: ::core::ffi::c_int,
|
||||
nz: ::core::ffi::c_int,
|
||||
type_: cuda_types::cufft::cufftType,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftPlanMany(
|
||||
plan: *mut cuda_types::cufft::cufftHandle,
|
||||
rank: ::core::ffi::c_int,
|
||||
n: *mut ::core::ffi::c_int,
|
||||
inembed: *mut ::core::ffi::c_int,
|
||||
istride: ::core::ffi::c_int,
|
||||
idist: ::core::ffi::c_int,
|
||||
onembed: *mut ::core::ffi::c_int,
|
||||
ostride: ::core::ffi::c_int,
|
||||
odist: ::core::ffi::c_int,
|
||||
type_: cuda_types::cufft::cufftType,
|
||||
batch: ::core::ffi::c_int,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftMakePlan1d(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
nx: ::core::ffi::c_int,
|
||||
type_: cuda_types::cufft::cufftType,
|
||||
batch: ::core::ffi::c_int,
|
||||
workSize: *mut usize,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftMakePlan2d(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
nx: ::core::ffi::c_int,
|
||||
ny: ::core::ffi::c_int,
|
||||
type_: cuda_types::cufft::cufftType,
|
||||
workSize: *mut usize,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftMakePlan3d(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
nx: ::core::ffi::c_int,
|
||||
ny: ::core::ffi::c_int,
|
||||
nz: ::core::ffi::c_int,
|
||||
type_: cuda_types::cufft::cufftType,
|
||||
workSize: *mut usize,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftMakePlanMany(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
rank: ::core::ffi::c_int,
|
||||
n: *mut ::core::ffi::c_int,
|
||||
inembed: *mut ::core::ffi::c_int,
|
||||
istride: ::core::ffi::c_int,
|
||||
idist: ::core::ffi::c_int,
|
||||
onembed: *mut ::core::ffi::c_int,
|
||||
ostride: ::core::ffi::c_int,
|
||||
odist: ::core::ffi::c_int,
|
||||
type_: cuda_types::cufft::cufftType,
|
||||
batch: ::core::ffi::c_int,
|
||||
workSize: *mut usize,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftMakePlanMany64(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
rank: ::core::ffi::c_int,
|
||||
n: *mut ::core::ffi::c_longlong,
|
||||
inembed: *mut ::core::ffi::c_longlong,
|
||||
istride: ::core::ffi::c_longlong,
|
||||
idist: ::core::ffi::c_longlong,
|
||||
onembed: *mut ::core::ffi::c_longlong,
|
||||
ostride: ::core::ffi::c_longlong,
|
||||
odist: ::core::ffi::c_longlong,
|
||||
type_: cuda_types::cufft::cufftType,
|
||||
batch: ::core::ffi::c_longlong,
|
||||
workSize: *mut usize,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftGetSizeMany64(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
rank: ::core::ffi::c_int,
|
||||
n: *mut ::core::ffi::c_longlong,
|
||||
inembed: *mut ::core::ffi::c_longlong,
|
||||
istride: ::core::ffi::c_longlong,
|
||||
idist: ::core::ffi::c_longlong,
|
||||
onembed: *mut ::core::ffi::c_longlong,
|
||||
ostride: ::core::ffi::c_longlong,
|
||||
odist: ::core::ffi::c_longlong,
|
||||
type_: cuda_types::cufft::cufftType,
|
||||
batch: ::core::ffi::c_longlong,
|
||||
workSize: *mut usize,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftEstimate1d(
|
||||
nx: ::core::ffi::c_int,
|
||||
type_: cuda_types::cufft::cufftType,
|
||||
batch: ::core::ffi::c_int,
|
||||
workSize: *mut usize,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftEstimate2d(
|
||||
nx: ::core::ffi::c_int,
|
||||
ny: ::core::ffi::c_int,
|
||||
type_: cuda_types::cufft::cufftType,
|
||||
workSize: *mut usize,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftEstimate3d(
|
||||
nx: ::core::ffi::c_int,
|
||||
ny: ::core::ffi::c_int,
|
||||
nz: ::core::ffi::c_int,
|
||||
type_: cuda_types::cufft::cufftType,
|
||||
workSize: *mut usize,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftEstimateMany(
|
||||
rank: ::core::ffi::c_int,
|
||||
n: *mut ::core::ffi::c_int,
|
||||
inembed: *mut ::core::ffi::c_int,
|
||||
istride: ::core::ffi::c_int,
|
||||
idist: ::core::ffi::c_int,
|
||||
onembed: *mut ::core::ffi::c_int,
|
||||
ostride: ::core::ffi::c_int,
|
||||
odist: ::core::ffi::c_int,
|
||||
type_: cuda_types::cufft::cufftType,
|
||||
batch: ::core::ffi::c_int,
|
||||
workSize: *mut usize,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftCreate(
|
||||
handle: *mut cuda_types::cufft::cufftHandle,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftGetSize1d(
|
||||
handle: cuda_types::cufft::cufftHandle,
|
||||
nx: ::core::ffi::c_int,
|
||||
type_: cuda_types::cufft::cufftType,
|
||||
batch: ::core::ffi::c_int,
|
||||
workSize: *mut usize,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftGetSize2d(
|
||||
handle: cuda_types::cufft::cufftHandle,
|
||||
nx: ::core::ffi::c_int,
|
||||
ny: ::core::ffi::c_int,
|
||||
type_: cuda_types::cufft::cufftType,
|
||||
workSize: *mut usize,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftGetSize3d(
|
||||
handle: cuda_types::cufft::cufftHandle,
|
||||
nx: ::core::ffi::c_int,
|
||||
ny: ::core::ffi::c_int,
|
||||
nz: ::core::ffi::c_int,
|
||||
type_: cuda_types::cufft::cufftType,
|
||||
workSize: *mut usize,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftGetSizeMany(
|
||||
handle: cuda_types::cufft::cufftHandle,
|
||||
rank: ::core::ffi::c_int,
|
||||
n: *mut ::core::ffi::c_int,
|
||||
inembed: *mut ::core::ffi::c_int,
|
||||
istride: ::core::ffi::c_int,
|
||||
idist: ::core::ffi::c_int,
|
||||
onembed: *mut ::core::ffi::c_int,
|
||||
ostride: ::core::ffi::c_int,
|
||||
odist: ::core::ffi::c_int,
|
||||
type_: cuda_types::cufft::cufftType,
|
||||
batch: ::core::ffi::c_int,
|
||||
workArea: *mut usize,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftGetSize(
|
||||
handle: cuda_types::cufft::cufftHandle,
|
||||
workSize: *mut usize,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftSetWorkArea(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
workArea: *mut ::core::ffi::c_void,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftSetAutoAllocation(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
autoAllocate: ::core::ffi::c_int,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftExecC2C(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
idata: *mut cuda_types::cufft::cufftComplex,
|
||||
odata: *mut cuda_types::cufft::cufftComplex,
|
||||
direction: ::core::ffi::c_int,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftExecR2C(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
idata: *mut cuda_types::cufft::cufftReal,
|
||||
odata: *mut cuda_types::cufft::cufftComplex,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftExecC2R(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
idata: *mut cuda_types::cufft::cufftComplex,
|
||||
odata: *mut cuda_types::cufft::cufftReal,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftExecZ2Z(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
idata: *mut cuda_types::cufft::cufftDoubleComplex,
|
||||
odata: *mut cuda_types::cufft::cufftDoubleComplex,
|
||||
direction: ::core::ffi::c_int,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftExecD2Z(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
idata: *mut cuda_types::cufft::cufftDoubleReal,
|
||||
odata: *mut cuda_types::cufft::cufftDoubleComplex,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftExecZ2D(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
idata: *mut cuda_types::cufft::cufftDoubleComplex,
|
||||
odata: *mut cuda_types::cufft::cufftDoubleReal,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftSetStream(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
stream: cuda_types::cufft::cudaStream_t,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftDestroy(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftGetVersion(
|
||||
version: *mut ::core::ffi::c_int,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftGetProperty(
|
||||
type_: cuda_types::cufft::libraryPropertyType,
|
||||
value: *mut ::core::ffi::c_int,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftSetPlanPropertyInt64(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
property: cuda_types::cufft::cufftProperty,
|
||||
inputValueInt: ::core::ffi::c_longlong,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftGetPlanPropertyInt64(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
property: cuda_types::cufft::cufftProperty,
|
||||
returnPtrValue: *mut ::core::ffi::c_longlong,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftResetPlanProperty(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
property: cuda_types::cufft::cufftProperty,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftXtSetGPUs(
|
||||
handle: cuda_types::cufft::cufftHandle,
|
||||
nGPUs: ::core::ffi::c_int,
|
||||
whichGPUs: *mut ::core::ffi::c_int,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftXtMalloc(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
descriptor: *mut *mut cuda_types::cufft::cudaLibXtDesc,
|
||||
format: cuda_types::cufft::cufftXtSubFormat,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftXtMemcpy(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
dstPointer: *mut ::core::ffi::c_void,
|
||||
srcPointer: *mut ::core::ffi::c_void,
|
||||
type_: cuda_types::cufft::cufftXtCopyType,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftXtFree(
|
||||
descriptor: *mut cuda_types::cufft::cudaLibXtDesc,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftXtSetWorkArea(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
workArea: *mut *mut ::core::ffi::c_void,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftXtExecDescriptorC2C(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
input: *mut cuda_types::cufft::cudaLibXtDesc,
|
||||
output: *mut cuda_types::cufft::cudaLibXtDesc,
|
||||
direction: ::core::ffi::c_int,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftXtExecDescriptorR2C(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
input: *mut cuda_types::cufft::cudaLibXtDesc,
|
||||
output: *mut cuda_types::cufft::cudaLibXtDesc,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftXtExecDescriptorC2R(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
input: *mut cuda_types::cufft::cudaLibXtDesc,
|
||||
output: *mut cuda_types::cufft::cudaLibXtDesc,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftXtExecDescriptorZ2Z(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
input: *mut cuda_types::cufft::cudaLibXtDesc,
|
||||
output: *mut cuda_types::cufft::cudaLibXtDesc,
|
||||
direction: ::core::ffi::c_int,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftXtExecDescriptorD2Z(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
input: *mut cuda_types::cufft::cudaLibXtDesc,
|
||||
output: *mut cuda_types::cufft::cudaLibXtDesc,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftXtExecDescriptorZ2D(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
input: *mut cuda_types::cufft::cudaLibXtDesc,
|
||||
output: *mut cuda_types::cufft::cudaLibXtDesc,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftXtQueryPlan(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
queryStruct: *mut ::core::ffi::c_void,
|
||||
queryType: cuda_types::cufft::cufftXtQueryType,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftXtSetCallback(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
callback_routine: *mut *mut ::core::ffi::c_void,
|
||||
cbType: cuda_types::cufft::cufftXtCallbackType,
|
||||
caller_info: *mut *mut ::core::ffi::c_void,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftXtClearCallback(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
cbType: cuda_types::cufft::cufftXtCallbackType,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftXtSetCallbackSharedSize(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
cbType: cuda_types::cufft::cufftXtCallbackType,
|
||||
sharedSize: usize,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftXtMakePlanMany(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
rank: ::core::ffi::c_int,
|
||||
n: *mut ::core::ffi::c_longlong,
|
||||
inembed: *mut ::core::ffi::c_longlong,
|
||||
istride: ::core::ffi::c_longlong,
|
||||
idist: ::core::ffi::c_longlong,
|
||||
inputtype: cuda_types::cufft::cudaDataType,
|
||||
onembed: *mut ::core::ffi::c_longlong,
|
||||
ostride: ::core::ffi::c_longlong,
|
||||
odist: ::core::ffi::c_longlong,
|
||||
outputtype: cuda_types::cufft::cudaDataType,
|
||||
batch: ::core::ffi::c_longlong,
|
||||
workSize: *mut usize,
|
||||
executiontype: cuda_types::cufft::cudaDataType,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftXtGetSizeMany(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
rank: ::core::ffi::c_int,
|
||||
n: *mut ::core::ffi::c_longlong,
|
||||
inembed: *mut ::core::ffi::c_longlong,
|
||||
istride: ::core::ffi::c_longlong,
|
||||
idist: ::core::ffi::c_longlong,
|
||||
inputtype: cuda_types::cufft::cudaDataType,
|
||||
onembed: *mut ::core::ffi::c_longlong,
|
||||
ostride: ::core::ffi::c_longlong,
|
||||
odist: ::core::ffi::c_longlong,
|
||||
outputtype: cuda_types::cufft::cudaDataType,
|
||||
batch: ::core::ffi::c_longlong,
|
||||
workSize: *mut usize,
|
||||
executiontype: cuda_types::cufft::cudaDataType,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftXtExec(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
input: *mut ::core::ffi::c_void,
|
||||
output: *mut ::core::ffi::c_void,
|
||||
direction: ::core::ffi::c_int,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftXtExecDescriptor(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
input: *mut cuda_types::cufft::cudaLibXtDesc,
|
||||
output: *mut cuda_types::cufft::cudaLibXtDesc,
|
||||
direction: ::core::ffi::c_int,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
fn cufftXtSetWorkAreaPolicy(
|
||||
plan: cuda_types::cufft::cufftHandle,
|
||||
policy: cuda_types::cufft::cufftXtWorkAreaPolicy,
|
||||
workSize: *mut usize,
|
||||
) -> cuda_types::cufft::cufftResult;
|
||||
}
|
|
@ -8423,6 +8423,23 @@ impl cudaDataType_t {
|
|||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub struct cudaDataType_t(pub ::core::ffi::c_uint);
|
||||
pub use self::cudaDataType_t as cudaDataType;
|
||||
#[repr(C)]
|
||||
#[repr(align(8))]
|
||||
#[derive(Debug, Copy, Clone, PartialEq)]
|
||||
pub struct float2 {
|
||||
pub x: f32,
|
||||
pub y: f32,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[repr(align(16))]
|
||||
#[derive(Debug, Copy, Clone, PartialEq)]
|
||||
pub struct double2 {
|
||||
pub x: f64,
|
||||
pub y: f64,
|
||||
}
|
||||
pub type cuFloatComplex = float2;
|
||||
pub type cuDoubleComplex = double2;
|
||||
pub type cuComplex = cuFloatComplex;
|
||||
impl CUerror {
|
||||
pub const INVALID_VALUE: CUerror = CUerror(unsafe {
|
||||
::core::num::NonZeroU32::new_unchecked(1)
|
||||
|
|
385
cuda_types/src/cufft.rs
Normal file
385
cuda_types/src/cufft.rs
Normal file
|
@ -0,0 +1,385 @@
|
|||
// Generated automatically by zluda_bindgen
|
||||
// DO NOT EDIT MANUALLY
|
||||
#![allow(warnings)]
|
||||
pub const CUFFT_VER_MAJOR: u32 = 11;
|
||||
pub const CUFFT_VER_MINOR: u32 = 3;
|
||||
pub const CUFFT_VER_PATCH: u32 = 3;
|
||||
pub const CUFFT_VER_BUILD: u32 = 83;
|
||||
pub const CUFFT_VERSION: u32 = 11303;
|
||||
pub const CUFFT_FORWARD: i32 = -1;
|
||||
pub const CUFFT_INVERSE: u32 = 1;
|
||||
impl cufftResult_t {
|
||||
pub const CUFFT_SUCCESS: cufftResult_t = cufftResult_t(0);
|
||||
}
|
||||
impl cufftResult_t {
|
||||
pub const CUFFT_INVALID_PLAN: cufftResult_t = cufftResult_t(1);
|
||||
}
|
||||
impl cufftResult_t {
|
||||
pub const CUFFT_ALLOC_FAILED: cufftResult_t = cufftResult_t(2);
|
||||
}
|
||||
impl cufftResult_t {
|
||||
pub const CUFFT_INVALID_TYPE: cufftResult_t = cufftResult_t(3);
|
||||
}
|
||||
impl cufftResult_t {
|
||||
pub const CUFFT_INVALID_VALUE: cufftResult_t = cufftResult_t(4);
|
||||
}
|
||||
impl cufftResult_t {
|
||||
pub const CUFFT_INTERNAL_ERROR: cufftResult_t = cufftResult_t(5);
|
||||
}
|
||||
impl cufftResult_t {
|
||||
pub const CUFFT_EXEC_FAILED: cufftResult_t = cufftResult_t(6);
|
||||
}
|
||||
impl cufftResult_t {
|
||||
pub const CUFFT_SETUP_FAILED: cufftResult_t = cufftResult_t(7);
|
||||
}
|
||||
impl cufftResult_t {
|
||||
pub const CUFFT_INVALID_SIZE: cufftResult_t = cufftResult_t(8);
|
||||
}
|
||||
impl cufftResult_t {
|
||||
pub const CUFFT_UNALIGNED_DATA: cufftResult_t = cufftResult_t(9);
|
||||
}
|
||||
impl cufftResult_t {
|
||||
pub const CUFFT_INCOMPLETE_PARAMETER_LIST: cufftResult_t = cufftResult_t(10);
|
||||
}
|
||||
impl cufftResult_t {
|
||||
pub const CUFFT_INVALID_DEVICE: cufftResult_t = cufftResult_t(11);
|
||||
}
|
||||
impl cufftResult_t {
|
||||
pub const CUFFT_PARSE_ERROR: cufftResult_t = cufftResult_t(12);
|
||||
}
|
||||
impl cufftResult_t {
|
||||
pub const CUFFT_NO_WORKSPACE: cufftResult_t = cufftResult_t(13);
|
||||
}
|
||||
impl cufftResult_t {
|
||||
pub const CUFFT_NOT_IMPLEMENTED: cufftResult_t = cufftResult_t(14);
|
||||
}
|
||||
impl cufftResult_t {
|
||||
pub const CUFFT_LICENSE_ERROR: cufftResult_t = cufftResult_t(15);
|
||||
}
|
||||
impl cufftResult_t {
|
||||
pub const CUFFT_NOT_SUPPORTED: cufftResult_t = cufftResult_t(16);
|
||||
}
|
||||
#[repr(transparent)]
|
||||
#[must_use]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub struct cufftResult_t(pub ::core::ffi::c_uint);
|
||||
pub use self::cufftResult_t as cufftResult;
|
||||
pub type cufftReal = f32;
|
||||
pub type cufftDoubleReal = f64;
|
||||
pub type cufftComplex = super::cuda::cuComplex;
|
||||
pub type cufftDoubleComplex = super::cuda::cuDoubleComplex;
|
||||
impl cufftType_t {
|
||||
pub const CUFFT_R2C: cufftType_t = cufftType_t(42);
|
||||
}
|
||||
impl cufftType_t {
|
||||
pub const CUFFT_C2R: cufftType_t = cufftType_t(44);
|
||||
}
|
||||
impl cufftType_t {
|
||||
pub const CUFFT_C2C: cufftType_t = cufftType_t(41);
|
||||
}
|
||||
impl cufftType_t {
|
||||
pub const CUFFT_D2Z: cufftType_t = cufftType_t(106);
|
||||
}
|
||||
impl cufftType_t {
|
||||
pub const CUFFT_Z2D: cufftType_t = cufftType_t(108);
|
||||
}
|
||||
impl cufftType_t {
|
||||
pub const CUFFT_Z2Z: cufftType_t = cufftType_t(105);
|
||||
}
|
||||
#[repr(transparent)]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub struct cufftType_t(pub ::core::ffi::c_uint);
|
||||
pub use self::cufftType_t as cufftType;
|
||||
impl cufftCompatibility_t {
|
||||
pub const CUFFT_COMPATIBILITY_FFTW_PADDING: cufftCompatibility_t = cufftCompatibility_t(
|
||||
1,
|
||||
);
|
||||
}
|
||||
#[repr(transparent)]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub struct cufftCompatibility_t(pub ::core::ffi::c_uint);
|
||||
pub use self::cufftCompatibility_t as cufftCompatibility;
|
||||
pub type cufftHandle = ::core::ffi::c_int;
|
||||
impl cufftProperty_t {
|
||||
pub const NVFFT_PLAN_PROPERTY_INT64_PATIENT_JIT: cufftProperty_t = cufftProperty_t(
|
||||
1,
|
||||
);
|
||||
}
|
||||
impl cufftProperty_t {
|
||||
pub const NVFFT_PLAN_PROPERTY_INT64_MAX_NUM_HOST_THREADS: cufftProperty_t = cufftProperty_t(
|
||||
2,
|
||||
);
|
||||
}
|
||||
#[repr(transparent)]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub struct cufftProperty_t(pub ::core::ffi::c_uint);
|
||||
pub use self::cufftProperty_t as cufftProperty;
|
||||
impl cufftXtSubFormat_t {
|
||||
pub const CUFFT_XT_FORMAT_INPUT: cufftXtSubFormat_t = cufftXtSubFormat_t(0);
|
||||
}
|
||||
impl cufftXtSubFormat_t {
|
||||
pub const CUFFT_XT_FORMAT_OUTPUT: cufftXtSubFormat_t = cufftXtSubFormat_t(1);
|
||||
}
|
||||
impl cufftXtSubFormat_t {
|
||||
pub const CUFFT_XT_FORMAT_INPLACE: cufftXtSubFormat_t = cufftXtSubFormat_t(2);
|
||||
}
|
||||
impl cufftXtSubFormat_t {
|
||||
pub const CUFFT_XT_FORMAT_INPLACE_SHUFFLED: cufftXtSubFormat_t = cufftXtSubFormat_t(
|
||||
3,
|
||||
);
|
||||
}
|
||||
impl cufftXtSubFormat_t {
|
||||
pub const CUFFT_XT_FORMAT_1D_INPUT_SHUFFLED: cufftXtSubFormat_t = cufftXtSubFormat_t(
|
||||
4,
|
||||
);
|
||||
}
|
||||
impl cufftXtSubFormat_t {
|
||||
pub const CUFFT_XT_FORMAT_DISTRIBUTED_INPUT: cufftXtSubFormat_t = cufftXtSubFormat_t(
|
||||
5,
|
||||
);
|
||||
}
|
||||
impl cufftXtSubFormat_t {
|
||||
pub const CUFFT_XT_FORMAT_DISTRIBUTED_OUTPUT: cufftXtSubFormat_t = cufftXtSubFormat_t(
|
||||
6,
|
||||
);
|
||||
}
|
||||
impl cufftXtSubFormat_t {
|
||||
pub const CUFFT_FORMAT_UNDEFINED: cufftXtSubFormat_t = cufftXtSubFormat_t(7);
|
||||
}
|
||||
#[repr(transparent)]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub struct cufftXtSubFormat_t(pub ::core::ffi::c_uint);
|
||||
pub use self::cufftXtSubFormat_t as cufftXtSubFormat;
|
||||
impl cufftXtCopyType_t {
|
||||
pub const CUFFT_COPY_HOST_TO_DEVICE: cufftXtCopyType_t = cufftXtCopyType_t(0);
|
||||
}
|
||||
impl cufftXtCopyType_t {
|
||||
pub const CUFFT_COPY_DEVICE_TO_HOST: cufftXtCopyType_t = cufftXtCopyType_t(1);
|
||||
}
|
||||
impl cufftXtCopyType_t {
|
||||
pub const CUFFT_COPY_DEVICE_TO_DEVICE: cufftXtCopyType_t = cufftXtCopyType_t(2);
|
||||
}
|
||||
impl cufftXtCopyType_t {
|
||||
pub const CUFFT_COPY_UNDEFINED: cufftXtCopyType_t = cufftXtCopyType_t(3);
|
||||
}
|
||||
#[repr(transparent)]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub struct cufftXtCopyType_t(pub ::core::ffi::c_uint);
|
||||
pub use self::cufftXtCopyType_t as cufftXtCopyType;
|
||||
impl cufftXtQueryType_t {
|
||||
pub const CUFFT_QUERY_1D_FACTORS: cufftXtQueryType_t = cufftXtQueryType_t(0);
|
||||
}
|
||||
impl cufftXtQueryType_t {
|
||||
pub const CUFFT_QUERY_UNDEFINED: cufftXtQueryType_t = cufftXtQueryType_t(1);
|
||||
}
|
||||
#[repr(transparent)]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub struct cufftXtQueryType_t(pub ::core::ffi::c_uint);
|
||||
pub use self::cufftXtQueryType_t as cufftXtQueryType;
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub struct cufftXt1dFactors_t {
|
||||
pub size: ::core::ffi::c_longlong,
|
||||
pub stringCount: ::core::ffi::c_longlong,
|
||||
pub stringLength: ::core::ffi::c_longlong,
|
||||
pub substringLength: ::core::ffi::c_longlong,
|
||||
pub factor1: ::core::ffi::c_longlong,
|
||||
pub factor2: ::core::ffi::c_longlong,
|
||||
pub stringMask: ::core::ffi::c_longlong,
|
||||
pub substringMask: ::core::ffi::c_longlong,
|
||||
pub factor1Mask: ::core::ffi::c_longlong,
|
||||
pub factor2Mask: ::core::ffi::c_longlong,
|
||||
pub stringShift: ::core::ffi::c_int,
|
||||
pub substringShift: ::core::ffi::c_int,
|
||||
pub factor1Shift: ::core::ffi::c_int,
|
||||
pub factor2Shift: ::core::ffi::c_int,
|
||||
}
|
||||
pub type cufftXt1dFactors = cufftXt1dFactors_t;
|
||||
impl cufftXtWorkAreaPolicy_t {
|
||||
pub const CUFFT_WORKAREA_MINIMAL: cufftXtWorkAreaPolicy_t = cufftXtWorkAreaPolicy_t(
|
||||
0,
|
||||
);
|
||||
}
|
||||
impl cufftXtWorkAreaPolicy_t {
|
||||
pub const CUFFT_WORKAREA_USER: cufftXtWorkAreaPolicy_t = cufftXtWorkAreaPolicy_t(1);
|
||||
}
|
||||
impl cufftXtWorkAreaPolicy_t {
|
||||
pub const CUFFT_WORKAREA_PERFORMANCE: cufftXtWorkAreaPolicy_t = cufftXtWorkAreaPolicy_t(
|
||||
2,
|
||||
);
|
||||
}
|
||||
#[repr(transparent)]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub struct cufftXtWorkAreaPolicy_t(pub ::core::ffi::c_uint);
|
||||
pub use self::cufftXtWorkAreaPolicy_t as cufftXtWorkAreaPolicy;
|
||||
impl cufftXtCallbackType_t {
|
||||
pub const CUFFT_CB_LD_COMPLEX: cufftXtCallbackType_t = cufftXtCallbackType_t(0);
|
||||
}
|
||||
impl cufftXtCallbackType_t {
|
||||
pub const CUFFT_CB_LD_COMPLEX_DOUBLE: cufftXtCallbackType_t = cufftXtCallbackType_t(
|
||||
1,
|
||||
);
|
||||
}
|
||||
impl cufftXtCallbackType_t {
|
||||
pub const CUFFT_CB_LD_REAL: cufftXtCallbackType_t = cufftXtCallbackType_t(2);
|
||||
}
|
||||
impl cufftXtCallbackType_t {
|
||||
pub const CUFFT_CB_LD_REAL_DOUBLE: cufftXtCallbackType_t = cufftXtCallbackType_t(3);
|
||||
}
|
||||
impl cufftXtCallbackType_t {
|
||||
pub const CUFFT_CB_ST_COMPLEX: cufftXtCallbackType_t = cufftXtCallbackType_t(4);
|
||||
}
|
||||
impl cufftXtCallbackType_t {
|
||||
pub const CUFFT_CB_ST_COMPLEX_DOUBLE: cufftXtCallbackType_t = cufftXtCallbackType_t(
|
||||
5,
|
||||
);
|
||||
}
|
||||
impl cufftXtCallbackType_t {
|
||||
pub const CUFFT_CB_ST_REAL: cufftXtCallbackType_t = cufftXtCallbackType_t(6);
|
||||
}
|
||||
impl cufftXtCallbackType_t {
|
||||
pub const CUFFT_CB_ST_REAL_DOUBLE: cufftXtCallbackType_t = cufftXtCallbackType_t(7);
|
||||
}
|
||||
impl cufftXtCallbackType_t {
|
||||
pub const CUFFT_CB_UNDEFINED: cufftXtCallbackType_t = cufftXtCallbackType_t(8);
|
||||
}
|
||||
#[repr(transparent)]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub struct cufftXtCallbackType_t(pub ::core::ffi::c_uint);
|
||||
pub use self::cufftXtCallbackType_t as cufftXtCallbackType;
|
||||
pub type cufftCallbackLoadC = ::core::option::Option<
|
||||
unsafe extern "C" fn(
|
||||
dataIn: *mut ::core::ffi::c_void,
|
||||
offset: usize,
|
||||
callerInfo: *mut ::core::ffi::c_void,
|
||||
sharedPointer: *mut ::core::ffi::c_void,
|
||||
) -> cufftComplex,
|
||||
>;
|
||||
pub type cufftCallbackLoadZ = ::core::option::Option<
|
||||
unsafe extern "C" fn(
|
||||
dataIn: *mut ::core::ffi::c_void,
|
||||
offset: usize,
|
||||
callerInfo: *mut ::core::ffi::c_void,
|
||||
sharedPointer: *mut ::core::ffi::c_void,
|
||||
) -> cufftDoubleComplex,
|
||||
>;
|
||||
pub type cufftCallbackLoadR = ::core::option::Option<
|
||||
unsafe extern "C" fn(
|
||||
dataIn: *mut ::core::ffi::c_void,
|
||||
offset: usize,
|
||||
callerInfo: *mut ::core::ffi::c_void,
|
||||
sharedPointer: *mut ::core::ffi::c_void,
|
||||
) -> cufftReal,
|
||||
>;
|
||||
pub type cufftCallbackLoadD = ::core::option::Option<
|
||||
unsafe extern "C" fn(
|
||||
dataIn: *mut ::core::ffi::c_void,
|
||||
offset: usize,
|
||||
callerInfo: *mut ::core::ffi::c_void,
|
||||
sharedPointer: *mut ::core::ffi::c_void,
|
||||
) -> cufftDoubleReal,
|
||||
>;
|
||||
pub type cufftCallbackStoreC = ::core::option::Option<
|
||||
unsafe extern "C" fn(
|
||||
dataOut: *mut ::core::ffi::c_void,
|
||||
offset: usize,
|
||||
element: cufftComplex,
|
||||
callerInfo: *mut ::core::ffi::c_void,
|
||||
sharedPointer: *mut ::core::ffi::c_void,
|
||||
),
|
||||
>;
|
||||
pub type cufftCallbackStoreZ = ::core::option::Option<
|
||||
unsafe extern "C" fn(
|
||||
dataOut: *mut ::core::ffi::c_void,
|
||||
offset: usize,
|
||||
element: cufftDoubleComplex,
|
||||
callerInfo: *mut ::core::ffi::c_void,
|
||||
sharedPointer: *mut ::core::ffi::c_void,
|
||||
),
|
||||
>;
|
||||
pub type cufftCallbackStoreR = ::core::option::Option<
|
||||
unsafe extern "C" fn(
|
||||
dataOut: *mut ::core::ffi::c_void,
|
||||
offset: usize,
|
||||
element: cufftReal,
|
||||
callerInfo: *mut ::core::ffi::c_void,
|
||||
sharedPointer: *mut ::core::ffi::c_void,
|
||||
),
|
||||
>;
|
||||
pub type cufftCallbackStoreD = ::core::option::Option<
|
||||
unsafe extern "C" fn(
|
||||
dataOut: *mut ::core::ffi::c_void,
|
||||
offset: usize,
|
||||
element: cufftDoubleReal,
|
||||
callerInfo: *mut ::core::ffi::c_void,
|
||||
sharedPointer: *mut ::core::ffi::c_void,
|
||||
),
|
||||
>;
|
||||
pub type cufftJITCallbackLoadC = ::core::option::Option<
|
||||
unsafe extern "C" fn(
|
||||
dataIn: *mut ::core::ffi::c_void,
|
||||
offset: ::core::ffi::c_ulonglong,
|
||||
callerInfo: *mut ::core::ffi::c_void,
|
||||
sharedPointer: *mut ::core::ffi::c_void,
|
||||
) -> cufftComplex,
|
||||
>;
|
||||
pub type cufftJITCallbackLoadZ = ::core::option::Option<
|
||||
unsafe extern "C" fn(
|
||||
dataIn: *mut ::core::ffi::c_void,
|
||||
offset: ::core::ffi::c_ulonglong,
|
||||
callerInfo: *mut ::core::ffi::c_void,
|
||||
sharedPointer: *mut ::core::ffi::c_void,
|
||||
) -> cufftDoubleComplex,
|
||||
>;
|
||||
pub type cufftJITCallbackLoadR = ::core::option::Option<
|
||||
unsafe extern "C" fn(
|
||||
dataIn: *mut ::core::ffi::c_void,
|
||||
offset: ::core::ffi::c_ulonglong,
|
||||
callerInfo: *mut ::core::ffi::c_void,
|
||||
sharedPointer: *mut ::core::ffi::c_void,
|
||||
) -> cufftReal,
|
||||
>;
|
||||
pub type cufftJITCallbackLoadD = ::core::option::Option<
|
||||
unsafe extern "C" fn(
|
||||
dataIn: *mut ::core::ffi::c_void,
|
||||
offset: ::core::ffi::c_ulonglong,
|
||||
callerInfo: *mut ::core::ffi::c_void,
|
||||
sharedPointer: *mut ::core::ffi::c_void,
|
||||
) -> cufftDoubleReal,
|
||||
>;
|
||||
pub type cufftJITCallbackStoreC = ::core::option::Option<
|
||||
unsafe extern "C" fn(
|
||||
dataOut: *mut ::core::ffi::c_void,
|
||||
offset: ::core::ffi::c_ulonglong,
|
||||
element: cufftComplex,
|
||||
callerInfo: *mut ::core::ffi::c_void,
|
||||
sharedPointer: *mut ::core::ffi::c_void,
|
||||
),
|
||||
>;
|
||||
pub type cufftJITCallbackStoreZ = ::core::option::Option<
|
||||
unsafe extern "C" fn(
|
||||
dataOut: *mut ::core::ffi::c_void,
|
||||
offset: ::core::ffi::c_ulonglong,
|
||||
element: cufftDoubleComplex,
|
||||
callerInfo: *mut ::core::ffi::c_void,
|
||||
sharedPointer: *mut ::core::ffi::c_void,
|
||||
),
|
||||
>;
|
||||
pub type cufftJITCallbackStoreR = ::core::option::Option<
|
||||
unsafe extern "C" fn(
|
||||
dataOut: *mut ::core::ffi::c_void,
|
||||
offset: ::core::ffi::c_ulonglong,
|
||||
element: cufftReal,
|
||||
callerInfo: *mut ::core::ffi::c_void,
|
||||
sharedPointer: *mut ::core::ffi::c_void,
|
||||
),
|
||||
>;
|
||||
pub type cufftJITCallbackStoreD = ::core::option::Option<
|
||||
unsafe extern "C" fn(
|
||||
dataOut: *mut ::core::ffi::c_void,
|
||||
offset: ::core::ffi::c_ulonglong,
|
||||
element: cufftDoubleReal,
|
||||
callerInfo: *mut ::core::ffi::c_void,
|
||||
sharedPointer: *mut ::core::ffi::c_void,
|
||||
),
|
||||
>;
|
|
@ -4,4 +4,5 @@ pub mod cuda;
|
|||
pub mod cudnn;
|
||||
pub mod cudnn8;
|
||||
pub mod cudnn9;
|
||||
pub mod cufft;
|
||||
pub mod nvml;
|
||||
|
|
|
@ -6,3 +6,4 @@
|
|||
#include <vdpau/vdpau.h>
|
||||
#include <cudaVDPAU.h>
|
||||
#include <library_types.h>
|
||||
#include <cuComplex.h>
|
||||
|
|
|
@ -21,6 +21,33 @@ fn main() {
|
|||
generate_cublas(&crate_root);
|
||||
generate_cublaslt(&crate_root);
|
||||
generate_cudnn(&crate_root);
|
||||
generate_cufft(&crate_root);
|
||||
}
|
||||
|
||||
fn generate_cufft(crate_root: &PathBuf) {
|
||||
let cufft_header = new_builder()
|
||||
.header("/usr/local/cuda/include/cufftXt.h")
|
||||
.allowlist_type("^cufft.*")
|
||||
.allowlist_function("^cufft.*")
|
||||
.allowlist_var("^CUFFT_.*")
|
||||
.must_use_type("cufftResult_t")
|
||||
.allowlist_recursively(false)
|
||||
.clang_args(["-I/usr/local/cuda/include"])
|
||||
.generate()
|
||||
.unwrap()
|
||||
.to_string();
|
||||
let module: syn::File = syn::parse_str(&cufft_header).unwrap();
|
||||
generate_functions(
|
||||
&crate_root,
|
||||
"cufft",
|
||||
&["..", "cuda_base", "src", "cufft.rs"],
|
||||
&module,
|
||||
);
|
||||
generate_types_library(
|
||||
&crate_root,
|
||||
&["..", "cuda_types", "src", "cufft.rs"],
|
||||
&module,
|
||||
)
|
||||
}
|
||||
|
||||
fn generate_cudnn(crate_root: &PathBuf) {
|
||||
|
@ -35,14 +62,8 @@ fn generate_cudnn(crate_root: &PathBuf) {
|
|||
.generate()
|
||||
.unwrap()
|
||||
.to_string();
|
||||
let module: syn::File = syn::parse_str(&cudnn9).unwrap();
|
||||
let cudnn9_types = generate_types_library_impl(&module);
|
||||
//generate_functions(
|
||||
// &crate_root,
|
||||
// "cudnn9",
|
||||
// &["..", "cuda_base", "src", "cudnn9.rs"],
|
||||
// &module,
|
||||
//);
|
||||
let cudnn9_module: syn::File = syn::parse_str(&cudnn9).unwrap();
|
||||
let cudnn9_types = generate_types_library_impl(&cudnn9_module);
|
||||
let mut current_dir = PathBuf::from(file!());
|
||||
current_dir.pop();
|
||||
let cudnn8 = new_builder()
|
||||
|
@ -59,14 +80,8 @@ fn generate_cudnn(crate_root: &PathBuf) {
|
|||
.generate()
|
||||
.unwrap()
|
||||
.to_string();
|
||||
let module: syn::File = syn::parse_str(&cudnn8).unwrap();
|
||||
let cudnn8_types = generate_types_library_impl(&module);
|
||||
//generate_functions(
|
||||
// &crate_root,
|
||||
// "cudnn8",
|
||||
// &["..", "cuda_base", "src", "cudnn8.rs"],
|
||||
// &module,
|
||||
//);
|
||||
let cudnn8_module: syn::File = syn::parse_str(&cudnn8).unwrap();
|
||||
let cudnn8_types = generate_types_library_impl(&cudnn8_module);
|
||||
merge_types(
|
||||
&crate_root,
|
||||
&["..", "cuda_types", "src", "cudnn.rs"],
|
||||
|
@ -75,6 +90,18 @@ fn generate_cudnn(crate_root: &PathBuf) {
|
|||
cudnn8_types,
|
||||
&["..", "cuda_types", "src", "cudnn8.rs"],
|
||||
);
|
||||
generate_functions(
|
||||
&crate_root,
|
||||
"cudnn8",
|
||||
&["..", "cuda_base", "src", "cudnn8.rs"],
|
||||
&cudnn8_module,
|
||||
);
|
||||
generate_functions(
|
||||
&crate_root,
|
||||
"cudnn9",
|
||||
&["..", "cuda_base", "src", "cudnn9.rs"],
|
||||
&cudnn9_module,
|
||||
);
|
||||
}
|
||||
|
||||
// This code splits types (and constants) into one of:
|
||||
|
@ -459,6 +486,7 @@ fn generate_cuda(crate_root: &PathBuf) {
|
|||
.header_contents("cuda_wrapper.h", include_str!("../build/cuda_wrapper.h"))
|
||||
.allowlist_type("^CU.*")
|
||||
.allowlist_type("^cuda.*")
|
||||
.allowlist_type("^cu.*Complex.*")
|
||||
.allowlist_function("^cu.*")
|
||||
.allowlist_var("^CU.*")
|
||||
.must_use_type("cudaError_enum")
|
||||
|
@ -543,8 +571,11 @@ fn generate_types_library(crate_root: &PathBuf, path: &[&str], module: &syn::Fil
|
|||
let module = generate_types_library_impl(module);
|
||||
let mut output = crate_root.clone();
|
||||
output.extend(path);
|
||||
let text =
|
||||
prettyplease::unparse(&module).replace("self::cudaDataType", "super::cuda::cudaDataType");
|
||||
let text = prettyplease::unparse(&module)
|
||||
.replace("self::cudaDataType", "super::cuda::cudaDataType")
|
||||
// complex as used by cuFFT
|
||||
.replace("cuComplex", "super::cuda::cuComplex")
|
||||
.replace("cuDoubleComplex", "super::cuda::cuDoubleComplex");
|
||||
write_rust_to_file(output, &text)
|
||||
}
|
||||
|
||||
|
|
|
@ -26370,6 +26370,34 @@ impl crate::format::CudaDisplay for cuda_types::cuda::cudaDataType_t {
|
|||
}
|
||||
}
|
||||
}
|
||||
impl crate::format::CudaDisplay for cuda_types::cuda::float2 {
|
||||
fn write(
|
||||
&self,
|
||||
_fn_name: &'static str,
|
||||
_index: usize,
|
||||
writer: &mut (impl std::io::Write + ?Sized),
|
||||
) -> std::io::Result<()> {
|
||||
writer.write_all(concat!("{ ", stringify!(x), ": ").as_bytes())?;
|
||||
crate::format::CudaDisplay::write(&self.x, "", 0, writer)?;
|
||||
writer.write_all(concat!(", ", stringify!(y), ": ").as_bytes())?;
|
||||
crate::format::CudaDisplay::write(&self.y, "", 0, writer)?;
|
||||
writer.write_all(b" }")
|
||||
}
|
||||
}
|
||||
impl crate::format::CudaDisplay for cuda_types::cuda::double2 {
|
||||
fn write(
|
||||
&self,
|
||||
_fn_name: &'static str,
|
||||
_index: usize,
|
||||
writer: &mut (impl std::io::Write + ?Sized),
|
||||
) -> std::io::Result<()> {
|
||||
writer.write_all(concat!("{ ", stringify!(x), ": ").as_bytes())?;
|
||||
crate::format::CudaDisplay::write(&self.x, "", 0, writer)?;
|
||||
writer.write_all(concat!(", ", stringify!(y), ": ").as_bytes())?;
|
||||
crate::format::CudaDisplay::write(&self.y, "", 0, writer)?;
|
||||
writer.write_all(b" }")
|
||||
}
|
||||
}
|
||||
impl crate::format::CudaDisplay for cuda_types::cuda::CUresult {
|
||||
fn write(
|
||||
&self,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue