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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
/*
* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can
* be found in the LICENSE file.
*
*/
#pragma once
//
//
//
#include <CL/opencl.h>
//
//
//
#define SKC_CL_ARG(arg) sizeof(arg),&arg
//
//
//
typedef enum skc_device_kernel_id {
SKC_DEVICE_KERNEL_ID_BLOCK_POOL_INIT_IDS,
SKC_DEVICE_KERNEL_ID_BLOCK_POOL_INIT_ATOMICS,
SKC_DEVICE_KERNEL_ID_PATHS_ALLOC,
SKC_DEVICE_KERNEL_ID_PATHS_COPY,
SKC_DEVICE_KERNEL_ID_FILLS_EXPAND,
SKC_DEVICE_KERNEL_ID_RASTERIZE_ALL,
SKC_DEVICE_KERNEL_ID_RASTERIZE_LINES,
SKC_DEVICE_KERNEL_ID_RASTERIZE_QUADS,
SKC_DEVICE_KERNEL_ID_RASTERIZE_CUBICS,
SKC_DEVICE_KERNEL_ID_RASTERIZE_RAT_QUADS,
SKC_DEVICE_KERNEL_ID_RASTERIZE_RAT_CUBICS,
SKC_DEVICE_KERNEL_ID_SEGMENT_TTRK,
SKC_DEVICE_KERNEL_ID_RASTERS_ALLOC,
SKC_DEVICE_KERNEL_ID_PREFIX,
SKC_DEVICE_KERNEL_ID_PLACE,
SKC_DEVICE_KERNEL_ID_SEGMENT_TTCK,
SKC_DEVICE_KERNEL_ID_RENDER,
SKC_DEVICE_KERNEL_ID_PATHS_RECLAIM,
SKC_DEVICE_KERNEL_ID_RASTERS_RECLAIM,
//
SKC_DEVICE_KERNEL_ID_COUNT
} skc_device_kernel_id;
//
//
//
void
skc_device_create(struct skc_runtime * const runtime);
void
skc_device_dispose(struct skc_runtime * const runtime);
//
// multi-threading/context/device requires multiple kernel instances
//
cl_kernel
skc_device_acquire_kernel(struct skc_device * const device,
skc_device_kernel_id const type);
void
skc_device_release_kernel(struct skc_device * const device,
cl_kernel kernel);
//
// grid shape can vary greatly by target platform
//
void
skc_device_enqueue_kernel(struct skc_device * const device,
skc_device_kernel_id const type,
cl_command_queue cq,
cl_kernel kernel,
size_t const work_size,
cl_uint num_events_in_wait_list,
cl_event const * const event_wait_list,
cl_event * const event);
//
//
//
|