Skip to main content

class allocation_id

Declaration

class allocation_id { /* full declaration omitted */ };

Description

Uniquely identifies an allocation across all memories on the local node. This is the instruction-graph equivalent of a USM pointer. As allocation_ids are used extensively within the code but its constituents (memory_id and raw_allocation_id) rarely need to be inspected, it is bit-encoded into a single integer member.

Member Variables

static const size_t memory_id_bits = 8
static const size_t max_memory_id = (1 << memory_id_bits) - 1
static const size_t raw_allocation_id_bits = sizeof(unsigned long) * 8 - memory_id_bits
static const size_t max_raw_allocation_id = (unsigned long(1) << raw_allocation_id_bits) - 1
size_t m_mid
size_t m_raid

Member Function Overview

Friend Function Overview

  • operator!=(const allocation_id & lhs, const allocation_id & rhs) → friend constexpr bool
  • operator==(const allocation_id & lhs, const allocation_id & rhs) → friend constexpr bool

Member Functions

constexpr allocation_id()

Description

Constructs an allocation_id that does not point to memory (equivalent to null_allocation_id).


constexpr allocation_id(memory_id mid,
                        raw_allocation_id raid)

Parameters

memory_id mid
raw_allocation_id raid

constexpr memory_id get_memory_id() const


constexpr raw_allocation_id
get_raw_allocation_id() const


Friend Functions

friend constexpr bool operator!=(
    const allocation_id& lhs,
    const allocation_id& rhs)

Parameters

const allocation_id& lhs
const allocation_id& rhs

friend constexpr bool operator==(
    const allocation_id& lhs,
    const allocation_id& rhs)

Parameters

const allocation_id& lhs
const allocation_id& rhs