mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-23 03:33:13 +08:00
51 lines
865 B
Common Lisp
51 lines
865 B
Common Lisp
/*
|
|
* Copyright (C) 2017-2018 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#pragma OPENCL EXTENSION cl_khr_global_int32_base_atomics : enable
|
|
|
|
__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;
|
|
}
|
|
|
|
__kernel void simple_kernel_3(
|
|
__global uint *dst) {
|
|
dst[get_global_id(0)] = 0;
|
|
}
|
|
|
|
__kernel void simple_kernel_4() {
|
|
}
|
|
|
|
__kernel void simple_kernel_5(__global uint *dst) {
|
|
atomic_inc(dst);
|
|
}
|