当前位置:网站首页>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)。
边栏推荐
- Classic literature reading -- deformable Detr
- Mech 3002 explanation
- From design delivery to development, easy and efficient!
- Don't use the new WP collection. Don't use WordPress collection without update
- Style modification of Mui bottom navigation
- 借力 Google Cloud 基础设施和着陆区,构建企业级云原生卓越运营能力
- In depth understanding of JUC concurrency (I) what is JUC
- 经典文献阅读之--Deformable DETR
- Spark overview
- VLAN experiment of switching technology
猜你喜欢
AttributeError: ‘str‘ object has no attribute ‘decode‘
经典文献阅读之--Deformable DETR
Deep learning classification network -- alexnet
深入学习JVM底层(二):HotSpot虚拟机对象
Step by step | help you easily submit Google play data security form
BGP报文详细解释
LeetCode 90. 子集 II
Shenji Bailian 3.54-dichotomy of dyeing judgment
New version of dedecms collection and release plug-in tutorial tool
日志(常用的日志框架)
随机推荐
Cookie plugin and localforce offline storage plugin
加密压缩文件解密技巧
Linear DP (split)
线性dp(拆分篇)
深入学习JVM底层(三):垃圾回收器与内存分配策略
LeetCode 78. 子集
No subject alternative DNS name matching updates. jenkins. IO found, the reason for the error and how to solve it
ROS2----LifecycleNode生命周期节点总结
BGP中的状态机
WLAN相关知识点总结
From design delivery to development, easy and efficient!
RestTemplate请求时设置请求头,请求参数,请求体。
AttributeError: ‘str‘ object has no attribute ‘decode‘
Contest3147 - game 38 of 2021 Freshmen's personal training match_ 1: Maximum palindromes
【每日一题】—华为机试01
Verifying downloaded files using sha256 files
Shenji Bailian 3.54-dichotomy of dyeing judgment
浅谈三点建议为所有已经毕业和终将毕业的同学
Introduce uview into uni app
New version of dedecms collection and release plug-in tutorial tool