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

    <i id='8YwEj'><tr id='8YwEj'><dt id='8YwEj'><q id='8YwEj'><span id='8YwEj'><b id='8YwEj'><form id='8YwEj'><ins id='8YwEj'></ins><ul id='8YwEj'></ul><sub id='8YwEj'></sub></form><legend id='8YwEj'></legend><bdo id='8YwEj'><pre id='8YwEj'><center id='8YwEj'></center></pre></bdo></b><th id='8YwEj'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='8YwEj'><tfoot id='8YwEj'></tfoot><dl id='8YwEj'><fieldset id='8YwEj'></fieldset></dl></div>

        <small id='8YwEj'></small><noframes id='8YwEj'>

      1. <legend id='8YwEj'><style id='8YwEj'><dir id='8YwEj'><q id='8YwEj'></q></dir></style></legend>
        <tfoot id='8YwEj'></tfoot>
        • <bdo id='8YwEj'></bdo><ul id='8YwEj'></ul>
      2. CUDA 驅(qū)動程序 API 與 CUDA 運行時

        CUDA Driver API vs. CUDA runtime(CUDA 驅(qū)動程序 API 與 CUDA 運行時)

        <small id='TgLbZ'></small><noframes id='TgLbZ'>

            <bdo id='TgLbZ'></bdo><ul id='TgLbZ'></ul>
            <tfoot id='TgLbZ'></tfoot>

            1. <i id='TgLbZ'><tr id='TgLbZ'><dt id='TgLbZ'><q id='TgLbZ'><span id='TgLbZ'><b id='TgLbZ'><form id='TgLbZ'><ins id='TgLbZ'></ins><ul id='TgLbZ'></ul><sub id='TgLbZ'></sub></form><legend id='TgLbZ'></legend><bdo id='TgLbZ'><pre id='TgLbZ'><center id='TgLbZ'></center></pre></bdo></b><th id='TgLbZ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='TgLbZ'><tfoot id='TgLbZ'></tfoot><dl id='TgLbZ'><fieldset id='TgLbZ'></fieldset></dl></div>
              <legend id='TgLbZ'><style id='TgLbZ'><dir id='TgLbZ'><q id='TgLbZ'></q></dir></style></legend>
                  <tbody id='TgLbZ'></tbody>
                1. 本文介紹了CUDA 驅(qū)動程序 API 與 CUDA 運行時的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  在編寫 CUDA 應(yīng)用程序時,您可以在驅(qū)動程序級別或運行時級別工作,如圖所示(庫是 CUFFT 和 CUBLAS 用于高級數(shù)學(xué)):

                  When writing CUDA applications, you can either work at the driver level or at the runtime level as illustrated on this image (The libraries are CUFFT and CUBLAS for advanced math):


                  (來源:tomshw.it)

                  我假設(shè)兩者之間的權(quán)衡是提高低級 API 的性能,但以增加代碼復(fù)雜性為代價.具體的區(qū)別是什么?有哪些重要的事情是高級 API 不能做的?

                  I assume the tradeoff between the two are increased performance for the low-evel API but at the cost of increased complexity of code. What are the concrete differences and are there any significant things which you cannot do with the high-level API?

                  我正在使用 CUDA.net 與 C# 進行互操作,它是作為驅(qū)動程序 API 的副本構(gòu)建的.這鼓勵在 C# 中編寫大量相當復(fù)雜的代碼,而使用運行時 API 的 C++ 等效代碼會更簡單.這樣做有什么好處嗎?我可以看到的一個好處是更容易將智能錯誤處理與其他 C# 代碼集成.

                  I am using CUDA.net for interop with C# and it is built as a copy of the driver API. This encourages writing a lot of rather complex code in C# while the C++ equivalent would be more simple using the runtime API. Is there anything to win by doing it this way? The one benefit I can see is that it is easier to integrate intelligent error handling with the rest of the C# code.

                  推薦答案

                  CUDA 運行時可以將您的 CUDA 內(nèi)核編譯和鏈接到可執(zhí)行文件中.這意味著您不必將 cubin 文件與您的應(yīng)用程序一起分發(fā),或者處理通過驅(qū)動程序 API 加載它們.正如您所指出的,它通常更易于使用.

                  The CUDA runtime makes it possible to compile and link your CUDA kernels into executables. This means that you don't have to distribute cubin files with your application, or deal with loading them through the driver API. As you have noted, it is generally easier to use.

                  相比之下,驅(qū)動程序 API 更難編程,但可以更好地控制 CUDA 的使用方式.程序員必須直接處理初始化、模塊加載等.

                  In contrast, the driver API is harder to program but provided more control over how CUDA is used. The programmer has to directly deal with initialization, module loading, etc.

                  顯然,通過驅(qū)動程序 API 可以查詢比通過運行時 API 更詳細的設(shè)備信息.例如,設(shè)備上可用的空閑內(nèi)存只能通過驅(qū)動程序 API 查詢.

                  Apparently more detailed device information can be queried through the driver API than through the runtime API. For instance, the free memory available on the device can be queried only through the driver API.

                  來自 CUDA 程序員指南:

                  From the CUDA Programmer's Guide:

                  它由兩個API組成:

                  • 一種稱為 CUDA 驅(qū)動程序 API 的低級 API,
                  • 一種稱為 CUDA 運行時 API 的高級 API,它在CUDA 驅(qū)動程序 API.

                  這些 API 是互斥的:應(yīng)用程序應(yīng)該使用其中一個或其他.

                  These APIs are mutually exclusive: An application should use either one or the other.

                  CUDA 運行時通過提供隱式來簡化設(shè)備代碼管理初始化、上下文管理和模塊管理.C 主機代碼nvcc 生成的基于 CUDA 運行時(參見第 4.2.5 節(jié)),所以鏈接到此代碼的應(yīng)用程序必須使用 CUDA 運行時 API.

                  The CUDA runtime eases device code management by providing implicit initialization, context management, and module management. The C host code generated by nvcc is based on the CUDA runtime (see Section 4.2.5), so applications that link to this code must use the CUDA runtime API.

                  相比之下,CUDA 驅(qū)動程序 API 需要更多代碼,更難編程和調(diào)試,但提供了更好的控制水平并且與語言無關(guān),因為它只處理 cubin 對象(參見第 4.2.5 節(jié)).尤其是更難使用 CUDA 驅(qū)動程序 API 配置和啟動內(nèi)核,因為執(zhí)行必須使用顯式函數(shù)調(diào)用指定配置和內(nèi)核參數(shù)而不是第 4.2.3 節(jié)中描述的執(zhí)行配置語法.此外,設(shè)備仿真(參見第 4.5.2.9 節(jié))不適用于 CUDA 驅(qū)動程序 API.

                  In contrast, the CUDA driver API requires more code, is harder to program and debug, but offers a better level of control and is language-independent since it only deals with cubin objects (see Section 4.2.5). In particular, it is more difficult to configure and launch kernels using the CUDA driver API, since the execution configuration and kernel parameters must be specified with explicit function calls instead of the execution configuration syntax described in Section 4.2.3. Also, device emulation (see Section 4.5.2.9) does not work with the CUDA driver API.

                  API 之間沒有明顯的性能差異.你的內(nèi)核如何使用內(nèi)存以及它們在 GPU 上的布局方式(在扭曲和塊中)將產(chǎn)生更明顯的效果.

                  There is no noticeable performance difference between the API's. How your kernels use memory and how they are laid out on the GPU (in warps and blocks) will have a much more pronounced effect.

                  這篇關(guān)于CUDA 驅(qū)動程序 API 與 CUDA 運行時的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  Ignore whitespace while reading XML(讀取 XML 時忽略空格)
                  XML to LINQ with Checking Null Elements(帶有檢查空元素的 XML 到 LINQ)
                  Reading XML with unclosed tags in C#(在 C# 中讀取帶有未閉合標簽的 XML)
                  Parsing tables, cells with Html agility in C#(在 C# 中使用 Html 敏捷性解析表格、單元格)
                  delete element from xml using LINQ(使用 LINQ 從 xml 中刪除元素)
                  Parse malformed XML(解析格式錯誤的 XML)
                2. <i id='N9zzI'><tr id='N9zzI'><dt id='N9zzI'><q id='N9zzI'><span id='N9zzI'><b id='N9zzI'><form id='N9zzI'><ins id='N9zzI'></ins><ul id='N9zzI'></ul><sub id='N9zzI'></sub></form><legend id='N9zzI'></legend><bdo id='N9zzI'><pre id='N9zzI'><center id='N9zzI'></center></pre></bdo></b><th id='N9zzI'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='N9zzI'><tfoot id='N9zzI'></tfoot><dl id='N9zzI'><fieldset id='N9zzI'></fieldset></dl></div>

                  <legend id='N9zzI'><style id='N9zzI'><dir id='N9zzI'><q id='N9zzI'></q></dir></style></legend>

                  1. <small id='N9zzI'></small><noframes id='N9zzI'>

                      <tbody id='N9zzI'></tbody>

                        • <bdo id='N9zzI'></bdo><ul id='N9zzI'></ul>
                          <tfoot id='N9zzI'></tfoot>

                            主站蜘蛛池模板: 日韩欧美一二三区 | 毛片一区二区三区 | 久久久www | 四虎影音 | 五月婷婷视频 | 亚洲精品一区二区三区丝袜 | 成人在线一区二区三区 | 久久综合久 | 久久久久久精 | 亚洲欧美一区二区三区1000 | 在线免费观看黄色 | 伊人网一区 | 99精品久久99久久久久 | 久久精品久久久久久 | 亚洲精色 | 在线看片网站 | 精品国产成人 | 99精品欧美一区二区三区综合在线 | 欧美日韩高清一区 | 成人午夜免费福利视频 | 欧美区日韩区 | 精品一区二区三 | 91看片在线观看 | 91国内精品久久 | 精品久久久久久久久久久院品网 | 欧美性一区二区三区 | 免费在线观看一区二区三区 | 四虎成人免费电影 | 7777奇米影视 | 免费国产一区 | 精品国产一区二区在线 | 久久久中文| 黄色免费看| 国产三级日本三级 | 精品美女 | 一级片网站视频 | 欧美一区二区三区久久精品 | 国产伦一区二区三区四区 | 色免费在线视频 | 成人一区二区三区在线观看 | 久久久久久久久久久国产 |