您当前的位置: 首页 >  矩阵

FPGA硅农

暂无认证

  • 2浏览

    0关注

    282博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

矩阵乘法在不同平台上的运行时间

FPGA硅农 发布时间:2020-08-13 12:14:56 ,浏览量:2

出于对并行计算的兴趣,我尝试了CPU、GPU CUDA、GPU CUDA CUBLAS这三种方式进行矩阵乘法的计算。 一、CPU

#include
#include
#include
//#pragma GCC optimize(3)
#define R_SIZE 256*8
int main(){
  int* a=(int*)malloc(R_SIZE*R_SIZE*sizeof(int));
  int* b=(int*)malloc(R_SIZE*R_SIZE*sizeof(int));
  int* c=(int*)malloc(R_SIZE*R_SIZE*sizeof(int));
  int i,j,k;
  clock_t start,end;
  for(i=0;i            
关注
打赏
1658642721
查看更多评论
0.0861s