>>help gpu
There are several options available for using your computer's graphics
processing unit (gpu) for matrix operations.

- Transfer data between the MATLAB workspace and the gpu
- Evaluate individual MATLAB functions that have been
overloaded for execution on the gpu
- Execute MATLAB code containing multiple functions using ARRAYFUN.
(Not all MATLAB functions are supported.)
- Create kernels from CU files for execution on the gpu

The gpu Computing section of the Parallel Computing Toolbox User's Guide
provides more information on these use cases and lists supported devices
and device drivers.

Data Transfer Operations
gpuArray - Transfer an array from the MATLAB workspace to the gpu
gather - Transfer an array from the gpu to the MATLAB workspace

MATLAB Overloads

MATLAB functions that have been made available for
execution on the gpu can be viewed using the command

methods('gpuArray')

Certain other MATLAB functions that support gpuArray inputs are
listed in the Parallel Computing Toolbox documentation.

Examples:
% FFT
A = gpuArray( rand( 2^16, 100 ) );
F = fft(A)

% MLDIVIDE
A = gpuArray( rand(1024) ); B = gpuArray( rand(1024,1) );
X = A\B

% MTIMES
A = gpuArray( rand(1024) ); B = gpuArray( rand(1024) );
C = A*B

Execute MATLAB code on the gpu
gpuArray/arrayfun - Apply a function to each element of an array on
the gpu

The function to evaluate on the gpu must exist on the path. Only a
subset of the MATLAB language is supported by ARRAYFUN on the gpu.
The restrictions are listed in the User's Guide.

Example:
% The file xycrull.m is one example of an existing MATLAB file
% that can be automatically executed on the gpu.
%
% Execute 'type xycrull' at the MATLAB prompt to view the contents
% of the file.
%
gt = gpuArray(rand(400));
[o1, o2] = arrayfun(@xycrull, gt)

CUDA Kernel Operations
parallel.gpu.CUDAKernel - Create a kernel object that corresponds
to a particular kernel in a CU file
parallel.gpu.CUDAKernel/feval - Evaluate a kernel on the gpu

Device Information
gpuDeviceCount - Return the number of gpu devices available
gpuDevice - Query or select a gpu device

Timing gpu Operations
gputimeit - Measure time required to run function on gpu

matlab采用GPU运算的更多相关文章

  1. 科学计算 | Matlab 使用 GPU 并行计算

    科学计算 | Matlab 使用 GPU 并行计算 本文转载自:  https://sanwen8.cn/p/14bJc10.html       Matlab下直接使用GPU并行计算(预告)< ...

  2. MATLAB的符号运算基础

    在数学运算中,运算的结果如果是一个数值,可以称这类运算为数值运算:如果运算结果为表达式,在MATLAB中称为符号运算,符号计算是对未赋值的符号对象(可以是常数.变量.表达式)进行运算和处理.MATLA ...

  3. TensorFlow——tensorflow指定CPU与GPU运算

    1.指定GPU运算 如果安装的是GPU版本,在运行的过程中TensorFlow能够自动检测.如果检测到GPU,TensorFlow会尽可能的利用找到的第一个GPU来执行操作. 如果机器上有超过一个可用 ...

  4. TensorFlow.NET机器学习入门【8】采用GPU进行学习

    随着网络越来约复杂,训练难度越来越大,有条件的可以采用GPU进行学习.本文介绍如何在GPU环境下使用TensorFlow.NET. TensorFlow.NET使用GPU非常的简单,代码不用做任何修改 ...

  5. Matlab的集合运算[转]

    今天遇到一个问题:有向量a和向量b,b是a的子向量(元素全部来自a),求向量a去掉向量b后剩下的元素构成的向量. 这么一个简单的问题,搜了半天也没有得到结果,因为找不到合适的关键词来描述这个问题. 在 ...

  6. 【matlab】GPU 显卡版本与计算能力(compute capability)兼容性问题

    MathWorks - Bug Reports 1. 问题说明 当运行 alexnet 等卷积神经网络需要使用 GPU 加速时,matlab 如果提示如下的警告信息: GPUs of compute ...

  7. 利用matlab进行协方差运算

    本文全部参考自: http://www.cnblogs.com/welen/articles/5535042.html#undefined 知识点一: MATLAB中四个取整函数具体使用方法如下:Ma ...

  8. [matlab] 5.字符运算与微积分

    首先介绍一下matlab里的符号计算 符号变量可以看成是数学中含参数 的表达式中的参数 matlab能进行像(a+b)(a-b)=a^2-b^2这样的计算 要进行符号计算首先要定义符号变量 定义符号对 ...

  9. MATLAB矩阵基础运算

    1.矩阵的加减运算X+Y或者X-Y:元素对应相加减.在此要求X与Y必须是同维矩阵,否则会出现错误信息.如果Y为一个数,则表示X中每一元素+Y或者-Y: %当X和Y都为同维矩阵时 X=[1,2,-3;2 ...

随机推荐

  1. 终极解决方案: Invalid character found in the request target.

    终极解决方案:(导出可能出现) 我的tomcat版本是8.5.32,导出时遇到以下报错. 报错日志: Invalid character found in the request target. Th ...

  2. hihocoder 1014: Trie树(Trie树模板题)

    题目链接 #include<bits/stdc++.h> using namespace std; ; struct T { int num; T* next[]; T() { num=; ...

  3. v-for中的key的使用【key的作用主要是是为了高效的更新虚拟DOM】

    vue中列表循环需加:key="唯一标识" 唯一标识可以是item里面id index等,因为vue组件高度复用增加Key可以标识组件的唯一性,为了更好地区别各个组件 key的作用 ...

  4. VS2010MFC编程入门

    一.MFC编程入门教程之目录 第1部分:MFC编程入门教程之目录 1.MFC编程入门之前言  鸡啄米的C++编程入门系列给大家讲了C++的编程入门知识,大家对C++语言在语法和设计思想上应该有了一定的 ...

  5. 对于vue绑定的model值里边get和set的小动作

    先看下例子: template里边内容: <el-form-item label="导航条类型"> <el-radio-group v-model="n ...

  6. windows10 cortana 不能搜索解决办法

    不太确定是某次系统更新或安装VS软件之后, 发现windows10 cortana 搜索的结果是空白了, 搜索了相关帖子, 试遍所有方法都无效, 最后在联网的情况下, 只用了在powershell中重 ...

  7. cvAddWeighted 进行图片融合

     http://blog.csdn.net/longzaitianya1989/article/details/8103822 cvAddWeighted 进行图片融合 2012-10-23 18:2 ...

  8. Markdown ![...](...) --> <img ... />

    search \!\[(\w+)\]\(([a-zA-Z0-9/.]+)\) replace <img src="$2" width="30%"/>

  9. 【一起学源码-微服务】Nexflix Eureka 源码三:EurekaServer启动之EurekaServer上下文EurekaClient创建

    前言 上篇文章已经介绍了 Eureka Server 环境和上下文初始化的一些代码,其中重点讲解了environment初始化使用的单例模式,以及EurekaServerConfigure基于接口对外 ...

  10. js中的经典案例--简易万年历

    js中的经典案例--简易万年历 html代码 <!DOCTYPE html> <html> <head> <meta charset="utf-8& ...