Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[ENHANCEMENT]: Including cuco datastructures declarations for non-CUDA compilers.

オープン
#232 コメント 10 件 リアクション 1 件 担当者 1 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@sleeepyjack がすでに取り組んでいます。

2023年10月12日 から。

評価

この issue はまだ評価されていません。

説明

P1: Should have type: feature request
Is your feature request related to a problem? Please describe.

I would like to be able to have a declaration of the cuco datastructures available without having to compile the definition using CUDA so that they can be used in .hpp or .cpp files. At the moment, if you need a forward declaration you need to include all the default template arguments. The compiler doesn't allow redefinition of the default template arguments, even when they are the same as in the .cuh file.

Describe the solution you'd like

Split the .cuh files into .hpp and an .inl. This way one can include either .hpp only for the declarations or .cuh for both the declarations and the definitions.

The .cuh file becomes:

#pragma once

#include <<data_structure>.hpp>
#include <cuco/detail/<data_structure>.inl>

I'm not sure this is that trivial as there may be cuda specific keywords in the declarations like device, device and so on.

Alternatively, the hpp file only contains the highest level declarations + default template value declarations. Then the only change to the current .cuh files would have to be to leave out these defaults in addition to the extra line:

#include <<data_structure>.hpp>

Describe alternatives you've considered

Currently, forward declare the data structure with all its template arguments including those with default values and copy-paste their default values from the .cuh file into your declarations. Obviously, this is not ideal.

Additional context

This is in particular convenient for larger codebases.

Any cpp file that depends on the cuco data structure through nested includes will run into this problem.

主要言語
Cuda
スター
671
フォーク
122
平均マージ
4日 19時間
マージ済み PR(30日)
10

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

NVIDIA/cuCollections のほかの issue

NVIDIA/cuCollections の issue をすべて見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。