<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          Libcu++NVIDIA C++ 標(biāo)準(zhǔn)庫

          聯(lián)合創(chuàng)作 · 2023-09-30 19:34

          libcu++ 是 NVIDIA 開源的 C++ 標(biāo)準(zhǔn)庫,提供了 C++ 標(biāo)準(zhǔn)庫的異構(gòu)實(shí)現(xiàn),可以在 CPU 和 GPU 代碼之間使用。如果有使用 C++ 標(biāo)準(zhǔn)庫的經(jīng)驗(yàn),相信很快就能上手 libcu++,首先需要在標(biāo)準(zhǔn)庫 includes 的開頭添加cuda/std/,在使用 std::之前添加cuda::

          #include <cuda/std/atomic>
          cuda::std::atomic<int> x;

          NVIDIA C++ 標(biāo)準(zhǔn)庫包含在 NVIDIA HPC SDK 和 CUDA 工具包中,無需額外的安裝或編譯器標(biāo)志。

          libcu++ fork 自 LLVM 的 libc++ 標(biāo)準(zhǔn)庫。作為 CUDA C++ 標(biāo)準(zhǔn)庫,libcu++ 在過去的一年里已經(jīng)初具規(guī)模,并在此后不斷改進(jìn),擁有了更多的功能。

          示例代碼

          // Standard C++, __host__ only.
          #include <atomic>
          std::atomic<int> x;
          
          // CUDA C++, __host__ __device__.
          // Strictly conforming to the C++ Standard.
          #include <cuda/std/atomic>
          cuda::std::atomic<int> x;
          
          // CUDA C++, __host__ __device__.
          // Conforming extensions to the C++ Standard.
          #include <cuda/atomic>
          cuda::atomic<int, cuda::thread_scope_block> x;
          瀏覽 39
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  亚洲图欧美色图另类色妞在线 | 中文字幕日韩视频 | 天天干天天射天天干 | 人人爱人人模人人草 | 亚洲欧美在线电影 |