Struct cublas::API
[−]
[src]
pub struct API;
Defines the cuBLAS API.
Methods
impl API
[src]
fn asum(
context: &Context,
x: *mut f32,
result: *mut f32,
n: i32,
stride: Option<i32>
) -> Result<(), Error>
context: &Context,
x: *mut f32,
result: *mut f32,
n: i32,
stride: Option<i32>
) -> Result<(), Error>
Compute the sum of magnitudes of the provided vector elements.
x
: pointer to input vector.
result
: pointer to output scalar.
n
: number of elements to compute sum over (should not be greater than x
).
stride
: offset from one input element to the next. Defaults to 1
.
fn axpy(
context: &Context,
alpha: *mut f32,
x: *mut f32,
y: *mut f32,
n: i32,
stride_x: Option<i32>,
stride_y: Option<i32>
) -> Result<(), Error>
context: &Context,
alpha: *mut f32,
x: *mut f32,
y: *mut f32,
n: i32,
stride_x: Option<i32>,
stride_y: Option<i32>
) -> Result<(), Error>
Computes a vector-scalar product and adds the result to a vector.
alpha
: pointer to input scalar.
x
: pointer to input vector.
y
: pointer to output vector.
n
: number of elements to use for operation (should not be greater than number of elements in x
or y
).
stride_x
: offset from one element in x to the next. Defaults to 1
.
stride_y
: offset from one element in y to the next. Defaults to 1
.
fn copy(
context: &Context,
x: *mut f32,
y: *mut f32,
n: i32,
stride_x: Option<i32>,
stride_y: Option<i32>
) -> Result<(), Error>
context: &Context,
x: *mut f32,
y: *mut f32,
n: i32,
stride_x: Option<i32>,
stride_y: Option<i32>
) -> Result<(), Error>
Copies a vector into another vector.
x
: pointer to input vector.
y
: pointer to output vector.
n
: number of elements to use for operation (should not be greater than number of elements in x
or y
).
stride_x
: offset from one element in x to the next. Defaults to 1
.
stride_y
: offset from one element in y to the next. Defaults to 1
.
fn dot(
context: &Context,
x: *mut f32,
y: *mut f32,
result: *mut f32,
n: i32,
stride_x: Option<i32>,
stride_y: Option<i32>
) -> Result<(), Error>
context: &Context,
x: *mut f32,
y: *mut f32,
result: *mut f32,
n: i32,
stride_x: Option<i32>,
stride_y: Option<i32>
) -> Result<(), Error>
TODO: DOC
fn nrm2(
context: &Context,
x: *mut f32,
result: *mut f32,
n: i32,
stride_x: Option<i32>
) -> Result<(), Error>
context: &Context,
x: *mut f32,
result: *mut f32,
n: i32,
stride_x: Option<i32>
) -> Result<(), Error>
TODO: DOC
fn scal(
context: &Context,
alpha: *mut f32,
x: *mut f32,
n: i32,
stride_x: Option<i32>
) -> Result<(), Error>
context: &Context,
alpha: *mut f32,
x: *mut f32,
n: i32,
stride_x: Option<i32>
) -> Result<(), Error>
TODO: DOC
fn swap(
context: &Context,
x: *mut f32,
y: *mut f32,
n: i32,
stride_x: Option<i32>,
stride_y: Option<i32>
) -> Result<(), Error>
context: &Context,
x: *mut f32,
y: *mut f32,
n: i32,
stride_x: Option<i32>,
stride_y: Option<i32>
) -> Result<(), Error>
TODO: DOC
impl API
[src]
fn gemm(
context: &Context,
transa: Operation,
transb: Operation,
m: i32,
n: i32,
k: i32,
alpha: *mut f32,
a: *mut f32,
lda: i32,
b: *mut f32,
ldb: i32,
beta: *mut f32,
c: *mut f32,
ldc: i32
) -> Result<(), Error>
context: &Context,
transa: Operation,
transb: Operation,
m: i32,
n: i32,
k: i32,
alpha: *mut f32,
a: *mut f32,
lda: i32,
b: *mut f32,
ldb: i32,
beta: *mut f32,
c: *mut f32,
ldc: i32
) -> Result<(), Error>
Performs a general matrix-matrix multiplication.
Note: the matrices are expected to be ordered column-major (FORTRAN-style).
impl API
[src]
fn create() -> Result<Context, Error>
Create a new cuBLAS context, allocating resources on the host and the GPU.
The returned Context must be provided to future cuBLAS calls. Creating contexts all the time can lead to performance problems. Generally one Context per GPU device and configuration is recommended.
unsafe fn destroy(context: &mut Context) -> Result<(), Error>
Destroys the cuBLAS context, freeing its resources.
Should generally not be called directly. Automatically called when dropping a Context.
fn get_pointer_mode(context: &Context) -> Result<PointerMode, Error>
Retrieve the pointer mode for a given cuBLAS context.
fn set_pointer_mode(
context: &mut Context,
pointer_mode: PointerMode
) -> Result<(), Error>
context: &mut Context,
pointer_mode: PointerMode
) -> Result<(), Error>
Set the pointer mode for a given cuBLAS context.
Trait Implementations
impl Debug for API
[src]
impl Copy for API
[src]
impl Clone for API
[src]
fn clone(&self) -> API
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more