Skip to content

Commit afd1b61

Browse files
committed
PHP8.4
1 parent 1e46479 commit afd1b61

File tree

12 files changed

+220
-218
lines changed

12 files changed

+220
-218
lines changed

.github/workflows/tests.yml

Lines changed: 52 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,70 @@ on:
77

88
jobs:
99
tests:
10-
runs-on: ubuntu-22.04
10+
runs-on: ${{ matrix.os }}
1111

1212
strategy:
1313
fail-fast: true
1414
matrix:
15-
php: ['8.1','8.2','8.3']
15+
include:
16+
- name: PHP8.1
17+
os: ubuntu-latest
18+
php: '8.1'
19+
phpunit: '10.5'
20+
- name: PHP8.3
21+
os: ubuntu-latest
22+
php: '8.3'
23+
phpunit: '11.5'
24+
- name: PHP8.4
25+
os: ubuntu-latest
26+
php: '8.4'
27+
phpunit: '11.5'
1628

1729
steps:
30+
- name: Setup PHP ${{ matrix.php }}
31+
uses: shivammathur/setup-php@v2
32+
with:
33+
php-version: ${{ matrix.php }}
34+
# PHP Extras
35+
coverage: none
36+
tools: composer, phpunit:${{ matrix.phpunit }}, phpstan
37+
#ini-values: "memory_limit=512M"
38+
extensions: ffi
39+
40+
#- name: Install OpenBLAS
41+
# run: |
42+
# sudo apt install -y clinfo
43+
# sudo apt install -y pocl-opencl-icd
44+
1845
- name: Checkout codes
1946
uses: "actions/checkout@v4"
2047

48+
#- name: Composer
49+
# uses: php-actions/composer@v6
50+
# with:
51+
# php_version: ${{ matrix.php }}
52+
# php_extensions: ffi
53+
2154
- name: Composer
22-
uses: php-actions/composer@v6
23-
with:
24-
php_version: ${{ matrix.php }}
25-
php_extensions: ffi
55+
run: composer update
56+
57+
#- name: PHP Static Analysys
58+
# uses: php-actions/phpstan@v3
59+
# with:
60+
# php_version: ${{ matrix.php }}
61+
# path: src/
2662

2763
- name: PHP Static Analysys
28-
uses: php-actions/phpstan@v3
29-
with:
30-
php_version: ${{ matrix.php }}
31-
path: src/
64+
run: phpstan
65+
66+
#- name: PHPUnit Tests
67+
# uses: php-actions/phpunit@v3
68+
# with:
69+
# configuration: tests/phpunit.xml
70+
# version: ${{ matrix.phpunit }}
71+
# php_version: ${{ matrix.php }}
72+
# filter: ReleaseTest
3273

3374
- name: PHPUnit Tests
34-
uses: php-actions/phpunit@v3
35-
with:
36-
configuration: tests/phpunit.xml
37-
version: 10.5
38-
php_version: ${{ matrix.php }}
39-
filter: ReleaseTest
75+
run: phpunit -c tests --filter ReleaseTest
4076

.vscode/settings.json

