GuidedFilter  1.2.0
 Hosted by GitHub
Functions
transpose_kernels.cl File Reference

Kernels for performing the Transpose operation. More...

Functions

kernel void transpose (global float4 *in, global float4 *out, local float4 *data)
 Performs a matrix transposition. More...
 

Detailed Description

Kernels for performing the Transpose operation.

Author
Nick Lamprianidis
Version
1.0
Date
2015
Copyright (c) 2015 Nick Lamprianidis
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Function Documentation

kernel void transpose ( global float4 *  in,
global float4 *  out,
local float4 *  data 
)

Performs a matrix transposition.

Note
Both dimensions of the matrix have to be multiples of 4. Other than that, the matrix can have any dimensions ratio. It doesn't have to be square.
The x dimension of the global workspace, \( gXdim \), should be equal to the number of columns, N, in the matrix divided by 4. That is, \( \ gXdim = N/4 \). The y dimension of the global workspace, \( gYdim \), should be equal to the number of rows, M, in the matrix divided by 4. That is, \( \ gYdim = M/4 \). The local workspace should be square. That is, \( \ lXdim = lYdim \).
Each work-item transposes a square 4x4 block.
Parameters
[in]ininput matrix of float elements.
[out]outoutput (transposed) matrix of float elements.
[in]datalocal buffer. Its size should be 16 float elements for each work-item in a work-group. That is, \( 4*4*lXdim*lYdim*sizeof\ (float) \).