Skip to content

Commit d657c77

Browse files
authored
ADM's Heterogeneous-computing Interface for Portability API, similar to CUDA. See AcademySoftwareFoundation#462. Signed-off-by: Cary Phillips <cary@ilm.com>
1 parent 0b6e3db commit d657c77

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

config/ImathConfig.h.in

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,11 @@
9898
#endif
9999

100100
//
101-
// Decorator that makes a function available for both CPU and GPU, when
102-
// compiling for Cuda.
101+
// Decorator that makes a function available for both CPU and GPU,
102+
// when compiling for Cuda or HIP (AMD's Heterogeneous-computing
103+
// Interface for Portability).
103104
//
104-
#ifdef __CUDACC__
105+
#if defined(__CUDACC__) || defined(__HIP__)
105106
# define IMATH_HOSTDEVICE __host__ __device__
106107
#else
107108
# define IMATH_HOSTDEVICE

src/Imath/ImathRoots.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222

2323
/// @cond Doxygen_Suppress
2424

25-
#ifdef __CUDACC__
25+
// If CUDA or HIP (AMD's Heterogeneous-computing Interface for
26+
// Portability), use the thrust complex library
27+
#if defined(__CUDACC__) || defined(__HIP__)
2628
# include <thrust/complex.h>
2729
# define COMPLEX_NAMESPACE thrust
2830
#else

0 commit comments

Comments
 (0)