/** * @deprecated Use {@link CLDevice#getByteOrder()} */ @Deprecated public synchronized ByteOrder getKernelsDefaultByteOrder() { if (kernelsDefaultByteOrder == null) { kernelsDefaultByteOrder = ByteOrderHack.guessByteOrderNeededForBuffers(this); } return kernelsDefaultByteOrder; }
public static ByteOrder guessByteOrderNeededForBuffers(CLDevice device) { CLPlatform platform = device.getPlatform(); PlatformUtils.PlatformKind knownPlatform = PlatformUtils.guessPlatformKind(platform); if (!hackEnabled || knownPlatform != PlatformUtils.PlatformKind.AMDApp) return device.getByteOrder(); else return checkByteOrderNeededForBuffers(device); } public static ByteOrder checkByteOrderNeededForBuffers(CLDevice device) {
public static ByteOrder guessByteOrderNeededForBuffers(CLDevice device) { CLPlatform platform = device.getPlatform(); PlatformUtils.PlatformKind knownPlatform = PlatformUtils.guessPlatformKind(platform); if (!hackEnabled || knownPlatform != PlatformUtils.PlatformKind.AMDApp) return device.getByteOrder(); else return checkByteOrderNeededForBuffers(device); } public static ByteOrder checkByteOrderNeededForBuffers(CLDevice device) {
@Test public void test() { if (!ByteOrderHack.hackEnabled) return; for (CLPlatform platform : JavaCL.listPlatforms()) { for (CLDevice device : platform.listAllDevices(true)) { assertEquals(device.getByteOrder(), ByteOrderHack.checkByteOrderNeededForBuffers(device)); } } } }
/** * @deprecated Use {@link CLDevice#getByteOrder()} */ @Deprecated public synchronized ByteOrder getKernelsDefaultByteOrder() { if (kernelsDefaultByteOrder == null) { kernelsDefaultByteOrder = ByteOrderHack.guessByteOrderNeededForBuffers(this); } return kernelsDefaultByteOrder; }