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