daily pastebin goal
38%
SHARE
TWEET

Untitled

a guest Jan 18th, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Needs["OpenCLLink`"]
  2. srcf = FileNameJoin[{$OpenCLLinkPath, "SupportFiles", "matrixMul.cl"}]
  3. blockSize = 4;
  4. MatrixMultiply = OpenCLFunctionLoad[File[srcf],
  5. "matrixMul", {{"Float", 2, "Output"}, {"Float", 2,
  6. "Input"}, {"Float", 2, "Input"}, {"Local", "Float"}, {"Local",
  7. "Float"}, _Integer, _Integer}, {blockSize, blockSize},
  8. "Defines" -> {"BLOCK_SIZE" -> blockSize}]
  9. A = RandomChoice[{0, 1}, {8, 8}];
  10. B = RandomChoice[{0, 1}, {8, 8}];
  11. out = OpenCLMemoryAllocate["Float", {8, 8}]
  12. MatrixMultiply[out, A, B, blockSize*blockSize, blockSize*blockSize,8,8]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top