Skip to content

Commit

Permalink
Remove prelude
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnh committed Jul 22, 2024
1 parent 4278106 commit 986ca55
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 48 deletions.
1 change: 0 additions & 1 deletion docs/guides.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ Guides

guides/introduction.rst
guides/promotion.rst
guides/prelude.rst
guides/constant.rst
42 changes: 0 additions & 42 deletions docs/guides/prelude.md

This file was deleted.

2 changes: 1 addition & 1 deletion examples/vector_add/main.cu
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <vector>

#include "kernel_float.h"
using namespace kernel_float::prelude;
namespace kf = kernel_float;

void cuda_check(cudaError_t code) {
if (code != cudaSuccess) {
Expand Down
2 changes: 1 addition & 1 deletion examples/vector_add_tiling/main.cu
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "kernel_float.h"
#include "kernel_float/tiling.h"
using namespace kernel_float::prelude;
namespace kf = kernel_float;

void cuda_check(cudaError_t code) {
if (code != cudaSuccess) {
Expand Down
2 changes: 1 addition & 1 deletion include/kernel_float.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
#include "kernel_float/base.h"
#include "kernel_float/bf16.h"
#include "kernel_float/binops.h"
#include "kernel_float/constant.h"
#include "kernel_float/conversion.h"
#include "kernel_float/fp16.h"
#include "kernel_float/iterate.h"
#include "kernel_float/macros.h"
#include "kernel_float/memory.h"
#include "kernel_float/meta.h"
#include "kernel_float/prelude.h"
#include "kernel_float/reduce.h"
#include "kernel_float/triops.h"
#include "kernel_float/unops.h"
Expand Down
1 change: 1 addition & 0 deletions include/kernel_float/bf16.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ KERNEL_FLOAT_BF16_CAST(
#endif

using bfloat16 = __nv_bfloat16;
KERNEL_FLOAT_VECTOR_ALIAS(bfloat16x, __nv_bfloat16)
//KERNEL_FLOAT_TYPE_ALIAS(float16x, __nv_bfloat16)
//KERNEL_FLOAT_TYPE_ALIAS(f16x, __nv_bfloat16)

Expand Down
1 change: 1 addition & 0 deletions include/kernel_float/fp16.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ KERNEL_FLOAT_FP16_CAST(unsigned long, __ull2half_rn(input), (unsigned long)(__ha
KERNEL_FLOAT_FP16_CAST(unsigned long long, __ull2half_rn(input), __half2ull_rz(input));

using half = __half;
KERNEL_FLOAT_VECTOR_ALIAS(half, __half)
//KERNEL_FLOAT_TYPE_ALIAS(float16x, __half)
//KERNEL_FLOAT_TYPE_ALIAS(f16x, __half)

Expand Down
15 changes: 15 additions & 0 deletions include/kernel_float/vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,21 @@ template<typename T> using vec7 = vec<T, 7>;
template<typename T> using vec8 = vec<T, 8>;
// clang-format on

#define KERNEL_FLOAT_VECTOR_ALIAS(NAME, T) \
template<size_t N> \
using NAME##1 = vec<T, 1>; \
using NAME##2 = vec<T, 2>; \
using NAME##3 = vec<T, 3>; \
using NAME##4 = vec<T, 4>; \
using NAME##5 = vec<T, 5>; \
using NAME##6 = vec<T, 6>; \
using NAME##7 = vec<T, 7>; \
using NAME##8 = vec<T, 8>;

KERNEL_FLOAT_VECTOR_ALIAS(int, int)
KERNEL_FLOAT_VECTOR_ALIAS(float, float)
KERNEL_FLOAT_VECTOR_ALIAS(double, double)

/**
* Create a vector from a variable number of input values.
*
Expand Down
21 changes: 19 additions & 2 deletions single_include/kernel_float.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

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

#ifndef KERNEL_FLOAT_MACROS_H
Expand Down Expand Up @@ -3853,6 +3853,21 @@ template<typename T> using vec7 = vec<T, 7>;
template<typename T> using vec8 = vec<T, 8>;
// clang-format on

#define KERNEL_FLOAT_VECTOR_ALIAS(NAME, T) \
template<size_t N> \
using NAME##1 = vec<T, 1>; \
using NAME##2 = vec<T, 2>; \
using NAME##3 = vec<T, 3>; \
using NAME##4 = vec<T, 4>; \
using NAME##5 = vec<T, 5>; \
using NAME##6 = vec<T, 6>; \
using NAME##7 = vec<T, 7>; \
using NAME##8 = vec<T, 8>;

KERNEL_FLOAT_VECTOR_ALIAS(int, int)
KERNEL_FLOAT_VECTOR_ALIAS(float, float)
KERNEL_FLOAT_VECTOR_ALIAS(double, double)

/**
* Create a vector from a variable number of input values.
*
Expand Down Expand Up @@ -4060,6 +4075,7 @@ KERNEL_FLOAT_FP16_CAST(unsigned long, __ull2half_rn(input), (unsigned long)(__ha
KERNEL_FLOAT_FP16_CAST(unsigned long long, __ull2half_rn(input), __half2ull_rz(input));

using half = __half;
KERNEL_FLOAT_VECTOR_ALIAS(half, __half)
//KERNEL_FLOAT_TYPE_ALIAS(float16x, __half)
//KERNEL_FLOAT_TYPE_ALIAS(f16x, __half)

Expand Down Expand Up @@ -4293,6 +4309,7 @@ KERNEL_FLOAT_BF16_CAST(
#endif

using bfloat16 = __nv_bfloat16;
KERNEL_FLOAT_VECTOR_ALIAS(bfloat16x, __nv_bfloat16)
//KERNEL_FLOAT_TYPE_ALIAS(float16x, __nv_bfloat16)
//KERNEL_FLOAT_TYPE_ALIAS(f16x, __nv_bfloat16)

Expand Down

0 comments on commit 986ca55

Please sign in to comment.