Commit 86e190d4 authored by Luis Mendes's avatar Luis Mendes Committed by Luis Mendes

Improve Range API to better bound a Range instance with Device and Kernel, fix...

Improve Range API to better bound a Range instance with Device and Kernel, fix work group size computation for JTP and OpenCL (refs #5)

Disable runtime execution time check when running in JTP for ProfileNewReportAPITest.multiThreadedSingleKernelReportObserverTestHelper

Disable runtime execution time check when running in JTP for ProfileNewReportAPITest.singleThreadedSingleKernelReportObserverTestHelper

Improve code quality and disable checks for JTP ProfileReportBackwardsCompatTest
parent 4d666a0c
Pipeline #1004 passed with stage
in 3 minutes and 14 seconds
......@@ -7,6 +7,10 @@
* Fixed NPE bug for Kernel.getProfileReportCurrentThread(device) and similar methods
* Fixed bug where ClassModel would throw an error when loaded if boot strap methods were 0.
* Aparapi can now run on any OpenCL version rather than failing on untested versions it produces a warning.
* Fixes Java Alternative algorithm does not work for arbitrary NDRanges #142, #5
* New Range method API to deal with the fact Ranges need to be bound to the Device and Kernel instances
* Fixed Range computation of local size for 1D ranges, where the algorithm could exceed the max. kernel and device allowed work group size
* Reworked Profiling support to deal with the possibility of Kernel compilation being decoupled from the kernel execution
* Updated the following dependency versions:
** com.aparapi: aparapi-jni 1.4.2 -> 1.4.3
** org.apache.bcel:bcel 6.4.1 -< 6.5.0
......
......@@ -90,6 +90,7 @@ import java.util.logging.Logger;
import com.aparapi.device.Device;
import com.aparapi.device.JavaDevice;
import com.aparapi.device.OpenCLDevice;
import com.aparapi.exception.AparapiKernelFailedException;
import com.aparapi.exception.CompileFailedException;
import com.aparapi.internal.kernel.IKernelBarrier;
import com.aparapi.internal.kernel.KernelArg;
......@@ -342,6 +343,9 @@ public abstract class Kernel implements Cloneable {
public abstract void run();
public Kernel execute(Range _range) {
if (!_range.isSameKernel(Kernel.this)) {
throw new AparapiKernelFailedException("Cannot execute kernel with the specified Range. It is targetting a different Kernel instance");
}
return (Kernel.this.execute("foo", _range, 1));
}
}
......@@ -2801,6 +2805,9 @@ public abstract class Kernel implements Cloneable {
*
*/
public synchronized Kernel execute(Range _range) {
if (!_range.isSameKernel(this)) {
throw new AparapiKernelFailedException("Cannot execute kernel with the specified Range. It is targetting a different Kernel instance");
}
return (execute(_range, 1));
}
......@@ -2843,10 +2850,10 @@ public abstract class Kernel implements Cloneable {
protected Range createRange(int _range) {
if (executionMode.equals(EXECUTION_MODE.AUTO)) {
Device device = getTargetDevice();
Range range = Range.create(device, _range);
Range range = Range.create(this, device, _range);
return range;
} else {
return Range.create(null, _range);
return Range.create(this, null, _range);
}
}
......@@ -2861,6 +2868,9 @@ public abstract class Kernel implements Cloneable {
*
*/
public synchronized Kernel execute(Range _range, int _passes) {
if (!_range.isSameKernel(this)) {
throw new AparapiKernelFailedException("Cannot execute kernel with the specified Range. It is targetting a different Kernel instance");
}
return (execute("run", _range, _passes));
}
......@@ -2904,6 +2914,9 @@ public abstract class Kernel implements Cloneable {
*
*/
public synchronized Kernel execute(String _entrypoint, Range _range, int _passes) {
if (!_range.isSameKernel(this)) {
throw new AparapiKernelFailedException("Cannot execute kernel with the specified Range. It is targetting a different Kernel instance");
}
return prepareKernelRunner().execute(_entrypoint, _range, _passes);
}
......
......@@ -119,11 +119,26 @@ public final class ProfileReport {
if (stage == ProfilingEvent.START.ordinal()) {
return 0;
}
if (stage == ProfilingEvent.READY_TO_PREPARE_EXECUTE.ordinal()) {
//Ready to prepare execute is a stage that never takes time it is just a partial start time
//reference point.
return 0.0;
}
return (currentTimes[stage] - currentTimes[stage - 1]) / MILLION;
}
/** Elapsed time for all events {@code from} through {@code to}.*/
public double getElapsedTime(int from, int to) {
double accum = 0.0;
if (from < ProfilingEvent.READY_TO_PREPARE_EXECUTE.ordinal()) {
if (to >= ProfilingEvent.READY_TO_PREPARE_EXECUTE.ordinal()) {
accum = (currentTimes[ProfilingEvent.OPENCL_COMPILED.ordinal()] - currentTimes[from]) / MILLION;
accum += (currentTimes[to] - currentTimes[ProfilingEvent.READY_TO_PREPARE_EXECUTE.ordinal()]) / MILLION;
return accum;
} else {
return (currentTimes[to] - currentTimes[from]) / MILLION;
}
}
return (currentTimes[to] - currentTimes[from]) / MILLION;
}
......
This diff is collapsed.
......@@ -134,29 +134,29 @@ public abstract class Device implements Comparable<Device> {
this.maxWorkItemSize = maxWorkItemSize;
}
public Range createRange(int _globalWidth) {
return (Range.create(this, _globalWidth));
public Range createRange(Kernel kernel, int _globalWidth) {
return (Range.create(kernel, this, _globalWidth));
}
public Range createRange(int _globalWidth, int _localWidth) {
return (Range.create(this, _globalWidth, _localWidth));
public Range createRange(Kernel kernel, int _globalWidth, int _localWidth) {
return (Range.create(kernel, this, _globalWidth, _localWidth));
}
public Range createRange2D(int _globalWidth, int _globalHeight) {
return (Range.create2D(this, _globalWidth, _globalHeight));
public Range createRange2D(Kernel kernel, int _globalWidth, int _globalHeight) {
return (Range.create2D(kernel, this, _globalWidth, _globalHeight));
}
public Range createRange2D(int _globalWidth, int _globalHeight, int _localWidth, int _localHeight) {
return (Range.create2D(this, _globalWidth, _globalHeight, _localWidth, _localHeight));
public Range createRange2D(Kernel kernel, int _globalWidth, int _globalHeight, int _localWidth, int _localHeight) {
return (Range.create2D(kernel, this, _globalWidth, _globalHeight, _localWidth, _localHeight));
}
public Range createRange3D(int _globalWidth, int _globalHeight, int _globalDepth) {
return (Range.create3D(this, _globalWidth, _globalHeight, _globalDepth));
public Range createRange3D(Kernel kernel, int _globalWidth, int _globalHeight, int _globalDepth) {
return (Range.create3D(kernel, this, _globalWidth, _globalHeight, _globalDepth));
}
public Range createRange3D(int _globalWidth, int _globalHeight, int _globalDepth, int _localWidth, int _localHeight,
public Range createRange3D(Kernel kernel, int _globalWidth, int _globalHeight, int _globalDepth, int _localWidth, int _localHeight,
int _localDepth) {
return (Range.create3D(this, _globalWidth, _globalHeight, _globalDepth, _localWidth, _localHeight, _localDepth));
return (Range.create3D(kernel, this, _globalWidth, _globalHeight, _globalDepth, _localWidth, _localHeight, _localDepth));
}
public abstract long getDeviceId();
......
/**
* 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.exception;
/**
* This exception is thrown when a Range creation fails.
*
* @author CoreRasurae
*/
public class AparapiRangeFailedException extends RuntimeException {
/**
*
*/
private static final long serialVersionUID = 5825738909363220032L;
public AparapiRangeFailedException(String message) {
super(message);
}
public AparapiRangeFailedException(String message, Throwable cause) {
super(message, cause);
}
public AparapiRangeFailedException(String message, Throwable cause, boolean enableSuppression,
boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
}
......@@ -71,9 +71,11 @@ public class KernelProfile {
/**
* Starts a profiling information gathering sequence for the current thread invoking this method
* regarding the specified execution device.
* @param device
* @param device the device to which the report pertains
* @param compileOnly <ul><li>true, if this event is from a compile only dry run</li>
* <li>false, if this event is from a regular kernel run</li></ul>
*/
void onStart(Device device) {
void onStart(Device device, boolean compileOnly) {
KernelDeviceProfile currentDeviceProfile = deviceProfiles.get(device);
if (currentDeviceProfile == null) {
currentDeviceProfile = new KernelDeviceProfile(this, kernelClass, device);
......@@ -83,7 +85,7 @@ public class KernelProfile {
}
}
currentDeviceProfile.onEvent(ProfilingEvent.START);
currentDeviceProfile.onEvent(ProfilingEvent.START, compileOnly);
currentDevice.set(device);
}
......@@ -93,25 +95,28 @@ public class KernelProfile {
*
* @param device the device where the kernel is/was executed
* @param event the event for which the profiling information is being updated
* @param compileOnly <ul><li>true, if this event is from a compile only dry run</li>
* <li>false, if this event is from a regular kernel run</li></ul>
*/
void onEvent(Device device, ProfilingEvent event) {
void onEvent(Device device, ProfilingEvent event, boolean compileOnly) {
if (event == null) {
logger.log(Level.WARNING, "Discarding profiling event " + event + " for null device, for Kernel class: " + kernelClass.getName());
return;
}
final KernelDeviceProfile deviceProfile = deviceProfiles.get(device);
switch (event) {
case CLASS_MODEL_BUILT: // fallthrough
case OPENCL_GENERATED: // fallthrough
case INIT_JNI: // fallthrough
case OPENCL_COMPILED: // fallthrough
case PREPARE_EXECUTE: // fallthrough
case EXECUTED: // fallthrough
case CLASS_MODEL_BUILT: // fallthrough
case OPENCL_GENERATED: // fallthrough
case INIT_JNI: // fallthrough
case OPENCL_COMPILED: // fallthrough
case READY_TO_PREPARE_EXECUTE: //falltrhough
case PREPARE_EXECUTE: // fallthrough
case EXECUTED: // fallthrough
{
if (deviceProfile == null) {
logger.log(Level.SEVERE, "Error in KernelProfile, no currentDevice (synchronization error?");
}
deviceProfile.onEvent(event);
deviceProfile.onEvent(event, compileOnly);
break;
}
case START:
......
......@@ -478,7 +478,7 @@ public class KernelRunner extends KernelRunnerJNI{
boolean legacySequentialMode = kernel.getExecutionMode().equals(Kernel.EXECUTION_MODE.SEQ);
passId = PASS_ID_PREPARING_EXECUTION;
_settings.profile.onEvent(device, ProfilingEvent.PREPARE_EXECUTE);
_settings.profile.onEvent(device, ProfilingEvent.PREPARE_EXECUTE, false);
try {
if (device == JavaDevice.ALTERNATIVE_ALGORITHM) {
......@@ -1370,15 +1370,15 @@ public class KernelRunner extends KernelRunnerJNI{
Range result;
switch (_settings.range.getDims()) {
case 1: {
result = Range.create(device, _settings.range.getGlobalSize_0());
result = Range.create(kernel, device, _settings.range.getGlobalSize_0());
break;
}
case 2: {
result = Range.create2D(device, _settings.range.getGlobalSize_0(), _settings.range.getGlobalSize_1());
result = Range.create2D(kernel, device, _settings.range.getGlobalSize_0(), _settings.range.getGlobalSize_1());
break;
}
case 3: {
result = Range.create3D(device, _settings.range.getGlobalSize_0(), _settings.range.getGlobalSize_1(), _settings.range.getGlobalSize_2());
result = Range.create3D(kernel, device, _settings.range.getGlobalSize_0(), _settings.range.getGlobalSize_1(), _settings.range.getGlobalSize_2());
break;
}
default: {
......@@ -1401,7 +1401,7 @@ public class KernelRunner extends KernelRunnerJNI{
@SuppressWarnings("deprecation")
synchronized private Kernel fallBackToNextDevice(Device device, ExecutionSettings _settings, Exception _exception, boolean _silently) {
isFallBack = true;
_settings.profile.onEvent(device, ProfilingEvent.EXECUTED);
_settings.profile.onEvent(device, ProfilingEvent.EXECUTED, false);
if (_settings.legacyExecutionMode) {
if (!_silently && logger.isLoggable(Level.WARNING)) {
logger.warning("Execution mode " + kernel.getExecutionMode() + " failed for " + kernel + ": " + _exception.getMessage());
......@@ -1461,9 +1461,9 @@ public class KernelRunner extends KernelRunnerJNI{
public synchronized Kernel compile(String _entrypoint, final Device device) throws CompileFailedException {
KernelProfile profile = KernelManager.instance().getProfile(kernel.getClass());
KernelPreferences preferences = KernelManager.instance().getPreferences(kernel);
Range range = new Range(device, 1);
ExecutionSettings settings = new ExecutionSettings(preferences, profile, _entrypoint, range, 1, false);
return executeInternalInner(settings, device, true);
Range range = Range.create((Kernel)null, device, 1);
ExecutionSettings settings = new ExecutionSettings(preferences, profile, _entrypoint, range, 1, false);
return executeInternalInner(settings, device, true);
}
private synchronized Kernel executeInternalOuter(ExecutionSettings _settings) {
......@@ -1571,7 +1571,7 @@ public class KernelRunner extends KernelRunnerJNI{
device = openCLDevice;
}
assert device != null : "No device available";
_settings.profile.onStart(device);
_settings.profile.onStart(device, compileOnly);
/* for backward compatibility reasons we still honor execution mode */
boolean isOpenCl = requestedExecutionMode.isOpenCL() || device instanceof OpenCLDevice;
if (isOpenCl) {
......@@ -1580,9 +1580,9 @@ public class KernelRunner extends KernelRunnerJNI{
try {
final ClassModel classModel = ClassModel.createClassModel(kernel.getClass());
entryPoint = classModel.getEntrypoint(_settings.entrypoint, kernel);
_settings.profile.onEvent(device, ProfilingEvent.CLASS_MODEL_BUILT);
_settings.profile.onEvent(device, ProfilingEvent.CLASS_MODEL_BUILT, false);
} catch (final Exception exception) {
_settings.profile.onEvent(device, ProfilingEvent.CLASS_MODEL_BUILT);
_settings.profile.onEvent(device, ProfilingEvent.CLASS_MODEL_BUILT, false);
if (compileOnly) {
//Cannot fallback in compile only mode
throw new CompileFailedException(exception);
......@@ -1602,7 +1602,7 @@ public class KernelRunner extends KernelRunnerJNI{
// Init the device to check capabilities before emitting the
// code that requires the capabilities.
jniContextHandle = initJNI(kernel, openCLDevice, jniFlags); // openCLDevice will not be null here
_settings.profile.onEvent(device, ProfilingEvent.INIT_JNI);
_settings.profile.onEvent(device, ProfilingEvent.INIT_JNI, false);
} // end of synchronized! issue 68
if (jniContextHandle == 0) {
......@@ -1661,12 +1661,12 @@ public class KernelRunner extends KernelRunnerJNI{
else if (Config.enableShowGeneratedOpenCL) {
System.out.println(openCL);
}
_settings.profile.onEvent(device, ProfilingEvent.OPENCL_GENERATED);
_settings.profile.onEvent(device, ProfilingEvent.OPENCL_GENERATED, compileOnly);
openCLCache.put(kernel.getClass(), openCL);
}
catch (final CodeGenException codeGenException) {
openCLCache.put(kernel.getClass(), CODE_GEN_ERROR_MARKER);
_settings.profile.onEvent(device, ProfilingEvent.OPENCL_GENERATED);
_settings.profile.onEvent(device, ProfilingEvent.OPENCL_GENERATED, compileOnly);
if (compileOnly) {
throw new CompileFailedException(codeGenException);
}
......@@ -1675,7 +1675,7 @@ public class KernelRunner extends KernelRunnerJNI{
}
else {
if (openCL.equals(CODE_GEN_ERROR_MARKER)) {
_settings.profile.onEvent(device, ProfilingEvent.OPENCL_GENERATED);
_settings.profile.onEvent(device, ProfilingEvent.OPENCL_GENERATED, compileOnly);
boolean silently = true; // since we must have already reported the CodeGenException
if (compileOnly) {
throw new CompileFailedException("Code Gen Error Marker present");
......@@ -1705,7 +1705,7 @@ public class KernelRunner extends KernelRunnerJNI{
}
}
}
_settings.profile.onEvent(device, ProfilingEvent.OPENCL_COMPILED);
_settings.profile.onEvent(device, ProfilingEvent.OPENCL_COMPILED, compileOnly);
if (handle == 0) {
if (compileOnly) {
//When compiling a kernel for a specific device device fallback is not allowed
......@@ -1720,8 +1720,9 @@ public class KernelRunner extends KernelRunnerJNI{
return kernel;
}
}
if (entryPoint != null) {
_settings.profile.onEvent(device, ProfilingEvent.READY_TO_PREPARE_EXECUTE, compileOnly);
if (entryPoint != null) {
//Pre-compiled kernels that never executed must resume here
args = new KernelArg[entryPoint.getReferencedFields().size()];
int i = 0;
......@@ -1848,7 +1849,7 @@ public class KernelRunner extends KernelRunnerJNI{
argc = i;
setArgsJNI(jniContextHandle, args, argc);
_settings.profile.onEvent(device, ProfilingEvent.PREPARE_EXECUTE);
_settings.profile.onEvent(device, ProfilingEvent.PREPARE_EXECUTE, false);
kernelNeverExecutedForDeviceHash.putIfAbsent(device, false);
try {
......@@ -1885,7 +1886,7 @@ public class KernelRunner extends KernelRunnerJNI{
return kernel;
}
finally {
_settings.profile.onEvent(device, ProfilingEvent.EXECUTED);
_settings.profile.onEvent(device, ProfilingEvent.EXECUTED, compileOnly);
maybeReportProfile(_settings);
}
}
......
......@@ -21,7 +21,7 @@ import java.util.concurrent.atomic.AtomicReference;
* Created by Barney on 02/09/2015.
*/
public enum ProfilingEvent {
START, CLASS_MODEL_BUILT, INIT_JNI, OPENCL_GENERATED, OPENCL_COMPILED, PREPARE_EXECUTE, EXECUTED;
START, CLASS_MODEL_BUILT, INIT_JNI, OPENCL_GENERATED, OPENCL_COMPILED, READY_TO_PREPARE_EXECUTE, PREPARE_EXECUTE, EXECUTED;
static final AtomicReference<String[]> stagesNames = new AtomicReference<String[]>(null);
......
......@@ -94,7 +94,7 @@ public class AtomicsSupportAdvTest {
final AtomicKernel kernel = new AtomicKernel(in, out);
try {
final Range range = openCLDevice.createRange(SIZE/2, SIZE/2);
final Range range = openCLDevice.createRange(kernel, SIZE/2, SIZE/2);
kernel.setExplicit(true);
kernel.put(in);
kernel.execute(range);
......@@ -121,7 +121,7 @@ public class AtomicsSupportAdvTest {
final AtomicKernel kernel = new AtomicKernel(in, out);
try {
final Range range = openCLDevice.createRange(SIZE/2, SIZE/2);
final Range range = openCLDevice.createRange(kernel, SIZE/2, SIZE/2);
kernel.execute(range);
} finally {
kernel.dispose();
......@@ -147,7 +147,7 @@ public class AtomicsSupportAdvTest {
final AtomicKernel kernel = new AtomicKernel(in, out);
try {
final Range range = device.createRange(SIZE/2, SIZE/2);
final Range range = device.createRange(kernel, SIZE/2, SIZE/2);
kernel.execute(range);
} finally {
kernel.dispose();
......@@ -172,7 +172,7 @@ public class AtomicsSupportAdvTest {
final AtomicBKernel kernel = new AtomicBKernel(in, out);
try {
final Range range = openCLDevice.createRange(SIZE/2, SIZE/2);
final Range range = openCLDevice.createRange(kernel, SIZE/2, SIZE/2);
kernel.execute(range);
} finally {
kernel.dispose();
......@@ -200,7 +200,7 @@ public class AtomicsSupportAdvTest {
final AtomicBKernel kernel = new AtomicBKernel(in, out);
try {
final Range range = device.createRange(SIZE/2, SIZE/2);
final Range range = device.createRange(kernel, SIZE/2, SIZE/2);
kernel.execute(range);
} finally {
kernel.dispose();
......
......@@ -94,7 +94,7 @@ public class BarrierSupportTest {
}
try {
final Range range = openCLDevice.createRange(SIZE, SIZE);
final Range range = openCLDevice.createRange(kernel, SIZE, SIZE);
targetArray = initInputArray();
kernel.setExplicit(false);
kernel.setArray(targetArray);
......@@ -124,7 +124,7 @@ public class BarrierSupportTest {
}
try {
final Range range = openCLDevice.createRange(SIZE, SIZE);
final Range range = openCLDevice.createRange(kernel, SIZE, SIZE);
targetArray = initInputArray();
kernel.setExplicit(true);
kernel.setArray(targetArray);
......@@ -146,7 +146,7 @@ public class BarrierSupportTest {
final Barrrier1Kernel kernel = new Barrrier1Kernel(SIZE);
try {
final Range range = device.createRange(SIZE, SIZE);
final Range range = device.createRange(kernel, SIZE, SIZE);
targetArray = initInputArray();
kernel.setExplicit(false);
kernel.setArray(targetArray);
......@@ -176,7 +176,7 @@ public class BarrierSupportTest {
}
try {
final Range range = openCLDevice.createRange(SIZE, SIZE);
final Range range = openCLDevice.createRange(kernel, SIZE, SIZE);
targetArray = initInputArray();
kernel.setExplicit(false);
kernel.setArray(targetArray);
......@@ -206,7 +206,7 @@ public class BarrierSupportTest {
}
try {
final Range range = openCLDevice.createRange(SIZE, SIZE);
final Range range = openCLDevice.createRange(kernel, SIZE, SIZE);
targetArray = initInputArray();
kernel.setExplicit(true);
kernel.setArray(targetArray);
......@@ -228,7 +228,7 @@ public class BarrierSupportTest {
final Barrrier2Kernel kernel = new Barrrier2Kernel(SIZE);
try {
final Range range = device.createRange(SIZE, SIZE);
final Range range = device.createRange(kernel, SIZE, SIZE);
targetArray = initInputArray();
kernel.setExplicit(false);
kernel.setArray(targetArray);
......
......@@ -51,7 +51,7 @@ public class BufferTransferTest {
if (maxSize < SIZE) {
SIZE = maxSize;
}
final Range range = openCLDevice.createRange(SIZE);
final Range range = openCLDevice.createRange(kernel, SIZE);
kernel.in = new int[SIZE];
kernel.out = new int[SIZE];
......@@ -76,7 +76,7 @@ public class BufferTransferTest {
if (maxSize < SIZE) {
SIZE = maxSize;
}
final Range range = openCLDevice.createRange(SIZE);
final Range range = openCLDevice.createRange(kernel, SIZE);
kernel.values = new int[SIZE];
kernel.result = new int[SIZE];
......@@ -129,7 +129,7 @@ public class BufferTransferTest {
SIZE = maxSize;
}
kernel.setExplicit(true);
final Range range = openCLDevice.createRange(SIZE);
final Range range = openCLDevice.createRange(kernel, SIZE);
kernel.values = new int[SIZE];
kernel.result = new int[SIZE];
......
......@@ -70,7 +70,7 @@ public class IntArray2DTest {
}
};
final Range range = openCLDevice.createRange(size);
final Range range = openCLDevice.createRange(kernel, size);
try {
kernel.execute(range);
......
......@@ -464,7 +464,7 @@ public class JtpRangeIdsTest {
@Test
public void test() {
MatrixKernel kernel = new MatrixKernel();
kernel.execute(Range.create2D(12, 4, 4, 2));
kernel.execute(Range.create2D(kernel, 12, 4, 4, 2));
for(boolean hasPassed : kernel.passed) {
Assert.assertTrue("Resulting matrix was invalid", hasPassed);
}
......
......@@ -86,7 +86,7 @@ public class KernelAndDeviceItemSizeLimitsTest {
assertTrue("Max Local Mem Size should be greater or equal to 0", maxLocalMemSize >= 0);
Range r = Range.create(openCLDevice, SIZE, SIZE);
Range r = Range.create(myKernel, openCLDevice, SIZE, SIZE);
myKernel.execute(r);
int[] results = myKernel.getResults();
......@@ -111,7 +111,7 @@ public class KernelAndDeviceItemSizeLimitsTest {
assertTrue("Max Private Mem Size should be greater than 0", maxPrivateMemSize >= 0);
Range r = Range.create(openCLDevice, SIZE);
Range r = Range.create(myKernel, openCLDevice, SIZE);
myKernel.execute(r);
int[] results = myKernel.getResults();
......@@ -136,7 +136,7 @@ public class KernelAndDeviceItemSizeLimitsTest {
assertTrue("Max Kernel Workgroup Size should be greater than 0", maxWorkGroupSize > 0);
Range r = Range.create(openCLDevice, SIZE);
Range r = Range.create(myKernel, openCLDevice, SIZE);
myKernel.execute(r);
int[] results = myKernel.getResults();
......@@ -161,7 +161,7 @@ public class KernelAndDeviceItemSizeLimitsTest {
assertTrue("Preferred Kernel Workgroup Size Multiple should be greater than 0", preferredWorkGroupSizeMultiple > 0);
Range r = Range.create(openCLDevice, SIZE);
Range r = Range.create(myKernel, openCLDevice, SIZE);
myKernel.execute(r);
int[] results = myKernel.getResults();
......@@ -190,7 +190,7 @@ public class KernelAndDeviceItemSizeLimitsTest {
assertTrue("Kernel Compile Work Group Size should be greater or equal than zero at index=" + i, maxWorkItemSize[i] >= 0);
}
Range r = Range.create(openCLDevice, SIZE);
Range r = Range.create(myKernel, openCLDevice, SIZE);
myKernel.execute(r);
int[] results = myKernel.getResults();
......@@ -222,7 +222,7 @@ public class KernelAndDeviceItemSizeLimitsTest {
assertTrue("Max Local Mem Size should be equal or greater to 0", maxLocalMemSize >= 0);
Range r = Range.create(device, SIZE, SIZE);
Range r = Range.create(myKernel, device, SIZE, SIZE);
myKernel.execute(r);
int[] results = myKernel.getResults();
......@@ -251,7 +251,7 @@ public class KernelAndDeviceItemSizeLimitsTest {
assertTrue("Max Private Mem Size should be equal or greater to 0", maxPrivateMemSize >= 0);