Created
June 28, 2012 12:35
-
-
Save gidili/3011101 to your computer and use it in GitHub Desktop.
JavaCL with byte ordering
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CLContext context = JavaCL.createBestContext(DeviceFeature.GPU); | |
CLQueue queue = context.createDefaultQueue(); | |
ByteOrder byteOrder = context.getByteOrder(); | |
// Read the program sources and compile them : | |
String src = IOUtils.readText(SampleSolverService.class.getResource(KERNEL_PATH)); | |
CLProgram program = context.createProgram(src); | |
// I/O BUFFERS DECLARATION | |
Pointer<Float> I_in_Ptr = allocateFloats(ELEM_COUNT).order(byteOrder); | |
Pointer<Float> V_in_Ptr = allocateFloats(ELEM_COUNT).order(byteOrder); | |
Pointer<Float> x_n_in_Ptr = allocateFloats(ELEM_COUNT).order(byteOrder); | |
Pointer<Float> x_m_in_Ptr = allocateFloats(ELEM_COUNT).order(byteOrder); | |
Pointer<Float> x_h_in_Ptr = allocateFloats(ELEM_COUNT).order(byteOrder); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment