zero out the buffer

This commit is contained in:
Comma Device
2022-07-19 19:17:47 -07:00
parent b8a67905e5
commit 314d70ff17

View File

@@ -232,6 +232,11 @@ def compile(input, output_fn):
row_pitch = (a.shape[0]*4*2 + 63)//64 * 64
size = row_pitch * a.shape[1]
buf = CLBuffer(size)
# zero out the buffer
zeros = np.zeros(size, dtype=np.uint8)
CL.enqueue_copy(buf.cl, zeros, is_blocking=True)
CLProgram("from_image_strided", """
__kernel void from_image_strided(read_only image2d_t in, __global float4 *out, int row_pitch) {
const sampler_t smp = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP | CLK_FILTER_NEAREST;