gpu-pearson
所属分类:GPU/显卡
开发工具:Cuda
文件大小:4KB
下载次数:0
上传日期:2020-10-23 08:55:23
上 传 者:
sh-1993
说明: CUDA支持GPU实现Pearson相关系数查找器。
(CUDA powered GPU implementation of the Pearson correlation coefficient finder.)
文件列表:
kernel.cu (4160, 2020-10-23)
main.cpp (392, 2020-10-23)
parameters.h (388, 2020-10-23)
pearsonCorellation.h (71, 2020-10-23)
structures.h (927, 2020-10-23)
utils.cpp (995, 2020-10-23)
utils.h (192, 2020-10-23)
# GPU-accelerated Pearson corellation
A simple GPU based Pearson correlation coefficient finder made using CUDA.
## What is a Pearson correlation?
A Pearson correlation is a statistic which measures a linear correlation of a set of points (x,y).
The domain of this function is **<-1, 1>**, where:
- 1 indicates a positive correlation
- 0 indicates no correlation
- -1 indicates a negative correlation
## Formula
A mathematical formula used to calculate the coefficient:
![Pearson corr formula](https://wikimedia.org/api/rest_v1/media/math/render/svg/435a23c499a2450f0752112e69a9b808336a7cce)
*Image courtesy of Wikipedia*
## How does the program work?
The program calculates in parallel each of the components of above formula.
Every sum is calculated and reduced using GPU. This is the most time-demanding process and it's easy to make it parallel. Then, CPU performs a "finishing" process (summing output values of every GPU block) and substitutes every component into the final formula.
## Example
### Input
| X | Y |
| -- | -- |
| 43 | 99 |
| 21 | 65 |
| 25 | 79 |
| 42 | 75 |
| 57 | 87 |
| 59 | 81 |
### Output
```
(sigma)xi * yi = 20485.000000
(sigma)xi^2 = 11409.000000
(sigma)yi^2 = 11409.000000
(sigma)xi = 247.000000
(sigma)yi = 486.000000
r = 0.52***09
```
近期下载者:
相关文件:
收藏者: