|
MLIR 23.0.0git
|
#include "mlir/CAPI/Support.h"#include "llvm/ADT/StringRef.h"#include "llvm/Support/FileSystem.h"#include "llvm/Support/ThreadPool.h"#include "llvm/Support/raw_ostream.h"#include <cstring>#include <string>Go to the source code of this file.
Functions | |
| MlirStringRef | mlirStringRefCreateFromCString (const char *str) |
| Constructs a string reference from a null-terminated C string. | |
| bool | mlirStringRefEqual (MlirStringRef string, MlirStringRef other) |
| Returns true if two string references are equal, false otherwise. | |
| MlirLlvmThreadPool | mlirLlvmThreadPoolCreate () |
| Create an LLVM thread pool. | |
| void | mlirLlvmThreadPoolDestroy (MlirLlvmThreadPool threadPool) |
| Destroy an LLVM thread pool. | |
| int | mlirLlvmThreadPoolGetMaxConcurrency (MlirLlvmThreadPool threadPool) |
| Returns the maximum number of threads in the thread pool. | |
| MlirLlvmRawFdOStream | mlirLlvmRawFdOStreamCreate (const char *path, bool binary, MlirStringCallback errorCallback, void *userData) |
| Create a raw_fd_ostream for the given path. | |
| void | mlirLlvmRawFdOStreamWrite (MlirLlvmRawFdOStream stream, MlirStringRef string) |
| Write a string to a raw_fd_ostream created with mlirLlvmRawFdOStreamCreate. | |
| bool | mlirLlvmRawFdOStreamIsNull (MlirLlvmRawFdOStream stream) |
| Checks if a raw_fd_ostream is null. | |
| void | mlirLlvmRawFdOStreamDestroy (MlirLlvmRawFdOStream stream) |
| Destroy a raw_fd_ostream created with mlirLlvmRawFdOStreamCreate. | |
| MlirTypeID | mlirTypeIDCreate (const void *ptr) |
| ptr must be 8 byte aligned and unique to a type valid for the duration of the returned type id's usage | |
| bool | mlirTypeIDEqual (MlirTypeID typeID1, MlirTypeID typeID2) |
| Checks if two type ids are equal. | |
| size_t | mlirTypeIDHashValue (MlirTypeID typeID) |
| Returns the hash value of the type id. | |
| MlirTypeIDAllocator | mlirTypeIDAllocatorCreate () |
| Creates a type id allocator for dynamic type id creation. | |
| void | mlirTypeIDAllocatorDestroy (MlirTypeIDAllocator allocator) |
| Deallocates the allocator and all allocated type ids. | |
| MlirTypeID | mlirTypeIDAllocatorAllocateTypeID (MlirTypeIDAllocator allocator) |
| Allocates a type id that is valid for the lifetime of the allocator. | |
| MlirLlvmRawFdOStream mlirLlvmRawFdOStreamCreate | ( | const char * | path, |
| bool | binary, | ||
| MlirStringCallback | errorCallback, | ||
| void * | userData ) |
Create a raw_fd_ostream for the given path.
This wrapper is needed because std::ostream does not provide the file sharing semantics required on Windows.
Definition at line 47 of file Support.cpp.
References mlirStringRefCreate(), and wrap().
Referenced by mlir::PyFileAccumulator::PyFileAccumulator().
| void mlirLlvmRawFdOStreamDestroy | ( | MlirLlvmRawFdOStream | stream | ) |
Destroy a raw_fd_ostream created with mlirLlvmRawFdOStreamCreate.
Definition at line 73 of file Support.cpp.
References unwrap().
Referenced by mlir::RAIIMlirLlvmRawFdOStream::~RAIIMlirLlvmRawFdOStream().
| bool mlirLlvmRawFdOStreamIsNull | ( | MlirLlvmRawFdOStream | stream | ) |
Checks if a raw_fd_ostream is null.
Definition at line 69 of file Support.cpp.
Referenced by mlir::PyFileAccumulator::PyFileAccumulator().
| void mlirLlvmRawFdOStreamWrite | ( | MlirLlvmRawFdOStream | stream, |
| MlirStringRef | string ) |
Write a string to a raw_fd_ostream created with mlirLlvmRawFdOStreamCreate.
Definition at line 64 of file Support.cpp.
References unwrap().
| MlirLlvmThreadPool mlirLlvmThreadPoolCreate | ( | void | ) |
Create an LLVM thread pool.
This is reexported here to avoid directly pulling in the LLVM headers directly.
Definition at line 30 of file Support.cpp.
References wrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyThreadPool::~PyThreadPool().
| void mlirLlvmThreadPoolDestroy | ( | MlirLlvmThreadPool | threadPool | ) |
Destroy an LLVM thread pool.
Definition at line 34 of file Support.cpp.
References unwrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyThreadPool::getMaxConcurrency().
| int mlirLlvmThreadPoolGetMaxConcurrency | ( | MlirLlvmThreadPool | threadPool | ) |
Returns the maximum number of threads in the thread pool.
Definition at line 38 of file Support.cpp.
References unwrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyThreadPool::_mlir_thread_pool_ptr().
| MlirStringRef mlirStringRefCreateFromCString | ( | const char * | str | ) |
Constructs a string reference from a null-terminated C string.
Prefer mlirStringRefCreate if the length of the string is known.
Definition at line 18 of file Support.cpp.
References mlirStringRefCreate().
| bool mlirStringRefEqual | ( | MlirStringRef | string, |
| MlirStringRef | other ) |
Returns true if two string references are equal, false otherwise.
Definition at line 22 of file Support.cpp.
References MlirStringRef::data, and MlirStringRef::length.
| MlirTypeID mlirTypeIDAllocatorAllocateTypeID | ( | MlirTypeIDAllocator | allocator | ) |
Allocates a type id that is valid for the lifetime of the allocator.
Definition at line 109 of file Support.cpp.
References unwrap(), and wrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyGlobals::TypeIDAllocator::allocate().
| MlirTypeIDAllocator mlirTypeIDAllocatorCreate | ( | void | ) |
Creates a type id allocator for dynamic type id creation.
Definition at line 101 of file Support.cpp.
References wrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyGlobals::TypeIDAllocator::TypeIDAllocator().
| void mlirTypeIDAllocatorDestroy | ( | MlirTypeIDAllocator | allocator | ) |
Deallocates the allocator and all allocated type ids.
Definition at line 105 of file Support.cpp.
References unwrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyGlobals::TypeIDAllocator::~TypeIDAllocator().
| MlirTypeID mlirTypeIDCreate | ( | const void * | ptr | ) |
ptr must be 8 byte aligned and unique to a type valid for the duration of the returned type id's usage
Definition at line 80 of file Support.cpp.
References mlir::TypeID::getFromOpaquePointer(), and wrap().
| bool mlirTypeIDEqual | ( | MlirTypeID | typeID1, |
| MlirTypeID | typeID2 ) |
Checks if two type ids are equal.
Definition at line 89 of file Support.cpp.
References unwrap().
Referenced by mlir::python::MlirTypeIDEqual::operator()().
| size_t mlirTypeIDHashValue | ( | MlirTypeID | typeID | ) |
Returns the hash value of the type id.
Definition at line 93 of file Support.cpp.
References unwrap().
Referenced by mlir::python::MlirTypeIDHash::operator()(), and mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().