Skip to content

Commit 929a122

Browse files
committed
Make KERNEL_FLOAT_FP8_AVAILABLE only available in CUDA 12
1 parent 0ae5853 commit 929a122

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

include/kernel_float/macros.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,12 @@
3232
#endif
3333

3434
#ifndef KERNEL_FLOAT_FP8_AVAILABLE
35+
#ifdef __CUDACC_VER_MAJOR__
36+
#define KERNEL_FLOAT_FP8_AVAILABLE (__CUDACC_VER_MAJOR__ >= 12)
37+
#else
3538
#define KERNEL_FLOAT_FP8_AVAILABLE (0)
3639
#endif
40+
#endif
3741

3842
#define KERNEL_FLOAT_ASSERT(expr) \
3943
do { \

single_include/kernel_float.h

Lines changed: 6 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: 2023-09-28 11:56:39.597009
20-
// git hash: f2078d86464553ef3c024dde759e5c4ab46fdf6e
19+
// date: 2023-09-28 12:12:55.542179
20+
// git hash: 0ae5853b782118d9842541588429b4aec7ff186a
2121
//================================================================================
2222

2323
#ifndef KERNEL_FLOAT_MACROS_H
@@ -54,8 +54,12 @@
5454
#endif
5555

5656
#ifndef KERNEL_FLOAT_FP8_AVAILABLE
57+
#ifdef __CUDACC_VER_MAJOR__
58+
#define KERNEL_FLOAT_FP8_AVAILABLE (__CUDACC_VER_MAJOR__ >= 12)
59+
#else
5760
#define KERNEL_FLOAT_FP8_AVAILABLE (0)
5861
#endif
62+
#endif
5963

6064
#define KERNEL_FLOAT_ASSERT(expr) \
6165
do { \

tests/common.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
#include <cstdint>
77

88
#include "catch2/catch_all.hpp"
9-
10-
#define KERNEL_FLOAT_FP8_AVAILABLE (1)
119
#include "kernel_float.h"
1210

1311
namespace kf = kernel_float;

0 commit comments

Comments
 (0)