Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trace internal libnomp function calls #261

Merged
merged 5 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 10 additions & 15 deletions docs/internal-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,59 +8,54 @@ Internal API

Internal Types
^^^^^^^^^^^^^^

Below is a list of internal types (structures and enums) used internally by
libnomp.

.. doxygengroup:: nomp_internal_types
:project: libnomp
:content-only:
:members:

Helper Macros
^^^^^^^^^^^^^
Internal Macros
^^^^^^^^^^^^^^^
.. doxygengroup:: nomp_internal_macros
:project: libnomp
:content-only:
:members:

Memory Management Functions and Macros
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. doxygengroup:: nomp_mem_utils
:project: libnomp
:content-only:
:members:

Backend Initialization Functions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. doxygengroup:: nomp_backend_init
:project: libnomp
:content-only:
:members:

Python Helper Functions
^^^^^^^^^^^^^^^^^^^^^^^^
.. doxygengroup:: nomp_py_utils
:project: libnomp
:content-only:
:members:

Reductions and Related Functions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. doxygengroup:: nomp_reduction_utils
:project: libnomp
:content-only:
:members:

Logging Functions
^^^^^^^^^^^^^^^^^
.. doxygengroup:: nomp_log_utils
:project: libnomp
:content-only:
:members:

Profiling Functions
^^^^^^^^^^^^^^^^^^^
.. doxygengroup:: nomp_profiler_utils
:project: libnomp
:content-only:
:members:

Other helper Functions
^^^^^^^^^^^^^^^^^^^^^^
.. doxygengroup:: nomp_other_utils
:project: libnomp
:content-only:
:members:
6 changes: 0 additions & 6 deletions docs/user-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,15 @@ User API

Data Types
^^^^^^^^^^

Below is a list of data types that are used in the user API.

.. doxygengroup:: nomp_user_types
:project: libnomp
:content-only:

Functions
^^^^^^^^^
.. doxygengroup:: nomp_user_api
:project: libnomp
:content-only:

Error Codes
^^^^^^^^^^^
.. doxygengroup:: nomp_error_codes
:project: libnomp
:content-only:
3 changes: 2 additions & 1 deletion include/nomp-impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/**
* @defgroup nomp_internal_types Internal types
*
* @brief Internal types used in libnomp.
* @brief Internal types (structures and enums) used by libnomp.
*/

/**
Expand Down Expand Up @@ -295,6 +295,7 @@ extern "C" {
int err_ = (err); \
if (err_ > 0) \
return err_; \
nomp_log(NOMP_SUCCESS, NOMP_INFO, "OK. Function: %s", __func__); \
}

#define NOMP_MEM_OFFSET(start, usize) ((start) * (usize))
Expand Down
13 changes: 6 additions & 7 deletions include/nomp-loopy.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,22 @@ int nomp_py_realize_reduction(PyObject **knl, const char *var,

int nomp_py_set_annotate_func(PyObject **func, const char *path);

int nomp_py_apply_annotations(PyObject **kernel, PyObject *function,
const PyObject *annotations,
const PyObject *context);
int nomp_py_annotate(PyObject **kernel, PyObject *function,
const PyObject *annotations, const PyObject *context);

int nomp_py_apply_transform(PyObject **knl, const char *file, const char *func,
const PyObject *context);
int nomp_py_transform(PyObject **knl, const char *file, const char *func,
const PyObject *context);

int nomp_py_get_knl_name_and_src(char **name, char **src, const PyObject *knl);

int nomp_py_get_grid_size(nomp_prog_t *prg, PyObject *knl);

void nomp_py_get_str(const char *msg, PyObject *obj);

int nomp_symengine_eval_grid_size(nomp_prog_t *prg);

int nomp_symengine_update(CMapBasicBasic *map, const char *key, const long val);

void nomp_py_print(const char *msg, PyObject *obj);

#ifdef __cplusplus
}
#endif
Expand Down
3 changes: 2 additions & 1 deletion include/nomp.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ extern "C" {

/**
* @defgroup nomp_user_types User types
* @brief Data types used in libnomp user API.
*
* @brief Below is a list of data types that are used in the user API.
*/

/**
Expand Down
13 changes: 6 additions & 7 deletions src/loopy.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ static char backend[NOMP_MAX_BUFFER_SIZE + 1];
* @param obj Python object to be printed.
* @return void
*/
void nomp_py_print(const char *const message, PyObject *const obj) {
void nomp_py_get_str(const char *const message, PyObject *const obj) {
PyObject *py_repr = PyObject_Repr(obj);
PyObject *py_str = PyUnicode_AsEncodedString(py_repr, "utf-8", "~E~");
const char *str = PyBytes_AS_STRING(py_str);
Expand Down Expand Up @@ -305,9 +305,9 @@ int nomp_py_get_knl_name_and_src(char **name, char **src,
* as backend, device details, etc.
* @return int
*/
int nomp_py_apply_annotations(PyObject **kernel, PyObject *const function,
const PyObject *const annotations,
const PyObject *const context) {
int nomp_py_annotate(PyObject **kernel, PyObject *const function,
const PyObject *const annotations,
const PyObject *const context) {
if (!kernel || !*kernel || !function)
return 0;

Expand Down Expand Up @@ -341,9 +341,8 @@ int nomp_py_apply_annotations(PyObject **kernel, PyObject *const function,
* information such as backend, device details, etc.
* @return int
*/
int nomp_py_apply_transform(PyObject **kernel, const char *const file,
const char *function,
const PyObject *const context) {
int nomp_py_transform(PyObject **kernel, const char *const file,
const char *function, const PyObject *const context) {
// If either kernel, file, or function are NULL, we don't have to do anything:
if (kernel == NULL || *kernel == NULL || file == NULL || function == NULL)
return 0;
Expand Down
Loading