Skip to content

Commit f9b20bf

Browse files
badermaarquitos14
andauthored
[SYCL][NVPTX][AMDGCN] Move std::complex to headers (#19572)
This follows 4f0afd5 and moves implementation of std::complex operations from libdevice to a header. --------- Co-authored-by: Marcos Maronas <[email protected]>
1 parent 0dc91aa commit f9b20bf

File tree

8 files changed

+972
-10
lines changed

8 files changed

+972
-10
lines changed

libdevice/complex_wrapper.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88

99
#include "device_complex.h"
1010

11-
#if defined(__SPIR__) || defined(__SPIRV__) || defined(__NVPTX__) || \
12-
defined(__AMDGCN__)
11+
#if defined(__SPIR__) || defined(__SPIRV__)
1312

1413
DEVICE_EXTERN_C_INLINE
1514
float cimagf(float __complex__ z) { return __devicelib_cimagf(z); }

libdevice/complex_wrapper_fp64.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99

1010
#include "device_complex.h"
1111

12-
#if defined(__SPIR__) || defined(__SPIRV__) || defined(__NVPTX__) || \
13-
defined(__AMDGCN__)
12+
#if defined(__SPIR__) || defined(__SPIRV__)
1413

1514
DEVICE_EXTERN_C_INLINE
1615
double cimag(double __complex__ z) { return __devicelib_cimag(z); }

libdevice/device_complex.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010

1111
#include "device.h"
1212

13-
#if defined(__SPIR__) || defined(__SPIRV__) || defined(__NVPTX__) || \
14-
defined(__AMDGCN__)
13+
#if defined(__SPIR__) || defined(__SPIRV__)
1514

1615
// TODO: This needs to be more robust.
1716
// clang doesn't recognize the c11 CMPLX macro, but it does have

libdevice/fallback-complex-fp64.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99

1010
#include "device_complex.h"
1111

12-
#if defined(__SPIR__) || defined(__SPIRV__) || defined(__NVPTX__) || \
13-
defined(__AMDGCN__)
12+
#if defined(__SPIR__) || defined(__SPIRV__)
1413
#include <cmath>
1514

1615
// To support fallback device libraries on-demand loading, please update the

libdevice/fallback-complex.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88

99
#include "device_complex.h"
1010

11-
#if defined(__SPIR__) || defined(__SPIRV__) || defined(__NVPTX__) || \
12-
defined(__AMDGCN__)
11+
#if defined(__SPIR__) || defined(__SPIRV__)
1312
#include <cmath>
1413

1514
// To support fallback device libraries on-demand loading, please update the

0 commit comments

Comments
 (0)