Skip to content

Commit

Permalink
Merge pull request PaddlePaddle#49 from mthreads/cpp_lint
Browse files Browse the repository at this point in the history
[MTAI-484] feat(build): fix code style for cpp lint
  • Loading branch information
caizhi-mt authored and mt-robot committed Aug 16, 2023
2 parents 9f1c64b + ce74631 commit 444b726
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion paddle/phi/common/cpstring_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ HOSTDEVICE static inline uint32_t swap32(uint32_t host_int) {
}
#endif

#if PD_PSTRING_LITTLE_ENDIAN || (defined(__NVCC__) || defined(__HIPCC__) || defined(__MUSACC__))
#if PD_PSTRING_LITTLE_ENDIAN || \
(defined(__NVCC__) || defined(__HIPCC__) || defined(__MUSACC__))
#define PD_le32toh(x) x
#else // PD_PSTRING_LITTLE_ENDIAN
#define PD_le32toh(x) swap32(x)
Expand Down
10 changes: 5 additions & 5 deletions paddle/phi/kernels/funcs/embedding_grad.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ __global__ void EmbeddingGradDeterministicKernel(T* table,
unsigned long long int matchmask = // NOLINT
__ballot(match_found_this_thread); // NOLINT
int first_remaining_peer = __ffsll(matchmask) - 1;
#else // MUSA and CUDA
// If and only if match_found_this_thread of the Nth thread is non-zero,
// set the Nth bit of matchmask to 1.
#else // MUSA and CUDA
// If and only if match_found_this_thread of the Nth thread is non-zero,
// set the Nth bit of matchmask to 1.
unsigned int matchmask =
__ballot_sync(0xffffffff, match_found_this_thread);
// Find the position of the first bit set to 1 in matchmask.
Expand All @@ -112,7 +112,7 @@ __global__ void EmbeddingGradDeterministicKernel(T* table,
while (matchmask) {
#ifdef PADDLE_WITH_HIP
first_remaining_peer = __ffsll(matchmask) - 1;
#else // CUDA and MUSA
#else // CUDA and MUSA
first_remaining_peer = __ffs(matchmask) - 1;
#endif
my_s[threadIdx.x] +=
Expand Down Expand Up @@ -142,7 +142,7 @@ void LaunchEmbeddingGradDeterministicKernel(const GPUContext& ctx,
#ifdef PADDLE_WITH_HIP
constexpr int kWarpSize = 64;
constexpr int kBlockDimY = 16;
#else // CUDA and MUSA
#else // CUDA and MUSA
constexpr int kWarpSize = 32;
constexpr int kBlockDimY = 32;
#endif
Expand Down

0 comments on commit 444b726

Please sign in to comment.