1 软件版本信息
- Visual Studio 2015 Professional
- Matlab 2017b
- Operating System Windows 10
2 代码部分
2.1 Matlab代码
2.1.1 图片
2.1.2 源码
function [c] = gpuTestInCPlus(n)
clc;
fprintf('Creating a matrix of size %d-by-%d.\n',n, n);
A = rand(n,n,'single') + 100*eye(n,n,'single');
b = rand(n, 1);
gd = gpuDevice();
disp('Coefficient Matrix (A) is as follows: ');
A
disp('Right Hand Side Vector (b) is as follows: ');
b
disp('gpuArray Manner With Single Technique Involved: ')
tic;
Agpu=gpuArray(A);
bgpu=gpuArray(b);
c=A\b;
wait(gd);
toc;
end
2.2 C++代码
2.2.1 图片
2.2.2 源码
#include "stdafx.h"
#include "gpuTestInCP