当前位置:网站首页>Vector types and variables built in CUDA
Vector types and variables built in CUDA
2022-07-02 06:27:00 【Little Heshang sweeping the floor】
CUDA The built-in Vector Types and variables
Built-in Vector Types
char, short, int, long, longlong, float, double
These are vector types derived from basic integer and floating-point types . They are structures , first 、 the second 、 The third and fourth components can be passed through fields x、y、z and w visit . They all carry make_<type name> Constructor of form ; for example ,
int2 make_int2(int x, int y);
It creates a with value(x, y) Of int2 Vector of type .
The alignment requirements of vector types are detailed in the following table .
| 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
This type is based on uint3 Integer vector type of , Used to specify the dimension . Definition dim3 When a variable of type , Any unspecified components will be initialized to 1.
Built-in Variables
1. gridDim
The type of the variable is dim3( see also dim3) And include the size of the grid .
2. blockIdx
The variable is uint3 type ( Please see the char、short、int、long、longlong、float、double) And include the block index in the grid .
3. blockDim
The type of the variable is dim3( see also dim3) And include the size of the block .
4. threadIdx
This variable is uint3 type ( Please see the char、short、int、long、longlong、float、double ) And include the thread index in the block .
5. warpSize
The variable is int type , Contains warp size ( of warp The definition of , Please see the SIMT Architecture).
边栏推荐
- sudo提权
- Don't use the new WP collection. Don't use WordPress collection without update
- RestTemplate请求时设置请求头,请求参数,请求体。
- 介绍两款代码自动生成器,帮助提升工作效率
- CUDA中的函数执行空间说明符
- Sparse array (nonlinear structure)
- Three suggestions for all students who have graduated and will graduate
- Redis——缓存击穿、穿透、雪崩
- 深入了解JUC并发(二)并发理论
- sprintf_s的使用方法
猜你喜欢

The intern left a big hole when he ran away and made two online problems, which made me miserable

New version of dedecms collection and release plug-in tutorial tool

Redis - grande question clé

深入学习JVM底层(四):类文件结构

Summary of WLAN related knowledge points
![Data science [9]: SVD (2)](/img/2c/f1a8c3ff34ff3f3cc6e26157a32bfd.png)
Data science [9]: SVD (2)

队列(线性结构)

一口气说出 6 种实现延时消息的方案

Redis - hot key issues

数据科学【九】:SVD(二)
随机推荐
CUDA中的存储空间修饰符
State machine in BGP
automation - Jenkins pipline 执行 nodejs 命令时,提示 node: command not found
Support new and old imperial CMS collection and warehousing tutorials
Linked list (linear structure)
Redis——Cluster数据分布算法&哈希槽
深入学习JVM底层(二):HotSpot虚拟机对象
When requesting resttemplate, set the request header, request parameters, and request body.
Shardingsphere JDBC
Hydration failed because the initial UI does not match what was rendered on the server.问题原因之一
PgSQL学习笔记
Amazon AWS data Lake Work Pit 1
Common means of modeling: combination
sudo提权
分布式事务 :可靠消息最终一致性方案
Detailed explanation of BGP message
计算属性普通函数写法 和 set get 写法
提高用户体验 防御性编程
FE - 微信小程序 - 蓝牙 BLE 开发调研与使用
CUDA中的异步数据拷贝