Skip to content

Commit 986ca55

Browse files
committed
Remove prelude
1 parent 4278106 commit 986ca55

File tree

9 files changed

+39
-48
lines changed

9 files changed

+39
-48
lines changed

docs/guides.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ Guides
55

66
guides/introduction.rst
77
guides/promotion.rst
8-
guides/prelude.rst
98
guides/constant.rst

docs/guides/prelude.md

Lines changed: 0 additions & 42 deletions
This file was deleted.

examples/vector_add/main.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <vector>
55

66
#include "kernel_float.h"
7-
using namespace kernel_float::prelude;
7+
namespace kf = kernel_float;
88

99
void cuda_check(cudaError_t code) {
1010
if (code != cudaSuccess) {

examples/vector_add_tiling/main.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#include "kernel_float.h"
77
#include "kernel_float/tiling.h"
8-
using namespace kernel_float::prelude;
8+
namespace kf = kernel_float;
99

1010
void cuda_check(cudaError_t code) {
1111
if (code != cudaSuccess) {

include/kernel_float.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
#include "kernel_float/base.h"
55
#include "kernel_float/bf16.h"
66
#include "kernel_float/binops.h"
7+
#include "kernel_float/constant.h"
78
#include "kernel_float/conversion.h"
89
#include "kernel_float/fp16.h"
910
#include "kernel_float/iterate.h"
1011
#include "kernel_float/macros.h"
1112
#include "kernel_float/memory.h"
1213
#include "kernel_float/meta.h"
13-
#include "kernel_float/prelude.h"
1414
#include "kernel_float/reduce.h"
1515
#include "kernel_float/triops.h"
1616
#include "kernel_float/unops.h"

include/kernel_float/bf16.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ KERNEL_FLOAT_BF16_CAST(
223223
#endif
224224

225225
using bfloat16 = __nv_bfloat16;
226+
KERNEL_FLOAT_VECTOR_ALIAS(bfloat16x, __nv_bfloat16)
226227
//KERNEL_FLOAT_TYPE_ALIAS(float16x, __nv_bfloat16)
227228
//KERNEL_FLOAT_TYPE_ALIAS(f16x, __nv_bfloat16)
228229

include/kernel_float/fp16.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ KERNEL_FLOAT_FP16_CAST(unsigned long, __ull2half_rn(input), (unsigned long)(__ha
171171
KERNEL_FLOAT_FP16_CAST(unsigned long long, __ull2half_rn(input), __half2ull_rz(input));
172172

173173
using half = __half;
174+
KERNEL_FLOAT_VECTOR_ALIAS(half, __half)
174175
//KERNEL_FLOAT_TYPE_ALIAS(float16x, __half)
175176
//KERNEL_FLOAT_TYPE_ALIAS(f16x, __half)
176177

include/kernel_float/vector.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,21 @@ template<typename T> using vec7 = vec<T, 7>;
323323
template<typename T> using vec8 = vec<T, 8>;
324324
// clang-format on
325325

326+
#define KERNEL_FLOAT_VECTOR_ALIAS(NAME, T) \
327+
template<size_t N> \
328+
using NAME##1 = vec<T, 1>; \
329+
using NAME##2 = vec<T, 2>; \
330+
using NAME##3 = vec<T, 3>; \
331+
using NAME##4 = vec<T, 4>; \
332+
using NAME##5 = vec<T, 5>; \
333+
using NAME##6 = vec<T, 6>; \
334+
using NAME##7 = vec<T, 7>; \
335+
using NAME##8 = vec<T, 8>;
336+
337+
KERNEL_FLOAT_VECTOR_ALIAS(int, int)
338+
KERNEL_FLOAT_VECTOR_ALIAS(float, float)
339+
KERNEL_FLOAT_VECTOR_ALIAS(double, double)
340+
326341
/**
327342
* Create a vector from a variable number of input values.
328343
*

single_include/kernel_float.h

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
//================================================================================
1818
// this file has been auto-generated, do not modify its contents!
19-
// date: 2024-07-22 11:19:46.100972
20-
// git hash: 3b349be35a239a302f4b3fd9a366f74e48976cf5
19+
// date: 2024-07-22 11:31:53.132636
20+
// git hash: 4278106f2a14629445668d7e3684dbc8faf8b94d
2121
//================================================================================
2222

2323
#ifndef KERNEL_FLOAT_MACROS_H
@@ -3853,6 +3853,21 @@ template<typename T> using vec7 = vec<T, 7>;
38533853
template<typename T> using vec8 = vec<T, 8>;
38543854
// clang-format on
38553855

3856+
#define KERNEL_FLOAT_VECTOR_ALIAS(NAME, T) \
3857+
template<size_t N> \
3858+
using NAME##1 = vec<T, 1>; \
3859+
using NAME##2 = vec<T, 2>; \
3860+
using NAME##3 = vec<T, 3>; \
3861+
using NAME##4 = vec<T, 4>; \
3862+
using NAME##5 = vec<T, 5>; \
3863+
using NAME##6 = vec<T, 6>; \
3864+
using NAME##7 = vec<T, 7>; \
3865+
using NAME##8 = vec<T, 8>;
3866+
3867+
KERNEL_FLOAT_VECTOR_ALIAS(int, int)
3868+
KERNEL_FLOAT_VECTOR_ALIAS(float, float)
3869+
KERNEL_FLOAT_VECTOR_ALIAS(double, double)
3870+
38563871
/**
38573872
* Create a vector from a variable number of input values.
38583873
*
@@ -4060,6 +4075,7 @@ KERNEL_FLOAT_FP16_CAST(unsigned long, __ull2half_rn(input), (unsigned long)(__ha
40604075
KERNEL_FLOAT_FP16_CAST(unsigned long long, __ull2half_rn(input), __half2ull_rz(input));
40614076

40624077
using half = __half;
4078+
KERNEL_FLOAT_VECTOR_ALIAS(half, __half)
40634079
//KERNEL_FLOAT_TYPE_ALIAS(float16x, __half)
40644080
//KERNEL_FLOAT_TYPE_ALIAS(f16x, __half)
40654081

@@ -4293,6 +4309,7 @@ KERNEL_FLOAT_BF16_CAST(
42934309
#endif
42944310

42954311
using bfloat16 = __nv_bfloat16;
4312+
KERNEL_FLOAT_VECTOR_ALIAS(bfloat16x, __nv_bfloat16)
42964313
//KERNEL_FLOAT_TYPE_ALIAS(float16x, __nv_bfloat16)
42974314
//KERNEL_FLOAT_TYPE_ALIAS(f16x, __nv_bfloat16)
42984315

0 commit comments

Comments
 (0)