Intel® oneAPI DPC++/C++ Compiler Developer Guide and Reference

ID 767253
Date 11/07/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

aligned_offset

Represent an integer based offset whose value is a multiple of an IndexAlignment specified at compile time. #include <sdlt/aligned_offset.h>

Syntax

template<int IndexAlignmentT>
class aligned_offset;

Arguments

int IndexAlignmentT

The index alignment the user is stating that the offset have.

Description

aligned_offset is a deprecated feature.

If we can tell the compiler that we know an offset will be a multiple of known value, then when combined with a loop index inside a SIMD loop, the compiler can use that information to maintain aligned access when accessing underlying data layout.

Internally, the offset value is converted to a block count.

Block Count = offsetValue/IndexAlignmentT;

Indices can then use that aligned block count as needed.

Member

Description

static const int IndexAlignment = IndexAlignmentT;

The alignment the offset is a multiple of

explicit aligned_offset(const int offset)

Construct instance based on offset

static aligned_offset from_block_count(int aligned_block_count);

Returns: Instance based on aligned_block_count, where the offset value = IndexAlignment*aligned_block_count

int aligned_block_count() const;

Returns: number of blocks of IndexAlignment it takes to represent the offset value.

int value() const;

Returns: offset value