SmartEngine
1.6.0
Native
Library
API
Context.h
1
// Copyright (C) Entropy Software LLC - All Rights Reserved
2
3
#pragma once
4
5
#include "Object.h"
6
7
namespace
SmartEngine
8
{
9
13
enum class
DeviceType
: byte
14
{
18
Default,
19
23
Cpu,
24
28
Gpu
,
29
};
30
39
class
SMARTENGINE_EXPORT
IContext
:
public
virtual
IObject
40
{
41
public
:
42
SMARTENGINE_DECLARE_CLASS(
IContext
)
43
44
45
virtual
DeviceType
GetDeviceType()
const
= 0;
49
};
50
54
SMARTENGINE_EXPORT
ObjectPtr<IContext>
CreateContext
(
DeviceType
device = DeviceType::Default);
55
57
extern
"C"
58
{
59
SMARTENGINE_EXPORT ObjPtr Context_CreateInstance(
DeviceType
device);
60
SMARTENGINE_EXPORT
int
Context_GetDeviceType(ObjPtr
object
);
61
}
63
64
}
// namespace SmartEngine
SmartEngine::DeviceType::Default
@ Default
Chooses the best device for the current system.
SmartEngine::ObjectPtr
Smart pointer to an IObject. Automatic ref counting.
Definition:
ObjectPtr.h:16
SmartEngine
Definition:
A2CTrainer.h:10
SmartEngine::IObject
Base class for SmartEngine AI objects. It is not common to deal with this class directly.
Definition:
Object.h:19
SmartEngine::CreateContext
SMARTENGINE_EXPORT ObjectPtr< IContext > CreateContext(DeviceType device=DeviceType::Default)
Creates a context using the specified device.
SmartEngine::IContext
Every node in the AI graph must belong to the same context.
Definition:
Context.h:40
SmartEngine::DeviceType
DeviceType
The type of context to create.
Definition:
Context.h:14
Generated by
1.8.20