This file contains 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
#!/usr/bin/env elixir | |
defmodule Canvas do | |
@behaviour :wx_object | |
@title "Canvas Example" | |
@size {600, 600} | |
def start_link() do | |
:wx_object.start_link(__MODULE__, [], []) |
This file contains 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
__kernel void convolute_mem(__read_only image2d_t src, __write_only image2d_t result, __constant float4 * filter) { | |
int2 global_coord = (int2) (get_global_id(0),get_global_id(1)); | |
int2 local_coord = (int2) (get_local_id(0),get_local_id(1)); | |
int2 local_size = (int2) (get_local_size(0),get_local_size(1)); | |
int2 local_array = (int2) (local_coord.x + KERNEL_SIZE_HALF, local_coord.y + KERNEL_SIZE_HALF); | |
// Need to think of the size of the array | |
__local float4 pixels[BLOCK_SIZE][BLOCK_SIZE]; | |
pixels[local_array.y][local_array.x] = read_imagef(src,sampler_const,global_coord); |