kernal.cu
#include <stdio.h>
#include <stdlib.h>
#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include <cusolverDn.h>
extern "C" int GET_QR(int ncpt)
{
cusolverDnHandle_t cusolverH = NULL;
const int m = 3;
const int lda = m;
float *A = (float*)malloc(lda*m * sizeof(float));
//for (size_t i = 0; i < m; i++)
//{
// for (size_t j = 0; j < m; j++)
// {
// A[i*m+j]=j*2;
// }
//}
A[0] = 12;
A[1] = 6;
A[2] = -4;
A[3] = -51;
A[4] = 167;
A[5] = 24;
A[6] = 4;
A[7] = -68;
A[8] = -41;
float *W;
W = (float*)malloc(lda*m * sizeof(float)); // eigenvalues最终保存结果
int info_gpu = 0;//计算状态保存
// 步骤1:声明句柄
cusolverDnCreate(&cusolverH);
// 步骤2:分配显存空间
float *d_A = NULL; cudaMalloc((void**)&d_A, sizeof(float) * lda * m);//声明Hermite矩阵(与计算后的特征向量为同一空间)
float *d_W =
|