CIRCT
20.0.0git
lib
Dialect
ESI
runtime
cpp
lib
Context.cpp
Go to the documentation of this file.
1
//===- Context.cpp --------------------------------------------------------===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
//
9
// DO NOT EDIT!
10
// This file is distributed as part of an ESI package. The source for this file
11
// should always be modified within CIRCT (lib/dialect/ESI/runtime/cpp/).
12
//
13
//===----------------------------------------------------------------------===//
14
15
#include "
esi/Context.h
"
16
#include "
esi/Accelerator.h
"
17
18
using namespace
esi
;
19
20
void
Context::registerType
(
Type
*type) {
21
if
(
types
.count(type->
getID
()))
22
throw
std::runtime_error(
"Type already exists in context"
);
23
types
.emplace(type->
getID
(), std::unique_ptr<Type>(type));
24
}
25
26
std::unique_ptr<AcceleratorConnection>
27
Context::connect
(std::string backend, std::string connection) {
28
return
registry::connect
(*
this
, backend, connection);
29
}
Accelerator.h
Context.h
esi::Context::types
TypeCache types
Definition:
Context.h:69
esi::Context::connect
std::unique_ptr< AcceleratorConnection > connect(std::string backend, std::string connection)
Connect to an accelerator backend.
Definition:
Context.cpp:27
esi::Context::registerType
void registerType(Type *type)
Register a type with the context. Takes ownership of the pointer type.
Definition:
Context.cpp:20
esi::Type
Root class of the ESI type system.
Definition:
Types.h:27
esi::Type::getID
ID getID() const
Definition:
Types.h:33
esi::registry::connect
std::unique_ptr< AcceleratorConnection > connect(Context &ctxt, const std::string &backend, const std::string &connection)
Definition:
Accelerator.cpp:231
esi
Definition:
esi.py:1
Generated on Mon Dec 23 2024 00:07:25 for CIRCT by
1.9.1