zoukankan      html  css  js  c++  java
  • 【NVIDIA讲座】CUDA Python

    CUDA
    compute Unified Device Architecture

    CUDA C/C++
    基于C/C++的编程方法
    支持异构编程的扩展方法
    简单明了的API

    CUDA支持的编程语言:
    C/C++/PYTHON/Fortran/Java/...

    CUDA并行计算模式
    并行计算是同时应用多个计算资源解决一个计算问题
    (空间换时间)

    异构计算
    HOST CPU和内存(host memory)
    DEVICE GPU和现存 (device memory)




    32个CUDA核(一个warp)共享一个execution contexts

    CUDA Python

    host: The CPU
    device: The GPU
    host memory: The system main memory
    device memory: Onboard memroy on a GPU card
    kernals: a GPU function launched by the host and executed on the device
    device function: a GPU function executed on the device which can only be called from the device (i.e. form a kernel or another device function)

    定义Kernal函数:

    @cuda.jit('void(int32[:]),int32[:]')
    def foo(aryA,aryB):
          ...
    

    调用Kernal函数:

    griddim = 1,2
    blockdim = 3,4
    foo[griddim,blockdim](aryA,aryB)
    

    查看CUDA 版本

    nvcc -V
    

    创建文件

    touch 20200609-python-cuda-cv.py
    
  • 相关阅读:
    python 模拟(简易)音乐播放器
    Python中的多态如何理解?(转)
    mysql踩得坑
    python简单模拟博客园系统
    04 信号量
    02 事件
    01 管道
    32 管道 事件 信号量 进程池 线程的创建
    02 验证进程之间是空间隔离的
    01 进程的其他方法
  • 原文地址:https://www.cnblogs.com/maxwell-maxwill/p/13207643.html
Copyright © 2011-2022 走看看