Skip to content

Instantly share code, notes, and snippets.

@maweigert
Last active September 23, 2018 23:19
Show Gist options
  • Save maweigert/6c0be17e82b2eb0b2faf047282ffb975 to your computer and use it in GitHub Desktop.
Save maweigert/6c0be17e82b2eb0b2faf047282ffb975 to your computer and use it in GitHub Desktop.
kernel test
src ="""
#pragma OPENCL EXTENSION cl_khr_3d_image_writes : enable
__kernel void img3d_to_img(__read_only image3d_t src,
__write_only image3d_t dest){
uint i = get_global_id(0);
uint j = get_global_id(1);
uint k = get_global_id(2);
write_imagef(dest,(int4)(i,j,k,0),0.f);
}
"""
import pyopencl as cl
ctx = cl.create_some_context()
prog = cl.Program(ctx,src).build()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment