Skip to content

Commit 9133f46

Browse files
TimDettmersclaude
andcommitted
Apply clang-format formatting fixes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 32cd056 commit 9133f46

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

csrc/compat.cuh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626
#if BNB_HIP
2727

28-
#include <hip/hip_fp16.h>
2928
#include <hip/hip_bfloat16.h>
29+
#include <hip/hip_fp16.h>
3030
#include <hip/hip_math_constants.h>
3131
#include <hip/hip_runtime.h>
3232
#include <hipblas/hipblas.h>
@@ -94,7 +94,9 @@ using bnb_error_t = cudaError_t;
9494
// ============================================================================
9595

9696
#if BNB_HIP
97-
#define __syncwarp() do {} while(0)
97+
#define __syncwarp() \
98+
do { \
99+
} while (0)
98100
#endif
99101

100102
// ============================================================================

csrc/kernels.cu

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -331,19 +331,16 @@ __global__ void kQuantizeBlockwise(
331331
// block_dim=32 (from BLOCK_SIZE=64/NUM_PER_TH=2) is too small. Fall back
332332
// to DIRECT load/store in that case.
333333
static constexpr int THREADS = BLOCK_SIZE / NUM_PER_TH;
334-
static constexpr auto LOAD_ALGO = (THREADS >= BNB_WARP_SIZE)
335-
? bnb_cub::BLOCK_LOAD_WARP_TRANSPOSE : bnb_cub::BLOCK_LOAD_DIRECT;
336-
static constexpr auto STORE_ALGO = (THREADS >= BNB_WARP_SIZE)
337-
? bnb_cub::BLOCK_STORE_WARP_TRANSPOSE : bnb_cub::BLOCK_STORE_DIRECT;
334+
static constexpr auto LOAD_ALGO =
335+
(THREADS >= BNB_WARP_SIZE) ? bnb_cub::BLOCK_LOAD_WARP_TRANSPOSE : bnb_cub::BLOCK_LOAD_DIRECT;
336+
static constexpr auto STORE_ALGO =
337+
(THREADS >= BNB_WARP_SIZE) ? bnb_cub::BLOCK_STORE_WARP_TRANSPOSE : bnb_cub::BLOCK_STORE_DIRECT;
338338

339339
typedef bnb_cub::BlockLoad<T, THREADS, NUM_PER_TH, LOAD_ALGO> LoadT;
340-
typedef bnb_cub::BlockStore<
341-
unsigned char, THREADS, (DATA_TYPE > 0) ? NUM_PER_TH / 2 : NUM_PER_TH,
342-
STORE_ALGO>
340+
typedef bnb_cub::BlockStore<unsigned char, THREADS, (DATA_TYPE > 0) ? NUM_PER_TH / 2 : NUM_PER_TH, STORE_ALGO>
343341
StoreChar;
344342
typedef bnb_cub::BlockReduce<float, THREADS> BlockReduce;
345-
typedef bnb_cub::BlockLoad<float, THREADS, NUM_PER_TH, LOAD_ALGO>
346-
LoadFloat;
343+
typedef bnb_cub::BlockLoad<float, THREADS, NUM_PER_TH, LOAD_ALGO> LoadFloat;
347344

348345
__shared__ typename LoadT::TempStorage loadt;
349346
__shared__ typename LoadFloat::TempStorage loadf;

csrc/ops.cuh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
#include <stdio.h>
1414
#include <vector>
1515

16+
#include "common.cuh"
1617
#include "compat.cuh"
1718
#include <common.h>
18-
#include "common.cuh"
1919

2020
// ============================================================================
2121
// Error checking helpers

0 commit comments

Comments
 (0)