numba_dpex.core.utils.cgutils_extra

Overview

Classes

LLVMTypes

A helper class to get LLVM Values for integer C types.

Function

declare_function(context, builder, name, sig, cargs, mangler)

Insert declaration for a opencl builtin function.

get_llvm_type(context, type)

Returns the LLVM Value corresponding to a Numba type.

get_llvm_ptr_type(type)

Returns an LLVM pointer type for a give LLVM type object.

create_null_ptr(builder, context)

Allocates a new LLVM Value storing a void* and returns the Value to

get_zero(context)

Returns an LLVM Constant storing a 64 bit representation for zero.

get_one(context)

Returns an LLVM Constant storing a 64 bit representation for one.

Classes

class LLVMTypes

A helper class to get LLVM Values for integer C types.

Overview

Members

byte_t
byte_ptr_t
byte_ptr_ptr_t
int32_t
int32_ptr_t
int64_t
int64_ptr_t
void_t

Functions

declare_function(context, builder, name, sig, cargs, mangler=mangle_c)

Insert declaration for a opencl builtin function. Uses the Itanium mangler.

Parameters:
  • context (target context)

  • builder (llvm builder)

  • name (str) – symbol name

  • sig (signature) – function signature of the symbol being declared

  • cargs (sequence of str) – C type names for the arguments

  • mangler (a mangler function) – function to use to mangle the symbol

get_llvm_type(context, type)

Returns the LLVM Value corresponding to a Numba type.

Parameters:
  • context – The LLVM context or the execution state of the current IR

  • generator.

  • type – A Numba type object.

Returns: An Python object wrapping an LLVM Value corresponding to the

specified Numba type.

get_llvm_ptr_type(type)

Returns an LLVM pointer type for a give LLVM type object.

Parameters:

type – An LLVM type for which we need the corresponding pointer type.

Returns: An LLVM pointer type object corresponding to the input LLVM type.

create_null_ptr(builder, context)

Allocates a new LLVM Value storing a void* and returns the Value to caller.

Parameters:
  • builder – The LLVM IR builder to be used for code generation.

  • context – The LLVM IR builder context.

Returns: An LLVM value storing a null pointer

get_zero(context)

Returns an LLVM Constant storing a 64 bit representation for zero.

Parameters:

context – The LLVM IR builder context.

Returns: An LLVM Constant Value storing zero.

get_one(context)

Returns an LLVM Constant storing a 64 bit representation for one.

Parameters:

context – The LLVM IR builder context.

Returns: An LLVM Constant Value storing one.