Skip to content

Commit

Permalink
Build: (07ce9ab) Improving C interface with capsule approach (like Nu…
Browse files Browse the repository at this point in the history
…mPy)
  • Loading branch information
emprice committed Jun 17, 2024
1 parent 16981c5 commit cb5f810
Show file tree
Hide file tree
Showing 123 changed files with 14,575 additions and 1,423 deletions.
2 changes: 1 addition & 1 deletion .buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 7f88ada47e9fbacf4ee3600e8e857fc5
config: 6159ba84f071280aad1c8baba785de4c
tags: 645f666f9bcd5a90fca523b33c5a78b7
1 change: 1 addition & 0 deletions _sources/exhale/dir_src_pocky_ext_include.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Files
-----

- :ref:`file_src_pocky_ext_include_pocky.h`
- :ref:`file_src_pocky_ext_include_pocky_api.h`
- :ref:`file_src_pocky_ext_include_pocky_bufpair.h`
- :ref:`file_src_pocky_ext_include_pocky_context.h`
- :ref:`file_src_pocky_ext_include_pocky_functions.h`
Expand Down
48 changes: 48 additions & 0 deletions _sources/exhale/file_src_pocky_ext_include_pocky_api.h.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

.. _file_src_pocky_ext_include_pocky_api.h:

File pocky_api.h
================

|exhale_lsh| :ref:`Parent directory <dir_src_pocky_ext_include>` (``src/pocky/ext/include``)

.. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS

Definition (``src/pocky/ext/include/pocky_api.h``)
--------------------------------------------------


.. toctree::
:maxdepth: 1

program_listing_file_src_pocky_ext_include_pocky_api.h.rst










Classes
-------


- :ref:`exhale_struct_structpocky__api__object`


Functions
---------


- :ref:`exhale_function_pocky__api_8h_1a1a332a875ad207687ddbcbd1508ec671`


Variables
---------


- :ref:`exhale_variable_pocky__api_8h_1aece7ff3e3aad730351705c07c2cffdd8`

Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,26 @@ Functions

- :ref:`exhale_function_pocky__bufpair_8h_1a6050f3a85392019f3e1e6bc4a6d19fc9`

- :ref:`exhale_function_pocky__bufpair_8h_1aca4d73b48d6df04e7725205c0a6e9998`

- :ref:`exhale_function_pocky__bufpair_8h_1a5e6d23295e03304777b28ee55889cef1`

- :ref:`exhale_function_pocky__bufpair_8h_1a843e1d96e56084f6eba14deb897f708a`

- :ref:`exhale_function_pocky__bufpair_8h_1a546ba0d25162a516c787f5bd86f030f6`
- :ref:`exhale_function_pocky__bufpair_8h_1a2ae63ed0d21df07da0f13001e3c1b41e`

- :ref:`exhale_function_pocky__bufpair_8h_1aa431280e9fda39d410eaa2ade5d51c76`

- :ref:`exhale_function_pocky__bufpair_8h_1a8aefbfdb3f119edb555833183129c419`

- :ref:`exhale_function_pocky__bufpair_8h_1a842bbe0abe5de8e8dd77dd4b96f0f315`

- :ref:`exhale_function_pocky__bufpair_8h_1a9657a00720358de97eeb3160ec62fd04`

- :ref:`exhale_function_pocky__bufpair_8h_1aa57c24c06f8b4ce50cc19d3590375e88`

- :ref:`exhale_function_pocky__bufpair_8h_1a7ccc00ba502d039c1e8e6e9fdca0efbf`

- :ref:`exhale_function_pocky__bufpair_8h_1adcc10b9ad889daba4ef4383c4384f9ae`


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ Variables
---------


- :ref:`exhale_variable_pocky__context_8h_1acf2efc722d14ac05b5d6926066873461`

- :ref:`exhale_variable_pocky__context_8h_1a4f9eb746bb0942d49d55218f2e530624`

- :ref:`exhale_variable_pocky__context_8h_1addc9a0182ff0066f11b24642582ac648`
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.. _exhale_function_pocky__api_8h_1a1a332a875ad207687ddbcbd1508ec671:

Function import_pocky
=====================

