File tree Expand file tree Collapse file tree 10 files changed +20
-10
lines changed
src/__support/macros/properties Expand file tree Collapse file tree 10 files changed +20
-10
lines changed Original file line number Diff line number Diff line change 1
- foreach (target nvptx amdgpu )
1
+ foreach (target nvptx amdgpu spirv64 )
2
2
add_subdirectory (${target} )
3
3
list (APPEND target_gpu_timing libc.benchmarks.gpu.timing.${target}.${target}_timing )
4
4
endforeach ()
Original file line number Diff line number Diff line change 15
15
#include " amdgpu/timing.h"
16
16
#elif defined(LIBC_TARGET_ARCH_IS_NVPTX)
17
17
#include " nvptx/timing.h"
18
+ #elif defined(LIBC_TARGET_ARCH_IS_SPIRV)
19
+ #include " spirv64/timing.h"
18
20
#else
19
21
#error "unsupported platform"
20
22
#endif
Original file line number Diff line number Diff line change @@ -73,7 +73,8 @@ function(get_arch_and_system_from_triple triple arch_var sys_var)
73
73
74
74
# Setting OS name for GPU architectures.
75
75
list (GET triple_comps -1 gpu_target_sys )
76
- if (gpu_target_sys MATCHES "^amdhsa" OR gpu_target_sys MATCHES "^cuda" )
76
+ if (gpu_target_sys MATCHES "^amdhsa" OR gpu_target_sys MATCHES "^cuda" OR
77
+ gpu_target_sys MATCHES "^opencl" )
77
78
set (target_sys "gpu" )
78
79
endif ()
79
80
Original file line number Diff line number Diff line change 42
42
#define FP_LLOGBNAN LONG_MAX
43
43
#endif
44
44
45
- #if defined(__NVPTX__ ) || defined(__AMDGPU__ ) || defined(__FAST_MATH__ )
45
+ #if defined(__NVPTX__ ) || defined(__AMDGPU__ ) || defined(__SPIRV__ ) || \
46
+ defined(__FAST_MATH__ )
46
47
#define math_errhandling 0
47
48
#elif defined(__NO_MATH_ERRNO__ )
48
49
#define math_errhandling (MATH_ERREXCEPT)
Original file line number Diff line number Diff line change 11
11
12
12
#if defined(__linux__ )
13
13
#include "linux/signal-macros.h"
14
- #elif defined(__NVPTX__ ) || defined(__AMDGPU__ )
14
+ #elif defined(__NVPTX__ ) || defined(__AMDGPU__ ) || defined( __SPIRV__ )
15
15
#include "gpu/signal-macros.h"
16
16
#endif
17
17
Original file line number Diff line number Diff line change 1
1
#ifndef LLVM_LIBC_MACROS_TIME_MACROS_H
2
2
#define LLVM_LIBC_MACROS_TIME_MACROS_H
3
3
4
- #if defined(__AMDGPU__ ) || defined(__NVPTX__ )
4
+ #if defined(__AMDGPU__ ) || defined(__NVPTX__ ) || defined( __SPIRV__ )
5
5
#include "gpu/time-macros.h"
6
6
#elif defined(__linux__ )
7
7
#include "linux/time-macros.h"
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ typedef struct {
25
25
} fenv_t ;
26
26
#elif defined(__riscv )
27
27
typedef unsigned int fenv_t ;
28
- #elif defined(__AMDGPU__ ) || defined(__NVPTX__ )
28
+ #elif defined(__AMDGPU__ ) || defined(__NVPTX__ ) || defined( __SPIRV__ )
29
29
typedef struct {
30
30
unsigned int __fpc ;
31
31
} fenv_t ;
Original file line number Diff line number Diff line change 12
12
#include < stddef.h>
13
13
#include < stdint.h>
14
14
15
- #if (defined(__NVPTX__) || defined(__AMDGPU__)) && \
15
+ #if (defined(__NVPTX__) || defined(__AMDGPU__) || defined(__SPIRV__)) && \
16
16
!((defined(__CUDA__) && !defined(__CUDA_ARCH__)) || \
17
17
(defined(__HIP__) && !defined(__HIP_DEVICE_COMPILE__)))
18
18
#include < gpuintrin.h>
Original file line number Diff line number Diff line change 17
17
#define LIBC_TARGET_ARCH_IS_NVPTX
18
18
#endif
19
19
20
- #if defined(LIBC_TARGET_ARCH_IS_NVPTX) || defined(LIBC_TARGET_ARCH_IS_AMDGPU)
20
+ #if defined(__SPIRV__)
21
+ #define LIBC_TARGET_ARCH_IS_SPIRV
22
+ #endif
23
+
24
+ #if defined(LIBC_TARGET_ARCH_IS_NVPTX) || \
25
+ defined (LIBC_TARGET_ARCH_IS_AMDGPU) || defined(LIBC_TARGET_ARCH_IS_SPIRV)
21
26
#define LIBC_TARGET_ARCH_IS_GPU
22
27
#endif
23
28
Original file line number Diff line number Diff line change 75
75
#endif // LIBC_TARGET_CPU_HAS_RISCV_FPU_DOUBLE
76
76
#endif // __riscv_flen
77
77
78
- #if defined(__NVPTX__) || defined(__AMDGPU__)
78
+ #if defined(__NVPTX__) || defined(__AMDGPU__) || defined(__SPIRV__)
79
79
#define LIBC_TARGET_CPU_HAS_FPU_FLOAT
80
80
#define LIBC_TARGET_CPU_HAS_FPU_DOUBLE
81
81
#endif
82
82
83
83
#if defined(__ARM_FEATURE_FMA) || (defined(__AVX2__) && defined(__FMA__)) || \
84
- defined (__NVPTX__) || defined(__AMDGPU__) || defined(__LIBC_RISCV_USE_FMA)
84
+ defined (__NVPTX__) || defined(__AMDGPU__) || defined(__SPIRV__) || \
85
+ defined(__LIBC_RISCV_USE_FMA)
85
86
#define LIBC_TARGET_CPU_HAS_FMA
86
87
// Provide a more fine-grained control of FMA instruction for ARM targets.
87
88
#if defined(LIBC_TARGET_CPU_HAS_FPU_HALF)
You can’t perform that action at this time.
0 commit comments