Skip to content

Commit de54eb0

Browse files
committed
performance-enum-size
1 parent 127766a commit de54eb0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+135
-86
lines changed

c/experimental/stf/include/cccl/c/experimental/stf/stf.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@
6565

6666
#pragma once
6767

68+
// NOLINTBEGIN
69+
6870
#ifndef CCCL_C_EXPERIMENTAL
6971
# error "C exposure is experimental and subject to change. Define CCCL_C_EXPERIMENTAL to acknowledge this notice."
7072
#endif // !CCCL_C_EXPERIMENTAL
@@ -1403,3 +1405,5 @@ void* stf_host_launch_deps_get_user_data(stf_host_launch_deps_handle deps);
14031405
#ifdef __cplusplus
14041406
}
14051407
#endif
1408+
1409+
// NOLINTEND

c/parallel/include/cccl/c/types.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
#pragma once
1212

13+
// NOLINTBEGIN
14+
1315
#ifndef CCCL_C_EXPERIMENTAL
1416
# error "C exposure is experimental and subject to change. Define CCCL_C_EXPERIMENTAL to acknowledge this notice."
1517
#endif // !CCCL_C_EXPERIMENTAL
@@ -175,3 +177,5 @@ typedef enum cccl_binary_search_mode_t
175177
} cccl_binary_search_mode_t;
176178

177179
CCCL_C_EXTERN_C_END
180+
181+
// NOLINTEND

c/parallel/test/test_util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ struct iterator_t
868868
}
869869
};
870870

871-
enum class iterator_kind
871+
enum class iterator_kind : std::uint8_t
872872
{
873873
INPUT = 0,
874874
OUTPUT = 1,

cub/cub/agent/agent_radix_sort_onesweep.cuh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include <cuda/std/__type_traits/conditional.h>
3434
#include <cuda/std/__type_traits/integral_constant.h>
3535
#include <cuda/std/__type_traits/is_same.h>
36+
#include <cuda/std/cstdint>
3637

3738
#if !_CCCL_COMPILER(NVRTC)
3839
# include <ostream>
@@ -45,7 +46,7 @@ CUB_NAMESPACE_BEGIN
4546
* memory. Currently applies only to writing 4B keys in full tiles; in all other cases,
4647
* RADIX_SORT_STORE_DIRECT is used.
4748
*/
48-
enum RadixSortStoreAlgorithm
49+
enum RadixSortStoreAlgorithm : ::cuda::std::uint8_t
4950
{
5051
/** \brief Elements are statically distributed among block threads, which write them
5152
* into the appropriate partition in global memory. This results in fewer instructions

cub/cub/agent/agent_select_if.cuh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ struct AgentSelectIf
242242
using FlagT = it_value_t<FlagsInputIteratorT>;
243243

244244
// Constants
245-
enum
245+
enum : ::cuda::std::uint8_t
246246
{
247247
USE_SELECT_OP,
248248
USE_SELECT_FLAGS,

cub/cub/agent/single_pass_scan_operators.cuh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <cuda/std/__type_traits/conditional.h>
3333
#include <cuda/std/__type_traits/enable_if.h>
3434
#include <cuda/std/__type_traits/is_trivially_copyable.h>
35+
#include <cuda/std/cstdint>
3536

3637
#include <nv/target>
3738

@@ -94,7 +95,7 @@ struct BlockScanRunningPrefixOp
9495
/**
9596
* Enumerations of tile status
9697
*/
97-
enum ScanTileStatus
98+
enum ScanTileStatus : ::cuda::std::uint8_t
9899
{
99100
SCAN_TILE_OOB, // Out-of-bounds (e.g., padding)
100101
SCAN_TILE_INVALID = 99, // Not yet processed
@@ -105,7 +106,7 @@ enum ScanTileStatus
105106
/**
106107
* Enum class used for specifying the memory order that shall be enforced while reading and writing the tile status.
107108
*/
108-
enum class MemoryOrder
109+
enum class MemoryOrder : ::cuda::std::uint8_t
109110
{
110111
// Uses relaxed loads when reading a tile's status and relaxed stores when updating a tile's status
111112
relaxed,

cub/cub/block/block_load.cuh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <cub/util_type.cuh>
2424

2525
#include <cuda/std/__new/device_new.h>
26+
#include <cuda/std/cstdint>
2627

2728
#if !_CCCL_COMPILER(NVRTC)
2829
# include <ostream>
@@ -605,7 +606,7 @@ _CCCL_DEVICE _CCCL_FORCEINLINE void LoadDirectWarpStriped(
605606

606607
//! @brief cub::BlockLoadAlgorithm enumerates alternative algorithms for cub::BlockLoad to read a linear segment of data
607608
//! from memory into a blocked arrangement across a CUDA thread block.
608-
enum BlockLoadAlgorithm
609+
enum BlockLoadAlgorithm : ::cuda::std::uint8_t
609610
{
610611
//! @rst
611612
//! Overview

cub/cub/block/block_load_to_shared.cuh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ private:
9292
};
9393

9494
#ifdef CCCL_ENABLE_DEVICE_ASSERTIONS
95-
enum struct State
95+
enum struct State : ::cuda::std::uint8_t
9696
{
9797
ready_to_copy,
9898
ready_to_copy_or_commit,

cub/cub/block/block_radix_rank.cuh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ CUB_NAMESPACE_BEGIN
4545
//! @brief Radix ranking algorithm, the algorithm used to implement stable ranking of the
4646
//! keys from a single tile. Note that different ranking algorithms require different
4747
//! initial arrangements of keys to function properly.
48-
enum RadixRankAlgorithm
48+
enum RadixRankAlgorithm : ::cuda::std::uint8_t
4949
{
5050
//! Ranking using the BlockRadixRank algorithm with `MemoizeOuterScan == false`.
5151
//! It uses thread-private histograms, and thus uses more shared memory.
@@ -870,7 +870,7 @@ public:
870870
//! @}
871871
};
872872

873-
enum WarpMatchAlgorithm
873+
enum WarpMatchAlgorithm : ::cuda::std::uint8_t
874874
{
875875
WARP_MATCH_ANY,
876876
WARP_MATCH_ATOMIC_OR

cub/cub/block/block_reduce.cuh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
#include <cuda/std/__functional/operations.h>
2929
#include <cuda/std/__type_traits/conditional.h>
30+
#include <cuda/std/cstdint>
3031

3132
#if !_CCCL_COMPILER(NVRTC)
3233
# include <ostream>
@@ -40,7 +41,7 @@ CUB_NAMESPACE_BEGIN
4041

4142
//! BlockReduceAlgorithm enumerates alternative algorithms for parallel reduction across a CUDA thread
4243
//! block.
43-
enum BlockReduceAlgorithm
44+
enum BlockReduceAlgorithm : ::cuda::std::uint8_t
4445
{
4546

4647
//! @rst

0 commit comments

Comments
 (0)