/*!
[config]
name: Vector store private int2,3,4,8,16
clc_version_min: 11

dimensions: 1
global_size: 1 0 0

[test]
name: vector store private int2
kernel_name: vstore2_private
arg_out: 0 buffer int[4] 0 28 46 0xdead
arg_in: 0 buffer int[4] 0 0 0  0xdead
arg_in:  1 buffer int2[1] 28 46

[test]
name: vector store private offset int2
kernel_name: vstore2_private_offset
arg_out: 0 buffer int[6] 0  28 46  28 46 0xdead
arg_in: 0 buffer int[6] 0 0 0 0 0  0xdead
arg_in: 1 buffer int2[1] 28 46

[test]
name: vector store private int3
kernel_name: vstore3_private
arg_out: 0 buffer int[5] 0 121 66 189 0xdead
arg_in: 0 buffer int[5] 0 0 0 0  0xdead
arg_in:  1 buffer int3[1] 121 66 189

[test]
name: vector store private offset int3
kernel_name: vstore3_private_offset
arg_out: 0 buffer int[8] 0  121 66 189  121 66 189 0xdead
arg_in: 0 buffer int[8] 0 0 0 0 0 0 0  0xdead
arg_in: 1 buffer int3[1] 121 66 189

[test]
name: vector store private int4
kernel_name: vstore4_private
arg_out: 0 buffer int[6] 0 120 155 52 202 0xdead
arg_in: 0 buffer int[6] 0 0 0 0 0  0xdead
arg_in:  1 buffer int4[1] 120 155 52 202

[test]
name: vector store private offset int4
kernel_name: vstore4_private_offset
arg_out: 0 buffer int[10] 0  120 155 52 202  120 155 52 202 0xdead
arg_in: 0 buffer int[10] 0 0 0 0 0 0 0 0 0  0xdead
arg_in: 1 buffer int4[1] 120 155 52 202

[test]
name: vector store private int8
kernel_name: vstore8_private
arg_out: 0 buffer int[10] 0 116 189 192 64 98 22 43 70 0xdead
arg_in: 0 buffer int[10] 0 0 0 0 0 0 0 0 0  0xdead
arg_in:  1 buffer int8[1] 116 189 192 64 98 22 43 70

[test]
name: vector store private offset int8
kernel_name: vstore8_private_offset
arg_out: 0 buffer int[18] 0  116 189 192 64 98 22 43 70  116 189 192 64 98 22 43 70 0xdead
arg_in: 0 buffer int[18] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0  0xdead
arg_in: 1 buffer int8[1] 116 189 192 64 98 22 43 70

[test]
name: vector store private int16
kernel_name: vstore16_private
arg_out: 0 buffer int[18] 0 185 240 246 145 213 116 228 2 209 132 121 113 5 151 154 171 0xdead
arg_in: 0 buffer int[18] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0  0xdead
arg_in:  1 buffer int16[1] 185 240 246 145 213 116 228 2 209 132 121 113 5 151 154 171

[test]
name: vector store private offset int16
kernel_name: vstore16_private_offset
arg_out: 0 buffer int[34] 0  185 240 246 145 213 116 228 2 209 132 121 113 5 151 154 171  185 240 246 145 213 116 228 2 209 132 121 113 5 151 154 171 0xdead
arg_in: 0 buffer int[34] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0  0xdead
arg_in: 1 buffer int16[1] 185 240 246 145 213 116 228 2 209 132 121 113 5 151 154 171

!*/

kernel void vstore2_private(global int *out,
                             global int2 *in) {
    int2 tmp = in[0];
    volatile private int loc[3];
    for (int i = 0; i < 3; ++i)
        loc[i] = (int)0;

    vstore2(tmp, 0, (private int*)loc + 1);
    for (int i = 0; i < 3; ++i)
        out[i] = loc[i];
}

kernel void vstore2_private_offset(global int *out,
                                    global int2 *in) {
    int2 tmp = in[0];
    volatile private int loc[5];
    for (int i = 0; i < 5; ++i)
        loc[i] = (int)0;

    vstore2(tmp, 0, (private int*)loc + 1);
    vstore2(tmp, 1, (private int*)loc + 1);
    for (int i = 0; i < 5; ++i)
        out[i] = loc[i];
}

kernel void vstore3_private(global int *out,
                             global int3 *in) {
    int3 tmp = in[0];
    volatile private int loc[4];
    for (int i = 0; i < 4; ++i)
        loc[i] = (int)0;

    vstore3(tmp, 0, (private int*)loc + 1);
    for (int i = 0; i < 4; ++i)
        out[i] = loc[i];
}

kernel void vstore3_private_offset(global int *out,
                                    global int3 *in) {
    int3 tmp = in[0];
    volatile private int loc[7];
    for (int i = 0; i < 7; ++i)
        loc[i] = (int)0;

    vstore3(tmp, 0, (private int*)loc + 1);
    vstore3(tmp, 1, (private int*)loc + 1);
    for (int i = 0; i < 7; ++i)
        out[i] = loc[i];
}

kernel void vstore4_private(global int *out,
                             global int4 *in) {
    int4 tmp = in[0];
    volatile private int loc[5];
    for (int i = 0; i < 5; ++i)
        loc[i] = (int)0;

    vstore4(tmp, 0, (private int*)loc + 1);
    for (int i = 0; i < 5; ++i)
        out[i] = loc[i];
}

kernel void vstore4_private_offset(global int *out,
                                    global int4 *in) {
    int4 tmp = in[0];
    volatile private int loc[9];
    for (int i = 0; i < 9; ++i)
        loc[i] = (int)0;

    vstore4(tmp, 0, (private int*)loc + 1);
    vstore4(tmp, 1, (private int*)loc + 1);
    for (int i = 0; i < 9; ++i)
        out[i] = loc[i];
}

kernel void vstore8_private(global int *out,
                             global int8 *in) {
    int8 tmp = in[0];
    volatile private int loc[9];
    for (int i = 0; i < 9; ++i)
        loc[i] = (int)0;

    vstore8(tmp, 0, (private int*)loc + 1);
    for (int i = 0; i < 9; ++i)
        out[i] = loc[i];
}

kernel void vstore8_private_offset(global int *out,
                                    global int8 *in) {
    int8 tmp = in[0];
    volatile private int loc[17];
    for (int i = 0; i < 17; ++i)
        loc[i] = (int)0;

    vstore8(tmp, 0, (private int*)loc + 1);
    vstore8(tmp, 1, (private int*)loc + 1);
    for (int i = 0; i < 17; ++i)
        out[i] = loc[i];
}

kernel void vstore16_private(global int *out,
                             global int16 *in) {
    int16 tmp = in[0];
    volatile private int loc[17];
    for (int i = 0; i < 17; ++i)
        loc[i] = (int)0;

    vstore16(tmp, 0, (private int*)loc + 1);
    for (int i = 0; i < 17; ++i)
        out[i] = loc[i];
}

kernel void vstore16_private_offset(global int *out,
                                    global int16 *in) {
    int16 tmp = in[0];
    volatile private int loc[33];
    for (int i = 0; i < 33; ++i)
        loc[i] = (int)0;

    vstore16(tmp, 0, (private int*)loc + 1);
    vstore16(tmp, 1, (private int*)loc + 1);
    for (int i = 0; i < 33; ++i)
        out[i] = loc[i];
}
