This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <vector> | |
| #include <cuda_runtime.h> | |
| // reduce0 kernel: Sums elements using interleaved shared memory addressing | |
| __global__ void reduce0(int *g_idata, int *g_odata) { | |
| extern __shared__ int sdata[]; | |
| unsigned int tid = threadIdx.x; | |
| unsigned int i = blockIdx.x * blockDim.x + threadIdx.x; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <Eigen/Core> | |
| #include <Eigen/Geometry> | |
| #include <iostream> | |
| /*Eigen::Quaterniond multiply(Eigen::Quaterniond a, Eigen::Quaterniond b) { | |
| a.normalize(); | |
| b.normalize(); | |
| Eigen::Quaterniond c = Eigen::Quaterniond::Identity(); | |
| c.w() = a.w() * b.w() - a.vec().transpose() * b.vec(); |