gem5 v24.0.0.0
Loading...
Searching...
No Matches
pybind_init.hh File Reference
#include <Python.h>
#include "pybind11/pybind11.h"

Go to the source code of this file.

Classes

struct  gem5::PybindModuleInit
 

Namespaces

namespace  gem5
 Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
 

Macros

#define GEM5_PYBIND_MODULE_INIT(name, func)
 

Macro Definition Documentation

◆ GEM5_PYBIND_MODULE_INIT

#define GEM5_PYBIND_MODULE_INIT ( name,
func )
Value:
namespace { \
\
::PyObject * \
initializer() \
{ \
static ::pybind11::module_::module_def mod_def; \
static auto m = ::pybind11::module_::create_extension_module( \
#name, nullptr, &mod_def); \
func(m); \
m.inc_ref(); \
return m.ptr(); \
} \
\
::gem5::PybindModuleInit modInit(#name, initializer); \
\
}
const std::string & name()
Definition trace.cc:48

Definition at line 56 of file pybind_init.hh.


Generated on Tue Jun 18 2024 16:24:08 for gem5 by doxygen 1.11.0