当前位置:网站首页>CUDA中内置的Vector类型和变量
CUDA中内置的Vector类型和变量
2022-07-02 06:12:00 【扫地的小何尚】
CUDA中内置的Vector类型和变量
Built-in Vector Types
char, short, int, long, longlong, float, double
这些是从基本整数和浮点类型派生的向量类型。 它们是结构,第一个、第二个、第三个和第四个组件可以分别通过字段 x、y、z 和 w 访问。 它们都带有 make_<type name> 形式的构造函数; 例如,
int2 make_int2(int x, int y);
它创建了一个带有 value(x, y) 的 int2 类型的向量。
向量类型的对齐要求在下表中有详细说明。
| Type | Alignment |
|---|---|
| char1, uchar1 | 1 |
| char2, uchar2 | 2 |
| char3, uchar3 | 1 |
| char4, uchar4 | 4 |
| short1, ushort1 | 2 |
| short2, ushort2 | 4 |
| short3, ushort3 | 2 |
| short4, ushort4 | 8 |
| int1, uint1 | 4 |
| int2, uint2 | 8 |
| int3, uint3 | 4 |
| int4, uint4 | 16 |
| long1, ulong1 | 4 if sizeof(long) is equal to sizeof(int) 8, otherwise |
| long2, ulong2 | 8 if sizeof(long) is equal to sizeof(int), 16, otherwise |
| long3, ulong3 | 4 if sizeof(long) is equal to sizeof(int), 8, otherwise |
| long4, ulong4 | 16 |
| longlong1, ulonglong1 | 8 |
| longlong2, ulonglong2 | 16 |
| longlong3, ulonglong3 | 8 |
| longlong4, ulonglong4 | 16 |
| float1 | 4 |
| float2 | 8 |
| float3 | 4 |
| float4 | 16 |
| double1 | 8 |
| double2 | 16 |
| double3 | 8 |
| double4 | 16 |
dim3
此类型是基于 uint3 的整数向量类型,用于指定维度。 定义 dim3 类型的变量时,任何未指定的组件都将初始化为 1。
Built-in Variables
1. gridDim
该变量的类型为 dim3(请参阅 dim3)并包含网格的尺寸。
2. blockIdx
该变量是 uint3 类型(请参见 char、short、int、long、longlong、float、double)并包含网格内的块索引。
3. blockDim
该变量的类型为 dim3(请参阅 dim3)并包含块的尺寸。
4. threadIdx
此变量是 uint3 类型(请参见 char、short、int、long、longlong、float、double )并包含块内的线程索引。
5. warpSize
该变量是 int 类型,包含线程中的 warp 大小(有关 warp 的定义,请参见 SIMT Architecture)。
边栏推荐
- From design delivery to development, easy and efficient!
- Database learning summary 5
- Contest3147 - game 38 of 2021 Freshmen's personal training match_ F: Polyhedral dice
- 日志(常用的日志框架)
- Current situation analysis of Devops and noops
- Contest3147 - game 38 of 2021 Freshmen's personal training match_ E: Listen to songs and know music
- Contest3145 - the 37th game of 2021 freshman individual training match_ H: Eat fish
- LeetCode 283. Move zero
- Don't use the new WP collection. Don't use WordPress collection without update
- 队列(线性结构)
猜你喜欢

Sumo tutorial Hello World

Singleton mode compilation

深入学习JVM底层(二):HotSpot虚拟机对象

Detailed notes of ES6

BGP中的状态机

稀疏数组(非线性结构)

来自读者们的 I/O 观后感|有奖征集获奖名单

Network related knowledge (Hardware Engineer)

Invalid operation: Load into table ‘sources_ orderdata‘ failed. Check ‘stl_ load_ errors‘ system table

Replace Django database with MySQL (attributeerror: 'STR' object has no attribute 'decode')
随机推荐
深入了解JUC并发(一)什么是JUC
Picture clipping plug-in cropper js
LeetCode 78. subset
Contest3147 - game 38 of 2021 Freshmen's personal training match_ F: Polyhedral dice
LeetCode 77. 组合
Sumo tutorial Hello World
Hydration failed because the initial UI does not match what was rendered on the server.问题原因之一
让每一位开发者皆可使用机器学习技术
浏览器原理思维导图
Current situation analysis of Devops and noops
亚马逊aws数据湖工作之坑1
State machine in BGP
Page printing plug-in print js
复杂 json数据 js前台解析 详细步骤《案例:一》
注解和反射详解以及运用
Shenji Bailian 3.53-kruskal
Bgp Routing preference Rules and notice Principles
如何使用MITMPROXy
Google play academy team PK competition, official start!
Cookie plugin and localforce offline storage plugin