---
name: "vec_step"
section: "3clc"
platform: "linux"
package: "opencl-1.2-man-doc"
version: "1.0~svn33624-5.1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/vec_step"
---

# vec\_step(3clc)

Takes a built-in scalar or vector data type argument and returns an integer value representing the number of elements in the scalar or vector.

## NAME

vec\_step - Takes a built-in scalar or vector data type argument and returns an integer value representing the number of elements in the scalar or vector.

##

**int vec\_step(gentype*n*** *a***);**

**int vec\_step(char3** *a***);**

**int vec\_step(uchar3** *a***);**

**int vec\_step(short3** *a***);**

**int vec\_step(ushort3** *a***);**

**int vec\_step(half3** *a***);**

**int vec\_step(int3** *a***);**

**int vec\_step(uint3** *a***);**

**int vec\_step(long3** *a***);**

**int vec\_step(ulong3** *a***);**

**int vec\_step(float3** *a***);**

**int vec\_step(double3** *a***);**

**int vec\_step(***type***);**

## DESCRIPTION

The **vec\_step** built-in function takes a built-in scalar or vector data type argument and returns an integer value representing the number of elements in the scalar or vector.

For all scalar types, **vec\_step** returns 1.

The **vec\_step** built-in functions that take a 3-component vector return 4.

**vec\_step** may also take a pure type as an argument, e.g. **vec\_step**(**float2**)

We use the generic type name **gentype***n* (or **gentype***m*) to indicate the built-in data types **char{2\|4\|8\|16}**, **uchar{2\|4\|8\|16}**, **short{2\|4\|8\|16}**, **ushort{2\|4\|8\|16}**, **int{2\|4\|8\|16}**, **uint{2\|4\|8\|16}**, **long{2\|4\|8\|16}**, **ulong{2\|4\|8\|16}**, or **float{2\|4\|8\|16}** as the type for the arguments unless otherwise stated. We use the generic name **ugentype***n* to indicate the built-in unsigned integer data types. If the **double** is supported, then **gentype***n* (or **gentype***m*) also indicate the built-in data types **double{2\|4\|8\|16}**.

The generic type name **gentype***n* (or **gentype***m*) may indicate the data type **half{2\|4\|8\|16}** if the [**cl\_khr\_fp16**(3clc)](/cl_khr_fp16/3clc.md) extension is supported.

## SPECIFICATION

**OpenCL Specification**\[1\]

## SEE ALSO

[**miscVectorFunctions**(3clc)](/miscVectorFunctions/3clc.md)

## AUTHORS

**The Khronos Group**

## COPYRIGHT

Copyright © 2007-2011 The Khronos Group Inc.\
 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and/or associated documentation files (the "Materials"), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Materials, and to permit persons to whom the Materials are furnished to do so, subject to the condition that this copyright notice and permission notice shall be included in all copies or substantial portions of the Materials.

## NOTES

- 1\.

  OpenCL Specification

  page 282, section 6.12.12 Miscellaneous Vector Functions
