This file is indexed.

/usr/share/pocl/include/pocl.h is in libpocl1-common 0.13-8.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
/* pocl.h - global pocl declarations.

   Copyright (c) 2011 Universidad Rey Juan Carlos
                 2011-2013 Pekka Jääskeläinen / Tampere University of Technology
  
   Permission is hereby granted, free of charge, to any person obtaining a copy
   of this software and associated documentation files (the "Software"), to deal
   in the Software without restriction, including without limitation the rights
   to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
   copies of the Software, and to permit persons to whom the Software is
   furnished to do so, subject to the following conditions:
   
   The above copyright notice and this permission notice shall be included in
   all copies or substantial portions of the Software.
   
   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
   THE SOFTWARE.
*/

/**
 * @file pocl.h
 * 
 * The declarations in this file are such that are used both in the
 * libpocl implementation CL and the kernel compiler. Others should be
 * moved to pocl_cl.h of lib/CL or under the kernel compiler dir. 
 * @todo Check if there are extra declarations here that could be moved.
 */
#ifndef POCL_H
#define POCL_H

#include <CL/opencl.h>

#include "pocl_device.h"
#include "config.h"

/*
 * During pocl kernel compiler transformations we use the fixed address 
 * space ids of clang's -ffake-address-space-map to mark the different 
 * address spaces to keep the processing target-independent. These
 * are converted to the target's address space map (if any), in a final
 * kernel compiler pass.
 */
#define POCL_ADDRESS_SPACE_PRIVATE 0
#define POCL_ADDRESS_SPACE_GLOBAL 1
#define POCL_ADDRESS_SPACE_LOCAL 2
#define POCL_ADDRESS_SPACE_CONSTANT 3
#define POCL_ADDRESS_SPACE_GENERIC 4

#define POCL_FILENAME_LENGTH 1024

typedef struct _mem_mapping mem_mapping_t;
/* represents a single buffer to host memory mapping */
struct _mem_mapping {
  void *host_ptr; /* the location of the mapped buffer chunk in the host memory */
  size_t offset; /* offset to the beginning of the buffer */
  size_t size;
  mem_mapping_t *prev, *next;
};

// Command Queue datatypes

// clEnqueueNDRangeKernel
typedef struct
{
  void *data;
  char *tmp_dir; 
  pocl_workgroup wg;
  cl_kernel kernel;
  /* A list of argument buffers to free after the command has 
     been executed. */
  cl_mem *arg_buffers;
  unsigned arg_buffer_count;
  size_t local_x;
  size_t local_y;
  size_t local_z;
  struct pocl_context pc;
  struct pocl_argument *arguments;
  /* Can be used to store/cache device-specific data. */
  void **device_data;
} _cl_command_run;

// clEnqueueNativeKernel
typedef struct
{
  void *data;
  void *args;
  size_t cb_args;
  void (*user_func)(void *);
  cl_mem *mem_list;
  unsigned num_mem_objects;
} _cl_command_native;

// clEnqueueReadBuffer
typedef struct
{
  void *host_ptr;
  const void *device_ptr;
  size_t offset;
  size_t cb;
  cl_mem buffer;
} _cl_command_read;

// clEnqueueWriteBuffer
typedef struct
{
  const void *host_ptr;
  void *device_ptr;
  size_t offset;
  size_t cb;
  cl_mem buffer;
} _cl_command_write;

// clEnqueueCopyBuffer
typedef struct
{
  void *data;
  void *src_ptr;
  size_t src_offset;
  void *dst_ptr;
  size_t dst_offset;
  size_t cb;
  cl_mem src_buffer;
  cl_mem dst_buffer;
} _cl_command_copy;

// clEnqueueMapBuffer
typedef struct
{
  cl_mem buffer;
  mem_mapping_t *mapping;
} _cl_command_map;

/* clEnqueue(Write/Read)Image */
typedef struct
{
  void *device_ptr;
  void *host_ptr;
  size_t origin[3];
  size_t region[3];
  size_t rowpitch;
  size_t slicepitch;
  cl_mem buffer;
} _cl_command_rw_image;

/* clEnqueueUnMapMemObject */
typedef struct
{
  void *data;
  cl_mem memobj;
  mem_mapping_t *mapping;
} _cl_command_unmap;

/* clEnqueueFillImage */
typedef struct
{
  void *data;
  void *device_ptr;
  size_t buffer_origin[3];
  size_t region[3];
  size_t rowpitch;
  size_t slicepitch;
  void *fill_pixel;
  size_t pixel_size;
} _cl_command_fill_image;

typedef struct
{
  void* ptr;
  size_t size, offset;
  void* pattern;
  size_t pattern_size;
} _cl_command_fill;

typedef struct
{
  void *data;
} _cl_command_marker;

typedef struct
{
  void* data;
  void* queue;
  unsigned  num_svm_pointers;
  void  **svm_pointers;
  void (CL_CALLBACK  *pfn_free_func) ( cl_command_queue queue,
                                       unsigned num_svm_pointers,
                                       void *svm_pointers[],
                                       void  *user_data);
} _cl_command_svm_free;

typedef struct
{
  void* svm_ptr;
  size_t size;
  cl_map_flags flags;
} _cl_command_svm_map;

typedef struct
{
  void* svm_ptr;
} _cl_command_svm_unmap;

typedef struct
{
  const void* src;
  void* dst;
  size_t size;
} _cl_command_svm_cpy;

typedef union
{
  _cl_command_run run;
  _cl_command_native native;
  _cl_command_read read;
  _cl_command_write write;
  _cl_command_copy copy;
  _cl_command_map map;
  _cl_command_fill_image fill_image;
  _cl_command_rw_image rw_image;
  _cl_command_marker marker;
  _cl_command_unmap unmap;
  _cl_command_fill memfill;

  _cl_command_svm_free svm_free;
  _cl_command_svm_map svm_map;
  _cl_command_svm_unmap svm_unmap;
  _cl_command_svm_cpy svm_memcpy;
} _cl_command_t;

// one item in the command queue
typedef struct _cl_command_node_struct
{
  _cl_command_t command;
  cl_command_type type;
  struct _cl_command_node_struct *next; // for linked-list storage
  cl_event event;
  const cl_event *event_wait_list;
  cl_uint num_events_in_wait_list;
  cl_device_id device;
} _cl_command_node;

/* Additional LLVM version macros to simplify ifdefs */

#if (defined LLVM_3_7)
# define LLVM_OLDER_THAN_3_8 1
#endif

#endif /* POCL_H */