Lines changed: 0 additions & 49 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Please see the documents about Buffer objects on [Rindow Mathematics](https://ri
1313
Requirements
1414
============
1515

16-
- PHP 8.1 or PHP8.2 or PHP8.3
16+
- PHP 8.1 or PHP8.2 or PHP8.3 or PHP8.4
1717
- CLBlast 1.5.1 or later
1818

1919
How to setup OpenCL & CLBlast

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
"require": {
88
"php": "^8.1",
99
"interop-phpobjects/polite-math": "~1.0.7",
10-
"rindow/rindow-opencl-ffi": "~1.0.0"
10+
"rindow/rindow-opencl-ffi": "^1.0"
1111
},
1212
"require-dev": {
1313
"ext-ffi": "*",
14-
"rindow/rindow-math-buffer-ffi": ">=1.0.0",
15-
"rindow/rindow-openblas-ffi": ">=1.0.0",
16-
"rindow/rindow-matlib-ffi": ">=1.0.0"
14+
"rindow/rindow-math-buffer-ffi": "^1.0",
15+
"rindow/rindow-openblas-ffi": "^1.0",
16+
"rindow/rindow-matlib-ffi": "^1.0"
1717
},
1818
"autoload": {
1919
"psr-4": {

phpstan.neon.dist

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,15 @@ parameters:
77
- src
88
ignoreErrors:
99
-
10-
message: "#^Call to an undefined method FFI::#"
10+
message: "#^Call to an undefined method FFI::#"
11+
-
12+
message: '#^PHPDoc tag @var with type Rindow\\CLBlast\\FFI\\cl_float2_t is not subtype of native type FFI\\CData#'
13+
identifier: varTag.nativeType
14+
count: 2
15+
path: src/Blas.php
16+
17+
-
18+
message: '#^PHPDoc tag @var with type Rindow\\CLBlast\\FFI\\cl_float2_t is not subtype of native type FFI\\CData#'
19+
identifier: varTag.nativeType
20+
count: 2
21+
path: src/Math.php

src/Blas.php

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function scal(
3434
float|object $alpha,
3535
DeviceBuffer $X, int $offsetX, int $incX,
3636
CommandQueue $queue,// Rindow\OpenCL\CommandQueue
37-
EventList $event=null, // Rindow\OpenCL\EventList
37+
?EventList $event=null, // Rindow\OpenCL\EventList
3838
) : void
3939
{
4040
$ffi = $this->ffi;
@@ -99,7 +99,7 @@ public function axpy(
9999
DeviceBuffer $X, int $offsetX, int $incX,
100100
DeviceBuffer $Y, int $offsetY, int $incY,
101101
CommandQueue $queue,// Rindow\OpenCL\CommandQueue
102-
EventList $event=null, // Rindow\OpenCL\EventList
102+
?EventList $event=null, // Rindow\OpenCL\EventList
103103
) : void
104104
{
105105
$ffi = $this->ffi;
@@ -170,7 +170,7 @@ public function dot(
170170
DeviceBuffer $X, int $offsetX, int $incX,
171171
DeviceBuffer $Y, int $offsetY, int $incY,
172172
CommandQueue $queue,// Rindow\OpenCL\CommandQueue
173-
EventList $event=null, // Rindow\OpenCL\EventList
173+
?EventList $event=null, // Rindow\OpenCL\EventList
174174
) : void
175175
{
176176
$ffi = $this->ffi;
@@ -228,7 +228,7 @@ public function dotc(
228228
DeviceBuffer $X, int $offsetX, int $incX,
229229
DeviceBuffer $Y, int $offsetY, int $incY,
230230
CommandQueue $queue,// Rindow\OpenCL\CommandQueue
231-
EventList $event=null, // Rindow\OpenCL\EventList
231+
?EventList $event=null, // Rindow\OpenCL\EventList
232232
) : void
233233
{
234234
$ffi = $this->ffi;
@@ -286,7 +286,7 @@ public function dotu(
286286
DeviceBuffer $X, int $offsetX, int $incX,
287287
DeviceBuffer $Y, int $offsetY, int $incY,
288288
CommandQueue $queue,// Rindow\OpenCL\CommandQueue
289-
EventList $event=null, // Rindow\OpenCL\EventList
289+
?EventList $event=null, // Rindow\OpenCL\EventList
290290
) : void
291291
{
292292
$ffi = $this->ffi;
@@ -343,7 +343,7 @@ public function asum(
343343
DeviceBuffer $R, int $offsetR,
344344
DeviceBuffer $X, int $offsetX, int $incX,
345345
CommandQueue $queue,
346-
EventList $event=null
346+
?EventList $event=null
347347
) : void
348348
{
349349
$ffi = $this->ffi;
@@ -410,7 +410,7 @@ public function iamax(
410410
DeviceBuffer $R, int $offsetR,
411411
DeviceBuffer $X, int $offsetX, int $incX,
412412
CommandQueue $queue,
413-
EventList $event=null
413+
?EventList $event=null
414414
) : void
415415
{
416416
$ffi = $this->ffi;
@@ -473,7 +473,7 @@ public function iamin(
473473
DeviceBuffer $R, int $offsetR,
474474
DeviceBuffer $X, int $offsetX, int $incX,
475475
CommandQueue $queue,
476-
EventList $event=null
476+
?EventList $event=null
477477
) : void
478478
{
479479
$ffi = $this->ffi;
@@ -536,7 +536,7 @@ public function copy(
536536
DeviceBuffer $X, int $offsetX, int $incX,
537537
DeviceBuffer $Y, int $offsetY, int $incY,
538538
CommandQueue $queue,// Rindow\OpenCL\CommandQueue
539-
EventList $event=null, // Rindow\OpenCL\EventList
539+
?EventList $event=null, // Rindow\OpenCL\EventList
540540
) : void
541541
{
542542
$ffi = $this->ffi;
@@ -617,7 +617,7 @@ public function nrm2(
617617
DeviceBuffer $R, int $offsetR,
618618
DeviceBuffer $X, int $offsetX, int $incX,
619619
CommandQueue $queue,
620-
EventList $event=null
620+
?EventList $event=null
621621
) : void
622622
{
623623
$ffi = $this->ffi;
@@ -684,7 +684,7 @@ public function swap(
684684
DeviceBuffer $X, int $offsetX, int $incX,
685685
DeviceBuffer $Y, int $offsetY, int $incY,
686686
CommandQueue $queue,// Rindow\OpenCL\CommandQueue
687-
EventList $event=null, // Rindow\OpenCL\EventList
687+
?EventList $event=null, // Rindow\OpenCL\EventList
688688
) : void
689689
{
690690
$ffi = $this->ffi;
@@ -752,7 +752,7 @@ public function rotg(
752752
DeviceBuffer $C, int $offsetC,
753753
DeviceBuffer $S, int $offsetS,
754754
CommandQueue $queue,// Rindow\OpenCL\CommandQueue
755-
EventList $event=null, // Rindow\OpenCL\EventList
755+
?EventList $event=null, // Rindow\OpenCL\EventList
756756
) : void
757757
{
758758
$ffi= $this->ffi;
@@ -825,7 +825,7 @@ public function rot(
825825
float $cos,
826826
float $sin,
827827
CommandQueue $queue,// Rindow\OpenCL\CommandQueue
828-
EventList $event=null, // Rindow\OpenCL\EventList
828+
?EventList $event=null, // Rindow\OpenCL\EventList
829829
) : void
830830
{
831831
$ffi= $this->ffi;
@@ -889,7 +889,7 @@ public function rotmg(
889889
DeviceBuffer $B2, int $offsetB2,
890890
DeviceBuffer $P, int $offsetP,
891891
CommandQueue $queue,// Rindow\OpenCL\CommandQueue
892-
EventList $event=null, // Rindow\OpenCL\EventList
892+
?EventList $event=null, // Rindow\OpenCL\EventList
893893
) : void
894894
{
895895
$ffi= $this->ffi;
@@ -965,7 +965,7 @@ public function rotm(
965965
DeviceBuffer $Y, int $offsetY, int $incY,
966966
DeviceBuffer $P, int $offsetP,
967967
CommandQueue $queue,// Rindow\OpenCL\CommandQueue
968-
EventList $event=null, // Rindow\OpenCL\EventList
968+
?EventList $event=null, // Rindow\OpenCL\EventList
969969
) : void
970970
{
971971
$ffi= $this->ffi;
@@ -1032,7 +1032,7 @@ public function gemv(
10321032
float|object $beta,
10331033
DeviceBuffer $Y, int $offsetY, int $incY,
10341034
CommandQueue $queue,
1035-
EventList $event=null
1035+
?EventList $event=null
10361036
) : void
10371037
{
10381038
$ffi = $this->ffi;
@@ -1144,7 +1144,7 @@ public function gemm(
11441144
float|object $beta,
11451145
DeviceBuffer $C, int $offsetC, int $ldC,
11461146
CommandQueue $queue,
1147-
EventList $event=null
1147+
?EventList $event=null
11481148
) : void
11491149
{
11501150
$ffi = $this->ffi;
@@ -1262,7 +1262,7 @@ public function symm(
12621262
float|object $beta,
12631263
DeviceBuffer $C, int $offsetC, int $ldC,
12641264
CommandQueue $queue,
1265-
EventList $event=null,
1265+
?EventList $event=null,
12661266
) : void
12671267
{
12681268
$ffi = $this->ffi;
@@ -1372,7 +1372,7 @@ public function syrk(
13721372
float|object $beta,
13731373
DeviceBuffer $C, int $offsetC, int $ldC,
13741374
CommandQueue $queue,
1375-
EventList $event=null,
1375+
?EventList $event=null,
13761376
) : void
13771377
{
13781378
$ffi = $this->ffi;
@@ -1475,7 +1475,7 @@ public function syr2k(
14751475
float|object $beta,
14761476
DeviceBuffer $C, int $offsetC, int $ldC,
14771477
CommandQueue $queue,
1478-
EventList $event=null,
1478+
?EventList $event=null,
14791479
) : void
14801480
{
14811481
$ffi = $this->ffi;
@@ -1586,7 +1586,7 @@ public function trmm(
15861586
DeviceBuffer $A, int $offsetA, int $ldA,
15871587
DeviceBuffer $B, int $offsetB, int $ldB,
15881588
CommandQueue $queue,
1589-
EventList $event=null,
1589+
?EventList $event=null,
15901590
) : void
15911591
{
15921592
$ffi = $this->ffi;
@@ -1691,7 +1691,7 @@ public function trsm(
16911691
DeviceBuffer $A, int $offsetA, int $ldA,
16921692
DeviceBuffer $B, int $offsetB, int $ldB,
16931693
CommandQueue $queue,
1694-
EventList $event=null,
1694+
?EventList $event=null,
16951695
) : void
16961696
{
16971697
$ffi = $this->ffi;
@@ -1793,7 +1793,7 @@ public function omatcopy(
17931793
DeviceBuffer $A, int $offsetA, int $ldA,
17941794
DeviceBuffer $B, int $offsetB, int $ldB,
17951795
CommandQueue $queue,
1796-
EventList $event=null
1796+
?EventList $event=null
17971797
) : void
17981798
{
17991799
$ffi = $this->ffi;

0 commit comments

Comments
 (0)