设为首页 加入收藏

TOP

基于PS3和Cell处理器并行程序编译过程
2014-11-23 22:28:30 来源: 作者: 【 】 浏览:12
Tags:基于 PS3 Cell 处理器 并行 程序 编译 过程

hello_ppu.c
#include
#include


extern spe_program_handle_t hello_spu_handle;


int main()
{
speid_t id[6];
int i;
for (i=0;i<6;i++)
{
id[i] = spe_create_thread(0,&hello_spu_handle,NULL,NULL,-1,0);//建立6个线程
}
for (i=0;i<6;i++)
{
spe_wait(id[i],NULL,0);//等待各个线程结束
}
i = spe_count_physical_spes(); //获取可以使用的spe数目
printf("number of spe available: %d\n",i);
return 0;
}

hello_spu.c
#include


int main (unsigned long long speid, unsigned long long argp,unsigned long long envp)
{
printf("0x%x: Hello World!\n",(unsigned int) speid);
return 0;
}


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇使用PS3与Linux搭建一个并行程序.. 下一篇Linux Shell元字符知识笔记

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: