PHPackages                             sheunl/numpower - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. sheunl/numpower

ActivePhp-ext

sheunl/numpower
===============

A PHP extension for high-performance numerical computations, leveraging GPU acceleration with CUDA.

0.7.4(yesterday)013↑823.1%MITPHP

Since Mar 31Pushed yesterdayCompare

[ Source](https://github.com/sheunl/numpower)[ Packagist](https://packagist.org/packages/sheunl/numpower)[ RSS](/packages/sheunl-numpower/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (2)Versions (5)Used By (0)

 [![](https://private-user-images.githubusercontent.com/49936521/426812225-11bc8f07-60cb-4628-bc88-5dee4b22bdc6.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzU2MzczOTQsIm5iZiI6MTc3NTYzNzA5NCwicGF0aCI6Ii80OTkzNjUyMS80MjY4MTIyMjUtMTFiYzhmMDctNjBjYi00NjI4LWJjODgtNWRlZTRiMjJiZGM2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDA4VDA4MzEzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA3ZmZkMjBjNzU0YmQ4ODAxNWJjMDQzMjMxZjAwMGJlMTBjNWM5YTI3M2EwY2EyZjIyNDU3NmIxZTYwOTk5MDgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.kguNiKVR0MD7L4gPKmKkC_C6c3pNk2IE3bWyVt8EU5o)](https://private-user-images.githubusercontent.com/49936521/426812225-11bc8f07-60cb-4628-bc88-5dee4b22bdc6.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzU2MzczOTQsIm5iZiI6MTc3NTYzNzA5NCwicGF0aCI6Ii80OTkzNjUyMS80MjY4MTIyMjUtMTFiYzhmMDctNjBjYi00NjI4LWJjODgtNWRlZTRiMjJiZGM2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDA4VDA4MzEzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA3ZmZkMjBjNzU0YmQ4ODAxNWJjMDQzMjMxZjAwMGJlMTBjNWM5YTI3M2EwY2EyZjIyNDU3NmIxZTYwOTk5MDgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.kguNiKVR0MD7L4gPKmKkC_C6c3pNk2IE3bWyVt8EU5o)

Rubix NumPower
==============

[](#rubix-numpower)

[![Typing code](https://camo.githubusercontent.com/17b0457723d561dc666f48d93e95473a4ecf4ddeb027af894e2f629159abd9c2/68747470733a2f2f726561646d652d747970696e672d7376672e64656d6f6c61622e636f6d3f666f6e743d466972612b436f6465266475726174696f6e3d323530302670617573653d32353026636f6c6f723d463733383144266d756c74696c696e653d747275652677696474683d353030266865696768743d31303226736570617261746f723d253343266c696e65733d7573652b4e756d506f7765723b2533432532346172722b2533442b4e756d506f776572253341253341617272617928253542253542312532432b322535442532432b253542332532432b34253544253544293b253343253234726573756c742b2533442b2532346172722b2a2b323b2533436563686f2b253234726573756c743b)](https://camo.githubusercontent.com/17b0457723d561dc666f48d93e95473a4ecf4ddeb027af894e2f629159abd9c2/68747470733a2f2f726561646d652d747970696e672d7376672e64656d6f6c61622e636f6d3f666f6e743d466972612b436f6465266475726174696f6e3d323530302670617573653d32353026636f6c6f723d463733383144266d756c74696c696e653d747275652677696474683d353030266865696768743d31303226736570617261746f723d253343266c696e65733d7573652b4e756d506f7765723b2533432532346172722b2533442b4e756d506f776572253341253341617272617928253542253542312532432b322535442532432b253542332532432b34253544253544293b253343253234726573756c742b2533442b2532346172722b2a2b323b2533436563686f2b253234726573756c743b)

Inspired by NumPy, the NumPower extension was created by Henrique Borba to provide the foundation for efficient scientific computing in PHP, as well as leverage the machine learning tools and libraries that already exist and can benefit from it.

This C extension developed for PHP can be used to considerably speed up mathematical operations on large datasets and facilitate the manipulation, creation and operation of N-dimensional tensors.

NumPower was designed from the ground up to utilize AVX2 and the GPU to further improve performance. With the use of contiguous single precision arrays, slices, buffer sharing and a specific GC engine,

NumPower aims to manage memory more efficiently than a matrix in PHP arrays

[![Typing code](https://camo.githubusercontent.com/2c19d65e0953ab1387d288dcc75534e0a39eacdc00e4ae57d644b0a7c3744c28/68747470733a2f2f726561646d652d747970696e672d7376672e64656d6f6c61622e636f6d3f666f6e743d466972612b436f6465266475726174696f6e3d323530302670617573653d32353026636f6c6f723d463733383144266d756c74696c696e653d747275652677696474683d353030266865696768743d31323726736570617261746f723d253343266c696e65733d7573652b4e756d506f7765723b253343253234612b2533442b4e756d506f7765722533412533416e6f726d616c28253542322532432b32253544292d25334567707528293b253343253234622b2533442b4e756d506f7765722533412533416e6f726d616c28253542322532432b32253544292d25334567707528293b253343253234726573756c742b2533442b4e756d506f7765722533412533416d61746d756c28253234614770752532432b25323462477075293b2533436563686f2b253234726573756c743b)](https://camo.githubusercontent.com/2c19d65e0953ab1387d288dcc75534e0a39eacdc00e4ae57d644b0a7c3744c28/68747470733a2f2f726561646d652d747970696e672d7376672e64656d6f6c61622e636f6d3f666f6e743d466972612b436f6465266475726174696f6e3d323530302670617573653d32353026636f6c6f723d463733383144266d756c74696c696e653d747275652677696474683d353030266865696768743d31323726736570617261746f723d253343266c696e65733d7573652b4e756d506f7765723b253343253234612b2533442b4e756d506f7765722533412533416e6f726d616c28253542322532432b32253544292d25334567707528293b253343253234622b2533442b4e756d506f7765722533412533416e6f726d616c28253542322532432b32253544292d25334567707528293b253343253234726573756c742b2533442b4e756d506f7765722533412533416d61746d756c28253234614770752532432b25323462477075293b2533436563686f2b253234726573756c743b)

Requirements
------------

[](#requirements)

- PHP 8.x
- LAPACKE
- OpenBLAS
- **Optional**: Intel MKL
- **Optional (GPU)**: CUBLAS, CUDA Build Toolkit and cuDNN
- **Optional (Image)**: PHP-GD

Compiling
---------

[](#compiling)

```
$ phpize
$ ./configure
$ make install

```

Compiling with GPU (CUDA) support
---------------------------------

[](#compiling-with-gpu-cuda-support)

```
$ phpize
$ ./configure --with-cuda
$ make install-cuda

```

GPU support
-----------

[](#gpu-support)

If you have an NVIDIA graphics card with CUDA support, you can use your graphics card to perform operations. To do this, just copy your array to the GPU memory.

```
use \NumPower;

$x = NumPower::ones([10, 10]);
$y = NumPower::ones([10, 10]);

$xGpu = $x->gpu();   // Copy $x from RAM to VRAM
$yGpu = $y->gpu();   // Copy $y from RAM to VRAM

$r = NumPower::matmul($xGpu, $yGpu); // Matmul is performed using CUDA
```

Both GPU and CPU memory management are done automatically by NumPower, so the memory of both devices will be automatically freed by the garbage collector. You can also bring arrays back from VRAM into RAM:

```
$xCpu = $x->cpu();
```

> **You must explicitly copy the arrays you want to use in your devices**. Cross-array operations (like adding) will raise an exception if the arrays used are on different devices.

###  Health Score

37

—

LowBetter than 82% of packages

Maintenance100

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity26

Early-stage or recently created project

 Bus Factor1

Top contributor holds 84.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

1d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5263d5656fe4088cb3e554bb1b6c9ea9dc43a9227a2763ac841ff236f038313e?d=identicon)[sheunl](/maintainers/sheunl)

---

Top Contributors

[![henrique-borba](https://avatars.githubusercontent.com/u/1107499?v=4)](https://github.com/henrique-borba "henrique-borba (300 commits)")[![SkibidiProduction](https://avatars.githubusercontent.com/u/49936521?v=4)](https://github.com/SkibidiProduction "SkibidiProduction (50 commits)")[![jiyo4476](https://avatars.githubusercontent.com/u/12014143?v=4)](https://github.com/jiyo4476 "jiyo4476 (1 commits)")[![markkimsal](https://avatars.githubusercontent.com/u/54099?v=4)](https://github.com/markkimsal "markkimsal (1 commits)")[![martin-juul](https://avatars.githubusercontent.com/u/11337105?v=4)](https://github.com/martin-juul "martin-juul (1 commits)")[![sheunl](https://avatars.githubusercontent.com/u/18687649?v=4)](https://github.com/sheunl "sheunl (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sheunl-numpower/health.svg)

```
[![Health](https://phpackages.com/badges/sheunl-numpower/health.svg)](https://phpackages.com/packages/sheunl-numpower)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
