在CUDA 10.0中,cudaError_tcudnnStatus_t的大小取决于编译器和操作系统的位数。

对于大多数操作系统和编译器,cudaError_t的大小为4个字节(32位系统)或8个字节(64位系统),而cudnnStatus_t的大小为4个字节。

然而,这只是一般情况,具体的大小可能会因操作系统、编译器和编译选项的不同而有所变化。如果需要准确的大小信息,可以通过在代码中使用sizeof运算符来获取它们的确切大小:

#include <stdio.h>
#include <cuda_runtime.h>
#include <cudnn.h>

int main() {
    printf("sizeof(cudaError_t) = %zu\n", sizeof(cudaError_t));
    printf("sizeof(cudnnStatus_t) = %zu\n", sizeof(cudnnStatus_t));
    
    return 0;
}

运行上述代码将会输出sizeof(cudaError_t)sizeof(cudnnStatus_t)的确切大小

cuda100中sizeofcudaError_t和sizeofcudnnStatus_t分别多大

原文地址: https://www.cveoy.top/t/topic/hx0c 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录