PHPackages                             rindow/rindow-opencl-ffi - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. rindow/rindow-opencl-ffi

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rindow/rindow-opencl-ffi
========================

The OpenCL library for FFI on PHP

1.0.5(1y ago)45532BSD-3-ClausePHPPHP ^8.1CI passing

Since Mar 18Pushed 1y ago1 watchersCompare

[ Source](https://github.com/rindow/rindow-opencl-ffi)[ Packagist](https://packagist.org/packages/rindow/rindow-opencl-ffi)[ RSS](/packages/rindow-rindow-opencl-ffi/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (2)Versions (7)Used By (2)

The Interface of The OpenCL for FFI on PHP
==========================================

[](#the-interface-of-the-opencl-for-ffi-on-php)

Status: [![Build Status](https://github.com/rindow/rindow-opencl-ffi/workflows/tests/badge.svg)](https://github.com/rindow/rindow-opencl-ffi/actions)[![Downloads](https://camo.githubusercontent.com/1026d0cd69be2936c7ad2c0402d5279a6b631df0e2e409044ff25117d5685505/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f72696e646f772f72696e646f772d6f70656e636c2d666669)](https://packagist.org/packages/rindow/rindow-opencl-ffi)[![Latest Stable Version](https://camo.githubusercontent.com/b6ca08587041064d2a009382bbdf18e177a712fdac0c2970b69bedfea9123a5e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72696e646f772f72696e646f772d6f70656e636c2d666669)](https://packagist.org/packages/rindow/rindow-opencl-ffi)[![License](https://camo.githubusercontent.com/eb3340716262be903db5b7f7c52fe06c18b7be182c510c0486e029ee0b95d0ea/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f72696e646f772f72696e646f772d6f70656e636c2d666669)](https://packagist.org/packages/rindow/rindow-opencl-ffi)

You can use OpenCL on PHP. The version of OpenCL is limited to version 1.2(1.1 with restrictions), and we are considering porting to a wide range of environments.

Since our goal is to use it with the Rindow Neural Network Library, we currently only have the minimum required functionality. It will be expanded in the future.

Please see the documents about Buffer objects on [Rindow Mathematics](https://rindow.github.io/mathematics/acceleration/opencl.html#rindow-clblast-ffi) web pages.

Requirements
============

[](#requirements)

- PHP 8.1 or PHP8.2 or PHP8.3 or PHP8.4
- interop-phpobjects/polite-math 1.0.5 or later
- FFI-Buffer in the Interop php objects for Math. (ex. rindow/rindow-math-buffer-ffi)
- OpenCL 1.2 ICL loader and OpenCL 1.1/1.2 drivers
- Windows 10/11, Ubuntu(Recommendation 22.04-)/Debian (Recommendation 12-)

AMD GPU/APU and Intel integrated GPU drivers for Windows are including OpenCL drivers. If you want to use it on Linux, you need to explicitly install the OpenCL driver.

How to setup
============

[](#how-to-setup)

### Setup OpenCL

[](#setup-opencl)

On Windows, you can use OpenCL without doing anything.

On Linux, install ICL Loader and the driver appropriate for your hardware.

For example, in the case of Linux standard AMD driver, install as follows

```
$ sudo apt install clinfo
$ sudo apt install mesa-opencl-icd
```

Linux standard OpenCL drivers include:

- mesa-opencl-icd
- beignet-opencl-icd
- intel-opencl-icd
- nvidia-opencl-icd-xxx
- pocl-opencl-icd

### Setup Rindow OpenCL-FFI

[](#setup-rindow-opencl-ffi)

Install using composer.

```
$ composer require rindow/rindow-opencl-ffi
```

How to use
==========

[](#how-to-use)

Let's run the sample program.

### Sample for Display OpenCL Information

[](#sample-for-display-opencl-information)

```
