Last active
May 5, 2018 10:10
-
-
Save mratsim/7f7ecf3cfc2be0f59f9075baf5d051a4 to your computer and use it in GitHub Desktop.
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
| # Works on checkout 8ce9e434348f6f63b81f7a788bd4093996dbaca7, from 11 days ago but not on latest | |
| import opencl | |
| {.experimental.} | |
| type clResource = PCommandQueue | PKernel | PProgram | PMem | PContext | |
| template release*(queue: PCommandQueue) = check releaseCommandQueue(queue) | |
| template release*(kernel: PKernel) = check releaseKernel(kernel) | |
| template release*(program: PProgram) = check releaseProgram(program) | |
| template release*(buffer: PMem) = check releaseMemObject(buffer) | |
| template release*(context: PContext) = check releaseContext(context) | |
| proc `=destroy`*(clres: clResource) = | |
| release clres |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment