A C/C++ based OpenCL library which utilizes the power of parallel computing to perform NumPy based matrix operations.
- Easy Python UI for NumPy Matrix Multiplications
- Accomodation for CPU/GPU setups
- Lightweight Codebase
Clear steps to install your project. Include both simple and advanced installation methods:
# Simple installation
pip install blitzmat
# Installation from source
git clone https://github.com/deflucaseng/blitzmat.git
cd project
pip install -e .
Simple Python Library based UI:
import numpy as np
from blitzmul import blitz
# For basic matrix multiplication
A = np.array([[1, 2],
[3, 4]])
B = np.array([[5, 6],
[7, 8]])
C = blitz.mat_mul(A, B)
print(C)
Explain any configuration options and how to use them:
# Example configuration file
from blitzmat import blitz
blitz.set_device("CPU") #Searches for an available CPU and utilizes it for computation
blitz.set_device("GPU") #Searches for an available GPU and utilizes it for parallel computation
Starter Code:
from blitzmat import blitz
import numpy
blitz.set_device("GPU") #Note it defaults to CPU
A = np.array([[1, 2],
[3, 4]])
B = np.array([[5, 6],
[7, 8]])
Supported operations are as follows
C = blitz.mat_mul(A, B)
C = blitz.elemwise_add(A, B) # Addition
D = blitz.elemwise_sub(A, B) # Subtraction
E = blitz.elemwise_mul(A, B) # Multiplication
F = blitz.elemwise_div(A, B) # Division
C = blitz.transpose(A)
C = blitz.inverse(A)
C = blitz.determinant(A)
C = blitz.trace(A)
C = blitz.frb_nrm(A)
- This project utilized the OpenCL library
- Maintainer: Lucas Eng
- Email: intlucaseng@gmail.com
- My LinkedIn
If this project helps your research, please cite it as:
@software{Numerikal Labs,
author = {Lucas Eng},
title = {BlitzMat},
year = {2024},
url = {https://github.com/deflucaseng/BlitzMat.git}
}