Skip to content

Commit b3f4c38

Browse files
committed
Replace pragma once with header guard
1 parent ddc4d81 commit b3f4c38

File tree

6 files changed

+24
-6
lines changed

6 files changed

+24
-6
lines changed
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
#pragma once
1+
#ifndef CACHEFLOW_ATTENTION_ATTENTION_DTYPES_H_
2+
#define CACHEFLOW_ATTENTION_ATTENTION_DTYPES_H_
23

34
#include "attention_generic.cuh"
45
#include "dtype_float16.cuh"
56
#include "dtype_float32.cuh"
7+
8+
#endif // CACHEFLOW_ATTENTION_ATTENTION_DTYPES_H_

csrc/attention/attention_generic.cuh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#pragma once
1+
#ifndef CACHEFLOW_ATTENTION_ATTENTION_GENERIC_H_
2+
#define CACHEFLOW_ATTENTION_ATTENTION_GENERIC_H_
23

34
#include <stdint.h>
45

@@ -45,3 +46,5 @@ inline __device__ void zero(T& dst) {
4546
}
4647

4748
} // namespace cacheflow
49+
50+
#endif // CACHEFLOW_ATTENTION_ATTENTION_GENERIC_H_

csrc/attention/attention_utils.cuh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#pragma once
1+
#ifndef CACHEFLOW_ATTENTION_ATTENTION_UTILS_H_
2+
#define CACHEFLOW_ATTENTION_ATTENTION_UTILS_H_
23

34
#include "attention_dtypes.cuh"
45

@@ -36,3 +37,5 @@ struct Qk_dot {
3637
};
3738

3839
} // namespace cacheflow
40+
41+
#endif // CACHEFLOW_ATTENTION_ATTENTION_UTILS_H_

csrc/attention/dtype_float16.cuh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#pragma once
1+
#ifndef CACHEFLOW_ATTENTION_DTYPE_FLOAT16_H_
2+
#define CACHEFLOW_ATTENTION_DTYPE_FLOAT16_H_
23

34
#include "attention_generic.cuh"
45
#include "dtype_float32.cuh"
@@ -424,3 +425,5 @@ inline __device__ Float8_ to_float(uint4 u) {
424425
}
425426

426427
} // namespace cacheflow
428+
429+
#endif // CACHEFLOW_ATTENTION_DTYPE_FLOAT16_H_

csrc/attention/dtype_float32.cuh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#pragma once
1+
#ifndef CACHEFLOW_ATTENTION_DTYPE_FLOAT32_H_
2+
#define CACHEFLOW_ATTENTION_DTYPE_FLOAT32_H_
23

34
#include "attention_generic.cuh"
45

@@ -248,3 +249,5 @@ inline __device__ Float8_ to_float(Float8_ u) {
248249
}
249250

250251
} // namespace cacheflow
252+
253+
#endif // CACHEFLOW_ATTENTION_DTYPE_FLOAT32_H_

csrc/reduction_utils.cuh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#pragma once
1+
#ifndef CACHEFLOW_REDUCTION_UTILS_H_
2+
#define CACHEFLOW_REDUCTION_UTILS_H_
23

34
namespace cacheflow {
45

@@ -32,3 +33,5 @@ __inline__ __device__ T blockReduceSum(T val) {
3233
}
3334

3435
} // namespace cacheflow
36+
37+
#endif // CACHEFLOW_REDUCTION_UTILS_H_

0 commit comments

Comments
 (0)