# thrust **Repository Path**: KIGA1216/thrust ## Basic Information - **Project Name**: thrust - **Description**: Thrust is a C++ parallel programming library which resembles the C++ Standard Library. - **Primary Language**: C++ - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 0 - **Created**: 2019-07-07 - **Last Updated**: 2021-01-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README Thrust: Code at the speed of light ================================== Thrust is a C++ parallel programming library which resembles the C++ Standard Library. Thrust's **high-level** interface greatly enhances programmer **productivity** while enabling performance portability between GPUs and multicore CPUs. **Interoperability** with established technologies (such as CUDA, TBB, and OpenMP) facilitates integration with existing software. Develop **high-performance** applications rapidly with Thrust! Thrust is distributed with the CUDA Toolkit in addition to GitHub. Examples -------- Thrust is best explained through examples. The following source code generates random numbers serially and then transfers them to a parallel device where they are sorted. ```c++ #include #include #include #include #include #include #include int main(void) { // generate 32M random numbers serially thrust::host_vector h_vec(32 << 20); std::generate(h_vec.begin(), h_vec.end(), rand); // transfer data to the device thrust::device_vector d_vec = h_vec; // sort data on the device (846M keys per second on GeForce GTX 480) thrust::sort(d_vec.begin(), d_vec.end()); // transfer data back to host thrust::copy(d_vec.begin(), d_vec.end(), h_vec.begin()); return 0; } ``` This code sample computes the sum of 100 random numbers in parallel: ```c++ #include #include #include #include #include #include #include int main(void) { // generate random data serially thrust::host_vector h_vec(100); std::generate(h_vec.begin(), h_vec.end(), rand); // transfer to device and compute sum thrust::device_vector d_vec = h_vec; int x = thrust::reduce(d_vec.begin(), d_vec.end(), 0, thrust::plus()); return 0; } ``` Refer to the [Quick Start Guide](http://github.com/thrust/thrust/wiki/Quick-Start-Guide) page for further information and examples. Development process ------------------- For information on development process and branching, see [this document](doc/branching.md). http://thrust.github.io/ Release File