@@ -0,0 +1,1953 @@
+/**%0A * Copyright (c) 2016 - 2017 Syncleus, Inc.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage com.aparapi.runtime;%0A%0Aimport static org.hamcrest.CoreMatchers.is;%0Aimport static org.junit.Assert.assertThat;%0A%0Aimport org.junit.After;%0Aimport org.junit.AfterClass;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport com.aparapi.Kernel;%0Aimport com.aparapi.device.Device;%0Aimport com.aparapi.internal.kernel.KernelManager;%0Aimport com.aparapi.internal.kernel.KernelManagers;%0A%0Apublic class Issue55Test %7B%0A%09private Kernel testKernel;%0A%0A%09@Before%0A%09public void setUp() %7B%0A%09%09testKernel = new Kernel() %7B%0A%0A%09%09%09@Override%0A%09%09%09public void run() %7B%0A%09%09%09%7D%0A%09%09%7D;%0A%09%7D%0A%0A%09@After%0A%09public void tearDown() %7B%0A%09%09testKernel.dispose();%0A%09%7D%0A%0A%09@AfterClass%0A%09public static void tearDownClass() %7B%0A%09%09// reset the KernelManager after we are done, as some tests expect a openCL device%0A%09%09KernelManager.setKernelManager(new KernelManager() %7B%7D);%0A%09%7D%0A%0A%09@Test%0A%09public void testUseJTP_ONLY() %7B%0A%09%09KernelManager.setKernelManager(KernelManagers.JTP_ONLY);%0A%09%09%0A%09%09Device device = KernelManager.instance().getDefaultPreferences().getPreferredDevice(testKernel);%0A%0A%09%09assertThat(device.getType(), is(Device.TYPE.JTP));%0A%09%7D%0A%0A%09@Test%0A%09public void testUseSEQUENTIAL_ONLY() %7B%0A%09%09KernelManager.setKernelManager(KernelManagers.SEQUENTIAL_ONLY);%0A%0A%09%09Device device = KernelManager.instance().getDefaultPreferences().getPreferredDevice(testKernel);%0A%0A%09%09assertThat(device.getType(), is(Device.TYPE.SEQ));%0A%09%7D%0A%7D%0A

test to expose KernelManagers issue