C++并行应用开发包 Thrust

码农软件 · 软件分类 · 并发/并行处理框架 · 2019-09-03 07:57:04

软件介绍

Thrust 是一个开源的 C++ 库用于开发高性能并行应用程序,以 C++ 标准模板库为蓝本实现,Thrust 带来一系列并行计算领域的抽象层。

下面示例代码用来并行结算 100 个随机数的和:

#include <thrust/host_vector.h>
#include <thrust/device_vector.h>
#include <thrust/generate.h>
#include <thrust/reduce.h>
#include <thrust/functional.h>
#include <algorithm>
#include <cstdlib>

int main(void)
{
  // generate random data serially
  thrust::host_vector<int> h_vec(100);
  std:generate(h_vec.begin(), h_vec.end(), rand);

  // transfer to device and compute sum
  thrust::device_vector<int> d_vec = h_vec;
  int x = thrust::reduce(d_vec.begin(), d_vec.end(), 0, thrust::plus<int>());
  return 0;
}

本文地址:https://www.codercto.com/soft/d/13764.html

平台战略

平台战略

陈威如、余卓轩 / 中信出版社 / 2013-1 / 58.00元

《平台战略:正在席卷全球的商业模式革命》内容简介:平台商业模式的精髓,在于打造一个完善的、成长潜能强大的“生态圈”。它拥有独树一帜的精密规范和机制系统,能有效激励多方群体之间互动,达成平台企业的愿景。纵观全球许多重新定义产业架构的企业,我们往往就会发现它们成功的关键——建立起良好的“平台生态圈”,连接两个以上群体,弯曲、打碎了既有的产业链。 平台生态圈里的一方群体,一旦因为需求增加而壮大,另......一起来看看 《平台战略》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具