Skip to content

Fix an error in the tutorial in the Readme.md #53

@ThrudPrimrose

Description

@ThrudPrimrose

if I call the example in the tutorial as it is, I get an error.
I call it like this:

generator.generate(output_dir, GeneratorCollection([LIBXSMM(arch), Eigen(arch)]))

The error I get is:

Deducing indices...
Generating unit tests...
Traceback (most recent call last):
  File "/home/primrose/Work/MasterThesisMaterial/yateto/playground/gen.py", line 68, in <module>
    generator.generate(output_dir, GeneratorCollection([LIBXSMM(arch), Eigen(arch)]))
  File "/home/primrose/Work/MasterThesisMaterial/yateto/yateto/generator.py", line 295, in generate
    with cpp.HeaderGuard(self._headerGuardName(namespace, self.CXXTEST_FILE_NAME.replace('.', '_'))):
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/primrose/Work/MasterThesisMaterial/yateto/yateto/generator.py", line 258, in _headerGuardName
    partlist = namespace.upper().split('::') + [fileBaseName.upper(), self.HEADER_GUARD_SUFFIX]
               ^^^^^^^^^^^^^^^
AttributeError: 'GeneratorCollection' object has no attribute 'upper'

I believe this happens that the 2nd argument in the definition is for the namespace and not for the generator collection, the following works fine:

generator.generate(outputDir=output_dir, gemm_cfg=GeneratorCollection([LIBXSMM(arch), Eigen(arch)]))

I believe it could be better to update the tutorial example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions