Skip to content

Commit

Permalink
Prepare to convert between PHP types and OpenCL C types.
Browse files Browse the repository at this point in the history
  • Loading branch information
rsky committed Sep 2, 2012
1 parent c0a68c8 commit eba8b43
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
19 changes: 19 additions & 0 deletions params.c
Expand Up @@ -57,6 +57,25 @@ cl_device_id *phpcl_get_devicecs(zval *zv, int argno, cl_uint *num_devices_ret T
return devices;
}

/* }}} */
/* {{{ phpcl_convert_zval_to_c() */

zend_bool phpcl_convert_zval_to_c(zval *zv, phpcl_c_type_t type,
void **value_ptr_ret, size_t *size_ret TSRMLS_DC)
{
/* not yet implemented */
return 0;
}

/* }}} */
/* {{{ phpcl_convert_c_to_zval() */

zval *phpcl_convert_c_to_zval(void *value_ptr, phpcl_c_type_t type TSRMLS_DC)
{
/* not yet implemented */
return NULL;
}

/* }}} */

/*
Expand Down
8 changes: 7 additions & 1 deletion params.h
Expand Up @@ -14,7 +14,13 @@

zend_bool phpcl_is_callable(zval *zv, int argno TSRMLS_DC);

cl_device_id *phpcl_get_devicecs(zval *zv, int argno, cl_uint *num_devices_ret TSRMLS_DC);
cl_device_id *phpcl_get_devicecs(zval *zv, int argno,
cl_uint *num_devices_ret TSRMLS_DC);

zend_bool phpcl_convert_zval_to_c(zval *zv, phpcl_c_type_t type,
void **value_ptr_ret, size_t *size_ret TSRMLS_DC);

zval *phpcl_convert_c_to_zval(void *value_ptr, phpcl_c_type_t type TSRMLS_DC);

#endif

Expand Down
2 changes: 1 addition & 1 deletion php_opencl.h
Expand Up @@ -101,7 +101,7 @@ typedef enum {
/* pointer */
C_TYPE_MEM_PTR,
C_TYPE_NULL_PTR
} phpcl_opencl_c_type_t;
} phpcl_c_type_t;

typedef struct {
cl_context context;
Expand Down

0 comments on commit eba8b43

Please sign in to comment.