#include <iostream>
#include <cuda_runtime.h>
#include <cuda_occupancy.h>
// Device code
__global__ void MyKernel(int *d, int *a, int *b)
{
int idx = threadIdx.x + blockIdx.x * blockDim.x;
d[idx] = a[idx] * b[idx];
}
// Host code
int main()
{
int numBlocks; // Occupancy in terms of active blocks
int
CUDA提供的函数评估Occupancy
最新推荐文章于 2025-06-24 13:27:12 发布

最低0.47元/天 解锁文章
532

被折叠的 条评论
为什么被折叠?



