xpu
defines.h File Reference

Defines for xpu. More...

Go to the source code of this file.

Macros

#define XPU_IS_CPU   XPU_DETAIL_IS_CPU
 
#define XPU_IS_CUDA   XPU_DETAIL_IS_CUDA
 
#define XPU_IS_HIP   XPU_DETAIL_IS_HIP
 
#define XPU_IS_SYCL   XPU_DETAIL_IS_SYCL
 
#define XPU_IS_HIP_CUDA   (XPU_IS_CUDA || XPU_IS_HIP)
 
#define XPU_D   XPU_DETAIL_DEVICE_SPEC
 Function specifier for device functions. (Replaces device) More...
 
#define XPU_H   XPU_DETAIL_HOST_SPEC
 Function specifier for host functions. (Replaces host) More...
 
#define XPU_IS_DEVICE_CODE   XPU_DETAIL_IS_DEVICE_CODE
 Is true if the current compilation target is a device. More...
 
#define XPU_FORCE_INLINE   XPU_DETAIL_FORCE_INLINE
 
#define XPU_COMPILATION_TARGET   XPU_DETAIL_COMPILATION_TARGET
 
#define XPU_CUDA_HAS_BLOCK_ATOMICS   XPU_DETAIL_HAS_BLOCK_ATOMICS
 

Detailed Description

Defines for xpu.

Include as #include <xpu/defines.h>.

Macro Definition Documentation

◆ XPU_COMPILATION_TARGET

#define XPU_COMPILATION_TARGET   XPU_DETAIL_COMPILATION_TARGET

◆ XPU_CUDA_HAS_BLOCK_ATOMICS

#define XPU_CUDA_HAS_BLOCK_ATOMICS   XPU_DETAIL_HAS_BLOCK_ATOMICS

◆ XPU_D

#define XPU_D   XPU_DETAIL_DEVICE_SPEC

Function specifier for device functions. (Replaces device)

◆ XPU_FORCE_INLINE

#define XPU_FORCE_INLINE   XPU_DETAIL_FORCE_INLINE

◆ XPU_H

#define XPU_H   XPU_DETAIL_HOST_SPEC

Function specifier for host functions. (Replaces host)

Note
This is usually not required, as all device functions are also compiled for the host by xpu. You only need XPU_H if the function is called from host code inside the device image. This happens typically if:
  • The funcions is called within a xpu::function object.
  • For copy constructors and assignment operators of types that are passed by value to kernels.

◆ XPU_IS_CPU

#define XPU_IS_CPU   XPU_DETAIL_IS_CPU

◆ XPU_IS_CUDA

#define XPU_IS_CUDA   XPU_DETAIL_IS_CUDA

◆ XPU_IS_DEVICE_CODE

#define XPU_IS_DEVICE_CODE   XPU_DETAIL_IS_DEVICE_CODE

Is true if the current compilation target is a device.

◆ XPU_IS_HIP

#define XPU_IS_HIP   XPU_DETAIL_IS_HIP

◆ XPU_IS_HIP_CUDA

#define XPU_IS_HIP_CUDA   (XPU_IS_CUDA || XPU_IS_HIP)

◆ XPU_IS_SYCL

#define XPU_IS_SYCL   XPU_DETAIL_IS_SYCL