OpenCL Data Types (数据类型)

1. Built-in Scalar Data Types - 内置标量数据类型

The following table describes the list of built-in scalar data types.

Type and Description
bool [1]
A conditional data type which is either true or false. The value true expands to the integer constant 1 and the value false expands to the integer constant 0.
一种条件数据类型,值为 true or false。其中 true 展开后为整形常量 1,而 false 展开后为整形常量 0。

[1] When any scalar value is converted to bool, the result is 0 if the value compares equal to 0; otherwise, the result is 1.
任意标量值转换为 bool 时,如果原始值等于 0,则结果为 0;否则,结果为 1。

char
A signed two’s complement 8-bit integer.
有符号 8 位整数,为二的补码。

unsigned char, uchar
An unsigned 8-bit integer.
无符号 8 位整数。

short
A signed two’s complement 16-bit integer.
有符号 16 位整数,为二的补码。

unsigned short, ushort
An unsigned 16-bit integer.
无符号 16 位整数。

int
A signed two’s complement 32-bit integer.
有符号 32 位整数,为二的补码。

unsigned int, uint
An unsigned 32-bit integer.
无符号 32 位整数。

long [2]
A signed two’s complement 64-bit integer.
有符号 64 位整数,为二的补码。

unsigned long, ulong [2]
An unsigned 64-bit integer.
无符号 64 位整数。

[2] The long, unsigned long and ulong scalar types are optional types for EMBEDDED profile devices that are supported if the value of the CL_DEVICE_EXTENSIONS device query contains cles_khr_int64. An OpenCL C 3.0 compiler must also define the __opencl_c_int64 feature macro unconditionally for FULL profile devices, or for EMBEDDED profile devices that support these types.
long, unsigned long and ulong 标量类型是 Embedded Profile (嵌入式简档) 设备的可选类型。如果 CL_DEVICE_EXTENSIONS 设备查询的值包含 cles_khr_int64,则支持这些类型。OpenCL C 3.0 编译器还必须无条件地为 FULL profile (完全简档) 设备或支持这些类型的 Embedded Profile (嵌入式简档) 设备定义 __opencl_c_int64 功能宏。

float
A 32-bit floating-point. The float data type must conform to the IEEE 754 single precision storage format.
32 位浮点数,必须符合 IEEE 754 中的单精度存储格式。

double [3]
A 64-bit floating-point. The double data type must conform to the IEEE 754 double precision storage format.
64 位浮点数,必须符合 IEEE 754 中的双精度存储格式。

Requires support for OpenCL C 1.2 or newer. In OpenCL C 3.0 it requires support of the __opencl_c_fp64 feature. Also see extension cl_khr_fp64.

[3] The double scalar type is an optional type that is supported if the value of the CL_DEVICE_DOUBLE_FP_CONFIG device query is not zero. If this is the case then an OpenCL C 3.0 compiler must also define the __opencl_c_fp64 feature macro.
double 是可选类型,只有设备的 CL_DEVICE_DOUBLE_FP_CONFIG 不是零时才需要支持。如果是这种情况,那么 OpenCL C 3.0 编译器还必须定义 __opencl_c_fp64 特性宏。

half
A 16-bit floating-point. The half data type must conform to the IEEE 754-2008 half precision storage format.
16 位浮点数,必须符合 IEEE 754-2008 中的半精度存储格式。

size_t [4]
The unsigned integer type of the result of the sizeof operator.
无符号整数类型,这是 sizeof 操作符结果的类型。

[4] This is a 32-bit type if the value of the CL_DEVICE_ADDRESS_BITS device query is 32-bits, and a 64-bit type if the value of the query is 64-bits.
如果 CL_DEVICE_ADDRESS_BITS 是 32 位,则此类型为 32 位无符号整数类型。如果 CL_DEVICE_ADDRESS_BITS 是 64 位,则此类型为 64 位类型无符号整数类型。

ptrdiff_t [4]
A signed integer type that is the result of subtracting two pointers.
有符号整形,两个指针相减的结果。

[4] This is a 32-bit type if the value of the CL_DEVICE_ADDRESS_BITS device query is 32-bits, and a 64-bit type if the value of the query is 64-bits.
如果 CL_DEVICE_ADDRESS_BITS 是 32 位,则此类型为 32 位有符号整形。如果 CL_DEVICE_ADDRESS_BITS 是 64 位,则此类型为 64 位有符号整形。

intptr_t [4]
A signed integer type with the property that any valid pointer to void can be converted to this type, then converted back to pointer to void, and the result will compare equal to the original pointer.
有符号整形,任意指向 void 的有效指针都能转换为此类型,然后还可以转换回指向 void 的指针,其结果与原始指针相同。

[4] This is a 32-bit type if the value of the CL_DEVICE_ADDRESS_BITS device query is 32-bits, and a 64-bit type if the value of the query is 64-bits.
如果 CL_DEVICE_ADDRESS_BITS 是 32 位,则此类型为 32 位有符号整形。如果 CL_DEVICE_ADDRESS_BITS 是 64 位,则此类型为 64 位有符号整形。

uintptr_t [4]
An unsigned integer type with the property that any valid pointer to void can be converted to this type, then converted back to pointer to void, and the result will compare equal to the original pointer.
无符号整形,任意指向 void 的有效指针都能转换为此类型,然后还可以转换回指向 void 的指针,其结果与原始指针相同。

[4] This is a 32-bit type if the value of the CL_DEVICE_ADDRESS_BITS device query is 32-bits, and a 64-bit type if the value of the query is 64-bits.
如果 CL_DEVICE_ADDRESS_BITS 是 32 位,则此类型为 32 位无符号整形。如果 CL_DEVICE_ADDRESS_BITS 是 64 位,则此类型为 64 位无符号整形。

void
The void type comprises an empty set of values; it is an incomplete type that cannot be completed.
此类型不包含任何值,它是一种不完全类型,不能被补全。

If the double-precision floating-point extension {cl_khr_fp64} or the __opencl_c_fp64 feature is not supported, implementations may implicitly cast double-precision floating-point literals to single-precision literals. The use of double-precision literals without double-precision support should result in a diagnostic.
如果不支持 double-precision floating-point 扩展 {cl_khr_fp64}__opencl_c_fp64 特性,则实现可能会将 double-precision floating-point 常量隐式转换为 single-precision floating-point 常量。使用不支持 double-precision 的 double-precision 常量应该会导致诊断 (diagnostic)。

字面值 (literal) 是字面值常量 (literal constant) 的缩写。这是一种实体,指定了自身的值,并且不允许发生改变。ANSIC 允许命名常量 (named constant),声明为 const 的变量的创建,它与普通变量类似。区别在于当它被初始化以后,它的值便不能改变。

literal ['lɪt(ə)rəl]:adj. 字面意义的;完全按原文的;缺乏想象力的 n. 错排,字面值常量
diagnostic [ˌdaɪəɡˈnɒstɪk]:n. 诊断,诊断程序 adj. 诊断的,判断的

Most built-in scalar data types are also declared as appropriate types in the OpenCL API (and header files) that can be used by an application. The following table describes the built-in scalar data type in the OpenCL C programming language and the corresponding data type available to the application:
大多数内置标量数据类型也在 OpenCL API (and header files) 中声明为可供应用程序使用的适当类型。下表描述了 the built-in scalar data type in the OpenCL C programming language (内置标量数据类型) 与应用程序可用的相应数据类型:

Type in OpenCL Language API type for application
bool n/a
char cl_char
unsigned char, uchar cl_uchar
short cl_short
unsigned short, ushort cl_ushort
int cl_int
unsigned int, uint cl_uint
long cl_long
unsigned long, ulong cl_ulong
float cl_float
double cl_double [5]
half cl_half
size_t n/a
ptrdiff_t n/a
intptr_t n/a
uintptr_t n/a
void void

[5] Requires support for OpenCL C 1.2 or above. Also see extension cl_khr_fp64.

1.1 The half Data Type

The half data type must be IEEE 754-2008 compliant. half numbers have 1 sign bit, 5 exponent bits, and 10 mantissa bits. The interpretation of the sign, exponent and mantissa is analogous to IEEE 754 floating-point numbers. The exponent bias is 15. The half data type must represent finite and normal numbers, denormalized numbers, infinities and NaN. Denormalized numbers for the half data type which may be generated when converting a float to a half using vstore_half and converting a half to a float using vload_half cannot be flushed to zero.
half 数据类型必须符合 IEEE 754-2008。half 数据有 1 个符号位、5 个指数位和 10 个尾数位。符号、指数和尾数的含义与 IEEE 754 浮点数的相应解释类似。指数偏置值为 15。half 数据类型必须能表示有限规格化数、非规格化数、无穷大和 NaN (非数字)。half 数据类型的非规格化数可能在使用内置函数 vstore_half 将一个 float 转换为 half 时生成,也可能在使用内置函数 vload_half 将一个 half 转换为 float 时生成,这些非规格化数不能刷新为 0。

Conversions from float to half correctly round the mantissa to 11 bits of precision. Conversions from half to float are lossless; all half numbers are exactly representable as float values.
float 转换为 half 时会适当地将尾数舍入为 11 位精度。halffloat 的转换则是无损的,所有 half 数都可以被 float 值准确地表示。

compliant [kəm'plaɪənt]:adj. 顺从的,百依百顺的,俯首帖耳的,符合的
exponent [ɪkˈspəʊnənt]:n. 指数,拥护者,能手 adj. 讲解的
mantissa [mæn'tɪsə]:n. 假数,(对数的) 尾数
finite [ˈfaɪnaɪt]:adj. 有限的,有限制的,限定的 n. 有限 (性),有限物
infinity [ɪn'fɪnəti]:n. 无限,无穷,无穷远,无限远的点

The half data type can only be used to declare a pointer to a buffer that contains half values. A few valid examples are given below:
数据类型 half 只能用于声明指针,指向含有 half 值的 buffer。

void bar(__global half *p) {...
}__kernel void foo(__global half *pg, __local half *pl) {__global half *ptr;int offset;ptr = pg + offset;bar(ptr);
}

Below are some examples that are not valid usage of the half type:

half a;
half b[100];
half *p;
a = *p;  // not allowed. must use *vload_half* function

Loads from a pointer to a half and stores to a pointer to a half can be performed using the vector data load and store functions vload_half, vload_halfn, vloada_halfn and vstore_half, vstore_halfn, and vstorea_halfn. The load functions read scalar or vector half values from memory and convert them to a scalar or vector float value. The store functions take a scalar or vector float value as input, convert it to a half scalar or vector value (with appropriate rounding mode) and write the half scalar or vector value to memory.
可以使用 vector data load and store functions vload_half, vload_halfn, vloada_halfn and vstore_half, vstore_halfn, and vstorea_halfn 来执行对 half 指针的加载和存储。加载 (load) 函数从内存读取标量或矢量 half 值,将其转换为一个标量或矢量 float 值。存储 (store) 函数将一个标量或矢量 float 作为输入,将它转换为一个 half 标量或矢量值 (釆用适当的舍入模式),并把这个 half 标量或矢量值写入内存。

2. Built-in Vector Data Types - 内置矢量数据类型

The char, unsigned char, short, unsigned short, int, unsigned int, long, unsigned long, float and double vector data types are supported. [6] The vector data type is defined with the type name, i.e. char, uchar, short, ushort, int, uint, long, ulong, float, or double followed by a literal value n that defines the number of elements in the vector. Supported values of n are 2, 3, 4, 8, and 16 for all vector data types.
所支持的矢量数据类型有:char, unsigned char, short, unsigned short, int, unsigned int, long, unsigned long, float and double。矢量数据类型是通过在类别名 (char, uchar, short, ushort, int, uint, long, ulong, float, or double) 后面跟一个常值 n 来定义的 (其中 n 表示矢量元素的数目)。对于所有矢量数据类型而言,这个 n 可以是 2、3、4、8 和 16。

Vector types with three elements, i.e. where n is 3, require support for OpenCL C 1.1 or newer.

[6] Built-in vector data types are supported by the OpenCL implementation even if the underlying compute device does not natively support any or all of the vector data types. They are to be converted by the device compiler to appropriate instructions that use underlying built-in types supported natively by the compute device. Refer to Appendix B in the OpenCL API specification for a description of the order of the components of a vector type in memory.
即使下层计算设备本身不支持任何或所有矢量数据类型,OpenCL 实现也支持内置矢量数据类型。设备编译器需要将这些类型翻译成恰当的指令,用计算设备原生支持的内置类型来取代他。请参阅 OpenCL API 规范中的附录 B,以了解向量类型的分量在内存中的顺序。

The following table describes the list of built-in vector data types.

Type and Description

charn
A vector of n 8-bit signed two’s complement integer values.
n 个 8 位有符号整数值矢量,为二的补码。

ucharn
A vector of n 8-bit unsigned integer values.
n 个 8 位无符号整数值矢量。

shortn
A vector of n 16-bit signed two’s complement integer values.
n 个 16 位有符号整数值矢量,为二的补码。

ushortn
A vector of n 16-bit unsigned integer values.
n 个 16 位无符号整数值矢量。

intn
A vector of n 32-bit signed two’s complement integer values.
n 个 32 位有符号整数值矢量,为二的补码。

uintn
A vector of n 32-bit unsigned integer values.
n 个 32 位无符号整数值矢量。

longn [7]
A vector of n 64-bit signed two’s complement integer values.
n 个 64 位有符号整数值矢量,为二的补码。

ulongn [7]
A vector of n 64-bit unsigned integer values.
n 个 64 位无符号整数值矢量。

floatn
A vector of n 32-bit floating-point values.
n 个 32 位浮点值矢量

doublen [8]
A vector of n 64-bit floating-point values.
n 个 64 位浮点值矢量。

Requires support for OpenCL C 1.2 or newer. In OpenCL C 3.0 it requires support of the __opencl_c_fp64 feature. Also see extension cl_khr_fp64.

[7] The longn and ulongn vector types are optional types for EMBEDDED profile devices that are supported if the value of the CL_DEVICE_EXTENSIONS device query contains cles_khr_int64. An OpenCL C 3.0 compiler must also define the __opencl_c_int64 feature macro unconditionally for FULL profile devices, or for EMBEDDED profile devices that support these types.
longn and ulongn 向量类型是 Embedded Profile (嵌入式简档) 设备的可选类型。如果 CL_DEVICE_EXTENSIONS 设备查询的值包含 cles_khr_int64,则支持这些类型。OpenCL C 3.0 编译器还必须无条件地为 FULL profile (完全简档) 设备或支持这些类型的 Embedded Profile (嵌入式简档) 设备定义 __opencl_c_int64 功能宏。

[8] The doublen vector type is an optional type that is supported if the value of the CL_DEVICE_DOUBLE_FP_CONFIG device query is not zero. If this is the case then an OpenCL C 3.0 compiler must also define the __opencl_c_fp64 feature macro.
doublen 向量类型是可选类型。如果 CL_DEVICE_DOUBLE_FP_CONFIG 设备查询的值不为零,则支持该类型。 如果是这种情况,那么 OpenCL C 3.0 编译器还必须定义 __opencl_c_fp64 功能宏。

The built-in vector data types are also declared as appropriate types in the OpenCL API (and header files) that can be used by an application. The following table describes the built-in vector data type in the OpenCL C programming language and the corresponding data type available to the application:
built-in vector data types 也在 OpenCL API (and header files) 中声明了可供应用程序使用的适当类型。下表描述了 the built-in vector data type in the OpenCL C programming language (内置向量数据类型) 以及应用程序可用的对应数据类型:

Type in OpenCL Language API type for application
charn cl_charn
ucharn cl_ucharn
shortn cl_shortn
ushortn cl_ushortn
intn cl_intn
uintn cl_uintn
longn cl_longn
ulongn cl_ulongn
floatn cl_floatn
doublen cl_doublen

cl_uchar and cl_uchar4 是应用程序可用的数据类型。

//============================================================================
// Name        : HelloWorld
// Author      : Yongqiang Cheng
// Version     : Version 1.0.0
// Copyright   : Copyright (c) 2020 Yongqiang Cheng
// Description : Hello World in C++, Ansi-style
//============================================================================#include <iostream>
#include <string>
#include <CL/cl.h>#define SUCCESS 0
#define FAILURE 1int main(int argc, char *argv[]) {cl_uint pixel_size_1 = sizeof(cl_uchar);cl_uint pixel_size_2 = sizeof(cl_uchar4);std::cout << "pixel_size_1 = sizeof(cl_uchar) = " << pixel_size_1 << std::endl;std::cout << "pixel_size_2 = sizeof(cl_uchar4) = " << pixel_size_2 << std::endl;std::cout << "\nYongqiang Passed!\n";return SUCCESS;
}

uchar and uchar4 是 OpenCL C 可用的数据类型,应用程序不能直接使用。

//============================================================================
// Name        : HelloWorld
// Author      : Yongqiang Cheng
// Version     : Version 1.0.0
// Copyright   : Copyright (c) 2020 Yongqiang Cheng
// Description : Hello World in C++, Ansi-style
//============================================================================#include <iostream>
#include <string>
#include <CL/cl.h>#define SUCCESS 0
#define FAILURE 1int main(int argc, char *argv[]) {cl_uint pixel_size_1 = sizeof(cl_uchar);cl_uint pixel_size_2 = sizeof(cl_uchar4);cl_uint pixel_size_3 = sizeof(uchar);cl_uint pixel_size_4 = sizeof(uchar4);std::cout << "pixel_size_1 = sizeof(cl_uchar) = " << pixel_size_1 << std::endl;std::cout << "pixel_size_2 = sizeof(cl_uchar4) = " << pixel_size_2 << std::endl;std::cout << "pixel_size_3 = sizeof(uchar) = " << pixel_size_3 << std::endl;std::cout << "pixel_size_4 = sizeof(uchar4) = " << pixel_size_4 << std::endl;std::cout << "\nYongqiang Passed!\n";return SUCCESS;
}
1>------ Build started: Project: HelloWorld, Configuration: Debug Win32 ------
1>  HelloWorld.cpp
1>d:\opencl_workspace\helloworld\helloworld\helloworld.cpp(19): error C2065: 'uchar': undeclared identifier
1>d:\opencl_workspace\helloworld\helloworld\helloworld.cpp(20): error C2065: 'uchar4': undeclared identifier
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

区分 Type in OpenCL LanguageAPI type for application 两种数据类型的应用场景。

//============================================================================
// Name        : HelloWorld
// Author      : Yongqiang Cheng
// Version     : Version 1.0.0
// Copyright   : Copyright (c) 2020 Yongqiang Cheng
// Description : Hello World in C++, Ansi-style
//============================================================================#include <iostream>
#include <string>
#include <CL/cl.h>#define SUCCESS 0
#define FAILURE 1union uchar4 {struct __uchar_four {unsigned char s0;unsigned char s1;unsigned char s2;unsigned char s3;} ch;cl_uint num;
};int main(int argc, char *argv[]) {cl_uint pixel_size_1 = sizeof(cl_uchar);cl_uint pixel_size_2 = sizeof(cl_uchar4);cl_uint pixel_size_3 = sizeof(uchar4);std::cout << "pixel_size_1 = sizeof(cl_uchar) = " << pixel_size_1 << std::endl;std::cout << "pixel_size_2 = sizeof(cl_uchar4) = " << pixel_size_2 << std::endl;std::cout << "pixel_size_3 = sizeof(uchar4) = " << pixel_size_3 << std::endl;std::cout << "\nYongqiang Passed!\n";return SUCCESS;
}
pixel_size_1 = sizeof(cl_uchar) = 1
pixel_size_2 = sizeof(cl_uchar4) = 4
pixel_size_3 = sizeof(uchar4) = 4Yongqiang Passed!
请按任意键继续. . .

3. Other Built-in Data Types - 其他内置数据类型

The following table describes the list of additional data types supported by OpenCL.

Type and Description

image2d_t [9]
A 2D image.

image3d_t [9]
A 3D image.

image2d_array_t [9]
A 2D image array.
2D 图像数组。

Requires support for OpenCL C 1.2 or newer.

image1d_t [9]
A 1D image.

Requires support for OpenCL C 1.2 or newer.

image1d_buffer_t [9]
A 1D image created from a buffer object.
由 buffer 对象所创建的 1D 图像。

Requires support for OpenCL C 1.2 or newer.

image1d_array_t [9]
A 1D image array.
1D 图像数组。

Requires support for OpenCL C 1.2 or newer.

image2d_depth_t [9]
A 2D depth image.

Requires support for OpenCL C 2.0 or newer, also see cl_khr_depth_images extension.

image2d_array_depth_t [9]
A 2D depth image array.

Requires support for OpenCL C 2.0 or newer, also see cl_khr_depth_images extension.

sampler_t [9]
A sampler type.
采样器类型。

queue_t
A device command queue. This queue can only be used to enqueue commands from kernels executing on the device.
设备命令队列。此队列只能用于将在设备上执行的内核的命令入队。

Requires support for OpenCL C 2.0, or OpenCL C 3.0 or newer and the __opencl_c_device_enqueue feature.

ndrange_t
The N-dimensional range over which a kernel executes.
内核执行的 N 维范围。

Requires support for OpenCL C 2.0, or OpenCL C 3.0 or newer and the __opencl_c_device_enqueue feature.

clk_event_t
A device side event that identifies a command enqueue to a device command queue.
一种设备端事件,用于标识进入设备命令队列的命令。

Requires support for OpenCL C 2.0, or OpenCL C 3.0 or newer and the __opencl_c_device_enqueue feature.

reserve_id_t
A reservation ID. This opaque type is used to identify the reservation for reading and writing a pipe.
预留 ID。此不透明类型用于标识预留的读取和写入管道。

Requires support for OpenCL C 2.0, or OpenCL C 3.0 or newer and the __opencl_c_pipes feature.

natively ['neɪtɪvlɪ]:adv.生来地
opaque [əʊˈpeɪk]:n. 不透明,遮檐,遮光涂料 adj. 模糊,不透明的,不透光的,浑浊的

event_t
An event. This can be used to identify async copies from global to local memory and vice-versa.
事件。可用来标识全局内存和局部内存之间的异步拷贝。

cl_mem_fence_flags
This is a bitfield and can be 0 or a combination of the following values ORed together (这是一个位域,可以是 0 或以下值 ORed 的组合一起):
CLK_GLOBAL_MEM_FENCE
CLK_LOCAL_MEM_FENCE
CLK_IMAGE_MEM_FENCE

These flags are described in detail in the synchronization functions section.

[9] Refer to the detailed description of the built-in Image Read and Write Functions that use this type.

The image2d_t, image3d_t, image2d_array_t, image1d_t, image1d_buffer_t, image1d_array_t, image2d_depth_t, image2d_array_depth_t and sampler_t types are only defined if the device supports images, i.e. the value of the CL_DEVICE_IMAGE_SUPPORT device query is CL_TRUE. If this is the case then an OpenCL C 3.0 or newer compiler must also define the __opencl_c_images feature macro.
image2d_t, image3d_t, image2d_array_t, image1d_t, image1d_buffer_t, image1d_array_t, image2d_depth_t, image2d_array_depth_t and sampler_t 类型仅在设备支持 image 时才可以定义,即 CL_DEVICE_IMAGE_SUPPORT 设备查询为 CL_TRUE。如果是这种情况,那么 OpenCL C 3.0 或更新的编译器还必须定义 __opencl_c_images feature macro。

The C99 derived types (arrays, structs, unions, functions, and pointers), constructed from the built-in scalar, vector, and other data types are supported, with specified restrictions.
C99 的派生类型 (arrays, structs, unions, functions, and pointers) 也在支持之列,不过必须是由内置标量、向量和其他数据类型所构造的,同时有特定的限制。

The following tables describe the other built-in data types in OpenCL described in Other Built-in Data Types and the corresponding data type available to the application:
下表描述了 OpenCL 中的其他内置数据类型以及应用程序可用的相应数据类型:

Type in OpenCL Language API type for application
image2d_t cl_mem
image3d_t cl_mem
image2d_array_t cl_mem
image1d_t cl_mem
image1d_buffer_t cl_mem
image1d_array_t cl_mem
image2d_depth_t cl_mem
image2d_array_depth_t cl_mem
sampler_t cl_sampler
queue_t cl_command_queue
ndrange_t N/A
clk_event_t N/A
reserve_id_t N/A
event_t N/A
cl_mem_fence_flags N/A

4. Reserved Data Types - 保留的数据类型

The data type names described in the following table are reserved and cannot be used by applications as type names. The vector data type names defined in Built-in Vector Data Types, but where n is any value other than 2, 3, 4, 8 and 16, are also reserved.
下表中描述的数据类型名称是保留的,不能被应用程序用作类型名称。对于矢量数据型别名而言,当 n 是除 2、3、4、8 和 16 之外的其他值时,也是保留的。

Type and Description

booln
A boolean vector.

Boolean [ˈbuːliən]:adj. 布尔逻辑体系的 (分别以 1 和 0 代指是和非) n. 布尔

halfn
A 16-bit floating-point vector.
n 个 16 位浮点值矢量

quad, quadn
A 128-bit floating-point scalar and vector.
128 位浮点标量和矢量。

complex half, complex halfn
A complex 16-bit floating-point scalar and vector.
16 位浮点复数标量和矢量。

imaginary half, imaginary halfn
An imaginary 16-bit floating-point scalar and vector.
16 位浮点虚数标量和矢量。

complex float, complex floatn
A complex 32-bit floating-point scalar and vector.
32 位浮点复数标量和矢量。

imaginary float, imaginary floatn
An imaginary 32-bit floating-point scalar and vector.
32 位浮点虚数标量和矢量。

complex double, complex doublen
A complex 64-bit floating-point scalar and vector.
64 位浮点复数标量和矢量。

imaginary double, imaginary doublen
An imaginary 64-bit floating-point scalar and vector.
64 位浮点虚数标量和矢量。

complex quad, complex quadn
A complex 128-bit floating-point scalar and vector.
128 位浮点复数标量和矢量。

imaginary quad, imaginary quadn
An imaginary 128-bit floating-point scalar and vector.
128 位浮点虚数标量和矢量。

floatnxm
An n×mn × mn×m matrix of single precision floating-point values stored in column-major order.
单精度浮点数的

OpenCL Data Types (数据类型)相关推荐

  1. 《Redis官方文档》Data types—数据类型

    String类型(字符串类型) String 是Redis中最基本的类型.Redis中的String 类型是二进制安全的,也就是说在Redis中String类型可以包含各种数据,比如一张JPEG图片或 ...

  2. date类型_Chapter 01. 常见数据类型概述 Overview of Common Data Types

    课程:DataCamp_Skill Track_SQL fundamentals[笔记] Chapter 01. 常见数据类型概述 Overview of Common Data Types 了解常见 ...

  3. 【12c】扩展数据类型(Extended Data Types)-- MAX_STRING_SIZE

    [12c]扩展数据类型(Extended Data Types)-- MAX_STRING_SIZE [12c]扩展数据类型(Extended Data Types)-- MAX_STRING_SIZ ...

  4. oracle hana 字段长度,学习SAP HANA 数据类型(SAP HANA DATA TYPES)--像学Oracle一样学习SAP HANA...

    学习SAP HANA 数据类型: SAP HANA Reference: DATA TYPES   http://help.sap.com/hana/html/_csql_data_types.htm ...

  5. java conversion_java 基本数据类型之间的转换(Conversion between Java basic data types).doc...

    java 基本数据类型之间的转换(Conversion between Java basic data types) java 基本数据类型之间的转换(Conversion between Java ...

  6. ODP.NET与复杂的PL/SQL数据类型(Using ODP.NET To Deal With Complex PLSQL Data Types)

    ODP.NET与复杂的PL/SQL数据类型(Using ODP.NET To Deal With Complex PLSQL Data Types) 在开始介绍之前,先给出文章里用到的所有PL/SQL ...

  7. Supported Data Types(flink支持的数据类型)

    文章目录 1.Tuples and Case Classes 2.POJOs 3.Primitive Types 4.General Class Types 5.Values 6.Hadoop Wri ...

  8. Google Earth Engine(GEE)——影像导出谷歌硬盘发生错误Error: Exported bands must have compatible data types

    粉丝问题: 我正在尝试运行一个非常简单的脚本,该脚本应该将 Landsat 8 图像导出到我的 Google Drive.当我在任务上单击"运行"时,GEE 吐出一个错误:&quo ...

  9. Redis Essentials 读书笔记 - 第二章: Advanced Data Types (Earning a Black Belt)

    Chapter 2. Advanced Data Types (Earning a Black Belt) 本章介绍数据类型:Set, Sorted Set, Bitmap, HyperLogLog. ...

最新文章

  1. word2003计算机应用考试,2017职称计算机考试Word2003操作练习题
  2. 云计算的7种变化方式
  3. Linux下显示IP地址所在地信息的小工具——nali
  4. 关于ArrayList的几大问题,看完还不懂来打我!
  5. 12306新版上线 还是不能选上下铺
  6. dtm文件生成等高线 lisp_南方cass如何用图面高程点生成等高线
  7. [UE4]控制台命令,生成机器人
  8. kafka--Struct Streaming--kafka案例
  9. 2021-09-10二叉树的层序遍历
  10. 基于python实现网络课程秒刷
  11. FPGA之道(6)软件编程思路与FPGA编程思路的变革
  12. 腰围2尺1,2,3,4,5,6,7,8寸分别等于是多少厘米/英寸(对照表)
  13. 微型计算机求RAM片数,微机原理随堂练习答案及解析..doc
  14. 树莓派+英特尔神经网络计算棒
  15. JS快速获取本周、本月时间区间的方法
  16. 大数据在高校的应用场景_大数据在高校教育信息化的应用
  17. YUVPlayer: 基于Android平台的YUV视频原始数据播放器
  18. Qt5.12+VS2017环境下编译QtAV视频库
  19. Windows 系统自带的文件同步工具
  20. 计算机网络第四版课后题答案黄彦,教学大纲-计算机电路基础(9页)-原创力文档...

热门文章

  1. Linux数据库挂载空间
  2. 通联支付python库
  3. 日历制作视频教程下载
  4. 如何调出天正8.2中上部的工具条
  5. 第二章 不确定性推理方法
  6. 南昌php总人数,2018南昌市人口数量是多少,历年南昌市各区人口数量排行榜
  7. facebook 的 CIO
  8. 多阈值小波包去噪matlab,小波包多阈值去噪法及其在形变分析中的应用
  9. Error:(7, 21) java: 程序包javax.servlet不存在,Maven项目请求资源不可用
  10. 任务管理软件 Things3 教程使用示例