collenchyma_blas/
transpose.rs1#[cfg(feature = "cuda")]
3use std::convert::From;
4#[cfg(feature = "cuda")]
5use cublas::api::Operation;
6
7#[derive(Debug, Copy, Clone)]
8pub enum Transpose {
10 NoTrans,
12 Trans,
14 ConjTrans,
16}
17
18impl Transpose {
19 pub fn to_rblas(&self) -> ::rblas::attribute::Transpose {
21 match *self {
22 Transpose::NoTrans => ::rblas::attribute::Transpose::NoTrans,
23 Transpose::Trans => ::rblas::attribute::Transpose::Trans,
24 Transpose::ConjTrans => ::rblas::attribute::Transpose::ConjTrans,
25 }
26 }
27}
28
29#[cfg(feature = "cuda")]
30impl From<Operation> for Transpose {
31 fn from(op: Operation) -> Self {
32 match op {
33 Operation::NoTrans => Transpose::NoTrans,
34 Operation::Trans => Transpose::Trans,
35 Operation::ConjTrans => Transpose::ConjTrans,
36 }
37 }
38}
39
40#[cfg(feature = "cuda")]
41impl From<Transpose> for Operation {
42 fn from(op: Transpose) -> Self {
43 match op {
44 Transpose::NoTrans => Operation::NoTrans,
45 Transpose::Trans => Operation::Trans,
46 Transpose::ConjTrans => Operation::ConjTrans,
47 }
48 }
49}