Skip to content

Commit

Permalink
Move printing C++ API to include
Browse files Browse the repository at this point in the history
  • Loading branch information
PatKamin committed Oct 23, 2023
1 parent 952ab31 commit 1f2cd55
Show file tree
Hide file tree
Showing 8 changed files with 5,456 additions and 5,465 deletions.
10,696 changes: 5,310 additions & 5,386 deletions source/common/ur_print.hpp → include/ur_print.hpp

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions scripts/core/INTRO.rst
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,14 @@ and followed by a digit or uppercase letter are reserved for use by the implemen
Applications which use Unified Runtime must not provide definitions of these symbols.
This allows the Unified Runtime shared library to be updated with additional symbols for new API versions or extensions without causing symbol conflicts with existing applications.

Printing API
------------
## --validate=off
The header "${x}_print.hpp" contains the "${x}::print" namespace with the output stream operator (<<) overloads for Unified Runtime objects.
There is also the "${x}::extras::printFunctionParams" function for printing function parameters. These parameters have to be provided in a \*params_t struct format suitable for
a given function.
## --validate=on

Tracing
---------------------

Expand Down
5 changes: 3 additions & 2 deletions scripts/generate_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def _generate_api_cpp(incpath, srcpath, namespace, tags, version, revision, spec
loc = _mako_api_h(incpath, namespace, tags, version, revision, specs, meta)
loc += _mako_api_cpp(srcpath, namespace, tags, version, revision, specs, meta)
loc += _mako_ddi_h(incpath, namespace, tags, version, revision, specs, meta)
loc += _mako_print_hpp(incpath, namespace, tags, version, revision, specs, meta)

return loc

Expand Down Expand Up @@ -278,7 +279,7 @@ def _mako_tracing_layer_cpp(path, namespace, tags, version, specs, meta):
"""
generates c/c++ files from the specification documents
"""
def _mako_print_hpp(path, namespace, tags, version, specs, meta):
def _mako_print_hpp(path, namespace, tags, version, revision, specs, meta):
template = "print.hpp.mako"
fin = os.path.join(templates_dir, template)

Expand All @@ -291,6 +292,7 @@ def _mako_print_hpp(path, namespace, tags, version, specs, meta):
fin, fout,
name=name,
ver=version,
rev=revision,
namespace=namespace,
tags=tags,
specs=specs,
Expand Down Expand Up @@ -361,6 +363,5 @@ def generate_common(path, section, namespace, tags, version, specs, meta):
os.makedirs(layer_dstpath, exist_ok=True)

loc = 0
loc += _mako_print_hpp(layer_dstpath, namespace, tags, version, specs, meta)
print("COMMON Generated %s lines of code.\n"%loc)

Loading

0 comments on commit 1f2cd55

Please sign in to comment.