The OpenCL C programming language implements the following built-in query functions for a pipe. We use the generic type name gentype to indicate the built-in OpenCL C scalar or vector integer or floating-point data types [1] or any user defined type built from these scalar and vector data types can be used as the type for the arguments to the pipe functions listed in the following table.

aQual in the following table refers to one of the access qualifiers. For pipe query functions this may be read_only or write_only.

Table 1. Built-in Pipe Query Functions



uint get_pipe_num_packets(aQual pipe gentype p)

Returns the number of available entries in the pipe. The number of available entries in a pipe is a dynamic value. The value returned should be considered immediately stale.

uint get_pipe_max_packets(aQual pipe gentype p)

Returns the maximum number of packets specified when pipe was created.

See Also

Document Notes

For more information, see the OpenCL C Specification

This page is extracted from the OpenCL C Specification. Fixes and changes should be made to the Specification, not directly.

Copyright 2014-2023 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0

1. The half scalar and vector types can only be used if the cl_khr_fp16 extension is supported and has been enabled. The double scalar and vector types can only be used if double precision is supported, e.g. for OpenCL C 3.0 the __opencl_c_fp64 feature macro is present.