Skip to content

Commit 4d1dc80

Browse files
committed
Update README
1 parent f6ce3c9 commit 4d1dc80

4 files changed

Lines changed: 14 additions & 7 deletions

File tree

‎README.md‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1-
# Tensor: A PHP Extension for Scientific Computing
1+
# Tensor: Scientific Computing for [PHP](https://php.net)
22

33
[![PHP from Packagist](https://img.shields.io/packagist/php-v/rubix/tensor_ext.svg?style=flat&colorB=8892BF)](https://www.php.net/) [![Latest Stable Version](https://img.shields.io/packagist/v/rubix/tensor_ext.svg?style=flat&colorB=orange)](https://packagist.org/packages/rubix/tensor_ext) [![Code Checks](https://github.com/RubixML/Tensor-Ext/actions/workflows/ci.yml/badge.svg)](https://github.com/RubixML/Tensor-Ext/actions/workflows/ci.yml) [![Downloads from Packagist](https://img.shields.io/packagist/dt/rubix/tensor_ext.svg?style=flat&colorB=red)](https://packagist.org/packages/rubix/tensor_ext) [![GitHub](https://img.shields.io/github/license/RubixML/Tensor-Ext)](https://github.com/RubixML/Tensor-Ext/blob/master/LICENSE.md)
44

5-
Scientific Computing for the [PHP](https://php.net) language.
5+
Tensor Ext is a PHP extension that brings fast Matrix and Vector computing to the PHP language. The object-oriented API is written in [Zephir](https://zephir-lang.com) and backed by native C kernels.
6+
7+
## Features
8+
9+
- **Object-oriented API** — Matrix and Vector APIs are fluent and expressive.
10+
- **Native BLAS and LAPACK acceleration** — Highly-optimized multi-threaded linear algebra kernels.
11+
- **Universal element-wise functions** — Elementwise operations are broadcast and vectorized.
12+
- **Dynamic kernel dispatching** — Operations are dispatched at runtime based on CPU architecture.
613

714
## Installation
815

@@ -15,9 +22,9 @@ $ pie install rubix/tensor_ext
1522
## Requirements
1623

1724
- [PHP](https://php.net) 8.1 or above
25+
- The PHP development package (source code and tooling)
1826
- A C compiler such as [GCC](https://gcc.gnu.org/), [Clang](https://clang.llvm.org/), or [Visual C++](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads)
1927
- A Fortran compiler such as [GFortran](https://gcc.gnu.org/wiki/GFortran)
20-
- The PHP development package (source code and tooling)
2128
- [OpenBLAS](https://www.openblas.net/) development package
2229
- [LAPACKE](https://www.netlib.org/lapack/lapacke.html) C interface to [LAPACK](http://www.netlib.org/lapack/)
2330
- [re2c](https://re2c.org/) 0.13.6 or later

‎ext/include/buffer.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ int tensor_tensorbuffer_create_uninit(zval * ret, zend_long len, zval * buffer)
6969
* bytes decoding to Inf would give `Inf * 0 = NaN` and contaminate the result.
7070
* Everywhere else, prefer tensor_tensorbuffer_create_uninit().
7171
*/
72-
int tensor_tensorbuffer_zeros(zval * ret, zend_long len, zval * buffer)
72+
int tensor_tensorbuffer_create_zeros(zval * ret, zend_long len, zval * buffer)
7373
{
7474
if (UNEXPECTED(zephir_buffer_create(buffer, len, ZEPHIR_BUFFER_DOUBLE) == FAILURE)) {
7575
ZVAL_UNDEF(buffer);

‎ext/include/buffer.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ int tensor_tensorbuffer_create_uninit(zval * ret, zend_long len, zval * buffer);
3030
* Zero-fills because some callers hand the buffer to BLAS with `beta = 0.0`,
3131
* which must not read uninitialized bytes. Prefer the _uninit variant
3232
* everywhere the caller fully overwrites the buffer. */
33-
int tensor_tensorbuffer_zeros(zval * ret, zend_long len, zval * buffer);
33+
int tensor_tensorbuffer_create_zeros(zval * ret, zend_long len, zval * buffer);
3434

3535
/* Unwrap the double buffer hidden inside a `Tensor\TensorBuffer` object,
3636
* returning a raw pointer into it. Sets `*success` to 1 on success and 0 on

‎ext/include/linear_algebra.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ void tensor_matmul(zval * return_value, zval * a, zval * b, zval * m, zval * p,
4646

4747
zval c;
4848

49-
if (UNEXPECTED(tensor_tensorbuffer_zeros(return_value, ma * nb, &c) == FAILURE)) {
49+
if (UNEXPECTED(tensor_tensorbuffer_create_zeros(return_value, ma * nb, &c) == FAILURE)) {
5050
return;
5151
}
5252

@@ -88,7 +88,7 @@ void tensor_matrix_dot(zval * return_value, zval * a, zval * b, zval * m, zval *
8888

8989
zval c;
9090

91-
if (UNEXPECTED(tensor_tensorbuffer_zeros(return_value, ma, &c) == FAILURE)) {
91+
if (UNEXPECTED(tensor_tensorbuffer_create_zeros(return_value, ma, &c) == FAILURE)) {
9292
return;
9393
}
9494

0 commit comments

Comments
 (0)