/**
 * Copyright (c) 2016 - 2018 Syncleus, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.aparapi.codegen.test;

import org.junit.Test;

public class WideLoadTest extends com.aparapi.codegen.CodeGenJUnitBase {

    private static final String[] expectedOpenCL = {
        "typedef struct This_s{\n"
        + " int passid;\n"
        + " }This;\n"
        + " int get_pass_id(This *this){\n"
        + " return this->passid;\n"
        + " }\n"
        + " __kernel void run(\n"
        + " int passid\n"
        + " ){\n"
        + " This thisStruct;\n"
        + " This* this=&thisStruct;\n"
        + " this->passid = passid;\n"
        + " {\n"
        + " int value00 = 0;\n"
        + " int value01 = 0;\n"
        + " int value02 = 0;\n"
        + " int value03 = 0;\n"
        + " int value04 = 0;\n"
        + " int value05 = 0;\n"
        + " int value06 = 0;\n"
        + " int value07 = 0;\n"
        + " int value08 = 0;\n"
        + " int value09 = 0;\n"
        + " int value0A = 0;\n"
        + " int value0B = 0;\n"
        + " int value0C = 0;\n"
        + " int value0D = 0;\n"
        + " int value0E = 0;\n"
        + " int value0F = 0;\n"
        + " int value10 = 0;\n"
        + " int value11 = 0;\n"
        + " int value12 = 0;\n"
        + " int value13 = 0;\n"
        + " int value14 = 0;\n"
        + " int value15 = 0;\n"
        + " int value16 = 0;\n"
        + " int value17 = 0;\n"
        + " int value18 = 0;\n"
        + " int value19 = 0;\n"
        + " int value1A = 0;\n"
        + " int value1B = 0;\n"
        + " int value1C = 0;\n"
        + " int value1D = 0;\n"
        + " int value1E = 0;\n"
        + " int value1F = 0;\n"
        + " int value20 = 0;\n"
        + " int value21 = 0;\n"
        + " int value22 = 0;\n"
        + " int value23 = 0;\n"
        + " int value24 = 0;\n"
        + " int value25 = 0;\n"
        + " int value26 = 0;\n"
        + " int value27 = 0;\n"
        + " int value28 = 0;\n"
        + " int value29 = 0;\n"
        + " int value2A = 0;\n"
        + " int value2B = 0;\n"
        + " int value2C = 0;\n"
        + " int value2D = 0;\n"
        + " int value2E = 0;\n"
        + " int value2F = 0;\n"
        + " int value30 = 0;\n"
        + " int value31 = 0;\n"
        + " int value32 = 0;\n"
        + " int value33 = 0;\n"
        + " int value34 = 0;\n"
        + " int value35 = 0;\n"
        + " int value36 = 0;\n"
        + " int value37 = 0;\n"
        + " int value38 = 0;\n"
        + " int value39 = 0;\n"
        + " int value3A = 0;\n"
        + " int value3B = 0;\n"
        + " int value3C = 0;\n"
        + " int value3D = 0;\n"
        + " int value3E = 0;\n"
        + " int value3F = 0;\n"
        + " int value40 = 0;\n"
        + " int value41 = 0;\n"
        + " int value42 = 0;\n"
        + " int value43 = 0;\n"
        + " int value44 = 0;\n"
        + " int value45 = 0;\n"
        + " int value46 = 0;\n"
        + " int value47 = 0;\n"
        + " int value48 = 0;\n"
        + " int value49 = 0;\n"
        + " int value4A = 0;\n"
        + " int value4B = 0;\n"
        + " int value4C = 0;\n"
        + " int value4D = 0;\n"
        + " int value4E = 0;\n"
        + " int value4F = 0;\n"
        + " int value50 = 0;\n"
        + " int value51 = 0;\n"
        + " int value52 = 0;\n"
        + " int value53 = 0;\n"
        + " int value54 = 0;\n"
        + " int value55 = 0;\n"
        + " int value56 = 0;\n"
        + " int value57 = 0;\n"
        + " int value58 = 0;\n"
        + " int value59 = 0;\n"
        + " int value5A = 0;\n"
        + " int value5B = 0;\n"
        + " int value5C = 0;\n"
        + " int value5D = 0;\n"
        + " int value5E = 0;\n"
        + " int value5F = 0;\n"
        + " int value60 = 0;\n"
        + " int value61 = 0;\n"
        + " int value62 = 0;\n"
        + " int value63 = 0;\n"
        + " int value64 = 0;\n"
        + " int value65 = 0;\n"
        + " int value66 = 0;\n"
        + " int value67 = 0;\n"
        + " int value68 = 0;\n"
        + " int value69 = 0;\n"
        + " int value6A = 0;\n"
        + " int value6B = 0;\n"
        + " int value6C = 0;\n"
        + " int value6D = 0;\n"
        + " int value6E = 0;\n"
        + " int value6F = 0;\n"
        + " int value70 = 0;\n"
        + " int value71 = 0;\n"
        + " int value72 = 0;\n"
        + " int value73 = 0;\n"
        + " int value74 = 0;\n"
        + " int value75 = 0;\n"
        + " int value76 = 0;\n"
        + " int value77 = 0;\n"
        + " int value78 = 0;\n"
        + " int value79 = 0;\n"
        + " int value7A = 0;\n"
        + " int value7B = 0;\n"
        + " int value7C = 0;\n"
        + " int value7D = 0;\n"
        + " int value7E = 0;\n"
        + " int value7F = 0;\n"
        + " int value80 = 0;\n"
        + " int value81 = 0;\n"
        + " int value82 = 0;\n"
        + " int value83 = 0;\n"
        + " int value84 = 0;\n"
        + " int value85 = 0;\n"
        + " int value86 = 0;\n"
        + " int value87 = 0;\n"
        + " int value88 = 0;\n"
        + " int value89 = 0;\n"
        + " int value8A = 0;\n"
        + " int value8B = 0;\n"
        + " int value8C = 0;\n"
        + " int value8D = 0;\n"
        + " int value8E = 0;\n"
        + " int value8F = 0;\n"
        + " int value90 = 0;\n"
        + " int value91 = 0;\n"
        + " int value92 = 0;\n"
        + " int value93 = 0;\n"
        + " int value94 = 0;\n"
        + " int value95 = 0;\n"
        + " int value96 = 0;\n"
        + " int value97 = 0;\n"
        + " int value98 = 0;\n"
        + " int value99 = 0;\n"
        + " int value9A = 0;\n"
        + " int value9B = 0;\n"
        + " int value9C = 0;\n"
        + " int value9D = 0;\n"
        + " int value9E = 0;\n"
        + " int value9F = 0;\n"
        + " int valueA0 = 0;\n"
        + " int valueA1 = 0;\n"
        + " int valueA2 = 0;\n"
        + " int valueA3 = 0;\n"
        + " int valueA4 = 0;\n"
        + " int valueA5 = 0;\n"
        + " int valueA6 = 0;\n"
        + " int valueA7 = 0;\n"
        + " int valueA8 = 0;\n"
        + " int valueA9 = 0;\n"
        + " int valueAA = 0;\n"
        + " int valueAB = 0;\n"
        + " int valueAC = 0;\n"
        + " int valueAD = 0;\n"
        + " int valueAE = 0;\n"
        + " int valueAF = 0;\n"
        + " int valueB0 = 0;\n"
        + " int valueB1 = 0;\n"
        + " int valueB2 = 0;\n"
        + " int valueB3 = 0;\n"
        + " int valueB4 = 0;\n"
        + " int valueB5 = 0;\n"
        + " int valueB6 = 0;\n"
        + " int valueB7 = 0;\n"
        + " int valueB8 = 0;\n"
        + " int valueB9 = 0;\n"
        + " int valueBA = 0;\n"
        + " int valueBB = 0;\n"
        + " int valueBC = 0;\n"
        + " int valueBD = 0;\n"
        + " int valueBE = 0;\n"
        + " int valueBF = 0;\n"
        + " int valueC0 = 0;\n"
        + " int valueC1 = 0;\n"
        + " int valueC2 = 0;\n"
        + " int valueC3 = 0;\n"
        + " int valueC4 = 0;\n"
        + " int valueC5 = 0;\n"
        + " int valueC6 = 0;\n"
        + " int valueC7 = 0;\n"
        + " int valueC8 = 0;\n"
        + " int valueC9 = 0;\n"
        + " int valueCA = 0;\n"
        + " int valueCB = 0;\n"
        + " int valueCC = 0;\n"
        + " int valueCD = 0;\n"
        + " int valueCE = 0;\n"
        + " int valueCF = 0;\n"
        + " int valueD0 = 0;\n"
        + " int valueD1 = 0;\n"
        + " int valueD2 = 0;\n"
        + " int valueD3 = 0;\n"
        + " int valueD4 = 0;\n"
        + " int valueD5 = 0;\n"
        + " int valueD6 = 0;\n"
        + " int valueD7 = 0;\n"
        + " int valueD8 = 0;\n"
        + " int valueD9 = 0;\n"
        + " int valueDA = 0;\n"
        + " int valueDB = 0;\n"
        + " int valueDC = 0;\n"
        + " int valueDD = 0;\n"
        + " int valueDE = 0;\n"
        + " int valueDF = 0;\n"
        + " int valueE0 = 0;\n"
        + " int valueE1 = 0;\n"
        + " int valueE2 = 0;\n"
        + " int valueE3 = 0;\n"
        + " int valueE4 = 0;\n"
        + " int valueE5 = 0;\n"
        + " int valueE6 = 0;\n"
        + " int valueE7 = 0;\n"
        + " int valueE8 = 0;\n"
        + " int valueE9 = 0;\n"
        + " int valueEA = 0;\n"
        + " int valueEB = 0;\n"
        + " int valueEC = 0;\n"
        + " int valueED = 0;\n"
        + " int valueEE = 0;\n"
        + " int valueEF = 0;\n"
        + " int valueF0 = 0;\n"
        + " int valueF1 = 0;\n"
        + " int valueF2 = 0;\n"
        + " int valueF3 = 0;\n"
        + " int valueF4 = 0;\n"
        + " int valueF5 = 0;\n"
        + " int valueF6 = 0;\n"
        + " int valueF7 = 0;\n"
        + " int valueF8 = 0;\n"
        + " int valueF9 = 0;\n"
        + " int valueFA = 0;\n"
        + " int valueFB = 0;\n"
        + " int valueFC = 0;\n"
        + " int valueFD = 0;\n"
        + " int valueFE = 0;\n"
        + " int valueFF = 0;\n"
        + " int valueWide = 0;\n"
        + " valueWide++;\n"
        + " return;\n"
        + " }\n"
        + " }\n"
        + " "};
    private static final Class<? extends com.aparapi.internal.exception.AparapiException> expectedException = null;

    @Test
    public void WideLoadTest() {
        test(com.aparapi.codegen.test.WideLoad.class, expectedException, expectedOpenCL);
    }

    @Test
    public void WideLoadTestWorksWithCaching() {
        test(com.aparapi.codegen.test.WideLoad.class, expectedException, expectedOpenCL);
    }
}
