-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat/features: add framework feature groups
- Loading branch information
Showing
10 changed files
with
410 additions
and
355 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,26 +2,34 @@ | |
name = "collenchyma-blas" | ||
description = "Collenchyma library for full BLAS support" | ||
version = "0.1.0" | ||
authors = ["MichaelHirn <[email protected]>"] | ||
authors = ["MichaelHirn <[email protected]>", | ||
"Maximilian Goisser <[email protected]>"] | ||
|
||
repository = "https://github.com/autumnai/collenchyma-blas" | ||
homepage = "https://github.com/autumnai/collenchyma-blas" | ||
documentation = "https://autumnai.github.io/collenchyma-blas" | ||
readme = "README.md" | ||
|
||
keywords = ["blas", "collenchyma", "computation", "hpc"] | ||
keywords = ["blas", "collenchyma", "computation", "hpc", "plugin"] | ||
license = "MIT" | ||
|
||
[dependencies] | ||
collenchyma = "0.0.4" | ||
rblas = "0.0.11" | ||
collenchyma = { version = "0.0.5", default-features = false } | ||
|
||
rblas = { version = "0.0.11", optional = true } | ||
|
||
clippy = { version = "0.0.27", optional = true } | ||
|
||
[dev-dependencies] | ||
|
||
rand = "0.3" | ||
|
||
[features] | ||
default = ["native", "cuda", "opencl"] | ||
native = ["collenchyma/native", "rblas"] | ||
cuda = ["collenchyma/cuda"] | ||
opencl = ["collenchyma/opencl"] | ||
|
||
travis = ["native"] | ||
dev = [] | ||
travis = [] | ||
lint = ["clippy"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,103 +1,103 @@ | ||
//! Provides BLAS for a OpenCL backend. | ||
use ::operation::*; | ||
use ::binary::*; | ||
use ::library::*; | ||
use collenchyma::backend::Backend; | ||
use collenchyma::device::DeviceType; | ||
use collenchyma::memory::MemoryType; | ||
use collenchyma::plugin::Error; | ||
use collenchyma::frameworks::cuda::{Function, Module, Cuda}; | ||
|
||
impl IBlasBinary<f32> for Module { | ||
type Asum = Function; | ||
type Axpy = Function; | ||
type Copy = Function; | ||
type Dot = Function; | ||
type Nrm2 = Function; | ||
|
||
type Scale = Function; | ||
type Swap = Function; | ||
|
||
fn asum(&self) -> Self::Asum { | ||
unimplemented!() | ||
} | ||
|
||
fn axpy(&self) -> Self::Axpy { | ||
self.blas_axpy | ||
} | ||
|
||
fn copy(&self) -> Self::Copy { | ||
unimplemented!() | ||
} | ||
|
||
fn dot(&self) -> Self::Dot { | ||
self.blas_dot | ||
} | ||
|
||
fn nrm2(&self) -> Self::Nrm2 { | ||
unimplemented!() | ||
} | ||
|
||
fn scale(&self) -> Self::Scale { | ||
self.blas_scale | ||
} | ||
|
||
fn swap(&self) -> Self::Swap { | ||
unimplemented!() | ||
} | ||
} | ||
|
||
impl IOperationAsum<f32> for Function { | ||
fn compute(&self, x: &MemoryType, result: &mut MemoryType) -> Result<(), Error> { | ||
unimplemented!() | ||
} | ||
} | ||
|
||
impl IOperationAxpy<f32> for Function { | ||
fn compute(&self, a: &MemoryType, x: &MemoryType, y: &mut MemoryType) -> Result<(), Error> { | ||
unimplemented!() | ||
} | ||
} | ||
|
||
impl IOperationCopy<f32> for Function { | ||
fn compute(&self, x: &MemoryType, y: &mut MemoryType) -> Result<(), Error> { | ||
unimplemented!() | ||
} | ||
} | ||
|
||
impl IOperationDot<f32> for Function { | ||
fn compute(&self, x: &MemoryType, y: &MemoryType, result: &mut MemoryType) -> Result<(), Error> { | ||
unimplemented!() | ||
} | ||
} | ||
|
||
impl IOperationNrm2<f32> for Function { | ||
fn compute(&self, x: &MemoryType, result: &mut MemoryType) -> Result<(), Error> { | ||
unimplemented!() | ||
} | ||
} | ||
|
||
impl IOperationScale<f32> for Function { | ||
fn compute(&self, a: &MemoryType, x: &mut MemoryType) -> Result<(), Error> { | ||
unimplemented!() | ||
} | ||
} | ||
|
||
impl IOperationSwap<f32> for Function { | ||
fn compute(&self, x: &mut MemoryType, y: &mut MemoryType) -> Result<(), Error> { | ||
unimplemented!() | ||
} | ||
} | ||
|
||
impl IBlas<f32> for Backend<Cuda> { | ||
type B = Module; | ||
|
||
fn binary(&self) -> &Self::B { | ||
self.binary() | ||
} | ||
|
||
fn device(&self) -> &DeviceType { | ||
self.device() | ||
} | ||
} | ||
// #![allow(unused_variables)] | ||
// use ::operation::*; | ||
// use ::binary::*; | ||
// use ::library::*; | ||
// use collenchyma::backend::Backend; | ||
// use collenchyma::device::DeviceType; | ||
// use collenchyma::memory::MemoryType; | ||
// use collenchyma::plugin::Error; | ||
// use collenchyma::frameworks::cuda::{Function, Module, Cuda}; | ||
// | ||
// impl IBlasBinary<f32> for Module { | ||
// type Asum = Function; | ||
// type Axpy = Function; | ||
// type Copy = Function; | ||
// type Dot = Function; | ||
// type Nrm2 = Function; | ||
// | ||
// type Scale = Function; | ||
// type Swap = Function; | ||
// | ||
// fn asum(&self) -> Self::Asum { | ||
// unimplemented!() | ||
// } | ||
// | ||
// fn axpy(&self) -> Self::Axpy { | ||
// self.blas_axpy | ||
// } | ||
// | ||
// fn copy(&self) -> Self::Copy { | ||
// unimplemented!() | ||
// } | ||
// | ||
// fn dot(&self) -> Self::Dot { | ||
// self.blas_dot | ||
// } | ||
// | ||
// fn nrm2(&self) -> Self::Nrm2 { | ||
// unimplemented!() | ||
// } | ||
// | ||
// fn scale(&self) -> Self::Scale { | ||
// self.blas_scale | ||
// } | ||
// | ||
// fn swap(&self) -> Self::Swap { | ||
// unimplemented!() | ||
// } | ||
// } | ||
// | ||
// impl IOperationAsum<f32> for Function { | ||
// fn compute(&self, x: &MemoryType, result: &mut MemoryType) -> Result<(), Error> { | ||
// unimplemented!() | ||
// } | ||
// } | ||
// | ||
// impl IOperationAxpy<f32> for Function { | ||
// fn compute(&self, a: &MemoryType, x: &MemoryType, y: &mut MemoryType) -> Result<(), Error> { | ||
// unimplemented!() | ||
// } | ||
// } | ||
// | ||
// impl IOperationCopy<f32> for Function { | ||
// fn compute(&self, x: &MemoryType, y: &mut MemoryType) -> Result<(), Error> { | ||
// unimplemented!() | ||
// } | ||
// } | ||
// | ||
// impl IOperationDot<f32> for Function { | ||
// fn compute(&self, x: &MemoryType, y: &MemoryType, result: &mut MemoryType) -> Result<(), Error> { | ||
// unimplemented!() | ||
// } | ||
// } | ||
// | ||
// impl IOperationNrm2<f32> for Function { | ||
// fn compute(&self, x: &MemoryType, result: &mut MemoryType) -> Result<(), Error> { | ||
// unimplemented!() | ||
// } | ||
// } | ||
// | ||
// impl IOperationScale<f32> for Function { | ||
// fn compute(&self, a: &MemoryType, x: &mut MemoryType) -> Result<(), Error> { | ||
// unimplemented!() | ||
// } | ||
// } | ||
// | ||
// impl IOperationSwap<f32> for Function { | ||
// fn compute(&self, x: &mut MemoryType, y: &mut MemoryType) -> Result<(), Error> { | ||
// unimplemented!() | ||
// } | ||
// } | ||
// | ||
// impl IBlas<f32> for Backend<Cuda> { | ||
// type B = Module; | ||
// | ||
// fn binary(&self) -> &Self::B { | ||
// self.binary() | ||
// } | ||
// | ||
// fn device(&self) -> &DeviceType { | ||
// self.device() | ||
// } | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
//! Provides the specific Framework implementations for the Library Operations. | ||
#[cfg(feature = "native")] | ||
mod native; | ||
mod opencl; | ||
#[cfg(feature = "cuda")] | ||
mod cuda; | ||
#[cfg(feature = "opencl")] | ||
mod opencl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.