This page contains proposed changes for a future release of ROCm. Read the latest Linux release of ROCm documentation for your production environments.

hipmemallocpitch Interface Reference

hipmemallocpitch Interface Reference#

HIPFORT API Reference: hipfort::hipmemallocpitch Interface Reference
hipfort::hipmemallocpitch Interface Reference

Allocates at least width (in bytes) * height bytes of linear memory Padding may occur to ensure alighnment requirements are met for the given row The change in width size due to padding will be returned in *pitch. More...

Public Member Functions

integer(kind(hipsuccess)) function hipmemallocpitch_ (dptr, pitch, widthInBytes, height, elementSizeBytes)
 

Detailed Description

Allocates at least width (in bytes) * height bytes of linear memory Padding may occur to ensure alighnment requirements are met for the given row The change in width size due to padding will be returned in *pitch.

Currently the alignment is set to 128 bytes

Parameters
[out]dptrPointer to the allocated device memory
[out]pitchPitch for allocation (in bytes)
[in]widthRequested pitched allocation width (in bytes)
[in]heightRequested pitched allocation height

If size is 0, no memory is allocated, ptr returns nullptr, and hipSuccess is returned. The intended usage of pitch is as a separate parameter of the allocation, used to compute addresses within the 2D array. Given the row and column of an array element of type T, the address is computed as: T pElement = (T*)((char*)BaseAddress + Row * Pitch) + Column;

Returns
Error code
See also
hipMalloc, hipFree, hipMallocArray, hipFreeArray, hipHostFree, hipMalloc3D, hipMalloc3DArray, hipHostMalloc

Member Function/Subroutine Documentation

◆ hipmemallocpitch_()

integer(kind(hipsuccess)) function hipfort::hipmemallocpitch::hipmemallocpitch_ ( type(c_ptr)  dptr,
integer(c_size_t)  pitch,
integer(c_size_t), value  widthInBytes,
integer(c_size_t), value  height,
integer(c_int), value  elementSizeBytes 
)

The documentation for this interface was generated from the following file: