久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如何使用 Visual Profiler 分析 PyCuda 代碼?

How to profile PyCuda code with the Visual Profiler?(如何使用 Visual Profiler 分析 PyCuda 代碼?)
本文介紹了如何使用 Visual Profiler 分析 PyCuda 代碼?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

當我創建一個新會話并告訴 Visual Profiler 啟動我的 python/pycuda 腳本時,我收到以下錯誤消息:Execution run #1 of program '' failed, exit code: 255

When I create a new session and tell the Visual Profiler to launch my python/pycuda scripts I get following error message: Execution run #1 of program '' failed, exit code: 255

這些是我的偏好:

  • 啟動:python "/pathtopycudafile/mysuperkernel.py"
  • 工作目錄:"/pathtopycudafile/mysuperkernel.py"
  • 參數:[empty]

我在 Ubuntu 10.10 下使用 CUDA 4.0.64位.分析編譯的示例工作.

I use CUDA 4.0 under Ubuntu 10.10. 64Bit. Profiling compiled examples works.

附言我知道 SO 問題 如何在 Linux 中分析 PyCuda 代碼?,但似乎是一個不相關的問題.

p.s. I am aware of SO question How to profile PyCuda code in Linux?, but seems to be an unrelated problem.

小例子

pycudaexample.py:

pycudaexample.py:

import pycuda.autoinit
import pycuda.driver as drv
import numpy

from pycuda.compiler import SourceModule

mod = SourceModule("""
__global__ void multiply_them(float *dest, float *a, float *b)
{
  const int i = threadIdx.x;
  dest[i] = a[i] * b[i];
}
""")

multiply_them = mod.get_function("multiply_them")

a = numpy.random.randn(400).astype(numpy.float32)
b = numpy.random.randn(400).astype(numpy.float32)

dest = numpy.zeros_like(a)
multiply_them(
        drv.Out(dest), drv.In(a), drv.In(b),
        block=(400,1,1), grid=(1,1))

pycuda.autoinit.context.detach()

示例設置

錯誤信息

推薦答案

您為計算分析器指定可執行文件的方式有問題.如果我在您發布的代碼的頂部放了一條井號線:

There is something wrong with the way you are specifying the executable to the compute profiler. If I put a hash bang line at the top of your posted code:

#!/usr/bin/env python

然后給python文件可執行權限,計算分析器運行代碼沒有抱怨,我得到這個:

and then give the python file executable permissions, the compute profiler runs the code without complaint and I get this:

這篇關于如何使用 Visual Profiler 分析 PyCuda 代碼?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Troubles while parsing with python very large xml file(使用 python 解析非常大的 xml 文件時出現問題)
Find all nodes by attribute in XML using Python 2(使用 Python 2 在 XML 中按屬性查找所有節點)
Python - How to parse xml response and store a elements value in a variable?(Python - 如何解析 xml 響應并將元素值存儲在變量中?)
How to get XML tag value in Python(如何在 Python 中獲取 XML 標記值)
How to correctly parse utf-8 xml with ElementTree?(如何使用 ElementTree 正確解析 utf-8 xml?)
Parse XML from URL into python object(將 XML 從 URL 解析為 python 對象)
主站蜘蛛池模板: 精品久久久久一区二区国产 | 国产精品免费一区二区三区 | 精品国产乱码久久久久久老虎 | 欧美一区二区激情三区 | 日韩α片 | 欧美一区2区三区3区公司 | 日韩一区和二区 | 天天曰天天干 | 婷婷免费在线 | 国产精品国产成人国产三级 | 国产精品视频一区二区三区 | 日韩成人精品视频 | 精品国产免费人成在线观看 | 国产不卡一 | 91精品国产乱码久久久久久久久 | 免费久久久 | 毛片毛片毛片毛片毛片 | 97精品超碰一区二区三区 | 免费在线观看成年人视频 | 精品国产免费一区二区三区五区 | 在线免费中文字幕 | 最新黄色毛片 | 国产日韩欧美在线观看 | 成人在线免费网站 | 国产免费又黄又爽又刺激蜜月al | 美女久久视频 | 在线看片国产精品 | 懂色av色香蕉一区二区蜜桃 | 久久久免费 | 91就要激情 | 精品国产乱码久久久久久88av | 日韩毛片网 | 中文av在线播放 | 欧美阿v| 亚洲综合天堂网 | 精品影院 | 一区日韩 | 丝袜天堂 | 国产精品久久国产精品 | 午夜视频在线观看网站 | 成人久久久 |