2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2018-10-18 12:38:18 +08:00
|
|
|
* Copyright (C) 2017-2018 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2018-10-18 12:38:18 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2018-10-27 06:02:28 +08:00
|
|
|
#pragma OPENCL EXTENSION cl_khr_global_int32_base_atomics : enable
|
|
|
|
|
2017-12-21 07:45:38 +08:00
|
|
|
__kernel void simple_kernel_0(
|
|
|
|
const uint arg0,
|
|
|
|
const float arg1,
|
|
|
|
__global uint *dst) {
|
|
|
|
|
|
|
|
uint idx = get_global_id(0);
|
|
|
|
uint data = arg0 + (uint)arg1;
|
|
|
|
|
|
|
|
dst[idx] = data;
|
|
|
|
}
|
|
|
|
|
|
|
|
__kernel void simple_kernel_1(
|
|
|
|
__global uint *src,
|
|
|
|
const uint arg1,
|
|
|
|
__global uint *dst) {
|
|
|
|
|
|
|
|
uint idx = get_global_id(0);
|
|
|
|
|
|
|
|
dst[idx] = src[idx] + arg1;
|
|
|
|
}
|
|
|
|
|
|
|
|
__kernel void simple_kernel_2(
|
|
|
|
const uint arg0,
|
|
|
|
__global uint *dst) {
|
|
|
|
|
|
|
|
uint idx = get_global_id(0);
|
|
|
|
|
|
|
|
dst[idx] = arg0;
|
|
|
|
}
|
2018-10-18 12:38:18 +08:00
|
|
|
|
|
|
|
__kernel void simple_kernel_3(
|
|
|
|
__global uint *dst) {
|
2018-10-24 06:49:00 +08:00
|
|
|
dst[get_global_id(0)] = 0;
|
2018-10-18 12:38:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
__kernel void simple_kernel_4() {
|
|
|
|
}
|
2018-10-27 06:02:28 +08:00
|
|
|
|
|
|
|
__kernel void simple_kernel_5(__global uint *dst) {
|
|
|
|
atomic_inc(dst);
|
|
|
|
}
|