forked from plaidml/plaidml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
zero_kernel.h
41 lines (32 loc) · 1.18 KB
/
zero_kernel.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
// Copyright 2017-2018 Intel Corporation.
#pragma once
#include <array>
#include <memory>
#include <string>
#include <vector>
#include "tile/base/hal.h"
#include "tile/hal/opencl/buffer.h"
#include "tile/hal/opencl/device_state.h"
#include "tile/hal/opencl/kernel.h"
namespace vertexai {
namespace tile {
namespace hal {
namespace opencl {
class ZeroKernel final : public Kernel {
public:
ZeroKernel(const std::shared_ptr<DeviceState>& device_state, const lang::KernelInfo& kinfo,
context::proto::ActivityID kid);
std::shared_ptr<hal::Event> Run(const context::Context& ctx, const std::vector<std::shared_ptr<hal::Buffer>>& params,
const std::vector<std::shared_ptr<hal::Event>>& dependencies,
bool enable_profiling) final;
private:
std::shared_ptr<DeviceState> device_state_;
lang::KernelInfo kinfo_;
context::proto::ActivityID kid_;
CLObj<cl_event> FillBufferImpl(const DeviceState::Queue& queue, Buffer* buf, void* pattern, size_t pattern_size,
const std::vector<cl_event>& deps);
};
} // namespace opencl
} // namespace hal
} // namespace tile
} // namespace vertexai