CreateBuffer

std::shared_ptr<Buffer> tt::tt_metal::v0::CreateBuffer(const InterleavedBufferConfig &config)

Creates a pre-allocated interleaved DRAM or L1 buffer with the global allocator on device

Return value: std::shared_ptr<Buffer>

Argument

Description

Type

Valid Range

Required

config

Config for the buffer

InterleavedBufferConfig

Yes

std::shared_ptr<Buffer> tt::tt_metal::v0::CreateBuffer(const ShardedBufferConfig &config)

Creates a pre-allocated sharded DRAM or L1 buffer with the global allocator on device

Return value: std::shared_ptr<Buffer>

Argument

Description

Type

Valid Range

Required

config

Config for the buffer

ShardedBufferConfig

Yes

std::shared_ptr<Buffer> tt::tt_metal::v0::CreateBuffer(const InterleavedBufferConfig &config, DeviceAddr address)

Creates a pre-allocated interleaved DRAM or L1 buffer with the global allocator on device

Return value: std::shared_ptr<Buffer>

Argument

Description

Type

Valid Range

Required

config

Config for the buffer

InterleavedBufferConfig

Yes

address

Device address of the buffer

DeviceAddr

No

std::shared_ptr<Buffer> tt::tt_metal::v0::CreateBuffer(const ShardedBufferConfig &config, DeviceAddr address)

Creates a pre-allocated sharded DRAM or L1 buffer with the global allocator on device

Return value: std::shared_ptr<Buffer>

Argument

Description

Type

Valid Range

Required

config

Config for the buffer

ShardedBufferConfig

Yes

address

Device address of the buffer

DeviceAddr

No

std::shared_ptr<Buffer> tt::tt_metal::v0::CreateBuffer(const InterleavedBufferConfig &config, SubDeviceId sub_device_id)

Creates a pre-allocated interleaved DRAM or L1 buffer on device

Return value: std::shared_ptr<Buffer>

Argument

Description

Type

Valid Range

Required

config

Config for the buffer

InterleavedBufferConfig

Yes

sub_device_id

The sub-device id to allocate on

SubDeviceId

No

std::shared_ptr<Buffer> tt::tt_metal::v0::CreateBuffer(const ShardedBufferConfig &config, SubDeviceId sub_device_id)

Creates a pre-allocated sharded DRAM or L1 buffer on device

Return value: std::shared_ptr<Buffer>

Argument

Description

Type

Valid Range

Required

config

Config for the buffer

ShardedBufferConfig

Yes

sub_device_id

The sub-device id to allocate on

No