- Defined in :ref:`file_src_pocky_ext_include_pocky_api.h`


Function Documentation
----------------------


.. doxygenfunction:: import_pocky(void)
:project: pocky
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. _exhale_function_pocky__bufpair_8h_1a546ba0d25162a516c787f5bd86f030f6:
.. _exhale_function_pocky__bufpair_8h_1a2ae63ed0d21df07da0f13001e3c1b41e:

Function pocky_bufpair_empty_from_shape
=======================================
Expand All @@ -10,5 +10,5 @@ Function Documentation
----------------------


.. doxygenfunction:: pocky_bufpair_empty_from_shape(pocky_context_object *, size_t, size_t *, pocky_bufpair_object **)
.. doxygenfunction:: pocky_bufpair_empty_from_shape(pocky_context_object *, size_t, long *, pocky_bufpair_object **)
:project: pocky
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.. _exhale_function_pocky__bufpair_8h_1a5e6d23295e03304777b28ee55889cef1:

Function pocky_bufpair_copy_to_device
=====================================

- Defined in :ref:`file_src_pocky_ext_include_pocky_bufpair.h`


Function Documentation
----------------------


.. doxygenfunction:: pocky_bufpair_copy_to_device(pocky_bufpair_object *, PyObject *)
:project: pocky
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.. _exhale_function_pocky__bufpair_8h_1a7ccc00ba502d039c1e8e6e9fdca0efbf:

Function pocky_bufpair_set_dirty
================================

- Defined in :ref:`file_src_pocky_ext_include_pocky_bufpair.h`


Function Documentation
----------------------


.. doxygenfunction:: pocky_bufpair_set_dirty(pocky_bufpair_object *, PyObject *, void *)
:project: pocky
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.. _exhale_function_pocky__bufpair_8h_1a8aefbfdb3f119edb555833183129c419:

Function pocky_bufpair_get_dirty
================================

- Defined in :ref:`file_src_pocky_ext_include_pocky_bufpair.h`


Function Documentation
----------------------


.. doxygenfunction:: pocky_bufpair_get_dirty(pocky_bufpair_object *, void *)
:project: pocky
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.. _exhale_function_pocky__bufpair_8h_1aca4d73b48d6df04e7725205c0a6e9998:

Function pocky_bufpair_copy_from_device
=======================================

- Defined in :ref:`file_src_pocky_ext_include_pocky_bufpair.h`


Function Documentation
----------------------


.. doxygenfunction:: pocky_bufpair_copy_from_device(pocky_bufpair_object *, PyObject *)
:project: pocky
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@

.. _program_listing_file_src_pocky_ext_include_pocky_api.h:

Program Listing for File pocky_api.h
====================================

|exhale_lsh| :ref:`Return to documentation for file <file_src_pocky_ext_include_pocky_api.h>` (``src/pocky/ext/include/pocky_api.h``)

.. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS

.. code-block:: c
#ifndef POCKY_API_H
#define POCKY_API_H
typedef struct
{
PyTypeObject *context_type;
PyTypeObject *bufpair_type;
cl_int (*opencl_kernels_from_fragments)(cl_uint, const char **,
cl_context, cl_program *, cl_uint *, cl_kernel **);
cl_int (*opencl_kernels_from_files)(cl_uint, const char **,
cl_context, cl_program *, cl_uint *, cl_kernel **);
cl_int (*opencl_kernel_lookup_by_name)(cl_uint,
cl_kernel *, const char *, cl_kernel *);
cl_int (*opencl_kernels_free_all)(cl_uint *, cl_kernel **);
cl_int (*opencl_program_free)(cl_program *);
int (*bufpair_empty_like)(pocky_context_object *,
pocky_bufpair_object *, pocky_bufpair_object **);
int (*bufpair_empty_from_shape)(pocky_context_object *,
size_t, long *, pocky_bufpair_object **);
const char *(*opencl_error_to_string)(cl_int);
}
pocky_api_object;
#ifndef NO_IMPORT_POCKY
pocky_api_object *pocky_api;
static int import_pocky(void)
{
pocky_api = (pocky_api_object *) PyCapsule_Import("pocky.ext._C_API", 0);
return (pocky_api == NULL) ? -1 : 0;
}
#else
extern pocky_api_object *pocky_api;
#endif /* NO_IMPORT_POCKY */
#endif /* POCKY_API_H */
/* vim: set ft=c.doxygen: */
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Program Listing for File pocky_bufpair.h
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
pocky_context_object *context;
PyObject *host;
PyObject *dirty;
cl_mem device;
size_t host_size;
size_t device_size;
Expand All @@ -34,19 +35,26 @@ Program Listing for File pocky_bufpair.h
PyObject *args, PyObject *kwargs);
extern void pocky_bufpair_dealloc(pocky_bufpair_object *self);
extern PyObject *pocky_bufpair_copy_to_device(pocky_bufpair_object *self, PyObject *args);
extern PyObject *pocky_bufpair_copy_from_device(pocky_bufpair_object *self, PyObject *args);
extern PyObject *pocky_bufpair_array(pocky_bufpair_object *self, PyObject *noargs);
extern PyObject *pocky_bufpair_get_host(pocky_bufpair_object *self, void *closure);
extern int pocky_bufpair_set_host(pocky_bufpair_object *self,
PyObject *value, void *closure);
extern PyObject *pocky_bufpair_get_dirty(pocky_bufpair_object *self, void *closure);
extern int pocky_bufpair_set_dirty(pocky_bufpair_object *self,
PyObject *value, void *closure);
extern PyGetSetDef pocky_bufpair_getsetters[];
extern PyMethodDef pocky_bufpair_methods[];
extern int pocky_bufpair_empty_like(pocky_context_object *context,
pocky_bufpair_object *like, pocky_bufpair_object **bufpair);
extern int pocky_bufpair_empty_from_shape(pocky_context_object *context,
size_t ndim, size_t *shape, pocky_bufpair_object **bufpair);
size_t ndim, long *shape, pocky_bufpair_object **bufpair);
#endif /* POCKY_BUFPAIR_H */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Program Listing for File pocky_context.h
PyObject_HEAD
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
cl_context ctx;
cl_program program;
cl_uint num_queues;
cl_command_queue *queues;
}
Expand All @@ -28,6 +27,7 @@ Program Listing for File pocky_context.h
extern PyTypeObject pocky_context_type;
extern PyMethodDef pocky_context_methods[];
extern PyGetSetDef pocky_context_getsetters[];
extern PyObject *pocky_context_new(PyTypeObject *type,
PyObject *args, PyObject *kwargs);
Expand Down
17 changes: 17 additions & 0 deletions _sources/exhale/structpocky__api__object.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.. _exhale_struct_structpocky__api__object:

Struct pocky_api_object
=======================

- Defined in :ref:`file_src_pocky_ext_include_pocky_api.h`


Struct Documentation
--------------------


.. doxygenstruct:: pocky_api_object
:project: pocky
:members:
:protected-members:
:undoc-members:
5 changes: 5 additions & 0 deletions _sources/exhale/unabridged_orphan.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ Files

file_src_pocky_ext_include_pocky.h.rst

.. toctree::
:maxdepth: 5

file_src_pocky_ext_include_pocky_api.h.rst

.. toctree::
:maxdepth: 5

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.. _exhale_variable_pocky__api_8h_1aece7ff3e3aad730351705c07c2cffdd8:

Variable pocky_api
==================

- Defined in :ref:`file_src_pocky_ext_include_pocky_api.h`


Variable Documentation
----------------------


.. doxygenvariable:: pocky_api
:project: pocky
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.. _exhale_variable_pocky__context_8h_1acf2efc722d14ac05b5d6926066873461:

Variable pocky_context_getsetters
=================================

- Defined in :ref:`file_src_pocky_ext_include_pocky_context.h`


Variable Documentation
----------------------


.. doxygenvariable:: pocky_context_getsetters
:project: pocky
2 changes: 1 addition & 1 deletion _static/basic.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Sphinx stylesheet -- basic theme.
*
* :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
Expand Down
2 changes: 1 addition & 1 deletion _static/doctools.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Base JavaScript utilities for all Sphinx HTML documentation.
*
* :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
Expand Down
Loading

0 comments on commit cb5f810

Please sign in to comment.