forked from plaidml/plaidml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlibrary.h
43 lines (33 loc) · 1.38 KB
/
library.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright 2017-2018 Intel Corporation.
#pragma once
#include <memory>
#include <string>
#include <vector>
#include "tile/base/hal.h"
#include "tile/hal/opencl/device_state.h"
#include "tile/hal/opencl/ocl.h"
#include "tile/lang/generate.h"
namespace vertexai {
namespace tile {
namespace hal {
namespace opencl {
class Library final : public hal::Library {
public:
static Library* Downcast(hal::Library* library, const std::shared_ptr<DeviceState>& device_state);
Library(const std::shared_ptr<DeviceState>& device_state, const std::map<std::string, CLObj<cl_program>>& program,
const std::vector<lang::KernelInfo>& kernel_info, std::vector<context::proto::ActivityID> kernel_ids);
std::map<std::string, std::string> Serialize() final;
const std::shared_ptr<DeviceState>& device_state() const { return device_state_; }
const std::map<std::string, CLObj<cl_program>>& program() const { return program_; }
const std::vector<lang::KernelInfo>& kernel_info() const { return kernel_info_; }
const std::vector<context::proto::ActivityID>& kernel_ids() const { return kernel_ids_; }
private:
std::shared_ptr<DeviceState> device_state_;
std::map<std::string, CLObj<cl_program>> program_;
std::vector<lang::KernelInfo> kernel_info_;
std::vector<context::proto::ActivityID> kernel_ids_;
};
} // namespace opencl
} // namespace hal
} // namespace tile
} // namespace vertexai