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] width Requested pitched allocation width (in bytes) [in] height Requested 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(kind=4), value | elementSizeBytes | ||
) |
The documentation for this interface was generated from the following file: