29package com.jogamp.opencl.test.util;
31import java.nio.ByteBuffer;
32import java.util.HashSet;
33import java.util.Random;
36import com.jogamp.common.os.Platform;
38import static java.lang.System.*;
39import static org.junit.Assert.*;
47 public final static int ONE_MB = 1048576;
51 public static final void fillBuffer(
final ByteBuffer buffer,
final int seed) {
53 final Random rnd =
new Random(seed);
55 while(buffer.remaining() != 0)
56 buffer.putInt(rnd.nextInt());
61 public static final int roundUp(
final int groupSize,
final int globalSize) {
62 final int r = globalSize % groupSize;
66 return globalSize + groupSize - r;
70 public static final void checkIfEqual(
final ByteBuffer a,
final ByteBuffer b,
final int elements) {
71 for(
int i = 0; i < elements; i++) {
72 final int aVal = a.getInt();
73 final int bVal = b.getInt();
75 out.println(
"a: "+aVal);
76 out.println(
"b: "+bVal);
77 out.println(
"position: "+a.position());
85 private static final Set<Platform.OSType> knownOSWithoutCLImpl;
87 knownOSWithoutCLImpl =
new HashSet<Platform.OSType>();
88 knownOSWithoutCLImpl.add(Platform.OSType.SUNOS);
101 return knownOSWithoutCLImpl.contains(Platform.getOSType());
static final void checkIfEqual(final ByteBuffer a, final ByteBuffer b, final int elements)
static final int NUM_ELEMENTS
static final void fillBuffer(final ByteBuffer buffer, final int seed)
static final int roundUp(final int groupSize, final int globalSize)
static final boolean isKnownOSWithoutCLImpl()