本文整理汇总了Java中com.nativelibs4java.opencl.CLEvent类的典型用法代码示例。如果您正苦于以下问题:Java CLEvent类的具体用法?Java CLEvent怎么用?Java CLEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CLEvent类属于com.nativelibs4java.opencl包,在下文中一共展示了CLEvent类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: kernel_14740318
import com.nativelibs4java.opencl.CLEvent; //导入依赖的package包/类
public static void kernel_14740318(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int[] paramArrayOfInt)
{
CLDevice.QueueProperties[] arrayOfQueueProperties = { CLDevice.QueueProperties.ProfilingEnable };
CLQueue localCLQueue = context.createDefaultQueue(arrayOfQueueProperties);
String[] arrayOfString = { kernel_14740318 };
CLKernel[] arrayOfCLKernel = context.createProgram(arrayOfString).createKernels();
CLKernel localCLKernel = arrayOfCLKernel[0];
int i = paramInt2;
int j = paramInt3;
int k = paramInt4;
CLBuffer localCLBuffer = context.createBuffer(CLMem.Usage.InputOutput, Pointer.pointerToInts(paramArrayOfInt), true);
localCLKernel.setArgs(new Object[] { paramInt1, i, j, k, localCLBuffer });
int m = paramInt1 - paramInt4 / 1;
CLEvent[] arrayOfCLEvent = { null };
CLEvent localCLEvent = localCLKernel.enqueueNDRange(localCLQueue, new int[] { m }, arrayOfCLEvent);
localCLQueue.finish();
localCLBuffer.read(localCLQueue, new CLEvent[] { localCLEvent }).getInts(paramArrayOfInt);
}
开发者ID:adnanmitf09,项目名称:Rubus,代码行数:19,代码来源:MemImage.java
示例2: kernel_20211761
import com.nativelibs4java.opencl.CLEvent; //导入依赖的package包/类
public static void kernel_20211761(int paramInt1, int paramInt2, int paramInt3, float paramFloat1, short[] paramArrayOfShort, int paramInt4, int paramInt5, float paramFloat2) {
CLDevice.QueueProperties[] arrayOfQueueProperties = { CLDevice.QueueProperties.ProfilingEnable };
CLQueue localCLQueue = context.createDefaultQueue(arrayOfQueueProperties);
String[] arrayOfString = { kernel_20211761 };
CLKernel[] arrayOfCLKernel = context.createProgram(arrayOfString).createKernels();
CLKernel localCLKernel = arrayOfCLKernel[0];
int i = paramInt2;
int j = paramInt3;
float f1 = paramFloat1;
CLBuffer localCLBuffer = context.createBuffer(CLMem.Usage.InputOutput, Pointer.pointerToShorts(paramArrayOfShort), true);
int k = paramInt4;
int m = paramInt5;
float f2 = paramFloat2;
localCLKernel.setArgs(new Object[] { paramInt1, i, j, f1, localCLBuffer, k, m, f2 });
int n = paramInt1 - paramInt5 / 1;
CLEvent[] arrayOfCLEvent = { null };
CLEvent localCLEvent = localCLKernel.enqueueNDRange(localCLQueue, new int[] { n }, arrayOfCLEvent);
localCLQueue.finish();
localCLBuffer.read(localCLQueue, new CLEvent[] { localCLEvent }).getShorts(paramArrayOfShort);
}
开发者ID:adnanmitf09,项目名称:Rubus,代码行数:21,代码来源:Mandelbrot.java
示例3: kernel_14309029
import com.nativelibs4java.opencl.CLEvent; //导入依赖的package包/类
public static void kernel_14309029(int paramInt1, int paramInt2, int paramInt3, int paramInt4, byte[] paramArrayOfByte1, int paramInt5, int paramInt6, int paramInt7, float[] paramArrayOfFloat, byte[] paramArrayOfByte2) {
CLDevice.QueueProperties[] arrayOfQueueProperties = { CLDevice.QueueProperties.ProfilingEnable };
CLQueue localCLQueue = context.createDefaultQueue(arrayOfQueueProperties);
String[] arrayOfString = { kernel_14309029 };
CLKernel[] arrayOfCLKernel = context.createProgram(arrayOfString).createKernels();
CLKernel localCLKernel = arrayOfCLKernel[0];
int i = paramInt2;
int j = paramInt3;
int k = paramInt4;
CLBuffer localCLBuffer1 = context.createBuffer(CLMem.Usage.InputOutput, Pointer.pointerToBytes(paramArrayOfByte1), true);
int m = paramInt5;
int n = paramInt6;
int i1 = paramInt7;
CLBuffer localCLBuffer2 = context.createBuffer(CLMem.Usage.Input, Pointer.pointerToFloats(paramArrayOfFloat), true);
CLBuffer localCLBuffer3 = context.createBuffer(CLMem.Usage.Input, Pointer.pointerToBytes(paramArrayOfByte2), true);
localCLKernel.setArgs(new Object[] { paramInt1, i, j, k, localCLBuffer1, m, n, i1, localCLBuffer2, localCLBuffer3 });
int i2 = paramInt1 - paramInt4 / 1;
CLEvent[] arrayOfCLEvent = { null };
CLEvent localCLEvent = localCLKernel.enqueueNDRange(localCLQueue, new int[] { i2 }, arrayOfCLEvent);
localCLQueue.finish();
localCLBuffer1.read(localCLQueue, new CLEvent[] { localCLEvent }).getBytes(paramArrayOfByte1);
}
开发者ID:adnanmitf09,项目名称:Rubus,代码行数:23,代码来源:Convolution.java
示例4: kernel_332684807
import com.nativelibs4java.opencl.CLEvent; //导入依赖的package包/类
public void kernel_332684807(int paramInt1, int paramInt2, int paramInt3, float[] paramArrayOfFloat1, int paramInt4, int paramInt5, float[] paramArrayOfFloat2, float[] paramArrayOfFloat3)
{
CLDevice.QueueProperties[] arrayOfQueueProperties = { CLDevice.QueueProperties.ProfilingEnable };
CLQueue localCLQueue = context.createDefaultQueue(arrayOfQueueProperties);
String[] arrayOfString = { kernel_332684807 };
CLKernel[] arrayOfCLKernel = context.createProgram(arrayOfString).createKernels();
CLKernel localCLKernel = arrayOfCLKernel[0];
int i = paramInt3;
CLBuffer localCLBuffer1 = context.createBuffer(CLMem.Usage.Input, Pointer.pointerToFloats(paramArrayOfFloat1), true);
int j = paramInt4;
int k = paramInt5;
CLBuffer localCLBuffer2 = context.createBuffer(CLMem.Usage.InputOutput, Pointer.pointerToFloats(paramArrayOfFloat2), true);
CLBuffer localCLBuffer3 = context.createBuffer(CLMem.Usage.Input, Pointer.pointerToFloats(paramArrayOfFloat3), true);
localCLKernel.setArgs(new Object[] { paramInt1, paramInt2, i, localCLBuffer1, j, k, localCLBuffer2, localCLBuffer3 });
int m = paramInt1 - paramInt5 / 1;
int n = paramInt2 - paramInt4 / 1;
CLEvent[] arrayOfCLEvent = { null };
CLEvent localCLEvent = localCLKernel.enqueueNDRange(localCLQueue, new int[] { m, n }, arrayOfCLEvent);
localCLQueue.finish();
localCLBuffer2.read(localCLQueue, new CLEvent[] { localCLEvent }).getFloats(paramArrayOfFloat2);
}
开发者ID:adnanmitf09,项目名称:Rubus,代码行数:24,代码来源:MatrixMultiplication.java
示例5: kernel_1365023967
import com.nativelibs4java.opencl.CLEvent; //导入依赖的package包/类
public static void kernel_1365023967(int paramInt1, float[] paramArrayOfFloat1, float[] paramArrayOfFloat2, int paramInt2)
{
CLDevice.QueueProperties[] arrayOfQueueProperties = { CLDevice.QueueProperties.ProfilingEnable };
CLQueue localCLQueue = context.createDefaultQueue(arrayOfQueueProperties);
String[] arrayOfString = { kernel_1365023967 };
CLKernel[] arrayOfCLKernel = context.createProgram(arrayOfString).createKernels();
CLKernel localCLKernel = arrayOfCLKernel[0];
CLBuffer localCLBuffer1 = context.createBuffer(CLMem.Usage.InputOutput, Pointer.pointerToFloats(paramArrayOfFloat1), true);
CLBuffer localCLBuffer2 = context.createBuffer(CLMem.Usage.Input, Pointer.pointerToFloats(paramArrayOfFloat2), true);
int i = paramInt2;
localCLKernel.setArgs(new Object[] { paramInt1, localCLBuffer1, localCLBuffer2, i });
int j = paramInt1 - paramInt2 / 1;
CLEvent[] arrayOfCLEvent = { null };
CLEvent localCLEvent = localCLKernel.enqueueNDRange(localCLQueue, new int[] { j }, arrayOfCLEvent);
localCLQueue.finish();
localCLBuffer1.read(localCLQueue, new CLEvent[] { localCLEvent }).getFloats(paramArrayOfFloat1);
}
开发者ID:adnanmitf09,项目名称:Rubus,代码行数:18,代码来源:SquaresMath.java
示例6: kernel_1387062610
import com.nativelibs4java.opencl.CLEvent; //导入依赖的package包/类
public static void kernel_1387062610(int paramInt1, int paramInt2, float paramFloat1, float[] paramArrayOfFloat1, float paramFloat2, int paramInt3, float[] paramArrayOfFloat2, float paramFloat3)
{
CLDevice.QueueProperties[] arrayOfQueueProperties = { CLDevice.QueueProperties.ProfilingEnable };
CLQueue localCLQueue = context.createDefaultQueue(arrayOfQueueProperties);
String[] arrayOfString = { kernel_1387062610 };
CLKernel[] arrayOfCLKernel = context.createProgram(arrayOfString).createKernels();
CLKernel localCLKernel = arrayOfCLKernel[0];
int i = paramInt2;
float f1 = paramFloat1;
CLBuffer localCLBuffer1 = context.createBuffer(CLMem.Usage.InputOutput, Pointer.pointerToFloats(paramArrayOfFloat1), true);
float f2 = paramFloat2;
int j = paramInt3;
CLBuffer localCLBuffer2 = context.createBuffer(CLMem.Usage.InputOutput, Pointer.pointerToFloats(paramArrayOfFloat2), true);
float f3 = paramFloat3;
localCLKernel.setArgs(new Object[] { paramInt1, i, f1, localCLBuffer1, f2, j, localCLBuffer2, f3 });
int k = paramInt1 - paramInt2 / 1;
CLEvent[] arrayOfCLEvent = { null };
CLEvent localCLEvent = localCLKernel.enqueueNDRange(localCLQueue, new int[] { k }, arrayOfCLEvent);
localCLQueue.finish();
localCLBuffer1.read(localCLQueue, new CLEvent[] { localCLEvent }).getFloats(paramArrayOfFloat1);
localCLBuffer2.read(localCLQueue, new CLEvent[] { localCLEvent }).getFloats(paramArrayOfFloat2);
}
开发者ID:adnanmitf09,项目名称:Rubus,代码行数:23,代码来源:NBody.java
示例7: kernel_381446705
import com.nativelibs4java.opencl.CLEvent; //导入依赖的package包/类
public static void kernel_381446705(int paramInt1, int[] paramArrayOfInt, int paramInt2)
{
CLDevice.QueueProperties[] arrayOfQueueProperties = { CLDevice.QueueProperties.ProfilingEnable };
CLQueue localCLQueue = context.createDefaultQueue(arrayOfQueueProperties);
String[] arrayOfString = { kernel_381446705 };
CLKernel[] arrayOfCLKernel = context.createProgram(arrayOfString).createKernels();
CLKernel localCLKernel = arrayOfCLKernel[0];
CLBuffer localCLBuffer = context.createBuffer(CLMem.Usage.InputOutput, Pointer.pointerToInts(paramArrayOfInt), true);
int i = paramInt2;
localCLKernel.setArgs(new Object[] { paramInt1, localCLBuffer, i });
int j = paramInt1 - paramInt2 / 1;
CLEvent[] arrayOfCLEvent = { null };
CLEvent localCLEvent = localCLKernel.enqueueNDRange(localCLQueue, new int[] { j }, arrayOfCLEvent);
localCLQueue.finish();
localCLBuffer.read(localCLQueue, new CLEvent[] { localCLEvent }).getInts(paramArrayOfInt);
}
开发者ID:adnanmitf09,项目名称:Rubus,代码行数:17,代码来源:LoopWithMultipleConditionsInBody.java
示例8: kernel_1780824482
import com.nativelibs4java.opencl.CLEvent; //导入依赖的package包/类
public static void kernel_1780824482(int paramInt1, int paramInt2, float[] paramArrayOfFloat, int paramInt3)
{
CLDevice.QueueProperties[] arrayOfQueueProperties = { CLDevice.QueueProperties.ProfilingEnable };
CLQueue localCLQueue = context.createDefaultQueue(arrayOfQueueProperties);
String[] arrayOfString = { kernel_1780824482 };
CLKernel[] arrayOfCLKernel = context.createProgram(arrayOfString).createKernels();
CLKernel localCLKernel = arrayOfCLKernel[0];
int i = paramInt2;
CLBuffer localCLBuffer = context.createBuffer(CLMem.Usage.InputOutput, Pointer.pointerToFloats(paramArrayOfFloat), true);
int j = paramInt3;
localCLKernel.setArgs(new Object[] { paramInt1, i, localCLBuffer, j });
int k = paramInt1 - paramInt2 / 1;
CLEvent[] arrayOfCLEvent = { null };
CLEvent localCLEvent = localCLKernel.enqueueNDRange(localCLQueue, new int[] { k }, arrayOfCLEvent);
localCLQueue.finish();
localCLBuffer.read(localCLQueue, new CLEvent[] { localCLEvent }).getFloats(paramArrayOfFloat);
}
开发者ID:adnanmitf09,项目名称:Rubus,代码行数:18,代码来源:BlackScholes.java
示例9: kernel_112397371
import com.nativelibs4java.opencl.CLEvent; //导入依赖的package包/类
public static void kernel_112397371(int paramInt1, int paramInt2, int paramInt3, float paramFloat, int paramInt4, int paramInt5, int paramInt6, short[] paramArrayOfShort)
{
CLDevice.QueueProperties[] arrayOfQueueProperties = { CLDevice.QueueProperties.ProfilingEnable };
CLQueue localCLQueue = context.createDefaultQueue(arrayOfQueueProperties);
String[] arrayOfString = { kernel_112397371 };
CLKernel[] arrayOfCLKernel = context.createProgram(arrayOfString).createKernels();
CLKernel localCLKernel = arrayOfCLKernel[0];
int i = paramInt3;
float f = paramFloat;
int j = paramInt4;
int k = paramInt5;
int m = paramInt6;
CLBuffer localCLBuffer = context.createBuffer(CLMem.Usage.InputOutput, Pointer.pointerToShorts(paramArrayOfShort), true);
localCLKernel.setArgs(new Object[] { paramInt1, paramInt2, i, f, j, k, m, localCLBuffer });
int n = paramInt1 - paramInt4 / 1;
int i1 = paramInt2 - paramInt5 / 1;
CLEvent[] arrayOfCLEvent = { null };
CLEvent localCLEvent = localCLKernel.enqueueNDRange(localCLQueue, new int[] { n, i1 }, arrayOfCLEvent);
localCLQueue.finish();
localCLBuffer.read(localCLQueue, new CLEvent[] { localCLEvent }).getShorts(paramArrayOfShort);
}
开发者ID:adnanmitf09,项目名称:Rubus,代码行数:22,代码来源:Mandelbrot.java
示例10: kernel_1817842420
import com.nativelibs4java.opencl.CLEvent; //导入依赖的package包/类
public static void kernel_1817842420(int paramInt1, int paramInt2, float[] paramArrayOfFloat, int paramInt3, int paramInt4, byte[] paramArrayOfByte1, int paramInt5, int paramInt6, byte[] paramArrayOfByte2, int paramInt7)
{
CLDevice.QueueProperties[] arrayOfQueueProperties = { CLDevice.QueueProperties.ProfilingEnable };
CLQueue localCLQueue = context.createDefaultQueue(arrayOfQueueProperties);
String[] arrayOfString = { kernel_1817842420 };
CLKernel[] arrayOfCLKernel = context.createProgram(arrayOfString).createKernels();
CLKernel localCLKernel = arrayOfCLKernel[0];
int i = paramInt2;
CLBuffer localCLBuffer1 = context.createBuffer(CLMem.Usage.Input, Pointer.pointerToFloats(paramArrayOfFloat), true);
int j = paramInt3;
int k = paramInt4;
CLBuffer localCLBuffer2 = context.createBuffer(CLMem.Usage.Input, Pointer.pointerToBytes(paramArrayOfByte1), true);
int m = paramInt5;
int n = paramInt6;
CLBuffer localCLBuffer3 = context.createBuffer(CLMem.Usage.InputOutput, Pointer.pointerToBytes(paramArrayOfByte2), true);
int i1 = paramInt7;
localCLKernel.setArgs(new Object[] { paramInt1, i, localCLBuffer1, j, k, localCLBuffer2, m, n, localCLBuffer3, i1 });
int i2 = paramInt1 - paramInt6 / 1;
CLEvent[] arrayOfCLEvent = { null };
CLEvent localCLEvent = localCLKernel.enqueueNDRange(localCLQueue, new int[] { i2 }, arrayOfCLEvent);
localCLQueue.finish();
localCLBuffer3.read(localCLQueue, new CLEvent[] { localCLEvent }).getBytes(paramArrayOfByte2);
}
开发者ID:adnanmitf09,项目名称:Rubus,代码行数:24,代码来源:Convolution.java
示例11: kernel_539791456
import com.nativelibs4java.opencl.CLEvent; //导入依赖的package包/类
public static void kernel_539791456(int paramInt1, int paramInt2, int paramInt3, int paramInt4, float[] paramArrayOfFloat1, float paramFloat, float[] paramArrayOfFloat2, int paramInt5)
{
CLDevice.QueueProperties[] arrayOfQueueProperties = { CLDevice.QueueProperties.ProfilingEnable };
CLQueue localCLQueue = context.createDefaultQueue(arrayOfQueueProperties);
String[] arrayOfString = { kernel_539791456 };
CLKernel[] arrayOfCLKernel = context.createProgram(arrayOfString).createKernels();
CLKernel localCLKernel = arrayOfCLKernel[0];
int i = paramInt2;
int j = paramInt3;
int k = paramInt4;
CLBuffer localCLBuffer1 = context.createBuffer(CLMem.Usage.Input, Pointer.pointerToFloats(paramArrayOfFloat1), true);
float f = paramFloat;
CLBuffer localCLBuffer2 = context.createBuffer(CLMem.Usage.Input, Pointer.pointerToFloats(paramArrayOfFloat2), true);
int m = paramInt5;
localCLKernel.setArgs(new Object[] { paramInt1, i, j, k, localCLBuffer1, f, localCLBuffer2, m });
int n = paramInt1 - paramInt2 / 1;
CLEvent[] arrayOfCLEvent = { null };
CLEvent localCLEvent = localCLKernel.enqueueNDRange(localCLQueue, new int[] { n }, arrayOfCLEvent);
localCLQueue.finish();
}
开发者ID:adnanmitf09,项目名称:Rubus,代码行数:21,代码来源:MatrixMultiplicationOneD.java
示例12: kernel_1983995535
import com.nativelibs4java.opencl.CLEvent; //导入依赖的package包/类
public static void kernel_1983995535(int paramInt1, float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4, float paramFloat5, float paramFloat6, float paramFloat7, int paramInt2, float paramFloat8, float[] paramArrayOfFloat)
{
CLDevice.QueueProperties[] arrayOfQueueProperties = { CLDevice.QueueProperties.ProfilingEnable };
CLQueue localCLQueue = context.createDefaultQueue(arrayOfQueueProperties);
String[] arrayOfString = { kernel_1983995535 };
CLKernel[] arrayOfCLKernel = context.createProgram(arrayOfString).createKernels();
CLKernel localCLKernel = arrayOfCLKernel[0];
float f1 = paramFloat1;
float f2 = paramFloat2;
float f3 = paramFloat3;
float f4 = paramFloat4;
float f5 = paramFloat5;
float f6 = paramFloat6;
float f7 = paramFloat7;
int i = paramInt2;
float f8 = paramFloat8;
CLBuffer localCLBuffer = context.createBuffer(CLMem.Usage.Input, Pointer.pointerToFloats(paramArrayOfFloat), true);
localCLKernel.setArgs(new Object[] { paramInt1, f1, f2, f3, f4, f5, f6, f7, i, f8, localCLBuffer });
int j = paramInt1 - paramInt2 / 3;
CLEvent[] arrayOfCLEvent = { null };
CLEvent localCLEvent = localCLKernel.enqueueNDRange(localCLQueue, new int[] { j }, arrayOfCLEvent);
localCLQueue.finish();
}
开发者ID:adnanmitf09,项目名称:Rubus,代码行数:24,代码来源:NBody.java
示例13: kernel_741680667
import com.nativelibs4java.opencl.CLEvent; //导入依赖的package包/类
public static void kernel_741680667(int paramInt1, int paramInt2, float[] paramArrayOfFloat)
{
CLDevice.QueueProperties[] arrayOfQueueProperties = { CLDevice.QueueProperties.ProfilingEnable };
CLQueue localCLQueue = context.createDefaultQueue(arrayOfQueueProperties);
String[] arrayOfString = { kernel_741680667 };
CLKernel[] arrayOfCLKernel = context.createProgram(arrayOfString).createKernels();
CLKernel localCLKernel = arrayOfCLKernel[0];
int i = paramInt2;
CLBuffer localCLBuffer = context.createBuffer(CLMem.Usage.InputOutput, Pointer.pointerToFloats(paramArrayOfFloat), true);
localCLKernel.setArgs(new Object[] { paramInt1, i, localCLBuffer });
int j = paramInt1 - paramInt2 / 1;
CLEvent[] arrayOfCLEvent = { null };
CLEvent localCLEvent = localCLKernel.enqueueNDRange(localCLQueue, new int[] { j }, arrayOfCLEvent);
localCLQueue.finish();
localCLBuffer.read(localCLQueue, new CLEvent[] { localCLEvent }).getFloats(paramArrayOfFloat);
}
开发者ID:adnanmitf09,项目名称:Rubus,代码行数:17,代码来源:FillArray.java
示例14: kernel_M382277171
import com.nativelibs4java.opencl.CLEvent; //导入依赖的package包/类
public static void kernel_M382277171(int paramInt1, int paramInt2, int[][] paramArrayOfInt1, int paramInt3, int paramInt4, int[][] paramArrayOfInt2, int[][] paramArrayOfInt3)
{
CLDevice.QueueProperties[] arrayOfQueueProperties = { CLDevice.QueueProperties.ProfilingEnable };
CLQueue localCLQueue = context.createDefaultQueue(arrayOfQueueProperties);
String[] arrayOfString = { kernel_M382277171 };
CLKernel[] arrayOfCLKernel = context.createProgram(arrayOfString).createKernels();
CLKernel localCLKernel = arrayOfCLKernel[0];
CLBuffer localCLBuffer1 = context.createBuffer(CLMem.Usage.InputOutput, Pointer.pointerToInts(paramArrayOfInt1), true);
int i = paramInt3;
int j = paramInt4;
CLBuffer localCLBuffer2 = context.createBuffer(CLMem.Usage.Input, Pointer.pointerToInts(paramArrayOfInt2), true);
CLBuffer localCLBuffer3 = context.createBuffer(CLMem.Usage.Input, Pointer.pointerToInts(paramArrayOfInt3), true);
localCLKernel.setArgs(new Object[] { paramInt1, paramInt2, localCLBuffer1, i, j, localCLBuffer2, localCLBuffer3 });
int k = paramInt1 - paramInt3 / 1;
int m = paramInt2 - paramInt4 / 1;
CLEvent[] arrayOfCLEvent = { null };
CLEvent localCLEvent = localCLKernel.enqueueNDRange(localCLQueue, new int[] { k, m }, arrayOfCLEvent);
localCLQueue.finish();
Pointer localPointer1 = localCLBuffer1.read(localCLQueue, new CLEvent[] { localCLEvent });
long l = localPointer1.getValidElements();
for (int n = 0; n < l; n++)
{
Pointer localPointer2 = (Pointer)localPointer1.get(n);
localPointer2.getInts(paramArrayOfInt1[n]);
}
}
开发者ID:adnanmitf09,项目名称:Rubus,代码行数:27,代码来源:ArrayMultiplication2D.java
示例15: kernel_2128203651
import com.nativelibs4java.opencl.CLEvent; //导入依赖的package包/类
public static void kernel_2128203651(int paramInt1, int[] paramArrayOfInt, int paramInt2)
{
CLDevice.QueueProperties[] arrayOfQueueProperties = { CLDevice.QueueProperties.ProfilingEnable };
CLQueue localCLQueue = context.createDefaultQueue(arrayOfQueueProperties);
String[] arrayOfString = { kernel_2128203651 };
CLKernel[] arrayOfCLKernel = context.createProgram(arrayOfString).createKernels();
CLKernel localCLKernel = arrayOfCLKernel[0];
CLBuffer localCLBuffer = context.createBuffer(CLMem.Usage.InputOutput, Pointer.pointerToInts(paramArrayOfInt), true);
int i = paramInt2;
localCLKernel.setArgs(new Object[] { paramInt1, localCLBuffer, i });
int j = paramInt1 - paramInt2 / 1;
CLEvent[] arrayOfCLEvent = { null };
CLEvent localCLEvent = localCLKernel.enqueueNDRange(localCLQueue, new int[] { j }, arrayOfCLEvent);
localCLQueue.finish();
localCLBuffer.read(localCLQueue, new CLEvent[] { localCLEvent }).getInts(paramArrayOfInt);
}
开发者ID:adnanmitf09,项目名称:Rubus,代码行数:17,代码来源:ArrayIncrement.java
示例16: kernel_1507237915
import com.nativelibs4java.opencl.CLEvent; //导入依赖的package包/类
public static void kernel_1507237915(int paramInt1, int[] paramArrayOfInt, int paramInt2)
{
CLDevice.QueueProperties[] arrayOfQueueProperties = { CLDevice.QueueProperties.ProfilingEnable };
CLQueue localCLQueue = context.createDefaultQueue(arrayOfQueueProperties);
String[] arrayOfString = { kernel_1507237915 };
CLKernel[] arrayOfCLKernel = context.createProgram(arrayOfString).createKernels();
CLKernel localCLKernel = arrayOfCLKernel[0];
CLBuffer localCLBuffer = context.createBuffer(CLMem.Usage.InputOutput, Pointer.pointerToInts(paramArrayOfInt), true);
int i = paramInt2;
localCLKernel.setArgs(new Object[] { paramInt1, localCLBuffer, i });
int j = paramInt1 - paramInt2 / 1;
CLEvent[] arrayOfCLEvent = { null };
CLEvent localCLEvent = localCLKernel.enqueueNDRange(localCLQueue, new int[] { j }, arrayOfCLEvent);
localCLQueue.finish();
localCLBuffer.read(localCLQueue, new CLEvent[] { localCLEvent }).getInts(paramArrayOfInt);
}
开发者ID:adnanmitf09,项目名称:Rubus,代码行数:17,代码来源:ArrayIncrement.java
示例17: regenerate
import com.nativelibs4java.opencl.CLEvent; //导入依赖的package包/类
public void regenerate(boolean antialiasing, BufferedImage imgout, CLEditor editor) {
if (isKernelOk() && !clQueue.isOutOfOrder()) {
try {
clQueue.finish();
long t0 = System.nanoTime();
editor.updateKernelArgsRenderingMode(antialiasing);
final int w = (int) imageOut.getWidth(),
h = (int) imageOut.getHeight();
CLEvent evt = clKernel.enqueueNDRange(clQueue, new int[]{w, h}/*, new int[]{32,32}*/);
if (evt != null) {
clQueue.enqueueWaitForEvents(evt);
imageOut.read(clQueue, imgout, false, evt);
long dt = System.nanoTime() - t0;
System.out.println("Image (" + w + "x" + h + ") generated in " + (dt / 1000000) + "ms");
}
} catch (Exception e) {
int test;
}
}
}
开发者ID:iapafoto,项目名称:DicomViewer,代码行数:26,代码来源:OpenCLWithJavaCL.java
示例18: run
import com.nativelibs4java.opencl.CLEvent; //导入依赖的package包/类
@Override
public void run() {
long base = 0;
kernel.setArgs(addressBuffer, blockBuffer, prefixBuffer, base, work, outputBuffer);
while (run) {
CLEvent mine = kernel.enqueueNDRange(queue, workSize);
Pointer<Byte> outputPtr = outputBuffer.read(queue, mine);
mine.release();
hashes += workSize[0];
base += workSize[0];
if (outputPtr.getByteAtIndex(0) != 0 && run) {
char[] sol = MinerUtils.getChars(outputPtr.getBytes());
long score = MinerUtils.hashToLong(MinerUtils.digest(MinerUtils.getBytes(new String(sol))));
if (score <= work) {
Solution s = new Solution(new String(Arrays.copyOfRange(sol, 0, 10)),
new String(Arrays.copyOfRange(sol, 10, 22)), new String(Arrays.copyOfRange(sol, 22, 34)));
solved(s);
break;
}
}
kernel.setArg(3, base);
}
}
开发者ID:apemanzilla,项目名称:turbokrist,代码行数:24,代码来源:GPUMiner.java
示例19: testMining_hashToLong
import com.nativelibs4java.opencl.CLEvent; //导入依赖的package包/类
@Test
public void testMining_hashToLong() {
String[] inputs = { "", "hello", "hi", "ADLGeag3" };
CLKernel kernel = program.createKernel("testHashToLong");
for (String input : inputs) {
byte[] hashed = MinerUtils.digest(MinerUtils.getBytes(input));
Pointer<Byte> inputPtr = Pointer.allocateBytes(hashed.length).order(context.getByteOrder());
for (int i = 0; i < hashed.length; i++) {
inputPtr.set(i, hashed[i]);
}
CLBuffer<Byte> inputBuf = context.createByteBuffer(Usage.Input, inputPtr);
CLBuffer<Long> outputBuf = context.createLongBuffer(Usage.Output, 1);
kernel.setArgs(inputBuf, outputBuf);
CLEvent evt = kernel.enqueueNDRange(queue, new int[] { 1 });
Pointer<Long> outputPtr = outputBuf.read(queue, evt);
long expect = MinerUtils.hashToLong(hashed);
long got = outputPtr.get(0);
assertEquals(expect, got);
}
}
开发者ID:apemanzilla,项目名称:turbokrist,代码行数:21,代码来源:TestCLMining.java
示例20: setUp
import com.nativelibs4java.opencl.CLEvent; //导入依赖的package包/类
@Before
public void setUp() throws ProgramBuildException {
// Set up context and queue
context = JavaCL.createBestContext();
queue = context.createDefaultQueue();
// Build program
ProgramBuilder pb = new ProgramBuilder("sha256.cl", "krist_miner.cl", "test_kernels.cl");
pb.addBuildOption("-Werror");
pb.defineMacro("UNIT_TESTING", 1);
program = pb.build(context);
// Test that CL code can be compiled and the testCompile kernel can be
// run without errors
CLKernel kernel = program.createKernel("testCompile");
CLEvent compilationTest = kernel.enqueueNDRange(queue, new int[] { 1 });
compilationTest.waitFor();
}
开发者ID:apemanzilla,项目名称:turbokrist,代码行数:17,代码来源:OpenCLTest.java
注:本文中的com.nativelibs4java.opencl.CLEvent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论