Skip to content

Low Level Linear Algebra Library for OpenCL

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

timo-42/ocl-algebra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ocl-algebra

Low Level Linear Algebra Library for OpenCL

goals

  • simple low level linear algebra api
  • implement an synchron api (copy data to device, math operation, copy result to host and delete data on device)
  • todo: implement asynchron api, run multiple math operation without always copying data to/from the device
  • library may be useful as alternative backend for pure rust alebra libraries

example

From [examples/simple.rs]:

extern crate ocl_algebra;

use ocl_algebra::*;

func main() {
    // init library
    let mut c = new();
    
    // init some matrices
    let m0 = Matrix{rows: 2, cols: 2, data: vec![1.0, 2.0, 3.0, 4.0]};
    let m1 = Matrix{rows: 2, cols: 1, data: vec![4.0, 5.0]};
    
    /* matrix multiplication
       [1 2] * [4] = [14]
       [3 4]   [5]   [32] */
    let m = c.mul_matrix_matrix(&m0,&m1);
    
    /* matrix scalar multiplication 
       [1 2] * 1.5 = [1.5 3]
       [3 4]         [4.5 6]*/
    let m = c.mul_matrix_scalar(&m0,1.5);
}

Development

License

Licensed under either of:

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


“OpenCL and the OpenCL logo are trademarks of Apple Inc. used by permission by Khronos.” “Vulkan and the Vulkan logo are trademarks of the Khronos Group Inc.”

About

Low Level Linear Algebra Library for OpenCL

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages