You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for this accurate code base.
I would like to use it with PHP 8.2, but zend API has been changed years ago.
I was able to modify the code - however I am unsure about its correctness.
I hope that the upgrade is merely syntactic procedure with no semantic consequences.
Can you provide some guide to make this code build-able?
(I have no zend extension experience at all. Probably it requires a long learning curve.)
In a worst case scenario I can write my own C OpenCL code and call it by FFI.
However I think this project is useful for a wider audience and it worth a face lift.
Maybe that is less effort to me and others than an in-house C library.
Best regards,
Csongor
NOTE:
So probably this is the last build error to overcome - I have no time to dig into Zend programming ☹️ :
/root/php-opencl/params.c: In function'phpcl_get_devicecs':
/root/php-opencl/params.c:40:32: error: expected expression before 'cl_device_id'
40 | zend_fetch_resource2(device, cl_device_id, &zv, -1,
| ^~~~~~~~~~~~
/root/php-opencl/params.c:40:24: warning: passing argument 1 of 'zend_fetch_resource2' from incompatible pointer type [-Wincompatible-pointer-types]
40 | zend_fetch_resource2(device, cl_device_id, &zv, -1,
| ^~~~~~
||| cl_device_id {aka struct _cl_device_id *}
In file included from /usr/local/include/php/Zend/zend_API.h:26,
from /usr/local/include/php/main/php.h:35,
from /root/php-opencl/php_opencl.h:17,
from /root/php-opencl/params.h:10,
from /root/php-opencl/params.c:10:
/usr/local/include/php/Zend/zend_list.h:62:52: note: expected 'zend_resource *' {aka 'struct _zend_resource *'} but argument is of type'cl_device_id' {aka 'struct _cl_device_id *'}
62 | ZEND_API void *zend_fetch_resource2(zend_resource *res, const char *resource_type_name, int resource_type, int resource_type2);|~~~~~~~~~~~~~~~^~~
/root/php-opencl/params.c:40:3: error: too few arguments to function'zend_fetch_resource2'
40 | zend_fetch_resource2(device, cl_device_id, &zv, -1,
| ^~~~~~~~~~~~~~~~~~~~
In file included from /usr/local/include/php/Zend/zend_API.h:26,
from /usr/local/include/php/main/php.h:35,
from /root/php-opencl/php_opencl.h:17,
from /root/php-opencl/params.h:10,
from /root/php-opencl/params.c:10:
/usr/local/include/php/Zend/zend_list.h:62:16: note: declared here
62 | ZEND_API void *zend_fetch_resource2(zend_resource *res, const char *resource_type_name, int resource_type, int resource_type2);| ^~~~~~~~~~~~~~~~~~~~
make: *** [Makefile:213: params.lo] Error 1
The text was updated successfully, but these errors were encountered:
Hi,
Thank you for this accurate code base.
I would like to use it with PHP 8.2, but zend API has been changed years ago.
I was able to modify the code - however I am unsure about its correctness.
I had to change an include path:
Some macro calls - NOTE: I do not know what is the right replacement for
ZEND_REGISTER_RESOURCE
:I adjusted the configuration by this command:
(Based on this doc https://wiki.php.net/phpng-upgrading)
./configure CFLAGS='-g -O2 -DCL_TARGET_OPENCL_VERSION=120 -DTSRMLS_DC= -DTSRMLS_CC= -DTSRMLS_C= -Dzend_rsrc_list_entry=zend_resource'
I also had to change a function call in
params.c
, however I have no clue at all:I hope that the upgrade is merely syntactic procedure with no semantic consequences.
Can you provide some guide to make this code build-able?
(I have no zend extension experience at all. Probably it requires a long learning curve.)
In a worst case scenario I can write my own C OpenCL code and call it by FFI.
However I think this project is useful for a wider audience and it worth a face lift.
Maybe that is less effort to me and others than an in-house C library.
Best regards,
Csongor
NOTE:☹️ :
So probably this is the last build error to overcome - I have no time to dig into Zend programming
The text was updated successfully, but these errors were encountered: