Compute Library  18.03
floor.cl File Reference
#include "helpers.h"

Go to the source code of this file.

Functions

__kernel void floor_layer (__global uchar *input_ptr, uint input_stride_x, uint input_step_x, uint input_stride_y, uint input_step_y, uint input_stride_z, uint input_step_z, uint input_offset_first_element_in_bytes, __global uchar *output_ptr, uint output_stride_x, uint output_step_x, uint output_stride_y, uint output_step_y, uint output_stride_z, uint output_step_z, uint output_offset_first_element_in_bytes)
 Perform a floor operation on an input tensor. More...
 

Function Documentation

__kernel void floor_layer ( __global uchar *  input_ptr,
uint  input_stride_x,
uint  input_step_x,
uint  input_stride_y,
uint  input_step_y,
uint  input_stride_z,
uint  input_step_z,
uint  input_offset_first_element_in_bytes,
__global uchar *  output_ptr,
uint  output_stride_x,
uint  output_step_x,
uint  output_stride_y,
uint  output_step_y,
uint  output_stride_z,
uint  output_step_z,
uint  output_offset_first_element_in_bytes 
)

Perform a floor operation on an input tensor.

Attention
Data type can be passed using the -DDATA_TYPE compile flag, e.g. -DDATA_TYPE=float
Vector size should be given as a preprocessor argument using -DVEC_SIZE=size. e.g. -DVEC_SIZE=16
Note
Can only take floating point data types.
Parameters
[in]input_ptrPointer to the source image. Supported data types: F16/F32
[in]input_stride_xStride of the source image in X dimension (in bytes)
[in]input_step_xinput_stride_x * number of elements along X processed per workitem(in bytes)
[in]input_stride_yStride of the source image in Y dimension (in bytes)
[in]input_step_yinput_stride_y * number of elements along Y processed per workitem(in bytes)
[in]input_stride_zStride of the source tensor in Z dimension (in bytes)
[in]input_step_zinput_stride_z * number of elements along Z processed per workitem(in bytes)
[in]input_offset_first_element_in_bytesThe offset of the first element in the source image
[out]output_ptrPointer to the destination image. Supported data types: same as input_ptr
[in]output_stride_xStride of the destination image in X dimension (in bytes)
[in]output_step_xoutput_stride_x * number of elements along X processed per workitem(in bytes)
[in]output_stride_yStride of the destination image in Y dimension (in bytes)
[in]output_step_youtput_stride_y * number of elements along Y processed per workitem(in bytes)
[in]output_stride_zStride of the source tensor in Z dimension (in bytes)
[in]output_step_zoutput_stride_z * number of elements along Z processed per workitem(in bytes)
[in]output_offset_first_element_in_bytesThe offset of the first element in the destination image

Definition at line 49 of file floor.cl.

References CONVERT_TO_TENSOR3D_STRUCT, DATA_TYPE, Tensor3D::ptr, VLOAD, and VSTORE.

52 {
53  Tensor3D input = CONVERT_TO_TENSOR3D_STRUCT(input);
54  Tensor3D output = CONVERT_TO_TENSOR3D_STRUCT(output);
55 
56  VSTORE(VEC_SIZE)
57  (floor(VLOAD(VEC_SIZE)(0, (__global DATA_TYPE *)input.ptr)), 0, (__global DATA_TYPE *)output.ptr);
58 }
#define VLOAD(size)
Definition: helpers.h:40
#define CONVERT_TO_TENSOR3D_STRUCT(name)
Definition: helpers.h:117
#define DATA_TYPE
Structure to hold 3D tensor information.
Definition: helpers.h:149
#define VSTORE(size)
Definition: helpers.h:43
__global uchar * ptr
Pointer to the starting postion of the buffer.
Definition: helpers.h:151