MU Library
kernel.hpp File Reference
Include dependency graph for kernel.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mu::KernelInfo
 

Namespaces

 mu
 

Macros

#define MU_NON_BLOCKING_KERNEL_INIT(FUNC)
 Registers a non-blocking kernel function. More...
 
#define _MU_CONCAT(a, b)   a##b
 
#define MU_CONCAT(a, b)   _MU_CONCAT(a, b)
 
#define MU_KERNEL_DEFINE(TARGET, ID)
 Macro for generating kernel wrapper (especially for kernel template) More...
 
#define MU_KERNEL_ADD(FUNC)   MU_KERNEL_DEFINE(FUNC, FUNC)
 Adds a kernel function to the MU runtime. More...
 
#define __pxl_kernel__   [[clang::annotate("mu::offload")]]
 annotation for kernel entry functions, templates More...
 
#define __mu_shared__   [[clang::annotate("mu::share")]]
 annotation for declarations shared across host and mu devices More...
 
#define __mu_device__   [[clang::annotate("mu::device")]]
 annotation for declarations exclusively for mu devices More...
 

Macro Definition Documentation

◆ __mu_device__

#define __mu_device__   [[clang::annotate("mu::device")]]

annotation for declarations exclusively for mu devices

Definition at line 77 of file kernel.hpp.

◆ __mu_shared__

#define __mu_shared__   [[clang::annotate("mu::share")]]

annotation for declarations shared across host and mu devices

Definition at line 70 of file kernel.hpp.

◆ __pxl_kernel__

#define __pxl_kernel__   [[clang::annotate("mu::offload")]]

annotation for kernel entry functions, templates

Definition at line 63 of file kernel.hpp.

◆ _MU_CONCAT

#define _MU_CONCAT (   a,
 
)    a##b

Definition at line 29 of file kernel.hpp.

◆ MU_CONCAT

#define MU_CONCAT (   a,
 
)    _MU_CONCAT(a, b)

Definition at line 32 of file kernel.hpp.

◆ MU_KERNEL_ADD

#define MU_KERNEL_ADD (   FUNC)    MU_KERNEL_DEFINE(FUNC, FUNC)

Adds a kernel function to the MU runtime.

Parameters
FUNCThe function to be registered as a kernel

Definition at line 56 of file kernel.hpp.

◆ MU_KERNEL_DEFINE

#define MU_KERNEL_DEFINE (   TARGET,
  ID 
)
Value:
extern "C" void MU_CONCAT(__mu_kernel_, ID)(unsigned int mode, unsigned int ndarrayValueBit, char* argv) \
{ \
mu::callMain(TARGET, mode, ndarrayValueBit, argv); \
} \
extern "C" [[gnu::used]] const mu::KernelInfo MU_CONCAT(__mu_func_, ID) = { \
#ID, \
MU_CONCAT(__mu_kernel_, ID)};
#define MU_CONCAT(a, b)
Definition: kernel.hpp:32
void callMain(FP func, uint32_t mode, uint32_t ndarrayValueBit, char *buffer)
Definition: call_main.hpp:141

Macro for generating kernel wrapper (especially for kernel template)

Parameters
TARGETfunction name or template instance (ex: sort_with_ptr<int>)
IDunique name for c identifier (ex: _Z4sortIiEvPi)

Definition at line 41 of file kernel.hpp.

◆ MU_NON_BLOCKING_KERNEL_INIT

#define MU_NON_BLOCKING_KERNEL_INIT (   FUNC)
Value:
MU_KERNEL_ADD(FUNC) \
extern "C" [[gnu::used]] const uint64_t __mu_kernel_type__ = 1;
#define MU_KERNEL_ADD(FUNC)
Adds a kernel function to the MU runtime.
Definition: kernel.hpp:56

Registers a non-blocking kernel function.

Parameters
FUNCThe function to be registered as a non-blocking kernel

Definition at line 22 of file kernel.hpp.