|
Packit |
345191 |
.\"
|
|
Packit |
345191 |
.\" Copyright (C) 2015 - 2019 Intel Corporation.
|
|
Packit |
345191 |
.\" All rights reserved.
|
|
Packit |
345191 |
.\"
|
|
Packit |
345191 |
.\" Redistribution and use in source and binary forms, with or without
|
|
Packit |
345191 |
.\" modification, are permitted provided that the following conditions are met:
|
|
Packit |
345191 |
.\" 1. Redistributions of source code must retain the above copyright notice(s),
|
|
Packit |
345191 |
.\" this list of conditions and the following disclaimer.
|
|
Packit |
345191 |
.\" 2. Redistributions in binary form must reproduce the above copyright notice(s),
|
|
Packit |
345191 |
.\" this list of conditions and the following disclaimer in the documentation
|
|
Packit |
345191 |
.\" and/or other materials provided with the distribution.
|
|
Packit |
345191 |
.\"
|
|
Packit |
345191 |
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY EXPRESS
|
|
Packit |
345191 |
.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
Packit |
345191 |
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
|
Packit |
345191 |
.\" EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
Packit |
345191 |
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
Packit |
345191 |
.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
Packit |
345191 |
.\" PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
Packit |
345191 |
.\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
|
Packit |
345191 |
.\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
Packit |
345191 |
.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
Packit |
345191 |
.\"
|
|
Packit |
345191 |
.TH "HBWALLOCATOR" 3 "2015-11-02" "Intel Corporation" "HBWALLOCATOR" \" -*- nroff -*-
|
|
Packit |
345191 |
.SH "NAME"
|
|
Packit |
345191 |
hbw::allocator<T> \- The C++ allocator compatible with the C++ standard library allocator concepts
|
|
Packit |
345191 |
.br
|
|
Packit |
345191 |
.BR Note:
|
|
Packit |
345191 |
This is EXPERIMENTAL API. The functionality and the header file itself can be changed (including non-backward compatible changes) or removed.
|
|
Packit |
345191 |
.SH "SYNOPSIS"
|
|
Packit |
345191 |
.nf
|
|
Packit |
345191 |
.B #include <hbw_allocator.h>
|
|
Packit |
345191 |
.sp
|
|
Packit |
345191 |
.B Link with -lmemkind
|
|
Packit |
345191 |
.sp
|
|
Packit |
345191 |
.BI "hbw::allocator();"
|
|
Packit |
345191 |
.br
|
|
Packit |
345191 |
.BI "template <class U>hbw::allocator<T>::allocator(const hbw::allocator<U>&);
|
|
Packit |
345191 |
.br
|
|
Packit |
345191 |
.BI "hbw::allocator<T>::~allocator()'"
|
|
Packit |
345191 |
.br
|
|
Packit |
345191 |
.BI "hbw::allocator<T>::pointer hbw::allocator<T>::address(hbw::allocator<T>::reference " "x" );
|
|
Packit |
345191 |
.br
|
|
Packit |
345191 |
.BI "hbw::allocator<T>::const_pointer hbw::allocator<T>::address(hbw::allocator<T>::const_reference " "x" );
|
|
Packit |
345191 |
.br
|
|
Packit |
345191 |
.BI "hbw::allocator<T>::pointer hbw::allocator<T>::allocate(hbw::allocator<T>::size_type " "n" ", const void * = 0);
|
|
Packit |
345191 |
.br
|
|
Packit |
345191 |
.BI "void hbw::allocator<T>::deallocate(hbw::allocator<T>::pointer " "p" ", hbw::allocator<T>::size_type " "n" );
|
|
Packit |
345191 |
.br
|
|
Packit |
345191 |
.BI "hbw::allocator<T>::size_type hbw::allocator<T>::max_size();
|
|
Packit |
345191 |
.br
|
|
Packit |
345191 |
.BI "void hbw::allocator<T>::construct(hbw::allocator<T>::pointer " "p" ", const hbw::allocator<T>::value_type& " "val" );
|
|
Packit |
345191 |
.br
|
|
Packit |
345191 |
.BI "void hbw::allocator<T>::destroy(hbw::allocator<T>::pointer " "p" );
|
|
Packit |
345191 |
.fi
|
|
Packit |
345191 |
.SH "DESCRIPTION"
|
|
Packit |
345191 |
The
|
|
Packit |
345191 |
.BR hbw::allocator<T>
|
|
Packit |
345191 |
is intended to be used with STL containers to allocate high bandwidth memory. Memory management is based on hbwmalloc (memkind library), enabling users to gain performance in multithreaded applications. Refer
|
|
Packit |
345191 |
.BR hbwmalloc (3)
|
|
Packit |
345191 |
and
|
|
Packit |
345191 |
.BR memkind (3)
|
|
Packit |
345191 |
man page for more details.
|
|
Packit |
345191 |
.PP
|
|
Packit |
345191 |
All public member types and functions corresponds to standard library allocator concepts and definitions. The current implementation supports C++03 standard.
|
|
Packit |
345191 |
.PP
|
|
Packit |
345191 |
Template arguments:
|
|
Packit |
345191 |
.br
|
|
Packit |
345191 |
.I T
|
|
Packit |
345191 |
is an object type aliased by value_type.
|
|
Packit |
345191 |
.br
|
|
Packit |
345191 |
.I U
|
|
Packit |
345191 |
is an object type.
|
|
Packit |
345191 |
.PP
|
|
Packit |
345191 |
.B Note:
|
|
Packit |
345191 |
.br
|
|
Packit |
345191 |
.BI "hbw::allocator<T>::pointer hbw::allocator<T>::allocate(hbw::allocator<T>::size_type " "n" ", const void * = 0)"
|
|
Packit |
345191 |
allocates high bandwidth memory using
|
|
Packit |
345191 |
.BR hbw_malloc ().
|
|
Packit |
345191 |
Throw
|
|
Packit |
345191 |
.I std::bad_alloc
|
|
Packit |
345191 |
when:
|
|
Packit |
345191 |
.br
|
|
Packit |
345191 |
.RS
|
|
Packit |
345191 |
.I n
|
|
Packit |
345191 |
= 0,
|
|
Packit |
345191 |
.RE
|
|
Packit |
345191 |
.br
|
|
Packit |
345191 |
.RS
|
|
Packit |
345191 |
.I n
|
|
Packit |
345191 |
>
|
|
Packit |
345191 |
.BR max_size ()
|
|
Packit |
345191 |
.RE
|
|
Packit |
345191 |
.br
|
|
Packit |
345191 |
.RS
|
|
Packit |
345191 |
or there is not enough memory to satisfy the request.
|
|
Packit |
345191 |
.RE
|
|
Packit |
345191 |
.PP
|
|
Packit |
345191 |
.BI "hbw::allocator<T>::deallocate(hbw::allocator<T>::pointer " "p" ", hbw::allocator<T>::size_type " "n")
|
|
Packit |
345191 |
deallocates memory associated with pointer returned by
|
|
Packit |
345191 |
.BR allocate ()
|
|
Packit |
345191 |
using
|
|
Packit |
345191 |
.BR hbw_free ().
|
|
Packit |
345191 |
|
|
Packit |
345191 |
.SH ERRORS
|
|
Packit |
345191 |
The same as described in
|
|
Packit |
345191 |
.B ERRORS
|
|
Packit |
345191 |
section of
|
|
Packit |
345191 |
.BR hbwmalloc (3)
|
|
Packit |
345191 |
man page.
|
|
Packit |
345191 |
.SH "NOTES"
|
|
Packit |
345191 |
The
|
|
Packit |
345191 |
.BR hbw::allocator<T>
|
|
Packit |
345191 |
behavior depends on hbwmalloc heap management policy. To get and set the policy please use
|
|
Packit |
345191 |
.BR hbw_get_policy ()
|
|
Packit |
345191 |
and
|
|
Packit |
345191 |
.BR hbw_set_policy ()
|
|
Packit |
345191 |
respectively.
|
|
Packit |
345191 |
.SH "COPYRIGHT"
|
|
Packit |
345191 |
Copyright (C) 2015 - 2019 Intel Corporation. All rights reserved.
|
|
Packit |
345191 |
.SH "SEE ALSO"
|
|
Packit |
345191 |
.BR hbwmalloc (3),
|
|
Packit |
345191 |
.BR numa (3),
|
|
Packit |
345191 |
.BR numactl (8),
|
|
Packit |
345191 |
.BR memkind (3)
|