summaryrefslogtreecommitdiff
path: root/backend/src/libocl/src/ocl_enqueue.cl
blob: 2dd87307fd778b2ac68f333d98f11e0856609517 (plain)
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
/*
 * Copyright © 2012 - 2014 Intel Corporation
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
 *
 */
#include "ocl_enqueue.h"

int __gen_ocl_enqueue_kernel(uint, uint);

OVERLOADABLE ndrange_t ndrange_1D(size_t global_work_size) {
  ndrange_t value;
  value.globalSize[0] = global_work_size;
  value.globalSize[1] = value.globalSize[2] = 1;
  value.localSize[0] = global_work_size > 16 ? 16 : global_work_size;
  value.localSize[1] = value.localSize[2] = 1;
  value.globalOffset[0] = value.globalOffset[1] = value.globalOffset[2] = 0;
  return value;
}

int enqueue_kernel(queue_t queue, kernel_enqueue_flags_t flags,
                   const ndrange_t ndrange) //, void (^block)(void));
{
  return __gen_ocl_enqueue_kernel(ndrange.globalSize[0], ndrange.localSize[0]);
}