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]dptr- Pointer to the allocated device memory
[out]pitch- Pitch for allocation (in bytes)
[in]widthInBytes- Requested pitched allocation width (in bytes)
[in]height- Requested pitched allocation height
[in]elementSizeBytes- The size of element bytes, should be 4, 8 or 16

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: